PageSourceSearch

https://nextjs-topshot-account-linking.vercel.app/_next/static/chunks/953-9e10827edd54dc4f.js

js nextjs-topshot-account-linking.vercel.app collected 2026-10-03 07:23:24 UTC 771,496 bytes, 182 lines download raw bytes

vendor: 11,588 bytes, line 1
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[953],{6526:function(e,t,r){!function(e,t){"use strict";function i(e,t){if(!e)throw Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function s(e,t,r){if(s.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&(("le"===t||"be"===t)&&(r=t,t=10),this._init(e||0,t||10,r||"be"))}"object"==typeof e?e.exports=s:t.BN=s,s.BN=s,s.wordSize=26;try{h="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(1848).Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void i(!1,"Invalid character in "+e)}function a(e,t,r){var i=o(e,r);return r-1>=t&&(i|=o(e,r-1)<<4),i}function u(e,t,r,n){for(var s=0,o=0,a=Math.min(e.length,r),u=t;u<a;u++){var f=e.charCodeAt(u)-48;s*=n,o=f>=49?f-49+10:f>=17?f-17+10:f,i(f>=0&&o<n,"Invalid character"),s+=o}return s}function f(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return 0>e.cmp(t)?e:t},s.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,r):(this._parseBase(e,t,n),"le"===r&&this._initArray(this.toArray(),t,r)))},s.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<0x4000000?(this.words=[0x3ffffff&e],this.length=1):e<0x10000000000000?(this.words=[0x3ffffff&e,e/0x4000000&0x3ffffff],this.length=2):(i(e<0x20000000000000),this.words=[0x3ffffff&e,e/0x4000000&0x3ffffff,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},s.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=Array(this.length);for(var n,s,o=0;o<this.length;o++)this.words[o]=0;var a=0;if("be"===r)for(o=e.length-1,n=0;o>=0;o-=3)s=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[n]|=s<<a&0x3ffffff,this.words[n+1]=s>>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,n++);else if("le"===r)for(o=0,n=0;o<e.length;o+=3)s=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[n]|=s<<a&0x3ffffff,this.words[n+1]=s>>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,n++);return this._strip()},s.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var i,n=0;n<this.length;n++)this.words[n]=0;var s=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=a(e,t,n)<<s,this.words[o]|=0x3ffffff&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=a(e,t,n)<<s,this.words[o]|=0x3ffffff&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;this._strip()},s.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=0x3ffffff;n*=t)i++;i--,n=n/t|0;for(var s=e.length-r,o=s%i,a=Math.min(s,s-o)+r,f=0,c=r;c<a;c+=i)f=u(e,c,c+i,t),this.imuln(n),this.words[0]+f<0x4000000?this.words[0]+=f:this._iaddn(f);if(0!==o){var h=1;for(f=u(e,c,e.length,t),c=0;c<o;c++)h*=t;this.imuln(h),this.words[0]+f<0x4000000?this.words[0]+=f:this._iaddn(f)}this._strip()},s.prototype.copy=function(e){e.words=Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},s.prototype._move=function(e){f(e,this)},s.prototype.clone=function(){var e=new s(null);return this.copy(e),e},s.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(e){s.prototype.inspect=c}else s.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h,l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[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],p=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];function g(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],s=0|t.words[0],o=n*s,a=0x3ffffff&o,u=o/0x4000000|0;r.words[0]=a;for(var f=1;f<i;f++){for(var c=u>>>26,h=0x3ffffff&u,l=Math.min(f,t.length-1),d=Math.max(0,f-e.length+1);d<=l;d++){var p=f-d|0;c+=(o=(n=0|e.words[p])*(s=0|t.words[d])+h)/0x4000000|0,h=0x3ffffff&o}r.words[f]=0|h,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r._strip()}s.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var r,n=0,s=0,o=0;o<this.length;o++){var a=this.words[o],u=((a<<n|s)&0xffffff).toString(16);s=a>>>24-n&0xffffff,(n+=2)>=26&&(n-=26,o--),r=0!==s||o!==this.length-1?l[6-u.length]+u+r:u+r}for(0!==s&&(r=s.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var f=d[e],c=p[e];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var g=h.modrn(c).toString(e);r=(h=h.idivn(c)).isZero()?g+r:l[f-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?e+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16,2)},h&&(s.prototype.toBuffer=function(e,t){return this.toArrayLike(h,e,t)}),s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0");var o=e.allocUnsafe?e.allocUnsafe(s):new e(s);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,n),o},s.prototype._toArrayLikeLE=function(e,t){for(var r=0,i=0,n=0,s=0;n<this.length;n++){var o=this.words[n]<<s|i;e[r++]=255&o,r<e.length&&(e[r++]=o>>8&255),r<e.length&&(e[r++]=o>>16&255),6===s?(r<e.length&&(e[r++]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r<e.length)for(e[r++]=i;r<e.length;)e[r++]=0},s.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,i=0,n=0,s=0;n<this.length;n++){var o=this.words[n]<<s|i;e[r--]=255&o,r>=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===s?(r>=0&&(e[r--]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r>=0)for(e[r--]=i;r>=0;)e[r--]=0},Math.clz32?s.prototype._countBits=function(e){return 32-Math.clz32(e)}:s.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return(8191&t)==0&&(r+=13,t>>>=13),(127&t)==0&&(r+=7,t>>>=7),(15&t)==0&&(r+=4,t>>>=4),(3&t)==0&&(r+=2,t>>>=2),(1&t)==0&&r++,r},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},s.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},s.prototype.ior=function(e){return i((this.negative|e.negative)==0),this.iuor(e)},s.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},s.prototype.iand=function(e){return i((this.negative|e.negative)==0),this.iuand(e)},s.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){this.length>e.length?(t=this,r=e):(t=e,r=this);for(var t,r,i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this._strip()},s.prototype.ixor=function(e){return i((this.negative|e.negative)==0),this.iuxor(e)},s.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=0x3ffffff&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-r),this._strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),t?this.words[r]=this.words[r]|1<<n:this.words[r]=this.words[r]&~(1<<n),this._strip()},s.prototype.iadd=function(e){if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var t,r,i,n=0,s=0;s<i.length;s++)t=(0|r.words[s])+(0|i.words[s])+n,this.words[s]=0x3ffffff&t,n=t>>>26;for(;0!==n&&s<r.length;s++)t=(0|r.words[s])+n,this.words[s]=0x3ffffff&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},s.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;
vendor: 8,237 bytes, line 1
1var t,r,i=this.iadd(e);return e.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(t=this,r=e):(t=e,r=this);for(var s=0,o=0;o<r.length;o++)s=(i=(0|t.words[o])-(0|r.words[o])+s)>>26,this.words[o]=0x3ffffff&i;for(;0!==s&&o<t.length;o++)s=(i=(0|t.words[o])+s)>>26,this.words[o]=0x3ffffff&i;if(0===s&&o<t.length&&t!==this)for(;o<t.length;o++)this.words[o]=t.words[o];return this.length=Math.max(this.length,o),t!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var i,n,s,o=e.words,a=t.words,u=r.words,f=0,c=0|o[0],h=8191&c,l=c>>>13,d=0|o[1],p=8191&d,g=d>>>13,m=0|o[2],b=8191&m,y=m>>>13,v=0|o[3],w=8191&v,_=v>>>13,E=0|o[4],x=8191&E,S=E>>>13,M=0|o[5],I=8191&M,A=M>>>13,R=0|o[6],D=8191&R,O=R>>>13,P=0|o[7],N=8191&P,T=P>>>13,k=0|o[8],C=8191&k,L=k>>>13,U=0|o[9],j=8191&U,B=U>>>13,q=0|a[0],z=8191&q,F=q>>>13,$=0|a[1],H=8191&$,K=$>>>13,V=0|a[2],G=8191&V,W=V>>>13,J=0|a[3],X=8191&J,Y=J>>>13,Z=0|a[4],Q=8191&Z,ee=Z>>>13,et=0|a[5],er=8191&et,ei=et>>>13,en=0|a[6],es=8191&en,eo=en>>>13,ea=0|a[7],eu=8191&ea,ef=ea>>>13,ec=0|a[8],eh=8191&ec,el=ec>>>13,ed=0|a[9],ep=8191&ed,eg=ed>>>13;r.negative=e.negative^t.negative,r.length=19;var em=(f+(i=Math.imul(h,z))|0)+((8191&(n=(n=Math.imul(h,F))+Math.imul(l,z)|0))<<13)|0;f=((s=Math.imul(l,F))+(n>>>13)|0)+(em>>>26)|0,em&=0x3ffffff,i=Math.imul(p,z),n=(n=Math.imul(p,F))+Math.imul(g,z)|0,s=Math.imul(g,F);var eb=(f+(i=i+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,K)|0)+Math.imul(l,H)|0))<<13)|0;f=((s=s+Math.imul(l,K)|0)+(n>>>13)|0)+(eb>>>26)|0,eb&=0x3ffffff,i=Math.imul(b,z),n=(n=Math.imul(b,F))+Math.imul(y,z)|0,s=Math.imul(y,F),i=i+Math.imul(p,H)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(g,H)|0,s=s+Math.imul(g,K)|0;var ey=(f+(i=i+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,W)|0)+Math.imul(l,G)|0))<<13)|0;f=((s=s+Math.imul(l,W)|0)+(n>>>13)|0)+(ey>>>26)|0,ey&=0x3ffffff,i=Math.imul(w,z),n=(n=Math.imul(w,F))+Math.imul(_,z)|0,s=Math.imul(_,F),i=i+Math.imul(b,H)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(y,H)|0,s=s+Math.imul(y,K)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(g,G)|0,s=s+Math.imul(g,W)|0;var ev=(f+(i=i+Math.imul(h,X)|0)|0)+((8191&(n=(n=n+Math.imul(h,Y)|0)+Math.imul(l,X)|0))<<13)|0;f=((s=s+Math.imul(l,Y)|0)+(n>>>13)|0)+(ev>>>26)|0,ev&=0x3ffffff,i=Math.imul(x,z),n=(n=Math.imul(x,F))+Math.imul(S,z)|0,s=Math.imul(S,F),i=i+Math.imul(w,H)|0,n=(n=n+Math.imul(w,K)|0)+Math.imul(_,H)|0,s=s+Math.imul(_,K)|0,i=i+Math.imul(b,G)|0,n=(n=n+Math.imul(b,W)|0)+Math.imul(y,G)|0,s=s+Math.imul(y,W)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,X)|0,s=s+Math.imul(g,Y)|0;var ew=(f+(i=i+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,ee)|0)+Math.imul(l,Q)|0))<<13)|0;f=((s=s+Math.imul(l,ee)|0)+(n>>>13)|0)+(ew>>>26)|0,ew&=0x3ffffff,i=Math.imul(I,z),n=(n=Math.imul(I,F))+Math.imul(A,z)|0,s=Math.imul(A,F),i=i+Math.imul(x,H)|0,n=(n=n+Math.imul(x,K)|0)+Math.imul(S,H)|0,s=s+Math.imul(S,K)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,G)|0,s=s+Math.imul(_,W)|0,i=i+Math.imul(b,X)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(y,X)|0,s=s+Math.imul(y,Y)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(g,Q)|0,s=s+Math.imul(g,ee)|0;var e_=(f+(i=i+Math.imul(h,er)|0)|0)+((8191&(n=(n=n+Math.imul(h,ei)|0)+Math.imul(l,er)|0))<<13)|0;f=((s=s+Math.imul(l,ei)|0)+(n>>>13)|0)+(e_>>>26)|0,e_&=0x3ffffff,i=Math.imul(D,z),n=(n=Math.imul(D,F))+Math.imul(O,z)|0,s=Math.imul(O,F),i=i+Math.imul(I,H)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(A,H)|0,s=s+Math.imul(A,K)|0,i=i+Math.imul(x,G)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(S,G)|0,s=s+Math.imul(S,W)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,X)|0,s=s+Math.imul(_,Y)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(y,Q)|0,s=s+Math.imul(y,ee)|0,i=i+Math.imul(p,er)|0,n=(n=n+Math.imul(p,ei)|0)+Math.imul(g,er)|0,s=s+Math.imul(g,ei)|0;var eE=(f+(i=i+Math.imul(h,es)|0)|0)+((8191&(n=(n=n+Math.imul(h,eo)|0)+Math.imul(l,es)|0))<<13)|0;f=((s=s+Math.imul(l,eo)|0)+(n>>>13)|0)+(eE>>>26)|0,eE&=0x3ffffff,i=Math.imul(N,z),n=(n=Math.imul(N,F))+Math.imul(T,z)|0,s=Math.imul(T,F),i=i+Math.imul(D,H)|0,n=(n=n+Math.imul(D,K)|0)+Math.imul(O,H)|0,s=s+Math.imul(O,K)|0,i=i+Math.imul(I,G)|0,n=(n=n+Math.imul(I,W)|0)+Math.imul(A,G)|0,s=s+Math.imul(A,W)|0,i=i+Math.imul(x,X)|0,n=(n=n+Math.imul(x,Y)|0)+Math.imul(S,X)|0,s=s+Math.imul(S,Y)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,ee)|0,i=i+Math.imul(b,er)|0,n=(n=n+Math.imul(b,ei)|0)+Math.imul(y,er)|0,s=s+Math.imul(y,ei)|0,i=i+Math.imul(p,es)|0,n=(n=n+Math.imul(p,eo)|0)+Math.imul(g,es)|0,s=s+Math.imul(g,eo)|0;var ex=(f+(i=i+Math.imul(h,eu)|0)|0)+((8191&(n=(n=n+Math.imul(h,ef)|0)+Math.imul(l,eu)|0))<<13)|0;f=((s=s+Math.imul(l,ef)|0)+(n>>>13)|0)+(ex>>>26)|0,ex&=0x3ffffff,i=Math.imul(C,z),n=(n=Math.imul(C,F))+Math.imul(L,z)|0,s=Math.imul(L,F),i=i+Math.imul(N,H)|0,n=(n=n+Math.imul(N,K)|0)+Math.imul(T,H)|0,s=s+Math.imul(T,K)|0,i=i+Math.imul(D,G)|0,n=(n=n+Math.imul(D,W)|0)+Math.imul(O,G)|0,s=s+Math.imul(O,W)|0,i=i+Math.imul(I,X)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(A,X)|0,s=s+Math.imul(A,Y)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,ee)|0,i=i+Math.imul(w,er)|0,n=(n=n+Math.imul(w,ei)|0)+Math.imul(_,er)|0,s=s+Math.imul(_,ei)|0,i=i+Math.imul(b,es)|0,n=(n=n+Math.imul(b,eo)|0)+Math.imul(y,es)|0,s=s+Math.imul(y,eo)|0,i=i+Math.imul(p,eu)|0,n=(n=n+Math.imul(p,ef)|0)+Math.imul(g,eu)|0,s=s+Math.imul(g,ef)|0;var eS=(f+(i=i+Math.imul(h,eh)|0)|0)+((8191&(n=(n=n+Math.imul(h,el)|0)+Math.imul(l,eh)|0))<<13)|0;f=((s=s+Math.imul(l,el)|0)+(n>>>13)|0)+(eS>>>26)|0,eS&=0x3ffffff,i=Math.imul(j,z),n=(n=Math.imul(j,F))+Math.imul(B,z)|0,s=Math.imul(B,F),i=i+Math.imul(C,H)|0,n=(n=n+Math.imul(C,K)|0)+Math.imul(L,H)|0,s=s+Math.imul(L,K)|0,i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(T,G)|0,s=s+Math.imul(T,W)|0,i=i+Math.imul(D,X)|0,n=(n=n+Math.imul(D,Y)|0)+Math.imul(O,X)|0,s=s+Math.imul(O,Y)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(A,Q)|0,s=s+Math.imul(A,ee)|0,i=i+Math.imul(x,er)|0,n=(n=n+Math.imul(x,ei)|0)+Math.imul(S,er)|0,s=s+Math.imul(S,ei)|0,i=i+Math.imul(w,es)|0,n=(n=n+Math.imul(w,eo)|0)+Math.imul(_,es)|0,s=s+Math.imul(_,eo)|0,i=i+Math.imul(b,eu)|0,n=(n=n+Math.imul(b,ef)|0)+Math.imul(y,eu)|0,s=s+Math.imul(y,ef)|0,i=i+Math.imul(p,eh)|0,n=(n=n+Math.imul(p,el)|0)+Math.imul(g,eh)|0,s=s+Math.imul(g,el)|0;var eM=(f+(i=i+Math.imul(h,ep)|0)|0)+((8191&(n=(n=n+Math.imul(h,eg)|0)+Math.imul(l,ep)|0))<<13)|0;f=((s=s+Math.imul(l,eg)|0)+(n>>>13)|0)+(eM>>>26)|0,eM&=0x3ffffff,i=Math.imul(j,H),n=(n=Math.imul(j,K))+Math.imul(B,H)|0,s=Math.imul(B,K),i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,W)|0)+Math.imul(L,G)|0,s=s+Math.imul(L,W)|0,i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(T,X)|0,s=s+Math.imul(T,Y)|0,i=i+Math.imul(D,Q)|0,n=(n=n+Math.imul(D,ee)|0)+Math.imul(O,Q)|0,s=s+Math.imul(O,ee)|0,i=i+Math.imul(I,er)|0,n=(n=n+Math.imul(I,ei)|0)+Math.imul(A,er)|0,s=s+Math.imul(A,ei)|0,i=i+Math.imul(x,es)|0,n=(n=n+Math.imul(x,eo)|0)+Math.imul(S,es)|0,s=s+Math.imul(S,eo)|0,i=i+Math.imul(w,eu)|0,n=(n=n+Math.imul(w,ef)|0)+Math.imul(_,eu)|0,s=s+Math.imul(_,ef)|0,i=i+Math.imul(b,eh)|0,n=(n=n+Math.imul(b,el)|0)+Math.imul(y,eh)|0,s=s+Math.imul(y,el)|0;var eI=(f+(i=i+Math.imul(p,ep)|0)|0)+((8191&(n=(n=n+Math.imul(p,eg)|0)+Math.imul(g,ep)|0))<<13)|0;f=((s=s+Math.imul(g,eg)|0)+(n>>>13)|0)+(eI>>>26)|0,eI&=0x3ffffff,i=Math.imul(j,G),n=(n=Math.imul(j,W))+Math.imul(B,G)|0,s=Math.imul(B,W),i=i+Math.imul(C,X)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(L,X)|0,s=s+Math.imul(L,Y)|0,i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,ee)|0,i=i+Math.imul(D,er)|0,n=(n=n+Math.imul(D,ei)|0)+Math.imul(O,er)|0,s=s+Math.imul(O,ei)|0,i=i+Math.imul(I,es)|0,n=(n=n+Math.imul(I,eo)|0)+Math.imul(A,es)|0,s=s+Math.imul(A,eo)|0,i=i+Math.imul(x,eu)|0,n=(n=n+Math.imul(x,ef)|0)+Math.imul(S,eu)|0,s=s+Math.imul(S,ef)|0,i=i+Math.imul(w,eh)|0,n=(n=n+Math.imul(w,el)|0)+Math.imul(_,eh)|0,s=s+Math.imul(_,el)|0;var eA=(f+(i=i+Math.imul(b,ep)|0)|0)+((8191&(n=(n=n+Math.imul(b,eg)|0)+Math.imul(y,ep)|0))<<13)|0;f=((s=s+Math.imul(y,eg)|0)+(n>>>13)|0)+(eA>>>
vendor: 6,502 bytes, line 1
126)|0,eA&=0x3ffffff,i=Math.imul(j,X),n=(n=Math.imul(j,Y))+Math.imul(B,X)|0,s=Math.imul(B,Y),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(L,Q)|0,s=s+Math.imul(L,ee)|0,i=i+Math.imul(N,er)|0,n=(n=n+Math.imul(N,ei)|0)+Math.imul(T,er)|0,s=s+Math.imul(T,ei)|0,i=i+Math.imul(D,es)|0,n=(n=n+Math.imul(D,eo)|0)+Math.imul(O,es)|0,s=s+Math.imul(O,eo)|0,i=i+Math.imul(I,eu)|0,n=(n=n+Math.imul(I,ef)|0)+Math.imul(A,eu)|0,s=s+Math.imul(A,ef)|0,i=i+Math.imul(x,eh)|0,n=(n=n+Math.imul(x,el)|0)+Math.imul(S,eh)|0,s=s+Math.imul(S,el)|0;var eR=(f+(i=i+Math.imul(w,ep)|0)|0)+((8191&(n=(n=n+Math.imul(w,eg)|0)+Math.imul(_,ep)|0))<<13)|0;f=((s=s+Math.imul(_,eg)|0)+(n>>>13)|0)+(eR>>>26)|0,eR&=0x3ffffff,i=Math.imul(j,Q),n=(n=Math.imul(j,ee))+Math.imul(B,Q)|0,s=Math.imul(B,ee),i=i+Math.imul(C,er)|0,n=(n=n+Math.imul(C,ei)|0)+Math.imul(L,er)|0,s=s+Math.imul(L,ei)|0,i=i+Math.imul(N,es)|0,n=(n=n+Math.imul(N,eo)|0)+Math.imul(T,es)|0,s=s+Math.imul(T,eo)|0,i=i+Math.imul(D,eu)|0,n=(n=n+Math.imul(D,ef)|0)+Math.imul(O,eu)|0,s=s+Math.imul(O,ef)|0,i=i+Math.imul(I,eh)|0,n=(n=n+Math.imul(I,el)|0)+Math.imul(A,eh)|0,s=s+Math.imul(A,el)|0;var eD=(f+(i=i+Math.imul(x,ep)|0)|0)+((8191&(n=(n=n+Math.imul(x,eg)|0)+Math.imul(S,ep)|0))<<13)|0;f=((s=s+Math.imul(S,eg)|0)+(n>>>13)|0)+(eD>>>26)|0,eD&=0x3ffffff,i=Math.imul(j,er),n=(n=Math.imul(j,ei))+Math.imul(B,er)|0,s=Math.imul(B,ei),i=i+Math.imul(C,es)|0,n=(n=n+Math.imul(C,eo)|0)+Math.imul(L,es)|0,s=s+Math.imul(L,eo)|0,i=i+Math.imul(N,eu)|0,n=(n=n+Math.imul(N,ef)|0)+Math.imul(T,eu)|0,s=s+Math.imul(T,ef)|0,i=i+Math.imul(D,eh)|0,n=(n=n+Math.imul(D,el)|0)+Math.imul(O,eh)|0,s=s+Math.imul(O,el)|0;var eO=(f+(i=i+Math.imul(I,ep)|0)|0)+((8191&(n=(n=n+Math.imul(I,eg)|0)+Math.imul(A,ep)|0))<<13)|0;f=((s=s+Math.imul(A,eg)|0)+(n>>>13)|0)+(eO>>>26)|0,eO&=0x3ffffff,i=Math.imul(j,es),n=(n=Math.imul(j,eo))+Math.imul(B,es)|0,s=Math.imul(B,eo),i=i+Math.imul(C,eu)|0,n=(n=n+Math.imul(C,ef)|0)+Math.imul(L,eu)|0,s=s+Math.imul(L,ef)|0,i=i+Math.imul(N,eh)|0,n=(n=n+Math.imul(N,el)|0)+Math.imul(T,eh)|0,s=s+Math.imul(T,el)|0;var eP=(f+(i=i+Math.imul(D,ep)|0)|0)+((8191&(n=(n=n+Math.imul(D,eg)|0)+Math.imul(O,ep)|0))<<13)|0;f=((s=s+Math.imul(O,eg)|0)+(n>>>13)|0)+(eP>>>26)|0,eP&=0x3ffffff,i=Math.imul(j,eu),n=(n=Math.imul(j,ef))+Math.imul(B,eu)|0,s=Math.imul(B,ef),i=i+Math.imul(C,eh)|0,n=(n=n+Math.imul(C,el)|0)+Math.imul(L,eh)|0,s=s+Math.imul(L,el)|0;var eN=(f+(i=i+Math.imul(N,ep)|0)|0)+((8191&(n=(n=n+Math.imul(N,eg)|0)+Math.imul(T,ep)|0))<<13)|0;f=((s=s+Math.imul(T,eg)|0)+(n>>>13)|0)+(eN>>>26)|0,eN&=0x3ffffff,i=Math.imul(j,eh),n=(n=Math.imul(j,el))+Math.imul(B,eh)|0,s=Math.imul(B,el);var eT=(f+(i=i+Math.imul(C,ep)|0)|0)+((8191&(n=(n=n+Math.imul(C,eg)|0)+Math.imul(L,ep)|0))<<13)|0;f=((s=s+Math.imul(L,eg)|0)+(n>>>13)|0)+(eT>>>26)|0,eT&=0x3ffffff;var ek=(f+(i=Math.imul(j,ep))|0)+((8191&(n=(n=Math.imul(j,eg))+Math.imul(B,ep)|0))<<13)|0;return f=((s=Math.imul(B,eg))+(n>>>13)|0)+(ek>>>26)|0,ek&=0x3ffffff,u[0]=em,u[1]=eb,u[2]=ey,u[3]=ev,u[4]=ew,u[5]=e_,u[6]=eE,u[7]=ex,u[8]=eS,u[9]=eM,u[10]=eI,u[11]=eA,u[12]=eR,u[13]=eD,u[14]=eO,u[15]=eP,u[16]=eN,u[17]=eT,u[18]=ek,0!==f&&(u[19]=f,r.length++),r};function b(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,s=0;s<r.length-1;s++){var o=n;n=0;for(var a=0x3ffffff&i,u=Math.min(s,t.length-1),f=Math.max(0,s-e.length+1);f<=u;f++){var c=s-f,h=(0|e.words[c])*(0|t.words[f]),l=0x3ffffff&h;o=o+(h/0x4000000|0)|0,a=0x3ffffff&(l=l+a|0),n+=(o=o+(l>>>26)|0)>>>26,o&=0x3ffffff}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r._strip()}function y(e,t){this.x=e,this.y=t}Math.imul||(m=g),s.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):i<63?g(this,e,t):b(this,e,t)},y.prototype.makeRBT=function(e){for(var t=Array(e),r=s.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},y.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},y.prototype.permute=function(e,t,r,i,n,s){for(var o=0;o<s;o++)i[o]=t[e[o]],n[o]=r[e[o]]},y.prototype.transform=function(e,t,r,i,n,s){this.permute(s,e,t,r,i,n);for(var o=1;o<n;o<<=1)for(var a=o<<1,u=Math.cos(2*Math.PI/a),f=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var h=u,l=f,d=0;d<o;d++){var p=r[c+d],g=i[c+d],m=r[c+d+o],b=i[c+d+o],y=h*m-l*b;b=h*b+l*m,m=y,r[c+d]=p+m,i[c+d]=g+b,r[c+d+o]=p-m,i[c+d+o]=g-b,d!==a&&(y=u*h-f*l,l=u*l+f*h,h=y)}},y.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},y.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},y.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=0x3ffffff&n,r=n<0x4000000?0:n/0x4000000|0}return e},y.prototype.convert13b=function(e,t,r,n){for(var s=0,o=0;o<t;o++)s+=0|e[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*t;o<n;++o)r[o]=0;i(0===s),i((-8192&s)==0)},y.prototype.stub=function(e){for(var t=Array(e),r=0;r<e;r++)t[r]=0;return t},y.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),s=this.stub(i),o=Array(i),a=Array(i),u=Array(i),f=Array(i),c=Array(i),h=Array(i),l=r.words;l.length=i,this.convert13b(e.words,e.length,o,i),this.convert13b(t.words,t.length,f,i),this.transform(o,s,a,u,i,n),this.transform(f,s,c,h,i,n);for(var d=0;d<i;d++){var p=a[d]*c[d]-u[d]*h[d];u[d]=a[d]*h[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,l,s,i,n),this.conjugate(l,s,i),this.normalize13b(l,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},s.prototype.mul=function(e){var t=new s(null);return t.words=Array(this.length+e.length),this.mulTo(e,t)},s.prototype.mulf=function(e){var t=new s(null);return t.words=Array(this.length+e.length),b(this,e,t)},s.prototype.imul=function(e){return this.clone().mulTo(e,this)},s.prototype.imuln=function(e){var t=e<0;t&&(e=-e),i("number"==typeof e),i(e<0x4000000);for(var r=0,n=0;n<this.length;n++){var s=(0|this.words[n])*e,o=(0x3ffffff&s)+(0x3ffffff&r);r>>=26,r+=(s/0x4000000|0)+(o>>>26),this.words[n]=0x3ffffff&o}return 0!==r&&(this.words[n]=r,this.length++),t?this.ineg():this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),r
vendor: 29,352 bytes, line 1
1=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=e.words[i]>>>n&1}return t}(e);if(0===t.length)return new s(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},s.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,s=0x3ffffff>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var a=this.words[t]&s,u=(0|this.words[t])-a<<r;this.words[t]=u|o,o=a>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this._strip()},s.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},s.prototype.iushrn=function(e,t,r){i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var n,s=e%26,o=Math.min((e-s)/26,this.length),a=0x3ffffff^0x3ffffff>>>s<<s;if(n-=o,n=Math.max(0,n),r){for(var u=0;u<o;u++)r.words[u]=this.words[u];r.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var f=0;for(u=this.length-1;u>=0&&(0!==f||u>=n);u--){var c=0|this.words[u];this.words[u]=f<<26-s|c>>>s,f=c&a}return r&&0!==f&&(r.words[r.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;return!(this.length<=r)&&!!(this.words[r]&1<<t)},s.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;return(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)?this:(0!==t&&r++,this.length=Math.min(r,this.length),0!==t&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>t<<t),this._strip())},s.prototype.maskn=function(e){return this.clone().imaskn(e)},s.prototype.iaddn=function(e){return(i("number"==typeof e),i(e<0x4000000),e<0)?this.isubn(-e):0!==this.negative?(1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(e),this.negative=1),this):this._iaddn(e)},s.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=0x4000000;t++)this.words[t]-=0x4000000,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(i("number"==typeof e),i(e<0x4000000),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=0x4000000,this.words[t+1]-=1;return this._strip()},s.prototype.addn=function(e){return this.clone().iaddn(e)},s.prototype.subn=function(e){return this.clone().isubn(e)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(e,t,r){var n,s,o=e.length+r;this._expand(o);var a=0;for(n=0;n<e.length;n++){s=(0|this.words[n+r])+a;var u=(0|e.words[n])*t;s-=0x3ffffff&u,a=(s>>26)-(u/0x4000000|0),this.words[n+r]=0x3ffffff&s}for(;n<this.length-r;n++)a=(s=(0|this.words[n+r])+a)>>26,this.words[n+r]=0x3ffffff&s;if(0===a)return this._strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(s=-(0|this.words[n])+a)>>26,this.words[n]=0x3ffffff&s;return this.negative=1,this._strip()},s.prototype._wordDiv=function(e,t){var r,i=this.length-e.length,n=this.clone(),o=e,a=0|o.words[o.length-1];0!=(i=26-this._countBits(a))&&(o=o.ushln(i),n.iushln(i),a=0|o.words[o.length-1]);var u=n.length-o.length;if("mod"!==t){(r=new s(null)).length=u+1,r.words=Array(r.length);for(var f=0;f<r.length;f++)r.words[f]=0}var c=n.clone()._ishlnsubmul(o,1,u);0===c.negative&&(n=c,r&&(r.words[u]=1));for(var h=u-1;h>=0;h--){var l=(0|n.words[o.length+h])*0x4000000+(0|n.words[o.length+h-1]);for(l=Math.min(l/a|0,0x3ffffff),n._ishlnsubmul(o,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);r&&(r.words[h]=l)}return r&&r._strip(),n._strip(),"div"!==t&&0!==i&&n.iushrn(i),{div:r||null,mod:n}},s.prototype.divmod=function(e,t,r){var n,o,a;return(i(!e.isZero()),this.isZero())?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):(this.negative&e.negative)!=0?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||0>this.cmp(e)?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modrn(e.words[0]))}:this._wordDiv(e,t)},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modrn=function(e){var t=e<0;t&&(e=-e),i(e<=0x3ffffff);for(var r=0x4000000%e,n=0,s=this.length-1;s>=0;s--)n=(r*n+(0|this.words[s]))%e;return t?-n:n},s.prototype.modn=function(e){return this.modrn(e)},s.prototype.idivn=function(e){var t=e<0;t&&(e=-e),i(e<=0x3ffffff);for(var r=0,n=this.length-1;n>=0;n--){var s=(0|this.words[n])+0x4000000*r;this.words[n]=s/e|0,r=s%e}return this._strip(),t?this.ineg():this},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new s(1),o=new s(0),a=new s(0),u=new s(1),f=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++f;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var l=0,d=1;(t.words[0]&d)==0&&l<26;++l,d<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(c),o.isub(h)),n.iushrn(1),o.iushrn(1);for(var p=0,g=1;(r.words[0]&g)==0&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(a),o.isub(u)):(r.isub(t),a.isub(n),u.isub(o))}return{a:a,b:u,gcd:r.iushln(f)}},s.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t,r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var o=new s(1),a=new s(0),u=n.clone();r.cmpn(1)>0&&n.cmpn(1)>0;){for(var f=0,c=1;(r.words[0]&c)==0&&f<26;++f,c<<=1);if(f>0)for(r.iushrn(f);f-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var h=0,l=1;(n.words[0]&l)==0&&h<26;++h,l<<=1);if(h>0)for(n.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);r.cmp(n)>=0?(r.isub(n),o.isub(a)):(n.isub(r),a.isub(o))}return 0>(t=0===r.cmpn(1)?o:a).cmpn(0)&&t.iadd(e),t},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var s=t;t=r,r=s}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return(1&this.words[0])==0},s.prototype.isOdd=function(){return(1&this.words[0])==1},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var s=n,o=r;0!==s&&o<this.length;o++){var a=0|this.words[o];a+=s,s=a>>>26,a&=0x3ffffff,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return -1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=0x3ffffff,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},s.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return -1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},s.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return -1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return -1===this.cmpn(e)},s.prototype.lt=function(e){return -1===this.cmp(e)},s.prototype.lten=function(e){return 0>=this.cmpn(e)},s.prototype.lte=function(e){return 0>=this.cmp(e)},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new M(e)},s.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(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)}w.prototype._tmp=function(){var e=new s(null);return e.words=Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},n(_,w),_.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9){e.words[0]=0,e.length=1;return}var n=e.words[9];for(i=10,t.words[t.length++]=4194303&n;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(4194303&s)<<4|n>>>22,n=s}n>>>=22,e.words[i-10]=n,0===n&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=0x3ffffff&t,t=64*i+(t/0x4000000|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(E,w),n(x,w),n(S,w),S.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=(0|e.words[r])*19+t,n=0x3ffffff&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){var t;if(v[e])return v[e];if("k256"===e)t=new _;else if("p224"===e)t=new E;else if("p192"===e)t=new x;else if("p25519"===e)t=new S;else throw Error("Unknown prime "+e);return v[e]=t,t},M.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){i((e.negative|t.negative)==0,"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(f(e,e.umod(this.m)._forceRed(this)),e)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new s(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),u=a.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new s(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,n),l=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),p=o;0!==d.cmp(a);){for(var g=d,m=0;0!==g.cmp(a);m++)g=g.redSqr();i(m<p);var b=this.pow(h,new s(1).iushln(p-m-1));l=l.redMul(b),h=b.redSqr(),d=d.redMul(h),p=m}return l},M.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},M.prototype.pow=function(e,t){if(t.isZero())return new s(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=Array(16);r[0]=new s(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],o=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var f=t.words[i],c=u-1;c>=0;c--){var h=f>>c&1;if(n!==r[0]&&(n=this.sqr(n)),0===h&&0===o){a=0;continue}o<<=1,o|=h,(4==++a||0===i&&0===c)&&(n=this.mul(n,r[o]),a=0,o=0)}u=26}return n},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new I(e)},n(I,M),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},I.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):0>n.cmpn(0)&&(s=n.iadd(this.m)),s._forceRed(this)},I.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):0>n.cmpn(0)&&(o=n.iadd(this.m)),o._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},1160:function(e,t,r){!function(e,t){"use strict";function i(e,t){if(!e)throw Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function s(e,t,r){if(s.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&(("le"===t||"be"===t)&&(r=t,t=10),this._init(e||0,t||10,r||"be"))}"object"==typeof e?e.exports=s:t.BN=s,s.BN=s,s.wordSize=26;try{h="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(8954).Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void i(!1,"Invalid character in "+e)}function a(e,t,r){var i=o(e,r);return r-1>=t&&(i|=o(e,r-1)<<4),i}function u(e,t,r,n){for(var s=0,o=0,a=Math.min(e.length,r),u=t;u<a;u++){var f=e.charCodeAt(u)-48;s*=n,o=f>=49?f-49+10:f>=17?f-17+10:f,i(f>=0&&o<n,"Invalid character"),s+=o}return s}function f(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return 0>e.cmp(t)?e:t},s.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,r):(this._parseBase(e,t,n),"le"===r&&this._initArray(this.toArray(),t,r)))},s.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<0x4000000?(this.words=[0x3ffffff&e],this.length=1):e<0x10000000000000?(this.words=[0x3ffffff&e,e/0x4000000&0x3ffffff],this.length=2):(i(e<0x20000000000000),this.words=[0x3ffffff&e,e/0x4000000&0x3ffffff,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},s.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=Array(this.length);for(var n,s,o=0;o<this.length;o++)this.words[o]=0;var a=0;if("be"===r)for(o=e.length-1,n=0;o>=0;o-=3)s=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[n]|=s<<a&0x3ffffff,this.words[n+1]=s>>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,n++);else if("le"===r)for(o=0,n=0;o<e.length;o+=3)s=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[n]|=s<<a&0x3ffffff,this.words[n+1]=s>>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,n++);return this._strip()},s.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var i,n=0;n<this.length;n++)this.words[n]=0;var s=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=a(e,t,n)<<s,this.words[o]|=0x3ffffff&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=a(e,t,n)<<s,this.words[o]|=0x3ffffff&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;this._strip()},s.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=0x3ffffff;n*=t)i++;i--,n=n/t|0;for(var s=e.length-r,o=s%i,a=Math.min(s,s-o)+r,f=0,c=r;c<a;c+=i)f=u(e,c,c+i,t),this.imuln(n),this.words[0]+f<0x4000000?this.words[0]+=f:this._iaddn(f);if(0!==o){var h=1;for(f=u(e,c,e.length,t),c=0;c<o;c++)h*=t;this.imuln(h),this.words[0]+f<0x4000000?this.words[0]+=f:this._iaddn(f)}this._strip()},s.prototype.copy=function(e){e.words=Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},s.prototype._move=function(e){f(e,this)},s.prototype.clone=function(){var e=new s(null);return this.copy(e),e},s.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(e){s.prototype.inspect=c}else s.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h,l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[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],p=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];function g(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],s=0|t.words[0],o=n*s,a=0x3ffffff&o,u=o/0x4000000|0;r.words[0]=a;for(var f=1;f<i;f++){for(var c=u>>>26,h=0x3ffffff&u,l=Math.min(f,t.length-1),d=Math.max(0,f-e.length+1);d<=l;d++){var p=f-d|0;c+=(o=(n=0|e.words[p])*(s=0|t.words[d])+h)/0x4000000|0,h=0x3ffffff&o}r.words[f]=0|h,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r._strip()}s.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var r,n=0,s=0,o=0;o<this.length;o++){var a=this.words[o],u=((a<<n|s)&0xffffff).toString(16);s=a>>>24-n&0xffffff,(n+=2)>=26&&(n-=26,o--),r=0!==s||o!==this.length-1?l[6-u.length]+u+r:u+r}for(0!==s&&(r=s.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var f=d[e],c=p[e];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var g=h.modrn(c).toString(e);r=(h=h.idivn(c)).isZero()?g+r:l[f-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?e+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16,2)},h&&(s.prototype.toBuffer=function(e,t){return this.toArrayLike(h,e,t)}),s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0");var o=e.allocUnsafe?e.allocUnsafe(s):new e(s);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,n),o},s.prototype._toArrayLikeLE=function(e,t){for(var r=0,i=0,n=0,s=0;n<this.length;n++){var o=this.words[n]<<s|i;e[r++]=255&o,r<e.length&&(e[r++]=o>>8&255),r<e.length&&(e[r++]=o>>16&255),6===s?(r<e.length&&(e[r++]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r<e.length)for(e[r++]=i;r<e.length;)e[r++]=0},s.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,i=0,n=0,s=0;n<this.length;n++){var o=this.words[n]<<s|i;e[r--]=255&o,r>=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===s?(r>=0&&(e[r--]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r>=0)for(e[r--]=i;r>=0;)e[r--]=0},Math.clz32?s.prototype._countBits=function(e){return 32-Math.clz32(e)}:s.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return(8191&t)==0&&(r+=13,t>>>=13),(127&t)==0&&(r+=7,t>>>=7),(15&t)==0&&(r+=4,t>>>=4),(3&t)==0&&(r+=2,t>>>=2),(1&t)==0&&r++,r},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},s.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},s.prototype.ior=function(e){return i((this.negative|e.negative)==0),this.iuor(e)},s.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},s.prototype.iand=function(e){return i((this.negative|e.negative)==0),this.iuand(e)},s.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){this.length>e.length?(t=this,r=e):(t=e,r=this);for(var t,r,i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this._strip()},s.prototype.ixor=function(e){return i((this.negative|e.negative)==0),this.iuxor(e)},s.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=0x3ffffff&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-r),this._strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),t?this.words[r]=this.words[r]|1<<n:this.words[r]=this.words[r]&~(1<<n),this._strip()},s.prototype.iadd=function(e){if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var t,r,i,n=0,s=0;s<i.length;s++)t=(0|r.words[s])+(0|i.words[s])+n,this.words[s]=0x3ffffff&t,n=t>>>26;for(;0!==n&&s<r.length;s++)t=(0|r.words[s])+n,this.words[s]=0x3ffffff&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},s.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;
vendor: 8,237 bytes, line 1
1var t,r,i=this.iadd(e);return e.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(t=this,r=e):(t=e,r=this);for(var s=0,o=0;o<r.length;o++)s=(i=(0|t.words[o])-(0|r.words[o])+s)>>26,this.words[o]=0x3ffffff&i;for(;0!==s&&o<t.length;o++)s=(i=(0|t.words[o])+s)>>26,this.words[o]=0x3ffffff&i;if(0===s&&o<t.length&&t!==this)for(;o<t.length;o++)this.words[o]=t.words[o];return this.length=Math.max(this.length,o),t!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var i,n,s,o=e.words,a=t.words,u=r.words,f=0,c=0|o[0],h=8191&c,l=c>>>13,d=0|o[1],p=8191&d,g=d>>>13,m=0|o[2],b=8191&m,y=m>>>13,v=0|o[3],w=8191&v,_=v>>>13,E=0|o[4],x=8191&E,S=E>>>13,M=0|o[5],I=8191&M,A=M>>>13,R=0|o[6],D=8191&R,O=R>>>13,P=0|o[7],N=8191&P,T=P>>>13,k=0|o[8],C=8191&k,L=k>>>13,U=0|o[9],j=8191&U,B=U>>>13,q=0|a[0],z=8191&q,F=q>>>13,$=0|a[1],H=8191&$,K=$>>>13,V=0|a[2],G=8191&V,W=V>>>13,J=0|a[3],X=8191&J,Y=J>>>13,Z=0|a[4],Q=8191&Z,ee=Z>>>13,et=0|a[5],er=8191&et,ei=et>>>13,en=0|a[6],es=8191&en,eo=en>>>13,ea=0|a[7],eu=8191&ea,ef=ea>>>13,ec=0|a[8],eh=8191&ec,el=ec>>>13,ed=0|a[9],ep=8191&ed,eg=ed>>>13;r.negative=e.negative^t.negative,r.length=19;var em=(f+(i=Math.imul(h,z))|0)+((8191&(n=(n=Math.imul(h,F))+Math.imul(l,z)|0))<<13)|0;f=((s=Math.imul(l,F))+(n>>>13)|0)+(em>>>26)|0,em&=0x3ffffff,i=Math.imul(p,z),n=(n=Math.imul(p,F))+Math.imul(g,z)|0,s=Math.imul(g,F);var eb=(f+(i=i+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,K)|0)+Math.imul(l,H)|0))<<13)|0;f=((s=s+Math.imul(l,K)|0)+(n>>>13)|0)+(eb>>>26)|0,eb&=0x3ffffff,i=Math.imul(b,z),n=(n=Math.imul(b,F))+Math.imul(y,z)|0,s=Math.imul(y,F),i=i+Math.imul(p,H)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(g,H)|0,s=s+Math.imul(g,K)|0;var ey=(f+(i=i+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,W)|0)+Math.imul(l,G)|0))<<13)|0;f=((s=s+Math.imul(l,W)|0)+(n>>>13)|0)+(ey>>>26)|0,ey&=0x3ffffff,i=Math.imul(w,z),n=(n=Math.imul(w,F))+Math.imul(_,z)|0,s=Math.imul(_,F),i=i+Math.imul(b,H)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(y,H)|0,s=s+Math.imul(y,K)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(g,G)|0,s=s+Math.imul(g,W)|0;var ev=(f+(i=i+Math.imul(h,X)|0)|0)+((8191&(n=(n=n+Math.imul(h,Y)|0)+Math.imul(l,X)|0))<<13)|0;f=((s=s+Math.imul(l,Y)|0)+(n>>>13)|0)+(ev>>>26)|0,ev&=0x3ffffff,i=Math.imul(x,z),n=(n=Math.imul(x,F))+Math.imul(S,z)|0,s=Math.imul(S,F),i=i+Math.imul(w,H)|0,n=(n=n+Math.imul(w,K)|0)+Math.imul(_,H)|0,s=s+Math.imul(_,K)|0,i=i+Math.imul(b,G)|0,n=(n=n+Math.imul(b,W)|0)+Math.imul(y,G)|0,s=s+Math.imul(y,W)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,X)|0,s=s+Math.imul(g,Y)|0;var ew=(f+(i=i+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,ee)|0)+Math.imul(l,Q)|0))<<13)|0;f=((s=s+Math.imul(l,ee)|0)+(n>>>13)|0)+(ew>>>26)|0,ew&=0x3ffffff,i=Math.imul(I,z),n=(n=Math.imul(I,F))+Math.imul(A,z)|0,s=Math.imul(A,F),i=i+Math.imul(x,H)|0,n=(n=n+Math.imul(x,K)|0)+Math.imul(S,H)|0,s=s+Math.imul(S,K)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,G)|0,s=s+Math.imul(_,W)|0,i=i+Math.imul(b,X)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(y,X)|0,s=s+Math.imul(y,Y)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(g,Q)|0,s=s+Math.imul(g,ee)|0;var e_=(f+(i=i+Math.imul(h,er)|0)|0)+((8191&(n=(n=n+Math.imul(h,ei)|0)+Math.imul(l,er)|0))<<13)|0;f=((s=s+Math.imul(l,ei)|0)+(n>>>13)|0)+(e_>>>26)|0,e_&=0x3ffffff,i=Math.imul(D,z),n=(n=Math.imul(D,F))+Math.imul(O,z)|0,s=Math.imul(O,F),i=i+Math.imul(I,H)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(A,H)|0,s=s+Math.imul(A,K)|0,i=i+Math.imul(x,G)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(S,G)|0,s=s+Math.imul(S,W)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,X)|0,s=s+Math.imul(_,Y)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(y,Q)|0,s=s+Math.imul(y,ee)|0,i=i+Math.imul(p,er)|0,n=(n=n+Math.imul(p,ei)|0)+Math.imul(g,er)|0,s=s+Math.imul(g,ei)|0;var eE=(f+(i=i+Math.imul(h,es)|0)|0)+((8191&(n=(n=n+Math.imul(h,eo)|0)+Math.imul(l,es)|0))<<13)|0;f=((s=s+Math.imul(l,eo)|0)+(n>>>13)|0)+(eE>>>26)|0,eE&=0x3ffffff,i=Math.imul(N,z),n=(n=Math.imul(N,F))+Math.imul(T,z)|0,s=Math.imul(T,F),i=i+Math.imul(D,H)|0,n=(n=n+Math.imul(D,K)|0)+Math.imul(O,H)|0,s=s+Math.imul(O,K)|0,i=i+Math.imul(I,G)|0,n=(n=n+Math.imul(I,W)|0)+Math.imul(A,G)|0,s=s+Math.imul(A,W)|0,i=i+Math.imul(x,X)|0,n=(n=n+Math.imul(x,Y)|0)+Math.imul(S,X)|0,s=s+Math.imul(S,Y)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,ee)|0,i=i+Math.imul(b,er)|0,n=(n=n+Math.imul(b,ei)|0)+Math.imul(y,er)|0,s=s+Math.imul(y,ei)|0,i=i+Math.imul(p,es)|0,n=(n=n+Math.imul(p,eo)|0)+Math.imul(g,es)|0,s=s+Math.imul(g,eo)|0;var ex=(f+(i=i+Math.imul(h,eu)|0)|0)+((8191&(n=(n=n+Math.imul(h,ef)|0)+Math.imul(l,eu)|0))<<13)|0;f=((s=s+Math.imul(l,ef)|0)+(n>>>13)|0)+(ex>>>26)|0,ex&=0x3ffffff,i=Math.imul(C,z),n=(n=Math.imul(C,F))+Math.imul(L,z)|0,s=Math.imul(L,F),i=i+Math.imul(N,H)|0,n=(n=n+Math.imul(N,K)|0)+Math.imul(T,H)|0,s=s+Math.imul(T,K)|0,i=i+Math.imul(D,G)|0,n=(n=n+Math.imul(D,W)|0)+Math.imul(O,G)|0,s=s+Math.imul(O,W)|0,i=i+Math.imul(I,X)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(A,X)|0,s=s+Math.imul(A,Y)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,ee)|0,i=i+Math.imul(w,er)|0,n=(n=n+Math.imul(w,ei)|0)+Math.imul(_,er)|0,s=s+Math.imul(_,ei)|0,i=i+Math.imul(b,es)|0,n=(n=n+Math.imul(b,eo)|0)+Math.imul(y,es)|0,s=s+Math.imul(y,eo)|0,i=i+Math.imul(p,eu)|0,n=(n=n+Math.imul(p,ef)|0)+Math.imul(g,eu)|0,s=s+Math.imul(g,ef)|0;var eS=(f+(i=i+Math.imul(h,eh)|0)|0)+((8191&(n=(n=n+Math.imul(h,el)|0)+Math.imul(l,eh)|0))<<13)|0;f=((s=s+Math.imul(l,el)|0)+(n>>>13)|0)+(eS>>>26)|0,eS&=0x3ffffff,i=Math.imul(j,z),n=(n=Math.imul(j,F))+Math.imul(B,z)|0,s=Math.imul(B,F),i=i+Math.imul(C,H)|0,n=(n=n+Math.imul(C,K)|0)+Math.imul(L,H)|0,s=s+Math.imul(L,K)|0,i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(T,G)|0,s=s+Math.imul(T,W)|0,i=i+Math.imul(D,X)|0,n=(n=n+Math.imul(D,Y)|0)+Math.imul(O,X)|0,s=s+Math.imul(O,Y)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(A,Q)|0,s=s+Math.imul(A,ee)|0,i=i+Math.imul(x,er)|0,n=(n=n+Math.imul(x,ei)|0)+Math.imul(S,er)|0,s=s+Math.imul(S,ei)|0,i=i+Math.imul(w,es)|0,n=(n=n+Math.imul(w,eo)|0)+Math.imul(_,es)|0,s=s+Math.imul(_,eo)|0,i=i+Math.imul(b,eu)|0,n=(n=n+Math.imul(b,ef)|0)+Math.imul(y,eu)|0,s=s+Math.imul(y,ef)|0,i=i+Math.imul(p,eh)|0,n=(n=n+Math.imul(p,el)|0)+Math.imul(g,eh)|0,s=s+Math.imul(g,el)|0;var eM=(f+(i=i+Math.imul(h,ep)|0)|0)+((8191&(n=(n=n+Math.imul(h,eg)|0)+Math.imul(l,ep)|0))<<13)|0;f=((s=s+Math.imul(l,eg)|0)+(n>>>13)|0)+(eM>>>26)|0,eM&=0x3ffffff,i=Math.imul(j,H),n=(n=Math.imul(j,K))+Math.imul(B,H)|0,s=Math.imul(B,K),i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,W)|0)+Math.imul(L,G)|0,s=s+Math.imul(L,W)|0,i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(T,X)|0,s=s+Math.imul(T,Y)|0,i=i+Math.imul(D,Q)|0,n=(n=n+Math.imul(D,ee)|0)+Math.imul(O,Q)|0,s=s+Math.imul(O,ee)|0,i=i+Math.imul(I,er)|0,n=(n=n+Math.imul(I,ei)|0)+Math.imul(A,er)|0,s=s+Math.imul(A,ei)|0,i=i+Math.imul(x,es)|0,n=(n=n+Math.imul(x,eo)|0)+Math.imul(S,es)|0,s=s+Math.imul(S,eo)|0,i=i+Math.imul(w,eu)|0,n=(n=n+Math.imul(w,ef)|0)+Math.imul(_,eu)|0,s=s+Math.imul(_,ef)|0,i=i+Math.imul(b,eh)|0,n=(n=n+Math.imul(b,el)|0)+Math.imul(y,eh)|0,s=s+Math.imul(y,el)|0;var eI=(f+(i=i+Math.imul(p,ep)|0)|0)+((8191&(n=(n=n+Math.imul(p,eg)|0)+Math.imul(g,ep)|0))<<13)|0;f=((s=s+Math.imul(g,eg)|0)+(n>>>13)|0)+(eI>>>26)|0,eI&=0x3ffffff,i=Math.imul(j,G),n=(n=Math.imul(j,W))+Math.imul(B,G)|0,s=Math.imul(B,W),i=i+Math.imul(C,X)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(L,X)|0,s=s+Math.imul(L,Y)|0,i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,ee)|0,i=i+Math.imul(D,er)|0,n=(n=n+Math.imul(D,ei)|0)+Math.imul(O,er)|0,s=s+Math.imul(O,ei)|0,i=i+Math.imul(I,es)|0,n=(n=n+Math.imul(I,eo)|0)+Math.imul(A,es)|0,s=s+Math.imul(A,eo)|0,i=i+Math.imul(x,eu)|0,n=(n=n+Math.imul(x,ef)|0)+Math.imul(S,eu)|0,s=s+Math.imul(S,ef)|0,i=i+Math.imul(w,eh)|0,n=(n=n+Math.imul(w,el)|0)+Math.imul(_,eh)|0,s=s+Math.imul(_,el)|0;var eA=(f+(i=i+Math.imul(b,ep)|0)|0)+((8191&(n=(n=n+Math.imul(b,eg)|0)+Math.imul(y,ep)|0))<<13)|0;f=((s=s+Math.imul(y,eg)|0)+(n>>>13)|0)+(eA>>>
vendor: 6,502 bytes, line 1
126)|0,eA&=0x3ffffff,i=Math.imul(j,X),n=(n=Math.imul(j,Y))+Math.imul(B,X)|0,s=Math.imul(B,Y),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(L,Q)|0,s=s+Math.imul(L,ee)|0,i=i+Math.imul(N,er)|0,n=(n=n+Math.imul(N,ei)|0)+Math.imul(T,er)|0,s=s+Math.imul(T,ei)|0,i=i+Math.imul(D,es)|0,n=(n=n+Math.imul(D,eo)|0)+Math.imul(O,es)|0,s=s+Math.imul(O,eo)|0,i=i+Math.imul(I,eu)|0,n=(n=n+Math.imul(I,ef)|0)+Math.imul(A,eu)|0,s=s+Math.imul(A,ef)|0,i=i+Math.imul(x,eh)|0,n=(n=n+Math.imul(x,el)|0)+Math.imul(S,eh)|0,s=s+Math.imul(S,el)|0;var eR=(f+(i=i+Math.imul(w,ep)|0)|0)+((8191&(n=(n=n+Math.imul(w,eg)|0)+Math.imul(_,ep)|0))<<13)|0;f=((s=s+Math.imul(_,eg)|0)+(n>>>13)|0)+(eR>>>26)|0,eR&=0x3ffffff,i=Math.imul(j,Q),n=(n=Math.imul(j,ee))+Math.imul(B,Q)|0,s=Math.imul(B,ee),i=i+Math.imul(C,er)|0,n=(n=n+Math.imul(C,ei)|0)+Math.imul(L,er)|0,s=s+Math.imul(L,ei)|0,i=i+Math.imul(N,es)|0,n=(n=n+Math.imul(N,eo)|0)+Math.imul(T,es)|0,s=s+Math.imul(T,eo)|0,i=i+Math.imul(D,eu)|0,n=(n=n+Math.imul(D,ef)|0)+Math.imul(O,eu)|0,s=s+Math.imul(O,ef)|0,i=i+Math.imul(I,eh)|0,n=(n=n+Math.imul(I,el)|0)+Math.imul(A,eh)|0,s=s+Math.imul(A,el)|0;var eD=(f+(i=i+Math.imul(x,ep)|0)|0)+((8191&(n=(n=n+Math.imul(x,eg)|0)+Math.imul(S,ep)|0))<<13)|0;f=((s=s+Math.imul(S,eg)|0)+(n>>>13)|0)+(eD>>>26)|0,eD&=0x3ffffff,i=Math.imul(j,er),n=(n=Math.imul(j,ei))+Math.imul(B,er)|0,s=Math.imul(B,ei),i=i+Math.imul(C,es)|0,n=(n=n+Math.imul(C,eo)|0)+Math.imul(L,es)|0,s=s+Math.imul(L,eo)|0,i=i+Math.imul(N,eu)|0,n=(n=n+Math.imul(N,ef)|0)+Math.imul(T,eu)|0,s=s+Math.imul(T,ef)|0,i=i+Math.imul(D,eh)|0,n=(n=n+Math.imul(D,el)|0)+Math.imul(O,eh)|0,s=s+Math.imul(O,el)|0;var eO=(f+(i=i+Math.imul(I,ep)|0)|0)+((8191&(n=(n=n+Math.imul(I,eg)|0)+Math.imul(A,ep)|0))<<13)|0;f=((s=s+Math.imul(A,eg)|0)+(n>>>13)|0)+(eO>>>26)|0,eO&=0x3ffffff,i=Math.imul(j,es),n=(n=Math.imul(j,eo))+Math.imul(B,es)|0,s=Math.imul(B,eo),i=i+Math.imul(C,eu)|0,n=(n=n+Math.imul(C,ef)|0)+Math.imul(L,eu)|0,s=s+Math.imul(L,ef)|0,i=i+Math.imul(N,eh)|0,n=(n=n+Math.imul(N,el)|0)+Math.imul(T,eh)|0,s=s+Math.imul(T,el)|0;var eP=(f+(i=i+Math.imul(D,ep)|0)|0)+((8191&(n=(n=n+Math.imul(D,eg)|0)+Math.imul(O,ep)|0))<<13)|0;f=((s=s+Math.imul(O,eg)|0)+(n>>>13)|0)+(eP>>>26)|0,eP&=0x3ffffff,i=Math.imul(j,eu),n=(n=Math.imul(j,ef))+Math.imul(B,eu)|0,s=Math.imul(B,ef),i=i+Math.imul(C,eh)|0,n=(n=n+Math.imul(C,el)|0)+Math.imul(L,eh)|0,s=s+Math.imul(L,el)|0;var eN=(f+(i=i+Math.imul(N,ep)|0)|0)+((8191&(n=(n=n+Math.imul(N,eg)|0)+Math.imul(T,ep)|0))<<13)|0;f=((s=s+Math.imul(T,eg)|0)+(n>>>13)|0)+(eN>>>26)|0,eN&=0x3ffffff,i=Math.imul(j,eh),n=(n=Math.imul(j,el))+Math.imul(B,eh)|0,s=Math.imul(B,el);var eT=(f+(i=i+Math.imul(C,ep)|0)|0)+((8191&(n=(n=n+Math.imul(C,eg)|0)+Math.imul(L,ep)|0))<<13)|0;f=((s=s+Math.imul(L,eg)|0)+(n>>>13)|0)+(eT>>>26)|0,eT&=0x3ffffff;var ek=(f+(i=Math.imul(j,ep))|0)+((8191&(n=(n=Math.imul(j,eg))+Math.imul(B,ep)|0))<<13)|0;return f=((s=Math.imul(B,eg))+(n>>>13)|0)+(ek>>>26)|0,ek&=0x3ffffff,u[0]=em,u[1]=eb,u[2]=ey,u[3]=ev,u[4]=ew,u[5]=e_,u[6]=eE,u[7]=ex,u[8]=eS,u[9]=eM,u[10]=eI,u[11]=eA,u[12]=eR,u[13]=eD,u[14]=eO,u[15]=eP,u[16]=eN,u[17]=eT,u[18]=ek,0!==f&&(u[19]=f,r.length++),r};function b(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,s=0;s<r.length-1;s++){var o=n;n=0;for(var a=0x3ffffff&i,u=Math.min(s,t.length-1),f=Math.max(0,s-e.length+1);f<=u;f++){var c=s-f,h=(0|e.words[c])*(0|t.words[f]),l=0x3ffffff&h;o=o+(h/0x4000000|0)|0,a=0x3ffffff&(l=l+a|0),n+=(o=o+(l>>>26)|0)>>>26,o&=0x3ffffff}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r._strip()}function y(e,t){this.x=e,this.y=t}Math.imul||(m=g),s.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):i<63?g(this,e,t):b(this,e,t)},y.prototype.makeRBT=function(e){for(var t=Array(e),r=s.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},y.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},y.prototype.permute=function(e,t,r,i,n,s){for(var o=0;o<s;o++)i[o]=t[e[o]],n[o]=r[e[o]]},y.prototype.transform=function(e,t,r,i,n,s){this.permute(s,e,t,r,i,n);for(var o=1;o<n;o<<=1)for(var a=o<<1,u=Math.cos(2*Math.PI/a),f=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var h=u,l=f,d=0;d<o;d++){var p=r[c+d],g=i[c+d],m=r[c+d+o],b=i[c+d+o],y=h*m-l*b;b=h*b+l*m,m=y,r[c+d]=p+m,i[c+d]=g+b,r[c+d+o]=p-m,i[c+d+o]=g-b,d!==a&&(y=u*h-f*l,l=u*l+f*h,h=y)}},y.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},y.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},y.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=0x3ffffff&n,r=n<0x4000000?0:n/0x4000000|0}return e},y.prototype.convert13b=function(e,t,r,n){for(var s=0,o=0;o<t;o++)s+=0|e[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*t;o<n;++o)r[o]=0;i(0===s),i((-8192&s)==0)},y.prototype.stub=function(e){for(var t=Array(e),r=0;r<e;r++)t[r]=0;return t},y.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),s=this.stub(i),o=Array(i),a=Array(i),u=Array(i),f=Array(i),c=Array(i),h=Array(i),l=r.words;l.length=i,this.convert13b(e.words,e.length,o,i),this.convert13b(t.words,t.length,f,i),this.transform(o,s,a,u,i,n),this.transform(f,s,c,h,i,n);for(var d=0;d<i;d++){var p=a[d]*c[d]-u[d]*h[d];u[d]=a[d]*h[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,l,s,i,n),this.conjugate(l,s,i),this.normalize13b(l,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},s.prototype.mul=function(e){var t=new s(null);return t.words=Array(this.length+e.length),this.mulTo(e,t)},s.prototype.mulf=function(e){var t=new s(null);return t.words=Array(this.length+e.length),b(this,e,t)},s.prototype.imul=function(e){return this.clone().mulTo(e,this)},s.prototype.imuln=function(e){var t=e<0;t&&(e=-e),i("number"==typeof e),i(e<0x4000000);for(var r=0,n=0;n<this.length;n++){var s=(0|this.words[n])*e,o=(0x3ffffff&s)+(0x3ffffff&r);r>>=26,r+=(s/0x4000000|0)+(o>>>26),this.words[n]=0x3ffffff&o}return 0!==r&&(this.words[n]=r,this.length++),t?this.ineg():this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),r
vendor: 18,237 bytes, line 1
1=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=e.words[i]>>>n&1}return t}(e);if(0===t.length)return new s(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},s.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,s=0x3ffffff>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var a=this.words[t]&s,u=(0|this.words[t])-a<<r;this.words[t]=u|o,o=a>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this._strip()},s.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},s.prototype.iushrn=function(e,t,r){i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var n,s=e%26,o=Math.min((e-s)/26,this.length),a=0x3ffffff^0x3ffffff>>>s<<s;if(n-=o,n=Math.max(0,n),r){for(var u=0;u<o;u++)r.words[u]=this.words[u];r.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var f=0;for(u=this.length-1;u>=0&&(0!==f||u>=n);u--){var c=0|this.words[u];this.words[u]=f<<26-s|c>>>s,f=c&a}return r&&0!==f&&(r.words[r.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;return!(this.length<=r)&&!!(this.words[r]&1<<t)},s.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;return(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)?this:(0!==t&&r++,this.length=Math.min(r,this.length),0!==t&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>t<<t),this._strip())},s.prototype.maskn=function(e){return this.clone().imaskn(e)},s.prototype.iaddn=function(e){return(i("number"==typeof e),i(e<0x4000000),e<0)?this.isubn(-e):0!==this.negative?(1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(e),this.negative=1),this):this._iaddn(e)},s.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=0x4000000;t++)this.words[t]-=0x4000000,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(i("number"==typeof e),i(e<0x4000000),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=0x4000000,this.words[t+1]-=1;return this._strip()},s.prototype.addn=function(e){return this.clone().iaddn(e)},s.prototype.subn=function(e){return this.clone().isubn(e)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(e,t,r){var n,s,o=e.length+r;this._expand(o);var a=0;for(n=0;n<e.length;n++){s=(0|this.words[n+r])+a;var u=(0|e.words[n])*t;s-=0x3ffffff&u,a=(s>>26)-(u/0x4000000|0),this.words[n+r]=0x3ffffff&s}for(;n<this.length-r;n++)a=(s=(0|this.words[n+r])+a)>>26,this.words[n+r]=0x3ffffff&s;if(0===a)return this._strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(s=-(0|this.words[n])+a)>>26,this.words[n]=0x3ffffff&s;return this.negative=1,this._strip()},s.prototype._wordDiv=function(e,t){var r,i=this.length-e.length,n=this.clone(),o=e,a=0|o.words[o.length-1];0!=(i=26-this._countBits(a))&&(o=o.ushln(i),n.iushln(i),a=0|o.words[o.length-1]);var u=n.length-o.length;if("mod"!==t){(r=new s(null)).length=u+1,r.words=Array(r.length);for(var f=0;f<r.length;f++)r.words[f]=0}var c=n.clone()._ishlnsubmul(o,1,u);0===c.negative&&(n=c,r&&(r.words[u]=1));for(var h=u-1;h>=0;h--){var l=(0|n.words[o.length+h])*0x4000000+(0|n.words[o.length+h-1]);for(l=Math.min(l/a|0,0x3ffffff),n._ishlnsubmul(o,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);r&&(r.words[h]=l)}return r&&r._strip(),n._strip(),"div"!==t&&0!==i&&n.iushrn(i),{div:r||null,mod:n}},s.prototype.divmod=function(e,t,r){var n,o,a;return(i(!e.isZero()),this.isZero())?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):(this.negative&e.negative)!=0?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||0>this.cmp(e)?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modrn(e.words[0]))}:this._wordDiv(e,t)},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modrn=function(e){var t=e<0;t&&(e=-e),i(e<=0x3ffffff);for(var r=0x4000000%e,n=0,s=this.length-1;s>=0;s--)n=(r*n+(0|this.words[s]))%e;return t?-n:n},s.prototype.modn=function(e){return this.modrn(e)},s.prototype.idivn=function(e){var t=e<0;t&&(e=-e),i(e<=0x3ffffff);for(var r=0,n=this.length-1;n>=0;n--){var s=(0|this.words[n])+0x4000000*r;this.words[n]=s/e|0,r=s%e}return this._strip(),t?this.ineg():this},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new s(1),o=new s(0),a=new s(0),u=new s(1),f=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++f;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var l=0,d=1;(t.words[0]&d)==0&&l<26;++l,d<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(c),o.isub(h)),n.iushrn(1),o.iushrn(1);for(var p=0,g=1;(r.words[0]&g)==0&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(a),o.isub(u)):(r.isub(t),a.isub(n),u.isub(o))}return{a:a,b:u,gcd:r.iushln(f)}},s.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t,r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var o=new s(1),a=new s(0),u=n.clone();r.cmpn(1)>0&&n.cmpn(1)>0;){for(var f=0,c=1;(r.words[0]&c)==0&&f<26;++f,c<<=1);if(f>0)for(r.iushrn(f);f-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var h=0,l=1;(n.words[0]&l)==0&&h<26;++h,l<<=1);if(h>0)for(n.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);r.cmp(n)>=0?(r.isub(n),o.isub(a)):(n.isub(r),a.isub(o))}return 0>(t=0===r.cmpn(1)?o:a).cmpn(0)&&t.iadd(e),t},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var s=t;t=r,r=s}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return(1&this.words[0])==0},s.prototype.isOdd=function(){return(1&this.words[0])==1},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var s=n,o=r;0!==s&&o<this.length;o++){var a=0|this.words[o];a+=s,s=a>>>26,a&=0x3ffffff,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return -1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=0x3ffffff,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},s.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return -1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},s.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return -1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return -1===this.cmpn(e)},s.prototype.lt=function(e){return -1===this.cmp(e)},s.prototype.lten=function(e){return 0>=this.cmpn(e)},s.prototype.lte=function(e){return 0>=this.cmp(e)},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new M(e)},s.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(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)}w.prototype._tmp=function(){var e=new s(null);return e.words=Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},n(_,w),_.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9){e.words[0]=0,e.length=1;return}var n=e.words[9];for(i=10,t.words[t.length++]=4194303&n;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(4194303&s)<<4|n>>>22,n=s}n>>>=22,e.words[i-10]=n,0===n&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=0x3ffffff&t,t=64*i+(t/0x4000000|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(E,w),n(x,w),n(S,w),S.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=(0|e.words[r])*19+t,n=0x3ffffff&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){var t;if(v[e])return v[e];if("k256"===e)t=new _;else if("p224"===e)t=new E;else if("p192"===e)t=new x;else if("p25519"===e)t=new S;else throw Error("Unknown prime "+e);return v[e]=t,t},M.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){i((e.negative|t.negative)==0,"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(f(e,e.umod(this.m)._forceRed(this)),e)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new s(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),u=a.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new s(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,n),l=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),p=o;0!==d.cmp(a);){for(var g=d,m=0;0!==g.cmp(a);m++)g=g.redSqr();i(m<p);var b=this.pow(h,new s(1).iushln(p-m-1));l=l.redMul(b),h=b.redSqr(),d=d.redMul(h),p=m}return l},M.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},M.prototype.pow=function(e,t){if(t.isZero())return new s(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=Array(16);r[0]=new s(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],o=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var f=t.words[i],c=u-1;c>=0;c--){var h=f>>c&1;if(n!==r[0]&&(n=this.sqr(n)),0===h&&0===o){a=0;continue}o<<=1,o|=h,(4==++a||0===i&&0===c)&&(n=this.mul(n,r[o]),a=0,o=0)}u=26}return n},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new I(e)},n(I,M),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},I.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):0>n.cmpn(0)&&(s=n.iadd(this.m)),s._forceRed(this)},I.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):0>n.cmpn(0)&&(o=n.iadd(this.m)),o._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6167:function(e){var t;t=function(){var e,t;return e={418:function(e,t){!function(e,t){for(var r in t)e[r]=t[r]}(t,function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})}
1,r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(3),n=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={splitValues:!1});var r,n=this;this.headersMap={},e&&("undefined"!=typeof Headers&&e instanceof Headers?i.getHeaderKeys(e).forEach(function(r){i.getHeaderValues(e,r).forEach(function(e){t.splitValues?n.append(r,i.splitHeaderValue(e)):n.append(r,e)})}):"object"==typeof(r=e)&&"object"==typeof r.headersMap&&"function"==typeof r.forEach?e.forEach(function(e,t){n.append(e,t)}):"undefined"!=typeof Map&&e instanceof Map?e.forEach(function(e,t){n.append(t,e)}):"string"==typeof e?this.appendFromString(e):"object"==typeof e&&Object.getOwnPropertyNames(e).forEach(function(t){var r=e[t];Array.isArray(r)?r.forEach(function(e){n.append(t,e)}):n.append(t,r)}))}return e.prototype.appendFromString=function(e){for(var t=e.split("\r\n"),r=0;r<t.length;r++){var i=t[r],n=i.indexOf(":");if(n>0){var s=i.substring(0,n).trim(),o=i.substring(n+1).trim();this.append(s,o)}}},e.prototype.delete=function(e,t){var r=i.normalizeName(e);if(void 0===t)delete this.headersMap[r];else{var n=this.headersMap[r];if(n){var s=n.indexOf(t);s>=0&&n.splice(s,1),0===n.length&&delete this.headersMap[r]}}},e.prototype.append=function(e,t){var r=this,n=i.normalizeName(e);Array.isArray(this.headersMap[n])||(this.headersMap[n]=[]),Array.isArray(t)?t.forEach(function(e){r.headersMap[n].push(i.normalizeValue(e))}):this.headersMap[n].push(i.normalizeValue(t))},e.prototype.set=function(e,t){var r=i.normalizeName(e);if(Array.isArray(t)){var n=[];t.forEach(function(e){n.push(i.normalizeValue(e))}),this.headersMap[r]=n}else this.headersMap[r]=[i.normalizeValue(t)]},e.prototype.has=function(e,t){var r=this.headersMap[i.normalizeName(e)];if(!Array.isArray(r))return!1;if(void 0!==t){var n=i.normalizeValue(t);return r.indexOf(n)>=0}return!0},e.prototype.get=function(e){var t=this.headersMap[i.normalizeName(e)];return void 0!==t?t.concat():[]},e.prototype.forEach=function(e){var t=this;Object.getOwnPropertyNames(this.headersMap).forEach(function(r){e(r,t.headersMap[r])},this)},e.prototype.toHeaders=function(){if("undefined"!=typeof Headers){var e=new Headers;return this.forEach(function(t,r){r.forEach(function(r){e.append(t,r)})}),e}throw Error("Headers class is not defined")},e}();t.BrowserHeaders=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0);t.BrowserHeaders=i.BrowserHeaders},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iterateHeaders=function(e,t){for(var r=e[Symbol.iterator](),i=r.next();!i.done;)t(i.value[0]),i=r.next()},t.iterateHeadersKeys=function(e,t){for(var r=e.keys(),i=r.next();!i.done;)t(i.value),i=r.next()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(2);t.normalizeName=function(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw TypeError("Invalid character in header field name");return e.toLowerCase()},t.normalizeValue=function(e){return"string"!=typeof e&&(e=String(e)),e},t.getHeaderValues=function(e,t){if(e instanceof Headers&&e.getAll)return e.getAll(t);var r=e.get(t);return r&&"string"==typeof r?[r]:r},t.getHeaderKeys=function(e){var t={},r=[];return e.keys?i.iterateHeadersKeys(e,function(e){t[e]||(t[e]=!0,r.push(e))}):e.forEach?e.forEach(function(e,i){t[i]||(t[i]=!0,r.push(i))}):i.iterateHeaders(e,function(e){var i=e[0];t[i]||(t[i]=!0,r.push(i))}),r},t.splitHeaderValue=function(e){var t=[];return e.split(", ").forEach(function(e){e.split(",").forEach(function(e){t.push(e)})}),t}}]))},617:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChunkParser=t.ChunkType=t.encodeASCII=t.decodeASCII=void 0;var i,n,s=r(65);function o(e){return 9===e||10===e||13===e||e>=32&&e<=126}function a(e){for(var t=0;t!==e.length;
1++t)if(!o(e[t]))throw Error("Metadata is not valid (printable) ASCII");return String.fromCharCode.apply(String,Array.prototype.slice.call(e))}function u(e,t,r){return e.byteLength-t>=r}function f(e,t,r){if(e.slice)return e.slice(t,r);var i=e.length;void 0!==r&&(i=r);for(var n=new Uint8Array(i-t),s=0,o=t;o<i;o++)n[s++]=e[o];return n}t.decodeASCII=a,t.encodeASCII=function(e){for(var t=new Uint8Array(e.length),r=0;r!==e.length;++r){var i=e.charCodeAt(r);if(!o(i))throw Error("Metadata contains invalid ASCII");t[r]=i}return t},(i=n=t.ChunkType||(t.ChunkType={}))[i.MESSAGE=1]="MESSAGE",i[i.TRAILERS=2]="TRAILERS";var c=function(){function e(){this.buffer=null,this.position=0}return e.prototype.parse=function(e,t){if(0===e.length&&t)return[];var r=[];if(null==this.buffer)this.buffer=e,this.position=0;else if(this.position===this.buffer.byteLength)this.buffer=e,this.position=0;else{var i=this.buffer.byteLength-this.position,o=new Uint8Array(i+e.byteLength),c=f(this.buffer,this.position);o.set(c,0);var h=new Uint8Array(e);o.set(h,i),this.buffer=o,this.position=0}for(;;){if(!u(this.buffer,this.position,5))return r;var l=f(this.buffer,this.position,this.position+5),d=new DataView(l.buffer,l.byteOffset,l.byteLength),p=d.getUint32(1,!1);if(!u(this.buffer,this.position,5+p))return r;var g=f(this.buffer,this.position+5,this.position+5+p);if(this.position+=5+p,128==(128&d.getUint8(0)))return r.push({chunkType:n.TRAILERS,trailers:new s.Metadata(a(g))}),r;r.push({chunkType:n.MESSAGE,data:g})}},e}();t.ChunkParser=c},8:function(e,t){"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.httpStatusToCode=t.Code=void 0,(i=r=t.Code||(t.Code={}))[i.OK=0]="OK",i[i.Canceled=1]="Canceled",i[i.Unknown=2]="Unknown",i[i.InvalidArgument=3]="InvalidArgument",i[i.DeadlineExceeded=4]="DeadlineExceeded",i[i.NotFound=5]="NotFound",i[i.AlreadyExists=6]="AlreadyExists",i[i.PermissionDenied=7]="PermissionDenied",i[i.ResourceExhausted=8]="ResourceExhausted",i[i.FailedPrecondition=9]="FailedPrecondition",i[i.Aborted=10]="Aborted",i[i.OutOfRange=11]="OutOfRange",i[i.Unimplemented=12]="Unimplemented",i[i.Internal=13]="Internal",i[i.Unavailable=14]="Unavailable",i[i.DataLoss=15]="DataLoss",i[i.Unauthenticated=16]="Unauthenticated",t.httpStatusToCode=function(e){switch(e){case 0:return r.Internal;case 200:return r.OK;case 400:return r.InvalidArgument;case 401:return r.Unauthenticated;case 403:return r.PermissionDenied;case 404:return r.NotFound;case 409:return r.Aborted;case 412:return r.FailedPrecondition;case 429:return r.ResourceExhausted;case 499:return r.Canceled;case 500:default:return r.Unknown;case 501:return r.Unimplemented;case 503:return r.Unavailable;case 504:return r.DeadlineExceeded}}},934:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.client=void 0;var i=r(65),n=r(617),s=r(8),o=r(346),a=r(57),u=r(882);t.client=function(e,t){return new f(e,t)};var f=function(){function e(e,t){this.started=!1,this.sentFirstMessage=!1,this.completed=!1,this.closed=!1,this.finishedSending=!1,this.onHeadersCallbacks=[],this.onMessageCallbacks=[],this.onEndCallbacks=[],this.parser=new n.ChunkParser,this.methodDefinition=e,this.props=t,this.createTransport()}return e.prototype.createTransport=function(){var e=this.props.host+"/"+this.methodDefinition.service.serviceName+"/"+this.methodDefinition.methodName,t={methodDefinition:this.methodDefinition,debug:this.props.debug||!1,url:e,onHeaders:this.onTransportHeaders.bind(this),onChunk:this.onTransportChunk.bind(this),onEnd:this.onTransportEnd.bind(this)};this.props.transport?this.transport=this.props.transport(t):this.transport=a.makeDefaultTransport(t)},e.prototype.onTransportHeaders=function(e,t){if(this.props.debug&&o.debug("onHeaders",e,t),this.closed)this.props.debug&&o.debug("grpc.onHeaders received after request was closed - ignoring");else if(0===t);else{this.responseHeaders=e,this.props.debug&&o.debug("onHeaders.responseHeaders",JSON.stringify(this.responseHeaders,null,2));var r=c(e);this.props.debug&&o.debug("onHeaders.gRPCStatus",r);var i=r&&r>=0?r:s.httpStatusToCode(t);this.props.debug&&o.debug("onHeaders.code",i);var n=e.get("grpc-message")||[];if(this.props.debug&&o.debug("onHeaders.gRPCMessage",n),this.rawOnHeaders(e),i!==s.Code.OK){var a=this.decodeGRPCStatus(n[0]);this.rawOnError(i,a,e)}}},e.prototype.onTransportChunk=function(e){var t=this;
1if(this.closed)this.props.debug&&o.debug("grpc.onChunk received after request was closed - ignoring");else{var r=[];try{r=this.parser.parse(e)}catch(e){return this.props.debug&&o.debug("onChunk.parsing error",e,e.message),void this.rawOnError(s.Code.Internal,"parsing error: "+e.message)}r.forEach(function(e){if(e.chunkType===n.ChunkType.MESSAGE){var r=t.methodDefinition.responseType.deserializeBinary(e.data);t.rawOnMessage(r)}else e.chunkType===n.ChunkType.TRAILERS&&(t.responseHeaders?(t.responseTrailers=new i.Metadata(e.trailers),t.props.debug&&o.debug("onChunk.trailers",t.responseTrailers)):(t.responseHeaders=new i.Metadata(e.trailers),t.rawOnHeaders(t.responseHeaders)))})}},e.prototype.onTransportEnd=function(){if(this.props.debug&&o.debug("grpc.onEnd"),this.closed)this.props.debug&&o.debug("grpc.onEnd received after request was closed - ignoring");else if(void 0!==this.responseTrailers){var e=c(this.responseTrailers);if(null!==e){var t=this.responseTrailers.get("grpc-message"),r=this.decodeGRPCStatus(t[0]);this.rawOnEnd(e,r,this.responseTrailers)}else this.rawOnError(s.Code.Internal,"Response closed without grpc-status (Trailers provided)")}else{if(void 0===this.responseHeaders)return void this.rawOnError(s.Code.Unknown,"Response closed without headers");var i=c(this.responseHeaders),n=this.responseHeaders.get("grpc-message");if(this.props.debug&&o.debug("grpc.headers only response ",i,n),null===i)return void this.rawOnEnd(s.Code.Unknown,"Response closed without grpc-status (Headers only)",this.responseHeaders);var a=this.decodeGRPCStatus(n[0]);this.rawOnEnd(i,a,this.responseHeaders)}},e.prototype.decodeGRPCStatus=function(e){if(!e)return"";try{return decodeURIComponent(e)}catch(t){return e}},e.prototype.rawOnEnd=function(e,t,r){var i=this;this.props.debug&&o.debug("rawOnEnd",e,t,r),this.completed||(this.completed=!0,this.onEndCallbacks.forEach(function(n){if(!i.closed)try{n(e,t,r)}catch(e){setTimeout(function(){throw e},0)}}))},e.prototype.rawOnHeaders=function(e){this.props.debug&&o.debug("rawOnHeaders",e),this.completed||this.onHeadersCallbacks.forEach(function(t){try{t(e)}catch(e){setTimeout(function(){throw e},0)}})},e.prototype.rawOnError=function(e,t,r){var n=this;void 0===r&&(r=new i.Metadata),this.props.debug&&o.debug("rawOnError",e,t),this.completed||(this.completed=!0,this.onEndCallbacks.forEach(function(i){if(!n.closed)try{i(e,t,r)}catch(e){setTimeout(function(){throw e},0)}}))},e.prototype.rawOnMessage=function(e){var t=this;this.props.debug&&o.debug("rawOnMessage",e.toObject()),this.completed||this.closed||this.onMessageCallbacks.forEach(function(r){if(!t.closed)try{r(e)}catch(e){setTimeout(function(){throw e},0)}})},e.prototype.onHeaders=function(e){this.onHeadersCallbacks.push(e)},e.prototype.onMessage=function(e){this.onMessageCallbacks.push(e)},e.prototype.onEnd=function(e){this.onEndCallbacks.push(e)},e.prototype.start=function(e){if(this.started)throw Error("Client already started - cannot .start()");this.started=!0;var t=new i.Metadata(e||{});t.set("content-type","application/grpc-web+proto"),t.set("x-grpc-web","1"),this.transport.start(t)},e.prototype.send=function(e){if(!this.started)throw Error("Client not started - .start() must be called before .send()");if(this.closed)throw Error("Client already closed - cannot .send()");if(this.finishedSending)throw Error("Client already finished sending - cannot .send()");if(!this.methodDefinition.requestStream&&this.sentFirstMessage)throw Error("Message already sent for non-client-streaming method - cannot .send()");this.sentFirstMessage=!0;var t=u.frameRequest(e);this.transport.sendMessage(t)},e.prototype.finishSend=function(){if(!this.started)throw Error("Client not started - .finishSend() must be called before .close()");if(this.closed)throw Error("Client already closed - cannot .send()");if(this.finishedSending)throw Error("Client already finished sending - cannot .finishSend()");this.finishedSending=!0,this.transport.finishSend()},e.prototype.close=function(){if(!this.started)throw Error("Client not started - .start() must be called before .close()");if(this.closed)throw Error("Client already closed - cannot .close()");this.closed=!0,this.props.debug&&o.debug("request.abort aborting request"),this.transport.cancel()},e}();function c(e){var t=e.get("grpc-status")||[];if(t.length>0)try{var r=t[0];return parseInt(r,10)}catch(e){}return null}},346:function(e,t){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.debug=void 0,t.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.debug?console.debug.apply(null,e):console.log.apply(null,e)}},607:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.grpc=void 0;var i,n=r(418),s=r(57),o=r(229),a=r(540),u=r(210),f=r(859),c=r(8),h=r(938),l=r(35),d=r(934);(i=t.grpc||(t.grpc={})).setDefaultTransport=s.setDefaultTransportFactory,i.CrossBrowserHttpTransport=f.CrossBrowserHttpTransport,i.FetchReadableStreamTransport=o.FetchReadableStreamTransport,i.XhrTransport=u.XhrTransport,i.WebsocketTransport=a.WebsocketTransport,i.Code=c.Code,i.Metadata=n.BrowserHeaders,i.client=function(e,t){return d.client(e,t)},i.invoke=h.invoke,i.unary=l.unary},938:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.invoke=void 0;var i=r(934);t.invoke=function(e,t){if(e.requestStream)throw Error(".invoke cannot be used with client-streaming methods. Use .client instead.");var r=i.client(e,{host:t.host,transport:t.transport,debug:t.debug});return t.onHeaders&&r.onHeaders(t.onHeaders),t.onMessage&&r.onMessage(t.onMessage),t.onEnd&&r.onEnd(t.onEnd),r.start(t.metadata),r.send(t.request),r.finishSend(),{close:function(){r.close()}}}},65:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var i=r(418);Object.defineProperty(t,"Metadata",{enumerable:!0,get:function(){return i.BrowserHeaders}})},57:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeDefaultTransport=t.setDefaultTransportFactory=void 0;var i=r(859),n=function(e){return i.CrossBrowserHttpTransport({withCredentials:!1})(e)};t.setDefaultTransportFactory=function(e){n=e},t.makeDefaultTransport=function(e){return n(e)}},229:function(e,t,r){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.detectFetchSupport=t.FetchReadableStreamTransport=void 0;var n=r(65),s=r(346);t.FetchReadableStreamTransport=function(e){return function(t){return t.debug&&s.debug("fetchRequest",t),new o(t,e)}};var o=function(){function e(e,t){this.cancelled=!1,this.controller=self.AbortController&&new AbortController,this.options=e,this.init=t}return e.prototype.pump=function(e,t){var r=this;if(this.reader=e,this.cancelled)return this.options.debug&&s.debug("Fetch.pump.cancel at first pump"),void this.reader.cancel().catch(function(e){r.options.debug&&s.debug("Fetch.pump.reader.cancel exception",e)});this.reader.read().then(function(e){if(e.done)return r.options.onEnd(),t;r.options.onChunk(e.value),r.pump(r.reader,t)}).catch(function(e){r.cancelled?r.options.debug&&s.debug("Fetch.catch - request cancelled"):(r.cancelled=!0,r.options.debug&&s.debug("Fetch.catch",e.message),r.options.onEnd(e))})},e.prototype.send=function(e){var t=this;fetch(this.options.url,i(i({},this.init),{headers:this.metadata.toHeaders(),method:"POST",body:e,signal:this.controller&&this.controller.signal})).then(function(e){if(t.options.debug&&s.debug("Fetch.response",e),t.options.onHeaders(new n.Metadata(e.headers),e.status),!e.body)return e;t.pump(e.body.getReader(),e)}).catch(function(e){t.cancelled?t.options.debug&&s.debug("Fetch.catch - request cancelled"):(t.cancelled=!0,t.options.debug&&s.debug("Fetch.catch",e.message),t.options.onEnd(e))})},e.prototype.sendMessage=function(e){this.send(e)},e.prototype.finishSend=function(){},e.prototype.start=function(e){this.metadata=e},e.prototype.cancel=function(){var e=this;this.cancelled?this.options.debug&&s.debug("Fetch.cancel already cancelled"):(this.cancelled=!0,this.controller?(this.options.debug&&s.debug("Fetch.cancel.controller.abort"),this.controller.abort()):this.options.debug&&s.debug("Fetch.cancel.missing abort controller"),this.reader?(this.options.debug&&s.debug("Fetch.cancel.reader.cancel"),this.reader.cancel().catch(function(t){e.options.debug&&s.debug("Fetch.cancel.reader.cancel exception",t)})):this.options.debug&&s.debug("Fetch.cancel before reader"))},e}();t.detectFetchSupport=function(){return"undefined"!=typeof Response&&Response.prototype.hasOwnProperty("body")&&"function"==typeof Headers}},859:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.CrossBrowserHttpTransport=void 0;var i=r(229),n=r(210);t.CrossBrowserHttpTransport=function(e){if(i.detectFetchSupport()){var t={credentials:e.withCredentials?"include":"same-origin"};return i.FetchReadableStreamTransport(t)}return n.XhrTransport({withCredentials:e.withCredentials})}},210:function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.stringToArrayBuffer=t.MozChunkedArrayBufferXHR=t.XHR=t.XhrTransport=void 0;var s=r(65),o=r(346),a=r(849);t.XhrTransport=function(e){return function(t){if(a.detectMozXHRSupport())return new f(t,e);if(a.detectXHROverrideMimeTypeSupport())return new u(t,e);throw Error("This environment's XHR implementation cannot support binary transfer.")}};var u=function(){function e(e,t){this.options=e,this.init=t}return e.prototype.onProgressEvent=function(){this.options.debug&&o.debug("XHR.onProgressEvent.length: ",this.xhr.response.length);var e=this.xhr.response.substr(this.index);this.index=this.xhr.response.length;var t=c(e);this.options.onChunk(t)},e.prototype.onLoadEvent=function(){this.options.debug&&o.debug("XHR.onLoadEvent"),this.options.onEnd()},e.prototype.onStateChange=function(){this.options.debug&&o.debug("XHR.onStateChange",this.xhr.readyState),this.xhr.readyState===XMLHttpRequest.HEADERS_RECEIVED&&this.options.onHeaders(new s.Metadata(this.xhr.getAllResponseHeaders()),this.xhr.status)},e.prototype.sendMessage=function(e){this.xhr.send(e)},e.prototype.finishSend=function(){},e.prototype.start=function(e){var t=this;this.metadata=e;var r=new XMLHttpRequest;this.xhr=r,r.open("POST",this.options.url),this.configureXhr(),this.metadata.forEach(function(e,t){r.setRequestHeader(e,t.join(", "))}),r.withCredentials=!!this.init.withCredentials,r.addEventListener("readystatechange",this.onStateChange.bind(this)),r.addEventListener("progress",this.onProgressEvent.bind(this)),r.addEventListener("loadend",this.onLoadEvent.bind(this)),r.addEventListener("error",function(e){t.options.debug&&o.debug("XHR.error",e),t.options.onEnd(e.error)})},e.prototype.configureXhr=function(){this.xhr.responseType="text",this.xhr.overrideMimeType("text/plain; charset=x-user-defined")},e.prototype.cancel=function(){this.options.debug&&o.debug("XHR.abort"),this.xhr.abort()},e}();t.XHR=u;var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.configureXhr=function(){this.options.debug&&o.debug("MozXHR.configureXhr: setting responseType to 'moz-chunked-arraybuffer'"),this.xhr.responseType="moz-chunked-arraybuffer"},t.prototype.onProgressEvent=function(){var e=this.xhr.response;this.options.debug&&o.debug("MozXHR.onProgressEvent: ",new Uint8Array(e)),this.options.onChunk(new Uint8Array(e))},t}(u);function c(e){for(var t=new Uint8Array(e.length),r=0,i=0;i<e.length;i++){var n=String.prototype.codePointAt?e.codePointAt(i):function(e,t){var r=e.charCodeAt(t);if(r>=55296&&r<=56319){var i=e.charCodeAt(t+1);i>=56320&&i<=57343&&(r=65536+(r-55296<<10)+(i-56320))}return r}(e,i);t[r++]=255&n}return t}t.MozChunkedArrayBufferXHR=f,t.stringToArrayBuffer=c},849:function(e,t){"use strict";var r;function i(e){var t=function(){if(void 0!==r)return r;if(XMLHttpRequest){r=new XMLHttpRequest;try{r.open("GET","https://localhost")}catch(e){}}return r}();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}Object.defineProperty(t,"__esModule",{value:!0}),t.detectXHROverrideMimeTypeSupport=t.detectMozXHRSupport=t.xhrSupportsResponseType=void 0,t.xhrSupportsResponseType=i,t.detectMozXHRSupport=function(){return"undefined"!=typeof XMLHttpRequest&&i("moz-chunked-arraybuffer")},t.detectXHROverrideMimeTypeSupport=function(){return"undefined"!=typeof XMLHttpRequest&&XMLHttpRequest.prototype.hasOwnProperty("overrideMimeType")}},540:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.WebsocketTransport=void 0;var i,n,s=r(346),o=r(617);(i=n||(n={}))[i.FINISH_SEND=1]="FINISH_SEND";var a=new Uint8Array([1]);t.WebsocketTransport=function(){return function(e){return function(e){e.debug&&s.debug("websocketRequest",e);var t,r=function(e){if("https://"===e.substr(0,8))return"wss://"+e.substr(8);if("http://"===e.substr(0,7))return"ws://"+e.substr(7);throw Error("Websocket transport constructed with non-https:// or http:// host.")}(e.url),i=[];function u(e){if(e===n.FINISH_SEND)t.send(a);else{var r=new Int8Array(e.byteLength+1);r.set(new Uint8Array([0])),r.set(e,1),t.send(r)}}return{sendMessage:function(e){t&&t.readyState!==t.CONNECTING?u(e):i.push(e)},finishSend:function(){t&&t.readyState!==t.CONNECTING?u(n.FINISH_SEND):i.push(n.FINISH_SEND)},start:function(n){(t=new WebSocket(r,["grpc-websockets"])).binaryType="arraybuffer",t.onopen=function(){var r;e.debug&&s.debug("websocketRequest.onopen"),t.send((r="",n.forEach(function(e,t){r+=e+": "+t.join(", ")+"\r\n"}
1),o.encodeASCII(r))),i.forEach(function(e){u(e)})},t.onclose=function(t){e.debug&&s.debug("websocketRequest.onclose",t),e.onEnd()},t.onerror=function(t){e.debug&&s.debug("websocketRequest.onerror",t)},t.onmessage=function(t){e.onChunk(new Uint8Array(t.data))}},cancel:function(){e.debug&&s.debug("websocket.abort"),t.close()}}}(e)}}},35:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unary=void 0;var i=r(65),n=r(934);t.unary=function(e,t){if(e.responseStream)throw Error(".unary cannot be used with server-streaming methods. Use .invoke or .client instead.");if(e.requestStream)throw Error(".unary cannot be used with client-streaming methods. Use .client instead.");var r=null,s=null,o=n.client(e,{host:t.host,transport:t.transport,debug:t.debug});return o.onHeaders(function(e){r=e}),o.onMessage(function(e){s=e}),o.onEnd(function(e,n,o){t.onEnd({status:e,statusMessage:n,headers:r||new i.Metadata,message:s,trailers:o})}),o.start(t.metadata),o.send(t.request),o.finishSend(),{close:function(){o.close()}}}},882:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.frameRequest=void 0,t.frameRequest=function(e){var t=e.serializeBinary(),r=new ArrayBuffer(t.byteLength+5);return new DataView(r,1,4).setUint32(0,t.length,!1),new Uint8Array(r,5).set(t),new Uint8Array(r)}}},t={},function r(i){if(t[i])return t[i].exports;var n=t[i]={exports:{}};return e[i].call(n.exports,n,n.exports,r),n.exports}(607)},e.exports=t()},9953:(e,t,r)=>{"use strict";let i,n,s,o,a;r.d(t,{JR:()=>iV,QF:()=>g$,$W:()=>eq,Ny:()=>gF,P:()=>nu,Vb:()=>gH});var u,f,c,h,l,d={};r.r(d),r.d(d,{identity:()=>ax});var p={};r.r(p),r.d(p,{base2:()=>aS});var g={};r.r(g),r.d(g,{base8:()=>aM});var m={};r.r(m),r.d(m,{base10:()=>aI});var b={};r.r(b),r.d(b,{base16:()=>aA,base16upper:()=>aR});var y={};r.r(y),r.d(y,{base32:()=>aD,base32hex:()=>aT,base32hexpad:()=>aC,base32hexpadupper:()=>aL,base32hexupper:()=>ak,base32pad:()=>aP,base32padupper:()=>aN,base32upper:()=>aO,base32z:()=>aU});var v={};r.r(v),r.d(v,{base36:()=>aj,base36upper:()=>aB});var w={};r.r(w),r.d(w,{base58btc:()=>aq,base58flickr:()=>az});var _={};r.r(_),r.d(_,{base64:()=>aF,base64pad:()=>a$,base64url:()=>aH,base64urlpad:()=>aK});var E={};r.r(E),r.d(E,{base256emoji:()=>aJ});var x={};r.r(x),r.d(x,{sha256:()=>a4,sha512:()=>a9});var S={};r.r(S),r.d(S,{identity:()=>a7});var M={};r.r(M),r.d(M,{code:()=>ut,decode:()=>ui,encode:()=>ur,name:()=>ue});var I={};r.r(I),r.d(I,{code:()=>ua,decode:()=>uf,encode:()=>uu,name:()=>uo});var A=r(4794);function R(e,t){if(!e){let e=Error(`INVARIANT ${t}`);e.stack=e.stack?.split("\n")?.filter(e=>!/at invariant/.test(e))?.join("\n");for(var r=arguments.length,i=Array(r>2?r-2:0),n=2;n<r;n++)i[n-2]=arguments[n];throw console.error("\n\n---\n\n",e,"\n\n",...i,"\n\n---\n\n"),e}}let D={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},O=new Uint8Array(16),P=[];for(let e=0;e<256;++e)P.push((e+256).toString(16).slice(1));let N=function(e,t,r){if(D.randomUUID&&!t&&!e)return D.randomUUID();let n=(e=e||{}).random||(e.rng||function(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(O)})();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return function(e,t=0){return P[e[t+0]]+P[e[t+1]]+P[e[t+2]]+P[e[t+3]]+"-"+P[e[t+4]]+P[e[t+5]]+"-"+P[e[t+6]]+P[e[t+7]]+"-"+P[e[t+8]]+P[e[t+9]]+"-"+P[e[t+10]]+P[e[t+11]]+P[e[t+12]]+P[e[t+13]]+P[e[t+14]]+P[e[t+15]]}(n)};var T=function(e){return e.UNKNOWN="UNKNOWN",e.SCRIPT="SCRIPT",e.TRANSACTION="TRANSACTION",e.GET_TRANSACTION_STATUS="GET_TRANSACTION_STATUS",e.GET_ACCOUNT="GET_ACCOUNT",e.GET_EVENTS="GET_EVENTS",e.PING="PING",e.GET_TRANSACTION="GET_TRANSACTION",e.GET_BLOCK="GET_BLOCK",e.GET_BLOCK_HEADER="GET_BLOCK_HEADER",e.GET_COLLECTION="GET_COLLECTION",e.GET_NETWORK_PARAMETERS="GET_NETWORK_PARAMETERS",e.SUBSCRIBE_EVENTS="SUBSCRIBE_EVENTS",e.GET_NODE_VERSION_INFO="GET_NODE_VERSION_INFO",e}({}),k=function(e){return e.BAD="BAD",e.OK="OK",e}({}),C=function(e){return e.AUTHORIZER="authorizer",e.PAYER="payer",e.PROPOSER="proposer",e}({}),L=function(e){return e.ARGUMENT="ARGUMENT",e.ACCOUNT="ACCOUNT",e}({});let U=()=>{let e;let t=[];return{async deliver(r){t.push(r),e&&(e(t.shift()),e=void 0)},receive:()=>new Promise(function(r){let i=t.shift();if(i)return r(i);e=r})}},j=e=>
1(n||(n=Promise.resolve())).then(e).catch(e=>setTimeout(()=>{throw e},0)),B="INIT",q="SUBSCRIBE",z="UNSUBSCRIBE",F="UPDATED",$="SNAPSHOT",H="EXIT",K="TERMINATE",V="object"==typeof self&&self.self===self&&self||"object"==typeof r.g&&r.g.global===r.g&&r.g||"object"==typeof window&&window.window===window&&window||{FCL_REGISTRY:null};V.FCL_REGISTRY=null==V.FCL_REGISTRY?{}:V.FCL_REGISTRY;let G=V.FCL_REGISTRY,W=0;function J(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{expectReply:!1};return new Promise((n,s)=>{let o=i.expectReply||!1,a=null!=i.timeout?i.timeout:5e3;o&&a&&setTimeout(()=>s(Error(`Timeout: ${a}ms passed without a response.`)),a);let u={to:e,from:i.from,tag:t,data:r,timeout:a,reply:n,reject:s};try{G[e]&&G[e].mailbox.deliver(u),o||n(!0)}catch(t){console.error("FCL.Actor -- Could Not Deliver Message",u,G[e],t),s(t)}})}let X=e=>{delete G[e]},Y=e=>async t=>{for("function"==typeof e[B]&&await e[B](t);;){let r=await t.receive();try{if(r.tag===H){"function"==typeof e[K]&&await e[K](t,r,r.data||{});break}await e[r.tag]?.(t,r,r.data||{})}catch(e){console.error(`${t.self()} Error`,r,e)}finally{continue}}},Z=e=>{if(null==e){for(;G[String(W)];)W++;return String(W)}return String(e)},Q=function(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=Z(r);if(null!=G[i])return i;G[i]={addr:i,mailbox:U(),subs:new Set,kvs:{},error:null};let n=ee(i);return t="object"==typeof e?Y(e):e,j(async()=>{await t(n),X(i)}),i},ee=e=>({self:()=>e,receive:()=>G[e].mailbox.receive(),send:function(t,r,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(null!=t)return n.from=e,J(t,r,i,n)},sendSelf:function(t,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};G[e]&&J(e,t,r,i)},broadcast:function(t,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(let n of(i.from=e,G[e].subs))J(n,t,r,i)},subscribe:t=>null!=t&&G[e].subs.add(t),unsubscribe:t=>null!=t&&G[e].subs.delete(t),subscriberCount:()=>G[e].subs.size,hasSubs:()=>!!G[e].subs.size,put:(t,r)=>{null!=t&&(G[e].kvs[t]=r)},get:function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=G[e].kvs[t];return null==i?r:i},delete:t=>{delete G[e].kvs[t]},update:(t,r)=>{null!=t&&(G[e].kvs[t]=r(G[e].kvs[t]))},keys:()=>Object.keys(G[e].kvs),all:()=>G[e].kvs,where:t=>Object.keys(G[e].kvs).reduce((r,i)=>t.test(i)?{...r,[i]:G[e].kvs[i]}:r,{}),merge:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.keys(t).forEach(r=>G[e].kvs[r]=t[r])},fatalError:t=>{for(let r of(G[e].error=t,G[e].subs))J(r,F)}});function et(e,t,r){t(e);let i=Q(async t=>{for(t.send(e,q);;){let i=await t.receive(),n=G[e].error;if(i.tag===H){t.send(e,z);return}if(n){r(null,n),t.send(e,z);return}r(i.data,null)}});return()=>J(i,H)}function er(e,t){return t(e),J(e,$,null,{expectReply:!0,timeout:0})}let ei=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>t.reduce((e,t)=>t(e),e)},en=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>t.reduce((t,r)=>({...t,...r(e)}),{})},es=e=>e&&"object"==typeof e&&!Array.isArray(e),eo=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(!r.length)return e;let n=r.shift();if(es(e)&&es(n))for(let t in n)es(n[t])?(e[t]||Object.assign(e,{[t]:{}}),eo(e[t],n[t])):Object.assign(e,{[t]:n[t]});return eo(e,...r)},ea=e=>Array.isArray(e)?eo({},...e):e,eu=e=>e.contracts?e.contracts:{},ef=e=>e.dependencies?e.dependencies:{},ec=e=>t=>Object.entries(t).reduce((t,r)=>{let[i,n]=r,s=n?.aliases?.[e];return s&&(t[i]=s),t},{}),eh=e=>t=>Object.entries(t).reduce((t,r)=>{let[i,n]=r,s=n?.aliases?.[e];return s&&(t[i]=s),t},{}),el=e=>t=>{let{deployments:r={},accounts:i={}}=t,n=r?.[e];return n?Object.entries(n).reduce((e,t)=>{let[r,n]=t,s=i[r]?.address;return s?n.reduce((e,t)=>({...e,[t]:s}),{}):e},{}):{}},ed=(e,t)=>ei(ea,en(el(t),ei(eu,ec(t)),ei(ef,eh(t))))(e),ep=e=>"string"==typeof e&&/^[0-9A-Fa-f]+$/.test(e),eg=e=>Object.entries(e?.accounts??[]).reduce((e,t)=>{let[,r]=t;return!!e||r&&Object.prototype.hasOwnProperty.call(r,"key")&&ep(r?.key)},!1),em=e=>Array.isArray(e)?e.some(eg):eg(e),eb=e=>{let t=e?.toLowerCase()==="local"?"emulator":e?.toLowerCase();if("emulator"===t||"testnet"===t||"mainnet"===t||"previewnet"===t)return t;throw Error(`Invalid network "${e}". Must be one of "emulator", "local", "testnet", or "mainnet"`)};A.Nk(eq);let ey="config",ev="PUT_CONFIG",ew="GET_CONFIG",e_="GET_ALL_CONFIG",eE="UPDATE_CONFIG",ex="DELETE_CONFIG",eS="CLEAR_CONFIG",eM="WHERE_CONFIG",eI="CONFIG/UPDATED",eA=e=>e,eR={[ev]:(e,t,r)=>{let{key:i,value:n}=r;if(null==i)throw Error("Missing 'key' for config/put.");e.put(i,n),e.broadcast(eI,{...e.all()})},[ew]:(e,t,r)=>{let{key:i,fallback:n}=r;if(null==i)throw Error("Missing 'key' for config/get");t.reply(e.get(i,n))},[e_]:(e,t)=>{t.reply({...e.all()})},[eE]:(e,t,r)=>{let{key:i,fn:n}=r;if(null==i)throw Error("Missing 'key' for config/update");e.update(i,n||eA),e.broadcast(eI,{...e.all()})},[ex]:(e,t,r)=>{let{key:i}=r;if(null==i)throw Error("Missing 'key' for config/delete");e.delete(i),e.broadcast(eI,{...e.all()})},[eS]:e=>{for(let t of Object.keys(e.all()))e.delete(t);e.broadcast(eI,{...e.all()})},[eM]:(e,t,r)=>{let{pattern:i}=r;if(null==i)throw Error("Missing 'pattern' for config/where");t.reply(e.where(i))},[q]:(e,t)=>{e.subscribe(t.from),e.send(t.from,eI,{...e.all()})},[z]:(e,t)=>{e.unsubscribe(t.from)}};function eD(e,t){return J(ey,ev,{key:e,value:t}),eq()}function eO(e,t){return J(ey,ew,{key:e,fallback:t},{expectReply:!0,timeout:10})}async function eP(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if(!e.length)return t;let[r,...i]=e,n=await eO(r);return null==n?eP(i,t):n}function eN(){return J(ey,e_,null,{expectReply:!0,timeout:10})}function eT(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eA;return J(ey,eE,{key:e,fn:t}),eq()}function ek(e){return J(ey,ex,{key:e}),eq()}function eC(e){return J(ey,eM,{pattern:e},{expectReply:!0,timeout:10})}
1function eL(e){return et(ey,()=>Q(eR,ey),e)}async function eU(){await J(ey,eS)}async function ej(e){return eU().then(()=>eq(e))}async function eB(e){let{ignoreConflicts:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=eb(await eO("flow.network")),{flowJSON:i}=e;if(R(!!i,"config.load -- 'flowJSON' must be defined"),R(!!r,'Flow Network Required -- In order for FCL to load your contracts please define "flow.network" to "emulator", "local", "testnet", or "mainnet" in your config. See more here: https://developers.flow.com/tools/fcl-js/reference/configure-fcl'),em(i)){let e="emulator"===r;A.Rm({title:"Private Keys Detected",message:"Private keys should be stored in a separate flow.json file for security. See more here: https://developers.flow.com/tools/flow-cli/security",level:e?A.A_.warn:A.A_.error}),R(e,"Private keys should be stored in a separate flow.json file for security. See more here: https://developers.flow.com/tools/flow-cli/security")}for(let[e,n]of Object.entries(ed(i,r))){let r=`0x${e}`,i=await eO(r);i&&i!==n&&!t?A.Rm({title:"Contract Placeholder Conflict Detected",message:"A generated contract placeholder from config.load conflicts with a placeholder you've set manually in config have the same name.",level:A.A_.warn}):eD(r,n);let s=`system.contracts.${e}`,o=await eO(s);o&&o!==n&&!t?A.Rm({title:"Contract Placeholder Conflict Detected",message:"A generated contract placeholder from config.load conflicts with a placeholder you've set manually in config have the same name.",level:A.A_.warn}):eD(s,n)}}function eq(e){return null!=e&&"object"==typeof e&&Object.keys(e).map(t=>eD(t,e[t])),{put:eD,get:eO,all:eN,first:eP,update:eT,delete:ek,where:eC,subscribe:eL,overload:ez,load:eB}}async function ez(e,t){let r=await eN();try{return eq(e),await t(await eN())}finally{await ej(r)}}Q(eR,ey),eq.put=eD,eq.get=eO,eq.all=eN,eq.first=eP,eq.update=eT,eq.delete=ek,eq.where=eC,eq.subscribe=eL,eq.overload=ez,eq.load=eB;var eF=r(5927);function e$(e){if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r++)t.push(e$(e[r]));let r=eF.Buffer.concat(t);return eF.Buffer.concat([eH(r.length,192),r])}{let t=function(e){if(!eF.Buffer.isBuffer(e)){if("string"==typeof e){var t;return eK(e)?eF.Buffer.from((t="string"!=typeof e?e:eK(e)?e.slice(2):e).length%2?"0"+t:t,"hex"):eF.Buffer.from(e)}if("number"==typeof e)return e?function(e){let t=eV(e);return eF.Buffer.from(t,"hex")}(e):eF.Buffer.from([]);if(null==e)return eF.Buffer.from([]);if(e instanceof Uint8Array)return eF.Buffer.from(e);else throw Error("invalid type")}return e}(e);return 1===t.length&&t[0]<128?t:eF.Buffer.concat([eH(t.length,128),t])}}function eH(e,t){if(e<56)return eF.Buffer.from([e+t]);{let r=eV(e),i=eV(t+55+r.length/2);return eF.Buffer.from(i+r,"hex")}}function eK(e){return"0x"===e.slice(0,2)}function eV(e){if(e<0)throw Error("Invalid integer as argument, must be unsigned!");let t=e.toString(16);return t.length%2?"0"+t:t}var eG=r(5647),eW=r.n(eG);function eJ(e){return null==e?null:e.replace(/^0x/,"").replace(/^Fx/,"")}function eX(e){return null==e?null:"0x"+eJ(e)}var eY=r(429),eZ=r.n(eY),eQ=null;"undefined"!=typeof WebSocket?eQ=WebSocket:"undefined"!=typeof MozWebSocket?eQ=MozWebSocket:void 0!==r.g?eQ=r.g.WebSocket||r.g.MozWebSocket:"undefined"!=typeof window?eQ=window.WebSocket||window.MozWebSocket:"undefined"!=typeof self&&(eQ=self.WebSocket||self.MozWebSocket);let e0=eQ;function e1(e){try{return JSON.parse(e)}catch{return null}}let e2=globalThis.AbortController||r(6800);class e6 extends Error{constructor(e){let{error:t,hostname:r,path:i,method:n,requestBody:s,responseBody:o,responseStatusText:a,statusCode:u}=e;super(`
2      HTTP Request Error: An error occurred when interacting with the Access API.
3      ${t?`error=${t}`:""}
4      ${r?`hostname=${r}`:""}
5      ${i?`path=${i}`:""}
6      ${n?`method=${n}`:""}
7      ${s?`requestBody=${s}`:""}
8      ${o?`responseBody=${o}`:""}
9      ${a?`responseStatusText=${a}`:""}
10      ${u?`statusCode=${u}`:""}
11    `),this.name="HTTP Request Error",this.statusCode=u,this.errorMessage=t}}async function e3(e){let{hostname:t,path:r,method:i,body:n,headers:s,retryLimit:o=5,retryIntervalMs:a=1e3,timeoutLimit:u=3e4,enableRequestLogging:f=!0}=e,c=n?JSON.stringify(n):null;async function h(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{return await function(){let e=new e2,n=setTimeout(()=>{e.abort()},u);return eW()((r?t.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):t).toString(),{method:i,body:c,headers:s,signal:e.signal}).then(async e=>{if(e.ok)return e.json();let n=await e.text().catch(()=>null),s=e1(n);throw new e6({error:s?.message,hostname:t,path:r,method:i,requestBody:c,responseBody:n,responseStatusText:e.statusText,statusCode:e.status})}).catch(async e=>{if(e instanceof e6||"AbortError"===e.name)throw e;throw f&&await A.Rm({title:"Access Node Error",message:`The provided access node ${t} does not appear to be a valid REST/HTTP access node.
12  Please verify that you are not unintentionally using a GRPC access node.
13  See more here: https://docs.onflow.org/fcl/reference/sdk-guidelines/#connect`,level:A.A_.error}),new e6({error:e?.message,hostname:t,path:r,method:i,requestBody:c})}).finally(()=>{clearTimeout(n)})}()}catch(t){if("AbortError"===t.name||[408,429,500,502,503,504].includes(t.statusCode))return await new Promise((r,i)=>{e<o?(f&&console.warn(`Access node unavailable, retrying in ${a} ms...`),setTimeout(()=>{r(h(e+1))},a)):i(t)});throw t}}return await h()}async function e5(e,t,r){let i=r.httpRequest||e3,n=await i({hostname:r.node,path:`/v1/scripts?block_id=${e.block.id}`,method:"POST",body:{script:t.Buffer.from(e.message.cadence).toString("base64"),arguments:e.message.arguments.map(r=>t.Buffer.from(JSON.stringify(e.arguments[r].asArgument)).toString("base64"))}});return e9(e,t,n)}async function e8(e,t,r){let i=r.httpRequest||e3,n=await i({hostname:r.node,path:`/v1/scripts?block_height=${e.block.height}`,method:"POST",body:{script:t.Buffer.from(e.message.cadence).toString("base64"),arguments:e.message.arguments.map(r=>t.Buffer.from(JSON.stringify(e.arguments[r].asArgument)).toString("base64"))}});return e9(e,t,n)}async function e4(e,t,r){let i=r.httpRequest||e3,n=await i({hostname:r.node,path:"/v1/scripts?block_height=sealed",method:"POST",body:{script:t.Buffer.from(e.message.cadence).toString("base64"),arguments:e.message.arguments.map(r=>t.Buffer.from(JSON.stringify(e.arguments[r].asArgument)).toString("base64"))}});return e9(e,t,n)}function e9(e,t,r){let i=t.response();return i.tag=e.tag,i.encodedData=JSON.parse(t.Buffer.from(r,"base64").toString()),i}async function e7(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};
13return(R(r.node,"SDK Send Execute Script Error: opts.node must be defined."),R(t.response,"SDK Send Execute Script Error: context.response must be defined."),R(t.Buffer,"SDK Send Execute Script Error: context.Buffer must be defined."),(e=await e).block.id)?await e5(e,t,r):e.block.height?await e8(e,t,r):await e4(e,t,r)}let te={SHA2_256:1,SHA2_384:2,SHA3_256:3,SHA3_384:4,KMAC128_BLS_BLS12_381:5},tt={ECDSA_P256:1,ECDSA_secp256k1:2,BLS_BLS12_381:3};async function tr(e,t,r){let i=r.httpRequest||e3,n=await i({hostname:r.node,path:`/v1/accounts/${e.account.addr}?block_height=${e.block.height}&expand=contracts,keys`,method:"GET",body:null});return tn(e,t,n)}async function ti(e,t,r){let i=r.httpRequest||e3,n=await i({hostname:r.node,path:`/v1/accounts/${e.account.addr}?block_height=sealed&expand=contracts,keys`,method:"GET",body:null});return tn(e,t,n)}function tn(e,t,r){let i=t.response();return i.tag=e.tag,i.account={address:r.address,balance:Number(r.balance),code:"",contracts:(e=>{let r={};if(!e)return r;for(let i of Object.keys(e))r[i]=t.Buffer.from(e[i],"base64").toString();return r})(r.contracts),keys:r.keys?.map(e=>({index:Number(e.index),publicKey:e.public_key.replace(/^0x/,""),signAlgo:tt[e.signing_algorithm],signAlgoString:e.signing_algorithm,hashAlgo:te[e.hashing_algorithm],hashAlgoString:e.hashing_algorithm,sequenceNumber:Number(e.sequence_number),weight:Number(e.weight),revoked:e.revoked}))??[]},i}async function ts(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(R(r.node,"SDK Send Get Account Error: opts.node must be defined."),R(t.response,"SDK Send Get Account Error: context.response must be defined."),R(t.Buffer,"SDK Send Get Account Error: context.Buffer must be defined."),null!==(e=await e).block.height)?await tr(e,t,r):await ti(e,t,r)}async function to(e,t,r){let i=r.httpRequest||e3,n=await i({hostname:r.node,path:`/v1/blocks/${e.block.id}`,method:"GET",body:null});return tf(e,t,n)}async function ta(e,t,r){let i=r.httpRequest||e3,n=await i({hostname:r.node,path:`/v1/blocks?height=${e.block.height}`,method:"GET",body:null});return tf(e,t,n)}async function tu(e,t,r){let i=r.httpRequest||e3,n=e.block?.isSealed?"sealed":"final";return tf(e,t,await i({hostname:r.node,path:`/v1/blocks?height=${n}`,method:"GET",body:null}))}function tf(e,t,r){let i=r.length?r[0]:null,n=t.response();return n.tag=e.tag,n.blockHeader={id:i.header.id,parentId:i.header.parent_id,height:Number(i.header.height),timestamp:i.header.timestamp},n}async function tc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};R(r.node,"SDK Send Get Block Header Error: opts.node must be defined."),R(t.response,"SDK Send Get Block Header Error: context.response must be defined.");let i=null!==(e=await e).block.id,n=null!==e.block.height;return i?await to(e,t,r):n?await ta(e,t,r):await tu(e,t,r)}async function th(e,t,r){let i=r.httpRequest||e3,n=await i({hostname:r.node,path:`/v1/blocks/${e.block.id}?expand=payload`,method:"GET",body:null});return tp(e,t,n)}async function tl(e,t,r){let i=r.httpRequest||e3,n=await i({hostname:r.node,path:`/v1/blocks?height=${e.block.height}&expand=payload`,method:"GET",body:null});return tp(e,t,n)}async function td(e,t,r){let i=r.httpRequest||e3,n=e.block?.isSealed?"sealed":"final";return tp(e,t,await i({hostname:r.node,path:`/v1/blocks?height=${n}&expand=payload`,method:"GET",body:null}))}function tp(e,t,r){let i=r.length?r[0]:null,n=t.response();return n.tag=e.tag,n.block={id:i.header.id,parentId:i.header.parent_id,height:Number(i.header.height),timestamp:i.header.timestamp,collectionGuarantees:i.payload.collection_guarantees.map(e=>({collectionId:e.collection_id,signerIds:e.signer_ids})),blockSeals:i.payload.block_seals.map(e=>({blockId:e.block_id,executionReceiptId:e.result_id}))},n}async function tg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};R(r.node,"SDK Send Get Block Error: opts.node must be defined."),R(t.response,"SDK Send Get Block Error: context.response must be defined.");let i=null!==(e=await e).block.id,n=null!==e.block.height;return i?await th(e,t,r):n?await tl(e,t,r):await td(e,t,r)}async function tm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};R(r.node,"SDK Send Get Collection Error: opts.node must be defined."),R(t.response,"SDK Send Get Collection Error: context.response must be defined.");let i=r.httpRequest||e3,n=await i({hostname:r.node,path:`/v1/collections/${e.collection.id}?expand=transactions`,method:"GET",body:null}),s=t.response();return s.tag=e.tag,s.collection={id:n.id,transactionIds:n.transactions.map(e=>e.id)},s}async function tb(e,t,r){let i=r.httpRequest||e3,n=await i({hostname:r.node,path:`/v1/events?type=${e.events.eventType}&start_height=${e.events.start}&end_height=${e.events.end}`,method:"GET",body:null});return tv(e,t,n)}async function ty(e,t,r){let i=r.httpRequest||e3,n=await i({hostname:r.node,path:`/v1/events?type=${e.events.eventType}&block_ids=${e.events.blockIds.join(",")}`,method:"GET",body:null});return tv(e,t,n)}function tv(e,t,r){let i=t.response();
13return i.tag=e.tag,i.events=[],r.forEach(e=>e.events?e.events.forEach(r=>i.events.push({blockId:e.block_id,blockHeight:Number(e.block_height),blockTimestamp:e.block_timestamp,type:r.type,transactionId:r.transaction_id,transactionIndex:Number(r.transaction_index),eventIndex:Number(r.event_index),payload:JSON.parse(t.Buffer.from(r.payload,"base64").toString())})):null),i}async function tw(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};R(r.node,"SDK Send Get Events Error: opts.node must be defined."),R(t.response,"SDK Send Get Events Error: context.response must be defined."),R(t.Buffer,"SDK Send Get Events Error: context.Buffer must be defined.");let i=null!==(e=await e).events.start,n=Array.isArray(e.events.blockIds)&&e.events.blockIds.length>0;return(R(i||n,"SendGetEventsError: Unable to determine which get events request to send. Either a block height range, or block IDs must be specified."),i)?await tb(e,t,r):await ty(e,t,r)}async function t_(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};R(i.node,"SDK Send Get Transaction Error: opts.node must be defined."),R(r.response,"SDK Send Get Transaction Error: context.response must be defined."),R(r.Buffer,"SDK Send Get Transaction Error: context.Buffer must be defined.");let n=i.httpRequest||e3;e=await e;let s=await n({hostname:i.node,path:`/v1/transactions/${e.transaction.id}`,method:"GET",body:null}),o=e=>({address:e.address,keyId:Number(e.key_index),signature:e.signature}),a=r.response();return a.tag=e.tag,a.transaction={script:r.Buffer.from(s.script,"base64").toString(),args:[...s.arguments.map(e=>JSON.parse(r.Buffer.from(e,"base64").toString()))],referenceBlockId:s.reference_block_id,gasLimit:Number(s.gas_limit),payer:s.payer,proposalKey:s.proposal_key?{address:(t=s.proposal_key).address,keyId:Number(t.key_id),sequenceNumber:Number(t.sequence_number)}:s.proposal_key,authorizers:s.authorizers,payloadSignatures:[...s.payload_signatures.map(o)],envelopeSignatures:[...s.envelope_signatures.map(o)]},a}let tE={UNKNOWN:0,PENDING:1,FINALIZED:2,EXECUTED:3,SEALED:4,EXPIRED:5};async function tx(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};R(r.node,"SDK Send Get Transaction Status Error: opts.node must be defined."),R(t.response,"SDK Send Get Transaction Status Error: context.response must be defined."),R(t.Buffer,"SDK Send Get Transaction Status Error: context.Buffer must be defined.");let i=r.httpRequest||e3;e=await e;let n=await i({hostname:r.node,path:`/v1/transaction_results/${e.transaction.id}`,method:"GET",body:null}),s=t.response();return s.tag=e.tag,s.transactionStatus={blockId:n.block_id,status:tE[n.status.toUpperCase()]||"",statusString:n.status.toUpperCase(),statusCode:n.status_code,errorMessage:n.error_message,events:n.events.map(e=>({type:e.type,transactionId:e.transaction_id,transactionIndex:Number(e.transaction_index),eventIndex:Number(e.event_index),payload:JSON.parse(t.Buffer.from(e.payload,"base64").toString())}))},s}async function tS(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};R(!!r.node,"SDK Send Ping Error: opts.node must be defined."),R(!!t.response,"SDK Send Ping Error: context.response must be defined.");let i=r.httpRequest||e3;await i({hostname:r.node,path:"/v1/blocks?height=sealed",method:"GET",body:null});let n="function"==typeof t?.response?t.response():{};return n.tag=e.tag,n}let tM=e=>`${withPrefix(e.addr)}-${e.keyId}`;async function tI(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};R(r.node,"SDK Send Transaction Error: opts.node must be defined."),R(t.response,"SDK Send Transaction Error: context.response must be defined."),R(t.Buffer,"SDK Send Transaction Error: context.Buffer must be defined.");let i=r.httpRequest||e3;e=await e;let n=[];
13for(let r of Object.values(e.accounts))try{if(!r.role.payer&&null!=r.signature){let e={address:eJ(r.addr),key_index:String(r.keyId),signature:t.Buffer.from(r.signature,"hex").toString("base64")};n.find(t=>t.address===e.address&&t.key_index===e.key_index&&t.signature===e.signature)||n.push(e)}}catch(t){throw console.error("SDK HTTP Send Error: Trouble applying payload signature",{acct:r,ix:e}),t}let s={};for(let r of Object.values(e.accounts))try{if(r.role.payer&&null!=r.signature){let e=r.tempId||tM(r);s[e]=s[e]||{address:eJ(r.addr),key_index:String(r.keyId),signature:t.Buffer.from(r.signature,"hex").toString("base64")}}}catch(t){throw console.error("SDK HTTP Send Error: Trouble applying envelope signature",{acct:r,ix:e}),t}s=Object.values(s);var o=Date.now();let a=await i({hostname:r.node,path:"/v1/transactions",method:"POST",body:{script:t.Buffer.from(e.message.cadence).toString("base64"),arguments:[...e.message.arguments.map(r=>t.Buffer.from(JSON.stringify(e.arguments[r].asArgument)).toString("base64"))],reference_block_id:e.message.refBlock?e.message.refBlock:null,gas_limit:String(e.message.computeLimit),payer:eJ(e.accounts[Array.isArray(e.payer)?e.payer[0]:e.payer].addr),proposal_key:{address:eJ(e.accounts[e.proposer].addr),key_index:String(e.accounts[e.proposer].keyId),sequence_number:String(e.accounts[e.proposer].sequenceNum)},authorizers:e.authorizations.map(t=>e.accounts[t].addr).reduce((e,t)=>e.find(e=>e===t)?e:[...e,t],[]).map(eJ),payload_signatures:n,envelope_signatures:s}});var u=Date.now();let f=t.response();return f.tag=e.tag,f.transactionId=a.id,"undefined"!=typeof window&&"undefined"!=typeof CustomEvent&&window.dispatchEvent(new CustomEvent("FLOW::TX",{detail:{txId:f.transactionId,delta:u-o}})),f}async function tA(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};R(r.node,"SDK Send Get Network Parameters Error: opts.node must be defined."),R(t.response,"SDK Send Get Network Parameters Error: context.response must be defined.");let i=r.httpRequest||e3;e=await e;let n=await i({hostname:r.node,path:"/v1/network/parameters",method:"GET",body:null,enableRequestLogging:r.enableRequestLogging??!0}),s=t.response();return s.tag=e.tag,s.networkParameters={chainId:n.chain_id},s}async function tR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};R(r.node,"SDK Send Get Node Version Info Error: opts.node must be defined."),R(t.response,"SDK Send Get Node Verison Info Error: context.response must be defined.");let i=r.httpRequest||e3;e=await e;let n=await i({hostname:r.node,path:"/v1/node_version_info",method:"GET"}),s=t.response();return s.tag=e.tag,s.nodeVersionInfo={semver:n.semver,commit:n.commit,sporkId:n.spork_id,protocolVersion:parseInt(n.protocol_version),sporkRootBlockHeight:parseInt(n.spork_root_block_height),nodeRootBlockHeight:parseInt(n.node_root_block_height)},s}
13class tD extends Error{constructor(e){let{code:t,reason:r,message:i,wasClean:n}=e;super(`
14      connectWs: connection closed with error${i?`: ${i}`:""}
15      ${t?`code: ${t}`:""}
16      ${r?`reason: ${r}`:""}
17      ${n?`wasClean: ${n}`:""}
18    `),this.name="WebsocketError",this.code=t,this.reason=r,this.wasClean=!1}}function tO(e){let{hostname:t,path:r,params:i,getParams:n,retryLimit:s=5,retryIntervalMs:o=1e3}=e;if(n&&i)throw Error("connectWs: cannot specify both params and getParams");let a=new eY.EventEmitter,u=0,f=n||(()=>i),c=()=>{};return!function e(){let i=!1,n=!1,h=new e0(function(e,t,r){let i=new URL(t||"",e);return"https:"===i.protocol?i.protocol="wss:":"http:"===i.protocol&&(i.protocol="ws:"),Object.entries(r||{}).forEach(e=>{let[t,r]=e;if(r){let e;e=Array.isArray(r)?r.join(","):r.toString(),i.searchParams.append(t,e)}}),i.toString()}(t,r,f()));h.onmessage=function(e){let t=e1(e.data);t?a.emit("data",t):(a.emit("error",new tD({message:"invalid JSON data"})),this.close())},h.onclose=function(t){if(i){a.emit("close"),a.removeAllListeners();return}n?setTimeout(e,o):u<s?(u++,setTimeout(e,o)):(a.emit("error",new tD({wasClean:t.wasClean,code:t.code,reason:t.reason,message:"failed to connect"})),setTimeout(()=>{a.emit("close"),a.removeAllListeners()}))},h.onopen=function(){n=!0,u=0},c=()=>{i=!0,h.close()}}(),{on(e,t){return a.on(e,t),this},off(e,t){return a.off(e,t),this},close(){c()}}}async function tP(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};R(r.node,"SDK Send Get Events Error: opts.node must be defined."),R(t.response,"SDK Send Get Events Error: context.response must be defined."),R(t.Buffer,"SDK Send Get Events Error: context.Buffer must be defined.");let i=await e,n=r.connectWs||tO,s=new eY.EventEmitter,o=null,a=n({hostname:r.node,path:"/v1/subscribe_events",getParams:()=>{let e={event_types:i.subscribeEvents?.eventTypes,addresses:i.subscribeEvents?.addresses,contracts:i.subscribeEvents?.contracts,heartbeat_interval:i.subscribeEvents?.heartbeatInterval};return o?e.start_height=o+1:(e.start_block_id=i.subscribeEvents?.startBlockId,e.start_height=i.subscribeEvents?.startHeight),e}});return a.on("data",e=>{let r=function(e,t,r){let i=t.response();return i.tag=e.tag,i.events=r.Events?.length>0?r.Events.map(e=>({blockId:r.BlockID,blockHeight:Number(r.Height),blockTimestamp:r.BlockTimestamp,type:e.Type,transactionId:e.TransactionID,transactionIndex:Number(e.TransactionIndex),eventIndex:Number(e.EventIndex),payload:JSON.parse(t.Buffer.from(e.Payload,"base64").toString())})):null,i.heartbeat={blockId:r.BlockID,blockHeight:Number(r.Height),blockTimestamp:r.BlockTimestamp},i}(i,t,e);o=r.heartbeat.blockHeight,s.emit("data",r)}),a.on("error",e=>{s.emit("error",e)}),a.on("close",()=>{s.emit("close")}),function(e,t,r){let i=t.response();return i.tag=e.tag,i.streamConnection=r,i}(i,t,{on(e,t){return s.on(e,t),this},off(e,t){return s.off(e,t),this},close(){a.close()}})}let tN=async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};switch(R(!!r?.node,'SDK Send Error: Either opts.node or "accessNode.api" in config must be defined.'),R(!!t.ix,"SDK Send Error: context.ix must be defined."),e=await e,!0){case t.ix.isTransaction(e):return r.sendTransaction?r.sendTransaction(e,t,r):tI(e,t,r);case t.ix.isGetTransactionStatus(e):return r.sendGetTransactionStatus?r.sendGetTransactionStatus(e,t,r):tx(e,t,r);case t.ix.isGetTransaction(e):return r.sendGetTransaction?r.sendGetTransaction(e,t,r):t_(e,t,r);case t.ix.isScript(e):return r.sendExecuteScript?r.sendExecuteScript(e,t,r):e7(e,t,r);case t.ix.isGetAccount(e):return r.sendGetAccount?r.sendGetAccount(e,t,r):ts(e,t,r);case t.ix.isGetEvents(e):return r.sendGetEvents?r.sendGetEvents(e,t,r):tw(e,t,r);case t.ix.isSubscribeEvents?.(e):return r.connectSubscribeEvents?r.connectSubscribeEvents(e,t,r):tP(e,t,r);case t.ix.isGetBlock(e):return r.sendGetBlock?r.sendGetBlock(e,t,r):tg(e,t,r);case t.ix.isGetBlockHeader(e):return r.sendGetBlockHeader?r.sendGetBlockHeader(e,t,r):tc(e,t,r);case t.ix.isGetCollection(e):return r.sendGetCollection?r.sendGetCollection(e,t,r):tm(e,t,r);case t.ix.isPing(e):return r.sendPing?r.sendPing(e,t,r):tS(e,t,r);case t.ix.isGetNetworkParameters(e):return r.sendGetNetworkParameters?r.sendGetNetworkParameters(e,t,r):tA(e,t,r);case t.ix.isGetNodeVersionInfo?.(e):return r.sendGetNodeVersionInfo?r.sendGetNodeVersionInfo(e,t,r):tR(e,t,r);default:return e}};var tT=r(2194);let tk=`{
19  "kind":"${L.ACCOUNT}",
20  "tempId":null,
21  "addr":null,
22  "keyId":null,
23  "sequenceNum":null,
24  "signature":null,
25  "signingFunction":null,
26  "resolve":null,
27  "role": {
28    "proposer":false,
29    "authorizer":false,
30    "payer":false,
31    "param":false
32  }
33}`,tC=`{
34  "kind":"${L.ARGUMENT}",
35  "tempId":null,
36  "value":null,
37  "asArgument":null,
38  "xform":null,
39  "resolve": null,
40  "resolveArgument": null
41}`,tL=`{
42  "tag":"${T.UNKNOWN}",
43  "assigns":{},
44  "status":"${k.OK}",
45  "reason":null,
46  "accounts":{},
47  "params":{},
48  "arguments":{},
49  "message": {
50    "cadence":null,
51    "refBlock":null,
52    "computeLimit":null,
53    "proposer":null,
54    "payer":null,
55    "authorizations":[],
56    "params":[],
57    "arguments":[]
58  },
59  "proposer":null,
60  "authorizations":[],
61  "payer":[],
62  "events": {
63    "eventType":null,
64    "start":null,
65    "end":null,
66    "blockIds":[]
67  },
68  "subscribeEvents": {
69    "startBlockId":null,
70    "startHeight":null,
71    "eventTypes":null,
72    "addresses":null,
73    "contracts":null,
74    "heartbeatInterval":null
75  },
76  "transaction": {
77    "id":null
78  },
79  "block": {
80    "id":null,
81    "height":null,
82    "isSealed":null
83  },
84  "account": {
85    "addr":null
86  },
87  "collection": {
88    "id":null
89  }
90}`,tU=new Set(Object.keys(JSON.parse(tL))),tj=()=>JSON.parse(tL),tB=e=>"number"==typeof e,tq=e=>Array.isArray(e),tz=e=>null!==e&&"object"==typeof e,tF=e=>null==e,t$=e=>"function"==typeof e,tH=e=>{if(!tz(e)||tF(e)||tB(e))return!1;for(let t of tU)if(!e.hasOwnProperty(t))return!1;return!0},tK=e=>(e.status=k.OK,e),tV=(e,t)=>(e.status=k.BAD,e.reason=t,e),tG=e=>t=>(t.tag=e,tK(t)),tW=e=>null==e.keyId?e:(R(!isNaN(parseInt(e.keyId.toString())),"account.keyId must be an integer"),{...e,keyId:parseInt(e.keyId.toString())}),tJ=()=>JSON.parse(tk),tX=e=>t=>{let r=N();return t.message.arguments.push(r),t.arguments[r]=JSON.parse(tC),t.arguments[r].tempId=r,t.arguments[r].value=e.value,t.arguments[r].asArgument=e.asArgument,t.arguments[r].xform=e.xform,t.arguments[r].resolve=e.resolve,t.arguments[r].resolveArgument=t$(e.resolveArgument)?e.resolveArgument.bind(e):e.resolveArgument,tK(t)},tY=tG(T.UNKNOWN),tZ=tG(T.SCRIPT),tQ=tG(T.TRANSACTION),t0=tG(T.GET_TRANSACTION_STATUS),t1=tG(T.GET_TRANSACTION),t2=tG(T.GET_ACCOUNT),t6=tG(T.GET_EVENTS),t3=tG(T.PING),t5=tG(T.GET_BLOCK),t8=tG(T.GET_BLOCK_HEADER),t4=tG(T.GET_COLLECTION),t9=tG(T.GET_NETWORK_PARAMETERS),t7=tG(T.SUBSCRIBE_EVENTS),re=tG(T.GET_NODE_VERSION_INFO),rt=e=>t=>t.tag===e,rr=rt(T.UNKNOWN),ri=rt(T.SCRIPT),rn=rt(T.TRANSACTION),rs=rt(T.GET_TRANSACTION_STATUS),ro=rt(T.GET_TRANSACTION),ra=rt(T.GET_ACCOUNT),ru=rt(T.GET_EVENTS),rf=rt(T.PING),rc=rt(T.GET_BLOCK),rh=rt(T.GET_BLOCK_HEADER),rl=rt(T.GET_COLLECTION),rd=rt(T.GET_NETWORK_PARAMETERS),rp=rt(T.GET_NODE_VERSION_INFO),rg=rt(T.SUBSCRIBE_EVENTS),rm=e=>e.status===k.BAD,rb=e=>{for(let t of Object.keys(e))if(!tU.has(t))throw Error(`"${t}
90" is an invalid root level Interaction property.`);return e},ry=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];try{if(e=rb(await e),rm(e))throw Error(`Interaction Error: ${e.reason}`);if(!t.length)return e;let[r,...i]=t,n=await r;if(t$(n))return ry(n(e),i);if(tF(n)||!n)return ry(e,i);if(tH(n))return ry(n,i);throw Error("Invalid Interaction Composition")}catch(e){throw e}};function rv(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let[i,n]=t;return tq(i)?e=>rv(e,i):ry(i,n)}let rw=function(e){return e},r_=(e,t,r)=>null==e.assigns[t]?r:e.assigns[t],rE=(e,t)=>r=>(r.assigns[e]=t,tK(r)),rx=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rw;return r=>(r.assigns[e]=t(r.assigns[e],r),tK(r))};var rS=Object.freeze({__proto__:null,initInteraction:tj,interaction:()=>(A.Rm.deprecate({pkg:"FCL/SDK",message:"The interaction been deprecated from the Flow JS-SDK/FCL. use initInteraction instead",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/TRANSITIONS.md#0010-deprecate-interaction",level:A.A_.warn}),tj()),isNumber:tB,isArray:tq,isObj:tz,isNull:tF,isFn:t$,isInteraction:tH,Ok:tK,Bad:tV,initAccount:tJ,prepAccount:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r=>{R("function"==typeof e||"object"==typeof e,"prepAccount must be passed an authorization function or an account object"),R(null!=t.role,"Account must have a role");let i=tJ(),n=t.role,s=N(),o={...e};e.authorization&&t$(e.authorization)&&(o={resolve:e.authorization}),!e.authorization&&t$(e)&&(o={resolve:e});let a=o.resolve;return a&&(o.resolve=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return[a,tW].reduce(async(e,t)=>t(await e,...r),e)}),o=tW(o),r.accounts[s]={...i,tempId:s,...o,role:{...i.role,..."object"==typeof e.role?e.role:{},...n?{[n]:!0}:{}}},n===C.AUTHORIZER?r.authorizations.push(s):n===C.PAYER?r.payer.push(s):n&&(r[n]=s),r}},makeArgument:tX,makeUnknown:tY,makeScript:tZ,makeTransaction:tQ,makeGetTransactionStatus:t0,makeGetTransaction:t1,makeGetAccount:t2,makeGetEvents:t6,makePing:t3,makeGetBlock:t5,makeGetBlockHeader:t8,makeGetCollection:t4,makeGetNetworkParameters:t9,makeSubscribeEvents:t7,makeGetNodeVerionInfo:re,isUnknown:rr,isScript:ri,isTransaction:rn,isGetTransactionStatus:rs,isGetTransaction:ro,isGetAccount:ra,isGetEvents:ru,isPing:rf,isGetBlock:rc,isGetBlockHeader:rh,isGetCollection:rl,isGetNetworkParameters:rd,isGetNodeVersionInfo:rp,isSubscribeEvents:rg,isOk:e=>e.status===k.OK,isBad:rm,why:e=>e.reason,isAccount:e=>e.kind===L.ACCOUNT,isArgument:e=>e.kind===L.ARGUMENT,pipe:rv,get:r_,put:rE,update:rx,destroy:e=>t=>(delete t.assigns[e],tK(t))});function rM(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return rv(tj(),e)}let rI={tag:null,transaction:null,transactionStatus:null,transactionId:null,encodedData:null,events:null,account:null,block:null,blockHeader:null,latestBlock:null,collection:null,networkParameters:null,streamConnection:null,heartbeat:null,nodeVersionInfo:null},rA=()=>({...rI});function rR(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return rv([t5,t=>(t.block.isSealed=e,tK(t))])}function rD(e){return rv([t2,t=>(t.account.addr=eJ(e),tK(t))])}let rO=(e,t,r)=>{let i=new(eZ()),n=function(){let e=[],t=!1;async function r(){if(!t){for(t=!0;e.length>0;){let t=e.shift();await t?.()}t=!1}}return{push:t=>{e.push(t),r()}}}();function s(t){e.on(t,e=>{n.push(async()=>{i.emit(t,e)})})}return e.on("data",async e=>{let s=Promise.all(Object.keys(e).filter(t=>null!=e[t]&&"tag"!==t).map(async i=>{let n={[i]:e[i]};return{channel:i,message:await t(n,r)}}));n.push(async()=>{(await s).forEach(e=>{let{channel:t,message:r}=e;i.emit(t,r)})})}),s("close"),s("error"),{on(e,t){return i.on(e,t),this},off(e,t){return i.off(e,t),this},close:()=>{e.close()}}},rP=()=>{A.Rm.deprecate({pkg:"@onflow/decode",subject:"Operating upon data of the latestBlock field of the response object",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/decode/WARNINGS.md#0001-Deprecating-latestBlock-field"})},rN=async e=>e,rT=async(e,t,r)=>{let i=await e.fields.reduce(async(e,i)=>((e=await e)[i.name]=await rL(i.value,t,[...r,i.name]),e),Promise.resolve({}
90)),n=e.id&&rC(t,e.id);return n?await n(i):i},rk={UInt:rN,Int:rN,UInt8:rN,Int8:rN,UInt16:rN,Int16:rN,UInt32:rN,Int32:rN,UInt64:rN,Int64:rN,UInt128:rN,Int128:rN,UInt256:rN,Int256:rN,Word8:rN,Word16:rN,Word32:rN,Word64:rN,Word128:rN,Word256:rN,UFix64:rN,Fix64:rN,String:rN,Character:rN,Bool:rN,Address:rN,Void:async()=>null,Optional:async(e,t,r)=>e?await rL(e,t,r):null,Reference:rN,Array:async(e,t,r)=>await Promise.all(e.map(e=>new Promise(async i=>i(await rL(e,t,[...r,e.type]))))),Dictionary:async(e,t,r)=>await e.reduce(async(e,i)=>((e=await e)[await rL(i.key,t,[...r,i.key])]=await rL(i.value,t,[...r,i.key]),e),Promise.resolve({})),Event:rT,Resource:rT,Struct:rT,Enum:rT,Type:async e=>e.staticType,Path:rN,Capability:rN,InclusiveRange:async(e,t,r)=>{let i=["start","end","step"];return await Object.keys(e).reduce(async(n,s)=>(n=await n,i.includes(s)&&(n[s]=await rL(e[s],t,[...r,s])),n),Promise.resolve({}))}},rC=(e,t)=>{let r=Object.keys(e).find(e=>/^\/.*\/$/.test(e)?new RegExp(e.substring(1,e.length-1)).test(t):e===t);return t&&r&&e[r]},rL=async(e,t,r)=>{let i=rC(t,e.type);if(!i)throw Error(`Undefined Decoder Error: ${e.type}@${r.join(".")}`);return await i(e.value,t,r)},rU=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return rL(e,{...Object.keys(rk).filter(e=>!Object.keys(t).find(t=>new RegExp(t).test(e))).reduce((e,t)=>(e[t]=rk[t],e),t),...t},r)},rj=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.encodedData)return rU(e.encodedData,t);if(e.transactionStatus)return{...e.transactionStatus,events:await Promise.all(e.transactionStatus.events.map(async function(e){return{type:e.type,transactionId:e.transactionId,transactionIndex:e.transactionIndex,eventIndex:e.eventIndex,data:await rU(e.payload,t)}}))};if(e.transaction)return e.transaction;if(e.events)return await Promise.all(e.events.map(async function(e){return{blockId:e.blockId,blockHeight:e.blockHeight,blockTimestamp:e.blockTimestamp,type:e.type,transactionId:e.transactionId,transactionIndex:e.transactionIndex,eventIndex:e.eventIndex,data:await rU(e.payload,t)}}));if(e.account)return e.account;if(e.block)return e.block;if(e.blockHeader)return e.blockHeader;else if(e.latestBlock)return rP(),e.latestBlock;else if(e.transactionId)return e.transactionId;else if(e.collection)return e.collection;else if(e.networkParameters){let t=/^flow-/,r=e.networkParameters.chainId;return{chainId:"flow-emulator"===r?"local":t.test(r)?r.replace(t,""):r}}else if(e.streamConnection)return rO(e.streamConnection,rj,t);else if(e.heartbeat)return e.heartbeat;else if(e.nodeVersionInfo)return e.nodeVersionInfo;return null},rB=e=>"function"==typeof e,rq=e=>"string"==typeof e,rz=()=>/\b(0x\w+)\b/g,rF=()=>/import\s+"(\w+)"/g;async function r$(e){if(!rn(e)&&!ri(e))return e;var t,r,i,n,s=r_(e,"ix.cadence");if(R(rB(s)||rq(s),"Cadence needs to be a function or a string."),rB(s)&&(s=await s({})),R(rq(s),"Cadence needs to be a string at this point."),R((t=s,!rz().test(t)||(r=s,!rF().test(r))),"Both account identifier and contract identifier syntax not simultaneously supported."),i=s,rz().test(i)&&(s=await eq().where(/^0x/).then(e=>Object.entries(e).reduce((e,t)=>{let[r,i]=t,n=RegExp("(\\b"+r+"\\b)","g");return e.replace(n,i)},s))),n=s,rF().test(n))for(let[e,t]of s.matchAll(rF())){let r=await eq().get(`system.contracts.${t}`);r?s=s.replace(e,`import ${t} from ${eX(r)}`):A.Rm({title:"Contract Placeholder not found",message:`Cannot find a value for contract placeholder ${t}. Please add to your flow.json or explicitly add it to the config 'contracts.*' namespace.`,level:A.A_.warn})}return e.message.cadence=s,e}let rH=e=>"function"==typeof e;async function rK(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return(R(t>0,`Argument Resolve Recursion Limit Exceeded for Arg: ${e.tempId}`),rH(e.resolveArgument))?rK(await e.resolveArgument(),t-1):e}async function rV(e){if(rn(e)||ri(e))for(let[t,r]of Object.entries(e.arguments)){let i=await rK(r);R((i.xform,!0),`No type specified for argument: ${i.value}`),e.arguments[t].asArgument=rH(i.xform)?i.xform(i.value):rH(i.xform.asArgument)?i.xform.asArgument(i.value):void R(!1,"Invalid Argument",i)}return e}let rG=e=>rY(r6(r3(e))),rW=e=>rY(r6(r5(e))),rJ=(e,t)=>
90eF.Buffer.from(e.padStart(2*t,"0"),"hex"),rX=(a=eF.Buffer.from("FLOW-V0.0-transaction").toString("hex"),eF.Buffer.from(a.padEnd(64,"0"),"hex")).toString("hex"),rY=e=>rX+e,rZ=e=>rJ(e,8),rQ=e=>rJ(e,32),r0=e=>eF.Buffer.from(JSON.stringify(e),"utf8"),r1=e=>eF.Buffer.from(e,"utf8"),r2=e=>eF.Buffer.from(e,"hex"),r6=e=>e$(e).toString("hex"),r3=e=>(r9(e),[r1(e.cadence||""),e.arguments.map(r0),rQ(e.refBlock||""),e.computeLimit,rZ(eJ(e.proposalKey.address||"")),e.proposalKey.keyId,e.proposalKey.sequenceNum,rZ(eJ(e.payer)),e.authorizers.map(e=>rZ(eJ(e)))]),r5=e=>(r7(e),[r3(e),r8(e)]),r8=e=>{let t=r4(e);return e.payloadSigs?.map(e=>({signerIndex:t.get(e.address)||"",keyId:e.keyId,sig:e.sig})).sort((e,t)=>e.signerIndex>t.signerIndex?1:e.signerIndex<t.signerIndex?-1:e.keyId>t.keyId?1:e.keyId<t.keyId?-1:0).map(e=>[e.signerIndex,e.keyId,r2(e.sig)])},r4=e=>{let t=new Map,r=0,i=e=>{!t.has(e)&&(t.set(e,r),r++)};return e.proposalKey.address&&i(e.proposalKey.address),i(e.payer),e.authorizers.forEach(i),t},r9=e=>{is.forEach(t=>ic(e,t)),io.forEach(t=>ic(e.proposalKey,t,"proposalKey"))},r7=e=>{ia.forEach(t=>ic(e,t)),e.payloadSigs?.forEach((e,t)=>{iu.forEach(r=>ic(e,r,"payloadSigs",t))})},ie=e=>"number"==typeof e,it=e=>"string"==typeof e,ir=e=>null!==e&&"object"==typeof e,ii=e=>ir(e)&&e instanceof Array,is=[{name:"cadence",check:it},{name:"arguments",check:ii},{name:"refBlock",check:it,defaultVal:"0"},{name:"computeLimit",check:ie},{name:"proposalKey",check:ir},{name:"payer",check:it},{name:"authorizers",check:ii}],io=[{name:"address",check:it},{name:"keyId",check:ie},{name:"sequenceNum",check:ie}],ia=[{name:"payloadSigs",check:ii}],iu=[{name:"address",check:it},{name:"keyId",check:ie},{name:"sig",check:it}],ic=(e,t,r,i)=>{let{name:n,check:s,defaultVal:o}=t;if(null==e[n]&&null!=o&&(e[n]=o),null==e[n])throw il(n,r,i);if(!s(e[n]))throw id(n,r,i)},ih=(e,t,r)=>t?null==r?`${t}.${e}`:`${t}.${r}.${e}`:e,il=(e,t,r)=>Error(`Missing field ${ih(e,t,r)}`),id=(e,t,r)=>Error(`Invalid field ${ih(e,t,r)}`);function ip(e){let t=new Set(e.authorizations);return e.proposer&&t.add(e.proposer),Array.isArray(e.payer)?e.payer.forEach(e=>t.delete(e)):t.delete(e.payer),Array.from(t)}function ig(e){return Array.from(new Set(Array.isArray(e.payer)?e.payer:[e.payer]))}let im=e=>{let t=e.proposer?{address:eX(e.accounts[e.proposer].addr),keyId:e.accounts[e.proposer].keyId,sequenceNum:e.accounts[e.proposer].sequenceNum}:{};return{cadence:e.message.cadence,refBlock:e.message.refBlock||null,computeLimit:e.message.computeLimit,arguments:e.message.arguments.map(t=>e.arguments[t].asArgument),proposalKey:t,payer:eX(e.accounts[Array.isArray(e.payer)?e.payer[0]:e.payer].addr),authorizers:e.authorizations.map(t=>eX(e.accounts[t].addr)).reduce((e,t)=>e.find(e=>e===t)?e:[...e,t],[]),payloadSigs:ip(e).map(t=>({address:eX(e.accounts[t].addr),keyId:e.accounts[t].keyId,sig:e.accounts[t].signature})),envelopeSigs:ig(e).map(t=>({address:eX(e.accounts[t].addr),keyId:e.accounts[t].keyId,sig:e.accounts[t].signature}))}},ib=e=>`${eX(e.addr)}-${e.keyId}`,iy=e=>e&&("[object Function]"===Object.prototype.toString.call(e)||"function"==typeof e||e instanceof Function),iv=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.join("-")};var iw=function(e){return e.PAYER="payer",e.PROPOSER="proposer",e.AUTHORIZATIONS="authorizations",e}(iw||{});function i_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return t<=0||!Array.isArray(e)?e:i_(e.flatMap(e=>e),t-1)}async function iE(e,t){let r=Array.isArray(e.payer)?e.payer:[e.payer],i=Array.isArray(e.authorizations)?e.authorizations:[e.authorizations],n=null===e.proposer?[]:Array.isArray(e.proposer)?e.proposer:[e.proposer],s=Object.keys(e.accounts),o=[...new Set(r.concat(i,n))];for(let t of s)o.find(e=>e===t)||delete e.accounts[t]}function ix(e,t){"string"==typeof t.addr&&("number"==typeof t.keyId||"string"==typeof t.keyId)?t.tempId=ib(t):t.tempId=t.tempId||N();let r=e.accounts[t.tempId]||t;return e.accounts[t.tempId]||(e.accounts[t.tempId]=t),e.accounts[t.tempId].role.proposer=r.role.proposer||t.role.proposer,e.accounts[t.tempId].role.payer=r.role.payer||t.role.payer,e.accounts[t.tempId].role.authorizer=r.role.authorizer||t.role.authorizer,e.accounts[t.tempId]}async function iS(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,{debugLogger:i}=arguments.length>3?arguments[3]:void 0;if(r<=0)throw Error("recurseResolveAccount Error: Depth limit (5) reached. Ensure your authorization functions resolve to an account after 5 resolves.");let n=e.accounts[t];if(!n)return[[],!1];if(i(`account: ${n.tempId}`,Math.max(5-r,0)),n?.resolve){if(!iy(n?.resolve))return i(`account: ${n.tempId} -- cache HIT`,Math.max(5-r,0)),[n.resolve,!1];{i(`account: ${n.tempId} -- cache MISS`,Math.max(5-r,0));let{resolve:t,...s}=n,o=await t(s,function(e,t){try{return{f_type:"PreSignable",f_vsn:"1.0.1",roles:e.role,cadence:t.message.cadence,args:t.message.arguments.map(e=>t.arguments[e].asArgument),data:{},interaction:t,voucher:im(t)}}catch(e){throw console.error("buildPreSignable",e),e}}(s,e)),a=i_(o=Array.isArray(o)?o:[o]);return a=a.map(t=>ix(e,t)),n.resolve=a.map(e=>e.tempId),n=ix(e,n),[a.map(e=>e.tempId),!0]}}
90return[n.tempId?[n.tempId]:[],!1]}let iM=e=>null===e?[]:Array.isArray(e)?e:[e];async function iI(e,t,r){for(let i of Object.values(iw))if(i===iw.AUTHORIZATIONS||i===iw.PAYER)e[i]=iM(e[i]).reduce((e,n)=>n===t?e.concat(...r.filter(e=>i===iw.PAYER&&e.role.payer||i===iw.AUTHORIZATIONS&&e.role.authorizer).map(e=>e.tempId)):e.concat(n),[]);else if(i===iw.PROPOSER){let t=r.filter(e=>e.role.proposer);if(t.length>1)throw Error("replaceRoles Error: Multiple proposer keys were resolved, but only one is allowed");e[i]=t[0]?.tempId??e[i]}}async function iA(e,t){let r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,{debugLogger:n}=arguments.length>3?arguments[3]:void 0;R(e&&"object"==typeof e,"resolveAccountType Error: ix not defined");let s=new Set;for(let r of t){R(!!e.accounts[r],"resolveAccountType Error: account not found");let[t,o]=await iS(e,r,i,{debugLogger:n});if(o){let i=function(e){let t=i_(e),r=new Set;return t.map(e=>{let t=iv(e.tempId,e.role.payer,e.role.proposer,e.role.authorizer,e.role.param);return r.has(t)?null:(r.add(t),e)}).filter(e=>null!==e)}(t.map(t=>e.accounts[t]));i.forEach(e=>s.add(e.tempId)),iI(e,r,i)}}for(let t of e[iw.PAYER]){let i=e.accounts[t];if(r){if(r!==i.addr)throw Error("resolveAccountType Error: payers from different accounts detected")}else r=i.addr}return s}async function iR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(rn(e)){Array.isArray(e.payer)||A.Rm.deprecate({pkg:"FCL",subject:'"ix.payer" must be an array. Support for ix.payer as a singular',message:"See changelog for more info."});let[r,i]=function(){let e=[];return[function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e.push(Array(4*r).fill(" ").join("-")+t)},function(){return e.reduce((e,t)=>e+"\n"+t)}]}();try{let n=5,s=new Set([...iM(e[iw.PAYER]),...iM(e[iw.PROPOSER]),...iM(e[iw.AUTHORIZATIONS])]);for(;s.size>0;){if(n<=0)throw Error("resolveAccounts Error: Depth limit (5) reached. Ensure your authorization functions resolve to an account after 5 resolves.");s=await iA(e,s,n,{debugLogger:r}),n--}for(let t of(await iE(e,{debugLogger:r}),Object.values(iw)))R(iM(e[t]).length>0||t===iw.AUTHORIZATIONS,`resolveAccountType Error: no accounts for role "${t}" found`);t.enableDebug&&console.debug(i())}catch(e){throw console.error("=== SAD PANDA ===\n\n",e,"\n\n=== SAD PANDA ==="),e}}return e}async function iD(e){if(rn(e))try{let t=ip(e),r=rG(iP(e));await Promise.all(t.map(iO(e,r)));let i=ig(e),n=rW({...iP(e),payloadSigs:t.map(t=>({address:e.accounts[t].addr||"",keyId:e.accounts[t].keyId||0,sig:e.accounts[t].signature||""}))});await Promise.all(i.map(iO(e,n)))}catch(t){throw console.error("Signatures",t,{ix:e}),t}return e}function iO(e,t){return async function(r){let i=e.accounts[r];if(null!=i.signature&&void 0!==i.signature)return;let{signature:n}=await i.signingFunction(function(e,t,r){try{return{f_type:"Signable",f_vsn:"1.0.1",message:t,addr:eJ(e.addr),keyId:e.keyId,roles:e.role,cadence:r.message.cadence,args:r.message.arguments.map(e=>r.arguments[e].asArgument),data:{},interaction:r,voucher:im(r)}}catch(e){throw console.error("buildSignable",e),e}}(i,t,e));e.accounts[r].signature=n}}function iP(e){let t=eJ((Array.isArray(e.payer)?e.accounts[e.payer[0]]:e.accounts[e.payer]).addr||""),r=e.proposer?{address:eJ(e.accounts[e.proposer].addr)||"",keyId:e.accounts[e.proposer].keyId||0,sequenceNum:e.accounts[e.proposer].sequenceNum||0}:{};return{cadence:e.message.cadence,refBlock:e.message.refBlock,computeLimit:e.message.computeLimit,arguments:e.message.arguments.map(t=>e.arguments[t].asArgument),proposalKey:r,payer:t,authorizers:e.authorizations.map(t=>eJ(e.accounts[t].addr)||"").reduce((e,t)=>e.find(e=>e===t)?e:[...e,t],[])}}async function iN(e){let t=r_(e,"ix.validators",[]);return rv(e,t.map(e=>t=>e(t,{Ok:tK,Bad:tV})))}async function iT(e){for(let t of Object.keys(e.accounts))e.accounts[t].addr=eJ(e.accounts[t].addr);return e}async function ik(e){let t=r_(e,"ix.voucher-intercept");return t$(t)&&await t(im(e)),e}async function iC(e){return rn(e)&&(e.message.computeLimit=e.message.computeLimit||await eq.get("fcl.limit"),e.message.computeLimit||(A.Rm.deprecate({pkg:"FCL/SDK",subject:"The built-in default compute limit (DEFAULT_COMPUTE_LIMIT=10)",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/TRANSITIONS.md#0009-deprecate-default-compute-limit"}),e.message.computeLimit=100)),e}let iL=e=>e,iU=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:iL;return async r=>(await eq.get(`debug.${e}`)&&await t(r,function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];console.log(`debug[${e}] ---
91`,...r,"\n\n\n---")},e=>["\nAccounts:",{proposer:e.proposer,authorizations:e.authorizations,payer:e.payer}
91,"\n\nDetails:",e.accounts].filter(Boolean)),r)},ij=rv([r$,iU("cadence",(e,t)=>t(e.message.cadence)),iC,iU("compute limit",(e,t)=>t(e.message.computeLimit)),rV,iU("arguments",(e,t)=>t(e.message.arguments,e.message)),iR,iU("accounts",(e,t,r)=>t(...r(e))),iB,iq,iD,iU("signatures",(e,t,r)=>t(...r(e))),iT,iN,ik,iU("resolved",(e,t)=>t(e))]);async function iB(e){if(rn(e)&&null==e.message.refBlock){let t=await eq().get("accessNode.api"),r=await eq.first(["sdk.transport","sdk.send"],tN);R(r,"Required value for sdk.transport is not defined in config. See: https://github.com/onflow/fcl-js/blob/master/packages/sdk/CHANGELOG.md#0057-alpha1----2022-01-21"),e.message.refBlock=(await r(rM([rR()]),{config:eq,response:rA,Buffer:eF.Buffer,ix:rS},{node:t}).then(rj)).id}return e}async function iq(e){if(rn(e)){var t=Object.values(e.accounts).find(e=>e.role.proposer);if(R(t,"Transactions require a proposer"),null==t.sequenceNum){let r=await eq().get("accessNode.api"),i=await eq.first(["sdk.transport","sdk.send"],tN);R(i,"Required value for sdk.transport is not defined in config. See: https://github.com/onflow/fcl-js/blob/master/packages/sdk/CHANGELOG.md#0057-alpha1----2022-01-21"),e.accounts[t.tempId].sequenceNum=await i(await rM([rD(t.addr)]),{config:eq,response:rA,Buffer:eF.Buffer,ix:rS},{node:r}).then(rj).then(e=>e.keys).then(e=>e.find(e=>e.index===t.keyId)).then(e=>e.sequenceNumber)}}return e}function iz(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){let[e,r]=t;return iz((t,i)=>{let{Ok:n,Bad:s}=i;return e?n(t):s(t,r)})}let[i]=t;return e=>i(e,{Ok:tK,Bad:tV})}let iF=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=await eq.first(["sdk.transport","sdk.send"],t.send||tN);iz(r,"Required value for sdk.transport is not defined in config. See: https://github.com/onflow/fcl-js/blob/master/packages/sdk/CHANGELOG.md#0057-alpha1----2022-01-21");let i=await eq.first(["sdk.resolve"],t.resolve||ij);return t.node=t.node||await eq().get("accessNode.api"),Array.isArray(e)&&(e=rv(tj(),e)),r(await i(e),{config:eq,response:rA,ix:rS,Buffer:eF.Buffer},t)};async function i$(e){return rj(e,Object.fromEntries(Object.entries(await eq().where(/^decoder\./)).map(e=>{let[t,r]=e;return[t=`/${t.replace(/^decoder\./,"")}$/`,r]})))}function iH(e){return rx("ix.validators",t=>Array.isArray(t)?t.push(e):[e])}function iK(){let{sealed:e=!1,id:t,height:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(R(!(e&&t||e&&r),'Method: block -- Cannot pass "sealed" with "id" or "height"'),R(!(t&&r),'Method: block -- Cannot pass "id" and "height" simultaneously'),t)?iF([rR(),rv([e=>(e.block.id=t,tK(e)),iH((e,t)=>{let{Ok:r,Bad:i}=t;return ra(e)?i(e,"Unable to specify a block id with a Get Account interaction."):"boolean"==typeof e.block.isSealed?i(e,"Unable to specify both block id and isSealed."):e.block.height?i(e,"Unable to specify both block id and block height."):r(e)})])],i).then(rj):r?iF([rR(),rv([e=>(e.block.height=r,e),iH(e=>{if("boolean"==typeof e.block.isSealed)throw Error("Unable to specify both block height and isSealed.");if(e.block.id)throw Error("Unable to specify both block height and block id.");return e})])],i).then(rj):iF([rR(e)],i).then(rj)}function iV(e,t){return{value:e,xform:t}}var iG=r(3286),iW=r(6167),iJ=/^[0-9]+$/,iX=function(e,t){var r=iJ.test(e),i=iJ.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1},iY=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,iZ=function(e,t){if("string"!=typeof e||"string"!=typeof t)throw Error("Invalid input");var r=e.match(iY),i=t.match(iY);if(!r||!i)throw Error("Invalid input");for(var n=1;n<=3;n++){if(parseInt(r[n])>parseInt(i[n]))return 1;if(parseInt(r[n])<parseInt(i[n]))return -1}if(r[4]&&i[4])for(var s=(r[4]||"").split("."),o=(i[4]||"").split("."),a=0;a<Math.max(s.length,o.length);a++){if(void 0===s[a])return -1;if(void 0===o[a])return 1;var u=iX(s[a],o[a]);if(0!==u)return u}return 0};let iQ="1.12.0",i0=e=>t=>typeof t===e,i1=e=>null!=e,i2=i0("object"),i6=i0("string"),i3=i0("function");async function i5(e){let t,{url:r}=e;R(void 0!==r,"retrieve({ url }) -- url must be defined");try{t=await eW()(r)}catch(e){throw Error("httpDocumentResolver Error: Failed to retrieve document.")}return t.ok?await t.json():null}i0("number");let i8=new Map([["http",i5],["https",i5]]);async function i4(e){let{url:t}=e;R(void 0!==t,"retrieve({ url }) -- url must be defined"),R("string"==typeof t,"retrieve({ url }) -- url must be a string");let r=await eq().where(/^document\.resolver\./);Object.keys(r).map(e=>{let t=r[e],i=e.replace(/^document\.resolver\./,"");i8.set(i,t)});let i=/^(.*):\/\/([A-Za-z0-9\-\.]+)(:[0-9]+)?(.*)$/.exec(t);R(i,"Failed to parse URL");let n=i[1];R(i,"Failed to parse URL protocol");let s=i8.get(n);return R(s,`No resolver found for protcol=${n}`),await s({url:t})}async function i9(e){let{network:t,template:r}=e;return R("1.0.0"===r.f_version,"deriveCadenceByNetwork100({ template }) -- template must be version 1.0.0"),Object.keys(r?.data?.dependencies).map(e=>{let i=Object.values(r?.data?.dependencies?.[e]);
91R(void 0!==i,`deriveCadenceByNetwork100 -- Could not find contracts for dependency placeholder: ${e}`),R(i.length>0,`deriveCadenceByNetwork100 -- Could not find contracts for dependency placeholder: ${e}`);let n=i[0],s=n?.[t];return R(s,`deriveCadenceByNetwork100 -- Could not find ${t} network information for dependency: ${e}`),[e,s?.address]}).reduce((e,t)=>{let[r,i]=t,n=RegExp("(\\b"+r+"\\b)","g");return e.replace(n,i)},r.data.cadence)}async function i7(e){let{network:t,template:r}=e;R("1.1.0"===r.f_version,"deriveCadenceByNetwork110({ template }) -- template must be version 1.0.0");let i={};return r?.data?.dependencies.forEach(e=>{e.contracts.forEach(e=>{let r=e.contract;e.networks.forEach(e=>{e.network===t&&(i[r]=e.address)}),R(void 0!==i[r],`deriveCadenceByNetwork110 -- Could not find contracts Network Address: ${t} ${r}`)})}),R(Object.keys(i).length===r?.data?.dependencies.length,`deriveCadenceByNetwork110 -- Could not find contracts for import dependencies: ${i}`),R(Object.keys(i).length===Object.values(i).length,`deriveCadenceByNetwork110 -- Could not find all addresses for network ${t} dependencies:  ${i}`),R(r?.data?.cadence?.body,`no cadence found -- Could not replace import dependencies: ${i}`),function(e){let{cadence:t,networkDependencies:r}=e;return Object.keys(r).reduce((e,t)=>{let i=r[t],n=RegExp(`import "\\b${t}\\b"`,"g");return e.replace(n,`import ${t} from ${i}`)},t)}({cadence:r?.data?.cadence?.body,networkDependencies:i})}async function ne(e){let{network:t,template:r}=e;switch(R(void 0!=t,"deriveCadenceByNetwork({ network }) -- network must be defined"),R("string"==typeof t,"deriveCadenceByNetwork({ network }) -- network must be a string"),R(void 0!=r,"deriveCadenceByNetwork({ template }) -- template must be defined"),R("object"==typeof r,"deriveCadenceByNetwork({ template }) -- template must be an object"),R("InteractionTemplate"===r.f_type,"deriveCadenceByNetwork({ template }) -- template must be an InteractionTemplate"),r.f_version){case"1.1.0":return await i7({network:t,template:r});case"1.0.0":return await i9({network:t,template:r});default:throw Error("deriveCadenceByNetwork Error: Unsupported template version")}}async function nt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(await iF([rv([t9,e=>tK(e)])],e).then(i$)).chainId}let nr={},ni=!1;async function nn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=await eq.get("flow.network"),r=await eq.get("env");r&&!ni&&(A.Rm.deprecate({pkg:"FCL",subject:'Using the "env" configuration key for specifying the flow network',message:"Configuring to specify flow network is no longer required",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/TRANSITIONS.md#0001-deprecate-env-config-key"}),ni=!0);let i=e.node||await eq.get("accessNode.api");if(!i){if(t)return t;if(r)return r;throw Error('Either the "accessNode.api" config key or opts.node must be set')}if(nr[i])try{return await nr[i]}catch{}nr[i]||(nr[i]=nt(e).catch(e=>{throw nr[i]=null,e}));try{return await nr[i]}catch(e){if(t)return t;if(r)return r;throw Error(`Error getting chainId from access node - are you using the correct access node endpoint.  If running locally, is your emulator up-to-date? ${e.message}`)}}async function ns(e){i6(e?.template)&&(e.template=await i4({url:e?.template}));let t=e.cadence||await ne({template:e.template,network:await nn(e)});return e.cadence=t,e}async function no(e,t){R(i1(t),`${e}(opts) -- opts is required`),R(i2(t),`${e}(opts) -- opts must be an object`),R(!(t.cadence&&t.template),`${e}({ template, cadence }) -- cannot pass both cadence and template`),R(i1(t.cadence||t?.template),`${e}({ cadence }) -- cadence is required`),R(i6(t.cadence)||t?.template,`${e}({ cadence }) -- cadence must be a string`),R(await eq().get("accessNode.api"),`${e}(opts) -- Required value for "accessNode.api" not defined in config. See: https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/exec/query.md#configuration`)}async function na(e){return no("query",e)}async function nu(){var e,t;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return await na(r),iF([function(){return rv([tZ,rE("ix.cadence",function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return"string"==typeof e?()=>e:"function"==typeof e?e:t=>(function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!t.length&&!r.length||!t.length)return i;if(!r.length)return i.push(...t),i;let[n,...s]=t,[o,...a]=r;return void 0!==n&&i.push(n),void 0!==o&&i.push(o),e(s,a,i)})([...e],r.map(function e(t){return function(r){return"function"==typeof r?(A.Rm.deprecate({pkg:"FCL/SDK",subject:"Interopolation of functions into template literals",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/TRANSITIONS.md#0001-deprecate-params"}),e(t)(r(t))):String(r)}}(t))).join("").trim()}(...arguments))])}((r=await ns(r)).cadence),rv((i3(e=r.args||[])?e(iV,iG):[]).map(tX)),r.limit&&"number"==typeof r.limit&&(t=r.limit,e=>(e.message.computeLimit=t,e))]).then(i$)}let nf={"HTTP/RPC":"HTTP/RPC","HTTP/POST":"HTTP/POST","IFRAME/RPC":"IFRAME/RPC","POP/RPC":"POP/RPC","TAB/RPC":"TAB/RPC","EXT/RPC":"EXT/RPC","DEEPLINK/RPC":"DEEPLINK/RPC"},nc=globalThis.URL;class nh extends nc{constructor(e,t){for(var r=arguments.length,i=Array(r>2?r-2:0),n=2;n<r;n++)i[n-2]=arguments[n];super(e,t,...i);return}}let nl={f_type:"Service",f_vsn:"1.0.0"},nd={f_type:"Identity",f_vsn:"1.0.0"},np={f_type:"USER",f_vsn:"1.0.0"},ng={f_type:"PollingResponse",f_vsn:"1.0.0"}
91,nm={f_type:"CompositeSignature",f_vsn:"1.0.0"},nb=(e,t)=>eF.Buffer.from(e.padStart(2*t,"0"),"hex"),ny=e=>{if(e.appIdentifier){let{appIdentifier:t,address:r,nonce:i,signatures:n}=e;return R(i6(t),"verifyAccountProof({ appIdentifier }) -- appIdentifier must be a string"),R(i6(r)&&16===eJ(r).length,"verifyAccountProof({ address }) -- address must be a valid address"),R(/^[0-9a-f]+$/i.test(i),"nonce must be a hex string"),R(Array.isArray(n)&&n.every((e,t,r)=>"CompositeSignature"===e.f_type),"Must include an Array of CompositeSignatures to verify"),R(n.map(e=>e.addr).every((e,t,r)=>e===r[0]),"User signatures to be verified must be from a single account address"),!0}{let{message:t,address:r,compSigs:i}=e;return R(/^[0-9a-f]+$/i.test(t),"Signed message must be a hex string"),R(i6(r)&&16===eJ(r).length,"verifyUserSignatures({ address }) -- address must be a valid address"),R(Array.isArray(i)&&i.every((e,t,r)=>"CompositeSignature"===e.f_type),"Must include an Array of CompositeSignatures to verify"),R(i.map(e=>e.addr).every((e,t,r)=>e===r[0]),"User signatures to be verified must be from a single account address"),!0}},nv=async(e,t)=>{let r="ACCOUNT_PROOF"===e?"verifyAccountProofSignatures":"verifyUserSignatures",i=await nn(t),n=t.fclCryptoContract||({testnet:"0x74daa6f9c7ef24b1",mainnet:"0xb4b82a1c9d21d284",previewnet:"0x40b5b8b2ce81ea4a"})[i];return R(n,`${r}({ fclCryptoContract }) -- FCLCrypto contract address is unknown for network: ${i}. Please manually specify the FCLCrypto contract address.`),`
92      import FCLCrypto from ${n}
93
94      access(all) fun main(
95          address: Address, 
96          message: String, 
97          keyIndices: [Int], 
98          signatures: [String]
99      ): Bool {
100        return FCLCrypto.${r}(address: address, message: message, keyIndices: keyIndices, signatures: signatures)
101      }
102    `};async function nw(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=eX(t[0].addr);ny({message:e,address:i,compSigs:t});let n=[],s=[];for(let e of t)n.push(e.signature),s.push(e.keyId.toString());return nu({cadence:await nv("USER_SIGNATURE",r),args:(t,r)=>[t(i,r.Address),t(e,r.String),t(s,r.Array(r.Int)),t(n,r.Array(r.String))]})}async function n_(e){return Object.fromEntries(Object.entries(await eq().where(e)).map(t=>{let[r,i]=t;return[r.replace(e,""),i]}))}A.Rm.deprecate({pkg:"FCL",subject:"fcl.verifyUserSignatures()",message:"Please use fcl.AppUtils.verifyUserSignatures()",callback:function(e,t){return nw(e,t)}});let nE=/^[0-9a-fA-F]{64}$/,nx="POLL",nS="TIMEOUT",nM=async e=>iF([rv([t0,t=>(t.transaction.id=e,tK(t))])]).then(i$),nI=e=>e.status>=4,nA=e=>e.status>=3,nR=e=>e.status>=2,nD=(e,t)=>JSON.stringify(e)!==JSON.stringify(t),nO=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{[B]:async t=>{setTimeout(()=>t.sendSelf(nS),e.txNotFoundTimeout),t.sendSelf(nx)},[q]:(e,t)=>{e.subscribe(t.from),e.send(t.from,F,e.all())},[z]:(e,t)=>{e.unsubscribe(t.from)},[$]:async(e,t)=>{t.reply(e.all())},[nS]:async t=>{0===Object.keys(t.all()).length&&t.fatalError(Error(`TX status polling failed: no transaction was found within timeout interval (${e.txNotFoundTimeout}ms)`))},[nx]:async t=>{let r;let i=()=>setTimeout(()=>t.sendSelf(nx),e.pollRate),n=t.all();try{r=await nM(t.self())}catch(n){let e=n instanceof e6&&404===n.statusCode,r=n.code===iW.grpc.Code.NotFound;if(e||r)return i();return t.fatalError(n)}nI(r)||i(),nD(n,r)&&t.broadcast(F,r),t.merge(r)}}},nP=e=>{if("object"==typeof e&&(e=e.transactionId),null==e)throw Error("transactionId required");return e},nN=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>Q(nO(e),nP(t))};function nT(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{txNotFoundTimeout:12500,pollRate:2500};if(!nE.test(nP(e)))throw Error("Invalid transactionId");function r(r){return et(nP(e),nN(t),r)}function i(e){return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.suppress||!1;return new Promise((t,n)=>{let s=r((r,o)=>{(o||r.statusCode)&&!i?(n(o||r.errorMessage),s()):e(r)&&(t(r),s())})})}}return{snapshot:function(){return er(e,nN(t))},subscribe:r,onceFinalized:i(nR),onceExecuted:i(nA),onceSealed:i(nI)}}nT.isUnknown=e=>e.status>=0,nT.isPending=e=>e.status>=1,nT.isFinalized=nR,nT.isExecuted=nA,nT.isSealed=nI,nT.isExpired=e=>5===e.status;let nk="TICK",nC=async e=>setTimeout(()=>e.sendSelf(nk),await eq().get("fcl.eventPollRate",1e4)),nL=()=>{throw Error("Platform specific Core Strategies are not initialized")},nU={[nf["EXT/RPC"]]:nL,[nf["HTTP/POST"]]:nL,[nf["IFRAME/RPC"]]:nL,[nf["POP/RPC"]]:nL,[nf["TAB/RPC"]]:nL,[nf["EXT/RPC"]]:nL},nj=["ServicePlugin"],nB=["discovery-service"],nq=e=>{let{services:t=[],serviceStrategy:r}=e;for(let e of(R(Array.isArray(t),"Services must be an array"),t))R(i1(e.f_type)&&"Service"===e.f_type,"Service is required"),R(i1(e.type)&&"authn"===e.type,`Service must be type authn. Received ${e.type}`),R(e.method in nf||r.method===e.method,`Service method ${e.method} is not supported`);return R(i1(r),"Service strategy is required"),R(i1(r.method)&&i6(r.method),"Service strategy method is required"),R(i1(r.exec)&&i3(r.exec),"Service strategy exec function is required"),{discoveryServices:t,serviceStrategy:r}},nz=e=>{let{coreStrategies:t}=e,r=new Set,i=new Map(Object.entries(t)),n=e=>r=new Set([...e]);return Object.freeze({add:e=>{if(R(nB.includes(e.type),`Service Plugin type ${e.type} is not supported`),"discovery-service"===e.type){let{discoveryServices:t,serviceStrategy:r}=nq(e);n(t),i.has(r.method)?(0,A.Rm)({title:"Add Service Plugin",message:`Service strategy for ${r.method} already exists`,level:A.A_.warn}):i.set(r.method,r.exec)}},getServices:()=>[...r],getStrategy:e=>i.get(e),getStrategies:()=>[...i.keys()]})},nF=e=>{let t;for(let r of(R(!!e,"No plugins supplied"),t=Array.isArray(e)?[...e]:[e]))R(i1(r.name),"Plugin name is required"),R(i1(r.f_type),"Plugin f_type is required"),R(nj.includes(r.f_type),`Plugin type ${r.f_type} is not supported`);return t},n$=()=>void 0!==s,nH=e=>{let{coreStrategies:t}=e;if(n$())return s;let r=nz({coreStrategies:t});return s=r,r},nK=()=>n$()?s:(console.warn("Registry is not initalized, it will be initialized with stub core strategies"),nH({coreStrategies:nU})),nV=(()=>{let e=new Map;return Object.freeze({add:t=>{for(let r of nF(t))e.set(r.name,r),"ServicePlugin"===r.f_type&&s.add(r)},getPlugins:()=>e})})(),nG=async()=>[...window?.fcl_extensions||[],...nK().getServices()];async function nW(e){let t=await eq.get("discovery.authn.include",[]),r=await eq.get("discovery.features.suggested",[]),i=await eq.first(["discovery.wallet.method","discovery.wallet.method.default"]),n=e?.method?e.method:i,s=e?.endpoint??await eq.first(["discovery.wallet","challenge.handshake"]);return R(s,`
103    If no service is passed to "authenticate," then "discovery.wallet" must be defined in fcl config.
104    See: "https://docs.onflow.org/fcl/reference/api/#setting-configuration-values"
105    `),{...e,type:"authn",endpoint:s,method:n,discoveryAuthnInclude:t,discoveryFeaturesSuggested:r}}async function nJ(e){let{types:t}=e,r=await eq.get("discovery.authn.endpoint");R(!!r,'"discovery.authn.endpoint" in config must be defined.');let i=await eq.get("discovery.authn.include",[]);return fetch(new nh(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:t,fclVersion:iQ,include:i,features:{suggested:await eq.get("discovery.features.suggested",[])},clientServices:await nG(),supportedStrategies:nK().getStrategies(),userAgent:window?.navigator?.userAgent,network:await nn()})}).then(e=>e.json())}let nX={AUTHN:"authn",SNAPSHOT:"SNAPSHOT",UPDATED:"UPDATED",UPDATE_RESULTS:"UPDATE_RESULTS"},nY=(e,t)=>{e&&console.warn(`
106      %cFCL Warning
107      ============================
108      ${t}
109      For more info, please see the docs: https://docs.onflow.org/fcl/
110      ============================
111      `,"font-weight:bold;font-family:monospace;")},nZ=async()=>{try{let e=await nJ({types:[nX.AUTHN]});J(nX.AUTHN,nX.UPDATE_RESULTS,{results:e})}catch(e){(0,A.Rm)({title:`${e.name} Error fetching Discovery API services.`,message:e.message,level:A.A_.error})}},nQ={[B]:async e=>{nY("undefined"==typeof window,'"fcl.discovery" is only available in the browser.'),"complete"===document.readyState?nZ():window.addEventListener("load",()=>{nZ()})},[nX.UPDATE_RESULTS]:(e,t,r)=>{e.merge(r),e.broadcast(nX.UPDATED,{...e.all()})},[q]:(e,t)=>{e.subscribe(t.from),e.send(t.from,nX.UPDATED,{...e.all()})},[z]:(e,t)=>e.unsubscribe(t.from),[nX.SNAPSHOT]:async(e,t)=>t.reply({...e.all()})},n0=()=>Q(nQ,nX.AUTHN),n1={authn:{subscribe:e=>et(nX.AUTHN,n0,e),snapshot:()=>er(nX.AUTHN,n0),update:()=>{"complete"===document.readyState&&nZ()}}};function n2(e){let t=new tT.KN(256);return t.update(eF.Buffer.from(e,"utf8")),t.digest("hex")}async function n6(e){let{template:t}=e;iz(void 0!=t,"generateTemplateId({ template }) -- template must be defined"),iz("object"==typeof t,"generateTemplateId({ template }) -- template must be an object"),iz("InteractionTemplate"===t.f_type,"generateTemplateId({ template }) -- template object must be an InteractionTemplate"),iz("1.0.0"===t.f_version,"generateTemplateId({ template }) -- template object must be an version 1.0.0");let r=t.data,i=await Promise.all(Object.keys(r.messages).map(async e=>[n2(e),await Promise.all(Object.keys(r.messages?.[e]?.i18n).map(async t=>
111[n2(t),n2(r.messages?.[e]?.i18n?.[t])]))])),n=await Promise.all(Object.keys(r?.dependencies).map(async e=>[n2(e),await Promise.all(Object.keys(r?.dependencies?.[e]).map(async t=>[n2(t),await Promise.all(Object.keys(r?.dependencies?.[e]?.[t]).map(async i=>[n2(i),[n2(r?.dependencies?.[e]?.[t]?.[i].address),n2(r?.dependencies?.[e]?.[t]?.[i].contract),n2(r?.dependencies?.[e]?.[t]?.[i].fq_address),n2(r?.dependencies?.[e]?.[t]?.[i].pin),n2(String(r?.dependencies?.[e]?.[t]?.[i].pin_block_height))]]))]))])),s=await Promise.all(Object.keys(r?.arguments).map(async e=>[n2(e),[n2(String(r?.arguments?.[e].index)),n2(r?.arguments?.[e].type),n2(r?.arguments?.[e].balance||""),await Promise.all(Object.keys(r?.arguments?.[e].messages).map(async t=>[n2(t),await Promise.all(Object.keys(r?.arguments?.[e].messages?.[t].i18n).map(async i=>[n2(i),n2(r?.arguments?.[e].messages?.[t].i18n?.[i])]))]))]])),o=e$([n2("InteractionTemplate"),n2("1.0.0"),n2(r?.type),n2(r?.interface),i,n2(r?.cadence),n,s]).toString("hex");return n2(o)}function n3(e){let{contractName:t,address:r}=e;return{contractName:t,address:r,contract:""}}function n5(e){let t=[];for(let r of e.match(/import ((\w|,| )+)* from 0x\w+/g)||[]){let e=/import ((\w+|, |)*) from (0x\w+)/g.exec(r),i=/((?:\w+)+),?/g;for(let r of e[1].match(i)||[])t.push(n3({address:e[3],contractName:r.replace(/,/g,"")}))}return t}async function n8(e){let{address:t,contractName:r}=e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};iz(void 0!=t,"generateDependencyPin({ address }) -- address must be defined"),iz(void 0!=r,"generateDependencyPin({ contractName }) -- contractName must be defined"),iz("string"==typeof t,"generateDependencyPin({ address }) -- address must be a string"),iz("string"==typeof r,"generateDependencyPin({ contractName }) -- contractName must be a string");let n=[n3({contractName:r,address:t})];for(let e of n){let t=await iF([rD(await eq().get(e.address,e.address))],i).then(i$);if(e.contract=t.contracts?.[e.contractName],!e.contract)throw console.error("Did not find expected contract",e,t),Error("Did not find expected contract");let r=n5(e.contract);n.push(...r)}let s=n.map(e=>n2(e.contract));return n2((await Promise.all(s)).join(""))}async function n4(e,t){let r=[];for(let i of t){let t=[n2(i.network)],{address:n,dependency_pin_block_height:s}=i;if(i.dependency_pin){let r=await n8({address:n,contractName:e,blockHeight:s});t.push(n2(r))}r.push(t)}return r}async function n9(e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],n=[];for(let e=0;e<i?.contracts.length;e++){let t=i?.contracts[e],r=t?.contract;n.push(n2(r));let s=await n4(r,t?.networks);n.push(s)}t.push(n)}return t}async function n7(e){let{template:t}=e;R(t,"generateTemplateId({ template }) -- template must be defined"),R("object"==typeof t,"generateTemplateId({ template }) -- template must be an object"),R("InteractionTemplate"===t.f_type,"generateTemplateId({ template }) -- template object must be an InteractionTemplate"),R("1.1.0"===t.f_version,"generateTemplateId({ template }) -- template object must be an version 1.1.0");let r=t.data,i=await Promise.all(r.messages.map(async e=>[n2(e.key),await Promise.all(e.i18n.map(async e=>[n2(e.tag),n2(e.translation)]))])),n=await Promise.all(r?.parameters.sort((e,t)=>e.index-t.index).map(async e=>[n2(e.label),[n2(String(e.index)),n2(e.type),await Promise.all(e.messages.map(async e=>[n2(e.key),await Promise.all(e.i18n.map(async e=>[n2(e.tag),n2(e.translation)]))]))]])),s=[await n9(r?.dependencies)],o=e$([n2(t?.f_type),n2(t?.f_version),n2(r?.type),n2(r?.interface),i,n2(r?.cadence?.body),[s],n]).toString("hex");return n2(o)}async function se(e){let{address:t,contractName:r}=e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};iz(void 0!=t,"generateDependencyPin({ address }) -- address must be defined"),iz(void 0!=r,"generateDependencyPin({ contractName }) -- contractName must be defined"),iz("string"==typeof t,"generateDependencyPin({ address }) -- address must be a string"),iz("string"==typeof r,"generateDependencyPin({ contractName }) -- contractName must be a string");let n=[n3({contractName:r,address:t})];for(let e of n){let t=await iF([rD(await eq().get(e.address,e.address))],i).then(i$);if(e.contract=t.contracts?.[e.contractName],!e.contract)throw console.error("Did n
111ot find expected contract",e,t),Error("Did not find expected contract");let r=n5(e.contract);n.push(...r)}let s=n.map(e=>n2(e.contract)).join("");return n2(s)}async function st(e){let{version:t,address:r,contractName:i}=e;switch(iz(void 0!=r,"generateDependencyPin({ address }) -- address must be defined"),iz(void 0!=i,"generateDependencyPin({ contractName }) -- contractName must be defined"),iz("string"==typeof r,"generateDependencyPin({ address }) -- address must be a string"),iz("string"==typeof i,"generateDependencyPin({ contractName }) -- contractName must be a string"),t){case"1.1.0":return await n8({address:r,contractName:i});case"1.0.0":return await se({address:r,contractName:i});default:throw Error("deriveCadenceByNetwork Error: Unsupported template version")}}async function sr(e,t){if(null==e||null==t)return[];let r=new nh(e);r.searchParams.append("code",t);let i=await fetch(r,{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>e.json());if(Array.isArray(i))return i;let n=[];if(Array.isArray(i.authorizations))for(let e of i.authorizations)n.push({type:"authz",keyId:i.keyId,...e});return null!=i.provider&&n.push({type:"authn",id:"wallet-provider#authn",...i.provider}),n}function si(e){return null==e?null:e.f_vsn?"1.0.0"===e.f_vsn?e:null:{old:e,...nl,type:"frame",endpoint:e.endpoint,params:e.params||{},data:e.data||{}}}function sn(e){return null==e?null:e.f_vsn?"1.0.0"===e.f_vsn?e:null:{...nl,type:"back-channel-rpc",endpoint:e.endpoint,method:e.method,params:e.params||{},data:e.data||{}}}function ss(e){return null==e?null:(null==e.method&&(e={...e,type:"local-view",method:"VIEW/IFRAME"}),e.f_vsn)?"1.0.0"===e.f_vsn?e:null:{...nl,type:e.type||"local-view",method:e.method,endpoint:e.endpoint,data:e.data||{},params:e.params||{}}}let so={"back-channel-rpc":sn,"pre-authz":function(e){return null==e?null:e.f_vsn?"1.0.0"===e.f_vsn?e:null:{...nl,type:e.type,uid:e.id,endpoint:e.endpoint,method:e.method,identity:{...nd,address:eX(e.addr),keyId:e.keyId},params:e.params,data:e.data}},authz:function(e){return null==e?null:e.f_vsn?"1.0.0"===e.f_vsn?e:null:{...nl,type:e.type,uid:e.id,endpoint:e.endpoint,method:e.method,identity:{...nd,address:eX(e.addr),keyId:e.keyId},params:e.params,data:e.data}},authn:function(e){return null==e?null:e.f_vsn?"1.0.0"===e.f_vsn?e:null:{...nl,type:e.type,uid:e.id,endpoint:e.authn,id:e.pid,provider:{address:eX(e.addr),name:e.name,icon:e.icon}}},frame:si,"open-id":function(e){return null==e?null:"1.0.0"===e.f_vsn?e:null},"user-signature":function(e){if(null==e)return null;if(!e.f_vsn)throw Error("Invalid user-signature service");return"1.0.0"===e.f_vsn?e:null},"local-view":ss,"account-proof":function(e){if(null==e)return null;if(!e.f_vsn)throw Error("FCL Normalizer Error: Invalid account-proof service");return"1.0.0"===e.f_vsn?e:null},"authn-refresh":function(e){if(null==e)return null;if(!e.f_vsn)throw Error("Invalid authn-refresh service");return"1.0.0"===e.f_vsn?e:null}};function sa(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return e.reduce((e,r)=>r.type===t&&(!e||iZ(r.f_vsn,e.f_vsn)>0)?r:e,null)}async function su(e){(t=e).addr=t.addr?eX(t.addr):null,t.paddr=t.paddr?eX(t.paddr):null;var t,r=(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return[...e,...t]})((e=t).services||[],await sr(e.hks,e.code)).map(e=>(function(e,t){try{return so[e.type](e,t)}catch(t){return console.error(`Unrecognized FCL Service Type [${e.type}]`,e,t),e}})(e,void 0)).filter(Boolean);let i=sa(r,"authn");return{...np,addr:eX(e.addr),cid:e$([i.provider?.address||i.provider?.name||"UNSPECIFIED",i.id]).toString("hex"),loggedIn:!0,services:r,expiresAt:e.expires}}let sf="undefined"==typeof window,sc=globalThis.AbortController||r(6800),sh=async e=>{let{service:t,body:r,config:i,abortSignal:n,customRpc:s,opts:o}=e;return nK().getStrategy(t.method)({service:t,body:r,config:i,abortSignal:n,customRpc:s,opts:o})};async function sl(e){let{service:t,msg:r={},config:i={},opts:n={}
111,platform:s,abortSignal:o=new sc().signal,execStrategy:a}=e;!sf&&(nK().getStrategies().includes("WC/RPC")||A.Rm({title:"FCL WalletConnect Service Plugin",level:A.A_.error,message:"All dApps are expected to register for a WalletConnect projectId & add this to their FCL configuration.  If you do not do so, users will be unable to use certain wallets to interact with your dApp.  See https://developers.flow.com/tools/clients/fcl-js/configure-fcl for more information."})),r.data=t.data;let u={services:await n_(/^service\./),app:await n_(/^app\.detail\./),client:{...i.client,platform:s,fclVersion:iQ,fclLibrary:"https://github.com/onflow/fcl-js",hostname:window?.location?.hostname??null,network:await nn(n)}};try{let e=await (a||sh)({service:t,body:r,config:u,opts:n,abortSignal:o});if("REDIRECT"===e.status)return R(t.type===e.data.type,"Cannot shift recursive service type in execService"),await sl({service:e.data,msg:r,config:u,opts:n,abortSignal:o});return e}catch(e){throw(0,A.Rm)({title:`Error on execService ${t?.type}`,message:e,level:A.A_.error}),e}}function sd(e){return null==e?null:e.f_vsn?"1.0.0"===e.f_vsn?e:null:{...nm,addr:eJ(e.addr||e.address),signature:e.signature||e.sig,keyId:e.keyId}}let sp=e=>"function"==typeof e,sg="CURRENT_USER",sm="CURRENT_USER/UPDATED",sb="SNAPSHOT",sy="SET_CURRENT_USER",sv="DEL_CURRENT_USER",sw=`{
112  "f_type": "User",
113  "f_vsn": "1.0.0",
114  "addr":null,
115  "cid":null,
116  "loggedIn":null,
117  "expiresAt":null,
118  "services":[]
119}`,s_=async e=>{let t=JSON.parse(sw),r=await e.get(sg);return null!=r&&t.f_vsn!==r.f_vsn?(e.removeItem(sg),t):r||t},sE={[B]:async e=>{"undefined"==typeof window&&console.warn(`
120        %cFCL Warning
121        ============================
122        "currentUser" is only available in the browser.
123        For more info, please see the docs: https://docs.onflow.org/fcl/
124        ============================
125        `,"font-weight:bold;font-family:monospace;"),e.merge(JSON.parse(sw));let t=await eq.first(["fcl.storage","fcl.storage.default"]);if(t.can){let r=await s_(t);(function(e){return null==e.expiresAt||0===e.expiresAt||e.expiresAt>Date.now()})(r)&&e.merge(r)}},[q]:(e,t)=>{e.subscribe(t.from),e.send(t.from,sm,{...e.all()})},[z]:(e,t)=>{e.unsubscribe(t.from)},[sb]:async(e,t)=>{t.reply({...e.all()})},[sy]:async(e,t,r)=>{e.merge(r);let i=await eq.first(["fcl.storage","fcl.storage.default"]);i.can&&i.put(sg,e.all()),e.broadcast(sm,{...e.all()})},[sv]:async(e,t)=>{e.merge(JSON.parse(sw));let r=await eq.first(["fcl.storage","fcl.storage.default"]);r.can&&r.put(sg,e.all()),e.broadcast(sm,{...e.all()})}},sx=()=>Q(sE,sg);async function sS(){let e=await eq.get("fcl.accountProof.resolver");if(null==e)return;if(!sp(e)){(0,A.Rm)({title:"Account Proof Data Resolver must be a function",message:`Check fcl.accountProof.resolver configuration.
126                Expected: fcl.accountProof.resolver: async () => { ... }
127                Received: fcl.accountProof.resolver: ${typeof e}
128                `,level:A.A_.warn});return}let t=await e();if(null!=t)return R("string"==typeof t.appIdentifier,"appIdentifier must be a string"),R(/^[0-9a-f]+$/i.test(t.nonce),"Nonce must be a hex string"),t}let sM=async e=>{let{discoveryAuthnInclude:t,discoveryFeaturesSuggested:r}=e;return{client:{discoveryAuthnInclude:t,discoveryFeaturesSuggested:r,clientServices:await nG(),supportedStrategies:nK().getStrategies()}}},sI=e=>{let{platform:t,discovery:r}=e;return async function(){let{service:e,redir:i=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e&&!e?.provider?.is_installed&&e?.provider?.requires_install){window.location.href=e?.provider?.install_link;return}return new Promise(async(n,s)=>{let o;sx();let a={redir:i},u=await sN(),f=await nW(e),c=sa(u.services,"authn-refresh");if(u.loggedIn){if(!c)return n(u);try{let e=await sl({service:c,msg:o,opts:a,platform:t});J(sg,sy,await su(e))}catch(e){(0,A.Rm)({title:`${e.name} Could not refresh wallet authentication.`,message:e.message,level:A.A_.error})}finally{return n(await sN())}}try{o=await sS()}catch(e){return(0,A.Rm)({title:`${e.name} On Authentication: Could not resolve account proof data.`,message:e.message,level:A.A_.error}),s(e)}try{let e=await sl({service:f,msg:o,config:await sM(f),opts:a,platform:t,execStrategy:r?.execStrategy});J(sg,sy,await su(e))}catch(e){(0,A.Rm)({title:`${e} On Authentication`,message:e,level:A.A_.error})}finally{n(await sN())}})}};function sA(){sx(),J(sg,sv)}let sR=e=>({f_type:"PreAuthzResponse",f_vsn:"1.0.0",proposer:(e||{}).proposer,payer:(e||{}).payer||[],authorization:(e||{}).authorization||[]}),sD=e=>{let{platform:t}=e;return e=>{let r=sR(e),i=[];for(let e of(null!=r.proposer&&i.push(["PROPOSER",r.proposer]),r.payer||[]))i.push(["PAYER",e]);for(let e of r.authorization||[])i.push(["AUTHORIZER",e]);return i.map(e=>{let[r,i]=e;return{tempId:[i.identity.address,i.identity.keyId].join("|"),addr:i.identity.address,keyId:i.identity.keyId,signingFunction:e=>sl({service:i,msg:e,platform:t,opts:{initiatedByPreAuthz:!0}}),role:{proposer:"PROPOSER"===r,payer:"PAYER"===r,authorizer:"AUTHORIZER"===r}}})}},sO=e=>{let{platform:t,discovery:r}=e;return async e=>(sx(),{...e,tempId:"CURRENT_USER",async resolve(e,i){let n=await sI({platform:t,discovery:r})({redir:!0}),s=sa(n.services,"authz"),o=sa(n.services,"pre-authz");if(o)return sD({platform:t,discovery:r})(await sl({service:o,msg:i,platform:t}));if(s)return{...e,tempId:"CURRENT_USER",resolve:null,addr:eJ(s.identity.address),keyId:s.identity.keyId,sequenceNum:null,signature:null,signingFunction:async e=>sd(await sl({service:s,msg:e,opts:{includeOlderJsonRpcCall:!0},platform:t}))};throw Error("No Authz or PreAuthz Service configured for CURRENT_USER")}})};function sP(e){sx();let t="@EXIT",r=Q(async r=>{for(r.send(sg,q);;){let i=await r.receive();if(i.tag===t){r.send(sg,z);return}e(i.data)}});return()=>J(r,t)}function sN(){return sx(),J(sg,sb,null,{expectReply:!0,timeout:0})}let sT=e=>{let{platform:t,discovery:r}=e;return async()=>{let{addr:e}=await sI({platform:t,discovery:r})();return iV(eX(e),iG.Address)}},sk=e=>(R(/^[0-9a-f]+$/i.test(e),"Message must be a hex string"),{message:e}),sC=e=>{let{platform:t,discovery:r}=e;return async e=>{sx();let i=sa((await sI({platform:t,discovery:r})({redir:!0})).services,"user-signature");R(i,"Current user must have authorized a signing service.");try{let r=await sl({service:i,msg:sk(e),platform:t});if(Array.isArray(r))return r.map(e=>sd(e));return[sd(r)]}catch(e){return e}}};function sL(e){let t=new nh(e.endpoint);if(window?.location?.origin&&t.searchParams.append("l6n",window.location.origin),null!=e.params)for(let[r,i]of Object.entries(e.params||{}))t.searchParams.append(r,i);return t}function sU(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.method||"POST",i="GET"===r?void 0:JSON.stringify(t.data||e.data||{});return fetch(sL(e),{method:r,headers:{...e.headers||{},...t.headers||{},"Content-Type":"application/json"},body:i}).then(e=>e.json())}function sj(e){return null==e?null:e.f_vsn?"1.0.0"===e.f_vsn?e:null:{...ng,status:e.status??"APPROVED",reason:e.reason??null,data:e.compositeSignature||e.data||{...e},updates:sn(e.authorizationUpdates),local:si((e.local||[])[0])}}let sB={"HTTP/GET":"GET","HTTP/POST":"POST"},sq=e=>(R(sB[e.method],"Invalid Service Method for type back-channel-rpc",{service:e}),sB[e.method]);async function sz(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>!0;if(R(e,"Missing Polling Service",{service:e}),!r())throw Error("Externally Halted");try{if("undefined"!=typeof document&&"hidden"===document.visibilityState)return await new Promise(e=>setTimeout(e,500)),sz(e,r);t=await sU(e,{method:sq(e)}).then(sj)}catch(e){throw e}switch(t.status){case"APPROVED":return t.data;case"DECLINED":throw Error(`Declined: ${t.reason||"No reason supplied."}`);default:return await new Promise(e=>setTimeout(e,500)),sz(t.updates,r)}}let sF=e=>async t=>{let{service:r,body:i,config:n,opts:s}=t,o=await sU(r,{data:{fclVersion:iQ,service:{params:r.params,data:r.data,type:r.type},config:n,...i}}).then(sj);if("APPROVED"===o.status)return o.data;if("DECLINED"===o.status)throw Error(`Declined: ${o.reason||"No reason supplied."}`);if("REDIRECT"===o.status)return o;if("PENDING"===o.status){var a=!0,u=!0;let[t,r]=await e(ss(o.local),{serviceEndpoint:sL,onClose:()=>u=!1}),i=()=>{try{r(),u=!1}catch(e){console.error("Frame Close Error",e)}};return sz(o.updates,()=>{let e=a;return a=u,e}).then(e=>(i(),e)).catch(e=>{throw console.error(e),i(),e})}throw console.error("Auto Decline: Invalid Response",{service:r,resp:o}),Error("Auto Decline: Invalid Response")},s$="FCL:VIEW:CLOSE",sH="FCL:VIEW:READY",sK="FCL:VIEW:RESPONSE",sV=e=>"string"==typeof e&&e.toLowerCase(),sG=new Set(["monetizationstart","monetizationpending","monetizationprogress","monetizationstop"]),sW=(e,t)=>
128console.warn("DEPRECATION NOTICE",`Received ${e}, please use ${t} for this and future versions of FCL`),sJ=e=>{let t,{close:r,send:i,onReady:n,onResponse:s,onMessage:o,onCustomRpc:a,getSource:u}=e;return e=>{try{t=u?.()||t}catch(e){t=null}try{if("object"!=typeof e.data||sG.has(e.data.type)||null!=t&&e.source!==t)return;sV(e.data.type)===sV(s$)&&r(),sV(e.data.type)===sV(sH)&&(n(e,{send:i,close:r}),t||=e.source),sV(e.data.type)===sV(sK)&&s(e,{send:i,close:r}),sV(e.data.type)===sV("FCL:VIEW:CUSTOM_RPC")&&a(e.data.payload,{send:i,close:r}),o(e,{send:i,close:r}),sV(e.data.type)===sV("FCL:FRAME:READY")&&(sW(e.data.type,sH),n(e,{send:i,close:r}),t||=e.source),sV(e.data.type)===sV("FCL:FRAME:RESPONSE")&&(sW(e.data.type,sK),s(e,{send:i,close:r})),sV(e.data.type)===sV("FCL:FRAME:CLOSE")&&(sW(e.data.type,s$),r()),sV(e.data.type)===sV("FCL::CHALLENGE::RESPONSE")&&(sW(e.data.type,sK),s(e,{send:i,close:r})),sV(e.data.type)===sV("FCL::AUTHZ_READY")&&(sW(e.data.type,sH),n(e,{send:i,close:r}),t||=e.source),sV(e.data.type)===sV("FCL::CHALLENGE::CANCEL")&&(sW(e.data.type,s$),r()),sV(e.data.type)===sV("FCL::CANCEL")&&(sW(e.data.type,s$),r())}catch(e){console.error("Frame Callback Error",e),r()}}};function sX(e){return(sX="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sY(e,t,r){var i;return(i=function(e,t){if("object"!=sX(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=sX(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==sX(i)?i:i+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}eq.subscribe(()=>{nn({enableRequestLogging:!1}
128).catch(()=>{})});let sZ=function(e){return e[e.INVALID_REQUEST=-32600]="INVALID_REQUEST",e[e.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",e[e.INVALID_PARAMS=-32602]="INVALID_PARAMS",e[e.INTERNAL_ERROR=-32603]="INTERNAL_ERROR",e[e.PARSE_ERROR=-32700]="PARSE_ERROR",e}({});class sQ extends Error{constructor(e,t,r){super(t),this.code=e,this.message=t,this.data=r}}var s0=function(e){return e.HELLO="rpc_hello",e}(s0||{});class s1{constructor(e){let{notifications:t}=e;sY(this,"id",0),sY(this,"setSend",()=>{}),sY(this,"_send",new Promise(e=>{this.setSend=e})),sY(this,"peerInfo",new Promise((e,t)=>{this.resolvePeerInfo=e,this.rejectPeerInfo=t})),sY(this,"enabledNotifications",[]),sY(this,"requestHandlers",{}),sY(this,"subscriptions",{}),sY(this,"messageListeners",[]),this.enabledNotifications=t||[],this.on(s0.HELLO,e=>(this.resolvePeerInfo(e),this.ownInfo()))}connect(e){let{send:t}=e;this.setSend(t),this.requestWithoutConnection(s0.HELLO,this.ownInfo()).then(e=>{this.resolvePeerInfo(e)}).catch(this.rejectPeerInfo)}ownInfo(){return{requests:Object.keys(this.requestHandlers),notifications:this.enabledNotifications}}async send(e){return(await this._send)(e)}receive(e){e?.jsonrpc==="2.0"&&("method"in e&&("id"in e?this.handleRequest(e):this.handleNotification(e)),this.messageListeners.forEach(t=>t(e)))}async handleRequest(e){let t=this.requestHandlers[e.method];if(t)try{let r=await t(e.params);this.send({jsonrpc:"2.0",id:e.id,result:r})}catch(t){t instanceof sQ?this.send({jsonrpc:"2.0",id:e.id,error:{code:t.code,message:t.message,data:t.data}}):this.send({jsonrpc:"2.0",id:e.id,error:{code:sZ.INTERNAL_ERROR,message:t?.message}})}else this.send({jsonrpc:"2.0",id:e.id,error:{code:sZ.METHOD_NOT_FOUND,message:`Method not found: ${e.method}`}})}handleNotification(e){this.subscriptions[e.method]&&this.subscriptions[e.method].forEach(t=>t(e.params))}onMessage(e){return this.messageListeners.push(e),()=>{this.messageListeners=this.messageListeners.filter(t=>t!==e)}}async notify(e,t){await this.onceConnected(),this.send({jsonrpc:"2.0",method:e,params:t})}async request(e,t){return await this.onceConnected(),this.requestWithoutConnection(e,t)}async requestWithoutConnection(e,t){let r=this.id++,i=()=>{},n=new Promise((e,t)=>{i=this.onMessage(i=>{i.id===r&&("result"in i||"error"in i)&&(i.error&&t(new sQ(i.error.code,i.error.message,i.error.data)),e(i.result))})}).finally(i);return this.send({jsonrpc:"2.0",method:e,params:t,id:r}),n}on(e,t){this.requestHandlers[e]=t}subscribe(e,t){this.subscriptions[e]=this.subscriptions[e]||new Set,this.subscriptions[e].add(t)}unsubscribe(e,t){this.subscriptions[e]?.delete(t)}async onceConnected(){return this.peerInfo.then(()=>{})}async getAvailableRequests(){return this.peerInfo.then(e=>e.requests)}async getAvailableNotifications(){return this.peerInfo.then(e=>e.notifications)}}var s2=r(9652);class s6{}class s3 extends s6{constructor(e){super()}}let s5=s2.FIVE_SECONDS,s8={pulse:"heartbeat_pulse"};class s4 extends s3{constructor(e){super(e),this.events=new eY.EventEmitter,this.interval=s5,this.interval=e?.interval||s5}static async init(e){let t=new s4(e);return await t.init(),t}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),(0,s2.toMiliseconds)(this.interval))}pulse(){this.events.emit(s8.pulse)}}let s9=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,s7=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,oe=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function ot(e,t){if("__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`);return}return t}function or(e,t={}){if("string"!=typeof e)return e;let r=e.trim();if('"'===e[0]&&e.endsWith('"')&&!e.includes("\\"))return r.slice(1,-1);if(r.length<=9){let e=r.toLowerCase();if("true"===e)return!0;
128if("false"===e)return!1;if("undefined"===e)return;if("null"===e)return null;if("nan"===e)return Number.NaN;if("infinity"===e)return Number.POSITIVE_INFINITY;if("-infinity"===e)return Number.NEGATIVE_INFINITY}if(!oe.test(e)){if(t.strict)throw SyntaxError("[destr] Invalid JSON");return e}try{if(s9.test(e)||s7.test(e)){if(t.strict)throw Error("[destr] Possible prototype pollution");return JSON.parse(e,ot)}return JSON.parse(e)}catch(r){if(t.strict)throw r;return e}}var oi=r(5927).Buffer;function on(e,...t){try{var r;return(r=e(...t))&&"function"==typeof r.then?r:Promise.resolve(r)}catch(e){return Promise.reject(e)}}function os(e){if(function(e){let t=typeof e;return null===e||"object"!==t&&"function"!==t}(e))return String(e);if(function(e){let t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}(e)||Array.isArray(e))return JSON.stringify(e);if("function"==typeof e.toJSON)return os(e.toJSON());throw Error("[unstorage] Cannot stringify value!")}function oo(){if(void 0===oi)throw TypeError("[unstorage] Buffer is not supported!")}let oa="base64:";function ou(e){return e?e.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function of(e){return(e=ou(e))?e+":":""}let oc=()=>{let e=new Map;return{name:"memory",getInstance:()=>e,hasItem:t=>e.has(t),getItem:t=>e.get(t)??null,getItemRaw:t=>e.get(t)??null,setItem(t,r){e.set(t,r)},setItemRaw(t,r){e.set(t,r)},removeItem(t){e.delete(t)},getKeys:()=>[...e.keys()],clear(){e.clear()},dispose(){e.clear()}}};function oh(e,t,r){return e.watch?e.watch((e,i)=>t(e,r+i)):()=>{}}async function ol(e){"function"==typeof e.dispose&&await on(e.dispose)}function od(e){return new Promise((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)})}function op(e,t){let r=indexedDB.open(e);r.onupgradeneeded=()=>r.result.createObjectStore(t);let i=od(r);return(e,r)=>i.then(i=>r(i.transaction(t,e).objectStore(t)))}function og(){return o||(o=op("keyval-store","keyval")),o}function om(e,t=og()){return t("readonly",t=>od(t.get(e)))}let ob=e=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString()+"n":t),oy=e=>JSON.parse(e.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3'),(e,t)=>"string"==typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t);function ov(e){if("string"!=typeof e)throw Error(`Cannot safe json parse value of type ${typeof e}`);try{return oy(e)}catch(t){return e}}function ow(e){return"string"==typeof e?e:ob(e)||""}var o_=(e={})=>{let t;let r=e.base&&e.base.length>0?`${e.base}:`:"",i=e=>r+e;return e.dbName&&e.storeName&&(t=op(e.dbName,e.storeName)),{name:"idb-keyval",options:e,hasItem:async e=>!(typeof await om(i(e),t)>"u"),getItem:async e=>await om(i(e),t)??null,setItem:(e,r)=>(function(e,t,r=og()){return r("readwrite",r=>(r.put(t,e),od(r.transaction)))})(i(e),r,t),removeItem:e=>(function(e,t=og()){return t("readwrite",t=>(t.delete(e),od(t.transaction)))})(i(e),t),getKeys:()=>(function(e=og()){return e("readonly",e=>{var t;if(e.getAllKeys)return od(e.getAllKeys());let r=[];return(t=e=>r.push(e.key),e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},od(e.transaction)).then(()=>r)})})(t),clear:()=>(function(e=og()){return e("readwrite",e=>(e.clear(),od(e.transaction)))})(t)}};class oE{constructor(){this.indexedDb=function(e={}){let t={mounts:{"":e.driver||oc()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=e=>{for(let r of t.mountpoints)if(e.startsWith(r))return{base:r,relativeKey:e.slice(r.length),driver:t.mounts[r]};return{base:"",relativeKey:e,driver:t.mounts[""]}},i=(e,r)=>t.mountpoints.filter(t=>t.startsWith(e)||r&&e.startsWith(t)).map(r=>({relativeBase:e.length>r.length?e.slice(r.length):void 0,mountpoint:r,driver:t.mounts[r]})),n=(e,r)=>{if(t.watching)for(let i of(r=ou(r),t.watchListeners))i(e,r)},s=async()=>{if(!t.watching)for(let e in t.watching=!0,t.mounts)t.unwatch[e]=await oh(t.mounts[e],n,e)},o=async()=>
128{if(t.watching){for(let e in t.unwatch)await t.unwatch[e]();t.unwatch={},t.watching=!1}},a=(e,t,i)=>{let n=new Map,s=e=>{let t=n.get(e.base);return t||(t={driver:e.driver,base:e.base,items:[]},n.set(e.base,t)),t};for(let i of e){let e="string"==typeof i,n=ou(e?i:i.key),o=e?void 0:i.value,a=e||!i.options?t:{...t,...i.options},u=r(n);s(u).items.push({key:n,value:o,relativeKey:u.relativeKey,options:a})}return Promise.all([...n.values()].map(e=>i(e))).then(e=>e.flat())},u={hasItem(e,t={}){let{relativeKey:i,driver:n}=r(e=ou(e));return on(n.hasItem,i,t)},getItem(e,t={}){let{relativeKey:i,driver:n}=r(e=ou(e));return on(n.getItem,i,t).then(e=>or(e))},getItems:(e,t)=>a(e,t,e=>e.driver.getItems?on(e.driver.getItems,e.items.map(e=>({key:e.relativeKey,options:e.options})),t).then(t=>t.map(t=>({key:function(...e){return ou(e.join(":"))}(e.base,t.key),value:or(t.value)}))):Promise.all(e.items.map(t=>on(e.driver.getItem,t.relativeKey,t.options).then(e=>({key:t.key,value:or(e)}))))),getItemRaw(e,t={}){let{relativeKey:i,driver:n}=r(e=ou(e));return n.getItemRaw?on(n.getItemRaw,i,t):on(n.getItem,i,t).then(e=>"string"==typeof e&&e.startsWith(oa)?(oo(),oi.from(e.slice(oa.length),"base64")):e)},async setItem(e,t,i={}){if(void 0===t)return u.removeItem(e);let{relativeKey:s,driver:o}=r(e=ou(e));o.setItem&&(await on(o.setItem,s,os(t),i),o.watch||n("update",e))},async setItems(e,t){await a(e,t,async e=>{if(e.driver.setItems)return on(e.driver.setItems,e.items.map(e=>({key:e.relativeKey,value:os(e.value),options:e.options})),t);e.driver.setItem&&await Promise.all(e.items.map(t=>on(e.driver.setItem,t.relativeKey,os(t.value),t.options)))})},async setItemRaw(e,t,i={}){if(void 0===t)return u.removeItem(e,i);let{relativeKey:s,driver:o}=r(e=ou(e));if(o.setItemRaw)await on(o.setItemRaw,s,t,i);else{if(!o.setItem)return;await on(o.setItem,s,"string"==typeof t?t:(oo(),oa+oi.from(t).toString("base64")),i)}o.watch||n("update",e)},async removeItem(e,t={}){"boolean"==typeof t&&(t={removeMeta:t});let{relativeKey:i,driver:s}=r(e=ou(e));s.removeItem&&(await on(s.removeItem,i,t),(t.removeMeta||t.removeMata)&&await on(s.removeItem,i+"$",t),s.watch||n("remove",e))},async getMeta(e,t={}){"boolean"==typeof t&&(t={nativeOnly:t});let{relativeKey:i,driver:n}=r(e=ou(e)),s=Object.create(null);if(n.getMeta&&Object.assign(s,await on(n.getMeta,i,t)),!t.nativeOnly){let e=await on(n.getItem,i+"$",t).then(e=>or(e));e&&"object"==typeof e&&("string"==typeof e.atime&&(e.atime=new Date(e.atime)),"string"==typeof e.mtime&&(e.mtime=new Date(e.mtime)),Object.assign(s,e))}return s},setMeta(e,t,r={}){return this.setItem(e+"$",t,r)},removeMeta(e,t={}){return this.removeItem(e+"$",t)},async getKeys(e,t={}){let r=i(e=of(e),!0),n=[],s=[];for(let e of r){for(let r of(await on(e.driver.getKeys,e.relativeBase,t))){let t=e.mountpoint+ou(r);n.some(e=>t.startsWith(e))||s.push(t)}n=[e.mountpoint,...n.filter(t=>!t.startsWith(e.mountpoint))]}return e?s.filter(t=>t.startsWith(e)&&"$"!==t[t.length-1]):s.filter(e=>"$"!==e[e.length-1])},async clear(e,t={}){e=of(e),await Promise.all(i(e,!1).map(async e=>e.driver.clear?on(e.driver.clear,e.relativeBase,t):e.driver.removeItem?Promise.all((await e.driver.getKeys(e.relativeBase||"",t)).map(r=>e.driver.removeItem(r,t))):void 0))},async dispose(){await Promise.all(Object.values(t.mounts).map(e=>ol(e)))},watch:async e=>(await s(),t.watchListeners.push(e),async()=>{t.watchListeners=t.watchListeners.filter(t=>t!==e),0===t.watchListeners.length&&await o()}),async unwatch(){t.watchListeners=[],await o()},mount(e,r){if((e=of(e))&&t.mounts[e])throw Error(`already mounted at ${e}`);return e&&(t.mountpoints.push(e),t.mountpoints.sort((e,t)=>t.length-e.length)),t.mounts[e]=r,t.watching&&Promise.resolve(oh(r,n,e)).then(r=>{t.unwatch[e]=r}).catch(console.error),u},async unmount(e,r=!0){(e=of(e))&&t.mounts[e]&&(t.watching&&e in t.unwatch&&(t.unwatch[e](),delete t.unwatch[e]),r&&await ol(t.mounts[e]),t.mountpoints=t.mountpoints.filter(t=>t!==e),delete t.mounts[e])},getMount(e=""){let t=r(e=ou(e)+":");return{driver:t.driver,base:t.base}},getMounts:(e="",t={})=>i(e=ou(e),t.parents).map(e=>({driver:e.driver,base:e.mountpoint})),keys:(e,t={})=>u.getKeys(e,t),get:(e,t={})=>u.getItem(e,t),set:(e,t,r={})=>u.setItem(e,t,r),has:(e,t={})=>u.hasItem(e,t),del:(e,t={})=>u.removeItem(e,t),remove:(e,t={})=>u.removeItem(e,t)};return u}({driver:o_({dbName:"WALLET_CONNECT_V2_INDEXED_DB",storeName:"keyvaluestorage"})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){let t=await this.indexedDb.getItem(e);if(null!==t)return t}async setItem(e,t){await this.indexedDb.setItem(e,ow(t))}async removeItem(e){await this.indexedDb.removeItem(e)}}var ox="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{},oS={exports:{}};function oM(e){var t;return[e[0],ov(null!=(t=e[1])?t:"")]}!function(){function e(){}e.prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},e.prototype.setItem=function(e,t){this[e]=String(t)},e.prototype.removeItem=function(e){delete this[e]},e.prototype.clear=function(){let e=this;Object.keys(e).forEach(function(t){e[t]=void 0,delete e[t]})},e.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),"u">typeof ox&&ox.localStorage?oS.exports=ox.localStorage:"u">typeof window&&window.localStorage?oS.exports=window.localStorage:oS.exports=new e}();class oI{constructor(){this.localStorage=oS.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(oM)}async getItem(e){let t=this.localStorage.getItem(e);if(null!==t)return ov(t)}async setItem(e,t){this.localStorage.setItem(e,ow(t))}async removeItem(e){this.localStorage.removeItem(e)}}let oA=async(e,t,r)=>{let i="wc_storage_version",n=await t.getItem(i);if(n&&n>=1){r(t);return}let s=await e.getKeys();if(!s.length){r(t);return}let o=[];for(;s.length;){let r=s.shift();if(!r)continue;let i=r.toLowerCase();if(i.includes("wc@")||i.includes("walletconnect")||i.includes("wc_")||i.includes("wallet_connect")){let i=await e.getItem(r);await t.setItem(r,i),o.push(r)}}await t.setItem(i,1),r(t),oR(e,o)},oR=async(e,t)=>{t.length&&t.forEach(async t=>{await e.removeItem(t)})};class oD{constructor(){this.initialized=!1,this.setInitialized=e=>{this.storage=e,this.initialized=!0};let e=new oI;this.storage=e;try{let t=new oE;oA(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{let t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}}var oO=r(8509),oP=r.n(oO);let oN={level:"info"},oT="custom_context";class ok{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class oC{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){let t=new ok(e);if(t.size>this.maxSizeInBytes)throw Error(`[LinkedList] Value too big to insert into list: ${e} with size ${t.size}`);for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?this.tail&&(this.tail.next=t):this.head=t,this.tail=t,this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;let e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){let e=[],t=this.head;for(;null!==t;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};let t=e.value;return e=e.next,{done:!1,value:t}}}}}class oL{constructor(e,t=1024e3){this.level=e??"error",this.levelValue=oO.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new oC(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===oO.levels.values.error?console.error(e):t===oO.levels.values.warn?console.warn(e):t===oO.levels.values.debug?console.debug(e):t===oO.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(ow({timestamp:new Date().toISOString(),log:e}));let t="string"==typeof e?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new oC(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){let t=this.getLogArray();return t.push(ow({extraMetadata:e})),new Blob(t,{type:"application/json"})}}class oU{constructor(e,t=1024e3){this.baseChunkLogger=new oL(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){let t=URL.createObjectURL(this.logsToBlob(e)),r=document.createElement("a");r.href=t,r.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(t)}}class oj{constructor(e,t=1024e3){this.baseChunkLogger=new oL(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var oB=Object.defineProperty,oq=Object.defineProperties,oz=Object.getOwnPropertyDescriptors,oF=Object.getOwnPropertySymbols,o$=Object.prototype.hasOwnProperty,oH=Object.prototype.propertyIsEnumerable,oK=(e,t,r)=>t in e?oB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,oV=(e,t)=>{for(var r in t||(t={}))o$.call(t,r)&&oK(e,r,t[r]);if(oF)for(var r of oF(t))oH.call(t,r)&&oK(e,r,t[r]);return e},oG=(e,t)=>
128oq(e,oz(t));function oW(e){return oG(oV({},e),{level:e?.level||oN.level})}function oJ(e,t=oT){return typeof e.bindings>"u"?function(e,t=oT){return e[t]||""}(e,t):e.bindings().context||""}function oX(e,t,r=oT){let i=function(e,t,r=oT){let i=oJ(e,r);return i.trim()?`${i}/${t}`:t}(e,t,r);return function(e,t,r=oT){return e[r]=t,e}(e.child({context:i}),i,r)}class oY extends s6{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class oZ extends s6{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}}class oQ{constructor(e,t){this.logger=e,this.core=t}}class o0 extends s6{constructor(e,t){super(),this.relayer=e,this.logger=t}}class o1 extends s6{constructor(e){super()}}class o2{constructor(e,t,r,i){this.core=e,this.logger=t,this.name=r}}class o6 extends s6{constructor(e,t){super(),this.relayer=e,this.logger=t}}class o3 extends s6{constructor(e,t){super(),this.core=e,this.logger=t}}class o5{constructor(e,t,r){this.core=e,this.logger=t,this.store=r}}class o8{constructor(e,t){this.projectId=e,this.logger=t}}class o4{constructor(e,t,r){this.core=e,this.logger=t,this.telemetryEnabled=r}}class o9{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class o7{constructor(e){this.client=e}}var ae=r(7004),at=r(9992);let ar="base64url",ai="utf8",an="utf8",as="base58btc";function ao(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function aa(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?ao(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}let au=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var n=0;n<e.length;n++){var s=e.charAt(n),o=s.charCodeAt(0);if(255!==r[o])throw TypeError(s+" is ambiguous");r[o]=n}var a=e.length,u=e.charAt(0),f=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function h(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var i=0,n=0;e[t]===u;)i++,t++;for(var s=(e.length-t)*f+1>>>0,o=new Uint8Array(s);e[t];){var c=r[e.charCodeAt(t)];if(255===c)return;for(var h=0,l=s-1;(0!==c||h<n)&&-1!==l;l--,h++)c+=a*o[l]>>>0,o[l]=c%256>>>0,c=c/256>>>0;if(0!==c)throw Error("Non-zero carry");n=h,t++}if(" "!==e[t]){for(var d=s-n;d!==s&&0===o[d];)d++;for(var p=new Uint8Array(i+(s-d)),g=i;d!==s;)p[g++]=o[d++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,i=0,n=0,s=t.length;n!==s&&0===t[n];)n++,r++;for(var o=(s-n)*c+1>>>0,f=new Uint8Array(o);n!==s;){for(var h=t[n],l=0,d=o-1;(0!==h||l<i)&&-1!==d;d--,l++)h+=256*f[d]>>>0,f[d]=h%a>>>0,h=h/a>>>0;if(0!==h)throw Error("Non-zero carry");i=l,n++}for(var p=o-i;p!==o&&0===f[p];)p++;for(var g=u.repeat(r);p<o;++p)g+=e.charAt(f[p]);return g},decodeUnsafe:h,decode:function(e){var r=h(e);if(r)return r;throw Error(`Non-${t} character`)}}};new Uint8Array(0);let af=(e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},ac=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},ah=e=>new TextEncoder().encode(e),al=e=>new TextDecoder().decode(e);class ad{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class ap{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name}
128 decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return am(this,e)}}class ag{constructor(e){this.decoders=e}or(e){return am(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let am=(e,t)=>new ag({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class ab{constructor(e,t,r,i){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=i,this.encoder=new ad(e,t,r),this.decoder=new ap(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let ay=({name:e,prefix:t,encode:r,decode:i})=>new ab(e,t,r,i),av=({prefix:e,name:t,alphabet:r})=>{let{encode:i,decode:n}=au(r,t);return ay({prefix:e,name:t,encode:i,decode:e=>ac(n(e))})},aw=(e,t,r,i)=>{let n={};for(let e=0;e<t.length;++e)n[t[e]]=e;let s=e.length;for(;"="===e[s-1];)--s;let o=new Uint8Array(s*r/8|0),a=0,u=0,f=0;for(let t=0;t<s;++t){let s=n[e[t]];if(void 0===s)throw SyntaxError(`Non-${i} character`);u=u<<r|s,(a+=r)>=8&&(a-=8,o[f++]=255&u>>a)}if(a>=r||255&u<<8-a)throw SyntaxError("Unexpected end of data");return o},a_=(e,t,r)=>{let i="="===t[t.length-1],n=(1<<r)-1,s="",o=0,a=0;for(let i=0;i<e.length;++i)for(a=a<<8|e[i],o+=8;o>r;)o-=r,s+=t[n&a>>o];if(o&&(s+=t[n&a<<r-o]),i)for(;s.length*r&7;)s+="=";return s},aE=({name:e,prefix:t,bitsPerChar:r,alphabet:i})=>ay({prefix:t,name:e,encode:e=>a_(e,i,r),decode:t=>aw(t,i,r,e)}),ax=ay({prefix:"\0",name:"identity",encode:e=>al(e),decode:e=>ah(e)}),aS=aE({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),aM=aE({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),aI=av({prefix:"9",name:"base10",alphabet:"0123456789"}),aA=aE({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),aR=aE({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),aD=aE({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),aO=aE({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),aP=aE({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),aN=aE({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),aT=aE({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),ak=aE({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),aC=aE({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),aL=aE({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),aU=aE({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),aj=av({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),aB=av({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),aq=av({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),az=av({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),aF=aE({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),a$=aE({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),aH=aE({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),aK=aE({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),aV=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),aG=aV.reduce((e,t,r)=>(e[r]=t,e),[]),aW=aV.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]),aJ=ay({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>
128e+=aG[t],"")},decode:function(e){let t=[];for(let r of e){let e=aW[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}}),aX={encode:function e(t,r,i){r=r||[];for(var n=i=i||0;t>=0x80000000;)r[i++]=255&t|128,t/=128;for(;-128&t;)r[i++]=255&t|128,t>>>=7;return r[i]=0|t,e.bytes=i-n+1,r},decode:function e(t,r){var i,n=0,r=r||0,s=0,o=r,a=t.length;do{if(o>=a)throw e.bytes=0,RangeError("Could not decode varint");i=t[o++],n+=s<28?(127&i)<<s:(127&i)*Math.pow(2,s),s+=7}while(i>=128);return e.bytes=o-r,n},encodingLength:function(e){return e<128?1:e<16384?2:e<2097152?3:e<0x10000000?4:e<0x800000000?5:e<0x40000000000?6:e<0x2000000000000?7:e<0x100000000000000?8:e<0x8000000000000000?9:10}},aY=(e,t=0)=>[aX.decode(e,t),aX.decode.bytes],aZ=(e,t,r=0)=>(aX.encode(e,t,r),t),aQ=e=>aX.encodingLength(e),a0=(e,t)=>{let r=t.byteLength,i=aQ(e),n=i+aQ(r),s=new Uint8Array(n+r);return aZ(e,s,0),aZ(r,s,i),s.set(t,n),new a6(e,r,t,s)},a1=e=>{let t=ac(e),[r,i]=aY(t),[n,s]=aY(t.subarray(i)),o=t.subarray(i+s);if(o.byteLength!==n)throw Error("Incorrect length");return new a6(r,n,o,t)},a2=(e,t)=>
128e===t||e.code===t.code&&e.size===t.size&&af(e.bytes,t.bytes);class a6{constructor(e,t,r,i){this.code=e,this.size=t,this.digest=r,this.bytes=i}}let a3=({name:e,code:t,encode:r})=>new a5(e,t,r);class a5{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?a0(this.code,t):t.then(e=>a0(this.code,e))}throw Error("Unknown type, must be binary type")}}let a8=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),a4=a3({name:"sha2-256",code:18,encode:a8("SHA-256")}),a9=a3({name:"sha2-512",code:19,encode:a8("SHA-512")}),a7={code:0,name:"identity",encode:ac,digest:e=>a0(0,ac(e))},ue="raw",ut=85,ur=e=>ac(e),ui=e=>ac(e),un=new TextEncoder,us=new TextDecoder,uo="json",ua=512,uu=e=>un.encode(JSON.stringify(e)),uf=e=>JSON.parse(us.decode(e));class uc{constructor(e,t,r,i){this.code=t,this.version=e,this.multihash=r,this.bytes=i,this.byteOffset=i.byteOffset,this.byteLength=i.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:uv,byteLength:uv,code:uy,version:uy,multihash:uy,bytes:uy,_baseCache:uv,asCID:uv})}toV0(){if(0===this.version)return this;{let{code:e,multihash:t}=this;if(e!==up)throw Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==ug)throw Error("Cannot convert non sha2-256 multihash CID to CIDv0");return uc.createV0(t)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=a0(e,t);return uc.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&a2(this.multihash,e.multihash)}toString(e){let{bytes:t,version:r,_baseCache:i}=this;return 0===r?ul(t,i,e||aq.encoder):ud(t,i,e||aD.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return uw(/^0\.0/,u_),!!(e&&(e[ub]||e.asCID===e))}get toBaseEncodedString(){throw Error("Deprecated, use .toString()")}get codec(){throw Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw Error('"multibaseName" property is deprecated')}get prefix(){throw Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof uc)return e;if(null!=e&&e.asCID===e){let{version:t,code:r,multihash:i,bytes:n}=e;return new uc(t,r,i,n||um(t,r,i.bytes))}if(null==e||!0!==e[ub])return null;{let{version:t,multihash:r,code:i}=e,n=a1(r);return uc.create(t,i,n)}}static create(e,t,r){if("number"!=typeof t)throw Error("String codecs are no longer supported");switch(e){case 0:if(t===up)return new uc(e,t,r,r.bytes);throw Error(`Version 0 CID must use dag-pb (code: ${up}) block encoding`);case 1:{let i=um(e,t,r.bytes);return new uc(e,t,r,i)}default:throw Error("Invalid version")}}static createV0(e){return uc.create(0,up,e)}static createV1(e,t){return uc.create(1,e,t)}static decode(e){let[t,r]=uc.decodeFirst(e);if(r.length)throw Error("Incorrect length");return t}static decodeFirst(e){let t=uc.inspectBytes(e),r=t.size-t.multihashSize,i=ac(e.subarray(r,r+t.multihashSize));if(i.byteLength!==t.multihashSize)throw Error("Incorrect length");let n=i.subarray(t.multihashSize-t.digestSize),s=new a6(t.multihashCode,t.digestSize,n,i);return[0===t.version?uc.createV0(s):uc.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=()=>{let[r,i]=aY(e.subarray(t));return t+=i,r},i=r(),n=up;if(18===i?(i=0,t=0):1===i&&(n=r()),0!==i&&1!==i)throw RangeError(`Invalid CID version ${i}`);let s=t,o=r(),a=r(),u=t+a;return{version:i,codec:n,multihashCode:o,digestSize:a,multihashSize:u-s,size:u}}static parse(e,t){let[r,i]=uh(e,t),n=uc.decode(i);return n._baseCache.set(r,e),n}}let uh=(e,t)=>{switch(e[0]){case"Q":{let r=t||aq;return[aq.prefix,r.decode(`${aq.prefix}${e}`)]}case aq.prefix:{let r=t||aq;return[aq.prefix,r.decode(e)]}case aD.prefix:{let r=t||aD;return[aD.prefix,r.decode(e)]}default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}},ul=(e,t,r)=>{let{prefix:i}=r;if(i!==aq.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let n=t.get(i);if(null!=n)return n;{let n=r.encode(e).slice(1);return t.set(i,n),n}},ud=(e,t,r)=>{let{prefix:i}=r,n=t.get(i);if(null!=n)return n;{let n=r.encode(e);return t.set(i,n),n}},up=112,ug=18,um=(e,t,r)=>{let i=aQ(e),n=i+aQ(t),s=new Uint8Array(n+r.byteLength);return aZ(e,s,0),aZ(t,s,i),s.set(r,n),s}
128,ub=Symbol.for("@ipld/js-cid/CID"),uy={writable:!1,configurable:!1,enumerable:!0},uv={writable:!1,enumerable:!1,configurable:!1},uw=(e,t)=>{if(e.test("0.0.0-dev"))console.warn(t);else throw Error(t)},u_=`CID.isCID(v) is deprecated and will be removed in the next major release.
129Following code pattern:
130
131if (CID.isCID(value)) {
132  doSomethingWithCID(value)
133}
134
135Is replaced with:
136
137const cid = CID.asCID(value)
138if (cid) {
139  // Make sure to use cid instead of value
140  doSomethingWithCID(cid)
141}
142`,uE={...d,...p,...g,...m,...b,...y,...v,...w,..._,...E};function ux(e,t,r,i){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:i}}}({...x,...S});let uS=ux("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),uM=ux("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=aa((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),uI={utf8:uS,"utf-8":uS,hex:uE.base16,latin1:uM,ascii:uM,binary:uM,...uE};function uA(e,t="utf8"){let r=uI[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}function uR(e,t="utf8"){let r=uI[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?ao(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function uD(e){return ov(uA(uR(e,ar),ai))}function uO(e){return uA(uR(ow(e),ai),ar)}function uP(e){return["did","key","z"+uA(function(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));let r=aa(t),i=0;for(let t of e)r.set(t,i),i+=t.length;return ao(r)}([uR("K36",as),e]),as)].join(":")}function uN(e){let t=e.split("."),r=uD(t[0]);return{header:r,payload:uD(t[1]),signature:uR(t[2],ar),data:uR(t.slice(0,2).join("."),an)}}function uT(e=(0,at.randomBytes)(32)){return ae.K(e)}async function uk(e,t,r,i,n=(0,s2.fromMiliseconds)(Date.now())){var s,o;let a={alg:"EdDSA",typ:"JWT"},u={iss:uP(i.publicKey),sub:e,aud:t,iat:n,exp:n+r},f=uR([uO((s={header:a,payload:u}).header),uO(s.payload)].join("."),an);return[uO((o={header:a,payload:u,signature:ae._S(i.secretKey,f)}).header),uO(o.payload),uA(o.signature,ar)].join(".")}r(1285);var uC=r(2818),uL=function(e,t,r){if(r||2==arguments.length)for(var i,n=0,s=t.length;n<s;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},uU=function(e,t,r){this.name=e,this.version=t,this.os=r,this.type="browser"},uj=function(e){this.version=e,this.type="node",this.name="node",this.os=uC.platform},uB=function(e,t,r,i){this.name=e,this.version=t,this.os=r,this.bot=i,this.type="bot-device"},uq=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},uz=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},uF=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,u$=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;
142\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],uH=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]],uK=r(5208),uV=r(9973),uG=r(7536);let uW=!1,uJ=!1,uX={debug:1,default:2,info:2,warning:3,error:4,off:5},uY=uX.default,uZ=null,uQ=function(){try{let e=[];
142if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test"!=="test".normalize(t))throw Error("bad normalize")}catch(r){e.push(t)}}),e.length)throw Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw Error("broken implementation")}catch(e){return e.message}return null}();!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(u||(u={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(f||(f={}));let u0="0123456789abcdef";class u1{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let r=e.toLowerCase();null==uX[r]&&this.throwArgumentError("invalid log level name","logLevel",e),uY>uX[r]||console.log.apply(console,t)}debug(...e){this._log(u1.levels.DEBUG,e)}info(...e){this._log(u1.levels.INFO,e)}warn(...e){this._log(u1.levels.WARNING,e)}makeError(e,t,r){if(uJ)return this.makeError("censored error",t,{});t||(t=u1.errors.UNKNOWN_ERROR),r||(r={});let i=[];Object.keys(r).forEach(e=>{let t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e<t.length;e++)r+=u0[t[e]>>4],r+=u0[15&t[e]];i.push(e+"=Uint8Array(0x"+r+")")}else i.push(e+"="+JSON.stringify(t))}catch(t){i.push(e+"="+JSON.stringify(r[e].toString()))}}),i.push(`code=${t}`),i.push(`version=${this.version}`);let n=e,s="";switch(t){case f.NUMERIC_FAULT:{s="NUMERIC_FAULT";let t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":s+="-"+t;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case f.CALL_EXCEPTION:case f.INSUFFICIENT_FUNDS:case f.MISSING_NEW:case f.NONCE_EXPIRED:case f.REPLACEMENT_UNDERPRICED:case f.TRANSACTION_REPLACED:case f.UNPREDICTABLE_GAS_LIMIT:s=t}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(e+=" ("+i.join(", ")+")");let o=Error(e);return o.reason=n,o.code=t,Object.keys(r).forEach(function(e){o[e]=r[e]}),o}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,u1.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,i){e||this.throwError(t,r,i)}assertArgument(e,t,r,i){e||this.throwArgumentError(t,r,i)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),uQ&&this.throwError("platform missing String.prototype.normalize",u1.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:uQ})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=0x1fffffffffffff)&&this.throwError(t,u1.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,u1.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",e<t&&this.throwError("missing argument"+r,u1.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,u1.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||null==e)&&this.throwError("missing new",u1.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",u1.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||null==e)&&this.throwError("missing new",u1.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return uZ||(uZ=new u1("logger/5.7.0")),uZ}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",u1.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),uW){if(!e)return;this.globalLogger().throwError("error censorship permanent",u1.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}uJ=!!e,uW=!!t}static setLogLevel(e){let t=uX[e.toLowerCase()];if(null==t){u1.globalLogger().warn("invalid log level - "+e);return}uY=t}static from(e){return new u1(e)}}u1.errors=f,u1.levels=u;let u2=new u1("bytes/5.7.0");function u6(e){return!!e.toHexString}function u3(e){return e.slice||(e.slice=function(){let t=Array.prototype.slice.call(arguments);return u3(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function u5(e){return"number"==typeof e&&e==e&&e%1==0}function u8(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;
142if("string"==typeof e||!u5(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){let r=e[t];if(!u5(r)||r<0||r>=256)return!1}return!0}function u4(e,t){if(t||(t={}),"number"==typeof e){u2.checkSafeUint53(e,"invalid arrayify value");let t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),u3(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),u6(e)&&(e=e.toHexString()),u9(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":u2.throwArgumentError("hex data is odd-length","value",e));let i=[];for(let e=0;e<r.length;e+=2)i.push(parseInt(r.substring(e,e+2),16));return u3(new Uint8Array(i))}return u8(e)?u3(new Uint8Array(e)):u2.throwArgumentError("invalid arrayify value","value",e)}function u9(e,t){return"string"==typeof e&&!!e.match(/^0x[0-9A-Fa-f]*$/)&&(!t||e.length===2+2*t)}let u7="0123456789abcdef";function fe(e,t){if(t||(t={}),"number"==typeof e){u2.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=u7[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),u6(e))return e.toHexString();if(u9(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":u2.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(u8(e)){let t="0x";for(let r=0;r<e.length;r++){let i=e[r];t+=u7[(240&i)>>4]+u7[15&i]}return t}return u2.throwArgumentError("invalid hexlify value","value",e)}function ft(e,t,r){return("string"!=typeof e?e=fe(e):(!u9(e)||e.length%2)&&u2.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r)?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function fr(e,t){for("string"!=typeof e?e=fe(e):u9(e)||u2.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&u2.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function fi(e){let t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(u9(e)&&!(e.length%2)||u8(e)){let r=u4(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=fe(r.slice(0,32)),t.s=fe(r.slice(32,64))):65===r.length?(t.r=fe(r.slice(0,32)),t.s=fe(r.slice(32,64)),t.v=r[64]):u2.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:u2.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=fe(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){let r=function(e,t){(e=u4(e)).length>t&&u2.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(t);return r.set(e,t-e.length),u3(r)}(u4(t._vs),32);t._vs=fe(r);let i=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=i:t.recoveryParam!==i&&u2.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;let n=fe(r);null==t.s?t.s=n:t.s!==n&&u2.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?u2.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{let r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&u2.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&u9(t.r)?t.r=fr(t.r,32):u2.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&u9(t.s)?t.s=fr(t.s,32):u2.throwArgumentError("signature missing or invalid s","signature",e);let r=u4(t.s);r[0]>=128&&u2.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);let i=fe(r);t._vs&&(u9(t._vs)||u2.throwArgumentError("signature invalid _vs","signature",e),t._vs=fr(t._vs,32)),null==t._vs?t._vs=i:t._vs!==i&&u2.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}var fn=r(720),fs=r.n(fn);function fo(e){return"0x"+fs().keccak_256(u4(e))}let fa=new u1("strings/5.7.0");function fu(e,t,r,i,n){if(e===h.BAD_PREFIX||e===h.UNEXPECTED_CONTINUE){let e=0;for(let i=t+1;i<r.length&&r[i]>>6==2;i++)e++;return e}return e===h.OVERRUN?r.length-t-1:0}function ff(e,t=c.current){t!=c.current&&(fa.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(63&i|128);else if((64512&i)==55296){t++;let n=e.charCodeAt(t);if(t>=e.length||(64512&n)!=56320)throw Error("invalid utf-8 string");let s=65536+((1023&i)<<10)+(1023&n);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(63&s|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return u4(r)}function fc(e){return"string"==typeof e&&(e=ff(e)),fo(function(e){let t=e.map(e=>
142u4(e)),r=new Uint8Array(t.reduce((e,t)=>e+t.length,0));return t.reduce((e,t)=>(r.set(t,e),e+t.length),0),u3(r)}([ff("\x19Ethereum Signed Message:\n"),ff(String(e.length)),e]))}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(c||(c={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(h||(h={})),Object.freeze({error:function(e,t,r,i,n){return fa.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:fu,replace:function(e,t,r,i,n){return e===h.OVERLONG?(i.push(n),0):(i.push(65533),fu(e,t,r,i,n))}});var fh=r(6526),fl=r.n(fh)().BN;let fd=new u1("bignumber/5.7.0"),fp={},fg=!1;class fm{constructor(e,t){e!==fp&&fd.throwError("cannot call constructor directly; use BigNumber.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return fy(fv(this).fromTwos(e))}toTwos(e){return fy(fv(this).toTwos(e))}abs(){return"-"===this._hex[0]?fm.from(this._hex.substring(1)):this}add(e){return fy(fv(this).add(fv(e)))}sub(e){return fy(fv(this).sub(fv(e)))}div(e){return fm.from(e).isZero()&&fw("division-by-zero","div"),fy(fv(this).div(fv(e)))}mul(e){return fy(fv(this).mul(fv(e)))}mod(e){let t=fv(e);return t.isNeg()&&fw("division-by-zero","mod"),fy(fv(this).umod(t))}pow(e){let t=fv(e);return t.isNeg()&&fw("negative-power","pow"),fy(fv(this).pow(t))}and(e){let t=fv(e);return(this.isNegative()||t.isNeg())&&fw("unbound-bitwise-result","and"),fy(fv(this).and(t))}or(e){let t=fv(e);return(this.isNegative()||t.isNeg())&&fw("unbound-bitwise-result","or"),fy(fv(this).or(t))}xor(e){let t=fv(e);return(this.isNegative()||t.isNeg())&&fw("unbound-bitwise-result","xor"),fy(fv(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&fw("negative-width","mask"),fy(fv(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&fw("negative-width","shl"),fy(fv(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&fw("negative-width","shr"),fy(fv(this).shrn(e))}eq(e){return fv(this).eq(fv(e))}lt(e){return fv(this).lt(fv(e))}lte(e){return fv(this).lte(fv(e))}gt(e){return fv(this).gt(fv(e))}gte(e){return fv(this).gte(fv(e))}isNegative(){return"-"===this._hex[0]}isZero(){return fv(this).isZero()}toNumber(){try{return fv(this).toNumber()}catch(e){fw("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return fd.throwError("this platform does not support BigInt",Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?fg||(fg=!0,fd.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?fd.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Logger.errors.UNEXPECTED_ARGUMENT,{}):fd.throwError("BigNumber.toString does not accept parameters",Logger.errors.UNEXPECTED_ARGUMENT,{})),fv(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof fm)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new fm(fp,fb(e)):e.match(/^-?[0-9]+$/)?new fm(fp,fb(new fl(e))):fd.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&fw("underflow","BigNumber.from",e),(e>=0x1fffffffffffff||e<=-0x1fffffffffffff)&&fw("overflow","BigNumber.from",e),fm.from(String(e));if("bigint"==typeof e)return fm.from(e.toString());if(isBytes(e))return fm.from(hexlify(e));if(e){if(e.toHexString){let t=e.toHexString();if("string"==typeof t)return fm.from(t)}else{let t=e._hex;if(null==t&&"BigNumber"===e.type&&(t=e.hex),"string"==typeof t&&(isHexString(t)||"-"===t[0]&&isHexString(t.substring(1))))return fm.from(t)}}return fd.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function fb(e){if("string"!=typeof e)return fb(e.toString(16));if("-"===e[0])return("-"===(e=e.substring(1))[0]&&fd.throwArgumentError("invalid hex","value",e),"0x00"===(e=fb(e)))?e:"-"+e;
142if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function fy(e){return fm.from(fb(e))}function fv(e){let t=fm.from(e).toHexString();return"-"===t[0]?new fl("-"+t.substring(3),16):new fl(t.substring(2),16)}function fw(e,t,r){let i={fault:e,operation:t};return null!=r&&(i.value=r),fd.throwError(e,Logger.errors.NUMERIC_FAULT,i)}let f_=new u1("address/5.7.0");function fE(e){u9(e,20)||f_.throwArgumentError("invalid address","address",e);let t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);let i=u4(fo(r));for(let e=0;e<40;e+=2)i[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&i[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}let fx={};for(let e=0;e<10;e++)fx[String(e)]=String(e);for(let e=0;e<26;e++)fx[String.fromCharCode(65+e)]=String(10+e);let fS=Math.floor(Math.log10?Math.log10(0x1fffffffffffff):Math.log(0x1fffffffffffff)/Math.LN10);var fM=r(1160),fI=r.n(fM),fA=r(7432),fR=r.n(fA);function fD(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(e,null==t?r.path:t)}},r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;var fO=fP;function fP(e,t){if(!e)throw Error(t||"Assertion failed")}fP.equal=function(e,t,r){if(e!=t)throw Error(r||"Assertion failed: "+e+" != "+t)};var fN=fD(function(e,t){function r(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",i=0;i<e.length;i++)t+=r(e[i].toString(16));return t}t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var i=0;i<e.length;i++)r[i]=0|e[i];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/ig,"")).length%2!=0&&(e="0"+e);for(var i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var i=0;i<e.length;i++){var n=e.charCodeAt(i),s=n>>8,o=255&n;s?r.push(s,o):r.push(o)}return r},t.zero2=r,t.toHex=i,t.encode=function(e,t){return"hex"===t?i(e):e}}),fT=fD(function(e,t){t.assert=fO,t.toArray=fN.toArray,t.zero2=fN.zero2,t.toHex=fN.toHex,t.encode=fN.encode,t.getNAF=function(e,t,r){var i=Array(Math.max(e.bitLength(),r)+1);i.fill(0);for(var n=1<<t+1,s=e.clone(),o=0;o<i.length;o++){var a,u=s.andln(n-1);s.isOdd()?(a=u>(n>>1)-1?(n>>1)-u:u,s.isubn(a)):a=0,i[o]=a,s.iushrn(1)}return i},t.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i=0,n=0;e.cmpn(-i)>0||t.cmpn(-n)>0;){var s,o,a,u=e.andln(3)+i&3,f=t.andln(3)+n&3;3===u&&(u=-1),3===f&&(f=-1),o=(1&u)==0?0:(3==(s=e.andln(7)+i&7)||5===s)&&2===f?-u:u,r[0].push(o),a=(1&f)==0?0:(3==(s=t.andln(7)+n&7)||5===s)&&2===u?-f:f,r[1].push(a),2*i===o+1&&(i=1-i),2*n===a+1&&(n=1-n),e.iushrn(1),t.iushrn(1)}return r},t.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new(fI())(e,"hex","le")}}),fk=fT.getNAF,fC=fT.getJSF,fL=fT.assert;function fU(e,t){this.type=e,this.p=new(fI())(t.p,16),this.red=t.prime?fI().red(t.prime):fI().mont(this.p),this.zero=new(fI())(0).toRed(this.red),this.one=new(fI())(1).toRed(this.red),this.two=new(fI())(2).toRed(this.red),this.n=t.n&&new(fI())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function fj(e,t){this.curve=e,this.type=t,this.precomputed=null}fU.prototype.point=function(){throw Error("Not implemented")},fU.prototype.validate=function(){throw Error("Not implemented")},fU.prototype._fixedNafMul=function(e,t){fL(e.precomputed);var r,i,n=e._getDoubles(),s=fk(t,1,this._bitLength),o=(1<<n.step+1)-(n.step%2==0?2:1);o/=3;var a=[];for(r=0;r<s.length;r+=n.step){i=0;for(var u=r+n.step-1;u>=r;u--)i=(i<<1)+s[u];a.push(i)}for(var f=this.jpoint(null,null,null),c=this.jpoint(null,null,null),h=o;h>0;h--){for(r=0;r<a.length;r++)(i=a[r])===h?c=c.mixedAdd(n.points[r]):i===-h&&(c=c.mixedAdd(n.points[r].neg()));f=f.add(c)}return f.toP()},fU.prototype._wnafMul=function(e,t){var r=4,i=e._getNAFPoints(r);r=i.wnd;for(var n=i.points,s=fk(t,r,this._bitLength),o=this.jpoint(null,null,null),a=s.length-1;a>=0;a--){for(var u=0;a>=0&&0===s[a];a--)u++;if(a>=0&&u++,o=o.dblp(u),a<0)break;var f=s[a];fL(0!==f),o="affine"===e.type?f>0?o.mixedAdd(n[f-1>>1]):o.mixedAdd(n[-f-1>>
1421].neg()):f>0?o.add(n[f-1>>1]):o.add(n[-f-1>>1].neg())}return"affine"===e.type?o.toP():o},fU.prototype._wnafMulAdd=function(e,t,r,i,n){var s,o,a,u=this._wnafT1,f=this._wnafT2,c=this._wnafT3,h=0;for(s=0;s<i;s++){var l=(a=t[s])._getNAFPoints(e);u[s]=l.wnd,f[s]=l.points}for(s=i-1;s>=1;s-=2){var d=s-1,p=s;if(1!==u[d]||1!==u[p]){c[d]=fk(r[d],u[d],this._bitLength),c[p]=fk(r[p],u[p],this._bitLength),h=Math.max(c[d].length,h),h=Math.max(c[p].length,h);continue}var g=[t[d],null,null,t[p]];0===t[d].y.cmp(t[p].y)?(g[1]=t[d].add(t[p]),g[2]=t[d].toJ().mixedAdd(t[p].neg())):0===t[d].y.cmp(t[p].y.redNeg())?(g[1]=t[d].toJ().mixedAdd(t[p]),g[2]=t[d].add(t[p].neg())):(g[1]=t[d].toJ().mixedAdd(t[p]),g[2]=t[d].toJ().mixedAdd(t[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],b=fC(r[d],r[p]);for(o=0,h=Math.max(b[0].length,h),c[d]=Array(h),c[p]=Array(h);o<h;o++){var y=0|b[0][o],v=0|b[1][o];c[d][o]=m[(y+1)*3+(v+1)],c[p][o]=0,f[d]=g}}var w=this.jpoint(null,null,null),_=this._wnafT4;for(s=h;s>=0;s--){for(var E=0;s>=0;){var x=!0;for(o=0;o<i;o++)_[o]=0|c[o][s],0!==_[o]&&(x=!1);if(!x)break;E++,s--}if(s>=0&&E++,w=w.dblp(E),s<0)break;for(o=0;o<i;o++){var S=_[o];0!==S&&(S>0?a=f[o][S-1>>1]:S<0&&(a=f[o][-S-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(s=0;s<i;s++)f[s]=null;return n?w:w.toP()},fU.BasePoint=fj,fj.prototype.eq=function(){throw Error("Not implemented")},fj.prototype.validate=function(){return this.curve.validate(this)},fU.prototype.decodePoint=function(e,t){e=fT.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?fL(e[e.length-1]%2==0):7===e[0]&&fL(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw Error("Unknown point format")},fj.prototype.encodeCompressed=function(e){return this.encode(e,!0)},fj.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},fj.prototype.encode=function(e,t){return fT.encode(this._encode(t),e)},fj.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},fj.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},fj.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<t;n+=e){for(var s=0;s<e;s++)i=i.dbl();r.push(i)}return{step:e,points:r}},fj.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)t[n]=t[n-1].add(i);return{wnd:e,points:t}},fj.prototype._getBeta=function(){return null},fj.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var fB=fD(function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}}),fq=fT.assert;function fz(e){fU.call(this,"short",e),this.a=new(fI())(e.a,16).toRed(this.red),this.b=new(fI())(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}function fF(e,t,r,i){fU.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new(fI())(t,16),this.y=new(fI())(r,16),i&&(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)}
142function f$(e,t,r,i){fU.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new(fI())(0)):(this.x=new(fI())(t,16),this.y=new(fI())(r,16),this.z=new(fI())(i,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}fB(fz,fU),fz.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){if(e.beta)t=new(fI())(e.beta,16).toRed(this.red);else{var t,r,i,n=this._getEndoRoots(this.p);t=(t=0>n[0].cmp(n[1])?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new(fI())(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))?r=s[0]:(r=s[1],fq(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return i=e.basis?e.basis.map(function(e){return{a:new(fI())(e.a,16),b:new(fI())(e.b,16)}}):this._getEndoBasis(r),{beta:t,lambda:r,basis:i}}},fz.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:fI().mont(e),r=new(fI())(2).toRed(t).redInvm(),i=r.redNeg(),n=new(fI())(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},fz.prototype._getEndoBasis=function(e){for(var t,r,i,n,s,o,a,u,f,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,l=this.n.clone(),d=new(fI())(1),p=new(fI())(0),g=new(fI())(0),m=new(fI())(1),b=0;0!==h.cmpn(0);){var y=l.div(h);u=l.sub(y.mul(h)),f=g.sub(y.mul(d));var v=m.sub(y.mul(p));if(!i&&0>u.cmp(c))t=a.neg(),r=d,i=u.neg(),n=f;else if(i&&2==++b)break;a=u,l=h,h=u,g=d,d=f,m=p,p=v}s=u.neg(),o=f;var w=i.sqr().add(n.sqr());return s.sqr().add(o.sqr()).cmp(w)>=0&&(s=t,o=r),i.negative&&(i=i.neg(),n=n.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:i,b:n},{a:s,b:o}]},fz.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),s=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),u=n.mul(r.b),f=s.mul(i.b);return{k1:e.sub(o).sub(a),k2:u.add(f).neg()}},fz.prototype.pointFromX=function(e,t){(e=new(fI())(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var n=i.fromRed().isOdd();return(t&&!n||!t&&n)&&(i=i.redNeg()),this.point(e,i)},fz.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},fz.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s<e.length;s++){var o=this._endoSplit(t[s]),a=e[s],u=a._getBeta();o.k1.negative&&(o.k1.ineg(),a=a.neg(!0)),o.k2.negative&&(o.k2.ineg(),u=u.neg(!0)),i[2*s]=a,i[2*s+1]=u,n[2*s]=o.k1,n[2*s+1]=o.k2}for(var f=this._wnafMulAdd(1,i,n,2*s,r),c=0;c<2*s;c++)i[c]=null,n[c]=null;return f},fB(fF,fU.BasePoint),fz.prototype.point=function(e,t,r){return new fF(this,e,t,r)},fz.prototype.pointFromJSON=function(e,t){return fF.fromJSON(this,e,t)},fF.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,i=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},fF.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]},fF.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var i=e.point(t[0],t[1],r);if(!t[2])return i;function n(t){return e.point(t[0],t[1],r)}var s=t[2];return i.precomputed={beta:null,doubles:s.doubles&&{step:s.doubles.step,points:[i].concat(s.doubles.points.map(n))},naf:s.naf&&{wnd:s.naf.wnd,points:[i].concat(s.naf.points.map(n))}},i},fF.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>
142":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},fF.prototype.isInfinity=function(){return this.inf},fF.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e)||0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},fF.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},fF.prototype.getX=function(){return this.x.fromRed()},fF.prototype.getY=function(){return this.y.fromRed()},fF.prototype.mul=function(e){return(e=new(fI())(e,16),this.isInfinity())?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},fF.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},fF.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},fF.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},fF.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},fF.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},fB(f$,fU.BasePoint),fz.prototype.jpoint=function(e,t,r){return new f$(this,e,t,r)},f$.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},f$.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f$.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),s=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),a=i.redSub(n),u=s.redSub(o);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=a.redSqr(),c=f.redMul(a),h=i.redMul(f),l=u.redSqr().redIAdd(c).redISub(h).redISub(h),d=u.redMul(h.redISub(l)).redISub(s.redMul(c)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(l,d,p)},f$.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,s=e.y.redMul(t).redMul(this.z),o=r.redSub(i),a=n.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=o.redSqr(),f=u.redMul(o),c=r.redMul(u),h=a.redSqr().redIAdd(f).redISub(c).redISub(c),l=a.redMul(c.redISub(h)).redISub(n.redMul(f)),d=this.z.redMul(o);return this.curve.jpoint(h,l,d)},f$.prototype.dblp=function(e){if(0===e||this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var t,r=this;for(t=0;t<e;t++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,s=this.x,o=this.y,a=this.z,u=a.redSqr().redSqr(),f=o.redAdd(o);for(t=0;t<e;t++){var c=s.redSqr(),h=f.redSqr(),l=h.redSqr(),d=c.redAdd(c).redIAdd(c).redIAdd(i.redMul(u)),p=s.redMul(h),g=d.redSqr().redISub(p.redAdd(p)),m=p.redISub(g),b=d.redMul(m);b=b.redIAdd(b).redISub(l);var y=f.redMul(a);t+1<e&&(u=u.redMul(l)),s=g,a=y,f=b}return this.curve.jpoint(s,f.redMul(n),a)},f$.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},f$.prototype._zeroDbl=function(){if(this.zOne){var e,t,r,i=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),o=this.x.redAdd(n).redSqr().redISub(i).redISub(s);o=o.redIAdd(o);var a=i.redAdd(i).redIAdd(i),u=a.redSqr().redISub(o).redISub(o),f=s.redIAdd(s);
vendor: 8,125 bytes, line 142
142f=(f=f.redIAdd(f)).redIAdd(f),e=u,t=a.redMul(o.redISub(u)).redISub(f),r=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),h=this.y.redSqr(),l=h.redSqr(),d=this.x.redAdd(h).redSqr().redISub(c).redISub(l);d=d.redIAdd(d);var p=c.redAdd(c).redIAdd(c),g=p.redSqr(),m=l.redIAdd(l);m=(m=m.redIAdd(m)).redIAdd(m),e=g.redISub(d).redISub(d),t=p.redMul(d.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},f$.prototype._threeDbl=function(){if(this.zOne){var e,t,r,i=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),o=this.x.redAdd(n).redSqr().redISub(i).redISub(s);o=o.redIAdd(o);var a=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),u=a.redSqr().redISub(o).redISub(o);e=u;var f=s.redIAdd(s);f=(f=f.redIAdd(f)).redIAdd(f),t=a.redMul(o.redISub(u)).redISub(f),r=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),h=this.y.redSqr(),l=this.x.redMul(h),d=this.x.redSub(c).redMul(this.x.redAdd(c));d=d.redAdd(d).redIAdd(d);var p=l.redIAdd(l),g=(p=p.redIAdd(p)).redAdd(p);e=d.redSqr().redISub(g),r=this.y.redAdd(this.z).redSqr().redISub(h).redISub(c);var m=h.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=d.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},f$.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),s=t.redSqr(),o=r.redSqr(),a=s.redAdd(s).redIAdd(s).redIAdd(e.redMul(n)),u=t.redAdd(t),f=(u=u.redIAdd(u)).redMul(o),c=a.redSqr().redISub(f.redAdd(f)),h=f.redISub(c),l=o.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=a.redMul(h).redISub(l),p=r.redAdd(r).redMul(i);return this.curve.jpoint(c,d,p)},f$.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),i=t.redSqr(),n=e.redAdd(e).redIAdd(e),s=n.redSqr(),o=this.x.redAdd(t).redSqr().redISub(e).redISub(i),a=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(s)).redSqr(),u=i.redIAdd(i);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var f=n.redIAdd(o).redSqr().redISub(s).redISub(a).redISub(u),c=t.redMul(f);c=(c=c.redIAdd(c)).redIAdd(c);var h=this.x.redMul(a).redISub(c);h=(h=h.redIAdd(h)).redIAdd(h);var l=this.y.redMul(f.redMul(u.redISub(f)).redISub(o.redMul(a)));l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=this.z.redAdd(o).redSqr().redISub(r).redISub(a);return this.curve.jpoint(h,l,d)},f$.prototype.mul=function(e,t){return e=new(fI())(e,t),this.curve._wnafMul(this,e)},f$.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var i=t.redMul(this.z),n=r.redMul(e.z);return 0===this.y.redMul(n).redISub(e.y.redMul(i)).cmpn(0)},f$.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},f$.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)+">"},f$.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var fH=fD(function(e,t){t.base=fU,t.short=fz,t.mont=null,t.edwards=null}),fK=fD(function(e,t){var r,i=fT.assert;function n(e){"short"===e.type?this.curve=new fH.short(e):"edwards"===e.type?this.curve=new fH.edwards(e):this.curve=new fH.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){var i=new n(r);return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:i}),i}})}t.PresetCurve=n,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:fR().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:fR().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:fR().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:fR().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:fR().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:fR().sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:fR().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:fR().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
142,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})});function fV(e){if(!(this instanceof fV))return new fV(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=fN.toArray(e.entropy,e.entropyEnc||"hex"),r=fN.toArray(e.nonce,e.nonceEnc||"hex"),i=fN.toArray(e.pers,e.persEnc||"hex");fO(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}fV.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=0x1000000000000},fV.prototype._hmac=function(){return new(fR()).hmac(this.hash,this.K)},fV.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},fV.prototype.reseed=function(e,t,r,i){"string"!=typeof t&&(i=r,r=t,t=null),e=fN.toArray(e,t),r=fN.toArray(r,i),fO(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},fV.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=fN.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length<e;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var s=n.slice(0,e);return this._update(r),this._reseed++,fN.encode(s,t)};var fG=fT.assert;function fW(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}fW.fromPublic=function(e,t,r){return t instanceof fW?t:new fW(e,{pub:t,pubEnc:r})},fW.fromPrivate=function(e,t,r){return t instanceof fW?t:new fW(e,{priv:t,privEnc:r})},fW.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.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"}},fW.prototype.getPublic=function(e,t){return("string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t)?this.pub.encode(t,e):this.pub},fW.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},fW.prototype._importPrivate=function(e,t){this.priv=new(fI())(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},fW.prototype._importPublic=function(e,t){if(e.x||e.y){"mont"===this.ec.curve.type?fG(e.x,"Need x coordinate"):("short"===this.ec.curve.type||"edwards"===this.ec.curve.type)&&fG(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)},fW.prototype.derive=function(e){return e.validate()||fG(e.validate(),"public point not validated"),e.mul(this.priv).getX()},fW.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},fW.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},fW.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var fJ=fT.assert;function fX(e,t){if(e instanceof fX)return e;this._importDER(e,t)||(fJ(e.r&&e.s,"Signature without r or s"),this.r=new(fI())(e.r,16),this.s=new(fI())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function fY(){this.place=0}function fZ(e,t){var r=e[t.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,s=0,o=t.place;s<i;s++,o++)n<<=8,n|=e[o],n>>>=0;return!(n<=127)&&(t.place=o,n)}function fQ(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function f0(e,t){if(t<128){e.push(t);return}var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}fX.prototype._importDER=function(e,t){e=fT.toArray(e,t);var r=new fY;if(48!==e[r.place++])return!1;var i=fZ(e,r);if(!1===i||i+r.place!==e.length||2!==e[r.place++])return!1;var n=fZ(e,r);if(!1===n)return!1;var s=e.slice(r.place,n+r.place);if(r.place+=n,2!==e[r.place++])return!1;var o=fZ(e,r);if(!1===o||e.length!==o+r.place)return!1;var a=e.slice(r.place,o+r.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}
142if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new(fI())(s),this.s=new(fI())(a),this.recoveryParam=null,!0},fX.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=fQ(t),r=fQ(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var i=[2];f0(i,t.length),(i=i.concat(t)).push(2),f0(i,r.length);var n=i.concat(r),s=[48];return f0(s,n.length),s=s.concat(n),fT.encode(s,e)};var f1=function(){throw Error("unsupported")},f2=fT.assert;function f6(e){if(!(this instanceof f6))return new f6(e);"string"==typeof e&&(f2(Object.prototype.hasOwnProperty.call(fK,e),"Unknown curve "+e),e=fK[e]),e instanceof fK.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}f6.prototype.keyPair=function(e){return new fW(this,e)},f6.prototype.keyFromPrivate=function(e,t){return fW.fromPrivate(this,e,t)},f6.prototype.keyFromPublic=function(e,t){return fW.fromPublic(this,e,t)},f6.prototype.genKeyPair=function(e){e||(e={});for(var t=new fV({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||f1(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new(fI())(2));;){var n=new(fI())(t.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},f6.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return(r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0)?e.sub(this.n):e},f6.prototype.sign=function(e,t,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new(fI())(e,16));for(var n=this.n.byteLength(),s=t.getPrivate().toArray("be",n),o=e.toArray("be",n),a=new fV({hash:this.hash,entropy:s,nonce:o,pers:i.pers,persEnc:i.persEnc||"utf8"}),u=this.n.sub(new(fI())(1)),f=0;;f++){var c=i.k?i.k(f):new(fI())(a.generate(this.n.byteLength()));if(!(0>=(c=this._truncateToN(c,!0)).cmpn(1)||c.cmp(u)>=0)){var h=this.g.mul(c);if(!h.isInfinity()){var l=h.getX(),d=l.umod(this.n);if(0!==d.cmpn(0)){var p=c.invm(this.n).mul(d.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var g=(h.getY().isOdd()?1:0)|(0!==l.cmp(d)?2:0);return i.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),g^=1),new fX({r:d,s:p,recoveryParam:g})}}}}}},f6.prototype.verify=function(e,t,r,i){e=this._truncateToN(new(fI())(e,16)),r=this.keyFromPublic(r,i);var n,s=(t=new fX(t,"hex")).r,o=t.s;if(0>s.cmpn(1)||s.cmp(this.n)>=0||0>o.cmpn(1)||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),u=a.mul(e).umod(this.n),f=a.mul(s).umod(this.n);return this.curve._maxwellTrick?!(n=this.g.jmulAdd(u,r.getPublic(),f)).isInfinity()&&n.eqXToP(s):!(n=this.g.mulAdd(u,r.getPublic(),f)).isInfinity()&&0===n.getX().umod(this.n).cmp(s)},f6.prototype.recoverPubKey=function(e,t,r,i){f2((3&r)===r,"The recovery param is more than two bits"),t=new fX(t,i);var n=this.n,s=new(fI())(e),o=t.r,a=t.s,u=1&r,f=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw Error("Unable to find sencond key candinate");o=f?this.curve.pointFromX(o.add(this.curve.n),u):this.curve.pointFromX(o,u);var c=t.r.invm(n),h=n.sub(s).mul(c).umod(n),l=a.mul(c).umod(n);return this.g.mulAdd(h,o,l)},f6.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new fX(t,i)).recoveryParam)return t.recoveryParam;for(var n,s=0;s<4;s++){try{n=this.recoverPubKey(e,t,s)}catch(e){continue}if(n.eq(r))return s}throw Error("Unable to find valid recovery factor")};var f3=fD(function(e,t){t.version="6.5.4",t.utils=fT,t.rand=function(){throw Error("unsupported")},t.curve=fH,t.curves=fK,t.ec=f6,t.eddsa=null}).ec;function f5(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}new u1("properties/5.7.0");let f8=new u1("signing-key/5.7.0"),f4=null;function f9(){return f4||(f4=new f3("secp256k1")),f4}class f7{constructor(e){f5(this,"curve","secp256k1"),f5(this,"privateKey",fe(e)),32!==function(e){if("string"!=typeof e)e=fe(e);else if(!u9(e)||e.length%2)return null;return(e.length-2)/2}(this.privateKey)&&f8.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=f9().keyFromPrivate(u4(this.privateKey));f5(this,"publicKey","0x"+t.getPublic(!1,"hex")),f5(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),f5(this,"_isSigningKey",!0)}_addPoint(e){let t=f9().keyFromPublic(u4(this.publicKey)),r=f9().keyFromPublic(u4(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}
142signDigest(e){let t=f9().keyFromPrivate(u4(this.privateKey)),r=u4(e);32!==r.length&&f8.throwArgumentError("bad digest length","digest",e);let i=t.sign(r,{canonical:!0});return fi({recoveryParam:i.recoveryParam,r:fr("0x"+i.r.toString(16),32),s:fr("0x"+i.s.toString(16),32)})}computeSharedSecret(e){let t=f9().keyFromPrivate(u4(this.privateKey)),r=f9().keyFromPublic(u4(ce(e)));return fr("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function ce(e,t){let r=u4(e);if(32===r.length){let e=new f7(r);return t?"0x"+f9().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?fe(r):"0x"+f9().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+f9().keyFromPublic(r).getPublic(!0,"hex"):fe(r):f8.throwArgumentError("invalid public or private key","key","[REDACTED]")}let ct=new u1("transactions/5.7.0");!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(l||(l={}));function cr(e,t){return{address:getAddress(e),storageKeys:(t||[]).map((t,r)=>(32!==hexDataLength(t)&&ct.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase()))}}var ci=r(7904),cn=r(2084),cs=r(1360),co=r(8502);function ca(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function cu(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));let r=ca(t),i=0;for(let t of e)r.set(t,i),i+=t.length;return r}
142function cf(e,t,r,i){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:i}}}let cc=cf("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),ch=cf("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=ca((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),cl={utf8:cc,"utf-8":cc,hex:uE.base16,latin1:ch,ascii:ch,binary:ch,...uE};function cd(e,t="utf8"){let r=cl[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e,"utf8"):r.decoder.decode(`${r.prefix}${e}`)}function cp(e,t="utf8"){let r=cl[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}var cg=r(1423);let cm={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var cb=r(2818),cy=r(5927).Buffer;function cv(e){let[t,r]=e.split(":");return{namespace:t,reference:r}}function cw(e,t){return e.includes(":")?[e]:t.chains||[]}var c_=Object.defineProperty,cE=Object.getOwnPropertySymbols,cx=Object.prototype.hasOwnProperty,cS=Object.prototype.propertyIsEnumerable,cM=(e,t,r)=>t in e?c_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,cI=(e,t)=>{for(var r in t||(t={}))cx.call(t,r)&&cM(e,r,t[r]);if(cE)for(var r of cE(t))cS.call(t,r)&&cM(e,r,t[r]);return e};let cA={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"};function cR(){return"u">typeof cb&&"u">typeof cb.versions&&"u">typeof cb.versions.node}function cD(){return!(0,uK.getDocument)()&&!!(0,uK.getNavigator)()&&"ReactNative"===navigator.product}function cO(){return!cR()&&!!(0,uK.getNavigator)()&&!!(0,uK.getDocument)()}function cP(){return cD()?cA.reactNative:cR()?cA.node:cO()?cA.browser:cA.unknown}function cN(){return(0,uV.g)()||{name:"",description:"",url:"",icons:[""]}}function cT(e,t,i){let n=function(){if(cP()===cA.reactNative&&"u">typeof r.g&&"u">typeof(null==r.g?void 0:r.g.Platform)){let{OS:e,Version:t}=r.g.Platform;return[e,t].join("-")}let e="undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new uz:"undefined"!=typeof navigator?function(e){var t=""!==e&&u$.reduce(function(t,r){var i=r[0],n=r[1];if(t)return t;var s=n.exec(e);return!!s&&[i,s]},!1);if(!t)return null;var r=t[0],i=t[1];if("searchbot"===r)return new uq;var n=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);n?n.length<3&&(n=uL(uL([],n,!0),function(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}(3-n.length),!0)):n=[];var s=n.join("."),o=function(e){for(var t=0,r=uH.length;t<r;t++){var i=uH[t],n=i[0];if(i[1].exec(e))return n}return null}(e),a=uF.exec(e);return a&&a[1]?new uB(r,s,o,a[1]):new uU(r,s,o)}(navigator.userAgent):void 0!==uC&&uC.version?new uj(uC.version.slice(1)):null;if(null===e)return"unknown";let t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return"browser"===e.type?[t,e.name,e.version].join("-"):[t,e.version].join("-")}(),s=function(){var e;let t=cP();return t===cA.browser?[t,(null==(e=(0,uK.getLocation)())?void 0:e.host)||"unknown"].join(":"):t}();return[[e,t].join("-"),["js",i].join("-"),n,s].join("/")}function ck(e,t){return e.filter(e=>t.includes(e)).length===e.length}function cC(e){return Object.fromEntries(e.entries())}function cL(e){return new Map(Object.entries(e))}function cU(e=s2.FIVE_MINUTES,t){let r,i,n;let s=(0,s2.toMiliseconds)(e||s2.FIVE_MINUTES);return{resolve:e=>{n&&r&&(clearTimeout(n),r(e))},reject:e=>{n&&i&&(clearTimeout(n),i(e))},done:()=>new Promise((e,o)=>{n=setTimeout(()=>{o(Error(t))},s),r=e,i=o})}}function cj(e,t,r){return new Promise(async(i,n)=>{let s=setTimeout(()=>n(Error(r)),t);try{let t=await e;i(t)}catch(e){n(e)}clearTimeout(s)})}function cB(e,t){if("string"==typeof t&&t.startsWith(`${e}:`))return t;if("topic"===e.toLowerCase()){if("string"!=typeof t)throw Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}if("id"===e.toLowerCase()){if("number"!=typeof t)throw Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw Error(`Unknown expirer target type: ${e}`)}function cq(e){let[t,r]=e.split(":"),i={id:void 0,topic:void 0};if("topic"===t&&"string"==typeof r)i.topic=r;else if("id"===t&&Number.isInteger(Number(r)))i.id=Number(r);else throw Error(`Invalid target, expected id:number or topic:string, got ${t}:${r}`);return i}function cz(e,t){return(0,s2.fromMiliseconds)((t||Date.now())+(0,s2.toMiliseconds)(e))}function cF(e){return Date.now()>=(0,s2.toMiliseconds)(e)}function c$(e,t){return`${e}${t?`:${t}`:""}`}async function cH({id:e,topic:t,wcDeepLink:i}){var n;try{if(!i)return;let s="string"==typeof i?JSON.parse(i):i,o=s?.href;if("string"!=typeof o)return;let a=function(e,t,r){let i=`requestId=${t}&sessionTopic=${r}`;e.endsWith("/")&&(e=e.slice(0,-1));let n=`${e}`;if(e.startsWith("https://t.me")){let t=e.includes("?")?"&startapp=":"?startapp=";n=`${n}${t}${function(e,t=!1){let r=cy.from(e).toString("base64");return t?r.replace(/[=]/g,""):r}(i,!0)}`}else n=`${n}/wc?${i}`;return n}(o,e,t),u=cP();if(u===cA.browser){if(!(null!=(n=(0,uK.getDocument)())&&n.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}a.startsWith("https://")||a.startsWith("http://")?window.open(a,"_blank","noreferrer noopener"):window.open(a,"u">typeof window&&(window.TelegramWebviewProxy||window.Telegram||window.TelegramWebviewProxyProto)?"_blank":"_self","noreferrer noopener")}else u===cA.reactNative&&"u">typeof(null==r.g?void 0:r.g.Linking)&&await r.g.Linking.openURL(a)}catch(e){console.error(e)}}async function cK(e,t){let r="";
142try{if(cO()&&(r=localStorage.getItem(t)))return r;r=await e.getItem(t)}catch(e){console.error(e)}return r}function cV(e,t){if(!e.includes(t))return null;let r=e.split(/([&,?,=])/),i=r.indexOf(t);return r[i+2]}function cG(){return"u">typeof crypto&&null!=crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function cW(){return"u">typeof cb&&"true"===cb.env.IS_VITEST}function cJ(e){return cy.from(e,"base64").toString("utf-8")}async function cX(e,t,r,i,n,s){switch(r.t){case"eip191":var o,a,u;return o=r.s,(a=fc(t),u=o,function(e){let t=null;if("string"!=typeof e&&f_.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=fE(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&f_.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==function(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map(e=>fx[e]).join("");for(;t.length>=fS;){let e=t.substring(0,fS);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}(e)&&f_.throwArgumentError("bad icap checksum","address",e),t=new fl(e.substring(4),36).toString(16);t.length<40;)t="0"+t;t=fE("0x"+t)}else f_.throwArgumentError("invalid address","address",e);return t}(ft(fo(ft(ce(function(e,t){let r=fi(t),i={r:u4(r.r),s:u4(r.s)};return"0x"+f9().recoverPubKey(u4(e),i,r.recoveryParam).encode("hex",!1)}(u4(a),u)),1)),12))).toLowerCase()===e.toLowerCase();case"eip1271":return await cY(e,t,r.s,i,n,s);default:throw Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}async function cY(e,t,r,i,n,s){let o=cv(i);if(!o.namespace||!o.reference)throw Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${i}`);try{let o="0x1626ba7e",a=r.substring(2),u=fc(t).substring(2),f=o+u+"00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000041"+a,c=await fetch(`${s||"https://rpc.walletconnect.org/v1"}/?chainId=${i}&projectId=${n}`,{method:"POST",body:JSON.stringify({id:Date.now()+Math.floor(1e3*Math.random()),jsonrpc:"2.0",method:"eth_call",params:[{to:e,data:f},"latest"]})}),{result:h}=await c.json();return!!h&&h.slice(0,o.length).toLowerCase()===o.toLowerCase()}catch(e){return console.error("isValidEip1271Signature: ",e),!1}}var cZ=Object.defineProperty,cQ=Object.defineProperties,c0=Object.getOwnPropertyDescriptors,c1=Object.getOwnPropertySymbols,c2=Object.prototype.hasOwnProperty,c6=Object.prototype.propertyIsEnumerable,c3=(e,t,r)=>t in e?cZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,c5=(e,t)=>{for(var r in t||(t={}))c2.call(t,r)&&c3(e,r,t[r]);if(c1)for(var r of c1(t))c6.call(t,r)&&c3(e,r,t[r]);return e},c8=(e,t)=>cQ(e,c0(t));let c4=e=>e?.split(":"),c9=e=>{let t=e&&c4(e);if(t)return e.includes("did:pkh:")?t[3]:t[1]},c7=e=>{let t=e&&c4(e);if(t)return t[2]+":"+t[3]},he=e=>{let t=e&&c4(e);if(t)return t.pop()};async function ht(e){let{cacao:t,projectId:r}=e,{s:i,p:n}=t,s=hr(n,n.iss),o=he(n.iss);return await cX(o,s,i,c7(n.iss),r)}let hr=(e,t)=>{let r=`${e.domain} wants you to sign in with your Ethereum account:`,i=he(t);if(!e.aud&&!e.uri)throw Error("Either `aud` or `uri` is required to construct the message");let n=e.statement||void 0,s=`URI: ${e.aud||e.uri}`,o=`Version: ${e.version}`,a=`Chain ID: ${c9(t)}`,u=`Nonce: ${e.nonce}`,f=`Issued At: ${e.iat}`,c=e.exp?`Expiration Time: ${e.exp}`:void 0,h=e.nbf?`Not Before: ${e.nbf}`:void 0,l=e.requestId?`Request ID: ${e.requestId}`:void 0,d=e.resources?`Resources:${e.resources.map(e=>`
143- ${e}`).join("")}`:void 0,p=hu(e.resources);return p&&(n=function(e="",t){hi(t);let r="I further authorize the stated URI to perform the following actions on my behalf: ";if(e.includes(r))return e;let i=[],n=0;Object.keys(t.att).forEach(e=>{let r=Object.keys(t.att[e]).map(e=>({ability:e.split("/")[0],action:e.split("/")[1]}));r.sort((e,t)=>
143e.action.localeCompare(t.action));let s={};r.forEach(e=>{s[e.ability]||(s[e.ability]=[]),s[e.ability].push(e.action)});let o=Object.keys(s).map(t=>(n++,`(${n}) '${t}': '${s[t].join("', '")}' for '${e}'.`));i.push(o.join(", ").replace(".,","."))});let s=i.join(" "),o=`${r}${s}`;return`${e?e+" ":""}${o}`}(n,hs(p))),[r,i,"",n,"",s,o,a,u,f,c,h,l,d].filter(e=>null!=e).join(`
144`)};function hi(e){if(!e)throw Error("No recap provided, value is undefined");if(!e.att)throw Error("No `att` property found");let t=Object.keys(e.att);if(!(null!=t&&t.length))throw Error("No resources found in `att` property");t.forEach(t=>{let r=e.att[t];if(Array.isArray(r)||"object"!=typeof r)throw Error(`Resource must be an object: ${t}`);if(!Object.keys(r).length)throw Error(`Resource object is empty: ${t}`);Object.keys(r).forEach(e=>{let t=r[e];if(!Array.isArray(t))throw Error(`Ability limits ${e} must be an array of objects, found: ${t}`);if(!t.length)throw Error(`Value of ${e} is empty array, must be an array with objects`);t.forEach(t=>{if("object"!=typeof t)throw Error(`Ability limits (${e}) must be an array of objects, found: ${t}`)})})})}function hn(e){return hi(e),`urn:recap:${cy.from(JSON.stringify(e)).toString("base64").replace(/=/g,"")}`}function hs(e){var t;let r=(t=e.replace("urn:recap:",""),JSON.parse(cy.from(t,"base64").toString("utf-8")));return hi(r),r}function ho(e){var t;let r=hs(e);hi(r);let i=null==(t=r.att)?void 0:t.eip155;return i?Object.keys(i).map(e=>e.split("/")[1]):[]}function ha(e){let t=hs(e);hi(t);let r=[];return Object.values(t.att).forEach(e=>{Object.values(e).forEach(e=>{var t;null!=(t=e?.[0])&&t.chains&&r.push(e[0].chains)})}),[...new Set(r.flat())]}function hu(e){if(!e)return;let t=e?.[e.length-1];return t&&t.includes("urn:recap:")?t:void 0}let hf="base10",hc="base16",hh="base64pad",hl="base64url",hd="utf8";function hp(){return cp((0,at.randomBytes)(32),hc)}function hg(e){return cp((0,cs.tW)(cd(e,hc)),hc)}function hm(e){return cp((0,cs.tW)(cd(e,hd)),hc)}function hb(e){return Number(cp(e,hf))}function hy(e){let{encoding:t=hh}=e;if(2===hb(e.type))return cp(cu([e.type,e.sealed]),t);if(1===hb(e.type)){if(typeof e.senderPublicKey>"u")throw Error("Missing sender public key for type 1 envelope");return cp(cu([e.type,e.senderPublicKey,e.iv,e.sealed]),t)}return cp(cu([e.type,e.iv,e.sealed]),t)}function hv(e){let{encoded:t,encoding:r=hh}=e,i=cd(t,r),n=i.slice(0,1);if(1===hb(n)){let e=i.slice(1,33),t=i.slice(33,45);return{type:n,sealed:i.slice(45),iv:t,senderPublicKey:e}}if(2===hb(n))return{type:n,sealed:i.slice(1),iv:(0,at.randomBytes)(12)};let s=i.slice(1,13);return{type:n,sealed:i.slice(13),iv:s}}function hw(e){let t=e?.type||0;if(1===t){if(typeof e?.senderPublicKey>"u")throw Error("missing sender public key");if(typeof e?.receiverPublicKey>"u")throw Error("missing receiver public key")}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}function h_(e){return 1===e.type&&"string"==typeof e.senderPublicKey&&"string"==typeof e.receiverPublicKey}function hE(e){return e?.relay||{protocol:"irn"}}function hx(e){let t=cm[e];if(typeof t>"u")throw Error(`Relay Protocol not supported: ${e}`);return t}var hS=Object.defineProperty,hM=Object.defineProperties,hI=Object.getOwnPropertyDescriptors,hA=Object.getOwnPropertySymbols,hR=Object.prototype.hasOwnProperty,hD=Object.prototype.propertyIsEnumerable,hO=(e,t,r)=>t in e?hS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hP=(e,t)=>{for(var r in t||(t={}))hR.call(t,r)&&hO(e,r,t[r]);if(hA)for(var r of hA(t))hD.call(t,r)&&hO(e,r,t[r]);return e},hN=(e,t)=>hM(e,hI(t));function hT(e){var t;if(!e.includes("wc:")){let t=cJ(e);null!=t&&t.includes("wc:")&&(e=t)}let r=(e=(e=e.includes("wc://")?e.replace("wc://",""):e).includes("wc:")?e.replace("wc:",""):e).indexOf(":"),i=-1!==e.indexOf("?")?e.indexOf("?"):void 0,n=e.substring(0,r),s=e.substring(r+1,i).split("@"),o="u">typeof i?e.substring(i):"",a=uG.parse(o),u="string"==typeof a.methods?a.methods.split(","):void 0;return{protocol:n,topic:(t=s[0]).startsWith("//")?t.substring(2):t,version:parseInt(s[1],10),symKey:a.symKey,relay:function(e,t="-"){let r={},i="relay"+t;return Object.keys(e).forEach(t=>{if(t.startsWith(i)){let n=t.replace(i,""),s=e[t];r[n]=s}}),r}(a),methods:u,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function hk(e){return`${e.protocol}
144:${e.topic}@${e.version}?`+uG.stringify(hP(hN(hP({symKey:e.symKey},function(e,t="-"){let r={};return Object.keys(e).forEach(i=>{e[i]&&(r["relay"+t+i]=e[i])}),r}(e.relay)),{expiryTimestamp:e.expiryTimestamp}),e.methods?{methods:e.methods.join(",")}:{}))}function hC(e,t,r){return`${e}?wc_ev=${r}&topic=${t}`}var hL=Object.defineProperty,hU=Object.defineProperties,hj=Object.getOwnPropertyDescriptors,hB=Object.getOwnPropertySymbols,hq=Object.prototype.hasOwnProperty,hz=Object.prototype.propertyIsEnumerable,hF=(e,t,r)=>t in e?hL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;function h$(e){let t=[];return e.forEach(e=>{let[r,i]=e.split(":");t.push(`${r}:${i}`)}),t}function hH(e,t){let r=function(e){let t={};return e?.forEach(e=>{let[r,i]=e.split(":");t[r]||(t[r]={accounts:[],chains:[],events:[]}),t[r].accounts.push(e),t[r].chains.push(`${r}:${i}`)}),t}(t=t.map(e=>e.replace("did:pkh:","")));for(let[t,i]of Object.entries(r))i.methods?i.methods=function(e=[],t=[]){return[...new Set([...e,...t])]}(i.methods,e):i.methods=e,i.events=["chainChanged","accountsChanged"];return r}let hK={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},hV={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function hG(e,t){let{message:r,code:i}=hV[e];return{message:t?`${r} ${t}`:r,code:i}}function hW(e,t){let{message:r,code:i}=hK[e];return{message:t?`${r} ${t}`:r,code:i}}function hJ(e,t){return!!Array.isArray(e)&&(!("u">typeof t)||!e.length||e.every(t))}function hX(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function hY(e){return typeof e>"u"}function hZ(e,t){return!!(t&&hY(e))||"string"==typeof e&&!!e.trim().length}function hQ(e,t){return!!(t&&hY(e))||"number"==typeof e&&!isNaN(e)}function h0(e){return!!(hZ(e,!1)&&e.includes(":"))&&2===e.split(":").length}function h1(e){let t=!0;return hJ(e)?e.length&&(t=e.every(e=>hZ(e,!1))):t=!1,t}function h2(e,t){let r=null;return Object.values(e).forEach(e=>{var i;let n;if(r)return;let s=(i=`${t}, namespace`,n=null,h1(e?.methods)?h1(e?.events)||(n=hW("UNSUPPORTED_EVENTS",`${i}, events should be an array of strings or empty array for no events`)):n=hW("UNSUPPORTED_METHODS",`${i}, methods should be an array of strings or empty array for no methods`),n);s&&(r=s)}),r}function h6(e,t){let r=null;if(e&&hX(e)){let i;let n=h2(e,t);n&&(r=n);
144let s=(i=null,Object.values(e).forEach(e=>{var r,n;let s;if(i)return;let o=(r=e?.accounts,n=`${t} namespace`,s=null,hJ(r)?r.forEach(e=>{s||function(e){if(hZ(e,!1)&&e.includes(":")){let t=e.split(":");if(3===t.length){let e=t[0]+":"+t[1];return!!t[2]&&h0(e)}}return!1}(e)||(s=hW("UNSUPPORTED_ACCOUNTS",`${n}, account ${e} should be a string and conform to "namespace:chainId:address" format`))}):s=hW("UNSUPPORTED_ACCOUNTS",`${n}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),s);o&&(i=o)}),i);s&&(r=s)}else r=hG("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return r}function h3(e){return hZ(e.protocol,!0)}function h5(e){return"u">typeof e}function h8(e,t){return!(!h0(t)||!(function(e){let t=[];return Object.values(e).forEach(e=>{t.push(...h$(e.accounts))}),t})(e).includes(t))}function h4(e,t,r){let i=null,n=function(e){let t={};return Object.keys(e).forEach(r=>{var i;r.includes(":")?t[r]=e[r]:null==(i=e[r].chains)||i.forEach(i=>{t[i]={methods:e[r].methods,events:e[r].events}})}),t}(e),s=function(e){let t={};return Object.keys(e).forEach(r=>{if(r.includes(":"))t[r]=e[r];else{let i=h$(e[r].accounts);i?.forEach(i=>{t[i]={accounts:e[r].accounts.filter(e=>e.includes(`${i}:`)),methods:e[r].methods,events:e[r].events}})}}),t}(t),o=Object.keys(n),a=Object.keys(s),u=h9(Object.keys(e)),f=h9(Object.keys(t)),c=u.filter(e=>!f.includes(e));return c.length&&(i=hG("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
145      Required: ${c.toString()}
146      Received: ${Object.keys(t).toString()}`)),ck(o,a)||(i=hG("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
147      Required: ${o.toString()}
148      Approved: ${a.toString()}`)),Object.keys(t).forEach(e=>{if(!e.includes(":")||i)return;let n=h$(t[e].accounts);n.includes(e)||(i=hG("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${e}
149        Required: ${e}
150        Approved: ${n.toString()}`))}),o.forEach(e=>{i||(ck(n[e].methods,s[e].methods)?ck(n[e].events,s[e].events)||(i=hG("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${e}`)):i=hG("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${e}`))}),i}function h9(e){return[...new Set(e.map(e=>e.includes(":")?e.split(":")[0]:e))]}function h7(){let e=cP();return new Promise(t=>{switch(e){case cA.browser:t(cO()&&navigator?.onLine);break;case cA.reactNative:t(le());break;case cA.node:default:t(!0)}})}async function le(){if(cD()&&"u">typeof r.g&&null!=r.g&&r.g.NetInfo){let e=await (null==r.g?void 0:r.g.NetInfo.fetch());return e?.isConnected}return!0}let lt={};class lr{static get(e){return lt[e]}static set(e,t){lt[e]=t}static delete(e){delete lt[e]}}let li="INTERNAL_ERROR",ln="SERVER_ERROR",ls=[-32700,-32600,-32601,-32602,-32603],lo={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[li]:{code:-32603,message:"Internal error"},[ln]:{code:-32e3,message:"Server error"}};function la(e){return Object.keys(lo).includes(e)?lo[e]:lo[ln]}var lu=r(4144);
150function lf(e=3){return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function lc(e=6){return BigInt(lf(e))}function lh(e,t,r){return{id:r||lf(),jsonrpc:"2.0",method:e,params:t}}function ll(e,t){return{id:e,jsonrpc:"2.0",result:t}}function ld(e,t,r){var i,n,s;return{id:e,jsonrpc:"2.0",error:void 0===(i=t)?la(li):("string"==typeof i&&(i=Object.assign(Object.assign({},la(ln)),{message:i})),void 0!==r&&(i.data=r),n=i.code,ls.includes(n)&&(s=i.code,i=Object.values(lo).find(e=>e.code===s)||lo[ln]),i)}}class lp{}class lg extends lp{constructor(){super()}}class lm extends lg{constructor(e){super()}}function lb(e){return function(e,t){let r=function(e){let t=e.match(RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return void 0!==r&&new RegExp(t).test(r)}(e,"^wss?:")}function ly(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function lv(e){return ly(e)&&"method"in e}function lw(e){return ly(e)&&(l_(e)||lE(e))}function l_(e){return"result"in e}function lE(e){return"error"in e}class lx extends lm{constructor(e){super(e),this.events=new eY.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(lh(e.method,e.params||[],e.id||lc().toString()),t)}async requestStrict(e,t){return new Promise(async(r,i)=>{if(!this.connection.connected)try{await this.open()}catch(e){i(e)}this.events.on(`${e.id}`,e=>{lE(e)?i(e.error):r(e.result)});try{await this.connection.send(e,t)}catch(e){i(e)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),lw(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&this.events.emit("error",Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof e&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}let lS=()=>"u">typeof WebSocket||"u">typeof r.g&&"u">typeof r.g.WebSocket||"u">typeof window&&"u">typeof window.WebSocket||"u">typeof self&&"u">typeof self.WebSocket,lM=e=>e.split("?")[0],lI="u">typeof WebSocket?WebSocket:"u">typeof r.g&&"u">typeof r.g.WebSocket?r.g.WebSocket:"u">typeof window&&"u">typeof window.WebSocket?window.WebSocket:"u">typeof self&&"u">typeof self.WebSocket?self.WebSocket:r(3244);class lA{constructor(e){if(this.url=e,this.events=new eY.EventEmitter,this.registering=!1,!lb(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return"u">typeof this.socket}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>"u"){t(Error("Connection already closed"));return}this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ow(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!lb(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){let e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>
150{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return t(Error("WebSocket connection is missing or invalid"));e(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,r)=>{let i=new URLSearchParams(e).get("origin"),n=(0,lu.isReactNative)()?{headers:{origin:i}}:{rejectUnauthorized:!RegExp("wss?://localhost(:d{2,5})?").test(e)},s=new lI(e,[],n);lS()?s.onerror=e=>{r(this.emitError(e.error))}:s.on("error",e=>{r(this.emitError(e))}),s.onopen=()=>{this.onOpen(s),t(s)}})}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;let t="string"==typeof e.data?ov(e.data):e.data;this.events.emit("payload",t)}onError(e,t){let r=this.parseError(t),i=ld(e,r.message||r.toString());this.events.emit("payload",i)}parseError(e,t=this.url){var r;return r=lM(t),e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?Error(`Unavailable WS RPC url at ${r}`):e}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(e){let t=this.parseError(Error(e?.message||`WebSocket connection failed for host: ${lM(this.url)}`));return this.events.emit("register_error",t),t}}var lR=r(9618),lD=r.n(lR);let lO="core",lP=`wc@2:${lO}:`,lN={logger:"error"},lT={database:":memory:"},lk="client_ed25519_seed",lC=s2.ONE_DAY,lL=s2.SIX_HOURS,lU="wss://relay.walletconnect.org",lj={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",publish:"relayer_publish"},lB={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},lq="2.17.2",lz={link_mode:"link_mode",relay:"relay"},lF="WALLETCONNECT_LINK_MODE_APPS",l$={created:"subscription_created",deleted:"subscription_deleted",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},lH=1e3*s2.FIVE_SECONDS,lK={wc_pairingDelete:{req:{ttl:s2.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:s2.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:s2.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:s2.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:s2.ONE_DAY,prompt:!1,tag:0},res:{ttl:s2.ONE_DAY,prompt:!1,tag:0}}},lV={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},lG={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},lW={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},lJ="https://verify.walletconnect.org",lX=`${lJ}/v3`,lY=["https://verify.walletconnect.com",lJ],lZ={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal"},lQ={no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_listener_not_found:"proposal_listener_not_found"},l0={session_approve_started:"session_approve_started",session_namespaces_validation_success:"session_namespaces_validation_success",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},l1={no_internet_connection:"no_internet_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},l2={authenticated_session_approve_started:"authenticated_session_approve_started",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve"}
150,l6={no_internet_connection:"no_internet_connection",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"};var l3=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var n=0;n<e.length;n++){var s=e.charAt(n),o=s.charCodeAt(0);if(255!==r[o])throw TypeError(s+" is ambiguous");r[o]=n}var a=e.length,u=e.charAt(0),f=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function h(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var i=0,n=0;e[t]===u;)i++,t++;for(var s=(e.length-t)*f+1>>>0,o=new Uint8Array(s);e[t];){var c=r[e.charCodeAt(t)];if(255===c)return;for(var h=0,l=s-1;(0!==c||h<n)&&-1!==l;l--,h++)c+=a*o[l]>>>0,o[l]=c%256>>>0,c=c/256>>>0;if(0!==c)throw Error("Non-zero carry");n=h,t++}if(" "!==e[t]){for(var d=s-n;d!==s&&0===o[d];)d++;for(var p=new Uint8Array(i+(s-d)),g=i;d!==s;)p[g++]=o[d++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,i=0,n=0,s=t.length;n!==s&&0===t[n];)n++,r++;for(var o=(s-n)*c+1>>>0,f=new Uint8Array(o);n!==s;){for(var h=t[n],l=0,d=o-1;(0!==h||l<i)&&-1!==d;d--,l++)h+=256*f[d]>>>0,f[d]=h%a>>>0,h=h/a>>>0;if(0!==h)throw Error("Non-zero carry");i=l,n++}for(var p=o-i;p!==o&&0===f[p];)p++;for(var g=u.repeat(r);p<o;++p)g+=e.charAt(f[p]);return g},decodeUnsafe:h,decode:function(e){var r=h(e);if(r)return r;throw Error(`Non-${t} character`)}}};let l5=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},l8=e=>new TextEncoder().encode(e),l4=e=>new TextDecoder().decode(e);class l9{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class l7{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return dt(this,e)}}class de{constructor(e){this.decoders=e}or(e){return dt(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let dt=(e,t)=>new de({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});
150class dr{constructor(e,t,r,i){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=i,this.encoder=new l9(e,t,r),this.decoder=new l7(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let di=({name:e,prefix:t,encode:r,decode:i})=>new dr(e,t,r,i),dn=({prefix:e,name:t,alphabet:r})=>{let{encode:i,decode:n}=l3(r,t);return di({prefix:e,name:t,encode:i,decode:e=>l5(n(e))})},ds=(e,t,r,i)=>{let n={};for(let e=0;e<t.length;++e)n[t[e]]=e;let s=e.length;for(;"="===e[s-1];)--s;let o=new Uint8Array(s*r/8|0),a=0,u=0,f=0;for(let t=0;t<s;++t){let s=n[e[t]];if(void 0===s)throw SyntaxError(`Non-${i} character`);u=u<<r|s,(a+=r)>=8&&(a-=8,o[f++]=255&u>>a)}if(a>=r||255&u<<8-a)throw SyntaxError("Unexpected end of data");return o},da=(e,t,r)=>{let i="="===t[t.length-1],n=(1<<r)-1,s="",o=0,a=0;for(let i=0;i<e.length;++i)for(a=a<<8|e[i],o+=8;o>r;)o-=r,s+=t[n&a>>o];if(o&&(s+=t[n&a<<r-o]),i)for(;s.length*r&7;)s+="=";return s},du=({name:e,prefix:t,bitsPerChar:r,alphabet:i})=>di({prefix:t,name:e,encode:e=>da(e,i,r),decode:t=>ds(t,i,r,e)});var df=Object.freeze({__proto__:null,identity:di({prefix:"\0",name:"identity",encode:e=>l4(e),decode:e=>l8(e)})}),dc=Object.freeze({__proto__:null,base2:du({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}),dh=Object.freeze({__proto__:null,base8:du({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}),dl=Object.freeze({__proto__:null,base10:dn({prefix:"9",name:"base10",alphabet:"0123456789"})}),dd=Object.freeze({__proto__:null,base16:du({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper:du({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});let dp=du({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),dg=du({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),dm=du({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),db=du({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),dy=du({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),dv=du({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5});var dw=Object.freeze({__proto__:null,base32:dp,base32upper:dg,base32pad:dm,base32padupper:db,base32hex:dy,base32hexupper:dv,base32hexpad:du({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper:du({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z:du({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}),d_=Object.freeze({__proto__:null,base36:dn({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper:dn({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}),dE=Object.freeze({__proto__:null,base58btc:dn({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr:dn({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});let dx=du({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6});var dS=Object.freeze({__proto__:null,base64:dx,base64pad:du({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url:du({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad:du({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});let dM=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),dI=dM.reduce((e,t,r)=>(e[r]=t,e),[]),dA=dM.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);var dR=Object.freeze({__proto__:null,base256emoji:di({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>
150e+=dI[t],"")},decode:function(e){let t=[];for(let r of e){let e=dA[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}})});function dD(e,t){var r,i=0,t=t||0,n=0,s=t,o=e.length;do{if(s>=o)throw dD.bytes=0,RangeError("Could not decode varint");r=e[s++],i+=n<28?(127&r)<<n:(127&r)*Math.pow(2,n),n+=7}while(r>=128);return dD.bytes=s-t,i}var dO={encode:function e(t,r,i){r=r||[],i=i||0;for(var n=i;t>=0x80000000;)r[i++]=255&t|128,t/=128;for(;-128&t;)r[i++]=255&t|128,t>>>=7;return r[i]=0|t,e.bytes=i-n+1,r},encodingLength:function(e){return e<128?1:e<16384?2:e<2097152?3:e<0x10000000?4:e<0x800000000?5:e<0x40000000000?6:e<0x2000000000000?7:e<0x100000000000000?8:e<0x8000000000000000?9:10}};let dP=(e,t,r=0)=>(dO.encode(e,t,r),t),dN=e=>dO.encodingLength(e),dT=(e,t)=>{let r=t.byteLength,i=dN(e),n=i+dN(r),s=new Uint8Array(n+r);return dP(e,s,0),dP(r,s,i),s.set(t,n),new dk(e,r,t,s)};class dk{constructor(e,t,r,i){this.code=e,this.size=t,this.digest=r,this.bytes=i}}let dC=({name:e,code:t,encode:r})=>new dL(e,t,r);class dL{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?dT(this.code,t):t.then(e=>dT(this.code,e))}throw Error("Unknown type, must be binary type")}}let dU=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));var dj=Object.freeze({__proto__:null,sha256:dC({name:"sha2-256",code:18,encode:dU("SHA-256")}),sha512:dC({name:"sha2-512",code:19,encode:dU("SHA-512")})}),dB=Object.freeze({__proto__:null,identity:{code:0,name:"identity",encode:l5,digest:e=>dT(0,l5(e))}});new TextEncoder,new TextDecoder;let dq={...df,...dc,...dh,...dl,...dd,...dw,...d_,...dE,...dS,...dR};function dz(e,t,r,i){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:i}}}({...dj,...dB});let dF=dz("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),d$=dz("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=function(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),dH={utf8:dF,"utf-8":dF,hex:dq.base16,latin1:d$,ascii:d$,binary:d$,...dq};class dK{constructor(e,t){this.core=e,this.logger=t,this.keychain=new Map,this.name="keychain",this.version="0.3",this.initialized=!1,this.storagePrefix=lP,this.init=async()=>{if(!this.initialized){let e=await this.getKeyChain();"u">typeof e&&(this.keychain=e),this.initialized=!0}},this.has=e=>(this.isInitialized(),this.keychain.has(e)),this.set=async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()},this.get=e=>{this.isInitialized();let t=this.keychain.get(e);if(typeof t>"u"){let{message:t}=hG("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t},this.del=async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()},this.core=e,this.logger=oX(t,this.name)}get context(){return oJ(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,cC(e))}async getKeyChain(){let e=await this.core.storage.getItem(this.storageKey);return"u">typeof e?cL(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){let{message:e}=hG("NOT_INITIALIZED",this.name);throw Error(e)}}}class dV{constructor(e,t,r){this.core=e,this.logger=t,this.name="crypto",this.randomSessionIdentifier=hp(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=e=>(this.isInitialized(),this.keychain.has(e)),this.getClientId=async()=>(this.isInitialized(),uP(uT(await this.getClientSeed()).publicKey)),this.generateKeyPair=()=>{this.isInitialized();let e=function(){let e=co.TZ();return{privateKey:cp(e.secretKey,hc),publicKey:cp(e.publicKey,hc)}}();return this.setPrivateKey(e.publicKey,e.privateKey)},this.signJWT=async e=>{this.isInitialized();let t=uT(await this.getClientSeed()),r=this.randomSessionIdentifier;return await uk(r,e,lC,t)},this.generateSharedKey=(e,t,r)=>{this.isInitialized();let i=function(e,t){let r=co.Tc(cd(e,hc),cd(t,hc),!0);return cp(new cn.i(cs.aD,r).expand(32),hc)}(this.getPrivateKey(e),t);return this.setSymKey(i,r)},this.setSymKey=async(e,t)=>{this.isInitialized();let r=t||hg(e);return await this.keychain.set(r,e),r},this.deleteKeyPair=async e=>{this.isInitialized(),await this.keychain.del(e)},this.deleteSymKey=async e=>{this.isInitialized(),await this.keychain.del(e)},this.encode=async(e,t,r)=>{this.isInitialized();let i=hw(r),n=ow(t);if(2===i.type)return function(e,t){let r=cd("2",hf),i=(0,at.randomBytes)(12);return hy({type:r,sealed:cd(e,hd),iv:i,encoding:t})}(n,r?.encoding);
150if(h_(i)){let t=i.senderPublicKey,r=i.receiverPublicKey;e=await this.generateSharedKey(t,r)}let s=this.getSymKey(e),{type:o,senderPublicKey:a}=i;return function(e){var t;let r=(t="u">typeof e.type?e.type:0,cd(`${t}`,hf));if(1===hb(r)&&typeof e.senderPublicKey>"u")throw Error("Missing sender public key for type 1 envelope");let i="u">typeof e.senderPublicKey?cd(e.senderPublicKey,hc):void 0,n="u">typeof e.iv?cd(e.iv,hc):(0,at.randomBytes)(12);return hy({type:r,sealed:new ci.g6(cd(e.symKey,hc)).seal(n,cd(e.message,hd)),iv:n,senderPublicKey:i,encoding:e.encoding})}({type:o,symKey:s,message:n,senderPublicKey:a,encoding:r?.encoding})},this.decode=async(e,t,r)=>{this.isInitialized();let i=function(e,t){let r=hv({encoded:e,encoding:t?.encoding});return hw({type:hb(r.type),senderPublicKey:"u">typeof r.senderPublicKey?cp(r.senderPublicKey,hc):void 0,receiverPublicKey:t?.receiverPublicKey})}(t,r);if(2===i.type)return ov(function(e,t){let{sealed:r}=hv({encoded:e,encoding:t});return cp(r,hd)}(t,r?.encoding));if(h_(i)){let t=i.receiverPublicKey,r=i.senderPublicKey;e=await this.generateSharedKey(t,r)}try{let i=this.getSymKey(e),n=function(e){let t=new ci.g6(cd(e.symKey,hc)),{sealed:r,iv:i}=hv({encoded:e.encoded,encoding:e?.encoding}),n=t.open(i,r);if(null===n)throw Error("Failed to decrypt");return cp(n,hd)}({symKey:i,encoded:t,encoding:r?.encoding});return ov(n)}catch(t){this.logger.error(`Failed to decode message from topic: '${e}', clientId: '${await this.getClientId()}'`),this.logger.error(t)}},this.getPayloadType=(e,t=hh)=>hb(hv({encoded:e,encoding:t}).type),this.getPayloadSenderPublicKey=(e,t=hh)=>{let r=hv({encoded:e,encoding:t});return r.senderPublicKey?cp(r.senderPublicKey,hc):void 0},this.core=e,this.logger=oX(t,this.name),this.keychain=r||new dK(this.core,this.logger)}get context(){return oJ(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(lk)}catch{e=hp(),await this.keychain.set(lk,e)}return function(e,t="utf8"){let r=dH[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e,"utf8"):r.decoder.decode(`${r.prefix}${e}`)}(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){let{message:e}=hG("NOT_INITIALIZED",this.name);throw Error(e)}}}class dG extends oQ{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name="messages",this.version="0.3",this.initialized=!1,this.storagePrefix=lP,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{let e=await this.getRelayerMessages();"u">typeof e&&(this.messages=e),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}},this.set=async(e,t)=>{this.isInitialized();let r=hm(t),i=this.messages.get(e);return typeof i>"u"&&(i={}),"u">typeof i[r]||(i[r]=t,this.messages.set(e,i),await this.persist()),r},this.get=e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>"u"&&(t={}),t},this.has=(e,t)=>(this.isInitialized(),"u">typeof this.get(e)[hm(t)]),this.del=async e=>{this.isInitialized(),this.messages.delete(e),await this.persist()},this.logger=oX(e,this.name),this.core=t}get context(){return oJ(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,cC(e))}async getRelayerMessages(){let e=await this.core.storage.getItem(this.storageKey);return"u">typeof e?cL(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){let{message:e}=hG("NOT_INITIALIZED",this.name);throw Error(e)}}}class dW extends o0{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new eY.EventEmitter,this.name="publisher",this.queue=new Map,this.publishTimeout=(0,s2.toMiliseconds)(s2.ONE_MINUTE),this.failedPublishTimeout=(0,s2.toMiliseconds)(s2.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(e,t,r)=>{var i;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:r}});let n=r?.ttl||lL,s=hE(r),o=r?.prompt||!1,a=r?.tag||0,u=r?.id||lc().toString(),f={topic:e,message:t,opts:{ttl:n,relay:s,prompt:o,tag:a,id:u,attestation:r?.attestation}},c=`Failed to publish payload, please try again. id:${u} tag:${a}`,h=Date.now(),l,d=1;try{for(;void 0===l;){if(Date.now()-h>this.publishTimeout)throw Error(c);this.logger.trace({id:u,attempts:d},`publisher.publish - attempt ${d}`),l=await await cj(this.rpcPublish(e,t,n,s,o,a,u,r?.attestation).catch(e=>this.logger.warn(e)),this.publishTimeout,c),d++,l||await new Promise(e=>setTimeout(e,this.failedPublishTimeout))}this.relayer.events.emit(lj.publish,f),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:u,topic:e,message:t,opts:r}})}catch(e){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(e),null!=(i=r?.internal)&&i.throwOnFailedPublish)throw e;this.queue.set(u,f)}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.relayer=e,this.logger=oX(t,this.name),this.registerEventListeners()}get context(){return oJ(this.logger)}rpcPublish(e,t,r,i,n,s,o,a){var u,f,c,h;let l={method:hx(i.protocol).publish,params:{topic:e,message:t,ttl:r,prompt:n,tag:s,attestation:a},id:o};return hY(null==(u=l.params)?void 0:u.prompt)&&(null==(f=l.params)||delete f.prompt),hY(null==(c=l.params)?void 0:c.tag)&&(null==(h=l.params)||delete h.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:l}),this.relayer.request(l)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{let{topic:t,message:r,opts:i}=e;await this.publish(t,r,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(s8.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(lj.connection_stalled);return}this.checkQueue()}),this.relayer.on(lj.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class dJ{constructor(){this.map=new Map,this.set=(e,t)=>{let r=this.get(e);this.exists(e,t)||this.map.set(e,[...r,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>
150{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;let r=this.get(e);if(!this.exists(e,t))return;let i=r.filter(e=>e!==t);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var dX=Object.defineProperty,dY=Object.defineProperties,dZ=Object.getOwnPropertyDescriptors,dQ=Object.getOwnPropertySymbols,d0=Object.prototype.hasOwnProperty,d1=Object.prototype.propertyIsEnumerable,d2=(e,t,r)=>t in e?dX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,d6=(e,t)=>{for(var r in t||(t={}))d0.call(t,r)&&d2(e,r,t[r]);if(dQ)for(var r of dQ(t))d1.call(t,r)&&d2(e,r,t[r]);return e},d3=(e,t)=>dY(e,dZ(t));class d5 extends o6{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new dJ,this.events=new eY.EventEmitter,this.name="subscription",this.version="0.3",this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=lP,this.subscribeTimeout=(0,s2.toMiliseconds)(s2.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(e,t)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}});try{let r=hE(t),i={topic:e,relay:r,transportType:t?.transportType};this.pending.set(e,i);let n=await this.rpcSubscribe(e,r,t);return"string"==typeof n&&(this.onSubscribe(n,i),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}})),n}catch(e){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(e),e}},this.unsubscribe=async(e,t)=>{await this.restartToComplete(),this.isInitialized(),"u">typeof t?.id?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)},this.isSubscribed=async e=>{if(this.topics.includes(e))return!0;let t=`${this.pendingSubscriptionWatchLabel}_${e}`;return await new Promise((r,i)=>{let n=new s2.Watch;n.start(t);let s=setInterval(()=>{!this.pending.has(e)&&this.topics.includes(e)&&(clearInterval(s),n.stop(t),r(!0)),n.elapsed(t)>=lH&&(clearInterval(s),n.stop(t),i(Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=oX(t,this.name),this.clientId=""}get context(){return oJ(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,t){let r=!1;try{r=this.getSubscription(e).topic===t}catch{}return r}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){let r=this.topicMap.get(e);await Promise.all(r.map(async r=>await this.unsubscribeById(e,r,t)))}async unsubscribeById(e,t,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}});try{let i=hE(r);await this.rpcUnsubscribe(e,t,i);let n=hW("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,n),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}})}catch(e){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e),e}}async rpcSubscribe(e,t,r){var i;r?.transportType===lz.relay&&await this.restartToComplete();let n={method:hx(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let s=null==(i=r?.internal)?void 0:i.throwOnFailedPublish;try{let t=hm(e+this.clientId);if(r?.transportType===lz.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(n).catch(e=>this.logger.warn(e))},(0,s2.toMiliseconds)(s2.ONE_SECOND)),t;let i=await cj(this.relayer.request(n).catch(e=>this.logger.warn(e)),this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!i&&s)throw Error(`Subscribing to ${e} failed, please try again`);return i?t:null}catch(e){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(lj.connection_stalled),s)throw e}return null}async rpcBatchSubscribe(e){if(!e.length)return;let t={method:hx(e[0].relay.protocol).batchSubscribe,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{return await await cj(this.relayer.request(t).catch(e=>this.logger.warn(e)),this.subscribeTimeout)}catch{this.relayer.events.emit(lj.connection_stalled)}}async rpcBatchFetchMessages(e){let t;if(!e.length)return;let r={method:hx(e[0].relay.protocol).batchFetchMessages,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});
150try{t=await await cj(this.relayer.request(r).catch(e=>this.logger.warn(e)),this.subscribeTimeout)}catch{this.relayer.events.emit(lj.connection_stalled)}return t}rpcUnsubscribe(e,t,r){let i={method:hx(r.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,t){this.setSubscription(e,d3(d6({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(e=>{this.setSubscription(e.id,d6({},e)),this.pending.delete(e.topic)})}async onUnsubscribe(e,t,r){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,r),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,d6({},t)),this.topicMap.set(t.topic,e),this.events.emit(l$.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});let t=this.subscriptions.get(e);if(!t){let{message:t}=hG("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});let r=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(r.topic,e),this.events.emit(l$.deleted,d3(d6({},r),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(l$.sync)}async reset(){if(this.cached.length){let e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t<e;t++){let e=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchFetchMessages(e),await this.batchSubscribe(e)}}this.events.emit(l$.resubscribed)}async restore(){try{let e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){let{message:e}=hG("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;let t=await this.rpcBatchSubscribe(e);hJ(t)&&this.onBatchSubscribe(t.map((t,r)=>d3(d6({},e[r]),{id:t})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);let t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(t.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;let e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(s8.pulse,async()=>{await this.checkPending()}),this.events.on(l$.created,async e=>{let t=l$.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(l$.deleted,async e=>{let t=l$.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=hG("NOT_INITIALIZED",this.name);throw Error(e)}}async restartToComplete(){this.relayer.connected||this.relayer.connecting||await this.relayer.transportOpen(),this.restartInProgress&&await new Promise(e=>{let t=setInterval(()=>{this.restartInProgress||(clearInterval(t),e())},this.pollingInterval)})}}var d8=Object.defineProperty,d4=Object.getOwnPropertySymbols,d9=Object.prototype.hasOwnProperty,d7=Object.prototype.propertyIsEnumerable,pe=(e,t,r)=>t in e?d8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pt=(e,t)=>
150{for(var r in t||(t={}))d9.call(t,r)&&pe(e,r,t[r]);if(d4)for(var r of d4(t))d7.call(t,r)&&pe(e,r,t[r]);return e};class pr extends o1{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new eY.EventEmitter,this.name="relayer",this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=(0,s2.toMiliseconds)(s2.THIRTY_SECONDS+s2.ONE_SECOND),this.request=async e=>{var t,r;this.logger.debug("Publishing Request Payload");let i=e.id||lc().toString();await this.toEstablishConnection();try{let n=this.provider.request(e);this.requestsInFlight.set(i,{promise:n,request:e}),this.logger.trace({id:i,method:e.method,topic:null==(t=e.params)?void 0:t.topic},"relayer.request - attempt to publish...");let s=await new Promise(async(e,t)=>{let r=()=>{t(Error(`relayer.request - publish interrupted, id: ${i}`))};this.provider.on(lB.disconnect,r);let s=await n;this.provider.off(lB.disconnect,r),e(s)});return this.logger.trace({id:i,method:e.method,topic:null==(r=e.params)?void 0:r.topic},"relayer.request - published"),s}catch(e){throw this.logger.debug(`Failed to Publish Request: ${i}`),e}finally{this.requestsInFlight.delete(i)}},this.resetPingTimeout=()=>{if(cR())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var e,t,r;null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)||r.terminate()},this.heartBeatTimeout)}catch(e){this.logger.warn(e)}},this.onPayloadHandler=e=>{this.onProviderPayload(e),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(lj.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=e=>{this.logger.error(e),this.events.emit(lj.error,e),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(lB.payload,this.onPayloadHandler),this.provider.on(lB.connect,this.onConnectHandler),this.provider.on(lB.disconnect,this.onDisconnectHandler),this.provider.on(lB.error,this.onProviderErrorHandler)},this.core=e.core,this.logger="u">typeof e.logger&&"string"!=typeof e.logger?oX(e.logger,this.name):oP()(oW({level:e.logger||"error"})),this.messages=new dG(this.logger,e.core),this.subscriber=new d5(this,this.logger),this.publisher=new dW(this,this.logger),this.relayUrl=e?.relayUrl||lU,this.projectId=e.projectId,this.bundleId=function(){var e;try{return cD()&&"u">typeof r.g&&"u">typeof(null==r.g?void 0:r.g.Application)?null==(e=r.g.Application)?void 0:e.applicationId:void 0}catch{return}}(),this.provider={}}
150async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(e){this.logger.warn(e)}}get context(){return oJ(this.logger)}get connected(){var e,t,r;return(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)===1}get connecting(){var e,t,r;return(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)===0}async publish(e,t,r){this.isInitialized(),await this.publisher.publish(e,t,r),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:lz.relay})}async subscribe(e,t){var r,i,n;this.isInitialized(),t?.transportType==="relay"&&await this.toEstablishConnection();let s=typeof(null==(r=t?.internal)?void 0:r.throwOnFailedPublish)>"u"||(null==(i=t?.internal)?void 0:i.throwOnFailedPublish),o=(null==(n=this.subscriber.topicMap.get(e))?void 0:n[0])||"",a,u=t=>{t.topic===e&&(this.subscriber.off(l$.created,u),a())};return await Promise.all([new Promise(e=>{a=e,this.subscriber.on(l$.created,u)}),new Promise(async(r,i)=>{o=await this.subscriber.subscribe(e,pt({internal:{throwOnFailedPublish:s}},t)).catch(e=>{s&&i(e)})||o,r()})]),o}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await cj(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(e,t)=>{let r=()=>{this.provider.off(lB.disconnect,r),t(Error("Connection interrupted while trying to subscribe"))};this.provider.on(lB.disconnect,r),await cj(this.provider.connect(),(0,s2.toMiliseconds)(s2.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(e=>{t(e)}).finally(()=>{clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),this.subscriber.start().catch(e=>{this.logger.error(e),this.onDisconnectHandler()}),this.hasExperiencedNetworkDisruption=!1,e()})}catch(e){if(this.logger.error(e),this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(e.message))throw e}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await h7())throw Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(e?.length===0){this.logger.trace("Batch message events is empty. Ignoring...");return}let t=e.sort((e,t)=>e.publishedAt-t.publishedAt);for(let e of(this.logger.trace(`Batch of ${t.length} message events sorted`),t))try{await this.onMessageEvent(e)}catch(e){this.logger.warn(e)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){let{topic:r}=e;if(!t.sessionExists){let e=cz(s2.FIVE_MINUTES);await this.core.pairing.pairings.set(r,{topic:r,expiry:e,relay:{protocol:"irn"},active:!1})}this.events.emit(lj.message,e),await this.recordMessageEvent(e)}startPingTimeout(){var e,t,r,i,n;if(cR())try{null!=(t=null==(e=this.provider)?void 0:e.connection)&&t.socket&&(null==(n=null==(i=null==(r=this.provider)?void 0:r.connection)?void 0:i.socket)||n.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(e){this.logger.warn(e)}}isConnectionStalled(e){return this.staleConnectionErrors.some(t=>e.includes(t))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();let e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new lx(new lA(function({protocol:e,version:t,relayUrl:r,sdkVersion:i,auth:n,projectId:s,useOnCloseEvent:o,bundleId:a}){var u,f;let c;let h=r.split("?"),l=cT(e,t,i),d=(u=h[1]||"",f={auth:n,ua:l,projectId:s,useOnCloseEvent:o||void 0,origin:a||void 0},c=cI(cI({},c=uG.parse(u)),f),u=uG.stringify(c));return h[0]+"?"+d}({sdkVersion:lq,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){let{topic:t,message:r}=e;await this.messages.set(t,r)}async shouldIgnoreMessageEvent(e){let{topic:t,message:r}=e;if(!r||0===r.length)return this.logger.debug(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;let i=this.messages.has(t,r);return i&&this.logger.debug(`Ignoring duplicate message: ${r}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),lv(e)){if(!e.method.endsWith("_subscription"))return;let t=e.params,{topic:r,message:i,publishedAt:n,attestation:s}=t.data,o={topic:r,message:i,publishedAt:n,transportType:lz.relay,attestation:s};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(pt({type:"event",event:t.id},o)),this.events.emit(t.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else lw(e)&&this.events.emit(lj.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(lj.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){let t=ll(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(lB.payload,this.onPayloadHandler),this.provider.off(lB.connect,this.onConnectHandler),this.provider.off(lB.disconnect,this.onDisconnectHandler),this.provider.off(lB.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await h7();!function(e){switch(cP()){case cA.browser:!cD()&&cO()&&(window.addEventListener("online",()=>e(!0)),window.addEventListener("offline",()=>e(!1)));break;case cA.reactNative:cD()&&"u">typeof r.g&&null!=r.g&&r.g.NetInfo&&r.g?.NetInfo.addEventListener(t=>e(t?.isConnected));case cA.node:}}(async t=>{e!==t&&(e=t,t?await this.restartTransport().catch(e=>this.logger.error(e)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(lj.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},(0,s2.toMiliseconds)(.1))))}isInitialized(){if(!this.initialized){let{message:e}=hG("NOT_INITIALIZED",this.name);throw Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),this.connected||(this.connectionAttemptInProgress&&await new Promise(e=>{let t=setInterval(()=>{this.connected&&(clearInterval(t),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var pi=Object.defineProperty,pn=Object.getOwnPropertySymbols,ps=Object.prototype.hasOwnProperty,po=Object.prototype.propertyIsEnumerable,pa=(e,t,r)=>t in e?pi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pu=(e,t)=>{for(var r in t||(t={}))ps.call(t,r)&&pa(e,r,t[r]);if(pn)for(var r of pn(t))po.call(t,r)&&pa(e,r,t[r]);return e};
150class pf extends o2{constructor(e,t,r,i=lP,n){super(e,t,r,i),this.core=e,this.logger=t,this.name=r,this.map=new Map,this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=lP,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>{this.getKey&&null!==e&&!hY(e)?this.map.set(this.getKey(e),e):function(e){var t;return null==(t=e?.proposer)?void 0:t.publicKey}(e)?this.map.set(e.id,e):e?.topic&&this.map.set(e.topic,e)}),this.cached=[],this.initialized=!0)},this.set=async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:e,value:t}),this.map.set(e,t),await this.persist())},this.get=e=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:e}),this.getData(e)),this.getAll=e=>(this.isInitialized(),e?this.values.filter(t=>Object.keys(e).every(r=>lD()(t[r],e[r]))):this.values),this.update=async(e,t)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:e,update:t});let r=pu(pu({},this.getData(e)),t);this.map.set(e,r),await this.persist()},this.delete=async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:e,reason:t}),this.map.delete(e),this.addToRecentlyDeleted(e),await this.persist())},this.logger=oX(t,this.name),this.storagePrefix=i,this.getKey=n}get context(){return oJ(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){let t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){let{message:t}=hG("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(t),Error(t)}let{message:t}=hG("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{let e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){let{message:e}=hG("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){let{message:e}=hG("NOT_INITIALIZED",this.name);throw Error(e)}}}class pc{constructor(e,t){this.core=e,this.logger=t,this.name="pairing",this.version="0.3",this.events=new(eZ()),this.initialized=!1,this.storagePrefix=lP,this.ignoredPayloadTypes=[1],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]},this.create=async e=>{this.isInitialized();let t=hp(),r=await this.core.crypto.setSymKey(t),i=cz(s2.FIVE_MINUTES),n={protocol:"irn"},s={topic:r,expiry:i,relay:n,active:!1,methods:e?.methods},o=hk({protocol:this.core.protocol,version:this.core.version,topic:r,symKey:t,relay:n,expiryTimestamp:i,methods:e?.methods});return this.events.emit(lV.create,s),this.core.expirer.set(r,i),await this.pairings.set(r,s),await this.core.relayer.subscribe(r,{transportType:e?.transportType}),{topic:r,uri:o}},this.pair=async e=>{let t;this.isInitialized();let r=this.core.eventClient.createEvent({properties:{topic:e?.uri,trace:[lZ.pairing_started]}});this.isValidPair(e,r);let{topic:i,symKey:n,relay:s,expiryTimestamp:o,methods:a}=hT(e.uri);if(r.props.properties.topic=i,r.addTrace(lZ.pairing_uri_validation_success),r.addTrace(lZ.pairing_uri_not_expired),this.pairings.keys.includes(i)){if(t=this.pairings.get(i),r.addTrace(lZ.existing_pairing),t.active)throw r.setError(lQ.active_pairing_already_exists),Error(`Pairing already exists: ${i}. Please try again with a new connection URI.`);r.addTrace(lZ.pairing_not_expired)}
150let u=o||cz(s2.FIVE_MINUTES),f={topic:i,relay:s,expiry:u,active:!1,methods:a};this.core.expirer.set(i,u),await this.pairings.set(i,f),r.addTrace(lZ.store_new_pairing),e.activatePairing&&await this.activate({topic:i}),this.events.emit(lV.create,f),r.addTrace(lZ.emit_inactive_pairing),this.core.crypto.keychain.has(i)||await this.core.crypto.setSymKey(n,i),r.addTrace(lZ.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{r.setError(lQ.no_internet_connection)}try{await this.core.relayer.subscribe(i,{relay:s})}catch(e){throw r.setError(lQ.subscribe_pairing_topic_failure),e}return r.addTrace(lZ.subscribe_pairing_topic_success),f},this.activate=async({topic:e})=>{this.isInitialized();let t=cz(s2.THIRTY_DAYS);this.core.expirer.set(e,t),await this.pairings.update(e,{active:!0,expiry:t})},this.ping=async e=>{this.isInitialized(),await this.isValidPing(e);let{topic:t}=e;if(this.pairings.keys.includes(t)){let e=await this.sendRequest(t,"wc_pairingPing",{}),{done:r,resolve:i,reject:n}=cU();this.events.once(c$("pairing_ping",e),({error:e})=>{e?n(e):i()}),await r()}},this.updateExpiry=async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})},this.updateMetadata=async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async e=>{this.isInitialized(),await this.isValidDisconnect(e);let{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,"wc_pairingDelete",hW("USER_DISCONNECTED")),await this.deletePairing(t))},this.formatUriFromPairing=e=>{this.isInitialized();let{topic:t,relay:r,expiry:i,methods:n}=e,s=this.core.crypto.keychain.get(t);return hk({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:s,relay:r,expiryTimestamp:i,methods:n})},this.sendRequest=async(e,t,r)=>{let i=lh(t,r),n=await this.core.crypto.encode(e,i),s=lK[t].req;return this.core.history.set(e,i),this.core.relayer.publish(e,n,s),i.id},this.sendResult=async(e,t,r)=>{let i=ll(e,r),n=await this.core.crypto.encode(t,i),s=lK[(await this.core.history.get(t,e)).request.method].res;await this.core.relayer.publish(t,n,s),await this.core.history.resolve(i)},this.sendError=async(e,t,r)=>{let i=ld(e,r),n=await this.core.crypto.encode(t,i),s=await this.core.history.get(t,e),o=lK[s.request.method]?lK[s.request.method].res:lK.unregistered_method.res;await this.core.relayer.publish(t,n,o),await this.core.history.resolve(i)},this.deletePairing=async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,hW("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])},this.cleanup=async()=>{let e=this.pairings.getAll().filter(e=>cF(e.expiry));await Promise.all(e.map(e=>this.deletePairing(e.topic)))},this.onRelayEventRequest=e=>{let{topic:t,payload:r}=e;switch(r.method){case"wc_pairingPing":return this.onPairingPingRequest(t,r);case"wc_pairingDelete":return this.onPairingDeleteRequest(t,r);default:return this.onUnknownRpcMethodRequest(t,r)}},this.onRelayEventResponse=async e=>{let{topic:t,payload:r}=e,i=(await this.core.history.get(t,r.id)).request.method;return"wc_pairingPing"===i?this.onPairingPingResponse(t,r):this.onUnknownRpcMethodResponse(i)},this.onPairingPingRequest=async(e,t)=>{let{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult(r,e,!0),this.events.emit(lV.ping,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onPairingPingResponse=(e,t)=>{let{id:r}=t;setTimeout(()=>{l_(t)?this.events.emit(c$("pairing_ping",r),{}):lE(t)&&this.events.emit(c$("pairing_ping",r),{error:t.error})},500)},this.onPairingDeleteRequest=async(e,t)=>{let{id:r}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit(lV.delete,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onUnknownRpcMethodRequest=async(e,t)=>{let{id:r,method:i}=t;try{if(this.registeredMethods.includes(i))return;let t=hW("WC_METHOD_UNSUPPORTED",i);await this.sendError(r,e,t),this.logger.error(t)}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onUnknownRpcMethodResponse=e=>{this.registeredMethods.includes(e)||this.logger.error(hW("WC_METHOD_UNSUPPORTED",e))},this.isValidPair=(e,t)=>
150{var r;if(!h5(e)){let{message:r}=hG("MISSING_OR_INVALID",`pair() params: ${e}`);throw t.setError(lQ.malformed_pairing_uri),Error(r)}if(!function(e){function t(e){try{return"u">typeof new URL(e)}catch{return!1}}try{if(hZ(e,!1)){if(t(e))return!0;let r=cJ(e);return t(r)}}catch{}return!1}(e.uri)){let{message:r}=hG("MISSING_OR_INVALID",`pair() uri: ${e.uri}`);throw t.setError(lQ.malformed_pairing_uri),Error(r)}let i=hT(e?.uri);if(!(null!=(r=i?.relay)&&r.protocol)){let{message:e}=hG("MISSING_OR_INVALID","pair() uri#relay-protocol");throw t.setError(lQ.malformed_pairing_uri),Error(e)}if(!(null!=i&&i.symKey)){let{message:e}=hG("MISSING_OR_INVALID","pair() uri#symKey");throw t.setError(lQ.malformed_pairing_uri),Error(e)}if(null!=i&&i.expiryTimestamp&&(0,s2.toMiliseconds)(i?.expiryTimestamp)<Date.now()){t.setError(lQ.pairing_expired);let{message:e}=hG("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw Error(e)}},this.isValidPing=async e=>{if(!h5(e)){let{message:t}=hG("MISSING_OR_INVALID",`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidDisconnect=async e=>{if(!h5(e)){let{message:t}=hG("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidPairingTopic=async e=>{if(!hZ(e,!1)){let{message:t}=hG("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.pairings.keys.includes(e)){let{message:t}=hG("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw Error(t)}if(cF(this.pairings.get(e).expiry)){await this.deletePairing(e);let{message:t}=hG("EXPIRED",`pairing topic: ${e}`);throw Error(t)}},this.core=e,this.logger=oX(t,this.name),this.pairings=new pf(this.core,this.logger,this.name,this.storagePrefix)}get context(){return oJ(this.logger)}isInitialized(){if(!this.initialized){let{message:e}=hG("NOT_INITIALIZED",this.name);throw Error(e)}}registerRelayerEvents(){this.core.relayer.on(lj.message,async e=>{let{topic:t,message:r,transportType:i}=e;if(!this.pairings.keys.includes(t)||i===lz.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))return;let n=await this.core.crypto.decode(t,r);try{lv(n)?(this.core.history.set(t,n),this.onRelayEventRequest({topic:t,payload:n})):lw(n)&&(await this.core.history.resolve(n),await this.onRelayEventResponse({topic:t,payload:n}),this.core.history.delete(t,n.id))}catch(e){this.logger.error(e)}})}registerExpirerEvents(){this.core.expirer.on(lW.expired,async e=>{let{topic:t}=cq(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(lV.expire,{topic:t}))})}}class ph extends oZ{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new eY.EventEmitter,this.name="history",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=lP,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.records.set(e.id,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(e,t,r)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:r}),this.records.has(t.id))return;let i={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:r,expiry:cz(s2.THIRTY_DAYS)};this.records.set(i.id,i),this.persist(),this.events.emit(lG.created,i)},this.resolve=async e=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:e}),!this.records.has(e.id))return;let t=await this.getRecord(e.id);typeof t.response>"u"&&(t.response=lE(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.persist(),this.events.emit(lG.updated,t))},this.get=async(e,t)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:e,id:t}),await this.getRecord(t)),this.delete=(e,t)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:t}
150),this.values.forEach(r=>{r.topic!==e||"u">typeof t&&r.id!==t||(this.records.delete(r.id),this.events.emit(lG.deleted,r))}),this.persist()},this.exists=async(e,t)=>(this.isInitialized(),!!this.records.has(t)&&(await this.getRecord(t)).topic===e),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=oX(t,this.name)}get context(){return oJ(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){let e=[];return this.values.forEach(t=>{if("u">typeof t.response)return;let r={topic:t.topic,request:lh(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(r)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();let t=this.records.get(e);if(!t){let{message:t}=hG("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(lG.sync)}async restore(){try{let e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){let{message:e}=hG("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(lG.created,e=>{let t=lG.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(lG.updated,e=>{let t=lG.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(lG.deleted,e=>{let t=lG.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.core.heartbeat.on(s8.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{(0,s2.toMiliseconds)(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(lG.deleted,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){let{message:e}=hG("NOT_INITIALIZED",this.name);throw Error(e)}}}class pl extends o3{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new eY.EventEmitter,this.name="expirer",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=lP,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.expirations.set(e.target,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=e=>{try{let t=this.formatTarget(e);return"u">typeof this.getExpiration(t)}catch{return!1}},this.set=(e,t)=>{this.isInitialized();let r=this.formatTarget(e),i={target:r,expiry:t};this.expirations.set(r,i),this.checkExpiry(r,i),this.events.emit(lW.created,{target:r,expiration:i})},this.get=e=>{this.isInitialized();let t=this.formatTarget(e);return this.getExpiration(t)},this.del=e=>{if(this.isInitialized(),this.has(e)){let t=this.formatTarget(e),r=this.getExpiration(t);this.expirations.delete(t),this.events.emit(lW.deleted,{target:t,expiration:r})}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=oX(t,this.name)}get context(){return oJ(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if("string"==typeof e)return cB("topic",e);if("number"==typeof e)return cB("id",e);let{message:t}=hG("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(lW.sync)}
150async restore(){try{let e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){let{message:e}=hG("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){let t=this.expirations.get(e);if(!t){let{message:t}=hG("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(t),Error(t)}return t}checkExpiry(e,t){let{expiry:r}=t;(0,s2.toMiliseconds)(r)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(lW.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(s8.pulse,()=>this.checkExpirations()),this.events.on(lW.created,e=>{let t=lW.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(lW.expired,e=>{let t=lW.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(lW.deleted,e=>{let t=lW.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=hG("NOT_INITIALIZED",this.name);throw Error(e)}}}class pd extends o5{constructor(e,t,r){super(e,t,r),this.core=e,this.logger=t,this.store=r,this.name="verify-api",this.verifyUrlV3=lX,this.storagePrefix=lP,this.version=2,this.init=async()=>{var e;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&(0,s2.toMiliseconds)(null==(e=this.publicKey)?void 0:e.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))},this.register=async e=>{if(!cO()||this.isDevEnv)return;let t=window.location.origin,{id:r,decryptedId:i}=e,n=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${t}&id=${r}&decryptedId=${i}`;try{let e=(0,uK.getDocument)(),t=this.startAbortTimer(5*s2.ONE_SECOND),i=await new Promise((i,s)=>{let o=()=>{window.removeEventListener("message",u),e.body.removeChild(a),s("attestation aborted")};this.abortController.signal.addEventListener("abort",o);let a=e.createElement("iframe");a.src=n,a.style.display="none",a.addEventListener("error",o,{signal:this.abortController.signal});let u=n=>{if(n.data&&"string"==typeof n.data)try{let s=JSON.parse(n.data);if("verify_attestation"===s.type){if(uN(s.attestation).payload.id!==r)return;clearInterval(t),e.body.removeChild(a),this.abortController.signal.removeEventListener("abort",o),window.removeEventListener("message",u),i(null===s.attestation?"":s.attestation)}}catch(e){this.logger.warn(e)}};e.body.appendChild(a),window.addEventListener("message",u,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",i),i}catch(e){this.logger.warn(e)}return""},this.resolve=async e=>{if(this.isDevEnv)return"";let{attestationId:t,hash:r,encryptedId:i}=e;if(""===t){this.logger.debug("resolve: attestationId is empty, skipping");return}if(t){if(uN(t).payload.id!==i)return;let e=await this.isValidJwtAttestation(t);if(e){if(!e.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return e}}if(!r)return;let n=this.getVerifyUrl(e?.verifyUrl);return this.fetchAttestation(r,n)},this.fetchAttestation=async(e,t)=>{this.logger.debug(`resolving attestation: ${e} from url: ${t}`);let r=this.startAbortTimer(5*s2.ONE_SECOND),i=await fetch(`${t}/attestation/${e}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(r),200===i.status?await i.json():void 0},this.getVerifyUrl=e=>{let t=e||lJ;return lY.includes(t)||(this.logger.info(`verify url: ${t}, not included in trusted list, assigning default: ${lJ}`),t=lJ),t},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);let e=this.startAbortTimer(s2.FIVE_SECONDS),t=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(e),await t.json()}catch(e){this.logger.warn(e)}},this.persistPublicKey=async e=>{this.logger.debug("persisting public key to local storage",e),await this.store.setItem(this.storeKey,e),this.publicKey=e},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async e=>{let t=await this.getPublicKey();try{if(t)return this.validateAttestation(e,t)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}let r=await this.fetchAndPersistPublicKey();try{if(r)return this.validateAttestation(e,r)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>
150{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async e=>{let t=await this.fetchPublicKey();t&&(await this.persistPublicKey(t),e(t))});let e=await this.fetchPromise;return this.fetchPromise=void 0,e},this.validateAttestation=(e,t)=>{let r=function(e,t){let[r,i,n]=e.split("."),s=cy.from(function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4;return r>0&&(t+="=".repeat(4-r)),t}(n),"base64");if(64!==s.length)throw Error("Invalid signature length");let o=s.slice(0,32).toString("hex"),a=s.slice(32,64).toString("hex"),u=`${r}.${i}`,f=new cs.aD().update(cy.from(u)).digest(),c=new cg.ec("p256").keyFromPublic({x:cy.from(t.x,"base64").toString("hex"),y:cy.from(t.y,"base64").toString("hex")},"hex"),h=cy.from(f).toString("hex");if(!c.verify(h,{r:o,s:a}))throw Error("Invalid signature");return uN(e).payload}(e,t.publicKey),i={hasExpired:(0,s2.toMiliseconds)(r.exp)<Date.now(),payload:r};if(i.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),Error("JWT attestation expired");return{origin:i.payload.origin,isScam:i.payload.isScam,isVerified:i.payload.isVerified}},this.logger=oX(t,this.name),this.abortController=new AbortController,this.isDevEnv=cW(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return oJ(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),(0,s2.toMiliseconds)(e))}}class pp extends o8{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context="echo",this.registerDeviceToken=async e=>{let{clientId:t,token:r,notificationType:i,enableEncrypted:n=!1}=e,s=`https://echo.walletconnect.com/${this.projectId}/clients`;await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:t,type:i,token:r,always_raw:n})})},this.logger=oX(t,this.context)}}var pg=Object.defineProperty,pm=Object.getOwnPropertySymbols,pb=Object.prototype.hasOwnProperty,py=Object.prototype.propertyIsEnumerable,pv=(e,t,r)=>t in e?pg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pw=(e,t)=>{for(var r in t||(t={}))pb.call(t,r)&&pv(e,r,t[r]);if(pm)for(var r of pm(t))py.call(t,r)&&pv(e,r,t[r]);return e};class p_ extends o4{constructor(e,t,r=!0){super(e,t,r),this.core=e,this.logger=t,this.context="event-client",this.storagePrefix=lP,this.storageVersion=.1,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!cW())try{let e={eventId:cG(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:cT(this.core.relayer.protocol,this.core.relayer.version,lq)}}};await this.sendEvent([e])}catch(e){this.logger.warn(e)}},this.createEvent=e=>{let{event:t="ERROR",type:r="",properties:{topic:i,trace:n}}=e,s=cG(),o=this.core.projectId||"",a=pw({eventId:s,timestamp:Date.now(),props:{event:t,type:r,properties:{topic:i,trace:n}},bundleId:o,domain:this.getAppDomain()},this.setMethods(s));return this.telemetryEnabled&&(this.events.set(s,a),this.shouldPersist=!0),a},this.getEvent=e=>{let{eventId:t,topic:r}=e;if(t)return this.events.get(t);let i=Array.from(this.events.values()).find(e=>e.props.properties.topic===r);if(i)return pw(pw({},i),this.setMethods(i.eventId))},this.deleteEvent=e=>{let{eventId:t}=e;this.events.delete(t),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(s8.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(e=>{(0,s2.fromMiliseconds)(Date.now())-(0,s2.fromMiliseconds)(e.timestamp)>86400&&(this.events.delete(e.eventId),this.shouldPersist=!0)})})},this.setMethods=e=>({addTrace:t=>this.addTrace(e,t),setError:t=>this.setError(e,t)}),this.addTrace=(e,t)=>{let r=this.events.get(e);r&&(r.props.properties.trace.push(t),this.events.set(e,r),this.shouldPersist=!0)},this.setError=(e,t)=>{let r=this.events.get(e);r&&(r.props.type=t,r.timestamp=Date.now(),this.events.set(e,r),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())
150),this.shouldPersist=!1},this.restore=async()=>{try{let e=await this.core.storage.getItem(this.storageKey)||[];if(!e.length)return;e.forEach(e=>{this.events.set(e.eventId,pw(pw({},e),this.setMethods(e.eventId)))})}catch(e){this.logger.warn(e)}},this.submit=async()=>{if(!this.telemetryEnabled||0===this.events.size)return;let e=[];for(let[t,r]of this.events)r.props.type&&e.push(r);if(0!==e.length)try{if((await this.sendEvent(e)).ok)for(let t of e)this.events.delete(t.eventId),this.shouldPersist=!0}catch(e){this.logger.warn(e)}},this.sendEvent=async e=>{let t=this.getAppDomain()?"":"&sp=desktop";return await fetch(`https://pulse.walletconnect.org/batch?projectId=${this.core.projectId}&st=events_sdk&sv=js-${lq}${t}`,{method:"POST",body:JSON.stringify(e)})},this.getAppDomain=()=>cN().url,this.logger=oX(t,this.context),this.telemetryEnabled=r,r?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var pE=Object.defineProperty,px=Object.getOwnPropertySymbols,pS=Object.prototype.hasOwnProperty,pM=Object.prototype.propertyIsEnumerable,pI=(e,t,r)=>t in e?pE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pA=(e,t)=>{for(var r in t||(t={}))pS.call(t,r)&&pI(e,r,t[r]);if(px)for(var r of px(t))pM.call(t,r)&&pI(e,r,t[r]);return e};class pR extends oY{constructor(e){var t;super(e),this.protocol="wc",this.version=2,this.name=lO,this.events=new eY.EventEmitter,this.initialized=!1,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.dispatchEnvelope=({topic:e,message:t,sessionExists:r})=>{if(!e||!t)return;let i={topic:e,message:t,publishedAt:Date.now(),transportType:lz.link_mode};this.relayer.onLinkMessageEvent(i,{sessionExists:r})},this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||lU,this.customStoragePrefix=null!=e&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";let{logger:r,chunkLoggerController:i}=function(e){return"u">typeof e.loggerOverride&&"string"!=typeof e.loggerOverride?{logger:e.loggerOverride,chunkLoggerController:null}:"u">typeof window?function(e){var t,r;let i=new oU(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:oP()(oG(oV({},e.opts),{level:"trace",browser:oG(oV({},null==(r=e.opts)?void 0:r.browser),{write:e=>i.write(e)})})),chunkLoggerController:i}}(e):function(e){var t;let r=new oj(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:oP()(oG(oV({},e.opts),{level:"trace"}),r),chunkLoggerController:r}}(e)}({opts:oW({level:"string"==typeof e?.logger&&e.logger?e.logger:lN.logger}),maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=i,null!=(t=this.logChunkController)&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var e,t;null!=(e=this.logChunkController)&&e.downloadLogsBlobInBrowser&&(null==(t=this.logChunkController)||t.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=oX(r,this.name),this.heartbeat=new s4,this.crypto=new dV(this,this.logger,e?.keychain),this.history=new ph(this,this.logger),this.expirer=new pl(this,this.logger),this.storage=null!=e&&e.storage?e.storage:new oD(pA(pA({},lT),e?.storageOptions)),this.relayer=new pr({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new pc(this,this.logger),this.verify=new pd(this,this.logger,this.storage),this.echoClient=new pp(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new p_(this,this.logger,e?.telemetryEnabled)}static async init(e){let t=new pR(e);await t.initialize();let r=await t.crypto.getClientId();return await t.storage.setItem("WALLETCONNECT_CLIENT_ID",r),t}get context(){return oJ(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return null==(e=this.logChunkController)?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(lF,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(
150),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(lF)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}let pD="client",pO=`wc@2:${pD}:`,pP={name:pD,logger:"error"},pN="WALLETCONNECT_DEEPLINK_CHOICE",pT=s2.SEVEN_DAYS,pk={wc_sessionPropose:{req:{ttl:s2.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:s2.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:s2.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:s2.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:s2.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:s2.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:s2.ONE_DAY,prompt:!1,tag:1104},res:{ttl:s2.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:s2.ONE_DAY,prompt:!1,tag:1106},res:{ttl:s2.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:s2.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:s2.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:s2.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:s2.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:s2.ONE_DAY,prompt:!1,tag:1112},res:{ttl:s2.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:s2.ONE_DAY,prompt:!1,tag:1114},res:{ttl:s2.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:s2.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:s2.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:s2.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:s2.FIVE_MINUTES,prompt:!1,tag:1119}}},pC={min:s2.FIVE_MINUTES,max:s2.SEVEN_DAYS},pL={idle:"IDLE",active:"ACTIVE"},pU=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],pj="[email protected]:auth:",pB=`${pj}:PUB_KEY`;var pq=Object.defineProperty,pz=Object.defineProperties,pF=Object.getOwnPropertyDescriptors,p$=Object.getOwnPropertySymbols,pH=Object.prototype.hasOwnProperty,pK=Object.prototype.propertyIsEnumerable,pV=(e,t,r)=>t in e?pq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pG=(e,t)=>{for(var r in t||(t={}))pH.call(t,r)&&pV(e,r,t[r]);if(p$)for(var r of p$(t))pK.call(t,r)&&pV(e,r,t[r]);return e},pW=(e,t)=>pz(e,pF(t));class pJ extends o7{constructor(e){super(e),this.name="engine",this.events=new(eZ()),this.initialized=!1,this.requestQueue={state:pL.idle,queue:[]},this.sessionRequestQueue={state:pL.idle,queue:[]},this.requestQueueDelay=s2.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(pk)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},(0,s2.toMiliseconds)(this.requestQueueDelay)))},this.connect=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();let t=pW(pG({},e),{requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}});await this.isValidConnect(t);let{pairingTopic:r,requiredNamespaces:i,optionalNamespaces:n,sessionProperties:s,relays:o}=t,a=r,u,f=!1;try{a&&(f=this.client.core.pairing.pairings.get(a).active)}catch(e){throw this.client.logger.error(`connect() -> pairing.get(${a}) failed`),e}if(!a||!f){let{topic:e,uri:t}=await this.client.core.pairing.create();a=e,u=t}if(!a){let{message:e}=hG("NO_MATCHING_KEY",`connect() pairing topic: ${a}`);throw Error(e)}let c=await this.client.core.crypto.generateKeyPair(),h=pk.wc_sessionPropose.req.ttl||s2.FIVE_MINUTES,l=cz(h),d=pG({requiredNamespaces:i,optionalNamespaces:n,relays:o??[{protocol:"irn"}],proposer:{publicKey:c,metadata:this.client.metadata},expiryTimestamp:l,pairingTopic:a},s&&{sessionProperties:s}),{reject:p,resolve:g,done:m}=cU(h,"Proposal expired");this.events.once(c$("session_connect"),async({error:e,session:t})=>{if(e)p(e);else if(t){t.self.publicKey=c;let e=pW(pG({},t),{pairingTopic:d.pairingTopic,requiredNamespaces:d.requiredNamespaces,optionalNamespaces:d.optionalNamespaces,transportType:lz.relay});await this.client.session.set(t.topic,e),await this.setExpiry(t.topic,t.expiry),a&&await this.client.core.pairing.updateMetadata({topic:a,metadata:t.peer.metadata}
150),this.cleanupDuplicatePairings(e),g(e)}});let b=await this.sendRequest({topic:a,method:"wc_sessionPropose",params:d,throwOnFailedPublish:!0});return await this.setProposal(b,pG({id:b},d)),{uri:u,approval:m}},this.pair=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(e)}catch(e){throw this.client.logger.error("pair() failed"),e}},this.approve=async e=>{var t,r,i;let n=this.client.core.eventClient.createEvent({properties:{topic:null==(t=e?.id)?void 0:t.toString(),trace:[l0.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(e){throw n.setError(l1.no_internet_connection),e}try{await this.isValidProposalId(e?.id)}catch(t){throw this.client.logger.error(`approve() -> proposal.get(${e?.id}) failed`),n.setError(l1.proposal_not_found),t}try{await this.isValidApprove(e)}catch(e){throw this.client.logger.error("approve() -> isValidApprove() failed"),n.setError(l1.session_approve_namespace_validation_failure),e}let{id:s,relayProtocol:o,namespaces:a,sessionProperties:u,sessionConfig:f}=e,c=this.client.proposal.get(s);this.client.core.eventClient.deleteEvent({eventId:n.eventId});let{pairingTopic:h,proposer:l,requiredNamespaces:d,optionalNamespaces:p}=c,g=null==(r=this.client.core.eventClient)?void 0:r.getEvent({topic:h});g||(g=null==(i=this.client.core.eventClient)?void 0:i.createEvent({type:l0.session_approve_started,properties:{topic:h,trace:[l0.session_approve_started,l0.session_namespaces_validation_success]}}));let m=await this.client.core.crypto.generateKeyPair(),b=l.publicKey,y=await this.client.core.crypto.generateSharedKey(m,b),v=pG(pG({relay:{protocol:o??"irn"},namespaces:a,controller:{publicKey:m,metadata:this.client.metadata},expiry:cz(pT)},u&&{sessionProperties:u}),f&&{sessionConfig:f}),w=lz.relay;g.addTrace(l0.subscribing_session_topic);try{await this.client.core.relayer.subscribe(y,{transportType:w})}catch(e){throw g.setError(l1.subscribe_session_topic_failure),e}g.addTrace(l0.subscribe_session_topic_success);let _=pW(pG({},v),{topic:y,requiredNamespaces:d,optionalNamespaces:p,pairingTopic:h,acknowledged:!1,self:v.controller,peer:{publicKey:l.publicKey,metadata:l.metadata},controller:m,transportType:lz.relay});await this.client.session.set(y,_),g.addTrace(l0.store_session);try{g.addTrace(l0.publishing_session_settle),await this.sendRequest({topic:y,method:"wc_sessionSettle",params:v,throwOnFailedPublish:!0}).catch(e=>{throw g?.setError(l1.session_settle_publish_failure),e}),g.addTrace(l0.session_settle_publish_success),g.addTrace(l0.publishing_session_approve),await this.sendResult({id:s,topic:h,result:{relay:{protocol:o??"irn"},responderPublicKey:m},throwOnFailedPublish:!0}).catch(e=>{throw g?.setError(l1.session_approve_publish_failure),e}),g.addTrace(l0.session_approve_publish_success)}catch(e){throw this.client.logger.error(e),this.client.session.delete(y,hW("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(y),e}return this.client.core.eventClient.deleteEvent({eventId:g.eventId}),await this.client.core.pairing.updateMetadata({topic:h,metadata:l.metadata}),await this.client.proposal.delete(s,hW("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:h}),await this.setExpiry(y,cz(pT)),{topic:y,acknowledged:()=>Promise.resolve(this.client.session.get(y))}},this.reject=async e=>{let t;this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(e)}catch(e){throw this.client.logger.error("reject() -> isValidReject() failed"),e}let{id:r,reason:i}=e;try{t=this.client.proposal.get(r).pairingTopic}catch(e){throw this.client.logger.error(`reject() -> proposal.get(${r}) failed`),e}t&&(await this.sendError({id:r,topic:t,error:i,rpcOpts:pk.wc_sessionPropose.reject}),await this.client.proposal.delete(r,hW("USER_DISCONNECTED")))},this.update=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(e)}catch(e){throw this.client.logger.error("update() -> isValidUpdate() failed"),e}let{topic:t,namespaces:r}=e,{done:i,resolve:n,reject:s}=cU(),o=lf(),a=lc().toString(),u=this.client.session.get(t).namespaces;return this.events.once(c$("session_update",o),({error:e})=>{e?s(e):n()}),await this.client.session.update(t,{namespaces:r}),await this.sendRequest({topic:t,method:"wc_sessionUpdate",params:{namespaces:r},throwOnFailedPublish:!0,clientRpcId:o,relayRpcId:a}).catch(e=>{this.client.logger.error(e),this.client.session.update(t,{namespaces:u}),s(e)}),{acknowledged:i}},this.extend=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(e)}catch(e){throw this.client.logger.error("extend() -> isValidExtend() failed"),e}let{topic:t}=e,r=lf(),{done:i,resolve:n,reject:s}=cU();return this.events.once(c$("session_extend",r),({error:e})=>{e?s(e):n()}),await this.setExpiry(t,cz(pT)),this.sendRequest({topic:t,method:"wc_sessionExtend",params:{},clientRpcId:r,throwOnFailedPublish:!0}).catch(e=>{s(e)}),{acknowledged:i}},this.request=async e=>{this.isInitialized();try{await this.isValidRequest(e)}catch(e){throw this.client.logger.error("request() -> isValidRequest() failed"),e}let{chainId:t,request:r,topic:i,expiry:n=pk.wc_sessionRequest.req.ttl}=e,s=this.client.session.get(i);s?.transportType===lz.relay&&await this.confirmOnlineStateOrThrow();let o=lf(),a=lc().toString(),{done:u,resolve:f,reject:c}=cU(n,"Request expired. Please try again.");this.events.once(c$("session_request",o),({error:e,result:t})=>{e?c(e):f(t)});let h=this.getAppLinkIfEnabled(s.peer.metadata,s.transportType);return h?(await this.sendRequest({clientRpcId:o,relayRpcId:a,topic:i,method:"wc_sessionRequest",params:{request:pW(pG({},r),{expiryTimestamp:cz(n)}),chainId:t},expiry:n,throwOnFailedPublish:!0,appLink:h}).catch(e=>c(e)),this.client.events.emit("session_request_sent",{topic:i,request:r,chainId:t,id:o}),await u()):await Promise.all([new Promise(async e=>{await this.sendRequest({clientRpcId:o,relayRpcId:a,topic:i,method:"wc_sessionRequest",params:{request:pW(pG({},r),{expiryTimestamp:cz(n)}),chainId:t},expiry:n,throwOnFailedPublish:!0}).catch(e=>c(e)),this.client.events.emit("session_request_sent",{topic:i,request:r,chainId:t,id:o}),e()}),new Promise(async e=>{var t;if(!(null!=(t=s.sessionConfig)&&t.disableDeepLink)){let e=await cK(this.client.core.storage,pN);await cH({id:o,topic:i,wcDeepLink:e})}e()}
150),u()]).then(e=>e[2])},this.respond=async e=>{this.isInitialized(),await this.isValidRespond(e);let{topic:t,response:r}=e,{id:i}=r,n=this.client.session.get(t);n.transportType===lz.relay&&await this.confirmOnlineStateOrThrow();let s=this.getAppLinkIfEnabled(n.peer.metadata,n.transportType);l_(r)?await this.sendResult({id:i,topic:t,result:r.result,throwOnFailedPublish:!0,appLink:s}):lE(r)&&await this.sendError({id:i,topic:t,error:r.error,appLink:s}),this.cleanupAfterResponse(e)},this.ping=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(e)}catch(e){throw this.client.logger.error("ping() -> isValidPing() failed"),e}let{topic:t}=e;if(this.client.session.keys.includes(t)){let e=lf(),r=lc().toString(),{done:i,resolve:n,reject:s}=cU();this.events.once(c$("session_ping",e),({error:e})=>{e?s(e):n()}),await Promise.all([this.sendRequest({topic:t,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:e,relayRpcId:r}),i()])}else this.client.core.pairing.pairings.keys.includes(t)&&await this.client.core.pairing.ping({topic:t})},this.emit=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(e);let{topic:t,event:r,chainId:i}=e,n=lc().toString();await this.sendRequest({topic:t,method:"wc_sessionEvent",params:{event:r,chainId:i},throwOnFailedPublish:!0,relayRpcId:n})},this.disconnect=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(e);let{topic:t}=e;if(this.client.session.keys.includes(t))await this.sendRequest({topic:t,method:"wc_sessionDelete",params:hW("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:t,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(t))await this.client.core.pairing.disconnect({topic:t});else{let{message:e}=hG("MISMATCHED_TOPIC",`Session or pairing topic not found: ${t}`);throw Error(e)}},this.find=e=>(this.isInitialized(),this.client.session.getAll().filter(t=>(function(e,t){let{requiredNamespaces:r}=t,i=Object.keys(e.namespaces),n=Object.keys(r),s=!0;return!!ck(n,i)&&(i.forEach(t=>{let{accounts:i,methods:n,events:o}=e.namespaces[t],a=h$(i),u=r[t];ck(cw(t,u),a)&&ck(u.methods,n)&&ck(u.events,o)||(s=!1)}),s)})(t,e))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(e,t)=>{var r,i,n;let s;this.isInitialized(),this.isValidAuthenticate(e);let o=t&&this.client.core.linkModeSupportedApps.includes(t)&&(null==(r=this.client.metadata.redirect)?void 0:r.linkMode),a=o?lz.link_mode:lz.relay;a===lz.relay&&await this.confirmOnlineStateOrThrow();let{chains:u,statement:f="",uri:c,domain:h,nonce:l,type:d,exp:p,nbf:g,methods:m=[],expiry:b}=e,y=[...e.resources||[]],{topic:v,uri:w}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:a});this.client.logger.info({message:"Generated new pairing",pairing:{topic:v,uri:w}});let _=await this.client.core.crypto.generateKeyPair(),E=hg(_);if(await Promise.all([this.client.auth.authKeys.set(pB,{responseTopic:E,publicKey:_}),this.client.auth.pairingTopics.set(E,{topic:E,pairingTopic:v})]),await this.client.core.relayer.subscribe(E,{transportType:a}),this.client.logger.info(`sending request to new pairing topic: ${v}`),m.length>0){let{namespace:e}=cv(u[0]),t=hn(function(e,t,r,i={}){return r?.sort((e,t)=>e.localeCompare(t)),{att:{[e]:function(e,t,r={}){return Object.assign({},...(t=t?.sort((e,t)=>e.localeCompare(t))).map(t=>({[`${e}/${t}`]:[r]})))}(t,r,i)}}}(e,"request",m));hu(y)&&(i=t,n=y.pop(),t=hn(function(e,t){hi(e),hi(t);let r=Object.keys(e.att).concat(Object.keys(t.att)).sort((e,t)=>e.localeCompare(t)),i={att:{}};return r.forEach(r=>{var n,s;Object.keys((null==(n=e.att)?void 0:n[r])||{}).concat(Object.keys((null==(s=t.att)?void 0:s[r])||{})).sort((e,t)=>e.localeCompare(t)).forEach(n=>{var s,o;i.att[r]=c8(c5({},i.att[r]),{[n]:(null==(s=e.att[r])?void 0:s[n])||(null==(o=t.att[r])?void 0:o[n])})})}),i}(hs(i),hs(n)))),y.push(t)}let x=b&&b>pk.wc_sessionAuthenticate.req.ttl?b:pk.wc_sessionAuthenticate.req.ttl,S={authPayload:{type:d??"caip122",chains:u,statement:f,aud:c,domain:h,version:"1",nonce:l,iat:new Date().toISOString(),exp:p,nbf:g,resources:y},requester:{publicKey:_,metadata:this.client.metadata},expiryTimestamp:cz(x)},M={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:u,methods:[...new Set(["personal_sign",...m])],events:["chainChanged","accountsChanged"]}},relays:[{protocol:"irn"}],pairingTopic:v,proposer:{publicKey:_,metadata:this.client.metadata},expiryTimestamp:cz(pk.wc_sessionPropose.req.ttl)},{done:I,resolve:A,reject:R}=cU(x,"Request expired"),D=async({error:e,session:t})=>{if(this.events.off(c$("session_request",P),O),e)R(e);else if(t){t.self.publicKey=_,await this.client.session.set(t.topic,t),await this.setExpiry(t.topic,t.expiry),v&&await this.client.core.pairing.updateMetadata({topic:v,metadata:t.peer.metadata});let e=this.client.session.get(t.topic);await this.deleteProposal(N),A({session:e})}},O=async e=>{var r,i,n;let s;if(await this.deletePendingAuthRequest(P,{message:"fulfilled",code:0}),e.error){let t=hW("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return e.error.code===t.code?void 0:(this.events.off(c$("session_connect"),D),R(e.error.message))}await this.deleteProposal(N),this.events.off(c$("session_connect"),D);let{cacaos:o,responder:u}=e.result,f=[],c=[];for(let e of o){await ht({cacao:e,projectId:this.client.core.projectId})||(this.client.logger.error(e,"Signature verification failed"),R(hW("SESSION_SETTLEMENT_FAILED","Signature verification failed")));let{p:t}=e,r=hu(t.resources),i=[c7(t.iss)],n=he(t.iss);if(r){let e=ho(r),t=ha(r);f.push(...e),i.push(...t)}for(let e of i)c.push(`${e}:${n}`)}let h=await this.client.core.crypto.generateSharedKey(_,u.publicKey);f.length>0&&(s={topic:h,acknowledged:!0,self:{publicKey:_,metadata:this.client.metadata},peer:u,controller:u.publicKey,expiry:cz(pT),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:v,namespaces:hH([...new Set(f)],[...new Set(c)]),transportType:a},await this.client.core.relayer.subscribe(h,{transportType:a}),await this.client.session.set(h,s),v&&await this.client.core.pairing.updateMetadata({topic:v,metadata:u.metadata}),s=this.client.session.get(h)),null!=(r=this.client.metadata.redirect)&&r.linkMode&&null!=(i=u.metadata.redirect)&&i.linkMode&&null!=(n=u.metadata.redirect)&&n.universal&&t&&(this.client.core.addLinkModeSupportedApp(u.metadata.redirect.universal),this.client.session.update(h,{transportType:lz.link_mode})),A({auths:o,session:s})},P=lf(),N=lf();this.events.once(c$("session_connect"),D),this.events.once(c$("session_request",P),O);try{if(o){let e=lh("wc_sessionAuthenticate",S,P);this.client.core.history.set(v,e);let r=await this.client.core.crypto.encode("",e,{type:2,encoding:hl});s=hC(t,v,r)}else await Promise.all([this.sendRequest({topic:v,method:"wc_sessionAuthenticate",params:S,expiry:e.expiry,throwOnFailedPublish:!0,clientRpcId:P}),this.sendRequest({topic:v,method:"wc_sessionPropose",params:M,expiry:pk.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:N})])}catch(e){throw this.events.off(c$("session_connect"),D),this.events.off(c$("session_request",P),O),e}return await this.setProposal(N,pG({id:N},M)),await this.setAuthRequest(P,{request:pW(pG({},S),{verifyContext:{}}),pairingTopic:v,transportType:a}),{uri:s??w,response:I}},this.approveSessionAuthenticate=async e=>{let t;let{id:r,auths:i}=e,n=this.client.core.eventClient.createEvent({properties:{topic:r.toString(),trace:[l2.authenticated_session_approve_started]}});try{this.isInitialized()}catch(e){throw n.setError(l6.no_internet_connection),e}let s=this.getPendingAuthRequest(r);if(!s)throw n.setError(l6.authenticated_session_pending_request_not_found),Error(`Could not find pending auth request with id ${r}`);let o=s.transportType||lz.relay;o===lz.relay&&await this.confirmOnlineStateOrThrow();let a=s.requester.publicKey,u=await this.client.core.crypto.generateKeyPair(),f=hg(a),c={type:1,receiverPublicKey:a,senderPublicKey:u},h=[],l=[];for(let e of i){if(!await ht({cacao:e,projectId:this.client.core.projectId})){n.setError(l6.invalid_cacao);let e=hW("SESSION_SETTLEMENT_FAILED","Signature verification failed");
150throw await this.sendError({id:r,topic:f,error:e,encodeOpts:c}),Error(e.message)}n.addTrace(l2.cacaos_verified);let{p:t}=e,i=hu(t.resources),s=[c7(t.iss)],o=he(t.iss);if(i){let e=ho(i),t=ha(i);h.push(...e),s.push(...t)}for(let e of s)l.push(`${e}:${o}`)}let d=await this.client.core.crypto.generateSharedKey(u,a);if(n.addTrace(l2.create_authenticated_session_topic),h?.length>0){t={topic:d,acknowledged:!0,self:{publicKey:u,metadata:this.client.metadata},peer:{publicKey:a,metadata:s.requester.metadata},controller:a,expiry:cz(pT),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:s.pairingTopic,namespaces:hH([...new Set(h)],[...new Set(l)]),transportType:o},n.addTrace(l2.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(d,{transportType:o})}catch(e){throw n.setError(l6.subscribe_authenticated_session_topic_failure),e}n.addTrace(l2.subscribe_authenticated_session_topic_success),await this.client.session.set(d,t),n.addTrace(l2.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:s.pairingTopic,metadata:s.requester.metadata})}n.addTrace(l2.publishing_authenticated_session_approve);try{await this.sendResult({topic:f,id:r,result:{cacaos:i,responder:{publicKey:u,metadata:this.client.metadata}},encodeOpts:c,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(s.requester.metadata,o)})}catch(e){throw n.setError(l6.authenticated_session_approve_publish_failure),e}return await this.client.auth.requests.delete(r,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:s.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:n.eventId}),{session:t}},this.rejectSessionAuthenticate=async e=>{this.isInitialized();let{id:t,reason:r}=e,i=this.getPendingAuthRequest(t);if(!i)throw Error(`Could not find pending auth request with id ${t}`);i.transportType===lz.relay&&await this.confirmOnlineStateOrThrow();let n=i.requester.publicKey,s=await this.client.core.crypto.generateKeyPair(),o=hg(n);await this.sendError({id:t,topic:o,error:r,encodeOpts:{type:1,receiverPublicKey:n,senderPublicKey:s},rpcOpts:pk.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(i.requester.metadata,i.transportType)}),await this.client.auth.requests.delete(t,{message:"rejected",code:0}),await this.client.proposal.delete(t,hW("USER_DISCONNECTED"))},this.formatAuthMessage=e=>{this.isInitialized();let{request:t,iss:r}=e;return hr(t,r)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(0!==this.relayMessageCache.length)for(;this.relayMessageCache.length>0;)try{let e=this.relayMessageCache.shift();e&&await this.onRelayMessage(e)}catch(e){this.client.logger.error(e)}},50)},this.cleanupDuplicatePairings=async e=>{if(e.pairingTopic)try{let t=this.client.core.pairing.pairings.get(e.pairingTopic),r=this.client.core.pairing.pairings.getAll().filter(r=>{var i,n;return(null==(i=r.peerMetadata)?void 0:i.url)&&(null==(n=r.peerMetadata)?void 0:n.url)===e.peer.metadata.url&&r.topic&&r.topic!==t.topic});if(0===r.length)return;this.client.logger.info(`Cleaning up ${r.length} duplicate pairing(s)`),await Promise.all(r.map(e=>this.client.core.pairing.disconnect({topic:e.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(e){this.client.logger.error(e)}},this.deleteSession=async e=>{var t;let{topic:r,expirerHasDeleted:i=!1,emitEvent:n=!0,id:s=0}=e,{self:o}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await this.client.session.delete(r,hW("USER_DISCONNECTED")),this.addToRecentlyDeleted(r,"session"),this.client.core.crypto.keychain.has(o.publicKey)&&await this.client.core.crypto.deleteKeyPair(o.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),i||this.client.core.expirer.del(r),this.client.core.storage.removeItem(pN).catch(e=>this.client.logger.warn(e)),this.getPendingSessionRequests().forEach(e=>{e.topic===r&&this.deletePendingSessionRequest(e.id,hW("USER_DISCONNECTED"))}),r===(null==(t=this.sessionRequestQueue.queue[0])?void 0:t.topic)&&(this.sessionRequestQueue.state=pL.idle),n&&this.client.events.emit("session_delete",{id:s,topic:r})},this.deleteProposal=async(e,t)=>{if(t)try{let t=this.client.proposal.get(e),r=this.client.core.eventClient.getEvent({topic:t.pairingTopic});r?.setError(l1.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(e,hW("USER_DISCONNECTED")),t?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"proposal")},this.deletePendingSessionRequest=async(e,t,r=!1)=>
150{await Promise.all([this.client.pendingRequest.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(t=>t.id!==e),r&&(this.sessionRequestQueue.state=pL.idle,this.client.events.emit("session_request_expire",{id:e}))},this.deletePendingAuthRequest=async(e,t,r=!1)=>{await Promise.all([this.client.auth.requests.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)])},this.setExpiry=async(e,t)=>{this.client.session.keys.includes(e)&&(this.client.core.expirer.set(e,t),await this.client.session.update(e,{expiry:t}))},this.setProposal=async(e,t)=>{this.client.core.expirer.set(e,cz(pk.wc_sessionPropose.req.ttl)),await this.client.proposal.set(e,t)},this.setAuthRequest=async(e,t)=>{let{request:r,pairingTopic:i,transportType:n=lz.relay}=t;this.client.core.expirer.set(e,r.expiryTimestamp),await this.client.auth.requests.set(e,{authPayload:r.authPayload,requester:r.requester,expiryTimestamp:r.expiryTimestamp,id:e,pairingTopic:i,verifyContext:r.verifyContext,transportType:n})},this.setPendingSessionRequest=async e=>{let{id:t,topic:r,params:i,verifyContext:n}=e,s=i.request.expiryTimestamp||cz(pk.wc_sessionRequest.req.ttl);this.client.core.expirer.set(t,s),await this.client.pendingRequest.set(t,{id:t,topic:r,params:i,verifyContext:n})},this.sendRequest=async e=>{let t,i;let{topic:n,method:s,params:o,expiry:a,relayRpcId:u,clientRpcId:f,throwOnFailedPublish:c,appLink:h}=e,l=lh(s,o,f),d=!!h;try{let e=d?hl:hh;t=await this.client.core.crypto.encode(n,l,{encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),e}if(pU.includes(s)){let e=hm(JSON.stringify(l)),r=hm(t);i=await this.client.core.verify.register({id:r,decryptedId:e})}let p=pk[s].req;if(p.attestation=i,a&&(p.ttl=a),u&&(p.id=u),this.client.core.history.set(n,l),d){let e=hC(h,n,t);await r.g.Linking.openURL(e,this.client.name)}else{let e=pk[s].req;a&&(e.ttl=a),u&&(e.id=u),c?(e.internal=pW(pG({},e.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,t,e)):this.client.core.relayer.publish(n,t,e).catch(e=>this.client.logger.error(e))}return l.id},this.sendResult=async e=>{let t,i;let{id:n,topic:s,result:o,throwOnFailedPublish:a,encodeOpts:u,appLink:f}=e,c=ll(n,o),h=f&&"u">typeof(null==r.g?void 0:r.g.Linking);try{let e=h?hl:hh;t=await this.client.core.crypto.encode(s,c,pW(pG({},u||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${s} failed`),e}try{i=await this.client.core.history.get(s,n)}catch(e){throw this.client.logger.error(`sendResult() -> history.get(${s}, ${n}) failed`),e}if(h){let e=hC(f,s,t);await r.g.Linking.openURL(e,this.client.name)}else{let e=pk[i.request.method].res;a?(e.internal=pW(pG({},e.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(s,t,e)):this.client.core.relayer.publish(s,t,e).catch(e=>this.client.logger.error(e))}await this.client.core.history.resolve(c)},this.sendError=async e=>{let t,i;let{id:n,topic:s,error:o,encodeOpts:a,rpcOpts:u,appLink:f}=e,c=ld(n,o),h=f&&"u">typeof(null==r.g?void 0:r.g.Linking);try{let e=h?hl:hh;t=await this.client.core.crypto.encode(s,c,pW(pG({},a||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${s} failed`),e}try{i=await this.client.core.history.get(s,n)}catch(e){throw this.client.logger.error(`sendError() -> history.get(${s}, ${n}) failed`),e}if(h){let e=hC(f,s,t);await r.g.Linking.openURL(e,this.client.name)}else{let e=u||pk[i.request.method].res;this.client.core.relayer.publish(s,t,e)}await this.client.core.history.resolve(c)},this.cleanup=async()=>{let e=[],t=[];this.client.session.getAll().forEach(t=>{let r=!1;cF(t.expiry)&&(r=!0),this.client.core.crypto.keychain.has(t.topic)||(r=!0),r&&e.push(t.topic)}),this.client.proposal.getAll().forEach(e=>{cF(e.expiryTimestamp)&&t.push(e.id)}),await Promise.all([...e.map(e=>this.deleteSession({topic:e})),...t.map(e=>this.deleteProposal(e))])},this.onRelayEventRequest=async e=>{this.requestQueue.queue.push(e),await this.processRequestsQueue()},this.processRequestsQueue=async()=>
150{if(this.requestQueue.state===pL.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=pL.active;let e=this.requestQueue.queue.shift();if(e)try{await this.processRequest(e)}catch(e){this.client.logger.warn(e)}}this.requestQueue.state=pL.idle},this.processRequest=async e=>{let{topic:t,payload:r,attestation:i,transportType:n,encryptedId:s}=e,o=r.method;if(!this.shouldIgnorePairingRequest({topic:t,requestMethod:o}))switch(o){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:t,payload:r,attestation:i,encryptedId:s});case"wc_sessionSettle":return await this.onSessionSettleRequest(t,r);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(t,r);case"wc_sessionExtend":return await this.onSessionExtendRequest(t,r);case"wc_sessionPing":return await this.onSessionPingRequest(t,r);case"wc_sessionDelete":return await this.onSessionDeleteRequest(t,r);case"wc_sessionRequest":return await this.onSessionRequest({topic:t,payload:r,attestation:i,encryptedId:s,transportType:n});case"wc_sessionEvent":return await this.onSessionEventRequest(t,r);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:t,payload:r,attestation:i,encryptedId:s,transportType:n});default:return this.client.logger.info(`Unsupported request method ${o}`)}},this.onRelayEventResponse=async e=>{let{topic:t,payload:r,transportType:i}=e,n=(await this.client.core.history.get(t,r.id)).request.method;switch(n){case"wc_sessionPropose":return this.onSessionProposeResponse(t,r,i);case"wc_sessionSettle":return this.onSessionSettleResponse(t,r);case"wc_sessionUpdate":return this.onSessionUpdateResponse(t,r);case"wc_sessionExtend":return this.onSessionExtendResponse(t,r);case"wc_sessionPing":return this.onSessionPingResponse(t,r);case"wc_sessionRequest":return this.onSessionRequestResponse(t,r);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(t,r);default:return this.client.logger.info(`Unsupported response method ${n}`)}},this.onRelayEventUnknownPayload=e=>{let{topic:t}=e,{message:r}=hG("MISSING_OR_INVALID",`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw Error(r)},this.shouldIgnorePairingRequest=e=>{let{topic:t,requestMethod:r}=e,i=this.expectedPairingMethodMap.get(t);return!(!i||i.includes(r))&&!!(i.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async e=>{let{topic:t,payload:r,attestation:i,encryptedId:n}=e,{params:s,id:o}=r;try{let e=this.client.core.eventClient.getEvent({topic:t});this.isValidConnect(pG({},r.params));let a=s.expiryTimestamp||cz(pk.wc_sessionPropose.req.ttl),u=pG({id:o,pairingTopic:t,expiryTimestamp:a},s);await this.setProposal(o,u);let f=await this.getVerifyContext({attestationId:i,hash:hm(JSON.stringify(r)),encryptedId:n,metadata:u.proposer.metadata});0===this.client.events.listenerCount("session_proposal")&&(console.warn("No listener for session_proposal event"),e?.setError(lQ.proposal_listener_not_found)),e?.addTrace(lZ.emit_session_proposal),this.client.events.emit("session_proposal",{id:o,params:u,verifyContext:f})}catch(e){await this.sendError({id:o,topic:t,error:e,rpcOpts:pk.wc_sessionPropose.autoReject}),this.client.logger.error(e)}},this.onSessionProposeResponse=async(e,t,r)=>{let{id:i}=t;if(l_(t)){let{result:n}=t;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:n});let s=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:s});let o=s.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:o});let a=n.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:a});let u=await this.client.core.crypto.generateSharedKey(o,a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:u});let f=await this.client.core.relayer.subscribe(u,{transportType:r});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:f}),await this.client.core.pairing.activate({topic:e})}else if(lE(t)){await this.client.proposal.delete(i,hW("USER_DISCONNECTED"));let e=c$("session_connect");
150if(0===this.events.listenerCount(e))throw Error(`emitting ${e} without any listeners, 954`);this.events.emit(c$("session_connect"),{error:t.error})}},this.onSessionSettleRequest=async(e,t)=>{let{id:r,params:i}=t;try{this.isValidSessionSettleRequest(i);let{relay:r,controller:n,expiry:s,namespaces:o,sessionProperties:a,sessionConfig:u}=t.params,f=pW(pG(pG({topic:e,relay:r,expiry:s,namespaces:o,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:n.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:n.publicKey,metadata:n.metadata}},a&&{sessionProperties:a}),u&&{sessionConfig:u}),{transportType:lz.relay}),c=c$("session_connect");if(0===this.events.listenerCount(c))throw Error(`emitting ${c} without any listeners 997`);this.events.emit(c$("session_connect"),{session:f}),await this.sendResult({id:t.id,topic:e,result:!0,throwOnFailedPublish:!0})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionSettleResponse=async(e,t)=>{let{id:r}=t;l_(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(c$("session_approve",r),{})):lE(t)&&(await this.client.session.delete(e,hW("USER_DISCONNECTED")),this.events.emit(c$("session_approve",r),{error:t.error}))},this.onSessionUpdateRequest=async(e,t)=>{let{params:r,id:i}=t;try{let t=`${e}_session_update`,n=lr.get(t);if(n&&this.isRequestOutOfSync(n,i)){this.client.logger.info(`Discarding out of sync request - ${i}`),this.sendError({id:i,topic:e,error:hW("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(pG({topic:e},r));try{lr.set(t,i),await this.client.session.update(e,{namespaces:r.namespaces}),await this.sendResult({id:i,topic:e,result:!0,throwOnFailedPublish:!0})}catch(e){throw lr.delete(t),e}this.client.events.emit("session_update",{id:i,topic:e,params:r})}catch(t){await this.sendError({id:i,topic:e,error:t}),this.client.logger.error(t)}},this.isRequestOutOfSync=(e,t)=>parseInt(t.toString().slice(0,-3))<=parseInt(e.toString().slice(0,-3)),this.onSessionUpdateResponse=(e,t)=>{let{id:r}=t,i=c$("session_update",r);if(0===this.events.listenerCount(i))throw Error(`emitting ${i} without any listeners`);l_(t)?this.events.emit(c$("session_update",r),{}):lE(t)&&this.events.emit(c$("session_update",r),{error:t.error})},this.onSessionExtendRequest=async(e,t)=>{let{id:r}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,cz(pT)),await this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionExtendResponse=(e,t)=>{let{id:r}=t,i=c$("session_extend",r);if(0===this.events.listenerCount(i))throw Error(`emitting ${i} without any listeners`);l_(t)?this.events.emit(c$("session_extend",r),{}):lE(t)&&this.events.emit(c$("session_extend",r),{error:t.error})},this.onSessionPingRequest=async(e,t)=>{let{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionPingResponse=(e,t)=>{let{id:r}=t,i=c$("session_ping",r);if(0===this.events.listenerCount(i))throw Error(`emitting ${i} without any listeners`);setTimeout(()=>{l_(t)?this.events.emit(c$("session_ping",r),{}):lE(t)&&this.events.emit(c$("session_ping",r),{error:t.error})},500)},this.onSessionDeleteRequest=async(e,t)=>{let{id:r}=t;try{this.isValidDisconnect({topic:e,reason:t.params}),Promise.all([new Promise(t=>{this.client.core.relayer.once(lj.publish,async()=>{t(await this.deleteSession({topic:e,id:r}))})}),this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:e,error:hW("USER_DISCONNECTED")})]).catch(e=>this.client.logger.error(e))}catch(e){this.client.logger.error(e)}},this.onSessionRequest=async e=>{var t,r,i;let{topic:n,payload:s,attestation:o,encryptedId:a,transportType:u}=e,{id:f,params:c}=s;try{await this.isValidRequest(pG({topic:n},c));let e=this.client.session.get(n),s=await this.getVerifyContext({attestationId:o,hash:hm(JSON.stringify(lh("wc_sessionRequest",c,f))),encryptedId:a,metadata:e.peer.metadata,transportType:u}),h={id:f,topic:n,params:c,verifyContext:s};await this.setPendingSessionRequest(h),u===lz.link_mode&&null!=(t=e.peer.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(null==(r=e.peer.metadata.redirect)?void 0:r.universal),null!=(i=this.client.signConfig)&&i.disableRequestQueue?this.emitSessionRequest(h):(this.addSessionRequestToSessionRequestQueue(h),this.processSessionRequestQueue())}
150catch(e){await this.sendError({id:f,topic:n,error:e}),this.client.logger.error(e)}},this.onSessionRequestResponse=(e,t)=>{let{id:r}=t,i=c$("session_request",r);if(0===this.events.listenerCount(i))throw Error(`emitting ${i} without any listeners`);l_(t)?this.events.emit(c$("session_request",r),{result:t.result}):lE(t)&&this.events.emit(c$("session_request",r),{error:t.error})},this.onSessionEventRequest=async(e,t)=>{let{id:r,params:i}=t;try{let t=`${e}_session_event_${i.event.name}`,n=lr.get(t);if(n&&this.isRequestOutOfSync(n,r)){this.client.logger.info(`Discarding out of sync request - ${r}`);return}this.isValidEmit(pG({topic:e},i)),this.client.events.emit("session_event",{id:r,topic:e,params:i}),lr.set(t,r)}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionAuthenticateResponse=(e,t)=>{let{id:r}=t;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:e,payload:t}),l_(t)?this.events.emit(c$("session_request",r),{result:t.result}):lE(t)&&this.events.emit(c$("session_request",r),{error:t.error})},this.onSessionAuthenticateRequest=async e=>{var t;let{topic:r,payload:i,attestation:n,encryptedId:s,transportType:o}=e;try{let{requester:e,authPayload:a,expiryTimestamp:u}=i.params,f=await this.getVerifyContext({attestationId:n,hash:hm(JSON.stringify(i)),encryptedId:s,metadata:e.metadata,transportType:o}),c={requester:e,pairingTopic:r,id:i.id,authPayload:a,verifyContext:f,expiryTimestamp:u};await this.setAuthRequest(i.id,{request:c,pairingTopic:r,transportType:o}),o===lz.link_mode&&null!=(t=e.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(e.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:r,params:i.params,id:i.id,verifyContext:f})}catch(s){this.client.logger.error(s);let e=i.params.requester.publicKey,t=await this.client.core.crypto.generateKeyPair(),n=this.getAppLinkIfEnabled(i.params.requester.metadata,o);await this.sendError({id:i.id,topic:r,error:s,encodeOpts:{type:1,receiverPublicKey:e,senderPublicKey:t},rpcOpts:pk.wc_sessionAuthenticate.autoReject,appLink:n})}},this.addSessionRequestToSessionRequestQueue=e=>{this.sessionRequestQueue.queue.push(e)},this.cleanupAfterResponse=e=>{this.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=pL.idle,this.processSessionRequestQueue()},(0,s2.toMiliseconds)(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:e,error:t})=>{let r=this.client.core.history.pending;r.length>0&&r.filter(t=>t.topic===e&&"wc_sessionRequest"===t.request.method).forEach(e=>{let r=c$("session_request",e.request.id);if(0===this.events.listenerCount(r))throw Error(`emitting ${r} without any listeners`);this.events.emit(c$("session_request",e.request.id),{error:t})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===pL.active){this.client.logger.info("session request queue is already active.");return}let e=this.sessionRequestQueue.queue[0];if(!e){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=pL.active,this.emitSessionRequest(e)}catch(e){this.client.logger.error(e)}},this.emitSessionRequest=e=>{this.client.events.emit("session_request",e)},this.onPairingCreated=e=>{if(e.methods&&this.expectedPairingMethodMap.set(e.topic,e.methods),e.active)return;let t=this.client.proposal.getAll().find(t=>t.pairingTopic===e.topic);
150t&&this.onSessionProposeRequest({topic:e.topic,payload:lh("wc_sessionPropose",{requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces,relays:t.relays,proposer:t.proposer,sessionProperties:t.sessionProperties},t.id)})},this.isValidConnect=async e=>{if(!h5(e)){let{message:t}=hG("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(e)}`);throw Error(t)}let{pairingTopic:t,requiredNamespaces:r,optionalNamespaces:i,sessionProperties:n,relays:s}=e;if(hY(t)||await this.isValidPairingTopic(t),!function(e,t){let r=!1;return t&&!e?r=!0:e&&hJ(e)&&e.length&&e.forEach(e=>{r=h3(e)}),r}(s,!0)){let{message:e}=hG("MISSING_OR_INVALID",`connect() relays: ${s}`);throw Error(e)}hY(r)||0===hX(r)||this.validateNamespaces(r,"requiredNamespaces"),hY(i)||0===hX(i)||this.validateNamespaces(i,"optionalNamespaces"),hY(n)||this.validateSessionProps(n,"sessionProperties")},this.validateNamespaces=(e,t)=>{let r=function(e,t,r){let i=null;if(e&&hX(e)){let n;let s=h2(e,t);s&&(i=s);let o=(n=null,Object.entries(e).forEach(([e,i])=>{var s,o;let a;if(n)return;let u=(s=cw(e,i),o=`${t} ${r}`,a=null,hJ(s)&&s.length?s.forEach(e=>{a||h0(e)||(a=hW("UNSUPPORTED_CHAINS",`${o}, chain ${e} should be a string and conform to "namespace:chainId" format`))}):h0(e)||(a=hW("UNSUPPORTED_CHAINS",`${o}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),a);u&&(n=u)}),n);o&&(i=o)}else i=hG("MISSING_OR_INVALID",`${t}, ${r} should be an object with data`);return i}(e,"connect()",t);if(r)throw Error(r.message)},this.isValidApprove=async e=>{if(!h5(e))throw Error(hG("MISSING_OR_INVALID",`approve() params: ${e}`).message);let{id:t,namespaces:r,relayProtocol:i,sessionProperties:n}=e;this.checkRecentlyDeleted(t),await this.isValidProposalId(t);let s=this.client.proposal.get(t),o=h6(r,"approve()");if(o)throw Error(o.message);let a=h4(s.requiredNamespaces,r,"approve()");if(a)throw Error(a.message);if(!hZ(i,!0)){let{message:e}=hG("MISSING_OR_INVALID",`approve() relayProtocol: ${i}`);throw Error(e)}hY(n)||this.validateSessionProps(n,"sessionProperties")},this.isValidReject=async e=>{if(!h5(e)){let{message:t}=hG("MISSING_OR_INVALID",`reject() params: ${e}`);throw Error(t)}let{id:t,reason:r}=e;if(this.checkRecentlyDeleted(t),await this.isValidProposalId(t),!function(e){return!(!e||"object"!=typeof e||!e.code||!hQ(e.code,!1)||!e.message||!hZ(e.message,!1))}(r)){let{message:e}=hG("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(r)}`);throw Error(e)}},this.isValidSessionSettleRequest=e=>{if(!h5(e)){let{message:t}=hG("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${e}`);throw Error(t)}
150let{relay:t,controller:r,namespaces:i,expiry:n}=e;if(!h3(t)){let{message:e}=hG("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw Error(e)}let s=function(e,t){let r=null;return hZ(e?.publicKey,!1)||(r=hG("MISSING_OR_INVALID",`${t} controller public key should be a string`)),r}(r,"onSessionSettleRequest()");if(s)throw Error(s.message);let o=h6(i,"onSessionSettleRequest()");if(o)throw Error(o.message);if(cF(n)){let{message:e}=hG("EXPIRED","onSessionSettleRequest()");throw Error(e)}},this.isValidUpdate=async e=>{if(!h5(e)){let{message:t}=hG("MISSING_OR_INVALID",`update() params: ${e}`);throw Error(t)}let{topic:t,namespaces:r}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let i=this.client.session.get(t),n=h6(r,"update()");if(n)throw Error(n.message);let s=h4(i.requiredNamespaces,r,"update()");if(s)throw Error(s.message)},this.isValidExtend=async e=>{if(!h5(e)){let{message:t}=hG("MISSING_OR_INVALID",`extend() params: ${e}`);throw Error(t)}let{topic:t}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t)},this.isValidRequest=async e=>{if(!h5(e)){let{message:t}=hG("MISSING_OR_INVALID",`request() params: ${e}`);throw Error(t)}let{topic:t,request:r,chainId:i,expiry:n}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let{namespaces:s}=this.client.session.get(t);if(!h8(s,i)){let{message:e}=hG("MISSING_OR_INVALID",`request() chainId: ${i}`);throw Error(e)}if(!function(e){return!(hY(e)||!hZ(e.method,!1))}(r)){let{message:e}=hG("MISSING_OR_INVALID",`request() ${JSON.stringify(r)}`);throw Error(e)}if(!function(e,t,r){return!!hZ(r,!1)&&(function(e,t){let r=[];return Object.values(e).forEach(e=>{h$(e.accounts).includes(t)&&r.push(...e.methods)}),r})(e,t).includes(r)}(s,i,r.method)){let{message:e}=hG("MISSING_OR_INVALID",`request() method: ${r.method}`);throw Error(e)}if(n&&!function(e,t){return hQ(e,!1)&&e<=t.max&&e>=t.min}(n,pC)){let{message:e}=hG("MISSING_OR_INVALID",`request() expiry: ${n}. Expiry must be a number (in seconds) between ${pC.min} and ${pC.max}`);throw Error(e)}},this.isValidRespond=async e=>{var t;if(!h5(e)){let{message:t}=hG("MISSING_OR_INVALID",`respond() params: ${e}`);throw Error(t)}let{topic:r,response:i}=e;try{await this.isValidSessionTopic(r)}catch(r){throw null!=(t=e?.response)&&t.id&&this.cleanupAfterResponse(e),r}if(!function(e){return!(hY(e)||hY(e.result)&&hY(e.error)||!hQ(e.id,!1)||!hZ(e.jsonrpc,!1))}(i)){let{message:e}=hG("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw Error(e)}},this.isValidPing=async e=>{if(!h5(e)){let{message:t}=hG("MISSING_OR_INVALID",`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidEmit=async e=>{if(!h5(e)){let{message:t}=hG("MISSING_OR_INVALID",`emit() params: ${e}`);throw Error(t)}let{topic:t,event:r,chainId:i}=e;await this.isValidSessionTopic(t);let{namespaces:n}=this.client.session.get(t);if(!h8(n,i)){let{message:e}=hG("MISSING_OR_INVALID",`emit() chainId: ${i}`);throw Error(e)}if(!function(e){return!(hY(e)||!hZ(e.name,!1))}(r)||!function(e,t,r){return!!hZ(r,!1)&&(function(e,t){let r=[];return Object.values(e).forEach(e=>{h$(e.accounts).includes(t)&&r.push(...e.events)}),r})(e,t).includes(r)}(n,i,r.name)){let{message:e}=hG("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw Error(e)}},this.isValidDisconnect=async e=>{if(!h5(e)){let{message:t}=hG("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidAuthenticate=e=>{let{chains:t,uri:r,domain:i,nonce:n}=e;if(!Array.isArray(t)||0===t.length)throw Error("chains is required and must be a non-empty array");if(!hZ(r,!1))throw Error("uri is required parameter");if(!hZ(i,!1))throw Error("domain is required parameter");if(!hZ(n,!1))throw Error("nonce is required parameter");if([...new Set(t.map(e=>cv(e).namespace))].length>1)throw Error("Multi-namespace requests are not supported. Please request single namespace only.");let{namespace:s}=cv(t[0]);if("eip155"!==s)throw Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async e=>{let{attestationId:t,hash:r,encryptedId:i,metadata:n,transportType:s}=e,o={verified:{verifyUrl:n.verifyUrl||lJ,validation:"UNKNOWN",origin:n.url||""}};try{if(s===lz.link_mode){let e=this.getAppLinkIfEnabled(n,s);return o.verified.validation=e&&new URL(e).origin===new URL(n.url).origin?"VALID":"INVALID",o}let e=await this.client.core.verify.resolve({attestationId:t,hash:r,encryptedId:i,verifyUrl:n.verifyUrl});e&&(o.verified.origin=e.origin,o.verified.isScam=e.isScam,o.verified.validation=e.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(e){this.client.logger.warn(e)}return this.client.logger.debug(`Verify context: ${JSON.stringify(o)}`),o},this.validateSessionProps=(e,t)=>
150{Object.values(e).forEach(e=>{if(!hZ(e,!1)){let{message:r}=hG("MISSING_OR_INVALID",`${t} must be in Record<string, string> format. Received: ${JSON.stringify(e)}`);throw Error(r)}})},this.getPendingAuthRequest=e=>{let t=this.client.auth.requests.get(e);return"object"==typeof t?t:void 0},this.addToRecentlyDeleted=(e,t)=>{if(this.recentlyDeletedMap.set(e,t),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let e=0,t=this.recentlyDeletedLimit/2;for(let r of this.recentlyDeletedMap.keys()){if(e++>=t)break;this.recentlyDeletedMap.delete(r)}}},this.checkRecentlyDeleted=e=>{let t=this.recentlyDeletedMap.get(e);if(t){let{message:r}=hG("MISSING_OR_INVALID",`Record was recently deleted - ${t}: ${e}`);throw Error(r)}},this.isLinkModeEnabled=(e,t)=>{var i,n,s,o,a,u,f,c,h;return!!e&&t===lz.link_mode&&(null==(n=null==(i=this.client.metadata)?void 0:i.redirect)?void 0:n.linkMode)===!0&&(null==(o=null==(s=this.client.metadata)?void 0:s.redirect)?void 0:o.universal)!==void 0&&(null==(u=null==(a=this.client.metadata)?void 0:a.redirect)?void 0:u.universal)!==""&&(null==(f=e?.redirect)?void 0:f.universal)!==void 0&&(null==(c=e?.redirect)?void 0:c.universal)!==""&&(null==(h=e?.redirect)?void 0:h.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(e.redirect.universal)&&"u">typeof(null==r.g?void 0:r.g.Linking)},this.getAppLinkIfEnabled=(e,t)=>{var r;return this.isLinkModeEnabled(e,t)?null==(r=e?.redirect)?void 0:r.universal:void 0},this.handleLinkModeMessage=({url:e})=>{if(!e||!e.includes("wc_ev")||!e.includes("topic"))return;let t=cV(e,"topic")||"",r=decodeURIComponent(cV(e,"wc_ev")||""),i=this.client.session.keys.includes(t);i&&this.client.session.update(t,{transportType:lz.link_mode}),this.client.core.dispatchEnvelope({topic:t,message:r,sessionExists:i})},this.registerLinkModeListeners=async()=>{var e;if(cW()||cD()&&null!=(e=this.client.metadata.redirect)&&e.linkMode){let e=null==r.g?void 0:r.g.Linking;if("u">typeof e){e.addEventListener("url",this.handleLinkModeMessage,this.client.name);let t=await e.getInitialURL();t&&setTimeout(()=>{this.handleLinkModeMessage({url:t})},50)}}}}isInitialized(){if(!this.initialized){let{message:e}=hG("NOT_INITIALIZED",this.name);throw Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(lj.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){let{topic:t,message:r,attestation:i,transportType:n}=e,{publicKey:s}=this.client.auth.authKeys.keys.includes(pB)?this.client.auth.authKeys.get(pB):{responseTopic:void 0,publicKey:void 0},o=await this.client.core.crypto.decode(t,r,{receiverPublicKey:s,encoding:n===lz.link_mode?hl:hh});try{lv(o)?(this.client.core.history.set(t,o),this.onRelayEventRequest({topic:t,payload:o,attestation:i,transportType:n,encryptedId:hm(r)})):lw(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:t,payload:o,transportType:n}),this.client.core.history.delete(t,o.id)):this.onRelayEventUnknownPayload({topic:t,payload:o,transportType:n})}catch(e){this.client.logger.error(e)}}registerExpirerEvents(){this.client.core.expirer.on(lW.expired,async e=>{let{topic:t,id:r}=cq(e.target);return r&&this.client.pendingRequest.keys.includes(r)?await this.deletePendingSessionRequest(r,hG("EXPIRED"),!0):r&&this.client.auth.requests.keys.includes(r)?await this.deletePendingAuthRequest(r,hG("EXPIRED"),!0):void(t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r})))})}registerPairingEvents(){this.client.core.pairing.events.on(lV.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(lV.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!hZ(e,!1)){let{message:t}=hG("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){let{message:t}=hG("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw Error(t)}if(cF(this.client.core.pairing.pairings.get(e).expiry)){let{message:t}=hG("EXPIRED",`pairing topic: ${e}`);throw Error(t)}}async isValidSessionTopic(e){if(!hZ(e,!1)){let{message:t}=hG("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){let{message:t}=hG("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw Error(t)}if(cF(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});let{message:t}=hG("EXPIRED",`session topic: ${e}`);throw Error(t)}if(!this.client.core.crypto.keychain.has(e)){let{message:t}=hG("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(hZ(e,!1)){let{message:t}=hG("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw Error(t)}else{let{message:t}=hG("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw Error(t)}}async isValidProposalId(e){if("number"!=typeof e){let{message:t}=hG("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw Error(t)}if(!this.client.proposal.keys.includes(e)){let{message:t}=hG("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw Error(t)}if(cF(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);let{message:t}=hG("EXPIRED",`proposal id: ${e}`);throw Error(t)}}}class pX extends pf{constructor(e,t){super(e,t,"proposal",pO),this.core=e,this.logger=t}}class pY extends pf{constructor(e,t){super(e,t,"session",pO),this.core=e,this.logger=t}}class pZ extends pf{constructor(e,t){super(e,t,"request",pO,e=>e.id),this.core=e,this.logger=t}}class pQ extends pf{constructor(e,t){super(e,t,"authKeys",pj,()=>pB),this.core=e,this.logger=t}}class p0 extends pf{constructor(e,t){super(e,t,"pairingTopics",pj),this.core=e,this.logger=t}}class p1 extends pf{constructor(e,t){super(e,t,"requests",pj,e=>e.id),this.core=e,this.logger=t}}class p2{constructor(e,t){this.core=e,this.logger=t,this.authKeys=new pQ(this.core,this.logger),this.pairingTopics=new p0(this.core,this.logger),this.requests=new p1(this.core,this.logger)}
150async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class p6 extends o9{constructor(e){super(e),this.protocol="wc",this.version=2,this.name=pP.name,this.events=new eY.EventEmitter,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.removeAllListeners=e=>this.events.removeAllListeners(e),this.connect=async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}},this.pair=async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}},this.approve=async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}},this.reject=async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}},this.update=async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}},this.extend=async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}},this.request=async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}},this.respond=async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}},this.ping=async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}},this.emit=async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}},this.disconnect=async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}},this.find=e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}},this.authenticate=async(e,t)=>{try{return await this.engine.authenticate(e,t)}catch(e){throw this.logger.error(e.message),e}},this.formatAuthMessage=e=>{try{return this.engine.formatAuthMessage(e)}catch(e){throw this.logger.error(e.message),e}},this.approveSessionAuthenticate=async e=>{try{return await this.engine.approveSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.rejectSessionAuthenticate=async e=>{try{return await this.engine.rejectSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.name=e?.name||pP.name,this.metadata=e?.metadata||cN(),this.signConfig=e?.signConfig;let t="u">typeof e?.logger&&"string"!=typeof e?.logger?e.logger:oP()(oW({level:e?.logger||pP.logger}));this.core=e?.core||new pR(e),this.logger=oX(t,this.name),this.session=new pY(this.core,this.logger),this.proposal=new pX(this.core,this.logger),this.pendingRequest=new pZ(this.core,this.logger),this.engine=new pJ(this),this.auth=new p2(this.core,this.logger)}static async init(e){let t=new p6(e);return await t.initialize(),t}get context(){return oJ(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}function p3(){return"undefined"!=typeof navigator&&/android/i.test(navigator.userAgent)||"undefined"!=typeof navigator&&/iPhone|iPod/.test(navigator.userAgent)||"undefined"!=typeof navigator&&/iPad/.test(navigator.userAgent)}function p5(e){if(e.startsWith("http")){let t=document.createElement("a");t.href=e,t.target="_blank",t.rel="noreferrer noopener",t.click()}else window.open(e,"_blank")}let p8=function(e){return e.FLOW_AUTHN="flow_authn",e.FLOW_PRE_AUTHZ="flow_pre_authz",e.FLOW_AUTHZ="flow_authz",e.FLOW_USER_SIGN="flow_user_sign",e}({}),p4=function(e){return e.SESSION_REQUEST="session_proposal",e.SIGNING_REQUEST="signing_request",e}({});async function p9(e){let{client:t,existingPairing:r}=e,i=await nn(),n={flow:{methods:[p8.FLOW_AUTHN,p8.FLOW_PRE_AUTHZ,p8.FLOW_AUTHZ,p8.FLOW_USER_SIGN],chains:[`flow:${i}`],events:["chainChanged","accountsChanged"]}},{uri:s,approval:o}=await t.connect({pairingTopic:r?.topic,requiredNamespaces:n});if(!s)throw Error("FCL-WC: Error creating session proposal. Could not create a proposal URI.");return{uri:s,approval:o}}let p7=async e=>
150{let{method:t,body:r,session:i,client:n,abortSignal:s}=e,[o,a,u]=function(e){let[t,r,i]=Object.values(e.namespaces).map(e=>e.accounts).flat().filter(e=>e.startsWith("flow:"))[0].split(":");return[`${t}:${r}`,i,i]}(i),f=JSON.stringify({...r,addr:a,address:u}),c=await Promise.race([n.request({topic:i.topic,chainId:o,request:{method:t,params:[f]}}),new Promise((e,t)=>{s?.aborted&&t(Error("WalletConnect Request aborted")),s?.addEventListener("abort",()=>{t(Error("WalletConnect Request aborted"))})})]);if("object"==typeof c&&null!=c)switch(c.status){case"APPROVED":case"REDIRECT":return c.data;case"DECLINED":throw Error(`Declined: ${c.reason||"No reason supplied"}`);default:throw Error("Declined: No reason supplied")}},ge="fcl-plugin-service-walletconnect",gt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{projectId:"",includeBaseWC:!1,wallets:[],wcRequestHook:null,pairingModalOverride:null};return{name:ge,f_type:"ServicePlugin",type:"discovery-service",serviceStrategy:{method:"WC/RPC",exec:gr(e,t,r.e(99).then(r.bind(r,9099)).then(e=>e.WalletConnectModal))},services:[]}},gr=(e,t,r)=>{let{wcRequestHook:i,pairingModalOverride:n}=t;return async t=>{let s,o,{service:a,body:u,opts:f,abortSignal:c}=t,h=await e;R(!!h,"WalletConnect is not initialized");let l=a.endpoint,d=function(e){let{uid:t}=e;return t&&/^(ftp|http|https):\/\/[^ "]+$/.test(t)||(0,A.Rm)({title:"WalletConnect Service Warning",message:`service.uid should be a valid universal link url. Found: ${t}`,level:A.A_.warn}),t}(a),p=h.pairing.getAll({active:!0});if(p.length>0&&(o=p?.find(e=>e.peerMetadata?.url===a.uid)),h.session.length>0){let e=h.session.keys.length-1;s=h.session.get(h.session.keys.at(e))}return null==s&&(s=await new Promise((e,t)=>{(async e=>{let{service:t,onClose:i,appLink:n,client:s,method:o,pairing:a,wcRequestHook:u,pairingModalOverride:f,abortSignal:c}=e,h=s.opts?.projectId;R(!!h,"Cannot establish connection, WalletConnect projectId is undefined");let l=null,d;try{let{uri:e,approval:p}=await p9({client:s,existingPairing:a});if(l=e,u&&u instanceof Function&&u({type:p4.SESSION_REQUEST,method:o,service:t,session:null,pairing:a??null,uri:e??null}),p3()){let t=new URLSearchParams({uri:e}).toString();p5(null==a?n+"?"+t:n)}else a||(f?f(e,i):(d=new(await r)({projectId:h,walletConnectVersion:2})).openModal({uri:e,onClose:i}));return await Promise.race([p(),new Promise((e,t)=>{c?.aborted&&t(Error("Session request aborted")),c?.addEventListener("abort",()=>{t(Error("Session request aborted"))})})])}catch(e){throw e instanceof Error&&(0,A.Rm)({title:`${e.name} Error establishing WalletConnect session`,message:`
151          ${e.message}
152          uri: ${l}
153        `,level:A.A_.error}),i(),e}finally{d?.closeModal()}})({service:a,onClose:function(){t("Declined: Externally Halted")},appLink:d,client:h,method:l,pairing:o,wcRequestHook:i,pairingModalOverride:n,abortSignal:c}).then(e,t)})),i&&i instanceof Function&&i({type:p4.SIGNING_REQUEST,method:l,service:a,session:s??null,pairing:o??null,uri:null}),p3()&&l!==p8.FLOW_AUTHN&&!(l===p8.FLOW_AUTHZ&&f.initiatedByPreAuthz)&&p5(d),await p7({method:l,body:u,session:s,client:h,abortSignal:c})}},gi=Promise.resolve(null),gn=async e=>{let{projectId:t,metadata:r}=e;R(null!=t,"FCL Wallet Connect Error: WalletConnect projectId is required");try{return p6.init({logger:"debug",relayUrl:"wss://relay.walletconnect.com",projectId:t,metadata:r})}catch(e){throw e instanceof Error&&(0,A.Rm)({title:`${e.name} fcl-wc Init Client`,message:e.message,level:A.A_.error}),e}},gs=e=>{let{FclWcServicePlugin:t,clientPromise:r}=go(e);return n1.authn.update(),{FclWcServicePlugin:t,clientPromise:r}},go=e=>{let{projectId:t,metadata:r,includeBaseWC:i=!1,wcRequestHook:n=null,pairingModalOverride:s=null,wallets:o=[]}=e;if("undefined"==typeof window)throw Error("FCL Wallet Connect Plugin can only be initialized in the browser");return{FclWcServicePlugin:gt(gi=Promise.resolve(gi).catch(()=>null).then(e=>e||gn({projectId:t,metadata:r})).catch(e=>{throw(0,A.Rm)({title:"WalletConnect Client Initialization Error",message:e.message?e.message:e,level:A.A_.error}),e}),{projectId:t,includeBaseWC:i,wcRequestHook:n,pairingModalOverride:s,wallets:o}),clientPromise:gi}};async function ga(){return gi.then(e=>{if(!e)throw Error("WalletConnect client not initialized");return e})}let gu="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",gf=gu.length;function gc(){let e="",t=32;for(;t--;)e+=gu[Math.random()*gf|0];return e}let gh=globalThis.AbortController||r(6800),gl=function(e){return e.NOTIFY_QRCODE_CONNECTING="notifyQrCodeConnecting",e.NOTIFY_QRCODE_CONNECTED="notifyQrCodeConnected",e.NOTIFY_QRCODE_ERROR="notifyQrCodeError",e}({}),gd=function(e){return e.REQUEST_WALLETCONNECT_QRCODE="requestWalletConnectQrCode",e.EXEC_SERVICE="execService",e}({}),gp="APPROVED",gg=e=>{let{onExecResult:t,execStrategyOpts:r,execStrategyArgs:i,abortSignal:n}=e;return async e=>{let{service:s}=e;try{let e=await sh({...r,service:s,config:r.config,abortSignal:n},...i.slice(1));if((sj(e)?.status||gp)===gp)return t(e),null;throw Error(e?.reason||"Service was declined")}catch(e){throw Error(e?.message||"Service execution failed")}}},gm=e=>{let{rpc:t,onExecResult:r,authnBody:i,abortSignal:n}=e,s=function(e){let{rpc:t,authnBody:r}=e;return e=>{let{uri:i,approval:n,onExecResult:s}=e;setTimeout(async()=>{try{let e=await ga(),o=await n();t.notify(gl.NOTIFY_QRCODE_CONNECTING,{uri:i});let a=await p7({method:p8.FLOW_AUTHN,body:r,session:o,client:e});t.notify(gl.NOTIFY_QRCODE_CONNECTED,{uri:i}),s(a)}catch(e){t.notify(gl.NOTIFY_QRCODE_ERROR,{uri:i,error:e?.message})}},0)}}({rpc:t,authnBody:i});return async e=>{if(n.aborted)throw Error("Handler has been terminated");let t=await ga(),{uri:i,approval:o}=await p9({client:t});return s({uri:i,approval:o,onExecResult:r}),{uri:i}}};async function gb(e){let{customRpc:t,opts:r,args:i,abortSignal:n}=e,s={...r.config,client:{...r.config.client,discoveryRpcEnabled:!0}};return sh({...r,config:s,customRpc:t,abortSignal:n},...i.slice(1))}let gy="authn";
153async function gv(){let e;for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];let[n]=r,{body:s,abortSignal:o,service:a}=n;if(a?.type!==gy)return console.error(`ERROR: Invalid service type for FCL Discovery execStrategyHook, expected "${gy}" but got "${a?.type}"`),sh(...r);let u=function(e){let t=new gh;return e?.aborted&&t.abort(),e?.addEventListener("abort",()=>t.abort()),t}(o),f=new Promise(async(t,i)=>{e=gb({customRpc:function(e){let{onExecResult:t,body:r,opts:i,args:n,abortSignal:s}=e,o=new s1({notifications:[]});return o.on(gd.REQUEST_WALLETCONNECT_QRCODE,gm({rpc:o,onExecResult:t,authnBody:r,abortSignal:s})),o.on(gd.EXEC_SERVICE,gg({onExecResult:t,execStrategyOpts:i,execStrategyArgs:n,abortSignal:s})),{connect:o.connect.bind(o),receive:o.receive.bind(o)}}({onExecResult:t,body:s,opts:n,args:r,abortSignal:u.signal}),opts:n,args:r,abortSignal:u.signal}).then(t,i)});return await f.catch(()=>{}),await Promise.race([new Promise(e=>setTimeout(e,1e3)),e]).catch(()=>{}),u.abort(),f}let gw="FCL_IFRAME",g_=`
154  position:fixed;
155  top: 0px;
156  right: 0px;
157  bottom: 0px;
158  left: 0px;
159  height: 100%;
160  width: 100vw;
161  display:block;
162  background:rgba(0,0,0,0.25);
163  z-index: 2147483647;
164  box-sizing: border-box;
165  color-scheme: light;
166`;function gE(e){R(!document.getElementById(gw),"Attempt at triggering multiple Frames",{src:e});let t=document.createElement("iframe");return t.src=e,t.id=gw,t.allow="usb *; hid *; clipboard-write",t.frameBorder="0",t.style.cssText=g_,document.body.append(t),[t.contentWindow,()=>{document.getElementById(gw)&&document.getElementById(gw).remove()}]}let gx=null,gS=null;function gM(e){return null==gx||gx?.closed?gx=function(e,t,r,i,n){let s=r.top.outerHeight/2+r.top.screenY-385,o=r.top.outerWidth/2+r.top.screenX-320,a=r.open(e,t,`toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=640, height=770, top=${s}, left=${o}`);if(!a)throw Error("Popup failed to open (was it blocked by a popup blocker?)");return a}(e,"FCL_POP",window,0,0):(gS!==e&&gx.location.replace(e),gx.focus()),gS=e,[gx,()=>{gx&&!gx.closed&&gx.close(),gx=null}]}let gI=null,gA=null;function gR(e){if(null==gI||gI?.closed){if(!(gI=window.open(e,"_blank")))throw Error("Tab failed to open (was it blocked by the browser?)")}else gA!==e&&gI.location.replace(e),gI.focus();return gA=e,[gI,()=>{gI&&!gI.closed&&gI.close(),gI=null}]}let gD=()=>"undefined"==typeof window,gO=()=>{},gP="1.12.3",gN=()=>{},gT=()=>{},gk=()=>{},gC=()=>{throw Error("Strategy util has not been implemented on this platform")},gL={"VIEW/IFRAME":gE,"VIEW/POP":gM,"VIEW/TAB":gR,"VIEW/MOBILE_BROWSER":gC,"VIEW/DEEPLINK":gC};async function gU(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{serviceEndpoint:()=>{}},{serviceEndpoint:r}=t;try{return gL[e.method](r(e),t)}catch(r){throw console.error("execLocal({service, opts = {}})",r,{service:e,opts:t}),r}}let gj={[nf["HTTP/RPC"]]:sF(gU),[nf["HTTP/POST"]]:sF(gU),[nf["IFRAME/RPC"]]:function(e){let{service:t,body:r,config:i,customRpc:n,abortSignal:s,opts:o}=e;return new Promise((e,a)=>{let u=gc(),f=o.includeOlderJsonRpcCall,{close:c}=function(e){let t,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e)return{send:gO,close:gO};let n=i.onClose||gO,s=i.onMessage||gO,o=sJ({close:a,send:u,onReady:i.onReady||gO,onResponse:i.onResponse||gO,onMessage:s,onCustomRpc:i.onCustomRpc||gO,getSource:()=>t});return window.addEventListener("message",o),[t,r]=gE(sL(e)),{send:u,close:a};function a(){try{window.removeEventListener("message",o),r(),n()}catch(e){console.error("Frame Close Error",e)}}function u(e){try{t.postMessage(JSON.parse(JSON.stringify(e||{})),"*")}catch(t){console.error("Frame Send Error",e,t)}}}(t,{async onReady(e,s){let{send:o}=s;try{o({type:"FCL:VIEW:READY:RESPONSE",fclVersion:gP,body:r,service:{params:t.params,data:t.data,type:t.type},config:i}),o({fclVersion:gP,type:"FCL:FRAME:READY:RESPONSE",body:r,service:{params:t.params,data:t.data,type:t.type},config:i,deprecated:{message:"FCL:FRAME:READY:RESPONSE is deprecated and replaced with type: FCL:VIEW:READY:RESPONSE"}}),f&&o({jsonrpc:"2.0",id:u,method:"fcl:sign",params:[r,t.params],deprecated:{message:"jsonrpc is deprecated and replaced with type: FCL:VIEW:READY:RESPONSE"}}),n?.connect({send:e=>{o({type:"FCL:VIEW:CUSTOM_RPC",payload:e})}})}catch(e){throw e}},onResponse(t,r){let{close:i}=r;try{if("object"!=typeof t.data)return;let r=sj(t.data);switch(r.status){case"APPROVED":e(r.data),i();break;case"DECLINED":a(`Declined: ${r.reason||"No reason supplied"}`),i();break;
166case"REDIRECT":e(r),i();break;default:a("Declined: No reason supplied"),i()}}catch(e){throw console.error("execIframeRPC onResponse error",e),e}},onMessage(t,r){let{close:i}=r;try{if("object"!=typeof t.data||"2.0"!==t.data.jsonrpc||t.data.id!==u)return;let r=sj(t.data.result);switch(r.status){case"APPROVED":e(r.data),i();break;case"DECLINED":a(`Declined: ${r.reason||"No reason supplied"}`),i();break;case"REDIRECT":e(r),i();break;default:a("Declined: No reason supplied"),i()}}catch(e){throw console.error("execIframeRPC onMessage error",e),e}},onClose(){a("Declined: Externally Halted")},onCustomRpc(e){n?.receive(e)}});s&&(s.aborted&&(a("Declined: Aborted"),c()),s.addEventListener("abort",()=>{a("Declined: Aborted"),c()}))})},[nf["POP/RPC"]]:function(e){let{service:t,body:r,config:i,abortSignal:n,customRpc:s,opts:o}=e;return new Promise((e,a)=>{let u=gc(),{redir:f,includeOlderJsonRpcCall:c}=o,{close:h}=function(e){let t,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e)return{send:gN,close:gN};let n=i.onClose||gN,s=i.onMessage||gN,o=sJ({close:u,send:f,onReady:i.onReady||gN,onResponse:i.onResponse||gN,onMessage:s,onCustomRpc:i.onCustomRpc||gN,getSource:()=>t});window.addEventListener("message",o),[t,r]=gM(sL(e));let a=setInterval(function(){t&&t.closed&&u()},500);return{send:f,close:u};function u(){try{window.removeEventListener("message",o),clearInterval(a),r(),n()}catch(e){console.error("Popup Close Error",e)}}function f(e){try{t.postMessage(JSON.parse(JSON.stringify(e||{})),"*")}catch(t){console.error("Popup Send Error",e,t)}}}(t,{customRpc:s,async onReady(e,n){let{send:o}=n;try{o({fclVersion:gP,type:"FCL:VIEW:READY:RESPONSE",body:r,service:{params:t.params,data:t.data,type:t.type},config:i}),o({fclVersion:gP,type:"FCL:FRAME:READY:RESPONSE",body:r,service:{params:t.params,data:t.data,type:t.type},config:i,deprecated:{message:"FCL:FRAME:READY:RESPONSE is deprecated and replaced with type: FCL:VIEW:READY:RESPONSE"}}),c&&o({jsonrpc:"2.0",id:u,method:"fcl:sign",params:[r,t.params]}),s?.connect({send:e=>{o({type:"FCL:VIEW:CUSTOM_RPC",payload:e})}})}catch(e){throw e}},onResponse(t,r){let{close:i}=r;try{if("object"!=typeof t.data)return;let r=sj(t.data);switch(r.status){case"APPROVED":e(r.data),f||i();break;case"DECLINED":a(`Declined: ${r.reason||"No reason supplied"}`),i();break;case"REDIRECT":e(r),i();break;default:a("Declined: No reason supplied"),i()}}catch(e){throw console.error("execPopRPC onResponse error",e),e}},onMessage(t,r){let{close:i}=r;try{if("object"!=typeof t.data||"2.0"!==t.data.jsonrpc||t.data.id!==u)return;let r=sj(t.data.result);switch(r.status){case"APPROVED":e(r.data),f||i();break;case"DECLINED":a(`Declined: ${r.reason||"No reason supplied"}`),i();break;case"REDIRECT":e(r),i();break;default:a("Declined: No reason supplied"),i()}}catch(e){throw console.error("execPopRPC onMessage error",e),e}},onClose(){a("Declined: Externally Halted")},onCustomRpc(e){s?.receive(e)}});n&&(n.aborted&&(a("Declined: Aborted"),h()),n.addEventListener("abort",()=>{a("Declined: Aborted"),h()}))})},[nf["TAB/RPC"]]:function(e){let{service:t,body:r,config:i,abortSignal:n,customRpc:s,opts:o}=e;return new Promise((e,a)=>{let u=gc(),{redir:f,includeOlderJsonRpcCall:c}=o,{close:h}=function(e){let t,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e)return{send:gT,close:gT};let n=i.onClose||gT,s=i.onMessage||gT,o=sJ({close:u,send:f,onReady:i.onReady||gT,onResponse:i.onResponse||gT,onMessage:s,onCustomRpc:i.onCustomRpc||gT,getSource:()=>t});window.addEventListener("message",o),[t,r]=gR(sL(e));let a=setInterval(function(){t&&t.closed&&u()},500);return{send:f,close:u};function u(){try{window.removeEventListener("message",o),clearInterval(a),r(),n()}catch(e){console.error("Tab Close Error",e)}}function f(e){try{t.postMessage(JSON.parse(JSON.stringify(e||{})),"*")}catch(t){console.error("Tab Send Error",e,t)}}}(t,{customRpc:s,async onReady(e,n){let{send:o}=n;try{o({fclVersion:gP,type:"FCL:VIEW:READY:RESPONSE",body:r,service:{params:t.params,data:t.data,type:t.type},config:i}),o({fclVersion:gP,type:"FCL:FRAME:READY:RESPONSE",body:r,service:{params:t.params,data:t.data,type:t.type},config:i,deprecated:{message:"FCL:FRAME:READY:RESPONSE is deprecated and replaced with type: FCL:VIEW:READY:RESPONSE"}}),c&&o({jsonrpc:"2.0",id:u,method:"fcl:sign",params:[r,t.params]}),s?.connect({send:e=>{o({type:"FCL:VIEW:CUSTOM_RPC",payload:e})}})}catch(e){throw e}},onResponse(t,r){let{close:i}=r;try{if("object"!=typeof t.data)return;let r=sj(t.data);switch(r.status){case"APPROVED":e(r.data),f||i();break;case"DECLINED":a(`Declined: ${r.reason||"No reason supplied"}`),i();break;
166case"REDIRECT":e(r),i();break;default:a("Declined: No reason supplied"),i()}}catch(e){throw console.error("execPopRPC onResponse error",e),e}},onMessage(t,r){let{close:i}=r;try{if("object"!=typeof t.data||"2.0"!==t.data.jsonrpc||t.data.id!==u)return;let r=sj(t.data.result);switch(r.status){case"APPROVED":e(r.data),f||i();break;case"DECLINED":a(`Declined: ${r.reason||"No reason supplied"}`),i();break;case"REDIRECT":e(r),i();break;default:a("Declined: No reason supplied"),i()}}catch(e){throw console.error("execPopRPC onMessage error",e),e}},onClose(){a("Declined: Externally Halted")},onCustomRpc(e){s?.receive(e)}});n&&(n.aborted&&(h(),a("Declined: Aborted")),n.addEventListener("abort",()=>{h(),a("Declined: Aborted")}))})},[nf["EXT/RPC"]]:function(e){let{service:t,body:r,config:i,abortSignal:n,customRpc:s,opts:o}=e;return new Promise((e,o)=>{let{close:a}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e)return{send:gk,close:gk};let r=t.onClose||gk,i=t.onMessage||gk,n=sJ({close:s,send:o,onReady:t.onReady||gk,onResponse:t.onResponse||gk,onMessage:i,onCustomRpc:t.onCustomRpc||gk});return window.addEventListener("message",n),o({service:e}),{send:o,close:s};function s(){try{window.removeEventListener("message",n),r()}catch(e){console.error("Ext Close Error",e)}}function o(e){try{window&&window.postMessage(JSON.parse(JSON.stringify(e||{})),"*")}catch(t){console.error("Ext Send Error",e,t)}}}(t,{async onReady(e,n){let{send:o}=n;try{o({fclVersion:gP,type:"FCL:VIEW:READY:RESPONSE",body:r,service:{params:t.params,data:t.data,type:t.type},config:i}),s?.connect({send:e=>{o({type:"FCL:VIEW:CUSTOM_RPC",body:e})}})}catch(e){throw e}},onResponse(t,r){let{close:i}=r;try{if("object"!=typeof t.data)return;let r=sj(t.data);switch(r.status){case"APPROVED":e(r.data),i();break;case"DECLINED":o(`Declined: ${r.reason||"No reason supplied"}`),i();break;case"REDIRECT":e(r),i();break;default:o("Declined: No reason supplied"),i()}}catch(e){throw console.error("execExtRPC onResponse error",e),e}},onClose(){o("Declined: Externally Halted")},onCustomRpc(e){s?.receive(e)}});n&&(n.aborted&&(a(),o("Declined: Aborted")),n.addEventListener("abort",()=>{a(),o("Declined: Aborted")}))})}},gB="undefined"==typeof window,gq=e=>{let t=e["app.detail.title"],r=e["app.detail.icon"],i=e["app.detail.description"],n=e["app.detail.url"];return{name:t??document.title,description:i??"",url:n??window.location.origin,icons:r?[r]:[]}},gz={execStrategy:gv};(e=>{let{platform:t,discovery:r}=e})({platform:"web",discovery:gz});let gF=(e=>{let{platform:t,discovery:r}=e,i=()=>({authenticate:sI({platform:t,discovery:r}),unauthenticate:sA,authorization:sO({platform:t,discovery:r}),signUserMessage:sC({platform:t,discovery:r}),subscribe:sP,snapshot:sN,resolveArgument:sT({platform:t,discovery:r})});return i.authenticate=sI({platform:t,discovery:r}),i.unauthenticate=sA,i.authorization=sO({platform:t,discovery:r}),i.signUserMessage=sC({platform:t,discovery:r}),i.subscribe=sP,i.snapshot=sN,i.resolveArgument=sT({platform:t,discovery:r}),i})({platform:"web",discovery:gz}),g$=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return gF().authenticate(e)},gH=()=>gF().unauthenticate();gF().authorization,eq({"discovery.wallet.method.default":"IFRAME/RPC","fcl.storage.default":(()=>{try{return{can:!gD(),get:async e=>JSON.parse(sessionStorage.getItem(e)),put:async(e,t)=>sessionStorage.setItem(e,JSON.stringify(t))}}catch(e){return null}})()}),nH({coreStrategies:gj}),function(){if(gB)return;let e=null,t=!1;eq.subscribe(async r=>{let i={"walletconnect.projectId":r["walletconnect.projectId"],"app.detail.title":r["app.detail.title"],"app.detail.icon":r["app.detail.icon"],"app.detail.description":r["app.detail.description"],"app.detail.url":r["app.detail.url"]},n=i["walletconnect.projectId"],s=e;if(e=JSON.stringify(i,null,2),t){s!==e&&console.warn(`FCL WalletConnect Plugin has been already loaded with different configuration. It is not possible to change the configuration after the plugin has been loaded.
167
168Previous configuration:
169${s}
170
171Current configuration:
172${e}`);return}if(!n)return;if(R(!!n,"FCL Configuration value for 'walletconnect.projectId' is required"),nV.getPlugins().has(ge)){t||console.warn("It seems like the FCL WalletConnect plugins has been already loaded manually. This is no longer necessary, please see the documentation for more information."),t=!0;return}t=!0;let{clientPromise:o,FclWcServicePlugin:a}=gs({projectId:n,metadata:gq(i)});nV.add([a])})}()},3286:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Address:()=>F,Array:()=>V,Bool:()=>z,Character:()=>q,Dictionary:()=>G,Enum:()=>Y,Event:()=>W,Fix64:()=>j,Identity:()=>g,InclusiveRange:()=>Q,Int:()=>b,Int128:()=>A,Int16:()=>_,Int256:()=>D,Int32:()=>x,Int64:()=>M,Int8:()=>v,Optional:()=>H,Path:()=>Z,Reference:()=>K,Resource:()=>J,String:()=>B,Struct:()=>X,UFix64:()=>U,UInt:()=>m,UInt128:()=>I,UInt16:()=>w,UInt256:()=>R,UInt32:()=>E,UInt64:()=>S,UInt8:()=>y,Void:()=>$,Word128:()=>k,Word16:()=>P,Word256:()=>C,Word32:()=>N,Word64:()=>T,Word8:()=>O,_Array:()=>V});var i=r(4794);let n=(e,t,r)=>({label:e,asArgument:t,asInjection:t=>(i.Rm.deprecate({pkg:"@onflow/types",subject:`Passing in ${e} as value for ${e}`,message:`Going forward, use ${e} as value for ${e}.`}),r(t))}),s=e=>Array.isArray(e),o=e=>"object"==typeof e,a=e=>null==e,u=e=>"boolean"==typeof e,f=e=>"number"==typeof e,c=e=>Number.isInteger(e),h=e=>"string"==typeof e,l=e=>{throw Error("Type Error: "+e)},d=e=>{i.Rm.deprecate({pkg:"@onflow/types",subject:`Passing in Number as value for ${e}`,message:`Going forward, use String as value for ${e}.`,transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/types/WARNINGS.md#0002-[U]Int*-and-Word*-as-Number"})},p=!1,g={label:"Identity",asArgument:e=>(p||(i.Rm.deprecate({pkg:"@onflow/types",subject:"Identity",message:"Identity type is deprecated and will be removed in v2.0.0.  Please remove it from your co
172de."}),p=!0),e),asInjection:e=>e},m=n("UInt",e=>f(e)&&c(e)?(d("UInt"),{type:"UInt",value:e.toString()}):h(e)?{type:"UInt",value:e}:l("Expected Positive Integer for type Unsigned Int"),e=>e),b=n("Int",e=>f(e)&&c(e)?(d("Int"),{type:"Int",value:e.toString()}):h(e)?{type:"Int",value:e}:l("Expected Integer for type Int"),e=>e),y=n("UInt8",e=>f(e)&&c(e)?(d("UInt8"),{type:"UInt8",value:e.toString()}):h(e)?{type:"UInt8",value:e}:l("Expected integer for UInt8"),e=>e),v=n("Int8",e=>f(e)&&c(e)?(d("Int8"),{type:"Int8",value:e.toString()}):h(e)?{type:"Int8",value:e}:l("Expected positive integer for Int8"),e=>e),w=n("UInt16",e=>f(e)&&c(e)?(d("UInt16"),{type:"UInt16",value:e.toString()}):h(e)?{type:"UInt16",value:e}:l("Expected integer for UInt16"),e=>e),_=n("Int16",e=>f(e)&&c(e)?(d("Int16"),{type:"Int16",value:e.toString()}):h(e)?{type:"Int16",value:e}:l("Expected positive integer for Int16"),e=>e),E=n("UInt32",e=>f(e)&&c(e)?(d("UInt32"),{type:"UInt32",value:e.toString()}):h(e)?{type:"UInt32",value:e}:l("Expected integer for UInt32"),e=>e),x=n("Int32",e=>f(e)&&c(e)?(d("Int32"),{type:"Int32",value:e.toString()}):h(e)?{type:"Int32",value:e}:l("Expected positive integer for Int32"),e=>e),S=n("UInt64",e=>f(e)&&c(e)?(d("UInt64"),{type:"UInt64",value:e.toString()}):h(e)?{type:"UInt64",value:e}:l("Expected integer for UInt64"),e=>e),M=n("Int64",e=>f(e)&&c(e)?(d("Int64"),{type:"Int64",value:e.toString()}):h(e)?{type:"Int64",value:e}:l("Expected positive integer for Int64"),e=>e),I=n("UInt128",e=>f(e)&&c(e)?(d("UInt128"),{type:"UInt128",value:e.toString()}):h(e)?{type:"UInt128",value:e}:l("Expected integer for UInt128"),e=>e),A=n("Int128",e=>f(e)&&c(e)?(d("Int128"),{type:"Int128",value:e.toString()}):h(e)?{type:"Int128",value:e}:l("Expected positive integer for Int128"),e=>e),R=n("UInt256",e=>f(e)&&c(e)?(d("UInt256"),{type:"UInt256",value:e.toString()}):h(e)?{type:"UInt256",value:e}:l("Expected integer for UInt256"),e=>e),D=n("Int256",e=>f(e)&&c(e)?(d("Int256"),{type:"Int256",value:e.toString()}):h(e)?{type:"Int256",value:e}:l("Expected integer for Int256"),e=>e),O=n("Word8",e=>f(e)&&c(e)?(d("Word8"),{type:"Word8",value:e.toString()}):h(e)?{type:"Word8",value:e}:l("Expected positive number for Word8"),e=>e),P=n("Word16",e=>f(e)&&c(e)?(d("Word16"),{type:"Word16",value:e.toString()}):h(e)?{type:"Word16",value:e}:l("Expected positive number for Word16"),e=>e),N=n("Word32",e=>f(e)&&c(e)?(d("Word32"),{type:"Word32",value:e.toString()}):h(e)?{type:"Word32",value:e}:l("Expected positive number for Word32"),e=>e),T=n("Word64",e=>f(e)&&c(e)?(d("Word64"),{type:"Word64",value:e.toString()}):h(e)?{type:"Word64",value:e}:l("Expected positive number for Word64"),e=>e),k=n("Word128",e=>f(e)&&c(e)?(d("Word128"),{type:"Word128",value:e.toString()}):h(e)?{type:"Word128",value:e}:l("Expected positive number for Word128"),e=>e),C=n("Word256",e=>f(e)&&c(e)?(d("Word256"),{type:"Word256",value:e.toString()}):h(e)?{type:"Word256",value:e}:l("Expected positive number for Word256"),e=>e),L=()=>{i.Rm.deprecate({subject:"Passing in Numbers as values for Fix64 and UFix64 types",pkg:"@onflow/types",transition:"https://github.com/onflow/flow-js-sdk/blob/master/packages/types/WARNINGS.md#0001-[U]Fix64-as-Number"})},U=n("UFix64",e=>{if(h(e)){let t=e.split(".");return 2!==t.length?l(`Expected one decimal but found ${t.length} in the [U]Fix64 value. Find out more about [U]Fix64 types here: https://docs.onflow.org/cadence/json-cadence-spec/#fixed-point-numbers`):0==t[1].length||t[1].length>8?l(`Expected at least one digit, and at most 8 digits following the decimal of the [U]Fix64 value but found ${t[1].length} digits. Find out more about [U]Fix64 types here: https://docs.onflow.org/cadence/json-cadence-spec/#fixed-point-numbers`):(t[1]=t[1].padEnd(8,"0"),{type:"UFix64",value:e=t.join(".")})}
172return f(e)?(L(),{type:"UFix64",value:e.toString()}):l("Expected String for UFix64")},e=>e),j=n("Fix64",e=>{if(h(e)){let t=e.split(".");return 2!==t.length?l(`Expected one decimal but found ${t.length} in the [U]Fix64 value. Find out more about [U]Fix64 types here: https://docs.onflow.org/cadence/json-cadence-spec/#fixed-point-numbers`):0==t[1].length||t[1].length>8?l(`Expected at least one digit, and at most 8 digits following the decimal of the [U]Fix64 value but found ${t[1].length} digits. Find out more about [U]Fix64 types here: https://docs.onflow.org/cadence/json-cadence-spec/#fixed-point-numbers`):(t[1]=t[1].padEnd(8,"0"),{type:"Fix64",value:e=t.join(".")})}return f(e)?(L(),{type:"Fix64",value:e.toString()}):l("Expected String for Fix64")},e=>e),B=n("String",e=>h(e)?{type:"String",value:e}:l("Expected String for type String"),e=>e),q=n("Character",e=>h(e)?{type:"Character",value:e}:l("Expected Character for type Character"),e=>e),z=n("Bool",e=>u(e)?{type:"Bool",value:e}:l("Expected Boolean for type Bool"),e=>e),F=n("Address",e=>h(e)?{type:"Address",value:e}:l("Expected Address for type Address"),e=>e),$=n("Void",e=>!e||a(e)?{type:"Void",value:null}:l("Expected Void for type Void"),e=>e),H=e=>n("Optional",t=>({type:"Optional",value:a(t)?null:e.asArgument(t)}),e=>e),K=n("Reference",e=>o(e)?{type:"Reference",value:e}:l("Expected Object for type Reference"),e=>e),V=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return n("Array",t=>({type:"Array",value:s(e)?e.map((e,r)=>e.asArgument(t[r])):t.map(t=>e.asArgument(t))}),e=>e)},G=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return n("Dictionary",t=>{let r=s(t),i=s(e);return o(t)?{type:"Dictionary",value:i&&r?e.map((e,r)=>({key:e.key.asArgument(t[r].key),value:e.value.asArgument(t[r].value)})):r&&!i?t.map(t=>({key:e.key.asArgument(t.key),value:e.value.asArgument(t.value)})):r||i?l("Invalid arguments for Dictionary."):[{key:e.key.asArgument(t.key),value:e.value.asArgument(t.value)}]}:l("Expected Object for type Dictionary")},e=>e)},W=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n("Event",r=>o(r)?{type:"Event",value:{id:e,fields:s(t)?t.map((e,t)=>({name:r.fields[t].name,value:e.value.asArgument(r.fields[t].value)})):r.fields.map(e=>({name:e.name,value:t.value.asArgument(e.value)}))}}:l("Expected Object for type Event"),e=>e)},J=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n("Resource",r=>o(r)?{type:"Resource",value:{id:e,fields:s(t)?t.map((e,t)=>({name:r.fields[t].name,value:e.value.asArgument(r.fields[t].value)})):r.fields.map(e=>({name:e.name,value:t.value.asArgument(e.value)}))}}:l("Expected Object for type Resource"),e=>e)},X=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n("Struct",r=>o(r)?{type:"Struct",value:{id:e,fields:s(t)?t.map((e,t)=>({name:r.fields[t].name,value:e.value.asArgument(r.fields[t].value)})):r.fields.map(e=>({name:e.name,value:t.value.asArgument(e.value)}))}}:l("Expected Object for type Struct"),e=>e)},Y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n("Enum",r=>o(r)?{type:"Enum",value:{id:e,fields:s(t)?t.map((e,t)=>({name:r.fields[t].name,value:e.value.asArgument(r.fields[t].value)})):r.fields.map(e=>({name:e.name,value:t.value.asArgument(e.value)}))}}:l("Expected Object for type Enum"),e=>e)},Z=n("Path",e=>o(e)?h(e.domain)?"storage"===e.domain||"private"===e.domain||"public"===e.domain?h(e.identifier)?{type:"Path",value:{domain:e.domain,identifier:e.identifier}}:l(`Expected a string for the Path identifier but found ${e.identifier}. Find out more about the Path type here: https://docs.onflow.org/cadence/json-cadence-spec/#path`):l(`Expected either "storage", "private" or "public" as the Path domain but found ${e.domain}. Find out more about the Path type here: https://docs.onflow.org/cadence/json-cadence-spec/#path`):l(`Expected a string for the Path domain but found ${e.domain}. Find out more about the Path type here: https://docs.onflow.org/cadence/json-cadence-spec/#path`):l("Expected Object for type Path"),e=>e),Q=e=>n("InclusiveRange",t=>{if(o(t)){let{start:r,end:i,step:n}=t;return{type:"InclusiveRange",value:{start:e.asArgument(r),end:e.asArgument(i),step:e.asArgument(n)}}}return l("Expected Object for type InclusiveRange")},e=>e)},4794:(e,t,r)=>{"use strict";r.d(t,{A_:()=>s,Nk:()=>n,Rm:()=>a});let i=null,n=e=>{i=e},s=function(e){return e[e.debug=5]="debug",e[e.info=4]="info",e[e.log=3]="log",e[e.warn=2]="warn",e[e.error=1]="error",e}({}),o=e=>{let{title:t,message:r}=e;return[`
173    %c${t}
174    ============================
175
176    ${r}
177
178    ============================
179    `.replace(/\n[^\S\r\n]+/g,"\n").trim(),"font-weight:bold;font-family:monospace;"]},a=async e=>{let{title:t,message:r,level:n,always:a}=e,u=await i?.()?.get("logger.level")??s.warn;if(!a&&u<n)return;let f=o({title:t,message:r});switch(n){case s.debug:console.debug(...f);break;case s.info:console.info(...f);break;case s.warn:console.warn(...f);break;case s.error:console.error(...f);break;default:console.log(...f)}};a.deprecate=e=>{let{pkg:t,subject:r,transition:i,level:n=s.warn,message:o="",callback:u=null}=e,f=e=>e.charAt(0).toUpperCase()+e.slice(1),c=()=>a({title:`${t?t+" ":""}Deprecation Notice`,message:`
180      ${r?`${f(r)} is deprecated and will cease to work in future releases${t?" of "+t:""}.`:""}${o?"\n"+o:""}${i?`
181You can learn more (including a guide on common transition paths) here: ${i}`:""}
182    `.trim(),level:n});return"function"==typeof u?async function(){return await c(),await u(...arguments)}:c()}},9064:(e,t,r)=>{"use strict";
182Object.defineProperty(t,"__esModule",{value:!0});var i=r(8212);function n(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}function s(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t}function o(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function a(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function u(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function f(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function c(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}function h(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}function l(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),c(e/0x100000000>>>0,t,r),c(e>>>0,t,r+4),t}function d(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),h(e>>>0,t,r),h(e/0x100000000>>>0,t,r+4),t}t.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},t.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},t.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},t.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},t.writeUint16BE=n,t.writeInt16BE=n,t.writeUint16LE=s,t.writeInt16LE=s,t.readInt32BE=o,t.readUint32BE=a,t.readInt32LE=u,t.readUint32LE=f,t.writeUint32BE=c,t.writeInt32BE=c,t.writeUint32LE=h,t.writeInt32LE=h,t.readInt64BE=function(e,t){void 0===t&&(t=0);var r=o(e,t),i=o(e,t+4);return 0x100000000*r+i-(i>>31)*0x100000000},t.readUint64BE=function(e,t){return void 0===t&&(t=0),0x100000000*a(e,t)+a(e,t+4)},t.readInt64LE=function(e,t){void 0===t&&(t=0);var r=u(e,t);return 0x100000000*u(e,t+4)+r-(r>>31)*0x100000000},t.readUint64LE=function(e,t){void 0===t&&(t=0);var r=f(e,t);return 0x100000000*f(e,t+4)+r},t.writeUint64BE=l,t.writeInt64BE=l,t.writeUint64LE=d,t.writeInt64LE=d,t.readUintBE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw Error("readUintBE: array is too short for the given b
182itLength");for(var i=0,n=1,s=e/8+r-1;s>=r;s--)i+=t[s]*n,n*=256;return i},t.readUintLE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw Error("readUintLE: array is too short for the given bitLength");for(var i=0,n=1,s=r;s<r+e/8;s++)i+=t[s]*n,n*=256;return i},t.writeUintBE=function(e,t,r,n){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===n&&(n=0),e%8!=0)throw Error("writeUintBE supports only bitLengths divisible by 8");if(!i.isSafeInteger(t))throw Error("writeUintBE value must be an integer");for(var s=1,o=e/8+n-1;o>=n;o--)r[o]=t/s&255,s*=256;return r},t.writeUintLE=function(e,t,r,n){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===n&&(n=0),e%8!=0)throw Error("writeUintLE supports only bitLengths divisible by 8");if(!i.isSafeInteger(t))throw Error("writeUintLE value must be an integer");for(var s=1,o=n;o<n+e/8;o++)r[o]=t/s&255,s*=256;return r},t.readFloat32BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t)},t.readFloat32LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t,!0)},t.readFloat64BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t)},t.readFloat64LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t,!0)},t.writeFloat32BE=function(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(r,e),t},t.writeFloat32LE=function(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(r,e,!0),t},t.writeFloat64BE=function(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(r,e),t},t.writeFloat64LE=function(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(r,e,!0),t}},7074:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(9064),n=r(2368);function s(e,t,r,s,o){if(void 0===o&&(o=0),32!==e.length)throw Error("ChaCha: key size must be 32 bytes");if(s.length<r.length)throw Error("ChaCha: destination is shorter than source");if(0===o){if(8!==t.length&&12!==t.length)throw Error("ChaCha nonce must be 8 or 12 bytes");u=(a=new Uint8Array(16)).length-t.length,a.set(t,u)}else{if(16!==t.length)throw Error("ChaCha nonce with counter must be 16 bytes");a=t,u=o}for(var a,u,f=new Uint8Array(64),c=0;c<r.length;c+=64){!function(e,t,r){for(var n=r[3]<<24|r[2]<<16|r[1]<<8|r[0],s=r[7]<<24|r[6]<<16|r[5]<<8|r[4],o=r[11]<<24|r[10]<<16|r[9]<<8|r[8],a=r[15]<<24|r[14]<<16|r[13]<<8|r[12],u=r[19]<<24|r[18]<<16|r[17]<<8|r[16],f=r[23]<<24|r[22]<<16|r[21]<<8|r[20],c=r[27]<<24|r[26]<<16|r[25]<<8|r[24],h=r[31]<<24|r[30]<<16|r[29]<<8|r[28],l=t[3]<<24|t[2]<<16|t[1]<<8|t[0],d=t[7]<<24|t[6]<<16|t[5]<<8|t[4],p=t[11]<<24|t[10]<<16|t[9]<<8|t[8],g=t[15]<<24|t[14]<<16|t[13]<<8|t[12],m=0x61707865,b=0x3320646e,y=0x79622d32,v=0x6b206574,w=n,_=s,E=o,x=a,S=u,M=f,I=c,A=h,R=l,D=d,O=p,P=g,N=0;N<20;N+=2)R^=m=m+w|0,w^=S=S+(R=R>>>16|R<<16)|0,w=w>>>20|w<<12,D^=b=b+_|0,_^=M=M+(D=D>>>16|D<<16)|0,_=_>>>20|_<<12,O^=y=y+E|0,E^=I=I+(O=O>>>16|O<<16)|0,E=E>>>20|E<<12,P^=v=v+x|0,x^=A=A+(P=P>>>16|P<<16)|0,x=x>>>20|x<<12,O^=y=y+E|0,E^=I=I+(O=O>>>24|O<<8)|0,E=E>>>25|E<<7,P^=v=v+x|0,x^=A=A+(P=P>>>24|P<<8)|0,x=x>>>25|x<<7,D^=b=b+_|0,_^=M=M+(D=D>>>24|D<<8)|0,_=_>>>25|_<<7,R^=m=m+w|0,w^=S=S+(R=R>>>24|R<<8)|0,w=w>>>25|w<<7,P^=m=m+_|0,_^=I=I+(P=P>>>16|P<<16)|0,_=_>>>20|_<<12,R^=b=b+E|0,E^=A=A+(R=R>>>16|R<<16)|0,E=E>>>20|E<<12,D^=y=y+x|0,x^=S=S+(D=D>>>16|D<<16)|0,x=x>>>20|x<<12,O^=v=v+w|0,w^=M=M+(O=O>>>16|O<<16)|0,w=w>>>20|w<<12,D^=y=y+x|0,x^=S=S+(D=D>>>24|D<<8)|0,x=x>>>25|x<<7,O^=v=v+w|0,w^=M=M+(O=O>>>24|O<<8)|0,w=w>>>25|w<<7,R^=b=b+E|0,E^=A=A+(R=R>>>24|R<<8)|0,E=E>>>25|E<<7,P^=m=m+_|0,_^=I=I+(P=P>>>24|P<<8)|0,_=_>>>25|_<<7;i.writeUint32LE(m+0x61707865|0,e,0),i.writeUint32LE(b+0x3320646e|0,e,4),i.writeUint32LE(y+0x79622d32|0,e,8),i.writeUint32LE(v+0x6b206574|0,e,12),i.writeUint32LE(w+n|0,e,16),i.writeUint32LE(_+s|0,e,20),i.writeUint32LE(E+o|0,e,24),i.writeUint32LE(x+a|0,e,28),i.writeUint32LE(S+u|0,e,32),i.writeUint32LE(M+f|0,e,36),i.writeUint32LE(I+c|0,e,40),i.writeUint32LE(A+h|0,e,44),i.writeUint32LE(R+l|0,e,48),i.writeUint32LE(D+d|0,e,52),i.writeUint32LE(O+p|0,e,56),i.writeUint32LE(P+g|0,e,60)}(f,a,e);for(var h=c;h<c+64&&h<r.length;h++)s[h]=r[h]^f[h-c];!function(e,t,r){for(var i=1;r--;)i=i+(255&e[t])|0,e[t]=255&i,i>>>=8,t++;if(i>0)throw Error("ChaCha: counter overflow")}(a,0,u)}return n.wipe(f),0===o&&n.wipe(a),s}t.streamXOR=s,t.stream=function(e,t,r,i){return void 0===i&&(i=0),n.wipe(r),s(e,t,r,r,i)}},7904:(e,t,r)=>{"use strict";
182var i=r(7074),n=r(6536),s=r(2368),o=r(9064),a=r(8288);t.J4=32,t.PX=12,t.iW=16;var u=new Uint8Array(16),f=function(){function e(e){if(this.nonceLength=t.PX,this.tagLength=t.iW,e.length!==t.J4)throw Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return e.prototype.seal=function(e,t,r,n){if(e.length>16)throw Error("ChaCha20Poly1305: incorrect nonce length");var o,a=new Uint8Array(16);a.set(e,a.length-e.length);var u=new Uint8Array(32);i.stream(this._key,a,u,4);var f=t.length+this.tagLength;if(n){if(n.length!==f)throw Error("ChaCha20Poly1305: incorrect destination length");o=n}else o=new Uint8Array(f);return i.streamXOR(this._key,a,t,o,4),this._authenticate(o.subarray(o.length-this.tagLength,o.length),u,o.subarray(0,o.length-this.tagLength),r),s.wipe(a),o},e.prototype.open=function(e,t,r,n){if(e.length>16)throw Error("ChaCha20Poly1305: incorrect nonce length");if(t.length<this.tagLength)return null;var o,u=new Uint8Array(16);u.set(e,u.length-e.length);var f=new Uint8Array(32);i.stream(this._key,u,f,4);var c=new Uint8Array(this.tagLength);if(this._authenticate(c,f,t.subarray(0,t.length-this.tagLength),r),!a.equal(c,t.subarray(t.length-this.tagLength,t.length)))return null;var h=t.length-this.tagLength;if(n){if(n.length!==h)throw Error("ChaCha20Poly1305: incorrect destination length");o=n}else o=new Uint8Array(h);return i.streamXOR(this._key,u,t.subarray(0,t.length-this.tagLength),o,4),s.wipe(u),o},e.prototype.clean=function(){return s.wipe(this._key),this},e.prototype._authenticate=function(e,t,r,i){var a=new n.Poly1305(t);i&&(a.update(i),i.length%16>0&&a.update(u.subarray(i.length%16))),a.update(r),r.length%16>0&&a.update(u.subarray(r.length%16));var f=new Uint8Array(8);i&&o.writeUint64LE(i.length,f),a.update(f),o.writeUint64LE(r.length,f),a.update(f);for(var c=a.digest(),h=0;h<c.length;h++)e[h]=c[h];a.clean(),s.wipe(c),s.wipe(f)},e}();t.g6=f},8288:(e,t)=>{"use strict";function r(e,t){if(e.length!==t.length)return 0;for(var r=0,i=0;i<e.length;i++)r|=e[i]^t[i];return 1&r-1>>>8}Object.defineProperty(t,"__esModule",{value:!0}),t.select=function(e,t,r){return~(e-1)&t|e-1&r},t.lessOrEqual=function(e,t){return(0|e)-(0|t)-1>>>31&1},t.compare=r,t.equal=function(e,t){return 0!==e.length&&0!==t.length&&0!==r(e,t)}},7004:(e,t,r)=>{"use strict";t._S=t.K=t.TP=t.wE=t.Ee=void 0,r(9992);let i=r(3442);function n(e){let t=new Float64Array(16);if(e)for(let r=0;r<e.length;r++)t[r]=e[r];return t}r(2368),t.Ee=64,t.wE=64,t.TP=32,new Uint8Array(32)[0]=9;let s=n(),o=n([1]),a=(n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222])),u=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),f=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]);function c(e,t){for(let r=0;r<16;r++)e[r]=0|t[r]}function h(e){let t=1;for(let r=0;r<16;r++){let i=e[r]+t+65535;t=Math.floor(i/65536),e[r]=i-65536*t}e[0]+=t-1+37*(t-1)}function l(e,t,r){let i=~(r-1);for(let r=0;r<16;r++){let n=i&(e[r]^t[r]);e[r]^=n,t[r]^=n}}function d(e,t){let r=n(),i=n();for(let e=0;e<16;e++)i[e]=t[e];h(i),h(i),h(i);for(let e=0;e<2;e++){r[0]=i[0]-65517;for(let e=1;e<15;e++)r[e]=i[e]-65535-(r[e-1]>>16&1),r[e-1]&=65535;r[15]=i[15]-32767-(r[14]>>16&1);let e=r[15]>>16&1;r[14]&=65535,l(i,r,1-e)}for(let t=0;t<16;t++)e[2*t]=255&i[t],e[2*t+1]=i[t]>>8}n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t,r){for(let i=0;i<16;i++)e[i]=t[i]+r[i]}function g(e,t,r){for(let i=0;i<16;i++)e[i]=t[i]-r[i]}function m(e,t,r){let i,n,s=0,o=0,a=0,u=0,f=0,c=0,h=0,l=0,d=0,p=0,g=0,m=0,b=0,y=0,v=0,w=0,_=0,E=0,x=0,S=0,M=0,I=0,A=0,R=0,D=0,O=0,P=0,N=0,T=0,k=0,C=0,L=r[0],U=r[1],j=r[2],B=r[3],q=r[4],z=r[5],F=r[6],$=r[7],H=r[8],K=r[9],V=r[10],G=r[11],W=r[12],J=r[13],X=r[14],Y=r[15];s+=(i=t[0])*L,o+=i*U,a+=i*j,u+=i*B,f+=i*q,c+=i*z,h+=i*F,l+=i*$,d+=i*H,p+=i*K,g+=i*V,m+=i*G,b+=i*W,y+=i*J,v+=i*X,w+=i*Y,o+=(i=t[1])*L,a+=i*U,u+=i*j,f+=i*B,c+=i*q,h+=i*z,l+=i*F,d+=i*$,p+=i*H,g+=i*K,m+=i*V,b+=i*G,y+=i*W,v+=i*J,w+=i*X,_+=i*Y,a+=(i=t[2])*L,u+=i*U,f+=i*j,c+=i*B,h+=i*q,l+=i*z,d+=i*F,p+=i*$,g+=i*H,m+=i*K,b+=i*V,y+=i*G,v+=i*W,w+=i*J,_+=i*X,E+=i*Y,u+=(i=t[3])*L,f+=i*U,c+=i*j,h+=i*B,l+=i*q,d+=i*z,p+=i*F,g+=i*$,m+=i*H,b+=i*K,y+=i*V,v+=i*G,w+=i*W,_+=i*J,E+=i*X,x+=i*Y,f+=(i=t[4])*L,c+=i*U,h+=i*j,l+=i*B,d+=i*q,p+=i*z,g+=i*F,m+=i*$,b+=i*H,y+=i*K,v+=i*V,w+=i*G,_+=i*W,E+=i*J,x+=i*X,S+=i*Y,c+=(i=t[5])*L,h+=i*U,l+=i*j,d+=i*B,p+=i*q,g+=i*z,m+=i*F,b+=i*$,y+=i*H,v+=i*K,w+=i*V,_+=i*G,E+=i*W,x+=i*J,S+=i*X,M+=i*Y,h+=(i=t[6])*L,l+=i*U,d+=i*j,p+=i*B,g+=i*q,m+=i*z,b+=i*F,y+=i*$,v+=i*H,w+=i*K,_+=i*V,E+=i*G,x+=i*W,S+=i*J,M+=i*X,I+=i*Y,l+=(i=t[7])*L,d+=i*U,p+=i*j,g+=i*B,m+=i*q,b+=i*z,y+=i*F,v+=i*$,w+=i*H,_+=i*K,E+=i*V,x+=i*G,S+=i*W,M+=i*J,I+=i*X,A+=i*Y,d+=(i=t[8])*L,p+=i*U,g+=i*j,m+=i*B,b+=i*q,y+=i*z,v+=i*F,w+=i*$,_+=i*H,E+=i*K,x+=i*V,S+=i*G,M+=i*W,I+=i*J,A+=i*X,R+=i*Y,p+=(i=t[9])*L,g+=i*U,m+=i*j,b+=i*B,y+=i*q,v+=i*z,w+=i*F,_+=i*$,E+=i*H,x+=i*K,S+=i*V,M+=i*G,I+=i*W,A+=i*J,R+=i*X,D+=i*Y,g+=(i=t[10])*L,m+=i*U,b+=i*j,y+=i*B,v+=i*q,w+=i*z,_+=i*F,E+=i*$,x+=i*H,S+=i*K,M+=i*V,I+=i*G,A+=i*W,R+=i*J,D+=i*X,O+=i*Y,m+=(i=t[11])*L,b+=i*U,y+=i*j,v+=i*B,w+=i*q,_+=i*z,E+=i*F,x+=i*$,S+=i*H,M+=i*K,I+=i*V,A+=i*G,R+=i*W,D+=i*J,O+=i*X,P+=i*Y,b+=(i=t[12])*L,y+=i*U,v+=i*j,w+=i*B,_+=i*q,E+=i*z,x+=i*F,S+=i*$,M+=i*H,I+=i*K,A+=i*V,R+=i*G,D+=i*W,O+=i*J,P+=i*X,N+=i*Y,y+=(i=t[13])*L,v+=i*U,w+=i*j,_+=i*B,E+=i*q,x+=i*z,S+=i*F,M+=i*$,I+=i*H,A+=i*K,R+=i*V,D+=i*G,O+=i*W,P+=i*J,N+=i*X,T+=i*Y,v+=(i=t[14])*L,w+=i*U,_+=i*j,E+=i*B,x+=i*q,S+=i*z,M+=i*F,I+=i*$,A+=i*H,R+=i*K,D+=i*V,O+=i*G,P+=i*W,N+=i*J,T+=i*X,k+=i*Y,w+=(i=t[15])*L,_+=i*U,E+=i*j,x+=i*B,S+=i*q,M+=i*z,I+=i*F,A+=i*$,R+=i*H,D+=i*K,O+=i*V,P+=i*G,N+=i*W,T+=i*J,k+=i*X,C+=i*Y,s+=38*_,o+=38*E,a+=38*x,u+=38*S,f+=38*M,c+=38*I,h+=38*A,l+=38*R,d+=38*D,p+=38*O,g+=38*P,m+=38*N,b+=38*T,y+=38*k,v+=38*C,n=Math.floor((i=s+(n=1)+6
1825535)/65536),s=i-65536*n,n=Math.floor((i=o+n+65535)/65536),o=i-65536*n,n=Math.floor((i=a+n+65535)/65536),a=i-65536*n,n=Math.floor((i=u+n+65535)/65536),u=i-65536*n,n=Math.floor((i=f+n+65535)/65536),f=i-65536*n,n=Math.floor((i=c+n+65535)/65536),c=i-65536*n,n=Math.floor((i=h+n+65535)/65536),h=i-65536*n,n=Math.floor((i=l+n+65535)/65536),l=i-65536*n,n=Math.floor((i=d+n+65535)/65536),d=i-65536*n,n=Math.floor((i=p+n+65535)/65536),p=i-65536*n,n=Math.floor((i=g+n+65535)/65536),g=i-65536*n,n=Math.floor((i=m+n+65535)/65536),m=i-65536*n,n=Math.floor((i=b+n+65535)/65536),b=i-65536*n,n=Math.floor((i=y+n+65535)/65536),y=i-65536*n,n=Math.floor((i=v+n+65535)/65536),v=i-65536*n,n=Math.floor((i=w+n+65535)/65536),w=i-65536*n,s+=n-1+37*(n-1),n=Math.floor((i=s+(n=1)+65535)/65536),s=i-65536*n,n=Math.floor((i=o+n+65535)/65536),o=i-65536*n,n=Math.floor((i=a+n+65535)/65536),a=i-65536*n,n=Math.floor((i=u+n+65535)/65536),u=i-65536*n,n=Math.floor((i=f+n+65535)/65536),f=i-65536*n,n=Math.floor((i=c+n+65535)/65536),c=i-65536*n,n=Math.floor((i=h+n+65535)/65536),h=i-65536*n,n=Math.floor((i=l+n+65535)/65536),l=i-65536*n,n=Math.floor((i=d+n+65535)/65536),d=i-65536*n,n=Math.floor((i=p+n+65535)/65536),p=i-65536*n,n=Math.floor((i=g+n+65535)/65536),g=i-65536*n,n=Math.floor((i=m+n+65535)/65536),m=i-65536*n,n=Math.floor((i=b+n+65535)/65536),b=i-65536*n,n=Math.floor((i=y+n+65535)/65536),y=i-65536*n,n=Math.floor((i=v+n+65535)/65536),v=i-65536*n,n=Math.floor((i=w+n+65535)/65536),w=i-65536*n,s+=n-1+37*(n-1),e[0]=s,e[1]=o,e[2]=a,e[3]=u,e[4]=f,e[5]=c,e[6]=h,e[7]=l,e[8]=d,e[9]=p,e[10]=g,e[11]=m,e[12]=b,e[13]=y,e[14]=v,e[15]=w}function b(e,t){let r=n(),i=n(),s=n(),o=n(),u=n(),f=n(),c=n(),h=n(),l=n();g(r,e[1],e[0]),g(l,t[1],t[0]),m(r,r,l),p(i,e[0],e[1]),p(l,t[0],t[1]),m(i,i,l),m(s,e[3],t[3]),m(s,s,a),m(o,e[2],t[2]),p(o,o,o),g(u,i,r),g(f,o,s),p(c,o,s),p(h,i,r),m(e[0],u,f),m(e[1],h,c),m(e[2],c,f),m(e[3],u,h)}function y(e,t,r){for(let i=0;i<4;i++)l(e[i],t[i],r)}function v(e,t){let r=n(),i=n(),s=n();(function(e,t){let r;let i=n();for(r=0;r<16;r++)i[r]=t[r];for(r=253;r>=0;r--)m(i,i,i),2!==r&&4!==r&&m(i,i,t);for(r=0;r<16;r++)e[r]=i[r]})(s,t[2]),m(r,t[0],s),m(i,t[1],s),d(e,i),e[31]^=function(e){let t=new Uint8Array(32);return d(t,e),1&t[0]}(r)<<7}function w(e,t){let r=[n(),n(),n(),n()];c(r[0],u),c(r[1],f),c(r[2],o),m(r[3],u,f),function(e,t,r){c(e[0],s),c(e[1],o),c(e[2],o),c(e[3],s);for(let i=255;i>=0;--i){let n=r[i/8|0]>>(7&i)&1;y(e,t,n),b(t,e),b(e,e),y(e,t,n)}}(e,r,t)}t.K=function(e){if(e.length!==t.TP)throw Error(`ed25519: seed must be ${t.TP} bytes`);let r=(0,i.hash)(e);r[0]&=248,r[31]&=127,r[31]|=64;let s=new Uint8Array(32),o=[n(),n(),n(),n()];w(o,r),v(s,o);let a=new Uint8Array(64);return a.set(e),a.set(s,32),{publicKey:s,secretKey:a}};let _=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function E(e,t){let r,i,n,s;for(i=63;i>=32;--i){for(r=0,n=i-32,s=i-12;n<s;++n)t[n]+=r-16*t[i]*_[n-(i-32)],r=Math.floor((t[n]+128)/256),t[n]-=256*r;t[n]+=r,t[i]=0}for(n=0,r=0;n<32;n++)t[n]+=r-(t[31]>>4)*_[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*_[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function x(e){let t=new Float64Array(64);for(let r=0;r<64;r++)t[r]=e[r];for(let t=0;t<64;t++)e[t]=0;E(e,t)}t._S=function(e,t){let r=new Float64Array(64),s=[n(),n(),n(),n()],o=(0,i.hash)(e.subarray(0,32));o[0]&=248,o[31]&=127,o[31]|=64;let a=new Uint8Array(64);a.set(o.subarray(32),32);let u=new i.SHA512;u.update(a.subarray(32)),u.update(t);let f=u.digest();u.clean(),x(f),w(s,f),v(a,s),u.reset(),u.update(a.subarray(0,32)),u.update(e.subarray(32)),u.update(t);let c=u.digest();x(c);for(let e=0;e<32;e++)r[e]=f[e];for(let e=0;e<32;e++)for(let t=0;t<32;t++)r[e+t]+=c[e]*o[t];return E(a.subarray(32),r),a}},1054:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSerializableHash=function(e){return void 0!==e.saveState&&void 0!==e.restoreState&&void 0!==e.cleanSavedState}},2084:(e,t,r)=>{"use strict";var i=r(1344),n=r(2368),s=function(){function e(e,t,r,n){void 0===r&&(r=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=n;var s=i.hmac(this._hash,r,t);this._hmac=new i.HMAC(e,s),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(0===e)throw Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},e.prototype.expand=function(e){for(var t=new Uint8Array(e),r=0;r<t.length;r++)this._bufpos===this._buffer.length&&this._fillBuffer(),t[r]=this._buffer[this._bufpos++];return t},e.prototype.clean=function(){this._hmac.clean(),n.wipe(this._buffer),n.wipe(this._counter),this._bufpos=0},e}();t.i=s},1344:(e,t,r)=>{"use strict";
182Object.defineProperty(t,"__esModule",{value:!0});var i=r(1054),n=r(8288),s=r(2368),o=function(){function e(e,t){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var r=new Uint8Array(this.blockSize);t.length>this.blockSize?this._inner.update(t).finish(r).clean():r.set(t);for(var n=0;n<r.length;n++)r[n]^=54;this._inner.update(r);for(var n=0;n<r.length;n++)r[n]^=106;this._outer.update(r),i.isSerializableHash(this._inner)&&i.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),s.wipe(r)}return e.prototype.reset=function(){if(!i.isSerializableHash(this._inner)||!i.isSerializableHash(this._outer))throw Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.clean=function(){i.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),i.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(e){return this._inner.update(e),this},e.prototype.finish=function(e){return this._finished?this._outer.finish(e):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0),this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(!i.isSerializableHash(this._inner))throw Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(e){if(!i.isSerializableHash(this._inner)||!i.isSerializableHash(this._outer))throw Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.cleanSavedState=function(e){if(!i.isSerializableHash(this._inner))throw Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},e}();t.HMAC=o,t.hmac=function(e,t,r){var i=new o(e,t);i.update(r);var n=i.digest();return i.clean(),n},t.equal=n.equal},8212:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mul=Math.imul||function(e,t){var r=65535&e,i=65535&t;return r*i+((e>>>16&65535)*i+r*(t>>>16&65535)<<16>>>0)|0},t.add=function(e,t){return e+t|0},t.sub=function(e,t){return e-t|0},t.rotl=function(e,t){return e<<t|e>>>32-t},t.rotr=function(e,t){return e<<32-t|e>>>t},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.MAX_SAFE_INTEGER=0x1fffffffffffff,t.isSafeInteger=function(e){return t.isInteger(e)&&e>=-t.MAX_SAFE_INTEGER&&e<=t.MAX_SAFE_INTEGER}},6536:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(8288),n=r(2368);t.DIGEST_LENGTH=16;var s=function(){function e(e){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var r=e[0]|e[1]<<8;this._r[0]=8191&r;var i=e[2]|e[3]<<8;this._r[1]=(r>>>13|i<<3)&8191;var n=e[4]|e[5]<<8;this._r[2]=(i>>>10|n<<6)&7939;var s=e[6]|e[7]<<8;this._r[3]=(n>>>7|s<<9)&8191;var o=e[8]|e[9]<<8;this._r[4]=(s>>>4|o<<12)&255,this._r[5]=o>>>1&8190;var a=e[10]|e[11]<<8;this._r[6]=(o>>>14|a<<2)&8191;var u=e[12]|e[13]<<8;this._r[7]=(a>>>11|u<<5)&8065;var f=e[14]|e[15]<<8;this._r[8]=(u>>>8|f<<8)&8191,this._r[9]=f>>>5&127,this._pad[0]=e[16]|e[17]<<8,this._pad[1]=e[18]|e[19]<<8,this._pad[2]=e[20]|e[21]<<8,this._pad[3]=e[22]|e[23]<<8,this._pad[4]=e[24]|e[25]<<8,this._pad[5]=e[26]|e[27]<<8,this._pad[6]=e[28]|e[29]<<8,this._pad[7]=e[30]|e[31]<<8}return e.prototype._blocks=function(e,t,r){for(var i=this._fin?0:2048,n=this._h[0],s=this._h[1],o=this._h[2],a=this._h[3],u=this._h[4],f=this._h[5],c=this._h[6],h=this._h[7],l=this._h[8],d=this._h[9],p=this._r[0],g=this._r[1],m=this._r[2],b=this._r[3],y=this._r[4],v=this._r[5],w=this._r[6],_=this._r[7],E=this._r[8],x=this._r[9];r>=16;
182){var S,M=e[t+0]|e[t+1]<<8;n+=8191&M;var I=e[t+2]|e[t+3]<<8;s+=(M>>>13|I<<3)&8191;var A=e[t+4]|e[t+5]<<8;o+=(I>>>10|A<<6)&8191;var R=e[t+6]|e[t+7]<<8;a+=(A>>>7|R<<9)&8191;var D=e[t+8]|e[t+9]<<8;u+=(R>>>4|D<<12)&8191,f+=D>>>1&8191;var O=e[t+10]|e[t+11]<<8;c+=(D>>>14|O<<2)&8191;var P=e[t+12]|e[t+13]<<8;h+=(O>>>11|P<<5)&8191;var N=e[t+14]|e[t+15]<<8;l+=(P>>>8|N<<8)&8191,d+=N>>>5|i;var T=0;T=(S=0+n*p+5*x*s+5*E*o+5*_*a+5*w*u)>>>13,S&=8191,S+=5*v*f+5*y*c+5*b*h+5*m*l+5*g*d,T+=S>>>13,S&=8191;var k=T;k+=n*g,k+=s*p,k+=5*x*o,k+=5*E*a,k+=5*_*u,T=k>>>13,k&=8191,k+=5*w*f,k+=5*v*c,k+=5*y*h,k+=5*b*l,k+=5*m*d,T+=k>>>13,k&=8191;var C=T;C+=n*m,C+=s*g,C+=o*p,C+=5*x*a,C+=5*E*u,T=C>>>13,C&=8191,C+=5*_*f,C+=5*w*c,C+=5*v*h,C+=5*y*l,C+=5*b*d,T+=C>>>13,C&=8191;var L=T;L+=n*b,L+=s*m,L+=o*g,L+=a*p,L+=5*x*u,T=L>>>13,L&=8191,L+=5*E*f,L+=5*_*c,L+=5*w*h,L+=5*v*l,L+=5*y*d,T+=L>>>13,L&=8191;var U=T;U+=n*y,U+=s*b,U+=o*m,U+=a*g,U+=u*p,T=U>>>13,U&=8191,U+=5*x*f,U+=5*E*c,U+=5*_*h,U+=5*w*l,U+=5*v*d,T+=U>>>13,U&=8191;var j=T;j+=n*v,j+=s*y,j+=o*b,j+=a*m,j+=u*g,T=j>>>13,j&=8191,j+=f*p,j+=5*x*c,j+=5*E*h,j+=5*_*l,j+=5*w*d,T+=j>>>13,j&=8191;var B=T;B+=n*w,B+=s*v,B+=o*y,B+=a*b,B+=u*m,T=B>>>13,B&=8191,B+=f*g,B+=c*p,B+=5*x*h,B+=5*E*l,B+=5*_*d,T+=B>>>13,B&=8191;var q=T;q+=n*_,q+=s*w,q+=o*v,q+=a*y,q+=u*b,T=q>>>13,q&=8191,q+=f*m,q+=c*g,q+=h*p,q+=5*x*l,q+=5*E*d,T+=q>>>13,q&=8191;var z=T;z+=n*E,z+=s*_,z+=o*w,z+=a*v,z+=u*y,T=z>>>13,z&=8191,z+=f*b,z+=c*m,z+=h*g,z+=l*p,z+=5*x*d,T+=z>>>13,z&=8191;var F=T;F+=n*x,F+=s*E,F+=o*_,F+=a*w,F+=u*v,T=F>>>13,F&=8191,F+=f*y,F+=c*b,F+=h*m,F+=l*g,F+=d*p,T+=F>>>13,F&=8191,S=8191&(T=(T=(T<<2)+T|0)+S|0),T>>>=13,k+=T,n=S,s=k,o=C,a=L,u=U,f=j,c=B,h=q,l=z,d=F,t+=16,r-=16}this._h[0]=n,this._h[1]=s,this._h[2]=o,this._h[3]=a,this._h[4]=u,this._h[5]=f,this._h[6]=c,this._h[7]=h,this._h[8]=l,this._h[9]=d},e.prototype.finish=function(e,t){void 0===t&&(t=0);var r,i,n,s,o=new Uint16Array(10);if(this._leftover){for(s=this._leftover,this._buffer[s++]=1;s<16;s++)this._buffer[s]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(r=this._h[1]>>>13,this._h[1]&=8191,s=2;s<10;s++)this._h[s]+=r,r=this._h[s]>>>13,this._h[s]&=8191;for(this._h[0]+=5*r,r=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=r,r=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=r,o[0]=this._h[0]+5,r=o[0]>>>13,o[0]&=8191,s=1;s<10;s++)o[s]=this._h[s]+r,r=o[s]>>>13,o[s]&=8191;for(o[9]-=8192,i=(1^r)-1,s=0;s<10;s++)o[s]&=i;for(s=0,i=~i;s<10;s++)this._h[s]=this._h[s]&i|o[s];for(s=1,this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,n=this._h[0]+this._pad[0],this._h[0]=65535&n;s<8;s++)n=(this._h[s]+this._pad[s]|0)+(n>>>16)|0,this._h[s]=65535&n;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},e.prototype.update=function(e){var t,r=0,i=e.length;if(this._leftover){(t=16-this._leftover)>i&&(t=i);for(var n=0;n<t;n++)this._buffer[this._leftover+n]=e[r+n];if(i-=t,r+=t,this._leftover+=t,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(i>=16&&(t=i-i%16,this._blocks(e,r,t),r+=t,i-=t),i){for(var n=0;n<i;n++)this._buffer[this._leftover+n]=e[r+n];this._leftover+=i}return this},e.prototype.digest=function(){if(this._finished)throw Error("Poly1305 was finished");var e=new Uint8Array(16);return this.finish(e),e},e.prototype.clean=function(){return n.wipe(this._buffer),n.wipe(this._r),n.wipe(this._h),n.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},e}();t.Poly1305=s,t.oneTimeAuth=function(e,t){var r=new s(e);r.update(t);var i=r.digest();return r.clean(),i},t.equal=function(e,r){return e.length===t.DIGEST_LENGTH&&r.length===t.DIGEST_LENGTH&&i.equal(e,r)}},9992:(e,t,r)=>{"use strict";
182Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;let i=r(5766),n=r(9064),s=r(2368);function o(e,r=t.defaultRandomSource){return r.randomBytes(e)}t.defaultRandomSource=new i.SystemRandomSource,t.randomBytes=o,t.randomUint32=function(e=t.defaultRandomSource){let r=o(4,e),i=(0,n.readUint32LE)(r);return(0,s.wipe)(r),i};let a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(e,r=a,i=t.defaultRandomSource){if(r.length<2)throw Error("randomString charset is too short");if(r.length>256)throw Error("randomString charset is too long");let n="",f=r.length,c=256-256%f;for(;e>0;){let t=o(Math.ceil(256*e/c),i);for(let i=0;i<t.length&&e>0;i++){let s=t[i];s<c&&(n+=r.charAt(s%f),e--)}(0,s.wipe)(t)}return n}t.randomString=u,t.randomStringForEntropy=function(e,r=a,i=t.defaultRandomSource){return u(Math.ceil(e/(Math.log(r.length)/Math.LN2)),r,i)}},9737:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserRandomSource=void 0;class r{constructor(){this.isAvailable=!1,this.isInstantiated=!1;let e="undefined"!=typeof self?self.crypto||self.msCrypto:null;e&&void 0!==e.getRandomValues&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw Error("Browser random byte generator is not available.");let t=new Uint8Array(e);for(let e=0;e<t.length;e+=65536)this._crypto.getRandomValues(t.subarray(e,e+Math.min(t.length-e,65536)));return t}}t.BrowserRandomSource=r},5595:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeRandomSource=void 0;let i=r(2368);class n{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{let e=r(7051);e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw Error("NodeRandomSource: got fewer bytes than requested");let r=new Uint8Array(e);for(let e=0;e<r.length;e++)r[e]=t[e];return(0,i.wipe)(t),r}}t.NodeRandomSource=n},5766:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SystemRandomSource=void 0;let i=r(9737),n=r(5595);class s{constructor(){if(this.isAvailable=!1,this.name="",this._source=new i.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new n.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw Error("System random byte generator is not available.");return this._source.randomBytes(e)}}t.SystemRandomSource=s},1360:(e,t,r)=>{"use strict";var i=r(9064),n=r(2368);t.On=32,t.cS=64;var s=function(){function e(){this.digestLength=t.On,this.blockSize=t.cS,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._state[0]=0x6a09e667,this._state[1]=0xbb67ae85,this._state[2]=0x3c6ef372,this._state[3]=0xa54ff53a,this._state[4]=0x510e527f,this._state[5]=0x9b05688c,this._state[6]=0x1f83d9ab,this._state[7]=0x5be0cd19},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},e.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this._finished)throw Error("SHA256: can't update because hash was finished.");var r=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&t>0;)this._buffer[this._bufferLength++]=e[r++],t--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(r=a(this._temp,this._state,e,r,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[r++],t--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,n=t%64
182<56?64:128;this._buffer[r]=128;for(var s=r+1;s<n-8;s++)this._buffer[s]=0;i.writeUint32BE(t/0x20000000|0,this._buffer,n-8),i.writeUint32BE(t<<3,this._buffer,n-4),a(this._temp,this._state,this._buffer,0,n),this._finished=!0}for(var s=0;s<this.digestLength/4;s++)i.writeUint32BE(this._state[s],e,4*s);return this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(this._finished)throw Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){n.wipe(e.state),e.buffer&&n.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.aD=s;var o=new Int32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]);function a(e,t,r,n,s){for(;s>=64;){for(var a=t[0],u=t[1],f=t[2],c=t[3],h=t[4],l=t[5],d=t[6],p=t[7],g=0;g<16;g++){var m=n+4*g;e[g]=i.readUint32BE(r,m)}for(var g=16;g<64;g++){var b=e[g-2],y=(b>>>17|b<<15)^(b>>>19|b<<13)^b>>>10,v=((b=e[g-15])>>>7|b<<25)^(b>>>18|b<<14)^b>>>3;e[g]=(y+e[g-7]|0)+(v+e[g-16]|0)}for(var g=0;g<64;g++){var y=(((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&l^~h&d)|0)+(p+(o[g]+e[g]|0)|0)|0,v=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&u^a&f^u&f)|0;p=d,d=l,l=h,h=c+y|0,c=f,f=u,u=a,a=y+v|0}t[0]+=a,t[1]+=u,t[2]+=f,t[3]+=c,t[4]+=h,t[5]+=l,t[6]+=d,t[7]+=p,n+=64,s-=64}return n}t.tW=function(e){var t=new s;t.update(e);var r=t.digest();return t.clean(),r}},3442:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(9064),n=r(2368);t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var s=function(){function e(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._stateHi[0]=0x6a09e667,this._stateHi[1]=0xbb67ae85,this._stateHi[2]=0x3c6ef372,this._stateHi[3]=0xa54ff53a,this._stateHi[4]=0x510e527f,this._stateHi[5]=0x9b05688c,this._stateHi[6]=0x1f83d9ab,this._stateHi[7]=0x5be0cd19,this._stateLo[0]=0xf3bcc908,this._stateLo[1]=0x84caa73b,this._stateLo[2]=0xfe94f82b,this._stateLo[3]=0x5f1d36f1,this._stateLo[4]=0xade682d1,this._stateLo[5]=0x2b3e6c1f,this._stateLo[6]=0xfb41bd6b,this._stateLo[7]=0x137e2179},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},e.prototype.update=function(e,r){if(void 0===r&&(r=e.length),this._finished)throw Error("SHA512: can't update because hash was finished.");var i=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&r>0;)this._buffer[this._bufferLength++]=e[i++],r--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(i=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,i,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[i++],r--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,n=t%128<112?128:256;this._buffer[r]=128;for(var s=r+1;s<n-8;s++)this._buffer[s]=0;i.writeUint32BE(t/0x20000000|0,this._buffer,n-8),i.writeUint32BE(t<<3,this._buffer,n-4),a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,n),this._finished=!0}for(var s=0;s<this.digestLength/8;s++)i.writeUint32BE(this._stateHi[s],e,8*s),i.writeUint32BE(this._stateLo[s],e,8*s+4);return this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(this._finished)throw Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){n.wipe(e.stateHi),n.wipe(e.stateLo),e.buffer&&n.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.SHA512=s;var o=new Int32Array([0x428a2f98,0xd728ae22,0x71374491,0x23ef65cd,0xb5c0fbcf,0xec4d3b2f,0xe9b5dba5,0x8189dbbc,0x3956c25b,0xf348b538,0x59f111f1,0xb605d019,0x923f82a4,0xaf194f9b,0xab1c5ed5,0xda6d8118,0xd807aa98,0xa3030242,0x12835b01,0x45706fbe,0x243185be,0x4ee4b28c,0x550c7dc3,0xd5ffb4e2,0x72be5d74,0xf27b896f,0x80deb1fe,0x3b1696b1,0x9bdc06a7,0x25c71235,0xc19bf174,0xcf692694,0xe49b69c1,0x9ef14ad2,0xefbe4786,0x384f25e3,0xfc19dc6,0x8b8cd5b5,0x240ca1cc,0x77ac9c65,0x2de92c6f,0x592b0275,0x4a7484aa,0x6ea6e483,0x5cb0a9dc,0xbd41fbd4,0x76f988da,0x831153b5,0x983e5152,0xee66dfab,0xa831c66d,0x2db43210,0xb00327c8,0x98fb213f,0xbf597fc7,0xbeef0ee4,0xc6e00bf3,0x3da88fc2,0xd5a79147,0x930aa725,0x6ca6351,0xe003826f,0x14292967,0xa0e6e70,0x27b70a85,0x46d22ffc,0x2e1b2138,0x5c26c926,0x4d2c6dfc,0x5ac42aed,0x53380d13,0x9d95b3df,0x650a7354,0x8baf63de,0x766a0abb,0x3c77b2a8,0x81c2c92e,0x47edaee6,0x92722c85,0x1482353b,0xa2bfe8a1,0x4cf10364,0xa81a664b,0xbc423001,0xc24b8b70,0xd0f89791,0xc76c51a3,0x654be30,0xd192e819,0xd6ef5218,0xd6990624,0x5565a910,0xf40e3585,0x5771202a,0x106aa070,0x32bbd1b8,0x19a4c116,0xb8d2d0c8,0x1e376c08,0x5141ab53,0x2748774c,0xdf8eeb99,0x34b0bcb5,0xe19b48a8,0x391c0cb3,0xc5c95a63,0x4ed8aa4a,0xe3418acb,0x5b9cca4f,0x7763e373,0x682e6ff3,0xd6b2b8a3,0x748f82ee,0x5defb2fc,0x78a5636f,0x43172f60,0x84c87814,0xa1f0ab72,0x8cc70208,0x1a6439ec,0x90befffa,0x23631e28,0xa4506ceb,0xde82bde9,0xbef9a3f7,0xb2c67915,0xc67178f2,0xe372532b,0xca273ece,0xea26619c,0xd186b8c7,0x21c0c207,0xeada7dd6,0xcde0eb1e,0xf57d4f7f,0xee6ed178,0x6f067aa,0x72176fba,0xa637dc5,0xa2c898a6,0x113f9804,0xbef90dae,0x1b710b35,0x131c471b,0x28db77f5,0x23047d84,0x32caab7b,0x40c72493,0x3c9ebe0a,0x15c9bebc,0x431d67c4,0x9c100d4c,0x4cc5d4be,0xcb3e42b6,0x597f299c,0xfc657e2a,0x5fcb6fab,0x3ad6faec,0x6c44198c,0x4a475817]);function a(e,t,r,n,s,a,u){for(var f,c,h,l,d,p,g,m,b=r[0],y=r[1],v=r[2],w=r[3],_=r[4],E=r[5],x=r[6],S=r[7],M=n[0],I=n[1],A=n[2],R=n[3],D=n[4],O=n[5],P=n[6],N=n[7];u>=128;){for(var T=0;T<16;T++){var k=8*T+a;e[T]=i.readUint32BE(s,k),t[T]=i.readUint32BE(s,k+4)}for(var T=0;T<80;T++){var C=b,L=y,U=v,j=w,B=_,q=E,z=x,F=S,$=M,H=I,K=A,V=R,G=D,W=O,J=P,X=N;if(f=S,d=65535&(c=N),p=c>>>16,g=65535&f,m=f>>>16,f=(_>>>14|D<<18)^(_>>>18|D<<14)^(D>>>9|_<<23),d+=65535&(c=(D>>>14|_<<18)^(D>>>18|_<<14)^(_>>>9|D<<23)),p+=c>>>16,g+=65535&f,m+=f>>>16,f=_&E^~_&x,d+=65535&(c=D&O^~D&P),p+=c>>>16,g+=65535&f,m+=f>>>16,f=o[2*T],d+=65535&(c=o[2*T+1]),p+=c>>>16,g+=65535&f,m+=f>>>16,f=e[T%16],d+=65535&(c=t[T%16]),p+=c>>>16,g+=65535&f,m+=f>>>16,p+=d>>>16,g+=p>>>16,m+=g>>>16,h=65535&g|m<<16,l=65535&d|p<<16,f=h,d=65535&(c=l),p=c>>>16,g=65535&f,m=f>>>16,f=(b>>>28|M<<4)^(M>>>2|b<<30)^(M>>>7|b<<25),d+=65535&(c=(M>>>28|b<<4)^(b>>>2|M<<30)^(b>>>7|M<<25)),p+=c>>>16,g+=65535&f,m+=f>>>16,f=b&y^b&v^y&v,d+=65535&(c=M&I^M&A^I&A),p+=c>>>16,g+=65535&f,m+=f>>>16,p+=d>>>16,g+=p>>>16,m+=g>>>16,F=65535&g|m<<16,X=65535&d|p<<16,f=j,d=65535&(c=V),p=c>>>16,g=65535&f,m=f>>>16,f=h,d+=65535&(c=l),p+=c>>>16,g+=65535&f,m+=f>>>16,p+=d>>>16,g+=p>>>16,m+=g>>>16,j=65535&g|m<<16,V=65535&d|p<<16,y=C,v=L,w=U,_=j,E=B,x=q,S=z,b=F,I=$,A=H,R=K,D=V,O=G,P=W,N=J,M=X,T%16==15)for(var k=0;k<16;k++)f=e[k],d=65535&(c=t[k]),p=c>>>16,g=65535&f,m=f>>>16,f=e[(k+9)%16],d+=65535&(c=t[(k+9)%16]),p+=c>>>16,g+=65535&f,m+=f>>>16,f=((h=e[(k+1)%16])>>>1|(l=t[(k+1)%16])<<31)^(h>>>8|l<<24)^h>>>7,d+=65535&(c=(l>>>1|h<<31)^(l>>>8|h<<24)^(l>>>7|h<<25)),p+=c>>>16,g+=65535&f,m+=f>>>16,f=((h=e[(k+14)%16])>>>19|(l=t[(k+14)%16])<<13)^(l>>>29|h<<3)^h>>>6,d+=65535&(c=(l>>>19|h<<13)^(h>>>29|l<<3)^(l>>>6|h<<26)),p+=c>>>16,g+=65535&f,m+=f>>>16,p+=d>>>16,g+=p>>>16,m+=g>>>16,e[k]=65535&g|m<<16,t[k]=65535&d|p<<16}f=b,d=65535&(c=M),p=c>>>16,g=65535&f,m=f>>>16,f=r[0],d+=65535&(c=n[0]),p+=c>>>16,g+=65535&f,m+=f>>>16,p+=d>>>16,g+=p>>>16,m+=g>>>16,r[0]=b=65535&g|m<<16,n[0]=M=65535&d|p<<16,f=y,d=65535&(c=I),p=c>>>16,g=65535&f,m=f>>>16,f=r[1],d+=65535&(c=n[1]),p+=c>>>16,g+=65535&f,m+=f>>>16,p+=d>>>16,g+=p>>>16,m+=g>>>16,r[1]=y=65535&g|m<<16,n[1]=I=65535&d|p<<16,f=v,d=65535&(c=A),p=c>>>16,g=65535&f,m=f>>>16,f=r[2],d+=65535&(c=n[2]),p+=c>>>16,g+=65535&f,m+=f>>>16,p+=d>>>16,g+=p>>>16,m+=g>>>16,r[2]=v=65535&g|m<<16,n[2]=A=65535&d|p<<16,f=w,d=65535&(c=R),p=c>>>16,g=65535&f,m=f>>>16,f=r[3],d+=65535&(c=n[3]),p+=c>>>16,g+=65535&f,m+=f>>>16,p+=d>>>16,g+=p>>>16,m+=g>>>16,r[3]=w=65535&g|m<<16,n[3]=R=65535&d|p<<16,f=_,d=65535&(c=D),p=c>>>16,g=65535&f,m=f>>>16,f=r[4],d+=65535&(c=n[4]),p+=c>>>16,g+=65535&f,m+=f>>>16,p+=d>>>16,g+=p>>>16,m+=g>>>16,r[4]=_=65535&g|m<<16,n[4]=D=65535&d|p<<16,f=E,d=65535&(c=O),p=c>>>16,g=65535&f,m=f>>>16,f=r[5],d+=65535&(c=n[5]),p+=c>>>16,g+=65535&f,m+=f>>>16,p+=d>>>16,g+=p>>>16,m+=g>>>16,r[5]=E=65535&g|m<<16,n[5]=O=65535&d|p<<16,f=x,d=65535&(c=P),p=c>>>16,g=65535&f,m=f>>>16,f=r[6],d+=65535&(c=n[6]),p+=c>>>16,g+=65535&f,m+=f>>>16,p+=d>>>16,g+=p>>>16,m+=g>>>16,r[6]=x=65535&g|m<<16,n[6]=P=65535&d|p<<16,f=S,d=65535&(c=N),p=c>>>16,g=65535&f,m=f>>>16,f=r[7],d+=65535&(c=n[7]),p+=c>>>16,g+=65535&f,m+=f>>>16,p+=d>>>16,g+=p>>>16,m+=g>>>16,r[7]=S=65535&g|m<<16,n[7]=N=65535&d|p<<16,a+=128,u-=128}return a}t.hash=function(e){var t=new s;t.update(e);var r=t.digest();return t.clean(),r}},2368:(e,t)=>{"use strict";
182Object.defineProperty(t,"__esModule",{value:!0}),t.wipe=function(e){for(var t=0;t<e.length;t++)e[t]=0;return e}},8502:(e,t,r)=>{"use strict";t.Tc=t.TZ=t.wE=t.Xx=void 0;let i=r(9992),n=r(2368);function s(e){let t=new Float64Array(16);if(e)for(let r=0;r<e.length;r++)t[r]=e[r];return t}t.Xx=32,t.wE=32;let o=new Uint8Array(32);o[0]=9;let a=s([56129,1]);function u(e){let t=1;for(let r=0;r<16;r++){let i=e[r]+t+65535;t=Math.floor(i/65536),e[r]=i-65536*t}e[0]+=t-1+37*(t-1)}function f(e,t,r){let i=~(r-1);for(let r=0;r<16;r++){let n=i&(e[r]^t[r]);e[r]^=n,t[r]^=n}}function c(e,t,r){for(let i=0;i<16;i++)e[i]=t[i]+r[i]}function h(e,t,r){for(let i=0;i<16;i++)e[i]=t[i]-r[i]}function l(e,t,r){let i,n,s=0,o=0,a=0,u=0,f=0,c=0,h=0,l=0,d=0,p=0,g=0,m=0,b=0,y=0,v=0,w=0,_=0,E=0,x=0,S=0,M=0,I=0,A=0,R=0,D=0,O=0,P=0,N=0,T=0,k=0,C=0,L=r[0],U=r[1],j=r[2],B=r[3],q=r[4],z=r[5],F=r[6],$=r[7],H=r[8],K=r[9],V=r[10],G=r[11],W=r[12],J=r[13],X=r[14],Y=r[15];s+=(i=t[0])*L,o+=i*U,a+=i*j,u+=i*B,f+=i*q,c+=i*z,h+=i*F,l+=i*$,d+=i*H,p+=i*K,g+=i*V,m+=i*G,b+=i*W,y+=i*J,v+=i*X,w+=i*Y,o+=(i=t[1])*L,a+=i*U,u+=i*j,f+=i*B,c+=i*q,h+=i*z,l+=i*F,d+=i*$,p+=i*H,g+=i*K,m+=i*V,b+=i*G,y+=i*W,v+=i*J,w+=i*X,_+=i*Y,a+=(i=t[2])*L,u+=i*U,f+=i*j,c+=i*B,h+=i*q,l+=i*z,d+=i*F,p+=i*$,g+=i*H,m+=i*K,b+=i*V,y+=i*G,v+=i*W,w+=i*J,_+=i*X,E+=i*Y,u+=(i=t[3])*L,f+=i*U,c+=i*j,h+=i*B,l+=i*q,d+=i*z,p+=i*F,g+=i*$,m+=i*H,b+=i*K,y+=i*V,v+=i*G,w+=i*W,_+=i*J,E+=i*X,x+=i*Y,f+=(i=t[4])*L,c+=i*U,h+=i*j,l+=i*B,d+=i*q,p+=i*z,g+=i*F,m+=i*$,b+=i*H,y+=i*K,v+=i*V,w+=i*G,_+=i*W,E+=i*J,x+=i*X,S+=i*Y,c+=(i=t[5])*L,h+=i*U,l+=i*j,d+=i*B,p+=i*q,g+=i*z,m+=i*F,b+=i*$,y+=i*H,v+=i*K,w+=i*V,_+=i*G,E+=i*W,x+=i*J,S+=i*X,M+=i*Y,h+=(i=t[6])*L,l+=i*U,d+=i*j,p+=i*B,g+=i*q,m+=i*z,b+=i*F,y+=i*$,v+=i*H,w+=i*K,_+=i*V,E+=i*G,x+=i*W,S+=i*J,M+=i*X,I+=i*Y,l+=(i=t[7])*L,d+=i*U,p+=i*j,g+=i*B,m+=i*q,b+=i*z,y+=i*F,v+=i*$,w+=i*H,_+=i*K,E+=i*V,x+=i*G,S+=i*W,M+=i*J,I+=i*X,A+=i*Y,d+=(i=t[8])*L,p+=i*U,g+=i*j,m+=i*B,b+=i*q,y+=i*z,v+=i*F,w+=i*$,_+=i*H,E+=i*K,x+=i*V,S+=i*G,M+=i*W,I+=i*J,A+=i*X,R+=i*Y,p+=(i=t[9])*L,g+=i*U,m+=i*j,b+=i*B,y+=i*q,v+=i*z,w+=i*F,_+=i*$,E+=i*H,x+=i*K,S+=i*V,M+=i*G,I+=i*W,A+=i*J,R+=i*X,D+=i*Y,g+=(i=t[10])*L,m+=i*U,b+=i*j,y+=i*B,v+=i*q,w+=i*z,_+=i*F,E+=i*$,x+=i*H,S+=i*K,M+=i*V,I+=i*G,A+=i*W,R+=i*J,D+=i*X,O+=i*Y,m+=(i=t[11])*L,b+=i*U,y+=i*j,v+=i*B,w+=i*q,_+=i*z,E+=i*F,x+=i*$,S+=i*H,M+=i*K,I+=i*V,A+=i*G,R+=i*W,D+=i*J,O+=i*X,P+=i*Y,b+=(i=t[12])*L,y+=i*U,v+=i*j,w+=i*B,_+=i*q,E+=i*z,x+=i*F,S+=i*$,M+=i*H,I+=i*K,A+=i*V,R+=i*G,D+=i*W,O+=i*J,P+=i*X,N+=i*Y,y+=(i=t[13])*L,v+=i*U,w+=i*j,_+=i*B,E+=i*q,x+=i*z,S+=i*F,M+=i*$,I+=i*H,A+=i*K,R+=i*V,D+=i*G,O+=i*W,P+=i*J,N+=i*X,T+=i*Y,v+=(i=t[14])*L,w+=i*U,_+=i*j,E+=i*B,x+=i*q,S+=i*z,M+=i*F,I+=i*$,A+=i*H,R+=i*K,D+=i*V,O+=i*G,P+=i*W,N+=i*J,T+=i*X,k+=i*Y,w+=(i=t[15])*L,_+=i*U,E+=i*j,x+=i*B,S+=i*q,M+=i*z,I+=i*F,A+=i*$,R+=i*H,D+=i*K,O+=i*V,P+=i*G,N+=i*W,T+=i*J,k+=i*X,C+=i*Y,s+=38*_,o+=38*E,a+=38*x,u+=38*S,f+=38*M,c+=38*I,h+=38*A,l+=38*R,d+=38*D,p+=38*O,g+=38*P,m+=38*N,b+=38*T,y+=38*k,v+=38*C,n=Math.floor((i=s+(n=1)+65535)/65536),s=i-65536*n,n=Math.floor((i=o+n+65535)/65536),o=i-65536*n,n=Math.floor((i=a+n+65535)/65536),a=i-65536*n,n=Math.floor((i=u+n+65535)/65536),u=i-65536*n,n=Math.floor((i=f+n+65535)/65536),f=i-65536*n,n=Math.floor((i=c+n+65535)/65536),c=i-65536*n,n=Math.floor((i=h+n+65535)/65536),h=i-65536*n,n=Math.floor((i=l+n+65535)/65536),l=i-65536*n,n=Math.floor((i=d+n+65535)/65536),d=i-65536*n,n=Math.floor((i=p+n+65535)/65536),p=i-65536*n,n=Math.floor((i=g+n+65535)/65536),g=i-65536*n,n=Math.floor((i=m+n+65535)/65536),m=i-65536*n,n=Math.floor((i=b+n+65535)/65536),b=i-65536*n,n=Math.floor((i=y+n+65535)/65536),y=i-65536*n,n=Math.floor((i=v+n+65535)/65536),v=i-65536*n,n=Math.floor((i=w+n+65535)/65536),w=i-65536*n,s+=n-1+37*(n-1),n=Math.floor((i=s+(n=1)+65535)/65536),s=i-65536*n,n=Math.floor((i=o+n+65535)/65536),o=i-65536*n,n=Math.floor((i=a+n+65535)/65536),a=i-65536*n,n=Math.floor((i=u+n+65535)/65536),u=i-65536*n,n=Math.floor((i=f+n+65535)/65536),f=i-65536*n,n=Math.floor((i=c+n+65535)/65536),c=i-65536*n,n=Math.floor((i=h+n+65535)/65536),h=i-65536*n,n=Math.floor((i=l+n+65535)/65536),l=i-65536*n,n=Math.floor((i=d+n+65535)/65536),d=i-65536*n,n=Math.floor((i=p+n+65535)/65536),p=i-65536*n,n=Math.floor((i=g+n+65535)/65536),g=i-65536*n,n=Math.floor((i=m+n+65535)/65536),m=i-65536*n,n=Math.floor((i=b
182+n+65535)/65536),b=i-65536*n,n=Math.floor((i=y+n+65535)/65536),y=i-65536*n,n=Math.floor((i=v+n+65535)/65536),v=i-65536*n,n=Math.floor((i=w+n+65535)/65536),w=i-65536*n,s+=n-1+37*(n-1),e[0]=s,e[1]=o,e[2]=a,e[3]=u,e[4]=f,e[5]=c,e[6]=h,e[7]=l,e[8]=d,e[9]=p,e[10]=g,e[11]=m,e[12]=b,e[13]=y,e[14]=v,e[15]=w}function d(e,t){let r=new Uint8Array(32),i=new Float64Array(80),n=s(),o=s(),d=s(),p=s(),g=s(),m=s();for(let t=0;t<31;t++)r[t]=e[t];r[31]=127&e[31]|64,r[0]&=248,function(e,t){for(let r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(i,t);for(let e=0;e<16;e++)o[e]=i[e];n[0]=p[0]=1;for(let e=254;e>=0;--e){let t=r[e>>>3]>>>(7&e)&1;f(n,o,t),f(d,p,t),c(g,n,d),h(n,n,d),c(d,o,p),h(o,o,p),l(p,g,g),l(m,n,n),l(n,d,n),l(d,o,g),c(g,n,d),h(n,n,d),l(o,n,n),h(d,p,m),l(n,d,a),c(n,n,p),l(d,d,n),l(n,p,m),l(p,o,i),l(o,g,g),f(n,o,t),f(d,p,t)}for(let e=0;e<16;e++)i[e+16]=n[e],i[e+32]=d[e],i[e+48]=o[e],i[e+64]=p[e];let b=i.subarray(32),y=i.subarray(16);!function(e,t){let r=s();for(let e=0;e<16;e++)r[e]=t[e];for(let e=253;e>=0;e--)l(r,r,r),2!==e&&4!==e&&l(r,r,t);for(let t=0;t<16;t++)e[t]=r[t]}(b,b),l(y,y,b);let v=new Uint8Array(32);return!function(e,t){let r=s(),i=s();for(let e=0;e<16;e++)i[e]=t[e];u(i),u(i),u(i);for(let e=0;e<2;e++){r[0]=i[0]-65517;for(let e=1;e<15;e++)r[e]=i[e]-65535-(r[e-1]>>16&1),r[e-1]&=65535;r[15]=i[15]-32767-(r[14]>>16&1);let e=r[15]>>16&1;r[14]&=65535,f(i,r,1-e)}for(let t=0;t<16;t++)e[2*t]=255&i[t],e[2*t+1]=i[t]>>8}(v,y),v}t.TZ=function(e){let r=(0,i.randomBytes)(32,e),s=function(e){if(e.length!==t.wE)throw Error(`x25519: seed must be ${t.wE} bytes`);let r=new Uint8Array(e);return{publicKey:d(r,o),secretKey:r}}(r);return(0,n.wipe)(r),s},t.Tc=function(e,r,i=!1){if(e.length!==t.Xx)throw Error("X25519: incorrect secret key length");if(r.length!==t.Xx)throw Error("X25519: incorrect public key length");let n=d(e,r);if(i){let e=0;for(let t=0;t<n.length;t++)e|=n[t];if(0===e)throw Error("X25519: invalid shared key")}return n}},2253:(e,t,r)=>{"use strict";function i(){return(null===r.g||void 0===r.g?void 0:r.g.crypto)||(null===r.g||void 0===r.g?void 0:r.g.msCrypto)||{}}function n(){let e=i();return e.subtle||e.webkitSubtle}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=i,t.getSubtleCrypto=n,t.isBrowserCryptoAvailable=function(){return!!i()&&!!n()}},6263:(e,t,r)=>{"use strict";var i=r(2818);function n(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function s(){return void 0!==i&&void 0!==i.versions&&void 0!==i.versions.node}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=t.isNode=t.isReactNative=void 0,t.isReactNative=n,t.isNode=s,t.isBrowser=function(){return!n()&&!s()}},4144:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(4092);i.__exportStar(r(2253),t),i.__exportStar(r(6263),t)},4092:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__assign:()=>s,__asyncDelegator:()=>w,__asyncGenerator:()=>v,__asyncValues:()=>_,__await:()=>y,__awaiter:()=>c,__classPrivateFieldGet:()=>M,__classPrivateFieldSet:()=>I,__createBinding:()=>l,__decorate:()=>a,__exportStar:()=>d,__extends:()=>n,__generator:()=>h,__importDefault:()=>S,__importStar:()=>
vendor: 5,187 bytes, line 182
182x,__makeTemplateObject:()=>E,__metadata:()=>f,__param:()=>u,__read:()=>g,__rest:()=>o,__spread:()=>m,__spreadArrays:()=>b,__values:()=>p});var i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function n(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return(s=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function o(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);n<i.length;n++)0>t.indexOf(i[n])&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]]);return r}function a(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o}function u(e,t){return function(r,i){t(r,i,e)}}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,r,i){return new(r||(r=Promise))(function(n,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function a(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}u((i=i.apply(e,t||[])).next())})}function h(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(n=(n=o.trys).length>0&&n[n.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function l(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}function d(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function b(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var i=Array(e),n=0,t=0;t<r;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i}function y(e){return this instanceof y?(this.v=e,this):new y(e)}function v(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var i,n=r.apply(e,t||[]),s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(e){n[e]&&(i[e]=function(t){return new Promise(function(r,i){s.push([e,t,r,i])>1||a(e,t)})})}function a(e,t){try{var r;(r=n[e](t)).value instanceof y?Promise.resolve(r.value.v).then(u,f):c(s[0][2],r)}catch(e){c(s[0][3],e)}}function u(e){a("next",e)}function f(e){a("throw",e)}function c(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function w(e){var t,r;return t={},i("next"),i("throw",function(e){throw e}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,n){t[i]=e[i]?function(t){return(r=!r)?{value:y(e[i](t)),done:"return"===i}:n?n(t):t}:n}}function _(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(r){t[r]=e[r]&&function(t){return new Promise(function(i,n){!function(e,t,r,i){Promise.resolve(i).then(function(t){e({value:t,done:r})},t)}(i,n,(t=e[r](t)).done,t.value)})}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}
182function x(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function S(e){return e&&e.__esModule?e:{default:e}}function M(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}function I(e,t,r){if(!t.has(e))throw TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},3244:e=>{"use strict";e.exports=function(){throw Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},1285:()=>{},1842:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(5656);i.__exportStar(r(1302),t),i.__exportStar(r(99),t)},1302:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_THOUSAND=t.ONE_HUNDRED=void 0,t.ONE_HUNDRED=100,t.ONE_THOUSAND=1e3},99:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=5*t.ONE_MINUTE,t.TEN_MINUTES=10*t.ONE_MINUTE,t.THIRTY_MINUTES=30*t.ONE_MINUTE,t.SIXTY_MINUTES=60*t.ONE_MINUTE,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=3*t.ONE_HOUR,t.SIX_HOURS=6*t.ONE_HOUR,t.TWELVE_HOURS=12*t.ONE_HOUR,t.TWENTY_FOUR_HOURS=24*t.ONE_HOUR,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=3*t.ONE_DAY,t.FIVE_DAYS=5*t.ONE_DAY,t.SEVEN_DAYS=7*t.ONE_DAY,t.THIRTY_DAYS=30*t.ONE_DAY,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=2*t.ONE_WEEK,t.THREE_WEEKS=3*t.ONE_WEEK,t.FOUR_WEEKS=4*t.ONE_WEEK,t.ONE_YEAR=365*t.ONE_DAY},9652:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(5656);i.__exportStar(r(7590),t),i.__exportStar(r(8895),t),i.__exportStar(r(6858),t),i.__exportStar(r(1842),t)},6858:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(5656).__exportStar(r(233),t)},233:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IWatch=void 0;class r{}t.IWatch=r},6801:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromMiliseconds=t.toMiliseconds=void 0;let i=r(1842);t.toMiliseconds=function(e){return e*i.ONE_THOUSAND},t.fromMiliseconds=function(e){return Math.floor(e/i.ONE_THOUSAND)}},1825:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0,t.delay=function(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}},7590:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let i=r(5656);i.__exportStar(r(1825),t),i.__exportStar(r(6801),t)},8895:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){let t=this.get(e);if(void 0!==t.elapsed)throw Error(`Watch already stopped for label: ${e}`);let r=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:r})}get(e){let t=this.timestamps.get(e);if(void 0===t)throw Error(`No timestamp found for label: ${e}`);return t}elapsed(e){let t=this.get(e);return t.elapsed||Date.now()-t.started}}t.Watch=r,t.default=r},5656:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__assign:()=>s,__asyncDelegator:()=>w,__asyncGenerator:()=>v,__asyncValues:()=>_,__await:()=>y,__awaiter:()=>c,__classPrivateFieldGet:()=>M,__classPrivateFieldSet:()=>I,__createBinding:()=>l,__decorate:()=>a,__exportStar:()=>d,__extends:()=>n,__generator:()=>h,__importDefault:()=>S,__importStar:()=>
vendor: 5,187 bytes, line 182
182x,__makeTemplateObject:()=>E,__metadata:()=>f,__param:()=>u,__read:()=>g,__rest:()=>o,__spread:()=>m,__spreadArrays:()=>b,__values:()=>p});var i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function n(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return(s=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function o(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);n<i.length;n++)0>t.indexOf(i[n])&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]]);return r}function a(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o}function u(e,t){return function(r,i){t(r,i,e)}}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,r,i){return new(r||(r=Promise))(function(n,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function a(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}u((i=i.apply(e,t||[])).next())})}function h(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(n=(n=o.trys).length>0&&n[n.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function l(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}function d(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function b(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var i=Array(e),n=0,t=0;t<r;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i}function y(e){return this instanceof y?(this.v=e,this):new y(e)}function v(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var i,n=r.apply(e,t||[]),s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(e){n[e]&&(i[e]=function(t){return new Promise(function(r,i){s.push([e,t,r,i])>1||a(e,t)})})}function a(e,t){try{var r;(r=n[e](t)).value instanceof y?Promise.resolve(r.value.v).then(u,f):c(s[0][2],r)}catch(e){c(s[0][3],e)}}function u(e){a("next",e)}function f(e){a("throw",e)}function c(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function w(e){var t,r;return t={},i("next"),i("throw",function(e){throw e}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,n){t[i]=e[i]?function(t){return(r=!r)?{value:y(e[i](t)),done:"return"===i}:n?n(t):t}:n}}function _(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(r){t[r]=e[r]&&function(t){return new Promise(function(i,n){!function(e,t,r,i){Promise.resolve(i).then(function(t){e({value:t,done:r})},t)}(i,n,(t=e[r](t)).done,t.value)})}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}
182function x(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function S(e){return e&&e.__esModule?e:{default:e}}function M(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}function I(e,t,r){if(!t.has(e))throw TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},5208:(e,t)=>{"use strict";function r(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function i(e){let t=r(e);if(!t)throw Error(`${e} is not defined in Window`);return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=r,t.getFromWindowOrThrow=i,t.getDocumentOrThrow=function(){return i("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return i("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return i("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return i("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return i("localStorage")},t.getLocalStorage=function(){return r("localStorage")}},9973:(e,t,r)=>{"use strict";t.g=void 0;let i=r(5208);t.g=function(){let e,t,r;try{e=i.getDocumentOrThrow(),t=i.getLocationOrThrow()}catch(e){return null}function n(...t){let r=e.getElementsByTagName("meta");for(let e=0;e<r.length;e++){let i=r[e],n=["itemprop","property","name"].map(e=>i.getAttribute(e)).filter(e=>!!e&&t.includes(e));if(n.length&&n){let e=i.getAttribute("content");if(e)return e}}return""}let s=((r=n("name","og:site_name","og:title","twitter:title"))||(r=e.title),r),o=n("description","og:description","twitter:description","keywords");return{description:o,url:t.origin,icons:function(){let r=e.getElementsByTagName("link"),i=[];for(let e=0;e<r.length;e++){let n=r[e],s=n.getAttribute("rel");if(s&&s.toLowerCase().indexOf("icon")>-1){let e=n.getAttribute("href");if(e){if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let r=t.protocol+"//"+t.host;if(0===e.indexOf("/"))r+=e;else{let i=t.pathname.split("/");i.pop(),r+=i.join("/")+"/"+e}i.push(r)}else if(0===e.indexOf("//")){let r=t.protocol+e;i.push(r)}else i.push(e)}}}return i}(),name:s}}},6800:e=>{"use strict";let{AbortController:t,AbortSignal}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=AbortSignal,e.exports.default=t},3836:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],i=t[1];return(r+i)*3/4-i},t.toByteArray=function(e){var t,r,s=u(e),o=s[0],a=s[1],f=new n((o+a)*3/4-a),c=0,h=a>0?o-4:o;for(r=0;r<h;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],f[c++]=t>>16&255,f[c++]=t>>8&255,f[c++]=255&t;return 2===a&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,f[c++]=255&t),1===a&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,f[c++]=t>>8&255,f[c++]=255&t),f},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,s=[],o=0,a=i-n;o<a;o+=16383)s.push(function(e,t,i){for(var n,s=[],o=t;o<i;o+=3)s.push(r[(n=(e[o]<<16&0xff0000)+(e[o+1]<<8&65280)+(255&e[o+2]))>>18&63]+r[n>>12&63]+r[n>>6&63]+r[63&n]);return s.join("")}(e,o,o+16383>a?a:o+16383));return 1===n?s.push(r[(t=e[i-1])>>2]+r[t<<4&63]+"=="):2===n&&s.push(r[(t=(e[i-2]<<8)+e[i-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),s.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=s.length;o<a;++o)r[o]=s[o],i[s.charCodeAt(o)]=o;function u(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var i=r===t?0:4-r%4;return[r,i]}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},5852:function(e,t,r){!function(e,t){"use strict";function i(e,t){if(!e)throw Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function s(e,t,r){if(s.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&(("le"===t||"be"===t)&&(r=t,t=10),this._init(e||0,t||10,r||"be"))}
vendor: 4,123 bytes, line 182
182"object"==typeof e?e.exports=s:t.BN=s,s.BN=s,s.wordSize=26;try{f="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(7790).Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=o(e,r);return r-1>=t&&(i|=o(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,s=Math.min(e.length,r),o=t;o<s;o++){var a=e.charCodeAt(o)-48;n*=i,a>=49?n+=a-49+10:a>=17?n+=a-17+10:n+=a}return n}s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return 0>e.cmp(t)?e:t},s.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,r):(this._parseBase(e,t,n),"le"===r&&this._initArray(this.toArray(),t,r)))},s.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<0x4000000?(this.words=[0x3ffffff&e],this.length=1):e<0x10000000000000?(this.words=[0x3ffffff&e,e/0x4000000&0x3ffffff],this.length=2):(i(e<0x20000000000000),this.words=[0x3ffffff&e,e/0x4000000&0x3ffffff,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},s.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=Array(this.length);for(var n,s,o=0;o<this.length;o++)this.words[o]=0;var a=0;if("be"===r)for(o=e.length-1,n=0;o>=0;o-=3)s=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[n]|=s<<a&0x3ffffff,this.words[n+1]=s>>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,n++);else if("le"===r)for(o=0,n=0;o<e.length;o+=3)s=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[n]|=s<<a&0x3ffffff,this.words[n+1]=s>>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,n++);return this.strip()},s.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var i,n=0;n<this.length;n++)this.words[n]=0;var s=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=a(e,t,n)<<s,this.words[o]|=0x3ffffff&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=a(e,t,n)<<s,this.words[o]|=0x3ffffff&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;this.strip()},s.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=0x3ffffff;n*=t)i++;i--,n=n/t|0;for(var s=e.length-r,o=s%i,a=Math.min(s,s-o)+r,f=0,c=r;c<a;c+=i)f=u(e,c,c+i,t),this.imuln(n),this.words[0]+f<0x4000000?this.words[0]+=f:this._iaddn(f);if(0!==o){var h=1;for(f=u(e,c,e.length,t),c=0;c<o;c++)h*=t;this.imuln(h),this.words[0]+f<0x4000000?this.words[0]+=f:this._iaddn(f)}this.strip()},s.prototype.copy=function(e){e.words=Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},s.prototype.clone=function(){var e=new s(null);return this.copy(e),e},s.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f,c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[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],l=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,
vendor: 6,188 bytes, line 182
1820x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];function d(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],s=0|t.words[0],o=n*s,a=0x3ffffff&o,u=o/0x4000000|0;r.words[0]=a;for(var f=1;f<i;f++){for(var c=u>>>26,h=0x3ffffff&u,l=Math.min(f,t.length-1),d=Math.max(0,f-e.length+1);d<=l;d++){var p=f-d|0;c+=(o=(n=0|e.words[p])*(s=0|t.words[d])+h)/0x4000000|0,h=0x3ffffff&o}r.words[f]=0|h,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}s.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var r,n=0,s=0,o=0;o<this.length;o++){var a=this.words[o],u=((a<<n|s)&0xffffff).toString(16);r=0!=(s=a>>>24-n&0xffffff)||o!==this.length-1?c[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(r=s.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var f=h[e],d=l[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?g+r:c[f-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?e+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(e,t){return i(void 0!==f),this.toArrayLike(f,e,t)},s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,r){var n,s,o=this.byteLength(),a=r||Math.max(1,o);i(o<=a,"byte array longer than desired length"),i(a>0,"Requested array length <= 0"),this.strip();var u=new e(a),f=this.clone();if("le"===t){for(s=0;!f.isZero();s++)n=f.andln(255),f.iushrn(8),u[s]=n;for(;s<a;s++)u[s]=0}else{for(s=0;s<a-o;s++)u[s]=0;for(s=0;!f.isZero();s++)n=f.andln(255),f.iushrn(8),u[a-s-1]=n}return u},Math.clz32?s.prototype._countBits=function(e){return 32-Math.clz32(e)}:s.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return(8191&t)==0&&(r+=13,t>>>=13),(127&t)==0&&(r+=7,t>>>=7),(15&t)==0&&(r+=4,t>>>=4),(3&t)==0&&(r+=2,t>>>=2),(1&t)==0&&r++,r},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},s.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},s.prototype.ior=function(e){return i((this.negative|e.negative)==0),this.iuor(e)},s.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},s.prototype.iand=function(e){return i((this.negative|e.negative)==0),this.iuand(e)},s.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){this.length>e.length?(t=this,r=e):(t=e,r=this);for(var t,r,i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},s.prototype.ixor=function(e){return i((this.negative|e.negative)==0),this.iuxor(e)},s.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=0x3ffffff&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-r),this.strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),t?this.words[r]=this.words[r]|1<<n:this.words[r]=this.words[r]&~(1<<n),this.strip()},s.prototype.iadd=function(e){if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var t,r,i,n=0,s=0;s<i.length;s++)t=(0|r.words[s])+(0|i.words[s])+n,this.words[s]=0x3ffffff&t,n=t>>>26;for(;0!==n&&s<r.length;s++)t=(0|r.words[s])+n,this.words[s]=0x3ffffff&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},s.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;
vendor: 8,236 bytes, line 182
182var t,r,i=this.iadd(e);return e.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(t=this,r=e):(t=e,r=this);for(var s=0,o=0;o<r.length;o++)s=(i=(0|t.words[o])-(0|r.words[o])+s)>>26,this.words[o]=0x3ffffff&i;for(;0!==s&&o<t.length;o++)s=(i=(0|t.words[o])+s)>>26,this.words[o]=0x3ffffff&i;if(0===s&&o<t.length&&t!==this)for(;o<t.length;o++)this.words[o]=t.words[o];return this.length=Math.max(this.length,o),t!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var i,n,s,o=e.words,a=t.words,u=r.words,f=0,c=0|o[0],h=8191&c,l=c>>>13,d=0|o[1],p=8191&d,g=d>>>13,m=0|o[2],b=8191&m,y=m>>>13,v=0|o[3],w=8191&v,_=v>>>13,E=0|o[4],x=8191&E,S=E>>>13,M=0|o[5],I=8191&M,A=M>>>13,R=0|o[6],D=8191&R,O=R>>>13,P=0|o[7],N=8191&P,T=P>>>13,k=0|o[8],C=8191&k,L=k>>>13,U=0|o[9],j=8191&U,B=U>>>13,q=0|a[0],z=8191&q,F=q>>>13,$=0|a[1],H=8191&$,K=$>>>13,V=0|a[2],G=8191&V,W=V>>>13,J=0|a[3],X=8191&J,Y=J>>>13,Z=0|a[4],Q=8191&Z,ee=Z>>>13,et=0|a[5],er=8191&et,ei=et>>>13,en=0|a[6],es=8191&en,eo=en>>>13,ea=0|a[7],eu=8191&ea,ef=ea>>>13,ec=0|a[8],eh=8191&ec,el=ec>>>13,ed=0|a[9],ep=8191&ed,eg=ed>>>13;r.negative=e.negative^t.negative,r.length=19;var em=(f+(i=Math.imul(h,z))|0)+((8191&(n=(n=Math.imul(h,F))+Math.imul(l,z)|0))<<13)|0;f=((s=Math.imul(l,F))+(n>>>13)|0)+(em>>>26)|0,em&=0x3ffffff,i=Math.imul(p,z),n=(n=Math.imul(p,F))+Math.imul(g,z)|0,s=Math.imul(g,F);var eb=(f+(i=i+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,K)|0)+Math.imul(l,H)|0))<<13)|0;f=((s=s+Math.imul(l,K)|0)+(n>>>13)|0)+(eb>>>26)|0,eb&=0x3ffffff,i=Math.imul(b,z),n=(n=Math.imul(b,F))+Math.imul(y,z)|0,s=Math.imul(y,F),i=i+Math.imul(p,H)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(g,H)|0,s=s+Math.imul(g,K)|0;var ey=(f+(i=i+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,W)|0)+Math.imul(l,G)|0))<<13)|0;f=((s=s+Math.imul(l,W)|0)+(n>>>13)|0)+(ey>>>26)|0,ey&=0x3ffffff,i=Math.imul(w,z),n=(n=Math.imul(w,F))+Math.imul(_,z)|0,s=Math.imul(_,F),i=i+Math.imul(b,H)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(y,H)|0,s=s+Math.imul(y,K)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(g,G)|0,s=s+Math.imul(g,W)|0;var ev=(f+(i=i+Math.imul(h,X)|0)|0)+((8191&(n=(n=n+Math.imul(h,Y)|0)+Math.imul(l,X)|0))<<13)|0;f=((s=s+Math.imul(l,Y)|0)+(n>>>13)|0)+(ev>>>26)|0,ev&=0x3ffffff,i=Math.imul(x,z),n=(n=Math.imul(x,F))+Math.imul(S,z)|0,s=Math.imul(S,F),i=i+Math.imul(w,H)|0,n=(n=n+Math.imul(w,K)|0)+Math.imul(_,H)|0,s=s+Math.imul(_,K)|0,i=i+Math.imul(b,G)|0,n=(n=n+Math.imul(b,W)|0)+Math.imul(y,G)|0,s=s+Math.imul(y,W)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,X)|0,s=s+Math.imul(g,Y)|0;var ew=(f+(i=i+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,ee)|0)+Math.imul(l,Q)|0))<<13)|0;f=((s=s+Math.imul(l,ee)|0)+(n>>>13)|0)+(ew>>>26)|0,ew&=0x3ffffff,i=Math.imul(I,z),n=(n=Math.imul(I,F))+Math.imul(A,z)|0,s=Math.imul(A,F),i=i+Math.imul(x,H)|0,n=(n=n+Math.imul(x,K)|0)+Math.imul(S,H)|0,s=s+Math.imul(S,K)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,G)|0,s=s+Math.imul(_,W)|0,i=i+Math.imul(b,X)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(y,X)|0,s=s+Math.imul(y,Y)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(g,Q)|0,s=s+Math.imul(g,ee)|0;var e_=(f+(i=i+Math.imul(h,er)|0)|0)+((8191&(n=(n=n+Math.imul(h,ei)|0)+Math.imul(l,er)|0))<<13)|0;f=((s=s+Math.imul(l,ei)|0)+(n>>>13)|0)+(e_>>>26)|0,e_&=0x3ffffff,i=Math.imul(D,z),n=(n=Math.imul(D,F))+Math.imul(O,z)|0,s=Math.imul(O,F),i=i+Math.imul(I,H)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(A,H)|0,s=s+Math.imul(A,K)|0,i=i+Math.imul(x,G)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(S,G)|0,s=s+Math.imul(S,W)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,X)|0,s=s+Math.imul(_,Y)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(y,Q)|0,s=s+Math.imul(y,ee)|0,i=i+Math.imul(p,er)|0,n=(n=n+Math.imul(p,ei)|0)+Math.imul(g,er)|0,s=s+Math.imul(g,ei)|0;var eE=(f+(i=i+Math.imul(h,es)|0)|0)+((8191&(n=(n=n+Math.imul(h,eo)|0)+Math.imul(l,es)|0))<<13)|0;f=((s=s+Math.imul(l,eo)|0)+(n>>>13)|0)+(eE>>>26)|0,eE&=0x3ffffff,i=Math.imul(N,z),n=(n=Math.imul(N,F))+Math.imul(T,z)|0,s=Math.imul(T,F),i=i+Math.imul(D,H)|0,n=(n=n+Math.imul(D,K)|0)+Math.imul(O,H)|0,s=s+Math.imul(O,K)|0,i=i+Math.imul(I,G)|0,n=(n=n+Math.imul(I,W)|0)+Math.imul(A,G)|0,s=s+Math.imul(A,W)|0,i=i+Math.imul(x,X)|0,n=(n=n+Math.imul(x,Y)|0)+Math.imul(S,X)|0,s=s+Math.imul(S,Y)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,ee)|0,i=i+Math.imul(b,er)|0,n=(n=n+Math.imul(b,ei)|0)+Math.imul(y,er)|0,s=s+Math.imul(y,ei)|0,i=i+Math.imul(p,es)|0,n=(n=n+Math.imul(p,eo)|0)+Math.imul(g,es)|0,s=s+Math.imul(g,eo)|0;var ex=(f+(i=i+Math.imul(h,eu)|0)|0)+((8191&(n=(n=n+Math.imul(h,ef)|0)+Math.imul(l,eu)|0))<<13)|0;f=((s=s+Math.imul(l,ef)|0)+(n>>>13)|0)+(ex>>>26)|0,ex&=0x3ffffff,i=Math.imul(C,z),n=(n=Math.imul(C,F))+Math.imul(L,z)|0,s=Math.imul(L,F),i=i+Math.imul(N,H)|0,n=(n=n+Math.imul(N,K)|0)+Math.imul(T,H)|0,s=s+Math.imul(T,K)|0,i=i+Math.imul(D,G)|0,n=(n=n+Math.imul(D,W)|0)+Math.imul(O,G)|0,s=s+Math.imul(O,W)|0,i=i+Math.imul(I,X)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(A,X)|0,s=s+Math.imul(A,Y)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,ee)|0,i=i+Math.imul(w,er)|0,n=(n=n+Math.imul(w,ei)|0)+Math.imul(_,er)|0,s=s+Math.imul(_,ei)|0,i=i+Math.imul(b,es)|0,n=(n=n+Math.imul(b,eo)|0)+Math.imul(y,es)|0,s=s+Math.imul(y,eo)|0,i=i+Math.imul(p,eu)|0,n=(n=n+Math.imul(p,ef)|0)+Math.imul(g,eu)|0,s=s+Math.imul(g,ef)|0;var eS=(f+(i=i+Math.imul(h,eh)|0)|0)+((8191&(n=(n=n+Math.imul(h,el)|0)+Math.imul(l,eh)|0))<<13)|0;f=((s=s+Math.imul(l,el)|0)+(n>>>13)|0)+(eS>>>26)|0,eS&=0x3ffffff,i=Math.imul(j,z),n=(n=Math.imul(j,F))+Math.imul(B,z)|0,s=Math.imul(B,F),i=i+Math.imul(C,H)|0,n=(n=n+Math.imul(C,K)|0)+Math.imul(L,H)|0,s=s+Math.imul(L,K)|0,i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(T,G)|0,s=s+Math.imul(T,W)|0,i=i+Math.imul(D,X)|0,n=(n=n+Math.imul(D,Y)|0)+Math.imul(O,X)|0,s=s+Math.imul(O,Y)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(A,Q)|0,s=s+Math.imul(A,ee)|0,i=i+Math.imul(x,er)|0,n=(n=n+Math.imul(x,ei)|0)+Math.imul(S,er)|0,s=s+Math.imul(S,ei)|0,i=i+Math.imul(w,es)|0,n=(n=n+Math.imul(w,eo)|0)+Math.imul(_,es)|0,s=s+Math.imul(_,eo)|0,i=i+Math.imul(b,eu)|0,n=(n=n+Math.imul(b,ef)|0)+Math.imul(y,eu)|0,s=s+Math.imul(y,ef)|0,i=i+Math.imul(p,eh)|0,n=(n=n+Math.imul(p,el)|0)+Math.imul(g,eh)|0,s=s+Math.imul(g,el)|0;var eM=(f+(i=i+Math.imul(h,ep)|0)|0)+((8191&(n=(n=n+Math.imul(h,eg)|0)+Math.imul(l,ep)|0))<<13)|0;f=((s=s+Math.imul(l,eg)|0)+(n>>>13)|0)+(eM>>>26)|0,eM&=0x3ffffff,i=Math.imul(j,H),n=(n=Math.imul(j,K))+Math.imul(B,H)|0,s=Math.imul(B,K),i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,W)|0)+Math.imul(L,G)|0,s=s+Math.imul(L,W)|0,i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(T,X)|0,s=s+Math.imul(T,Y)|0,i=i+Math.imul(D,Q)|0,n=(n=n+Math.imul(D,ee)|0)+Math.imul(O,Q)|0,s=s+Math.imul(O,ee)|0,i=i+Math.imul(I,er)|0,n=(n=n+Math.imul(I,ei)|0)+Math.imul(A,er)|0,s=s+Math.imul(A,ei)|0,i=i+Math.imul(x,es)|0,n=(n=n+Math.imul(x,eo)|0)+Math.imul(S,es)|0,s=s+Math.imul(S,eo)|0,i=i+Math.imul(w,eu)|0,n=(n=n+Math.imul(w,ef)|0)+Math.imul(_,eu)|0,s=s+Math.imul(_,ef)|0,i=i+Math.imul(b,eh)|0,n=(n=n+Math.imul(b,el)|0)+Math.imul(y,eh)|0,s=s+Math.imul(y,el)|0;var eI=(f+(i=i+Math.imul(p,ep)|0)|0)+((8191&(n=(n=n+Math.imul(p,eg)|0)+Math.imul(g,ep)|0))<<13)|0;f=((s=s+Math.imul(g,eg)|0)+(n>>>13)|0)+(eI>>>26)|0,eI&=0x3ffffff,i=Math.imul(j,G),n=(n=Math.imul(j,W))+Math.imul(B,G)|0,s=Math.imul(B,W),i=i+Math.imul(C,X)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(L,X)|0,s=s+Math.imul(L,Y)|0,i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,ee)|0,i=i+Math.imul(D,er)|0,n=(n=n+Math.imul(D,ei)|0)+Math.imul(O,er)|0,s=s+Math.imul(O,ei)|0,i=i+Math.imul(I,es)|0,n=(n=n+Math.imul(I,eo)|0)+Math.imul(A,es)|0,s=s+Math.imul(A,eo)|0,i=i+Math.imul(x,eu)|0,n=(n=n+Math.imul(x,ef)|0)+Math.imul(S,eu)|0,s=s+Math.imul(S,ef)|0,i=i+Math.imul(w,eh)|0,n=(n=n+Math.imul(w,el)|0)+Math.imul(_,eh)|0,s=s+Math.imul(_,el)|0;var eA=(f+(i=i+Math.imul(b,ep)|0)|0)+((8191&(n=(n=n+Math.imul(b,eg)|0)+Math.imul(y,ep)|0))<<13)|0;f=((s=s+Math.imul(y,eg)|0)+(n>>>13)|0)+(eA>>>
vendor: 6,525 bytes, line 182
18226)|0,eA&=0x3ffffff,i=Math.imul(j,X),n=(n=Math.imul(j,Y))+Math.imul(B,X)|0,s=Math.imul(B,Y),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(L,Q)|0,s=s+Math.imul(L,ee)|0,i=i+Math.imul(N,er)|0,n=(n=n+Math.imul(N,ei)|0)+Math.imul(T,er)|0,s=s+Math.imul(T,ei)|0,i=i+Math.imul(D,es)|0,n=(n=n+Math.imul(D,eo)|0)+Math.imul(O,es)|0,s=s+Math.imul(O,eo)|0,i=i+Math.imul(I,eu)|0,n=(n=n+Math.imul(I,ef)|0)+Math.imul(A,eu)|0,s=s+Math.imul(A,ef)|0,i=i+Math.imul(x,eh)|0,n=(n=n+Math.imul(x,el)|0)+Math.imul(S,eh)|0,s=s+Math.imul(S,el)|0;var eR=(f+(i=i+Math.imul(w,ep)|0)|0)+((8191&(n=(n=n+Math.imul(w,eg)|0)+Math.imul(_,ep)|0))<<13)|0;f=((s=s+Math.imul(_,eg)|0)+(n>>>13)|0)+(eR>>>26)|0,eR&=0x3ffffff,i=Math.imul(j,Q),n=(n=Math.imul(j,ee))+Math.imul(B,Q)|0,s=Math.imul(B,ee),i=i+Math.imul(C,er)|0,n=(n=n+Math.imul(C,ei)|0)+Math.imul(L,er)|0,s=s+Math.imul(L,ei)|0,i=i+Math.imul(N,es)|0,n=(n=n+Math.imul(N,eo)|0)+Math.imul(T,es)|0,s=s+Math.imul(T,eo)|0,i=i+Math.imul(D,eu)|0,n=(n=n+Math.imul(D,ef)|0)+Math.imul(O,eu)|0,s=s+Math.imul(O,ef)|0,i=i+Math.imul(I,eh)|0,n=(n=n+Math.imul(I,el)|0)+Math.imul(A,eh)|0,s=s+Math.imul(A,el)|0;var eD=(f+(i=i+Math.imul(x,ep)|0)|0)+((8191&(n=(n=n+Math.imul(x,eg)|0)+Math.imul(S,ep)|0))<<13)|0;f=((s=s+Math.imul(S,eg)|0)+(n>>>13)|0)+(eD>>>26)|0,eD&=0x3ffffff,i=Math.imul(j,er),n=(n=Math.imul(j,ei))+Math.imul(B,er)|0,s=Math.imul(B,ei),i=i+Math.imul(C,es)|0,n=(n=n+Math.imul(C,eo)|0)+Math.imul(L,es)|0,s=s+Math.imul(L,eo)|0,i=i+Math.imul(N,eu)|0,n=(n=n+Math.imul(N,ef)|0)+Math.imul(T,eu)|0,s=s+Math.imul(T,ef)|0,i=i+Math.imul(D,eh)|0,n=(n=n+Math.imul(D,el)|0)+Math.imul(O,eh)|0,s=s+Math.imul(O,el)|0;var eO=(f+(i=i+Math.imul(I,ep)|0)|0)+((8191&(n=(n=n+Math.imul(I,eg)|0)+Math.imul(A,ep)|0))<<13)|0;f=((s=s+Math.imul(A,eg)|0)+(n>>>13)|0)+(eO>>>26)|0,eO&=0x3ffffff,i=Math.imul(j,es),n=(n=Math.imul(j,eo))+Math.imul(B,es)|0,s=Math.imul(B,eo),i=i+Math.imul(C,eu)|0,n=(n=n+Math.imul(C,ef)|0)+Math.imul(L,eu)|0,s=s+Math.imul(L,ef)|0,i=i+Math.imul(N,eh)|0,n=(n=n+Math.imul(N,el)|0)+Math.imul(T,eh)|0,s=s+Math.imul(T,el)|0;var eP=(f+(i=i+Math.imul(D,ep)|0)|0)+((8191&(n=(n=n+Math.imul(D,eg)|0)+Math.imul(O,ep)|0))<<13)|0;f=((s=s+Math.imul(O,eg)|0)+(n>>>13)|0)+(eP>>>26)|0,eP&=0x3ffffff,i=Math.imul(j,eu),n=(n=Math.imul(j,ef))+Math.imul(B,eu)|0,s=Math.imul(B,ef),i=i+Math.imul(C,eh)|0,n=(n=n+Math.imul(C,el)|0)+Math.imul(L,eh)|0,s=s+Math.imul(L,el)|0;var eN=(f+(i=i+Math.imul(N,ep)|0)|0)+((8191&(n=(n=n+Math.imul(N,eg)|0)+Math.imul(T,ep)|0))<<13)|0;f=((s=s+Math.imul(T,eg)|0)+(n>>>13)|0)+(eN>>>26)|0,eN&=0x3ffffff,i=Math.imul(j,eh),n=(n=Math.imul(j,el))+Math.imul(B,eh)|0,s=Math.imul(B,el);var eT=(f+(i=i+Math.imul(C,ep)|0)|0)+((8191&(n=(n=n+Math.imul(C,eg)|0)+Math.imul(L,ep)|0))<<13)|0;f=((s=s+Math.imul(L,eg)|0)+(n>>>13)|0)+(eT>>>26)|0,eT&=0x3ffffff;var ek=(f+(i=Math.imul(j,ep))|0)+((8191&(n=(n=Math.imul(j,eg))+Math.imul(B,ep)|0))<<13)|0;return f=((s=Math.imul(B,eg))+(n>>>13)|0)+(ek>>>26)|0,ek&=0x3ffffff,u[0]=em,u[1]=eb,u[2]=ey,u[3]=ev,u[4]=ew,u[5]=e_,u[6]=eE,u[7]=ex,u[8]=eS,u[9]=eM,u[10]=eI,u[11]=eA,u[12]=eR,u[13]=eD,u[14]=eO,u[15]=eP,u[16]=eN,u[17]=eT,u[18]=ek,0!==f&&(u[19]=f,r.length++),r};function g(e,t,r){return new m().mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(p=d),s.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,s=0;s<r.length-1;s++){var o=n;n=0;for(var a=0x3ffffff&i,u=Math.min(s,t.length-1),f=Math.max(0,s-e.length+1);f<=u;f++){var c=s-f,h=(0|e.words[c])*(0|t.words[f]),l=0x3ffffff&h;o=o+(h/0x4000000|0)|0,a=0x3ffffff&(l=l+a|0),n+=(o=o+(l>>>26)|0)>>>26,o&=0x3ffffff}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r.strip()}(this,e,t):g(this,e,t)},m.prototype.makeRBT=function(e){for(var t=Array(e),r=s.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},m.prototype.permute=function(e,t,r,i,n,s){for(var o=0;o<s;o++)i[o]=t[e[o]],n[o]=r[e[o]]},m.prototype.transform=function(e,t,r,i,n,s){this.permute(s,e,t,r,i,n);for(var o=1;o<n;o<<=1)for(var a=o<<1,u=Math.cos(2*Math.PI/a),f=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var h=u,l=f,d=0;d<o;d++){var p=r[c+d],g=i[c+d],m=r[c+d+o],b=i[c+d+o],y=h*m-l*b;b=h*b+l*m,m=y,r[c+d]=p+m,i[c+d]=g+b,r[c+d+o]=p-m,i[c+d+o]=g-b,d!==a&&(y=u*h-f*l,l=u*l+f*h,h=y)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},m.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=0x3ffffff&n,r=n<0x4000000?0:n/0x4000000|0}return e},m.prototype.convert13b=function(e,t,r,n){for(var s=0,o=0;o<t;o++)s+=0|e[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*t;o<n;++o)r[o]=0;i(0===s),i((-8192&s)==0)},m.prototype.stub=function(e){for(var t=Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),s=this.stub(i),o=Array(i),a=Array(i),u=Array(i),f=Array(i),c=Array(i),h=Array(i),l=r.words;l.length=i,this.convert13b(e.words,e.length,o,i),this.convert13b(t.words,t.length,f,i),this.transform(o,s,a,u,i,n),this.transform(f,s,c,h,i,n);for(var d=0;d<i;d++){var p=a[d]*c[d]-u[d]*h[d];u[d]=a[d]*h[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,l,s,i,n),this.conjugate(l,s,i),this.normalize13b(l,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},s.prototype.mul=function(e){var t=new s(null);return t.words=Array(this.length+e.length),this.mulTo(e,t)},s.prototype.mulf=function(e){var t=new s(null);return t.words=Array(this.length+e.length),g(this,e,t)},s.prototype.imul=function(e){return this.clone().mulTo(e,this)},s.prototype.imuln=function(e){i("number"==typeof e),i(e<0x4000000);for(var t=0,r=0;r<this.length;r++){var n=(0|this.words[r])*e,s=(0x3ffffff&n)+(0x3ffffff&t);t>>=26,t+=(n/0x4000000|0)+(s>>>26),this.words[r]=0x3ffffff&s}return 0!==t&&(this.words[r]=t,this.length++),this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),r
vendor: 13,934 bytes, line 182
182=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new s(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},s.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,s=0x3ffffff>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var a=this.words[t]&s,u=(0|this.words[t])-a<<r;this.words[t]=u|o,o=a>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},s.prototype.iushrn=function(e,t,r){i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var n,s=e%26,o=Math.min((e-s)/26,this.length),a=0x3ffffff^0x3ffffff>>>s<<s;if(n-=o,n=Math.max(0,n),r){for(var u=0;u<o;u++)r.words[u]=this.words[u];r.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var f=0;for(u=this.length-1;u>=0&&(0!==f||u>=n);u--){var c=0|this.words[u];this.words[u]=f<<26-s|c>>>s,f=c&a}return r&&0!==f&&(r.words[r.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;return!(this.length<=r)&&!!(this.words[r]&1<<t)},s.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;return(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)?this:(0!==t&&r++,this.length=Math.min(r,this.length),0!==t&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>t<<t),this.strip())},s.prototype.maskn=function(e){return this.clone().imaskn(e)},s.prototype.iaddn=function(e){return(i("number"==typeof e),i(e<0x4000000),e<0)?this.isubn(-e):0!==this.negative?(1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(e),this.negative=1),this):this._iaddn(e)},s.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=0x4000000;t++)this.words[t]-=0x4000000,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(i("number"==typeof e),i(e<0x4000000),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=0x4000000,this.words[t+1]-=1;return this.strip()},s.prototype.addn=function(e){return this.clone().iaddn(e)},s.prototype.subn=function(e){return this.clone().isubn(e)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(e,t,r){var n,s,o=e.length+r;this._expand(o);var a=0;for(n=0;n<e.length;n++){s=(0|this.words[n+r])+a;var u=(0|e.words[n])*t;s-=0x3ffffff&u,a=(s>>26)-(u/0x4000000|0),this.words[n+r]=0x3ffffff&s}for(;n<this.length-r;n++)a=(s=(0|this.words[n+r])+a)>>26,this.words[n+r]=0x3ffffff&s;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(s=-(0|this.words[n])+a)>>26,this.words[n]=0x3ffffff&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(e,t){var r,i=this.length-e.length,n=this.clone(),o=e,a=0|o.words[o.length-1];0!=(i=26-this._countBits(a))&&(o=o.ushln(i),n.iushln(i),a=0|o.words[o.length-1]);var u=n.length-o.length;if("mod"!==t){(r=new s(null)).length=u+1,r.words=Array(r.length);for(var f=0;f<r.length;f++)r.words[f]=0}var c=n.clone()._ishlnsubmul(o,1,u);0===c.negative&&(n=c,r&&(r.words[u]=1));for(var h=u-1;h>=0;h--){var l=(0|n.words[o.length+h])*0x4000000+(0|n.words[o.length+h-1]);for(l=Math.min(l/a|0,0x3ffffff),n._ishlnsubmul(o,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);r&&(r.words[h]=l)}return r&&r.strip(),n.strip(),"div"!==t&&0!==i&&n.iushrn(i),{div:r||null,mod:n}},s.prototype.divmod=function(e,t,r){var n,o,a;return(i(!e.isZero()),this.isZero())?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):(this.negative&e.negative)!=0?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||0>this.cmp(e)?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modn(e.words[0]))}:this._wordDiv(e,t)},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modn=function(e){i(e<=0x3ffffff);for(var t=0x4000000%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},s.prototype.idivn=function(e){i(e<=0x3ffffff);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+0x4000000*t;this.words[r]=n/e|0,t=n%e}return this.strip()},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new s(1),o=new s(0),a=new s(0),u=new s(1),f=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++f;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var l=0,d=1;(t.words[0]&d)==0&&l<26;++l,d<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(c),o.isub(h)),n.iushrn(1),o.iushrn(1);for(var p=0,g=1;(r.words[0]&g)==0&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(a),o.isub(u)):(r.isub(t),a.isub(n),u.isub(o))}return{a:a,b:u,gcd:r.iushln(f)}},s.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t,r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var o=new s(1),a=new s(0),u=n.clone();r.cmpn(1)>0&&n.cmpn(1)>0;){for(var f=0,c=1;(r.words[0]&c)==0&&f<26;++f,c<<=1);if(f>0)for(r.iushrn(f);f-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var h=0,l=1;(n.words[0]&l)==0&&h<26;++h,l<<=1);if(h>0)for(n.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);r.cmp(n)>=0?(r.isub(n),o.isub(a)):(n.isub(r),a.isub(o))}return 0>(t=0===r.cmpn(1)?o:a).cmpn(0)&&t.iadd(e),t},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var s=t;t=r,r=s}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return(1&this.words[0])==0},s.prototype.isOdd=function(){return(1&this.words[0])==1},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var s=n,o=r;0!==s&&o<this.length;o++){var a=0|this.words[o];a+=s,s=a>>>26,a&=0x3ffffff,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return -1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=0x3ffffff,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},s.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return -1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},s.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return -1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return -1===this.cmpn(e)},s.prototype.lt=function(e){return -1===this.cmp(e)},s.prototype.lten=function(e){return 0>=this.cmpn(e)},s.prototype.lte=function(e){return 0>=this.cmp(e)},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new x(e)},s.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(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)}y.prototype._tmp=function(){var e=new s(null);return e.words=Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},n(v,y),v.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9){e.words[0]=0,e.length=1;return}var n=e.words[9];for(i=10,t.words[t.length++]=4194303&n;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(4194303&s)<<4|n>>>22,n=s}n>>>=22,e.words[i-10]=n,0===n&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=0x3ffffff&t,t=64*i+(t/0x4000000|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(w,y),n(_,y),n(E,y),E.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=(0|e.words[r])*19+t,n=0x3ffffff&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){var t;if(b[e])return b[e];
182if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else if("p25519"===e)t=new E;else throw Error("Unknown prime "+e);return b[e]=t,t},x.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){i((e.negative|t.negative)==0,"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new s(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),u=a.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new s(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,n),l=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),p=o;0!==d.cmp(a);){for(var g=d,m=0;0!==g.cmp(a);m++)g=g.redSqr();i(m<p);var b=this.pow(h,new s(1).iushln(p-m-1));l=l.redMul(b),h=b.redSqr(),d=d.redMul(h),p=m}return l},x.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},x.prototype.pow=function(e,t){if(t.isZero())return new s(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=Array(16);r[0]=new s(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],o=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var f=t.words[i],c=u-1;c>=0;c--){var h=f>>c&1;if(n!==r[0]&&(n=this.sqr(n)),0===h&&0===o){a=0;continue}o<<=1,o|=h,(4==++a||0===i&&0===c)&&(n=this.mul(n,r[o]),a=0,o=0)}u=26}return n},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new S(e)},n(S,x),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):0>n.cmpn(0)&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):0>n.cmpn(0)&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},3607:(e,t,r)=>{var i;function n(e){this.rand=e}if(e.exports=function(e){return i||(i=new n(null)),i.generate(e)},e.exports.Rand=n,n.prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(n.prototype._rand=function(){throw Error("Not implemented yet")});else try{var s=r(3776);if("function"!=typeof s.randomBytes)throw Error("Not supported");n.prototype._rand=function(e){return s.randomBytes(e)}}catch(e){}},5927:(e,t,r)=>{"use strict";let i=r(3836),n=r(4981),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(e){if(e>
1820x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!a.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=0|p(e,t),i=o(r),n=i.write(e,t);return n!==r&&(i=i.slice(0,n)),i}(e,t);if(ArrayBuffer.isView(e))return function(e){if(U(e,Uint8Array)){let t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(U(e,ArrayBuffer)||e&&U(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(U(e,SharedArrayBuffer)||e&&U(e.buffer,SharedArrayBuffer)))return l(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return a.from(i,t,r);let n=function(e){var t;if(a.isBuffer(e)){let t=0|d(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?o(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return f(e),o(e<0?0:0|d(e))}function h(e){let t=e.length<0?0:0|d(e.length),r=o(t);for(let i=0;i<t;i+=1)r[i]=255&e[i];return r}function l(e,t,r){let i;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(i=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),a.prototype),i}function d(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||U(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return k(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return C(e).length;default:if(n)return i?-1:k(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){let i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=t;i<r;++i)n+=j[e[i]];return n}(this,t,r);case"utf8":case"utf-8":return v(this,t,r);case"ascii":return function(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(127&e[n]);return i}(this,t,r);case"latin1":case"binary":return function(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(e[n]);return i}(this,t,r);case"base64":var s,o;return s=t,o=r,0===s&&o===this.length?i.fromByteArray(this):i.fromByteArray(this.slice(s,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){let i=e.slice(t,r),n="";for(let e=0;e<i.length-1;e+=2)n+=String.fromCharCode(i[e]+256*i[e+1]);return n}(this,t,r);default:if(n)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function b(e,t,r,i,n){var s;if(0===e.length)return -1;if("string"==typeof r?(i=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(s=r=+r)!=s&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return -1;r=e.length-1}
vendor: 16,656 bytes, line 182
182else if(r<0){if(!n)return -1;r=0}if("string"==typeof t&&(t=a.from(t,i)),a.isBuffer(t))return 0===t.length?-1:y(e,t,r,i,n);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,i,n);throw TypeError("val must be string, number or Buffer")}function y(e,t,r,i,n){let s,o=1,a=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return -1;o=2,a/=2,u/=2,r/=2}function f(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){let i=-1;for(s=r;s<a;s++)if(f(e,s)===f(t,-1===i?0:s-i)){if(-1===i&&(i=s),s-i+1===u)return i*o}else -1!==i&&(s-=s-i),i=-1}else for(r+u>a&&(r=a-u),s=r;s>=0;s--){let r=!0;for(let i=0;i<u;i++)if(f(e,s+i)!==f(t,i)){r=!1;break}if(r)return s}return -1}function v(e,t,r){r=Math.min(e.length,r);let i=[],n=t;for(;n<r;){let t=e[n],s=null,o=t>239?4:t>223?3:t>191?2:1;if(n+o<=r){let r,i,a,u;switch(o){case 1:t<128&&(s=t);break;case 2:(192&(r=e[n+1]))==128&&(u=(31&t)<<6|63&r)>127&&(s=u);break;case 3:r=e[n+1],i=e[n+2],(192&r)==128&&(192&i)==128&&(u=(15&t)<<12|(63&r)<<6|63&i)>2047&&(u<55296||u>57343)&&(s=u);break;case 4:r=e[n+1],i=e[n+2],a=e[n+3],(192&r)==128&&(192&i)==128&&(192&a)==128&&(u=(15&t)<<18|(63&r)<<12|(63&i)<<6|63&a)>65535&&u<1114112&&(s=u)}}null===s?(s=65533,o=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),n+=o}return function(e){let t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);let r="",i=0;for(;i<t;)r+=String.fromCharCode.apply(String,e.slice(i,i+=4096));return r}(i)}function w(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function _(e,t,r,i,n,s){if(!a.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<s)throw RangeError('"value" argument is out of bounds');if(r+i>e.length)throw RangeError("Index out of range")}function E(e,t,r,i,n){O(t,i,n,e,r,7);let s=Number(t&BigInt(0xffffffff));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function x(e,t,r,i,n){O(t,i,n,e,r,7);let s=Number(t&BigInt(0xffffffff));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function S(e,t,r,i,n,s){if(r+i>e.length||r<0)throw RangeError("Index out of range")}function M(e,t,r,i,s){return t=+t,r>>>=0,s||S(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}function I(e,t,r,i,s){return t=+t,r>>>=0,s||S(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}t.Buffer=a,t.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,a.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return(f(e),e<=0)?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)},a.allocUnsafe=function(e){return c(e)},a.allocUnsafeSlow=function(e){return c(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(U(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),U(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,i=t.length;for(let n=0,s=Math.min(r,i);n<s;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){let r;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;let i=a.allocUnsafe(t),n=0;for(r=0;r<e.length;++r){let t=e[r];if(U(t,Uint8Array))n+t.length>i.length?(a.isBuffer(t)||(t=a.from(t)),t.copy(i,n)):Uint8Array.prototype.set.call(i,t,n);else if(a.isBuffer(t))t.copy(i,n);else throw TypeError('"list" argument must be an Array of Buffers');n+=t.length}return i},a.byteLength=p,a.prototype._isBuffer=!0,a.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},a.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},a.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},a.prototype.toString=function(){let e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):g.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){let e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(a.prototype[s]=a.prototype.inspect),a.prototype.compare=function(e,t,r,i,n){if(U(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,i>>>=0,n>>>=0,this===e)return 0;let s=n-i,o=r-t,u=Math.min(s,o),f=this.slice(i,n),c=e.slice(t,r);for(let e=0;e<u;++e)if(f[e]!==c[e]){s=f[e],o=c[e];break}return s<o?-1:o<s?1:0},a.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},a.prototype.write=function(e,t,r,i){var n,s,o,a,u,f,c,h;if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let l=this.length-t;if((void 0===r||r>l)&&(r=l),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let d=!1;for(;;)switch(i){case"hex":return function(e,t,r,i){let n;r=Number(r)||0;let s=e.length-r;i?(i=Number(i))>s&&(i=s):i=s;let o=t.length;for(i>o/2&&(i=o/2),n=0;n<i;++n){let i=parseInt(t.substr(2*n,2),16);if(i!=i)break;e[r+n]=i}return n}(this,e,t,r);case"utf8":case"utf-8":return n=t,s=r,L(k(e,this.length-n),this,n,s);case"ascii":case"latin1":case"binary":return o=t,a=r,L(function(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(e),this,o,a);case"base64":return u=t,f=r,L(C(e),this,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,h=r,L(function(e,t){let r,i;let n=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)i=(r=e.charCodeAt(s))>>8,n.push(r%256),n.push(i);return n}(e,this.length-c),this,c,h);default:if(d)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let i=this.subarray(e,t);return Object.setPrototypeOf(i,a.prototype),i},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);let i=this[e],n=1,s=0;for(;++s<t&&(n*=256);)i+=this[e+s]*n;return i},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);let i=this[e+--t],n=1;for(;t>0&&(n*=256);)i+=this[e+--t]*n;return i},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readBigUInt64LE=B(function(e){P(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&N(e,this.length-8);let i=t+256*this[++e]+65536*this[++e]+0x1000000*this[++e],n=this[++e]+256*this[++e]+65536*this[++e]+0x1000000*r;return BigInt(i)+(BigInt(n)<<BigInt(32))}),a.prototype.readBigUInt64BE=B(function(e){P(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&N(e,this.length-8);let i=0x1000000*t+65536*this[++e]+256*this[++e]+this[++e],n=0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)}),a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);let i=this[e],n=1,s=0;for(;++s<t&&(n*=256);)i+=this[e+s]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*t)),i},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);let i=t,n=1,s=this[e+--i];for(;i>0&&(n*=256);)s+=this[e+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*t)),s},a.prototype.readInt8=function(e,t){return(e>>>=0,t||w(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||w(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||w(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readBigInt64LE=B(function(e){P(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&N(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+0x1000000*this[++e])}),a.prototype.readBigInt64BE=B(function(e){P(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&N(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r)}),a.prototype.readFloatLE=function(e,t){return e>>>=0,t||w(e,4,this.length),n.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||w(e,4,this.length),n.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||w(e,8,this.length),n.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||w(e,8,this.length),n.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,r,i){if(e=+e,t>>>=0,r>>>=0,!i){let i=Math.pow(2,8*r)-1;_(this,e,t,r,i,0)}let n=1,s=0;for(this[t]=255&e;++s<r&&(n*=256);)this[t+s]=e/n&255;return t+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,r,i){if(e=+e,t>>>=0,r>>>=0,!i){let i=Math.pow(2,8*r)-1;_(this,e,t,r,i,0)}let n=r-1,s=1;for(this[t+n]=255&e;--n>=0&&(s*=256);)this[t+n]=e/s&255;return t+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigUInt64LE=B(function(e,t=0){return E(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=B(function(e,t=0){return x(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){let i=Math.pow(2,8*r-1);_(this,e,t,r,i-1,-i)}let n=0,s=1,o=0;for(this[t]=255&e;++n<r&&(s*=256);)e<0&&0===o&&0!==this[t+n-1]&&(o=1),this[t+n]=(e/s>>0)-o&255;return t+r},a.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){let i=Math.pow(2,8*r-1);_(this,e,t,r,i-1,-i)}let n=r-1,s=1,o=0;for(this[t+n]=255&e;--n>=0&&(s*=256);)e<0&&0===o&&0!==this[t+n+1]&&(o=1),this[t+n]=(e/s>>0)-o&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigInt64LE=B(function(e,t=0){return E(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=B(function(e,t=0){return x(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return I(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return I(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,i){if(!a.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);let n=i-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,i):Uint8Array.prototype.set.call(e,this.subarray(r,i),t),n},a.prototype.fill=function(e,t,r,i){let n;if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw TypeError("encoding must be a string");if("string"==typeof i&&!a.isEncoding(i))throw TypeError("Unknown encoding: "+i);if(1===e.length){let t=e.charCodeAt(0);("utf8"===i&&t<128||"latin1"===i)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n<r;++n)this[n]=e;
vendor: 2,063 bytes, line 182
182else{let s=a.isBuffer(e)?e:a.from(e,i),o=s.length;if(0===o)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<r-t;++n)this[n+t]=s[n%o]}return this};let A={};function R(e,t,r){A[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function D(e){let t="",r=e.length,i="-"===e[0]?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function O(e,t,r,i,n,s){if(e>r||e<t){let i;let n="bigint"==typeof t?"n":"";throw i=s>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${(s+1)*8}${n}`:`>= -(2${n} ** ${(s+1)*8-1}${n}) and < 2 ** ${(s+1)*8-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new A.ERR_OUT_OF_RANGE("value",i,e)}P(n,"offset"),(void 0===i[n]||void 0===i[n+s])&&N(n,i.length-(s+1))}function P(e,t){if("number"!=typeof e)throw new A.ERR_INVALID_ARG_TYPE(t,"number",e)}function N(e,t,r){if(Math.floor(e)!==e)throw P(e,r),new A.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new A.ERR_BUFFER_OUT_OF_BOUNDS;throw new A.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}R("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),R("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),R("ERR_OUT_OF_RANGE",function(e,t,r){let i=`The value of "${e}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>0x100000000?n=D(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=D(n)),n+="n"),i+=` It must be ${t}. Received ${n}`},RangeError);let T=/[^+/0-9A-Za-z-_]/g;function k(e,t){let r;t=t||1/0;let i=e.length,n=null,s=[];for(let o=0;o<i;++o){if((r=e.charCodeAt(o))>
18255295&&r<57344){if(!n){if(r>56319||o+1===i){(t-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(t-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function C(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(T,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function L(e,t,r,i){let n;for(n=0;n<i&&!(n+r>=t.length)&&!(n>=e.length);++n)t[n+r]=e[n];return n}function U(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}let j=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let i=16*r;for(let n=0;n<16;++n)t[i+n]=e[r]+e[n]}return t}();function B(e){return"undefined"==typeof BigInt?q:e}function q(){throw Error("BigInt not supported")}},5647:function(e,t){var r="undefined"!=typeof self?self:this,i=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();(function(e){var t={searchParams:"URLSearchParams"in i,iterable:"Symbol"in i&&"iterator"in Symbol,blob:"FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in i,arrayBuffer:"ArrayBuffer"in i};if(t.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],n=ArrayBuffer.isView||function(e){return e&&r.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw TypeError("Invalid character in header field name");return e.toLowerCase()}function o(e){return"string"!=typeof e&&(e=String(e)),e}function a(e){var r={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(r[Symbol.iterator]=function(){return r}),r}function u(e){this.map={},e instanceof u?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function f(e){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function h(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function l(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e){if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var r;t.arrayBuffer&&t.blob&&(r=e)&&DataView.prototype.isPrototypeOf(r)?(this._bodyArrayBuffer=l(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||n(e))?this._bodyArrayBuffer=l(e):this._bodyText=e=Object.prototype.toString.call(e)}}else this._bodyText="";!this.headers.get("content-type")&&("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var e,t,r,i=f(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,r=c(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=Array(t.length),i=0;i<t.length;i++)r[i]=String.fromCharCode(t[i]);return r.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},t.formData&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=s(e),t=o(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},u.prototype.delete=function(e){delete this.map[s(e)]},u.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},u.prototype.set=function(e,t){this.map[s(e)]=o(t)},u.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},u.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),a(e)},u.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),a(e)},u.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),a(e)},t.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);
182var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(e,t){var r,i,n=(t=t||{}).body;if(e instanceof g){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new u(t.headers)),this.method=(i=(r=t.method||this.method||"GET").toUpperCase(),p.indexOf(i)>-1?i:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function m(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(n))}}),t}function b(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},d.call(g.prototype),d.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var y=[301,302,303,307,308];b.redirect=function(e,t){if(-1===y.indexOf(t))throw RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},e.DOMException=i.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function v(r,i){return new Promise(function(n,s){var o=new g(r,i);if(o.signal&&o.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function f(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new u,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var r=e.split(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();t.append(i,n)}}),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL"),n(new b("response"in a?a.response:a.responseText,r))},a.onerror=function(){s(TypeError("Network request failed"))},a.ontimeout=function(){s(TypeError("Network request failed"))},a.onabort=function(){s(new e.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&t.blob&&(a.responseType="blob"),o.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),o.signal&&(o.signal.addEventListener("abort",f),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",f)}),a.send(void 0===o._bodyInit?null:o._bodyInit)})}v.polyfill=!0,i.fetch||(i.fetch=v,i.Headers=u,i.Request=g,i.Response=b),e.Headers=u,e.Request=g,e.Response=b,e.fetch=v,Object.defineProperty(e,"__esModule",{value:!0})})({}),i.fetch.ponyfill=!0,delete i.fetch.polyfill,(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},1466:e=>{"use strict";var t="%[a-f0-9]{2}",r=RegExp("("+t+")|([^%]+?)","gi"),i=RegExp("("+t+")+","gi");e.exports=function(e){if("string"!=typeof e)throw TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=i.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch(e){var s=function(e){try{return decodeURIComponent(e)}catch(n){for(var t=e.match(r)||[],i=1;i<t.length;i++)t=(e=(function e(t,r){try{return[decodeURIComponent(t.join(""))]}catch(e){}if(1===t.length)return t;r=r||1;var i=t.slice(0,r),n=t.slice(r);return Array.prototype.concat.call([],e(i),e(n))})(t,i).join("")).match(r)||[];return e}}(n[0]);s!==n[0]&&(t[n[0]]=s)}n=i.exec(e)}t["%C2"]="�";for(var o=Object.keys(t),a=0;a<o.length;a++){var u=o[a];e=e.replace(RegExp(u,"g"),t[u])}return e}(e)}}},1423:(e,t,r)=>{"use strict";t.version=r(4537).rE,t.utils=r(1929),t.rand=r(3607),t.curve=r(4560),t.curves=r(8728),t.e
182c=r(8691),t.eddsa=r(9324)},9021:(e,t,r)=>{"use strict";var i=r(5852),n=r(1929),s=n.getNAF,o=n.getJSF,a=n.assert;function u(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function f(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw Error("Not implemented")},u.prototype.validate=function(){throw Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r,i,n=e._getDoubles(),o=s(t,1,this._bitLength),u=(1<<n.step+1)-(n.step%2==0?2:1);u/=3;var f=[];for(r=0;r<o.length;r+=n.step){i=0;for(var c=r+n.step-1;c>=r;c--)i=(i<<1)+o[c];f.push(i)}for(var h=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=u;d>0;d--){for(r=0;r<f.length;r++)(i=f[r])===d?l=l.mixedAdd(n.points[r]):i===-d&&(l=l.mixedAdd(n.points[r].neg()));h=h.add(l)}return h.toP()},u.prototype._wnafMul=function(e,t){var r=4,i=e._getNAFPoints(r);r=i.wnd;for(var n=i.points,o=s(t,r,this._bitLength),u=this.jpoint(null,null,null),f=o.length-1;f>=0;f--){for(var c=0;f>=0&&0===o[f];f--)c++;if(f>=0&&c++,u=u.dblp(c),f<0)break;var h=o[f];a(0!==h),u="affine"===e.type?h>0?u.mixedAdd(n[h-1>>1]):u.mixedAdd(n[-h-1>>1].neg()):h>0?u.add(n[h-1>>1]):u.add(n[-h-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,i,n){var a,u,f,c=this._wnafT1,h=this._wnafT2,l=this._wnafT3,d=0;for(a=0;a<i;a++){var p=(f=t[a])._getNAFPoints(e);c[a]=p.wnd,h[a]=p.points}for(a=i-1;a>=1;a-=2){var g=a-1,m=a;if(1!==c[g]||1!==c[m]){l[g]=s(r[g],c[g],this._bitLength),l[m]=s(r[m],c[m],this._bitLength),d=Math.max(l[g].length,d),d=Math.max(l[m].length,d);continue}var b=[t[g],null,null,t[m]];0===t[g].y.cmp(t[m].y)?(b[1]=t[g].add(t[m]),b[2]=t[g].toJ().mixedAdd(t[m].neg())):0===t[g].y.cmp(t[m].y.redNeg())?(b[1]=t[g].toJ().mixedAdd(t[m]),b[2]=t[g].add(t[m].neg())):(b[1]=t[g].toJ().mixedAdd(t[m]),b[2]=t[g].toJ().mixedAdd(t[m].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=o(r[g],r[m]);for(u=0,d=Math.max(v[0].length,d),l[g]=Array(d),l[m]=Array(d);u<d;u++){var w=0|v[0][u],_=0|v[1][u];l[g][u]=y[(w+1)*3+(_+1)],l[m][u]=0,h[g]=b}}var E=this.jpoint(null,null,null),x=this._wnafT4;for(a=d;a>=0;a--){for(var S=0;a>=0;){var M=!0;for(u=0;u<i;u++)x[u]=0|l[u][a],0!==x[u]&&(M=!1);if(!M)break;S++,a--}if(a>=0&&S++,E=E.dblp(S),a<0)break;for(u=0;u<i;u++){var I=x[u];0!==I&&(I>0?f=h[u][I-1>>1]:I<0&&(f=h[u][-I-1>>1].neg()),E="affine"===f.type?E.mixedAdd(f):E.add(f))}}for(a=0;a<i;a++)h[a]=null;return n?E:E.toP()},u.BasePoint=f,f.prototype.eq=function(){throw Error("Not implemented")},f.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(e,t){e=n.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?a(e[e.length-1]%2==0):7===e[0]&&a(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw Error("Unknown point format")},f.prototype.encodeCompressed=function(e){return this.encode(e,!0)},f.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},f.prototype.encode=function(e,t){return n.encode(this._encode(t),e)},f.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},f.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)}
vendor: 11,968 bytes, line 182
182,f.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<t;n+=e){for(var s=0;s<e;s++)i=i.dbl();r.push(i)}return{step:e,points:r}},f.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)t[n]=t[n-1].add(i);return{wnd:e,points:t}},f.prototype._getBeta=function(){return null},f.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},3824:(e,t,r)=>{"use strict";var i=r(1929),n=r(5852),s=r(4448),o=r(9021),a=i.assert;function u(e){this.twisted=(0|e.a)!=1,this.mOneA=this.twisted&&(0|e.a)==-1,this.extended=this.mOneA,o.call(this,"edwards",e),this.a=new n(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=(0|e.c)==1}function f(e,t,r,i,s){o.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(t,16),this.y=new n(r,16),this.z=i?new n(i,16):this.curve.one,this.t=s&&new n(s,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,!this.curve.extended||this.t||(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}s(u,o),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,i){return this.point(e,t,r,i)},u.prototype.pointFromX=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=this.c2.redSub(this.a.redMul(r)),s=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=i.redMul(s.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw Error("invalid point");var u=a.fromRed().isOdd();return(t&&!u||!t&&u)&&(a=a.redNeg()),this.point(e,a)},u.prototype.pointFromY=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=r.redSub(this.c2),s=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(s.redInvm());if(0===o.cmp(this.zero)){if(!t)return this.point(this.zero,e);throw Error("invalid point")}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),i=t.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===i.cmp(n)},s(f,o.BasePoint),u.prototype.pointFromJSON=function(e){return f.fromJSON(this,e)},u.prototype.point=function(e,t,r,i){return new f(this,e,t,r,i)},f.fromJSON=function(e,t){return new f(e,t[0],t[1],t[2])},f.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)+" z: "+this.z.fromRed().toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),s=i.redAdd(t),o=s.redSub(r),a=i.redSub(t),u=n.redMul(o),f=s.redMul(a),c=n.redMul(a),h=o.redMul(s);return this.curve.point(u,f,h,c)},f.prototype._projDbl=function(){var e,t,r,i,n,s,o=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var f=(i=this.curve._mulA(a)).redAdd(u);this.zOne?(e=o.redSub(a).redSub(u).redMul(f.redSub(this.curve.two)),t=f.redMul(i.redSub(u)),r=f.redSqr().redSub(f).redSub(f)):(n=this.z.redSqr(),s=f.redSub(n).redISub(n),e=o.redSub(a).redISub(u).redMul(s),t=f.redMul(i.redSub(u)),r=f.redMul(s))}else i=a.redAdd(u),n=this.curve._mulC(this.z).redSqr(),s=i.redSub(n).redSub(n),e=this.curve._mulC(o.redISub(i)).redMul(s),t=this.curve._mulC(i).redMul(a.redISub(u)),r=i.redMul(s);return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),s=r.redSub(t),o=n.redSub(i),a=n.redAdd(i),u=r.redAdd(t),f=s.redMul(o),c=a.redMul(u),h=s.redMul(u),l=o.redMul(a);return this.curve.point(f,c,l,h)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),s=this.x.redMul(e.x),o=this.y.redMul(e.y),a=this.curve.d.redMul(s).redMul(o),u=n.redSub(a),f=n.redAdd(a),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(s).redISub(o),h=i.redMul(u).redMul(c);return this.curve.twisted?(t=i.redMul(f).redMul(o.redSub(this.curve._mulA(s))),r=u.redMul(f)):(t=i.redMul(f).redMul(o.redSub(s)),r=this.curve._mulC(u).redMul(f)),this.curve.point(h,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},4560:(e,t,r)=>{"use strict";t.base=r(9021),t.short=r(8458),t.mont=r(9482),t.edwards=r(3824)},9482:(e,t,r)=>{"use strict";var i=r(5852),n=r(4448),s=r(9021),o=r(1929);function a(e){s.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){s.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,s),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},n(u,s.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},a.prototype.point=function(e,t){return new u(this,e,t)},a.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},u.prototype.add=function(){throw Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),s=e.x.redSub(e.z).redMul(r),o=n.redMul(i),a=t.z.redMul(s.redAdd(o).redSqr()),u=t.x.redMul(s.redISub(o).redSqr());return this.curve.point(a,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var s=n.length-1;s>=0;s--)0===n[s]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},u.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},8458:(e,t,r)=>{"use strict";var i=r(1929),n=r(5852),s=r(4448),o=r(9021),a=i.assert;function u(e){o.call(this,"short",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}function f(e,t,r,i){o.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(t,16),this.y=new n(r,16),i&&(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)}function c(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(t,16),this.y=new n(r,16),this.z=new n(i,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}s(u,o),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){if(e.beta)t=new n(e.beta,16).toRed(this.red);else{var t,r,i,s=this._getEndoRoots(this.p);t=(t=0>s[0].cmp(s[1])?s[0]:s[1]).toRed(this.red)}if(e.lambda)r=new n(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return i=e.basis?e.basis.map(function(e){return{a:new n(e.a,16),b:new n(e.b,16)}}):this._getEndoBasis(r),{beta:t,lambda:r,basis:i}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:n.mont(e),r=new n(2).toRed(t).redInvm(),i=r.redNeg(),s=new n(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(s).fromRed(),i.redSub(s).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,i,s,o,a,u,f,c,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,d=this.n.clone(),p=new n(1),g=new n(0),m=new n(0),b=new n(1),y=0;0!==l.cmpn(0);){var v=d.div(l);f=d.sub(v.mul(l)),c=m.sub(v.mul(p));var w=b.sub(v.mul(g));if(!i&&0>f.cmp(h))t=u.neg(),r=p,i=f.neg(),s=c;else if(i&&2==++y)break;u=f,d=l,l=f,m=p,p=c,b=g,g=w}o=f.neg(),a=c;var _=i.sqr().add(s.sqr());return o.sqr().add(a.sqr()).cmp(_)>=0&&(o=t,a=r),i.negative&&(i=i.neg(),s=s.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:s},{a:o,b:a}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),s=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),u=n.mul(r.b),f=s.mul(i.b);
vendor: 9,147 bytes, line 182
182return{k1:e.sub(o).sub(a),k2:u.add(f).neg()}},u.prototype.pointFromX=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var s=i.fromRed().isOdd();return(t&&!s||!t&&s)&&(i=i.redNeg()),this.point(e,i)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s<e.length;s++){var o=this._endoSplit(t[s]),a=e[s],u=a._getBeta();o.k1.negative&&(o.k1.ineg(),a=a.neg(!0)),o.k2.negative&&(o.k2.ineg(),u=u.neg(!0)),i[2*s]=a,i[2*s+1]=u,n[2*s]=o.k1,n[2*s+1]=o.k2}for(var f=this._wnafMulAdd(1,i,n,2*s,r),c=0;c<2*s;c++)i[c]=null,n[c]=null;return f},s(f,o.BasePoint),u.prototype.point=function(e,t,r){return new f(this,e,t,r)},u.prototype.pointFromJSON=function(e,t){return f.fromJSON(this,e,t)},f.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,i=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},f.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]},f.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var i=e.point(t[0],t[1],r);if(!t[2])return i;function n(t){return e.point(t[0],t[1],r)}var s=t[2];return i.precomputed={beta:null,doubles:s.doubles&&{step:s.doubles.step,points:[i].concat(s.doubles.points.map(n))},naf:s.naf&&{wnd:s.naf.wnd,points:[i].concat(s.naf.points.map(n))}},i},f.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)+">"},f.prototype.isInfinity=function(){return this.inf},f.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e)||0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},f.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(e){return(e=new n(e,16),this.isInfinity())?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},f.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},f.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},f.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},s(c,o.BasePoint),u.prototype.jpoint=function(e,t,r){return new c(this,e,t,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),s=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),a=i.redSub(n),u=s.redSub(o);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=a.redSqr(),c=f.redMul(a),h=i.redMul(f),l=u.redSqr().redIAdd(c).redISub(h).redISub(h),d=u.redMul(h.redISub(l)).redISub(s.redMul(c)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(l,d,p)},c.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,s=e.y.redMul(t).redMul(this.z),o=r.redSub(i),a=n.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=o.redSqr(),f=u.redMul(o),c=r.redMul(u),h=a.redSqr().redIAdd(f).redISub(c).redISub(c),l=a.redMul(c.redISub(h)).redISub(n.redMul(f)),d=this.z.redMul(o);return this.curve.jpoint(h,l,d)},c.prototype.dblp=function(e){if(0===e||this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var t,r=this;for(t=0;t<e;t++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,s=this.x,o=this.y,a=this.z,u=a.redSqr().redSqr(),f=o.redAdd(o);for(t=0;t<e;t++){var c=s.redSqr(),h=f.redSqr(),l=h.redSqr(),d=c.redAdd(c).redIAdd(c).redIAdd(i.redMul(u)),p=s.redMul(h),g=d.redSqr().redISub(p.redAdd(p)),m=p.redISub(g),b=d.redMul(m);b=b.redIAdd(b).redISub(l);var y=f.redMul(a);t+1<e&&(u=u.redMul(l)),s=g,a=y,f=b}return this.curve.jpoint(s,f.redMul(n),a)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){if(this.zOne){var e,t,r,i=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),o=this.x.redAdd(n).redSqr().redISub(i).redISub(s);o=o.redIAdd(o);var a=i.redAdd(i).redIAdd(i),u=a.redSqr().redISub(o).redISub(o),f=s.redIAdd(s);f=(f=f.redIAdd(f)).redIAdd(f),e=u,t=a.redMul(o.redISub(u)).redISub(f),r=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),h=this.y.redSqr(),l=h.redSqr(),d=this.x.redAdd(h).redSqr().redISub(c).redISub(l);d=d.redIAdd(d);var p=c.redAdd(c).redIAdd(c),g=p.redSqr(),m=l.redIAdd(l);m=(m=m.redIAdd(m)).redIAdd(m),e=g.redISub(d).redISub(d),t=p.redMul(d.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},c.prototype._threeDbl=function(){if(this.zOne){var e,t,r,i=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),o=this.x.redAdd(n).redSqr().redISub(i).redISub(s);o=o.redIAdd(o);var a=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),u=a.redSqr().redISub(o).redISub(o);e=u;var f=s.redIAdd(s);f=(f=f.redIAdd(f)).redIAdd(f),t=a.redMul(o.redISub(u)).redISub(f),r=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),h=this.y.redSqr(),l=this.x.redMul(h),d=this.x.redSub(c).redMul(this.x.redAdd(c));d=d.redAdd(d).redIAdd(d);var p=l.redIAdd(l),g=(p=p.redIAdd(p)).redAdd(p);e=d.redSqr().redISub(g),r=this.y.redAdd(this.z).redSqr().redISub(h).redISub(c);var m=h.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=d.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},c.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),s=t.redSqr(),o=r.redSqr(),a=s.redAdd(s).redIAdd(s).redIAdd(e.redMul(n)),u=t.redAdd(t),f=(u=u.redIAdd(u)).redMul(o),c=a.redSqr().redISub(f.redAdd(f)),h=f.redISub(c),l=o.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=a.redMul(h).redISub(l),p=r.redAdd(r).redMul(i);return this.curve.jpoint(c,d,p)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),i=t.redSqr(),n=e.redAdd(e).redIAdd(e),s=n.redSqr(),o=this.x.redAdd(t).redSqr().redISub(e).redISub(i),a=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(s)).redSqr(),u=i.redIAdd(i);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var f=n.redIAdd(o).redSqr().redISub(s).redISub(a).redISub(u),c=t.redMul(f);c=(c=c.redIAdd(c)).redIAdd(c);var h=this.x.redMul(a).redISub(c);h=(h=h.redIAdd(h)).redIAdd(h);var l=this.y.redMul(f.redMul(u.redISub(f)).redISub(o.redMul(a)));l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=this.z.redAdd(o).redSqr().redISub(r).redISub(a);return this.curve.jpoint(h,l,d)},c.prototype.mul=function(e,t){return e=new n(e,t),this.curve._wnafMul(this,e)},c.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;
vendor: 5,536 bytes, line 182
182var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var i=t.redMul(this.z),n=r.redMul(e.z);return 0===this.y.redMul(n).redISub(e.y.redMul(i)).cmpn(0)},c.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},c.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)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},8728:(e,t,r)=>{"use strict";var i,n=r(7432),s=r(4560),o=r(1929).assert;function a(e){"short"===e.type?this.curve=new s.short(e):"edwards"===e.type?this.curve=new s.edwards(e):this.curve=new s.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){var i=new a(r);return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:i}),i}})}t.PresetCurve=a,u("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:n.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("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:n.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("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:n.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("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:n.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"]}),u("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:n.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"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["9"]}),u("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:n.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r(4929)}catch(e){i=void 0}u("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:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
182,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},8691:(e,t,r)=>{"use strict";var i=r(5852),n=r(6205),s=r(1929),o=r(8728),a=r(3607),u=s.assert,f=r(7020),c=r(3621);function h(e){if(!(this instanceof h))return new h(e);"string"==typeof e&&(u(Object.prototype.hasOwnProperty.call(o,e),"Unknown curve "+e),e=o[e]),e instanceof o.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=h,h.prototype.keyPair=function(e){return new f(this,e)},h.prototype.keyFromPrivate=function(e,t){return f.fromPrivate(this,e,t)},h.prototype.keyFromPublic=function(e,t){return f.fromPublic(this,e,t)},h.prototype.genKeyPair=function(e){e||(e={});for(var t=new n({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),s=this.n.sub(new i(2));;){var o=new i(t.generate(r));if(!(o.cmp(s)>0))return o.iaddn(1),this.keyFromPrivate(o)}},h.prototype._truncateToN=function(e,t,r){if(i.isBN(e)||"number"==typeof e)n=(e=new i(e,16)).byteLength();else if("object"==typeof e)n=e.length,e=new i(e,16);else{var n,s=e.toString();n=s.length+1>>>1,e=new i(s,16)}"number"!=typeof r&&(r=8*n);var o=r-this.n.bitLength();return(o>0&&(e=e.ushrn(o)),!t&&e.cmp(this.n)>=0)?e.sub(this.n):e},h.prototype.sign=function(e,t,r,s){"object"==typeof r&&(s=r,r=null),s||(s={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(e,!1,s.msgBitLength);for(var o=this.n.byteLength(),a=t.getPrivate().toArray("be",o),u=e.toArray("be",o),f=new n({hash:this.hash,entropy:a,nonce:u,pers:s.pers,persEnc:s.persEnc||"utf8"}),h=this.n.sub(new i(1)),l=0;;l++){var d=s.k?s.k(l):new i(f.generate(this.n.byteLength()));if(!(0>=(d=this._truncateToN(d,!0)).cmpn(1)||d.cmp(h)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var g=p.getX(),m=g.umod(this.n);if(0!==m.cmpn(0)){var b=d.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(b=b.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==g.cmp(m)?2:0);return s.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),y^=1),new c({r:m,s:b,recoveryParam:y})}}}}}},h.prototype.verify=function(e,t,r,i,n){n||(n={}),e=this._truncateToN(e,!1,n.msgBitLength),r=this.keyFromPublic(r,i);var s,o=(t=new c(t,"hex")).r,a=t.s;if(0>o.cmpn(1)||o.cmp(this.n)>=0||0>a.cmpn(1)||a.cmp(this.n)>=0)return!1;var u=a.invm(this.n),f=u.mul(e).umod(this.n),h=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(f,r.getPublic(),h)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(f,r.getPublic(),h)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},h.prototype.recoverPubKey=function(e,t,r,n){u((3&r)===r,"The recovery param is more than two bits"),t=new c(t,n);var s=this.n,o=new i(e),a=t.r,f=t.s,h=1&r,l=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),h):this.curve.pointFromX(a,h);var d=t.r.invm(s),p=s.sub(o).mul(d).umod(s),g=f.mul(d).umod(s);return this.g.mulAdd(p,a,g)},h.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new c(t,i)).recoveryParam)return t.recoveryParam;for(var n,s=0;s<4;s++){try{n=this.recoverPubKey(e,t,s)}catch(e){continue}if(n.eq(r))return s}throw Error("Unable to find valid recovery factor")}},7020:(e,t,r)=>{"use strict";var i=r(5852),n=r(1929).assert;function s(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=s,s.fromPublic=function(e,t,r){return t instanceof s?t:new s(e,{pub:t,pubEnc:r})},s.fromPrivate=function(e,t,r){return t instanceof s?t:new s(e,{priv:t,privEnc:r})},s.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.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"}},s.prototype.getPublic=function(e,t){return("string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t)?this.pub.encode(t,e):this.pub},s.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},s.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},s.prototype._importPublic=function(e,t){if(e.x||e.y){"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):("short"===this.ec.curve.type||"edwards"===this.ec.curve.type)&&n(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)},s.prototype.derive=function(e){return e.validate()||n(e.validate(),"public point not validated"),e.mul(this.priv).getX()},s.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},s.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},s.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},3621:(e,t,r)=>{"use strict";var i=r(5852),n=r(1929),s=n.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(s(e.r&&e.s,"Signature without r or s"),this.r=new i(e.r,16),this.s=new i(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4||0===e[t.place])return!1;for(var n=0,s=0,o=t.place;s<i;s++,o++)n<<=8,n|=e[o],n>>>=0;return!(n<=127)&&(t.place=o,n)}function f(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function c(e,t){if(t<128){e.push(t);return}var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}e.exports=o,o.prototype._importDER=function(e,t){e=n.toArray(e,t);var r=new a;
182if(48!==e[r.place++])return!1;var s=u(e,r);if(!1===s||s+r.place!==e.length||2!==e[r.place++])return!1;var o=u(e,r);if(!1===o||(128&e[r.place])!=0)return!1;var f=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var c=u(e,r);if(!1===c||e.length!==c+r.place||(128&e[r.place])!=0)return!1;var h=e.slice(r.place,c+r.place);if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new i(f),this.s=new i(h),this.recoveryParam=null,!0},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=f(t),r=f(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var i=[2];c(i,t.length),(i=i.concat(t)).push(2),c(i,r.length);var s=i.concat(r),o=[48];return c(o,s.length),o=o.concat(s),n.encode(o,e)}},9324:(e,t,r)=>{"use strict";var i=r(7432),n=r(8728),s=r(1929),o=s.assert,a=s.parseBytes,u=r(623),f=r(2562);function c(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof c))return new c(e);e=n[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}e.exports=c,c.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),s=this.encodePoint(n),o=this.hashInt(s,r.pubBytes(),e).mul(r.priv()),u=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:u,Rencoded:s})},c.prototype.verify=function(e,t,r){if(e=a(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),s=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(s)},c.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return s.intFromLE(e.digest()).umod(this.curve.n)},c.prototype.keyFromPublic=function(e){return u.fromPublic(this,e)},c.prototype.keyFromSecret=function(e){return u.fromSecret(this,e)},c.prototype.makeSignature=function(e){return e instanceof f?e:new f(this,e)},c.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},c.prototype.decodePoint=function(e){var t=(e=s.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),i=(128&e[t])!=0,n=s.intFromLE(r);return this.curve.pointFromY(n,i)},c.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(e){return s.intFromLE(e)},c.prototype.isPoint=function(e){return e instanceof this.pointClass}},623:(e,t,r)=>{"use strict";var i=r(1929),n=i.assert,s=i.parseBytes,o=i.cachedProperty;function a(e,t){this.eddsa=e,this._secret=s(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=s(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},o(a,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),o(a,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),o(a,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i}),o(a,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),o(a,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),o(a,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),a.prototype.sign=function(e){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return n(this._secret,"KeyPair is public only"),i.encode(this.secret(),e)},a.prototype.getPublic=function(e){return i.encode(this.pubBytes(),e)},e.exports=a},2562:(e,t,r)=>{"use strict";var i=r(5852),n=r(1929),s=n.assert,o=n.cachedProperty,a=n.parseBytes;function u(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(s(t.length===2*e.encodingLength,"Signature has invali
182d size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),s(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof i&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}o(u,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),o(u,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),o(u,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),o(u,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},4929:e=>
vendor: 26,139 bytes, line 182
182{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},
1821929:(e,t,r)=>{"use strict";var i=r(5852),n=r(5067),s=r(5897);t.assert=n,t.toArray=s.toArray,t.zero2=s.zero2,t.toHex=s.toHex,t.encode=s.encode,t.getNAF=function(e,t,r){var i=Array(Math.max(e.bitLength(),r)+1);for(o=0;o<i.length;o+=1)i[o]=0;var n=1<<t+1,s=e.clone();for(o=0;o<i.length;o++){var o,a,u=s.andln(n-1);s.isOdd()?(a=u>(n>>1)-1?(n>>1)-u:u,s.isubn(a)):a=0,i[o]=a,s.iushrn(1)}return i},t.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i=0,n=0;e.cmpn(-i)>0||t.cmpn(-n)>0;){var s,o,a,u=e.andln(3)+i&3,f=t.andln(3)+n&3;3===u&&(u=-1),3===f&&(f=-1),o=(1&u)==0?0:(3==(s=e.andln(7)+i&7)||5===s)&&2===f?-u:u,r[0].push(o),a=(1&f)==0?0:(3==(s=t.andln(7)+n&7)||5===s)&&2===u?-f:f,r[1].push(a),2*i===o+1&&(i=1-i),2*n===a+1&&(n=1-n),e.iushrn(1),t.iushrn(1)}return r},t.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new i(e,"hex","le")}},429:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise(function(r,i){var n;function s(r){e.removeListener(t,o),i(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",s),r([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&(n={once:!0},"function"==typeof e.on&&g(e,"error",s,n))})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}
182function f(e,t,r,i){if(a(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),o=s[t]),void 0===o)o=s[t]=r,++e._eventsCount;else if("function"==typeof o?o=s[t]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=u(e))>0&&o.length>n&&!o.warned){o.warned=!0;var n,s,o,f=Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=o.length,console&&console.warn&&console.warn(f)}return e}function c(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=c.bind(i);return n.listener=r,i.wrapFn=n,n}function l(e,t,r){var i=e._events;if(void 0===i)return[];var n=i[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(n):p(n,n.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=Array(t),i=0;i<t;++i)r[i]=e[i];return r}function g(e,t,r,i){if("function"==typeof e.on)i.once?e.once(t,r):e.on(t,r);else if("function"==typeof e.addEventListener)e.addEventListener(t,function n(s){i.once&&e.removeEventListener(t,n),r(s)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||n(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),s.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var o,a=Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var u=s[e];if(void 0===u)return!1;if("function"==typeof u)i(u,this,t);else for(var f=u.length,c=p(u,f),r=0;r<f;++r)i(c[r],this,t);return!0},s.prototype.addListener=function(e,t){return f(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return f(this,e,t,!0)},s.prototype.once=function(e,t){return a(t),this.on(e,h(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,h(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,i,n,s,o;if(a(t),void 0===(i=this._events)||void 0===(r=i[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(n=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,n),1===r.length&&(i[e]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var n,s=Object.keys(r);for(i=0;i<s.length;++i)"removeListener"!==(n=s[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},s.prototype.listeners=function(e){return l(this,e,!0)},s.prototype.rawListeners=function(e){return l(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},s.prototype.listenerCount=d,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},8287:e=>{"use strict";e.exports=function(e,t){for(var r={},i=Object.keys(e),n=Array.isArray(t),s=0;s<i.length;s++){var o=i[s],a=e[o];(n?-1!==t.indexOf(o):t(o,a,e))&&(r[o]=a)}return r}},7432:(e,t,r)=>{t.utils=r(5362),t.common=r(4372),t.sha=r(7729),t.ripemd=r(7394),t.hmac=r(7690),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160},4372:(e,t,r)=>{"use strict";var i=r(5362),n=r(5067);function s(){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}
182t.BlockHash=s,s.prototype.update=function(e,t){if(e=i.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},s.prototype.digest=function(e){return this.update(this._pad()),n(null===this.pending),this._digest(e)},s.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,i=Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(e<<=3,"big"===this.endian){for(var s=8;s<this.padLength;s++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=e>>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(s=8,i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0;s<this.padLength;s++)i[n++]=0;return i}},7690:(e,t,r)=>{"use strict";var i=r(5362),n=r(5067);function s(e,t,r){if(!(this instanceof s))return new s(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(t,r))}e.exports=s,s.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(t=0,this.inner=new this.Hash().update(e);t<e.length;t++)e[t]^=106;this.outer=new this.Hash().update(e)},s.prototype.update=function(e,t){return this.inner.update(e,t),this},s.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},7394:(e,t,r)=>{"use strict";var i=r(5362),n=r(4372),s=i.rotl32,o=i.sum32,a=i.sum32_3,u=i.sum32_4,f=n.BlockHash;function c(){if(!(this instanceof c))return new c;f.call(this),this.h=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0],this.endian="little"}function h(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~
182i:t^(r|~i)}i.inherits(c,f),t.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(e,t){for(var r=this.h[0],i=this.h[1],n=this.h[2],f=this.h[3],c=this.h[4],m=r,b=i,y=n,v=f,w=c,_=0;_<80;_++){var E,x,S=o(s(u(r,h(_,i,n,f),e[l[_]+t],(E=_)<=15?0:E<=31?0x5a827999:E<=47?0x6ed9eba1:E<=63?0x8f1bbcdc:0xa953fd4e),p[_]),c);r=c,c=f,f=s(n,10),n=i,i=S,S=o(s(u(m,h(79-_,b,y,v),e[d[_]+t],(x=_)<=15?0x50a28be6:x<=31?0x5c4dd124:x<=47?0x6d703ef3:x<=63?0x7a6d76e9:0),g[_]),w),m=w,w=v,v=s(y,10),y=b,b=S}S=a(this.h[1],n,v),this.h[1]=a(this.h[2],f,w),this.h[2]=a(this.h[3],c,m),this.h[3]=a(this.h[4],r,b),this.h[4]=a(this.h[0],i,y),this.h[0]=S},c.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"little"):i.split32(this.h,"little")};var l=[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],d=[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],p=[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],g=[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]},7729:(e,t,r)=>{"use strict";t.sha1=r(1573),t.sha224=r(5994),t.sha256=r(2171),t.sha384=r(4859),t.sha512=r(8122)},1573:(e,t,r)=>{"use strict";var i=r(5362),n=r(4372),s=r(9359),o=i.rotl32,a=i.sum32,u=i.sum32_5,f=s.ft_1,c=n.BlockHash,h=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6];function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0],this.W=Array(80)}i.inherits(l,c),e.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=o(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);var n=this.h[0],s=this.h[1],c=this.h[2],l=this.h[3],d=this.h[4];for(i=0;i<r.length;i++){var p=~~(i/20),g=u(o(n,5),f(p,s,c,l),d,r[i],h[p]);d=l,l=c,c=o(s,30),s=n,n=g}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],s),this.h[2]=a(this.h[2],c),this.h[3]=a(this.h[3],l),this.h[4]=a(this.h[4],d)},l.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},5994:(e,t,r)=>{"use strict";var i=r(5362),n=r(2171);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[0xc1059ed8,0x367cd507,0x3070dd17,0xf70e5939,0xffc00b31,0x68581511,0x64f98fa7,0xbefa4fa4]}i.inherits(s,n),e.exports=s,s.blockSize=512,s.outSize=224,s.hmacStrength=192,s.padLength=64,s.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},2171:(e,t,r)=>{"use strict";var i=r(5362),n=r(4372),s=r(9359),o=r(5067),a=i.sum32,u=i.sum32_4,f=i.sum32_5,c=s.ch32,h=s.maj32,l=s.s0_256,d=s.s1_256,p=s.g0_256,g=s.g1_256,m=n.BlockHash,b=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2];function y(){if(!(this instanceof y))return new y;m.call(this),this.h=[0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19],this.k=b,this.W=Array(64)}i.inherits(y,m),e.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;
182i++)r[i]=u(g(r[i-2]),r[i-7],p(r[i-15]),r[i-16]);var n=this.h[0],s=this.h[1],m=this.h[2],b=this.h[3],y=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(o(this.k.length===r.length),i=0;i<r.length;i++){var E=f(_,d(y),c(y,v,w),this.k[i],r[i]),x=a(l(n),h(n,s,m));_=w,w=v,v=y,y=a(b,E),b=m,m=s,s=n,n=a(E,x)}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],s),this.h[2]=a(this.h[2],m),this.h[3]=a(this.h[3],b),this.h[4]=a(this.h[4],y),this.h[5]=a(this.h[5],v),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},y.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},4859:(e,t,r)=>{"use strict";var i=r(5362),n=r(8122);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]}i.inherits(s,n),e.exports=s,s.blockSize=1024,s.outSize=384,s.hmacStrength=192,s.padLength=128,s.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},8122:(e,t,r)=>{"use strict";var i=r(5362),n=r(4372),s=r(5067),o=i.rotr64_hi,a=i.rotr64_lo,u=i.shr64_hi,f=i.shr64_lo,c=i.sum64,h=i.sum64_hi,l=i.sum64_lo,d=i.sum64_4_hi,p=i.sum64_4_lo,g=i.sum64_5_hi,m=i.sum64_5_lo,b=n.BlockHash,y=[0x428a2f98,0xd728ae22,0x71374491,0x23ef65cd,0xb5c0fbcf,0xec4d3b2f,0xe9b5dba5,0x8189dbbc,0x3956c25b,0xf348b538,0x59f111f1,0xb605d019,0x923f82a4,0xaf194f9b,0xab1c5ed5,0xda6d8118,0xd807aa98,0xa3030242,0x12835b01,0x45706fbe,0x243185be,0x4ee4b28c,0x550c7dc3,0xd5ffb4e2,0x72be5d74,0xf27b896f,0x80deb1fe,0x3b1696b1,0x9bdc06a7,0x25c71235,0xc19bf174,0xcf692694,0xe49b69c1,0x9ef14ad2,0xefbe4786,0x384f25e3,0xfc19dc6,0x8b8cd5b5,0x240ca1cc,0x77ac9c65,0x2de92c6f,0x592b0275,0x4a7484aa,0x6ea6e483,0x5cb0a9dc,0xbd41fbd4,0x76f988da,0x831153b5,0x983e5152,0xee66dfab,0xa831c66d,0x2db43210,0xb00327c8,0x98fb213f,0xbf597fc7,0xbeef0ee4,0xc6e00bf3,0x3da88fc2,0xd5a79147,0x930aa725,0x6ca6351,0xe003826f,0x14292967,0xa0e6e70,0x27b70a85,0x46d22ffc,0x2e1b2138,0x5c26c926,0x4d2c6dfc,0x5ac42aed,0x53380d13,0x9d95b3df,0x650a7354,0x8baf63de,0x766a0abb,0x3c77b2a8,0x81c2c92e,0x47edaee6,0x92722c85,0x1482353b,0xa2bfe8a1,0x4cf10364,0xa81a664b,0xbc423001,0xc24b8b70,0xd0f89791,0xc76c51a3,0x654be30,0xd192e819,0xd6ef5218,0xd6990624,0x5565a910,0xf40e3585,0x5771202a,0x106aa070,0x32bbd1b8,0x19a4c116,0xb8d2d0c8,0x1e376c08,0x5141ab53,0x2748774c,0xdf8eeb99,0x34b0bcb5,0xe19b48a8,0x391c0cb3,0xc5c95a63,0x4ed8aa4a,0xe3418acb,0x5b9cca4f,0x7763e373,0x682e6ff3,0xd6b2b8a3,0x748f82ee,0x5defb2fc,0x78a5636f,0x43172f60,0x84c87814,0xa1f0ab72,0x8cc70208,0x1a6439ec,0x90befffa,0x23631e28,0xa4506ceb,0xde82bde9,0xbef9a3f7,0xb2c67915,0xc67178f2,0xe372532b,0xca273ece,0xea26619c,0xd186b8c7,0x21c0c207,0xeada7dd6,0xcde0eb1e,0xf57d4f7f,0xee6ed178,0x6f067aa,0x72176fba,0xa637dc5,0xa2c898a6,0x113f9804,0xbef90dae,0x1b710b35,0x131c471b,0x28db77f5,0x23047d84,0x32caab7b,0x40c72493,0x3c9ebe0a,0x15c9bebc,0x431d67c4,0x9c100d4c,0x4cc5d4be,0xcb3e42b6,0x597f299c,0xfc657e2a,0x5fcb6fab,0x3ad6faec,0x6c44198c,0x4a475817];function v(){if(!(this instanceof v))return new v;b.call(this),this.h=[0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179],this.k=y,this.W=Array(160)}i.inherits(v,b),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,i=0;i<32;i++)r[i]=e[t+i];for(;i<r.length;i+=2){var n=function(e,t){var r=o(e,t,19)^o(t,e,29)^u(e,t,6);return r<0&&(r+=0x100000000),r}(r[i-4],r[i-3]),s=function(e,t){var r=a(e,t,19)^a(t,e,29)^f(e,t,6);return r<0&&(r+=0x100000000),r}(r[i-4],r[i-3]),c=r[i-14],h=r[i-13],l=function(e,t){var r=o(e,t,1)^o(e,t,8)^u(e,t,7);return r<0&&(r+=0x100000000),r}(r[i-30],r[i-29]),g=function(e,t){var r=a(e,t,1)^a(e,t,8)^f(e,t,7);return r<0&&(r+=0x100000000),r}(r[i-30],r[i-29]),m=r[i-32],b=r[i-31];r[i]=d(n,s,c,h,l,g,m,b),r[i+1]=p(n,s,c,h,l,g,m,b)}},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,i=this.h[0],n=this.h[1],u=this.h[2],f=this.h[3],d=this.h[4],p=this.h[5],b=this.h[6],y=this.h[7],v=this.h[8],w=this.h[9],_=this.h[10],E=this.h[11],x=this.h[12],S=this.h[13],M=this.h[14],I=this.h[15];s(this.k.length===r.length);for(var A=0;A<r.length;A+=2){var R=M,D=I,O=function(e,t){var r=o(e,t,14)^o(e,t,18)^o(t,e,9);return r<0&&(r+=0x100000000),r}(v,w),P=function(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=0x100000000),r}(v,w),N=function(e,t,r,i,n){var s=e&r^~e&n;return s<0&&(s+=0x100000000),s}(v,0,_,0,x,S),T=function(e,t,r,i,n,s){var o=t&i^~t&s;return o<0&&(o+=0x100000000),o}(0,w,0,E,0,S),k=this.k[A],C=this.k[A+1],L=r[A],U=r[A+1],j=g(R,D,O,P,N,T,k,C,L,U),B=m(R,D,O,P,N,T,k,C,L,U);R=function(e,t){var r=o(e,t,28)^o(t,e,2)^o(t,e,7);return r<0&&(r+=0x100000000),r}(i,n);var q=h(R,D=function(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=0x100000000),r}(i,n),O=function(e,t,r,i,n){var s=e&r^e&n^r&n;return s<0&&(s+=0x100000000),s}(i,0,u,0,d,p),P=function(e,t,r,i,n,s){var o=t&i^t&s^i&s;return o<0&&(o+=0x100000000),o}(0,n,0,f,0,p)),z=l(R,D,O,P);M=x,I=S,x=_,S=E,_=v,E=w,v=h(b,y,j,B),w=l(y,y,j,B),b=d,y=p,d=u,p=f,u=i,f=n,i=h(j,B,q,z),n=l(j,B,q,z)}c(this.h,0,i,n),c(this.h,2,u,f),c(this.h,4,d,p),c(this.h,6,b,y),c(this.h,8,v,w),c(this.h,10,_,E),c(this.h,12,x,S),c(this.h,14,M,I)},v.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},9359:(e,t,r)=>{"use strict";var i=r(5362).rotr32;function n(e,t,r){return e&t^e&r^t&r}t.ft_1=function(e,t,r,i){return 0===e?t&r^~t&i:1===e||3===e?t^r^i:2===e?n(t,r,i):void 0},t.ch32=function(e,t,r){return e&t^~e&r},t.maj32=n,t.p32=function(e,t,r){return e^t^r},t.s0_256=function(e){return i(e,2)^i(e,13)^i(e,22)},t.s1_256=function(e){return i(e,6)^i(e,11)^i(e,25)},t.g0_256=function(e){return i(e,7)^i(e,18)^e>>>3},t.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},5362:(e,t,r)=>{"use strict";var i=r(5067),n=r(4448);function s(e){return(e>>>24|e>>>8&65280|e<<8&0xff0000|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function a(e){if(7===e.length)return"0"+e;if(6===e.length)return"00"+e;if(5===e.length)return"000"+e;if(4===e.length)return"0000"+e;if(3===e.length)return"00000"+e;if(2===e.length)return"000000"+e;if(1===e.length)return"0000000"+e;else return e}t.inherits=n,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e){if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/ig,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(var i=0,n=0;n<e.length;n++){var s,o,a=e.charCodeAt(n);a<128?r[i++]=a:(a<2048?r[i++]=a>>
1826|192:((s=e,o=n,(64512&s.charCodeAt(o))!=55296||o<0||o+1>=s.length?1:(64512&s.charCodeAt(o+1))!=56320)?r[i++]=a>>12|224:(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++n)),r[i++]=a>>18|240,r[i++]=a>>12&63|128),r[i++]=a>>6&63|128),r[i++]=63&a|128)}}else for(n=0;n<e.length;n++)r[n]=0|e[n];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=o(e[r].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var r="",i=0;i<e.length;i++){var n=e[i];"little"===t&&(n=s(n)),r+=a(n.toString(16))}return r},t.zero2=o,t.zero8=a,t.join32=function(e,t,r,n){var s,o=r-t;i(o%4==0);for(var a=Array(o/4),u=0,f=t;u<a.length;u++,f+=4)s="big"===n?e[f]<<24|e[f+1]<<16|e[f+2]<<8|e[f+3]:e[f+3]<<24|e[f+2]<<16|e[f+1]<<8|e[f],a[u]=s>>>0;return a},t.split32=function(e,t){for(var r=Array(4*e.length),i=0,n=0;i<e.length;i++,n+=4){var s=e[i];"big"===t?(r[n]=s>>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=255&s):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=255&s)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},t.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},t.sum64=function(e,t,r,i){var n=e[t],s=i+e[t+1]>>>0;e[t]=(s<i?1:0)+r+n>>>0,e[t+1]=s},t.sum64_hi=function(e,t,r,i){return(t+i>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,i){return t+i>>>0},t.sum64_4_hi=function(e,t,r,i,n,s,o,a){var u,f=t;return e+r+n+o+(0+((f=f+i>>>0)<t?1:0)+((f=f+s>>>0)<s?1:0)+((f=f+a>>>0)<a?1:0))>>>0},t.sum64_4_lo=function(e,t,r,i,n,s,o,a){return t+i+s+a>>>0},t.sum64_5_hi=function(e,t,r,i,n,s,o,a,u,f){var c,h=t;return e+r+n+o+u+(0+((h=h+i>>>0)<t?1:0)+((h=h+s>>>0)<s?1:0)+((h=h+a>>>0)<a?1:0)+((h=h+f>>>0)<f?1:0))>>>0},t.sum64_5_lo=function(e,t,r,i,n,s,o,a,u,f){return t+i+s+a+f>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},6205:(e,t,r)=>{"use strict";var i=r(7432),n=r(5897),s=r(5067);function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=n.toArray(e.entropy,e.entropyEnc||"hex"),r=n.toArray(e.nonce,e.nonceEnc||"hex"),i=n.toArray(e.pers,e.persEnc||"hex");s(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}e.exports=o,o.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=0x1000000000000},o.prototype._hmac=function(){return new i.hmac(this.hash,this.K)},o.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},o.prototype.reseed=function(e,t,r,i){"string"!=typeof t&&(i=r,r=t,t=null),e=n.toArray(e,t),r=n.toArray(r,i),s(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},o.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=n.toArray(r,i||"hex"),this._update(r));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var o=s.slice(0,e);return this._update(r),this._reseed++,n.encode(o,t)}},4981:(e,t)=>{t.read=function(e,t,r,i,n){var s,o,a=8*n-i-1,u=(1<<a)-1,f=u>>1,c=-7,h=r?n-1:0,l=r?-1:1,d=e[t+h];for(h+=l,s=d&(1<<-c)-1,d>>=-c,c+=a;c>0;s=256*s+e[t+h],h+=l,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=i;c>0;o=256*o+e[t+h],h+=l,c-=8);if(0===s)s=1-f;else{if(s===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,i),s-=f}return(d?-1:1)*o*Math.pow(2,s-i)},t.write=function(e,t,r,i,n,s){var o,a,u,f=8*s-n-1,c=(1<<f)-1,h=c>>1,l=23===n?5960464477539062e-23:0,d=i?0:s-1,p=i?1:-1,g=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(a=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+h>=1?t+=l/u:t+=l*Math.pow(2,1-h),t*u>=2&&(o++,u/=2),o+h>=c?(a=0,o=c):o+h>=1?(a=(t*u-1)*Math.pow(2,n),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,n),o=0));n>=8;e[r+d]=255&a,d+=p,a/=256,n-=8);for(o=o<<n|a,f+=n;f>0;e[r+d]=255&o,d+=p,o/=256,f-=8);e[r+d-p]|=128*g}},4448:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},720:(e,t,r)=>{var i,n=r(2818);!function(){"use strict";
182var s="input is invalid type",o="object"==typeof window,a=o?window:{};a.JS_SHA3_NO_WINDOW&&(o=!1);var u=!o&&"object"==typeof self;!a.JS_SHA3_NO_NODE_JS&&"object"==typeof n&&n.versions&&n.versions.node?a=r.g:u&&(a=self);var f=!a.JS_SHA3_NO_COMMON_JS&&e.exports,c=r.amdO,h=!a.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,l="0123456789abcdef".split(""),d=[4,1024,262144,0x4000000],p=[0,8,16,24],g=[1,0,32898,0,32906,0x80000000,0x80008000,0x80000000,32907,0,0x80000001,0,0x80008081,0x80000000,32777,0x80000000,138,0,136,0,0x80008009,0,0x8000000a,0,0x8000808b,0,139,0x80000000,32905,0x80000000,32771,0x80000000,32770,0x80000000,128,0x80000000,32778,0,0x8000000a,0x80000000,0x80008081,0x80000000,32896,0x80000000,0x80000001,0,0x80008008,0x80000000],m=[224,256,384,512],b=[128,256],y=["hex","buffer","arrayBuffer","array","digest"],v={128:168,256:136};(a.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),h&&(a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var w=function(e,t,r){return function(i){return new C(e,t,e).update(i)[r]()}},_=function(e,t,r){return function(i,n){return new C(e,t,n).update(i)[r]()}},E=function(e,t,r){return function(t,i,n,s){return A["cshake"+e].update(t,i,n,s)[r]()}},x=function(e,t,r){return function(t,i,n,s){return A["kmac"+e].update(t,i,n,s)[r]()}},S=function(e,t,r,i){for(var n=0;n<y.length;++n){var s=y[n];e[s]=t(r,i,s)}return e},M=function(e,t){var r=w(e,t,"hex");return r.create=function(){return new C(e,t,e)},r.update=function(e){return r.create().update(e)},S(r,w,e,t)},I=[{name:"keccak",padding:[1,256,65536,0x1000000],bits:m,createMethod:M},{name:"sha3",padding:[6,1536,393216,0x6000000],bits:m,createMethod:M},{name:"shake",padding:[31,7936,2031616,0x1f000000],bits:b,createMethod:function(e,t){var r=_(e,t,"hex");return r.create=function(r){return new C(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},S(r,_,e,t)}},{name:"cshake",padding:d,bits:b,createMethod:function(e,t){var r=v[e],i=E(e,t,"hex");return i.create=function(i,n,s){return n||s?new C(e,t,i).bytepad([n,s],r):A["shake"+e].create(i)},i.update=function(e,t,r,n){return i.create(t,r,n).update(e)},S(i,E,e,t)}},{name:"kmac",padding:d,bits:b,createMethod:function(e,t){var r=v[e],i=x(e,t,"hex");return i.create=function(i,n,s){return new L(e,t,n).bytepad(["KMAC",s],r).bytepad([i],r)},i.update=function(e,t,r,n){return i.create(e,r,n).update(t)},S(i,x,e,t)}}],A={},R=[],D=0;D<I.length;++D)for(var O=I[D],P=O.bits,N=0;N<P.length;++N){var T=O.name+"_"+P[N];if(R.push(T),A[T]=O.createMethod(P[N],O.padding),"sha3"!==O.name){var k=O.name+P[N];R.push(k),A[k]=A[T]}}function C(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}function L(e,t,r){C.call(this,e,t,r)}C.prototype.update=function(e){if(this.finalized)throw Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"===r){if(null===e)throw Error(s);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!h||!ArrayBuffer.isView(e)))throw Error(s)}else throw Error(s);t=!0}for(var i,n,o=this.blocks,a=this.byteCount,u=e.length,f=this.blockCount,c=0,l=this.s;c<u;){if(this.reset)for(i=1,this.reset=!1,o[0]=this.block;i<f+1;++i)o[i]=0;if(t)for(i=this.start;c<u&&i<a;++c)o[i>>2]|=e[c]<<p[3&i++];else for(i=this.start;c<u&&i<a;++c)(n=e.charCodeAt(c))<128?o[i>>2]|=n<<p[3&i++]:(n<2048?o[i>>2]|=(192|n>>6)<<p[3&i++]:(n<55296||n>=57344?o[i>>2]|=(224|n>>12)<<p[3&i++]:(n=65536+((1023&n)<<10|1023&e.charCodeAt(++c)),o[i>>2]|=(240|n>>18)<<p[3&i++],o[i>>2]|=(128|n>>12&63)<<p[3&i++]),o[i>>2]|=(128|n>>6&63)<<p[3&i++]),o[i>>2]|=(128|63&n)<<p[3&i++]);if(this.lastByteIndex=i,i>=a){for(this.start=i-a,this.block=o[f],i=0;i<f;++i)l[i]^=o[i];U(l),this.reset=!0}else this.start=i}return this},C.prototype.encode=function(e,t){var r=255&e,i=1,n=[r];for(e>>=8,r=255&e;r>0;)n.unshift(r),e>>=8,r=255&e,++i;return t?n.push(i):n.unshift(i),this.update(n),n.length},C.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"===r){if(null===e)throw Error(s);
182if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!h||!ArrayBuffer.isView(e)))throw Error(s)}else throw Error(s);t=!0}var i=0,n=e.length;if(t)i=n;else for(var o=0;o<e.length;++o){var a=e.charCodeAt(o);a<128?i+=1:a<2048?i+=2:a<55296||a>=57344?i+=3:(a=65536+((1023&a)<<10|1023&e.charCodeAt(++o)),i+=4)}return i+=this.encode(8*i),this.update(e),i},C.prototype.bytepad=function(e,t){for(var r=this.encode(t),i=0;i<e.length;++i)r+=this.encodeString(e[i]);var n=t-r%t,s=[];return s.length=n,this.update(s),this},C.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,i=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(t=1,e[0]=e[r];t<r+1;++t)e[t]=0;for(e[r-1]|=0x80000000,t=0;t<r;++t)i[t]^=e[t];U(i)}},C.prototype.toString=C.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,s=0,o=0,a="";o<i;){for(s=0;s<t&&o<i;++s,++o)a+=l[(e=r[s])>>4&15]+l[15&e]+l[e>>12&15]+l[e>>8&15]+l[e>>20&15]+l[e>>16&15]+l[e>>28&15]+l[e>>24&15];o%t==0&&(U(r),s=0)}return n&&(a+=l[(e=r[s])>>4&15]+l[15&e],n>1&&(a+=l[e>>12&15]+l[e>>8&15]),n>2&&(a+=l[e>>20&15]+l[e>>16&15])),a},C.prototype.arrayBuffer=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,s=0,o=0,a=this.outputBits>>3,u=new Uint32Array(e=new ArrayBuffer(n?i+1<<2:a));o<i;){for(s=0;s<t&&o<i;++s,++o)u[o]=r[s];o%t==0&&U(r)}return n&&(u[s]=r[s],e=e.slice(0,a)),e},C.prototype.buffer=C.prototype.arrayBuffer,C.prototype.digest=C.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,i=this.s,n=this.outputBlocks,s=this.extraBytes,o=0,a=0,u=[];a<n;){for(o=0;o<r&&a<n;++o,++a)e=a<<2,t=i[o],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;a%r==0&&U(i)}return s&&(e=a<<2,t=i[o],u[e]=255&t,s>1&&(u[e+1]=t>>8&255),s>2&&(u[e+2]=t>>16&255)),u},L.prototype=new C,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),C.prototype.finalize.call(this)};var U=function(e){var t,r,i,n,s,o,a,u,f,c,h,l,d,p,m,b,y,v,w,_,E,x,S,M,I,A,R,D,O,P,N,T,k,C,L,U,j,B,q,z,F,$,H,K,V,G,W,J,X,Y,Z,Q,ee,et,er,ei,en,es,eo,ea,eu,ef,ec;for(i=0;i<48;i+=2)n=e[0]^e[10]^e[20]^e[30]^e[40],s=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],f=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],l=e[8]^e[18]^e[28]^e[38]^e[48],d=e[9]^e[19]^e[29]^e[39]^e[49],t=l^(o<<1|a>>>31),r=d^(a<<1|o>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=n^(u<<1|f>>>31),r=s^(f<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=o^(c<<1|h>>>31),r=a^(h<<1|c>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(l<<1|d>>>31),r=f^(d<<1|l>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=c^(n<<1|s>>>31),r=h^(s<<1|n>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,p=e[0],m=e[1],G=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,D=e[20]<<3|e[21]>>>29,O=e[21]<<3|e[20]>>>29,ea=e[31]<<9|e[30]>>>23,eu=e[30]<<9|e[31]>>>23,$=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,L=e[3]<<1|e[2]>>>31,b=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,J=e[22]<<10|e[23]>>>22,X=e[23]<<10|e[22]>>>22,P=e[33]<<13|e[32]>>>19,N=e[32]<<13|e[33]>>>19,ef=e[42]<<2|e[43]>>>30,ec=e[43]<<2|e[42]>>>30,et=e[5]<<30|e[4]>>>2,er=e[4]<<30|e[5]>>>2,U=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,Z=e[35]<<15|e[34]>>>17,T=e[45]<<29|e[44]>>>3,k=e[44]<<29|e[45]>>>3,M=e[6]<<28|e[7]>>>4,I=e[7]<<28|e[6]>>>4,ei=e[17]<<23|e[16]>>>9,en=e[16]<<23|e[17]>>>9,B=e[26]<<25|e[27]>>>7,q=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,K=e[8]<<27|e[9]>>>5,V=e[9]<<27|e[8]>>>5,A=e[18]<<20|e[19]>>>12,R=e[19]<<20|e[18]>>>12,es=e[29]<<7|e[28]>>>25,eo=e[28]<<7|e[29]>>>25,z=e[38]<<8|e[39]>>>24,F=e[39]<<8|e[38]>>>24,x=e[48]<<14|e[49]>>>18,S=e[49]<<14|e[48]>>>18,e[0]=p^~b&v,e[1]=m^~y&w,e[10]=M^~A&D,e[11]=I^~R&O,e[20]=C^~U&B,e[21]=L^~j&q,e[30]=K^~G&J,e[31]=V^~W&X,e[40]=et^~ei&es,e[41]=er^~en&eo,e[2]=b^~v&_,e[3]=y^~w&E,e[12]=A^~D&P,e[13]=R^~O&N,e[22]=U^~B&z,e[23]=j^~q&F,e[32]=G^~J&Y,e[33]=W^~X&Z,e[42]=ei^~es&ea,e[43]=en^~eo&eu,e[4]=v^~_&x,e[5]=w^~E&S,e[14]=D^~P&T,e[15]=O^~N&k,e[24]=B^~z&$,e[25]=q^~F&H,e[34]=J^~Y&Q,e[35]=X^~Z&ee,e[44]=es^~ea&ef,e[45]=eo^~eu&ec,e[6]=_^~x&p,e[7]=E^~S&m,e[16]=P^~T&M,e[17]=N^~k&I,e[26]=z^~$&C,e[27]=F^~H&L,e[36]=Y^~Q&K,e[37]=Z^~ee&V,e[46]=ea^~ef&et,e[47]=eu^~ec&er,e[8]=x^~p&b,e[9]=S^~m&y,e[18]=T^~M&A,e[19]=k^~I&R,e[28]=$^~C&U,e[29]=H^~L&j,e[38]=Q^~K&G,e[39]=ee^~V&W,e[48]=ef^~et&ei,e[49]=ec^~er&en,e[0]^=g[i],e[1]^=g[i+1]};if(f)e.exports=A;else{for(D=0;D<R.length;++D)a[R[D]]=A[R[D]];c&&void 0!==(i=(function(){return A}).call(t,r,t,e))&&(e.exports=i)}}()},9618:(e,t,r)=>{e=r.nmd(e);var i,n,s="__lodash_hash_undefined__",o="[object Arguments]",a="[object Array]",u="[object Boolean]",f="[object Date]",c="[object Error]",h="[object Function]",l="[object Map]",d="[object Number]",p="[object Object]",g="[object Promise]",m="[object RegExp]",b="[object Set]",y="[object String]",v="[object WeakMap]",w="[object ArrayBuffer]",_="[object DataView]",E=/^\[object .+?Constructor\]$/,x=/^(?:0|[1-9]\d*)$/,S={};
182S["[object Float32Array]"]=S["[object Float64Array]"]=S["[object Int8Array]"]=S["[object Int16Array]"]=S["[object Int32Array]"]=S["[object Uint8Array]"]=S["[object Uint8ClampedArray]"]=S["[object Uint16Array]"]=S["[object Uint32Array]"]=!0,S[o]=S[a]=S[w]=S[u]=S[_]=S[f]=S[c]=S[h]=S[l]=S[d]=S[p]=S[m]=S[b]=S[y]=S[v]=!1;var M="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,I="object"==typeof self&&self&&self.Object===Object&&self,A=M||I||Function("return this")(),R=t&&!t.nodeType&&t,D=R&&e&&!e.nodeType&&e,O=D&&D.exports===R,P=O&&M.process,N=function(){try{return P&&P.binding&&P.binding("util")}catch(e){}}(),T=N&&N.isTypedArray;function k(e){var t=-1,r=Array(e.size);return e.forEach(function(e,i){r[++t]=[i,e]}),r}function C(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var L=Array.prototype,U=Function.prototype,j=Object.prototype,B=A["__core-js_shared__"],q=U.toString,z=j.hasOwnProperty,F=function(){var e=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),$=j.toString,H=RegExp("^"+q.call(z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),K=O?A.Buffer:void 0,V=A.Symbol,G=A.Uint8Array,W=j.propertyIsEnumerable,J=L.splice,X=V?V.toStringTag:void 0,Y=Object.getOwnPropertySymbols,Z=K?K.isBuffer:void 0,Q=(i=Object.keys,n=Object,function(e){return i(n(e))}),ee=eS(A,"DataView"),et=eS(A,"Map"),er=eS(A,"Promise"),ei=eS(A,"Set"),en=eS(A,"WeakMap"),es=eS(Object,"create"),eo=eA(ee),ea=eA(et),eu=eA(er),ef=eA(ei),ec=eA(en),eh=V?V.prototype:void 0,el=eh?eh.valueOf:void 0;function ed(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function ep(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function eg(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function em(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new eg;++t<r;)this.add(e[t])}function eb(e){var t=this.__data__=new ep(e);this.size=t.size}function ey(e,t){for(var r=e.length;r--;)if(eR(e[r][0],t))return r;return -1}function ev(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":X&&X in Object(e)?function(e){var t=z.call(e,X),r=e[X];try{e[X]=void 0;var i=!0}catch(e){}var n=$.call(e);return i&&(t?e[X]=r:delete e[X]),n}(e):$.call(e)}function ew(e){return eC(e)&&ev(e)==o}function e_(e,t,r,i,n,s){var o=1&r,a=e.length,u=t.length;if(a!=u&&!(o&&u>a))return!1;var f=s.get(e);if(f&&s.get(t))return f==t;var c=-1,h=!0,l=2&r?new em:void 0;for(s.set(e,t),s.set(t,e);++c<a;){var d=e[c],p=t[c];if(i)var g=o?i(p,d,c,t,e,s):i(d,p,c,e,t,s);if(void 0!==g){if(g)continue;h=!1;break}if(l){if(!function(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}(t,function(e,t){if(!l.has(t)&&(d===e||n(d,e,r,i,s)))return l.push(t)})){h=!1;break}}else if(!(d===p||n(d,p,r,i,s))){h=!1;break}}return s.delete(e),s.delete(t),h}function eE(e){var t;return t=function(e){return null!=e&&eT(e.length)&&!eN(e)?function(e,t){var r,i=eO(e),n=!i&&eD(e),s=!i&&!n&&eP(e),o=!i&&!n&&!s&&eL(e),a=i||n||s||o,u=a?function(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}(e.length,String):[],f=u.length;for(var c in e)z.call(e,c)&&!(a&&("length"==c||s&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||(r=null==(r=f)?0x1fffffffffffff:r)&&("number"==typeof c||x.test(c))&&c>-1&&c%1==0&&c<r))&&u.push(c);return u}(e):function(e){if(t=e&&e.constructor,e!==("function"==typeof t&&t.prototype||j))return Q(e);var t,r=[];for(var i in Object(e))z.call(e,i)&&"constructor"!=i&&r.push(i);return r}(e)}(e),eO(e)?t:function(e,t){for(var r=-1,i=t.length,n=e.length;++r<i;)e[n+r]=t[r];return e}(t,eM(e))}function ex(e,t){var r,i=e.__data__;return("string"==(r=typeof t)||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t)?i["string"==typeof t?"string":"hash"]:i.map}function eS(e,t){var r=null==e?void 0:e[t];return!(!ek(r)||F&&F in r)&&(eN(r)?H:E).test(eA(r))?r:void 0}ed.prototype.clear=function(){this.__data__=es?es(null):{},this.size=0},ed.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ed.prototype.get=function(e){var t=this.__data__;if(es){var r=t[e];return r===s?void 0:r}return z.call(t,e)?t[e]:void 0},ed.prototype.has=function(e){var t=this.__data__;return es?void 0!==t[e]:z.call(t,e)},ed.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=es&&void 0===t?s:t,this},ep.prototype.clear=function(){this.__data__=[],this.size=0},ep.prototype.delete=function(e){var t=this.__data__,r=ey(t,e);return!(r<0)&&(r==t.length-1?t.pop():J.call(t,r,1),--this.size,!0)},ep.prototype.get=function(e){var t=this.__data__,r=ey(t,e);return r<0?void 0:t[r][1]},ep.prototype.has=function(e){return ey(this.__data__,e)>-1},ep.prototype.set=function(e,t){var r=this.__data__,i=ey(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this},eg.prototype.clear=function(){this.size=0,this.__data__={hash:new ed,map:new(et||ep),string:new ed}},eg.prototype.delete=function(e){var t=ex(this,e).delete(e);return this.size-=t?1:0,t},eg.prototype.get=function(e){return ex(this,e).get(e)},eg.prototype.has=function(e){return ex(this,e).has(e)},eg.prototype.set=function(e,t){var r=ex(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this},em.prototype.add=em.prototype.push=function(e){return this.__data__.set(e,s),this},em.prototype.has=function(e){return this.__data__.has(e)},eb.prototype.clear=function(){this.__data__=new ep,this.size=0},eb.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},eb.prototype.get=function(e){return this.__data__.get(e)},eb.prototype.has=function(e){return this.__data__.has(e)},eb.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ep){var i=r.__data__;if(!et||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new eg(i)}return r.set(e,t),this.size=r.size,this};var eM=Y?function(e){return null==e?[]:function(e,t){for(var r=-1,i=null==e?0:e.length,n=0,s=[];++r<i;){var o=e[r];t(o,r,e)&&(s[n++]=o)}return s}(Y(e=Object(e)),function(t){return W.call(e,t)})}:function(){return[]},eI=ev;function eA(e){if(null!=e){try{return q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function eR(e,t){return e===t||e!=e&&t!=t}(ee&&eI(new ee(new ArrayBuffer(1)))!=_||et&&eI(new et)!=l||er&&eI(er.resolve())!=g||ei&&eI(new ei)!=b||en&&eI(new en)!=v)&&(eI=function(e){var t=ev(e),r=t==p?e.constructor:void 0,i=r?eA(r):"";if(i)switch(i){case eo:return _;case ea:return l;case eu:return g;case ef:return b;case ec:return v}return t});var eD=ew(function(){return arguments}())?ew:function(e){return eC(e)&&z.call(e,"callee")&&!W.call(e,"callee")},eO=Array.isArray,eP=Z||function(){return!1};function eN(e){if(!ek(e))return!1;var t=ev(e);return t==h||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function eT(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}function ek(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function eC(e){return null!=e&&"object"==typeof e}var eL=T?function(e){return T(e)}:function(e){return eC(e)&&eT(e.length)&&!!S[ev(e)]};e.exports=function(e,t){return function e(t,r,i,n,s){return t===r||(null!=t&&null!=r&&(eC(t)||eC(r))?function(e,t,r,i,n,s){var h=eO(e),g=eO(t),v=h?a:eI(e),E=g?a:eI(t);v=v==o?p:v,E=E==o?p:E;var x=v==p,S=E==p,M=v==E;
182if(M&&eP(e)){if(!eP(t))return!1;h=!0,x=!1}if(M&&!x)return s||(s=new eb),h||eL(e)?e_(e,t,r,i,n,s):function(e,t,r,i,n,s,o){switch(r){case _:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case w:if(e.byteLength!=t.byteLength||!s(new G(e),new G(t)))break;return!0;case u:case f:case d:return eR(+e,+t);case c:return e.name==t.name&&e.message==t.message;case m:case y:return e==t+"";case l:var a=k;case b:var h=1&i;if(a||(a=C),e.size!=t.size&&!h)break;var p=o.get(e);if(p)return p==t;i|=2,o.set(e,t);var g=e_(a(e),a(t),i,n,s,o);return o.delete(e),g;case"[object Symbol]":if(el)return el.call(e)==el.call(t)}return!1}(e,t,v,r,i,n,s);if(!(1&r)){var I=x&&z.call(e,"__wrapped__"),A=S&&z.call(t,"__wrapped__");if(I||A){var R=I?e.value():e,D=A?t.value():t;return s||(s=new eb),n(R,D,r,i,s)}}return!!M&&(s||(s=new eb),function(e,t,r,i,n,s){var o=1&r,a=eE(e),u=a.length;if(u!=eE(t).length&&!o)return!1;for(var f=u;f--;){var c=a[f];if(!(o?c in t:z.call(t,c)))return!1}var h=s.get(e);if(h&&s.get(t))return h==t;var l=!0;s.set(e,t),s.set(t,e);for(var d=o;++f<u;){var p=e[c=a[f]],g=t[c];if(i)var m=o?i(g,p,c,t,e,s):i(p,g,c,e,t,s);if(!(void 0===m?p===g||n(p,g,r,i,s):m)){l=!1;break}d||(d="constructor"==c)}if(l&&!d){var b=e.constructor,y=t.constructor;b!=y&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof y&&y instanceof y)&&(l=!1)}return s.delete(e),s.delete(t),l}(e,t,r,i,n,s))}(t,r,i,n,e,s):t!=t&&r!=r)}(e,t)}},5067:e=>{function t(e,t){if(!e)throw Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw Error(r||"Assertion failed: "+e+" != "+t)}},5897:(e,t)=>{"use strict";function r(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",i=0;i<e.length;i++)t+=r(e[i].toString(16));return t}t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var i=0;i<e.length;i++)r[i]=0|e[i];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/ig,"")).length%2!=0&&(e="0"+e);for(var i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var i=0;i<e.length;i++){var n=e.charCodeAt(i),s=n>>8,o=255&n;s?r.push(s,o):r.push(o)}return r},t.zero2=r,t.toHex=i,t.encode=function(e,t){return"hex"===t?i(e):e}},7536:(e,t,r)=>{"use strict";let i=r(2434),n=r(1466),s=r(3200),o=r(8287),a=e=>null==e,u=Symbol("encodeFragmentIdentifier");function f(e){if("string"!=typeof e||1!==e.length)throw TypeError("arrayFormatSeparator must be single character string")}function c(e,t){return t.encode?t.strict?i(e):encodeURIComponent(e):e}function h(e,t){return t.decode?n(e):e}function l(e){let t=e.indexOf("#");return -1!==t&&(e=e.slice(0,t)),e}function d(e){let t=(e=l(e)).indexOf("?");return -1===t?"":e.slice(t+1)}function p(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):t.parseBooleans&&null!==e&&("true"===e.toLowerCase()||"false"===e.toLowerCase())&&(e="true"===e.toLowerCase()),e}function g(e,t){f((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);let r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,i)=>{if(t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),!t){i[e]=r;return}void 0===i[e]&&(i[e]={}),i[e][t[1]]=r};case"bracket":return(e,r,i)=>{if(t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),!t){i[e]=r;return}if(void 0===i[e]){i[e]=[r];return}i[e]=[].concat(i[e],r)};case"colon-list-separator":return(e,r,i)=>{if(t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),!t){i[e]=r;return}if(void 0===i[e]){i[e]=[r];return}i[e]=[].concat(i[e],r)};case"comma":case"separator":return(t,r,i)=>{let n="string"==typeof r&&r.includes(e.arrayFormatSeparator),s="string"==typeof r&&!n&&h(r,e).includes(e.arrayFormatSeparator);r=s?h(r,e):r;let o=n||s?r.split(e.arrayFormatSeparator).map(t=>h(t,e)):null===r?r:h(r,e);i[t]=o};case"bracket-separator":return(t,r,i)=>{let n=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!n){i[t]=r?h(r,e):r;return}let s=null===r?[]:r.split(e.arrayFormatSeparator).map(t=>h(t,e));if(void 0===i[t]){i[t]=s;return}i[t]=[].concat(i[t],s)};default:return(e,t,r)=>{if(void 0===r[e]){r[e]=t;return}r[e]=[].concat(r[e],t)}}}(t),i=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return i;for(let n of e.split("&")){if(""===n)continue;let[e,o]=s(t.decode?n.replace(/\+/g," "):n,"=");o=void 0===o?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?o:h(o,t),r(h(e,t),o,i)}for(let e of Object.keys(i)){let r=i[e];if("object"==typeof r&&null!==r)for(let e of Object.keys(r))r[e]=p(r[e],t);else i[e]=p(r,t)}return!1===t.sort?i:(!0===t.sort?Object.keys(i).sort():Object.keys(i).sort(t.sort)).reduce((e,t)=>
182{let r=i[t];return r&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(r):e[t]=r,e},Object.create(null))}t.extract=d,t.parse=g,t.stringify=(e,t)=>{if(!e)return"";f((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);let r=r=>t.skipNull&&a(e[r])||t.skipEmptyString&&""===e[r],i=function(e){switch(e.arrayFormat){case"index":return t=>(r,i)=>{let n=r.length;return void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:null===i?[...r,[c(t,e),"[",n,"]"].join("")]:[...r,[c(t,e),"[",c(n,e),"]=",c(i,e)].join("")]};case"bracket":return t=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:null===i?[...r,[c(t,e),"[]"].join("")]:[...r,[c(t,e),"[]=",c(i,e)].join("")];case"colon-list-separator":return t=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:null===i?[...r,[c(t,e),":list="].join("")]:[...r,[c(t,e),":list=",c(i,e)].join("")];case"comma":case"separator":case"bracket-separator":{let t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(i,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?i:(n=null===n?"":n,0===i.length)?[[c(r,e),t,c(n,e)].join("")]:[[i,c(n,e)].join(e.arrayFormatSeparator)]}default:return t=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:null===i?[...r,c(t,e)]:[...r,[c(t,e),"=",c(i,e)].join("")]}}(t),n={};for(let t of Object.keys(e))r(t)||(n[t]=e[t]);let s=Object.keys(n);return!1!==t.sort&&s.sort(t.sort),s.map(r=>{let n=e[r];return void 0===n?"":null===n?c(r,t):Array.isArray(n)?0===n.length&&"bracket-separator"===t.arrayFormat?c(r,t)+"[]":n.reduce(i(r),[]).join("&"):c(r,t)+"="+c(n,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>
182{t=Object.assign({decode:!0},t);let[r,i]=s(e,"#");return Object.assign({url:r.split("?")[0]||"",query:g(d(e),t)},t&&t.parseFragmentIdentifier&&i?{fragmentIdentifier:h(i,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0,[u]:!0},r);let i=l(e.url).split("?")[0]||"",n=t.extract(e.url),s=Object.assign(t.parse(n,{sort:!1}),e.query),o=t.stringify(s,r);o&&(o=`?${o}`);let a=function(e){let t="",r=e.indexOf("#");return -1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(a=`#${r[u]?c(e.fragmentIdentifier,r):e.fragmentIdentifier}`),`${i}${o}${a}`},t.pick=(e,r,i)=>{i=Object.assign({parseFragmentIdentifier:!0,[u]:!1},i);let{url:n,query:s,fragmentIdentifier:a}=t.parseUrl(e,i);return t.stringifyUrl({url:n,query:o(s,r),fragmentIdentifier:a},i)},t.exclude=(e,r,i)=>{let n=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,n,i)}},6617:e=>{"use strict";function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}e.exports=function(e,r,i){var n=i&&i.stringify||t;if("object"==typeof e&&null!==e){var s=r.length+1;if(1===s)return e;var o=Array(s);o[0]=n(e);for(var a=1;a<s;a++)o[a]=n(r[a]);return o.join(" ")}if("string"!=typeof e)return e;var u=r.length;if(0===u)return e;for(var f="",c=0,h=-1,l=e&&e.length||0,d=0;d<l;){if(37===e.charCodeAt(d)&&d+1<l){switch(h=h>-1?h:0,e.charCodeAt(d+1)){case 100:case 102:if(c>=u||null==r[c])break;h<d&&(f+=e.slice(h,d)),f+=Number(r[c]),h=d+2,d++;break;case 105:if(c>=u||null==r[c])break;h<d&&(f+=e.slice(h,d)),f+=Math.floor(Number(r[c])),h=d+2,d++;break;case 79:case 111:case 106:if(c>=u||void 0===r[c])break;h<d&&(f+=e.slice(h,d));var p=typeof r[c];if("string"===p){f+="'"+r[c]+"'",h=d+2,d++;break}if("function"===p){f+=r[c].name||"<anonymous>",h=d+2,d++;break}f+=n(r[c]),h=d+2,d++;break;case 115:if(c>=u)break;h<d&&(f+=e.slice(h,d)),f+=String(r[c]),h=d+2,d++;break;case 37:h<d&&(f+=e.slice(h,d)),f+="%",h=d+2,d++,c--}++c}++d}return -1===h?e:(h<l&&(f+=e.slice(h)),f)}},2194:(e,t,r)=>{"use strict";t.KN=void 0;var i=r(5927),n=function(e){return e&&e.__esModule?e:{default:e}}(r(1071)),s=function(e){var t=e.allowedSizes,r=e.defaultSize,s=e.padding;return function e(){var o=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;if(!this||this.constructor!==e)return new e(a);if(t&&!t.includes(a))throw Error("Unsupported hash length");var u=new n.default({capacity:a});return this.update=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";if(i.Buffer.isBuffer(e))return u.absorb(e),o;if("string"==typeof e)return o.update(i.Buffer.from(e,t));throw TypeError("Not a string or buffer")},this.digest=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"binary",t="string"==typeof e?{format:e}:e,r=u.squeeze({buffer:t.buffer,padding:t.padding||s});return t.format&&"binary"!==t.format?r.toString(t.format):r},this.reset=function(){return u.reset(),o},this}},o=s({allowedSizes:[224,256,384,512],defaultSize:512,padding:1}),a=s({allowedSizes:[224,256,384,512],defaultSize:512,padding:6});t.KN=a,s({allowedSizes:[128,256],defaultSize:256,padding:31}),a.SHA3Hash=o},1071:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(5927),n=function(e){return e&&e.__esModule?e:{default:e}}(r(9962)),s=function(e,t){for(var r=0;r<e.length;r+=8){var i=r/4;t[i]^=e[r+7]<<24|e[r+6]<<16|e[r+5]<<8|e[r+4],t[i+1]^=e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]}return t},o=function(e,t){for(var r=0;r<t.length;r+=8){var i=r/4;t[r]=e[i+1],t[r+1]=e[i+1]>>>8,t[r+2]=e[i+1]>>>16,t[r+3]=e[i+1]>>>24,t[r+4]=e[i],t[r+5]=e[i]>>>8,t[r+6]=e[i]>>>16,t[r+7]=e[i]>>>24}return t};t.default=function(e){var t=this,r=e.capacity,a=e.padding,u=(0,n.default)(),f=r/8,c=200-r/4,h=0,l=new Uint32Array(50),d=i.Buffer.allocUnsafe(c);return this.absorb=function(e){for(var r=0;r<e.length;r++)d[h]=e[r],(h+=1)>=c&&(s(d,l),u(l),h=0);return t},this.squeeze=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={buffer:e.buffer||i.Buffer.allocUnsafe(f),padding:e.padding||a,queue:i.Buffer.allocUnsafe(d.length),state:new Uint32Array(l.length)};d.copy(t.queue);for(var r=0;r<l.length;r++)t.state[r]=l[r];t.queue.fill(0,h),t.queue[h]|=t.padding,t.queue[c-1]|=128,s(t.queue,t.state);for(var n=0;n<t.buffer.length;n+=c)u(t.state),o(t.state,t.buffer.slice(n,n+c));return t.buffer},this.reset=function(){return d.fill(0),l.fill(0),h=0,t},this}},4363:(e,t,r)=>{"use strict";
182Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e){return e&&e.__esModule?e:{default:e}}(r(9012));t.default=function(e){for(var t=e.A,r=e.C,n=0;n<25;n+=5){for(var s=0;s<5;s++)(0,i.default)(t,n+s)(r,s);for(var o=0;o<5;o++){var a=(n+o)*2,u=(o+1)%5*2,f=(o+2)%5*2;t[a]^=~r[u]&r[f],t[a+1]^=~r[u+1]&r[f+1]}}}},9012:e=>{"use strict";e.exports=function(e,t){return function(r,i){var n=2*i,s=2*t;r[n]=e[s],r[n+1]=e[s+1]}}},9962:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(r(4363)),n=a(r(3246)),s=a(r(5984)),o=a(r(3117));function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(){var e=new Uint32Array(10),t=new Uint32Array(10),r=new Uint32Array(2);return function(a){for(var u=0;u<24;u++)(0,o.default)({A:a,C:e,D:t,W:r}),(0,s.default)({A:a,C:e,W:r}),(0,i.default)({A:a,C:e}),(0,n.default)({A:a,roundIndex:u});e.fill(0),t.fill(0),r.fill(0)}}},3246:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e){return e&&e.__esModule?e:{default:e}}(r(2213));t.default=function(e){var t=e.A,r=2*e.roundIndex;t[0]^=i.default[r],t[1]^=i.default[r+1]}},2213:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=new Uint32Array([0,1,0,32898,0x80000000,32906,0x80000000,0x80008000,0,32907,0,0x80000001,0x80000000,0x80008081,0x80000000,32777,0,138,0,136,0,0x80008009,0,0x8000000a,0,0x8000808b,0x80000000,139,0x80000000,32905,0x80000000,32771,0x80000000,32770,0x80000000,128,0,32778,0x80000000,0x8000000a,0x80000000,0x80008081,0x80000000,32896,0,0x80000001,0x80000000,0x80008008]);t.default=r},5984:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(r(4739)),n=o(r(1)),s=o(r(9012));function o(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.A,r=e.C,o=e.W;(0,s.default)(t,1)(o,0);for(var a=0,u=0,f=0,c=32,h=0;h<24;h++){var l=i.default[h],d=n.default[h];(0,s.default)(t,l)(r,0),a=o[0],u=o[1],c=32-d,o[f=d<32?0:1]=a<<d|u>>>c,o[(f+1)%2]=u<<d|a>>>c,(0,s.default)(o,0)(t,l),(0,s.default)(r,0)(o,0)}}},4739:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[10,7,11,17,18,3,5,16,8,21,24,4,15,23,19,13,12,2,20,14,22,9,6,1]},1:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[1,3,6,10,15,21,28,36,45,55,2,14,27,41,56,8,25,43,62,18,39,61,20,44]},3117:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e){return e&&e.__esModule?e:{default:e}}(r(9012));t.default=function(e){for(var t=e.A,r=e.C,n=e.D,s=e.W,o=0,a=0,u=0;u<5;u++){var f=2*u,c=(u+5)*2,h=(u+10)*2,l=(u+15)*2,d=(u+20)*2;r[f]=t[f]^t[c]^t[h]^t[l]^t[d],r[f+1]=t[f+1]^t[c+1]^t[h+1]^t[l+1]^t[d+1]}for(var p=0;p<5;p++){(0,i.default)(r,(p+1)%5)(s,0),o=s[0],a=s[1],s[0]=o<<1|a>>>31,s[1]=a<<1|o>>>31,n[2*p]=r[(p+4)%5*2]^s[0],n[2*p+1]=r[(p+4)%5*2+1]^s[1];for(var g=0;g<25;g+=5)t[(g+p)*2]^=n[2*p],t[(g+p)*2+1]^=n[2*p+1]}}},3200:e=>{"use strict";e.exports=(e,t)=>{if(!("string"==typeof e&&"string"==typeof t))throw TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];let r=e.indexOf(t);return -1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},2434:e=>{"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},8509:(e,t,r)=>{"use strict";let i=r(6617);e.exports=s;let n=function(){function e(e){return void 0!==e&&e}try{if("undefined"!=typeof globalThis)return globalThis;return Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{};function s(e){var t,r;(e=e||{}).browser=e.browser||{};let i=e.browser.transmit;if(i&&"function"!=typeof i.send)throw Error("pino: transmit option must have a send function");let c=e.browser.write||n;e.browser.write&&(e.browser.asObject=!0);let h=e.serializers||{},g=Array.isArray(t=e.browser.serialize)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(h),m=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(m=!1),"function"==typeof c&&(c.error=c.fatal=c.warn=c.info=c.debug=c.trace=c),!1===e.enabled&&(e.level="silent");let b=e.level||"info",y=Object.create(c);y.log||(y.log=l),Object.defineProperty(y,"levelVal",{get:function(){return"silent"===this.level?1/0:this.levels.values[this.level]}}),Object.defineProperty(y,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,o(v,y,"error","log"),o(v,y,"fatal","error"),o(v,y,"w
182arn","error"),o(v,y,"info","log"),o(v,y,"debug","log"),o(v,y,"trace","log")}});let v={transmit:i,serialize:g,asObject:e.browser.asObject,levels:["error","fatal","warn","info","debug","trace"],timestamp:"function"==typeof(r=e).timestamp?r.timestamp:!1===r.timestamp?d:p};return y.levels=s.levels,y.level=b,y.setMaxListeners=y.getMaxListeners=y.emit=y.addListener=y.on=y.prependListener=y.once=y.prependOnceListener=y.removeListener=y.removeAllListeners=y.listeners=y.listenerCount=y.eventNames=y.write=y.flush=l,y.serializers=h,y._serialize=g,y._stdErrSerialize=m,y.child=function(t,r){if(!t)throw Error("missing bindings for child Pino");r=r||{},g&&t.serializers&&(r.serializers=t.serializers);let n=r.serializers;if(g&&n){var s=Object.assign({},h,n),o=!0===e.browser.serialize?Object.keys(s):g;delete t.serializers,a([t],o,s,this._stdErrSerialize)}function c(e){this._childLevel=(0|e._childLevel)+1,this.error=u(e,t,"error"),this.fatal=u(e,t,"fatal"),this.warn=u(e,t,"warn"),this.info=u(e,t,"info"),this.debug=u(e,t,"debug"),this.trace=u(e,t,"trace"),s&&(this.serializers=s,this._serialize=o),i&&(this._logEvent=f([].concat(e._logEvent.bindings,t)))}return c.prototype=this,new c(this)},i&&(y._logEvent=f()),y}function o(e,t,r,o){let u=Object.getPrototypeOf(t);t[r]=t.levelVal>t.levels.values[r]?l:u[r]?u[r]:n[r]||n[o]||l,function(e,t,r){if(e.transmit||t[r]!==l){var o;t[r]=(o=t[r],function(){let u=e.timestamp(),c=Array(arguments.length),h=Object.getPrototypeOf&&Object.getPrototypeOf(this)===n?n:this;for(var l=0;l<c.length;l++)c[l]=arguments[l];if(e.serialize&&!e.asObject&&a(c,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?o.call(h,function(e,t,r,n){e._serialize&&a(r,e._serialize,e.serializers,e._stdErrSerialize);let o=r.slice(),u=o[0],f={};n&&(f.time=n),f.level=s.levels.values[t];let c=(0|e._childLevel)+1;if(c<1&&(c=1),null!==u&&"object"==typeof u){for(;c--&&"object"==typeof o[0];)Object.assign(f,o.shift());u=o.length?i(o.shift(),o):void 0}else"string"==typeof u&&(u=i(o.shift(),o));return void 0!==u&&(f.msg=u),f}(this,r,c,u)):o.apply(h,c),e.transmit){let i=e.transmit.level||t.level,n=s.levels.values[i],o=s.levels.values[r];if(o<n)return;(function(e,t,r){let i=t.send,n=t.ts,s=t.methodLevel,o=t.methodValue,u=t.val,c=e._logEvent.bindings;a(r,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=n,e._logEvent.messages=r.filter(function(e){return -1===c.indexOf(e)}),e._logEvent.level.label=s,e._logEvent.level.value=o,i(s,e._logEvent,u),e._logEvent=f(c)})(this,{ts:u,methodLevel:r,methodValue:o,transmitLevel:i,transmitValue:s.levels.values[e.transmit.level||t.level],send:e.transmit.send,val:t.levelVal},c)}})}}(e,t,r)}function a(e,t,r,i){for(let n in e)if(i&&e[n]instanceof Error)e[n]=s.stdSerializers.err(e[n]);else if("object"==typeof e[n]&&!Array.isArray(e[n]))for(let i in e[n])t&&t.indexOf(i)>-1&&i in r&&(e[n][i]=r[i](e[n][i]))}function u(e,t,r){return function(){let i=Array(1+arguments.length);i[0]=t;for(var n=1;n<i.length;n++)i[n]=arguments[n-1];return e[r].apply(this,i)}}function f(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function c(){return{}}function h(e){return e}function l(){}function d(){return!1}function p(){return Date.now()}s.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},s.stdSerializers={mapHttpRequest:c,mapHttpResponse:c,wrapRequestSerializer:h,wrapResponseSerializer:h,wrapErrorSerializer:h,req:c,res:c,err:function(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}},s.stdTimeFunctions=Object.assign({},{nullTime:d,epochTime:p,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}})},4537:e=>{"use strict";e.exports={rE:"6.6.0"}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.