@taquito/taquito 14.2.0-beta-RC.0 → 14.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see taquito.min.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.taquito=e():t.taquito=e()}(self,(()=>(()=>{var t,e,r={9437:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(5457);function n(t,e,r){return void 0===e&&(e=new Uint8Array(2)),void 0===r&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}function s(t,e,r){return void 0===e&&(e=new Uint8Array(2)),void 0===r&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}function o(t,e){return void 0===e&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}function a(t,e){return void 0===e&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}function c(t,e){return void 0===e&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}function u(t,e){return void 0===e&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}function h(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}function f(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}function l(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),h(t/4294967296>>>0,e,r),h(t>>>0,e,r+4),e}function d(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),f(t>>>0,e,r),f(t/4294967296>>>0,e,r+4),e}e.readInt16BE=function(t,e){return void 0===e&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16},e.readUint16BE=function(t,e){return void 0===e&&(e=0),(t[e+0]<<8|t[e+1])>>>0},e.readInt16LE=function(t,e){return void 0===e&&(e=0),(t[e+1]<<8|t[e])<<16>>16},e.readUint16LE=function(t,e){return void 0===e&&(e=0),(t[e+1]<<8|t[e])>>>0},e.writeUint16BE=n,e.writeInt16BE=n,e.writeUint16LE=s,e.writeInt16LE=s,e.readInt32BE=o,e.readUint32BE=a,e.readInt32LE=c,e.readUint32LE=u,e.writeUint32BE=h,e.writeInt32BE=h,e.writeUint32LE=f,e.writeInt32LE=f,e.readInt64BE=function(t,e){void 0===e&&(e=0);var r=o(t,e),i=o(t,e+4);return 4294967296*r+i-4294967296*(i>>31)},e.readUint64BE=function(t,e){return void 0===e&&(e=0),4294967296*a(t,e)+a(t,e+4)},e.readInt64LE=function(t,e){void 0===e&&(e=0);var r=c(t,e);return 4294967296*c(t,e+4)+r-4294967296*(r>>31)},e.readUint64LE=function(t,e){void 0===e&&(e=0);var r=u(t,e);return 4294967296*u(t,e+4)+r},e.writeUint64BE=l,e.writeInt64BE=l,e.writeUint64LE=d,e.writeInt64LE=d,e.readUintBE=function(t,e,r){if(void 0===r&&(r=0),t%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,n=1,s=t/8+r-1;s>=r;s--)i+=e[s]*n,n*=256;return i},e.readUintLE=function(t,e,r){if(void 0===r&&(r=0),t%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,n=1,s=r;s<r+t/8;s++)i+=e[s]*n,n*=256;return i},e.writeUintBE=function(t,e,r,n){if(void 0===r&&(r=new Uint8Array(t/8)),void 0===n&&(n=0),t%8!=0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!i.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var s=1,o=t/8+n-1;o>=n;o--)r[o]=e/s&255,s*=256;return r},e.writeUintLE=function(t,e,r,n){if(void 0===r&&(r=new Uint8Array(t/8)),void 0===n&&(n=0),t%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!i.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var s=1,o=n;o<n+t/8;o++)r[o]=e/s&255,s*=256;return r},e.readFloat32BE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(e)},e.readFloat32LE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(e,!0)},e.readFloat64BE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(e)},e.readFloat64LE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(e,!0)},e.writeFloat32BE=function(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat32(r,t),e},e.writeFloat32LE=function(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat32(r,t,!0),e},e.writeFloat64BE=function(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat64(r,t),e},e.writeFloat64LE=function(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat64(r,t,!0),e}},6851:(t,e,r)=>{"use strict";var i=r(9437),n=r(2887);e.cn=128,e.k=64,e.Cv=64,e.fg=16,e.fe=16,e.zS=Math.pow(2,32)-1,e.d=255,e.lV=255;var s=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),o=[[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6],[22,16,24,0,10,4,30,26,20,28,6,12,14,2,18,8],[14,18,6,2,26,24,22,28,4,12,10,20,8,0,30,16],[18,0,10,14,4,8,20,30,28,2,22,24,12,16,6,26],[4,24,12,20,0,22,16,6,8,26,14,10,30,28,2,18],[24,10,2,30,28,26,8,20,0,14,12,6,18,4,16,22],[26,22,14,28,24,2,6,18,10,0,30,8,16,12,4,20],[12,30,28,18,22,6,0,16,24,4,26,14,2,8,20,10],[20,4,16,8,14,12,2,10,30,22,18,28,6,24,26,0],[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6]],a=function(){function t(t,r){if(void 0===t&&(t=64),this.digestLength=t,this.blockSize=e.cn,this._state=new Int32Array(s),this._buffer=new Uint8Array(e.cn),this._bufferLength=0,this._ctr=new Uint32Array(4),this._flag=new Uint32Array(4),this._lastNode=!1,this._finished=!1,this._vtmp=new Uint32Array(32),this._mtmp=new Uint32Array(32),t<1||t>e.k)throw new Error("blake2b: wrong digest length");r&&this.validateConfig(r);var n=0;r&&r.key&&(n=r.key.length);var o=1,a=1;r&&r.tree&&(o=r.tree.fanout,a=r.tree.maxDepth),this._state[0]^=t|n<<8|o<<16|a<<24,r&&r.tree&&(this._state[1]^=r.tree.leafSize,this._state[2]^=r.tree.nodeOffsetLowBits,this._state[3]^=r.tree.nodeOffsetHighBits,this._state[4]^=r.tree.nodeDepth|r.tree.innerDigestLength<<8,this._lastNode=r.tree.lastNode),r&&r.salt&&(this._state[8]^=i.readUint32LE(r.salt,0),this._state[9]^=i.readUint32LE(r.salt,4),this._state[10]^=i.readUint32LE(r.salt,8),this._state[11]^=i.readUint32LE(r.salt,12)),r&&r.personalization&&(this._state[12]^=i.readUint32LE(r.personalization,0),this._state[13]^=i.readUint32LE(r.personalization,4),this._state[14]^=i.readUint32LE(r.personalization,8),this._state[15]^=i.readUint32LE(r.personalization,12)),this._initialState=new Uint32Array(this._state),r&&r.key&&n>0&&(this._paddedKey=new Uint8Array(e.cn),this._paddedKey.set(r.key),this._buffer.set(this._paddedKey),this._bufferLength=e.cn)}return t.prototype.reset=function(){return this._state.set(this._initialState),this._paddedKey?(this._buffer.set(this._paddedKey),this._bufferLength=e.cn):this._bufferLength=0,n.wipe(this._ctr),n.wipe(this._flag),this._finished=!1,this},t.prototype.validateConfig=function(t){if(t.key&&t.key.length>e.Cv)throw new Error("blake2b: wrong key length");if(t.salt&&t.salt.length!==e.fe)throw new Error("blake2b: wrong salt length");if(t.personalization&&t.personalization.length!==e.fg)throw new Error("blake2b: wrong personalization length");if(t.tree){if(t.tree.fanout<0||t.tree.fanout>e.d)throw new Error("blake2b: wrong tree fanout");if(t.tree.maxDepth<0||t.tree.maxDepth>e.lV)throw new Error("blake2b: wrong tree depth");if(t.tree.leafSize<0||t.tree.leafSize>e.zS)throw new Error("blake2b: wrong leaf size");if(t.tree.innerDigestLength<0||t.tree.innerDigestLength>e.k)throw new Error("blake2b: wrong tree inner digest length")}},t.prototype.update=function(t,r){if(void 0===r&&(r=t.length),this._finished)throw new Error("blake2b: can't update because hash was finished.");var i=e.cn-this._bufferLength,n=0;if(0===r)return this;if(r>i){for(var s=0;s<i;s++)this._buffer[this._bufferLength+s]=t[n+s];this._processBlock(e.cn),n+=i,r-=i,this._bufferLength=0}for(;r>e.cn;){for(s=0;s<e.cn;s++)this._buffer[s]=t[n+s];this._processBlock(e.cn),n+=e.cn,r-=e.cn,this._bufferLength=0}for(s=0;s<r;s++)this._buffer[this._bufferLength+s]=t[n+s];return this._bufferLength+=r,this},t.prototype.finish=function(t){if(!this._finished){for(var r=this._bufferLength;r<e.cn;r++)this._buffer[r]=0;this._flag[0]=4294967295,this._flag[1]=4294967295,this._lastNode&&(this._flag[2]=4294967295,this._flag[3]=4294967295),this._processBlock(this._bufferLength),this._finished=!0}var n=this._buffer.subarray(0,64);for(r=0;r<16;r++)i.writeUint32LE(this._state[r],n,4*r);return t.set(n.subarray(0,t.length)),this},t.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},t.prototype.clean=function(){n.wipe(this._vtmp),n.wipe(this._mtmp),n.wipe(this._state),n.wipe(this._buffer),n.wipe(this._initialState),this._paddedKey&&n.wipe(this._paddedKey),this._bufferLength=0,n.wipe(this._ctr),n.wipe(this._flag),this._lastNode=!1,this._finished=!1},t.prototype.saveState=function(){if(this._finished)throw new Error("blake2b: cannot save finished state");return{state:new Uint32Array(this._state),buffer:new Uint8Array(this._buffer),bufferLength:this._bufferLength,ctr:new Uint32Array(this._ctr),flag:new Uint32Array(this._flag),lastNode:this._lastNode,paddedKey:this._paddedKey?new Uint8Array(this._paddedKey):void 0,initialState:new Uint32Array(this._initialState)}},t.prototype.restoreState=function(t){return this._state.set(t.state),this._buffer.set(t.buffer),this._bufferLength=t.bufferLength,this._ctr.set(t.ctr),this._flag.set(t.flag),this._lastNode=t.lastNode,this._paddedKey&&n.wipe(this._paddedKey),this._paddedKey=t.paddedKey?new Uint8Array(t.paddedKey):void 0,this._initialState.set(t.initialState),this},t.prototype.cleanSavedState=function(t){n.wipe(t.state),n.wipe(t.buffer),n.wipe(t.initialState),t.paddedKey&&n.wipe(t.paddedKey),t.bufferLength=0,n.wipe(t.ctr),n.wipe(t.flag),t.lastNode=!1},t.prototype._G=function(t,e,r,i,n,s,o,a,c,u,h,f,l){var d=t[e],p=t[s],b=t[r],g=t[o],m=t[i],v=t[a],y=t[n],w=t[c],_=65535&d,E=d>>>16,S=65535&p,A=p>>>16;E+=b>>>16,S+=65535&g,A+=g>>>16,S+=(E+=(_+=65535&b)>>>16)>>>16,_=65535&(d=65535&_|E<<16),E=d>>>16,S=65535&(p=65535&S|(A+=S>>>16)<<16),A=p>>>16,E+=u>>>16,S+=65535&h,A+=h>>>16,d=65535&(_+=65535&u)|(E+=_>>>16)<<16,_=w^=p=65535&(S+=E>>>16)|(A+=S>>>16)<<16,w=y^=d,y=_,_=65535&m,E=m>>>16,S=65535&v,A=v>>>16,E+=y>>>16,S+=65535&w,A+=w>>>16,_=(b^=m=65535&(_+=65535&y)|(E+=_>>>16)<<16)<<8|(g^=v=65535&(S+=E>>>16)|(A+=S>>>16)<<16)>>>24,b=g<<8|b>>>24,g=_,_=65535&d,E=d>>>16,S=65535&p,A=p>>>16,E+=b>>>16,S+=65535&g,A+=g>>>16,S+=(E+=(_+=65535&b)>>>16)>>>16,_=65535&(d=65535&_|E<<16),E=d>>>16,S=65535&(p=65535&S|(A+=S>>>16)<<16),A=p>>>16,E+=f>>>16,S+=65535&l,A+=l>>>16,_=(y^=d=65535&(_+=65535&f)|(E+=_>>>16)<<16)<<16|(w^=p=65535&(S+=E>>>16)|(A+=S>>>16)<<16)>>>16,y=w<<16|y>>>16,w=_,_=65535&m,E=m>>>16,S=65535&v,A=v>>>16,E+=y>>>16,S+=65535&w,A+=w>>>16,_=(g^=v=65535&(S+=(E+=(_+=65535&y)>>>16)>>>16)|(A+=S>>>16)<<16)<<1|(b^=m=65535&_|E<<16)>>>31,b=b<<1|g>>>31,g=_,t[e]=d,t[s]=p,t[r]=b,t[o]=g,t[i]=m,t[a]=v,t[n]=y,t[c]=w},t.prototype._incrementCounter=function(t){for(var e=0;e<3;e++){var r=this._ctr[e]+t;if(this._ctr[e]=r>>>0,this._ctr[e]===r)return;t=1}},t.prototype._processBlock=function(t){this._incrementCounter(t);var e=this._vtmp;e.set(this._state),e.set(s,16),e[24]^=this._ctr[0],e[25]^=this._ctr[1],e[26]^=this._ctr[2],e[27]^=this._ctr[3],e[28]^=this._flag[0],e[29]^=this._flag[1],e[30]^=this._flag[2],e[31]^=this._flag[3];for(var r=this._mtmp,n=0;n<32;n++)r[n]=i.readUint32LE(this._buffer,4*n);for(var a=0;a<12;a++)this._G(e,0,8,16,24,1,9,17,25,r[o[a][0]],r[o[a][0]+1],r[o[a][1]],r[o[a][1]+1]),this._G(e,2,10,18,26,3,11,19,27,r[o[a][2]],r[o[a][2]+1],r[o[a][3]],r[o[a][3]+1]),this._G(e,4,12,20,28,5,13,21,29,r[o[a][4]],r[o[a][4]+1],r[o[a][5]],r[o[a][5]+1]),this._G(e,6,14,22,30,7,15,23,31,r[o[a][6]],r[o[a][6]+1],r[o[a][7]],r[o[a][7]+1]),this._G(e,0,10,20,30,1,11,21,31,r[o[a][8]],r[o[a][8]+1],r[o[a][9]],r[o[a][9]+1]),this._G(e,2,12,22,24,3,13,23,25,r[o[a][10]],r[o[a][10]+1],r[o[a][11]],r[o[a][11]+1]),this._G(e,4,14,16,26,5,15,17,27,r[o[a][12]],r[o[a][12]+1],r[o[a][13]],r[o[a][13]+1]),this._G(e,6,8,18,28,7,9,19,29,r[o[a][14]],r[o[a][14]+1],r[o[a][15]],r[o[a][15]+1]);for(n=0;n<16;n++)this._state[n]^=e[n]^e[n+16]},t}();e.vp=function(t,r,i){void 0===r&&(r=e.k);var n=new a(r,i);n.update(t);var s=n.digest();return n.clean(),s}},7728:(t,e,r)=>{"use strict";e.T=e.aP=e.KS=e.jQ=void 0;const i=r(1293),n=r(6756),s=r(2887);function o(t){const e=new Float64Array(16);if(t)for(let r=0;r<t.length;r++)e[r]=t[r];return e}e.jQ=64,e.KS=64,e.aP=32;new Uint8Array(32)[0]=9;const a=o(),c=o([1]),u=o([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=o([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),f=o([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),l=o([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),d=o([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(t,e){for(let r=0;r<16;r++)t[r]=0|e[r]}function b(t){let e=1;for(let r=0;r<16;r++){let i=t[r]+e+65535;e=Math.floor(i/65536),t[r]=i-65536*e}t[0]+=e-1+37*(e-1)}function g(t,e,r){const i=~(r-1);for(let r=0;r<16;r++){const n=i&(t[r]^e[r]);t[r]^=n,e[r]^=n}}function m(t,e){const r=o(),i=o();for(let t=0;t<16;t++)i[t]=e[t];b(i),b(i),b(i);for(let t=0;t<2;t++){r[0]=i[0]-65517;for(let t=1;t<15;t++)r[t]=i[t]-65535-(r[t-1]>>16&1),r[t-1]&=65535;r[15]=i[15]-32767-(r[14]>>16&1);const t=r[15]>>16&1;r[14]&=65535,g(i,r,1-t)}for(let e=0;e<16;e++)t[2*e]=255&i[e],t[2*e+1]=i[e]>>8}function v(t,e){let r=0;for(let i=0;i<32;i++)r|=t[i]^e[i];return(1&r-1>>>8)-1}function y(t,e){const r=new Uint8Array(32),i=new Uint8Array(32);return m(r,t),m(i,e),v(r,i)}function w(t){const e=new Uint8Array(32);return m(e,t),1&e[0]}function _(t,e,r){for(let i=0;i<16;i++)t[i]=e[i]+r[i]}function E(t,e,r){for(let i=0;i<16;i++)t[i]=e[i]-r[i]}function S(t,e,r){let i,n,s=0,o=0,a=0,c=0,u=0,h=0,f=0,l=0,d=0,p=0,b=0,g=0,m=0,v=0,y=0,w=0,_=0,E=0,S=0,A=0,O=0,T=0,x=0,R=0,P=0,I=0,N=0,M=0,k=0,L=0,C=0,B=r[0],D=r[1],U=r[2],j=r[3],K=r[4],V=r[5],F=r[6],H=r[7],G=r[8],$=r[9],z=r[10],q=r[11],Z=r[12],W=r[13],Y=r[14],J=r[15];i=e[0],s+=i*B,o+=i*D,a+=i*U,c+=i*j,u+=i*K,h+=i*V,f+=i*F,l+=i*H,d+=i*G,p+=i*$,b+=i*z,g+=i*q,m+=i*Z,v+=i*W,y+=i*Y,w+=i*J,i=e[1],o+=i*B,a+=i*D,c+=i*U,u+=i*j,h+=i*K,f+=i*V,l+=i*F,d+=i*H,p+=i*G,b+=i*$,g+=i*z,m+=i*q,v+=i*Z,y+=i*W,w+=i*Y,_+=i*J,i=e[2],a+=i*B,c+=i*D,u+=i*U,h+=i*j,f+=i*K,l+=i*V,d+=i*F,p+=i*H,b+=i*G,g+=i*$,m+=i*z,v+=i*q,y+=i*Z,w+=i*W,_+=i*Y,E+=i*J,i=e[3],c+=i*B,u+=i*D,h+=i*U,f+=i*j,l+=i*K,d+=i*V,p+=i*F,b+=i*H,g+=i*G,m+=i*$,v+=i*z,y+=i*q,w+=i*Z,_+=i*W,E+=i*Y,S+=i*J,i=e[4],u+=i*B,h+=i*D,f+=i*U,l+=i*j,d+=i*K,p+=i*V,b+=i*F,g+=i*H,m+=i*G,v+=i*$,y+=i*z,w+=i*q,_+=i*Z,E+=i*W,S+=i*Y,A+=i*J,i=e[5],h+=i*B,f+=i*D,l+=i*U,d+=i*j,p+=i*K,b+=i*V,g+=i*F,m+=i*H,v+=i*G,y+=i*$,w+=i*z,_+=i*q,E+=i*Z,S+=i*W,A+=i*Y,O+=i*J,i=e[6],f+=i*B,l+=i*D,d+=i*U,p+=i*j,b+=i*K,g+=i*V,m+=i*F,v+=i*H,y+=i*G,w+=i*$,_+=i*z,E+=i*q,S+=i*Z,A+=i*W,O+=i*Y,T+=i*J,i=e[7],l+=i*B,d+=i*D,p+=i*U,b+=i*j,g+=i*K,m+=i*V,v+=i*F,y+=i*H,w+=i*G,_+=i*$,E+=i*z,S+=i*q,A+=i*Z,O+=i*W,T+=i*Y,x+=i*J,i=e[8],d+=i*B,p+=i*D,b+=i*U,g+=i*j,m+=i*K,v+=i*V,y+=i*F,w+=i*H,_+=i*G,E+=i*$,S+=i*z,A+=i*q,O+=i*Z,T+=i*W,x+=i*Y,R+=i*J,i=e[9],p+=i*B,b+=i*D,g+=i*U,m+=i*j,v+=i*K,y+=i*V,w+=i*F,_+=i*H,E+=i*G,S+=i*$,A+=i*z,O+=i*q,T+=i*Z,x+=i*W,R+=i*Y,P+=i*J,i=e[10],b+=i*B,g+=i*D,m+=i*U,v+=i*j,y+=i*K,w+=i*V,_+=i*F,E+=i*H,S+=i*G,A+=i*$,O+=i*z,T+=i*q,x+=i*Z,R+=i*W,P+=i*Y,I+=i*J,i=e[11],g+=i*B,m+=i*D,v+=i*U,y+=i*j,w+=i*K,_+=i*V,E+=i*F,S+=i*H,A+=i*G,O+=i*$,T+=i*z,x+=i*q,R+=i*Z,P+=i*W,I+=i*Y,N+=i*J,i=e[12],m+=i*B,v+=i*D,y+=i*U,w+=i*j,_+=i*K,E+=i*V,S+=i*F,A+=i*H,O+=i*G,T+=i*$,x+=i*z,R+=i*q,P+=i*Z,I+=i*W,N+=i*Y,M+=i*J,i=e[13],v+=i*B,y+=i*D,w+=i*U,_+=i*j,E+=i*K,S+=i*V,A+=i*F,O+=i*H,T+=i*G,x+=i*$,R+=i*z,P+=i*q,I+=i*Z,N+=i*W,M+=i*Y,k+=i*J,i=e[14],y+=i*B,w+=i*D,_+=i*U,E+=i*j,S+=i*K,A+=i*V,O+=i*F,T+=i*H,x+=i*G,R+=i*$,P+=i*z,I+=i*q,N+=i*Z,M+=i*W,k+=i*Y,L+=i*J,i=e[15],w+=i*B,_+=i*D,E+=i*U,S+=i*j,A+=i*K,O+=i*V,T+=i*F,x+=i*H,R+=i*G,P+=i*$,I+=i*z,N+=i*q,M+=i*Z,k+=i*W,L+=i*Y,C+=i*J,s+=38*_,o+=38*E,a+=38*S,c+=38*A,u+=38*O,h+=38*T,f+=38*x,l+=38*R,d+=38*P,p+=38*I,b+=38*N,g+=38*M,m+=38*k,v+=38*L,y+=38*C,n=1,i=s+n+65535,n=Math.floor(i/65536),s=i-65536*n,i=o+n+65535,n=Math.floor(i/65536),o=i-65536*n,i=a+n+65535,n=Math.floor(i/65536),a=i-65536*n,i=c+n+65535,n=Math.floor(i/65536),c=i-65536*n,i=u+n+65535,n=Math.floor(i/65536),u=i-65536*n,i=h+n+65535,n=Math.floor(i/65536),h=i-65536*n,i=f+n+65535,n=Math.floor(i/65536),f=i-65536*n,i=l+n+65535,n=Math.floor(i/65536),l=i-65536*n,i=d+n+65535,n=Math.floor(i/65536),d=i-65536*n,i=p+n+65535,n=Math.floor(i/65536),p=i-65536*n,i=b+n+65535,n=Math.floor(i/65536),b=i-65536*n,i=g+n+65535,n=Math.floor(i/65536),g=i-65536*n,i=m+n+65535,n=Math.floor(i/65536),m=i-65536*n,i=v+n+65535,n=Math.floor(i/65536),v=i-65536*n,i=y+n+65535,n=Math.floor(i/65536),y=i-65536*n,i=w+n+65535,n=Math.floor(i/65536),w=i-65536*n,s+=n-1+37*(n-1),n=1,i=s+n+65535,n=Math.floor(i/65536),s=i-65536*n,i=o+n+65535,n=Math.floor(i/65536),o=i-65536*n,i=a+n+65535,n=Math.floor(i/65536),a=i-65536*n,i=c+n+65535,n=Math.floor(i/65536),c=i-65536*n,i=u+n+65535,n=Math.floor(i/65536),u=i-65536*n,i=h+n+65535,n=Math.floor(i/65536),h=i-65536*n,i=f+n+65535,n=Math.floor(i/65536),f=i-65536*n,i=l+n+65535,n=Math.floor(i/65536),l=i-65536*n,i=d+n+65535,n=Math.floor(i/65536),d=i-65536*n,i=p+n+65535,n=Math.floor(i/65536),p=i-65536*n,i=b+n+65535,n=Math.floor(i/65536),b=i-65536*n,i=g+n+65535,n=Math.floor(i/65536),g=i-65536*n,i=m+n+65535,n=Math.floor(i/65536),m=i-65536*n,i=v+n+65535,n=Math.floor(i/65536),v=i-65536*n,i=y+n+65535,n=Math.floor(i/65536),y=i-65536*n,i=w+n+65535,n=Math.floor(i/65536),w=i-65536*n,s+=n-1+37*(n-1),t[0]=s,t[1]=o,t[2]=a,t[3]=c,t[4]=u,t[5]=h,t[6]=f,t[7]=l,t[8]=d,t[9]=p,t[10]=b,t[11]=g,t[12]=m,t[13]=v,t[14]=y,t[15]=w}function A(t,e){S(t,e,e)}function O(t,e){const r=o();let i;for(i=0;i<16;i++)r[i]=e[i];for(i=253;i>=0;i--)A(r,r),2!==i&&4!==i&&S(r,r,e);for(i=0;i<16;i++)t[i]=r[i]}function T(t,e){const r=o(),i=o(),n=o(),s=o(),a=o(),c=o(),u=o(),f=o(),l=o();E(r,t[1],t[0]),E(l,e[1],e[0]),S(r,r,l),_(i,t[0],t[1]),_(l,e[0],e[1]),S(i,i,l),S(n,t[3],e[3]),S(n,n,h),S(s,t[2],e[2]),_(s,s,s),E(a,i,r),E(c,s,n),_(u,s,n),_(f,i,r),S(t[0],a,c),S(t[1],f,u),S(t[2],u,c),S(t[3],a,f)}function x(t,e,r){for(let i=0;i<4;i++)g(t[i],e[i],r)}function R(t,e){const r=o(),i=o(),n=o();O(n,e[2]),S(r,e[0],n),S(i,e[1],n),m(t,i),t[31]^=w(r)<<7}function P(t,e,r){p(t[0],a),p(t[1],c),p(t[2],c),p(t[3],a);for(let i=255;i>=0;--i){const n=r[i/8|0]>>(7&i)&1;x(t,e,n),T(e,t),T(t,t),x(t,e,n)}}function I(t,e){const r=[o(),o(),o(),o()];p(r[0],f),p(r[1],l),p(r[2],c),S(r[3],f,l),P(t,r,e)}function N(t){if(t.length!==e.aP)throw new Error(`ed25519: seed must be ${e.aP} bytes`);const r=(0,n.hash)(t);r[0]&=248,r[31]&=127,r[31]|=64;const i=new Uint8Array(32),s=[o(),o(),o(),o()];I(s,r),R(i,s);const a=new Uint8Array(64);return a.set(t),a.set(i,32),{publicKey:i,secretKey:a}}const M=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 k(t,e){let r,i,n,s;for(i=63;i>=32;--i){for(r=0,n=i-32,s=i-12;n<s;++n)e[n]+=r-16*e[i]*M[n-(i-32)],r=Math.floor((e[n]+128)/256),e[n]-=256*r;e[n]+=r,e[i]=0}for(r=0,n=0;n<32;n++)e[n]+=r-(e[31]>>4)*M[n],r=e[n]>>8,e[n]&=255;for(n=0;n<32;n++)e[n]-=r*M[n];for(i=0;i<32;i++)e[i+1]+=e[i]>>8,t[i]=255&e[i]}function L(t){const e=new Float64Array(64);for(let r=0;r<64;r++)e[r]=t[r];for(let e=0;e<64;e++)t[e]=0;k(t,e)}function C(t,e){const r=o(),i=o(),n=o(),s=o(),h=o(),f=o(),l=o();return p(t[2],c),function(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}(t[1],e),A(n,t[1]),S(s,n,u),E(n,n,t[2]),_(s,t[2],s),A(h,s),A(f,h),S(l,f,h),S(r,l,n),S(r,r,s),function(t,e){const r=o();let i;for(i=0;i<16;i++)r[i]=e[i];for(i=250;i>=0;i--)A(r,r),1!==i&&S(r,r,e);for(i=0;i<16;i++)t[i]=r[i]}(r,r),S(r,r,n),S(r,r,s),S(r,r,s),S(t[0],r,s),A(i,t[0]),S(i,i,s),y(i,n)&&S(t[0],t[0],d),A(i,t[0]),S(i,i,s),y(i,n)?-1:(w(t[0])===e[31]>>7&&E(t[0],a,t[0]),S(t[3],t[0],t[1]),0)}e.T=function(t,r,i){const s=new Uint8Array(32),a=[o(),o(),o(),o()],c=[o(),o(),o(),o()];if(i.length!==e.jQ)throw new Error(`ed25519: signature must be ${e.jQ} bytes`);if(C(c,t))return!1;const u=new n.SHA512;u.update(i.subarray(0,32)),u.update(t),u.update(r);const h=u.digest();return L(h),P(a,c,h),I(c,i.subarray(32)),T(a,c),R(s,a),!v(i,s)}},5457:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mul=Math.imul||function(t,e){var r=65535&t,i=65535&e;return r*i+((t>>>16&65535)*i+r*(e>>>16&65535)<<16>>>0)|0},e.add=function(t,e){return t+e|0},e.sub=function(t,e){return t-e|0},e.rotl=function(t,e){return t<<e|t>>>32-e},e.rotr=function(t,e){return t<<32-e|t>>>e},e.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(t){return e.isInteger(t)&&t>=-e.MAX_SAFE_INTEGER&&t<=e.MAX_SAFE_INTEGER}},1293:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const i=r(5147),n=r(9437),s=r(2887);function o(t,r=e.defaultRandomSource){return r.randomBytes(t)}e.defaultRandomSource=new i.SystemRandomSource,e.randomBytes=o,e.randomUint32=function(t=e.defaultRandomSource){const r=o(4,t),i=(0,n.readUint32LE)(r);return(0,s.wipe)(r),i};const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function c(t,r=a,i=e.defaultRandomSource){if(r.length<2)throw new Error("randomString charset is too short");if(r.length>256)throw new Error("randomString charset is too long");let n="";const c=r.length,u=256-256%c;for(;t>0;){const e=o(Math.ceil(256*t/u),i);for(let i=0;i<e.length&&t>0;i++){const s=e[i];s<u&&(n+=r.charAt(s%c),t--)}(0,s.wipe)(e)}return n}e.randomString=c,e.randomStringForEntropy=function(t,r=a,i=e.defaultRandomSource){return c(Math.ceil(t/(Math.log(r.length)/Math.LN2)),r,i)}},2017:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BrowserRandomSource=void 0;e.BrowserRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&void 0!==t.getRandomValues&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const e=new Uint8Array(t);for(let t=0;t<e.length;t+=65536)this._crypto.getRandomValues(e.subarray(t,t+Math.min(e.length-t,65536)));return e}}},7879:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NodeRandomSource=void 0;const i=r(2887);e.NodeRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{const t=r(5477);t&&t.randomBytes&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let e=this._crypto.randomBytes(t);if(e.length!==t)throw new Error("NodeRandomSource: got fewer bytes than requested");const r=new Uint8Array(t);for(let t=0;t<r.length;t++)r[t]=e[t];return(0,i.wipe)(e),r}}},5147:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SystemRandomSource=void 0;const i=r(2017),n=r(7879);e.SystemRandomSource=class{constructor(){return this.isAvailable=!1,this.name="",this._source=new i.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new n.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(t){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(t)}}},6756:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(9437),n=r(2887);e.DIGEST_LENGTH=64,e.BLOCK_SIZE=128;var s=function(){function t(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.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 t.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},t.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},t.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},t.prototype.update=function(t,r){if(void 0===r&&(r=t.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var i=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<e.BLOCK_SIZE&&r>0;)this._buffer[this._bufferLength++]=t[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,t,i,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=t[i++],r--;return this},t.prototype.finish=function(t){if(!this._finished){var e=this._bytesHashed,r=this._bufferLength,n=e/536870912|0,s=e<<3,o=e%128<112?128:256;this._buffer[r]=128;for(var c=r+1;c<o-8;c++)this._buffer[c]=0;i.writeUint32BE(n,this._buffer,o-8),i.writeUint32BE(s,this._buffer,o-4),a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,o),this._finished=!0}for(c=0;c<this.digestLength/8;c++)i.writeUint32BE(this._stateHi[c],t,8*c),i.writeUint32BE(this._stateLo[c],t,8*c+4);return this},t.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},t.prototype.saveState=function(){if(this._finished)throw new 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}},t.prototype.restoreState=function(t){return this._stateHi.set(t.stateHi),this._stateLo.set(t.stateLo),this._bufferLength=t.bufferLength,t.buffer&&this._buffer.set(t.buffer),this._bytesHashed=t.bytesHashed,this._finished=!1,this},t.prototype.cleanSavedState=function(t){n.wipe(t.stateHi),n.wipe(t.stateLo),t.buffer&&n.wipe(t.buffer),t.bufferLength=0,t.bytesHashed=0},t}();e.SHA512=s;var o=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(t,e,r,n,s,a,c){for(var u,h,f,l,d,p,b,g,m=r[0],v=r[1],y=r[2],w=r[3],_=r[4],E=r[5],S=r[6],A=r[7],O=n[0],T=n[1],x=n[2],R=n[3],P=n[4],I=n[5],N=n[6],M=n[7];c>=128;){for(var k=0;k<16;k++){var L=8*k+a;t[k]=i.readUint32BE(s,L),e[k]=i.readUint32BE(s,L+4)}for(k=0;k<80;k++){var C,B,D=m,U=v,j=y,K=w,V=_,F=E,H=S,G=O,$=T,z=x,q=R,Z=P,W=I,Y=N;if(d=65535&(h=M),p=h>>>16,b=65535&(u=A),g=u>>>16,d+=65535&(h=(P>>>14|_<<18)^(P>>>18|_<<14)^(_>>>9|P<<23)),p+=h>>>16,b+=65535&(u=(_>>>14|P<<18)^(_>>>18|P<<14)^(P>>>9|_<<23)),g+=u>>>16,d+=65535&(h=P&I^~P&N),p+=h>>>16,b+=65535&(u=_&E^~_&S),g+=u>>>16,u=o[2*k],d+=65535&(h=o[2*k+1]),p+=h>>>16,b+=65535&u,g+=u>>>16,u=t[k%16],p+=(h=e[k%16])>>>16,b+=65535&u,g+=u>>>16,b+=(p+=(d+=65535&h)>>>16)>>>16,d=65535&(h=l=65535&d|p<<16),p=h>>>16,b=65535&(u=f=65535&b|(g+=b>>>16)<<16),g=u>>>16,d+=65535&(h=(O>>>28|m<<4)^(m>>>2|O<<30)^(m>>>7|O<<25)),p+=h>>>16,b+=65535&(u=(m>>>28|O<<4)^(O>>>2|m<<30)^(O>>>7|m<<25)),g+=u>>>16,p+=(h=O&T^O&x^T&x)>>>16,b+=65535&(u=m&v^m&y^v&y),g+=u>>>16,C=65535&(b+=(p+=(d+=65535&h)>>>16)>>>16)|(g+=b>>>16)<<16,B=65535&d|p<<16,d=65535&(h=q),p=h>>>16,b=65535&(u=K),g=u>>>16,p+=(h=l)>>>16,b+=65535&(u=f),g+=u>>>16,v=D,y=U,w=j,_=K=65535&(b+=(p+=(d+=65535&h)>>>16)>>>16)|(g+=b>>>16)<<16,E=V,S=F,A=H,m=C,T=G,x=$,R=z,P=q=65535&d|p<<16,I=Z,N=W,M=Y,O=B,k%16==15)for(L=0;L<16;L++)u=t[L],d=65535&(h=e[L]),p=h>>>16,b=65535&u,g=u>>>16,u=t[(L+9)%16],d+=65535&(h=e[(L+9)%16]),p+=h>>>16,b+=65535&u,g+=u>>>16,f=t[(L+1)%16],d+=65535&(h=((l=e[(L+1)%16])>>>1|f<<31)^(l>>>8|f<<24)^(l>>>7|f<<25)),p+=h>>>16,b+=65535&(u=(f>>>1|l<<31)^(f>>>8|l<<24)^f>>>7),g+=u>>>16,f=t[(L+14)%16],p+=(h=((l=e[(L+14)%16])>>>19|f<<13)^(f>>>29|l<<3)^(l>>>6|f<<26))>>>16,b+=65535&(u=(f>>>19|l<<13)^(l>>>29|f<<3)^f>>>6),g+=u>>>16,g+=(b+=(p+=(d+=65535&h)>>>16)>>>16)>>>16,t[L]=65535&b|g<<16,e[L]=65535&d|p<<16}d=65535&(h=O),p=h>>>16,b=65535&(u=m),g=u>>>16,u=r[0],p+=(h=n[0])>>>16,b+=65535&u,g+=u>>>16,g+=(b+=(p+=(d+=65535&h)>>>16)>>>16)>>>16,r[0]=m=65535&b|g<<16,n[0]=O=65535&d|p<<16,d=65535&(h=T),p=h>>>16,b=65535&(u=v),g=u>>>16,u=r[1],p+=(h=n[1])>>>16,b+=65535&u,g+=u>>>16,g+=(b+=(p+=(d+=65535&h)>>>16)>>>16)>>>16,r[1]=v=65535&b|g<<16,n[1]=T=65535&d|p<<16,d=65535&(h=x),p=h>>>16,b=65535&(u=y),g=u>>>16,u=r[2],p+=(h=n[2])>>>16,b+=65535&u,g+=u>>>16,g+=(b+=(p+=(d+=65535&h)>>>16)>>>16)>>>16,r[2]=y=65535&b|g<<16,n[2]=x=65535&d|p<<16,d=65535&(h=R),p=h>>>16,b=65535&(u=w),g=u>>>16,u=r[3],p+=(h=n[3])>>>16,b+=65535&u,g+=u>>>16,g+=(b+=(p+=(d+=65535&h)>>>16)>>>16)>>>16,r[3]=w=65535&b|g<<16,n[3]=R=65535&d|p<<16,d=65535&(h=P),p=h>>>16,b=65535&(u=_),g=u>>>16,u=r[4],p+=(h=n[4])>>>16,b+=65535&u,g+=u>>>16,g+=(b+=(p+=(d+=65535&h)>>>16)>>>16)>>>16,r[4]=_=65535&b|g<<16,n[4]=P=65535&d|p<<16,d=65535&(h=I),p=h>>>16,b=65535&(u=E),g=u>>>16,u=r[5],p+=(h=n[5])>>>16,b+=65535&u,g+=u>>>16,g+=(b+=(p+=(d+=65535&h)>>>16)>>>16)>>>16,r[5]=E=65535&b|g<<16,n[5]=I=65535&d|p<<16,d=65535&(h=N),p=h>>>16,b=65535&(u=S),g=u>>>16,u=r[6],p+=(h=n[6])>>>16,b+=65535&u,g+=u>>>16,g+=(b+=(p+=(d+=65535&h)>>>16)>>>16)>>>16,r[6]=S=65535&b|g<<16,n[6]=N=65535&d|p<<16,d=65535&(h=M),p=h>>>16,b=65535&(u=A),g=u>>>16,u=r[7],p+=(h=n[7])>>>16,b+=65535&u,g+=u>>>16,g+=(b+=(p+=(d+=65535&h)>>>16)>>>16)>>>16,r[7]=A=65535&b|g<<16,n[7]=M=65535&d|p<<16,a+=128,c-=128}return a}e.hash=function(t){var e=new s;e.update(t);var r=e.digest();return e.clean(),r}},2887:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.wipe=function(t){for(var e=0;e<t.length;e++)t[e]=0;return t}},8166:(t,e,r)=>{"use strict";var i=r(7834).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var s=t.charAt(n),o=s.charCodeAt(0);if(255!==e[o])throw new TypeError(s+" is ambiguous");e[o]=n}var a=t.length,c=t.charAt(0),u=Math.log(a)/Math.log(256),h=Math.log(256)/Math.log(a);function f(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return i.alloc(0);for(var r=0,n=0,s=0;t[r]===c;)n++,r++;for(var o=(t.length-r)*u+1>>>0,h=new Uint8Array(o);t[r];){var f=e[t.charCodeAt(r)];if(255===f)return;for(var l=0,d=o-1;(0!==f||l<s)&&-1!==d;d--,l++)f+=a*h[d]>>>0,h[d]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");s=l,r++}for(var p=o-s;p!==o&&0===h[p];)p++;var b=i.allocUnsafe(n+(o-p));b.fill(0,0,n);for(var g=n;p!==o;)b[g++]=h[p++];return b}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=i.from(e)),!i.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,n=0,s=0,o=e.length;s!==o&&0===e[s];)s++,r++;for(var u=(o-s)*h+1>>>0,f=new Uint8Array(u);s!==o;){for(var l=e[s],d=0,p=u-1;(0!==l||d<n)&&-1!==p;p--,d++)l+=256*f[p]>>>0,f[p]=l%a>>>0,l=l/a>>>0;if(0!==l)throw new Error("Non-zero carry");n=d,s++}for(var b=u-n;b!==u&&0===f[b];)b++;for(var g=c.repeat(r);b<u;++b)g+=t.charAt(f[b]);return g},decodeUnsafe:f,decode:function(t){var e=f(t);if(e)return e;throw new Error("Non-base"+a+" character")}}}},5766:(t,e)=>{"use strict";e.byteLength=function(t){var e=c(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,s=c(t),o=s[0],a=s[1],u=new n(function(t,e,r){return 3*(e+r)/4-r}(0,o,a)),h=0,f=a>0?o-4:o;for(r=0;r<f;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],u[h++]=e>>16&255,u[h++]=e>>8&255,u[h++]=255&e;2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[h++]=255&e);1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[h++]=e>>8&255,u[h++]=255&e);return u},e.fromByteArray=function(t){for(var e,i=t.length,n=i%3,s=[],o=16383,a=0,c=i-n;a<c;a+=o)s.push(u(t,a,a+o>c?c:a+o));1===n?(e=t[i-1],s.push(r[e>>2]+r[e<<4&63]+"==")):2===n&&(e=(t[i-2]<<8)+t[i-1],s.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return 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 c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,i){for(var n,s,o=[],a=e;a<i;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(r[(s=n)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},6391:function(t,e,r){var i;!function(n){"use strict";var s,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,c=Math.floor,u="[BigNumber Error] ",h=u+"Number primitive has more than 15 significant digits: ",f=1e14,l=14,d=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],b=1e7,g=1e9;function m(t){var e=0|t;return t>0||t===e?e:e-1}function v(t){for(var e,r,i=1,n=t.length,s=t[0]+"";i<n;){for(e=t[i++]+"",r=l-e.length;r--;e="0"+e);s+=e}for(n=s.length;48===s.charCodeAt(--n););return s.slice(0,n+1||1)}function y(t,e){var r,i,n=t.c,s=e.c,o=t.s,a=e.s,c=t.e,u=e.e;if(!o||!a)return null;if(r=n&&!n[0],i=s&&!s[0],r||i)return r?i?0:-a:o;if(o!=a)return o;if(r=o<0,i=c==u,!n||!s)return i?0:!n^r?1:-1;if(!i)return c>u^r?1:-1;for(a=(c=n.length)<(u=s.length)?c:u,o=0;o<a;o++)if(n[o]!=s[o])return n[o]>s[o]^r?1:-1;return c==u?0:c>u^r?1:-1}function w(t,e,r,i){if(t<e||t>r||t!==c(t))throw Error(u+(i||"Argument")+("number"==typeof t?t<e||t>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function _(t){var e=t.c.length-1;return m(t.e/l)==e&&t.c[e]%2!=0}function E(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function S(t,e,r){var i,n;if(e<0){for(n=r+".";++e;n+=r);t=n+t}else if(++e>(i=t.length)){for(n=r,e-=i;--e;n+=r);t+=n}else e<i&&(t=t.slice(0,e)+"."+t.slice(e));return t}s=function t(e){var r,i,n,s,A,O,T,x,R,P,I=G.prototype={constructor:G,toString:null,valueOf:null},N=new G(1),M=20,k=4,L=-7,C=21,B=-1e7,D=1e7,U=!1,j=1,K=0,V={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz",H=!0;function G(t,e){var r,s,a,u,f,p,b,g,m=this;if(!(m instanceof G))return new G(t,e);if(null==e){if(t&&!0===t._isBigNumber)return m.s=t.s,void(!t.c||t.e>D?m.c=m.e=null:t.e<B?m.c=[m.e=0]:(m.e=t.e,m.c=t.c.slice()));if((p="number"==typeof t)&&0*t==0){if(m.s=1/t<0?(t=-t,-1):1,t===~~t){for(u=0,f=t;f>=10;f/=10,u++);return void(u>D?m.c=m.e=null:(m.e=u,m.c=[t]))}g=String(t)}else{if(!o.test(g=String(t)))return n(m,g,p);m.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(u=g.indexOf("."))>-1&&(g=g.replace(".","")),(f=g.search(/e/i))>0?(u<0&&(u=f),u+=+g.slice(f+1),g=g.substring(0,f)):u<0&&(u=g.length)}else{if(w(e,2,F.length,"Base"),10==e&&H)return Z(m=new G(t),M+m.e+1,k);if(g=String(t),p="number"==typeof t){if(0*t!=0)return n(m,g,p,e);if(m.s=1/t<0?(g=g.slice(1),-1):1,G.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(h+t)}else m.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=F.slice(0,e),u=f=0,b=g.length;f<b;f++)if(r.indexOf(s=g.charAt(f))<0){if("."==s){if(f>u){u=b;continue}}else if(!a&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){a=!0,f=-1,u=0;continue}return n(m,String(t),p,e)}p=!1,(u=(g=i(g,e,10,m.s)).indexOf("."))>-1?g=g.replace(".",""):u=g.length}for(f=0;48===g.charCodeAt(f);f++);for(b=g.length;48===g.charCodeAt(--b););if(g=g.slice(f,++b)){if(b-=f,p&&G.DEBUG&&b>15&&(t>d||t!==c(t)))throw Error(h+m.s*t);if((u=u-f-1)>D)m.c=m.e=null;else if(u<B)m.c=[m.e=0];else{if(m.e=u,m.c=[],f=(u+1)%l,u<0&&(f+=l),f<b){for(f&&m.c.push(+g.slice(0,f)),b-=l;f<b;)m.c.push(+g.slice(f,f+=l));f=l-(g=g.slice(f)).length}else f-=b;for(;f--;g+="0");m.c.push(+g)}}else m.c=[m.e=0]}function $(t,e,r,i){var n,s,o,a,c;if(null==r?r=k:w(r,0,8),!t.c)return t.toString();if(n=t.c[0],o=t.e,null==e)c=v(t.c),c=1==i||2==i&&(o<=L||o>=C)?E(c,o):S(c,o,"0");else if(s=(t=Z(new G(t),e,r)).e,a=(c=v(t.c)).length,1==i||2==i&&(e<=s||s<=L)){for(;a<e;c+="0",a++);c=E(c,s)}else if(e-=o,c=S(c,s,"0"),s+1>a){if(--e>0)for(c+=".";e--;c+="0");}else if((e+=s-a)>0)for(s+1==a&&(c+=".");e--;c+="0");return t.s<0&&n?"-"+c:c}function z(t,e){for(var r,i=1,n=new G(t[0]);i<t.length;i++){if(!(r=new G(t[i])).s){n=r;break}e.call(n,r)&&(n=r)}return n}function q(t,e,r){for(var i=1,n=e.length;!e[--n];e.pop());for(n=e[0];n>=10;n/=10,i++);return(r=i+r*l-1)>D?t.c=t.e=null:r<B?t.c=[t.e=0]:(t.e=r,t.c=e),t}function Z(t,e,r,i){var n,s,o,u,h,d,b,g=t.c,m=p;if(g){t:{for(n=1,u=g[0];u>=10;u/=10,n++);if((s=e-n)<0)s+=l,o=e,b=(h=g[d=0])/m[n-o-1]%10|0;else if((d=a((s+1)/l))>=g.length){if(!i)break t;for(;g.length<=d;g.push(0));h=b=0,n=1,o=(s%=l)-l+1}else{for(h=u=g[d],n=1;u>=10;u/=10,n++);b=(o=(s%=l)-l+n)<0?0:h/m[n-o-1]%10|0}if(i=i||e<0||null!=g[d+1]||(o<0?h:h%m[n-o-1]),i=r<4?(b||i)&&(0==r||r==(t.s<0?3:2)):b>5||5==b&&(4==r||i||6==r&&(s>0?o>0?h/m[n-o]:0:g[d-1])%10&1||r==(t.s<0?8:7)),e<1||!g[0])return g.length=0,i?(e-=t.e+1,g[0]=m[(l-e%l)%l],t.e=-e||0):g[0]=t.e=0,t;if(0==s?(g.length=d,u=1,d--):(g.length=d+1,u=m[l-s],g[d]=o>0?c(h/m[n-o]%m[o])*u:0),i)for(;;){if(0==d){for(s=1,o=g[0];o>=10;o/=10,s++);for(o=g[0]+=u,u=1;o>=10;o/=10,u++);s!=u&&(t.e++,g[0]==f&&(g[0]=1));break}if(g[d]+=u,g[d]!=f)break;g[d--]=0,u=1}for(s=g.length;0===g[--s];g.pop());}t.e>D?t.c=t.e=null:t.e<B&&(t.c=[t.e=0])}return t}function W(t){var e,r=t.e;return null===r?t.toString():(e=v(t.c),e=r<=L||r>=C?E(e,r):S(e,r,"0"),t.s<0?"-"+e:e)}return G.clone=t,G.ROUND_UP=0,G.ROUND_DOWN=1,G.ROUND_CEIL=2,G.ROUND_FLOOR=3,G.ROUND_HALF_UP=4,G.ROUND_HALF_DOWN=5,G.ROUND_HALF_EVEN=6,G.ROUND_HALF_CEIL=7,G.ROUND_HALF_FLOOR=8,G.EUCLID=9,G.config=G.set=function(t){var e,r;if(null!=t){if("object"!=typeof t)throw Error(u+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(w(r=t[e],0,g,e),M=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(w(r=t[e],0,8,e),k=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((r=t[e])&&r.pop?(w(r[0],-g,0,e),w(r[1],0,g,e),L=r[0],C=r[1]):(w(r,-g,g,e),L=-(C=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if((r=t[e])&&r.pop)w(r[0],-g,-1,e),w(r[1],1,g,e),B=r[0],D=r[1];else{if(w(r,-g,g,e),!r)throw Error(u+e+" cannot be zero: "+r);B=-(D=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(u+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(u+"crypto unavailable");U=r}else U=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(w(r=t[e],0,9,e),j=r),t.hasOwnProperty(e="POW_PRECISION")&&(w(r=t[e],0,g,e),K=r),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(r=t[e]))throw Error(u+e+" not an object: "+r);V=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(u+e+" invalid: "+r);H="0123456789"==r.slice(0,10),F=r}}return{DECIMAL_PLACES:M,ROUNDING_MODE:k,EXPONENTIAL_AT:[L,C],RANGE:[B,D],CRYPTO:U,MODULO_MODE:j,POW_PRECISION:K,FORMAT:V,ALPHABET:F}},G.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!G.DEBUG)return!0;var e,r,i=t.c,n=t.e,s=t.s;t:if("[object Array]"=={}.toString.call(i)){if((1===s||-1===s)&&n>=-g&&n<=g&&n===c(n)){if(0===i[0]){if(0===n&&1===i.length)return!0;break t}if((e=(n+1)%l)<1&&(e+=l),String(i[0]).length==e){for(e=0;e<i.length;e++)if((r=i[e])<0||r>=f||r!==c(r))break t;if(0!==r)return!0}}}else if(null===i&&null===n&&(null===s||1===s||-1===s))return!0;throw Error(u+"Invalid BigNumber: "+t)},G.maximum=G.max=function(){return z(arguments,I.lt)},G.minimum=G.min=function(){return z(arguments,I.gt)},G.random=(s=9007199254740992,A=Math.random()*s&2097151?function(){return c(Math.random()*s)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,i,n,s,o=0,h=[],f=new G(N);if(null==t?t=M:w(t,0,g),n=a(t/l),U)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(n*=2));o<n;)(s=131072*e[o]+(e[o+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),e[o]=r[0],e[o+1]=r[1]):(h.push(s%1e14),o+=2);o=n/2}else{if(!crypto.randomBytes)throw U=!1,Error(u+"crypto unavailable");for(e=crypto.randomBytes(n*=7);o<n;)(s=281474976710656*(31&e[o])+1099511627776*e[o+1]+4294967296*e[o+2]+16777216*e[o+3]+(e[o+4]<<16)+(e[o+5]<<8)+e[o+6])>=9e15?crypto.randomBytes(7).copy(e,o):(h.push(s%1e14),o+=7);o=n/7}if(!U)for(;o<n;)(s=A())<9e15&&(h[o++]=s%1e14);for(n=h[--o],t%=l,n&&t&&(s=p[l-t],h[o]=c(n/s)*s);0===h[o];h.pop(),o--);if(o<0)h=[i=0];else{for(i=-1;0===h[0];h.splice(0,1),i-=l);for(o=1,s=h[0];s>=10;s/=10,o++);o<l&&(i-=l-o)}return f.e=i,f.c=h,f}),G.sum=function(){for(var t=1,e=arguments,r=new G(e[0]);t<e.length;)r=r.plus(e[t++]);return r},i=function(){var t="0123456789";function e(t,e,r,i){for(var n,s,o=[0],a=0,c=t.length;a<c;){for(s=o.length;s--;o[s]*=e);for(o[0]+=i.indexOf(t.charAt(a++)),n=0;n<o.length;n++)o[n]>r-1&&(null==o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}return function(i,n,s,o,a){var c,u,h,f,l,d,p,b,g=i.indexOf("."),m=M,y=k;for(g>=0&&(f=K,K=0,i=i.replace(".",""),d=(b=new G(n)).pow(i.length-g),K=f,b.c=e(S(v(d.c),d.e,"0"),10,s,t),b.e=b.c.length),h=f=(p=e(i,n,s,a?(c=F,t):(c=t,F))).length;0==p[--f];p.pop());if(!p[0])return c.charAt(0);if(g<0?--h:(d.c=p,d.e=h,d.s=o,p=(d=r(d,b,m,y,s)).c,l=d.r,h=d.e),g=p[u=h+m+1],f=s/2,l=l||u<0||null!=p[u+1],l=y<4?(null!=g||l)&&(0==y||y==(d.s<0?3:2)):g>f||g==f&&(4==y||l||6==y&&1&p[u-1]||y==(d.s<0?8:7)),u<1||!p[0])i=l?S(c.charAt(1),-m,c.charAt(0)):c.charAt(0);else{if(p.length=u,l)for(--s;++p[--u]>s;)p[u]=0,u||(++h,p=[1].concat(p));for(f=p.length;!p[--f];);for(g=0,i="";g<=f;i+=c.charAt(p[g++]));i=S(i,h,c.charAt(0))}return i}}(),r=function(){function t(t,e,r){var i,n,s,o,a=0,c=t.length,u=e%b,h=e/b|0;for(t=t.slice();c--;)a=((n=u*(s=t[c]%b)+(i=h*s+(o=t[c]/b|0)*u)%b*b+a)/r|0)+(i/b|0)+h*o,t[c]=n%r;return a&&(t=[a].concat(t)),t}function e(t,e,r,i){var n,s;if(r!=i)s=r>i?1:-1;else for(n=s=0;n<r;n++)if(t[n]!=e[n]){s=t[n]>e[n]?1:-1;break}return s}function r(t,e,r,i){for(var n=0;r--;)t[r]-=n,n=t[r]<e[r]?1:0,t[r]=n*i+t[r]-e[r];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(i,n,s,o,a){var u,h,d,p,b,g,v,y,w,_,E,S,A,O,T,x,R,P=i.s==n.s?1:-1,I=i.c,N=n.c;if(!(I&&I[0]&&N&&N[0]))return new G(i.s&&n.s&&(I?!N||I[0]!=N[0]:N)?I&&0==I[0]||!N?0*P:P/0:NaN);for(w=(y=new G(P)).c=[],P=s+(h=i.e-n.e)+1,a||(a=f,h=m(i.e/l)-m(n.e/l),P=P/l|0),d=0;N[d]==(I[d]||0);d++);if(N[d]>(I[d]||0)&&h--,P<0)w.push(1),p=!0;else{for(O=I.length,x=N.length,d=0,P+=2,(b=c(a/(N[0]+1)))>1&&(N=t(N,b,a),I=t(I,b,a),x=N.length,O=I.length),A=x,E=(_=I.slice(0,x)).length;E<x;_[E++]=0);R=N.slice(),R=[0].concat(R),T=N[0],N[1]>=a/2&&T++;do{if(b=0,(u=e(N,_,x,E))<0){if(S=_[0],x!=E&&(S=S*a+(_[1]||0)),(b=c(S/T))>1)for(b>=a&&(b=a-1),v=(g=t(N,b,a)).length,E=_.length;1==e(g,_,v,E);)b--,r(g,x<v?R:N,v,a),v=g.length,u=1;else 0==b&&(u=b=1),v=(g=N.slice()).length;if(v<E&&(g=[0].concat(g)),r(_,g,E,a),E=_.length,-1==u)for(;e(N,_,x,E)<1;)b++,r(_,x<E?R:N,E,a),E=_.length}else 0===u&&(b++,_=[0]);w[d++]=b,_[0]?_[E++]=I[A]||0:(_=[I[A]],E=1)}while((A++<O||null!=_[0])&&P--);p=null!=_[0],w[0]||w.splice(0,1)}if(a==f){for(d=1,P=w[0];P>=10;P/=10,d++);Z(y,s+(y.e=d+h*l-1)+1,o,p)}else y.e=h,y.r=+p;return y}}(),O=/^(-?)0([xbo])(?=\w[\w.]*$)/i,T=/^([^.]+)\.$/,x=/^\.([^.]+)$/,R=/^-?(Infinity|NaN)$/,P=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(t,e,r,i){var n,s=r?e:e.replace(P,"");if(R.test(s))t.s=isNaN(s)?null:s<0?-1:1;else{if(!r&&(s=s.replace(O,(function(t,e,r){return n="x"==(r=r.toLowerCase())?16:"b"==r?2:8,i&&i!=n?t:e})),i&&(n=i,s=s.replace(T,"$1").replace(x,"0.$1")),e!=s))return new G(s,n);if(G.DEBUG)throw Error(u+"Not a"+(i?" base "+i:"")+" number: "+e);t.s=null}t.c=t.e=null},I.absoluteValue=I.abs=function(){var t=new G(this);return t.s<0&&(t.s=1),t},I.comparedTo=function(t,e){return y(this,new G(t,e))},I.decimalPlaces=I.dp=function(t,e){var r,i,n,s=this;if(null!=t)return w(t,0,g),null==e?e=k:w(e,0,8),Z(new G(s),t+s.e+1,e);if(!(r=s.c))return null;if(i=((n=r.length-1)-m(this.e/l))*l,n=r[n])for(;n%10==0;n/=10,i--);return i<0&&(i=0),i},I.dividedBy=I.div=function(t,e){return r(this,new G(t,e),M,k)},I.dividedToIntegerBy=I.idiv=function(t,e){return r(this,new G(t,e),0,1)},I.exponentiatedBy=I.pow=function(t,e){var r,i,n,s,o,h,f,d,p=this;if((t=new G(t)).c&&!t.isInteger())throw Error(u+"Exponent not an integer: "+W(t));if(null!=e&&(e=new G(e)),o=t.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!t.c||!t.c[0])return d=new G(Math.pow(+W(p),o?2-_(t):+W(t))),e?d.mod(e):d;if(h=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new G(NaN);(i=!h&&p.isInteger()&&e.isInteger())&&(p=p.mod(e))}else{if(t.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||o&&p.c[1]>=24e7:p.c[0]<8e13||o&&p.c[0]<=9999975e7)))return s=p.s<0&&_(t)?-0:0,p.e>-1&&(s=1/s),new G(h?1/s:s);K&&(s=a(K/l+2))}for(o?(r=new G(.5),h&&(t.s=1),f=_(t)):f=(n=Math.abs(+W(t)))%2,d=new G(N);;){if(f){if(!(d=d.times(p)).c)break;s?d.c.length>s&&(d.c.length=s):i&&(d=d.mod(e))}if(n){if(0===(n=c(n/2)))break;f=n%2}else if(Z(t=t.times(r),t.e+1,1),t.e>14)f=_(t);else{if(0===(n=+W(t)))break;f=n%2}p=p.times(p),s?p.c&&p.c.length>s&&(p.c.length=s):i&&(p=p.mod(e))}return i?d:(h&&(d=N.div(d)),e?d.mod(e):s?Z(d,K,k,undefined):d)},I.integerValue=function(t){var e=new G(this);return null==t?t=k:w(t,0,8),Z(e,e.e+1,t)},I.isEqualTo=I.eq=function(t,e){return 0===y(this,new G(t,e))},I.isFinite=function(){return!!this.c},I.isGreaterThan=I.gt=function(t,e){return y(this,new G(t,e))>0},I.isGreaterThanOrEqualTo=I.gte=function(t,e){return 1===(e=y(this,new G(t,e)))||0===e},I.isInteger=function(){return!!this.c&&m(this.e/l)>this.c.length-2},I.isLessThan=I.lt=function(t,e){return y(this,new G(t,e))<0},I.isLessThanOrEqualTo=I.lte=function(t,e){return-1===(e=y(this,new G(t,e)))||0===e},I.isNaN=function(){return!this.s},I.isNegative=function(){return this.s<0},I.isPositive=function(){return this.s>0},I.isZero=function(){return!!this.c&&0==this.c[0]},I.minus=function(t,e){var r,i,n,s,o=this,a=o.s;if(e=(t=new G(t,e)).s,!a||!e)return new G(NaN);if(a!=e)return t.s=-e,o.plus(t);var c=o.e/l,u=t.e/l,h=o.c,d=t.c;if(!c||!u){if(!h||!d)return h?(t.s=-e,t):new G(d?o:NaN);if(!h[0]||!d[0])return d[0]?(t.s=-e,t):new G(h[0]?o:3==k?-0:0)}if(c=m(c),u=m(u),h=h.slice(),a=c-u){for((s=a<0)?(a=-a,n=h):(u=c,n=d),n.reverse(),e=a;e--;n.push(0));n.reverse()}else for(i=(s=(a=h.length)<(e=d.length))?a:e,a=e=0;e<i;e++)if(h[e]!=d[e]){s=h[e]<d[e];break}if(s&&(n=h,h=d,d=n,t.s=-t.s),(e=(i=d.length)-(r=h.length))>0)for(;e--;h[r++]=0);for(e=f-1;i>a;){if(h[--i]<d[i]){for(r=i;r&&!h[--r];h[r]=e);--h[r],h[i]+=f}h[i]-=d[i]}for(;0==h[0];h.splice(0,1),--u);return h[0]?q(t,h,u):(t.s=3==k?-1:1,t.c=[t.e=0],t)},I.modulo=I.mod=function(t,e){var i,n,s=this;return t=new G(t,e),!s.c||!t.s||t.c&&!t.c[0]?new G(NaN):!t.c||s.c&&!s.c[0]?new G(s):(9==j?(n=t.s,t.s=1,i=r(s,t,0,3),t.s=n,i.s*=n):i=r(s,t,0,j),(t=s.minus(i.times(t))).c[0]||1!=j||(t.s=s.s),t)},I.multipliedBy=I.times=function(t,e){var r,i,n,s,o,a,c,u,h,d,p,g,v,y,w,_=this,E=_.c,S=(t=new G(t,e)).c;if(!(E&&S&&E[0]&&S[0]))return!_.s||!t.s||E&&!E[0]&&!S||S&&!S[0]&&!E?t.c=t.e=t.s=null:(t.s*=_.s,E&&S?(t.c=[0],t.e=0):t.c=t.e=null),t;for(i=m(_.e/l)+m(t.e/l),t.s*=_.s,(c=E.length)<(d=S.length)&&(v=E,E=S,S=v,n=c,c=d,d=n),n=c+d,v=[];n--;v.push(0));for(y=f,w=b,n=d;--n>=0;){for(r=0,p=S[n]%w,g=S[n]/w|0,s=n+(o=c);s>n;)r=((u=p*(u=E[--o]%w)+(a=g*u+(h=E[o]/w|0)*p)%w*w+v[s]+r)/y|0)+(a/w|0)+g*h,v[s--]=u%y;v[s]=r}return r?++i:v.splice(0,1),q(t,v,i)},I.negated=function(){var t=new G(this);return t.s=-t.s||null,t},I.plus=function(t,e){var r,i=this,n=i.s;if(e=(t=new G(t,e)).s,!n||!e)return new G(NaN);if(n!=e)return t.s=-e,i.minus(t);var s=i.e/l,o=t.e/l,a=i.c,c=t.c;if(!s||!o){if(!a||!c)return new G(n/0);if(!a[0]||!c[0])return c[0]?t:new G(a[0]?i:0*n)}if(s=m(s),o=m(o),a=a.slice(),n=s-o){for(n>0?(o=s,r=c):(n=-n,r=a),r.reverse();n--;r.push(0));r.reverse()}for((n=a.length)-(e=c.length)<0&&(r=c,c=a,a=r,e=n),n=0;e;)n=(a[--e]=a[e]+c[e]+n)/f|0,a[e]=f===a[e]?0:a[e]%f;return n&&(a=[n].concat(a),++o),q(t,a,o)},I.precision=I.sd=function(t,e){var r,i,n,s=this;if(null!=t&&t!==!!t)return w(t,1,g),null==e?e=k:w(e,0,8),Z(new G(s),t,e);if(!(r=s.c))return null;if(i=(n=r.length-1)*l+1,n=r[n]){for(;n%10==0;n/=10,i--);for(n=r[0];n>=10;n/=10,i++);}return t&&s.e+1>i&&(i=s.e+1),i},I.shiftedBy=function(t){return w(t,-9007199254740991,d),this.times("1e"+t)},I.squareRoot=I.sqrt=function(){var t,e,i,n,s,o=this,a=o.c,c=o.s,u=o.e,h=M+4,f=new G("0.5");if(1!==c||!a||!a[0])return new G(!c||c<0&&(!a||a[0])?NaN:a?o:1/0);if(0==(c=Math.sqrt(+W(o)))||c==1/0?(((e=v(a)).length+u)%2==0&&(e+="0"),c=Math.sqrt(+e),u=m((u+1)/2)-(u<0||u%2),i=new G(e=c==1/0?"5e"+u:(e=c.toExponential()).slice(0,e.indexOf("e")+1)+u)):i=new G(c+""),i.c[0])for((c=(u=i.e)+h)<3&&(c=0);;)if(s=i,i=f.times(s.plus(r(o,s,h,1))),v(s.c).slice(0,c)===(e=v(i.c)).slice(0,c)){if(i.e<u&&--c,"9999"!=(e=e.slice(c-3,c+1))&&(n||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(Z(i,i.e+M+2,1),t=!i.times(i).eq(o));break}if(!n&&(Z(s,s.e+M+2,0),s.times(s).eq(o))){i=s;break}h+=4,c+=4,n=1}return Z(i,i.e+M+1,k,t)},I.toExponential=function(t,e){return null!=t&&(w(t,0,g),t++),$(this,t,e,1)},I.toFixed=function(t,e){return null!=t&&(w(t,0,g),t=t+this.e+1),$(this,t,e)},I.toFormat=function(t,e,r){var i,n=this;if(null==r)null!=t&&e&&"object"==typeof e?(r=e,e=null):t&&"object"==typeof t?(r=t,t=e=null):r=V;else if("object"!=typeof r)throw Error(u+"Argument not an object: "+r);if(i=n.toFixed(t,e),n.c){var s,o=i.split("."),a=+r.groupSize,c=+r.secondaryGroupSize,h=r.groupSeparator||"",f=o[0],l=o[1],d=n.s<0,p=d?f.slice(1):f,b=p.length;if(c&&(s=a,a=c,c=s,b-=s),a>0&&b>0){for(s=b%a||a,f=p.substr(0,s);s<b;s+=a)f+=h+p.substr(s,a);c>0&&(f+=h+p.slice(s)),d&&(f="-"+f)}i=l?f+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?l.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):l):f}return(r.prefix||"")+i+(r.suffix||"")},I.toFraction=function(t){var e,i,n,s,o,a,c,h,f,d,b,g,m=this,y=m.c;if(null!=t&&(!(c=new G(t)).isInteger()&&(c.c||1!==c.s)||c.lt(N)))throw Error(u+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+W(c));if(!y)return new G(m);for(e=new G(N),f=i=new G(N),n=h=new G(N),g=v(y),o=e.e=g.length-m.e-1,e.c[0]=p[(a=o%l)<0?l+a:a],t=!t||c.comparedTo(e)>0?o>0?e:f:c,a=D,D=1/0,c=new G(g),h.c[0]=0;d=r(c,e,0,1),1!=(s=i.plus(d.times(n))).comparedTo(t);)i=n,n=s,f=h.plus(d.times(s=f)),h=s,e=c.minus(d.times(s=e)),c=s;return s=r(t.minus(i),n,0,1),h=h.plus(s.times(f)),i=i.plus(s.times(n)),h.s=f.s=m.s,b=r(f,n,o*=2,k).minus(m).abs().comparedTo(r(h,i,o,k).minus(m).abs())<1?[f,n]:[h,i],D=a,b},I.toNumber=function(){return+W(this)},I.toPrecision=function(t,e){return null!=t&&w(t,1,g),$(this,t,e,2)},I.toString=function(t){var e,r=this,n=r.s,s=r.e;return null===s?n?(e="Infinity",n<0&&(e="-"+e)):e="NaN":(null==t?e=s<=L||s>=C?E(v(r.c),s):S(v(r.c),s,"0"):10===t&&H?e=S(v((r=Z(new G(r),M+s+1,k)).c),r.e,"0"):(w(t,2,F.length,"Base"),e=i(S(v(r.c),s,"0"),10,t,n,!0)),n<0&&r.c[0]&&(e="-"+e)),e},I.valueOf=I.toJSON=function(){return W(this)},I._isBigNumber=!0,null!=e&&G.set(e),G}(),s.default=s.BigNumber=s,void 0===(i=function(){return s}.call(e,r,e,t))||(t.exports=i)}()},651:(t,e,r)=>{const i=r(7967);function n(t,e,r){const i=t[e]+t[r];let n=t[e+1]+t[r+1];i>=4294967296&&n++,t[e]=i,t[e+1]=n}function s(t,e,r,i){let n=t[e]+r;r<0&&(n+=4294967296);let s=t[e+1]+i;n>=4294967296&&s++,t[e]=n,t[e+1]=s}function o(t,e){return t[e]^t[e+1]<<8^t[e+2]<<16^t[e+3]<<24}function a(t,e,r,i,o,a){const c=f[o],u=f[o+1],l=f[a],d=f[a+1];n(h,t,e),s(h,t,c,u);let p=h[i]^h[t],b=h[i+1]^h[t+1];h[i]=b,h[i+1]=p,n(h,r,i),p=h[e]^h[r],b=h[e+1]^h[r+1],h[e]=p>>>24^b<<8,h[e+1]=b>>>24^p<<8,n(h,t,e),s(h,t,l,d),p=h[i]^h[t],b=h[i+1]^h[t+1],h[i]=p>>>16^b<<16,h[i+1]=b>>>16^p<<16,n(h,r,i),p=h[e]^h[r],b=h[e+1]^h[r+1],h[e]=b>>>31^p<<1,h[e+1]=p>>>31^b<<1}const c=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),u=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(t){return 2*t}))),h=new Uint32Array(32),f=new Uint32Array(32);function l(t,e){let r=0;for(r=0;r<16;r++)h[r]=t.h[r],h[r+16]=c[r];for(h[24]=h[24]^t.t,h[25]=h[25]^t.t/4294967296,e&&(h[28]=~h[28],h[29]=~h[29]),r=0;r<32;r++)f[r]=o(t.b,4*r);for(r=0;r<12;r++)a(0,8,16,24,u[16*r+0],u[16*r+1]),a(2,10,18,26,u[16*r+2],u[16*r+3]),a(4,12,20,28,u[16*r+4],u[16*r+5]),a(6,14,22,30,u[16*r+6],u[16*r+7]),a(0,10,20,30,u[16*r+8],u[16*r+9]),a(2,12,22,24,u[16*r+10],u[16*r+11]),a(4,14,16,26,u[16*r+12],u[16*r+13]),a(6,8,18,28,u[16*r+14],u[16*r+15]);for(r=0;r<16;r++)t.h[r]=t.h[r]^h[r]^h[r+16]}const d=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function p(t,e,r,i){if(0===t||t>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(e&&e.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(r&&16!==r.length)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(i&&16!==i.length)throw new Error("Illegal personal, expected Uint8Array with length is 16");const n={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:t};d.fill(0),d[0]=t,e&&(d[1]=e.length),d[2]=1,d[3]=1,r&&d.set(r,32),i&&d.set(i,48);for(let t=0;t<16;t++)n.h[t]=c[t]^o(d,4*t);return e&&(b(n,e),n.c=128),n}function b(t,e){for(let r=0;r<e.length;r++)128===t.c&&(t.t+=t.c,l(t,!1),t.c=0),t.b[t.c++]=e[r]}function g(t){for(t.t+=t.c;t.c<128;)t.b[t.c++]=0;l(t,!0);const e=new Uint8Array(t.outlen);for(let r=0;r<t.outlen;r++)e[r]=t.h[r>>2]>>8*(3&r);return e}function m(t,e,r,n,s){r=r||64,t=i.normalizeInput(t),n&&(n=i.normalizeInput(n)),s&&(s=i.normalizeInput(s));const o=p(r,e,n,s);return b(o,t),g(o)}t.exports={blake2b:m,blake2bHex:function(t,e,r,n,s){const o=m(t,e,r,n,s);return i.toHex(o)},blake2bInit:p,blake2bUpdate:b,blake2bFinal:g}},9962:(t,e,r)=>{const i=r(7967);function n(t,e){return t[e]^t[e+1]<<8^t[e+2]<<16^t[e+3]<<24}function s(t,e,r,i,n,s){u[t]=u[t]+u[e]+n,u[i]=o(u[i]^u[t],16),u[r]=u[r]+u[i],u[e]=o(u[e]^u[r],12),u[t]=u[t]+u[e]+s,u[i]=o(u[i]^u[t],8),u[r]=u[r]+u[i],u[e]=o(u[e]^u[r],7)}function o(t,e){return t>>>e^t<<32-e}const a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),u=new Uint32Array(16),h=new Uint32Array(16);function f(t,e){let r=0;for(r=0;r<8;r++)u[r]=t.h[r],u[r+8]=a[r];for(u[12]^=t.t,u[13]^=t.t/4294967296,e&&(u[14]=~u[14]),r=0;r<16;r++)h[r]=n(t.b,4*r);for(r=0;r<10;r++)s(0,4,8,12,h[c[16*r+0]],h[c[16*r+1]]),s(1,5,9,13,h[c[16*r+2]],h[c[16*r+3]]),s(2,6,10,14,h[c[16*r+4]],h[c[16*r+5]]),s(3,7,11,15,h[c[16*r+6]],h[c[16*r+7]]),s(0,5,10,15,h[c[16*r+8]],h[c[16*r+9]]),s(1,6,11,12,h[c[16*r+10]],h[c[16*r+11]]),s(2,7,8,13,h[c[16*r+12]],h[c[16*r+13]]),s(3,4,9,14,h[c[16*r+14]],h[c[16*r+15]]);for(r=0;r<8;r++)t.h[r]^=u[r]^u[r+8]}function l(t,e){if(!(t>0&&t<=32))throw new Error("Incorrect output length, should be in [1, 32]");const r=e?e.length:0;if(e&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");const i={h:new Uint32Array(a),b:new Uint8Array(64),c:0,t:0,outlen:t};return i.h[0]^=16842752^r<<8^t,r>0&&(d(i,e),i.c=64),i}function d(t,e){for(let r=0;r<e.length;r++)64===t.c&&(t.t+=t.c,f(t,!1),t.c=0),t.b[t.c++]=e[r]}function p(t){for(t.t+=t.c;t.c<64;)t.b[t.c++]=0;f(t,!0);const e=new Uint8Array(t.outlen);for(let r=0;r<t.outlen;r++)e[r]=t.h[r>>2]>>8*(3&r)&255;return e}function b(t,e,r){r=r||32,t=i.normalizeInput(t);const n=l(r,e);return d(n,t),p(n)}t.exports={blake2s:b,blake2sHex:function(t,e,r){const n=b(t,e,r);return i.toHex(n)},blake2sInit:l,blake2sUpdate:d,blake2sFinal:p}},1395:(t,e,r)=>{const i=r(651),n=r(9962);t.exports={blake2b:i.blake2b,blake2bHex:i.blake2bHex,blake2bInit:i.blake2bInit,blake2bUpdate:i.blake2bUpdate,blake2bFinal:i.blake2bFinal,blake2s:n.blake2s,blake2sHex:n.blake2sHex,blake2sInit:n.blake2sInit,blake2sUpdate:n.blake2sUpdate,blake2sFinal:n.blake2sFinal}},7967:t=>{function e(t){return(4294967296+t).toString(16).substring(1)}t.exports={normalizeInput:function(t){let e;if(t instanceof Uint8Array)e=t;else{if("string"!=typeof t)throw new Error("Input must be an string, Buffer or Uint8Array");e=(new TextEncoder).encode(t)}return e},toHex:function(t){return Array.prototype.map.call(t,(function(t){return(t<16?"0":"")+t.toString(16)})).join("")},debugPrint:function(t,r,i){let n="\n"+t+" = ";for(let s=0;s<r.length;s+=2){if(32===i)n+=e(r[s]).toUpperCase(),n+=" ",n+=e(r[s+1]).toUpperCase();else{if(64!==i)throw new Error("Invalid size "+i);n+=e(r[s+1]).toUpperCase(),n+=e(r[s]).toUpperCase()}s%6==4?n+="\n"+new Array(t.length+4).join(" "):s<r.length-2&&(n+=" ")}console.log(n)},testSpeed:function(t,e,r){let i=(new Date).getTime();const n=new Uint8Array(e);for(let t=0;t<e;t++)n[t]=t%256;const s=(new Date).getTime();console.log("Generated random input in "+(s-i)+"ms"),i=s;for(let s=0;s<r;s++){const r=t(n),s=(new Date).getTime(),o=s-i;i=s,console.log("Hashed in "+o+"ms: "+r.substring(0,20)+"..."),console.log(Math.round(e/(1<<20)/(o/1e3)*100)/100+" MB PER SECOND")}}}},2197:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(3196).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function u(t,e,r,i){for(var n=0,s=Math.min(t.length,r),o=e;o<s;o++){var a=t.charCodeAt(o)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,r):(this._parseBase(t,e,n),"le"===r&&this._initArray(this.toArray(),e,r)))},s.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var s,o,a=0;if("be"===r)for(n=t.length-1,s=0;n>=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,s=0,o=0;if("be"===r)for(i=t.length-1;i>=e;i-=2)n=c(t,e,i)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(t.length-e)%2==0?e+1:e;i<t.length;i+=2)n=c(t,e,i)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var s=t.length-r,o=s%i,a=Math.min(s,s-o)+r,c=0,h=r;h<a;h+=i)c=u(t,h,h+i,e),this.imuln(n),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==o){var f=1;for(c=u(t,h,t.length,e),h=0;h<o;h++)f*=e;this.imuln(f),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)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 h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=67108863&o,c=o/67108864|0;r.words[0]=a;for(var u=1;u<i;u++){for(var h=c>>>26,f=67108863&c,l=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=l;d++){var p=u-d|0;h+=(o=(n=0|t.words[p])*(s=0|e.words[d])+f)/67108864|0,f=67108863&o}r.words[u]=0|f,c=0|h}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,s=0,o=0;o<this.length;o++){var a=this.words[o],c=(16777215&(a<<n|s)).toString(16);r=0!==(s=a>>>24-n&16777215)||o!==this.length-1?h[6-c.length]+c+r:c+r,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(r=s.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?b+r:h[u-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=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 t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return i(void 0!==o),this.toArrayLike(o,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){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"),this.strip();var o,a,c="le"===e,u=new t(s),h=this.clone();if(c){for(a=0;!h.isZero();a++)o=h.andln(255),h.iushrn(8),u[a]=o;for(;a<s;a++)u[a]=0}else{for(a=0;a<s-n;a++)u[a]=0;for(a=0;!h.isZero();a++)o=h.andln(255),h.iushrn(8),u[s-a-1]=o}return u},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).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(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},s.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,s=0;s<i.length;s++)e=(0|r.words[s])+(0|i.words[s])+n,this.words[s]=67108863&e,n=e>>>26;for(;0!==n&&s<r.length;s++)e=(0|r.words[s])+n,this.words[s]=67108863&e,n=e>>>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(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var s=0,o=0;o<i.length;o++)s=(e=(0|r.words[o])-(0|i.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<r.length;o++)s=(e=(0|r.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var i,n,s,o=t.words,a=e.words,c=r.words,u=0,h=0|o[0],f=8191&h,l=h>>>13,d=0|o[1],p=8191&d,b=d>>>13,g=0|o[2],m=8191&g,v=g>>>13,y=0|o[3],w=8191&y,_=y>>>13,E=0|o[4],S=8191&E,A=E>>>13,O=0|o[5],T=8191&O,x=O>>>13,R=0|o[6],P=8191&R,I=R>>>13,N=0|o[7],M=8191&N,k=N>>>13,L=0|o[8],C=8191&L,B=L>>>13,D=0|o[9],U=8191&D,j=D>>>13,K=0|a[0],V=8191&K,F=K>>>13,H=0|a[1],G=8191&H,$=H>>>13,z=0|a[2],q=8191&z,Z=z>>>13,W=0|a[3],Y=8191&W,J=W>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],st=8191&nt,ot=nt>>>13,at=0|a[7],ct=8191&at,ut=at>>>13,ht=0|a[8],ft=8191&ht,lt=ht>>>13,dt=0|a[9],pt=8191&dt,bt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(u+(i=Math.imul(f,V))|0)+((8191&(n=(n=Math.imul(f,F))+Math.imul(l,V)|0))<<13)|0;u=((s=Math.imul(l,F))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(p,V),n=(n=Math.imul(p,F))+Math.imul(b,V)|0,s=Math.imul(b,F);var mt=(u+(i=i+Math.imul(f,G)|0)|0)+((8191&(n=(n=n+Math.imul(f,$)|0)+Math.imul(l,G)|0))<<13)|0;u=((s=s+Math.imul(l,$)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,V),n=(n=Math.imul(m,F))+Math.imul(v,V)|0,s=Math.imul(v,F),i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(b,G)|0,s=s+Math.imul(b,$)|0;var vt=(u+(i=i+Math.imul(f,q)|0)|0)+((8191&(n=(n=n+Math.imul(f,Z)|0)+Math.imul(l,q)|0))<<13)|0;u=((s=s+Math.imul(l,Z)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(w,V),n=(n=Math.imul(w,F))+Math.imul(_,V)|0,s=Math.imul(_,F),i=i+Math.imul(m,G)|0,n=(n=n+Math.imul(m,$)|0)+Math.imul(v,G)|0,s=s+Math.imul(v,$)|0,i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(b,q)|0,s=s+Math.imul(b,Z)|0;var yt=(u+(i=i+Math.imul(f,Y)|0)|0)+((8191&(n=(n=n+Math.imul(f,J)|0)+Math.imul(l,Y)|0))<<13)|0;u=((s=s+Math.imul(l,J)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(S,V),n=(n=Math.imul(S,F))+Math.imul(A,V)|0,s=Math.imul(A,F),i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,G)|0,s=s+Math.imul(_,$)|0,i=i+Math.imul(m,q)|0,n=(n=n+Math.imul(m,Z)|0)+Math.imul(v,q)|0,s=s+Math.imul(v,Z)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(b,Y)|0,s=s+Math.imul(b,J)|0;var wt=(u+(i=i+Math.imul(f,Q)|0)|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(l,Q)|0))<<13)|0;u=((s=s+Math.imul(l,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(T,V),n=(n=Math.imul(T,F))+Math.imul(x,V)|0,s=Math.imul(x,F),i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(A,G)|0,s=s+Math.imul(A,$)|0,i=i+Math.imul(w,q)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,q)|0,s=s+Math.imul(_,Z)|0,i=i+Math.imul(m,Y)|0,n=(n=n+Math.imul(m,J)|0)+Math.imul(v,Y)|0,s=s+Math.imul(v,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,s=s+Math.imul(b,tt)|0;var _t=(u+(i=i+Math.imul(f,rt)|0)|0)+((8191&(n=(n=n+Math.imul(f,it)|0)+Math.imul(l,rt)|0))<<13)|0;u=((s=s+Math.imul(l,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(P,V),n=(n=Math.imul(P,F))+Math.imul(I,V)|0,s=Math.imul(I,F),i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,$)|0)+Math.imul(x,G)|0,s=s+Math.imul(x,$)|0,i=i+Math.imul(S,q)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(A,q)|0,s=s+Math.imul(A,Z)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,Y)|0,s=s+Math.imul(_,J)|0,i=i+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(v,Q)|0,s=s+Math.imul(v,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(b,rt)|0,s=s+Math.imul(b,it)|0;var Et=(u+(i=i+Math.imul(f,st)|0)|0)+((8191&(n=(n=n+Math.imul(f,ot)|0)+Math.imul(l,st)|0))<<13)|0;u=((s=s+Math.imul(l,ot)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(M,V),n=(n=Math.imul(M,F))+Math.imul(k,V)|0,s=Math.imul(k,F),i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(I,G)|0,s=s+Math.imul(I,$)|0,i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(x,q)|0,s=s+Math.imul(x,Z)|0,i=i+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(A,Y)|0,s=s+Math.imul(A,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(v,rt)|0,s=s+Math.imul(v,it)|0,i=i+Math.imul(p,st)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(b,st)|0,s=s+Math.imul(b,ot)|0;var St=(u+(i=i+Math.imul(f,ct)|0)|0)+((8191&(n=(n=n+Math.imul(f,ut)|0)+Math.imul(l,ct)|0))<<13)|0;u=((s=s+Math.imul(l,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(C,V),n=(n=Math.imul(C,F))+Math.imul(B,V)|0,s=Math.imul(B,F),i=i+Math.imul(M,G)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(k,G)|0,s=s+Math.imul(k,$)|0,i=i+Math.imul(P,q)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(I,q)|0,s=s+Math.imul(I,Z)|0,i=i+Math.imul(T,Y)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(x,Y)|0,s=s+Math.imul(x,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(A,Q)|0,s=s+Math.imul(A,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,s=s+Math.imul(_,it)|0,i=i+Math.imul(m,st)|0,n=(n=n+Math.imul(m,ot)|0)+Math.imul(v,st)|0,s=s+Math.imul(v,ot)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(b,ct)|0,s=s+Math.imul(b,ut)|0;var At=(u+(i=i+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;u=((s=s+Math.imul(l,lt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(U,V),n=(n=Math.imul(U,F))+Math.imul(j,V)|0,s=Math.imul(j,F),i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(B,G)|0,s=s+Math.imul(B,$)|0,i=i+Math.imul(M,q)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(k,q)|0,s=s+Math.imul(k,Z)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(I,Y)|0,s=s+Math.imul(I,J)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(A,rt)|0,s=s+Math.imul(A,it)|0,i=i+Math.imul(w,st)|0,n=(n=n+Math.imul(w,ot)|0)+Math.imul(_,st)|0,s=s+Math.imul(_,ot)|0,i=i+Math.imul(m,ct)|0,n=(n=n+Math.imul(m,ut)|0)+Math.imul(v,ct)|0,s=s+Math.imul(v,ut)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(b,ft)|0,s=s+Math.imul(b,lt)|0;var Ot=(u+(i=i+Math.imul(f,pt)|0)|0)+((8191&(n=(n=n+Math.imul(f,bt)|0)+Math.imul(l,pt)|0))<<13)|0;u=((s=s+Math.imul(l,bt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,$))+Math.imul(j,G)|0,s=Math.imul(j,$),i=i+Math.imul(C,q)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(B,q)|0,s=s+Math.imul(B,Z)|0,i=i+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,J)|0)+Math.imul(k,Y)|0,s=s+Math.imul(k,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(I,Q)|0,s=s+Math.imul(I,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(x,rt)|0,s=s+Math.imul(x,it)|0,i=i+Math.imul(S,st)|0,n=(n=n+Math.imul(S,ot)|0)+Math.imul(A,st)|0,s=s+Math.imul(A,ot)|0,i=i+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,ct)|0,s=s+Math.imul(_,ut)|0,i=i+Math.imul(m,ft)|0,n=(n=n+Math.imul(m,lt)|0)+Math.imul(v,ft)|0,s=s+Math.imul(v,lt)|0;var Tt=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;u=((s=s+Math.imul(b,bt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(U,q),n=(n=Math.imul(U,Z))+Math.imul(j,q)|0,s=Math.imul(j,Z),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(B,Y)|0,s=s+Math.imul(B,J)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,s=s+Math.imul(k,tt)|0,i=i+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,it)|0)+Math.imul(I,rt)|0,s=s+Math.imul(I,it)|0,i=i+Math.imul(T,st)|0,n=(n=n+Math.imul(T,ot)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,ot)|0,i=i+Math.imul(S,ct)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(A,ct)|0,s=s+Math.imul(A,ut)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,lt)|0)+Math.imul(_,ft)|0,s=s+Math.imul(_,lt)|0;var xt=(u+(i=i+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,bt)|0)+Math.imul(v,pt)|0))<<13)|0;u=((s=s+Math.imul(v,bt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(U,Y),n=(n=Math.imul(U,J))+Math.imul(j,Y)|0,s=Math.imul(j,J),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(B,Q)|0,s=s+Math.imul(B,tt)|0,i=i+Math.imul(M,rt)|0,n=(n=n+Math.imul(M,it)|0)+Math.imul(k,rt)|0,s=s+Math.imul(k,it)|0,i=i+Math.imul(P,st)|0,n=(n=n+Math.imul(P,ot)|0)+Math.imul(I,st)|0,s=s+Math.imul(I,ot)|0,i=i+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(x,ct)|0,s=s+Math.imul(x,ut)|0,i=i+Math.imul(S,ft)|0,n=(n=n+Math.imul(S,lt)|0)+Math.imul(A,ft)|0,s=s+Math.imul(A,lt)|0;var Rt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((s=s+Math.imul(_,bt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(U,Q),n=(n=Math.imul(U,tt))+Math.imul(j,Q)|0,s=Math.imul(j,tt),i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(B,rt)|0,s=s+Math.imul(B,it)|0,i=i+Math.imul(M,st)|0,n=(n=n+Math.imul(M,ot)|0)+Math.imul(k,st)|0,s=s+Math.imul(k,ot)|0,i=i+Math.imul(P,ct)|0,n=(n=n+Math.imul(P,ut)|0)+Math.imul(I,ct)|0,s=s+Math.imul(I,ut)|0,i=i+Math.imul(T,ft)|0,n=(n=n+Math.imul(T,lt)|0)+Math.imul(x,ft)|0,s=s+Math.imul(x,lt)|0;var Pt=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,bt)|0)+Math.imul(A,pt)|0))<<13)|0;u=((s=s+Math.imul(A,bt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(U,rt),n=(n=Math.imul(U,it))+Math.imul(j,rt)|0,s=Math.imul(j,it),i=i+Math.imul(C,st)|0,n=(n=n+Math.imul(C,ot)|0)+Math.imul(B,st)|0,s=s+Math.imul(B,ot)|0,i=i+Math.imul(M,ct)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(k,ct)|0,s=s+Math.imul(k,ut)|0,i=i+Math.imul(P,ft)|0,n=(n=n+Math.imul(P,lt)|0)+Math.imul(I,ft)|0,s=s+Math.imul(I,lt)|0;var It=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,bt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((s=s+Math.imul(x,bt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(U,st),n=(n=Math.imul(U,ot))+Math.imul(j,st)|0,s=Math.imul(j,ot),i=i+Math.imul(C,ct)|0,n=(n=n+Math.imul(C,ut)|0)+Math.imul(B,ct)|0,s=s+Math.imul(B,ut)|0,i=i+Math.imul(M,ft)|0,n=(n=n+Math.imul(M,lt)|0)+Math.imul(k,ft)|0,s=s+Math.imul(k,lt)|0;var Nt=(u+(i=i+Math.imul(P,pt)|0)|0)+((8191&(n=(n=n+Math.imul(P,bt)|0)+Math.imul(I,pt)|0))<<13)|0;u=((s=s+Math.imul(I,bt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(U,ct),n=(n=Math.imul(U,ut))+Math.imul(j,ct)|0,s=Math.imul(j,ut),i=i+Math.imul(C,ft)|0,n=(n=n+Math.imul(C,lt)|0)+Math.imul(B,ft)|0,s=s+Math.imul(B,lt)|0;var Mt=(u+(i=i+Math.imul(M,pt)|0)|0)+((8191&(n=(n=n+Math.imul(M,bt)|0)+Math.imul(k,pt)|0))<<13)|0;u=((s=s+Math.imul(k,bt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(U,ft),n=(n=Math.imul(U,lt))+Math.imul(j,ft)|0,s=Math.imul(j,lt);var kt=(u+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,bt)|0)+Math.imul(B,pt)|0))<<13)|0;u=((s=s+Math.imul(B,bt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863;var Lt=(u+(i=Math.imul(U,pt))|0)+((8191&(n=(n=Math.imul(U,bt))+Math.imul(j,pt)|0))<<13)|0;return u=((s=Math.imul(j,bt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,c[0]=gt,c[1]=mt,c[2]=vt,c[3]=yt,c[4]=wt,c[5]=_t,c[6]=Et,c[7]=St,c[8]=At,c[9]=Ot,c[10]=Tt,c[11]=xt,c[12]=Rt,c[13]=Pt,c[14]=It,c[15]=Nt,c[16]=Mt,c[17]=kt,c[18]=Lt,0!==u&&(c[19]=u,r.length++),r};function b(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),s.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):i<63?d(this,t,e):i<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,s=0;s<r.length-1;s++){var o=n;n=0;for(var a=67108863&i,c=Math.min(s,e.length-1),u=Math.max(0,s-t.length+1);u<=c;u++){var h=s-u,f=(0|t.words[h])*(0|e.words[u]),l=67108863&f;a=67108863&(l=l+a|0),n+=(o=(o=o+(f/67108864|0)|0)+(l>>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r.strip()}(this,t,e):b(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},g.prototype.permute=function(t,e,r,i,n,s){for(var o=0;o<s;o++)i[o]=e[t[o]],n[o]=r[t[o]]},g.prototype.transform=function(t,e,r,i,n,s){this.permute(s,t,e,r,i,n);for(var o=1;o<n;o<<=1)for(var a=o<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),h=0;h<n;h+=a)for(var f=c,l=u,d=0;d<o;d++){var p=r[h+d],b=i[h+d],g=r[h+d+o],m=i[h+d+o],v=f*g-l*m;m=f*m+l*g,g=v,r[h+d]=p+g,i[h+d]=b+m,r[h+d+o]=p-g,i[h+d+o]=b-m,d!==a&&(v=c*f-u*l,l=c*l+u*f,f=v)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},g.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},g.prototype.convert13b=function(t,e,r,n){for(var s=0,o=0;o<e;o++)s+=0|t[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<n;++o)r[o]=0;i(0===s),i(0==(-8192&s))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),s=this.stub(i),o=new Array(i),a=new Array(i),c=new Array(i),u=new Array(i),h=new Array(i),f=new Array(i),l=r.words;l.length=i,this.convert13b(t.words,t.length,o,i),this.convert13b(e.words,e.length,u,i),this.transform(o,s,a,c,i,n),this.transform(u,s,h,f,i,n);for(var d=0;d<i;d++){var p=a[d]*h[d]-c[d]*f[d];c[d]=a[d]*f[d]+c[d]*h[d],a[d]=p}return this.conjugate(a,c,i),this.transform(a,c,l,s,i,n),this.conjugate(l,s,i),this.normalize13b(l,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),b(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,s=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=s>>>26,this.words[r]=67108863&s}return 0!==e&&(this.words[r]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new s(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var n=r.sqr();i<e.length;i++,n=n.sqr())0!==e[i]&&(r=r.mul(n));return r},s.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,c=(0|this.words[e])-a<<r;this.words[e]=c|o,o=a>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,c=r;if(n-=o,n=Math.max(0,n),c){for(var u=0;u<o;u++)c.words[u]=this.words[u];c.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 h=0;for(u=this.length-1;u>=0&&(0!==h||u>=n);u--){var f=0|this.words[u];this.words[u]=h<<26-s|f>>>s,h=f&a}return c&&0!==h&&(c.words[c.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},s.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var n,s,o=t.length+r;this._expand(o);var a=0;for(n=0;n<t.length;n++){s=(0|this.words[n+r])+a;var c=(0|t.words[n])*e;a=((s-=67108863&c)>>26)-(c/67108864|0),this.words[n+r]=67108863&s}for(;n<this.length-r;n++)a=(s=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&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]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,o=0|n.words[n.length-1];0!==(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,c=i.length-n.length;if("mod"!==e){(a=new s(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var h=i.clone()._ishlnsubmul(n,1,c);0===h.negative&&(i=h,a&&(a.words[c]=1));for(var f=c-1;f>=0;f--){var l=67108864*(0|i.words[n.length+f])+(0|i.words[n.length+f-1]);for(l=Math.min(l/o|0,67108863),i._ishlnsubmul(n,l,f);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(n,1,f),i.isZero()||(i.negative^=1);a&&(a.words[f]=l)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},s.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},s.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),c=new s(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var h=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(h),o.isub(f)),n.iushrn(1),o.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(h),c.isub(f)),a.iushrn(1),c.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),o.isub(c)):(r.isub(e),a.isub(n),c.isub(o))}return{a,b:c,gcd:r.iushln(u)}},s.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),c=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,h=1;0==(e.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var f=0,l=1;0==(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var s=e;e=r,r=s}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;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];s=(a+=s)>>>26,a&=67108863,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(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new S(t)},s.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){S.call(this,t),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)}v.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<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},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},n(y,v),y.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n<i;n++)e.words[n]=t.words[n];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var s=t.words[9];for(e.words[e.length++]=s&r,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(o&r)<<4|s>>>22,s=o}s>>>=22,t.words[n-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(w,v),n(_,v),n(E,v),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return m[t]=e,e},S.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,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),c=a.redNeg(),u=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new s(2*h*h).toRed(this);0!==this.pow(h,u).cmp(c);)h.redIAdd(c);for(var f=this.pow(h,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=o;0!==d.cmp(a);){for(var b=d,g=0;0!==b.cmp(a);g++)b=b.redSqr();i(g<p);var m=this.pow(f,new s(1).iushln(p-g-1));l=l.redMul(m),f=m.redSqr(),d=d.redMul(f),p=g}return l},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new s(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var n=r[0],o=0,a=0,c=e.bitLength()%26;for(0===c&&(c=26),i=e.length-1;i>=0;i--){for(var u=e.words[i],h=c-1;h>=0;h--){var f=u>>h&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==o?(o<<=1,o|=f,(4===++a||0===i&&0===h)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}c=26}return n},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new A(t)},n(A,S),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),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):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},2745:(t,e,r)=>{var i;function n(t){this.rand=t}if(t.exports=function(t){return i||(i=new n(null)),i.generate(t)},t.exports.Rand=n,n.prototype.generate=function(t){return this._rand(t)},n.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var s=r(8087);if("function"!=typeof s.randomBytes)throw new Error("Not supported");n.prototype._rand=function(t){return s.randomBytes(t)}}catch(t){}},7022:(t,e,r)=>{var i=r(8166);t.exports=i("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},8616:(t,e,r)=>{"use strict";var i=r(7022),n=r(7834).Buffer;t.exports=function(t){function e(e){var r=e.slice(0,-4),i=e.slice(-4),n=t(r);if(!(i[0]^n[0]|i[1]^n[1]|i[2]^n[2]|i[3]^n[3]))return r}return{encode:function(e){var r=t(e);return i.encode(n.concat([e,r],e.length+4))},decode:function(t){var r=e(i.decode(t));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(t){var r=i.decodeUnsafe(t);if(r)return e(r)}}}},4075:(t,e,r)=>{"use strict";var i=r(6162),n=r(8616);t.exports=n((function(t){var e=i("sha256").update(t).digest();return i("sha256").update(e).digest()}))},8834:(t,e,r)=>{"use strict";const i=r(5766),n=r(2333),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const o=2147483647;function a(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|b(t,e);let i=a(r);const n=i.write(t,e);n!==r&&(i=i.slice(0,n));return i}(t,e);if(ArrayBuffer.isView(t))return function(t){if(W(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return l(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(W(t,ArrayBuffer)||t&&W(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(W(t,SharedArrayBuffer)||t&&W(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return c.from(i,e,r);const n=function(t){if(c.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||Y(t.length)?a(0):l(t);if("Buffer"===t.type&&Array.isArray(t.data))return l(t.data)}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return h(t),a(t<0?0:0|p(t))}function l(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let i=0;i<e;i+=1)r[i]=255&t[i];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(i,c.prototype),i}function p(t){if(t>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function b(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||W(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(t).length;default:if(n)return i?-1:z(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){let i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function m(t,e,r){const i=t[e];t[e]=t[r],t[r]=i}function v(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=c.from(e,i)),c.isBuffer(e))return 0===e.length?-1:y(t,e,r,i,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,i,n){let s,o=1,a=t.length,c=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,c/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){let i=-1;for(s=r;s<a;s++)if(u(t,s)===u(e,-1===i?0:s-i)){if(-1===i&&(i=s),s-i+1===c)return i*o}else-1!==i&&(s-=s-i),i=-1}else for(r+c>a&&(r=a-c),s=r;s>=0;s--){let r=!0;for(let i=0;i<c;i++)if(u(t,s+i)!==u(e,i)){r=!1;break}if(r)return s}return-1}function w(t,e,r,i){r=Number(r)||0;const n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;const s=e.length;let o;for(i>s/2&&(i=s/2),o=0;o<i;++o){const i=parseInt(e.substr(2*o,2),16);if(Y(i))return o;t[r+o]=i}return o}function _(t,e,r,i){return Z(z(e,t.length-r),t,r,i)}function E(t,e,r,i){return Z(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,i)}function S(t,e,r,i){return Z(q(e),t,r,i)}function A(t,e,r,i){return Z(function(t,e){let r,i,n;const s=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),i=r>>8,n=r%256,s.push(n),s.push(i);return s}(e,t.length-r),t,r,i)}function O(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function T(t,e,r){r=Math.min(t.length,r);const i=[];let n=e;for(;n<r;){const e=t[n];let s=null,o=e>239?4:e>223?3:e>191?2:1;if(n+o<=r){let r,i,a,c;switch(o){case 1:e<128&&(s=e);break;case 2:r=t[n+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(s=c));break;case 3:r=t[n+1],i=t[n+2],128==(192&r)&&128==(192&i)&&(c=(15&e)<<12|(63&r)<<6|63&i,c>2047&&(c<55296||c>57343)&&(s=c));break;case 4:r=t[n+1],i=t[n+2],a=t[n+3],128==(192&r)&&128==(192&i)&&128==(192&a)&&(c=(15&e)<<18|(63&r)<<12|(63&i)<<6|63&a,c>65535&&c<1114112&&(s=c))}}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(t){const e=t.length;if(e<=x)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=x));return r}(i)}e.kMaxLength=o,c.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),c.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(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(t,e,r){return function(t,e,r){return h(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},c.allocUnsafe=function(t){return f(t)},c.allocUnsafeSlow=function(t){return f(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(W(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),W(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,i=e.length;for(let n=0,s=Math.min(r,i);n<s;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const i=c.allocUnsafe(e);let n=0;for(r=0;r<t.length;++r){let e=t[r];if(W(e,Uint8Array))n+e.length>i.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(i,n)):Uint8Array.prototype.set.call(i,e,n);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(i,n)}n+=e.length}return i},c.byteLength=b,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},c.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},c.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},c.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?T(this,0,t):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(t,e,r,i,n){if(W(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;let s=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(e>>>=0);const a=Math.min(s,o),u=this.slice(i,n),h=t.slice(e,r);for(let t=0;t<a;++t)if(u[t]!==h[t]){s=u[t],o=h[t];break}return s<o?-1:o<s?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return v(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return v(this,t,e,r,!1)},c.prototype.write=function(t,e,r,i){if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return E(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function R(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}function P(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function I(t,e,r){const i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=e;i<r;++i)n+=J[t[i]];return n}function N(t,e,r){const i=t.slice(e,r);let n="";for(let t=0;t<i.length-1;t+=2)n+=String.fromCharCode(i[t]+256*i[t+1]);return n}function M(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,i,n,s){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}function L(t,e,r,i,n){F(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function C(t,e,r,i,n){F(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s>>=8,t[r+6]=s,s>>=8,t[r+5]=s,s>>=8,t[r+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function B(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,i,s){return e=+e,r>>>=0,s||B(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function U(t,e,r,i,s){return e=+e,r>>>=0,s||B(t,0,r,8),n.write(t,e,r,i,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const i=this.subarray(t,e);return Object.setPrototypeOf(i,c.prototype),i},c.prototype.readUintLE=c.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||M(t,e,this.length);let i=this[t],n=1,s=0;for(;++s<e&&(n*=256);)i+=this[t+s]*n;return i},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||M(t,e,this.length);let i=this[t+--e],n=1;for(;e>0&&(n*=256);)i+=this[t+--e]*n;return i},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||M(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||M(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||M(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=X((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const i=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,n=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(i)+(BigInt(n)<<BigInt(32))})),c.prototype.readBigUInt64BE=X((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const i=e*2**24+65536*this[++t]+256*this[++t]+this[++t],n=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)})),c.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||M(t,e,this.length);let i=this[t],n=1,s=0;for(;++s<e&&(n*=256);)i+=this[t+s]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*e)),i},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||M(t,e,this.length);let i=e,n=1,s=this[t+--i];for(;i>0&&(n*=256);)s+=this[t+--i]*n;return n*=128,s>=n&&(s-=Math.pow(2,8*e)),s},c.prototype.readInt8=function(t,e){return t>>>=0,e||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||M(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||M(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=X((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const i=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),c.prototype.readBigInt64BE=X((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const i=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),c.prototype.readFloatLE=function(t,e){return t>>>=0,e||M(t,4,this.length),n.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||M(t,4,this.length),n.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||M(t,8,this.length),n.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||M(t,8,this.length),n.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e>>>=0,r>>>=0,!i){k(this,t,e,r,Math.pow(2,8*r)-1,0)}let n=1,s=0;for(this[e]=255&t;++s<r&&(n*=256);)this[e+s]=t/n&255;return e+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,e,r,i){if(t=+t,e>>>=0,r>>>=0,!i){k(this,t,e,r,Math.pow(2,8*r)-1,0)}let n=r-1,s=1;for(this[e+n]=255&t;--n>=0&&(s*=256);)this[e+n]=t/s&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=X((function(t,e=0){return L(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=X((function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}let n=0,s=1,o=0;for(this[e]=255&t;++n<r&&(s*=256);)t<0&&0===o&&0!==this[e+n-1]&&(o=1),this[e+n]=(t/s>>0)-o&255;return e+r},c.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}let n=r-1,s=1,o=0;for(this[e+n]=255&t;--n>=0&&(s*=256);)t<0&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/s>>0)-o&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=X((function(t,e=0){return L(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=X((function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,i){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);const n=i-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,i):Uint8Array.prototype.set.call(t,this.subarray(r,i),e),n},c.prototype.fill=function(t,e,r,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===t.length){const e=t.charCodeAt(0);("utf8"===i&&e<128||"latin1"===i)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let n;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n<r;++n)this[n]=t;else{const s=c.isBuffer(t)?t:c.from(t,i),o=s.length;if(0===o)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(n=0;n<r-e;++n)this[n+e]=s[n%o]}return this};const j={};function K(t,e,r){j[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function V(t){let e="",r=t.length;const i="-"===t[0]?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function F(t,e,r,i,n,s){if(t>r||t<e){const i="bigint"==typeof e?"n":"";let n;throw n=s>3?0===e||e===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(s+1)}${i}`:`>= -(2${i} ** ${8*(s+1)-1}${i}) and < 2 ** ${8*(s+1)-1}${i}`:`>= ${e}${i} and <= ${r}${i}`,new j.ERR_OUT_OF_RANGE("value",n,t)}!function(t,e,r){H(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||G(e,t.length-(r+1))}(i,n,s)}function H(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function G(t,e,r){if(Math.floor(t)!==t)throw H(t,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}K("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),K("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),K("ERR_OUT_OF_RANGE",(function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=V(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=V(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i}),RangeError);const $=/[^+/0-9A-Za-z-_]/g;function z(t,e){let r;e=e||1/0;const i=t.length;let n=null;const s=[];for(let o=0;o<i;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function q(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace($,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Z(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function W(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function X(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},3973:(t,e,r)=>{var i=r(7834).Buffer,n=r(4851).Transform,s=r(214).s;function o(t){n.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(1285)(o,n),o.prototype.update=function(t,e,r){"string"==typeof t&&(t=i.from(t,e));var n=this._update(t);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},o.prototype.setAutoPadding=function(){},o.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},o.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},o.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},o.prototype._transform=function(t,e,r){var i;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){i=t}finally{r(i)}},o.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},o.prototype._finalOrDigest=function(t){var e=this.__final()||i.alloc(0);return t&&(e=this._toString(e,t,!0)),e},o.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new s(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(t);return r&&(i+=this._decoder.end()),i},t.exports=o},6162:(t,e,r)=>{"use strict";var i=r(1285),n=r(7993),s=r(1445),o=r(9065),a=r(3973);function c(t){a.call(this,"digest"),this._hash=t}i(c,a),c.prototype._update=function(t){this._hash.update(t)},c.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new n:"rmd160"===t||"ripemd160"===t?new s:new c(o(t))}},7554:(t,e,r)=>{"use strict";var i=e;i.version=r(763).i8,i.utils=r(8288),i.rand=r(2745),i.curve=r(8610),i.curves=r(1479),i.ec=r(8596),i.eddsa=r(9208)},8919:(t,e,r)=>{"use strict";var i=r(2197),n=r(8288),s=n.getNAF,o=n.getJSF,a=n.assert;function c(t,e){this.type=t,this.p=new i(e.p,16),this.red=e.prime?i.red(e.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=e.n&&new i(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var 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 u(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),i=s(e,1,this._bitLength),n=(1<<r.step+1)-(r.step%2==0?2:1);n/=3;var o,c,u=[];for(o=0;o<i.length;o+=r.step){c=0;for(var h=o+r.step-1;h>=o;h--)c=(c<<1)+i[h];u.push(c)}for(var f=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=n;d>0;d--){for(o=0;o<u.length;o++)(c=u[o])===d?l=l.mixedAdd(r.points[o]):c===-d&&(l=l.mixedAdd(r.points[o].neg()));f=f.add(l)}return f.toP()},c.prototype._wnafMul=function(t,e){var r=4,i=t._getNAFPoints(r);r=i.wnd;for(var n=i.points,o=s(e,r,this._bitLength),c=this.jpoint(null,null,null),u=o.length-1;u>=0;u--){for(var h=0;u>=0&&0===o[u];u--)h++;if(u>=0&&h++,c=c.dblp(h),u<0)break;var f=o[u];a(0!==f),c="affine"===t.type?f>0?c.mixedAdd(n[f-1>>1]):c.mixedAdd(n[-f-1>>1].neg()):f>0?c.add(n[f-1>>1]):c.add(n[-f-1>>1].neg())}return"affine"===t.type?c.toP():c},c.prototype._wnafMulAdd=function(t,e,r,i,n){var a,c,u,h=this._wnafT1,f=this._wnafT2,l=this._wnafT3,d=0;for(a=0;a<i;a++){var p=(u=e[a])._getNAFPoints(t);h[a]=p.wnd,f[a]=p.points}for(a=i-1;a>=1;a-=2){var b=a-1,g=a;if(1===h[b]&&1===h[g]){var m=[e[b],null,null,e[g]];0===e[b].y.cmp(e[g].y)?(m[1]=e[b].add(e[g]),m[2]=e[b].toJ().mixedAdd(e[g].neg())):0===e[b].y.cmp(e[g].y.redNeg())?(m[1]=e[b].toJ().mixedAdd(e[g]),m[2]=e[b].add(e[g].neg())):(m[1]=e[b].toJ().mixedAdd(e[g]),m[2]=e[b].toJ().mixedAdd(e[g].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=o(r[b],r[g]);for(d=Math.max(y[0].length,d),l[b]=new Array(d),l[g]=new Array(d),c=0;c<d;c++){var w=0|y[0][c],_=0|y[1][c];l[b][c]=v[3*(w+1)+(_+1)],l[g][c]=0,f[b]=m}}else l[b]=s(r[b],h[b],this._bitLength),l[g]=s(r[g],h[g],this._bitLength),d=Math.max(l[b].length,d),d=Math.max(l[g].length,d)}var E=this.jpoint(null,null,null),S=this._wnafT4;for(a=d;a>=0;a--){for(var A=0;a>=0;){var O=!0;for(c=0;c<i;c++)S[c]=0|l[c][a],0!==S[c]&&(O=!1);if(!O)break;A++,a--}if(a>=0&&A++,E=E.dblp(A),a<0)break;for(c=0;c<i;c++){var T=S[c];0!==T&&(T>0?u=f[c][T-1>>1]:T<0&&(u=f[c][-T-1>>1].neg()),E="affine"===u.type?E.mixedAdd(u):E.add(u))}}for(a=0;a<i;a++)f[a]=null;return n?E:E.toP()},c.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},c.prototype.decodePoint=function(t,e){t=n.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?a(t[t.length-1]%2==0):7===t[0]&&a(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(t){return this.encode(t,!0)},u.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},u.prototype.encode=function(t,e){return n.encode(this._encode(e),t)},u.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},u.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},u.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<e;n+=t){for(var s=0;s<t;s++)i=i.dbl();r.push(i)}return{step:t,points:r}},u.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)e[n]=e[n-1].add(i);return{wnd:t,points:e}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},7105:(t,e,r)=>{"use strict";var i=r(8288),n=r(2197),s=r(1285),o=r(8919),a=i.assert;function c(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,o.call(this,"edwards",t),this.a=new n(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function u(t,e,r,i,s){o.BasePoint.call(this,t,"projective"),null===e&&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(e,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(c,o),t.exports=c,c.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},c.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},c.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},c.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.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 new Error("invalid point");var c=a.fromRed().isOdd();return(e&&!c||!e&&c)&&(a=a.redNeg()),this.point(t,a)},c.prototype.pointFromY=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.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(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},c.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(n)},s(u,o.BasePoint),c.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},c.prototype.point=function(t,e,r,i){return new u(this,t,e,r,i)},u.fromJSON=function(t,e){return new u(t,e[0],e[1],e[2])},u.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)+">"},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),s=i.redAdd(e),o=s.redSub(r),a=i.redSub(e),c=n.redMul(o),u=s.redMul(a),h=n.redMul(a),f=o.redMul(s);return this.curve.point(c,u,f,h)},u.prototype._projDbl=function(){var t,e,r,i,n,s,o=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(i=this.curve._mulA(a)).redAdd(c);this.zOne?(t=o.redSub(a).redSub(c).redMul(u.redSub(this.curve.two)),e=u.redMul(i.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(n=this.z.redSqr(),s=u.redSub(n).redISub(n),t=o.redSub(a).redISub(c).redMul(s),e=u.redMul(i.redSub(c)),r=u.redMul(s))}else i=a.redAdd(c),n=this.curve._mulC(this.z).redSqr(),s=i.redSub(n).redSub(n),t=this.curve._mulC(o.redISub(i)).redMul(s),e=this.curve._mulC(i).redMul(a.redISub(c)),r=i.redMul(s);return this.curve.point(t,e,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),s=r.redSub(e),o=n.redSub(i),a=n.redAdd(i),c=r.redAdd(e),u=s.redMul(o),h=a.redMul(c),f=s.redMul(c),l=o.redMul(a);return this.curve.point(u,h,l,f)},u.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),n=i.redSqr(),s=this.x.redMul(t.x),o=this.y.redMul(t.y),a=this.curve.d.redMul(s).redMul(o),c=n.redSub(a),u=n.redAdd(a),h=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(s).redISub(o),f=i.redMul(c).redMul(h);return this.curve.twisted?(e=i.redMul(u).redMul(o.redSub(this.curve._mulA(s))),r=c.redMul(u)):(e=i.redMul(u).redMul(o.redSub(s)),r=this.curve._mulC(c).redMul(u)),this.curve.point(f,e,r)},u.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},u.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},u.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},u.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},8610:(t,e,r)=>{"use strict";var i=e;i.base=r(8919),i.short=r(7715),i.mont=r(5125),i.edwards=r(7105)},5125:(t,e,r)=>{"use strict";var i=r(2197),n=r(1285),s=r(8919),o=r(8288);function a(t){s.call(this,"mont",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.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 c(t,e,r){s.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(e,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),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},n(c,s.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(o.toArray(t,e),1)},a.prototype.point=function(t,e){return new c(this,t,e)},a.prototype.pointFromJSON=function(t){return c.fromJSON(this,t)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(t,e){return new c(t,e[0],e[1]||t.one)},c.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)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),n=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),s=t.x.redSub(t.z).redMul(r),o=n.redMul(i),a=e.z.redMul(s.redAdd(o).redSqr()),c=e.x.redMul(s.redISub(o).redSqr());return this.curve.point(a,c)},c.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.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},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},7715:(t,e,r)=>{"use strict";var i=r(8288),n=r(2197),s=r(1285),o=r(8919),a=i.assert;function c(t){o.call(this,"short",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(t,e,r,i){o.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(e,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 h(t,e,r,i){o.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(e,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(c,o),t.exports=c,c.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new n(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=(e=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(t.lambda)r=new n(t.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(e))?r=s[0]:(r=s[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new n(t.a,16),b:new n(t.b,16)}})):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:n.mont(t),r=new n(2).toRed(e).redInvm(),i=r.redNeg(),s=new n(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(s).fromRed(),i.redSub(s).fromRed()]},c.prototype._getEndoBasis=function(t){for(var e,r,i,s,o,a,c,u,h,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,d=this.n.clone(),p=new n(1),b=new n(0),g=new n(0),m=new n(1),v=0;0!==l.cmpn(0);){var y=d.div(l);u=d.sub(y.mul(l)),h=g.sub(y.mul(p));var w=m.sub(y.mul(b));if(!i&&u.cmp(f)<0)e=c.neg(),r=p,i=u.neg(),s=h;else if(i&&2==++v)break;c=u,d=l,l=u,g=p,p=h,m=b,b=w}o=u.neg(),a=h;var _=i.sqr().add(s.sqr());return o.sqr().add(a.sqr()).cmp(_)>=0&&(o=e,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}]},c.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),c=n.mul(r.b),u=s.mul(i.b);return{k1:t.sub(o).sub(a),k2:c.add(u).neg()}},c.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var s=i.fromRed().isOdd();return(e&&!s||!e&&s)&&(i=i.redNeg()),this.point(t,i)},c.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},c.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s<t.length;s++){var o=this._endoSplit(e[s]),a=t[s],c=a._getBeta();o.k1.negative&&(o.k1.ineg(),a=a.neg(!0)),o.k2.negative&&(o.k2.ineg(),c=c.neg(!0)),i[2*s]=a,i[2*s+1]=c,n[2*s]=o.k1,n[2*s+1]=o.k2}for(var u=this._wnafMulAdd(1,i,n,2*s,r),h=0;h<2*s;h++)i[h]=null,n[h]=null;return u},s(u,o.BasePoint),c.prototype.point=function(t,e,r){return new u(this,t,e,r)},c.prototype.pointFromJSON=function(t,e){return u.fromJSON(this,t,e)},u.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,i=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}},u.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]},u.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);if(!e[2])return i;function n(e){return t.point(e[0],e[1],r)}var s=e[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},u.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)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},u.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).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)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(t){return t=new n(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},u.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},u.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},u.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.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 e},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},s(h,o.BasePoint),c.prototype.jpoint=function(t,e,r){return new h(this,t,e,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),c=s.redSub(o);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),h=u.redMul(a),f=i.redMul(u),l=c.redSqr().redIAdd(h).redISub(f).redISub(f),d=c.redMul(f.redISub(l)).redISub(s.redMul(h)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(l,d,p)},h.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,s=t.y.redMul(e).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 c=o.redSqr(),u=c.redMul(o),h=r.redMul(c),f=a.redSqr().redIAdd(u).redISub(h).redISub(h),l=a.redMul(h.redISub(f)).redISub(n.redMul(u)),d=this.z.redMul(o);return this.curve.jpoint(f,l,d)},h.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,s=this.x,o=this.y,a=this.z,c=a.redSqr().redSqr(),u=o.redAdd(o);for(e=0;e<t;e++){var h=s.redSqr(),f=u.redSqr(),l=f.redSqr(),d=h.redAdd(h).redIAdd(h).redIAdd(i.redMul(c)),p=s.redMul(f),b=d.redSqr().redISub(p.redAdd(p)),g=p.redISub(b),m=d.redMul(g);m=m.redIAdd(m).redISub(l);var v=u.redMul(a);e+1<t&&(c=c.redMul(l)),s=b,a=v,u=m}return this.curve.jpoint(s,u.redMul(n),a)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var 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),c=a.redSqr().redISub(o).redISub(o),u=s.redIAdd(s);u=(u=u.redIAdd(u)).redIAdd(u),t=c,e=a.redMul(o.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),f=this.y.redSqr(),l=f.redSqr(),d=this.x.redAdd(f).redSqr().redISub(h).redISub(l);d=d.redIAdd(d);var p=h.redAdd(h).redIAdd(h),b=p.redSqr(),g=l.redIAdd(l);g=(g=g.redIAdd(g)).redIAdd(g),t=b.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},h.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var 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),c=a.redSqr().redISub(o).redISub(o);t=c;var u=s.redIAdd(s);u=(u=u.redIAdd(u)).redIAdd(u),e=a.redMul(o.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),f=this.y.redSqr(),l=this.x.redMul(f),d=this.x.redSub(h).redMul(this.x.redAdd(h));d=d.redAdd(d).redIAdd(d);var p=l.redIAdd(l),b=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(h);var g=f.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=d.redMul(p.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,r)},h.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),s=e.redSqr(),o=r.redSqr(),a=s.redAdd(s).redIAdd(s).redIAdd(t.redMul(n)),c=e.redAdd(e),u=(c=c.redIAdd(c)).redMul(o),h=a.redSqr().redISub(u.redAdd(u)),f=u.redISub(h),l=o.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=a.redMul(f).redISub(l),p=r.redAdd(r).redMul(i);return this.curve.jpoint(h,d,p)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),i=e.redSqr(),n=t.redAdd(t).redIAdd(t),s=n.redSqr(),o=this.x.redAdd(e).redSqr().redISub(t).redISub(i),a=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(s)).redSqr(),c=i.redIAdd(i);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=n.redIAdd(o).redSqr().redISub(s).redISub(a).redISub(c),h=e.redMul(u);h=(h=h.redIAdd(h)).redIAdd(h);var f=this.x.redMul(a).redISub(h);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.y.redMul(u.redMul(c.redISub(u)).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(f,l,d)},h.prototype.mul=function(t,e){return t=new n(t,e),this.curve._wnafMul(this,t)},h.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var i=e.redMul(this.z),n=r.redMul(t.z);return 0===this.y.redMul(n).redISub(t.y.redMul(i)).cmpn(0)},h.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var i=t.clone(),n=this.curve.redN.redMul(e);;){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}},h.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)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},1479:(t,e,r)=>{"use strict";var i,n=e,s=r(3506),o=r(8610),a=r(8288).assert;function c(t){"short"===t.type?this.curve=new o.short(t):"edwards"===t.type?this.curve=new o.edwards(t):this.curve=new o.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new c(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=c,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:s.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:s.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:s.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:s.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:s.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:s.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:s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r(7983)}catch(t){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:s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},8596:(t,e,r)=>{"use strict";var i=r(2197),n=r(8873),s=r(8288),o=r(1479),a=r(2745),c=s.assert,u=r(2307),h=r(1798);function f(t){if(!(this instanceof f))return new f(t);"string"==typeof t&&(c(Object.prototype.hasOwnProperty.call(o,t),"Unknown curve "+t),t=o[t]),t instanceof o.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=f,f.prototype.keyPair=function(t){return new u(this,t)},f.prototype.keyFromPrivate=function(t,e){return u.fromPrivate(this,t,e)},f.prototype.keyFromPublic=function(t,e){return u.fromPublic(this,t,e)},f.prototype.genKeyPair=function(t){t||(t={});for(var e=new n({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),s=this.n.sub(new i(2));;){var o=new i(e.generate(r));if(!(o.cmp(s)>0))return o.iaddn(1),this.keyFromPrivate(o)}},f.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},f.prototype.sign=function(t,e,r,s){"object"==typeof r&&(s=r,r=null),s||(s={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i(t,16));for(var o=this.n.byteLength(),a=e.getPrivate().toArray("be",o),c=t.toArray("be",o),u=new n({hash:this.hash,entropy:a,nonce:c,pers:s.pers,persEnc:s.persEnc||"utf8"}),f=this.n.sub(new i(1)),l=0;;l++){var d=s.k?s.k(l):new i(u.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(f)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var b=p.getX(),g=b.umod(this.n);if(0!==g.cmpn(0)){var m=d.invm(this.n).mul(g.mul(e.getPrivate()).iadd(t));if(0!==(m=m.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==b.cmp(g)?2:0);return s.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),v^=1),new h({r:g,s:m,recoveryParam:v})}}}}}},f.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n);var s=(e=new h(e,"hex")).r,o=e.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,c=o.invm(this.n),u=c.mul(t).umod(this.n),f=c.mul(s).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),f)).isInfinity()&&a.eqXToP(s):!(a=this.g.mulAdd(u,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(s)},f.prototype.recoverPubKey=function(t,e,r,n){c((3&r)===r,"The recovery param is more than two bits"),e=new h(e,n);var s=this.n,o=new i(t),a=e.r,u=e.s,f=1&r,l=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),f):this.curve.pointFromX(a,f);var d=e.r.invm(s),p=s.sub(o).mul(d).umod(s),b=u.mul(d).umod(s);return this.g.mulAdd(p,a,b)},f.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new h(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(t,e,n)}catch(t){continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},2307:(t,e,r)=>{"use strict";var i=r(2197),n=r(8288).assert;function s(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=s,s.fromPublic=function(t,e,r){return e instanceof s?e:new s(t,{pub:e,pubEnc:r})},s.fromPrivate=function(t,e,r){return e instanceof s?e:new s(t,{priv:e,privEnc:r})},s.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},s.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},s.prototype._importPrivate=function(t,e){this.priv=new i(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},s.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?n(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},s.prototype.derive=function(t){return t.validate()||n(t.validate(),"public point not validated"),t.mul(this.priv).getX()},s.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},s.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},s.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},1798:(t,e,r)=>{"use strict";var i=r(2197),n=r(8288),s=n.assert;function o(t,e){if(t instanceof o)return t;this._importDER(t,e)||(s(t.r&&t.s,"Signature without r or s"),this.r=new i(t.r,16),this.s=new i(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function c(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,s=0,o=e.place;s<i;s++,o++)n<<=8,n|=t[o],n>>>=0;return!(n<=127)&&(e.place=o,n)}function u(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function h(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=o,o.prototype._importDER=function(t,e){t=n.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;var s=c(t,r);if(!1===s)return!1;if(s+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=c(t,r);if(!1===o)return!1;var u=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var h=c(t,r);if(!1===h)return!1;if(t.length!==h+r.place)return!1;var f=t.slice(r.place,h+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new i(u),this.s=new i(f),this.recoveryParam=null,!0},o.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];h(i,e.length),(i=i.concat(e)).push(2),h(i,r.length);var s=i.concat(r),o=[48];return h(o,s.length),o=o.concat(s),n.encode(o,t)}},9208:(t,e,r)=>{"use strict";var i=r(3506),n=r(1479),s=r(8288),o=s.assert,a=s.parseBytes,c=r(851),u=r(6117);function h(t){if(o("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof h))return new h(t);t=n[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=i.sha512}t.exports=h,h.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),n=this.g.mul(i),s=this.encodePoint(n),o=this.hashInt(s,r.pubBytes(),t).mul(r.priv()),c=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:c,Rencoded:s})},h.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var i=this.keyFromPublic(r),n=this.hashInt(e.Rencoded(),i.pubBytes(),t),s=this.g.mul(e.S());return e.R().add(i.pub().mul(n)).eq(s)},h.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return s.intFromLE(t.digest()).umod(this.curve.n)},h.prototype.keyFromPublic=function(t){return c.fromPublic(this,t)},h.prototype.keyFromSecret=function(t){return c.fromSecret(this,t)},h.prototype.makeSignature=function(t){return t instanceof u?t:new u(this,t)},h.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},h.prototype.decodePoint=function(t){var e=(t=s.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),i=0!=(128&t[e]),n=s.intFromLE(r);return this.curve.pointFromY(n,i)},h.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},h.prototype.decodeInt=function(t){return s.intFromLE(t)},h.prototype.isPoint=function(t){return t instanceof this.pointClass}},851:(t,e,r)=>{"use strict";var i=r(8288),n=i.assert,s=i.parseBytes,o=i.cachedProperty;function a(t,e){this.eddsa=t,this._secret=s(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=s(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},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 t=this.eddsa,e=this.hash(),r=t.encodingLength-1,i=e.slice(0,t.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(t){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return n(this._secret,"KeyPair is public only"),i.encode(this.secret(),t)},a.prototype.getPublic=function(t){return i.encode(this.pubBytes(),t)},t.exports=a},6117:(t,e,r)=>{"use strict";var i=r(2197),n=r(8288),s=n.assert,o=n.cachedProperty,a=n.parseBytes;function c(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),s(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof i&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}o(c,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),o(c,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),o(c,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),o(c,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},t.exports=c},7983:t=>{t.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"]]}}},8288:(t,e,r)=>{"use strict";var i=e,n=r(2197),s=r(9561),o=r(3022);i.assert=s,i.toArray=o.toArray,i.zero2=o.zero2,i.toHex=o.toHex,i.encode=o.encode,i.getNAF=function(t,e,r){var i=new Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<<e+1,s=t.clone(),o=0;o<i.length;o++){var a,c=s.andln(n-1);s.isOdd()?(a=c>(n>>1)-1?(n>>1)-c:c,s.isubn(a)):a=0,i[o]=a,s.iushrn(1)}return i},i.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,s=0;t.cmpn(-n)>0||e.cmpn(-s)>0;){var o,a,c=t.andln(3)+n&3,u=e.andln(3)+s&3;3===c&&(c=-1),3===u&&(u=-1),o=0==(1&c)?0:3!==(i=t.andln(7)+n&7)&&5!==i||2!==u?c:-c,r[0].push(o),a=0==(1&u)?0:3!==(i=e.andln(7)+s&7)&&5!==i||2!==c?u:-u,r[1].push(a),2*n===o+1&&(n=1-n),2*s===a+1&&(s=1-s),t.iushrn(1),e.iushrn(1)}return r},i.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(t){return"string"==typeof t?i.toArray(t,"hex"):t},i.intFromLE=function(t){return new n(t,"hex","le")}},2699:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,s),i(r)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}b(t,e,s,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&b(t,"error",e,r)}(t,n,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function u(t,e,r,i){var n,s,o,u;if(a(r),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),void 0===o)o=s[e]=r,++t._eventsCount;else if("function"==typeof o?o=s[e]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=c(t))>0&&o.length>n&&!o.warned){o.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=o.length,u=h,console&&console.warn&&console.warn(u)}return t}function h(){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 f(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=h.bind(i);return n.listener=r,i.wrapFn=n,n}function l(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(n):p(n,n.length)}function d(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function b(t,e,r,i){if("function"==typeof t.on)i.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function n(s){i.once&&t.removeEventListener(e,n),r(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(t){if("number"!=typeof t||t<0||n(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");o=t}}),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(t){if("number"!=typeof t||t<0||n(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[t];if(void 0===c)return!1;if("function"==typeof c)i(c,this,e);else{var u=c.length,h=p(c,u);for(r=0;r<u;++r)i(h[r],this,e)}return!0},s.prototype.addListener=function(t,e){return u(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return u(this,t,e,!0)},s.prototype.once=function(t,e){return a(e),this.on(t,f(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,f(this,t,e)),this},s.prototype.removeListener=function(t,e){var r,i,n,s,o;if(a(e),void 0===(i=this._events))return this;if(void 0===(r=i[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(n=-1,s=r.length-1;s>=0;s--)if(r[s]===e||r[s].listener===e){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,n),1===r.length&&(i[t]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",t,o||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,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[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),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(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},s.prototype.listeners=function(t){return l(this,t,!0)},s.prototype.rawListeners=function(t){return l(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},s.prototype.listenerCount=d,s.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},5695:t=>{"use strict";t.exports=function(t,e){e||(e={}),"function"==typeof e&&(e={cmp:e});var r,i="boolean"==typeof e.cycles&&e.cycles,n=e.cmp&&(r=e.cmp,function(t){return function(e,i){var n={key:e,value:t[e]},s={key:i,value:t[i]};return r(n,s)}}),s=[];return function t(e){if(e&&e.toJSON&&"function"==typeof e.toJSON&&(e=e.toJSON()),void 0!==e){if("number"==typeof e)return isFinite(e)?""+e:"null";if("object"!=typeof e)return JSON.stringify(e);var r,o;if(Array.isArray(e)){for(o="[",r=0;r<e.length;r++)r&&(o+=","),o+=t(e[r])||"null";return o+"]"}if(null===e)return"null";if(-1!==s.indexOf(e)){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var a=s.push(e)-1,c=Object.keys(e).sort(n&&n(e));for(o="",r=0;r<c.length;r++){var u=c[r],h=t(e[u]);h&&(o&&(o+=","),o+=JSON.stringify(u)+":"+h)}return s.splice(a,1),"{"+o+"}"}}(t)}},4485:(t,e,r)=>{"use strict";var i=r(7834).Buffer,n=r(7525).Transform;function s(t){n.call(this),this._block=i.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(1285)(s,n),s.prototype._transform=function(t,e,r){var i=null;try{this.update(t,e)}catch(t){i=t}r(i)},s.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},s.prototype.update=function(t,e){if(function(t,e){if(!i.isBuffer(t)&&"string"!=typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");i.isBuffer(t)||(t=i.from(t,e));for(var r=this._block,n=0;this._blockOffset+t.length-n>=this._blockSize;){for(var s=this._blockOffset;s<this._blockSize;)r[s++]=t[n++];this._update(),this._blockOffset=0}for(;n<t.length;)r[this._blockOffset++]=t[n++];for(var o=0,a=8*t.length;a>0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},s.prototype._update=function(){throw new Error("_update is not implemented")},s.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},s.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=s},3506:(t,e,r)=>{var i=e;i.utils=r(212),i.common=r(4495),i.sha=r(5530),i.ripemd=r(1396),i.hmac=r(5047),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},4495:(t,e,r)=>{"use strict";var i=r(212),n=r(9561);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}e.BlockHash=s,s.prototype.update=function(t,e){if(t=i.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=i.join32(t,0,t.length-r,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},s.prototype.digest=function(t){return this.update(this._pad()),n(null===this.pending),this._digest(t)},s.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(t<<=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++]=t>>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,s=8;s<this.padLength;s++)i[n++]=0;return i}},5047:(t,e,r)=>{"use strict";var i=r(212),n=r(9561);function s(t,e,r){if(!(this instanceof s))return new s(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(e,r))}t.exports=s,s.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),n(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},s.prototype.update=function(t,e){return this.inner.update(t,e),this},s.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},1396:(t,e,r)=>{"use strict";var i=r(212),n=r(4495),s=i.rotl32,o=i.sum32,a=i.sum32_3,c=i.sum32_4,u=n.BlockHash;function h(){if(!(this instanceof h))return new h;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function l(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}i.inherits(h,u),e.ripemd160=h,h.blockSize=512,h.outSize=160,h.hmacStrength=192,h.padLength=64,h.prototype._update=function(t,e){for(var r=this.h[0],i=this.h[1],n=this.h[2],u=this.h[3],h=this.h[4],v=r,y=i,w=n,_=u,E=h,S=0;S<80;S++){var A=o(s(c(r,f(S,i,n,u),t[p[S]+e],l(S)),g[S]),h);r=h,h=u,u=s(n,10),n=i,i=A,A=o(s(c(v,f(79-S,y,w,_),t[b[S]+e],d(S)),m[S]),E),v=E,E=_,_=s(w,10),w=y,y=A}A=a(this.h[1],n,_),this.h[1]=a(this.h[2],u,E),this.h[2]=a(this.h[3],h,v),this.h[3]=a(this.h[4],r,y),this.h[4]=a(this.h[0],i,w),this.h[0]=A},h.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"little"):i.split32(this.h,"little")};var p=[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],b=[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],g=[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],m=[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]},5530:(t,e,r)=>{"use strict";e.sha1=r(5079),e.sha224=r(3823),e.sha256=r(8032),e.sha384=r(5328),e.sha512=r(168)},5079:(t,e,r)=>{"use strict";var i=r(212),n=r(4495),s=r(713),o=i.rotl32,a=i.sum32,c=i.sum32_5,u=s.ft_1,h=n.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(l,h),t.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+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],h=this.h[2],l=this.h[3],d=this.h[4];for(i=0;i<r.length;i++){var p=~~(i/20),b=c(o(n,5),u(p,s,h,l),d,r[i],f[p]);d=l,l=h,h=o(s,30),s=n,n=b}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],s),this.h[2]=a(this.h[2],h),this.h[3]=a(this.h[3],l),this.h[4]=a(this.h[4],d)},l.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},3823:(t,e,r)=>{"use strict";var i=r(212),n=r(8032);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(s,n),t.exports=s,s.blockSize=512,s.outSize=224,s.hmacStrength=192,s.padLength=64,s.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},8032:(t,e,r)=>{"use strict";var i=r(212),n=r(4495),s=r(713),o=r(9561),a=i.sum32,c=i.sum32_4,u=i.sum32_5,h=s.ch32,f=s.maj32,l=s.s0_256,d=s.s1_256,p=s.g0_256,b=s.g1_256,g=n.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}i.inherits(v,g),t.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=c(b(r[i-2]),r[i-7],p(r[i-15]),r[i-16]);var n=this.h[0],s=this.h[1],g=this.h[2],m=this.h[3],v=this.h[4],y=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=u(_,d(v),h(v,y,w),this.k[i],r[i]),S=a(l(n),f(n,s,g));_=w,w=y,y=v,v=a(m,E),m=g,g=s,s=n,n=a(E,S)}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],s),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],m),this.h[4]=a(this.h[4],v),this.h[5]=a(this.h[5],y),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},v.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},5328:(t,e,r)=>{"use strict";var i=r(212),n=r(168);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(s,n),t.exports=s,s.blockSize=1024,s.outSize=384,s.hmacStrength=192,s.padLength=128,s.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},168:(t,e,r)=>{"use strict";var i=r(212),n=r(4495),s=r(9561),o=i.rotr64_hi,a=i.rotr64_lo,c=i.shr64_hi,u=i.shr64_lo,h=i.sum64,f=i.sum64_hi,l=i.sum64_lo,d=i.sum64_4_hi,p=i.sum64_4_lo,b=i.sum64_5_hi,g=i.sum64_5_lo,m=n.BlockHash,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function y(){if(!(this instanceof y))return new y;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function w(t,e,r,i,n){var s=t&r^~t&n;return s<0&&(s+=4294967296),s}function _(t,e,r,i,n,s){var o=e&i^~e&s;return o<0&&(o+=4294967296),o}function E(t,e,r,i,n){var s=t&r^t&n^r&n;return s<0&&(s+=4294967296),s}function S(t,e,r,i,n,s){var o=e&i^e&s^i&s;return o<0&&(o+=4294967296),o}function A(t,e){var r=o(t,e,28)^o(e,t,2)^o(e,t,7);return r<0&&(r+=4294967296),r}function O(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function T(t,e){var r=o(t,e,14)^o(t,e,18)^o(e,t,9);return r<0&&(r+=4294967296),r}function x(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function R(t,e){var r=o(t,e,1)^o(t,e,8)^c(t,e,7);return r<0&&(r+=4294967296),r}function P(t,e){var r=a(t,e,1)^a(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=o(t,e,19)^o(e,t,29)^c(t,e,6);return r<0&&(r+=4294967296),r}function N(t,e){var r=a(t,e,19)^a(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}i.inherits(y,m),t.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(t,e){for(var r=this.W,i=0;i<32;i++)r[i]=t[e+i];for(;i<r.length;i+=2){var n=I(r[i-4],r[i-3]),s=N(r[i-4],r[i-3]),o=r[i-14],a=r[i-13],c=R(r[i-30],r[i-29]),u=P(r[i-30],r[i-29]),h=r[i-32],f=r[i-31];r[i]=d(n,s,o,a,c,u,h,f),r[i+1]=p(n,s,o,a,c,u,h,f)}},y.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,i=this.h[0],n=this.h[1],o=this.h[2],a=this.h[3],c=this.h[4],u=this.h[5],d=this.h[6],p=this.h[7],m=this.h[8],v=this.h[9],y=this.h[10],R=this.h[11],P=this.h[12],I=this.h[13],N=this.h[14],M=this.h[15];s(this.k.length===r.length);for(var k=0;k<r.length;k+=2){var L=N,C=M,B=T(m,v),D=x(m,v),U=w(m,v,y,R,P),j=_(m,v,y,R,P,I),K=this.k[k],V=this.k[k+1],F=r[k],H=r[k+1],G=b(L,C,B,D,U,j,K,V,F,H),$=g(L,C,B,D,U,j,K,V,F,H);L=A(i,n),C=O(i,n),B=E(i,n,o,a,c),D=S(i,n,o,a,c,u);var z=f(L,C,B,D),q=l(L,C,B,D);N=P,M=I,P=y,I=R,y=m,R=v,m=f(d,p,G,$),v=l(p,p,G,$),d=c,p=u,c=o,u=a,o=i,a=n,i=f(G,$,z,q),n=l(G,$,z,q)}h(this.h,0,i,n),h(this.h,2,o,a),h(this.h,4,c,u),h(this.h,6,d,p),h(this.h,8,m,v),h(this.h,10,y,R),h(this.h,12,P,I),h(this.h,14,N,M)},y.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},713:(t,e,r)=>{"use strict";var i=r(212).rotr32;function n(t,e,r){return t&e^~t&r}function s(t,e,r){return t&e^t&r^e&r}function o(t,e,r){return t^e^r}e.ft_1=function(t,e,r,i){return 0===t?n(e,r,i):1===t||3===t?o(e,r,i):2===t?s(e,r,i):void 0},e.ch32=n,e.maj32=s,e.p32=o,e.s0_256=function(t){return i(t,2)^i(t,13)^i(t,22)},e.s1_256=function(t){return i(t,6)^i(t,11)^i(t,25)},e.g0_256=function(t){return i(t,7)^i(t,18)^t>>>3},e.g1_256=function(t){return i(t,17)^i(t,19)^t>>>10}},212:(t,e,r)=>{"use strict";var i=r(9561),n=r(1285);function s(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function c(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=n,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var i=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);o<128?r[i++]=o:o<2048?(r[i++]=o>>6|192,r[i++]=63&o|128):s(t,n)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++n)),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=63&o|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=63&o|128)}else for(n=0;n<t.length;n++)r[n]=0|t[n];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},e.htonl=o,e.toHex32=function(t,e){for(var r="",i=0;i<t.length;i++){var n=t[i];"little"===e&&(n=o(n)),r+=c(n.toString(16))}return r},e.zero2=a,e.zero8=c,e.join32=function(t,e,r,n){var s=r-e;i(s%4==0);for(var o=new Array(s/4),a=0,c=e;a<o.length;a++,c+=4){var u;u="big"===n?t[c]<<24|t[c+1]<<16|t[c+2]<<8|t[c+3]:t[c+3]<<24|t[c+2]<<16|t[c+1]<<8|t[c],o[a]=u>>>0}return o},e.split32=function(t,e){for(var r=new Array(4*t.length),i=0,n=0;i<t.length;i++,n+=4){var s=t[i];"big"===e?(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},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,i){return t+e+r+i>>>0},e.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},e.sum64=function(t,e,r,i){var n=t[e],s=i+t[e+1]>>>0,o=(s<i?1:0)+r+n;t[e]=o>>>0,t[e+1]=s},e.sum64_hi=function(t,e,r,i){return(e+i>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,i){return e+i>>>0},e.sum64_4_hi=function(t,e,r,i,n,s,o,a){var c=0,u=e;return c+=(u=u+i>>>0)<e?1:0,c+=(u=u+s>>>0)<s?1:0,t+r+n+o+(c+=(u=u+a>>>0)<a?1:0)>>>0},e.sum64_4_lo=function(t,e,r,i,n,s,o,a){return e+i+s+a>>>0},e.sum64_5_hi=function(t,e,r,i,n,s,o,a,c,u){var h=0,f=e;return h+=(f=f+i>>>0)<e?1:0,h+=(f=f+s>>>0)<s?1:0,h+=(f=f+a>>>0)<a?1:0,t+r+n+o+c+(h+=(f=f+u>>>0)<u?1:0)>>>0},e.sum64_5_lo=function(t,e,r,i,n,s,o,a,c,u){return e+i+s+a+u>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},8873:(t,e,r)=>{"use strict";var i=r(3506),n=r(3022),s=r(9561);function o(t){if(!(this instanceof o))return new o(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=n.toArray(t.entropy,t.entropyEnc||"hex"),r=n.toArray(t.nonce,t.nonceEnc||"hex"),i=n.toArray(t.pers,t.persEnc||"hex");s(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}t.exports=o,o.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new 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=281474976710656},o.prototype._hmac=function(){return new i.hmac(this.hash,this.K)},o.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},o.prototype.reseed=function(t,e,r,i){"string"!=typeof e&&(i=r,r=e,e=null),t=n.toArray(t,e),r=n.toArray(r,i),s(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},o.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=n.toArray(r,i||"hex"),this._update(r));for(var s=[];s.length<t;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var o=s.slice(0,t);return this._update(r),this._reseed++,n.encode(o,e)}},2333:(t,e)=>{e.read=function(t,e,r,i,n){var s,o,a=8*n-i-1,c=(1<<a)-1,u=c>>1,h=-7,f=r?n-1:0,l=r?-1:1,d=t[e+f];for(f+=l,s=d&(1<<-h)-1,d>>=-h,h+=a;h>0;s=256*s+t[e+f],f+=l,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=i;h>0;o=256*o+t[e+f],f+=l,h-=8);if(0===s)s=1-u;else{if(s===c)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,i),s-=u}return(d?-1:1)*o*Math.pow(2,s-i)},e.write=function(t,e,r,i,n,s){var o,a,c,u=8*s-n-1,h=(1<<u)-1,f=h>>1,l=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:s-1,p=i?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),(e+=o+f>=1?l/c:l*Math.pow(2,1-f))*c>=2&&(o++,c/=2),o+f>=h?(a=0,o=h):o+f>=1?(a=(e*c-1)*Math.pow(2,n),o+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,n),o=0));n>=8;t[r+d]=255&a,d+=p,a/=256,n-=8);for(o=o<<n|a,u+=n;u>0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*b}},1285:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},7993:(t,e,r)=>{"use strict";var i=r(1285),n=r(4485),s=r(7834).Buffer,o=new Array(16);function a(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(t,e){return t<<e|t>>>32-e}function u(t,e,r,i,n,s,o){return c(t+(e&r|~e&i)+n+s|0,o)+e|0}function h(t,e,r,i,n,s,o){return c(t+(e&i|r&~i)+n+s|0,o)+e|0}function f(t,e,r,i,n,s,o){return c(t+(e^r^i)+n+s|0,o)+e|0}function l(t,e,r,i,n,s,o){return c(t+(r^(e|~i))+n+s|0,o)+e|0}i(a,n),a.prototype._update=function(){for(var t=o,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,i=this._b,n=this._c,s=this._d;r=u(r,i,n,s,t[0],3614090360,7),s=u(s,r,i,n,t[1],3905402710,12),n=u(n,s,r,i,t[2],606105819,17),i=u(i,n,s,r,t[3],3250441966,22),r=u(r,i,n,s,t[4],4118548399,7),s=u(s,r,i,n,t[5],1200080426,12),n=u(n,s,r,i,t[6],2821735955,17),i=u(i,n,s,r,t[7],4249261313,22),r=u(r,i,n,s,t[8],1770035416,7),s=u(s,r,i,n,t[9],2336552879,12),n=u(n,s,r,i,t[10],4294925233,17),i=u(i,n,s,r,t[11],2304563134,22),r=u(r,i,n,s,t[12],1804603682,7),s=u(s,r,i,n,t[13],4254626195,12),n=u(n,s,r,i,t[14],2792965006,17),r=h(r,i=u(i,n,s,r,t[15],1236535329,22),n,s,t[1],4129170786,5),s=h(s,r,i,n,t[6],3225465664,9),n=h(n,s,r,i,t[11],643717713,14),i=h(i,n,s,r,t[0],3921069994,20),r=h(r,i,n,s,t[5],3593408605,5),s=h(s,r,i,n,t[10],38016083,9),n=h(n,s,r,i,t[15],3634488961,14),i=h(i,n,s,r,t[4],3889429448,20),r=h(r,i,n,s,t[9],568446438,5),s=h(s,r,i,n,t[14],3275163606,9),n=h(n,s,r,i,t[3],4107603335,14),i=h(i,n,s,r,t[8],1163531501,20),r=h(r,i,n,s,t[13],2850285829,5),s=h(s,r,i,n,t[2],4243563512,9),n=h(n,s,r,i,t[7],1735328473,14),r=f(r,i=h(i,n,s,r,t[12],2368359562,20),n,s,t[5],4294588738,4),s=f(s,r,i,n,t[8],2272392833,11),n=f(n,s,r,i,t[11],1839030562,16),i=f(i,n,s,r,t[14],4259657740,23),r=f(r,i,n,s,t[1],2763975236,4),s=f(s,r,i,n,t[4],1272893353,11),n=f(n,s,r,i,t[7],4139469664,16),i=f(i,n,s,r,t[10],3200236656,23),r=f(r,i,n,s,t[13],681279174,4),s=f(s,r,i,n,t[0],3936430074,11),n=f(n,s,r,i,t[3],3572445317,16),i=f(i,n,s,r,t[6],76029189,23),r=f(r,i,n,s,t[9],3654602809,4),s=f(s,r,i,n,t[12],3873151461,11),n=f(n,s,r,i,t[15],530742520,16),r=l(r,i=f(i,n,s,r,t[2],3299628645,23),n,s,t[0],4096336452,6),s=l(s,r,i,n,t[7],1126891415,10),n=l(n,s,r,i,t[14],2878612391,15),i=l(i,n,s,r,t[5],4237533241,21),r=l(r,i,n,s,t[12],1700485571,6),s=l(s,r,i,n,t[3],2399980690,10),n=l(n,s,r,i,t[10],4293915773,15),i=l(i,n,s,r,t[1],2240044497,21),r=l(r,i,n,s,t[8],1873313359,6),s=l(s,r,i,n,t[15],4264355552,10),n=l(n,s,r,i,t[6],2734768916,15),i=l(i,n,s,r,t[13],1309151649,21),r=l(r,i,n,s,t[4],4149444226,6),s=l(s,r,i,n,t[11],3174756917,10),n=l(n,s,r,i,t[2],718787259,15),i=l(i,n,s,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+s|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=s.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=a},9561:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},3022:(t,e)=>{"use strict";var r=e;function i(t){return 1===t.length?"0"+t:t}function n(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e}r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var i=0;i<t.length;i++)r[i]=0|t[i];return r}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(i=0;i<t.length;i++){var n=t.charCodeAt(i),s=n>>8,o=255&n;s?r.push(s,o):r.push(o)}return r},r.zero2=i,r.toHex=n,r.encode=function(t,e){return"hex"===e?n(t):t}},4452:t=>{"use strict";var e={};function r(t,r,i){i||(i=Error);var n=function(t){var e,i;function n(e,i,n){return t.call(this,function(t,e,i){return"string"==typeof r?r:r(t,e,i)}(e,i,n))||this}return i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,e.__proto__=i,n}(i);n.prototype.name=i.name,n.prototype.code=t,e[t]=n}function i(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,s,o,a;if("string"==typeof e&&(s="not ",e.substr(!o||o<0?0:+o,s.length)===s)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))a="The ".concat(t," ").concat(n," ").concat(i(e,"type"));else{var c=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";a='The "'.concat(t,'" ').concat(c," ").concat(n," ").concat(i(e,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},7073:(t,e,r)=>{"use strict";var i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var n=r(8051),s=r(2557);r(1285)(u,n);for(var o=i(s.prototype),a=0;a<o.length;a++){var c=o[a];u.prototype[c]||(u.prototype[c]=s.prototype[c])}function u(t){if(!(this instanceof u))return new u(t);n.call(this,t),s.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||process.nextTick(f,this)}function f(t){t.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},5163:(t,e,r)=>{"use strict";t.exports=n;var i=r(7640);function n(t){if(!(this instanceof n))return new n(t);i.call(this,t)}r(1285)(n,i),n.prototype._transform=function(t,e,r){r(null,t)}},8051:(t,e,r)=>{"use strict";var i;t.exports=A,A.ReadableState=S;r(2699).EventEmitter;var n=function(t,e){return t.listeners(e).length},s=r(5010),o=r(8834).Buffer,a=r.g.Uint8Array||function(){};var c,u=r(6602);c=u&&u.debuglog?u.debuglog("stream"):function(){};var h,f,l,d=r(6637),p=r(2262),b=r(7605).getHighWaterMark,g=r(4452).q,m=g.ERR_INVALID_ARG_TYPE,v=g.ERR_STREAM_PUSH_AFTER_EOF,y=g.ERR_METHOD_NOT_IMPLEMENTED,w=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(1285)(A,s);var _=p.errorOrDestroy,E=["error","close","destroy","pause","resume"];function S(t,e,n){i=i||r(7073),t=t||{},"boolean"!=typeof n&&(n=e instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=b(this,t,"readableHighWaterMark",n),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(h||(h=r(214).s),this.decoder=new h(t.encoding),this.encoding=t.encoding)}function A(t){if(i=i||r(7073),!(this instanceof A))return new A(t);var e=this instanceof i;this._readableState=new S(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function O(t,e,r,i,n){c("readableAddChunk",e);var s,u=t._readableState;if(null===e)u.reading=!1,function(t,e){if(c("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?P(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}(t,u);else if(n||(s=function(t,e){var r;i=e,o.isBuffer(i)||i instanceof a||"string"==typeof e||void 0===e||t.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],e));var i;return r}(u,e)),s)_(t,s);else if(u.objectMode||e&&e.length>0)if("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===o.prototype||(e=function(t){return o.from(t)}(e)),i)u.endEmitted?_(t,new w):T(t,u,e,!0);else if(u.ended)_(t,new v);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(e=u.decoder.write(e),u.objectMode||0!==e.length?T(t,u,e,!1):N(t,u)):T(t,u,e,!1)}else i||(u.reading=!1,N(t,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function T(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&P(t)),N(t,e)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),A.prototype.destroy=p.destroy,A.prototype._undestroy=p.undestroy,A.prototype._destroy=function(t,e){e(t)},A.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=o.from(t,e),e=""),r=!0),O(this,t,e,!1,r)},A.prototype.unshift=function(t){return O(this,t,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(t){h||(h=r(214).s);var e=new h(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var i=this._readableState.buffer.head,n="";null!==i;)n+=e.write(i.data),i=i.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var x=1073741824;function R(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=x?t=x:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function P(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(I,t))}function I(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,B(t)}function N(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(M,t,e))}function M(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(c("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function k(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function L(t){c("readable nexttick read 0"),t.read(0)}function C(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),B(t),e.flowing&&!e.reading&&t.read(0)}function B(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function D(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function U(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(j,e,t))}function j(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function K(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}A.prototype.read=function(t){c("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):P(this),null;if(0===(t=R(t,e))&&e.ended)return 0===e.length&&U(this),null;var i,n=e.needReadable;return c("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&c("length less than watermark",n=!0),e.ended||e.reading?c("reading or ended",n=!1):n&&(c("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=R(r,e))),null===(i=t>0?D(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&U(this)),null!==i&&this.emit("data",i),i},A.prototype._read=function(t){_(this,new y("_read()"))},A.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,e);var s=(!e||!1!==e.end)&&t!==process.stdout&&t!==process.stderr?a:b;function o(e,n){c("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",u),t.removeListener("error",l),t.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",b),r.removeListener("data",f),h=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}function a(){c("onend"),t.end()}i.endEmitted?process.nextTick(s):r.once("end",s),t.on("unpipe",o);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&n(t,"data")&&(e.flowing=!0,B(t))}}(r);t.on("drain",u);var h=!1;function f(e){c("ondata");var n=t.write(e);c("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==K(i.pipes,t))&&!h&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function l(e){c("onerror",e),b(),t.removeListener("error",l),0===n(t,"error")&&_(t,e)}function d(){t.removeListener("finish",p),b()}function p(){c("onfinish"),t.removeListener("close",d),b()}function b(){c("unpipe"),r.unpipe(t)}return r.on("data",f),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",l),t.once("close",d),t.once("finish",p),t.emit("pipe",r),i.flowing||(c("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<n;s++)i[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=K(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},A.prototype.on=function(t,e){var r=s.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?P(this):i.reading||process.nextTick(L,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(k,this),r},A.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(k,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(C,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var n in t.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(n){(c("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(e.push(n)||(i=!0,t.pause()))})),t)void 0===this[n]&&"function"==typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var s=0;s<E.length;s++)t.on(E[s],this.emit.bind(this,E[s]));return this._read=function(e){c("wrapped _read",e),i&&(i=!1,t.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(1029)),f(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),A._fromList=D,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(t,e){return void 0===l&&(l=r(352)),l(A,t,e)})},7640:(t,e,r)=>{"use strict";t.exports=h;var i=r(4452).q,n=i.ERR_METHOD_NOT_IMPLEMENTED,s=i.ERR_MULTIPLE_CALLBACK,o=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=i.ERR_TRANSFORM_WITH_LENGTH_0,c=r(7073);function u(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new s);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function h(t){if(!(this instanceof h))return new h(t);c.call(this,t),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",f)}function f(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?l(this,null,null):this._flush((function(e,r){l(t,e,r)}))}function l(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new o;return t.push(null)}r(1285)(h,c),h.prototype.push=function(t,e){return this._transformState.needTransform=!1,c.prototype.push.call(this,t,e)},h.prototype._transform=function(t,e,r){r(new n("_transform()"))},h.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},h.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},h.prototype._destroy=function(t,e){c.prototype._destroy.call(this,t,(function(t){e(t)}))}},2557:(t,e,r)=>{"use strict";function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var i=t.entry;t.entry=null;for(;i;){var n=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree.next=t}(e,t)}}var n;t.exports=A,A.WritableState=S;var s={deprecate:r(5803)},o=r(5010),a=r(8834).Buffer,c=r.g.Uint8Array||function(){};var u,h=r(2262),f=r(7605).getHighWaterMark,l=r(4452).q,d=l.ERR_INVALID_ARG_TYPE,p=l.ERR_METHOD_NOT_IMPLEMENTED,b=l.ERR_MULTIPLE_CALLBACK,g=l.ERR_STREAM_CANNOT_PIPE,m=l.ERR_STREAM_DESTROYED,v=l.ERR_STREAM_NULL_VALUES,y=l.ERR_STREAM_WRITE_AFTER_END,w=l.ERR_UNKNOWN_ENCODING,_=h.errorOrDestroy;function E(){}function S(t,e,s){n=n||r(7073),t=t||{},"boolean"!=typeof s&&(s=e instanceof n),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=f(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===t.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if("function"!=typeof n)throw new b;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,i,n){--e.pendingcb,r?(process.nextTick(n,i),process.nextTick(I,t,e),t._writableState.errorEmitted=!0,_(t,i)):(n(i),t._writableState.errorEmitted=!0,_(t,i),I(t,e))}(t,r,i,e,n);else{var s=R(r)||t.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||x(t,r),i?process.nextTick(T,t,r,s,n):T(t,r,s,n)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function A(t){var e=this instanceof(n=n||r(7073));if(!e&&!u.call(A,this))return new A(t);this._writableState=new S(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),o.call(this)}function O(t,e,r,i,n,s,o){e.writelen=i,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):r?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}function T(t,e,r,i){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),I(t,e)}function x(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,s=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var a=0,c=!0;r;)s[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;s.allBuffers=c,O(t,e,!0,e.length,s,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,h=r.encoding,f=r.callback;if(O(t,e,!1,e.objectMode?1:u.length,u,h,f),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function R(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function P(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,e){var r=R(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(P,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}r(1285)(A,o),S.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(S.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(u=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!u.call(this,t)||this===A&&(t&&t._writableState instanceof S)}})):u=function(t){return t instanceof this},A.prototype.pipe=function(){_(this,new g)},A.prototype.write=function(t,e,r){var i,n=this._writableState,s=!1,o=!n.objectMode&&(i=t,a.isBuffer(i)||i instanceof c);return o&&!a.isBuffer(t)&&(t=function(t){return a.from(t)}(t)),"function"==typeof e&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=E),n.ending?function(t,e){var r=new y;_(t,r),process.nextTick(e,r)}(this,r):(o||function(t,e,r,i){var n;return null===r?n=new v:"string"==typeof r||e.objectMode||(n=new d("chunk",["string","Buffer"],r)),!n||(_(t,n),process.nextTick(i,n),!1)}(this,n,t,r))&&(n.pendingcb++,s=function(t,e,r,i,n,s){if(!r){var o=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=a.from(e,r));return e}(e,i,n);i!==o&&(r=!0,n="buffer",i=o)}var c=e.objectMode?1:i.length;e.length+=c;var u=e.length<e.highWaterMark;u||(e.needDrain=!0);if(e.writing||e.corked){var h=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:s,next:null},h?h.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else O(t,e,!1,c,i,n,s);return u}(this,n,o,t,e,r)),s},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||x(this,t))},A.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new p("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var i=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,r){e.ending=!0,I(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,i,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=h.destroy,A.prototype._undestroy=h.undestroy,A.prototype._destroy=function(t,e){e(t)}},1029:(t,e,r)=>{"use strict";var i;function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=r(9885),o=Symbol("lastResolve"),a=Symbol("lastReject"),c=Symbol("error"),u=Symbol("ended"),h=Symbol("lastPromise"),f=Symbol("handlePromise"),l=Symbol("stream");function d(t,e){return{value:t,done:e}}function p(t){var e=t[o];if(null!==e){var r=t[l].read();null!==r&&(t[h]=null,t[o]=null,t[a]=null,e(d(r,!1)))}}function b(t){process.nextTick(p,t)}var g=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((n(i={get stream(){return this[l]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[u])return Promise.resolve(d(void 0,!0));if(this[l].destroyed)return new Promise((function(e,r){process.nextTick((function(){t[c]?r(t[c]):e(d(void 0,!0))}))}));var r,i=this[h];if(i)r=new Promise(function(t,e){return function(r,i){t.then((function(){e[u]?r(d(void 0,!0)):e[f](r,i)}),i)}}(i,this));else{var n=this[l].read();if(null!==n)return Promise.resolve(d(n,!1));r=new Promise(this[f])}return this[h]=r,r}},Symbol.asyncIterator,(function(){return this})),n(i,"return",(function(){var t=this;return new Promise((function(e,r){t[l].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),i),g);t.exports=function(t){var e,r=Object.create(m,(n(e={},l,{value:t,writable:!0}),n(e,o,{value:null,writable:!0}),n(e,a,{value:null,writable:!0}),n(e,c,{value:null,writable:!0}),n(e,u,{value:t._readableState.endEmitted,writable:!0}),n(e,f,{value:function(t,e){var i=r[l].read();i?(r[h]=null,r[o]=null,r[a]=null,t(d(i,!1))):(r[o]=t,r[a]=e)},writable:!0}),e));return r[h]=null,s(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[a];return null!==e&&(r[h]=null,r[o]=null,r[a]=null,e(t)),void(r[c]=t)}var i=r[o];null!==i&&(r[h]=null,r[o]=null,r[a]=null,i(d(void 0,!0))),r[u]=!0})),t.on("readable",b.bind(null,r)),r}},6637:(t,e,r)=>{"use strict";function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=r(8834).Buffer,a=r(4854).inspect,c=a&&a.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r,u;return e=t,r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e,r,i,n=o.allocUnsafe(t>>>0),s=this.head,a=0;s;)e=s.data,r=n,i=a,o.prototype.copy.call(e,r,i),a+=s.data.length,s=s.next;return n}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,i=e.data;for(t-=i.length;e=e.next;){var n=e.data,s=t>n.length?n.length:t;if(s===n.length?i+=n:i+=n.slice(0,t),0==(t-=s)){s===n.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(s));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),r=this.head,i=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var n=r.data,s=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,s),0==(t-=s)){s===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(s));break}++i}return this.length-=i,e}},{key:c,value:function(t,e){return a(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}],r&&s(e.prototype,r),u&&s(e,u),t}()},2262:t=>{"use strict";function e(t,e){i(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,n){var s=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(n?n(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(i,this,t)):process.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!n&&t?s._writableState?s._writableState.errorEmitted?process.nextTick(r,s):(s._writableState.errorEmitted=!0,process.nextTick(e,s,t)):process.nextTick(e,s,t):n?(process.nextTick(r,s),n(t)):process.nextTick(r,s)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}}},9885:(t,e,r)=>{"use strict";var i=r(4452).q.ERR_STREAM_PREMATURE_CLOSE;function n(){}t.exports=function t(e,r,s){if("function"==typeof r)return t(e,null,r);r||(r={}),s=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}(s||n);var o=r.readable||!1!==r.readable&&e.readable,a=r.writable||!1!==r.writable&&e.writable,c=function(){e.writable||h()},u=e._writableState&&e._writableState.finished,h=function(){a=!1,u=!0,o||s.call(e)},f=e._readableState&&e._readableState.endEmitted,l=function(){o=!1,f=!0,a||s.call(e)},d=function(t){s.call(e,t)},p=function(){var t;return o&&!f?(e._readableState&&e._readableState.ended||(t=new i),s.call(e,t)):a&&!u?(e._writableState&&e._writableState.ended||(t=new i),s.call(e,t)):void 0},b=function(){e.req.on("finish",h)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(e)?a&&!e._writableState&&(e.on("end",c),e.on("close",c)):(e.on("complete",h),e.on("abort",p),e.req?b():e.on("request",b)),e.on("end",l),e.on("finish",h),!1!==r.error&&e.on("error",d),e.on("close",p),function(){e.removeListener("complete",h),e.removeListener("abort",p),e.removeListener("request",b),e.req&&e.req.removeListener("finish",h),e.removeListener("end",c),e.removeListener("close",c),e.removeListener("finish",h),e.removeListener("end",l),e.removeListener("error",d),e.removeListener("close",p)}}},352:t=>{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},3495:(t,e,r)=>{"use strict";var i;var n=r(4452).q,s=n.ERR_MISSING_ARGS,o=n.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function c(t,e,n,s){s=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(s);var a=!1;t.on("close",(function(){a=!0})),void 0===i&&(i=r(9885)),i(t,{readable:e,writable:n},(function(t){if(t)return s(t);a=!0,s()}));var c=!1;return function(e){if(!a&&!c)return c=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void s(e||new o("pipe"))}}function u(t){t()}function h(t,e){return t.pipe(e)}function f(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i,n=f(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new s("streams");var o=e.map((function(t,r){var s=r<e.length-1;return c(t,s,r>0,(function(t){i||(i=t),t&&o.forEach(u),s||(o.forEach(u),n(i))}))}));return e.reduce(h)}},7605:(t,e,r)=>{"use strict";var i=r(4452).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,n){var s=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,n,r);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new i(n?r:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}}},5010:(t,e,r)=>{t.exports=r(2699).EventEmitter},7525:(t,e,r)=>{(e=t.exports=r(8051)).Stream=e,e.Readable=e,e.Writable=r(2557),e.Duplex=r(7073),e.Transform=r(7640),e.PassThrough=r(5163),e.finished=r(9885),e.pipeline=r(3495)},1445:(t,e,r)=>{"use strict";var i=r(8834).Buffer,n=r(1285),s=r(4485),o=new Array(16),a=[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],c=[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],u=[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],h=[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],f=[0,1518500249,1859775393,2400959708,2840853838],l=[1352829926,1548603684,1836072691,2053994217,0];function d(){s.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<<e|t>>>32-e}function b(t,e,r,i,n,s,o,a){return p(t+(e^r^i)+s+o|0,a)+n|0}function g(t,e,r,i,n,s,o,a){return p(t+(e&r|~e&i)+s+o|0,a)+n|0}function m(t,e,r,i,n,s,o,a){return p(t+((e|~r)^i)+s+o|0,a)+n|0}function v(t,e,r,i,n,s,o,a){return p(t+(e&i|r&~i)+s+o|0,a)+n|0}function y(t,e,r,i,n,s,o,a){return p(t+(e^(r|~i))+s+o|0,a)+n|0}n(d,s),d.prototype._update=function(){for(var t=o,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,i=0|this._b,n=0|this._c,s=0|this._d,d=0|this._e,w=0|this._a,_=0|this._b,E=0|this._c,S=0|this._d,A=0|this._e,O=0;O<80;O+=1){var T,x;O<16?(T=b(r,i,n,s,d,t[a[O]],f[0],u[O]),x=y(w,_,E,S,A,t[c[O]],l[0],h[O])):O<32?(T=g(r,i,n,s,d,t[a[O]],f[1],u[O]),x=v(w,_,E,S,A,t[c[O]],l[1],h[O])):O<48?(T=m(r,i,n,s,d,t[a[O]],f[2],u[O]),x=m(w,_,E,S,A,t[c[O]],l[2],h[O])):O<64?(T=v(r,i,n,s,d,t[a[O]],f[3],u[O]),x=g(w,_,E,S,A,t[c[O]],l[3],h[O])):(T=y(r,i,n,s,d,t[a[O]],f[4],u[O]),x=b(w,_,E,S,A,t[c[O]],l[4],h[O])),r=d,d=s,s=p(n,10),n=i,i=T,w=A,A=S,S=p(E,10),E=_,_=x}var R=this._b+n+S|0;this._b=this._c+s+A|0,this._c=this._d+d+w|0,this._d=this._e+r+_|0,this._e=this._a+i+E|0,this._a=R},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=i.alloc?i.alloc(20):new i(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},4496:(t,e,r)=>{"use strict";r.r(e),r.d(e,{ArgumentOutOfRangeError:()=>I.W,AsyncSubject:()=>h.c,BehaviorSubject:()=>c.X,ConnectableObservable:()=>n.c,EMPTY:()=>W.E,EmptyError:()=>N.K,GroupedObservable:()=>s.T,NEVER:()=>ft,Notification:()=>O.P,NotificationKind:()=>O.W,ObjectUnsubscribedError:()=>M.N,Observable:()=>i.y,ReplaySubject:()=>u.t,Scheduler:()=>E.b,Subject:()=>a.xQ,Subscriber:()=>A.L,Subscription:()=>S.w,TimeoutError:()=>L.W,UnsubscriptionError:()=>k.B,VirtualAction:()=>_,VirtualTimeScheduler:()=>w,animationFrame:()=>y,animationFrameScheduler:()=>v,asap:()=>f.e,asapScheduler:()=>f.E,async:()=>l.P,asyncScheduler:()=>l.z,bindCallback:()=>j,bindNodeCallback:()=>F,combineLatest:()=>z.aj,concat:()=>q.z,config:()=>Pt.v,defer:()=>Z.P,empty:()=>W.c,forkJoin:()=>X,from:()=>J.D,fromEvent:()=>et,fromEventPattern:()=>it,generate:()=>nt,identity:()=>R.y,iif:()=>ot,interval:()=>ct,isObservable:()=>P,merge:()=>ht.T,never:()=>lt,noop:()=>x.Z,observable:()=>o.L,of:()=>dt.of,onErrorResumeNext:()=>pt,pairs:()=>bt,partition:()=>wt,pipe:()=>T.z,queue:()=>d.c,queueScheduler:()=>d.N,race:()=>_t.S3,range:()=>Et,scheduled:()=>Rt.x,throwError:()=>At._,timer:()=>Ot.H,using:()=>Tt,zip:()=>xt.$R});var i=r(9939),n=r(9386),s=r(453),o=r(8859),a=r(1194),c=r(4580),u=r(1048),h=r(3866),f=r(4858),l=r(646),d=r(7410),p=r(2995),b=r(9795),g=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.scheduler=e,i.work=r,i}return p.ZT(e,t),e.prototype.requestAsyncId=function(e,r,i){return void 0===i&&(i=0),null!==i&&i>0?t.prototype.requestAsyncId.call(this,e,r,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame((function(){return e.flush(null)}))))},e.prototype.recycleAsyncId=function(e,r,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,r,i);0===e.actions.length&&(cancelAnimationFrame(r),e.scheduled=void 0)},e}(b.o),m=r(2966),v=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return p.ZT(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,r=this.actions,i=-1,n=r.length;t=t||r.shift();do{if(e=t.execute(t.state,t.delay))break}while(++i<n&&(t=r.shift()));if(this.active=!1,e){for(;++i<n&&(t=r.shift());)t.unsubscribe();throw e}},e}(m.v))(g),y=v,w=function(t){function e(e,r){void 0===e&&(e=_),void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this,e,(function(){return i.frame}))||this;return i.maxFrames=r,i.frame=0,i.index=-1,i}return p.ZT(e,t),e.prototype.flush=function(){for(var t,e,r=this.actions,i=this.maxFrames;(e=r[0])&&e.delay<=i&&(r.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=r.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10,e}(m.v),_=function(t){function e(e,r,i){void 0===i&&(i=e.index+=1);var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n.index=i,n.active=!0,n.index=e.index=i,n}return p.ZT(e,t),e.prototype.schedule=function(r,i){if(void 0===i&&(i=0),!this.id)return t.prototype.schedule.call(this,r,i);this.active=!1;var n=new e(this.scheduler,this.work);return this.add(n),n.schedule(r,i)},e.prototype.requestAsyncId=function(t,r,i){void 0===i&&(i=0),this.delay=t.frame+i;var n=t.actions;return n.push(this),n.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,r){void 0===r&&(r=0)},e.prototype._execute=function(e,r){if(!0===this.active)return t.prototype._execute.call(this,e,r)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(b.o),E=r(7035),S=r(1586),A=r(1881),O=r(8781),T=r(1199),x=r(4582),R=r(6930);function P(t){return!!t&&(t instanceof i.y||"function"==typeof t.lift&&"function"==typeof t.subscribe)}var I=r(9120),N=r(4397),M=r(906),k=r(2674),L=r(5915),C=r(2188),B=r(4658),D=r(3073),U=r(4070);function j(t,e,r){if(e){if(!(0,U.K)(e))return function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];return j(t,r).apply(void 0,i).pipe((0,C.U)((function(t){return(0,D.k)(t)?e.apply(void 0,t):e(t)})))};r=e}return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var s,o=this,a={context:o,subject:s,callbackFunc:t,scheduler:r};return new i.y((function(i){if(r){var n={args:e,subscriber:i,params:a};return r.schedule(K,0,n)}if(!s){s=new h.c;try{t.apply(o,e.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];s.next(t.length<=1?t[0]:t),s.complete()}]))}catch(t){(0,B._)(s)?s.error(t):console.warn(t)}}return s.subscribe(i)}))}}function K(t){var e=this,r=t.args,i=t.subscriber,n=t.params,s=n.callbackFunc,o=n.context,a=n.scheduler,c=n.subject;if(!c){c=n.subject=new h.c;try{s.apply(o,r.concat([function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=t.length<=1?t[0]:t;e.add(a.schedule(V,0,{value:i,subject:c}))}]))}catch(t){c.error(t)}}this.add(c.subscribe(i))}function V(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function F(t,e,r){if(e){if(!(0,U.K)(e))return function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];return F(t,r).apply(void 0,i).pipe((0,C.U)((function(t){return(0,D.k)(t)?e.apply(void 0,t):e(t)})))};r=e}return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var s={subject:void 0,args:e,callbackFunc:t,scheduler:r,context:this};return new i.y((function(i){var n=s.context,o=s.subject;if(r)return r.schedule(H,0,{params:s,subscriber:i,context:n});if(!o){o=s.subject=new h.c;try{t.apply(n,e.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.shift();r?o.error(r):(o.next(t.length<=1?t[0]:t),o.complete())}]))}catch(t){(0,B._)(o)?o.error(t):console.warn(t)}}return o.subscribe(i)}))}}function H(t){var e=this,r=t.params,i=t.subscriber,n=t.context,s=r.callbackFunc,o=r.args,a=r.scheduler,c=r.subject;if(!c){c=r.subject=new h.c;try{s.apply(n,o.concat([function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=t.shift();if(i)e.add(a.schedule($,0,{err:i,subject:c}));else{var n=t.length<=1?t[0]:t;e.add(a.schedule(G,0,{value:n,subject:c}))}}]))}catch(t){this.add(a.schedule($,0,{err:t,subject:c}))}}this.add(c.subscribe(i))}function G(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function $(t){var e=t.err;t.subject.error(e)}var z=r(97),q=r(4245),Z=r(6542),W=r(4773),Y=r(757),J=r(7238);function X(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){var r=t[0];if((0,D.k)(r))return Q(r,null);if((0,Y.K)(r)&&Object.getPrototypeOf(r)===Object.prototype){var i=Object.keys(r);return Q(i.map((function(t){return r[t]})),i)}}if("function"==typeof t[t.length-1]){var n=t.pop();return Q(t=1===t.length&&(0,D.k)(t[0])?t[0]:t,null).pipe((0,C.U)((function(t){return n.apply(void 0,t)})))}return Q(t,null)}function Q(t,e){return new i.y((function(r){var i=t.length;if(0!==i)for(var n=new Array(i),s=0,o=0,a=function(a){var c=(0,J.D)(t[a]),u=!1;r.add(c.subscribe({next:function(t){u||(u=!0,o++),n[a]=t},error:function(t){return r.error(t)},complete:function(){++s!==i&&u||(o===i&&r.next(e?e.reduce((function(t,e,r){return t[e]=n[r],t}),{}):n),r.complete())}}))},c=0;c<i;c++)a(c);else r.complete()}))}var tt=r(7371);function et(t,e,r,n){return(0,tt.m)(r)&&(n=r,r=void 0),n?et(t,e,r).pipe((0,C.U)((function(t){return(0,D.k)(t)?n.apply(void 0,t):n(t)}))):new i.y((function(i){rt(t,e,(function(t){arguments.length>1?i.next(Array.prototype.slice.call(arguments)):i.next(t)}),i,r)}))}function rt(t,e,r,i,n){var s;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){var o=t;t.addEventListener(e,r,n),s=function(){return o.removeEventListener(e,r,n)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){var a=t;t.on(e,r),s=function(){return a.off(e,r)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){var c=t;t.addListener(e,r),s=function(){return c.removeListener(e,r)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var u=0,h=t.length;u<h;u++)rt(t[u],e,r,i,n)}i.add(s)}function it(t,e,r){return r?it(t,e).pipe((0,C.U)((function(t){return(0,D.k)(t)?r.apply(void 0,t):r(t)}))):new i.y((function(r){var i,n=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r.next(1===t.length?t[0]:t)};try{i=t(n)}catch(t){return void r.error(t)}if((0,tt.m)(e))return function(){return e(n,i)}}))}function nt(t,e,r,n,s){var o,a;if(1==arguments.length){var c=t;a=c.initialState,e=c.condition,r=c.iterate,o=c.resultSelector||R.y,s=c.scheduler}else void 0===n||(0,U.K)(n)?(a=t,o=R.y,s=n):(a=t,o=n);return new i.y((function(t){var i=a;if(s)return s.schedule(st,0,{subscriber:t,iterate:r,condition:e,resultSelector:o,state:i});for(;;){if(e){var n=void 0;try{n=e(i)}catch(e){return void t.error(e)}if(!n){t.complete();break}}var c=void 0;try{c=o(i)}catch(e){return void t.error(e)}if(t.next(c),t.closed)break;try{i=r(i)}catch(e){return void t.error(e)}}}))}function st(t){var e=t.subscriber,r=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(t){return void e.error(t)}else t.needIterate=!0;if(r){var i=void 0;try{i=r(t.state)}catch(t){return void e.error(t)}if(!i)return void e.complete();if(e.closed)return}var n;try{n=t.resultSelector(t.state)}catch(t){return void e.error(t)}if(!e.closed&&(e.next(n),!e.closed))return this.schedule(t)}}function ot(t,e,r){return void 0===e&&(e=W.E),void 0===r&&(r=W.E),(0,Z.P)((function(){return t()?e:r}))}var at=r(6712);function ct(t,e){return void 0===t&&(t=0),void 0===e&&(e=l.P),(!(0,at.k)(t)||t<0)&&(t=0),e&&"function"==typeof e.schedule||(e=l.P),new i.y((function(r){return r.add(e.schedule(ut,t,{subscriber:r,counter:0,period:t})),r}))}function ut(t){var e=t.subscriber,r=t.counter,i=t.period;e.next(r),this.schedule({subscriber:e,counter:r+1,period:i},i)}var ht=r(7686),ft=new i.y(x.Z);function lt(){return ft}var dt=r(6612);function pt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)return W.E;var r=t[0],n=t.slice(1);return 1===t.length&&(0,D.k)(r)?pt.apply(void 0,r):new i.y((function(t){var e=function(){return t.add(pt.apply(void 0,n).subscribe(t))};return(0,J.D)(r).subscribe({next:function(e){t.next(e)},error:e,complete:e})}))}function bt(t,e){return e?new i.y((function(r){var i=Object.keys(t),n=new S.w;return n.add(e.schedule(gt,0,{keys:i,index:0,subscriber:r,subscription:n,obj:t})),n})):new i.y((function(e){for(var r=Object.keys(t),i=0;i<r.length&&!e.closed;i++){var n=r[i];t.hasOwnProperty(n)&&e.next([n,t[n]])}e.complete()}))}function gt(t){var e=t.keys,r=t.index,i=t.subscriber,n=t.subscription,s=t.obj;if(!i.closed)if(r<e.length){var o=e[r];i.next([o,s[o]]),n.add(this.schedule({keys:e,index:r+1,subscriber:i,subscription:n,obj:s}))}else i.complete()}var mt=r(5683),vt=r(1400),yt=r(2730);function wt(t,e,r){return[(0,yt.h)(e,r)(new i.y((0,vt.s)(t))),(0,yt.h)((0,mt.f)(e,r))(new i.y((0,vt.s)(t)))]}var _t=r(2219);function Et(t,e,r){return void 0===t&&(t=0),new i.y((function(i){void 0===e&&(e=t,t=0);var n=0,s=t;if(r)return r.schedule(St,0,{index:n,count:e,start:t,subscriber:i});for(;;){if(n++>=e){i.complete();break}if(i.next(s++),i.closed)break}}))}function St(t){var e=t.start,r=t.index,i=t.count,n=t.subscriber;r>=i?n.complete():(n.next(e),n.closed||(t.index=r+1,t.start=e+1,this.schedule(t)))}var At=r(4236),Ot=r(3254);function Tt(t,e){return new i.y((function(r){var i,n;try{i=t()}catch(t){return void r.error(t)}try{n=e(i)}catch(t){return void r.error(t)}var s=(n?(0,J.D)(n):W.E).subscribe(r);return function(){s.unsubscribe(),i&&i.unsubscribe()}}))}var xt=r(1131),Rt=r(2540),Pt=r(604)},3866:(t,e,r)=>{"use strict";r.d(e,{c:()=>o});var i=r(2995),n=r(1194),s=r(1586),o=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.value=null,e.hasNext=!1,e.hasCompleted=!1,e}return i.ZT(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),s.w.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),s.w.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(n.xQ)},4580:(t,e,r)=>{"use strict";r.d(e,{X:()=>o});var i=r(2995),n=r(1194),s=r(906),o=function(t){function e(e){var r=t.call(this)||this;return r._value=e,r}return i.ZT(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var r=t.prototype._subscribe.call(this,e);return r&&!r.closed&&e.next(this._value),r},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new s.N;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(n.xQ)},8781:(t,e,r)=>{"use strict";r.d(e,{P:()=>a,W:()=>i});var i,n=r(4773),s=r(6612),o=r(4236);i||(i={});var a=function(){function t(t,e,r){this.kind=t,this.value=e,this.error=r,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,r){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return r&&r()}},t.prototype.accept=function(t,e,r){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,r)},t.prototype.toObservable=function(){switch(this.kind){case"N":return(0,s.of)(this.value);case"E":return(0,o._)(this.error);case"C":return(0,n.c)()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}()},9939:(t,e,r)=>{"use strict";r.d(e,{y:()=>h});var i=r(4658),n=r(1881),s=r(2532),o=r(5629);var a=r(8859),c=r(1199),u=r(604),h=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var i=this.operator,a=function(t,e,r){if(t){if(t instanceof n.L)return t;if(t[s.b])return t[s.b]()}return t||e||r?new n.L(t,e,r):new n.L(o.c)}(t,e,r);if(i?a.add(i.call(a,this.source)):a.add(this.source||u.v.useDeprecatedSynchronousErrorHandling&&!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a)),u.v.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){u.v.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),(0,i._)(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=f(e))((function(e,i){var n;n=r.subscribe((function(e){try{t(e)}catch(t){i(t),n&&n.unsubscribe()}}),i,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[a.L]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:(0,c.U)(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=f(t))((function(t,r){var i;e.subscribe((function(t){return i=t}),(function(t){return r(t)}),(function(){return t(i)}))}))},t.create=function(e){return new t(e)},t}();function f(t){if(t||(t=u.v.Promise||Promise),!t)throw new Error("no Promise impl found");return t}},5629:(t,e,r)=>{"use strict";r.d(e,{c:()=>s});var i=r(604),n=r(7804),s={closed:!0,next:function(t){},error:function(t){if(i.v.useDeprecatedSynchronousErrorHandling)throw t;(0,n.z)(t)},complete:function(){}}},6807:(t,e,r)=>{"use strict";r.d(e,{L:()=>n});var i=r(2995),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.ZT(e,t),e.prototype.notifyNext=function(t,e,r,i,n){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(r(1881).L)},1048:(t,e,r)=>{"use strict";r.d(e,{t:()=>h});var i=r(2995),n=r(1194),s=r(7410),o=r(1586),a=r(9433),c=r(906),u=r(7566),h=function(t){function e(e,r,i){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===r&&(r=Number.POSITIVE_INFINITY);var n=t.call(this)||this;return n.scheduler=i,n._events=[],n._infiniteTimeWindow=!1,n._bufferSize=e<1?1:e,n._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(n._infiniteTimeWindow=!0,n.next=n.nextInfiniteTimeWindow):n.next=n.nextTimeWindow,n}return i.ZT(e,t),e.prototype.nextInfiniteTimeWindow=function(e){if(!this.isStopped){var r=this._events;r.push(e),r.length>this._bufferSize&&r.shift()}t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this.isStopped||(this._events.push(new f(this._getNow(),e)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,r=this._infiniteTimeWindow,i=r?this._events:this._trimBufferThenGetEvents(),n=this.scheduler,s=i.length;if(this.closed)throw new c.N;if(this.isStopped||this.hasError?e=o.w.EMPTY:(this.observers.push(t),e=new u.W(this,t)),n&&t.add(t=new a.ht(t,n)),r)for(var h=0;h<s&&!t.closed;h++)t.next(i[h]);else for(h=0;h<s&&!t.closed;h++)t.next(i[h].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||s.c).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,r=this._windowTime,i=this._events,n=i.length,s=0;s<n&&!(t-i[s].time<r);)s++;return n>e&&(s=Math.max(s,n-e)),s>0&&i.splice(0,s),i},e}(n.xQ),f=function(){return function(t,e){this.time=t,this.value=e}}()},7035:(t,e,r)=>{"use strict";r.d(e,{b:()=>i});var i=function(){function t(e,r){void 0===r&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(t,e,r){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(r,e)},t.now=function(){return Date.now()},t}()},1194:(t,e,r)=>{"use strict";r.d(e,{Yc:()=>h,xQ:()=>f});var i=r(2995),n=r(9939),s=r(1881),o=r(1586),a=r(906),c=r(7566),u=r(2532),h=function(t){function e(e){var r=t.call(this,e)||this;return r.destination=e,r}return i.ZT(e,t),e}(s.L),f=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return i.ZT(e,t),e.prototype[u.b]=function(){return new h(this)},e.prototype.lift=function(t){var e=new l(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new a.N;if(!this.isStopped)for(var e=this.observers,r=e.length,i=e.slice(),n=0;n<r;n++)i[n].next(t)},e.prototype.error=function(t){if(this.closed)throw new a.N;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,r=e.length,i=e.slice(),n=0;n<r;n++)i[n].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new a.N;this.isStopped=!0;for(var t=this.observers,e=t.length,r=t.slice(),i=0;i<e;i++)r[i].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new a.N;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new a.N;return this.hasError?(t.error(this.thrownError),o.w.EMPTY):this.isStopped?(t.complete(),o.w.EMPTY):(this.observers.push(t),new c.W(this,t))},e.prototype.asObservable=function(){var t=new n.y;return t.source=this,t},e.create=function(t,e){return new l(t,e)},e}(n.y),l=function(t){function e(e,r){var i=t.call(this)||this;return i.destination=e,i.source=r,i}return i.ZT(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):o.w.EMPTY},e}(f)},7566:(t,e,r)=>{"use strict";r.d(e,{W:()=>n});var i=r(2995),n=function(t){function e(e,r){var i=t.call(this)||this;return i.subject=e,i.subscriber=r,i.closed=!1,i}return i.ZT(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var r=e.indexOf(this.subscriber);-1!==r&&e.splice(r,1)}}},e}(r(1586).w)},1881:(t,e,r)=>{"use strict";r.d(e,{L:()=>h});var i=r(2995),n=r(7371),s=r(5629),o=r(1586),a=r(2532),c=r(604),u=r(7804),h=function(t){function e(r,i,n){var o=t.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=s.c;break;case 1:if(!r){o.destination=s.c;break}if("object"==typeof r){r instanceof e?(o.syncErrorThrowable=r.syncErrorThrowable,o.destination=r,r.add(o)):(o.syncErrorThrowable=!0,o.destination=new f(o,r));break}default:o.syncErrorThrowable=!0,o.destination=new f(o,r,i,n)}return o}return i.ZT(e,t),e.prototype[a.b]=function(){return this},e.create=function(t,r,i){var n=new e(t,r,i);return n.syncErrorThrowable=!1,n},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},e}(o.w),f=function(t){function e(e,r,i,o){var a,c=t.call(this)||this;c._parentSubscriber=e;var u=c;return(0,n.m)(r)?a=r:r&&(a=r.next,i=r.error,o=r.complete,r!==s.c&&(u=Object.create(r),(0,n.m)(u.unsubscribe)&&c.add(u.unsubscribe.bind(u)),u.unsubscribe=c.unsubscribe.bind(c))),c._context=u,c._next=a,c._error=i,c._complete=o,c}return i.ZT(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;c.v.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,r=c.v.useDeprecatedSynchronousErrorHandling;if(this._error)r&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)r?(e.syncErrorValue=t,e.syncErrorThrown=!0):(0,u.z)(t),this.unsubscribe();else{if(this.unsubscribe(),r)throw t;(0,u.z)(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var r=function(){return t._complete.call(t._context)};c.v.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),c.v.useDeprecatedSynchronousErrorHandling)throw t;(0,u.z)(t)}},e.prototype.__tryOrSetError=function(t,e,r){if(!c.v.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,r)}catch(e){return c.v.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):((0,u.z)(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(h)},1586:(t,e,r)=>{"use strict";r.d(e,{w:()=>a});var i=r(3073),n=r(757),s=r(7371),o=r(2674),a=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var e;if(!this.closed){var r=this,a=r._parentOrParents,u=r._ctorUnsubscribe,h=r._unsubscribe,f=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,a instanceof t)a.remove(this);else if(null!==a)for(var l=0;l<a.length;++l){a[l].remove(this)}if((0,s.m)(h)){u&&(this._unsubscribe=void 0);try{h.call(this)}catch(t){e=t instanceof o.B?c(t.errors):[t]}}if((0,i.k)(f)){l=-1;for(var d=f.length;++l<d;){var p=f[l];if((0,n.K)(p))try{p.unsubscribe()}catch(t){e=e||[],t instanceof o.B?e=e.concat(c(t.errors)):e.push(t)}}}if(e)throw new o.B(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(typeof e){case"function":r=new t(e);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var i=r;(r=new t)._subscriptions=[i]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var n=r._parentOrParents;if(null===n)r._parentOrParents=this;else if(n instanceof t){if(n===this)return r;r._parentOrParents=[n,this]}else{if(-1!==n.indexOf(this))return r;n.push(this)}var s=this._subscriptions;return null===s?this._subscriptions=[r]:s.push(r),r},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}},t.EMPTY=((e=new t).closed=!0,e),t}();function c(t){return t.reduce((function(t,e){return t.concat(e instanceof o.B?e.errors:e)}),[])}},604:(t,e,r)=>{"use strict";r.d(e,{v:()=>n});var i=!1,n={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;i=t},get useDeprecatedSynchronousErrorHandling(){return i}}},3694:(t,e,r)=>{"use strict";r.d(e,{Ds:()=>c,IY:()=>a,ft:()=>u});var i=r(2995),n=r(1881),s=r(9939),o=r(1400),a=function(t){function e(e){var r=t.call(this)||this;return r.parent=e,r}return i.ZT(e,t),e.prototype._next=function(t){this.parent.notifyNext(t)},e.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(n.L),c=(n.L,function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.ZT(e,t),e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(n.L));n.L;function u(t,e){if(!e.closed){if(t instanceof s.y)return t.subscribe(e);var r;try{r=(0,o.s)(t)(e)}catch(t){e.error(t)}return r}}},9386:(t,e,r)=>{"use strict";r.d(e,{N:()=>h,c:()=>u});var i=r(2995),n=r(1194),s=r(9939),o=r(1881),a=r(1586),c=r(6840),u=function(t){function e(e,r){var i=t.call(this)||this;return i.source=e,i.subjectFactory=r,i._refCount=0,i._isComplete=!1,i}return i.ZT(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new a.w).add(this.source.subscribe(new f(this.getSubject(),this))),t.closed&&(this._connection=null,t=a.w.EMPTY)),t},e.prototype.refCount=function(){return(0,c.x)()(this)},e}(s.y),h=function(){var t=u.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),f=function(t){function e(e,r){var i=t.call(this,e)||this;return i.connectable=r,i}return i.ZT(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(n.Yc);o.L},97:(t,e,r)=>{"use strict";r.d(e,{Ms:()=>f,aj:()=>h});var i=r(2995),n=r(4070),s=r(3073),o=r(6807),a=r(505),c=r(7),u={};function h(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=void 0,i=void 0;return(0,n.K)(t[t.length-1])&&(i=t.pop()),"function"==typeof t[t.length-1]&&(r=t.pop()),1===t.length&&(0,s.k)(t[0])&&(t=t[0]),(0,c.n)(t,i).lift(new f(r))}var f=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.resultSelector))},t}(),l=function(t){function e(e,r){var i=t.call(this,e)||this;return i.resultSelector=r,i.active=0,i.values=[],i.observables=[],i}return i.ZT(e,t),e.prototype._next=function(t){this.values.push(u),this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var r=0;r<e;r++){var i=t[r];this.add((0,a.D)(this,i,void 0,r))}}},e.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,r){var i=this.values,n=i[r],s=this.toRespond?n===u?--this.toRespond:this.toRespond:0;i[r]=e,0===s&&(this.resultSelector?this._tryResultSelector(i):this.destination.next(i.slice()))},e.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(o.L)},4245:(t,e,r)=>{"use strict";r.d(e,{z:()=>s});var i=r(6612),n=r(430);function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.u)()(i.of.apply(void 0,t))}},6542:(t,e,r)=>{"use strict";r.d(e,{P:()=>o});var i=r(9939),n=r(7238),s=r(4773);function o(t){return new i.y((function(e){var r;try{r=t()}catch(t){return void e.error(t)}return(r?(0,n.D)(r):(0,s.c)()).subscribe(e)}))}},4773:(t,e,r)=>{"use strict";r.d(e,{E:()=>n,c:()=>s});var i=r(9939),n=new i.y((function(t){return t.complete()}));function s(t){return t?function(t){return new i.y((function(e){return t.schedule((function(){return e.complete()}))}))}(t):n}},7238:(t,e,r)=>{"use strict";r.d(e,{D:()=>o});var i=r(9939),n=r(1400),s=r(2540);function o(t,e){return e?(0,s.x)(t,e):t instanceof i.y?t:new i.y((0,n.s)(t))}},7:(t,e,r)=>{"use strict";r.d(e,{n:()=>o});var i=r(9939),n=r(7651),s=r(6405);function o(t,e){return e?(0,s.r)(t,e):new i.y((0,n.V)(t))}},7686:(t,e,r)=>{"use strict";r.d(e,{T:()=>a});var i=r(9939),n=r(4070),s=r(7258),o=r(7);function a(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Number.POSITIVE_INFINITY,a=null,c=t[t.length-1];return(0,n.K)(c)?(a=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(r=t.pop())):"number"==typeof c&&(r=t.pop()),null===a&&1===t.length&&t[0]instanceof i.y?t[0]:(0,s.J)(r)((0,o.n)(t,a))}},6612:(t,e,r)=>{"use strict";r.d(e,{of:()=>o});var i=r(4070),n=r(7),s=r(6405);function o(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return(0,i.K)(r)?(t.pop(),(0,s.r)(t,r)):(0,n.n)(t)}},2219:(t,e,r)=>{"use strict";r.d(e,{S3:()=>c});var i=r(2995),n=r(3073),s=r(7),o=r(6807),a=r(505);function c(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){if(!(0,n.k)(t[0]))return t[0];t=t[0]}return(0,s.n)(t,void 0).lift(new u)}var u=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new h(t))},t}(),h=function(t){function e(e){var r=t.call(this,e)||this;return r.hasFirst=!1,r.observables=[],r.subscriptions=[],r}return i.ZT(e,t),e.prototype._next=function(t){this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(var r=0;r<e&&!this.hasFirst;r++){var i=t[r],n=(0,a.D)(this,i,void 0,r);this.subscriptions&&this.subscriptions.push(n),this.add(n)}this.observables=null}},e.prototype.notifyNext=function(t,e,r){if(!this.hasFirst){this.hasFirst=!0;for(var i=0;i<this.subscriptions.length;i++)if(i!==r){var n=this.subscriptions[i];n.unsubscribe(),this.remove(n)}this.subscriptions=null}this.destination.next(e)},e}(o.L)},4236:(t,e,r)=>{"use strict";r.d(e,{_:()=>n});var i=r(9939);function n(t,e){return e?new i.y((function(r){return e.schedule(s,0,{error:t,subscriber:r})})):new i.y((function(e){return e.error(t)}))}function s(t){var e=t.error;t.subscriber.error(e)}},3254:(t,e,r)=>{"use strict";r.d(e,{H:()=>a});var i=r(9939),n=r(646),s=r(6712),o=r(4070);function a(t,e,r){void 0===t&&(t=0);var a=-1;return(0,s.k)(e)?a=Number(e)<1?1:Number(e):(0,o.K)(e)&&(r=e),(0,o.K)(r)||(r=n.P),new i.y((function(e){var i=(0,s.k)(t)?t:+t-r.now();return r.schedule(c,i,{index:0,period:a,subscriber:e})}))}function c(t){var e=t.index,r=t.period,i=t.subscriber;if(i.next(e),!i.closed){if(-1===r)return i.complete();t.index=e+1,this.schedule(t,r)}}},1131:(t,e,r)=>{"use strict";r.d(e,{$R:()=>u,mx:()=>h});var i=r(2995),n=r(7),s=r(3073),o=r(1881),a=r(2),c=r(3694);function u(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return"function"==typeof r&&t.pop(),(0,n.n)(t,void 0).lift(new h(r))}var h=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new f(t,this.resultSelector))},t}(),f=function(t){function e(e,r,i){void 0===i&&(i=Object.create(null));var n=t.call(this,e)||this;return n.resultSelector=r,n.iterators=[],n.active=0,n.resultSelector="function"==typeof r?r:void 0,n}return i.ZT(e,t),e.prototype._next=function(t){var e=this.iterators;(0,s.k)(t)?e.push(new d(t)):"function"==typeof t[a.hZ]?e.push(new l(t[a.hZ]())):e.push(new p(this.destination,this,t))},e.prototype._complete=function(){var t=this.iterators,e=t.length;if(this.unsubscribe(),0!==e){this.active=e;for(var r=0;r<e;r++){var i=t[r];if(i.stillUnsubscribed)this.destination.add(i.subscribe());else this.active--}}else this.destination.complete()},e.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},e.prototype.checkIterators=function(){for(var t=this.iterators,e=t.length,r=this.destination,i=0;i<e;i++){if("function"==typeof(o=t[i]).hasValue&&!o.hasValue())return}var n=!1,s=[];for(i=0;i<e;i++){var o,a=(o=t[i]).next();if(o.hasCompleted()&&(n=!0),a.done)return void r.complete();s.push(a.value)}this.resultSelector?this._tryresultSelector(s):r.next(s),n&&r.complete()},e.prototype._tryresultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(o.L),l=function(){function t(t){this.iterator=t,this.nextResult=t.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},t.prototype.hasCompleted=function(){var t=this.nextResult;return Boolean(t&&t.done)},t}(),d=function(){function t(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return t.prototype[a.hZ]=function(){return this},t.prototype.next=function(t){var e=this.index++,r=this.array;return e<this.length?{value:r[e],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),p=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.parent=r,n.observable=i,n.stillUnsubscribed=!0,n.buffer=[],n.isComplete=!1,n}return i.ZT(e,t),e.prototype[a.hZ]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t){this.buffer.push(t),this.parent.checkIterators()},e.prototype.subscribe=function(){return(0,c.ft)(this.observable,new c.IY(this))},e}(c.Ds)},430:(t,e,r)=>{"use strict";r.d(e,{u:()=>n});var i=r(7258);function n(){return(0,i.J)(1)}},2730:(t,e,r)=>{"use strict";r.d(e,{h:()=>s});var i=r(2995),n=r(1881);function s(t,e){return function(r){return r.lift(new o(t,e))}}var o=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.thisArg))},t}(),a=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.predicate=r,n.thisArg=i,n.count=0,n}return i.ZT(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(n.L)},453:(t,e,r)=>{"use strict";r.d(e,{T:()=>l,v:()=>c});var i=r(2995),n=r(1881),s=r(1586),o=r(9939),a=r(1194);function c(t,e,r,i){return function(n){return n.lift(new u(t,e,r,i))}}var u=function(){function t(t,e,r,i){this.keySelector=t,this.elementSelector=e,this.durationSelector=r,this.subjectSelector=i}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),h=function(t){function e(e,r,i,n,s){var o=t.call(this,e)||this;return o.keySelector=r,o.elementSelector=i,o.durationSelector=n,o.subjectSelector=s,o.groups=null,o.attemptedToUnsubscribe=!1,o.count=0,o}return i.ZT(e,t),e.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(t){return void this.error(t)}this._group(t,e)},e.prototype._group=function(t,e){var r=this.groups;r||(r=this.groups=new Map);var i,n=r.get(e);if(this.elementSelector)try{i=this.elementSelector(t)}catch(t){this.error(t)}else i=t;if(!n){n=this.subjectSelector?this.subjectSelector():new a.xQ,r.set(e,n);var s=new l(e,n,this);if(this.destination.next(s),this.durationSelector){var o=void 0;try{o=this.durationSelector(new l(e,n))}catch(t){return void this.error(t)}this.add(o.subscribe(new f(e,n,this)))}}n.closed||n.next(i)},e.prototype._error=function(t){var e=this.groups;e&&(e.forEach((function(e,r){e.error(t)})),e.clear()),this.destination.error(t)},e.prototype._complete=function(){var t=this.groups;t&&(t.forEach((function(t,e){t.complete()})),t.clear()),this.destination.complete()},e.prototype.removeGroup=function(t){this.groups.delete(t)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&t.prototype.unsubscribe.call(this))},e}(n.L),f=function(t){function e(e,r,i){var n=t.call(this,r)||this;return n.key=e,n.group=r,n.parent=i,n}return i.ZT(e,t),e.prototype._next=function(t){this.complete()},e.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},e}(n.L),l=function(t){function e(e,r,i){var n=t.call(this)||this;return n.key=e,n.groupSubject=r,n.refCountSubscription=i,n}return i.ZT(e,t),e.prototype._subscribe=function(t){var e=new s.w,r=this.refCountSubscription,i=this.groupSubject;return r&&!r.closed&&e.add(new d(r)),e.add(i.subscribe(t)),e},e}(o.y),d=function(t){function e(e){var r=t.call(this)||this;return r.parent=e,e.count++,r}return i.ZT(e,t),e.prototype.unsubscribe=function(){var e=this.parent;e.closed||this.closed||(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(s.w)},2188:(t,e,r)=>{"use strict";r.d(e,{U:()=>s});var i=r(2995),n=r(1881);function s(t,e){return function(r){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new o(t,e))}}var o=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.project,this.thisArg))},t}(),a=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.project=r,n.count=0,n.thisArg=i||n,n}return i.ZT(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(n.L)},7258:(t,e,r)=>{"use strict";r.d(e,{J:()=>s});var i=r(1710),n=r(6930);function s(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),(0,i.zg)(n.y,t)}},1710:(t,e,r)=>{"use strict";r.d(e,{VS:()=>h,zg:()=>a});var i=r(2995),n=r(2188),s=r(7238),o=r(3694);function a(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof e?function(i){return i.pipe(a((function(r,i){return(0,s.D)(t(r,i)).pipe((0,n.U)((function(t,n){return e(r,t,i,n)})))}),r))}:("number"==typeof e&&(r=e),function(e){return e.lift(new c(t,r))})}var c=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.project,this.concurrent))},t}(),u=function(t){function e(e,r,i){void 0===i&&(i=Number.POSITIVE_INFINITY);var n=t.call(this,e)||this;return n.project=r,n.concurrent=i,n.hasCompleted=!1,n.buffer=[],n.active=0,n.index=0,n}return i.ZT(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e)},e.prototype._innerSub=function(t){var e=new o.IY(this),r=this.destination;r.add(e);var i=(0,o.ft)(t,e);i!==e&&r.add(i)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(o.Ds),h=a},9433:(t,e,r)=>{"use strict";r.d(e,{QV:()=>o,ht:()=>c});var i=r(2995),n=r(1881),s=r(8781);function o(t,e){return void 0===e&&(e=0),function(r){return r.lift(new a(t,e))}}var a=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.scheduler,this.delay))},t}(),c=function(t){function e(e,r,i){void 0===i&&(i=0);var n=t.call(this,e)||this;return n.scheduler=r,n.delay=i,n}return i.ZT(e,t),e.dispatch=function(t){var e=t.notification,r=t.destination;e.observe(r),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new u(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(s.P.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(s.P.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(s.P.createComplete()),this.unsubscribe()},e}(n.L),u=function(){return function(t,e){this.notification=t,this.destination=e}}()},6840:(t,e,r)=>{"use strict";r.d(e,{x:()=>s});var i=r(2995),n=r(1881);function s(){return function(t){return t.lift(new o(t))}}var o=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var r=this.connectable;r._refCount++;var i=new a(t,r),n=e.subscribe(i);return i.closed||(i.connection=r.connect()),n},t}(),a=function(t){function e(e,r){var i=t.call(this,e)||this;return i.connectable=r,i}return i.ZT(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var r=this.connection,i=t._connection;this.connection=null,!i||r&&i!==r||i.unsubscribe()}}else this.connection=null},e}(n.L)},6405:(t,e,r)=>{"use strict";r.d(e,{r:()=>s});var i=r(9939),n=r(1586);function s(t,e){return new i.y((function(r){var i=new n.w,s=0;return i.add(e.schedule((function(){s!==t.length?(r.next(t[s++]),r.closed||i.add(this.schedule())):r.complete()}))),i}))}},2540:(t,e,r)=>{"use strict";r.d(e,{x:()=>h});var i=r(9939),n=r(1586),s=r(8859);var o=r(6405),a=r(2);var c=r(9633),u=r(2318);function h(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[s.L]}(t))return function(t,e){return new i.y((function(r){var i=new n.w;return i.add(e.schedule((function(){var n=t[s.L]();i.add(n.subscribe({next:function(t){i.add(e.schedule((function(){return r.next(t)})))},error:function(t){i.add(e.schedule((function(){return r.error(t)})))},complete:function(){i.add(e.schedule((function(){return r.complete()})))}}))}))),i}))}(t,e);if((0,c.t)(t))return function(t,e){return new i.y((function(r){var i=new n.w;return i.add(e.schedule((function(){return t.then((function(t){i.add(e.schedule((function(){r.next(t),i.add(e.schedule((function(){return r.complete()})))})))}),(function(t){i.add(e.schedule((function(){return r.error(t)})))}))}))),i}))}(t,e);if((0,u.z)(t))return(0,o.r)(t,e);if(function(t){return t&&"function"==typeof t[a.hZ]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new i.y((function(r){var i,s=new n.w;return s.add((function(){i&&"function"==typeof i.return&&i.return()})),s.add(e.schedule((function(){i=t[a.hZ](),s.add(e.schedule((function(){if(!r.closed){var t,e;try{var n=i.next();t=n.value,e=n.done}catch(t){return void r.error(t)}e?r.complete():(r.next(t),this.schedule())}})))}))),s}))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}},9795:(t,e,r)=>{"use strict";r.d(e,{o:()=>n});var i=r(2995),n=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.scheduler=e,i.work=r,i.pending=!1,i}return i.ZT(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(i,this.id,e),this},e.prototype.requestAsyncId=function(t,e,r){return void 0===r&&(r=0),setInterval(t.flush.bind(t,this),r)},e.prototype.recycleAsyncId=function(t,e,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var r=!1,i=void 0;try{this.work(t)}catch(t){r=!0,i=!!t&&t||new Error(t)}if(r)return this.unsubscribe(),i},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,r=e.actions,i=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==i&&r.splice(i,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,r){return t.call(this)||this}return i.ZT(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(r(1586).w))},2966:(t,e,r)=>{"use strict";r.d(e,{v:()=>s});var i=r(2995),n=r(7035),s=function(t){function e(r,i){void 0===i&&(i=n.b.now);var s=t.call(this,r,(function(){return e.delegate&&e.delegate!==s?e.delegate.now():i()}))||this;return s.actions=[],s.active=!1,s.scheduled=void 0,s}return i.ZT(e,t),e.prototype.schedule=function(r,i,n){return void 0===i&&(i=0),e.delegate&&e.delegate!==this?e.delegate.schedule(r,i,n):t.prototype.schedule.call(this,r,i,n)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var r;this.active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}}},e}(n.b)},4858:(t,e,r)=>{"use strict";r.d(e,{e:()=>l,E:()=>f});var i=r(2995),n=1,s=function(){return Promise.resolve()}(),o={};function a(t){return t in o&&(delete o[t],!0)}var c=function(t){var e=n++;return o[e]=!0,s.then((function(){return a(e)&&t()})),e},u=function(t){a(t)},h=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.scheduler=e,i.work=r,i}return i.ZT(e,t),e.prototype.requestAsyncId=function(e,r,i){return void 0===i&&(i=0),null!==i&&i>0?t.prototype.requestAsyncId.call(this,e,r,i):(e.actions.push(this),e.scheduled||(e.scheduled=c(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,r,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,r,i);0===e.actions.length&&(u(r),e.scheduled=void 0)},e}(r(9795).o),f=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.ZT(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,r=this.actions,i=-1,n=r.length;t=t||r.shift();do{if(e=t.execute(t.state,t.delay))break}while(++i<n&&(t=r.shift()));if(this.active=!1,e){for(;++i<n&&(t=r.shift());)t.unsubscribe();throw e}},e}(r(2966).v))(h),l=f},646:(t,e,r)=>{"use strict";r.d(e,{P:()=>s,z:()=>n});var i=r(9795),n=new(r(2966).v)(i.o),s=n},7410:(t,e,r)=>{"use strict";r.d(e,{c:()=>o,N:()=>s});var i=r(2995),n=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.scheduler=e,i.work=r,i}return i.ZT(e,t),e.prototype.schedule=function(e,r){return void 0===r&&(r=0),r>0?t.prototype.schedule.call(this,e,r):(this.delay=r,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,r){return r>0||this.closed?t.prototype.execute.call(this,e,r):this._execute(e,r)},e.prototype.requestAsyncId=function(e,r,i){return void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0?t.prototype.requestAsyncId.call(this,e,r,i):e.flush(this)},e}(r(9795).o),s=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.ZT(e,t),e}(r(2966).v))(n),o=s},2:(t,e,r)=>{"use strict";function i(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}r.d(e,{hZ:()=>n});var n=i()},8859:(t,e,r)=>{"use strict";r.d(e,{L:()=>i});var i=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},2532:(t,e,r)=>{"use strict";r.d(e,{b:()=>i});var i=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}()},9120:(t,e,r)=>{"use strict";r.d(e,{W:()=>i});var i=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}()},4397:(t,e,r)=>{"use strict";r.d(e,{K:()=>i});var i=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}()},906:(t,e,r)=>{"use strict";r.d(e,{N:()=>i});var i=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}()},5915:(t,e,r)=>{"use strict";r.d(e,{W:()=>i});var i=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}()},2674:(t,e,r)=>{"use strict";r.d(e,{B:()=>i});var i=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}()},4658:(t,e,r)=>{"use strict";r.d(e,{_:()=>n});var i=r(1881);function n(t){for(;t;){var e=t,r=e.closed,n=e.destination,s=e.isStopped;if(r||s)return!1;t=n&&n instanceof i.L?n:null}return!0}},7804:(t,e,r)=>{"use strict";function i(t){setTimeout((function(){throw t}),0)}r.d(e,{z:()=>i})},6930:(t,e,r)=>{"use strict";function i(t){return t}r.d(e,{y:()=>i})},3073:(t,e,r)=>{"use strict";r.d(e,{k:()=>i});var i=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}()},2318:(t,e,r)=>{"use strict";r.d(e,{z:()=>i});var i=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t}},7371:(t,e,r)=>{"use strict";function i(t){return"function"==typeof t}r.d(e,{m:()=>i})},6712:(t,e,r)=>{"use strict";r.d(e,{k:()=>n});var i=r(3073);function n(t){return!(0,i.k)(t)&&t-parseFloat(t)+1>=0}},757:(t,e,r)=>{"use strict";function i(t){return null!==t&&"object"==typeof t}r.d(e,{K:()=>i})},9633:(t,e,r)=>{"use strict";function i(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}r.d(e,{t:()=>i})},4070:(t,e,r)=>{"use strict";function i(t){return t&&"function"==typeof t.schedule}r.d(e,{K:()=>i})},4582:(t,e,r)=>{"use strict";function i(){}r.d(e,{Z:()=>i})},5683:(t,e,r)=>{"use strict";function i(t,e){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=t,r.thisArg=e,r}r.d(e,{f:()=>i})},1199:(t,e,r)=>{"use strict";r.d(e,{U:()=>s,z:()=>n});var i=r(6930);function n(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return s(t)}function s(t){return 0===t.length?i.y:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}},1400:(t,e,r)=>{"use strict";r.d(e,{s:()=>h});var i=r(7651),n=r(7804),s=r(2),o=r(8859),a=r(2318),c=r(9633),u=r(757),h=function(t){if(t&&"function"==typeof t[o.L])return h=t,function(t){var e=h[o.L]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if((0,a.z)(t))return(0,i.V)(t);if((0,c.t)(t))return r=t,function(t){return r.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,n.z),t};if(t&&"function"==typeof t[s.hZ])return e=t,function(t){for(var r=e[s.hZ]();;){var i=void 0;try{i=r.next()}catch(e){return t.error(e),t}if(i.done){t.complete();break}if(t.next(i.value),t.closed)break}return"function"==typeof r.return&&t.add((function(){r.return&&r.return()})),t};var e,r,h,f=(0,u.K)(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+f+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},7651:(t,e,r)=>{"use strict";r.d(e,{V:()=>i});var i=function(t){return function(e){for(var r=0,i=t.length;r<i&&!e.closed;r++)e.next(t[r]);e.complete()}}},505:(t,e,r)=>{"use strict";r.d(e,{D:()=>a});var i=r(2995),n=function(t){function e(e,r,i){var n=t.call(this)||this;return n.parent=e,n.outerValue=r,n.outerIndex=i,n.index=0,n}return i.ZT(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(r(1881).L),s=r(1400),o=r(9939);function a(t,e,r,i,a){if(void 0===a&&(a=new n(t,r,i)),!a.closed)return e instanceof o.y?e.subscribe(a):(0,s.s)(e)(a)}},6276:(t,e,r)=>{"use strict";r.r(e),r.d(e,{audit:()=>s,auditTime:()=>h,buffer:()=>f,bufferCount:()=>b,bufferTime:()=>w,bufferToggle:()=>I,bufferWhen:()=>k,catchError:()=>B,combineAll:()=>K,combineLatest:()=>H,concat:()=>$,concatAll:()=>z.u,concatMap:()=>Z,concatMapTo:()=>W,count:()=>Y,debounce:()=>Q,debounceTime:()=>rt,defaultIfEmpty:()=>ot,delay:()=>ft,delayWhen:()=>gt,dematerialize:()=>_t,distinct:()=>At,distinctUntilChanged:()=>xt,distinctUntilKeyChanged:()=>It,elementAt:()=>Ft,endWith:()=>Gt,every:()=>$t,exhaust:()=>Zt,exhaustMap:()=>Xt,expand:()=>ee,filter:()=>Mt.h,finalize:()=>ne,find:()=>ae,findIndex:()=>he,first:()=>le,flatMap:()=>q.VS,groupBy:()=>de.v,ignoreElements:()=>pe,isEmpty:()=>me,last:()=>Se,map:()=>Jt.U,mapTo:()=>Ae,materialize:()=>xe,max:()=>Ce,merge:()=>De,mergeAll:()=>Ue.J,mergeMap:()=>q.zg,mergeMapTo:()=>je,mergeScan:()=>Ke,min:()=>He,multicast:()=>$e,observeOn:()=>qe.QV,onErrorResumeNext:()=>Ze,pairwise:()=>Je,partition:()=>er,pluck:()=>rr,publish:()=>sr,publishBehavior:()=>ar,publishLast:()=>ur,publishReplay:()=>fr,race:()=>dr,reduce:()=>Le,refCount:()=>Tr.x,repeat:()=>pr,repeatWhen:()=>mr,retry:()=>wr,retryWhen:()=>Sr,sample:()=>xr,sampleTime:()=>Ir,scan:()=>Ie,sequenceEqual:()=>Lr,share:()=>jr,shareReplay:()=>Kr,single:()=>Vr,skip:()=>Gr,skipLast:()=>qr,skipUntil:()=>Yr,skipWhile:()=>Qr,startWith:()=>ri,subscribeOn:()=>oi,switchAll:()=>fi,switchMap:()=>ci,switchMapTo:()=>li,take:()=>jt,takeLast:()=>we,takeUntil:()=>di,takeWhile:()=>gi,tap:()=>_i,throttle:()=>Oi,throttleTime:()=>Ri,throwIfEmpty:()=>Lt,timeInterval:()=>ki,timeout:()=>Ki,timeoutWith:()=>Bi,timestamp:()=>Vi,toArray:()=>Gi,window:()=>$i,windowCount:()=>Zi,windowTime:()=>Ji,windowToggle:()=>sn,windowWhen:()=>cn,withLatestFrom:()=>fn,zip:()=>bn,zipAll:()=>gn});var i=r(2995),n=r(3694);function s(t){return function(e){return e.lift(new o(t))}}var o=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.durationSelector))},t}(),a=function(t){function e(e,r){var i=t.call(this,e)||this;return i.durationSelector=r,i.hasValue=!1,i}return i.ZT(e,t),e.prototype._next=function(t){if(this.value=t,this.hasValue=!0,!this.throttled){var e=void 0;try{e=(0,this.durationSelector)(t)}catch(t){return this.destination.error(t)}var r=(0,n.ft)(e,new n.IY(this));!r||r.closed?this.clearThrottle():this.add(this.throttled=r)}},e.prototype.clearThrottle=function(){var t=this,e=t.value,r=t.hasValue,i=t.throttled;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),r&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))},e.prototype.notifyNext=function(){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(n.Ds),c=r(646),u=r(3254);function h(t,e){return void 0===e&&(e=c.P),s((function(){return(0,u.H)(t,e)}))}function f(t){return function(e){return e.lift(new l(t))}}var l=function(){function t(t){this.closingNotifier=t}return t.prototype.call=function(t,e){return e.subscribe(new d(t,this.closingNotifier))},t}(),d=function(t){function e(e,r){var i=t.call(this,e)||this;return i.buffer=[],i.add((0,n.ft)(r,new n.IY(i))),i}return i.ZT(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype.notifyNext=function(){var t=this.buffer;this.buffer=[],this.destination.next(t)},e}(n.Ds),p=r(1881);function b(t,e){return void 0===e&&(e=null),function(r){return r.lift(new g(t,e))}}var g=function(){function t(t,e){this.bufferSize=t,this.startBufferEvery=e,this.subscriberClass=e&&t!==e?v:m}return t.prototype.call=function(t,e){return e.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},t}(),m=function(t){function e(e,r){var i=t.call(this,e)||this;return i.bufferSize=r,i.buffer=[],i}return i.ZT(e,t),e.prototype._next=function(t){var e=this.buffer;e.push(t),e.length==this.bufferSize&&(this.destination.next(e),this.buffer=[])},e.prototype._complete=function(){var e=this.buffer;e.length>0&&this.destination.next(e),t.prototype._complete.call(this)},e}(p.L),v=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.bufferSize=r,n.startBufferEvery=i,n.buffers=[],n.count=0,n}return i.ZT(e,t),e.prototype._next=function(t){var e=this,r=e.bufferSize,i=e.startBufferEvery,n=e.buffers,s=e.count;this.count++,s%i==0&&n.push([]);for(var o=n.length;o--;){var a=n[o];a.push(t),a.length===r&&(n.splice(o,1),this.destination.next(a))}},e.prototype._complete=function(){for(var e=this.buffers,r=this.destination;e.length>0;){var i=e.shift();i.length>0&&r.next(i)}t.prototype._complete.call(this)},e}(p.L),y=r(4070);function w(t){var e=arguments.length,r=c.P;(0,y.K)(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],e--);var i=null;e>=2&&(i=arguments[1]);var n=Number.POSITIVE_INFINITY;return e>=3&&(n=arguments[2]),function(e){return e.lift(new _(t,i,n,r))}}var _=function(){function t(t,e,r,i){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=r,this.scheduler=i}return t.prototype.call=function(t,e){return e.subscribe(new S(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),E=function(){return function(){this.buffer=[]}}(),S=function(t){function e(e,r,i,n,s){var o=t.call(this,e)||this;o.bufferTimeSpan=r,o.bufferCreationInterval=i,o.maxBufferSize=n,o.scheduler=s,o.contexts=[];var a=o.openContext();if(o.timespanOnly=null==i||i<0,o.timespanOnly){var c={subscriber:o,context:a,bufferTimeSpan:r};o.add(a.closeAction=s.schedule(A,r,c))}else{var u={subscriber:o,context:a},h={bufferTimeSpan:r,bufferCreationInterval:i,subscriber:o,scheduler:s};o.add(a.closeAction=s.schedule(T,r,u)),o.add(s.schedule(O,i,h))}return o}return i.ZT(e,t),e.prototype._next=function(t){for(var e,r=this.contexts,i=r.length,n=0;n<i;n++){var s=r[n],o=s.buffer;o.push(t),o.length==this.maxBufferSize&&(e=s)}e&&this.onBufferFull(e)},e.prototype._error=function(e){this.contexts.length=0,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts,r=this.destination;e.length>0;){var i=e.shift();r.next(i.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var r=this.bufferTimeSpan,i={subscriber:this,context:t,bufferTimeSpan:r};this.add(t.closeAction=this.scheduler.schedule(A,r,i))}},e.prototype.openContext=function(){var t=new E;return this.contexts.push(t),t},e.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},e}(p.L);function A(t){var e=t.subscriber,r=t.context;r&&e.closeContext(r),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function O(t){var e=t.bufferCreationInterval,r=t.bufferTimeSpan,i=t.subscriber,n=t.scheduler,s=i.openContext();i.closed||(i.add(s.closeAction=n.schedule(T,r,{subscriber:i,context:s})),this.schedule(t,e))}function T(t){var e=t.subscriber,r=t.context;e.closeContext(r)}var x=r(1586),R=r(505),P=r(6807);function I(t,e){return function(r){return r.lift(new N(t,e))}}var N=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new M(t,this.openings,this.closingSelector))},t}(),M=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.closingSelector=i,n.contexts=[],n.add((0,R.D)(n,r)),n}return i.ZT(e,t),e.prototype._next=function(t){for(var e=this.contexts,r=e.length,i=0;i<r;i++)e[i].buffer.push(t)},e.prototype._error=function(e){for(var r=this.contexts;r.length>0;){var i=r.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var r=e.shift();this.destination.next(r.buffer),r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e){t?this.closeBuffer(t):this.openBuffer(e)},e.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},e.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(t){this._error(t)}},e.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var r=t.buffer,i=t.subscription;this.destination.next(r),e.splice(e.indexOf(t),1),this.remove(i),i.unsubscribe()}},e.prototype.trySubscribe=function(t){var e=this.contexts,r=new x.w,i={buffer:[],subscription:r};e.push(i);var n=(0,R.D)(this,t,i);!n||n.closed?this.closeBuffer(i):(n.context=i,this.add(n),r.add(n))},e}(P.L);function k(t){return function(e){return e.lift(new L(t))}}var L=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new C(t,this.closingSelector))},t}(),C=function(t){function e(e,r){var i=t.call(this,e)||this;return i.closingSelector=r,i.subscribing=!1,i.openBuffer(),i}return i.ZT(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype._complete=function(){var e=this.buffer;e&&this.destination.next(e),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},e.prototype.notifyNext=function(){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var e,r=this.buffer;this.buffer&&this.destination.next(r),this.buffer=[];try{e=(0,this.closingSelector)()}catch(t){return this.error(t)}t=new x.w,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add((0,n.ft)(e,new n.IY(this))),this.subscribing=!1},e}(n.Ds);function B(t){return function(e){var r=new D(t),i=e.lift(r);return r.caught=i}}var D=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new U(t,this.selector,this.caught))},t}(),U=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.selector=r,n.caught=i,n}return i.ZT(e,t),e.prototype.error=function(e){if(!this.isStopped){var r=void 0;try{r=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle();var i=new n.IY(this);this.add(i);var s=(0,n.ft)(r,i);s!==i&&this.add(s)}},e}(n.Ds),j=r(97);function K(t){return function(e){return e.lift(new j.Ms(t))}}var V=r(3073),F=r(7238);function H(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=null;return"function"==typeof t[t.length-1]&&(r=t.pop()),1===t.length&&(0,V.k)(t[0])&&(t=t[0].slice()),function(e){return e.lift.call((0,F.D)([e].concat(t)),new j.Ms(r))}}var G=r(4245);function $(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(G.z.apply(void 0,[e].concat(t)))}}var z=r(430),q=r(1710);function Z(t,e){return(0,q.zg)(t,e,1)}function W(t,e){return Z((function(){return t}),e)}function Y(t){return function(e){return e.lift(new J(t,e))}}var J=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new X(t,this.predicate,this.source))},t}(),X=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.predicate=r,n.source=i,n.count=0,n.index=0,n}return i.ZT(e,t),e.prototype._next=function(t){this.predicate?this._tryPredicate(t):this.count++},e.prototype._tryPredicate=function(t){var e;try{e=this.predicate(t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(p.L);function Q(t){return function(e){return e.lift(new tt(t))}}var tt=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new et(t,this.durationSelector))},t}(),et=function(t){function e(e,r){var i=t.call(this,e)||this;return i.durationSelector=r,i.hasValue=!1,i}return i.ZT(e,t),e.prototype._next=function(t){try{var e=this.durationSelector.call(this,t);e&&this._tryNext(t,e)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(t,e){var r=this.durationSubscription;this.value=t,this.hasValue=!0,r&&(r.unsubscribe(),this.remove(r)),(r=(0,n.ft)(e,new n.IY(this)))&&!r.closed&&this.add(this.durationSubscription=r)},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var e=this.value,r=this.durationSubscription;r&&(this.durationSubscription=void 0,r.unsubscribe(),this.remove(r)),this.value=void 0,this.hasValue=!1,t.prototype._next.call(this,e)}},e}(n.Ds);function rt(t,e){return void 0===e&&(e=c.P),function(r){return r.lift(new it(t,e))}}var it=function(){function t(t,e){this.dueTime=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new nt(t,this.dueTime,this.scheduler))},t}(),nt=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.dueTime=r,n.scheduler=i,n.debouncedSubscription=null,n.lastValue=null,n.hasValue=!1,n}return i.ZT(e,t),e.prototype._next=function(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(st,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var t=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}},e.prototype.clearDebounce=function(){var t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)},e}(p.L);function st(t){t.debouncedNext()}function ot(t){return void 0===t&&(t=null),function(e){return e.lift(new at(t))}}var at=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new ct(t,this.defaultValue))},t}(),ct=function(t){function e(e,r){var i=t.call(this,e)||this;return i.defaultValue=r,i.isEmpty=!0,i}return i.ZT(e,t),e.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(p.L);function ut(t){return t instanceof Date&&!isNaN(+t)}var ht=r(8781);function ft(t,e){void 0===e&&(e=c.P);var r=ut(t)?+t-e.now():Math.abs(t);return function(t){return t.lift(new lt(r,e))}}var lt=function(){function t(t,e){this.delay=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new dt(t,this.delay,this.scheduler))},t}(),dt=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.delay=r,n.scheduler=i,n.queue=[],n.active=!1,n.errored=!1,n}return i.ZT(e,t),e.dispatch=function(t){for(var e=t.source,r=e.queue,i=t.scheduler,n=t.destination;r.length>0&&r[0].time-i.now()<=0;)r.shift().notification.observe(n);if(r.length>0){var s=Math.max(0,r[0].time-i.now());this.schedule(t,s)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(t){this.active=!0,this.destination.add(t.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},e.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,r=new pt(e.now()+this.delay,t);this.queue.push(r),!1===this.active&&this._schedule(e)}},e.prototype._next=function(t){this.scheduleNotification(ht.P.createNext(t))},e.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(ht.P.createComplete()),this.unsubscribe()},e}(p.L),pt=function(){return function(t,e){this.time=t,this.notification=e}}(),bt=r(9939);function gt(t,e){return e?function(r){return new yt(r,e).lift(new mt(t))}:function(e){return e.lift(new mt(t))}}var mt=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new vt(t,this.delayDurationSelector))},t}(),vt=function(t){function e(e,r){var i=t.call(this,e)||this;return i.delayDurationSelector=r,i.completed=!1,i.delayNotifierSubscriptions=[],i.index=0,i}return i.ZT(e,t),e.prototype.notifyNext=function(t,e,r,i,n){this.destination.next(t),this.removeSubscription(n),this.tryComplete()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},e.prototype._next=function(t){var e=this.index++;try{var r=this.delayDurationSelector(t,e);r&&this.tryDelay(r,t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t);return-1!==e&&this.delayNotifierSubscriptions.splice(e,1),t.outerValue},e.prototype.tryDelay=function(t,e){var r=(0,R.D)(this,t,e);r&&!r.closed&&(this.destination.add(r),this.delayNotifierSubscriptions.push(r))},e.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},e}(P.L),yt=function(t){function e(e,r){var i=t.call(this)||this;return i.source=e,i.subscriptionDelay=r,i}return i.ZT(e,t),e.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new wt(t,this.source))},e}(bt.y),wt=function(t){function e(e,r){var i=t.call(this)||this;return i.parent=e,i.source=r,i.sourceSubscribed=!1,i}return i.ZT(e,t),e.prototype._next=function(t){this.subscribeToSource()},e.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(p.L);function _t(){return function(t){return t.lift(new Et)}}var Et=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new St(t))},t}(),St=function(t){function e(e){return t.call(this,e)||this}return i.ZT(e,t),e.prototype._next=function(t){t.observe(this.destination)},e}(p.L);function At(t,e){return function(r){return r.lift(new Ot(t,e))}}var Ot=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new Tt(t,this.keySelector,this.flushes))},t}(),Tt=function(t){function e(e,r,i){var s=t.call(this,e)||this;return s.keySelector=r,s.values=new Set,i&&s.add((0,n.ft)(i,new n.IY(s))),s}return i.ZT(e,t),e.prototype.notifyNext=function(){this.values.clear()},e.prototype.notifyError=function(t){this._error(t)},e.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},e.prototype._useKeySelector=function(t){var e,r=this.destination;try{e=this.keySelector(t)}catch(t){return void r.error(t)}this._finalizeNext(e,t)},e.prototype._finalizeNext=function(t,e){var r=this.values;r.has(t)||(r.add(t),this.destination.next(e))},e}(n.Ds);function xt(t,e){return function(r){return r.lift(new Rt(t,e))}}var Rt=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new Pt(t,this.compare,this.keySelector))},t}(),Pt=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.keySelector=i,n.hasKey=!1,"function"==typeof r&&(n.compare=r),n}return i.ZT(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e;try{var r=this.keySelector;e=r?r(t):t}catch(t){return this.destination.error(t)}var i=!1;if(this.hasKey)try{i=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;i||(this.key=e,this.destination.next(t))},e}(p.L);function It(t,e){return xt((function(r,i){return e?e(r[t],i[t]):r[t]===i[t]}))}var Nt=r(9120),Mt=r(2730),kt=r(4397);function Lt(t){return void 0===t&&(t=Dt),function(e){return e.lift(new Ct(t))}}var Ct=function(){function t(t){this.errorFactory=t}return t.prototype.call=function(t,e){return e.subscribe(new Bt(t,this.errorFactory))},t}(),Bt=function(t){function e(e,r){var i=t.call(this,e)||this;return i.errorFactory=r,i.hasValue=!1,i}return i.ZT(e,t),e.prototype._next=function(t){this.hasValue=!0,this.destination.next(t)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var t=void 0;try{t=this.errorFactory()}catch(e){t=e}this.destination.error(t)},e}(p.L);function Dt(){return new kt.K}var Ut=r(4773);function jt(t){return function(e){return 0===t?(0,Ut.c)():e.lift(new Kt(t))}}var Kt=function(){function t(t){if(this.total=t,this.total<0)throw new Nt.W}return t.prototype.call=function(t,e){return e.subscribe(new Vt(t,this.total))},t}(),Vt=function(t){function e(e,r){var i=t.call(this,e)||this;return i.total=r,i.count=0,i}return i.ZT(e,t),e.prototype._next=function(t){var e=this.total,r=++this.count;r<=e&&(this.destination.next(t),r===e&&(this.destination.complete(),this.unsubscribe()))},e}(p.L);function Ft(t,e){if(t<0)throw new Nt.W;var r=arguments.length>=2;return function(i){return i.pipe((0,Mt.h)((function(e,r){return r===t})),jt(1),r?ot(e):Lt((function(){return new Nt.W})))}}var Ht=r(6612);function Gt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return(0,G.z)(e,Ht.of.apply(void 0,t))}}function $t(t,e){return function(r){return r.lift(new zt(t,e,r))}}var zt=function(){function t(t,e,r){this.predicate=t,this.thisArg=e,this.source=r}return t.prototype.call=function(t,e){return e.subscribe(new qt(t,this.predicate,this.thisArg,this.source))},t}(),qt=function(t){function e(e,r,i,n){var s=t.call(this,e)||this;return s.predicate=r,s.thisArg=i,s.source=n,s.index=0,s.thisArg=i||s,s}return i.ZT(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(p.L);function Zt(){return function(t){return t.lift(new Wt)}}var Wt=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Yt(t))},t}(),Yt=function(t){function e(e){var r=t.call(this,e)||this;return r.hasCompleted=!1,r.hasSubscription=!1,r}return i.ZT(e,t),e.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add((0,n.ft)(t,new n.IY(this))))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(n.Ds),Jt=r(2188);function Xt(t,e){return e?function(r){return r.pipe(Xt((function(r,i){return(0,F.D)(t(r,i)).pipe((0,Jt.U)((function(t,n){return e(r,t,i,n)})))})))}:function(e){return e.lift(new Qt(t))}}var Qt=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new te(t,this.project))},t}(),te=function(t){function e(e,r){var i=t.call(this,e)||this;return i.project=r,i.hasSubscription=!1,i.hasCompleted=!1,i.index=0,i}return i.ZT(e,t),e.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},e.prototype.tryNext=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this.hasSubscription=!0,this._innerSub(e)},e.prototype._innerSub=function(t){var e=new n.IY(this),r=this.destination;r.add(e);var i=(0,n.ft)(t,e);i!==e&&r.add(i)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(n.Ds);function ee(t,e,r){return void 0===e&&(e=Number.POSITIVE_INFINITY),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(i){return i.lift(new re(t,e,r))}}var re=function(){function t(t,e,r){this.project=t,this.concurrent=e,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new ie(t,this.project,this.concurrent,this.scheduler))},t}(),ie=function(t){function e(e,r,i,n){var s=t.call(this,e)||this;return s.project=r,s.concurrent=i,s.scheduler=n,s.index=0,s.active=0,s.hasCompleted=!1,i<Number.POSITIVE_INFINITY&&(s.buffer=[]),s}return i.ZT(e,t),e.dispatch=function(t){var e=t.subscriber,r=t.result,i=t.value,n=t.index;e.subscribeToProjection(r,i,n)},e.prototype._next=function(t){var r=this.destination;if(r.closed)this._complete();else{var i=this.index++;if(this.active<this.concurrent){r.next(t);try{var n=(0,this.project)(t,i);if(this.scheduler){var s={subscriber:this,result:n,value:t,index:i};this.destination.add(this.scheduler.schedule(e.dispatch,0,s))}else this.subscribeToProjection(n,t,i)}catch(t){r.error(t)}}else this.buffer.push(t)}},e.prototype.subscribeToProjection=function(t,e,r){this.active++,this.destination.add((0,n.ft)(t,new n.IY(this)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this._next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t&&t.length>0&&this._next(t.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},e}(n.Ds);function ne(t){return function(e){return e.lift(new se(t))}}var se=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new oe(t,this.callback))},t}(),oe=function(t){function e(e,r){var i=t.call(this,e)||this;return i.add(new x.w(r)),i}return i.ZT(e,t),e}(p.L);function ae(t,e){if("function"!=typeof t)throw new TypeError("predicate is not a function");return function(r){return r.lift(new ce(t,r,!1,e))}}var ce=function(){function t(t,e,r,i){this.predicate=t,this.source=e,this.yieldIndex=r,this.thisArg=i}return t.prototype.call=function(t,e){return e.subscribe(new ue(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),ue=function(t){function e(e,r,i,n,s){var o=t.call(this,e)||this;return o.predicate=r,o.source=i,o.yieldIndex=n,o.thisArg=s,o.index=0,o}return i.ZT(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete(),this.unsubscribe()},e.prototype._next=function(t){var e=this.predicate,r=this.thisArg,i=this.index++;try{e.call(r||this,t,i,this.source)&&this.notifyComplete(this.yieldIndex?i:t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(p.L);function he(t,e){return function(r){return r.lift(new ce(t,r,!0,e))}}var fe=r(6930);function le(t,e){var r=arguments.length>=2;return function(i){return i.pipe(t?(0,Mt.h)((function(e,r){return t(e,r,i)})):fe.y,jt(1),r?ot(e):Lt((function(){return new kt.K})))}}var de=r(453);function pe(){return function(t){return t.lift(new be)}}var be=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new ge(t))},t}(),ge=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.ZT(e,t),e.prototype._next=function(t){},e}(p.L);function me(){return function(t){return t.lift(new ve)}}var ve=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new ye(t))},t}(),ye=function(t){function e(e){return t.call(this,e)||this}return i.ZT(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(p.L);function we(t){return function(e){return 0===t?(0,Ut.c)():e.lift(new _e(t))}}var _e=function(){function t(t){if(this.total=t,this.total<0)throw new Nt.W}return t.prototype.call=function(t,e){return e.subscribe(new Ee(t,this.total))},t}(),Ee=function(t){function e(e,r){var i=t.call(this,e)||this;return i.total=r,i.ring=new Array,i.count=0,i}return i.ZT(e,t),e.prototype._next=function(t){var e=this.ring,r=this.total,i=this.count++;e.length<r?e.push(t):e[i%r]=t},e.prototype._complete=function(){var t=this.destination,e=this.count;if(e>0)for(var r=this.count>=this.total?this.total:this.count,i=this.ring,n=0;n<r;n++){var s=e++%r;t.next(i[s])}t.complete()},e}(p.L);function Se(t,e){var r=arguments.length>=2;return function(i){return i.pipe(t?(0,Mt.h)((function(e,r){return t(e,r,i)})):fe.y,we(1),r?ot(e):Lt((function(){return new kt.K})))}}function Ae(t){return function(e){return e.lift(new Oe(t))}}var Oe=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new Te(t,this.value))},t}(),Te=function(t){function e(e,r){var i=t.call(this,e)||this;return i.value=r,i}return i.ZT(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(p.L);function xe(){return function(t){return t.lift(new Re)}}var Re=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Pe(t))},t}(),Pe=function(t){function e(e){return t.call(this,e)||this}return i.ZT(e,t),e.prototype._next=function(t){this.destination.next(ht.P.createNext(t))},e.prototype._error=function(t){var e=this.destination;e.next(ht.P.createError(t)),e.complete()},e.prototype._complete=function(){var t=this.destination;t.next(ht.P.createComplete()),t.complete()},e}(p.L);function Ie(t,e){var r=!1;return arguments.length>=2&&(r=!0),function(i){return i.lift(new Ne(t,e,r))}}var Ne=function(){function t(t,e,r){void 0===r&&(r=!1),this.accumulator=t,this.seed=e,this.hasSeed=r}return t.prototype.call=function(t,e){return e.subscribe(new Me(t,this.accumulator,this.seed,this.hasSeed))},t}(),Me=function(t){function e(e,r,i,n){var s=t.call(this,e)||this;return s.accumulator=r,s._seed=i,s.hasSeed=n,s.index=0,s}return i.ZT(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,r=this.index++;try{e=this.accumulator(this.seed,t,r)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},e}(p.L),ke=r(1199);function Le(t,e){return arguments.length>=2?function(r){return(0,ke.z)(Ie(t,e),we(1),ot(e))(r)}:function(e){return(0,ke.z)(Ie((function(e,r,i){return t(e,r,i+1)})),we(1))(e)}}function Ce(t){return Le("function"==typeof t?function(e,r){return t(e,r)>0?e:r}:function(t,e){return t>e?t:e})}var Be=r(7686);function De(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(Be.T.apply(void 0,[e].concat(t)))}}var Ue=r(7258);function je(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof e?(0,q.zg)((function(){return t}),e,r):("number"==typeof e&&(r=e),(0,q.zg)((function(){return t}),r))}function Ke(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),function(i){return i.lift(new Ve(t,e,r))}}var Ve=function(){function t(t,e,r){this.accumulator=t,this.seed=e,this.concurrent=r}return t.prototype.call=function(t,e){return e.subscribe(new Fe(t,this.accumulator,this.seed,this.concurrent))},t}(),Fe=function(t){function e(e,r,i,n){var s=t.call(this,e)||this;return s.accumulator=r,s.acc=i,s.concurrent=n,s.hasValue=!1,s.hasCompleted=!1,s.buffer=[],s.active=0,s.index=0,s}return i.ZT(e,t),e.prototype._next=function(t){if(this.active<this.concurrent){var e=this.index++,r=this.destination,i=void 0;try{i=(0,this.accumulator)(this.acc,t,e)}catch(t){return r.error(t)}this.active++,this._innerSub(i)}else this.buffer.push(t)},e.prototype._innerSub=function(t){var e=new n.IY(this),r=this.destination;r.add(e);var i=(0,n.ft)(t,e);i!==e&&r.add(i)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},e.prototype.notifyNext=function(t){var e=this.destination;this.acc=t,this.hasValue=!0,e.next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},e}(n.Ds);function He(t){return Le("function"==typeof t?function(e,r){return t(e,r)<0?e:r}:function(t,e){return t<e?t:e})}var Ge=r(9386);function $e(t,e){return function(r){var i;if(i="function"==typeof t?t:function(){return t},"function"==typeof e)return r.lift(new ze(i,e));var n=Object.create(r,Ge.N);return n.source=r,n.subjectFactory=i,n}}var ze=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var r=this.selector,i=this.subjectFactory(),n=r(i).subscribe(t);return n.add(e.subscribe(i)),n},t}(),qe=r(9433);function Ze(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length&&(0,V.k)(t[0])&&(t=t[0]),function(e){return e.lift(new We(t))}}var We=function(){function t(t){this.nextSources=t}return t.prototype.call=function(t,e){return e.subscribe(new Ye(t,this.nextSources))},t}(),Ye=function(t){function e(e,r){var i=t.call(this,e)||this;return i.destination=e,i.nextSources=r,i}return i.ZT(e,t),e.prototype.notifyError=function(){this.subscribeToNextSource()},e.prototype.notifyComplete=function(){this.subscribeToNextSource()},e.prototype._error=function(t){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var t=this.nextSources.shift();if(t){var e=new n.IY(this),r=this.destination;r.add(e);var i=(0,n.ft)(t,e);i!==e&&r.add(i)}else this.destination.complete()},e}(n.Ds);function Je(){return function(t){return t.lift(new Xe)}}var Xe=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Qe(t))},t}(),Qe=function(t){function e(e){var r=t.call(this,e)||this;return r.hasPrev=!1,r}return i.ZT(e,t),e.prototype._next=function(t){var e;this.hasPrev?e=[this.prev,t]:this.hasPrev=!0,this.prev=t,e&&this.destination.next(e)},e}(p.L),tr=r(5683);function er(t,e){return function(r){return[(0,Mt.h)(t,e)(r),(0,Mt.h)((0,tr.f)(t,e))(r)]}}function rr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.length;if(0===r)throw new Error("list of properties cannot be empty.");return function(e){return(0,Jt.U)(ir(t,r))(e)}}function ir(t,e){return function(r){for(var i=r,n=0;n<e;n++){var s=null!=i?i[t[n]]:void 0;if(void 0===s)return;i=s}return i}}var nr=r(1194);function sr(t){return t?$e((function(){return new nr.xQ}),t):$e(new nr.xQ)}var or=r(4580);function ar(t){return function(e){return $e(new or.X(t))(e)}}var cr=r(3866);function ur(){return function(t){return $e(new cr.c)(t)}}var hr=r(1048);function fr(t,e,r,i){r&&"function"!=typeof r&&(i=r);var n="function"==typeof r?r:void 0,s=new hr.t(t,e,i);return function(t){return $e((function(){return s}),n)(t)}}var lr=r(2219);function dr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return 1===t.length&&(0,V.k)(t[0])&&(t=t[0]),e.lift.call(lr.S3.apply(void 0,[e].concat(t)))}}function pr(t){return void 0===t&&(t=-1),function(e){return 0===t?(0,Ut.c)():t<0?e.lift(new br(-1,e)):e.lift(new br(t-1,e))}}var br=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new gr(t,this.count,this.source))},t}(),gr=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.count=r,n.source=i,n}return i.ZT(e,t),e.prototype.complete=function(){if(!this.isStopped){var e=this.source,r=this.count;if(0===r)return t.prototype.complete.call(this);r>-1&&(this.count=r-1),e.subscribe(this._unsubscribeAndRecycle())}},e}(p.L);function mr(t){return function(e){return e.lift(new vr(t))}}var vr=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new yr(t,this.notifier,e))},t}(),yr=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.notifier=r,n.source=i,n.sourceIsBeingSubscribedTo=!0,n}return i.ZT(e,t),e.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},e.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype._unsubscribeAndRecycle=function(){var e=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=e,this},e.prototype.subscribeToRetries=function(){var e;this.notifications=new nr.xQ;try{e=(0,this.notifier)(this.notifications)}catch(e){return t.prototype.complete.call(this)}this.retries=e,this.retriesSubscription=(0,n.ft)(e,new n.IY(this))},e}(n.Ds);function wr(t){return void 0===t&&(t=-1),function(e){return e.lift(new _r(t,e))}}var _r=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Er(t,this.count,this.source))},t}(),Er=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.count=r,n.source=i,n}return i.ZT(e,t),e.prototype.error=function(e){if(!this.isStopped){var r=this.source,i=this.count;if(0===i)return t.prototype.error.call(this,e);i>-1&&(this.count=i-1),r.subscribe(this._unsubscribeAndRecycle())}},e}(p.L);function Sr(t){return function(e){return e.lift(new Ar(t,e))}}var Ar=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Or(t,this.notifier,this.source))},t}(),Or=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.notifier=r,n.source=i,n}return i.ZT(e,t),e.prototype.error=function(e){if(!this.isStopped){var r=this.errors,i=this.retries,s=this.retriesSubscription;if(i)this.errors=void 0,this.retriesSubscription=void 0;else{r=new nr.xQ;try{i=(0,this.notifier)(r)}catch(e){return t.prototype.error.call(this,e)}s=(0,n.ft)(i,new n.IY(this))}this._unsubscribeAndRecycle(),this.errors=r,this.retries=i,this.retriesSubscription=s,r.next(e)}},e.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype.notifyNext=function(){var t=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=t,this.source.subscribe(this)},e}(n.Ds),Tr=r(6840);function xr(t){return function(e){return e.lift(new Rr(t))}}var Rr=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var r=new Pr(t),i=e.subscribe(r);return i.add((0,n.ft)(this.notifier,new n.IY(r))),i},t}(),Pr=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasValue=!1,e}return i.ZT(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(n.Ds);function Ir(t,e){return void 0===e&&(e=c.P),function(r){return r.lift(new Nr(t,e))}}var Nr=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new Mr(t,this.period,this.scheduler))},t}(),Mr=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.period=r,n.scheduler=i,n.hasValue=!1,n.add(i.schedule(kr,r,{subscriber:n,period:r})),n}return i.ZT(e,t),e.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(p.L);function kr(t){var e=t.subscriber,r=t.period;e.notifyNext(),this.schedule(t,r)}function Lr(t,e){return function(r){return r.lift(new Cr(t,e))}}var Cr=function(){function t(t,e){this.compareTo=t,this.comparator=e}return t.prototype.call=function(t,e){return e.subscribe(new Br(t,this.compareTo,this.comparator))},t}(),Br=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.compareTo=r,n.comparator=i,n._a=[],n._b=[],n._oneComplete=!1,n.destination.add(r.subscribe(new Dr(e,n))),n}return i.ZT(e,t),e.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var t=this,e=t._a,r=t._b,i=t.comparator;e.length>0&&r.length>0;){var n=e.shift(),s=r.shift(),o=!1;try{o=i?i(n,s):n===s}catch(t){this.destination.error(t)}o||this.emit(!1)}},e.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},e}(p.L),Dr=function(t){function e(e,r){var i=t.call(this,e)||this;return i.parent=r,i}return i.ZT(e,t),e.prototype._next=function(t){this.parent.nextB(t)},e.prototype._error=function(t){this.parent.error(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(p.L);function Ur(){return new nr.xQ}function jr(){return function(t){return(0,Tr.x)()($e(Ur)(t))}}function Kr(t,e,r){var i;return i=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:r},function(t){return t.lift(function(t){var e,r,i=t.bufferSize,n=void 0===i?Number.POSITIVE_INFINITY:i,s=t.windowTime,o=void 0===s?Number.POSITIVE_INFINITY:s,a=t.refCount,c=t.scheduler,u=0,h=!1,f=!1;return function(t){var i;u++,!e||h?(h=!1,e=new hr.t(n,o,c),i=e.subscribe(this),r=t.subscribe({next:function(t){e.next(t)},error:function(t){h=!0,e.error(t)},complete:function(){f=!0,r=void 0,e.complete()}}),f&&(r=void 0)):i=e.subscribe(this),this.add((function(){u--,i.unsubscribe(),i=void 0,r&&!f&&a&&0===u&&(r.unsubscribe(),r=void 0,e=void 0)}))}}(i))}}function Vr(t){return function(e){return e.lift(new Fr(t,e))}}var Fr=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Hr(t,this.predicate,this.source))},t}(),Hr=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.predicate=r,n.source=i,n.seenValue=!1,n.index=0,n}return i.ZT(e,t),e.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},e.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},e.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new kt.K)},e}(p.L);function Gr(t){return function(e){return e.lift(new $r(t))}}var $r=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new zr(t,this.total))},t}(),zr=function(t){function e(e,r){var i=t.call(this,e)||this;return i.total=r,i.count=0,i}return i.ZT(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(p.L);function qr(t){return function(e){return e.lift(new Zr(t))}}var Zr=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new Nt.W}return t.prototype.call=function(t,e){return 0===this._skipCount?e.subscribe(new p.L(t)):e.subscribe(new Wr(t,this._skipCount))},t}(),Wr=function(t){function e(e,r){var i=t.call(this,e)||this;return i._skipCount=r,i._count=0,i._ring=new Array(r),i}return i.ZT(e,t),e.prototype._next=function(t){var e=this._skipCount,r=this._count++;if(r<e)this._ring[r]=t;else{var i=r%e,n=this._ring,s=n[i];n[i]=t,this.destination.next(s)}},e}(p.L);function Yr(t){return function(e){return e.lift(new Jr(t))}}var Jr=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new Xr(t,this.notifier))},t}(),Xr=function(t){function e(e,r){var i=t.call(this,e)||this;i.hasValue=!1;var s=new n.IY(i);i.add(s),i.innerSubscription=s;var o=(0,n.ft)(r,s);return o!==s&&(i.add(o),i.innerSubscription=o),i}return i.ZT(e,t),e.prototype._next=function(e){this.hasValue&&t.prototype._next.call(this,e)},e.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(n.Ds);function Qr(t){return function(e){return e.lift(new ti(t))}}var ti=function(){function t(t){this.predicate=t}return t.prototype.call=function(t,e){return e.subscribe(new ei(t,this.predicate))},t}(),ei=function(t){function e(e,r){var i=t.call(this,e)||this;return i.predicate=r,i.skipping=!0,i.index=0,i}return i.ZT(e,t),e.prototype._next=function(t){var e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)},e.prototype.tryCallPredicate=function(t){try{var e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(t){this.destination.error(t)}},e}(p.L);function ri(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return(0,y.K)(r)?(t.pop(),function(e){return(0,G.z)(t,e,r)}):function(e){return(0,G.z)(t,e)}}var ii=r(4858),ni=r(6712),si=function(t){function e(e,r,i){void 0===r&&(r=0),void 0===i&&(i=ii.e);var n=t.call(this)||this;return n.source=e,n.delayTime=r,n.scheduler=i,(!(0,ni.k)(r)||r<0)&&(n.delayTime=0),i&&"function"==typeof i.schedule||(n.scheduler=ii.e),n}return i.ZT(e,t),e.create=function(t,r,i){return void 0===r&&(r=0),void 0===i&&(i=ii.e),new e(t,r,i)},e.dispatch=function(t){var e=t.source,r=t.subscriber;return this.add(e.subscribe(r))},e.prototype._subscribe=function(t){var r=this.delayTime,i=this.source;return this.scheduler.schedule(e.dispatch,r,{source:i,subscriber:t})},e}(bt.y);function oi(t,e){return void 0===e&&(e=0),function(r){return r.lift(new ai(t,e))}}var ai=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new si(e,this.delay,this.scheduler).subscribe(t)},t}();function ci(t,e){return"function"==typeof e?function(r){return r.pipe(ci((function(r,i){return(0,F.D)(t(r,i)).pipe((0,Jt.U)((function(t,n){return e(r,t,i,n)})))})))}:function(e){return e.lift(new ui(t))}}var ui=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new hi(t,this.project))},t}(),hi=function(t){function e(e,r){var i=t.call(this,e)||this;return i.project=r,i.index=0,i}return i.ZT(e,t),e.prototype._next=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this._innerSub(e)},e.prototype._innerSub=function(t){var e=this.innerSubscription;e&&e.unsubscribe();var r=new n.IY(this),i=this.destination;i.add(r),this.innerSubscription=(0,n.ft)(t,r),this.innerSubscription!==r&&i.add(this.innerSubscription)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=void 0},e.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t){this.destination.next(t)},e}(n.Ds);function fi(){return ci(fe.y)}function li(t,e){return e?ci((function(){return t}),e):ci((function(){return t}))}function di(t){return function(e){return e.lift(new pi(t))}}var pi=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var r=new bi(t),i=(0,n.ft)(this.notifier,new n.IY(r));return i&&!r.seenValue?(r.add(i),e.subscribe(r)):r},t}(),bi=function(t){function e(e){var r=t.call(this,e)||this;return r.seenValue=!1,r}return i.ZT(e,t),e.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(n.Ds);function gi(t,e){return void 0===e&&(e=!1),function(r){return r.lift(new mi(t,e))}}var mi=function(){function t(t,e){this.predicate=t,this.inclusive=e}return t.prototype.call=function(t,e){return e.subscribe(new vi(t,this.predicate,this.inclusive))},t}(),vi=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.predicate=r,n.inclusive=i,n.index=0,n}return i.ZT(e,t),e.prototype._next=function(t){var e,r=this.destination;try{e=this.predicate(t,this.index++)}catch(t){return void r.error(t)}this.nextOrComplete(t,e)},e.prototype.nextOrComplete=function(t,e){var r=this.destination;Boolean(e)?r.next(t):(this.inclusive&&r.next(t),r.complete())},e}(p.L),yi=r(4582),wi=r(7371);function _i(t,e,r){return function(i){return i.lift(new Ei(t,e,r))}}var Ei=function(){function t(t,e,r){this.nextOrObserver=t,this.error=e,this.complete=r}return t.prototype.call=function(t,e){return e.subscribe(new Si(t,this.nextOrObserver,this.error,this.complete))},t}(),Si=function(t){function e(e,r,i,n){var s=t.call(this,e)||this;return s._tapNext=yi.Z,s._tapError=yi.Z,s._tapComplete=yi.Z,s._tapError=i||yi.Z,s._tapComplete=n||yi.Z,(0,wi.m)(r)?(s._context=s,s._tapNext=r):r&&(s._context=r,s._tapNext=r.next||yi.Z,s._tapError=r.error||yi.Z,s._tapComplete=r.complete||yi.Z),s}return i.ZT(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(p.L),Ai={leading:!0,trailing:!1};function Oi(t,e){return void 0===e&&(e=Ai),function(r){return r.lift(new Ti(t,!!e.leading,!!e.trailing))}}var Ti=function(){function t(t,e,r){this.durationSelector=t,this.leading=e,this.trailing=r}return t.prototype.call=function(t,e){return e.subscribe(new xi(t,this.durationSelector,this.leading,this.trailing))},t}(),xi=function(t){function e(e,r,i,n){var s=t.call(this,e)||this;return s.destination=e,s.durationSelector=r,s._leading=i,s._trailing=n,s._hasValue=!1,s}return i.ZT(e,t),e.prototype._next=function(t){this._hasValue=!0,this._sendValue=t,this._throttled||(this._leading?this.send():this.throttle(t))},e.prototype.send=function(){var t=this._hasValue,e=this._sendValue;t&&(this.destination.next(e),this.throttle(e)),this._hasValue=!1,this._sendValue=void 0},e.prototype.throttle=function(t){var e=this.tryDurationSelector(t);e&&this.add(this._throttled=(0,n.ft)(e,new n.IY(this)))},e.prototype.tryDurationSelector=function(t){try{return this.durationSelector(t)}catch(t){return this.destination.error(t),null}},e.prototype.throttlingDone=function(){var t=this._throttled,e=this._trailing;t&&t.unsubscribe(),this._throttled=void 0,e&&this.send()},e.prototype.notifyNext=function(){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(n.Ds);function Ri(t,e,r){return void 0===e&&(e=c.P),void 0===r&&(r=Ai),function(i){return i.lift(new Pi(t,e,r.leading,r.trailing))}}var Pi=function(){function t(t,e,r,i){this.duration=t,this.scheduler=e,this.leading=r,this.trailing=i}return t.prototype.call=function(t,e){return e.subscribe(new Ii(t,this.duration,this.scheduler,this.leading,this.trailing))},t}(),Ii=function(t){function e(e,r,i,n,s){var o=t.call(this,e)||this;return o.duration=r,o.scheduler=i,o.leading=n,o.trailing=s,o._hasTrailingValue=!1,o._trailingValue=null,o}return i.ZT(e,t),e.prototype._next=function(t){this.throttled?this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Ni,this.duration,{subscriber:this})),this.leading?this.destination.next(t):this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var t=this.throttled;t&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),t.unsubscribe(),this.remove(t),this.throttled=null)},e}(p.L);function Ni(t){t.subscriber.clearThrottle()}var Mi=r(6542);function ki(t){return void 0===t&&(t=c.P),function(e){return(0,Mi.P)((function(){return e.pipe(Ie((function(e,r){var i=e.current;return{value:r,current:t.now(),last:i}}),{current:t.now(),value:void 0,last:void 0}),(0,Jt.U)((function(t){var e=t.current,r=t.last,i=t.value;return new Li(i,e-r)})))}))}}var Li=function(){return function(t,e){this.value=t,this.interval=e}}(),Ci=r(5915);function Bi(t,e,r){return void 0===r&&(r=c.P),function(i){var n=ut(t),s=n?+t-r.now():Math.abs(t);return i.lift(new Di(s,n,e,r))}}var Di=function(){function t(t,e,r,i){this.waitFor=t,this.absoluteTimeout=e,this.withObservable=r,this.scheduler=i}return t.prototype.call=function(t,e){return e.subscribe(new Ui(t,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),Ui=function(t){function e(e,r,i,n,s){var o=t.call(this,e)||this;return o.absoluteTimeout=r,o.waitFor=i,o.withObservable=n,o.scheduler=s,o.scheduleTimeout(),o}return i.ZT(e,t),e.dispatchTimeout=function(t){var e=t.withObservable;t._unsubscribeAndRecycle(),t.add((0,n.ft)(e,new n.IY(t)))},e.prototype.scheduleTimeout=function(){var t=this.action;t?this.action=t.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(e){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,e)},e.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},e}(n.Ds),ji=r(4236);function Ki(t,e){return void 0===e&&(e=c.P),Bi(t,(0,ji._)(new Ci.W),e)}function Vi(t){return void 0===t&&(t=c.P),(0,Jt.U)((function(e){return new Fi(e,t.now())}))}var Fi=function(){return function(t,e){this.value=t,this.timestamp=e}}();function Hi(t,e,r){return 0===r?[e]:(t.push(e),t)}function Gi(){return Le(Hi,[])}function $i(t){return function(e){return e.lift(new zi(t))}}var zi=function(){function t(t){this.windowBoundaries=t}return t.prototype.call=function(t,e){var r=new qi(t),i=e.subscribe(r);return i.closed||r.add((0,n.ft)(this.windowBoundaries,new n.IY(r))),i},t}(),qi=function(t){function e(e){var r=t.call(this,e)||this;return r.window=new nr.xQ,e.next(r.window),r}return i.ZT(e,t),e.prototype.notifyNext=function(){this.openWindow()},e.prototype.notifyError=function(t){this._error(t)},e.prototype.notifyComplete=function(){this._complete()},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var t=this.window;t&&t.complete();var e=this.destination,r=this.window=new nr.xQ;e.next(r)},e}(n.Ds);function Zi(t,e){return void 0===e&&(e=0),function(r){return r.lift(new Wi(t,e))}}var Wi=function(){function t(t,e){this.windowSize=t,this.startWindowEvery=e}return t.prototype.call=function(t,e){return e.subscribe(new Yi(t,this.windowSize,this.startWindowEvery))},t}(),Yi=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.destination=e,n.windowSize=r,n.startWindowEvery=i,n.windows=[new nr.xQ],n.count=0,e.next(n.windows[0]),n}return i.ZT(e,t),e.prototype._next=function(t){for(var e=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,r=this.destination,i=this.windowSize,n=this.windows,s=n.length,o=0;o<s&&!this.closed;o++)n[o].next(t);var a=this.count-i+1;if(a>=0&&a%e==0&&!this.closed&&n.shift().complete(),++this.count%e==0&&!this.closed){var c=new nr.xQ;n.push(c),r.next(c)}},e.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(p.L);function Ji(t){var e=c.P,r=null,i=Number.POSITIVE_INFINITY;return(0,y.K)(arguments[3])&&(e=arguments[3]),(0,y.K)(arguments[2])?e=arguments[2]:(0,ni.k)(arguments[2])&&(i=Number(arguments[2])),(0,y.K)(arguments[1])?e=arguments[1]:(0,ni.k)(arguments[1])&&(r=Number(arguments[1])),function(n){return n.lift(new Xi(t,r,i,e))}}var Xi=function(){function t(t,e,r,i){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=r,this.scheduler=i}return t.prototype.call=function(t,e){return e.subscribe(new tn(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),Qi=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._numberOfNextedValues=0,e}return i.ZT(e,t),e.prototype.next=function(e){this._numberOfNextedValues++,t.prototype.next.call(this,e)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(nr.xQ),tn=function(t){function e(e,r,i,n,s){var o=t.call(this,e)||this;o.destination=e,o.windowTimeSpan=r,o.windowCreationInterval=i,o.maxWindowSize=n,o.scheduler=s,o.windows=[];var a=o.openWindow();if(null!==i&&i>=0){var c={subscriber:o,window:a,context:null},u={windowTimeSpan:r,windowCreationInterval:i,subscriber:o,scheduler:s};o.add(s.schedule(nn,r,c)),o.add(s.schedule(rn,i,u))}else{var h={subscriber:o,window:a,windowTimeSpan:r};o.add(s.schedule(en,r,h))}return o}return i.ZT(e,t),e.prototype._next=function(t){for(var e=this.windows,r=e.length,i=0;i<r;i++){var n=e[i];n.closed||(n.next(t),n.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(n))}},e.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},e.prototype.openWindow=function(){var t=new Qi;return this.windows.push(t),this.destination.next(t),t},e.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},e}(p.L);function en(t){var e=t.subscriber,r=t.windowTimeSpan,i=t.window;i&&e.closeWindow(i),t.window=e.openWindow(),this.schedule(t,r)}function rn(t){var e=t.windowTimeSpan,r=t.subscriber,i=t.scheduler,n=t.windowCreationInterval,s=r.openWindow(),o=this,a={action:o,subscription:null},c={subscriber:r,window:s,context:a};a.subscription=i.schedule(nn,e,c),o.add(a.subscription),o.schedule(t,n)}function nn(t){var e=t.subscriber,r=t.window,i=t.context;i&&i.action&&i.subscription&&i.action.remove(i.subscription),e.closeWindow(r)}function sn(t,e){return function(r){return r.lift(new on(t,e))}}var on=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new an(t,this.openings,this.closingSelector))},t}(),an=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.openings=r,n.closingSelector=i,n.contexts=[],n.add(n.openSubscription=(0,R.D)(n,r,r)),n}return i.ZT(e,t),e.prototype._next=function(t){var e=this.contexts;if(e)for(var r=e.length,i=0;i<r;i++)e[i].window.next(t)},e.prototype._error=function(e){var r=this.contexts;if(this.contexts=null,r)for(var i=r.length,n=-1;++n<i;){var s=r[n];s.window.error(e),s.subscription.unsubscribe()}t.prototype._error.call(this,e)},e.prototype._complete=function(){var e=this.contexts;if(this.contexts=null,e)for(var r=e.length,i=-1;++i<r;){var n=e[i];n.window.complete(),n.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.contexts;if(this.contexts=null,t)for(var e=t.length,r=-1;++r<e;){var i=t[r];i.window.unsubscribe(),i.subscription.unsubscribe()}},e.prototype.notifyNext=function(t,e,r,i,n){if(t===this.openings){var s=void 0;try{s=(0,this.closingSelector)(e)}catch(t){return this.error(t)}var o=new nr.xQ,a=new x.w,c={window:o,subscription:a};this.contexts.push(c);var u=(0,R.D)(this,s,c);u.closed?this.closeWindow(this.contexts.length-1):(u.context=c,a.add(u)),this.destination.next(o)}else this.closeWindow(this.contexts.indexOf(t))},e.prototype.notifyError=function(t){this.error(t)},e.prototype.notifyComplete=function(t){t!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(t.context))},e.prototype.closeWindow=function(t){if(-1!==t){var e=this.contexts,r=e[t],i=r.window,n=r.subscription;e.splice(t,1),i.complete(),n.unsubscribe()}},e}(P.L);function cn(t){return function(e){return e.lift(new un(t))}}var un=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new hn(t,this.closingSelector))},t}(),hn=function(t){function e(e,r){var i=t.call(this,e)||this;return i.destination=e,i.closingSelector=r,i.openWindow(),i}return i.ZT(e,t),e.prototype.notifyNext=function(t,e,r,i,n){this.openWindow(n)},e.prototype.notifyError=function(t){this._error(t)},e.prototype.notifyComplete=function(t){this.openWindow(t)},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t),this.unsubscribeClosingNotification()},e.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},e.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},e.prototype.openWindow=function(t){void 0===t&&(t=null),t&&(this.remove(t),t.unsubscribe());var e=this.window;e&&e.complete();var r,i=this.window=new nr.xQ;this.destination.next(i);try{r=(0,this.closingSelector)()}catch(t){return this.destination.error(t),void this.window.error(t)}this.add(this.closingNotification=(0,R.D)(this,r))},e}(P.L);function fn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var r;"function"==typeof t[t.length-1]&&(r=t.pop());var i=t;return e.lift(new ln(i,r))}}var ln=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new dn(t,this.observables,this.project))},t}(),dn=function(t){function e(e,r,i){var n=t.call(this,e)||this;n.observables=r,n.project=i,n.toRespond=[];var s=r.length;n.values=new Array(s);for(var o=0;o<s;o++)n.toRespond.push(o);for(o=0;o<s;o++){var a=r[o];n.add((0,R.D)(n,a,void 0,o))}return n}return i.ZT(e,t),e.prototype.notifyNext=function(t,e,r){this.values[r]=e;var i=this.toRespond;if(i.length>0){var n=i.indexOf(r);-1!==n&&i.splice(n,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(P.L),pn=r(1131);function bn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(pn.$R.apply(void 0,[e].concat(t)))}}function gn(t){return function(e){return e.lift(new pn.mx(t))}}},2995:(t,e,r)=>{"use strict";r.d(e,{ZT:()=>n});var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},i(t,e)};function n(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}},7834:(t,e,r)=>{var i=r(8834),n=i.Buffer;function s(t,e){for(var r in t)e[r]=t[r]}function o(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(s(i,e),e.Buffer=o),o.prototype=Object.create(n.prototype),s(n,o),o.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},o.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},3327:(t,e,r)=>{var i=r(7834).Buffer;function n(t,e){this._block=i.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}n.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=i.from(t,e));for(var r=this._block,n=this._blockSize,s=t.length,o=this._len,a=0;a<s;){for(var c=o%n,u=Math.min(s-a,n-c),h=0;h<u;h++)r[c+h]=t[a+h];a+=u,(o+=u)%n==0&&this._update(r)}return this._len+=s,this},n.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n},9065:(t,e,r)=>{var i=t.exports=function(t){t=t.toLowerCase();var e=i[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};i.sha=r(8820),i.sha1=r(7885),i.sha224=r(8321),i.sha256=r(4424),i.sha384=r(213),i.sha512=r(5596)},8820:(t,e,r)=>{var i=r(1285),n=r(3327),s=r(7834).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,n.call(this,64,56)}function u(t){return t<<30|t>>>2}function h(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(c,n),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,s=0|this._c,a=0|this._d,c=0|this._e,f=0;f<16;++f)r[f]=t.readInt32BE(4*f);for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16];for(var l=0;l<80;++l){var d=~~(l/20),p=0|((e=i)<<5|e>>>27)+h(d,n,s,a)+c+r[l]+o[d];c=a,a=s,s=u(n),n=i,i=p}this._a=i+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var t=s.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=c},7885:(t,e,r)=>{var i=r(1285),n=r(3327),s=r(7834).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,n.call(this,64,56)}function u(t){return t<<5|t>>>27}function h(t){return t<<30|t>>>2}function f(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(c,n),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,s=0|this._c,a=0|this._d,c=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=(e=r[l-3]^r[l-8]^r[l-14]^r[l-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),b=u(i)+f(p,n,s,a)+c+r[d]+o[p]|0;c=a,a=s,s=h(n),n=i,i=b}this._a=i+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var t=s.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=c},8321:(t,e,r)=>{var i=r(1285),n=r(4424),s=r(3327),o=r(7834).Buffer,a=new Array(64);function c(){this.init(),this._w=a,s.call(this,64,56)}i(c,n),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var t=o.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=c},4424:(t,e,r)=>{var i=r(1285),n=r(3327),s=r(7834).Buffer,o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function c(){this.init(),this._w=a,n.call(this,64,56)}function u(t,e,r){return r^t&(e^r)}function h(t,e,r){return t&e|r&(t|e)}function f(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function l(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}i(c,n),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,s=0|this._c,a=0|this._d,c=0|this._e,p=0|this._f,b=0|this._g,g=0|this._h,m=0;m<16;++m)r[m]=t.readInt32BE(4*m);for(;m<64;++m)r[m]=0|(((e=r[m-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[m-7]+d(r[m-15])+r[m-16];for(var v=0;v<64;++v){var y=g+l(c)+u(c,p,b)+o[v]+r[v]|0,w=f(i)+h(i,n,s)|0;g=b,b=p,p=c,c=a+y|0,a=s,s=n,n=i,i=y+w|0}this._a=i+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=g+this._h|0},c.prototype._hash=function(){var t=s.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=c},213:(t,e,r)=>{var i=r(1285),n=r(5596),s=r(3327),o=r(7834).Buffer,a=new Array(160);function c(){this.init(),this._w=a,s.call(this,128,112)}i(c,n),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var t=o.allocUnsafe(48);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=c},5596:(t,e,r)=>{var i=r(1285),n=r(3327),s=r(7834).Buffer,o=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function c(){this.init(),this._w=a,n.call(this,128,112)}function u(t,e,r){return r^t&(e^r)}function h(t,e,r){return t&e|r&(t|e)}function f(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function l(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function b(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function m(t,e){return t>>>0<e>>>0?1:0}i(c,n),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(t){for(var e=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,s=0|this._dh,a=0|this._eh,c=0|this._fh,v=0|this._gh,y=0|this._hh,w=0|this._al,_=0|this._bl,E=0|this._cl,S=0|this._dl,A=0|this._el,O=0|this._fl,T=0|this._gl,x=0|this._hl,R=0;R<32;R+=2)e[R]=t.readInt32BE(4*R),e[R+1]=t.readInt32BE(4*R+4);for(;R<160;R+=2){var P=e[R-30],I=e[R-30+1],N=d(P,I),M=p(I,P),k=b(P=e[R-4],I=e[R-4+1]),L=g(I,P),C=e[R-14],B=e[R-14+1],D=e[R-32],U=e[R-32+1],j=M+B|0,K=N+C+m(j,M)|0;K=(K=K+k+m(j=j+L|0,L)|0)+D+m(j=j+U|0,U)|0,e[R]=K,e[R+1]=j}for(var V=0;V<160;V+=2){K=e[V],j=e[V+1];var F=h(r,i,n),H=h(w,_,E),G=f(r,w),$=f(w,r),z=l(a,A),q=l(A,a),Z=o[V],W=o[V+1],Y=u(a,c,v),J=u(A,O,T),X=x+q|0,Q=y+z+m(X,x)|0;Q=(Q=(Q=Q+Y+m(X=X+J|0,J)|0)+Z+m(X=X+W|0,W)|0)+K+m(X=X+j|0,j)|0;var tt=$+H|0,et=G+F+m(tt,$)|0;y=v,x=T,v=c,T=O,c=a,O=A,a=s+Q+m(A=S+X|0,S)|0,s=n,S=E,n=i,E=_,i=r,_=w,r=Q+et+m(w=X+tt|0,X)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+E|0,this._dl=this._dl+S|0,this._el=this._el+A|0,this._fl=this._fl+O|0,this._gl=this._gl+T|0,this._hl=this._hl+x|0,this._ah=this._ah+r+m(this._al,w)|0,this._bh=this._bh+i+m(this._bl,_)|0,this._ch=this._ch+n+m(this._cl,E)|0,this._dh=this._dh+s+m(this._dl,S)|0,this._eh=this._eh+a+m(this._el,A)|0,this._fh=this._fh+c+m(this._fl,O)|0,this._gh=this._gh+v+m(this._gl,T)|0,this._hh=this._hh+y+m(this._hl,x)|0},c.prototype._hash=function(){var t=s.allocUnsafe(64);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=c},4851:(t,e,r)=>{t.exports=n;var i=r(2699).EventEmitter;function n(){i.call(this)}r(1285)(n,i),n.Readable=r(8051),n.Writable=r(2557),n.Duplex=r(7073),n.Transform=r(7640),n.PassThrough=r(5163),n.finished=r(9885),n.pipeline=r(3495),n.Stream=n,n.prototype.pipe=function(t,e){var r=this;function n(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function s(){r.readable&&r.resume&&r.resume()}r.on("data",n),t.on("drain",s),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",c));var o=!1;function a(){o||(o=!0,t.end())}function c(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(h(),0===i.listenerCount(this,"error"))throw t}function h(){r.removeListener("data",n),t.removeListener("drain",s),r.removeListener("end",a),r.removeListener("close",c),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",h),r.removeListener("close",h),t.removeListener("close",h)}return r.on("error",u),t.on("error",u),r.on("end",h),r.on("close",h),t.on("close",h),t.emit("pipe",r),t}},214:(t,e,r)=>{"use strict";var i=r(7834).Buffer,n=i.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===n||!n(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=c,this.end=u,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=h,this.end=f,e=3;break;default:return this.write=l,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function c(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function h(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.s=s,s.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},s.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},s.prototype.text=function(t,e){var r=function(t,e,r){var i=e.length-1;if(i<r)return 0;var n=o(e[i]);if(n>=0)return n>0&&(t.lastNeed=n-1),n;if(--i<r||-2===n)return 0;if((n=o(e[i]))>=0)return n>0&&(t.lastNeed=n-2),n;if(--i<r||-2===n)return 0;if((n=o(e[i]))>=0)return n>0&&(2===n?n=0:t.lastNeed=n-3),n;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},s.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},8743:t=>{t.exports=function(t){return ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength):Buffer.from(t)}},5803:(t,e,r)=>{function i(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(i("noDeprecation"))return t;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(e);i("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},5543:(t,e,r)=>{"use strict";r.r(e),r.d(e,{HttpBackend:()=>l,HttpRequestFailed:()=>f,HttpResponseError:()=>h,STATUS_CODE:()=>i,VERSION:()=>a});var i,n=r(1825),s=r.n(n);function o(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))}!function(t){t[t.CONTINUE=100]="CONTINUE",t[t.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",t[t.PROCESSING=102]="PROCESSING",t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.RESET_CONTENT=205]="RESET_CONTENT",t[t.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",t[t.MULTI_STATUS=207]="MULTI_STATUS",t[t.ALREADY_REPORTED=208]="ALREADY_REPORTED",t[t.IM_USED=226]="IM_USED",t[t.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.FOUND=302]="FOUND",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.USE_PROXY=305]="USE_PROXY",t[t.SWITCH_PROXY=306]="SWITCH_PROXY",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",t[t.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",t[t.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",t[t.CONFLICT=409]="CONFLICT",t[t.GONE=410]="GONE",t[t.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",t[t.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",t[t.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",t[t.URI_TOO_LONG=414]="URI_TOO_LONG",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",t[t.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",t[t.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",t[t.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",t[t.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",t[t.LOCKED=423]="LOCKED",t[t.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",t[t.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",t[t.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",t[t.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t[t.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",t[t.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",t[t.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",t[t.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",t[t.LOOP_DETECTED=508]="LOOP_DETECTED",t[t.NOT_EXTENDED=510]="NOT_EXTENDED",t[t.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"}(i||(i={}));const a={commitHash:"d474f2ac7abec2e8faddba47cf403a0c0203c7d5",version:"14.2.0-beta-RC.0"},c="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node?void 0:r.e(462).then(r.bind(r,9462)).then((t=>t.default)).catch((()=>{}));var u;!function(t){t.TEXT="text",t.JSON="json"}(u||(u={}));class h extends Error{constructor(t,e,r,i,n){super(t),this.message=t,this.status=e,this.statusText=r,this.body=i,this.url=n,this.name="HttpResponse"}}class f extends Error{constructor(t){super(t),this.message=t,this.name="HttpRequestFailed"}}class l{constructor(t=3e4){this.timeout=t}serialize(t){if(!t)return"";const e=[];for(const r in t)if(t.hasOwnProperty(r)&&void 0!==t[r]){const i="function"==typeof t[r].toJSON?t[r].toJSON():t[r];if(null===i){e.push(encodeURIComponent(r));continue}if(Array.isArray(i)){i.forEach((t=>{e.push(encodeURIComponent(r)+"="+encodeURIComponent(t))}));continue}e.push(encodeURIComponent(r)+"="+encodeURIComponent(i))}const r=e.join("&");return r?`?${r}`:""}createRequest({url:t,method:e,timeout:r=this.timeout,query:i,headers:n={},json:a=!0},l){return o(this,void 0,void 0,(function*(){let o,d;n["Content-Type"]||(n["Content-Type"]="application/json"),a?o=u.JSON:(o=u.TEXT,d=[t=>t]);try{const a=c&&(yield c);return(yield s().request({url:t+this.serialize(i),method:null!=e?e:"GET",headers:n,responseType:o,transformResponse:d,timeout:r,data:l,adapter:a})).data}catch(r){if(s().isAxiosError(r)&&r.response){let e;throw e="object"==typeof r.response.data?JSON.stringify(r.response.data):r.response.data,new h(`Http error response: (${r.response.status}) ${e}`,r.response.status,r.response.statusText,e,t+this.serialize(i))}throw new f(`${e} ${t+this.serialize(i)} ${String(r)}`)}}))}}},1825:(t,e,r)=>{t.exports=r(6244)},3557:(t,e,r)=>{"use strict";var i=r(7751),n=r(4084),s=r(922),o=r(3514),a=r(9702),c=r(4929),u=r(1105),h=r(9013),f=r(8715),l=r(4310);t.exports=function(t){return new Promise((function(e,r){var d,p=t.data,b=t.headers,g=t.responseType;function m(){t.cancelToken&&t.cancelToken.unsubscribe(d),t.signal&&t.signal.removeEventListener("abort",d)}i.isFormData(p)&&delete b["Content-Type"];var v=new XMLHttpRequest;if(t.auth){var y=t.auth.username||"",w=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";b.Authorization="Basic "+btoa(y+":"+w)}var _=a(t.baseURL,t.url);function E(){if(v){var i="getAllResponseHeaders"in v?c(v.getAllResponseHeaders()):null,s={data:g&&"text"!==g&&"json"!==g?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:i,config:t,request:v};n((function(t){e(t),m()}),(function(t){r(t),m()}),s),v=null}}if(v.open(t.method.toUpperCase(),o(_,t.params,t.paramsSerializer),!0),v.timeout=t.timeout,"onloadend"in v?v.onloadend=E:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(E)},v.onabort=function(){v&&(r(h("Request aborted",t,"ECONNABORTED",v)),v=null)},v.onerror=function(){r(h("Network Error",t,null,v)),v=null},v.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",i=t.transitional||f;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(h(e,t,i.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",v)),v=null},i.isStandardBrowserEnv()){var S=(t.withCredentials||u(_))&&t.xsrfCookieName?s.read(t.xsrfCookieName):void 0;S&&(b[t.xsrfHeaderName]=S)}"setRequestHeader"in v&&i.forEach(b,(function(t,e){void 0===p&&"content-type"===e.toLowerCase()?delete b[e]:v.setRequestHeader(e,t)})),i.isUndefined(t.withCredentials)||(v.withCredentials=!!t.withCredentials),g&&"json"!==g&&(v.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&v.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(d=function(t){v&&(r(!t||t&&t.type?new l("canceled"):t),v.abort(),v=null)},t.cancelToken&&t.cancelToken.subscribe(d),t.signal&&(t.signal.aborted?d():t.signal.addEventListener("abort",d))),p||(p=null),v.send(p)}))}},6244:(t,e,r)=>{"use strict";var i=r(7751),n=r(3958),s=r(3439),o=r(8301);var a=function t(e){var r=new s(e),a=n(s.prototype.request,r);return i.extend(a,s.prototype,r),i.extend(a,r),a.create=function(r){return t(o(e,r))},a}(r(6973));a.Axios=s,a.Cancel=r(4310),a.CancelToken=r(3219),a.isCancel=r(785),a.VERSION=r(7002).version,a.all=function(t){return Promise.all(t)},a.spread=r(7079),a.isAxiosError=r(834),t.exports=a,t.exports.default=a},4310:t=>{"use strict";function e(t){this.message=t}e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},e.prototype.__CANCEL__=!0,t.exports=e},3219:(t,e,r)=>{"use strict";var i=r(4310);function n(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,i=r._listeners.length;for(e=0;e<i;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,i=new Promise((function(t){r.subscribe(t),e=t})).then(t);return i.cancel=function(){r.unsubscribe(e)},i},t((function(t){r.reason||(r.reason=new i(t),e(r.reason))}))}n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},n.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},n.source=function(){var t;return{token:new n((function(e){t=e})),cancel:t}},t.exports=n},785:t=>{"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},3439:(t,e,r)=>{"use strict";var i=r(7751),n=r(3514),s=r(272),o=r(8507),a=r(8301),c=r(9203),u=c.validators;function h(t){this.defaults=t,this.interceptors={request:new s,response:new s}}h.prototype.request=function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var r=e.transitional;void 0!==r&&c.assertOptions(r,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var i=[],n=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,i.unshift(t.fulfilled,t.rejected))}));var s,h=[];if(this.interceptors.response.forEach((function(t){h.push(t.fulfilled,t.rejected)})),!n){var f=[o,void 0];for(Array.prototype.unshift.apply(f,i),f=f.concat(h),s=Promise.resolve(e);f.length;)s=s.then(f.shift(),f.shift());return s}for(var l=e;i.length;){var d=i.shift(),p=i.shift();try{l=d(l)}catch(t){p(t);break}}try{s=o(l)}catch(t){return Promise.reject(t)}for(;h.length;)s=s.then(h.shift(),h.shift());return s},h.prototype.getUri=function(t){return t=a(this.defaults,t),n(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},i.forEach(["delete","get","head","options"],(function(t){h.prototype[t]=function(e,r){return this.request(a(r||{},{method:t,url:e,data:(r||{}).data}))}})),i.forEach(["post","put","patch"],(function(t){h.prototype[t]=function(e,r,i){return this.request(a(i||{},{method:t,url:e,data:r}))}})),t.exports=h},272:(t,e,r)=>{"use strict";var i=r(7751);function n(){this.handlers=[]}n.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},n.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},n.prototype.forEach=function(t){i.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=n},9702:(t,e,r)=>{"use strict";var i=r(6481),n=r(4647);t.exports=function(t,e){return t&&!i(e)?n(t,e):e}},9013:(t,e,r)=>{"use strict";var i=r(24);t.exports=function(t,e,r,n,s){var o=new Error(t);return i(o,e,r,n,s)}},8507:(t,e,r)=>{"use strict";var i=r(7751),n=r(9217),s=r(785),o=r(6973),a=r(4310);function c(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new a("canceled")}t.exports=function(t){return c(t),t.headers=t.headers||{},t.data=n.call(t,t.data,t.headers,t.transformRequest),t.headers=i.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),i.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||o.adapter)(t).then((function(e){return c(t),e.data=n.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return s(e)||(c(t),e&&e.response&&(e.response.data=n.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},24:t=>{"use strict";t.exports=function(t,e,r,i,n){return t.config=e,r&&(t.code=r),t.request=i,t.response=n,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t}},8301:(t,e,r)=>{"use strict";var i=r(7751);t.exports=function(t,e){e=e||{};var r={};function n(t,e){return i.isPlainObject(t)&&i.isPlainObject(e)?i.merge(t,e):i.isPlainObject(e)?i.merge({},e):i.isArray(e)?e.slice():e}function s(r){return i.isUndefined(e[r])?i.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function o(t){if(!i.isUndefined(e[t]))return n(void 0,e[t])}function a(r){return i.isUndefined(e[r])?i.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function c(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c};return i.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,n=e(t);i.isUndefined(n)&&e!==c||(r[t]=n)})),r}},4084:(t,e,r)=>{"use strict";var i=r(9013);t.exports=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(i("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)}},9217:(t,e,r)=>{"use strict";var i=r(7751),n=r(6973);t.exports=function(t,e,r){var s=this||n;return i.forEach(r,(function(r){t=r.call(s,t,e)})),t}},6973:(t,e,r)=>{"use strict";var i=r(7751),n=r(5453),s=r(24),o=r(8715),a={"Content-Type":"application/x-www-form-urlencoded"};function c(t,e){!i.isUndefined(t)&&i.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var u,h={transitional:o,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(u=r(3557)),u),transformRequest:[function(t,e){return n(e,"Accept"),n(e,"Content-Type"),i.isFormData(t)||i.isArrayBuffer(t)||i.isBuffer(t)||i.isStream(t)||i.isFile(t)||i.isBlob(t)?t:i.isArrayBufferView(t)?t.buffer:i.isURLSearchParams(t)?(c(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):i.isObject(t)||e&&"application/json"===e["Content-Type"]?(c(e,"application/json"),function(t,e,r){if(i.isString(t))try{return(e||JSON.parse)(t),i.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||h.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,o=!r&&"json"===this.responseType;if(o||n&&i.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(o){if("SyntaxError"===t.name)throw s(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};i.forEach(["delete","get","head"],(function(t){h.headers[t]={}})),i.forEach(["post","put","patch"],(function(t){h.headers[t]=i.merge(a)})),t.exports=h},8715:t=>{"use strict";t.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},7002:t=>{t.exports={version:"0.26.1"}},3958:t=>{"use strict";t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),i=0;i<r.length;i++)r[i]=arguments[i];return t.apply(e,r)}}},3514:(t,e,r)=>{"use strict";var i=r(7751);function n(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,r){if(!e)return t;var s;if(r)s=r(e);else if(i.isURLSearchParams(e))s=e.toString();else{var o=[];i.forEach(e,(function(t,e){null!=t&&(i.isArray(t)?e+="[]":t=[t],i.forEach(t,(function(t){i.isDate(t)?t=t.toISOString():i.isObject(t)&&(t=JSON.stringify(t)),o.push(n(e)+"="+n(t))})))})),s=o.join("&")}if(s){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}},4647:t=>{"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},922:(t,e,r)=>{"use strict";var i=r(7751);t.exports=i.isStandardBrowserEnv()?{write:function(t,e,r,n,s,o){var a=[];a.push(t+"="+encodeURIComponent(e)),i.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),i.isString(n)&&a.push("path="+n),i.isString(s)&&a.push("domain="+s),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},6481:t=>{"use strict";t.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}},834:(t,e,r)=>{"use strict";var i=r(7751);t.exports=function(t){return i.isObject(t)&&!0===t.isAxiosError}},1105:(t,e,r)=>{"use strict";var i=r(7751);t.exports=i.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var i=t;return e&&(r.setAttribute("href",i),i=r.href),r.setAttribute("href",i),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=n(window.location.href),function(e){var r=i.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}},5453:(t,e,r)=>{"use strict";var i=r(7751);t.exports=function(t,e){i.forEach(t,(function(r,i){i!==e&&i.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[i])}))}},4929:(t,e,r)=>{"use strict";var i=r(7751),n=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,r,s,o={};return t?(i.forEach(t.split("\n"),(function(t){if(s=t.indexOf(":"),e=i.trim(t.substr(0,s)).toLowerCase(),r=i.trim(t.substr(s+1)),e){if(o[e]&&n.indexOf(e)>=0)return;o[e]="set-cookie"===e?(o[e]?o[e]:[]).concat([r]):o[e]?o[e]+", "+r:r}})),o):o}},7079:t=>{"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},9203:(t,e,r)=>{"use strict";var i=r(7002).version,n={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){n[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var s={};n.transitional=function(t,e,r){function n(t,e){return"[Axios v"+i+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,i,o){if(!1===t)throw new Error(n(i," has been removed"+(e?" in "+e:"")));return e&&!s[i]&&(s[i]=!0,console.warn(n(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,i,o)}},t.exports={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var i=Object.keys(t),n=i.length;n-- >0;){var s=i[n],o=e[s];if(o){var a=t[s],c=void 0===a||o(a,s,t);if(!0!==c)throw new TypeError("option "+s+" must be "+c)}else if(!0!==r)throw Error("Unknown option "+s)}},validators:n}},7751:(t,e,r)=>{"use strict";var i=r(3958),n=Object.prototype.toString;function s(t){return Array.isArray(t)}function o(t){return void 0===t}function a(t){return"[object ArrayBuffer]"===n.call(t)}function c(t){return null!==t&&"object"==typeof t}function u(t){if("[object Object]"!==n.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function h(t){return"[object Function]"===n.call(t)}function f(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),s(t))for(var r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.call(null,t[n],n,t)}t.exports={isArray:s,isArrayBuffer:a,isBuffer:function(t){return null!==t&&!o(t)&&null!==t.constructor&&!o(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"[object FormData]"===n.call(t)},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&a(t.buffer)},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:c,isPlainObject:u,isUndefined:o,isDate:function(t){return"[object Date]"===n.call(t)},isFile:function(t){return"[object File]"===n.call(t)},isBlob:function(t){return"[object Blob]"===n.call(t)},isFunction:h,isStream:function(t){return c(t)&&h(t.pipe)},isURLSearchParams:function(t){return"[object URLSearchParams]"===n.call(t)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:f,merge:function t(){var e={};function r(r,i){u(e[i])&&u(r)?e[i]=t(e[i],r):u(r)?e[i]=t({},r):s(r)?e[i]=r.slice():e[i]=r}for(var i=0,n=arguments.length;i<n;i++)f(arguments[i],r);return e},extend:function(t,e,r){return f(e,(function(e,n){t[n]=r&&"function"==typeof e?i(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}}},5078:(t,e,r)=>{"use strict";r.r(e),r.d(e,{CODEC:()=>a,LocalForger:()=>Rt,ProtocolsHash:()=>At,Uint8ArrayConsumer:()=>A,VERSION:()=>Ot,decoders:()=>wt,encoders:()=>_t,getCodec:()=>xt,localForger:()=>Pt,opMapping:()=>c,opMappingReverse:()=>u});var i=r(4632),n=r(2558);const s=t=>t.reduce(((t,e)=>t+e.toString(16).padStart(2,"0")),""),o=(t,e=8)=>t.toString(16).padStart(e,"0");var a;!function(t){t.SECRET="secret",t.RAW="raw",t.TZ1="tz1",t.BRANCH="branch",t.ZARITH="zarith",t.PUBLIC_KEY="public_key",t.PKH="pkh",t.DELEGATE="delegate",t.SCRIPT="script",t.BALLOT_STATEMENT="ballotStmt",t.PROPOSAL="proposal",t.PROPOSAL_ARR="proposalArr",t.INT32="int32",t.INT16="int16",t.PARAMETERS="parameters",t.ADDRESS="address",t.SMART_CONTRACT_ADDRESS="smart_contract_address",t.VALUE="value",t.MANAGER="manager",t.BLOCK_PAYLOAD_HASH="blockPayloadHash",t.ENTRYPOINT="entrypoint",t.OPERATION="operation",t.OP_ACTIVATE_ACCOUNT="activate_account",t.OP_DELEGATION="delegation",t.OP_TRANSACTION="transaction",t.OP_ORIGINATION="origination",t.OP_BALLOT="ballot",t.OP_ENDORSEMENT="endorsement",t.OP_SEED_NONCE_REVELATION="seed_nonce_revelation",t.OP_REVEAL="reveal",t.OP_PROPOSALS="proposals",t.OP_REGISTER_GLOBAL_CONSTANT="register_global_constant",t.OP_TRANSFER_TICKET="transfer_ticket",t.OP_TX_ROLLUP_ORIGINATION="tx_rollup_origination",t.OP_TX_ROLLUP_SUBMIT_BATCH="tx_rollup_submit_batch",t.BURN_LIMIT="burn_limit",t.TX_ROLLUP_ORIGINATION_PARAM="tx_rollup_origination_param",t.TX_ROLLUP_ID="tx_rollup_id",t.TX_ROLLUP_BATCH_CONTENT="tx_rollup_batch_content",t.OP_INCREASE_PAID_STORAGE="increase_paid_storage"}(a||(a={}));const c={"00":"parameter","01":"storage","02":"code","03":"False","04":"Elt","05":"Left","06":"None","07":"Pair","08":"Right","09":"Some","0a":"True","0b":"Unit","0c":"PACK","0d":"UNPACK","0e":"BLAKE2B","0f":"SHA256",10:"SHA512",11:"ABS",12:"ADD",13:"AMOUNT",14:"AND",15:"BALANCE",16:"CAR",17:"CDR",18:"CHECK_SIGNATURE",19:"COMPARE","1a":"CONCAT","1b":"CONS","1c":"CREATE_ACCOUNT","1d":"CREATE_CONTRACT","1e":"IMPLICIT_ACCOUNT","1f":"DIP",20:"DROP",21:"DUP",22:"EDIV",23:"EMPTY_MAP",24:"EMPTY_SET",25:"EQ",26:"EXEC",27:"FAILWITH",28:"GE",29:"GET","2a":"GT","2b":"HASH_KEY","2c":"IF","2d":"IF_CONS","2e":"IF_LEFT","2f":"IF_NONE",30:"INT",31:"LAMBDA",32:"LE",33:"LEFT",34:"LOOP",35:"LSL",36:"LSR",37:"LT",38:"MAP",39:"MEM","3a":"MUL","3b":"NEG","3c":"NEQ","3d":"NIL","3e":"NONE","3f":"NOT",40:"NOW",41:"OR",42:"PAIR",43:"PUSH",44:"RIGHT",45:"SIZE",46:"SOME",47:"SOURCE",48:"SENDER",49:"SELF","4a":"STEPS_TO_QUOTA","4b":"SUB","4c":"SWAP","4d":"TRANSFER_TOKENS","4e":"SET_DELEGATE","4f":"UNIT",50:"UPDATE",51:"XOR",52:"ITER",53:"LOOP_LEFT",54:"ADDRESS",55:"CONTRACT",56:"ISNAT",57:"CAST",58:"RENAME",59:"bool","5a":"contract","5b":"int","5c":"key","5d":"key_hash","5e":"lambda","5f":"list",60:"map",61:"big_map",62:"nat",63:"option",64:"or",65:"pair",66:"set",67:"signature",68:"string",69:"bytes","6a":"mutez","6b":"timestamp","6c":"unit","6d":"operation","6e":"address","6f":"SLICE",70:"DIG",71:"DUG",72:"EMPTY_BIG_MAP",73:"APPLY",74:"chain_id",75:"CHAIN_ID",76:"LEVEL",77:"SELF_ADDRESS",78:"never",79:"NEVER","7a":"UNPAIR","7b":"VOTING_POWER","7c":"TOTAL_VOTING_POWER","7d":"KECCAK","7e":"SHA3","7f":"PAIRING_CHECK",80:"bls12_381_g1",81:"bls12_381_g2",82:"bls12_381_fr",83:"sapling_state",84:"sapling_transaction_deprecated",85:"SAPLING_EMPTY_STATE",86:"SAPLING_VERIFY_UPDATE",87:"ticket",88:"TICKET",89:"READ_TICKET","8a":"SPLIT_TICKET","8b":"JOIN_TICKETS","8c":"GET_AND_UPDATE","8d":"chest","8e":"chest_key","8f":"OPEN_CHEST",90:"VIEW",91:"view",92:"constant",93:"SUB_MUTEZ",94:"tx_rollup_l2_address",95:"MIN_BLOCK_TIME",96:"sapling_transaction",97:"EMIT"},u=(()=>{const t={};return Object.keys(c).forEach((e=>{t[c[e]]=e})),t})(),h={4:"activate_account",107:"reveal",110:"delegation",108:"transaction",109:"origination",6:"ballot",21:"endorsement",1:"seed_nonce_revelation",5:"proposals",111:"register_global_constant",150:"tx_rollup_origination",151:"tx_rollup_submit_batch",158:"transfer_ticket",113:"increase_paid_storage"},f=(()=>{const t={};return Object.keys(h).forEach((e=>{const r="string"==typeof e?parseInt(e,10):e;t[h[r]]=o(r,2)})),t})(),l={"00":"default","01":"root","02":"do","03":"set_delegate","04":"remove_delegate"},d=(()=>{const t={};return Object.keys(l).forEach((e=>{t[l[e]]=e})),t})();class p extends Error{constructor(t){super(t),this.message=t,this.name="InvalidBlockHashError"}}class b extends Error{constructor(t){super(t),this.message=t,this.name="InvalidOperationSchemaError"}}class g extends Error{constructor(t){super(`Oversized entrypoint: ${t}. The maximum length of entrypoint is 31`),this.entrypoint=t,this.name="OversizedEntryPointError"}}class m extends Error{constructor(t){super(`The ballot value '${t}' is invalid`),this.ballotValue=t,this.name="InvalidBallotValueError"}}class v extends Error{constructor(t){super(`Failed to decode ballot value ${t}`),this.ballotValue=t,this.name="DecodeBallotValueError"}}class y extends Error{constructor(t){super(`The hex string '${t}' is invalid`),this.hexString=t,this.name="InvalidHexStringError"}}class w extends Error{constructor(t){super(`Failed to encode michelson value '${t}'`),this.value=t,this.name="UnexpectedMichelsonValueError"}}class _ extends Error{constructor(t){super(t),this.message=t,this.name="OperationDecodingError"}}class E extends Error{constructor(t){super(t),this.message=t,this.name="OperationEncodingError"}}class S extends Error{constructor(t){super(`The operation '${t}' is unsupported`),this.op=t,this.name="UnsupportedOperationError"}}class A{constructor(t,e=0){this.arr=t,this.offset=e}static fromHexString(t){const e=t.toLowerCase();if(/^(([a-f]|\d){2})*$/.test(e)){const t=new Uint8Array((e.match(/([a-z]|\d){2}/g)||[]).map((t=>parseInt(t,16))));return new A(t)}throw new y(e)}consume(t){const e=this.arr.subarray(this.offset,this.offset+t);return this.offset+=t,e}get(t){return this.arr[this.offset+t]}length(){return this.arr.length-this.offset}}const O=t=>{if(Array.isArray(t)){const e=t.map((t=>O(t))).join(""),r=e.length/2;return`02${o(r)}${e}`}if((t=>"prim"in t)(t))return L(t);if((t=>"bytes"in t&&"string"==typeof t.bytes)(t))return R(t);if((t=>"string"in t&&"string"==typeof t.string)(t))return I(t);if((t=>"int"in t&&"string"==typeof t.int)(t))return M(t);throw new w(JSON.stringify(t))},T=t=>{const e=t.consume(1);switch(e[0]){case 10:return P(t);case 1:return N(t);case 0:return k(t);case 2:{const e=new A(x(t)),r=[];for(;e.length()>0;)r.push(T(e));return r}default:return C(t,e)}},x=(t,e=4)=>{const r=t.consume(e),i=parseInt(Buffer.from(r).toString("hex"),16);return t.consume(i)},R=t=>{if(!/^([A-Fa-f0-9]{2})*$/.test(t.bytes))throw new y(t.bytes);const e=t.bytes.length/2;return`0a${o(e)}${t.bytes}`},P=t=>{const e=x(t);return{bytes:Buffer.from(e).toString("hex")}},I=t=>{const e=Buffer.from(t.string,"utf8").toString("hex"),r=e.length/2;return`01${o(r)}${e}`},N=t=>{const e=x(t);return{string:Buffer.from(e).toString("utf8")}},M=({int:t})=>{const e=new n.O(t,10),r="-"===e.toString(2)[0]?"1":"0",i=e.toString(2).replace(/-/g,""),s=i.length<=6?6:(i.length-6)%7?i.length+7-(i.length-6)%7:i.length,o=i.padStart(s,"0").match(/\d{6,7}/g).reverse();o[0]=r+o[0];return`00${o.map(((t,e)=>parseInt((e===o.length-1?"0":"1")+t,2).toString(16).padStart(2,"0"))).join("")}`},k=t=>{let e=t.consume(1)[0];const r=[];for(;128&e;)r.push(e),e=t.consume(1)[0];r.push(e);const i=!!(64&r[0]);r[0]=127&r[0];const s=r.map(((t,e)=>t.toString(2).slice(0===e?-6:-7).padStart(0===e?6:7,"0"))).reverse();let o=new n.O(s.join(""),2);return i&&(o=o.times(-1)),{int:o.toFixed()}},L=t=>{const e=+Array.isArray(t.annots),r=Array.isArray(t.args)?t.args.length:0,i=o(Math.min(2*r+e+3,9),2),n=u[t.prim];let s=(t.args||[]).map((t=>O(t))).join("");const a=Array.isArray(t.annots)?U(t.annots):"";return"LAMBDA"===t.prim&&r&&(s=o(s.length/2)+s+o(0)),("pair"===t.prim||"Pair"===t.prim)&&r>2&&(s=""===a?o(s.length/2)+s+o(0):o(s.length/2)+s),"view"===t.prim&&t.args&&(s=o(s.length/2)+s+o(0)),`${i}${n}${s}${a}`},C=(t,e)=>{const r=(e[0]-3)%2==1;let i=Math.floor((e[0]-3)/2);const n=t.consume(1)[0].toString(16).padStart(2,"0"),s={prim:c[n]};if("LAMBDA"===c[n]&&t.consume(4),"view"===c[n])return 0!=i?B(t,s):s;let o,a;("pair"===c[n]||"Pair"===c[n])&&i>2&&(o=D(t),i=0,a=j(t));const u=new Array(i).fill(0).map((()=>T(t)));return"LAMBDA"===c[n]&&t.consume(4),o?s.args=o:u.length&&(s.args=u),a&&""!==a[0]?s.annots=a:r&&(s.annots=j(t)),s},B=(t,e)=>(t.consume(4),e.args=new Array(4).fill(0).map((()=>T(t))),t.consume(4),e),D=t=>{const e=new A(x(t)),r=[];for(;e.length()>0;)r.push(T(e));return r},U=t=>{const e=t.map((t=>Buffer.from(t,"utf8").toString("hex"))).join("20"),r=e.length/2;return`${o(r)}${e}`},j=t=>{const e=t.consume(4),r=parseInt(Buffer.from(e).toString("hex"),16),i=t.consume(r);return Buffer.from(i).toString("hex").split("20").map((t=>Buffer.from(t,"hex").toString("utf8")))},K=t=>e=>(0,i.buf2hex)(Buffer.from((0,i.b58cdecode)(e,i.prefix[t]))),V=t=>e=>{const r=e.consume(i.prefixLength[t]);return(0,i.b58cencode)(r,i.prefix[t])},F=V(i.Prefix.TZ1),H=V(i.Prefix.B),G=t=>{const e=t.consume(1);return 0===e[0]?V(i.Prefix.TZ1)(t):1===e[0]?V(i.Prefix.TZ2)(t):2===e[0]?V(i.Prefix.TZ3)(t):void 0},$=K(i.Prefix.B),z=K(i.Prefix.TZ1),q=t=>t?"ff":"00",Z=t=>K(i.Prefix.P)(t),W=t=>V(i.Prefix.P)(t),Y=t=>{switch(t.substr(0,3)){case i.Prefix.TZ1:return"00"+K(i.Prefix.TZ1)(t);case i.Prefix.TZ2:return"01"+K(i.Prefix.TZ2)(t);case i.Prefix.TZ3:return"02"+K(i.Prefix.TZ3)(t);default:throw new i.InvalidKeyHashError(t)}},J=t=>{const e=[];let r=new n.Z(t,10);if(r.isNaN())throw new TypeError(`Invalid zarith number ${t}`);for(;;){if(r.lt(128)){r.lt(16)&&e.push("0"),e.push(r.toString(16));break}{let t=r.mod(128);r=r.minus(t),r=r.dividedBy(128),t=t.plus(128),e.push(t.toString(16))}}return e.join("")},X=t=>{let e=0;for(;e<t.length()&&0!=(128&t.get(e));)e+=1;let r=new n.Z(0);for(let i=e;i>=0;i-=1){const e=127&t.get(i);r=r.multipliedBy(128),r=r.plus(e)}return t.consume(e+1),new n.Z(r).toString()},Q=K(i.Prefix.VH),tt=V(i.Prefix.VH),et=K(i.Prefix.TXR1),rt=V(i.Prefix.TXR1),it={branch:a.BRANCH,contents:[a.OPERATION]},nt={pkh:a.TZ1,secret:a.SECRET},st={source:a.PKH,fee:a.ZARITH,counter:a.ZARITH,gas_limit:a.ZARITH,storage_limit:a.ZARITH,public_key:a.PUBLIC_KEY},ot={source:a.PKH,fee:a.ZARITH,counter:a.ZARITH,gas_limit:a.ZARITH,storage_limit:a.ZARITH,delegate:a.DELEGATE},at={source:a.PKH,fee:a.ZARITH,counter:a.ZARITH,gas_limit:a.ZARITH,storage_limit:a.ZARITH,amount:a.ZARITH,destination:a.ADDRESS,parameters:a.PARAMETERS},ct={source:a.PKH,fee:a.ZARITH,counter:a.ZARITH,gas_limit:a.ZARITH,storage_limit:a.ZARITH,balance:a.ZARITH,delegate:a.DELEGATE,script:a.SCRIPT},ut={source:a.PKH,period:a.INT32,proposal:a.PROPOSAL,ballot:a.BALLOT_STATEMENT},ht={slot:a.INT16,level:a.INT32,round:a.INT32,block_payload_hash:a.BLOCK_PAYLOAD_HASH},ft={level:a.INT32,nonce:a.RAW},lt={source:a.PKH,period:a.INT32,proposals:a.PROPOSAL_ARR},dt={source:a.PKH,fee:a.ZARITH,counter:a.ZARITH,gas_limit:a.ZARITH,storage_limit:a.ZARITH,value:a.VALUE},pt={source:a.PKH,fee:a.ZARITH,counter:a.ZARITH,gas_limit:a.ZARITH,storage_limit:a.ZARITH,ticket_contents:a.VALUE,ticket_ty:a.VALUE,ticket_ticketer:a.ADDRESS,ticket_amount:a.ZARITH,destination:a.ADDRESS,entrypoint:a.ENTRYPOINT},bt={source:a.PKH,fee:a.ZARITH,counter:a.ZARITH,gas_limit:a.ZARITH,storage_limit:a.ZARITH,tx_rollup_origination:a.TX_ROLLUP_ORIGINATION_PARAM},gt={source:a.PKH,fee:a.ZARITH,counter:a.ZARITH,gas_limit:a.ZARITH,storage_limit:a.ZARITH,rollup:a.TX_ROLLUP_ID,content:a.TX_ROLLUP_BATCH_CONTENT,burn_limit:a.BURN_LIMIT},mt={source:a.PKH,fee:a.ZARITH,counter:a.ZARITH,gas_limit:a.ZARITH,storage_limit:a.ZARITH,amount:a.ZARITH,destination:a.SMART_CONTRACT_ADDRESS},vt=t=>e=>r=>Object.keys(e).reduce(((i,n)=>{const s=e[n];if(r&&Array.isArray(s)){const e=t[s[0]],o=r[n];if(!Array.isArray(o))throw new E(`Expected value to be Array ${JSON.stringify(o)}`);return i+o.reduce(((t,r)=>t+e(r)),"")}return i+(0,t[s])(r[n])}),""),yt=t=>e=>r=>Object.keys(e).reduce(((i,n)=>{const s=e[n];if(Array.isArray(s)){const e=t[s[0]],o=[],a=r.length();for(;r.length()>0;)if(o.push(e(r)),a===r.length())throw new _("Unable to decode value");return Object.assign(Object.assign({},i),{[n]:o})}{const e=(0,t[s])(r);return void 0!==e?Object.assign(Object.assign({},i),{[n]:e}):Object.assign({},i)}}),{}),wt={[a.SECRET]:t=>s(t.consume(20)),[a.RAW]:t=>s(t.consume(32)),[a.TZ1]:F,[a.BRANCH]:H,[a.ZARITH]:X,[a.PUBLIC_KEY]:t=>{switch(t.consume(1)[0]){case 0:return V(i.Prefix.EDPK)(t);case 1:return V(i.Prefix.SPPK)(t);case 2:return V(i.Prefix.P2PK)(t);default:throw new i.InvalidPublicKeyError(t.toString())}},[a.PKH]:G,[a.DELEGATE]:t=>{const e=(t=>255===t.consume(1)[0])(t);if(e)return G(t)},[a.INT32]:t=>{const e=t.consume(4);let r=0;for(let t=0;t<e.length;t++)r|=e[t]<<8*(e.length-(t+1));return r},[a.SCRIPT]:t=>{const e=x(t),r=x(t);return{code:T(new A(e)),storage:T(new A(r))}},[a.BALLOT_STATEMENT]:t=>{const e=t.consume(1);switch(e[0]){case 0:return"yay";case 1:return"nay";case 2:return"pass";default:throw new v(e[0].toString())}},[a.PROPOSAL]:W,[a.PROPOSAL_ARR]:t=>{const e=[];for(t.consume(4);t.length()>0;)e.push(W(t));return e},[a.PARAMETERS]:t=>{if(0!==t.consume(1)[0]){const e=(t=>{const e=o(t.consume(1)[0],2);if(e in l)return l[e];{const e=x(t,1),r=Buffer.from(e).toString("utf8");if(r.length>31)throw new g(r);return r}})(t),r=x(t);return{entrypoint:e,value:T(new A(r))}}},[a.ADDRESS]:t=>{switch(t.consume(1)[0]){case 0:return G(t);case 1:{const e=V(i.Prefix.KT1)(t);return t.consume(1),e}default:throw new i.InvalidAddressError(t.toString())}},[a.SMART_CONTRACT_ADDRESS]:t=>{if(1===t.consume(1)[0]){const e=V(i.Prefix.KT1)(t);return t.consume(1),e}throw new i.InvalidContractAddressError(t.toString())},[a.VALUE]:t=>{const e=x(t);return T(new A(e))},[a.INT16]:t=>{const e=t.consume(2);let r=0;for(let t=0;t<e.length;t++)r|=e[t]<<8*(e.length-(t+1));return r},[a.BLOCK_PAYLOAD_HASH]:tt,[a.ENTRYPOINT]:t=>{const e=x(t);return Buffer.from(e).toString("utf8")},[a.TX_ROLLUP_ORIGINATION_PARAM]:t=>({}),[a.TX_ROLLUP_ID]:rt,[a.TX_ROLLUP_BATCH_CONTENT]:t=>{const e=x(t);return Buffer.from(e).toString("hex")},[a.BURN_LIMIT]:t=>{const e=t.consume(1);if("00"!==Buffer.from(e).toString("hex"))return X(t)}};wt[a.OPERATION]=(t=>e=>{const r=e.consume(1),i=h[r[0]];if(void 0===i)throw new S(r[0].toString());const n=t[i](e);if("object"!=typeof n)throw new _("Decoded invalid operation");return Object.assign({kind:i},n)})(wt),wt[a.OP_ACTIVATE_ACCOUNT]=t=>yt(wt)(nt)(t),wt[a.OP_DELEGATION]=t=>yt(wt)(ot)(t),wt[a.OP_TRANSACTION]=t=>yt(wt)(at)(t),wt[a.OP_ORIGINATION]=t=>yt(wt)(ct)(t),wt[a.OP_BALLOT]=t=>yt(wt)(ut)(t),wt[a.OP_ENDORSEMENT]=t=>yt(wt)(ht)(t),wt[a.OP_SEED_NONCE_REVELATION]=t=>yt(wt)(ft)(t),wt[a.OP_PROPOSALS]=t=>yt(wt)(lt)(t),wt[a.OP_REVEAL]=t=>yt(wt)(st)(t),wt[a.OP_REGISTER_GLOBAL_CONSTANT]=t=>yt(wt)(dt)(t),wt[a.OP_TRANSFER_TICKET]=t=>yt(wt)(pt)(t),wt[a.OP_TX_ROLLUP_ORIGINATION]=t=>yt(wt)(bt)(t),wt[a.OP_TX_ROLLUP_SUBMIT_BATCH]=t=>yt(wt)(gt)(t),wt[a.OP_INCREASE_PAID_STORAGE]=t=>yt(wt)(mt)(t),wt[a.MANAGER]=yt(wt)(it);const _t={[a.SECRET]:t=>t,[a.RAW]:t=>t,[a.TZ1]:z,[a.BRANCH]:$,[a.ZARITH]:J,[a.PUBLIC_KEY]:t=>{switch(t.substr(0,4)){case i.Prefix.EDPK:return"00"+K(i.Prefix.EDPK)(t);case i.Prefix.SPPK:return"01"+K(i.Prefix.SPPK)(t);case i.Prefix.P2PK:return"02"+K(i.Prefix.P2PK)(t);default:throw new i.InvalidPublicKeyError(t)}},[a.PKH]:Y,[a.DELEGATE]:t=>t?q(!0)+Y(t):q(!1),[a.SCRIPT]:t=>{const e=O(t.code),r=O(t.storage);return`${o(e.length/2,8)}${e}${o(r.length/2,8)}${r}`},[a.BALLOT_STATEMENT]:t=>{switch(t){case"yay":return"00";case"nay":return"01";case"pass":return"02";default:throw new m(t)}},[a.PROPOSAL]:Z,[a.PROPOSAL_ARR]:t=>o(32*t.length)+t.map((t=>Z(t))).join(""),[a.INT32]:t=>{const e=parseInt(String(t),10),r=[];for(let t=0;t<4;t++){const i=8*(4-(t+1));r.push((e&255<<i)>>i)}return Buffer.from(r).toString("hex")},[a.PARAMETERS]:t=>{if(!t||"default"===t.entrypoint&&"prim"in t.value&&"Unit"===t.value.prim)return"00";const e=(t=>{if(t in d)return`${d[t]}`;if(t.length>31)throw new g(t);return`ff${O({string:t}).slice(8)}`})(t.entrypoint),r=O(t.value);return`ff${e}${(r.length/2).toString(16).padStart(8,"0")}${r}`},[a.ADDRESS]:t=>{switch(t.substr(0,3)){case i.Prefix.TZ1:case i.Prefix.TZ2:case i.Prefix.TZ3:return"00"+Y(t);case i.Prefix.KT1:return"01"+K(i.Prefix.KT1)(t)+"00";default:throw new i.InvalidAddressError(t)}},[a.SMART_CONTRACT_ADDRESS]:t=>{if(t.substring(0,3)===i.Prefix.KT1)return"01"+K(i.Prefix.KT1)(t)+"00";throw new i.InvalidContractAddressError(t)},[a.VALUE]:t=>{const e=O(t);return`${o(e.length/2)}${e}`},[a.INT16]:t=>{const e=parseInt(String(t),10),r=[];for(let t=0;t<2;t++){const i=8*(2-(t+1));r.push((e&255<<i)>>i)}return Buffer.from(r).toString("hex")},[a.BLOCK_PAYLOAD_HASH]:Q,[a.ENTRYPOINT]:t=>`${O({string:t}).slice(2)}`,[a.TX_ROLLUP_ORIGINATION_PARAM]:t=>"",[a.TX_ROLLUP_ID]:et,[a.TX_ROLLUP_BATCH_CONTENT]:t=>`${o(t.length/2)}${t}`,[a.BURN_LIMIT]:t=>t?`ff${J(t)}`:"00"};_t[a.OPERATION]=(t=>e=>{if(!(e.kind in t)||!(e.kind in f))throw new i.InvalidOperationKindError(e.kind);return f[e.kind]+t[e.kind](e)})(_t),_t[a.OP_ACTIVATE_ACCOUNT]=t=>vt(_t)(nt)(t),_t[a.OP_DELEGATION]=t=>vt(_t)(ot)(t),_t[a.OP_TRANSACTION]=t=>vt(_t)(at)(t),_t[a.OP_ORIGINATION]=t=>vt(_t)(ct)(t),_t[a.OP_BALLOT]=t=>vt(_t)(ut)(t),_t[a.OP_ENDORSEMENT]=t=>vt(_t)(ht)(t),_t[a.OP_SEED_NONCE_REVELATION]=t=>vt(_t)(ft)(t),_t[a.OP_PROPOSALS]=t=>vt(_t)(lt)(t),_t[a.OP_REVEAL]=t=>vt(_t)(st)(t),_t[a.OP_REGISTER_GLOBAL_CONSTANT]=t=>vt(_t)(dt)(t),_t[a.OP_TRANSFER_TICKET]=t=>vt(_t)(pt)(t),_t[a.OP_TX_ROLLUP_ORIGINATION]=t=>vt(_t)(bt)(t),_t[a.OP_TX_ROLLUP_SUBMIT_BATCH]=t=>vt(_t)(gt)(t),_t[a.OP_INCREASE_PAID_STORAGE]=t=>vt(_t)(mt)(t),_t[a.MANAGER]=vt(_t)(it);const Et={activate_account:nt,reveal:st,delegation:ot,transaction:at,origination:ct,ballot:ut,endorsement:ht,seed_nonce_revelation:ft,proposals:lt,register_global_constant:dt,transfer_ticket:pt,tx_rollup_origination:bt,tx_rollup_submit_batch:gt,increase_paid_storage:mt},St=t=>{const e=t.kind,r=Object.keys(t),i=(n="kind",r.filter((t=>t!==n)));var n;const s=Object.keys(Et[e]);return o=i,s.filter((t=>!o.includes(t)));var o};var At;!function(t){t.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",t.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",t.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",t.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",t.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",t.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",t.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",t.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",t.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",t.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",t.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",t.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",t.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(At||(At={}));const Ot={commitHash:"d474f2ac7abec2e8faddba47cf403a0c0203c7d5",version:"14.2.0-beta-RC.0"},Tt=At.Psithaca2;function xt(t,e){return{encoder:_t[t],decoder:e=>{const r=A.fromHexString(e);return wt[t](r)}}}class Rt{constructor(t=Tt){this.protocolHash=t,this.codec=xt(a.MANAGER,this.protocolHash)}forge(t){if((0,i.validateBlock)(t.branch)!==i.ValidationResult.VALID)throw new p(`The block hash ${t.branch} is invalid`);for(const r of t.contents){if(e=r.kind,!Object.keys(Et).includes(e))throw new i.InvalidOperationKindError(r.kind);const t=St(r);if(1===t.length){if("delegation"===r.kind&&"delegate"===t[0])continue;if("origination"===r.kind&&"delegate"===t[0])continue;if("transaction"===r.kind&&"parameters"===t[0])continue;if("tx_rollup_submit_batch"===r.kind&&"burn_limit"===t[0])continue;throw new b(`Missing properties: ${t.join(", ").toString()}`)}if(t.length>1)throw new b(`Missing properties: ${t.join(", ").toString()}`)}var e;const r=this.codec.encoder(t).toLowerCase();return Promise.resolve(r)}parse(t){return Promise.resolve(this.codec.decoder(t))}}const Pt=new Rt},9985:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Contract:()=>rr,DefaultProtocol:()=>p,JSONParseError:()=>C,MacroError:()=>v,MichelineParseError:()=>L,MichelsonError:()=>ut,MichelsonInstructionError:()=>Le,MichelsonTypeError:()=>ft,MichelsonValidationError:()=>Nt,Parser:()=>K,ProtoGreaterOfEqual:()=>g,ProtoInferiorTo:()=>m,Protocol:()=>d,VERSION:()=>ar,assertContractValid:()=>Ze,assertDataListIfAny:()=>ne,assertDataValid:()=>We,assertMichelsonBigMapStorableType:()=>zt,assertMichelsonComparableType:()=>Vt,assertMichelsonContract:()=>Xt,assertMichelsonData:()=>Jt,assertMichelsonInstruction:()=>Kt,assertMichelsonPackableType:()=>Ft,assertMichelsonPassableType:()=>$t,assertMichelsonPushableType:()=>Ht,assertMichelsonStorableType:()=>Gt,assertMichelsonType:()=>Wt,assertTypeAnnotationsValid:()=>je,assertTypesEqual:()=>Je,assertViewNameValid:()=>Zt,contractEntryPoint:()=>ze,contractEntryPoints:()=>qe,contractSection:()=>He,contractViews:()=>Ge,decodeAddressBytes:()=>Ne,decodePublicKeyBytes:()=>ke,decodePublicKeyHashBytes:()=>Me,dummyContract:()=>ir,emitMicheline:()=>$,formatError:()=>or,formatStack:()=>nr,functionType:()=>Ye,instructionIDs:()=>Rt,isContractValid:()=>Qe,isDataValid:()=>tr,isInstruction:()=>ie,isMichelsonCode:()=>ee,isMichelsonData:()=>te,isMichelsonError:()=>ht,isMichelsonScript:()=>Qt,isMichelsonType:()=>re,isTypeAnnotationsValid:()=>Xe,isTypeEqual:()=>er,packData:()=>Oe,packDataBytes:()=>Te,refContract:()=>l,sourceReference:()=>i,traceDumpFunc:()=>sr,unpackData:()=>Pe,unpackDataBytes:()=>Ie});const i=Symbol("source_reference");class n extends Error{constructor(t,e,r){super(r),this.src=t,this.idx=e,Object.setPrototypeOf(this,n.prototype)}}var s;!function(t){t[t.Comment=0]="Comment",t[t.Number=1]="Number",t[t.String=2]="String",t[t.Bytes=3]="Bytes",t[t.Ident=4]="Ident"}(s||(s={}));const o=new RegExp("\\s"),a=new RegExp("[:@%_A-Za-z]"),c=new RegExp("[@%_\\.A-Za-z0-9]"),u=new RegExp("[0-9]"),h=new RegExp("[0-9a-fA-F]");function*f(t,e=!1){let r=0;for(;r<t.length;){for(;r<t.length&&o.test(t[r]);)r++;if(r===t.length)return;const i=t[r],f=r;if(a.test(i)){for(r++;r<t.length&&c.test(t[r]);)r++;yield{t:s.Ident,v:t.slice(f,r),first:f,last:r}}else if(t.length-r>1&&"0x"===t.substr(r,2)){for(r+=2;r<t.length&&h.test(t[r]);)r++;if(0!=(r-f&1))throw new n(t,r,"Bytes literal length is expected to be power of two");yield{t:s.Bytes,v:t.slice(f,r),first:f,last:r}}else if(u.test(i)||"-"===i){"-"===i&&r++;const e=r;for(;r<t.length&&u.test(t[r]);)r++;if(e===r)throw new n(t,r,"Number literal is too short");yield{t:s.Number,v:t.slice(f,r),first:f,last:r}}else if('"'===i){r++;let e=!1;for(;r<t.length&&(e||'"'!==t[r]);r++)e=!e&&"\\"===t[r];if(r===t.length)throw new n(t,r,"Unterminated string literal");r++,yield{t:s.String,v:t.slice(f,r),first:f,last:r}}else if("#"===i){for(r++;r<t.length&&"\n"!==t[r];)r++;e&&(yield{t:s.Comment,v:t.slice(f,r),first:f,last:r})}else if(t.length-r>1&&"/*"===t.substr(r,2)){for(r+=2;r<t.length&&!(t.length-r>1&&"*/"===t.substr(r,2));)r++;if(r===t.length)throw new n(t,r,"Unterminated C style comment");r+=2,e&&(yield{t:s.Comment,v:t.slice(f,r),first:f,last:r})}else{if("("!==i&&")"!==i&&"{"!==i&&"}"!==i&&";"!==i)throw new n(t,r,`Invalid character at offset ${r}: \`${i}'`);r++,yield{t:i,v:i,first:f,last:r}}}}const l=Symbol("ref_contract");var d;!function(t){t.Ps9mPmXa="Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P",t.PtCJ7pwo="PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY",t.PsYLVpVv="PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",t.PsddFKi3="PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP",t.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",t.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",t.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",t.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",t.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",t.PtEdoTez="PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq",t.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",t.PsFLoren="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",t.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",t.PtGRANAD="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",t.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",t.PtHangzH="PtHangzHogokSuiMHemCuowEavgYTP8J5qQ9fQS793MHYFpCY3r",t.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",t.PsiThaCa="PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP",t.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",t.PtJakarta="PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw",t.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",t.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",t.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(d||(d={}));const p=d.Psithaca2,b={Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P:0,PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY:1,PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt:2,PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP:3,Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd:4,PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU:5,PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS:5,PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb:6,PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo:7,PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq:8,PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA:8,PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i:9,PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV:10,PtHangzHogokSuiMHemCuowEavgYTP8J5qQ9fQS793MHYFpCY3r:11,PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx:11,PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP:12,Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A:12,PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw:13,PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY:13,PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg:14,ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK:15};function g(t,e){return b[t]>=b[e]}function m(t,e){return b[t]<b[e]}class v extends Error{constructor(t,e){super(e),this.prim=t,Object.setPrototypeOf(this,v.prototype)}}function y(t,e){var r,i;if(0===e&&void 0===t.args||(null===(r=t.args)||void 0===r?void 0:r.length)===e)return!0;throw new v(t,`macro ${t.prim} expects ${e} arguments, was given ${null===(i=t.args)||void 0===i?void 0:i.length}`)}function w(t){if(void 0===t.annots)return!0;throw new v(t,`unexpected annotation on macro ${t.prim}: ${t.annots}`)}function _(t,e){if("int"in e)return!0;throw new v(t,`macro ${t.prim} expects int argument`)}function E(t,e,r,i){let n=0,s=0;const o=[null,null];let a;if(n===e.length)throw new v(t,`unexpected end: ${t.prim}`);let c,u=e[n++];switch(u){case"P":{const{r:o,n:c,an:u}=E(t,e.slice(n),r.slice(s),i);a=o,n+=c,s+=u;break}case"A":s!==r.length&&(o[0]=r[s++]);break;default:throw new v(t,`${t.prim}: unexpected character: ${u}`)}if(n===e.length)throw new v(t,`unexpected end: ${t.prim}`);switch(u=e[n++],u){case"P":{const{r:o,n:a,an:u}=E(t,e.slice(n),r.slice(s),i);c=o.map((([t,e])=>[t+1,e])),n+=a,s+=u;break}case"I":s!==r.length&&(o[1]=r[s++]);break;default:throw new v(t,`${t.prim}: unexpected character: ${u}`)}return{r:i(a,c,[0,o]),n,an:s}}function S(t,e,r,i){const n=e[0];switch(n){case"A":return e.length>1?[{prim:"DUP"},{prim:"DIP",args:[[{prim:"CAR",annots:["@%%"]},S(t,e.slice(1),[],i)]]},{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:["%@","%@",...r]}]:i.a;case"D":return e.length>1?[{prim:"DUP"},{prim:"DIP",args:[[{prim:"CDR",annots:["@%%"]},S(t,e.slice(1),[],i)]]},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@","%@",...r]}]:i.d;default:throw new v(t,`${t.prim}: unexpected character: ${n}`)}}function A(t,e){let r=t.length;for(;r>0&&t[r-1]===e;)r--;return t.slice(0,r)}function O(t){const e=[],r=[];if(void 0!==t)for(const i of t)(0!==i.length&&"%"===i[0]?e:r).push(i);return{fields:e,rest:r}}function T({prim:t,annots:e,args:r}){return Object.assign(Object.assign({prim:t},e&&{annots:e}),r&&{args:r})}const x=/^P[PAI]{3,}R$/,R=/^UNP[PAI]{2,}R$/,P=/^C[AD]{2,}R$/,I=/^SET_C[AD]+R$/,N=/^MAP_C[AD]+R$/,M=/^DI{2,}P$/,k=/^DU+P$/;class L extends Error{constructor(t,e){super(e),this.token=t,Object.setPrototypeOf(this,L.prototype)}}class C extends Error{constructor(t,e){super(e),this.node=t,Object.setPrototypeOf(this,C.prototype)}}const B=new L(null,"Unexpected EOF");function D(t){return t.t===s.Ident&&("@"===t.v[0]||"%"===t.v[0]||":"===t.v[0])}const U=new RegExp("^-?[0-9]+$"),j=new RegExp("^([0-9a-fA-F]{2})*$");class K{constructor(t){this.opt=t}expand(t){var e,r,n;if(void 0!==(null===(e=this.opt)||void 0===e?void 0:e.expandGlobalConstant)&&"constant"===t.prim){const e=function(t,e){return void 0!==t.args&&1===t.args.length&&"string"in t.args[0]&&t.args[0].string in e?e[t.args[0].string]:t}(t,this.opt.expandGlobalConstant);return e!==t&&(e[i]=Object.assign(Object.assign({},t[i]||{first:0,last:0}),{globalConstant:t})),e}if(void 0===(null===(r=this.opt)||void 0===r?void 0:r.expandMacros)||(null===(n=this.opt)||void 0===n?void 0:n.expandMacros)){const e=function(t,e){const r=(null==e?void 0:e.protocol)||p;function i(t){return void 0!==t?[{prim:"RENAME",annots:t}]:[]}switch(t.prim){case"CMPEQ":case"CMPNEQ":case"CMPLT":case"CMPGT":case"CMPLE":case"CMPGE":if(y(t,0))return[{prim:"COMPARE"},T({prim:t.prim.slice(3),annots:t.annots})];break;case"IFEQ":case"IFNEQ":case"IFLT":case"IFGT":case"IFLE":case"IFGE":if(y(t,2))return[{prim:t.prim.slice(2)},T({prim:"IF",annots:t.annots,args:t.args})];break;case"IFCMPEQ":case"IFCMPNEQ":case"IFCMPLT":case"IFCMPGT":case"IFCMPLE":case"IFCMPGE":if(y(t,2))return[{prim:"COMPARE"},{prim:t.prim.slice(5)},T({prim:"IF",annots:t.annots,args:t.args})];break;case"FAIL":if(y(t,0)&&w(t))return[{prim:"UNIT"},{prim:"FAILWITH"}];break;case"ASSERT":if(y(t,0)&&w(t))return[{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_EQ":case"ASSERT_NEQ":case"ASSERT_LT":case"ASSERT_GT":case"ASSERT_LE":case"ASSERT_GE":if(y(t,0)&&w(t))return[{prim:t.prim.slice(7)},{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_CMPEQ":case"ASSERT_CMPNEQ":case"ASSERT_CMPLT":case"ASSERT_CMPGT":case"ASSERT_CMPLE":case"ASSERT_CMPGE":if(y(t,0)&&w(t))return[[{prim:"COMPARE"},{prim:t.prim.slice(10)}],{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_NONE":if(y(t,0)&&w(t))return[{prim:"IF_NONE",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_SOME":if(y(t,0))return[{prim:"IF_NONE",args:[[[{prim:"UNIT"},{prim:"FAILWITH"}]],i(t.annots)]}];break;case"ASSERT_LEFT":if(y(t,0))return[{prim:"IF_LEFT",args:[i(t.annots),[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_RIGHT":if(y(t,0))return[{prim:"IF_LEFT",args:[[[{prim:"UNIT"},{prim:"FAILWITH"}]],i(t.annots)]}];break;case"IF_SOME":if(y(t,2))return[T({prim:"IF_NONE",annots:t.annots,args:[t.args[1],t.args[0]]})];break;case"IF_RIGHT":if(y(t,2))return[T({prim:"IF_LEFT",annots:t.annots,args:[t.args[1],t.args[0]]})];break;case"CAR":case"CDR":if(void 0===t.args)return t;if(y(t,1)&&_(t,t.args[0])){const e=parseInt(t.args[0].int,10);return T({prim:"GET",args:[{int:"CAR"===t.prim?String(2*e+1):String(2*e)}],annots:t.annots})}}if(x.test(t.prim)&&y(t,0)){const{fields:e,rest:r}=O(t.annots),{r:i}=E(t,t.prim.slice(1),e,((t,e,r)=>[...t||[],...e||[],r]));return i.map((([t,e],n)=>{const s=[...A(e,null).map((t=>null===t?"%":t)),...0===t&&n===i.length-1?r:[]],o=T({prim:"PAIR",annots:0!==s.length?s:void 0});return 0===t?o:{prim:"DIP",args:1===t?[[o]]:[{int:String(t)},[o]]}}))}if(R.test(t.prim)){if(m(r,d.PtEdo2Zk)&&y(t,0)){const{r:e}=E(t,t.prim.slice(3),t.annots||[],((t,e,r)=>[r,...e||[],...t||[]]));return e.map((([t,e])=>{const r=[{prim:"DUP"},T({prim:"CAR",annots:null!==e[0]?[e[0]]:void 0}),{prim:"DIP",args:[[T({prim:"CDR",annots:null!==e[1]?[e[1]]:void 0})]]}];return 0===t?r:{prim:"DIP",args:1===t?[[r]]:[{int:String(t)},[r]]}}))}if("UNPAIR"===t.prim)return t;if(y(t,0)){const{r:e}=E(t,t.prim.slice(3),[],((t,e,r)=>[r,...e||[],...t||[]]));return e.map((([t])=>{const e=T({prim:"UNPAIR"});return 0===t?e:{prim:"DIP",args:1===t?[[e]]:[{int:String(t)},[e]]}}))}}if(P.test(t.prim)&&y(t,0)){const e=[...t.prim.slice(1,t.prim.length-1)];return e.map(((r,i)=>{const n=i===e.length-1?t.annots:void 0;switch(r){case"A":return T({prim:"CAR",annots:n});case"D":return T({prim:"CDR",annots:n});default:throw new v(t,`unexpected character: ${r}`)}}))}if(I.test(t.prim)&&y(t,0)){const{fields:e,rest:r}=O(t.annots);if(e.length>1)throw new v(t,`unexpected annotation on macro ${t.prim}: ${e}`);const i=0!==e.length?{a:[{prim:"DUP"},{prim:"CAR",annots:e},{prim:"DROP"},{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:[e[0],"%@"]}],d:[{prim:"DUP"},{prim:"CDR",annots:e},{prim:"DROP"},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@",e[0]]}]}:{a:[{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:["%","%@"]}],d:[{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@","%"]}]};return S(t,t.prim.slice(5,t.prim.length-1),r,i)}if(N.test(t.prim)&&y(t,1)){const{fields:e}=O(t.annots);if(e.length>1)throw new v(t,`unexpected annotation on macro ${t.prim}: ${e}`);const r={a:[{prim:"DUP"},{prim:"CDR",annots:["@%%"]},{prim:"DIP",args:[[T({prim:"CAR",annots:0!==e.length?["@"+e[0].slice(1)]:void 0}),t.args[0]]]},{prim:"SWAP"},{prim:"PAIR",annots:[0!==e.length?e[0]:"%","%@"]}],d:[{prim:"DUP"},T({prim:"CDR",annots:0!==e.length?["@"+e[0].slice(1)]:void 0}),t.args[0],{prim:"SWAP"},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@",0!==e.length?e[0]:"%"]}]};return S(t,t.prim.slice(5,t.prim.length-1),[],r)}if(M.test(t.prim)&&y(t,1)){let e=0;for(;"I"===t.prim[1+e];)e++;return T({prim:"DIP",args:[{int:String(e)},t.args[0]]})}if(k.test(t.prim)){let e=0;for(;"U"===t.prim[1+e];)e++;if(m(r,d.PtEdo2Zk)){if(1===e){if(void 0===t.args)return t;y(t,1)&&_(t,t.args[0])&&(e=parseInt(t.args[0].int,10))}else y(t,0);return 1===e?[T({prim:"DUP",annots:t.annots})]:2===e?[{prim:"DIP",args:[[T({prim:"DUP",annots:t.annots})]]},{prim:"SWAP"}]:[{prim:"DIP",args:[{int:String(e-1)},[T({prim:"DUP",annots:t.annots})]]},{prim:"DIG",args:[{int:String(e)}]}]}if(1===e)return t;if(y(t,0))return T({prim:"DUP",args:[{int:String(e)}],annots:t.annots})}return t}(t,this.opt);return e!==t&&(e[i]=Object.assign(Object.assign({},t[i]||{first:0,last:0}),{macro:t})),e}return t}parseListExpr(t,e){var r;const n={first:e.first,last:e.last},o="("===e.t;let a;if(o){if(a=t.next(),a.done)throw B;n.last=a.value.last}else a={value:e};if(a.value.t!==s.Ident)throw new L(a.value,`not an identifier: ${a.value.v}`);const c={prim:a.value.v,[i]:n};for(;;){const e=t.next();if(e.done){if(o)throw B;break}if(")"===e.value.t){if(!o)throw new L(e.value,"unexpected closing bracket");n.last=e.value.last;break}if(D(e.value))c.annots=c.annots||[],c.annots.push(e.value.v),n.last=e.value.last;else{c.args=c.args||[];const s=this.parseExpr(t,e.value);n.last=(null===(r=s[i])||void 0===r?void 0:r.last)||n.last,c.args.push(s)}}return this.expand(c)}parseArgs(t,e){var r;const n={first:e.first,last:e.last},s={prim:e.v,[i]:n};for(;;){const e=t.next();if(e.done||"}"===e.value.t||";"===e.value.t)return[s,e];if(D(e.value))n.last=e.value.last,s.annots=s.annots||[],s.annots.push(e.value.v);else{const o=this.parseExpr(t,e.value);n.last=(null===(r=o[i])||void 0===r?void 0:r.last)||n.last,s.args=s.args||[],s.args.push(o)}}}parseSequenceExpr(t,e){var r,n;const o={first:e.first,last:e.last},a=[];a[i]=o;const c="{"===e.t;let u="{"===e.t?null:{value:e};for(;;){if(null===u&&(u=t.next(),u.done||(o.last=u.value.last)),u.done){if(c)throw B;return a}if("}"===u.value.t){if(c)return a;throw new L(u.value,"unexpected closing bracket")}if(u.value.t===s.Ident){const[e,n]=this.parseArgs(t,u.value);o.last=(null===(r=e[i])||void 0===r?void 0:r.last)||o.last,a.push(this.expand(e)),u=n}else{const e=this.parseExpr(t,u.value);o.last=(null===(n=e[i])||void 0===n?void 0:n.last)||o.last,a.push(e),u=null}null===u&&(u=t.next(),u.done||(o.last=u.value.last)),u.done||";"!==u.value.t||(u=null)}}parseExpr(t,e){switch(e.t){case s.Ident:return this.expand({prim:e.v,[i]:{first:e.first,last:e.last}});case s.Number:return{int:e.v,[i]:{first:e.first,last:e.last}};case s.String:return{string:JSON.parse(e.v),[i]:{first:e.first,last:e.last}};case s.Bytes:return{bytes:e.v.slice(2),[i]:{first:e.first,last:e.last}};case"{":return this.parseSequenceExpr(t,e);default:return this.parseListExpr(t,e)}}parseSequence(t){if("string"!=typeof t)throw new TypeError(`string type was expected, got ${typeof t} instead`);const e=f(t),r=e.next();return r.done?null:this.parseSequenceExpr(e,r.value)}parseList(t){if("string"!=typeof t)throw new TypeError(`string type was expected, got ${typeof t} instead`);const e=f(t),r=e.next();return r.done?null:this.parseListExpr(e,r.value)}parseMichelineExpression(t){if("string"!=typeof t)throw new TypeError(`string type was expected, got ${typeof t} instead`);const e=f(t),r=e.next();return r.done?null:this.parseExpr(e,r.value)}parseScript(t){return this.parseSequence(t)}parseData(t){return this.parseList(t)}parseJSON(t){if("object"!=typeof t)throw new TypeError(`object type was expected, got ${typeof t} instead`);if(Array.isArray(t)){const e=[];for(const r of t){if(null===r||"object"!=typeof r)throw new C(r,`unexpected sequence element: ${r}`);e.push(this.parseJSON(r))}return e}if("prim"in t){const e=t;if("string"==typeof e.prim&&(void 0===e.annots||Array.isArray(e.annots))&&(void 0===e.args||Array.isArray(e.args))){const t={prim:e.prim};if(void 0!==e.annots){for(const t of e.annots)if("string"!=typeof t)throw new C(t,`string expected: ${t}`);t.annots=e.annots}if(void 0!==e.args){t.args=[];for(const r of e.args){if(null===r||"object"!=typeof r)throw new C(r,`unexpected argument: ${r}`);t.args.push(this.parseJSON(r))}}return this.expand(t)}throw new C(t,`malformed prim expression: ${t}`)}if("string"in t){if("string"==typeof t.string)return{string:t.string};throw new C(t,`malformed string literal: ${t}`)}if("int"in t){if("string"==typeof t.int&&U.test(t.int))return{int:t.int};throw new C(t,`malformed int literal: ${t}`)}if("bytes"in t){if("string"==typeof t.bytes&&j.test(t.bytes))return{bytes:t.bytes};throw new C(t,`malformed bytes literal: ${t}`)}throw new C(t,`unexpected object: ${t}`)}}class V{constructor(t,e=0){this.opt=t,this.lev=e}indent(t=0){var e;let r="";if(void 0!==(null===(e=this.opt)||void 0===e?void 0:e.indent))for(let e=this.lev+t;e>0;e--)r+=this.opt.indent;return r}get lf(){var t;return(null===(t=this.opt)||void 0===t?void 0:t.newline)||""}get lfsp(){var t;return(null===(t=this.opt)||void 0===t?void 0:t.newline)||" "}down(t){return new V(this.opt,this.lev+t)}}function F(t){return"prim"in t&&(void 0!==t.annots&&0!==t.annots.length||void 0!==t.args&&0!==t.args.length)}function H(t){if(void 0!==t.args)for(const e of t.args)if(Array.isArray(e)||F(e))return!0;return!1}function G(t,e,r){var n;const s=null===(n=t[i])||void 0===n?void 0:n.macro;if(r&&s)return G(s,e,r);if(Array.isArray(t))return function(t,e,r){let i="{"+e.lf,n=t.length;for(const s of t){if(i+=e.indent(1),"prim"in s){if(i+=s.prim,void 0!==s.annots)for(const t of s.annots)i+=" "+t;if(void 0!==s.args){const t=H(s);for(const n of s.args)i+=t?e.lfsp+e.indent(2)+G(n,e.down(2),r):" "+G(n,e,r)}}else i+=G(s,e.down(1),r);i+=n>1?";"+e.lfsp:e.lf,n--}return i+e.indent()+"}"}(t,e,r);if("string"in t)return JSON.stringify(t.string);if("int"in t)return t.int;if("bytes"in t)return"0x"+t.bytes;{if(!(void 0!==t.annots&&0!==t.annots.length||void 0!==t.args&&0!==t.args.length))return t.prim;let i="("+t.prim;if(void 0!==t.annots)for(const e of t.annots)i+=" "+e;if(void 0!==t.args){const n=H(t);for(const s of t.args)i+=n?e.lfsp+e.indent(1)+G(s,e.down(1),r):" "+G(s,e,r)}return i+")"}}function $(t,e,r=!1){if("object"!=typeof t)throw new TypeError(`object type was expected, got ${typeof t} instead`);return G(t,new V(e),r)}const z=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],q=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998];class Z extends Error{constructor(t){super(t),this.message=t,this.name="Base58DecodingError"}}class W extends Error{constructor(t){super(t),this.message=t,this.name="InvalidMessageError"}}function Y(t){const e=(t.length+9)%64,r=0===e?0:64-e;if(t.length>268435455)throw new W(`SHA-256 -- message length is too big: ${t.length}`);const i=t.length<<3,n=[...t,128,...new Array(r).fill(0),0,0,0,0,i>>24&255,i>>16&255,i>>8&255,255&i];function s(t,e){return t>>>e|t<<32-e}const o=[...z],a=new Array(64),c=new Array(8);for(let t=0;t<n.length;t+=64){let e=t,r=0;for(;r<16;)a[r]=n[e]<<24|n[e+1]<<16|n[e+2]<<8|n[e+3],e+=4,r++;for(;r<64;){const t=s(a[r-15],7)^s(a[r-15],18)^a[r-15]>>>3,e=s(a[r-2],17)^s(a[r-2],19)^a[r-2]>>>10;a[r]=(0|e)+a[r-7]+t+a[r-16]|0,r++}for(let t=0;t<8;t++)c[t]=o[t];for(let t=0;t<64;t++){const e=s(c[0],2)^s(c[0],13)^s(c[0],22),r=s(c[4],6)^s(c[4],11)^s(c[4],25),i=c[7]+r+(c[4]&c[5]^~c[4]&c[6])+q[t]+a[t]|0,n=e+(c[0]&c[1]^c[0]&c[2]^c[1]&c[2])|0;c[7]=c[6],c[6]=c[5],c[5]=c[4],c[4]=c[3]+i|0,c[3]=c[2],c[2]=c[1],c[1]=c[0],c[0]=i+n|0}for(let t=0;t<8;t++)o[t]=o[t]+c[t]|0}const u=[];for(const t of o)u.push(t>>24&255),u.push(t>>16&255),u.push(t>>8&255),u.push(255&t);return u}const J=[0,1,2,3,4,5,6,7,8,-1,-1,-1,-1,-1,-1,-1,9,10,11,12,13,14,15,16,-1,17,18,19,20,21,-1,22,23,24,25,26,27,28,29,30,31,32,-1,-1,-1,-1,-1,-1,33,34,35,36,37,38,39,40,41,42,43,-1,44,45,46,47,48,49,50,51,52,53,54,55,56,57],X=[0,1,2,3,4,5,6,7,8,16,17,18,19,20,21,22,23,25,26,27,28,29,31,32,33,34,35,36,37,38,39,40,41,48,49,50,51,52,53,54,55,56,57,58,60,61,62,63,64,65,66,67,68,69,70,71,72,73];function Q(t,e){const r=t.charCodeAt(e)-49;if(r>=J.length||-1===J[r])throw new Z(`Unexpected character at position ${e}: ${t[e]}`);return J[r]}function tt(t){const e=function(t){const e=[];let r=0;for(;r<t.length&&0===Q(t,r);)r++;let i=r;for(;r<t.length;){let i=Q(t,r++),n=0;for(;0!==i||n<e.length;){const t=58*(e[n]||0)+i;e[n++]=t%256,i=Math.floor(t/256)}}for(;i-- >0;)e.push(0);return e.reverse()}(t);if(e.length<4)throw new Z(`Data is too short ${e.length}`);const r=e.slice(0,e.length-4),i=e.slice(e.length-4),n=Y(Y(r));if(i[0]!==n[0]||i[1]!==n[1]||i[2]!==n[2]||i[3]!==n[3])throw new Z("Invalid checksum");return r}function et(t){const e=Y(Y(t));return function(t){const e=[];let r=0;for(;r<t.length&&0===t[r];)r++;let i=r;for(;r<t.length;){let i=t[r++],n=0;for(;0!==i||n<e.length;){const t=256*(e[n]||0)+i;e[n++]=t%58,i=Math.floor(t/58)}}for(;i-- >0;)e.push(0);return e.reverse(),String.fromCharCode(...e.map((t=>X[t]+49)))}([...t,...e.slice(0,4)])}class rt extends Error{constructor(t){super(t),this.message=t,this.name="InvalidContractError"}}class it extends Error{constructor(t){super(t),this.message=t,this.name="InvalidTypeExpressionError"}}class nt extends Error{constructor(t){super(t),this.message=t,this.name="InvalidDataExpressionError"}}class st extends Error{constructor(t){super(`Contract has no entrypoint named: '${t}'`),this.entrypoint=t,this.name="InvalidEntrypointError"}}class ot extends Error{constructor(t){super(t),this.message=t,this.name="TezosIdEncodeError"}}class at extends Error{constructor(t){super(t),this.message=t,this.name="LongIntegerError"}}class ct extends Error{constructor(t){super(`Unable to parse hex byte: ${t}`),this.hexByte=t,this.name="HexParseError"}}class ut extends Error{constructor(t,e){super(e),this.val=t,Object.setPrototypeOf(this,ut.prototype)}}function ht(t){return t instanceof ut}class ft extends ut{constructor(t,e,r){super(t,r),void 0!==e&&(this.data=e),Object.setPrototypeOf(this,ft.prototype)}}class lt{constructor(t){if(this.neg=!1,this.buf=[],void 0!==t)if("string"==typeof t)for(let e=0;e<t.length;e++){const r=t.charCodeAt(e);if(0===e&&45===r)this.neg=!0;else{if(r<48||r>57)throw new at(`unexpected character in integer constant: ${t[e]}`);this.append(r-48)}}else t<0?(this.neg=!0,this.append(-t)):this.append(t)}append(t){let e=0;for(;0!==t||e<this.buf.length;){const r=10*(this.buf[e]||0)+t;this.buf[e++]=r%256,t=Math.floor(r/256)}}cmp(t){if(this.neg!==t.neg)return(t.neg?1:0)-(this.neg?1:0);{let e=0;if(this.buf.length!==t.buf.length)e=this.buf.length<t.buf.length?-1:1;else if(0!==this.buf.length){let r=t.buf.length-1;for(;r>=0&&this.buf[r]===t.buf[r];)r--;e=r<0?0:this.buf[r]<t.buf[r]?-1:1}return this.neg?0===e?0:-e:e}}get sign(){return 0===this.buf.length?0:this.neg?-1:1}}function dt(t){const e=[];for(let r=0;r<t.length;r+=2){const i=parseInt(t.slice(r,r+2),16);if(Number.isNaN(i))return null;e.push(i)}return e}function pt(t){try{return new lt(t),!0}catch(t){return!1}}function bt(t){try{return new lt(t).sign>=0}catch(t){return!1}}const gt=/^(@%|@%%|%@|[@:%]([_0-9a-zA-Z][_0-9a-zA-Z.%@]*)?)$/;function mt(t,e){if(Array.isArray(t))return{};let r,i,n;if(void 0!==t.annots)for(const s of t.annots)if(0!==s.length){if(!gt.test(s)||!(null==e?void 0:e.specialVar)&&("@%"===s||"@%%"===s)||!(null==e?void 0:e.specialFields)&&"%@"===s)throw new ut(t,`${t.prim}: unexpected annotation: ${s}`);switch(s[0]){case"%":((null==e?void 0:e.emptyFields)||s.length>1)&&(r=r||[],r.push(s));break;case":":s.length>1&&(i=i||[],i.push(s));break;case"@":((null==e?void 0:e.emptyVar)||s.length>1)&&(n=n||[],n.push(s))}}return{f:r,t:i,v:n}}const vt={BlockHash:[32,[1,52]],OperationHash:[32,[5,116]],OperationListHash:[32,[133,233]],OperationListListHash:[32,[29,159,109]],ProtocolHash:[32,[2,170]],ContextHash:[32,[79,199]],ED25519PublicKeyHash:[20,[6,161,159]],SECP256K1PublicKeyHash:[20,[6,161,161]],P256PublicKeyHash:[20,[6,161,164]],ContractHash:[20,[2,90,121]],CryptoboxPublicKeyHash:[16,[153,103]],ED25519Seed:[32,[13,15,58,7]],ED25519PublicKey:[32,[13,15,37,217]],SECP256K1SecretKey:[32,[17,162,224,201]],P256SecretKey:[32,[16,81,238,189]],ED25519EncryptedSeed:[56,[7,90,60,179,41]],SECP256K1EncryptedSecretKey:[56,[9,237,241,174,150]],P256EncryptedSecretKey:[56,[9,48,57,115,171]],SECP256K1PublicKey:[33,[3,254,226,86]],P256PublicKey:[33,[3,178,139,127]],SECP256K1Scalar:[33,[38,248,136]],SECP256K1Element:[33,[5,92,0]],ED25519SecretKey:[64,[43,246,78,7]],ED25519Signature:[64,[9,245,205,134,18]],SECP256K1Signature:[64,[13,115,101,19,63]],P256Signature:[64,[54,240,44,52]],GenericSignature:[64,[4,130,43]],ChainID:[4,[87,82,0]],RollupAddress:[20,[1,128,120,31]],TxRollupL2Address:[20,[6,161,166]]};function yt(t,...e){const r=tt(t);for(const t of e){const[e,i]=vt[t];if(r.length===e+i.length){let e=0;for(;e<i.length&&r[e]===i[e];)e++;if(e===i.length)return[t,r.slice(i.length)]}}return null}function wt(t,e){const[r,i]=vt[t];if(e.length!==r)throw new ot(`Incorrect data length for ${t}: ${e.length}`);return et([...i,...e])}function _t(t,e){const r=e,i=Array.isArray(r)?r:r.args;if(2===i.length){return"pair"===t?{prim:"pair",args:i}:{prim:"Pair",args:i}}return Object.assign(Object.assign({},Array.isArray(r)?{prim:t}:r),{args:[i[0],{prim:t,args:i.slice(1)}]})}function Et(t){return Array.isArray(t)||"pair"===t.prim}function St(t){return Array.isArray(t)||"prim"in t&&"Pair"===t.prim}const At=/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])[T ]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):([0-5][0-9]))$/;function Ot(t){if("string"in t){if(bt(t.string))return new Date(parseInt(t.string,10));if(At.test(t.string)){const e=new Date(t.string);if(!Number.isNaN(e.valueOf))return e}}else if(pt(t.int))return new Date(parseInt(t.int,10));return null}function Tt(t){return t.map((t=>(t>>4&15).toString(16)+(15&t).toString(16))).join("")}const xt={ABS:!0,ADD:!0,ADDRESS:!0,AMOUNT:!0,AND:!0,APPLY:!0,BALANCE:!0,BLAKE2B:!0,CAR:!0,CDR:!0,CHAIN_ID:!0,CHECK_SIGNATURE:!0,COMPARE:!0,CONCAT:!0,CONS:!0,EDIV:!0,EQ:!0,EXEC:!0,FAILWITH:!0,GE:!0,GET_AND_UPDATE:!0,GT:!0,HASH_KEY:!0,IMPLICIT_ACCOUNT:!0,INT:!0,ISNAT:!0,JOIN_TICKETS:!0,KECCAK:!0,LE:!0,LEVEL:!0,LSL:!0,LSR:!0,LT:!0,MEM:!0,MUL:!0,NEG:!0,NEQ:!0,NEVER:!0,NOT:!0,NOW:!0,OR:!0,PACK:!0,PAIRING_CHECK:!0,READ_TICKET:!0,SAPLING_VERIFY_UPDATE:!0,SELF:!0,SELF_ADDRESS:!0,SENDER:!0,SET_DELEGATE:!0,SHA256:!0,SHA3:!0,SHA512:!0,SIZE:!0,SLICE:!0,SOME:!0,SOURCE:!0,SPLIT_TICKET:!0,SUB:!0,SWAP:!0,TICKET:!0,TOTAL_VOTING_POWER:!0,TRANSFER_TOKENS:!0,UNIT:!0,VOTING_POWER:!0,XOR:!0,RENAME:!0,OPEN_CHEST:!0,SUB_MUTEZ:!0,MIN_BLOCK_TIME:!0},Rt=Object.assign({},xt,{CONTRACT:!0,CREATE_CONTRACT:!0,DIG:!0,DIP:!0,DROP:!0,DUG:!0,DUP:!0,EMIT:!0,EMPTY_BIG_MAP:!0,EMPTY_MAP:!0,EMPTY_SET:!0,GET:!0,IF:!0,IF_CONS:!0,IF_LEFT:!0,IF_NONE:!0,ITER:!0,LAMBDA:!0,LEFT:!0,LOOP:!0,LOOP_LEFT:!0,MAP:!0,NIL:!0,NONE:!0,PAIR:!0,PUSH:!0,RIGHT:!0,SAPLING_EMPTY_STATE:!0,UNPACK:!0,UNPAIR:!0,UPDATE:!0,CAST:!0,VIEW:!0}),Pt={unit:!0,never:!0,bool:!0,int:!0,nat:!0,string:!0,chain_id:!0,bytes:!0,mutez:!0,key_hash:!0,key:!0,signature:!0,timestamp:!0,address:!0,tx_rollup_l2_address:!0},It=Object.assign({},Pt,{or:!0,pair:!0,set:!0,big_map:!0,contract:!0,lambda:!0,list:!0,map:!0,operation:!0,option:!0,bls12_381_g1:!0,bls12_381_g2:!0,bls12_381_fr:!0,sapling_transaction:!0,sapling_state:!0,ticket:!0,chest_key:!0,chest:!0});class Nt extends ut{constructor(t,e){super(t,e),this.val=t,Object.setPrototypeOf(this,Nt.prototype)}}function Mt(t){return"prim"in t}function kt(t){if(Mt(t))return!0;throw new Nt(t,"prim expression expected")}function Lt(t){if(Array.isArray(t))return!0;throw new Nt(t,"sequence expression expected")}function Ct(t){if(function(t){return Array.isArray(t)||"prim"in t}(t))return!0;throw new Nt(t,"prim or sequence expression expected")}function Bt(t){if("-"===t.int[0])throw new Nt(t,"natural number expected")}function Dt(t){if("int"in t)return!0;throw new Nt(t,"int literal expected")}function Ut(t){if("string"in t)return!0;throw new Nt(t,"string literal expected")}function jt(t,e){var r;if(0===e&&void 0===t.args||(null===(r=t.args)||void 0===r?void 0:r.length)===e)return!0;throw new Nt(t,`${e} arguments expected`)}function Kt(t){var e,r;if(Array.isArray(t)){for(const e of t){if(!Array.isArray(e)&&!Mt(e))throw new Nt(t,"sequence or prim expected");Kt(e)}return!0}if(kt(t)){if(Object.prototype.hasOwnProperty.call(xt,t.prim))return jt(t,0),!0;switch(t.prim){case"DROP":case"PAIR":case"UNPAIR":case"DUP":case"UPDATE":case"GET":void 0!==t.args&&jt(t,1)&&Dt(t.args[0])&&Bt(t.args[0]);break;case"DIG":case"DUG":case"SAPLING_EMPTY_STATE":jt(t,1)&&Dt(t.args[0])&&Bt(t.args[0]);break;case"NONE":case"LEFT":case"RIGHT":case"NIL":case"CAST":jt(t,1)&&Wt(t.args[0]);break;case"UNPACK":jt(t,1)&&Ft(t.args[0]);break;case"CONTRACT":jt(t,1)&&$t(t.args[0]);break;case"IF_NONE":case"IF_LEFT":case"IF_CONS":case"IF":jt(t,2)&&(Lt(t.args[0])&&Kt(t.args[0]),Lt(t.args[1])&&Kt(t.args[1]));break;case"MAP":case"ITER":case"LOOP":case"LOOP_LEFT":jt(t,1)&&Kt(t.args[0]);break;case"CREATE_CONTRACT":jt(t,1)&&Xt(t.args[0]);break;case"DIP":if(2===(null===(e=t.args)||void 0===e?void 0:e.length))Dt(t.args[0])&&Bt(t.args[0]),Lt(t.args[1])&&Kt(t.args[1]);else{if(1!==(null===(r=t.args)||void 0===r?void 0:r.length))throw new Nt(t,"1 or 2 arguments expected");Lt(t.args[0])&&Kt(t.args[0])}break;case"PUSH":jt(t,2)&&(Ht(t.args[0]),Jt(t.args[1]));break;case"EMPTY_SET":jt(t,1)&&Vt(t.args[0]);break;case"EMPTY_MAP":jt(t,2)&&(Vt(t.args[0]),Wt(t.args[1]));break;case"EMPTY_BIG_MAP":jt(t,2)&&(Vt(t.args[0]),zt(t.args[1]));break;case"LAMBDA":jt(t,3)&&(Wt(t.args[0]),Wt(t.args[1]),Lt(t.args[2])&&Kt(t.args[2]));break;case"VIEW":jt(t,2)&&(Ut(t.args[0])&&Zt(t.args[0]),Wt(t.args[1])&&Ht(t.args[1]));break;case"EMIT":t.args&&t.args.length>0?jt(t,1):jt(t,0);break;default:throw new Nt(t,"instruction expected")}}return!0}function Vt(t){if(Ct(t))if(Array.isArray(t)||"pair"===t.prim||"or"===t.prim||"option"===t.prim)Yt(t,(t=>Vt(t)));else if(!Object.prototype.hasOwnProperty.call(Pt,t.prim))throw new Nt(t,`${t.prim}: type is not comparable`);return!0}function Ft(t){if(Ct(t)&&Mt(t)){if(!Object.prototype.hasOwnProperty.call(It,t.prim)||"big_map"===t.prim||"operation"===t.prim||"sapling_state"===t.prim||"ticket"===t.prim)throw new Nt(t,`${t.prim}: type can't be used inside PACK/UNPACK instructions`);Yt(t,(t=>Ft(t)))}return!0}function Ht(t){if(Ct(t)&&Mt(t)){if(!Object.prototype.hasOwnProperty.call(It,t.prim)||"big_map"===t.prim||"operation"===t.prim||"sapling_state"===t.prim||"ticket"===t.prim||"contract"===t.prim)throw new Nt(t,`${t.prim}: type can't be pushed`);Yt(t,(t=>Ht(t)))}return!0}function Gt(t){if(Ct(t)&&Mt(t)){if(!Object.prototype.hasOwnProperty.call(It,t.prim)||"operation"===t.prim||"contract"===t.prim)throw new Nt(t,`${t.prim}: type can't be used as part of a storage`);Yt(t,(t=>Gt(t)))}return!0}function $t(t){if(Ct(t)&&Mt(t)){if(!Object.prototype.hasOwnProperty.call(It,t.prim)||"operation"===t.prim)throw new Nt(t,`${t.prim}: type can't be used as part of a parameter`);Yt(t,(t=>$t(t)))}return!0}function zt(t){if(Ct(t)&&Mt(t)){if(!Object.prototype.hasOwnProperty.call(It,t.prim)||"big_map"===t.prim||"operation"===t.prim||"sapling_state"===t.prim)throw new Nt(t,`${t.prim}: type can't be used inside a big_map`);Yt(t,(t=>zt(t)))}return!0}const qt=new RegExp("^[a-zA-Z0-9_.%@]*$");function Zt(t){if(t.string.length>31)throw new Nt(t,`view name too long: ${t.string}`);if(!qt.test(t.string))throw new Nt(t,`invalid character(s) in view name: ${t.string}`)}function Wt(t){if(Ct(t)&&Mt(t)){if(!Object.prototype.hasOwnProperty.call(It,t.prim))throw new Nt(t,"type expected");Yt(t,(t=>Wt(t)))}return!0}function Yt(t,e){if(Array.isArray(t)||"pair"===t.prim){const r=Array.isArray(t)?t:t.args;if(void 0===r||r.length<2)throw new Nt(t,"at least 2 arguments expected");return r.forEach((t=>{Ct(t)&&e(t)})),!0}switch(t.prim){case"option":case"list":jt(t,1)&&Ct(t.args[0])&&e(t.args[0]);break;case"contract":jt(t,1)&&$t(t.args[0]);break;case"or":jt(t,2)&&Ct(t.args[0])&&Ct(t.args[1])&&(e(t.args[0]),e(t.args[1]));break;case"lambda":jt(t,2)&&(Wt(t.args[0]),Wt(t.args[1]));break;case"set":jt(t,1)&&Vt(t.args[0]);break;case"map":jt(t,2)&&Ct(t.args[0])&&Ct(t.args[1])&&(Vt(t.args[0]),e(t.args[1]));break;case"big_map":jt(t,2)&&Ct(t.args[0])&&Ct(t.args[1])&&(Vt(t.args[0]),zt(t.args[1]),e(t.args[1]));break;case"ticket":jt(t,1)&&Ct(t.args[0])&&Vt(t.args[0]);break;case"sapling_state":case"sapling_transaction":jt(t,1)&&Dt(t.args[0]);break;default:jt(t,0)}return!0}function Jt(t){if("int"in t||"string"in t||"bytes"in t)return!0;if(Array.isArray(t)){let e=0;for(const r of t)Mt(r)&&"Elt"===r.prim?(jt(r,2)&&(Jt(r.args[0]),Jt(r.args[1])),e++):Jt(r);if(0!==e&&e!==t.length)throw new Nt(t,"data entries and map elements can't be intermixed");return!0}if(!Mt(t))throw new Nt(t,"data entry expected");switch(t.prim){case"Unit":case"True":case"False":case"None":jt(t,0);break;case"Pair":if(void 0===t.args||t.args.length<2)throw new Nt(t,"at least 2 arguments expected");for(const e of t.args)Jt(e);break;case"Left":case"Right":case"Some":jt(t,1)&&Jt(t.args[0]);break;default:if(!Object.prototype.hasOwnProperty.call(Rt,t.prim))throw new Nt(t,"data entry or instruction expected");Kt(t)}return!0}function Xt(t){if(Lt(t)){const e={},r={};for(const i of t)if(kt(i)){if("view"!==i.prim){if(i.prim in e)throw new Nt(t,`duplicate contract section: ${i.prim}`);e[i.prim]=!0}switch(i.prim){case"code":jt(i,1)&&Lt(i.args[0])&&Kt(i.args[0]);break;case"parameter":if(jt(i,1)&&$t(i.args[0]),i.annots)throw new Nt(i,"Annotation must be part of the parameter type");break;case"storage":jt(i,1)&&Gt(i.args[0]);break;case"view":if(jt(i,4)){if(Ut(i.args[0])){const e=i.args[0];if(e.string in r)throw new Nt(t,`duplicate view name: ${e.string}`);r[e.string]=!0,Zt(e)}Ht(i.args[1]),Ht(i.args[2]),Lt(i.args[3])&&Kt(i.args[3])}break;default:throw new Nt(t,`unexpected contract section: ${i.prim}`)}}}return!0}function Qt(t){try{return Xt(t),!0}catch(t){return!1}}function te(t){try{return Jt(t),!0}catch(t){return!1}}function ee(t){try{return Kt(t),!0}catch(t){return!1}}function re(t){try{return Wt(t),!0}catch(t){return!1}}function ie(t){return Object.prototype.hasOwnProperty.call(Rt,t.prim)}function ne(t){if(!Array.isArray(t))return!1;for(const e of t)if("prim"in e){if(ie(e))throw new ut(t,`Instruction outside of a lambda: ${JSON.stringify(t)}`);if("Elt"===e.prim)throw new ut(t,`Elt item outside of a map literal: ${JSON.stringify(t)}`)}return!0}const se=["parameter","storage","code","False","Elt","Left","None","Pair","Right","Some","True","Unit","PACK","UNPACK","BLAKE2B","SHA256","SHA512","ABS","ADD","AMOUNT","AND","BALANCE","CAR","CDR","CHECK_SIGNATURE","COMPARE","CONCAT","CONS","CREATE_ACCOUNT","CREATE_CONTRACT","IMPLICIT_ACCOUNT","DIP","DROP","DUP","EDIV","EMPTY_MAP","EMPTY_SET","EQ","EXEC","FAILWITH","GE","GET","GT","HASH_KEY","IF","IF_CONS","IF_LEFT","IF_NONE","INT","LAMBDA","LE","LEFT","LOOP","LSL","LSR","LT","MAP","MEM","MUL","NEG","NEQ","NIL","NONE","NOT","NOW","OR","PAIR","PUSH","RIGHT","SIZE","SOME","SOURCE","SENDER","SELF","STEPS_TO_QUOTA","SUB","SWAP","TRANSFER_TOKENS","SET_DELEGATE","UNIT","UPDATE","XOR","ITER","LOOP_LEFT","ADDRESS","CONTRACT","ISNAT","CAST","RENAME","bool","contract","int","key","key_hash","lambda","list","map","big_map","nat","option","or","pair","set","signature","string","bytes","mutez","timestamp","unit","operation","address","SLICE","DIG","DUG","EMPTY_BIG_MAP","APPLY","chain_id","CHAIN_ID","LEVEL","SELF_ADDRESS","never","NEVER","UNPAIR","VOTING_POWER","TOTAL_VOTING_POWER","KECCAK","SHA3","PAIRING_CHECK","bls12_381_g1","bls12_381_g2","bls12_381_fr","sapling_state","sapling_transaction","SAPLING_EMPTY_STATE","SAPLING_VERIFY_UPDATE","ticket","TICKET","READ_TICKET","SPLIT_TICKET","JOIN_TICKETS","GET_AND_UPDATE","chest","chest_key","OPEN_CHEST","VIEW","view","constant","SUB_MUTEZ","EMIT"],oe=Object.assign({},...se.map(((t,e)=>({[t]:e}))));var ae;!function(t){t[t.Int=0]="Int",t[t.String=1]="String",t[t.Sequence=2]="Sequence",t[t.Prim0=3]="Prim0",t[t.Prim0Annot=4]="Prim0Annot",t[t.Prim1=5]="Prim1",t[t.Prim1Annot=6]="Prim1Annot",t[t.Prim2=7]="Prim2",t[t.Prim2Annot=8]="Prim2Annot",t[t.Prim=9]="Prim",t[t.Bytes=10]="Bytes"}(ae||(ae={}));class ce{constructor(){this.buffer=[]}get length(){return this.buffer.length}writeBytes(t){this.buffer.push(...t.map((t=>255&t)))}writeUint8(t){const e=0|t;this.buffer.push(255&e)}writeUint16(t){const e=0|t;this.buffer.push(e>>8&255),this.buffer.push(255&e)}writeUint32(t){const e=0|t;this.buffer.push(e>>24&255),this.buffer.push(e>>16&255),this.buffer.push(e>>8&255),this.buffer.push(255&e)}writeInt8(t){this.writeUint8(t)}writeInt16(t){this.writeUint16(t)}writeInt32(t){this.writeUint32(t)}}const ue=new Error("bounds out of range");class he{constructor(t,e=0,r=t.length){this.buffer=t,this.idx=e,this.cap=r}get length(){return this.cap-this.idx}readBytes(t){if(this.cap-this.idx<t)throw ue;const e=this.buffer.slice(this.idx,this.idx+t);return this.idx+=t,e}reader(t){if(this.cap-this.idx<t)throw ue;const e=new he(this.buffer,this.idx,this.idx+t);return this.idx+=t,e}copy(){return new he(this.buffer,this.idx,this.cap)}readUint8(){if(this.cap-this.idx<1)throw ue;return this.buffer[this.idx++]>>>0}readUint16(){if(this.cap-this.idx<2)throw ue;return(this.buffer[this.idx++]<<8|this.buffer[this.idx++])>>>0}readUint32(){if(this.cap-this.idx<4)throw ue;return(this.buffer[this.idx++]<<24|this.buffer[this.idx++]<<16|this.buffer[this.idx++]<<8|this.buffer[this.idx++])>>>0}readInt8(){if(this.cap-this.idx<1)throw ue;return this.buffer[this.idx++]<<24>>24}readInt16(){if(this.cap-this.idx<2)throw ue;return(this.buffer[this.idx++]<<8|this.buffer[this.idx++])<<16>>16}readInt32(){if(this.cap-this.idx<4)throw ue;return this.buffer[this.idx++]<<24|this.buffer[this.idx++]<<16|this.buffer[this.idx++]<<8|this.buffer[this.idx++]}}var fe,le,de;function pe(t){let e;const r=t.readUint8();switch(r){case le.ED25519:e="ED25519PublicKeyHash";break;case le.SECP256K1:e="SECP256K1PublicKeyHash";break;case le.P256:e="P256PublicKeyHash";break;default:throw new Error(`unknown public key hash tag: ${r}`)}return{type:e,hash:t.readBytes(20)}}function be(t){let e;const r=t.readUint8();switch(r){case fe.Implicit:e=pe(t);break;case fe.Originated:e={type:"ContractHash",hash:t.readBytes(20)},t.readBytes(1);break;default:throw new Error(`unknown address tag: ${r}`)}if(0!==t.length){const r=new TextDecoder;e.entryPoint=r.decode(new Uint8Array(t.readBytes(t.length)))}return e}function ge(t,e){let r;switch(t.type){case"ED25519PublicKeyHash":r=le.ED25519;break;case"SECP256K1PublicKeyHash":r=le.SECP256K1;break;case"P256PublicKeyHash":r=le.P256;break;default:throw new Error(`unexpected address type: ${t.type}`)}e.writeUint8(r),e.writeBytes(Array.from(t.hash))}function me(t){let e,r;const i=t.readUint8();switch(i){case de.ED25519:r="ED25519PublicKey",e=32;break;case de.SECP256K1:r="SECP256K1PublicKey",e=33;break;case de.P256:r="P256PublicKey",e=33;break;default:throw new Error(`unknown public key tag: ${i}`)}return{type:r,publicKey:t.readBytes(e)}}function ve(t,e,r){var i,n;const[s,o]=r(t);if(Array.isArray(s)){const t=new ce;for(const e of s){const r=o.next();if(r.done)throw new Error("REPORT ME: iterator is done");ve(e,t,r.value)}return e.writeUint8(ae.Sequence),e.writeUint32(t.length),void e.writeBytes(t.buffer)}if("string"in s){const t=(new TextEncoder).encode(s.string);return e.writeUint8(ae.String),e.writeUint32(t.length),void e.writeBytes(Array.from(t))}if("int"in s){e.writeUint8(ae.Int);let t=BigInt(s.int);const r=t<0;r&&(t=-t);let i=0;do{const n=0===i?BigInt(6):BigInt(7);let s=t&(BigInt(1)<<n)-BigInt(1);t>>=n,t&&(s|=BigInt(128)),0===i&&r&&(s|=BigInt(64)),e.writeUint8(Number(s)),i++}while(t);return}if("bytes"in s){const t=function(t){const e=[];for(let r=0;r<t.length;r+=2){const i=t.slice(r,r+2),n=parseInt(i,16);if(Number.isNaN(n))throw new ct(i);e.push(n)}return e}(s.bytes);return e.writeUint8(ae.Bytes),e.writeUint32(t.length),void e.writeBytes(t)}const a=oe[s.prim];if(void 0===a)throw new TypeError(`Can't encode primary: ${s.prim}`);const c=((null===(i=s.args)||void 0===i?void 0:i.length)||0)<3?ae.Prim0+2*((null===(n=s.args)||void 0===n?void 0:n.length)||0)+(void 0===s.annots||0===s.annots.length?0:1):ae.Prim;if(e.writeUint8(c),e.writeUint8(a),void 0!==s.args)if(s.args.length<3)for(const t of s.args){const r=o.next();if(r.done)throw new Error("REPORT ME: iterator is done");ve(t,e,r.value)}else{const t=new ce;for(const e of s.args){const r=o.next();if(r.done)throw new Error("REPORT ME: iterator is done");ve(e,t,r.value)}e.writeUint32(t.length),e.writeBytes(t.buffer)}if(void 0!==s.annots&&0!==s.annots.length){const t=(new TextEncoder).encode(s.annots.join(" "));e.writeUint32(t.length),e.writeBytes(Array.from(t))}else void 0!==s.args&&s.args.length>=3&&e.writeUint32(0)}function ye(t,e){function*r(){for(;;)yield Re}const[i,n]=e,s=t.readUint8();switch(s){case ae.Int:{const e=[];let r;do{r=t.readInt8(),e.push(r)}while(0!=(128&r));let i=BigInt(0),s=!1;for(let t=e.length-1;t>=0;t--){const r=0===t?BigInt(6):BigInt(7),n=BigInt(e[t]);i<<=r,i|=n&(BigInt(1)<<r)-BigInt(1),0===t&&(s=!!(n&BigInt(64)))}return s&&(i=-i),n({int:String(i)})}case ae.String:{const e=t.readUint32(),r=t.readBytes(e);return n({string:(new TextDecoder).decode(new Uint8Array(r))})}case ae.Bytes:{const e=t.readUint32(),r=t.readBytes(e);return n({bytes:Tt(Array.from(r))})}case ae.Sequence:{const e=t.readUint32();let s=[],o=t.copy(),a=r();for(let r=0;r<2;r++){const r=o.reader(e);for(s=[];r.length>0;){const t=a.next();if(t.done)throw new Error("REPORT ME: iterator is done");s.push(ye(r,t.value))}a=i(s),o=t}return n(s)}default:{if(s>9)throw new Error(`Unknown tag: ${s}`);const e=t.readUint8();if(e>=se.length)throw new Error(`Unknown primitive tag: ${e}`);const o=se[e],a=s-3>>1;let c={prim:o},u=r(),h=t.copy();for(let e=0;e<2;e++){if(c={prim:o},a<3)for(let t=0;t<a;t++){const t=u.next();if(t.done)throw new Error("REPORT ME: iterator is done");c.args=c.args||[],c.args.push(ye(h,t.value))}else{c.args=c.args||[];const t=h.readUint32(),e=h.reader(t);for(;e.length>0;){const t=u.next();if(t.done)throw new Error("REPORT ME: iterator is done");c.args.push(ye(e,t.value))}}u=i(c),h=t}if(1==(s-3&1)||3===a){const e=t.readUint32();if(0!==e){const r=t.readBytes(e),i=new TextDecoder;c.annots=i.decode(new Uint8Array(r)).split(" ")}}return n(c)}}}!function(t){t[t.Implicit=0]="Implicit",t[t.Originated=1]="Originated"}(fe||(fe={})),function(t){t[t.ED25519=0]="ED25519",t[t.SECP256K1=1]="SECP256K1",t[t.P256=2]="P256"}(le||(le={})),function(t){t[t.ED25519=0]="ED25519",t[t.SECP256K1=1]="SECP256K1",t[t.P256=2]="P256"}(de||(de={}));const we=t=>"prim"in t&&("Left"===t.prim||"Right"===t.prim),_e=t=>"prim"in t&&("Some"===t.prim||"None"===t.prim),Ee=t=>{if(Et(t))return e=>{if(!St(e))throw new ft(t,e,`pair expected: ${JSON.stringify(e)}`);ne(e);const r=_t("pair",t);return[_t("Pair",e),function*(){for(const t of r.args)yield Ee(t)}()]};switch(t.prim){case"or":return e=>{if(!we(e))throw new ft(t,e,`or expected: ${JSON.stringify(e)}`);return[e,function*(){yield Ee(t.args["Left"===e.prim?0:1])}()]};case"option":return e=>{if(!_e(e))throw new ft(t,e,`option expected: ${JSON.stringify(e)}`);return[e,function*(){"Some"===e.prim&&(yield Ee(t.args[0]))}()]};case"list":case"set":return e=>{if(!Array.isArray(e))throw new ft(t,e,`${t.prim} expected: ${JSON.stringify(e)}`);return[e,function*(){for(const r of e)yield Ee(t.args[0])}()]};case"map":return e=>{if(!Array.isArray(e))throw new ft(t,e,`map expected: ${JSON.stringify(e)}`);return[e,function*(){for(const r of e)yield e=>{if(!("prim"in e)||"Elt"!==e.prim)throw new ft(t,e,`map element expected: ${JSON.stringify(e)}`);return[e,function*(){for(const e of t.args)yield Ee(e)}()]}}()]};case"chain_id":return e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`chain id expected: ${JSON.stringify(e)}`);let r;if("string"in e){const i=yt(e.string,"ChainID");if(null===i)throw new ft(t,e,`chain id base58 expected: ${e.string}`);r={bytes:Tt(i[1])}}else r=e;return[r,[][Symbol.iterator]()]};case"signature":return e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`signature expected: ${JSON.stringify(e)}`);let r;if("string"in e){const i=yt(e.string,"ED25519Signature","SECP256K1Signature","P256Signature","GenericSignature");if(null===i)throw new ft(t,e,`signature base58 expected: ${e.string}`);r={bytes:Tt(i[1])}}else r=e;return[r,[][Symbol.iterator]()]};case"key_hash":return e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`key hash expected: ${JSON.stringify(e)}`);let r;if("string"in e){const i=yt(e.string,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash");if(null===i)throw new ft(t,e,`key hash base58 expected: ${e.string}`);const n=new ce;ge({type:i[0],hash:i[1]},n),r={bytes:Tt(n.buffer)}}else r=e;return[r,[][Symbol.iterator]()]};case"key":return e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`public key expected: ${JSON.stringify(e)}`);let r;if("string"in e){const i=yt(e.string,"ED25519PublicKey","SECP256K1PublicKey","P256PublicKey");if(null===i)throw new ft(t,e,`public key base58 expected: ${e.string}`);const n=new ce;!function(t,e){let r;switch(t.type){case"ED25519PublicKey":r=de.ED25519;break;case"SECP256K1PublicKey":r=de.SECP256K1;break;case"P256PublicKey":r=de.P256;break;default:throw new Error(`unexpected public key type: ${t.type}`)}e.writeUint8(r),e.writeBytes(Array.from(t.publicKey))}({type:i[0],publicKey:i[1]},n),r={bytes:Tt(n.buffer)}}else r=e;return[r,[][Symbol.iterator]()]};case"address":return e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`address expected: ${JSON.stringify(e)}`);let r;if("string"in e){const i=e.string.split("%"),n=yt(i[0],"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash","ContractHash");if(null===n)throw new ft(t,e,`address base58 expected: ${e.string}`);const s=new ce;!function(t,e){if("ContractHash"===t.type?(e.writeUint8(fe.Originated),e.writeBytes(Array.from(t.hash)),e.writeUint8(0)):(e.writeUint8(fe.Implicit),ge(t,e)),void 0!==t.entryPoint&&""!==t.entryPoint&&"default"!==t.entryPoint){const r=(new TextEncoder).encode(t.entryPoint);e.writeBytes(Array.from(r))}}({type:n[0],hash:n[1],entryPoint:i.length>1?i[1]:void 0},s),r={bytes:Tt(s.buffer)}}else r=e;return[r,[][Symbol.iterator]()]};case"timestamp":return e=>{if(!("string"in e)&&!("int"in e))throw new ft(t,e,`timestamp expected: ${JSON.stringify(e)}`);let r;if("string"in e){const i=Ot(e);if(null===i)throw new ft(t,e,`can't parse date: ${e.string}`);r={int:String(Math.floor(i.getTime()/1e3))}}else r=e;return[r,[][Symbol.iterator]()]};default:return Ae}},Se=t=>"prim"in t&&"PUSH"===t.prim,Ae=t=>Se(t)?(Kt(t),[t,function*(){yield Ae,yield Ee(t.args[0])}()]):[t,function*(){for(;;)yield Ae}()];function Oe(t,e){const r=new ce;return r.writeUint8(5),ve(t,r,void 0!==e?Ee(e):Ae),r.buffer}function Te(t,e){return{bytes:Tt(Oe(t,e))}}const xe=t=>{if(Et(t))return[e=>{if(!St(e))throw new ft(t,e,`pair expected: ${JSON.stringify(e)}`);const r=_t("pair",t);return function*(){for(const t of r.args)yield xe(t)}()},t=>t];switch(t.prim){case"or":return[e=>{if(!we(e))throw new ft(t,e,`or expected: ${JSON.stringify(e)}`);return function*(){yield xe(t.args["Left"===e.prim?0:1])}()},t=>t];case"option":return[e=>{if(!_e(e))throw new ft(t,e,`option expected: ${JSON.stringify(e)}`);return function*(){"Some"===e.prim&&(yield xe(t.args[0]))}()},t=>t];case"list":case"set":return[e=>{if(!Array.isArray(e))throw new ft(t,e,`${t.prim} expected: ${JSON.stringify(e)}`);return function*(){for(;;)yield xe(t.args[0])}()},t=>t];case"map":return[e=>{if(!Array.isArray(e))throw new ft(t,e,`map expected: ${JSON.stringify(e)}`);return function*(){for(;;)yield[e=>{if(!("prim"in e)||"Elt"!==e.prim)throw new ft(t,e,`map element expected: ${JSON.stringify(e)}`);return function*(){for(const e of t.args)yield xe(e)}()},t=>t]}()},t=>t];case"chain_id":return[()=>[][Symbol.iterator](),e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`chain id expected: ${JSON.stringify(e)}`);if("string"in e)return e;const r=dt(e.bytes);if(null===r)throw new ft(t,e,`can't parse bytes: ${e.bytes}`);return{string:wt("ChainID",r)}}];case"signature":return[()=>[][Symbol.iterator](),e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`signature expected: ${JSON.stringify(e)}`);if("string"in e)return e;const r=dt(e.bytes);if(null===r)throw new ft(t,e,`can't parse bytes: ${e.bytes}`);return{string:wt("GenericSignature",r)}}];case"key_hash":return[()=>[][Symbol.iterator](),e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`key hash expected: ${JSON.stringify(e)}`);if("string"in e)return e;const r=dt(e.bytes);if(null===r)throw new ft(t,e,`can't parse bytes: ${e.bytes}`);const i=pe(new he(new Uint8Array(r)));return{string:wt(i.type,i.hash)+(i.entryPoint?"%"+i.entryPoint:"")}}];case"key":return[()=>[][Symbol.iterator](),e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`public key expected: ${JSON.stringify(e)}`);if("string"in e)return e;const r=dt(e.bytes);if(null===r)throw new ft(t,e,`can't parse bytes: ${e.bytes}`);const i=me(new he(new Uint8Array(r)));return{string:wt(i.type,i.publicKey)}}];case"address":return[()=>[][Symbol.iterator](),e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`address expected: ${JSON.stringify(e)}`);if("string"in e)return e;const r=dt(e.bytes);if(null===r)throw new ft(t,e,`can't parse bytes: ${e.bytes}`);const i=be(new he(new Uint8Array(r)));return{string:wt(i.type,i.hash)+(i.entryPoint?"%"+i.entryPoint:"")}}];case"timestamp":return[()=>[][Symbol.iterator](),e=>{if(!("int"in e)&&!("string"in e))throw new ft(t,e,`address expected: ${JSON.stringify(e)}`);if("string"in e)return e;return{string:new Date(1e3*parseInt(e.int,10)).toISOString().slice(0,19)+"Z"}}];default:return Re}},Re=[t=>Se(t)?(Kt(t),function*(){yield Re,yield xe(t.args[0])}()):function*(){for(;;)yield Re}(),t=>t];function Pe(t,e){const r=new he(t);if(5!==r.readUint8())throw new Error("incorrect packed data magic number");const i=ye(r,void 0!==e?xe(e):Re);if(Jt(i))return i;throw new Error}function Ie(t,e){const r=dt(t.bytes);if(null===r)throw new Error(`can't parse bytes: "${t.bytes}"`);return Pe(r,e)}function Ne(t){const e=dt(t.bytes);if(null===e)throw new Error(`can't parse bytes: "${t.bytes}"`);return be(new he(new Uint8Array(e)))}function Me(t){const e=dt(t.bytes);if(null===e)throw new Error(`can't parse bytes: "${t.bytes}"`);return pe(new he(new Uint8Array(e)))}function ke(t){const e=dt(t.bytes);if(null===e)throw new Error(`can't parse bytes: "${t.bytes}"`);return me(new he(new Uint8Array(e)))}class Le extends ut{constructor(t,e,r){super(t,r),this.stackState=e,Object.setPrototypeOf(this,Le.prototype)}}function Ce(t){return Array.isArray(t)?"pair":t.prim}function Be(t){return"prim"in t?t.args:t}function De(t,e,r=!1){if(Ce(t)!==Ce(e))throw new ft(t,void 0,`types mismatch: ${Ce(t)} != ${Ce(e)}`);const i=[mt(t),mt(e)];if(i[0].t&&i[1].t&&i[0].t[0]!==i[1].t[0])throw new ft(t,void 0,`${Ce(t)}: type names mismatch: ${i[0].t[0]} != ${i[1].t[0]}`);if(r&&i[0].f&&i[1].f&&i[0].f[0]!==i[1].f[0])throw new ft(t,void 0,`${Ce(t)}: field names mismatch: ${i[0].f[0]} != ${i[1].f}`);if(Et(t)){const r=_t("pair",t),i=_t("pair",e);return De(r.args[0],i.args[0],!0),void De(r.args[1],i.args[1],!0)}switch(t.prim){case"option":case"list":case"contract":case"set":case"ticket":De(t.args[0],e.args[0]);break;case"or":De(t.args[0],e.args[0],!0),De(t.args[1],e.args[1],!0);break;case"lambda":case"map":case"big_map":De(t.args[0],e.args[0]),De(t.args[1],e.args[1]);break;case"sapling_state":case"sapling_transaction":if(parseInt(t.args[0].int,10)!==parseInt(e.args[0].int,10))throw new ft(t,void 0,`${Ce(t)}: type argument mismatch: ${t.args[0].int} != ${e.args[0].int}`)}}function Ue(t,e){if(t.length!==e.length)throw new ft(t,void 0,`stack length mismatch: ${t.length} != ${e.length}`);for(let r=0;r<t.length;r++)De(t[r],e[r])}function je(t,e=!1){var r,i,n;if(!Array.isArray(t)){const s=mt(t);if(((null===(r=s.t)||void 0===r?void 0:r.length)||0)>1)throw new ft(t,void 0,`${t.prim}: at most one type annotation allowed: ${t.annots}`);if(e){if(((null===(i=s.f)||void 0===i?void 0:i.length)||0)>1)throw new ft(t,void 0,`${t.prim}: at most one field annotation allowed: ${t.annots}`)}else if(((null===(n=s.f)||void 0===n?void 0:n.length)||0)>0)throw new ft(t,void 0,`${t.prim}: field annotations aren't allowed: ${t.annots}`)}if(Et(t)){const e=Be(t);for(const t of e)je(t,!0)}else switch(t.prim){case"option":case"list":case"contract":case"set":je(t.args[0]);break;case"or":for(const e of t.args)je(e,!0);break;case"lambda":case"map":case"big_map":je(t.args[0]),je(t.args[1])}}function Ke(t){if(!Array.isArray(t))return!1;for(const e of t)if(!(Array.isArray(e)&&Ke(e)||"prim"in e&&ie(e)))return!1;return!0}function Ve(t,e,r){if(Et(e)){if(St(t)){ne(t);const i=_t("Pair",t),n=_t("pair",e);return Ve(i.args[0],n.args[0],r),void Ve(i.args[1],n.args[1],r)}throw new ft(e,t,`pair expected: ${JSON.stringify(t)}`)}switch(e.prim){case"int":if("int"in t&&pt(t.int))return;throw new ft(e,t,`integer value expected: ${JSON.stringify(t)}`);case"nat":case"mutez":if("int"in t&&bt(t.int))return;throw new ft(e,t,`natural value expected: ${JSON.stringify(t)}`);case"string":if("string"in t)return;throw new ft(e,t,`string value expected: ${JSON.stringify(t)}`);case"bytes":case"bls12_381_g1":case"bls12_381_g2":if("bytes"in t&&null!==dt(t.bytes))return;throw new ft(e,t,`bytes value expected: ${JSON.stringify(t)}`);case"bool":if("prim"in t&&("True"===t.prim||"False"===t.prim))return;throw new ft(e,t,`boolean value expected: ${JSON.stringify(t)}`);case"key_hash":if("string"in t&&null!==yt(t.string,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash"))return;if("bytes"in t)try{return void Me(t)}catch(t){}throw new ft(e,t,`key hash expected: ${JSON.stringify(t)}`);case"timestamp":if(("string"in t||"int"in t)&&null!==Ot(t))return;throw new ft(e,t,`timestamp expected: ${JSON.stringify(t)}`);case"address":if("string"in t){let e=t.string;const r=t.string.indexOf("%");if(r>=0&&(e=t.string.slice(0,r)),null!==yt(e,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash","ContractHash","TxRollupL2Address","RollupAddress"))return}else if("bytes"in t)try{return void Ne(t)}catch(t){}throw new ft(e,t,`address expected: ${JSON.stringify(t)}`);case"key":if("string"in t&&null!==yt(t.string,"ED25519PublicKey","SECP256K1PublicKey","P256PublicKey"))return;if("bytes"in t)try{return void ke(t)}catch(t){}throw new ft(e,t,`public key expected: ${JSON.stringify(t)}`);case"unit":if("prim"in t&&"Unit"===t.prim)return;throw new ft(e,t,`unit value expected: ${JSON.stringify(t)}`);case"signature":if("bytes"in t||"string"in t&&null!==yt(t.string,"ED25519Signature","SECP256K1Signature","P256Signature","GenericSignature"))return;throw new ft(e,t,`signature expected: ${JSON.stringify(t)}`);case"chain_id":if("bytes"in t||"string"in t){if(null!==("string"in t?tt(t.string):dt(t.bytes)))return}throw new ft(e,t,`chain id expected: ${JSON.stringify(t)}`);case"option":if("prim"in t){if("None"===t.prim)return;if("Some"===t.prim)return void Ve(t.args[0],e.args[0],r)}throw new ft(e,t,`option expected: ${JSON.stringify(t)}`);case"list":case"set":if(ne(t)){for(const i of t)Ve(i,e.args[0],r);return}throw new ft(e,t,`${e.prim} expected: ${JSON.stringify(t)}`);case"or":if("prim"in t){if("Left"===t.prim)return void Ve(t.args[0],e.args[0],r);if("Right"===t.prim)return void Ve(t.args[0],e.args[1],r)}throw new ft(e,t,`union (or) expected: ${JSON.stringify(t)}`);case"lambda":if(Ke(t)){const i=Fe(t,[e.args[0]],r);if("failed"in i)throw new ft(e,t,`function is failed with error type: ${i.failed}`);if(1!==i.length)throw new ft(e,t,"function must return a value");return void De(e.args[1],i[0])}throw new ft(e,t,`function expected: ${JSON.stringify(t)}`);case"map":case"big_map":if(Array.isArray(t)){for(const i of t){if(!("prim"in i)||"Elt"!==i.prim)throw new ft(e,t,`map elements expected: ${JSON.stringify(t)}`);Ve(i.args[0],e.args[0],r),Ve(i.args[1],e.args[1],r)}return}throw new ft(e,t,`${e.prim} expected: ${JSON.stringify(t)}`);case"bls12_381_fr":if("int"in t&&pt(t.int)||"bytes"in t&&null!==dt(t.bytes))return;throw new ft(e,t,`BLS12-381 element expected: ${JSON.stringify(t)}`);case"sapling_state":if(Array.isArray(t))return;throw new ft(e,t,`sapling state expected: ${JSON.stringify(t)}`);case"ticket":return void Ve(t,{prim:"pair",args:[{prim:"address"},e.args[0],{prim:"nat"}]},r);default:throw new ft(e,t,`type ${Ce(e)} don't have Michelson literal representation`)}}function Fe(t,e,r){const i=(null==r?void 0:r.protocol)||p;if(Array.isArray(t))return function(t,e,r){let i=e,n=e,s=0;for(const e of t){const t=Fe(e,n,r);if(i=t,"failed"in t)break;n=t,s++}if("failed"in i&&0==i.level&&(!("prim"in i.failed)||"never"!==i.failed.prim)&&s!==t.length-1)throw new Le(t,i,"FAIL must appear in a tail position");if(void 0!==(null==r?void 0:r.traceCallback)){const n={op:t,in:e,out:i};r.traceCallback(n)}return"failed"in i?{failed:i.failed,level:i.level+1}:i}(t,e,r);const n=t;function s(t,...r){if(e.length<r.length+t)throw new Le(n,e,`${n.prim}: stack must have at least ${r.length} element(s)`);let i=t;for(const t of r){if(null!==t&&0!==t.length){let r=0;for(;r<t.length&&t[r]!==Ce(e[i]);)r++;if(r===t.length)throw new Le(n,e,`${n.prim}: stack type mismatch: [${i}] expected to be ${t}, got ${Ce(e[i])} instead`)}i++}return e.slice(t,r.length+t)}function o(t){return(...r)=>{try{return t(...r)}catch(t){throw t instanceof ut?new Le(n,e,t.message):t}}}function a(t){return r=>{try{return t(r)}catch(t){throw t instanceof ut?new Le(n,e,t.message):t}}}const c=o(mt),u=o(Ue),h=o(De),f=a(Vt),b=a(Ft),g=a(Gt),v=a(Ht),y=a(zt);function w(t,r){const i=c(n,Object.assign(Object.assign({},r),{emptyFields:void 0!==t.f&&t.f>1,emptyVar:void 0!==t.v&&t.v>1})),s=(t,r,i)=>{if(t&&t.length>(r||0))throw new Le(n,e,`${n.prim}: at most ${r||0} ${i} annotations allowed`)};return s(i.f,t.f,"field"),s(i.t,t.t,"type"),s(i.v,t.v,"variable"),i}function _(t,e){const r=t,i=Array.isArray(r)?{prim:"pair",args:r}:r,n=c(i),s=void 0!==e.v||void 0!==e.t||void 0!==e.f?[...(null===e.v?n.v:e.v)||[],...(null===e.t?n.t:e.t)||[],...(null===e.f?n.f:e.f)||[]]:void 0,o=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r}(i,["annots"]);return Object.assign(Object.assign({},o),s&&0!==s.length&&{annots:s})}function E(t,e){const r=w({v:1});return _(t,{v:void 0!==r.v?r.v:void 0!==e?[e]:null,t:null})}function S(t,r,i,s,o){var a,u,h,f;const l=null===(a=c(r).f)||void 0===a?void 0:a[0],d=null===(u=i.f)||void 0===u?void 0:u[s];if(void 0!==d&&"%"!==d&&void 0!==l&&d!==l)throw new Le(n,e,`${n.prim}: field names doesn't match: ${d} !== ${l}`);const p=null===(h=i.v)||void 0===h?void 0:h[s],b=null===(f=c(t).v)||void 0===f?void 0:f[0];return _(r,{t:null,v:p?"@%"===p?l?["@"+l.slice(1)]:void 0:"@%%"===p?b?["@"+b.slice(1)+"."+(l?l.slice(1):o)]:l?["@"+l.slice(1)]:void 0:[p]:null})}function A(t,r,i=r){const s=_t("pair",t);if(1===i)return[s.args[0]];if(2===i)return s.args;const o=s.args[1];if(Et(o))return[s.args[0],...A(o,r,i-1)];throw new Le(n,e,`${n.prim}: at least ${r} fields are expected`)}function O(t,r,i=r){if(0===i)return t;const s=_t("pair",t);if(1===i)return s.args[0];const o=s.args[1];if(Et(o))return O(o,r,i-2);if(2===i)return o;throw new Le(n,e,`${n.prim}: at least ${r+1} fields are expected`)}function T(t,r,i,s=i){if(0===s)return r;const o=_t("pair",t);if(1===s)return Object.assign(Object.assign({},o),{args:[r,o.args[1]]});const a=o.args[1];if(Et(a))return Object.assign(Object.assign({},o),{args:[o.args[0],T(a,r,i,s-2)]});if(2===s)return Object.assign(Object.assign({},o),{args:[o.args[0],r]});throw new Le(n,e,`${n.prim}: at least ${i+1} fields are expected`)}const x=(t,e)=>["@"+(t.v?t.v[0].slice(1)+".":"")+e];function R(t,e){return"failed"in t||"failed"in e?"failed"in t?e:t:(u(t,e),t)}const P=(t=>{var n,o,a,p,P;switch(t.prim){case"DUP":{const r=t.args?parseInt(t.args[0].int,10):1;if(0===r)throw new Le(t,e,"DUP 0 is forbidden");const i=s(r-1,null)[0];if("ticket"===Ce(i))throw new Le(t,e,"ticket can't be DUPed");return[i,...e]}case"SWAP":{const t=s(0,null,null);return w({}),[t[1],t[0],...e.slice(2)]}case"SOME":return[_({prim:"option",args:[s(0,null)[0]]},w({t:1,v:1})),...e.slice(1)];case"UNIT":return[_({prim:"unit"},w({v:1,t:1})),...e];case"PAIR":{const r=t.args?parseInt(t.args[0].int,10):2;if(r<2)throw new Le(t,e,`PAIR ${r} is forbidden`);const i=s(0,...new Array(r).fill(null)),n=w({f:r,t:1,v:1},{specialFields:!0}),o=t=>{const e=t.lastIndexOf(".");return t.slice(e>0?e+1:1)},a=i.map(((t,e)=>{var r;const i=c(t);return _(t,{v:null,t:null,f:n.f&&n.f.length>e&&"%"!==n.f[e]?"%@"===n.f[e]?i.v?["%"+o((null===(r=i.v)||void 0===r?void 0:r[0])||"")]:void 0:[n.f[e]]:void 0})}));return[_({prim:"pair",args:a},{t:n.t,v:n.v}),...e.slice(r)]}case"UNPAIR":{const r=t.args?parseInt(t.args[0].int,10):2;if(r<2)throw new Le(t,e,`UNPAIR ${r} is forbidden`);const i=s(0,["pair"])[0],n=w({f:2,v:2},{specialVar:!0});return[...A(i,r).map(((t,e)=>S(i,t,n,e,0===e?"car":"cdr"))),...e.slice(1)]}case"CAR":case"CDR":{const r=_t("pair",s(0,["pair"])[0]);return[S(r,r.args["CAR"===t.prim?0:1],w({f:1,v:1},{specialVar:!0}),0,t.prim.toLocaleLowerCase()),...e.slice(1)]}case"CONS":{const t=s(0,null,["list"]);return h(t[0],t[1].args[0]),[E({prim:"list",args:[t[1].args[0]]}),...e.slice(2)]}case"SIZE":return s(0,["string","list","set","map","bytes"]),[E({prim:"nat"}),...e.slice(1)];case"MEM":{const t=s(0,null,["set","map","big_map"]);return f(t[0]),h(t[0],t[1].args[0]),[E({prim:"bool"}),...e.slice(2)]}case"GET":if(t.args){const r=parseInt(t.args[0].int,10);return[E(O(s(0,["pair"])[0],r)),...e.slice(1)]}{const t=s(0,null,["map","big_map"]);return f(t[0]),h(t[0],t[1].args[0]),[E({prim:"option",args:[t[1].args[1]]}),...e.slice(2)]}case"UPDATE":if(t.args){const r=parseInt(t.args[0].int,10),i=s(0,null,["pair"]);return[E(T(i[1],i[0],r)),...e.slice(2)]}{const t=s(0,null,["bool","option"]);if(f(t[0]),"bool"===t[1].prim){const r=s(2,["set"]);return h(t[0],r[0].args[0]),[E({prim:"set",args:[_(t[0],{t:null})]}),...e.slice(3)]}const r=s(2,["map","big_map"]);return h(t[0],r[0].args[0]),"map"===r[0].prim?[E({prim:"map",args:[_(t[0],{t:null}),_(t[1].args[0],{t:null})]}),...e.slice(3)]:(y(t[1].args[0]),[E({prim:"big_map",args:[_(t[0],{t:null}),_(t[1].args[0],{t:null})]}),...e.slice(3)])}case"GET_AND_UPDATE":{const t=w({v:2}),r=s(0,null,["option"],["map","big_map"]);f(r[0]),h(r[0],r[2].args[0]),h(r[1].args[0],r[2].args[1]);const i=null===(n=t.v)||void 0===n?void 0:n.map((t=>"@"!==t?[t]:void 0));return"map"===r[2].prim?[_({prim:"option",args:[r[2].args[1]]},{v:null==i?void 0:i[0]}),_({prim:"map",args:[_(r[0],{t:null}),_(r[1].args[0],{t:null})]},{v:null==i?void 0:i[1]}),...e.slice(3)]:(y(r[1].args[0]),[_({prim:"option",args:[r[2].args[1]]},{v:null==i?void 0:i[0]}),_({prim:"big_map",args:[_(r[0],{t:null}),_(r[1].args[0],{t:null})]},{v:null==i?void 0:i[1]}),...e.slice(3)])}case"EXEC":{const t=s(0,null,["lambda"]);return h(t[0],t[1].args[0]),[E(t[1].args[1]),...e.slice(2)]}case"APPLY":{const r=s(0,null,["lambda"]);if(g(r[0]),v(r[0]),!Et(r[1].args[0]))throw new Le(t,e,`${t.prim}: function's argument must be a pair: ${Ce(r[1].args[0])}`);const i=r[1].args[0];return h(r[0],Be(i)[0]),[E({prim:"lambda",args:[Be(i)[1],r[1].args[1]]}),...e.slice(2)]}case"FAILWITH":{const t=s(0,null)[0];return m(i,d.PtEdo2Zk)||b(t),{failed:t,level:0}}case"NEVER":return s(0,["never"]),{failed:{prim:"never"},level:0};case"RENAME":return[E(s(0,null)[0]),...e.slice(1)];case"CONCAT":{const r=s(0,["string","list","bytes"]);if("list"===r[0].prim){if("string"!==Ce(r[0].args[0])&&"bytes"!==Ce(r[0].args[0]))throw new Le(t,e,`${t.prim}: can't concatenate list of ${Ce(r[0].args[0])}'s`);return[E(r[0].args[0]),...e.slice(1)]}const i=s(1,["string","bytes"]);if(r[0].prim!==i[0].prim)throw new Le(t,e,`${t.prim}: can't concatenate ${r[0].prim} with ${i[0].prim}`);return[E(i[0]),...e.slice(2)]}case"SLICE":return[E({prim:"option",args:[s(0,["nat"],["nat"],["string","bytes"])[2]]},"@slice"),...e.slice(3)];case"PACK":{const t=s(0,null)[0];return b(t),[E({prim:"bytes"},"@packed"),...e.slice(1)]}case"ADD":{const r=s(0,["nat","int","timestamp","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"],["nat","int","timestamp","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"]);if("nat"===r[0].prim&&"int"===r[1].prim||"int"===r[0].prim&&"nat"===r[1].prim)return[E({prim:"int"}),...e.slice(2)];if("int"===r[0].prim&&"timestamp"===r[1].prim||"timestamp"===r[0].prim&&"int"===r[1].prim)return[E({prim:"timestamp"}),...e.slice(2)];if(("int"===r[0].prim||"nat"===r[0].prim||"mutez"===r[0].prim||"bls12_381_g1"===r[0].prim||"bls12_381_g2"===r[0].prim||"bls12_381_fr"===r[0].prim)&&r[0].prim===r[1].prim)return[E(r[0]),...e.slice(2)];throw new Le(t,e,`${t.prim}: can't add ${r[0].prim} to ${r[1].prim}`)}case"SUB":{const r=m(i,d.PsiThaCa)?s(0,["nat","int","timestamp","mutez"],["nat","int","timestamp","mutez"]):s(0,["nat","int","timestamp"],["nat","int","timestamp"]);if(("nat"===r[0].prim||"int"===r[0].prim)&&("nat"===r[1].prim||"int"===r[1].prim)||"timestamp"===r[0].prim&&"timestamp"===r[1].prim)return[E({prim:"int"}),...e.slice(2)];if("timestamp"===r[0].prim&&"int"===r[1].prim)return[E({prim:"timestamp"}),...e.slice(2)];if("mutez"===r[0].prim&&"mutez"===r[1].prim)return[E({prim:"mutez"}),...e.slice(2)];throw new Le(t,e,`${t.prim}: can't subtract ${r[0].prim} from ${r[1].prim}`)}case"SUB_MUTEZ":return s(0,["mutez"],["mutez"]),[E({prim:"option",args:[{prim:"mutez"}]}),...e.slice(2)];case"MUL":{const r=s(0,["nat","int","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"],["nat","int","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"]);if("nat"===r[0].prim&&"int"===r[1].prim||"int"===r[0].prim&&"nat"===r[1].prim)return[E({prim:"int"}),...e.slice(2)];if("nat"===r[0].prim&&"mutez"===r[1].prim||"mutez"===r[0].prim&&"nat"===r[1].prim)return[E({prim:"mutez"}),...e.slice(2)];if(("bls12_381_g1"===r[0].prim||"bls12_381_g2"===r[0].prim||"bls12_381_fr"===r[0].prim)&&"bls12_381_fr"===r[1].prim||("nat"===r[0].prim||"int"===r[0].prim)&&r[0].prim===r[1].prim)return[E(r[0]),...e.slice(2)];if(("nat"===r[0].prim||"int"===r[0].prim)&&"bls12_381_fr"===r[1].prim||("nat"===r[1].prim||"int"===r[1].prim)&&"bls12_381_fr"===r[0].prim)return[E({prim:"bls12_381_fr"}),...e.slice(2)];throw new Le(t,e,`${t.prim}: can't multiply ${r[0].prim} by ${r[1].prim}`)}case"EDIV":{const r=(t,e)=>({prim:"option",args:[{prim:"pair",args:[{prim:t},{prim:e}]}]}),i=s(0,["nat","int","mutez"],["nat","int","mutez"]);if("nat"===i[0].prim&&"nat"===i[1].prim)return[E(r("nat","nat")),...e.slice(2)];if(!("nat"!==i[0].prim&&"int"!==i[0].prim||"nat"!==i[1].prim&&"int"!==i[1].prim))return[E(r("int","nat")),...e.slice(2)];if("mutez"===i[0].prim&&"nat"===i[1].prim)return[E(r("mutez","mutez")),...e.slice(2)];if("mutez"===i[0].prim&&"mutez"===i[1].prim)return[E(r("nat","mutez")),...e.slice(2)];throw new Le(t,e,`${t.prim}: can't euclideally divide ${i[0].prim} by ${i[1].prim}`)}case"ABS":return s(0,["int"]),[E({prim:"nat"}),...e.slice(1)];case"ISNAT":return s(0,["int"]),[E({prim:"option",args:[{prim:"nat"}]}),...e.slice(1)];case"INT":return s(0,["nat","bls12_381_fr"]),[E({prim:"int"}),...e.slice(1)];case"NEG":{const t=s(0,["nat","int","bls12_381_g1","bls12_381_g2","bls12_381_fr"])[0];return"nat"===t.prim||"int"===t.prim?[E({prim:"int"}),...e.slice(1)]:[E(t),...e.slice(1)]}case"LSL":case"LSR":return s(0,["nat"],["nat"]),[E({prim:"nat"}),...e.slice(2)];case"OR":case"XOR":{const r=s(0,["nat","bool"],["nat","bool"]);if(r[0].prim!==r[1].prim)throw new Le(t,e,`${t.prim}: both arguments must be of the same type: ${r[0].prim}, ${r[1].prim}`);return[E(r[1]),...e.slice(2)]}case"AND":{const r=s(0,["nat","bool","int"],["nat","bool"]);if(("int"!==r[0].prim||"nat"!==r[1].prim)&&r[0].prim!==r[1].prim)throw new Le(t,e,`${t.prim}: both arguments must be of the same type: ${r[0].prim}, ${r[1].prim}`);return[E(r[1]),...e.slice(2)]}case"NOT":return"bool"===s(0,["nat","bool","int"])[0].prim?[E({prim:"bool"}),...e.slice(1)]:[E({prim:"int"}),...e.slice(1)];case"COMPARE":{const t=s(0,null,null);return f(t[0]),f(t[1]),[E({prim:"int"}),...e.slice(2)]}case"EQ":case"NEQ":case"LT":case"GT":case"LE":case"GE":return s(0,["int"]),[E({prim:"bool"}),...e.slice(1)];case"SELF":{if(void 0===(null==r?void 0:r.contract))throw new Le(t,e,`${t.prim}: contract required`);const i=w({f:1,v:1}),n=ze(r.contract,null===(o=i.f)||void 0===o?void 0:o[0]);if(null===n)throw new Le(t,e,`${t.prim}: contract has no entrypoint ${n}`);return[_({prim:"contract",args:[n]},{v:i.v?i.v:["@self"]}),...e]}case"TRANSFER_TOKENS":{const t=s(0,null,["mutez"],["contract"]);return h(t[0],t[2].args[0]),[E({prim:"operation"}),...e.slice(3)]}case"SET_DELEGATE":{const r=s(0,["option"])[0];if("key_hash"!==Ce(r.args[0]))throw new Le(t,e,`${t.prim}: key hash expected: ${Ce(r.args[0])}`);return[E({prim:"operation"}),...e.slice(1)]}case"IMPLICIT_ACCOUNT":return s(0,["key_hash"]),[E({prim:"contract",args:[{prim:"unit"}]}),...e.slice(1)];case"NOW":return[E({prim:"timestamp"},"@now"),...e];case"AMOUNT":return[E({prim:"mutez"},"@amount"),...e];case"BALANCE":return[E({prim:"mutez"},"@balance"),...e];case"CHECK_SIGNATURE":return s(0,["key"],["signature"],["bytes"]),[E({prim:"bool"}),...e.slice(3)];case"BLAKE2B":case"SHA256":case"SHA512":case"KECCAK":case"SHA3":return s(0,["bytes"]),[E({prim:"bytes"}),...e.slice(1)];case"HASH_KEY":return s(0,["key"]),[E({prim:"key_hash"}),...e.slice(1)];case"SOURCE":return[E({prim:"address"},"@source"),...e];case"SENDER":return[E({prim:"address"},"@sender"),...e];case"ADDRESS":{const t=s(0,["contract"])[0],r=w({v:1});return[_({prim:"address",[l]:t},{v:r.v?r.v:x(c(t),"address")}),...e.slice(1)]}case"SELF_ADDRESS":{const t={prim:"address"};return void 0!==(null==r?void 0:r.contract)&&(t[l]={prim:"contract",args:[He(r.contract,"parameter").args[0]]}),[E(t,"@address"),...e]}case"CHAIN_ID":return[E({prim:"chain_id"}),...e];case"DROP":{w({});const r=void 0!==t.args?parseInt(t.args[0].int,10):1;return s(r-1,null),e.slice(r)}case"DIG":{w({});const r=parseInt(t.args[0].int,10);return[s(r,null)[0],...e.slice(0,r),...e.slice(r+1)]}case"DUG":{w({});const r=parseInt(t.args[0].int,10);return[...e.slice(1,r+1),s(0,null)[0],...e.slice(r+1)]}case"NONE":return je(t.args[0]),[_({prim:"option",args:[t.args[0]]},w({t:1,v:1})),...e];case"LEFT":case"RIGHT":{const r=s(0,null)[0],i=w({f:2,t:1,v:1},{specialFields:!0}),n=c(r),o=[_(r,{t:null,v:null,f:i.f&&i.f.length>0&&"%"!==i.f[0]?"%@"===i.f[0]?n.v?["%"+n.v[0].slice(1)]:void 0:i.f:void 0}),_(t.args[0],{t:null,f:i.f&&i.f.length>1&&"%"!==i.f[1]?i.f:void 0})];return[_({prim:"or",args:"LEFT"===t.prim?o:[o[1],o[0]]},{t:i.t,v:i.v}),...e.slice(1)]}case"NIL":return je(t.args[0]),[_({prim:"list",args:[t.args[0]]},w({t:1,v:1})),...e];case"UNPACK":return s(0,["bytes"]),je(t.args[0]),[E({prim:"option",args:[t.args[0]]},"@unpacked"),...e.slice(1)];case"CONTRACT":{const r=s(0,["address"])[0];je(t.args[0]);const i=w({v:1,f:1}),n=r[l];if(void 0!==n){const r=ze(n,null===(a=i.f)||void 0===a?void 0:a[0]);if(null===r)throw new Le(t,e,`${t.prim}: contract has no entrypoint ${r}`);h(r,t.args[0])}return[_({prim:"option",args:[{prim:"contract",args:[t.args[0]]}]},{v:i.v?i.v:x(c(r),"contract")}),...e.slice(1)]}case"CAST":{w({});const r=s(0,null)[0];return je(t.args[0]),h(t.args[0],r),[t.args[0],...e.slice(1)]}case"IF_NONE":{w({});const i=s(0,["option"])[0],n=e.slice(1);return R(Fe(t.args[0],n,r),Fe(t.args[1],[_(i.args[0],{t:null,v:x(c(i),"some")}),...n],r))}case"IF_LEFT":{w({});const i=s(0,["or"])[0],n=c(i),o=c(i.args[0]),a=c(i.args[1]),u=e.slice(1);return R(Fe(t.args[0],[_(i.args[0],{t:null,v:x(n,o.f?o.f[0].slice(1):"left")}),...u],r),Fe(t.args[1],[_(i.args[1],{t:null,v:x(n,a.f?a.f[0].slice(1):"right")}),...u],r))}case"IF_CONS":{w({});const i=s(0,["list"])[0],n=c(i),o=e.slice(1);return R(Fe(t.args[0],[_(i.args[0],{t:null,v:x(n,"hd")}),_(i,{t:null,v:x(n,"tl")}),...o],r),Fe(t.args[1],o,r))}case"IF":{w({}),s(0,["bool"]);const i=e.slice(1);return R(Fe(t.args[0],i,r),Fe(t.args[1],i,r))}case"MAP":{const i=s(0,["list","map","option"])[0],n=e.slice(1),o="map"===i.prim?{prim:"pair",args:i.args}:i.args[0],a=Fe(t.args[0],[_(o,{t:null,v:x(c(i),"elt")}),...n],r);if("failed"in a){if(!("prim"in a.failed)||"never"!==a.failed.prim)throw new Le(t,e,`${t.prim}: FAIL is not allowed in MAP`);return{failed:a.failed,level:a.level+1}}if(a.length<1)throw new Le(t,e,`${t.prim}: function must return a value`);return u(a.slice(1),n),"list"===i.prim?[E({prim:"list",args:[a[0]]}),...n]:"map"===i.prim?[E({prim:"map",args:[i.args[0],a[0]]}),...n]:[E({prim:"option",args:[a[0]]}),...n]}case"ITER":{w({});const i=s(0,["set","list","map"])[0],n=e.slice(1),o="map"===i.prim?{prim:"pair",args:i.args}:i.args[0],a=Fe(t.args[0],[_(o,{t:null,v:x(c(i),"elt")}),...n],r);return"failed"in a?{failed:a.failed,level:a.level+1}:(u(a,n),n)}case"LOOP":{w({}),s(0,["bool"]);const i=e.slice(1),n=Fe(t.args[0],i,r);return"failed"in n?{failed:n.failed,level:n.level+1}:(u(n,[{prim:"bool"},...i]),i)}case"LOOP_LEFT":{w({});const i=s(0,["or"])[0],n=e.slice(1),o=Fe(t.args[0],[_(i.args[0],{t:null,v:x(c(i),"left")}),...n],r);return"failed"in o?{failed:o.failed,level:o.level+1}:(u(o,[i,...n]),[_(i.args[1],{t:null,v:w({v:1}).v}),...n])}case"DIP":{w({});const i=2===t.args.length?parseInt(t.args[0].int,10):1;s(i-1,null);const n=e.slice(0,i),o=e.slice(i),a=2===t.args.length?Fe(t.args[1],o,r):Fe(t.args[0],o,r);return"failed"in a?{failed:a.failed,level:a.level+1}:[...n,...a]}case"CREATE_CONTRACT":{const r=w({v:2}),i=s(0,["option"],["mutez"],null);if("key_hash"!==Ce(i[0].args[0]))throw new Le(t,e,`${t.prim}: key hash expected: ${Ce(i[0].args[0])}`);g(i[2])&&(Ze(t.args[0]),De(He(t.args[0],"storage").args[0],i[2]));const n=null===(p=r.v)||void 0===p?void 0:p.map((t=>"@"!==t?[t]:void 0));return[_({prim:"operation"},{v:null==n?void 0:n[0]}),_({prim:"address",[l]:{prim:"contract",args:[He(t.args[0],"parameter").args[0]]}},{v:null==n?void 0:n[1]}),...e.slice(3)]}case"PUSH":return je(t.args[0]),Ve(t.args[1],t.args[0],Object.assign(Object.assign({},r),{contract:void 0})),[E(t.args[0]),...e];case"EMPTY_SET":return je(t.args[0]),f(t.args[0]),[_({prim:"set",args:t.args},w({t:1,v:1})),...e];case"EMPTY_MAP":return je(t.args[0]),f(t.args[0]),je(t.args[1]),[_({prim:"map",args:t.args},w({t:1,v:1})),...e];case"EMPTY_BIG_MAP":return je(t.args[0]),f(t.args[0]),je(t.args[1]),y(t.args[0]),[_({prim:"big_map",args:t.args},w({t:1,v:1})),...e];case"LAMBDA":{je(t.args[0]),je(t.args[1]);const i=Fe(t.args[2],[t.args[0]],Object.assign(Object.assign({},r),{contract:void 0}));if("failed"in i)return{failed:i.failed,level:i.level+1};if(1!==i.length)throw new Le(t,e,`${t.prim}: function must return a value`);return h(t.args[1],i[0]),[E({prim:"lambda",args:[t.args[0],t.args[1]]}),...e]}case"LEVEL":return[E({prim:"nat"},"@level"),...e];case"TOTAL_VOTING_POWER":case"MIN_BLOCK_TIME":return[E({prim:"nat"}),...e];case"VOTING_POWER":return s(0,["key_hash"]),[E({prim:"nat"}),...e.slice(1)];case"TICKET":{const t=s(0,null,["nat"])[0];return f(t),[_({prim:"ticket",args:[t]},w({t:1,v:1})),...e.slice(2)]}case"JOIN_TICKETS":{const r=_t("pair",s(0,["pair"])[0]);if("ticket"!==Ce(r.args[0]))throw new Le(t,e,`${t.prim}: ticket expected: ${Ce(r.args[0])}`);return h(r.args[0],r.args[1]),[E({prim:"option",args:[_(r.args[0],{t:null})]}),...e.slice(1)]}case"SPLIT_TICKET":{const r=s(0,["ticket"],["pair"]),i=_t("pair",r[1]);if("nat"!==Ce(i.args[0]))throw new Le(t,e,`${t.prim}: nat expected: ${Ce(i.args[0])}`);return h(i.args[0],i.args[1]),[E({prim:"option",args:[{prim:"pair",args:[_(r[0],{t:null}),_(r[0],{t:null})]}]}),...e.slice(2)]}case"READ_TICKET":{const t=w({v:2}),r=s(0,["ticket"])[0],i=null===(P=t.v)||void 0===P?void 0:P.map((t=>"@"!==t?[t]:void 0));return[_({prim:"pair",args:[{prim:"address"},_(r.args[0],{t:null}),{prim:"nat"}]},{v:null==i?void 0:i[0]}),_(r,{v:null==i?void 0:i[1],t:null}),...e.slice(1)]}case"PAIRING_CHECK":{const r=s(0,["list"])[0].args[0];if(!Et(r))throw new Le(t,e,`${t.prim}: pair expected: ${Ce(r)}`);const i=_t("pair",r);if("bls12_381_g1"!==Ce(i.args[0]))throw new Le(t,e,`${t.prim}: bls12_381_g1 expected: ${Ce(i.args[0])}`);if("bls12_381_g2"!==Ce(i.args[1]))throw new Le(t,e,`${t.prim}: bls12_381_g2 expected: ${Ce(i.args[1])}`);return[E({prim:"bool"}),...e.slice(1)]}case"SAPLING_EMPTY_STATE":return[_({prim:"sapling_state",args:[t.args[0]]},w({v:1,t:1})),...e];case"SAPLING_VERIFY_UPDATE":{const r=s(0,["sapling_transaction"],["sapling_state"]);if(parseInt(r[0].args[0].int,10)!==parseInt(r[1].args[0].int,10))throw new Le(t,e,`${t.prim}: sapling memo size mismatch: ${r[0].args[0].int} != ${r[1].args[0].int}`);return m(i,d.PtJakarta)?[E({prim:"option",args:[{prim:"pair",args:[{prim:"int"},_(r[1],{t:null})]}]}),...e.slice(2)]:[E({prim:"option",args:[{prim:"pair",args:[{prim:"bytes"},{prim:"pair",args:[{prim:"int"},_(r[1],{t:null})]}]}]}),...e.slice(2)]}case"OPEN_CHEST":return s(0,["chest_key"],["chest"],["nat"]),[E({prim:"or",args:[{prim:"bytes"},{prim:"bool"}]}),...e.slice(3)];case"VIEW":{const r=s(0,null,["address"]);return v(r[0]),[E({prim:"option",args:[t.args[1]]}),...e.slice(2)]}case"EMIT":{const r=w({f:1,t:1});if(t.args){const i=s(0,null);return h(i[0],t.args[0]),[_({prim:"operation"},r),...e.slice(1)]}return[_({prim:"operation"},r),...e.slice(1)]}default:throw new ut(t,`unexpected instruction: ${t.prim}`)}})(n);if(void 0!==(null==r?void 0:r.traceCallback)){const t={op:n,in:e,out:P};r.traceCallback(t)}return P}function He(t,e){for(const r of t)if(r.prim===e)return r;throw new ut(t,`missing contract section: ${e}`)}function Ge(t){const e={};for(const r of t)"view"===r.prim&&(e[r.args[0].string]=r);return e}function $e(t){if(Array.isArray(t))for(const e of t)if("prim"in e&&("parameter"===e.prim||"storage"===e.prim||"code"===e.prim))return!0;return!1}function ze(t,e){e=e||"%default";const r=qe(t).find((t=>t[0]===e));return void 0!==r?r[1]:"%default"===e?$e(t)?He(t,"parameter").args[0]:t:null}function qe(t){if($e(t)){const e=He(t,"parameter"),r=qe(e.args[0]),i=mt(e);return i.f?[[i.f[0],e.args[0]],...r]:r}if(e=t,Array.isArray(e)||"or"===e.prim){const e=Be(t),r=t=>{const r=mt(e[t]);if("or"===Ce(e[t])){const i=qe(e[t]);return r.f?[[r.f[0],e[t]],...i]:i}return r.f?[[r.f[0],e[t]]]:[]};return[...r(0),...r(1)]}var e;return[]}function Ze(t,e){const r=(r,i,n,s)=>{je(r,!0),je(i);const o=Fe(s,[{prim:"pair",args:[Object.assign(Object.assign({},r),{annots:["@parameter"]}),Object.assign(Object.assign({},i),{annots:["@storage"]})]}],Object.assign(Object.assign({},e),{contract:t}));if("failed"in o)return o;try{Ue(o,[n])}catch(t){throw t instanceof ut?new Le(s,o,t.message):t}return o},i=He(t,"parameter").args[0],n=He(t,"storage").args[0],s=r(i,n,{prim:"pair",args:[{prim:"list",args:[{prim:"operation"}]},n]},He(t,"code").args[0]);for(const e of Object.values(Ge(t)))r(e.args[1],n,e.args[2],e.args[3]);return s}function We(t,e,r){je(e),Ve(t,e,r||null)}function Ye(t,e,r){for(const t of e)je(t);if(void 0!==(null==r?void 0:r.contract))for(const t of["parameter","storage"]){je(He(r.contract,t).args[0])}return Fe(t,e,r||null)}function Je(t,e,r=!1){if(Array.isArray(t)){for(const e of t)je(e);for(const t of e)je(t)}else je(t),je(e);De(t,e,r)}function Xe(t,e=!1){try{return je(t,e),!0}catch(t){return!1}}function Qe(t,e){try{return Ze(t,e)}catch(t){return null}}function tr(t,e,r){try{return We(t,e,r),!0}catch(t){return!1}}function er(t,e,r=!1){try{return Je(t,e,r),!0}catch(t){return!1}}class rr{constructor(t,e){this.contract=t,this.ctx=Object.assign({contract:t},e),this.output=Ze(t,this.ctx)}static parse(t,e){const r=new K(e),i="string"==typeof t?r.parseScript(t):r.parseJSON(t);if(null===i)throw new rt("empty contract");if(Xt(i))return new rr(i,e)}static parseTypeExpression(t,e){const r=new K(e),i="string"==typeof t?r.parseScript(t):r.parseJSON(t);if(null===i)throw new it("empty type expression");if(Wt(i))return je(i),i}static parseDataExpression(t,e){const r=new K(e),i="string"==typeof t?r.parseScript(t):r.parseJSON(t);if(null===i)throw new nt("empty data expression");if(Jt(i))return i;throw void 0}section(t){return He(this.contract,t)}entryPoints(){return qe(this.contract)}entryPoint(t){return ze(this.contract,t)}assertDataValid(t,e){We(t,e,this.ctx)}isDataValid(t,e){return tr(t,e,this.ctx)}assertParameterValid(t,e){const r=this.entryPoint(t||void 0);if(null===r)throw new st(null==t?void 0:t.toString());this.assertDataValid(e,r)}isParameterValid(t,e){try{return this.assertParameterValid(t,e),!0}catch(t){return!1}}functionType(t,e){return Ye(t,e,this.ctx)}}const ir=new rr([{prim:"parameter",args:[{prim:"unit"}]},{prim:"storage",args:[{prim:"unit"}]},{prim:"code",args:[[{prim:"CAR"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PAIR"}]]}]);function nr(t){return"failed"in t?`[FAILED: ${$(t.failed)}]`:t.map(((t,e)=>{const r=mt(t);return`[${e}${r.v?"/"+r.v[0]:""}]: ${$(t)}`})).join("\n")}function sr(t,e){return r=>{var n;if(Array.isArray(r)&&!t)return;const s=null===(n=r.op[i])||void 0===n?void 0:n.macro,o=`${s?"Macro":"Op"}: ${s?$(s,void 0,!0)+" / ":""}${$(r.op)}\nInput:\n${nr(r.in)}\nOutput:\n${nr(r.out)}\n`;e(o)}}function or(t){var e;if(t instanceof Le){const r=null===(e=t.val[i])||void 0===e?void 0:e.macro;return`${r?"Macro":"Op"}: ${r?$(r,void 0,!0)+" / ":""}${$(t.val)}\nStack:\n${nr(t.stackState)}\n`}if(t instanceof ft){return`Type: ${Array.isArray(t.val)?"["+t.val.map(((t,e)=>`[${e}]: ${$(t)}`)).join("; ")+"]":$(t.val)}\n${t.data?`Data: ${$(t.data)}\n`:""}\n`}return`Value: ${$(t.val)}`}const ar={commitHash:"d474f2ac7abec2e8faddba47cf403a0c0203c7d5",version:"14.2.0-beta-RC.0"}},8899:(t,e,r)=>{"use strict";r.r(e),r.d(e,{AddressValidationError:()=>T,BigMapEncodingError:()=>Ut,BigMapValidationError:()=>b,BytesValidationError:()=>j,ChainIDValidationError:()=>rt,ContractValidationError:()=>k,EncodeTicketError:()=>nt,IntValidationError:()=>H,InvalidBigMapDiff:()=>Dt,InvalidBigMapSchema:()=>Bt,InvalidMapTypeError:()=>c,InvalidRpcResponseError:()=>Lt,InvalidScriptError:()=>kt,KeyHashValidationError:()=>Z,KeyValidationError:()=>z,ListValidationError:()=>C,MapTypecheckError:()=>h,MapValidationError:()=>R,MichelsonMap:()=>f,MissingArgumentError:()=>Kt,MutezValidationError:()=>D,NatValidationError:()=>S,OrTokenDecodingError:()=>m,ParameterEncodingError:()=>Ct,ParameterSchema:()=>zt,SaplingStateValue:()=>Yt,Schema:()=>$t,SetValidationError:()=>tt,SignatureValidationError:()=>Y,StorageEncodingError:()=>jt,Token:()=>d,TokenArgumentValidationError:()=>y,TokenComparisonError:()=>w,UnitValue:()=>Wt,VERSION:()=>Zt,ViewEncodingError:()=>Mt,ViewSchema:()=>qt});var i,n=r(5695),s=r.n(n),o=r(2558),a=r(4632);class c extends Error{constructor(t){super(`The map type '${t}' is invalid`),this.mapType=t,this.name="InvalidMapTypeError"}}const u=Symbol.for("taquito-michelson-map-type-symbol");class h extends Error{constructor(t,e,r){super(`${r} not compliant with underlying michelson type`),this.value=t,this.type=e,this.name="MapTypecheckError"}}class f{constructor(t){this.valueMap=new Map,this.keyMap=new Map,this[i]=!0,t&&this.setType(t)}static isMichelsonMap(t){return t&&!0===t[u]}setType(t){if(!("args"in(e=t))||!Array.isArray(e.args)||2!==e.args.length)throw new c(t.toString());var e;this.keySchema=new $t(t.args[0]),this.valueSchema=new $t(t.args[1])}removeType(){this.keySchema=void 0,this.valueSchema=void 0}static fromLiteral(t,e){const r=new f(e);return Object.keys(t).forEach((e=>{r.set(e,t[e])})),r}typecheckKey(t){return!this.keySchema||this.keySchema.Typecheck(t)}typecheckValue(t){return!this.valueSchema||this.valueSchema.Typecheck(t)}assertTypecheckValue(t){if(!this.typecheckValue(t))throw new h(t,this.valueSchema,"value")}assertTypecheckKey(t){if(!this.typecheckKey(t))throw new h(t,this.keySchema,"key")}serializeDeterministically(t){return s()(t)}*keys(){for(const[t]of this.entries())yield t}*values(){for(const[,t]of this.entries())yield t}*entries(){for(const t of this.valueMap.keys())yield[this.keyMap.get(t),this.valueMap.get(t)]}get(t){this.assertTypecheckKey(t);const e=this.serializeDeterministically(t);return this.valueMap.get(e)}set(t,e){this.assertTypecheckKey(t),this.assertTypecheckValue(e);const r=this.serializeDeterministically(t);this.keyMap.set(r,t),this.valueMap.set(r,e)}delete(t){this.assertTypecheckKey(t),this.keyMap.delete(this.serializeDeterministically(t)),this.valueMap.delete(this.serializeDeterministically(t))}has(t){this.assertTypecheckKey(t);const e=this.serializeDeterministically(t);return this.keyMap.has(e)&&this.valueMap.has(e)}clear(){this.keyMap.clear(),this.valueMap.clear()}get size(){return this.keyMap.size}forEach(t){for(const[e,r]of this.entries())t(r,e,this)}}i=u;class l extends Error{constructor(t,e,r){super(),this.value=t,this.token=e,this.name="ValidationError";const i=this.token.annot(),n=i?`[${i}] `:"";this.message=`${n}${r}`}}class d{constructor(t,e,r){this.val=t,this.idx=e,this.fac=r,this.createToken=this.fac}typeWithoutAnnotations(){const t=e=>{if("object"==typeof e){if(Array.isArray(e)){return e.map((e=>t(e)))}const r=e;return r.args?{prim:r.prim,args:r.args.map((e=>t(e)))}:{prim:r.prim}}return e};return(e=this.val).args?{prim:e.prim,args:e.args.map((e=>t(e)))}:{prim:e.prim};var e}annot(){return(Array.isArray(this.val.annots)&&this.val.annots.length>0?this.val.annots[0]:String(this.idx)).replace(/(%|:)(_Liq_entry_)?/,"")}hasAnnotations(){return Array.isArray(this.val.annots)&&this.val.annots.length}get tokenVal(){return this.val}ExtractSignature(){return[[this.ExtractSchema()]]}}class p extends d{compare(t,e){return t===e?0:t<e?-1:1}}class b extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="BigMapValidationError"}}class g extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}get ValueSchema(){return this.createToken(this.val.args[1],0)}get KeySchema(){return this.createToken(this.val.args[0],0)}ExtractSchema(){return{big_map:{key:this.KeySchema.ExtractSchema(),value:this.ValueSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:g.prim,schema:{key:this.KeySchema.generateSchema(),value:this.ValueSchema.generateSchema()}}}isValid(t){return f.isMichelsonMap(t)?null:new b(t,this,"Value must be a MichelsonMap")}objLitToMichelsonMap(t){return t instanceof f?t:"object"==typeof t?0===Object.keys(t).length?new f:f.fromLiteral(t):t}Encode(t){const e=this.objLitToMichelsonMap(t.pop()),r=this.isValid(e);if(r)throw r;return Array.from(e.keys()).sort(((t,e)=>this.KeySchema.compare(t,e))).map((t=>({prim:"Elt",args:[this.KeySchema.EncodeObject(t),this.ValueSchema.EncodeObject(e.get(t))]})))}EncodeObject(t,e){const r=this.objLitToMichelsonMap(t),i=this.isValid(r);if(i)throw i;return e&&e[g.prim]?e[g.prim](r,this.val):Array.from(r.keys()).sort(((t,e)=>this.KeySchema.compare(t,e))).map((t=>({prim:"Elt",args:[this.KeySchema.EncodeObject(t),this.ValueSchema.EncodeObject(r.get(t))]})))}Execute(t,e){if(e&&e[g.prim])return e[g.prim](t,this.val);if(Array.isArray(t)){const e=new f(this.val);return t.forEach((t=>{e.set(this.KeySchema.ToKey(t.args[0]),this.ValueSchema.Execute(t.args[1]))})),e}if("int"in t)return t.int;throw new b(t,this,`Big map is expecting either an array (Athens) or an object with an int property (Babylon). Got ${JSON.stringify(t)}`)}findAndReturnTokens(t,e){return g.prim===t&&e.push(this),this.KeySchema.findAndReturnTokens(t,e),this.ValueSchema.findAndReturnTokens(t,e),e}}g.prim="big_map";class m extends Error{constructor(t){super(t),this.message=t,this.name="OrTokenDecodingError"}}class v extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Encode(t){const e=t[t.length-1],r=this.createToken(this.val.args[0],this.idx);let i=1;r instanceof v&&(i=Object.keys(r.ExtractSchema()).length);const n=this.createToken(this.val.args[1],this.idx+i);if(String(r.annot())!==String(e)||r instanceof v){if(String(n.annot())!==String(e)||n instanceof v){if(r instanceof v){const e=r.Encode(t);if(e)return{prim:"Left",args:[e]}}if(n instanceof v){const e=n.Encode(t);if(e)return{prim:"Right",args:[e]}}return null}return t.pop(),{prim:"Right",args:[n.Encode(t)]}}return t.pop(),{prim:"Left",args:[r.Encode(t)]}}ExtractSignature(){const t=this.createToken(this.val.args[0],this.idx);let e=1;t instanceof v&&(e=Object.keys(t.ExtractSchema()).length);const r=this.createToken(this.val.args[1],this.idx+e),i=[];if(t instanceof v)i.push(...t.ExtractSignature());else for(const e of t.ExtractSignature())i.push([t.annot(),...e]);if(r instanceof v)i.push(...r.ExtractSignature());else for(const t of r.ExtractSignature())i.push([r.annot(),...t]);return i}EncodeObject(t,e){const r=Object.keys(t)[0],i=this.createToken(this.val.args[0],this.idx);let n=1;i instanceof v&&(n=Object.keys(i.ExtractSchema()).length);const s=this.createToken(this.val.args[1],this.idx+n);if(String(i.annot())!==String(r)||i instanceof v){if(String(s.annot())!==String(r)||s instanceof v){if(i instanceof v){const r=i.EncodeObject(t,e);if(r)return{prim:"Left",args:[r]}}if(s instanceof v){const r=s.EncodeObject(t,e);if(r)return{prim:"Right",args:[r]}}return null}return{prim:"Right",args:[s.EncodeObject(t[r],e)]}}return{prim:"Left",args:[i.EncodeObject(t[r],e)]}}Execute(t,e){const r=this.createToken(this.val.args[0],this.idx);let i=1;r instanceof v&&(i=Object.keys(r.ExtractSchema()).length);const n=this.createToken(this.val.args[1],this.idx+i);if("Right"===t.prim)return n instanceof v?n.Execute(t.args[0],e):{[n.annot()]:n.Execute(t.args[0],e)};if("Left"===t.prim)return r instanceof v?r.Execute(t.args[0],e):{[r.annot()]:r.Execute(t.args[0],e)};throw new m(`Was expecting Left or Right prim but got: ${t.prim}`)}traversal(t,e,r){const i=this.createToken(this.val.args[0],this.idx);let n,s=1;i instanceof v&&!i.hasAnnotations()?(n=t(i),s=Object.keys(i.ExtractSchema()).length):n={[i.annot()]:t(i)};const o=this.createToken(this.val.args[1],this.idx+s);let a;a=o instanceof v&&!o.hasAnnotations()?e(o):{[o.annot()]:e(o)};return r(n,a)}ExtractSchema(){return this.traversal((t=>t.ExtractSchema()),(t=>t.ExtractSchema()),((t,e)=>Object.assign(Object.assign({},t),e)))}generateSchema(){return{__michelsonType:v.prim,schema:this.traversal((t=>t instanceof v&&!t.hasAnnotations()?t.generateSchema().schema:t.generateSchema()),(t=>t instanceof v&&!t.hasAnnotations()?t.generateSchema().schema:t.generateSchema()),((t,e)=>Object.assign(Object.assign({},t),e)))}}findToken(t){const e=this.createToken(this.val.args[0],this.idx);let r=1;e instanceof v&&(r=Object.keys(e.ExtractSchema()).length);const i=this.createToken(this.val.args[1],this.idx+r);if(String(e.annot())===String(t)&&!(e instanceof v)&&e instanceof p)return e;if(String(i.annot())===String(t)&&!(i instanceof v)&&i instanceof p)return i;if(e instanceof v){const r=e.findToken(t);if(r)return r}if(i instanceof v){const e=i.findToken(t);if(e)return e}return null}compare(t,e){const r=Object.keys(t)[0];if(r!==Object.keys(e)[0]){return JSON.stringify(this.EncodeObject(t))<JSON.stringify(this.EncodeObject(e))?-1:1}{const i=this.findToken(r);if(i instanceof p)return i.compare(t[r],e[r])}}ToKey(t){return this.Execute(t)}ToBigMapKey(t){return{key:this.EncodeObject(t),type:this.typeWithoutAnnotations()}}findAndReturnTokens(t,e){return v.prim===t&&e.push(this),this.traversal((r=>r.findAndReturnTokens(t,e)),(r=>r.findAndReturnTokens(t,e)),((t,e)=>Object.assign(Object.assign({},t),e))),e}}v.prim="or";class y extends Error{constructor(t){super(t),this.message=t,this.name="TokenArgumentValidationError"}}class w extends Error{constructor(t,e){super(`Tokens ${t} and ${e} are not comparable`),this.val1=t,this.val2=e,this.name="TokenComparisonError"}}function _(t,e=E.prim){if(Array.isArray(t))return _({prim:e,args:t},e);if(void 0===t.args)throw new y("Encountered an invalid PairToken with no arguments, a pair must have two or more arguments");return t.args.length>2?[t.args[0],{prim:e,args:t.args.slice(1)}]:[t.args[0],t.args[1]]}class E extends p{constructor(t,e,r){super(Array.isArray(t)?{prim:E.prim,args:t}:t.prim?t:{prim:E.prim,args:t},e,r)}args(){return _(this.val)}tokens(){let t=0;return this.args().map((e=>{const r=this.createToken(e,this.idx+t);return r instanceof E?t+=Object.keys(r.ExtractSchema()).length:t++,r}))}Encode(t){return{prim:"Pair",args:this.tokens().map((e=>e.Encode(t)))}}ExtractSignature(){const t=this.args(),e=this.createToken(t[0],this.idx);let r=1;e instanceof v&&(r=Object.keys(e.ExtractSchema()).length);const i=this.createToken(t[1],this.idx+r),n=[];for(const t of e.ExtractSignature())for(const e of i.ExtractSignature())n.push([...t,...e]);return n}ToBigMapKey(t){return{key:this.EncodeObject(t),type:this.typeWithoutAnnotations()}}ToKey(t){return this.Execute(t)}EncodeObject(t,e){const[r,i]=this.tokens();let n,s;return n=r instanceof E&&!r.hasAnnotations()?t:t[r.annot()],s=i instanceof E&&!i.hasAnnotations()?t:t[i.annot()],{prim:"Pair",args:[r.EncodeObject(n,e),i.EncodeObject(s,e)]}}traversal(t,e){const r=this.args(),i=this.createToken(r[0],this.idx);let n,s=1;i instanceof E&&(s=Object.keys(i.ExtractSchema()).length),n=i instanceof E&&!i.hasAnnotations()?t(i):{[i.annot()]:t(i)};const o=this.createToken(r[1],this.idx+s);let a;a=o instanceof E&&!o.hasAnnotations()?e(o):{[o.annot()]:e(o)};return Object.assign(Object.assign({},n),a)}Execute(t,e){const r=_(t,"Pair");return this.traversal((t=>t.Execute(r[0],e)),(t=>t.Execute(r[1],e)))}ExtractSchema(){return this.traversal((t=>t.ExtractSchema()),(t=>t.ExtractSchema()))}generateSchema(){return{__michelsonType:E.prim,schema:this.traversal((t=>t instanceof E&&!t.hasAnnotations()?t.generateSchema().schema:t.generateSchema()),(t=>t instanceof E&&!t.hasAnnotations()?t.generateSchema().schema:t.generateSchema()))}}compare(t,e){const[r,i]=this.tokens(),n=(t,e)=>t instanceof E&&!t.hasAnnotations()?e:e[t.annot()];if(r instanceof p&&i instanceof p){const s=r.compare(n(r,t),n(r,e));return 0===s?i.compare(n(i,t),n(i,e)):s}throw new w(t,e)}findAndReturnTokens(t,e){return E.prim===t&&e.push(this),this.tokens().map((r=>r.findAndReturnTokens(t,e))),e}}E.prim="pair";class S extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="NatValidationError"}}class A extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return new o.Z(t[Object.keys(t)[0]])}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return{int:new o.Z(e).toFixed()}}isValid(t){const e=new o.Z(t);return e.isNaN()?new S(t,this,`Value is not a number: ${t}`):e.isNegative()?new S(t,this,`Value cannot be negative: ${t}`):null}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[A.prim]?e[A.prim](t):{int:new o.Z(t).toFixed()}}ExtractSchema(){return A.prim}generateSchema(){return{__michelsonType:A.prim,schema:A.prim}}ToBigMapKey(t){return{key:{int:String(t)},type:{prim:A.prim}}}ToKey({int:t}){return new o.Z(t)}compare(t,e){const r=Number(t),i=Number(e);return r===i?0:r<i?-1:1}findAndReturnTokens(t,e){return A.prim===t&&e.push(this),e}}A.prim="nat";class O extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return t[Object.keys(t)[0]]}ExtractSchema(){return O.prim}generateSchema(){return{__michelsonType:O.prim,schema:O.prim}}Encode(t){return{string:t.pop()}}EncodeObject(t,e){return e&&e[O.prim]?e[O.prim](t):{string:t}}ToKey({string:t}){return t}ToBigMapKey(t){return{key:{string:t},type:{prim:O.prim}}}findAndReturnTokens(t,e){return O.prim===t&&e.push(this),e}}O.prim="string";class T extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="AddressValidationError"}}class x extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}ToBigMapKey(t){return{key:{bytes:(0,a.b58decode)(t)},type:{prim:"bytes"}}}isValid(t){return(0,a.validateAddress)(t)!==a.ValidationResult.VALID?new T(t,this,`Address is not valid: ${t}`):null}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return{string:e}}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[x.prim]?e[x.prim](t):{string:t}}Execute(t){if(t.string)return t.string;if(!t.bytes)throw new T(t,this,`cannot be missing both string and bytes: ${t}`);return(0,a.encodePubKey)(t.bytes)}ExtractSchema(){return x.prim}generateSchema(){return{__michelsonType:x.prim,schema:x.prim}}ToKey({bytes:t,string:e}){if(e)return e;if(!t)throw new T({bytes:t,string:e},this,`cannot be missing both string and bytes ${{string:e,bytes:t}}`);return(0,a.encodePubKey)(t)}compare(t,e){const r=t=>t.startsWith("tz"),i=r(t),n=r(e);return i&&!n?-1:n&&!i?1:super.compare(t,e)}findAndReturnTokens(t,e){return x.prim===t&&e.push(this),e}}x.prim="address";class R extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="MapValidationError"}}class P extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}get ValueSchema(){return this.createToken(this.val.args[1],0)}get KeySchema(){return this.createToken(this.val.args[0],0)}isValid(t){return f.isMichelsonMap(t)?null:new R(t,this,"Value must be a MichelsonMap")}Execute(t,e){const r=new f(this.val);return t.forEach((t=>{r.set(this.KeySchema.ToKey(t.args[0]),this.ValueSchema.Execute(t.args[1],e))})),r}objLitToMichelsonMap(t){return t instanceof f?t:"object"==typeof t?0===Object.keys(t).length?new f:f.fromLiteral(t):t}Encode(t){const e=this.objLitToMichelsonMap(t.pop()),r=this.isValid(e);if(r)throw r;return Array.from(e.keys()).sort(((t,e)=>this.KeySchema.compare(t,e))).map((t=>({prim:"Elt",args:[this.KeySchema.EncodeObject(t),this.ValueSchema.EncodeObject(e.get(t))]})))}EncodeObject(t,e){const r=this.objLitToMichelsonMap(t),i=this.isValid(r);if(i)throw i;return e&&e[P.prim]?e[P.prim](r):Array.from(r.keys()).sort(((t,e)=>this.KeySchema.compare(t,e))).map((t=>({prim:"Elt",args:[this.KeySchema.EncodeObject(t),this.ValueSchema.EncodeObject(r.get(t))]})))}ExtractSchema(){return{map:{key:this.KeySchema.ExtractSchema(),value:this.ValueSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:P.prim,schema:{key:this.KeySchema.generateSchema(),value:this.ValueSchema.generateSchema()}}}findAndReturnTokens(t,e){return P.prim===t&&e.push(this),this.KeySchema.findAndReturnTokens(t,e),this.ValueSchema.findAndReturnTokens(t,e),e}}P.prim="map";class I extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return"true"===String(t.prim).toLowerCase()}Encode(t){return{prim:t.pop()?"True":"False"}}EncodeObject(t,e){return e&&e[I.prim]?e[I.prim](t):{prim:t?"True":"False"}}ExtractSchema(){return I.prim}generateSchema(){return{__michelsonType:I.prim,schema:I.prim}}ToBigMapKey(t){return{key:this.EncodeObject(t),type:{prim:I.prim}}}ToKey(t){return this.EncodeObject(t)}compare(t,e){return t&&e||!t&&!e?0:t?1:-1}findAndReturnTokens(t,e){return I.prim===t&&e.push(this),e}}I.prim="bool";class N extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="TxRollupL2AddressValidationError"}}class M extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}ToBigMapKey(t){return{key:{bytes:(0,a.b58decodeL2Address)(t)},type:{prim:"bytes"}}}isValid(t){if((0,a.validateAddress)(t)!==a.ValidationResult.VALID)throw new N(t,this,`tx_rollup_l2_address is not valid: ${t}`);return null}Encode(t){const e=t.pop();if(!e)throw new N(e,this,`arg missing to encode: this -> "${e}"`);return this.isValid(e),{string:e}}EncodeObject(t,e){return this.isValid(t),e&&e[M.prim]?e[M.prim](t):{string:t}}Execute(t){if(t.string)return t.string;if(!t.bytes)throw new N(t,this,`value cannot be missing string and byte value. must have one ${JSON.stringify(t)}`);return(0,a.encodeL2Address)(t.bytes)}ExtractSchema(){return M.prim}generateSchema(){return{__michelsonType:M.prim,schema:M.prim}}ToKey({bytes:t,string:e}){if(e)return e;if(!t)throw new N(t,this,`value cannot be missing string and byte value. must have one: bytes = ${t}`);return(0,a.encodeL2Address)(t)}findAndReturnTokens(t,e){return M.prim===t&&e.push(this),e}}M.prim="tx_rollup_l2_address";class k extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="ContractValidationError"}}class L extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}isValid(t){return(0,a.validateAddress)(t)!==a.ValidationResult.VALID?new k(t,this,"Contract address is not valid"):null}Execute(t){if(t.string)return t.string;if(!t.bytes)throw new k(t,this,"must contain bytes or string");return(0,a.encodePubKey)(t.bytes)}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return{string:e}}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[L.prim]?e[L.prim](t):{string:t}}ExtractSchema(){return L.prim}generateSchema(){const t=this.createToken(this.val.args[0],0);return{__michelsonType:L.prim,schema:{parameter:this.val.args[0]?t.generateSchema():{}}}}findAndReturnTokens(t,e){return L.prim===t&&e.push(this),e}}L.prim="contract";class C extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="ListValidationError"}}class B extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}get valueSchema(){return this.createToken(this.val.args[0],this.idx)}isValid(t){return Array.isArray(t)?null:new C(t,this,"Value must be an array")}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;const i=this.createToken(this.val.args[0],0);return e.reduce(((t,e)=>[...t,i.EncodeObject(e)]),[])}Execute(t,e){const r=this.createToken(this.val.args[0],0),i=this.isValid(t);if(i)throw i;return t.reduce(((t,i)=>[...t,r.Execute(i,e)]),[])}EncodeObject(t,e){const r=this.createToken(this.val.args[0],0),i=this.isValid(t);if(i)throw i;return e&&e[B.prim]?e[B.prim](t):t.reduce(((t,e)=>[...t,r.EncodeObject(e)]),[])}ExtractSchema(){return{[B.prim]:this.valueSchema.ExtractSchema()}}generateSchema(){return{__michelsonType:B.prim,schema:this.valueSchema.generateSchema()}}findAndReturnTokens(t,e){return B.prim===t&&e.push(this),this.createToken(this.val.args[0],this.idx).findAndReturnTokens(t,e),e}}B.prim="list";class D extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="MutezValidationError"}}class U extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return new o.Z(t[Object.keys(t)[0]])}ExtractSchema(){return U.prim}generateSchema(){return{__michelsonType:U.prim,schema:U.prim}}isValid(t){return new o.Z(t).isNaN()?new D(t,this,`Value is not a number: ${t}`):null}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return{int:String(e).toString()}}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[U.prim]?e[U.prim](t):{int:String(t).toString()}}ToBigMapKey(t){return{key:{int:String(t)},type:{prim:U.prim}}}ToKey({int:t}){return t}compare(t,e){const r=Number(t),i=Number(e);return r===i?0:r<i?-1:1}findAndReturnTokens(t,e){return U.prim===t&&e.push(this),e}}U.prim="mutez";class j extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="BytesValidationError"}}class K extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}ToBigMapKey(t){return{key:{bytes:t},type:{prim:K.prim}}}isValid(t){return"string"==typeof t&&/^[0-9a-fA-F]*$/.test(t)&&t.length%2==0?null:new j(t,this,`Invalid bytes: ${t}`)}convertUint8ArrayToHexString(t){return t.constructor===Uint8Array?Buffer.from(t).toString("hex"):t}Encode(t){let e=t.pop();e=(0,a.stripHexPrefix)(this.convertUint8ArrayToHexString(e));const r=this.isValid(e);if(r)throw r;return{bytes:String(e).toString()}}EncodeObject(t,e){"string"==typeof(t=this.convertUint8ArrayToHexString(t))&&(t=(0,a.stripHexPrefix)(t));const r=this.isValid(t);if(r)throw r;return e&&e[K.prim]?e[K.prim](t):{bytes:String(t).toString()}}Execute(t){return t.bytes}ExtractSchema(){return K.prim}generateSchema(){return{__michelsonType:K.prim,schema:K.prim}}ToKey({bytes:t,string:e}){return e||t}findAndReturnTokens(t,e){return K.prim===t&&e.push(this),e}}K.prim="bytes";class V extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}subToken(){return this.createToken(this.val.args[0],this.idx)}schema(){return this.createToken(this.val.args[0],0)}annot(){return Array.isArray(this.val.annots)?super.annot():this.createToken(this.val.args[0],this.idx).annot()}Encode(t){const e=t;return null==e?{prim:"None"}:!Array.isArray(e)||void 0!==e[e.length-1]&&null!==e[e.length-1]?{prim:"Some",args:[this.schema().Encode(t)]}:(e.pop(),{prim:"None"})}EncodeObject(t,e){const r=t;return null==r?{prim:"None"}:{prim:"Some",args:[this.schema().EncodeObject(r,e)]}}Execute(t,e){return"None"===t.prim?null:this.schema().Execute(t.args[0],e)}ExtractSchema(){return this.schema().ExtractSchema()}generateSchema(){return{__michelsonType:V.prim,schema:this.schema().generateSchema()}}ExtractSignature(){return[...this.schema().ExtractSignature(),[]]}get KeySchema(){return this.schema()}compare(t,e){return t?e?this.KeySchema.compare(t,e):1:-1}ToKey(t){return this.Execute(t)}ToBigMapKey(t){return{key:this.EncodeObject(t),type:this.typeWithoutAnnotations()}}findAndReturnTokens(t,e){return V.prim===t&&e.push(this),this.subToken().findAndReturnTokens(t,e),e}}V.prim="option";class F extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return t.string&&/^\d+$/.test(t.string)?new Date(1e3*Number(t.string)).toISOString():t.string?new Date(t.string).toISOString():t.int?new Date(1e3*Number(t.int)).toISOString():void 0}Encode(t){const e=t.pop();return"number"==typeof e?{int:String(e)}:{string:e}}EncodeObject(t,e){return e&&e[F.prim]?e[F.prim](t):"number"==typeof t?{int:String(t)}:{string:t}}ExtractSchema(){return F.prim}generateSchema(){return{__michelsonType:F.prim,schema:F.prim}}ToKey({string:t}){return t}ToBigMapKey(t){return{key:{string:t},type:{prim:F.prim}}}findAndReturnTokens(t,e){return F.prim===t&&e.push(this),e}}F.prim="timestamp";class H extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="IntValidationError"}}class G extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return new o.Z(t[Object.keys(t)[0]])}ExtractSchema(){return G.prim}generateSchema(){return{__michelsonType:G.prim,schema:G.prim}}isValid(t){return new o.Z(t).isNaN()?new H(t,this,`Value is not a number: ${t}`):null}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return{int:new o.Z(e).toFixed()}}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[G.prim]?e[G.prim](t):{int:new o.Z(t).toFixed()}}ToBigMapKey(t){return{key:{int:String(t)},type:{prim:G.prim}}}ToKey({int:t}){return t}compare(t,e){const r=Number(t),i=Number(e);return r===i?0:r<i?-1:1}findAndReturnTokens(t,e){return G.prim===t&&e.push(this),e}}G.prim="int";class $ extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Encode(t){return t.pop(),{prim:"Unit"}}EncodeObject(t,e){return e&&e[$.prim]?e[$.prim](t):{prim:"Unit"}}Execute(t){return Wt}ExtractSchema(){return $.prim}generateSchema(){return{__michelsonType:$.prim,schema:$.prim}}compare(t,e){return 0}ToKey(t){return Wt}ToBigMapKey(t){return{key:{prim:"Unit"},type:{prim:$.prim}}}findAndReturnTokens(t,e){return $.prim===t&&e.push(this),e}}$.prim="unit";class z extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="KeyValidationError"}}class q extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return t.string?t.string:(0,a.encodeKey)(t.bytes)}isValid(t){return(0,a.validatePublicKey)(t)!==a.ValidationResult.VALID?new z(t,this,"Key is not valid"):null}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return{string:e}}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[q.prim]?e[q.prim](t):{string:t}}ExtractSchema(){return q.prim}generateSchema(){return{__michelsonType:q.prim,schema:q.prim}}ToKey(t){return this.Execute(t)}ToBigMapKey(t){return{key:{string:t},type:{prim:q.prim}}}compare(t,e){const r=this.getPrefix(t),i=this.getPrefix(e);if(r===a.Prefix.EDPK&&i!==a.Prefix.EDPK)return-1;if(r===a.Prefix.SPPK&&i!==a.Prefix.SPPK)return i===a.Prefix.EDPK?1:-1;if(r===a.Prefix.P2PK){if(i!==a.Prefix.P2PK)return 1;const r=this.getP256PublicKeyComparableBytes(t),n=this.getP256PublicKeyComparableBytes(e);return Buffer.compare(r,n)}return super.compare(t,e)}getPrefix(t){return t.substring(0,4)}getP256PublicKeyComparableBytes(t){return(0,a.b58cdecode)(t,a.prefix[a.Prefix.P2PK]).slice(1)}findAndReturnTokens(t,e){return q.prim===t&&e.push(this),e}}q.prim="key";class Z extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="KeyHashValidationError"}}class W extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return t.string?t.string:(0,a.encodeKeyHash)(t.bytes)}isValid(t){return(0,a.validateKeyHash)(t)!==a.ValidationResult.VALID?new Z(t,this,`KeyHash is not valid: ${t}`):null}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return{string:e}}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[W.prim]?e[W.prim](t):{string:t}}ExtractSchema(){return W.prim}generateSchema(){return{__michelsonType:W.prim,schema:W.prim}}ToKey({string:t,bytes:e}){return t||(0,a.encodeKeyHash)(e)}ToBigMapKey(t){return{key:{string:t},type:{prim:W.prim}}}findAndReturnTokens(t,e){return W.prim===t&&e.push(this),e}}W.prim="key_hash";class Y extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="SignatureValidationError"}}class J extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return t.string?t.string:t.bytes}isValid(t){return(0,a.validateSignature)(t)!==a.ValidationResult.VALID?new Y(t,this,"Signature is not valid"):null}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return{string:e}}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[J.prim]?e[J.prim](t):{string:t}}ExtractSchema(){return J.prim}generateSchema(){return{__michelsonType:J.prim,schema:J.prim}}ToKey(t){return this.Execute(t)}ToBigMapKey(t){return{key:{string:t},type:{prim:J.prim}}}findAndReturnTokens(t,e){return J.prim===t&&e.push(this),e}}J.prim="signature";class X extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}get paramSchema(){return this.createToken(this.val.args[0],this.idx)}get returnSchema(){return this.createToken(this.val.args[1],this.idx+1)}Execute(t){return t.string?t.string:t}Encode(t){return t.pop()}EncodeObject(t,e){return e&&e[X.prim]?e[X.prim](t):t}ExtractSchema(){return{[X.prim]:{parameters:this.paramSchema.ExtractSchema(),returns:this.returnSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:X.prim,schema:{parameters:this.paramSchema.generateSchema(),returns:this.returnSchema.generateSchema()}}}findAndReturnTokens(t,e){return X.prim===t&&e.push(this),this.createToken(this.val.args[0],this.idx).findAndReturnTokens(t,e),this.createToken(this.val.args[1],this.idx).findAndReturnTokens(t,e),e}}X.prim="lambda";class Q extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return t.string}Encode(...t){return{string:t.pop()}}EncodeObject(t,e){return e&&e[Q.prim]?e[Q.prim](t):{string:t}}ExtractSchema(){return Q.prim}generateSchema(){return{__michelsonType:Q.prim,schema:Q.prim}}findAndReturnTokens(t,e){return Q.prim===t&&e.push(this),e}}Q.prim="operation";class tt extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="SetValidationError"}}class et extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}get KeySchema(){return this.createToken(this.val.args[0],0)}isValid(t){return Array.isArray(t)?null:new tt(t,this,"Value must be an array")}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return e.sort(((t,e)=>this.KeySchema.compare(t,e))).reduce(((t,e)=>[...t,this.KeySchema.EncodeObject(e)]),[])}Execute(t,e){return t.reduce(((t,r)=>[...t,this.KeySchema.Execute(r,e)]),[])}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[et.prim]?e[et.prim](t):t.sort(((t,e)=>this.KeySchema.compare(t,e))).reduce(((t,e)=>[...t,this.KeySchema.EncodeObject(e)]),[])}ExtractSchema(){return et.prim}generateSchema(){return{__michelsonType:et.prim,schema:this.KeySchema.generateSchema()}}findAndReturnTokens(t,e){return et.prim===t&&e.push(this),this.KeySchema.findAndReturnTokens(t,e),e}}et.prim="set";class rt extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="ChainIDValidationError"}}class it extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}isValid(t){return(0,a.validateChain)(t)!==a.ValidationResult.VALID?new rt(t,this,"ChainID is not valid"):null}Execute(t){return t[Object.keys(t)[0]]}ExtractSchema(){return it.prim}generateSchema(){return{__michelsonType:it.prim,schema:it.prim}}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return{string:e}}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[it.prim]?e[it.prim](t):{string:t}}ToKey({string:t}){return t}ToBigMapKey(t){return{key:{string:t},type:{prim:it.prim}}}findAndReturnTokens(t,e){return it.prim===t&&e.push(this),e}}it.prim="chain_id";class nt extends Error{constructor(){super("Tickets cannot be sent to the blockchain; they are created on-chain"),this.name="TicketEncodeError"}}const st={prim:"contract"},ot={prim:"int"};class at extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}get valueToken(){return this.createToken(this.val.args[0],this.idx)}Encode(t){throw new nt}EncodeObject(t,e){if(e&&e[at.prim])return e[at.prim](t,this.val);throw new nt}Execute(t,e){if(e&&e[at.prim])return e[at.prim](t,this.val);const r=this.createToken(st,this.idx),i=this.valueToken,n=this.createToken(ot,this.idx);return void 0===t.args[2]&&void 0!==t.args[1].args?{ticketer:r.Execute(t.args[0],e),value:i.Execute(t.args[1].args[0],e),amount:n.Execute(t.args[1].args[1],e)}:{ticketer:r.Execute(t.args[0],e),value:i.Execute(t.args[1],e),amount:n.Execute(t.args[2],e)}}ExtractSchema(){return{ticketer:L.prim,value:this.valueToken.ExtractSchema(),amount:G.prim}}generateSchema(){return{__michelsonType:at.prim,schema:{value:this.valueToken.generateSchema(),ticketer:{__michelsonType:L.prim,schema:L.prim},amount:{__michelsonType:G.prim,schema:G.prim}}}}findAndReturnTokens(t,e){return at.prim===t&&e.push(this),this.valueToken.findAndReturnTokens(t,e),e}}at.prim="ticket";class ct extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="NeverTokenError"}}class ut extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Encode(t){const e=t.pop();throw new ct(e,this,"Assigning a value to the type never is forbidden.")}EncodeObject(t,e){if(e&&e[ut.prim])return e[ut.prim](t);throw new ct(t,this,"Assigning a value to the type never is forbidden.")}Execute(t){throw new ct(t,this,"There is no literal value for the type never.")}ExtractSchema(){return ut.prim}generateSchema(){return{__michelsonType:ut.prim,schema:ut.prim}}findAndReturnTokens(t,e){return ut.prim===t&&e.push(this),e}}ut.prim="never";class ht extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="SaplingStateValidationError"}}class ft extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}isValid(t){return"object"==typeof t&&0===Object.keys(t).length}Execute(t,e){if(e&&e[ft.prim])return e[ft.prim](t,this.val);if("int"in t)return t.int;throw new ht(t,this,`Sapling state is expecting an object with an int property. Got ${JSON.stringify(t)}`)}Encode(t){const e=t.pop();if(this.isValid(e))return[];throw new ht(e,this,`Invalid sapling_state. Received: ${e} while expecting: {}`)}EncodeObject(t,e){if(e&&e[ft.prim])return e[ft.prim](t);if(this.isValid(t))return[];throw new ht(t,this,`Invalid sapling_state. Received: ${t} while expecting: {}`)}ExtractSchema(){return{[ft.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:ft.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(t,e){return ft.prim===t&&e.push(this),e}}ft.prim="sapling_state";class lt extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="SaplingTransactionValidationError"}}class dt extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){throw new lt(t,this,"There is no literal value for the sapling_transaction type.")}validateBytes(t){const e=/^(0x|0X)?([0-9a-fA-F]*$)/.exec(t);if(e&&e[2].length%2==0)return e[2];throw new lt(t,this,`Invalid bytes: ${t}`)}convertUint8ArrayToHexString(t){return t.constructor===Uint8Array?Buffer.from(t).toString("hex"):t}Encode(t){let e=t.pop();return e=this.validateBytes(this.convertUint8ArrayToHexString(e)),{bytes:String(e).toString()}}EncodeObject(t,e){return t=this.validateBytes(this.convertUint8ArrayToHexString(t)),e&&e[dt.prim]?e[dt.prim](t):{bytes:String(t).toString()}}ExtractSchema(){return{[dt.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:dt.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(t,e){return dt.prim===t&&e.push(this),e}}dt.prim="sapling_transaction";class pt extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="SaplingTransactionDeprecatedValidationError"}}class bt extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){throw new pt(t,this,"There is no literal value for the sapling_transaction_deprecated type.")}validateBytes(t){const e=/^(0x|0X)?([0-9a-fA-F]*$)/.exec(t);if(e&&e[2].length%2==0)return e[2];throw new pt(t,this,`Invalid bytes: ${t}`)}convertUint8ArrayToHexString(t){return t.constructor===Uint8Array?Buffer.from(t).toString("hex"):t}Encode(t){let e=t.pop();return e=this.validateBytes(this.convertUint8ArrayToHexString(e)),{bytes:String(e).toString()}}EncodeObject(t,e){return t=this.validateBytes(this.convertUint8ArrayToHexString(t)),e&&e[bt.prim]?e[bt.prim](t):{bytes:String(t).toString()}}ExtractSchema(){return{[bt.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:bt.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(t,e){return bt.prim===t&&e.push(this),e}}bt.prim="sapling_transaction_deprecated";class gt extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="Bls12381frValidationError"}}class mt extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}isValid(t){return/^[0-9a-fA-F]*$/.test(t)&&t.length%2==0?null:new gt(t,this,`Invalid bytes: ${t}`)}convertUint8ArrayToHexString(t){return t.constructor===Uint8Array?Buffer.from(t).toString("hex"):t}Encode(t){let e=t.pop();if("number"==typeof e)return{int:e.toString()};{e=this.convertUint8ArrayToHexString(e);const t=this.isValid(e);if(t)throw t;return{bytes:e}}}EncodeObject(t,e){if(e&&e[mt.prim])return e[mt.prim](t);if("number"==typeof t)return{int:t.toString()};{t=this.convertUint8ArrayToHexString(t);const e=this.isValid(t);if(e)throw e;return{bytes:t}}}Execute(t){return t.bytes}ExtractSchema(){return mt.prim}generateSchema(){return{__michelsonType:mt.prim,schema:mt.prim}}findAndReturnTokens(t,e){return mt.prim===t&&e.push(this),e}}mt.prim="bls12_381_fr";class vt extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="Bls12381g1ValidationError"}}class yt extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}isValid(t){return/^[0-9a-fA-F]*$/.test(t)&&t.length%2==0?null:new vt(t,this,`Invalid bytes: ${t}`)}convertUint8ArrayToHexString(t){return t.constructor===Uint8Array?Buffer.from(t).toString("hex"):t}Encode(t){let e=t.pop();e=this.convertUint8ArrayToHexString(e);const r=this.isValid(e);if(r)throw r;return{bytes:e}}EncodeObject(t,e){t=this.convertUint8ArrayToHexString(t);const r=this.isValid(t);if(r)throw r;return e&&e[yt.prim]?e[yt.prim](t):{bytes:t}}Execute(t){return t.bytes}ExtractSchema(){return yt.prim}generateSchema(){return{__michelsonType:yt.prim,schema:yt.prim}}findAndReturnTokens(t,e){return yt.prim===t&&e.push(this),e}}yt.prim="bls12_381_g1";class wt extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="Bls12381g2ValidationError"}}class _t extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}isValid(t){return/^[0-9a-fA-F]*$/.test(t)&&t.length%2==0?null:new wt(t,this,`Invalid bytes: ${t}`)}convertUint8ArrayToHexString(t){return t.constructor===Uint8Array?Buffer.from(t).toString("hex"):t}Encode(t){let e=t.pop();e=this.convertUint8ArrayToHexString(e);const r=this.isValid(e);if(r)throw r;return{bytes:e}}EncodeObject(t,e){t=this.convertUint8ArrayToHexString(t);const r=this.isValid(t);if(r)throw r;return e&&e[_t.prim]?e[_t.prim](t):{bytes:t}}Execute(t){return t.bytes}ExtractSchema(){return _t.prim}generateSchema(){return{__michelsonType:_t.prim,schema:_t.prim}}findAndReturnTokens(t,e){return _t.prim===t&&e.push(this),e}}_t.prim="bls12_381_g2";class Et extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="ChestValidationError"}}class St extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}isValid(t){return/^[0-9a-fA-F]*$/.test(t)&&t.length%2==0?null:new Et(t,this,`Invalid bytes: ${t}`)}convertUint8ArrayToHexString(t){return t.constructor===Uint8Array?Buffer.from(t).toString("hex"):t}Encode(t){let e=t.pop();e=this.convertUint8ArrayToHexString(e);const r=this.isValid(e);if(r)throw r;return{bytes:e}}EncodeObject(t,e){t=this.convertUint8ArrayToHexString(t);const r=this.isValid(t);if(r)throw r;return e&&e[St.prim]?e[St.prim](t):{bytes:t}}Execute(t){return t.bytes}ExtractSchema(){return St.prim}generateSchema(){return{__michelsonType:St.prim,schema:St.prim}}findAndReturnTokens(t,e){return St.prim===t&&e.push(this),e}}St.prim="chest";class At extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="ChestKeyValidationError"}}class Ot extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}isValid(t){return/^[0-9a-fA-F]*$/.test(t)&&t.length%2==0?null:new At(t,this,`Invalid bytes: ${t}`)}convertUint8ArrayToHexString(t){return t.constructor===Uint8Array?Buffer.from(t).toString("hex"):t}Encode(t){let e=t.pop();e=this.convertUint8ArrayToHexString(e);const r=this.isValid(e);if(r)throw r;return{bytes:e}}EncodeObject(t,e){t=this.convertUint8ArrayToHexString(t);const r=this.isValid(t);if(r)throw r;return e&&e[Ot.prim]?e[Ot.prim](t):{bytes:t}}Execute(t){return t.bytes}ExtractSchema(){return Ot.prim}generateSchema(){return{__michelsonType:Ot.prim,schema:Ot.prim}}findAndReturnTokens(t,e){return Ot.prim===t&&e.push(this),e}}Ot.prim="chest_key";class Tt extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="GlobalConstantEncodingError"}}class xt extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="GlobalConstantDecodingError"}}class Rt extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t,e){if(e&&e[Rt.prim])return e[Rt.prim](t,this.val);throw new xt(t,this,`Unable to decode a value represented by a global constants. Please provide an expanded script to the Michelson-Encoder or semantics for the decoding. The following global constant hash was encountered: ${this.val.args[0].string}.`)}Encode(t){throw new Tt(t,this,`Unable to encode a script containing global constants. Please provide an expanded script to the Michelson-Encoder. The following global constant hash was encountered: ${this.val.args[0].string}.`)}EncodeObject(t,e){if(e&&e[Rt.prim])return e[Rt.prim](t);throw new Tt(t,this,`Unable to encode a script containing global constants. Please provide an expanded script to the Michelson-Encoder. The following global constant hash was encountered: ${this.val.args[0].string}.`)}ExtractSchema(){return Rt.prim}generateSchema(){return{__michelsonType:Rt.prim,schema:{hash:this.val.args[0].string}}}findAndReturnTokens(t,e){return Rt.prim===t&&e.push(this),e}}Rt.prim="constant";const Pt=[E,A,O,g,x,M,P,I,v,L,B,U,K,V,F,G,$,q,W,J,X,Q,et,it,at,ut,ft,dt,bt,mt,yt,_t,St,Ot,Rt];class It extends Error{constructor(t,e){super(t),this.message=t,this.data=e,this.name="Invalid token error"}}function Nt(t,e){if(Array.isArray(t))return new E(t,e,Nt);const r=Pt.find((e=>e.prim===t.prim));if(!r)throw new It("Malformed data expected a value with a valid prim property",t);return new r(t,e,Nt)}class Mt extends Error{constructor(t,e){super(`Unable to encode the parameter of the view: ${t}.`),this.smartContractViewName=t,this.originalError=e,this.name="ViewEncodingError"}}class kt extends Error{constructor(t){super(t),this.message=t,this.name="InvalidScriptError"}}class Lt extends Error{constructor(t){super("Invalid RPC response passed as argument(s)"),this.script=t,this.name="InvalidRpcResponseError"}}class Ct extends Error{constructor(t,e,r){super(`\n ${t}. Error encountered when trying to encode arguments: \n\n [${e}]\n `),this.message=t,this.args=e,this.originalError=r,this.name="ParameterEncodingError"}}class Bt extends Error{constructor(t){super(t),this.message=t,this.name="InvalidBigMapSchema"}}class Dt extends Error{constructor(t){super(t),this.message=t,this.name="InvalidBigMapDiff"}}class Ut extends Error{constructor(t,e){super(`Unable to encode ${t}. ${e}`),this.obj=t,this.details=e,this.name="BigMapEncodingError"}}class jt extends Error{constructor(t,e){super(`Unable to encode ${t}. ${e}`),this.obj=t,this.details=e,this.name="StorageEncodingError"}}class Kt extends Error{constructor(t){super(t),this.message=t,this.name="MissingArgumentError"}}var Vt;const Ft=Symbol.for("taquito-schema-type-symbol");function Ht(t,e=E.prim){var r,i;if(Array.isArray(t))return Ht({prim:e,args:t},e);const n=t;return n.prim===e&&n.args&&n.args.length>2?Object.assign(Object.assign({},n),{args:[null===(r=n.args)||void 0===r?void 0:r[0],{prim:e,args:null===(i=n.args)||void 0===i?void 0:i.slice(1)}]}):n}function Gt(t,e){const r=Ht(t),i=Ht(e);return r.prim===i.prim&&(void 0===r.args&&void 0===i.args||void 0!==r.args&&void 0!==i.args&&r.args.length===i.args.length&&r.args.every(((t,e)=>{var r,n;return Gt(t,null!==(n=null===(r=i.args)||void 0===r?void 0:r[e])&&void 0!==n?n:{})})))&&(void 0===r.annots&&void 0===i.annots||void 0!==r.annots&&void 0!==i.annots&&r.annots.length===i.annots.length&&r.annots.every(((t,e)=>{var r;return t===(null===(r=i.annots)||void 0===r?void 0:r[e])})))}class $t{constructor(t){if(this.val=t,this[Vt]=!0,this.root=Nt(t,0),this.root instanceof g)this.bigMap=this.root;else if(this.isExpressionExtended(t)&&"pair"===t.prim){const e=t.args[0];this.isExpressionExtended(e)&&"big_map"===e.prim&&(this.bigMap=new g(e,0,Nt))}}static isSchema(t){return t&&!0===t[Ft]}static fromRPCResponse(t){const e=t&&t.script&&Array.isArray(t.script.code)&&t.script.code.find((e=>{if(!Array.isArray(e)){const t=e;return!!t.prim&&"storage"===t.prim}this.fromRPCResponse({script:{code:e,storage:t.script.storage}})}));if(!e||!Array.isArray(e.args))throw new Lt(t.script);return new $t(e.args[0])}isExpressionExtended(t){return"prim"in t&&Array.isArray(t.args)}removeTopLevelAnnotation(t){return(this.root instanceof E||this.root instanceof v)&&this.root.hasAnnotations()&&"object"==typeof t&&1===Object.keys(t).length?t[Object.keys(t)[0]]:t}Execute(t,e){const r=this.root.Execute(t,e);return this.removeTopLevelAnnotation(r)}Typecheck(t){if(this.root instanceof g&&Number.isInteger(Number(t)))return!0;if(this.root instanceof at&&t.ticketer&&t.value&&t.amount)return!0;try{return this.root.EncodeObject(t),!0}catch(t){return!1}}ExecuteOnBigMapDiff(t,e){if(!this.bigMap)throw new Bt("Big map schema is undefined");if(!Array.isArray(t))throw new Dt("Big map diff must be an array");const r=t.map((({key:t,value:e})=>({args:[t,e]})));return this.bigMap.Execute(r,e)}ExecuteOnBigMapValue(t,e){if(!this.bigMap)throw new Bt("No big map schema");return this.bigMap.ValueSchema.Execute(t,e)}EncodeBigMapKey(t){if(!this.bigMap)throw new Bt("Big map schema is undefined");try{return this.bigMap.KeySchema.ToBigMapKey(t)}catch(t){throw new Ut("big map key",t)}}Encode(t,e){try{return this.root.EncodeObject(t,e)}catch(t){if(t instanceof l)throw t;throw new jt("storage object",t)}}ExtractSchema(){return this.removeTopLevelAnnotation(this.root.ExtractSchema())}generateSchema(){return this.removeTopLevelAnnotation(this.root.generateSchema())}ComputeState(t,e){if(!this.bigMap)throw new Bt("Big map schema is undefined");const r=t.reduce(((t,e)=>Object.assign(Object.assign({},t),this.ExecuteOnBigMapDiff(e.contents[0].metadata.operation_result.big_map_diff))),{});return Object.assign(Object.assign({},this.Execute(e)),{[this.bigMap.annot()]:r})}FindFirstInTopLevelPair(t,e){return this.findValue(this.root.val,t,e)}findValue(t,e,r){if(Gt(r,t))return e;if(Array.isArray(t)||"pair"===t.prim){const i=Ht(t),n=Ht(e,"Pair");if(void 0===i.args||void 0===n.args)throw new Kt("Tokens have no arguments");if(i.args[0])return this.findValue(i.args[0],n.args[0],r)||this.findValue(i.args[1],n.args[1],r)}}findToken(t){return this.root.findAndReturnTokens(t,[])}}Vt=Ft;class zt{constructor(t){this.root=Nt(t,0)}static fromRPCResponse(t){const e=t&&t.script&&Array.isArray(t.script.code)&&t.script.code.find((t=>"parameter"===t.prim));if(!e||!Array.isArray(e.args))throw new Lt(t.script);return new zt(e.args[0])}get isMultipleEntryPoint(){return this.root instanceof v||this.root instanceof V&&this.root.subToken()instanceof v}get hasAnnotation(){return!this.isMultipleEntryPoint||"0"!==Object.keys(this.ExtractSchema())[0]}Execute(t,e){return this.root.Execute(t,e)}Encode(...t){try{return this.root.Encode(t.reverse())}catch(e){if(e instanceof l)throw e;throw new Ct("Unable to encode parameter",t.toString(),e)}}EncodeObject(t,e){try{return this.root.EncodeObject(t,e)}catch(e){if(e instanceof l)throw e;throw new Ct("Unable to encode parameter object",t,e)}}ExtractSchema(){return this.root.ExtractSchema()}generateSchema(){return this.root.generateSchema()}ExtractSignatures(){return this.root.ExtractSignature()}}class qt{constructor(t){if(4!==t.length||!("string"in t[0]))throw new kt(`Invalid on-chain view: ${JSON.stringify(t)}`);this.viewName=t[0].string,this.viewArgsType=t[1],this.viewReturnType=t[2],this.instructions=t[3],this.rootArgsType=Nt(this.viewArgsType,0),this.rootReturnType=Nt(this.viewReturnType,0)}static fromRPCResponse(t){const e=[],r=t&&t.script&&Array.isArray(t.script.code)&&t.script.code.filter((t=>"view"===t.prim));return r&&r.forEach((t=>{if(!t.args||4!==t.args.length)throw new kt(`Invalid on-chain view found in the script: ${JSON.stringify(t)}`);e.push(new qt(t.args))})),e}encodeViewArgs(t){try{return this.rootArgsType.EncodeObject(t)}catch(t){throw new Mt(this.viewName,t)}}decodeViewResult(t,e){return this.rootReturnType.Execute(t,e)}extractArgsSchema(){return this.rootArgsType.ExtractSchema()}extractResultSchema(){return this.rootReturnType.ExtractSchema()}}const Zt={commitHash:"d474f2ac7abec2e8faddba47cf403a0c0203c7d5",version:"14.2.0-beta-RC.0"},Wt=Symbol(),Yt={}},6368:(t,e,r)=>{"use strict";r.r(e),r.d(e,{METADATA_BALANCE_UPDATES_CATEGORY:()=>p,OPERATION_METADATA:()=>d,OpKind:()=>b,RpcClient:()=>m,RpcClientCache:()=>l,VERSION:()=>g,castToBigNumber:()=>f,defaultChain:()=>c,defaultRPCOptions:()=>u});var i=r(5543),n=r(2558),s=r(4632);function o(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r}function a(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))}const c="main",u={block:"head"};var h;function f(t,e){const r=Array.isArray(t);void 0===e&&(e=Object.keys(t));const i=r?[]:{};return e.forEach((e=>{const r=t[e];let s;if(void 0!==r){if(Array.isArray(r))return s=f(r),void(i[e]=s);s=new n.Z(r),i[e]=s}})),i}!function(t){t.GET_BAKING_RIGHTS="getBakingRights",t.GET_BALLOTS="getBallots",t.GET_BALLOT_LIST="getBallotList",t.GET_BIG_MAP_KEY="getBigMapKey",t.GET_BIG_MAP_EXPR="getBigMapExpr",t.GET_BLOCK_HASH="getBlockHash",t.GET_BLOCK="getBlock",t.GET_BLOCK_HEADER="getBlockHeader",t.GET_BLOCK_METADATA="getBlockMetadata",t.GET_BALANCE="getBalance",t.GET_CHAIN_ID="getChainId",t.GET_CONSTANTS="getConstants",t.GET_CONTRACT="getContract",t.GET_CURRENT_PERIOD="getCurrentPeriod",t.GET_CURRENT_PROPOSAL="getCurrentProposal",t.GET_CURRENT_QUORUM="getCurrentQuorum",t.GET_DELEGATE="getDelegate",t.GET_DELEGATES="getDelegates",t.GET_VOTING_INFO="getVotingInfo",t.GET_ENDORSING_RIGHTS="getEndorsingRights",t.GET_ENTRYPOINTS="getEntrypoints",t.GET_LIVE_BLOCKS="getLiveBlocks",t.GET_MANAGER_KEY="getManagerKey",t.GET_NORMALIZED_SCRIPT="getNormalizedScript",t.GET_PROPOSALS="getProposals",t.GET_PROTOCOLS="getProtocols",t.GET_SAPLING_DIFF_BY_CONTRACT="getSaplingDiffByContract",t.GET_SAPLING_DIFF_BY_ID="getSaplingDiffById",t.GET_SCRIPT="getScript",t.GET_STORAGE="getStorage",t.GET_SUCCESSOR_PERIOD="getSuccessorPeriod",t.GET_TX_ROLLUP_INBOX="getTxRollupInbox",t.GET_TX_ROLLUP_STATE="getTxRollupState",t.GET_VOTES_LISTINGS="getVotesListings",t.PACK_DATA="packData"}(h||(h={}));class l{constructor(t,e=1e3){this.rpcClient=t,this.ttl=e,this._cache={}}getAllCachedData(){return this._cache}deleteAllCachedData(){for(const t in this._cache)delete this._cache[t]}formatCacheKey(t,e,r,i){let n="";return r.forEach((t=>{n="object"==typeof t?n+JSON.stringify(t)+"/":n+t+"/"})),i?`${t}/${e}/${n}/${JSON.stringify(i)}`:`${t}/${e}/${n}`}has(t){return t in this._cache}get(t){return this._cache[t].response}put(t,e){const r=setTimeout((()=>this.remove(t)),this.ttl);Object.assign(this._cache,{[t]:{handle:r,response:e}})}remove(t){t in this._cache&&delete this._cache[t]}validateAddress(t){if((0,s.validateAddress)(t)!==s.ValidationResult.VALID)throw new s.InvalidAddressError(t)}validateContract(t){if((0,s.validateContractAddress)(t)!==s.ValidationResult.VALID)throw new s.InvalidContractAddressError(t)}getBlockHash({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BLOCK_HASH,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getBlockHash({block:t});return this.put(e,r),r}}))}getLiveBlocks({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_LIVE_BLOCKS,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getLiveBlocks({block:t});return this.put(e,r),r}}))}getBalance(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BALANCE,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getBalance(t,{block:e});return this.put(r,i),i}}))}getStorage(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateContract(t);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_STORAGE,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getStorage(t,{block:e});return this.put(r,i),i}}))}getScript(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateContract(t);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_SCRIPT,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getScript(t,{block:e});return this.put(r,i),i}}))}getNormalizedScript(t,e={unparsing_mode:"Readable"},{block:r}=u){return a(this,void 0,void 0,(function*(){this.validateContract(t);const i=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_NORMALIZED_SCRIPT,[r,t,e]);if(this.has(i))return this.get(i);{const n=this.rpcClient.getNormalizedScript(t,e,{block:r});return this.put(i,n),n}}))}getContract(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_CONTRACT,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getContract(t,{block:e});return this.put(r,i),i}}))}getManagerKey(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_MANAGER_KEY,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getManagerKey(t,{block:e});return this.put(r,i),i}}))}getDelegate(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_DELEGATE,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getDelegate(t,{block:e});return this.put(r,i),i}}))}getBigMapKey(t,e,{block:r}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const i=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BIG_MAP_KEY,[r,t,e]);if(this.has(i))return this.get(i);{const n=this.rpcClient.getBigMapKey(t,e,{block:r});return this.put(i,n),n}}))}getBigMapExpr(t,e,{block:r}=u){return a(this,void 0,void 0,(function*(){const i=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BIG_MAP_EXPR,[r,t,e]);if(this.has(i))return this.get(i);{const n=this.rpcClient.getBigMapExpr(t,e,{block:r});return this.put(i,n),n}}))}getDelegates(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_DELEGATES,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getDelegates(t,{block:e});return this.put(r,i),i}}))}getVotingInfo(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_VOTING_INFO,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getVotingInfo(t,{block:e});return this.put(r,i),i}}))}getConstants({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_CONSTANTS,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getConstants({block:t});return this.put(e,r),r}}))}getBlock({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BLOCK,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getBlock({block:t});return this.put(e,r),r}}))}getBlockHeader({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BLOCK_HEADER,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getBlockHeader({block:t});return this.put(e,r),r}}))}getBlockMetadata({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BLOCK_METADATA,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getBlockMetadata({block:t});return this.put(e,r),r}}))}getBakingRights(t={},{block:e}=u){return a(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BAKING_RIGHTS,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getBakingRights(t,{block:e});return this.put(r,i),i}}))}getEndorsingRights(t={},{block:e}=u){return a(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_ENDORSING_RIGHTS,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getEndorsingRights(t,{block:e});return this.put(r,i),i}}))}getBallotList({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BALLOT_LIST,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getBallotList({block:t});return this.put(e,r),r}}))}getBallots({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BALLOTS,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getBallots({block:t});return this.put(e,r),r}}))}getCurrentProposal({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_CURRENT_PROPOSAL,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getCurrentProposal({block:t});return this.put(e,r),r}}))}getCurrentQuorum({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_CURRENT_QUORUM,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getCurrentQuorum({block:t});return this.put(e,r),r}}))}getVotesListings({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_VOTES_LISTINGS,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getVotesListings({block:t});return this.put(e,r),r}}))}getProposals({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_PROPOSALS,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getProposals({block:t});return this.put(e,r),r}}))}forgeOperations(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.rpcClient.forgeOperations(t,{block:e})}))}injectOperation(t){return a(this,void 0,void 0,(function*(){return this.rpcClient.injectOperation(t)}))}preapplyOperations(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.rpcClient.preapplyOperations(t,{block:e})}))}getEntrypoints(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateContract(t);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_ENTRYPOINTS,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getEntrypoints(t,{block:e});return this.put(r,i),i}}))}runOperation(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.rpcClient.runOperation(t,{block:e})}))}runCode(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.rpcClient.runCode(t,{block:e})}))}runScriptView(t,{block:e}=u){var{unparsing_mode:r="Readable"}=t,i=o(t,["unparsing_mode"]);return a(this,void 0,void 0,(function*(){return this.rpcClient.runScriptView(Object.assign({unparsing_mode:r},i),{block:e})}))}runView(t,{block:e}=u){var{unparsing_mode:r="Readable"}=t,i=o(t,["unparsing_mode"]);return a(this,void 0,void 0,(function*(){return this.rpcClient.runView(Object.assign({unparsing_mode:r},i),{block:e})}))}getChainId(){return a(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_CHAIN_ID,[]);if(this.has(t))return this.get(t);{const e=this.rpcClient.getChainId();return this.put(t,e),e}}))}packData(t,{block:e}=u){return a(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.PACK_DATA,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.packData(t,{block:e});return this.put(r,i),i}}))}getRpcUrl(){return this.rpcClient.getRpcUrl()}getCurrentPeriod({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_CURRENT_PERIOD,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getCurrentPeriod({block:t});return this.put(e,r),r}}))}getSuccessorPeriod({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_SUCCESSOR_PERIOD,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getSuccessorPeriod({block:t});return this.put(e,r),r}}))}getSaplingDiffById(t,{block:e}=u){return a(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_SAPLING_DIFF_BY_ID,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getSaplingDiffById(t,{block:e});return this.put(r,i),i}}))}getSaplingDiffByContract(t,{block:e}=u){return a(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_SAPLING_DIFF_BY_CONTRACT,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getSaplingDiffByContract(t,{block:e});return this.put(r,i),i}}))}getProtocols({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_PROTOCOLS,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getProtocols({block:t});return this.put(e,r),r}}))}getTxRollupState(t,{block:e}=u){return a(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_TX_ROLLUP_STATE,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getTxRollupState(t,{block:e});return this.put(r,i),i}}))}getTxRollupInbox(t,e,{block:r}=u){return a(this,void 0,void 0,(function*(){const i=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_TX_ROLLUP_INBOX,[r,t,e]);if(this.has(i))return this.get(i);{const n=this.rpcClient.getTxRollupInbox(t,e,{block:r});return this.put(i,n),n}}))}}var d,p,b;!function(t){t.TOO_LARGE="too large"}(d||(d={})),function(t){t.BAKING_REWARDS="baking rewards",t.REWARDS="rewards",t.FEES="fees",t.DEPOSITS="deposits",t.LEGACY_REWARDS="legacy_rewards",t.LEGACY_FEES="legacy_fees",t.LEGACY_DEPOSITS="legacy_deposits",t.BLOCK_FEES="block fees",t.NONCE_REVELATION_REWARDS="nonce revelation rewards",t.DOUBLE_SIGNING_EVIDENCE_REWARDS="double signing evidence rewards",t.ENDORSING_REWARDS="endorsing rewards",t.BAKING_BONUSES="baking bonuses",t.STORAGE_FEES="storage fees",t.PUNISHMENTS="punishments",t.LOST_ENDORSING_REWARDS="lost endorsing rewards",t.SUBSIDY="subsidy",t.BURNED="burned",t.COMMITMENT="commitment",t.BOOTSTRAP="bootstrap",t.INVOICE="invoice",t.MINTED="minted",t.TX_ROLLUP_REJECTION_REWARDS="tx_rollup_rejection_rewards",t.TX_ROLLUP_REJECTION_PUNISHMENTS="tx_rollup_rejection_punishments",t.BONDS="bonds"}(p||(p={})),function(t){t.ORIGINATION="origination",t.DELEGATION="delegation",t.REVEAL="reveal",t.TRANSACTION="transaction",t.ACTIVATION="activate_account",t.ENDORSEMENT="endorsement",t.PREENDORSEMENT="preendorsement",t.SET_DEPOSITS_LIMIT="set_deposits_limit",t.DOUBLE_PREENDORSEMENT_EVIDENCE="double_preendorsement_evidence",t.ENDORSEMENT_WITH_SLOT="endorsement_with_slot",t.SEED_NONCE_REVELATION="seed_nonce_revelation",t.DOUBLE_ENDORSEMENT_EVIDENCE="double_endorsement_evidence",t.DOUBLE_BAKING_EVIDENCE="double_baking_evidence",t.PROPOSALS="proposals",t.BALLOT="ballot",t.FAILING_NOOP="failing_noop",t.REGISTER_GLOBAL_CONSTANT="register_global_constant",t.TX_ROLLUP_ORIGINATION="tx_rollup_origination",t.TX_ROLLUP_SUBMIT_BATCH="tx_rollup_submit_batch",t.TX_ROLLUP_COMMIT="tx_rollup_commit",t.TX_ROLLUP_RETURN_BOND="tx_rollup_return_bond",t.TX_ROLLUP_FINALIZE_COMMITMENT="tx_rollup_finalize_commitment",t.TX_ROLLUP_REMOVE_COMMITMENT="tx_rollup_remove_commitment",t.TX_ROLLUP_REJECTION="tx_rollup_rejection",t.TX_ROLLUP_DISPATCH_TICKETS="tx_rollup_dispatch_tickets",t.TRANSFER_TICKET="transfer_ticket",t.INCREASE_PAID_STORAGE="increase_paid_storage",t.VDF_REVELATION="vdf_revelation",t.EVENT="event"}(b||(b={}));const g={commitHash:"d474f2ac7abec2e8faddba47cf403a0c0203c7d5",version:"14.2.0-beta-RC.0"};class m{constructor(t,e=c,r=new i.HttpBackend){this.url=t,this.chain=e,this.httpBackend=r}createURL(t){return`${this.url.replace(/\/+$/g,"")}${t}`}validateAddress(t){if((0,s.validateAddress)(t)!==s.ValidationResult.VALID)throw new s.InvalidAddressError(t)}validateContract(t){if((0,s.validateContractAddress)(t)!==s.ValidationResult.VALID)throw new s.InvalidAddressError(t)}getBlockHash({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/hash`),method:"GET"})}))}getLiveBlocks({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/live_blocks`),method:"GET"})}))}getBalance(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/contracts/${t}/balance`),method:"GET"});return new n.Z(r)}))}getStorage(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.validateContract(t),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/contracts/${t}/storage`),method:"GET"})}))}getScript(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.validateContract(t),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/contracts/${t}/script`),method:"GET"})}))}getNormalizedScript(t,e={unparsing_mode:"Readable"},{block:r}=u){return a(this,void 0,void 0,(function*(){return this.validateContract(t),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/contracts/${t}/script/normalized`),method:"POST"},e)}))}getContract(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/contracts/${t}`),method:"GET"});return Object.assign(Object.assign({},r),{balance:new n.Z(r.balance)})}))}getManagerKey(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.validateAddress(t),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/contracts/${t}/manager_key`),method:"GET"})}))}getDelegate(t,{block:e}=u){return a(this,void 0,void 0,(function*(){let r;this.validateAddress(t);try{r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/contracts/${t}/delegate`),method:"GET"})}catch(t){if(!(t instanceof i.HttpResponseError&&t.status===i.STATUS_CODE.NOT_FOUND))throw t;r=null}return r}))}getBigMapKey(t,e,{block:r}=u){return a(this,void 0,void 0,(function*(){return this.validateAddress(t),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/contracts/${t}/big_map_get`),method:"POST"},e)}))}getBigMapExpr(t,e,{block:r}=u){return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/big_maps/${t}/${e}`),method:"GET"})}))}getDelegates(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/delegates/${t}`),method:"GET"}),i=f(r,["balance","full_balance","current_frozen_deposits","frozen_deposits","frozen_balance","frozen_deposits_limit","staking_balance","delegated_balance","voting_power"]);return Object.assign(Object.assign(Object.assign({},r),i),{frozen_balance_by_cycle:r.frozen_balance_by_cycle?r.frozen_balance_by_cycle.map((t=>{var{deposit:e,deposits:r,fees:i,rewards:n}=t,s=o(t,["deposit","deposits","fees","rewards"]);const a=f({deposit:e,deposits:r,fees:i,rewards:n},["deposit","deposits","fees","rewards"]);return Object.assign(Object.assign({},s),{deposit:a.deposit,deposits:a.deposits,fees:a.fees,rewards:a.rewards})})):void 0})}))}getVotingInfo(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.validateAddress(t),yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/delegates/${t}/voting_info`),method:"GET"})}))}getConstants({block:t}=u){return a(this,void 0,void 0,(function*(){const e=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/constants`),method:"GET"}),r=f(e,["time_between_blocks","hard_gas_limit_per_operation","hard_gas_limit_per_block","proof_of_work_threshold","tokens_per_roll","seed_nonce_revelation_tip","block_security_deposit","endorsement_security_deposit","block_reward","endorsement_reward","cost_per_byte","hard_storage_limit_per_operation","test_chain_duration","baking_reward_per_endorsement","delay_per_missing_endorsement","minimal_block_delay","liquidity_baking_subsidy","cache_layout","baking_reward_fixed_portion","baking_reward_bonus_per_slot","endorsing_reward_per_slot","double_baking_punishment","delay_increment_per_round","tx_rollup_commitment_bond","vdf_difficulty","sc_rollup_stake_amount"]);return Object.assign(Object.assign({},e),r)}))}getBlock({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}`),method:"GET"})}))}getBlockHeader({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/header`),method:"GET"})}))}getBlockMetadata({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/metadata`),method:"GET"})}))}getBakingRights(t={},{block:e}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/helpers/baking_rights`),method:"GET",query:t})}))}getEndorsingRights(t={},{block:e}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/helpers/endorsing_rights`),method:"GET",query:t})}))}getBallotList({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/votes/ballot_list`),method:"GET"})}))}getBallots({block:t}=u){return a(this,void 0,void 0,(function*(){return f(yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/votes/ballots`),method:"GET"}),["yay","nay","pass"])}))}getCurrentProposal({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/votes/current_proposal`),method:"GET"})}))}getCurrentQuorum({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/votes/current_quorum`),method:"GET"})}))}getVotesListings({block:t}=u){return a(this,void 0,void 0,(function*(){const e=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/votes/listings`),method:"GET"});return e.map((t=>(t.voting_power&&(t.voting_power=new n.Z(t.voting_power)),t))),e}))}getProposals({block:t}=u){return a(this,void 0,void 0,(function*(){const e=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/votes/proposals`),method:"GET"});return e.map((t=>t[1]=new n.Z(t[1]))),e}))}forgeOperations(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/helpers/forge/operations`),method:"POST"},t)}))}injectOperation(t){return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL("/injection/operation"),method:"POST"},t)}))}preapplyOperations(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/helpers/preapply/operations`),method:"POST"},t)}))}getEntrypoints(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateContract(t);return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/contracts/${t}/entrypoints`),method:"GET"})}))}runOperation(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/helpers/scripts/run_operation`),method:"POST"},t)}))}runCode(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/helpers/scripts/run_code`),method:"POST"},t)}))}runScriptView(t,{block:e}=u){var{unparsing_mode:r="Readable"}=t,i=o(t,["unparsing_mode"]);return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/helpers/scripts/run_script_view`),method:"POST"},Object.assign({unparsing_mode:r},i))}))}runView(t,{block:e}=u){var{unparsing_mode:r="Readable"}=t,i=o(t,["unparsing_mode"]);return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/helpers/scripts/run_view`),method:"POST"},Object.assign({unparsing_mode:r},i))}))}getChainId(){return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/chain_id`),method:"GET"})}))}packData(t,{block:e}=u){return a(this,void 0,void 0,(function*(){const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/helpers/scripts/pack_data`),method:"POST"},t),{gas:i}=r,s=o(r,["gas"]);let a=i;const c=new n.Z(i||"");return c.isNaN()||(a=c),Object.assign({gas:a},s)}))}getRpcUrl(){return this.url}getCurrentPeriod({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/votes/current_period`),method:"GET"})}))}getSuccessorPeriod({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/votes/successor_period`),method:"GET"})}))}getSaplingDiffById(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/sapling/${t}/get_diff`),method:"GET"})}))}getSaplingDiffByContract(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/contracts/${t}/single_sapling_get_diff`),method:"GET"})}))}getProtocols({block:t}=u){return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/protocols`),method:"GET"})}))}getTxRollupState(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/tx_rollup/${t}/state`),method:"GET"})}))}getTxRollupInbox(t,e,{block:r}=u){return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/tx_rollup/${t}/inbox/${e}`),method:"GET"})}))}}},4632:(t,e,r)=>{"use strict";r.r(e),r.d(e,{DeprecationError:()=>I,InvalidAddressError:()=>S,InvalidBlockHashError:()=>T,InvalidChainIdError:()=>A,InvalidContractAddressError:()=>E,InvalidHexStringError:()=>k,InvalidKeyError:()=>v,InvalidKeyHashError:()=>O,InvalidMessageError:()=>_,InvalidOperationHashError:()=>R,InvalidOperationKindError:()=>P,InvalidProtocolHashError:()=>x,InvalidPublicKeyError:()=>y,InvalidSignatureError:()=>w,Prefix:()=>i,ProhibitedActionError:()=>N,VERSION:()=>it,ValidationResult:()=>D,ValueConversionError:()=>M,b58cdecode:()=>ut,b58cencode:()=>ct,b58decode:()=>ht,b58decodeL2Address:()=>ft,buf2hex:()=>yt,bytes2Char:()=>Et,char2Bytes:()=>_t,encodeExpr:()=>ot,encodeKey:()=>pt,encodeKeyHash:()=>bt,encodeL2Address:()=>dt,encodeOpHash:()=>at,encodePubKey:()=>lt,format:()=>st,getPkhfromPk:()=>wt,hex2Bytes:()=>St,hex2buf:()=>gt,isValidPrefix:()=>U,mergebuf:()=>mt,mic2arr:()=>vt,num2PaddedHex:()=>Ot,prefix:()=>g,prefixLength:()=>m,stripHexPrefix:()=>Tt,toHexBuf:()=>At,validateAddress:()=>q,validateBlock:()=>et,validateChain:()=>Z,validateContractAddress:()=>W,validateKeyHash:()=>Y,validateOperation:()=>Q,validatePkAndExtractPrefix:()=>C,validateProtocol:()=>tt,validatePublicKey:()=>X,validateSignature:()=>J,validateSpendingKey:()=>rt,verifySignature:()=>L});var i,n=r(8834),s=r(7728),o=r(6851),a=r(1395),c=r.n(a),u=r(4075),h=r.n(u),f=r(2558),l=r(7554),d=r.n(l),p=r(8743),b=r.n(p);!function(t){t.TZ1="tz1",t.TZ2="tz2",t.TZ3="tz3",t.TZ4="tz4",t.KT="KT",t.KT1="KT1",t.EDSK2="edsk2",t.SPSK="spsk",t.P2SK="p2sk",t.EDPK="edpk",t.SPPK="sppk",t.P2PK="p2pk",t.BLPK="BLpk",t.EDESK="edesk",t.SPESK="spesk",t.P2ESK="p2esk",t.EDSK="edsk",t.EDSIG="edsig",t.SPSIG="spsig",t.P2SIG="p2sig",t.SIG="sig",t.NET="Net",t.NCE="nce",t.B="B",t.O="o",t.LO="Lo",t.LLO="LLo",t.P="P",t.CO="Co",t.ID="id",t.EXPR="expr",t.TZ="TZ",t.VH="vh",t.SASK="sask",t.ZET1="zet1",t.TXR1="txr1",t.TXI="txi",t.TXM="txm",t.TXC="txc",t.TXMR="txmr",t.TXRL="txM",t.TXW="txw"}(i||(i={}));const g={[i.TZ1]:new Uint8Array([6,161,159]),[i.TZ2]:new Uint8Array([6,161,161]),[i.TZ3]:new Uint8Array([6,161,164]),[i.TZ4]:new Uint8Array([6,161,166]),[i.KT]:new Uint8Array([2,90,121]),[i.KT1]:new Uint8Array([2,90,121]),[i.EDSK]:new Uint8Array([43,246,78,7]),[i.EDSK2]:new Uint8Array([13,15,58,7]),[i.SPSK]:new Uint8Array([17,162,224,201]),[i.P2SK]:new Uint8Array([16,81,238,189]),[i.EDPK]:new Uint8Array([13,15,37,217]),[i.SPPK]:new Uint8Array([3,254,226,86]),[i.P2PK]:new Uint8Array([3,178,139,127]),[i.BLPK]:new Uint8Array([6,149,135,204]),[i.EDESK]:new Uint8Array([7,90,60,179,41]),[i.SPESK]:new Uint8Array([9,237,241,174,150]),[i.P2ESK]:new Uint8Array([9,48,57,115,171]),[i.EDSIG]:new Uint8Array([9,245,205,134,18]),[i.SPSIG]:new Uint8Array([13,115,101,19,63]),[i.P2SIG]:new Uint8Array([54,240,44,52]),[i.SIG]:new Uint8Array([4,130,43]),[i.NET]:new Uint8Array([87,82,0]),[i.NCE]:new Uint8Array([69,220,169]),[i.B]:new Uint8Array([1,52]),[i.O]:new Uint8Array([5,116]),[i.LO]:new Uint8Array([133,233]),[i.LLO]:new Uint8Array([29,159,109]),[i.P]:new Uint8Array([2,170]),[i.CO]:new Uint8Array([79,179]),[i.ID]:new Uint8Array([153,103]),[i.EXPR]:new Uint8Array([13,44,64,27]),[i.TZ]:new Uint8Array([2,90,121]),[i.VH]:new Uint8Array([1,106,242]),[i.SASK]:new Uint8Array([11,237,20,92]),[i.ZET1]:new Uint8Array([18,71,40,223]),[i.TXR1]:new Uint8Array([1,128,120,31]),[i.TXI]:new Uint8Array([79,148,196]),[i.TXM]:new Uint8Array([79,149,30]),[i.TXC]:new Uint8Array([79,148,17]),[i.TXMR]:new Uint8Array([18,7,206,87]),[i.TXRL]:new Uint8Array([79,146,82]),[i.TXW]:new Uint8Array([79,150,72])},m={[i.TZ1]:20,[i.TZ2]:20,[i.TZ3]:20,[i.TZ4]:20,[i.KT]:20,[i.KT1]:20,[i.EDPK]:32,[i.SPPK]:33,[i.P2PK]:33,[i.BLPK]:48,[i.EDSIG]:64,[i.SPSIG]:64,[i.P2SIG]:64,[i.SIG]:64,[i.NET]:4,[i.B]:32,[i.P]:32,[i.O]:32,[i.VH]:32,[i.SASK]:169,[i.ZET1]:43,[i.TXR1]:20,[i.TXI]:32,[i.TXM]:32,[i.TXC]:32,[i.TXMR]:32,[i.TXRL]:32,[i.TXW]:32};class v extends Error{constructor(t,e){super(),this.key=t,this.errorDetail=e,this.name="InvalidKeyError";const r=`The key ${t} is invalid.`;this.message=e?`${r} ${e}`:r}}class y extends Error{constructor(t,e){super(),this.publicKey=t,this.name="InvalidPublicKeyError";const r=`The public key '${t}' is invalid.`;this.message=e?`${r} ${e}`:r}}class w extends Error{constructor(t,e){super(),this.signature=t,this.name="InvalidSignatureError";const r=`The signature '${t}' is invalid.`;this.message=e?`${r} ${e}`:r}}class _ extends Error{constructor(t,e){super(),this.msg=t,this.errorDetail=e,this.name="InvalidMessageError";const r=`The message '${t}' is invalid.`;this.message=e?`${r} ${e}`:r}}class E extends Error{constructor(t){super(`The contract address '${t}' is invalid`),this.contractAddress=t,this.name="InvalidContractAddressError"}}class S extends Error{constructor(t,e){super(),this.address=t,this.name="InvalidAddressError";const r=`The address '${t}' is invalid.`;this.message=e?`${r} ${e}`:r}}class A extends Error{constructor(t){super(`The chain id '${t}' is invalid`),this.chainId=t,this.name="InvalidChainIdError"}}class O extends Error{constructor(t){super(`The public key hash '${t}' is invalid`),this.keyHash=t,this.name="InvalidKeyHashError"}}class T extends Error{constructor(t){super(`The block hash '${t}' is invalid`),this.blockHash=t,this.name="InvalidBlockHashError"}}class x extends Error{constructor(t){super(`The protocol hash '${t}' is invalid`),this.protocolHash=t,this.name="InvalidProtocolHashError"}}class R extends Error{constructor(t){super(`The operation hash '${t}' is invalid`),this.operationHash=t,this.name="InvalidOperationHashError"}}class P extends Error{constructor(t){super(`The operation kind '${t}' is unsupported`),this.operationKind=t,this.name="InvalidOperationKindError"}}class I extends Error{constructor(t){super(t),this.message=t,this.name="DeprecationError"}}class N extends Error{constructor(t){super(t),this.message=t,this.name="ProhibitedActionError"}}class M extends Error{constructor(t,e){super(`Unable to convert ${t} to a ${e}`),this.value=t,this.desiredType=e,this.name="ValueConversionError"}}class k extends Error{constructor(t){super(t),this.message=t,this.name="InvalidHexStringError"}}function L(t,e,r){const n=C(e),a=function(t){const e=t.startsWith("sig")?t.substr(0,3):t.substr(0,5),r=J(t);if(r!==D.VALID){if(r===D.INVALID_CHECKSUM)throw new w(t,"invalid checksum");if(r===D.INVALID_LENGTH)throw new w(t,"invalid length");if(r===D.NO_PREFIX_MATCHED)throw new w(e,"unsupported prefix")}return e}(r),c=ut(e,g[n]),u=ut(r,g[a]),h=(0,o.vp)(gt(function(t){if(""===t)throw new _(t,"The message provided for verifying signature cannot be empty.");return t}(t)),32);return n===i.EDPK?function(t,e,r){try{return(0,s.T)(r,e,t)}catch(t){return!1}}(u,h,c):n===i.SPPK?function(t,e,r){const i=new(d().ec)("secp256k1").keyFromPublic(r);return B(t,e,i)}(u,h,c):n===i.P2PK&&function(t,e,r){const i=new(d().ec)("p256").keyFromPublic(r);return B(t,e,i)}(u,h,c)}function C(t){if(""===t)throw new y(t,"Public key cannot be empty");const e=t.substring(0,4),r=X(t);if(r!==D.VALID){if(r===D.INVALID_CHECKSUM)throw new y(t,"The public key provided has an invalid checksum");if(r===D.INVALID_LENGTH)throw new y(t,"The public key provided has an invalid length");if(r===D.NO_PREFIX_MATCHED)throw new y(t,`The public key provided has an unsupported prefix: ${e}`)}return e}function B(t,e,r){const i=yt(b()(t)).match(/([a-f\d]{64})/gi);if(i)try{const[t,n]=i;return r.verify(e,{r:t,s:n})}catch(t){return!1}return!1}var D;function U(t){return"string"==typeof t&&t in g}function j(t,e){const r=new RegExp(`^(${e.join("|")})`).exec(t);if(!r||0===r.length)return D.NO_PREFIX_MATCHED;const i=r[0];if(!U(i))return D.NO_PREFIX_MATCHED;const n=/^(KT1\w{33})(%(.*))?/.exec(t);n&&(t=n[1]);let s=h().decodeUnsafe(t);return s?(s=s.slice(g[i].length),s.length!==m[i]?D.INVALID_LENGTH:D.VALID):D.INVALID_CHECKSUM}!function(t){t[t.NO_PREFIX_MATCHED=0]="NO_PREFIX_MATCHED",t[t.INVALID_CHECKSUM=1]="INVALID_CHECKSUM",t[t.INVALID_LENGTH=2]="INVALID_LENGTH",t[t.VALID=3]="VALID"}(D||(D={}));const K=[i.TZ1,i.TZ2,i.TZ3,i.TZ4],V=[i.KT1,i.TXR1],F=[i.EDSIG,i.P2SIG,i.SPSIG,i.SIG],H=[i.EDPK,i.SPPK,i.P2PK,i.BLPK],G=[i.O],$=[i.P],z=[i.B];function q(t){return j(t,[...K,...V])}function Z(t){return j(t,[i.NET])}function W(t){return j(t,V)}function Y(t){return j(t,K)}function J(t){return j(t,F)}function X(t){return j(t,H)}function Q(t){return j(t,G)}function tt(t){return j(t,$)}function et(t){return j(t,z)}function rt(t){return j(t,[i.SASK])}const it={commitHash:"d474f2ac7abec2e8faddba47cf403a0c0203c7d5",version:"14.2.0-beta-RC.0"};function nt(t){switch(t){case"tz":return 6;case"mtz":return 3;default:return 0}}function st(t="mutez",e="mutez",r){const i=new f.Z(r);return i.isNaN()?r:i.multipliedBy(Math.pow(10,nt(t))).dividedBy(Math.pow(10,nt(e)))}function ot(t){return ct(c().blake2b(gt(t),void 0,32),g.expr)}function at(t){return ct(c().blake2b(gt(t),void 0,32),g.o)}function ct(t,e){const r="string"==typeof t?Uint8Array.from(n.Buffer.from(t,"hex")):t,i=new Uint8Array(e.length+r.length);return i.set(e),i.set(r,e.length),h().encode(n.Buffer.from(i.buffer))}const ut=(t,e)=>h().decode(t).slice(e.length);function ht(t){const e=h().decode(t),r={[g.tz1.toString()]:"0000",[g.tz2.toString()]:"0001",[g.tz3.toString()]:"0002"},i={[g.txr1.toString()]:"02"},n=r[new Uint8Array(e.slice(0,3)).toString()],s=i[new Uint8Array(e.slice(0,4)).toString()];if(n){return n+yt(e.slice(3))}if(s){return s+yt(e.slice(4))+"00"}return"01"+yt(e.slice(3,42))+"00"}function ft(t){const e=h().decode(t);return yt(e.slice(3,42))}function lt(t){if("00"===t.substring(0,2)){const e={"0000":g.tz1,"0001":g.tz2,"0002":g.tz3};return ct(t.substring(4),e[t.substring(0,4)])}return"02"===t.substring(0,2)?ct(t.substring(2,t.length-2),g.txr1):ct(t.substring(2,42),g.KT)}function dt(t){return ct(t,g.tz4)}function pt(t){if("0"===t[0]){const e={"00":new Uint8Array([13,15,37,217]),"01":new Uint8Array([3,254,226,86]),"02":new Uint8Array([3,178,139,127])};return ct(t.substring(2),e[t.substring(0,2)])}}function bt(t){if("0"===t[0]){const e={"00":new Uint8Array([6,161,159]),"01":new Uint8Array([6,161,161]),"02":new Uint8Array([6,161,164])};return ct(t.substring(2),e[t.substring(0,2)])}}const gt=t=>{const e=t.match(/[\da-f]{2}/gi);if(e)return new Uint8Array(e.map((t=>parseInt(t,16))));throw new M(t,"Uint8Array")},mt=(t,e)=>{const r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r},vt=function t(e){let r=[];if(Object.prototype.hasOwnProperty.call(e,"prim"))"Pair"===e.prim?(r.push(t(e.args[0])),r=r.concat(t(e.args[1]))):"Elt"===e.prim?r={key:t(e.args[0]),val:t(e.args[1])}:"True"===e.prim?r=!0:"False"===e.prim&&(r=!1);else if(Array.isArray(e)){const i=e.length;for(let n=0;n<i;n++){const i=t(e[n]);void 0!==i.key?(Array.isArray(r)&&(r={keys:[],vals:[]}),r.keys.push(i.key),r.vals.push(i.val)):r.push(i)}}else r=Object.prototype.hasOwnProperty.call(e,"string")?e.string:Object.prototype.hasOwnProperty.call(e,"int")?parseInt(e.int,10):e;return r},yt=t=>{const e=new Uint8Array(t),r=[];return e.forEach((t=>{const e=`00${t.toString(16)}`.slice(-2);r.push(e)})),r.join("")},wt=t=>{let e,r;const n=C(t),s=ut(t,g[n]);switch(n){case i.EDPK:e=g[i.TZ1],r=m[i.TZ1];break;case i.SPPK:e=g[i.TZ2],r=m[i.TZ2];break;case i.P2PK:e=g[i.TZ3],r=m[i.TZ3];break;case i.BLPK:e=g[i.TZ4],r=m[i.TZ4]}return ct((0,o.vp)(s,r),e)};function _t(t){return n.Buffer.from(t,"utf8").toString("hex")}function Et(t){return n.Buffer.from(gt(t)).toString("utf8")}function St(t){if(!t.match(/[\da-f]{2}/gi))throw new k(`The hex string ${t} does not have an even number of characters`);return n.Buffer.from(t,"hex")}function At(t,e=8){return n.Buffer.from(Ot(t,e),"hex")}function Ot(t,e=8){if(new f.Z(t).isPositive()){const r=Math.ceil(e/4),i=t.toString(16);let n=i.length>=r?i.length:r;return n=n%2==0?n:n+1,function(t,e){const r="0";if(t.length>=e)return t;{const i=e-t.length;return r.repeat(i)+t}}(i,n)}return new f.Z(2).pow(e).minus(new f.Z(t).abs()).toString(16)}function Tt(t){return t.startsWith("0x")?t.slice(2):t}},150:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.RPCBatchProvider=e.OperationBatch=e.BATCH_KINDS=void 0;const n=r(9480),s=r(3650),o=r(2026),a=r(807),c=r(6368),u=r(4632);e.BATCH_KINDS=[c.OpKind.ACTIVATION,c.OpKind.ORIGINATION,c.OpKind.TRANSACTION,c.OpKind.DELEGATION];class h extends o.OperationEmitter{constructor(t,e){super(t),this.estimator=e,this.operations=[]}withTransfer(t){if(u.validateAddress(t.to)!==u.ValidationResult.VALID)throw new u.InvalidAddressError(t.to);return this.operations.push(Object.assign({kind:c.OpKind.TRANSACTION},t)),this}withTransferTicket(t){if(u.validateContractAddress(t.destination)!==u.ValidationResult.VALID)throw new u.InvalidContractAddressError(t.destination);return this.operations.push(Object.assign({kind:c.OpKind.TRANSFER_TICKET},t)),this}withContractCall(t,e={}){return this.withTransfer(t.toTransferParams(e))}withDelegation(t){if(t.source&&u.validateAddress(t.source)!==u.ValidationResult.VALID)throw new u.InvalidAddressError(t.source);if(t.delegate&&u.validateAddress(t.delegate)!==u.ValidationResult.VALID)throw new u.InvalidAddressError(t.delegate);return this.operations.push(Object.assign({kind:c.OpKind.DELEGATION},t)),this}withActivation({pkh:t,secret:e}){if(u.validateKeyHash(t)!==u.ValidationResult.VALID)throw new u.InvalidKeyHashError(t);return this.operations.push({kind:c.OpKind.ACTIVATION,pkh:t,secret:e}),this}withOrigination(t){return this.operations.push(Object.assign({kind:c.OpKind.ORIGINATION},t)),this}withRegisterGlobalConstant(t){return this.operations.push(Object.assign({kind:c.OpKind.REGISTER_GLOBAL_CONSTANT},t)),this}withIncreasePaidStorage(t){return this.operations.push(Object.assign({kind:c.OpKind.INCREASE_PAID_STORAGE},t)),this}withTxRollupOrigination(t){return this.operations.push(Object.assign({kind:c.OpKind.TX_ROLLUP_ORIGINATION},t)),this}withTxRollupSubmitBatch(t){return this.operations.push(Object.assign({kind:c.OpKind.TX_ROLLUP_SUBMIT_BATCH},t)),this}getRPCOp(t){return i(this,void 0,void 0,(function*(){switch(t.kind){case c.OpKind.TRANSACTION:return n.createTransferOperation(Object.assign({},t));case c.OpKind.ORIGINATION:return n.createOriginationOperation(yield this.context.parser.prepareCodeOrigination(Object.assign({},t)));case c.OpKind.DELEGATION:return n.createSetDelegateOperation(Object.assign({},t));case c.OpKind.ACTIVATION:return Object.assign({},t);case c.OpKind.REGISTER_GLOBAL_CONSTANT:return n.createRegisterGlobalConstantOperation(Object.assign({},t));case c.OpKind.INCREASE_PAID_STORAGE:return n.createIncreasePaidStorageOperation(Object.assign({},t));case c.OpKind.TX_ROLLUP_ORIGINATION:return n.createTxRollupOriginationOperation(Object.assign({},t));case c.OpKind.TX_ROLLUP_SUBMIT_BATCH:return n.createTxRollupBatchOperation(Object.assign({},t));case c.OpKind.TRANSFER_TICKET:return n.createTransferTicketOperation(Object.assign({},t));default:throw new u.InvalidOperationKindError(t.kind)}}))}with(t){for(const e of t)switch(e.kind){case c.OpKind.TRANSACTION:this.withTransfer(e);break;case c.OpKind.ORIGINATION:this.withOrigination(e);break;case c.OpKind.DELEGATION:this.withDelegation(e);break;case c.OpKind.ACTIVATION:this.withActivation(e);break;case c.OpKind.REGISTER_GLOBAL_CONSTANT:this.withRegisterGlobalConstant(e);break;case c.OpKind.INCREASE_PAID_STORAGE:this.withIncreasePaidStorage(e);break;case c.OpKind.TX_ROLLUP_ORIGINATION:this.withTxRollupOrigination(e);break;case c.OpKind.TX_ROLLUP_SUBMIT_BATCH:this.withTxRollupSubmitBatch(e);break;case c.OpKind.TRANSFER_TICKET:this.withTransferTicket(e);break;default:throw new u.InvalidOperationKindError(e.kind)}return this}send(t){return i(this,void 0,void 0,(function*(){const e=yield this.signer.publicKeyHash(),r=yield this.signer.publicKey(),o=yield this.estimator.batch(this.operations),u=yield this.isRevealOpNeeded(this.operations,e);let h=u?1:0;const f=[];for(const t of this.operations){if(a.isOpWithFee(t)){const e=yield this.estimate(t,(()=>i(this,void 0,void 0,(function*(){return o[h]}))));f.push(yield this.getRPCOp(Object.assign(Object.assign({},t),e)))}else f.push(Object.assign({},t));h++}if(u){const t={kind:c.OpKind.REVEAL},s=yield this.estimate(t,(()=>i(this,void 0,void 0,(function*(){return o[0]}))));f.unshift(yield n.createRevealOperation(Object.assign({},s),e,r))}const l=t&&t.source||e,d=yield this.prepareOperation({operation:f,source:l}),p=yield this.forge(d),{hash:b,context:g,forgedBytes:m,opResponse:v}=yield this.signAndInject(p);return new s.BatchOperation(b,f,l,m,v,g)}))}}e.OperationBatch=h;e.RPCBatchProvider=class{constructor(t,e){this.context=t,this.estimator=e}batch(t){const e=new h(this.context,this.estimator);return Array.isArray(t)&&e.with(t),e}}},4593:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ChainIds=e.protocols=e.Protocols=e.COST_PER_BYTE=e.DEFAULT_STORAGE_LIMIT=e.DEFAULT_FEE=e.DEFAULT_GAS_LIMIT=void 0,function(t){t[t.DELEGATION=10600]="DELEGATION",t[t.ORIGINATION=10600]="ORIGINATION",t[t.TRANSFER=10600]="TRANSFER",t[t.REVEAL=1100]="REVEAL"}(e.DEFAULT_GAS_LIMIT||(e.DEFAULT_GAS_LIMIT={})),function(t){t[t.DELEGATION=1257]="DELEGATION",t[t.ORIGINATION=1e4]="ORIGINATION",t[t.TRANSFER=1e4]="TRANSFER",t[t.REVEAL=374]="REVEAL"}(e.DEFAULT_FEE||(e.DEFAULT_FEE={})),function(t){t[t.DELEGATION=0]="DELEGATION",t[t.ORIGINATION=257]="ORIGINATION",t[t.TRANSFER=257]="TRANSFER",t[t.REVEAL=0]="REVEAL"}(e.DEFAULT_STORAGE_LIMIT||(e.DEFAULT_STORAGE_LIMIT={})),e.COST_PER_BYTE=250,function(t){t.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",t.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",t.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",t.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",t.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",t.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",t.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",t.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",t.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",t.PsiThaCa="PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP",t.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",t.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",t.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",t.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(r=e.Protocols||(e.Protocols={})),e.protocols={"004":[r.Pt24m4xi],"005":[r.PsBABY5H,r.PsBabyM1],"006":[r.PsCARTHA],"007":[r.PsDELPH1],"008":[r.PtEdo2Zk],"009":[r.PsFLorena],"010":[r.PtGRANADs],"011":[r.PtHangz2],"012":[r.PsiThaCa,r.Psithaca2],"013":[r.PtJakart2],"014":[r.PtKathman],"015":[r.ProtoALpha]},function(t){t.MAINNET="NetXdQprcVkpaWU",t.CARTHAGENET="NetXjD3HPJJjmcd",t.DELPHINET="NetXm8tYqnMWky1",t.EDONET="NetXSgo1ZT2DRUG",t.FLORENCENET="NetXxkAx4woPLyu",t.GRANADANET="NetXz969SFaFn8k",t.HANGZHOUNET="NetXZSsxBpMQeAT",t.ITHACANET="NetXbhmtAbMukLc",t.ITHACANET2="NetXnHfVqm9iesp",t.JAKARTANET2="NetXLH1uAxK7CCh",t.KATHMANDUNET="NetXazhm4yetmff"}(e.ChainIds||(e.ChainIds={}))},4984:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Context=e.defaultConfigConfirmation=void 0;const n=r(6368),s=r(5744),o=r(1067),a=r(8286),c=r(992),u=r(4782),h=r(1151),f=r(150),l=r(635),d=r(5286),p=r(6395),b=r(4496),g=r(9494),m=r(259),v=r(5032),y=r(6713);e.defaultConfigConfirmation={defaultConfirmationCount:1,confirmationPollingTimeoutSecond:180};class w{constructor(t,r=new o.NoopSigner,i,w=new b.BehaviorSubject(Object.assign({},e.defaultConfigConfirmation)),_,E,S,A,O,T,x,R){this._rpc=t,this._signer=r,this._proto=i,this._config=w,this.providerDecorator=[],this.tz=new c.RpcTzProvider(this),this.estimate=new u.RPCEstimateProvider(this),this.contract=new h.RpcContractProvider(this,this.estimate),this.batch=new f.RPCBatchProvider(this,this.estimate),this.wallet=new l.Wallet(this),this.withExtensions=()=>{let t=this.clone();return this.providerDecorator.forEach((e=>{t=e(t)})),t},"string"==typeof this._rpc?this._rpcClient=new n.RpcClient(this._rpc):this._rpcClient=this._rpc,this._forger=_||new y.TaquitoLocalForger(this),this._injector=E||new s.RpcInjector(this),this.operationFactory=new a.OperationFactory(this),this._walletProvider=A||new l.LegacyWalletProvider(this),this._parser=O||new d.MichelCodecParser(this),this._packer=S||new p.RpcPacker(this),this._globalConstantsProvider=T||new g.NoopGlobalConstantsProvider,this._readProvider=x||new m.RpcReadAdapter(this._rpcClient),this._stream=R||new v.PollingSubscribeProvider(this)}get config(){return this._config.getValue()}set config(t){this._config.next(Object.assign({},t))}setPartialConfig(t){this._config.next(Object.assign(Object.assign({},this._config.getValue()),t))}get rpc(){return this._rpcClient}set rpc(t){this._rpcClient=t}get injector(){return this._injector}set injector(t){this._injector=t}get forger(){return this._forger}set forger(t){this._forger=t}get signer(){return this._signer}set signer(t){this._signer=t}get walletProvider(){return this._walletProvider}set walletProvider(t){this._walletProvider=t}set proto(t){this._proto=t}get proto(){return this._proto}get parser(){return this._parser}set parser(t){this._parser=t}get packer(){return this._packer}set packer(t){this._packer=t}get globalConstantsProvider(){return this._globalConstantsProvider}set globalConstantsProvider(t){this._globalConstantsProvider=t}get readProvider(){return this._readProvider}set readProvider(t){this._readProvider=t}get stream(){return this._stream}set stream(t){this._stream=t}isAnyProtocolActive(t=[]){return i(this,void 0,void 0,(function*(){if(this._proto)return t.includes(this._proto);{const e=yield this.readProvider.getNextProtocol("head");return t.includes(e)}}))}isAnySignerConfigured(){return!(this.signer instanceof o.NoopSigner)}clone(){return new w(this.rpc,this.signer,this.proto,this._config,this.forger,this._injector,this.packer,this._walletProvider,this._parser,this._globalConstantsProvider,this._readProvider,this._stream)}registerProviderDecorator(t){this.providerDecorator.push(t)}}e.Context=w},5225:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.BigMapAbstraction=void 0;const n=r(5543);e.BigMapAbstraction=class{constructor(t,e,r){this.id=t,this.schema=e,this.provider=r}get(t,e){return i(this,void 0,void 0,(function*(){try{return yield this.provider.getBigMapKeyByID(this.id.toString(),t,this.schema,e)}catch(t){if(t instanceof n.HttpResponseError&&t.status===n.STATUS_CODE.NOT_FOUND)return;throw t}}))}getMultipleValues(t,e,r=5){return i(this,void 0,void 0,(function*(){return this.provider.getBigMapKeysByID(this.id.toString(),t,this.schema,e,r)}))}toJSON(){return this.id.toString()}toString(){return this.id.toString()}}},191:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.compose=void 0,e.compose=function(t,e){return(r,i)=>e(t(r,i),i)}},2298:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContractMethodFactory=void 0;const i=r(3687),n=r(7864),s=r(3849);e.ContractMethodFactory=class{constructor(t,e){this.provider=t,this.contractAddress=e}createContractMethodFlatParams(t,e,r,i=!0,s=!1){return new n.ContractMethod(this.provider,this.contractAddress,t,e,r,i,s)}createContractMethodObjectParam(t,e,r,n=!0,s=!1){return new i.ContractMethodObject(this.provider,this.contractAddress,t,e,r,n,s)}createContractViewObjectParam(t,e,r,i,n){return new s.OnChainView(t,e,this.contractAddress,r,i,n)}}},7864:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContractMethod=void 0;const i=r(635),n=r(1863),s=r(6700);e.ContractMethod=class{constructor(t,e,r,i,n,s=!0,o=!1){this.provider=t,this.address=e,this.parameterSchema=r,this.name=i,this.args=n,this.isMultipleEntrypoint=s,this.isAnonymous=o}validateArgs(t,e,r){const i=e.ExtractSignatures();if(!i.find((e=>e.length===t.length)))throw new s.InvalidParameterError(r,i,t)}get schema(){return this.isAnonymous?this.parameterSchema.ExtractSchema()[this.name]:this.parameterSchema.ExtractSchema()}getSignature(){if(!this.isAnonymous){const t=this.parameterSchema.ExtractSignatures();return 1==t.length?t[0]:t}{const t=this.parameterSchema.ExtractSignatures().find((t=>t[0]===this.name));if(t)return t.shift(),t}}send(t={}){return this.provider instanceof i.Wallet?this.provider.transfer(this.toTransferParams(t)).send():this.provider.transfer(this.toTransferParams(t))}toTransferParams({fee:t,gasLimit:e,storageLimit:r,source:i,amount:s=0,mutez:o=!1}={}){return{to:this.address,amount:s,fee:t,mutez:o,source:i,gasLimit:e,storageLimit:r,parameter:{entrypoint:this.isMultipleEntrypoint?this.name:n.DEFAULT_SMART_CONTRACT_METHOD_NAME,value:this.isAnonymous?this.parameterSchema.Encode(this.name,...this.args):this.parameterSchema.Encode(...this.args)}}}}},4662:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3687:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContractMethodObject=void 0;const i=r(635),n=r(1863);e.ContractMethodObject=class{constructor(t,e,r,i,n="unit",s=!0,o=!1){this.provider=t,this.address=e,this.parameterSchema=r,this.name=i,this.args=n,this.isMultipleEntrypoint=s,this.isAnonymous=o}getSignature(){return this.isAnonymous?this.parameterSchema.ExtractSchema()[this.name]:this.parameterSchema.ExtractSchema()}send(t={}){return this.provider instanceof i.Wallet?this.provider.transfer(this.toTransferParams(t)).send():this.provider.transfer(this.toTransferParams(t))}toTransferParams({fee:t,gasLimit:e,storageLimit:r,source:i,amount:s=0,mutez:o=!1}={}){return{to:this.address,amount:s,fee:t,mutez:o,source:i,gasLimit:e,storageLimit:r,parameter:{entrypoint:this.isMultipleEntrypoint?this.name:n.DEFAULT_SMART_CONTRACT_METHOD_NAME,value:this.isAnonymous?this.parameterSchema.EncodeObject({[this.name]:this.args}):this.parameterSchema.EncodeObject(this.args)}}}}},3849:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.OnChainView=void 0;const n=r(4632),s=r(6700),o=r(4593);e.OnChainView=class{constructor(t,e,r,i,n,s="Unit"){this._rpc=t,this._readProvider=e,this._contractAddress=r,this._smartContractViewSchema=i,this._contractStorageType=n,this._args=s}getSignature(){return{parameter:this._smartContractViewSchema.extractArgsSchema(),result:this._smartContractViewSchema.extractResultSchema()}}executeView(t){return i(this,void 0,void 0,(function*(){const e=(yield this._rpc.getProtocols()).protocol;if(e===o.Protocols.PtJakart2){this.verifyContextExecution(t);const r=(yield this._readProvider.getBalance(this._contractAddress,"head")).toString(),i=yield this._readProvider.getChainId(),n=yield this._readProvider.getStorage(this._contractAddress,"head");return this.executeViewAndDecodeResult(((t,e,r,i,n,s,o,a,c,u="0")=>({script:[{prim:"parameter",args:[{prim:"pair",args:[t,r]}]},{prim:"storage",args:[{prim:"option",args:[e]}]},{prim:"code",args:[[{prim:"CAR"},i,{prim:"SOME"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PAIR"}]]}],storage:{prim:"None"},input:{prim:"Pair",args:[n,s]},amount:u,balance:o,chain_id:a,source:c}))(this._smartContractViewSchema.viewArgsType,this._smartContractViewSchema.viewReturnType,this._contractStorageType,this.adaptViewCodeToContext(this._smartContractViewSchema.instructions,t.viewCaller,r),this.transformArgsToMichelson(),n,r,i,t.source),e)}{this.verifyContextExecution(t);const r=yield this._readProvider.getChainId(),i=this.transformArgsToMichelson(),n={contract:this._contractAddress,view:this._smartContractViewSchema.viewName,input:i,chain_id:r,source:t.viewCaller};return t.source&&(n.payer=t.source),this.executeViewAndDecodeResult(n,e)}}))}verifyContextExecution(t){if(t.source&&n.validateAddress(t.source)!==n.ValidationResult.VALID)throw new s.InvalidViewSimulationContext(`The source account who initialized the view execution is invalid: ${t.source}.`);if(!t.viewCaller||n.validateAddress(t.viewCaller)!==n.ValidationResult.VALID)throw new s.InvalidViewSimulationContext(`The contract which is the caller of view is invalid: ${t.viewCaller}.`)}transformArgsToMichelson(){try{return this._smartContractViewSchema.encodeViewArgs(this._args)}catch(t){throw new s.InvalidViewParameterError(this._smartContractViewSchema.viewName,this.getSignature(),this._args,t)}}adaptViewCodeToContext(t,e,r){const i={BALANCE:[{prim:"PUSH",args:[{prim:"mutez"},{int:r}]}],SENDER:[{prim:"PUSH",args:[{prim:"address"},{string:e}]}],SELF_ADDRESS:[{prim:"PUSH",args:[{prim:"address"},{string:this._contractAddress}]}],AMOUNT:[{prim:"PUSH",args:[{prim:"mutez"},{int:"0"}]}]};return t.forEach(((n,s)=>{n.prim in i&&(t[s]=Object(i)[n.prim]),n.args&&0!==n.args.length?this.adaptViewCodeToContext(n.args,e,r):Array.isArray(n)&&this.adaptViewCodeToContext(n,e,r)})),t}executeViewAndDecodeResult(t,e){return i(this,void 0,void 0,(function*(){if(e===o.Protocols.PtJakart2){let e;try{e=(yield this._rpc.runCode(t)).storage}catch(t){const e=s.validateAndExtractFailwith(t);throw e?new s.ViewSimulationError(`The simulation of the on-chain view named ${this._smartContractViewSchema.viewName} failed with: ${JSON.stringify(e)}`,this._smartContractViewSchema.viewName,e,t):t}if(!e.args)throw new s.ViewSimulationError(`View simulation failed with an invalid result: ${e}`,this._smartContractViewSchema.viewName);return this._smartContractViewSchema.decodeViewResult(e.args[0])}{let e;try{e=(yield this._rpc.runScriptView(t)).data}catch(t){const e=s.validateAndExtractFailwith(t);throw e?new s.ViewSimulationError(`The simulation of the on-chain view named ${this._smartContractViewSchema.viewName} failed with: ${JSON.stringify(e)}`,this._smartContractViewSchema.viewName,e,t):t}return this._smartContractViewSchema.decodeViewResult(e)}}))}}},1863:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.ContractAbstraction=e.ContractView=e.DEFAULT_SMART_CONTRACT_METHOD_NAME=void 0;const n=r(8899),s=r(4632),o=r(2298),a=r(6700);e.DEFAULT_SMART_CONTRACT_METHOD_NAME="default";class c{constructor(t,e,r,i,n,s,o){this.currentContract=t,this.name=e,this.callbackParametersSchema=r,this.parameterSchema=i,this.args=n,this.rpc=s,this.readProvider=o}read(t){return i(this,void 0,void 0,(function*(){if(s.validateContractAddress(null!=t?t:"")==s.ValidationResult.VALID)throw new s.DeprecationError("Since version 12, the lambda view no longer depends on a lambda contract. The read method no longer accepts a contract address as a parameter.");if(t&&s.validateChain(t)!==s.ValidationResult.VALID)throw new s.InvalidChainIdError(t);const e=this.parameterSchema.Encode(...this.args),r=yield this.rpc.runView({contract:this.currentContract.address,entrypoint:this.name,input:e,chain_id:t||(yield this.readProvider.getChainId())});return this.callbackParametersSchema.Execute(r.data)}))}}e.ContractView=c;e.ContractAbstraction=class{constructor(t,e,r,i,s,a,c){this.address=t,this.script=e,this.storageProvider=i,this.entrypoints=s,this.rpc=a,this.readProvider=c,this.methods={},this.methodsObject={},this.views={},this.contractViews={},this.contractMethodFactory=new o.ContractMethodFactory(r,t),this.schema=n.Schema.fromRPCResponse({script:this.script}),this.parameterSchema=n.ParameterSchema.fromRPCResponse({script:this.script}),this.viewSchema=n.ViewSchema.fromRPCResponse({script:this.script}),0!==this.viewSchema.length&&this._initializeOnChainViews(this,a,this.readProvider,this.viewSchema),this._initializeMethods(this,this.entrypoints.entrypoints,this.rpc,this.readProvider)}_initializeMethods(t,r,i,s){const o=this.parameterSchema,u=Object.keys(r);if(o.isMultipleEntryPoint){u.forEach((e=>{const o=new n.ParameterSchema(r[e]);if(this.methods[e]=function(...r){return t.contractMethodFactory.createContractMethodFlatParams(o,e,r)},this.methodsObject[e]=function(r){return t.contractMethodFactory.createContractMethodObjectParam(o,e,r)},(t=>{let e=!1;if("prim"in t&&"pair"===t.prim&&t.args){const r=t.args[t.args.length-1];"prim"in r&&"contract"===r.prim&&(e=!0)}return e})(r[e])){const o=function(...o){const u=r[e].args[0],h=new n.ParameterSchema(u),f=r[e].args[1].args[0],l=new n.ParameterSchema(f);return((t,e,r)=>{const i=e.ExtractSignatures();if(!i.find((e=>e.length===t.length)))throw new a.InvalidParameterError(r,i,t)})(o,h,e),new c(t,e,l,h,o,i,s)};this.views[e]=o}}));Object.keys(o.ExtractSchema()).filter((t=>-1===Object.keys(r).indexOf(t))).forEach((e=>{this.methods[e]=function(...r){return t.contractMethodFactory.createContractMethodFlatParams(o,e,r,!1,!0)},this.methodsObject[e]=function(r){return t.contractMethodFactory.createContractMethodObjectParam(o,e,r,!1,!0)}}))}else{const r=this.parameterSchema;this.methods[e.DEFAULT_SMART_CONTRACT_METHOD_NAME]=function(...i){return t.contractMethodFactory.createContractMethodFlatParams(r,e.DEFAULT_SMART_CONTRACT_METHOD_NAME,i,!1)},this.methodsObject[e.DEFAULT_SMART_CONTRACT_METHOD_NAME]=function(i){return t.contractMethodFactory.createContractMethodObjectParam(r,e.DEFAULT_SMART_CONTRACT_METHOD_NAME,i,!1)}}}_initializeOnChainViews(t,e,r,i){const n=this.schema.val;i.forEach((i=>{this.contractViews[i.viewName]=function(s){return t.contractMethodFactory.createContractViewObjectParam(e,r,i,n,s)}}))}storage(){return this.storageProvider.getStorage(this.address,this.schema)}bigMap(t){return this.storageProvider.getBigMapKey(this.address,t,this.schema)}}},6700:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IntegerError=e.OriginationParameterError=e.RevealOperationError=e.InvalidViewSimulationContext=e.validateAndExtractFailwith=e.ViewSimulationError=e.InvalidViewParameterError=e.InvalidInitParameter=e.InvalidCodeParameter=e.InvalidDelegationSource=e.InvalidParameterError=void 0;class r extends Error{constructor(t,e,r){super(`${t} Received ${r.length} arguments while expecting one of the following signatures (${JSON.stringify(e)})`),this.smartContractMethodName=t,this.sigs=e,this.args=r,this.name="Invalid parameters error"}}e.InvalidParameterError=r;class i extends Error{constructor(t){super(`Since Babylon delegation source can no longer be a contract address ${t}. Please use the smart contract abstraction to set your delegate.`),this.source=t,this.name="Invalid delegation source error"}}e.InvalidDelegationSource=i;class n extends Error{constructor(t,e){super(t),this.message=t,this.data=e,this.name="InvalidCodeParameter"}}e.InvalidCodeParameter=n;class s extends Error{constructor(t,e){super(t),this.message=t,this.data=e,this.name="InvalidInitParameter"}}e.InvalidInitParameter=s;class o extends Error{constructor(t,e,r,i){super(`Unable to encode the parameter of the view: ${t}. Received ${r} as parameter while expecting one of the following signatures (${JSON.stringify(e)})`),this.smartContractViewName=t,this.sigs=e,this.args=r,this.originalError=i,this.name="Invalid view parameters error",this.cause=i}}e.InvalidViewParameterError=o;class a extends Error{constructor(t,e,r,i){super(t),this.message=t,this.viewName=e,this.failWith=r,this.originalError=i,this.name="ViewSimulationError"}}e.ViewSimulationError=a;e.validateAndExtractFailwith=t=>{if(c(t.body)){const e=JSON.parse(t.body);if(Array.isArray(e)&&"with"in e[e.length-1])return e[e.length-1].with}};const c=t=>{try{JSON.parse(t)}catch(t){return!1}return!0};class u extends Error{constructor(t){super(`${t} Please configure the context of the view execution in the executeView method.`),this.info=t,this.name="InvalidViewSimulationContext"}}e.InvalidViewSimulationContext=u;class h extends Error{constructor(t){super(t),this.message=t,this.name="RevealOperationError"}}e.RevealOperationError=h;class f extends Error{constructor(t){super(t),this.message=t,this.name="OriginationParameterError"}}e.OriginationParameterError=f;class l extends Error{constructor(t){super(t),this.message=t,this.name="IntegerError"}}e.IntegerError=l},238:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.compose=void 0,n(r(1863),e),n(r(6700),e),n(r(2619),e),n(r(4007),e),n(r(9480),e),n(r(120),e);var s=r(191);Object.defineProperty(e,"compose",{enumerable:!0,get:function(){return s.compose}}),n(r(4662),e),n(r(7864),e),n(r(3687),e),n(r(5491),e)},2619:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4007:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MANAGER_LAMBDA=void 0;e.MANAGER_LAMBDA={setDelegate:t=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"key_hash"},{string:t}]},{prim:"SOME"},{prim:"SET_DELEGATE"},{prim:"CONS"}],removeDelegate:()=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"NONE",args:[{prim:"key_hash"}]},{prim:"SET_DELEGATE"},{prim:"CONS"}],transferImplicit:(t,e)=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"key_hash"},{string:t}]},{prim:"IMPLICIT_ACCOUNT"},{prim:"PUSH",args:[{prim:"mutez"},{int:`${e}`}]},{prim:"UNIT"},{prim:"TRANSFER_TOKENS"},{prim:"CONS"}],transferToContract:(t,e)=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"address"},{string:t}]},{prim:"CONTRACT",args:[{prim:"unit"}]},[{prim:"IF_NONE",args:[[[{prim:"UNIT"},{prim:"FAILWITH"}]],[]]}],{prim:"PUSH",args:[{prim:"mutez"},{int:`${e}`}]},{prim:"UNIT"},{prim:"TRANSFER_TOKENS"},{prim:"CONS"}]}},9480:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.createProposalsOperation=e.createBallotOperation=e.createIncreasePaidStorageOperation=e.createTransferTicketOperation=e.createTxRollupBatchOperation=e.createTxRollupOriginationOperation=e.createRegisterGlobalConstantOperation=e.createRevealOperation=e.createRegisterDelegateOperation=e.createSetDelegateOperation=e.createTransferOperation=e.createOriginationOperation=void 0;const n=r(8899),s=r(6368),o=r(4593),a=r(4632),c=r(6700);e.createOriginationOperation=({code:t,init:e,balance:r="0",delegate:u,storage:h,fee:f=o.DEFAULT_FEE.ORIGINATION,gasLimit:l=o.DEFAULT_GAS_LIMIT.ORIGINATION,storageLimit:d=o.DEFAULT_STORAGE_LIMIT.ORIGINATION,mutez:p=!1})=>i(void 0,void 0,void 0,(function*(){if(void 0!==h&&void 0!==e)throw new c.OriginationParameterError("Storage and Init cannot be set a the same time. Please either use storage or init but not both.");if(!Array.isArray(t))throw new c.InvalidCodeParameter("Wrong code parameter type, expected an array",t);let i;if(void 0!==h){const e=t.find((t=>"prim"in t&&"storage"===t.prim));if(void 0===(null==e?void 0:e.args))throw new c.InvalidCodeParameter("The storage section is missing from the script",t);i=new n.Schema(e.args[0]).Encode(h)}else{if(void 0===e||"object"!=typeof e)throw new c.InvalidInitParameter("Wrong init parameter type, expected JSON Michelson",e);i=e}const o={code:t,storage:i};if(isNaN(Number(r)))throw new c.IntegerError(`Unexpected Invalid Integer ${r}`);const b={kind:s.OpKind.ORIGINATION,fee:f,gas_limit:l,storage_limit:d,balance:p?r.toString():a.format("tz","mutez",r).toString(),script:o};return u&&(b.delegate=u),b}));e.createTransferOperation=({to:t,amount:e,parameter:r,fee:n=o.DEFAULT_FEE.TRANSFER,gasLimit:c=o.DEFAULT_GAS_LIMIT.TRANSFER,storageLimit:u=o.DEFAULT_STORAGE_LIMIT.TRANSFER,mutez:h=!1})=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.TRANSACTION,fee:n,gas_limit:c,storage_limit:u,amount:h?e.toString():a.format("tz","mutez",e).toString(),destination:t,parameters:r}}));e.createSetDelegateOperation=({delegate:t,source:e,fee:r=o.DEFAULT_FEE.DELEGATION,gasLimit:n=o.DEFAULT_GAS_LIMIT.DELEGATION,storageLimit:a=o.DEFAULT_STORAGE_LIMIT.DELEGATION})=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.DELEGATION,source:e,fee:r,gas_limit:n,storage_limit:a,delegate:t}}));e.createRegisterDelegateOperation=({fee:t=o.DEFAULT_FEE.DELEGATION,gasLimit:e=o.DEFAULT_GAS_LIMIT.DELEGATION,storageLimit:r=o.DEFAULT_STORAGE_LIMIT.DELEGATION},n)=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.DELEGATION,fee:t,gas_limit:e,storage_limit:r,delegate:n}}));e.createRevealOperation=({fee:t=o.DEFAULT_FEE.REVEAL,gasLimit:e=o.DEFAULT_GAS_LIMIT.REVEAL,storageLimit:r=o.DEFAULT_STORAGE_LIMIT.REVEAL},n,a)=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.REVEAL,fee:t,public_key:a,source:n,gas_limit:e,storage_limit:r}}));e.createRegisterGlobalConstantOperation=({value:t,source:e,fee:r,gasLimit:n,storageLimit:o})=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.REGISTER_GLOBAL_CONSTANT,value:t,fee:r,gas_limit:n,storage_limit:o,source:e}}));e.createTxRollupOriginationOperation=({source:t,fee:e,gasLimit:r,storageLimit:n})=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.TX_ROLLUP_ORIGINATION,fee:e,gas_limit:r,storage_limit:n,source:t,tx_rollup_origination:{}}}));e.createTxRollupBatchOperation=({content:t,rollup:e,source:r,fee:n,gasLimit:o,storageLimit:a})=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.TX_ROLLUP_SUBMIT_BATCH,fee:n,gas_limit:o,storage_limit:a,source:r,content:t,rollup:e}}));e.createTransferTicketOperation=({ticketContents:t,ticketTy:e,ticketTicketer:r,ticketAmount:n,destination:o,entrypoint:a,source:c,fee:u,gasLimit:h,storageLimit:f})=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.TRANSFER_TICKET,fee:u,gas_limit:h,storage_limit:f,source:c,ticket_contents:t,ticket_ty:e,ticket_ticketer:r,ticket_amount:n,destination:o,entrypoint:a}}));e.createIncreasePaidStorageOperation=({source:t,fee:e,gasLimit:r,storageLimit:n,amount:o,destination:a})=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.INCREASE_PAID_STORAGE,source:t,fee:e,gas_limit:r,storage_limit:n,amount:o,destination:a}}));e.createBallotOperation=({source:t,proposal:e,ballot:r})=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.BALLOT,source:t,proposal:e,ballot:r}}));e.createProposalsOperation=({source:t,proposals:e})=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.PROPOSALS,source:t,proposals:e}}))},1151:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.RpcContractProvider=void 0;const n=r(5543),s=r(8899),o=r(6368),a=r(4632),c=r(150),u=r(9785),h=r(2026),f=r(6646),l=r(5544),d=r(2342),p=r(1846),b=r(807),g=r(1863),m=r(6700),v=r(9480),y=r(22),w=r(4632),_=r(9989),E=r(280),S=r(8983),A=r(106),O=r(3323),T=r(7279);class x extends h.OperationEmitter{constructor(t,e){super(t),this.estimator=e,this.contractProviderTypeSymbol=Symbol.for("taquito--provider-type-symbol")}getStorage(t,e){return i(this,void 0,void 0,(function*(){if(w.validateContractAddress(t)!==w.ValidationResult.VALID)throw new w.InvalidContractAddressError(t);const r=yield this.context.readProvider.getScript(t,"head");let i;return e||(e=r),i=s.Schema.isSchema(e)?e:s.Schema.fromRPCResponse({script:e}),i.Execute(r.storage,y.smartContractAbstractionSemantic(this))}))}getBigMapKey(t,e,r){return i(this,void 0,void 0,(function*(){if(w.validateContractAddress(t)!==w.ValidationResult.VALID)throw new w.InvalidContractAddressError(t);let i;r||(r=(yield this.rpc.getContract(t)).script),i=s.Schema.isSchema(r)?r:s.Schema.fromRPCResponse({script:r});const n=i.EncodeBigMapKey(e),o=yield this.rpc.getBigMapKey(t,n);return i.ExecuteOnBigMapValue(o)}))}getBigMapKeyByID(t,e,r,n){return i(this,void 0,void 0,(function*(){const{key:i,type:s}=r.EncodeBigMapKey(e),{packed:o}=yield this.context.packer.packData({data:i,type:s}),c=a.encodeExpr(o),u=n?yield this.context.readProvider.getBigMapValue({id:t.toString(),expr:c},n):yield this.context.readProvider.getBigMapValue({id:t.toString(),expr:c},"head");return r.ExecuteOnBigMapValue(u,y.smartContractAbstractionSemantic(this))}))}getBigMapKeysByID(t,e,r,n,o=5){return i(this,void 0,void 0,(function*(){const i=yield this.getBlockForRequest(e,n),a=new s.MichelsonMap;let c=0,u=[];for(;c<e.length;){const n=e.slice(c,c+o).map((e=>this.getBigMapValueOrUndefined(e,t,r,i)));u=[...u,...yield Promise.all(n)],c+=o}for(let t=0;t<u.length;t++)a.set(e[t],u[t]);return a}))}getBlockForRequest(t,e){return i(this,void 0,void 0,(function*(){return 1===t.length||void 0!==e?e:yield this.context.readProvider.getBlockLevel("head")}))}getBigMapValueOrUndefined(t,e,r,s){return i(this,void 0,void 0,(function*(){try{return yield this.getBigMapKeyByID(e,t,r,s)}catch(t){if(t instanceof n.HttpResponseError&&t.status===n.STATUS_CODE.NOT_FOUND)return;throw t}}))}getSaplingDiffByID(t,e){return i(this,void 0,void 0,(function*(){return e?yield this.context.readProvider.getSaplingDiffById({id:t.toString()},e):yield this.context.readProvider.getSaplingDiffById({id:t.toString()},"head")}))}addRevealOperationIfNeeded(t,e){return i(this,void 0,void 0,(function*(){if(b.isOpRequireReveal(t)){const r=[t],n=yield this.signer.publicKey(),s=yield this.estimator.reveal();if(s){const t={kind:o.OpKind.REVEAL},a=yield this.estimate(t,(()=>i(this,void 0,void 0,(function*(){return s}))));return r.unshift(yield v.createRevealOperation(Object.assign({},a),e,n)),r}}return t}))}originate(t){return i(this,void 0,void 0,(function*(){const e=yield this.estimate(t,this.estimator.originate.bind(this.estimator)),r=yield this.signer.publicKeyHash(),i=yield v.createOriginationOperation(yield this.context.parser.prepareCodeOrigination(Object.assign(Object.assign({},t),e))),n=yield this.addRevealOperationIfNeeded(i,r),s=yield this.prepareOperation({operation:n,source:r}),o=yield this.forge(s),{hash:a,context:c,forgedBytes:u,opResponse:h}=yield this.signAndInject(o);return new f.OriginationOperation(a,i,u,h,c,this)}))}setDelegate(t){return i(this,void 0,void 0,(function*(){if(t.source&&w.validateAddress(t.source)!==w.ValidationResult.VALID)throw new w.InvalidAddressError(t.source);if(t.delegate&&w.validateAddress(t.delegate)!==w.ValidationResult.VALID)throw new w.InvalidAddressError(t.delegate);if(/kt1/i.test(t.source))throw new m.InvalidDelegationSource(t.source);const e=yield this.estimate(t,this.estimator.setDelegate.bind(this.estimator)),r=yield this.signer.publicKeyHash(),i=yield v.createSetDelegateOperation(Object.assign(Object.assign({},t),e)),n=t.source||r,s=yield this.addRevealOperationIfNeeded(i,r),o=yield this.prepareOperation({operation:s,source:n}),a=yield this.forge(o),{hash:c,context:h,forgedBytes:f,opResponse:l}=yield this.signAndInject(a);return new u.DelegateOperation(c,i,n,f,l,h)}))}registerDelegate(t){return i(this,void 0,void 0,(function*(){const e=yield this.estimate(t,this.estimator.registerDelegate.bind(this.estimator)),r=yield this.signer.publicKeyHash(),i=yield v.createRegisterDelegateOperation(Object.assign(Object.assign({},t),e),r),n=yield this.addRevealOperationIfNeeded(i,r),s=yield this.prepareOperation({operation:n}),o=yield this.forge(s),{hash:a,context:c,forgedBytes:h,opResponse:f}=yield this.signAndInject(o);return new u.DelegateOperation(a,i,r,h,f,c)}))}transfer(t){return i(this,void 0,void 0,(function*(){if(w.validateAddress(t.to)!==w.ValidationResult.VALID)throw new w.InvalidAddressError(t.to);if(t.source&&w.validateAddress(t.source)!==w.ValidationResult.VALID)throw new w.InvalidAddressError(t.source);const e=yield this.signer.publicKeyHash(),r=yield this.estimate(t,this.estimator.transfer.bind(this.estimator)),i=yield v.createTransferOperation(Object.assign(Object.assign({},t),r)),n=t.source||e,s=yield this.addRevealOperationIfNeeded(i,e),o=yield this.prepareOperation({operation:s,source:t.source}),a=yield this.forge(o),{hash:c,context:u,forgedBytes:h,opResponse:f}=yield this.signAndInject(a);return new p.TransactionOperation(c,i,n,h,f,u)}))}transferTicket(t){var e;return i(this,void 0,void 0,(function*(){if(w.validateContractAddress(t.destination)!==w.ValidationResult.VALID)throw new w.InvalidContractAddressError(t.destination);if(t.source&&w.validateAddress(t.source)!==w.ValidationResult.VALID)throw new w.InvalidAddressError(t.source);const r=yield this.signer.publicKeyHash(),i=yield this.estimate(t,this.estimator.transferTicket.bind(this.estimator)),n=yield v.createTransferTicketOperation(Object.assign(Object.assign({},t),i)),s=null!==(e=t.source)&&void 0!==e?e:r,o=yield this.addRevealOperationIfNeeded(n,r),a=yield this.prepareOperation({operation:o,source:t.source}),c=yield this.forge(a),{hash:u,context:h,forgedBytes:f,opResponse:l}=yield this.signAndInject(c);return new S.TransferTicketOperation(u,n,s,f,l,h)}))}reveal(t){return i(this,void 0,void 0,(function*(){const e=yield this.signer.publicKeyHash(),r=yield this.estimator.reveal(t);if(r){const n=yield this.estimate(t,(()=>i(this,void 0,void 0,(function*(){return r})))),s=yield v.createRevealOperation(Object.assign({},n),e,yield this.signer.publicKey()),o=yield this.prepareOperation({operation:s,source:e}),a=yield this.forge(o),{hash:c,context:u,forgedBytes:h,opResponse:f}=yield this.signAndInject(a);return new d.RevealOperation(c,s,e,h,f,u)}throw new m.RevealOperationError(`The publicKeyHash '${e}' has already been revealed.`)}))}registerGlobalConstant(t){return i(this,void 0,void 0,(function*(){const e=yield this.signer.publicKeyHash(),r=yield this.estimate(t,this.estimator.registerGlobalConstant.bind(this.estimator)),i=yield v.createRegisterGlobalConstantOperation(Object.assign(Object.assign({},t),r)),n=yield this.addRevealOperationIfNeeded(i,e),s=yield this.prepareOperation({operation:n,source:e}),o=yield this.forge(s),{hash:a,context:c,forgedBytes:u,opResponse:h}=yield this.signAndInject(o);return new l.RegisterGlobalConstantOperation(a,i,e,u,h,c)}))}increasePaidStorage(t){return i(this,void 0,void 0,(function*(){const e=yield this.signer.publicKeyHash(),r=yield this.estimate(t,this.estimator.increasePaidStorage.bind(this.estimator)),i=yield v.createIncreasePaidStorageOperation(Object.assign(Object.assign({},t),r)),n=yield this.addRevealOperationIfNeeded(i,e),s=yield this.prepareOperation({operation:n,source:e}),o=yield this.forge(s),{hash:a,context:c,forgedBytes:u,opResponse:h}=yield this.signAndInject(o);return new A.IncreasePaidStorageOperation(a,i,e,u,h,c)}))}txRollupOriginate(t){return i(this,void 0,void 0,(function*(){const e=yield this.signer.publicKeyHash(),r=yield this.estimate(t||{},this.estimator.txRollupOriginate.bind(this.estimator)),i=yield v.createTxRollupOriginationOperation(Object.assign(Object.assign({},t),r)),n=yield this.addRevealOperationIfNeeded(i,e),s=yield this.prepareOperation({operation:n,source:e}),o=yield this.forge(s),{hash:a,context:c,forgedBytes:u,opResponse:h}=yield this.signAndInject(o);return new _.TxRollupOriginationOperation(a,i,e,u,h,c)}))}txRollupSubmitBatch(t){return i(this,void 0,void 0,(function*(){const e=yield this.signer.publicKeyHash(),r=yield this.estimate(t,this.estimator.txRollupSubmitBatch.bind(this.estimator)),i=yield v.createTxRollupBatchOperation(Object.assign(Object.assign({},t),r)),n=yield this.addRevealOperationIfNeeded(i,e),s=yield this.prepareOperation({operation:n,source:e}),o=yield this.forge(s),{hash:a,context:c,forgedBytes:u,opResponse:h}=yield this.signAndInject(o);return new E.TxRollupBatchOperation(a,i,e,u,h,c)}))}ballot(t){var e;return i(this,void 0,void 0,(function*(){const r=yield this.signer.publicKeyHash();if(t.source&&w.validateAddress(t.source)!==w.ValidationResult.VALID)throw new w.InvalidAddressError(t.source);const i=null!==(e=t.source)&&void 0!==e?e:r,n=yield v.createBallotOperation(Object.assign(Object.assign({},t),{source:i})),s=yield this.prepareOperation({operation:n,source:i}),o=yield this.forge(s),{hash:a,context:c,forgedBytes:u,opResponse:h}=yield this.signAndInject(o);return new O.BallotOperation(a,n,r,u,h,c)}))}proposals(t){var e;return i(this,void 0,void 0,(function*(){const r=yield this.signer.publicKeyHash();if(t.source&&w.validateAddress(t.source)!==w.ValidationResult.VALID)throw new w.InvalidAddressError(t.source);const i=null!==(e=t.source)&&void 0!==e?e:r,n=yield v.createProposalsOperation(Object.assign(Object.assign({},t),{source:i})),s=yield this.prepareOperation({operation:n,source:i}),o=yield this.forge(s),{hash:a,context:c,forgedBytes:u,opResponse:h}=yield this.signAndInject(o);return new T.ProposalsOperation(a,n,r,u,h,c)}))}at(t,e=(t=>t)){return i(this,void 0,void 0,(function*(){if(w.validateContractAddress(t)!==w.ValidationResult.VALID)throw new w.InvalidContractAddressError(t);const r=this.context.withExtensions().rpc,i=this.context.withExtensions().readProvider,n=yield i.getScript(t,"head"),s=yield i.getEntrypoints(t),o=new g.ContractAbstraction(t,n,this,this,s,r,i);return e(o,this.context)}))}batch(t){const e=new c.OperationBatch(this.context,this.estimator);return Array.isArray(t)&&e.with(t),e}}e.RpcContractProvider=x},5491:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.SaplingStateAbstraction=void 0;e.SaplingStateAbstraction=class{constructor(t,e){this.id=t,this.provider=e}getSaplingDiff(t){return r(this,void 0,void 0,(function*(){return this.provider.getSaplingDiffByID(this.id.toString(),t)}))}getId(){return this.id.toString()}}},22:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.smartContractAbstractionSemantic=void 0;const i=r(8899),n=r(5225),s=r(6391),o=r(5491);e.smartContractAbstractionSemantic=t=>({big_map:(e,r)=>{if(e&&"int"in e&&void 0!==e.int){const o=new i.Schema(r);return new n.BigMapAbstraction(new s.default(e.int),o,t)}return{}},sapling_state:e=>e&&"int"in e&&void 0!==e.int?new o.SaplingStateAbstraction(new s.default(e.int),t):{}})},120:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VIEW_LAMBDA=void 0;e.VIEW_LAMBDA={code:[{prim:"parameter",args:[{prim:"lambda",args:[{prim:"unit"},{prim:"pair",args:[{prim:"list",args:[{prim:"operation"}]},{prim:"unit"}]}]}]},{prim:"storage",args:[{prim:"unit"}]},{prim:"code",args:[[{prim:"CAR"},{prim:"UNIT"},{prim:"EXEC"}]]}],storage:"Unit"}},3010:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RPCResponseError=e.InvalidFilterExpressionError=e.ConfirmationUndefinedError=e.InvalidConfirmationCountError=void 0;class r extends Error{constructor(t){super(t),this.message=t,this.name="InvalidConfirmationCountError"}}e.InvalidConfirmationCountError=r;class i extends Error{constructor(t){super(t),this.message=t,this.name="ConfirmationUndefinedError"}}e.ConfirmationUndefinedError=i;class n extends Error{constructor(t){super(t),this.message=t,this.name="InvalidFilterExpressionError"}}e.InvalidFilterExpressionError=n;class s extends Error{constructor(t){super(t),this.message=t,this.name="RPCResponseError"}}e.RPCResponseError=s},2382:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RevealEstimateError=void 0;class r extends Error{constructor(){super("Unable to estimate the reveal operation, the public key is unknown"),this.name="Reveal Estimate Error"}}e.RevealEstimateError=r},1243:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4705:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Estimate=void 0;const r=100;class i{constructor(t,e,r,i,n=100){this._milligasLimit=t,this._storageLimit=e,this.opSize=r,this.minimalFeePerStorageByteMutez=i,this.baseFeeMutez=n}get burnFeeMutez(){return this.roundUp(Number(this.storageLimit)*Number(this.minimalFeePerStorageByteMutez))}get storageLimit(){const t=Math.max(Number(this._storageLimit),0);return t>0?t:0}get gasLimit(){return this.roundUp(Number(this._milligasLimit)/1e3+100)}get operationFeeMutez(){return.1*(Number(this._milligasLimit)/1e3+100)+1*Number(this.opSize)}roundUp(t){return Math.ceil(Number(t))}get minimalFeeMutez(){return this.roundUp(r+this.operationFeeMutez)}get suggestedFeeMutez(){return this.roundUp(this.operationFeeMutez+200)}get usingBaseFeeMutez(){return Math.max(Number(this.baseFeeMutez),r)+this.roundUp(this.operationFeeMutez)}get totalCost(){return this.minimalFeeMutez+this.burnFeeMutez}get consumedMilligas(){return Number(this._milligasLimit)}static createEstimateInstanceFromProperties(t){let e,r=0,n=0,s=0,o=0;return t.forEach((t=>{r+=t.milligasLimit,n+=t.storageLimit,s+=t.opSize,o=Math.max(t.minimalFeePerStorageByteMutez,o),t.baseFeeMutez&&(e=e?e+t.baseFeeMutez:t.baseFeeMutez)})),new i(r,n,s,o,e)}static createArrayEstimateInstancesFromProperties(t){return t.map((t=>new i(t.milligasLimit,t.storageLimit,t.opSize,t.minimalFeePerStorageByteMutez,t.baseFeeMutez)))}}e.Estimate=i},8794:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4705),e),n(r(1243),e),n(r(4782),e),n(r(2382),e)},4782:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))},n=this&&this.__rest||function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r};Object.defineProperty(e,"__esModule",{value:!0}),e.RPCEstimateProvider=void 0;const s=r(6368),o=r(6391),a=r(4593),c=r(2026),u=r(8974),h=r(807),f=r(4705),l=r(9480),d=r(4632),p=r(2382),b=(t,e)=>({fee:void 0===t.fee?e.fee:t.fee,gasLimit:void 0===t.gasLimit?e.gasLimit:t.gasLimit,storageLimit:void 0===t.storageLimit?e.storageLimit:t.storageLimit});class g extends c.OperationEmitter{constructor(){super(...arguments),this.ALLOCATION_STORAGE=257,this.ORIGINATION_STORAGE=257,this.OP_SIZE_REVEAL=128}getKeys(){return i(this,void 0,void 0,(function*(){const t=this.context.isAnySignerConfigured();return{publicKeyHash:t?yield this.signer.publicKeyHash():yield this.context.walletProvider.getPKH(),publicKey:t?yield this.signer.publicKey():void 0}}))}getAccountLimits(t,e,r){return i(this,void 0,void 0,(function*(){const i=yield this.context.readProvider.getBalance(t,"head"),{hard_gas_limit_per_operation:n,hard_gas_limit_per_block:s,hard_storage_limit_per_operation:a,cost_per_byte:c}=e;return{fee:0,gasLimit:r?Math.floor(this.ajustGasForBatchOperation(s,n,r).toNumber()):n.toNumber(),storageLimit:Math.floor(o.default.min(i.dividedBy(c),a).toNumber())}}))}ajustGasForBatchOperation(t,e,r){return o.default.min(e,t.div(r+1))}getEstimationPropertiesFromOperationContent(t,e,r,i){const n=u.flattenOperationResult({contents:[t]});let s=0,o=0;return n.forEach((t=>{o+="originated_contracts"in t&&void 0!==t.originated_contracts?t.originated_contracts.length*this.ORIGINATION_STORAGE:0,o+="allocated_destination_contract"in t?this.ALLOCATION_STORAGE:0,s+=Number(t.consumed_milligas)||0,o+="paid_storage_size_diff"in t&&Number(t.paid_storage_size_diff)||0,o+="storage_size"in t&&"global_address"in t&&Number(t.storage_size)||0,o+="originated_rollup"in t?i:0})),h.isOpWithFee(t)?{milligasLimit:s||0,storageLimit:Number(o||0),opSize:e,minimalFeePerStorageByteMutez:r.toNumber()}:{milligasLimit:0,storageLimit:0,opSize:e,minimalFeePerStorageByteMutez:r.toNumber(),baseFeeMutez:0}}prepareEstimate(t,e,r){return i(this,void 0,void 0,(function*(){const i=yield this.prepareOperation(t,r),{opbytes:n,opOb:{branch:s,contents:o}}=yield this.forge(i),a={operation:{branch:s,contents:o,signature:"edsigtkpiSSschcaCt9pUVrpNPf7TTcgvgDEDD6NCEHMy8NNQJCGnMfLZzYoQj74yLjo9wx6MPVV29CvVzgi7qEcEUok3k7AuMg"},chain_id:yield this.context.readProvider.getChainId()},{opResponse:c}=yield this.simulate(a),{cost_per_byte:h,tx_rollup_origination_size:f}=e,l=[...u.flattenErrors(c,"backtracked"),...u.flattenErrors(c)];if(l.length)throw new u.TezosOperationError(l,"Error occurred during estimation");let d=1;return Array.isArray(t.operation)&&t.operation.length>1&&(d="reveal"===c.contents[0].kind?t.operation.length-1:t.operation.length),c.contents.map((t=>this.getEstimationPropertiesFromOperationContent(t,"reveal"===t.kind?this.OP_SIZE_REVEAL/2:n.length/2/d,h,null!=f?f:0)))}))}originate(t){var{fee:e,storageLimit:r,gasLimit:s}=t,o=n(t,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{publicKeyHash:t}=yield this.getKeys(),i=yield this.context.readProvider.getProtocolConstants("head"),n=yield this.getAccountLimits(t,i),a=yield l.createOriginationOperation(yield this.context.parser.prepareCodeOrigination(Object.assign(Object.assign({},o),b({fee:e,storageLimit:r,gasLimit:s},n)))),c=yield this.isRevealOpNeeded([a],t),u=c?yield this.addRevealOp([a],t):a,h=yield this.prepareEstimate({operation:u,source:t},i,t);return c&&h.shift(),f.Estimate.createEstimateInstanceFromProperties(h)}))}transfer(t){var{fee:e,storageLimit:r,gasLimit:s}=t,o=n(t,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){if(d.validateAddress(o.to)!==d.ValidationResult.VALID)throw new d.InvalidAddressError(o.to);if(o.source&&d.validateAddress(o.source)!==d.ValidationResult.VALID)throw new d.InvalidAddressError(o.source);const t=(yield this.getKeys()).publicKeyHash,i=yield this.context.readProvider.getProtocolConstants("head"),n=yield this.getAccountLimits(t,i),a=yield l.createTransferOperation(Object.assign(Object.assign({},o),b({fee:e,storageLimit:r,gasLimit:s},n))),c=yield this.isRevealOpNeeded([a],t),u=c?yield this.addRevealOp([a],t):a,h=yield this.prepareEstimate({operation:u,source:t},i,t);return c&&h.shift(),f.Estimate.createEstimateInstanceFromProperties(h)}))}transferTicket(t){var e,{fee:r,storageLimit:s,gasLimit:o}=t,a=n(t,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){if(d.validateContractAddress(a.destination)!==d.ValidationResult.VALID)throw new d.InvalidContractAddressError(a.destination);if(a.source&&d.validateAddress(a.source)!==d.ValidationResult.VALID)throw new d.InvalidAddressError(null!==(e=a.source)&&void 0!==e?e:"");const t=(yield this.getKeys()).publicKeyHash,i=yield this.context.readProvider.getProtocolConstants("head"),n=yield this.getAccountLimits(t,i),c=yield l.createTransferTicketOperation(Object.assign(Object.assign({},a),b({fee:r,storageLimit:s,gasLimit:o},n))),u=yield this.isRevealOpNeeded([c],t),h=u?yield this.addRevealOp([c],t):c,p=yield this.prepareEstimate({operation:h,source:t},i,t);return u&&p.shift(),f.Estimate.createEstimateInstanceFromProperties(p)}))}setDelegate(t){var{fee:e,gasLimit:r,storageLimit:s}=t,o=n(t,["fee","gasLimit","storageLimit"]);return i(this,void 0,void 0,(function*(){if(o.source&&d.validateAddress(o.source)!==d.ValidationResult.VALID)throw new d.InvalidAddressError(o.source);if(o.delegate&&d.validateAddress(o.delegate)!==d.ValidationResult.VALID)throw new d.InvalidAddressError(o.delegate);const t=(yield this.getKeys()).publicKeyHash,i=o.source||t,n=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(i,n),c=yield l.createSetDelegateOperation(Object.assign(Object.assign({},o),b({fee:e,storageLimit:s,gasLimit:r},a))),u=yield this.isRevealOpNeeded([c],t),h=u?yield this.addRevealOp([c],t):c,p=yield this.prepareEstimate({operation:h,source:t},n,t);return u&&p.shift(),f.Estimate.createEstimateInstanceFromProperties(p)}))}batch(t){return i(this,void 0,void 0,(function*(){const{publicKeyHash:e}=yield this.getKeys();let r=[];const i=yield this.context.readProvider.getProtocolConstants("head"),n=yield this.getAccountLimits(e,i,t.length);for(const e of t)switch(e.kind){case s.OpKind.TRANSACTION:r.push(yield l.createTransferOperation(Object.assign(Object.assign({},e),b(e,n))));break;case s.OpKind.ORIGINATION:r.push(yield l.createOriginationOperation(yield this.context.parser.prepareCodeOrigination(Object.assign(Object.assign({},e),b(e,n)))));break;case s.OpKind.DELEGATION:r.push(yield l.createSetDelegateOperation(Object.assign(Object.assign({},e),b(e,n))));break;case s.OpKind.ACTIVATION:r.push(Object.assign(Object.assign({},e),n));break;case s.OpKind.REGISTER_GLOBAL_CONSTANT:r.push(yield l.createRegisterGlobalConstantOperation(Object.assign(Object.assign({},e),b(e,n))));break;case s.OpKind.TX_ROLLUP_ORIGINATION:r.push(yield l.createTxRollupOriginationOperation(Object.assign(Object.assign({},e),b(e,n))));break;case s.OpKind.TX_ROLLUP_SUBMIT_BATCH:r.push(yield l.createTxRollupBatchOperation(Object.assign(Object.assign({},e),b(e,n))));break;case s.OpKind.TRANSFER_TICKET:r.push(yield l.createTransferTicketOperation(Object.assign(Object.assign({},e),b(e,n))));break;case s.OpKind.INCREASE_PAID_STORAGE:r.push(yield l.createIncreasePaidStorageOperation(Object.assign(Object.assign({},e),b(e,n))));break;default:throw new d.InvalidOperationKindError(t.kind)}r=(yield this.isRevealOpNeeded(r,e))?yield this.addRevealOp(r,e):r;const o=yield this.prepareEstimate({operation:r,source:e},i,e);return f.Estimate.createArrayEstimateInstancesFromProperties(o)}))}registerDelegate(t){return i(this,void 0,void 0,(function*(){const e=(yield this.getKeys()).publicKeyHash,r=yield this.context.readProvider.getProtocolConstants("head"),i=yield this.getAccountLimits(e,r),n=yield l.createRegisterDelegateOperation(Object.assign(Object.assign({},t),i),e),s=yield this.isRevealOpNeeded([n],e),o=s?yield this.addRevealOp([n],e):n,a=yield this.prepareEstimate({operation:o,source:e},r,e);return s&&a.shift(),f.Estimate.createEstimateInstanceFromProperties(a)}))}reveal(t){return i(this,void 0,void 0,(function*(){const{publicKeyHash:e,publicKey:r}=yield this.getKeys();if(!r)throw new p.RevealEstimateError;if(yield this.isAccountRevealRequired(e)){const i=yield this.context.readProvider.getProtocolConstants("head"),n=yield this.getAccountLimits(e,i),s=yield l.createRevealOperation(Object.assign(Object.assign({},t),n),e,r),o=yield this.prepareEstimate({operation:s,source:e},i,e);return f.Estimate.createEstimateInstanceFromProperties(o)}}))}registerGlobalConstant(t){var{fee:e,storageLimit:r,gasLimit:s}=t,o=n(t,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const t=(yield this.getKeys()).publicKeyHash,i=yield this.context.readProvider.getProtocolConstants("head"),n=yield this.getAccountLimits(t,i),a=yield l.createRegisterGlobalConstantOperation(Object.assign(Object.assign({},o),b({fee:e,storageLimit:r,gasLimit:s},n))),c=yield this.isRevealOpNeeded([a],t),u=c?yield this.addRevealOp([a],t):a,h=yield this.prepareEstimate({operation:u,source:t},i,t);return c&&h.shift(),f.Estimate.createEstimateInstanceFromProperties(h)}))}increasePaidStorage(t){return i(this,void 0,void 0,(function*(){const{fee:e,storageLimit:r,gasLimit:i}=t,s=n(t,["fee","storageLimit","gasLimit"]),o=(yield this.getKeys()).publicKeyHash,a=yield this.context.readProvider.getProtocolConstants("head"),c=yield this.getAccountLimits(o,a),u=yield l.createIncreasePaidStorageOperation(Object.assign(Object.assign({},s),b({fee:e,storageLimit:r,gasLimit:i},c))),h=yield this.isRevealOpNeeded([u],o),d=h?yield this.addRevealOp([u],o):u,p=yield this.prepareEstimate({operation:d,source:o},a,o);return h&&p.shift(),f.Estimate.createEstimateInstanceFromProperties(p)}))}txRollupOriginate(t){return i(this,void 0,void 0,(function*(){t=t||{};const{fee:e,storageLimit:r,gasLimit:i}=t,s=n(t,["fee","storageLimit","gasLimit"]),o=(yield this.getKeys()).publicKeyHash,a=yield this.context.readProvider.getProtocolConstants("head"),c=yield this.getAccountLimits(o,a),u=yield l.createTxRollupOriginationOperation(Object.assign(Object.assign({},s),b({fee:e,storageLimit:r,gasLimit:i},c))),h=yield this.isRevealOpNeeded([u],o),d=h?yield this.addRevealOp([u],o):u,p=yield this.prepareEstimate({operation:d,source:o},a,o);return h&&p.shift(),f.Estimate.createEstimateInstanceFromProperties(p)}))}txRollupSubmitBatch(t){return i(this,void 0,void 0,(function*(){const{fee:e,storageLimit:r,gasLimit:i}=t,s=n(t,["fee","storageLimit","gasLimit"]),o=(yield this.getKeys()).publicKeyHash,a=yield this.context.readProvider.getProtocolConstants("head"),c=yield this.getAccountLimits(o,a),u=yield l.createTxRollupBatchOperation(Object.assign(Object.assign({},s),b({fee:e,storageLimit:r,gasLimit:i},c))),h=yield this.isRevealOpNeeded([u],o),d=h?yield this.addRevealOp([u],o):u,p=yield this.prepareEstimate({operation:d,source:o},a,o);return h&&p.shift(),f.Estimate.createEstimateInstanceFromProperties(p)}))}addRevealOp(t,e){return i(this,void 0,void 0,(function*(){const{publicKey:r}=yield this.getKeys();if(!r)throw new p.RevealEstimateError;return t.unshift(yield l.createRevealOperation(Object.assign({fee:a.DEFAULT_FEE.REVEAL,gasLimit:a.DEFAULT_GAS_LIMIT.REVEAL,storageLimit:a.DEFAULT_STORAGE_LIMIT.REVEAL}),e,yield this.signer.publicKey())),t}))}}e.RPCEstimateProvider=g},7336:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.CompositeForger=e.UnspecifiedForgerError=e.ForgingMismatchError=void 0;class i extends Error{constructor(t){super("Forging mismatch error"),this.results=t,this.name="ForgingMismatchError"}}e.ForgingMismatchError=i;class n extends Error{constructor(){super("At least one forger must be specified"),this.name="UnspecifiedForgerError"}}e.UnspecifiedForgerError=n;e.CompositeForger=class{constructor(t){if(this.forgers=t,0===t.length)throw new n}forge({branch:t,contents:e}){return r(this,void 0,void 0,(function*(){const r=yield Promise.all(this.forgers.map((r=>r.forge({branch:t,contents:e}))));if(0===r.length)throw new n;let s=r.pop();for(;r.length;){const t=r.pop();if(t!==s)throw new i([s,t]);s=t}return s}))}}},794:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RpcForger=void 0;e.RpcForger=class{constructor(t){this.context=t}forge({branch:t,contents:e}){return this.context.rpc.forgeOperations({branch:t,contents:e})}}},6713:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.TaquitoLocalForger=void 0;const n=r(5078);e.TaquitoLocalForger=class{constructor(t){this.context=t}getNextProto(){return i(this,void 0,void 0,(function*(){if(!this.context.proto){const t=yield this.context.readProvider.getNextProtocol("head");this.context.proto=t}return this.context.proto}))}forge({branch:t,contents:e}){return i(this,void 0,void 0,(function*(){return new n.LocalForger(yield this.getNextProto()).forge({branch:t,contents:e})}))}}},5505:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultGlobalConstantsProvider=void 0;const n=r(1452);e.DefaultGlobalConstantsProvider=class{constructor(){this._globalConstantsLibrary={}}loadGlobalConstant(t){for(const e in t)Object.assign(this._globalConstantsLibrary,{[e]:t[e]})}getGlobalConstantByHash(t){return i(this,void 0,void 0,(function*(){const e=this._globalConstantsLibrary[t];if(!e)throw new n.GlobalConstantNotFound(t);return e}))}}},1452:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UnconfiguredGlobalConstantsProviderError=e.GlobalConstantNotFound=void 0;class r extends Error{constructor(t){super(`Please load the value associated with the constant ${t} using the loadGlobalConstant method of the DefaultGlobalConstantsProvider.`),this.hash=t,this.name="GlobalConstantNotFound"}}e.GlobalConstantNotFound=r;class i extends Error{constructor(){super("No global constants provider has been configured. Please configure one by calling setGlobalConstantsProvider({globalConstantsProvider}) on your TezosToolkit instance."),this.name="UnconfiguredGlobalConstantsProviderError"}}e.UnconfiguredGlobalConstantsProviderError=i},3171:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},9494:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.NoopGlobalConstantsProvider=void 0;const n=r(1452);e.NoopGlobalConstantsProvider=class{getGlobalConstantByHash(t){return i(this,void 0,void 0,(function*(){throw new n.UnconfiguredGlobalConstantsProviderError}))}}},5180:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.formatErrorMessage=void 0;const i=r(5543);e.formatErrorMessage=function(t,e){const r=JSON.parse(t.body);if(r[0]&&r[0].kind&&r[0].msg){const n=JSON.stringify({kind:r[0].kind,id:r[0].id,msg:r[0].msg.replace(e,"")});return new i.HttpResponseError(`Http error response: (${t.status}) ${n}`,t.status,t.statusText,n,t.url)}return t}},5744:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.RpcInjector=void 0;const n=r(5180),s=r(5543);e.RpcInjector=class{constructor(t){this.context=t}inject(t){return i(this,void 0,void 0,(function*(){let e;try{e=yield this.context.rpc.injectOperation(t)}catch(t){const e=". You may want to use --replace to provide adequate fee and replace it";throw t instanceof s.HttpResponseError&&t.message.includes(e)?n.formatErrorMessage(t,e):t}return e}))}}},3729:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BallotOperation=void 0;const i=r(8361);class n extends i.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"ballot"===t.kind));return t||void 0}get period(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.period}get proposal(){return this.params.proposal}get ballot(){return this.params.ballot}}e.BallotOperation=n},3650:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BatchOperation=void 0;const i=r(6391),n=r(150),s=r(8974),o=r(8361),a=r(807);class c extends o.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r}sumProp(t,e){return t.reduce(((t,r)=>e in r?Number(r[e])+t:t),0)}getOriginatedContractAddresses(){const t=this.results.filter((t=>"origination"===t.kind));let e=[];for(const r of t)r.metadata.operation_result.originated_contracts&&(e=[...e,...r.metadata.operation_result.originated_contracts]);return e}get status(){return this.results.filter((t=>-1!==n.BATCH_KINDS.indexOf(t.kind))).map((t=>a.hasMetadataWithResult(t)?t.metadata.operation_result.status:"unknown"))[0]||"unknown"}get fee(){return this.sumProp(this.params,"fee")}get gasLimit(){return this.sumProp(this.params,"gas_limit")}get storageLimit(){return this.sumProp(this.params,"storage_limit")}get consumedGas(){return i.default.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.default.ROUND_UP}),new i.default(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp(s.flattenOperationResult({contents:this.results}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp(s.flattenOperationResult({contents:this.results}),"paid_storage_size_diff"))}get errors(){return s.flattenErrors({contents:this.results})}}e.BatchOperation=c},9785:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DelegateOperation=void 0;const i=r(6391),n=r(8361);class s extends n.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"delegation"===t.kind)),e=t&&t.metadata&&t.metadata.operation_result;return e||void 0}get status(){var t,e;return null!==(e=null===(t=this.operationResults)||void 0===t?void 0:t.status)&&void 0!==e?e:"unknown"}get delegate(){return this.params.delegate}get isRegisterOperation(){return this.delegate===this.source}get fee(){return this.params.fee}get gasLimit(){return this.params.gas_limit}get storageLimit(){return this.params.storage_limit}get consumedGas(){return i.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.BigNumber.ROUND_UP}),this.consumedMilliGas?new i.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.consumed_milligas}get errors(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.errors}}e.DelegateOperation=s},106:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IncreasePaidStorageOperation=void 0;const i=r(8361);class n extends i.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"increase_paid_storage"===t.kind)),e=t&&t.metadata&&t.metadata.operation_result;return e||void 0}get status(){var t,e;return null!==(e=null===(t=this.operationResults)||void 0===t?void 0:t.status)&&void 0!==e?e:"unknown"}get fee(){return this.params.fee}get gasLimit(){return this.params.gas_limit}get storageLimit(){return this.params.storage_limit}get errors(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.errors}get consumedMilliGas(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.consumed_milligas}get amount(){return this.params.amount}get destination(){return this.params.destination}}e.IncreasePaidStorageOperation=n},3323:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Operation=e.BallotOperation=e.TransactionOperation=e.OriginationOperation=e.DelegateOperation=e.BatchOperation=e.TezosPreapplyFailureError=e.TezosOperationError=e.OpKind=void 0;var i=r(807);Object.defineProperty(e,"OpKind",{enumerable:!0,get:function(){return i.OpKind}});var n=r(8974);Object.defineProperty(e,"TezosOperationError",{enumerable:!0,get:function(){return n.TezosOperationError}}),Object.defineProperty(e,"TezosPreapplyFailureError",{enumerable:!0,get:function(){return n.TezosPreapplyFailureError}});var s=r(3650);Object.defineProperty(e,"BatchOperation",{enumerable:!0,get:function(){return s.BatchOperation}});var o=r(9785);Object.defineProperty(e,"DelegateOperation",{enumerable:!0,get:function(){return o.DelegateOperation}});var a=r(6646);Object.defineProperty(e,"OriginationOperation",{enumerable:!0,get:function(){return a.OriginationOperation}});var c=r(1846);Object.defineProperty(e,"TransactionOperation",{enumerable:!0,get:function(){return c.TransactionOperation}});var u=r(3729);Object.defineProperty(e,"BallotOperation",{enumerable:!0,get:function(){return u.BallotOperation}});var h=r(8361);Object.defineProperty(e,"Operation",{enumerable:!0,get:function(){return h.Operation}})},2026:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))},n=this&&this.__rest||function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r};Object.defineProperty(e,"__esModule",{value:!0}),e.OperationEmitter=void 0;const s=r(6368),o=r(4593),a=r(3010),c=r(8974),u=r(4632),h=r(807);e.OperationEmitter=class{constructor(t){this.context=t}get rpc(){return this.context.rpc}get signer(){return this.context.signer}isRevealOpNeeded(t,e){return i(this,void 0,void 0,(function*(){return!(!(yield this.isAccountRevealRequired(e))||!this.isRevealRequiredForOpType(t))}))}isAccountRevealRequired(t){return i(this,void 0,void 0,(function*(){return!(yield this.context.readProvider.isAccountRevealed(t,"head"))}))}isRevealRequiredForOpType(t){let e=!1;for(const r of t)h.isOpRequireReveal(r)&&(e=!0);return e}prepareOperation({operation:t,source:e},r){return i(this,void 0,void 0,(function*(){const n={};let c=[];const f=this.context.readProvider.getBlockHash("head~2"),l=this.context.readProvider.getNextProtocol("head");c=Array.isArray(t)?[...t]:[t];const d=r||(yield this.signer.publicKeyHash());let p=Promise.resolve(void 0),b=Promise.resolve(void 0);c.find((t=>i(this,void 0,void 0,(function*(){if("ballot"===t.kind||"proposals"===t.kind)try{b=this.rpc.getCurrentPeriod()}catch(t){throw new a.RPCResponseError(`Failed to get the current voting period index: ${JSON.stringify(t)}`)}}))));for(let t=0;t<c.length;t++)if(h.isOpRequireReveal(c[t])||"reveal"===c[t].kind){p=this.context.readProvider.getCounter(d,"head");break}const[g,m,v,y]=yield Promise.all([f,l,p,b]),w=parseInt(v||"0",10);(!n[d]||n[d]<w)&&(n[d]=w);const _=t=>({counter:`${++n[d]}`,fee:void 0===t.fee?"0":`${t.fee}`,gas_limit:void 0===t.gas_limit?"0":`${t.gas_limit}`,storage_limit:void 0===t.storage_limit?"0":`${t.storage_limit}`}),E=t=>({source:void 0===t.source?e||d:t.source});return{opOb:{branch:g,contents:c.map((t=>{switch(t.kind){case s.OpKind.ACTIVATION:return Object.assign({},t);case s.OpKind.ORIGINATION:return Object.assign(Object.assign(Object.assign(Object.assign({},t),{balance:void 0!==t.balance?`${t.balance}`:"0"}),E(t)),_(t));case s.OpKind.TRANSACTION:{const e=Object.assign(Object.assign(Object.assign(Object.assign({},t),{amount:void 0!==t.amount?`${t.amount}`:"0"}),E(t)),_(t));if(e.source.toLowerCase().startsWith("kt1"))throw new u.DeprecationError(`KT1 addresses are not supported as source since ${o.Protocols.PsBabyM1}`);return e}case s.OpKind.REVEAL:case s.OpKind.DELEGATION:case s.OpKind.REGISTER_GLOBAL_CONSTANT:case s.OpKind.TX_ROLLUP_ORIGINATION:case s.OpKind.TX_ROLLUP_SUBMIT_BATCH:return Object.assign(Object.assign(Object.assign({},t),E(t)),_(t));case s.OpKind.TRANSFER_TICKET:return Object.assign(Object.assign(Object.assign(Object.assign({},t),{ticket_amount:`${t.ticket_amount}`}),E(t)),_(t));case s.OpKind.INCREASE_PAID_STORAGE:return Object.assign(Object.assign(Object.assign(Object.assign({},t),{amount:`${t.amount}`}),E(t)),_(t));case s.OpKind.BALLOT:case s.OpKind.PROPOSALS:if(void 0===y)throw new a.RPCResponseError("Failed to get the current voting period index");return Object.assign(Object.assign({},t),{period:null==y?void 0:y.voting_period.index});default:throw new u.InvalidOperationKindError(t.kind)}})),protocol:m},counter:w}}))}forge({opOb:{branch:t,contents:e,protocol:r},counter:n}){return i(this,void 0,void 0,(function*(){return{opbytes:yield this.context.forger.forge({branch:t,contents:e}),opOb:{branch:t,contents:e,protocol:r},counter:n}}))}simulate(t){return i(this,void 0,void 0,(function*(){return{opResponse:yield this.rpc.runOperation(t),op:t,context:this.context.clone()}}))}estimate(t,e){var{fee:r,gasLimit:s,storageLimit:o}=t,a=n(t,["fee","gasLimit","storageLimit"]);return i(this,void 0,void 0,(function*(){let t=r,i=s,n=o;if(void 0===r||void 0===s||void 0===o){const c=yield e(Object.assign({fee:r,gasLimit:s,storageLimit:o},a));void 0===t&&(t=c.suggestedFeeMutez),void 0===i&&(i=c.gasLimit),void 0===n&&(n=c.storageLimit)}return{fee:t,gasLimit:i,storageLimit:n}}))}signAndInject(t){return i(this,void 0,void 0,(function*(){const e=yield this.signer.sign(t.opbytes,new Uint8Array([3]));t.opbytes=e.sbytes,t.opOb.signature=e.prefixSig;const r=[],i=yield this.rpc.preapplyOperations([t.opOb]);if(!Array.isArray(i))throw new c.TezosPreapplyFailureError(i);for(let t=0;t<i.length;t++)for(let e=0;e<i[t].contents.length;e++)r.push(i[t].contents[e]);const n=c.flattenErrors(i);if(n.length)throw new c.TezosOperationError(n,"Error occurred during validation simulation of operation");return{hash:yield this.context.injector.inject(t.opbytes),forgedBytes:t,opResponse:r,context:this.context.clone()}}))}}},8974:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OriginationOperationError=e.flattenErrors=e.flattenOperationResult=e.TezosPreapplyFailureError=e.TezosOperationError=void 0;const i=r(807);class n extends Error{constructor(t,e){super(),this.errors=t,this.errorDetails=e,this.name="TezosOperationError";const r=t[t.length-1];this.id=r.id,this.kind=r.kind,this.message=`(${this.kind}) ${this.id}`,"with"in r&&(r.with.string?this.message=r.with.string:r.with.int?this.message=r.with.int:this.message=JSON.stringify(r.with))}}e.TezosOperationError=n;class s extends Error{constructor(t){super("Preapply returned an unexpected result"),this.result=t,this.name="TezosPreapplyFailureError"}}e.TezosPreapplyFailureError=s;e.flattenOperationResult=t=>{const e=Array.isArray(t)?t:[t],r=[];for(let t=0;t<e.length;t++)for(let n=0;n<e[t].contents.length;n++){const s=e[t].contents[n];i.hasMetadataWithResult(s)&&(r.push(Object.assign({fee:s.fee},s.metadata.operation_result)),Array.isArray(s.metadata.internal_operation_results)&&s.metadata.internal_operation_results.forEach((t=>r.push(t.result))))}return r};e.flattenErrors=(t,e="failed")=>{const r=Array.isArray(t)?t:[t];let n=[];for(let t=0;t<r.length;t++)for(let s=0;s<r[t].contents.length;s++){const o=r[t].contents[s];if(i.hasMetadata(o)&&(i.hasMetadataWithResult(o)&&o.metadata.operation_result.status===e&&(n=n.concat(o.metadata.operation_result.errors||[])),i.hasMetadataWithInternalOperationResult(o)&&Array.isArray(o.metadata.internal_operation_results)))for(const t of o.metadata.internal_operation_results)"result"in t&&t.result.status===e&&(n=n.concat(t.result.errors||[]))}return n};class o extends Error{constructor(t){super(t),this.message=t,this.name="OriginationOperationError"}}e.OriginationOperationError=o},8361:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Operation=void 0;const n=r(4496),s=r(6276),o=r(807),a=r(4632),c=r(552),u=r(3010);e.Operation=class{constructor(t,e,r,i){if(this.hash=t,this.raw=e,this.results=r,this.context=i,this._pollingConfig$=new n.ReplaySubject(1),this.currentHead$=this._pollingConfig$.pipe(s.switchMap((t=>new n.BehaviorSubject(t).pipe(s.timeoutWith(1e3*t.timeout,n.throwError(new Error("Confirmation polling timed out")))))),s.switchMap((()=>n.defer((()=>c.createObservableFromSubscription(this.context.stream.subscribeBlock("head")))).pipe(s.switchMap((t=>{var e,r;const i=null!==(r=null===(e=this.lastHead)||void 0===e?void 0:e.header.level)&&void 0!==r?r:t.header.level-1;return n.range(i+1,t.header.level-i-1).pipe(s.concatMap((t=>this.context.readProvider.getBlock(t))),s.endWith(t))})),s.tap((t=>this.lastHead=t))))),s.shareReplay({refCount:!0})),this.confirmed$=this.currentHead$.pipe(s.map((t=>{for(let e=3;e>=0;e--)t.operations[e].forEach((e=>{e.hash===this.hash&&(this._foundAt=t.header.level)}));if(t.header.level-this._foundAt>=0)return this._foundAt})),s.filter((t=>void 0!==t)),s.first(),s.shareReplay()),this._foundAt=Number.POSITIVE_INFINITY,a.validateOperation(this.hash)!==a.ValidationResult.VALID)throw new a.InvalidOperationHashError(this.hash);this.confirmed$.pipe(s.first(),s.catchError((()=>n.of(n.EMPTY)))).subscribe()}get includedInBlock(){return this._foundAt}get revealOperation(){return Array.isArray(this.results)&&this.results.find((t=>"reveal"===t.kind))}get revealStatus(){return this.revealOperation?this.revealOperation.metadata.operation_result.status:"unknown"}get status(){return this.results.map((t=>o.hasMetadataWithResult(t)?t.metadata.operation_result.status:"unknown"))[0]||"unknown"}confirmation(t,e){return i(this,void 0,void 0,(function*(){if(void 0!==t&&t<1)throw new u.InvalidConfirmationCountError("Confirmation count must be at least 1");const{defaultConfirmationCount:r,confirmationPollingTimeoutSecond:i}=this.context.config;this._pollingConfig$.next({timeout:e||i});const n=void 0!==t?t:r;return new Promise(((t,e)=>{this.confirmed$.pipe(s.switchMap((()=>this.currentHead$)),s.filter((t=>t.header.level-this._foundAt>=n-1)),s.first()).subscribe((e=>{t(this._foundAt+(n-1))}),e)}))}))}}},6646:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.OriginationOperation=void 0;const n=r(6391),s=r(8974),o=r(8361),a=r(807);class c extends o.Operation{constructor(t,e,r,i,n,s){super(t,r,i,n),this.params=e,this.contractProvider=s;const o=this.operationResults&&this.operationResults.originated_contracts;Array.isArray(o)&&(this.contractAddress=o[0])}get status(){var t,e;return null!==(e=null===(t=this.operationResults)||void 0===t?void 0:t.status)&&void 0!==e?e:"unknown"}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"origination"===t.kind)),e=t&&a.hasMetadataWithResult(t)&&t.metadata.operation_result;return e||void 0}get fee(){return this.params.fee}get gasLimit(){return this.params.gas_limit}get storageLimit(){return this.params.storage_limit}get consumedGas(){return n.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.BigNumber.ROUND_UP}),this.consumedMilliGas?new n.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.consumed_milligas}get storageDiff(){const t=this.operationResults&&this.operationResults.paid_storage_size_diff;return t||void 0}get storageSize(){const t=this.operationResults&&this.operationResults.storage_size;return t||void 0}get errors(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.errors}contract(t,e){return i(this,void 0,void 0,(function*(){if(!this.contractAddress)throw new s.OriginationOperationError("No contract was originated in this operation");return yield this.confirmation(t,e),this.contractProvider.at(this.contractAddress)}))}}e.OriginationOperation=c},7279:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProposalsOperation=void 0;const i=r(8361);class n extends i.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"proposals"===t.kind));return t||void 0}get proposals(){return this.params.proposals}get period(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.period}}e.ProposalsOperation=n},5544:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RegisterGlobalConstantOperation=void 0;const i=r(6391),n=r(8361);class s extends n.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r,this.globalConstantHash=this.operationResults&&this.operationResults.global_address}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"register_global_constant"===t.kind)),e=t&&t.metadata&&t.metadata.operation_result;return e||void 0}get status(){var t,e;return null!==(e=null===(t=this.operationResults)||void 0===t?void 0:t.status)&&void 0!==e?e:"unknown"}get registeredExpression(){return this.params.value}get fee(){return this.params.fee}get gasLimit(){return this.params.gas_limit}get storageLimit(){return this.params.storage_limit}get errors(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.errors}get consumedGas(){return i.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.BigNumber.ROUND_UP}),this.consumedMilliGas?new i.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.consumed_milligas}}e.RegisterGlobalConstantOperation=s},2342:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RevealOperation=void 0;const i=r(6391),n=r(8974),s=r(8361);class o extends s.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"reveal"===t.kind));return t?[t]:[]}get status(){const t=this.operationResults[0];return t?t.metadata.operation_result.status:"unknown"}get fee(){return this.params.fee}get gasLimit(){return this.params.gas_limit}get storageLimit(){return this.params.storage_limit}get publicKey(){return this.params.public_key}sumProp(t,e){return t.reduce(((t,r)=>e in r?Number(r[e])+t:t),0)}get consumedGas(){return i.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.BigNumber.ROUND_UP}),new i.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp(n.flattenOperationResult({contents:this.operationResults}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp(n.flattenOperationResult({contents:this.operationResults}),"paid_storage_size_diff"))}get storageSize(){return String(this.sumProp(n.flattenOperationResult({contents:this.operationResults}),"storage_size"))}get errors(){return n.flattenErrors({contents:this.operationResults})}}e.RevealOperation=o},1846:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TransactionOperation=void 0;const i=r(6391),n=r(8974),s=r(8361);class o extends s.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"transaction"===t.kind));return t?[t]:[]}get status(){const t=this.operationResults[0];return t?t.metadata.operation_result.status:"unknown"}get amount(){return new i.default(this.params.amount)}get destination(){return this.params.destination}get fee(){return this.params.fee}get gasLimit(){return this.params.gas_limit}get storageLimit(){return this.params.storage_limit}sumProp(t,e){return t.reduce(((t,r)=>e in r?Number(r[e])+t:t),0)}get consumedGas(){return i.default.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.default.ROUND_UP}),new i.default(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp(n.flattenOperationResult({contents:this.operationResults}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp(n.flattenOperationResult({contents:this.operationResults}),"paid_storage_size_diff"))}get storageSize(){return String(this.sumProp(n.flattenOperationResult({contents:this.operationResults}),"storage_size"))}get errors(){return n.flattenErrors({contents:this.operationResults})}}e.TransactionOperation=o},8983:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TransferTicketOperation=void 0;const i=r(6368),n=r(6391),s=r(3323);class o extends s.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>t.kind===i.OpKind.TRANSFER_TICKET)),e=t&&t.metadata&&t.metadata.operation_result;return e||void 0}get status(){var t,e;return null!==(e=null===(t=this.operationResults)||void 0===t?void 0:t.status)&&void 0!==e?e:"unknown"}get fee(){return this.params.fee}get gasLimit(){return this.params.gas_limit}get storageLimit(){return this.params.storage_limit}get consumedGas(){return n.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.BigNumber.ROUND_UP}),this.consumedMilliGas?new n.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.consumed_milligas}}e.TransferTicketOperation=o},280:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TxRollupBatchOperation=void 0;const i=r(6391),n=r(8361);class s extends n.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"tx_rollup_submit_batch"===t.kind)),e=t&&t.metadata&&t.metadata.operation_result;return e||void 0}get status(){var t,e;return null!==(e=null===(t=this.operationResults)||void 0===t?void 0:t.status)&&void 0!==e?e:"unknown"}get content(){return this.params.content}get fee(){return this.params.fee}get gasLimit(){return this.params.gas_limit}get storageLimit(){return this.params.storage_limit}get errors(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.errors}get consumedGas(){return i.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.BigNumber.ROUND_UP}),this.consumedMilliGas?new i.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.consumed_milligas}}e.TxRollupBatchOperation=s},9989:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TxRollupOriginationOperation=void 0;const i=r(6391),n=r(8361);class s extends n.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r,this.originatedRollup=this.operationResults&&this.operationResults.originated_rollup}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"tx_rollup_origination"===t.kind)),e=t&&t.metadata&&t.metadata.operation_result;return e||void 0}get status(){var t,e;return null!==(e=null===(t=this.operationResults)||void 0===t?void 0:t.status)&&void 0!==e?e:"unknown"}get fee(){return this.params.fee}get gasLimit(){return this.params.gas_limit}get storageLimit(){return this.params.storage_limit}get errors(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.errors}get consumedGas(){return i.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.BigNumber.ROUND_UP}),this.consumedMilliGas?new i.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.consumed_milligas}}e.TxRollupOriginationOperation=s},807:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasMetadataWithInternalOperationResult=e.hasMetadataWithResult=e.hasMetadata=e.isSourceOp=e.isOpRequireReveal=e.isOpWithFee=e.isKind=e.findWithKind=e.attachKind=e.OpKind=void 0;var i=r(6368);Object.defineProperty(e,"OpKind",{enumerable:!0,get:function(){return i.OpKind}});e.attachKind=(t,e)=>Object.assign(Object.assign({},t),{kind:e});e.findWithKind=(t,r)=>{if(Array.isArray(t)){const i=t.find((t=>t.kind===r));if(i&&e.isKind(i,r))return i}};e.isKind=(t,e)=>t.kind===e;e.isOpWithFee=t=>-1!==["transaction","delegation","origination","reveal","register_global_constant","increase_paid_storage","tx_rollup_origination","tx_rollup_submit_batch","transfer_ticket"].indexOf(t.kind);e.isOpRequireReveal=t=>-1!==["transaction","delegation","origination","register_global_constant","increase_paid_storage","tx_rollup_origination","tx_rollup_submit_batch","transfer_ticket"].indexOf(t.kind);e.isSourceOp=t=>-1!==["transaction","delegation","origination","reveal","ballot"].indexOf(t.kind);e.hasMetadata=t=>"metadata"in t;e.hasMetadataWithResult=t=>e.hasMetadata(t)&&"operation_result"in t.metadata;e.hasMetadataWithInternalOperationResult=t=>e.hasMetadata(t)&&"internal_operation_results"in t.metadata},4762:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3482:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.MichelCodecPacker=void 0;const n=r(9985);e.MichelCodecPacker=class{packData(t){return i(this,void 0,void 0,(function*(){const{bytes:e}=n.packDataBytes(t.data,t.type);return{packed:e}}))}}},6395:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.RpcPacker=void 0;e.RpcPacker=class{constructor(t){this.context=t}packData(t){return r(this,void 0,void 0,(function*(){return this.context.rpc.packData(t)}))}}},9813:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5286:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.MichelCodecParser=void 0;const n=r(9985),s=r(6700),o=r(8899);e.MichelCodecParser=class{constructor(t){this.context=t}getNextProto(){return i(this,void 0,void 0,(function*(){if(!this.context.proto){const t=yield this.context.readProvider.getNextProtocol("head");this.context.proto=t}return this.context.proto}))}parseScript(t){return i(this,void 0,void 0,(function*(){return new n.Parser({protocol:yield this.getNextProto()}).parseScript(t)}))}parseMichelineExpression(t){return i(this,void 0,void 0,(function*(){return new n.Parser({protocol:yield this.getNextProto()}).parseMichelineExpression(t)}))}parseJSON(t){return i(this,void 0,void 0,(function*(){return new n.Parser({protocol:yield this.getNextProto()}).parseJSON(t)}))}prepareCodeOrigination(t){return i(this,void 0,void 0,(function*(){const e=t;if(e.code=yield this.formatCodeParam(t.code),t.init)e.init=yield this.formatInitParam(t.init);else if(t.storage){const r=e.code.find((t=>"prim"in t&&"storage"===t.prim));if(!(null==r?void 0:r.args))throw new s.InvalidCodeParameter("The storage section is missing from the script",t.code);const i=new o.Schema(r.args[0]),a=yield this.findGlobalConstantsHashAndValue(i);if(0!==Object.keys(a).length){const i=new n.Parser({expandGlobalConstant:a}).parseJSON(r.args[0]),s=new o.Schema(i);e.init=s.Encode(t.storage)}else e.init=i.Encode(t.storage);delete e.storage}return e}))}formatCodeParam(t){return i(this,void 0,void 0,(function*(){let e;if("string"==typeof t){const r=yield this.parseScript(t);if(null===r)throw new s.InvalidCodeParameter("Invalid code parameter",t);e=r}else{const r=yield this.parseJSON(t),i=["parameter","storage","code"];e=r.sort(((t,e)=>i.indexOf(t.prim)-i.indexOf(e.prim)))}return e}))}formatInitParam(t){return i(this,void 0,void 0,(function*(){let e;if("string"==typeof t){const r=yield this.parseMichelineExpression(t);if(null===r)throw new s.InvalidInitParameter("Invalid init parameter",t);e=r}else e=yield this.parseJSON(t);return e}))}findGlobalConstantsHashAndValue(t){return i(this,void 0,void 0,(function*(){const e=t.findToken("constant"),r={};if(0!==e.length)for(const t of e){const e=t.tokenVal.args;if(e){const t=e[0];if(t.string){const e=t.string,i=yield this.context.globalConstantsProvider.getGlobalConstantByHash(e);Object.assign(r,{[e]:i})}}}return r}))}}},3259:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.NoopParser=void 0;e.NoopParser=class{prepareCodeOrigination(t){return r(this,void 0,void 0,(function*(){return t}))}}},259:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.RpcReadAdapter=void 0;e.RpcReadAdapter=class{constructor(t){this.rpc=t}getBalance(t,e){return r(this,void 0,void 0,(function*(){return this.rpc.getBalance(t,{block:String(e)})}))}getDelegate(t,e){return r(this,void 0,void 0,(function*(){return this.rpc.getDelegate(t,{block:String(e)})}))}getNextProtocol(t){return r(this,void 0,void 0,(function*(){return(yield this.rpc.getProtocols({block:String(t)})).next_protocol}))}getProtocolConstants(t){return r(this,void 0,void 0,(function*(){const{time_between_blocks:e,minimal_block_delay:r,hard_gas_limit_per_operation:i,hard_gas_limit_per_block:n,hard_storage_limit_per_operation:s,cost_per_byte:o,tx_rollup_origination_size:a}=yield this.rpc.getConstants({block:String(t)});return{time_between_blocks:e,minimal_block_delay:r,hard_gas_limit_per_operation:i,hard_gas_limit_per_block:n,hard_storage_limit_per_operation:s,cost_per_byte:o,tx_rollup_origination_size:a}}))}getScript(t,e){return r(this,void 0,void 0,(function*(){const{script:r}=yield this.rpc.getContract(t,{block:String(e)});return r}))}getStorage(t,e){return r(this,void 0,void 0,(function*(){return this.rpc.getStorage(t,{block:String(e)})}))}getBlockHash(t){return r(this,void 0,void 0,(function*(){const{hash:e}=yield this.rpc.getBlockHeader({block:String(t)});return e}))}getBlockLevel(t){return r(this,void 0,void 0,(function*(){const{level:e}=yield this.rpc.getBlockHeader({block:String(t)});return e}))}getCounter(t,e){return r(this,void 0,void 0,(function*(){const{counter:r}=yield this.rpc.getContract(t,{block:String(e)});return r||"0"}))}getBlockTimestamp(t){return r(this,void 0,void 0,(function*(){const{timestamp:e}=yield this.rpc.getBlockHeader({block:String(t)});return e}))}getBigMapValue(t,e){return r(this,void 0,void 0,(function*(){return this.rpc.getBigMapExpr(t.id,t.expr,{block:String(e)})}))}getSaplingDiffById(t,e){return r(this,void 0,void 0,(function*(){return this.rpc.getSaplingDiffById(t.id,{block:String(e)})}))}getSaplingDiffByContract(t,e){return r(this,void 0,void 0,(function*(){return this.rpc.getSaplingDiffByContract(t,{block:String(e)})}))}getEntrypoints(t){return r(this,void 0,void 0,(function*(){return this.rpc.getEntrypoints(t)}))}getChainId(){return r(this,void 0,void 0,(function*(){return this.rpc.getChainId()}))}isAccountRevealed(t,e){return r(this,void 0,void 0,(function*(){const r=yield this.rpc.getManagerKey(t,{block:String(e)});return r&&"object"==typeof r?!!r.key:!!r}))}getBlock(t){return r(this,void 0,void 0,(function*(){return this.rpc.getBlock({block:String(t)})}))}getLiveBlocks(t){return this.rpc.getLiveBlocks({block:String(t)})}}},1527:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1067:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.NoopSigner=e.UnconfiguredSignerError=void 0;class i extends Error{constructor(){super("No signer has been configured. Please configure one by calling setProvider({signer}) on your TezosToolkit instance."),this.name="UnconfiguredSignerError"}}e.UnconfiguredSignerError=i;e.NoopSigner=class{publicKey(){return r(this,void 0,void 0,(function*(){throw new i}))}publicKeyHash(){return r(this,void 0,void 0,(function*(){throw new i}))}secretKey(){return r(this,void 0,void 0,(function*(){throw new i}))}sign(t,e){return r(this,void 0,void 0,(function*(){throw new i}))}}},552:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createObservableFromSubscription=void 0;const i=r(4496);e.createObservableFromSubscription=function(t){return new i.Observable((e=>(t.on("data",(t=>{e.next(t)})),t.on("error",(t=>{e.error(t)})),t.on("close",(()=>{e.complete()})),()=>{t.close()})))}},8176:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.evaluateFilter=e.evaluateExpression=e.evaluateOpFilter=e.eventFilter=void 0;const i=r(3010);e.eventFilter=(t,e,r)=>"event"===t.kind&&(e&&r?t.source===e&&t.tag===r:e&&!r?t.source===e:!r||t.tag===r);e.evaluateOpFilter=(t,e)=>"opHash"in e?((t,e)=>t.hash===e.opHash)(t,e):"source"in e?((t,e)=>{switch(t.kind){case"endorsement":return"metadata"in t&&t.metadata.delegate===e.source;case"activate_account":return"metadata"in t&&t.pkh===e.source;default:return"source"in t&&t.source===e.source}})(t,e):"kind"in e?((t,e)=>"kind"in t&&t.kind===e.kind)(t,e):"destination"in e&&((t,e)=>{switch(t.kind){case"delegation":return t.delegate===e.destination;case"origination":if("metadata"in t&&"operation_result"in t.metadata&&"originated_contracts"in t.metadata.operation_result&&Array.isArray(t.metadata.operation_result.originated_contracts))return t.metadata.operation_result.originated_contracts.some((t=>t===e.destination));break;case"transaction":return t.destination===e.destination;default:return!1}})(t,e);e.evaluateExpression=(t,r)=>{if(Array.isArray(r.and))return r.and.every((r=>e.evaluateFilter(t,r)));if(Array.isArray(r.or))return r.or.some((r=>e.evaluateFilter(t,r)));throw new i.InvalidFilterExpressionError("Filter expression must contain either and/or property")};e.evaluateFilter=(t,r)=>{const i=[];return Array.isArray(r)?i.push(...r):i.push(r),i.every((r=>"and"in r||"or"in r?e.evaluateExpression(t,r):e.evaluateOpFilter(t,r)))}},440:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4435:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ObservableSubscription=e.UnsupportedEventError=void 0;const i=r(4496),n=r(6276);class s extends Error{constructor(t){super(t),this.message=t,this.name="UnsupportedEventError"}}e.UnsupportedEventError=s;e.ObservableSubscription=class{constructor(t,e=!1,r=n.retry()){this.shouldRetry=e,this.operatorFunction=r,this.errorListeners=[],this.messageListeners=[],this.closeListeners=[],this.completed$=new i.Subject,t.pipe(n.takeUntil(this.completed$),n.tap((t=>{this.call(this.messageListeners,t)}),(t=>{this.call(this.errorListeners,t)}),(()=>{this.call(this.closeListeners)})),this.shouldRetry?r:n.tap(),n.catchError((()=>i.NEVER))).subscribe()}call(t,e){for(const r of t)try{r(e)}catch(t){console.error(t)}}remove(t,e){const r=t.indexOf(e);-1!==r&&t.splice(r,1)}on(t,e){switch(t){case"data":this.messageListeners.push(e);break;case"error":this.errorListeners.push(e);break;case"close":this.closeListeners.push(e);break;default:throw new s(`Trying to register on an unsupported event: ${t}`)}}off(t,e){switch(t){case"data":this.remove(this.messageListeners,e);break;case"error":this.remove(this.errorListeners,e);break;case"close":this.remove(this.closeListeners,e);break;default:throw new s(`Trying to unregister on an unsupported event: ${t}`)}}close(){this.completed$.next()}}},5032:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.PollingSubscribeProvider=e.defaultConfigStreamer=void 0;const n=r(4496),s=r(6276),o=r(8176),a=r(4435),c=r(6391);e.defaultConfigStreamer={shouldObservableSubscriptionRetry:!1,observableSubscriptionRetryFunction:s.retry()};e.PollingSubscribeProvider=class{constructor(t,r={}){this.context=t,this._config$=new n.BehaviorSubject(Object.assign(Object.assign({},e.defaultConfigStreamer),r)),this.timer$=this._config$.pipe(s.pluck("pollingIntervalMilliseconds"),s.switchMap((t=>t?n.timer(0,t):n.from(this.getConfirmationPollingInterval()).pipe(s.switchMap((t=>n.timer(0,t))))))),this.newBlock$=this.timer$.pipe(s.switchMap((()=>(t=>n.from(t.rpc.getBlock()).pipe(s.first()))(this.context))),s.distinctUntilKeyChanged("hash"),s.publish(),s.refCount())}get config(){return this._config$.getValue()}getConfirmationPollingInterval(){return i(this,void 0,void 0,(function*(){if(!this.config.pollingIntervalMilliseconds){const t=5e3,e=1e3;try{const r=yield this.context.readProvider.getProtocolConstants("head"),i=(r.minimal_block_delay?r.minimal_block_delay.multipliedBy(1e3):r.time_between_blocks?r.time_between_blocks[0].multipliedBy(1e3):new c.default(t)).dividedBy(3);this.config.pollingIntervalMilliseconds=0===i.toNumber()?e:i.toNumber()}catch(e){return t}}return this.config.pollingIntervalMilliseconds}))}subscribeBlock(t){return new a.ObservableSubscription(this.newBlock$,this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribe(t){return new a.ObservableSubscription(this.newBlock$.pipe(s.pluck("hash")),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribeOperation(t){return new a.ObservableSubscription(this.newBlock$.pipe((t=>s.concatMap((e=>new n.Observable((r=>{for(const i of e.operations)for(const e of i)for(const i of e.contents)o.evaluateFilter(Object.assign({hash:e.hash},i),t)&&r.next(Object.assign({hash:e.hash},i));r.complete()})))))(t)),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribeEvent(t){return new a.ObservableSubscription(this.newBlock$.pipe((e=t,s.concatMap((t=>new n.Observable((r=>{for(const i of t.operations)for(const n of i)for(const i of n.contents){const s=i.metadata.internal_operation_results;if(s)for(const i of s)o.eventFilter(i,null==e?void 0:e.address,null==e?void 0:e.tag)&&r.next(Object.assign({opHash:n.hash,blockHash:t.hash,level:t.header.level},i))}r.complete()})))))),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction);var e}}},2353:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.TezosToolkit=e.TaquitoLocalForger=e.RpcReadAdapter=e.ObservableSubscription=e.PollingSubscribeProvider=e.OperationBatch=e.RpcForger=e.CompositeForger=e.UnitValue=e.MichelsonMap=void 0;const s=r(6368),o=r(4984),a=r(4632),c=r(9494),u=r(6395),h=r(259),f=r(1067),l=r(5032),d=r(8023),p=r(635),b=r(6713),g=r(5286);var m=r(8899);Object.defineProperty(e,"MichelsonMap",{enumerable:!0,get:function(){return m.MichelsonMap}}),Object.defineProperty(e,"UnitValue",{enumerable:!0,get:function(){return m.UnitValue}}),n(r(4593),e),n(r(4984),e),n(r(238),e),n(r(5225),e);var v=r(7336);Object.defineProperty(e,"CompositeForger",{enumerable:!0,get:function(){return v.CompositeForger}});var y=r(794);Object.defineProperty(e,"RpcForger",{enumerable:!0,get:function(){return y.RpcForger}}),n(r(3323),e);var w=r(150);Object.defineProperty(e,"OperationBatch",{enumerable:!0,get:function(){return w.OperationBatch}}),n(r(1527),e),n(r(440),e);var _=r(5032);Object.defineProperty(e,"PollingSubscribeProvider",{enumerable:!0,get:function(){return _.PollingSubscribeProvider}});var E=r(4435);Object.defineProperty(e,"ObservableSubscription",{enumerable:!0,get:function(){return E.ObservableSubscription}}),n(r(4946),e),n(r(635),e),n(r(9813),e),n(r(5286),e),n(r(3259),e),n(r(4762),e),n(r(3482),e),n(r(6395),e),n(r(5505),e),n(r(1452),e),n(r(3171),e);var S=r(259);Object.defineProperty(e,"RpcReadAdapter",{enumerable:!0,get:function(){return S.RpcReadAdapter}}),n(r(8794),e);var A=r(6713);Object.defineProperty(e,"TaquitoLocalForger",{enumerable:!0,get:function(){return A.TaquitoLocalForger}});e.TezosToolkit=class{constructor(t){this._rpc=t,this._options={},this.format=a.format,"string"==typeof this._rpc?this._rpcClient=new s.RpcClient(this._rpc):this._rpcClient=this._rpc,this._context=new o.Context(t),this._wallet=new p.Wallet(this._context),this.setProvider({rpc:this._rpcClient}),this.batch=this._context.batch.batch.bind(this._context.batch)}setProvider({rpc:t,stream:e,signer:r,protocol:i,config:n,forger:s,wallet:o,packer:a,globalConstantsProvider:c,readProvider:u,parserProvider:h}){this.setRpcProvider(t),this.setStreamProvider(e),this.setSignerProvider(r),this.setForgerProvider(s),this.setWalletProvider(o),this.setPackerProvider(a),this.setGlobalConstantsProvider(c),this.setReadProvider(u),this.setParserProvider(h),this._context.proto=i,n&&this._context.setPartialConfig(n)}setSignerProvider(t){this._options.signer||void 0!==t?void 0!==t&&(this._context.signer=t,this._options.signer=t):(this._context.signer=new f.NoopSigner,this._options.signer=t)}setRpcProvider(t){"string"==typeof t?this._rpcClient=new s.RpcClient(t):void 0===t||(this._rpcClient=t),this._options.rpc=this._rpcClient,this._context.rpc=this._rpcClient}setForgerProvider(t){if(void 0!==t)this._options.forger=t,this._context.forger=t;else if(void 0===this._options.forger){const t=this.getFactory(b.TaquitoLocalForger)();this._options.forger=t,this._context.forger=t}}setStreamProvider(t){if("string"==typeof t){const e=new l.PollingSubscribeProvider(new o.Context(new s.RpcClient(t)));this._options.stream=e,this._context.stream=e}else if(void 0!==t)this._options.stream=t,this._context.stream=t;else if(void 0===this._options.stream){const t=this.getFactory(l.PollingSubscribeProvider)();this._options.stream=t,this._context.stream=t}}setWalletProvider(t){if(this._options.wallet||void 0!==t)void 0!==t&&(this._options.wallet=t,this._context.walletProvider=t);else{const t=this.getFactory(p.LegacyWalletProvider)();this._options.wallet=t,this._context.walletProvider=t}}setPackerProvider(t){if(this._options.packer||void 0!==t)void 0!==t&&(this._context.packer=t,this._options.packer=t);else{const t=this.getFactory(u.RpcPacker)();this._context.packer=t,this._options.packer=t}}setGlobalConstantsProvider(t){if(this._options.globalConstantsProvider||void 0!==t)void 0!==t&&(this._context.globalConstantsProvider=t,this._options.globalConstantsProvider=t);else{const t=new c.NoopGlobalConstantsProvider;this._context.globalConstantsProvider=t,this._options.globalConstantsProvider=t}}setReadProvider(t){const e=t||new h.RpcReadAdapter(this._context.rpc);this._options.readProvider=e,this._context.readProvider=e}setParserProvider(t){if(this._options.parserProvider||void 0!==t)void 0!==t&&(this._context.parser=t,this._options.parserProvider=t);else{const t=new g.MichelCodecParser(this._context);this._context.parser=t,this._options.parserProvider=t}}get tz(){return this._context.tz}get contract(){return this._context.contract}get wallet(){return this._wallet}get operation(){return this._context.operationFactory}get estimate(){return this._context.estimate}get stream(){return this._context.stream}get rpc(){return this._context.rpc}get signer(){return this._context.signer}get globalConstants(){return this._context.globalConstantsProvider}addExtension(t){Array.isArray(t)?t.forEach((t=>t.configureContext(this._context))):t.configureContext(this._context)}getFactory(t){return(...e)=>new t(this._context,...e)}getVersionInfo(){return d.VERSION}}},4946:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},992:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.RpcTzProvider=void 0;const n=r(2026),s=r(8361),o=r(6368),a=r(4632);class c extends n.OperationEmitter{constructor(t){super(t)}getBalance(t){return i(this,void 0,void 0,(function*(){if(a.validateAddress(t)!==a.ValidationResult.VALID)throw new a.InvalidAddressError(t);return this.context.readProvider.getBalance(t,"head")}))}getDelegate(t){return i(this,void 0,void 0,(function*(){if(a.validateAddress(t)!==a.ValidationResult.VALID)throw new a.InvalidAddressError(t);return this.context.readProvider.getDelegate(t,"head")}))}activate(t,e){return i(this,void 0,void 0,(function*(){if(a.validateKeyHash(t)!==a.ValidationResult.VALID)throw new a.InvalidKeyHashError(t);const r={kind:o.OpKind.ACTIVATION,pkh:t,secret:e},i=yield this.prepareOperation({operation:[r],source:t}),n=yield this.forge(i),c=`${n.opbytes}00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000`;return new s.Operation(yield this.rpc.injectOperation(c),Object.assign(Object.assign({},n),{opbytes:c}),[],this.context.clone())}))}}e.RpcTzProvider=c},8023:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION=void 0,e.VERSION={commitHash:"d474f2ac7abec2e8faddba47cf403a0c0203c7d5",version:"14.2.0-beta-RC.0"}},1626:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.BatchWalletOperation=void 0;const n=r(6368),s=r(150),o=r(807),a=r(2809);class c extends a.WalletOperation{constructor(t,e,r){super(t,e,r),this.opHash=t,this.context=e,this.getOriginatedContractAddresses=()=>i(this,void 0,void 0,(function*(){const t=(yield this.operationResults()).filter((t=>"origination"===t.kind));let e=[];for(const r of t)r.metadata.operation_result.originated_contracts&&(e=[...e,...r.metadata.operation_result.originated_contracts]);return e}))}revealOperation(){return i(this,void 0,void 0,(function*(){return(yield this.operationResults()).find((t=>t.kind===n.OpKind.REVEAL))}))}status(){return i(this,void 0,void 0,(function*(){if(!this._included)return"pending";return(yield this.operationResults()).filter((t=>-1!==s.BATCH_KINDS.indexOf(t.kind))).map((t=>o.hasMetadataWithResult(t)?t.metadata.operation_result.status:"unknown"))[0]||"unknown"}))}}e.BatchWalletOperation=c},4364:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.DelegationWalletOperation=void 0;const n=r(6368),s=r(2809);class o extends s.WalletOperation{constructor(t,e,r){super(t,e,r),this.opHash=t,this.context=e}revealOperation(){return i(this,void 0,void 0,(function*(){return(yield this.operationResults()).find((t=>t.kind===n.OpKind.REVEAL))}))}delegationOperation(){return i(this,void 0,void 0,(function*(){return(yield this.operationResults()).find((t=>t.kind===n.OpKind.DELEGATION))}))}status(){return i(this,void 0,void 0,(function*(){if(!this._included)return"pending";const t=yield this.delegationOperation();return t?t.metadata.operation_result.status:"unknown"}))}}e.DelegationWalletOperation=o},635:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(5277),e),n(r(2809),e),n(r(4685),e),n(r(7654),e),n(r(4364),e),n(r(7432),e),n(r(8562),e)},7432:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},8562:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.LegacyWalletProvider=void 0;const n=r(807);e.LegacyWalletProvider=class{constructor(t){this.context=t}getPKH(){return i(this,void 0,void 0,(function*(){return this.context.signer.publicKeyHash()}))}mapTransferParamsToWalletParams(t){return i(this,void 0,void 0,(function*(){return n.attachKind(yield t(),n.OpKind.TRANSACTION)}))}mapOriginateParamsToWalletParams(t){return i(this,void 0,void 0,(function*(){return n.attachKind(yield t(),n.OpKind.ORIGINATION)}))}mapDelegateParamsToWalletParams(t){return i(this,void 0,void 0,(function*(){return n.attachKind(yield t(),n.OpKind.DELEGATION)}))}sendOperations(t){return i(this,void 0,void 0,(function*(){return(yield this.context.batch.batch(t).send()).hash}))}}},8286:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.OperationFactory=e.createNewPollingBasedHeadObservable=e.timeoutAfter=void 0;const n=r(4496),s=r(6276),o=r(552),a=r(1626),c=r(4364),u=r(2809),h=r(7654),f=r(4685);function l(t){return function(e){return new n.BehaviorSubject(null).pipe(s.timeoutWith(t,n.throwError(new Error("Confirmation polling timed out"))),s.mergeMap((()=>e)))}}e.timeoutAfter=l;e.createNewPollingBasedHeadObservable=(t,e,r)=>t.pipe(l(1e3*e.config.confirmationPollingTimeoutSecond),s.publishReplay(1),s.refCount());e.OperationFactory=class{constructor(t){this.context=t,this.sharedHeadObs=n.defer((()=>o.createObservableFromSubscription(this.context.stream.subscribeBlock("head"))))}createNewHeadObservable(){return i(this,void 0,void 0,(function*(){return e.createNewPollingBasedHeadObservable(this.sharedHeadObs,this.context)}))}createPastBlockWalker(t,e=1){return n.from(this.context.readProvider.getBlock(t)).pipe(s.switchMap((t=>1===e?n.of(t):n.range(t.header.level,e-1).pipe(s.startWith(t),s.concatMap((t=>i(this,void 0,void 0,(function*(){return this.context.readProvider.getBlock("number"==typeof t?t:t.header.level)}))))))))}createHeadObservableFromConfig({blockIdentifier:t}){return i(this,void 0,void 0,(function*(){const e=[];return t&&e.push(this.createPastBlockWalker(t)),e.push(yield this.createNewHeadObservable()),n.concat(...e)}))}createOperation(t,e={}){return i(this,void 0,void 0,(function*(){return new u.WalletOperation(t,this.context.clone(),yield this.createHeadObservableFromConfig(e))}))}createBatchOperation(t,e={}){return i(this,void 0,void 0,(function*(){return new a.BatchWalletOperation(t,this.context.clone(),yield this.createHeadObservableFromConfig(e))}))}createTransactionOperation(t,e={}){return i(this,void 0,void 0,(function*(){return new f.TransactionWalletOperation(t,this.context.clone(),yield this.createHeadObservableFromConfig(e))}))}createDelegationOperation(t,e={}){return i(this,void 0,void 0,(function*(){return new c.DelegationWalletOperation(t,this.context.clone(),yield this.createHeadObservableFromConfig(e))}))}createOriginationOperation(t,e={}){return i(this,void 0,void 0,(function*(){return new h.OriginationWalletOperation(t,this.context.clone(),yield this.createHeadObservableFromConfig(e))}))}}},2809:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.WalletOperation=void 0;const n=r(4496),s=r(6276),o=r(6298),a=r(4632),c=r(3010);e.WalletOperation=class{constructor(t,e,r){if(this.opHash=t,this.context=e,this._newHead$=r,this._operationResult=new n.ReplaySubject(1),this._includedInBlock=new n.ReplaySubject(1),this._included=!1,this.newHead$=this._newHead$.pipe(s.switchMap((t=>{var e,r;const i=null!==(r=null===(e=this.lastHead)||void 0===e?void 0:e.header.level)&&void 0!==r?r:t.header.level-1;return n.range(i+1,t.header.level-i-1).pipe(s.concatMap((t=>this.context.readProvider.getBlock(t))),s.endWith(t))})),s.tap((t=>this.lastHead=t)),s.publishReplay(1),s.refCount()),this.confirmed$=this.newHead$.pipe(s.map((t=>{for(const e of t.operations)for(const r of e)if(r.hash===this.opHash)return this._included=!0,this._includedInBlock.next(t),this._operationResult.next(r.contents),t})),s.filter((t=>void 0!==t)),s.first(),s.publishReplay(1),s.refCount()),a.validateOperation(this.opHash)!==a.ValidationResult.VALID)throw new a.InvalidOperationHashError(this.opHash);this.confirmed$.pipe(s.first(),s.catchError((()=>n.of(void 0)))).subscribe()}operationResults(){return i(this,void 0,void 0,(function*(){return this._operationResult.pipe(s.first()).toPromise()}))}receipt(){return i(this,void 0,void 0,(function*(){return o.receiptFromOperation(yield this.operationResults())}))}getCurrentConfirmation(){return i(this,void 0,void 0,(function*(){return this._included?n.combineLatest([this._includedInBlock,n.from(this.context.readProvider.getBlock("head"))]).pipe(s.map((([t,e])=>e.header.level-t.header.level+1)),s.first()).toPromise():0}))}isInCurrentBranch(t="head"){return i(this,void 0,void 0,(function*(){if(!this._included)return!0;const e=yield this.context.readProvider.getBlockLevel(t),r=yield this._includedInBlock.pipe(s.first()).toPromise(),i=e-r.header.level;if(i<=0)return!0;const n=Math.min(r.header.level+i,r.header.level+60);return new Set(yield this.context.readProvider.getLiveBlocks(n)).has(r.hash)}))}confirmationObservable(t){if(void 0!==t&&t<1)throw new c.InvalidConfirmationCountError("Confirmation count must be at least 1");const{defaultConfirmationCount:e}=this.context.config,r=void 0!==t?t:e;if(void 0===r)throw new c.ConfirmationUndefinedError("Default confirmation count can not be undefined!");return n.combineLatest([this._includedInBlock,this.newHead$]).pipe(s.distinctUntilChanged((([,t],[,e])=>t.hash===e.hash)),s.map((([t,e])=>({block:e,expectedConfirmation:r,currentConfirmation:e.header.level-t.header.level+1,completed:e.header.level-t.header.level>=r-1,isInCurrentBranch:()=>this.isInCurrentBranch(e.hash)}))),s.takeWhile((({completed:t})=>!t),!0))}confirmation(t){return this.confirmationObservable(t).toPromise()}}},7654:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.OriginationWalletOperation=void 0;const n=r(6368),s=r(807),o=r(2809);class a extends o.WalletOperation{constructor(t,e,r){super(t,e,r),this.opHash=t,this.context=e}originationOperation(){return i(this,void 0,void 0,(function*(){const t=yield this.operationResults();return s.findWithKind(t,n.OpKind.ORIGINATION)}))}revealOperation(){return i(this,void 0,void 0,(function*(){const t=yield this.operationResults();return s.findWithKind(t,n.OpKind.REVEAL)}))}status(){return i(this,void 0,void 0,(function*(){if(!this._included)return"pending";const t=yield this.originationOperation();return t?t.metadata.operation_result.status:"unknown"}))}contract(){return i(this,void 0,void 0,(function*(){const t=yield this.originationOperation(),e=((null==t?void 0:t.metadata.operation_result.originated_contracts)||[])[0];return this.context.wallet.at(e)}))}}e.OriginationWalletOperation=a},6298:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.receiptFromOperation=void 0;const i=r(6391),n=r(4593),s=r(8974);e.receiptFromOperation=(t,{ALLOCATION_BURN:e,ORIGINATION_BURN:r}={ALLOCATION_BURN:257,ORIGINATION_BURN:257})=>{i.default.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.default.ROUND_UP});const o=s.flattenOperationResult({contents:t});let a=new i.default(0),c=new i.default(0),u=new i.default(0),h=new i.default(0),f=new i.default(0),l=new i.default(0);return o.forEach((t=>{u=u.plus(t.fee||0),h=h.plus(Array.isArray(t.originated_contracts)?t.originated_contracts.length*r:0),f=f.plus("allocated_destination_contract"in t?e:0),a=a.plus(t.consumed_milligas||0),l=l.plus("paid_storage_size_diff"in t&&Number(t.paid_storage_size_diff)||0)})),c=c.plus(f).plus(h).plus(l),{totalFee:u,totalMilliGas:a,totalGas:a.dividedBy(1e3),totalStorage:c,totalAllocationBurn:f,totalOriginationBurn:h,totalPaidStorageDiff:l,totalStorageBurn:new i.default(c.multipliedBy(n.COST_PER_BYTE))}}},4685:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.TransactionWalletOperation=void 0;const n=r(2809),s=r(6368);class o extends n.WalletOperation{constructor(t,e,r){super(t,e,r),this.opHash=t,this.context=e}revealOperation(){return i(this,void 0,void 0,(function*(){return(yield this.operationResults()).find((t=>t.kind===s.OpKind.REVEAL))}))}transactionOperation(){return i(this,void 0,void 0,(function*(){return(yield this.operationResults()).find((t=>t.kind===s.OpKind.TRANSACTION))}))}status(){return i(this,void 0,void 0,(function*(){if(!this._included)return"pending";const t=yield this.transactionOperation();return t?t.metadata.operation_result.status:"unknown"}))}}e.TransactionWalletOperation=o},5277:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Wallet=e.WalletOperationBatch=void 0;const n=r(238),s=r(807),o=r(4632);class a{constructor(t,e){this.walletProvider=t,this.context=e,this.operations=[]}withTransfer(t){if(o.validateAddress(t.to)!==o.ValidationResult.VALID)throw new o.InvalidAddressError(t.to);return this.operations.push(Object.assign({kind:s.OpKind.TRANSACTION},t)),this}withContractCall(t,e={}){return this.withTransfer(t.toTransferParams(e))}withDelegation(t){if(t.delegate&&o.validateAddress(t.delegate)!==o.ValidationResult.VALID)throw new o.InvalidAddressError(t.delegate);return this.operations.push(Object.assign({kind:s.OpKind.DELEGATION},t)),this}withOrigination(t){return this.operations.push(Object.assign({kind:s.OpKind.ORIGINATION},t)),this}mapOperation(t){return i(this,void 0,void 0,(function*(){switch(t.kind){case s.OpKind.TRANSACTION:return this.walletProvider.mapTransferParamsToWalletParams((()=>i(this,void 0,void 0,(function*(){return t}))));case s.OpKind.ORIGINATION:return this.walletProvider.mapOriginateParamsToWalletParams((()=>i(this,void 0,void 0,(function*(){return this.context.parser.prepareCodeOrigination(Object.assign({},t))}))));case s.OpKind.DELEGATION:return this.walletProvider.mapDelegateParamsToWalletParams((()=>i(this,void 0,void 0,(function*(){return t}))));default:throw new o.InvalidOperationKindError(t.kind)}}))}with(t){for(const e of t)switch(e.kind){case s.OpKind.TRANSACTION:this.withTransfer(e);break;case s.OpKind.ORIGINATION:this.withOrigination(e);break;case s.OpKind.DELEGATION:this.withDelegation(e);break;default:throw new o.InvalidOperationKindError(e.kind)}return this}send(){return i(this,void 0,void 0,(function*(){const t=[];for(const e of this.operations)t.push(yield this.mapOperation(e));const e=yield this.walletProvider.sendOperations(t);return this.context.operationFactory.createBatchOperation(e)}))}}e.WalletOperationBatch=a;e.Wallet=class{constructor(t){this.context=t,this.walletCommand=t=>({send:t})}get walletProvider(){return this.context.walletProvider}pkh({forceRefetch:t}={}){return i(this,void 0,void 0,(function*(){return this._pkh&&!t||(this._pkh=yield this.walletProvider.getPKH()),this._pkh}))}originate(t){return this.walletCommand((()=>i(this,void 0,void 0,(function*(){const e=yield this.walletProvider.mapOriginateParamsToWalletParams((()=>this.context.parser.prepareCodeOrigination(Object.assign({},t)))),r=yield this.walletProvider.sendOperations([e]);return this.context.operationFactory.createOriginationOperation(r)}))))}setDelegate(t){if(t.delegate&&o.validateAddress(t.delegate)!==o.ValidationResult.VALID)throw new o.InvalidAddressError(t.delegate);return this.walletCommand((()=>i(this,void 0,void 0,(function*(){const e=yield this.walletProvider.mapDelegateParamsToWalletParams((()=>i(this,void 0,void 0,(function*(){return t})))),r=yield this.walletProvider.sendOperations([e]);return this.context.operationFactory.createDelegationOperation(r)}))))}registerDelegate(){return this.walletCommand((()=>i(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapDelegateParamsToWalletParams((()=>i(this,void 0,void 0,(function*(){return{delegate:yield this.pkh()}})))),e=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createDelegationOperation(e)}))))}transfer(t){if(o.validateAddress(t.to)!==o.ValidationResult.VALID)throw new o.InvalidAddressError(t.to);return this.walletCommand((()=>i(this,void 0,void 0,(function*(){const e=yield this.walletProvider.mapTransferParamsToWalletParams((()=>i(this,void 0,void 0,(function*(){return t})))),r=yield this.walletProvider.sendOperations([e]);return this.context.operationFactory.createTransactionOperation(r)}))))}batch(t){const e=new a(this.walletProvider,this.context);return Array.isArray(t)&&e.with(t),e}at(t,e=(t=>t)){return i(this,void 0,void 0,(function*(){if(o.validateContractAddress(t)!==o.ValidationResult.VALID)throw new o.InvalidContractAddressError(t);const r=this.context.withExtensions().rpc,i=this.context.withExtensions().readProvider,s=yield i.getScript(t,"head"),a=yield i.getEntrypoints(t),c=new n.ContractAbstraction(t,s,this,this.context.contract,a,r,i);return e(c,this.context)}))}}},5477:()=>{},3196:()=>{},8087:()=>{},4854:()=>{},6602:()=>{},2558:(t,e,r)=>{"use strict";r.d(e,{O:()=>_,Z:()=>E});var i=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,s=Math.floor,o="[BigNumber Error] ",a=o+"Number primitive has more than 15 significant digits: ",c=1e14,u=14,h=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],l=1e7,d=1e9;function p(t){var e=0|t;return t>0||t===e?e:e-1}function b(t){for(var e,r,i=1,n=t.length,s=t[0]+"";i<n;){for(e=t[i++]+"",r=u-e.length;r--;e="0"+e);s+=e}for(n=s.length;48===s.charCodeAt(--n););return s.slice(0,n+1||1)}function g(t,e){var r,i,n=t.c,s=e.c,o=t.s,a=e.s,c=t.e,u=e.e;if(!o||!a)return null;if(r=n&&!n[0],i=s&&!s[0],r||i)return r?i?0:-a:o;if(o!=a)return o;if(r=o<0,i=c==u,!n||!s)return i?0:!n^r?1:-1;if(!i)return c>u^r?1:-1;for(a=(c=n.length)<(u=s.length)?c:u,o=0;o<a;o++)if(n[o]!=s[o])return n[o]>s[o]^r?1:-1;return c==u?0:c>u^r?1:-1}function m(t,e,r,i){if(t<e||t>r||t!==s(t))throw Error(o+(i||"Argument")+("number"==typeof t?t<e||t>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function v(t){var e=t.c.length-1;return p(t.e/u)==e&&t.c[e]%2!=0}function y(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function w(t,e,r){var i,n;if(e<0){for(n=r+".";++e;n+=r);t=n+t}else if(++e>(i=t.length)){for(n=r,e-=i;--e;n+=r);t+=n}else e<i&&(t=t.slice(0,e)+"."+t.slice(e));return t}var _=function t(e){var r,_,E,S,A,O,T,x,R,P,I=G.prototype={constructor:G,toString:null,valueOf:null},N=new G(1),M=20,k=4,L=-7,C=21,B=-1e7,D=1e7,U=!1,j=1,K=0,V={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz",H=!0;function G(t,e){var r,n,o,c,f,l,d,p,b=this;if(!(b instanceof G))return new G(t,e);if(null==e){if(t&&!0===t._isBigNumber)return b.s=t.s,void(!t.c||t.e>D?b.c=b.e=null:t.e<B?b.c=[b.e=0]:(b.e=t.e,b.c=t.c.slice()));if((l="number"==typeof t)&&0*t==0){if(b.s=1/t<0?(t=-t,-1):1,t===~~t){for(c=0,f=t;f>=10;f/=10,c++);return void(c>D?b.c=b.e=null:(b.e=c,b.c=[t]))}p=String(t)}else{if(!i.test(p=String(t)))return E(b,p,l);b.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(c=p.indexOf("."))>-1&&(p=p.replace(".","")),(f=p.search(/e/i))>0?(c<0&&(c=f),c+=+p.slice(f+1),p=p.substring(0,f)):c<0&&(c=p.length)}else{if(m(e,2,F.length,"Base"),10==e&&H)return Z(b=new G(t),M+b.e+1,k);if(p=String(t),l="number"==typeof t){if(0*t!=0)return E(b,p,l,e);if(b.s=1/t<0?(p=p.slice(1),-1):1,G.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(a+t)}else b.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(r=F.slice(0,e),c=f=0,d=p.length;f<d;f++)if(r.indexOf(n=p.charAt(f))<0){if("."==n){if(f>c){c=d;continue}}else if(!o&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){o=!0,f=-1,c=0;continue}return E(b,String(t),l,e)}l=!1,(c=(p=_(p,e,10,b.s)).indexOf("."))>-1?p=p.replace(".",""):c=p.length}for(f=0;48===p.charCodeAt(f);f++);for(d=p.length;48===p.charCodeAt(--d););if(p=p.slice(f,++d)){if(d-=f,l&&G.DEBUG&&d>15&&(t>h||t!==s(t)))throw Error(a+b.s*t);if((c=c-f-1)>D)b.c=b.e=null;else if(c<B)b.c=[b.e=0];else{if(b.e=c,b.c=[],f=(c+1)%u,c<0&&(f+=u),f<d){for(f&&b.c.push(+p.slice(0,f)),d-=u;f<d;)b.c.push(+p.slice(f,f+=u));f=u-(p=p.slice(f)).length}else f-=d;for(;f--;p+="0");b.c.push(+p)}}else b.c=[b.e=0]}function $(t,e,r,i){var n,s,o,a,c;if(null==r?r=k:m(r,0,8),!t.c)return t.toString();if(n=t.c[0],o=t.e,null==e)c=b(t.c),c=1==i||2==i&&(o<=L||o>=C)?y(c,o):w(c,o,"0");else if(s=(t=Z(new G(t),e,r)).e,a=(c=b(t.c)).length,1==i||2==i&&(e<=s||s<=L)){for(;a<e;c+="0",a++);c=y(c,s)}else if(e-=o,c=w(c,s,"0"),s+1>a){if(--e>0)for(c+=".";e--;c+="0");}else if((e+=s-a)>0)for(s+1==a&&(c+=".");e--;c+="0");return t.s<0&&n?"-"+c:c}function z(t,e){for(var r,i=1,n=new G(t[0]);i<t.length;i++){if(!(r=new G(t[i])).s){n=r;break}e.call(n,r)&&(n=r)}return n}function q(t,e,r){for(var i=1,n=e.length;!e[--n];e.pop());for(n=e[0];n>=10;n/=10,i++);return(r=i+r*u-1)>D?t.c=t.e=null:r<B?t.c=[t.e=0]:(t.e=r,t.c=e),t}function Z(t,e,r,i){var o,a,h,l,d,p,b,g=t.c,m=f;if(g){t:{for(o=1,l=g[0];l>=10;l/=10,o++);if((a=e-o)<0)a+=u,h=e,b=(d=g[p=0])/m[o-h-1]%10|0;else if((p=n((a+1)/u))>=g.length){if(!i)break t;for(;g.length<=p;g.push(0));d=b=0,o=1,h=(a%=u)-u+1}else{for(d=l=g[p],o=1;l>=10;l/=10,o++);b=(h=(a%=u)-u+o)<0?0:d/m[o-h-1]%10|0}if(i=i||e<0||null!=g[p+1]||(h<0?d:d%m[o-h-1]),i=r<4?(b||i)&&(0==r||r==(t.s<0?3:2)):b>5||5==b&&(4==r||i||6==r&&(a>0?h>0?d/m[o-h]:0:g[p-1])%10&1||r==(t.s<0?8:7)),e<1||!g[0])return g.length=0,i?(e-=t.e+1,g[0]=m[(u-e%u)%u],t.e=-e||0):g[0]=t.e=0,t;if(0==a?(g.length=p,l=1,p--):(g.length=p+1,l=m[u-a],g[p]=h>0?s(d/m[o-h]%m[h])*l:0),i)for(;;){if(0==p){for(a=1,h=g[0];h>=10;h/=10,a++);for(h=g[0]+=l,l=1;h>=10;h/=10,l++);a!=l&&(t.e++,g[0]==c&&(g[0]=1));break}if(g[p]+=l,g[p]!=c)break;g[p--]=0,l=1}for(a=g.length;0===g[--a];g.pop());}t.e>D?t.c=t.e=null:t.e<B&&(t.c=[t.e=0])}return t}function W(t){var e,r=t.e;return null===r?t.toString():(e=b(t.c),e=r<=L||r>=C?y(e,r):w(e,r,"0"),t.s<0?"-"+e:e)}return G.clone=t,G.ROUND_UP=0,G.ROUND_DOWN=1,G.ROUND_CEIL=2,G.ROUND_FLOOR=3,G.ROUND_HALF_UP=4,G.ROUND_HALF_DOWN=5,G.ROUND_HALF_EVEN=6,G.ROUND_HALF_CEIL=7,G.ROUND_HALF_FLOOR=8,G.EUCLID=9,G.config=G.set=function(t){var e,r;if(null!=t){if("object"!=typeof t)throw Error(o+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(m(r=t[e],0,d,e),M=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(m(r=t[e],0,8,e),k=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((r=t[e])&&r.pop?(m(r[0],-d,0,e),m(r[1],0,d,e),L=r[0],C=r[1]):(m(r,-d,d,e),L=-(C=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if((r=t[e])&&r.pop)m(r[0],-d,-1,e),m(r[1],1,d,e),B=r[0],D=r[1];else{if(m(r,-d,d,e),!r)throw Error(o+e+" cannot be zero: "+r);B=-(D=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(o+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(o+"crypto unavailable");U=r}else U=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(m(r=t[e],0,9,e),j=r),t.hasOwnProperty(e="POW_PRECISION")&&(m(r=t[e],0,d,e),K=r),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(r=t[e]))throw Error(o+e+" not an object: "+r);V=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(o+e+" invalid: "+r);H="0123456789"==r.slice(0,10),F=r}}return{DECIMAL_PLACES:M,ROUNDING_MODE:k,EXPONENTIAL_AT:[L,C],RANGE:[B,D],CRYPTO:U,MODULO_MODE:j,POW_PRECISION:K,FORMAT:V,ALPHABET:F}},G.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!G.DEBUG)return!0;var e,r,i=t.c,n=t.e,a=t.s;t:if("[object Array]"=={}.toString.call(i)){if((1===a||-1===a)&&n>=-d&&n<=d&&n===s(n)){if(0===i[0]){if(0===n&&1===i.length)return!0;break t}if((e=(n+1)%u)<1&&(e+=u),String(i[0]).length==e){for(e=0;e<i.length;e++)if((r=i[e])<0||r>=c||r!==s(r))break t;if(0!==r)return!0}}}else if(null===i&&null===n&&(null===a||1===a||-1===a))return!0;throw Error(o+"Invalid BigNumber: "+t)},G.maximum=G.max=function(){return z(arguments,I.lt)},G.minimum=G.min=function(){return z(arguments,I.gt)},G.random=(S=9007199254740992,A=Math.random()*S&2097151?function(){return s(Math.random()*S)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,i,a,c,h=0,l=[],p=new G(N);if(null==t?t=M:m(t,0,d),a=n(t/u),U)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(a*=2));h<a;)(c=131072*e[h]+(e[h+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),e[h]=r[0],e[h+1]=r[1]):(l.push(c%1e14),h+=2);h=a/2}else{if(!crypto.randomBytes)throw U=!1,Error(o+"crypto unavailable");for(e=crypto.randomBytes(a*=7);h<a;)(c=281474976710656*(31&e[h])+1099511627776*e[h+1]+4294967296*e[h+2]+16777216*e[h+3]+(e[h+4]<<16)+(e[h+5]<<8)+e[h+6])>=9e15?crypto.randomBytes(7).copy(e,h):(l.push(c%1e14),h+=7);h=a/7}if(!U)for(;h<a;)(c=A())<9e15&&(l[h++]=c%1e14);for(a=l[--h],t%=u,a&&t&&(c=f[u-t],l[h]=s(a/c)*c);0===l[h];l.pop(),h--);if(h<0)l=[i=0];else{for(i=-1;0===l[0];l.splice(0,1),i-=u);for(h=1,c=l[0];c>=10;c/=10,h++);h<u&&(i-=u-h)}return p.e=i,p.c=l,p}),G.sum=function(){for(var t=1,e=arguments,r=new G(e[0]);t<e.length;)r=r.plus(e[t++]);return r},_=function(){var t="0123456789";function e(t,e,r,i){for(var n,s,o=[0],a=0,c=t.length;a<c;){for(s=o.length;s--;o[s]*=e);for(o[0]+=i.indexOf(t.charAt(a++)),n=0;n<o.length;n++)o[n]>r-1&&(null==o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}return function(i,n,s,o,a){var c,u,h,f,l,d,p,g,m=i.indexOf("."),v=M,y=k;for(m>=0&&(f=K,K=0,i=i.replace(".",""),d=(g=new G(n)).pow(i.length-m),K=f,g.c=e(w(b(d.c),d.e,"0"),10,s,t),g.e=g.c.length),h=f=(p=e(i,n,s,a?(c=F,t):(c=t,F))).length;0==p[--f];p.pop());if(!p[0])return c.charAt(0);if(m<0?--h:(d.c=p,d.e=h,d.s=o,p=(d=r(d,g,v,y,s)).c,l=d.r,h=d.e),m=p[u=h+v+1],f=s/2,l=l||u<0||null!=p[u+1],l=y<4?(null!=m||l)&&(0==y||y==(d.s<0?3:2)):m>f||m==f&&(4==y||l||6==y&&1&p[u-1]||y==(d.s<0?8:7)),u<1||!p[0])i=l?w(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(p.length=u,l)for(--s;++p[--u]>s;)p[u]=0,u||(++h,p=[1].concat(p));for(f=p.length;!p[--f];);for(m=0,i="";m<=f;i+=c.charAt(p[m++]));i=w(i,h,c.charAt(0))}return i}}(),r=function(){function t(t,e,r){var i,n,s,o,a=0,c=t.length,u=e%l,h=e/l|0;for(t=t.slice();c--;)a=((n=u*(s=t[c]%l)+(i=h*s+(o=t[c]/l|0)*u)%l*l+a)/r|0)+(i/l|0)+h*o,t[c]=n%r;return a&&(t=[a].concat(t)),t}function e(t,e,r,i){var n,s;if(r!=i)s=r>i?1:-1;else for(n=s=0;n<r;n++)if(t[n]!=e[n]){s=t[n]>e[n]?1:-1;break}return s}function r(t,e,r,i){for(var n=0;r--;)t[r]-=n,n=t[r]<e[r]?1:0,t[r]=n*i+t[r]-e[r];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(i,n,o,a,h){var f,l,d,b,g,m,v,y,w,_,E,S,A,O,T,x,R,P=i.s==n.s?1:-1,I=i.c,N=n.c;if(!(I&&I[0]&&N&&N[0]))return new G(i.s&&n.s&&(I?!N||I[0]!=N[0]:N)?I&&0==I[0]||!N?0*P:P/0:NaN);for(w=(y=new G(P)).c=[],P=o+(l=i.e-n.e)+1,h||(h=c,l=p(i.e/u)-p(n.e/u),P=P/u|0),d=0;N[d]==(I[d]||0);d++);if(N[d]>(I[d]||0)&&l--,P<0)w.push(1),b=!0;else{for(O=I.length,x=N.length,d=0,P+=2,(g=s(h/(N[0]+1)))>1&&(N=t(N,g,h),I=t(I,g,h),x=N.length,O=I.length),A=x,E=(_=I.slice(0,x)).length;E<x;_[E++]=0);R=N.slice(),R=[0].concat(R),T=N[0],N[1]>=h/2&&T++;do{if(g=0,(f=e(N,_,x,E))<0){if(S=_[0],x!=E&&(S=S*h+(_[1]||0)),(g=s(S/T))>1)for(g>=h&&(g=h-1),v=(m=t(N,g,h)).length,E=_.length;1==e(m,_,v,E);)g--,r(m,x<v?R:N,v,h),v=m.length,f=1;else 0==g&&(f=g=1),v=(m=N.slice()).length;if(v<E&&(m=[0].concat(m)),r(_,m,E,h),E=_.length,-1==f)for(;e(N,_,x,E)<1;)g++,r(_,x<E?R:N,E,h),E=_.length}else 0===f&&(g++,_=[0]);w[d++]=g,_[0]?_[E++]=I[A]||0:(_=[I[A]],E=1)}while((A++<O||null!=_[0])&&P--);b=null!=_[0],w[0]||w.splice(0,1)}if(h==c){for(d=1,P=w[0];P>=10;P/=10,d++);Z(y,o+(y.e=d+l*u-1)+1,a,b)}else y.e=l,y.r=+b;return y}}(),O=/^(-?)0([xbo])(?=\w[\w.]*$)/i,T=/^([^.]+)\.$/,x=/^\.([^.]+)$/,R=/^-?(Infinity|NaN)$/,P=/^\s*\+(?=[\w.])|^\s+|\s+$/g,E=function(t,e,r,i){var n,s=r?e:e.replace(P,"");if(R.test(s))t.s=isNaN(s)?null:s<0?-1:1;else{if(!r&&(s=s.replace(O,(function(t,e,r){return n="x"==(r=r.toLowerCase())?16:"b"==r?2:8,i&&i!=n?t:e})),i&&(n=i,s=s.replace(T,"$1").replace(x,"0.$1")),e!=s))return new G(s,n);if(G.DEBUG)throw Error(o+"Not a"+(i?" base "+i:"")+" number: "+e);t.s=null}t.c=t.e=null},I.absoluteValue=I.abs=function(){var t=new G(this);return t.s<0&&(t.s=1),t},I.comparedTo=function(t,e){return g(this,new G(t,e))},I.decimalPlaces=I.dp=function(t,e){var r,i,n,s=this;if(null!=t)return m(t,0,d),null==e?e=k:m(e,0,8),Z(new G(s),t+s.e+1,e);if(!(r=s.c))return null;if(i=((n=r.length-1)-p(this.e/u))*u,n=r[n])for(;n%10==0;n/=10,i--);return i<0&&(i=0),i},I.dividedBy=I.div=function(t,e){return r(this,new G(t,e),M,k)},I.dividedToIntegerBy=I.idiv=function(t,e){return r(this,new G(t,e),0,1)},I.exponentiatedBy=I.pow=function(t,e){var r,i,a,c,h,f,l,d,p=this;if((t=new G(t)).c&&!t.isInteger())throw Error(o+"Exponent not an integer: "+W(t));if(null!=e&&(e=new G(e)),h=t.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!t.c||!t.c[0])return d=new G(Math.pow(+W(p),h?2-v(t):+W(t))),e?d.mod(e):d;if(f=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new G(NaN);(i=!f&&p.isInteger()&&e.isInteger())&&(p=p.mod(e))}else{if(t.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||h&&p.c[1]>=24e7:p.c[0]<8e13||h&&p.c[0]<=9999975e7)))return c=p.s<0&&v(t)?-0:0,p.e>-1&&(c=1/c),new G(f?1/c:c);K&&(c=n(K/u+2))}for(h?(r=new G(.5),f&&(t.s=1),l=v(t)):l=(a=Math.abs(+W(t)))%2,d=new G(N);;){if(l){if(!(d=d.times(p)).c)break;c?d.c.length>c&&(d.c.length=c):i&&(d=d.mod(e))}if(a){if(0===(a=s(a/2)))break;l=a%2}else if(Z(t=t.times(r),t.e+1,1),t.e>14)l=v(t);else{if(0===(a=+W(t)))break;l=a%2}p=p.times(p),c?p.c&&p.c.length>c&&(p.c.length=c):i&&(p=p.mod(e))}return i?d:(f&&(d=N.div(d)),e?d.mod(e):c?Z(d,K,k,undefined):d)},I.integerValue=function(t){var e=new G(this);return null==t?t=k:m(t,0,8),Z(e,e.e+1,t)},I.isEqualTo=I.eq=function(t,e){return 0===g(this,new G(t,e))},I.isFinite=function(){return!!this.c},I.isGreaterThan=I.gt=function(t,e){return g(this,new G(t,e))>0},I.isGreaterThanOrEqualTo=I.gte=function(t,e){return 1===(e=g(this,new G(t,e)))||0===e},I.isInteger=function(){return!!this.c&&p(this.e/u)>this.c.length-2},I.isLessThan=I.lt=function(t,e){return g(this,new G(t,e))<0},I.isLessThanOrEqualTo=I.lte=function(t,e){return-1===(e=g(this,new G(t,e)))||0===e},I.isNaN=function(){return!this.s},I.isNegative=function(){return this.s<0},I.isPositive=function(){return this.s>0},I.isZero=function(){return!!this.c&&0==this.c[0]},I.minus=function(t,e){var r,i,n,s,o=this,a=o.s;if(e=(t=new G(t,e)).s,!a||!e)return new G(NaN);if(a!=e)return t.s=-e,o.plus(t);var h=o.e/u,f=t.e/u,l=o.c,d=t.c;if(!h||!f){if(!l||!d)return l?(t.s=-e,t):new G(d?o:NaN);if(!l[0]||!d[0])return d[0]?(t.s=-e,t):new G(l[0]?o:3==k?-0:0)}if(h=p(h),f=p(f),l=l.slice(),a=h-f){for((s=a<0)?(a=-a,n=l):(f=h,n=d),n.reverse(),e=a;e--;n.push(0));n.reverse()}else for(i=(s=(a=l.length)<(e=d.length))?a:e,a=e=0;e<i;e++)if(l[e]!=d[e]){s=l[e]<d[e];break}if(s&&(n=l,l=d,d=n,t.s=-t.s),(e=(i=d.length)-(r=l.length))>0)for(;e--;l[r++]=0);for(e=c-1;i>a;){if(l[--i]<d[i]){for(r=i;r&&!l[--r];l[r]=e);--l[r],l[i]+=c}l[i]-=d[i]}for(;0==l[0];l.splice(0,1),--f);return l[0]?q(t,l,f):(t.s=3==k?-1:1,t.c=[t.e=0],t)},I.modulo=I.mod=function(t,e){var i,n,s=this;return t=new G(t,e),!s.c||!t.s||t.c&&!t.c[0]?new G(NaN):!t.c||s.c&&!s.c[0]?new G(s):(9==j?(n=t.s,t.s=1,i=r(s,t,0,3),t.s=n,i.s*=n):i=r(s,t,0,j),(t=s.minus(i.times(t))).c[0]||1!=j||(t.s=s.s),t)},I.multipliedBy=I.times=function(t,e){var r,i,n,s,o,a,h,f,d,b,g,m,v,y,w,_=this,E=_.c,S=(t=new G(t,e)).c;if(!(E&&S&&E[0]&&S[0]))return!_.s||!t.s||E&&!E[0]&&!S||S&&!S[0]&&!E?t.c=t.e=t.s=null:(t.s*=_.s,E&&S?(t.c=[0],t.e=0):t.c=t.e=null),t;for(i=p(_.e/u)+p(t.e/u),t.s*=_.s,(h=E.length)<(b=S.length)&&(v=E,E=S,S=v,n=h,h=b,b=n),n=h+b,v=[];n--;v.push(0));for(y=c,w=l,n=b;--n>=0;){for(r=0,g=S[n]%w,m=S[n]/w|0,s=n+(o=h);s>n;)r=((f=g*(f=E[--o]%w)+(a=m*f+(d=E[o]/w|0)*g)%w*w+v[s]+r)/y|0)+(a/w|0)+m*d,v[s--]=f%y;v[s]=r}return r?++i:v.splice(0,1),q(t,v,i)},I.negated=function(){var t=new G(this);return t.s=-t.s||null,t},I.plus=function(t,e){var r,i=this,n=i.s;if(e=(t=new G(t,e)).s,!n||!e)return new G(NaN);if(n!=e)return t.s=-e,i.minus(t);var s=i.e/u,o=t.e/u,a=i.c,h=t.c;if(!s||!o){if(!a||!h)return new G(n/0);if(!a[0]||!h[0])return h[0]?t:new G(a[0]?i:0*n)}if(s=p(s),o=p(o),a=a.slice(),n=s-o){for(n>0?(o=s,r=h):(n=-n,r=a),r.reverse();n--;r.push(0));r.reverse()}for((n=a.length)-(e=h.length)<0&&(r=h,h=a,a=r,e=n),n=0;e;)n=(a[--e]=a[e]+h[e]+n)/c|0,a[e]=c===a[e]?0:a[e]%c;return n&&(a=[n].concat(a),++o),q(t,a,o)},I.precision=I.sd=function(t,e){var r,i,n,s=this;if(null!=t&&t!==!!t)return m(t,1,d),null==e?e=k:m(e,0,8),Z(new G(s),t,e);if(!(r=s.c))return null;if(i=(n=r.length-1)*u+1,n=r[n]){for(;n%10==0;n/=10,i--);for(n=r[0];n>=10;n/=10,i++);}return t&&s.e+1>i&&(i=s.e+1),i},I.shiftedBy=function(t){return m(t,-9007199254740991,h),this.times("1e"+t)},I.squareRoot=I.sqrt=function(){var t,e,i,n,s,o=this,a=o.c,c=o.s,u=o.e,h=M+4,f=new G("0.5");if(1!==c||!a||!a[0])return new G(!c||c<0&&(!a||a[0])?NaN:a?o:1/0);if(0==(c=Math.sqrt(+W(o)))||c==1/0?(((e=b(a)).length+u)%2==0&&(e+="0"),c=Math.sqrt(+e),u=p((u+1)/2)-(u<0||u%2),i=new G(e=c==1/0?"5e"+u:(e=c.toExponential()).slice(0,e.indexOf("e")+1)+u)):i=new G(c+""),i.c[0])for((c=(u=i.e)+h)<3&&(c=0);;)if(s=i,i=f.times(s.plus(r(o,s,h,1))),b(s.c).slice(0,c)===(e=b(i.c)).slice(0,c)){if(i.e<u&&--c,"9999"!=(e=e.slice(c-3,c+1))&&(n||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(Z(i,i.e+M+2,1),t=!i.times(i).eq(o));break}if(!n&&(Z(s,s.e+M+2,0),s.times(s).eq(o))){i=s;break}h+=4,c+=4,n=1}return Z(i,i.e+M+1,k,t)},I.toExponential=function(t,e){return null!=t&&(m(t,0,d),t++),$(this,t,e,1)},I.toFixed=function(t,e){return null!=t&&(m(t,0,d),t=t+this.e+1),$(this,t,e)},I.toFormat=function(t,e,r){var i,n=this;if(null==r)null!=t&&e&&"object"==typeof e?(r=e,e=null):t&&"object"==typeof t?(r=t,t=e=null):r=V;else if("object"!=typeof r)throw Error(o+"Argument not an object: "+r);if(i=n.toFixed(t,e),n.c){var s,a=i.split("."),c=+r.groupSize,u=+r.secondaryGroupSize,h=r.groupSeparator||"",f=a[0],l=a[1],d=n.s<0,p=d?f.slice(1):f,b=p.length;if(u&&(s=c,c=u,u=s,b-=s),c>0&&b>0){for(s=b%c||c,f=p.substr(0,s);s<b;s+=c)f+=h+p.substr(s,c);u>0&&(f+=h+p.slice(s)),d&&(f="-"+f)}i=l?f+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?l.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):l):f}return(r.prefix||"")+i+(r.suffix||"")},I.toFraction=function(t){var e,i,n,s,a,c,h,l,d,p,g,m,v=this,y=v.c;if(null!=t&&(!(h=new G(t)).isInteger()&&(h.c||1!==h.s)||h.lt(N)))throw Error(o+"Argument "+(h.isInteger()?"out of range: ":"not an integer: ")+W(h));if(!y)return new G(v);for(e=new G(N),d=i=new G(N),n=l=new G(N),m=b(y),a=e.e=m.length-v.e-1,e.c[0]=f[(c=a%u)<0?u+c:c],t=!t||h.comparedTo(e)>0?a>0?e:d:h,c=D,D=1/0,h=new G(m),l.c[0]=0;p=r(h,e,0,1),1!=(s=i.plus(p.times(n))).comparedTo(t);)i=n,n=s,d=l.plus(p.times(s=d)),l=s,e=h.minus(p.times(s=e)),h=s;return s=r(t.minus(i),n,0,1),l=l.plus(s.times(d)),i=i.plus(s.times(n)),l.s=d.s=v.s,g=r(d,n,a*=2,k).minus(v).abs().comparedTo(r(l,i,a,k).minus(v).abs())<1?[d,n]:[l,i],D=c,g},I.toNumber=function(){return+W(this)},I.toPrecision=function(t,e){return null!=t&&m(t,1,d),$(this,t,e,2)},I.toString=function(t){var e,r=this,i=r.s,n=r.e;return null===n?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(null==t?e=n<=L||n>=C?y(b(r.c),n):w(b(r.c),n,"0"):10===t&&H?e=w(b((r=Z(new G(r),M+n+1,k)).c),r.e,"0"):(m(t,2,F.length,"Base"),e=_(w(b(r.c),n,"0"),10,t,i,!0)),i<0&&r.c[0]&&(e="-"+e)),e},I.valueOf=I.toJSON=function(){return W(this)},I._isBigNumber=!0,I[Symbol.toStringTag]="BigNumber",I[Symbol.for("nodejs.util.inspect.custom")]=I.valueOf,null!=e&&G.set(e),G}();const E=_},763:t=>{"use strict";t.exports={i8:"6.5.4"}}},i={};function n(t){var e=i[t];if(void 0!==e)return e.exports;var s=i[t]={id:t,loaded:!1,exports:{}};return r[t].call(s.exports,s,s.exports,n),s.loaded=!0,s.exports}return n.m=r,n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.f={},n.e=t=>Promise.all(Object.keys(n.f).reduce(((e,r)=>(n.f[r](t,e),e)),[])),n.u=t=>"dist/"+t+".taquito.min.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="taquito:",n.l=(r,i,s,o)=>{if(t[r])t[r].push(i);else{var a,c;if(void 0!==s)for(var u=document.getElementsByTagName("script"),h=0;h<u.length;h++){var f=u[h];if(f.getAttribute("src")==r||f.getAttribute("data-webpack")==e+s){a=f;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,n.nc&&a.setAttribute("nonce",n.nc),a.setAttribute("data-webpack",e+s),a.src=r,0!==a.src.indexOf(window.location.origin+"/")&&(a.crossOrigin="anonymous"),a.integrity=n.sriHashes[s.match(/^chunk-(.+)$/)[1]],a.crossOrigin="anonymous"),t[r]=[i];var l=(e,i)=>{a.onerror=a.onload=null,clearTimeout(d);var n=t[r];if(delete t[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((t=>t(i))),e)return e(i)},d=setTimeout(l.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=l.bind(null,a.onerror),a.onload=l.bind(null,a.onload),c&&document.head.appendChild(a)}},n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");r.length&&(t=r[r.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t+"../"})(),n.sriHashes={462:"sha384-UvtzH4LwwNxGc/Jb4FV5cZhAVvXuKcpf8RjLC02oG9slpnoBi5tBQ4duxpGSPaLb"},(()=>{var t={179:0};n.f.j=(e,r)=>{var i=n.o(t,e)?t[e]:void 0;if(0!==i)if(i)r.push(i[2]);else{var s=new Promise(((r,n)=>i=t[e]=[r,n]));r.push(i[2]=s);var o=n.p+n.u(e),a=new Error;n.l(o,(r=>{if(n.o(t,e)&&(0!==(i=t[e])&&(t[e]=void 0),i)){var s=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;a.message="Loading chunk "+e+" failed.\n("+s+": "+o+")",a.name="ChunkLoadError",a.type=s,a.request=o,i[1](a)}}),"chunk-"+e,e)}};var e=(e,r)=>{var i,s,[o,a,c]=r,u=0;if(o.some((e=>0!==t[e]))){for(i in a)n.o(a,i)&&(n.m[i]=a[i]);if(c)c(n)}for(e&&e(r);u<o.length;u++)s=o[u],n.o(t,s)&&t[s]&&t[s][0](),t[s]=0},r=self.webpackChunktaquito=self.webpackChunktaquito||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})(),n(2353)})()));
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.taquito=e():t.taquito=e()}(self,(()=>(()=>{var t,e,r={9437:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(5457);function n(t,e,r){return void 0===e&&(e=new Uint8Array(2)),void 0===r&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}function s(t,e,r){return void 0===e&&(e=new Uint8Array(2)),void 0===r&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}function o(t,e){return void 0===e&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}function a(t,e){return void 0===e&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}function c(t,e){return void 0===e&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}function u(t,e){return void 0===e&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}function h(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}function f(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}function l(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),h(t/4294967296>>>0,e,r),h(t>>>0,e,r+4),e}function d(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),f(t>>>0,e,r),f(t/4294967296>>>0,e,r+4),e}e.readInt16BE=function(t,e){return void 0===e&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16},e.readUint16BE=function(t,e){return void 0===e&&(e=0),(t[e+0]<<8|t[e+1])>>>0},e.readInt16LE=function(t,e){return void 0===e&&(e=0),(t[e+1]<<8|t[e])<<16>>16},e.readUint16LE=function(t,e){return void 0===e&&(e=0),(t[e+1]<<8|t[e])>>>0},e.writeUint16BE=n,e.writeInt16BE=n,e.writeUint16LE=s,e.writeInt16LE=s,e.readInt32BE=o,e.readUint32BE=a,e.readInt32LE=c,e.readUint32LE=u,e.writeUint32BE=h,e.writeInt32BE=h,e.writeUint32LE=f,e.writeInt32LE=f,e.readInt64BE=function(t,e){void 0===e&&(e=0);var r=o(t,e),i=o(t,e+4);return 4294967296*r+i-4294967296*(i>>31)},e.readUint64BE=function(t,e){return void 0===e&&(e=0),4294967296*a(t,e)+a(t,e+4)},e.readInt64LE=function(t,e){void 0===e&&(e=0);var r=c(t,e);return 4294967296*c(t,e+4)+r-4294967296*(r>>31)},e.readUint64LE=function(t,e){void 0===e&&(e=0);var r=u(t,e);return 4294967296*u(t,e+4)+r},e.writeUint64BE=l,e.writeInt64BE=l,e.writeUint64LE=d,e.writeInt64LE=d,e.readUintBE=function(t,e,r){if(void 0===r&&(r=0),t%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,n=1,s=t/8+r-1;s>=r;s--)i+=e[s]*n,n*=256;return i},e.readUintLE=function(t,e,r){if(void 0===r&&(r=0),t%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,n=1,s=r;s<r+t/8;s++)i+=e[s]*n,n*=256;return i},e.writeUintBE=function(t,e,r,n){if(void 0===r&&(r=new Uint8Array(t/8)),void 0===n&&(n=0),t%8!=0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!i.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var s=1,o=t/8+n-1;o>=n;o--)r[o]=e/s&255,s*=256;return r},e.writeUintLE=function(t,e,r,n){if(void 0===r&&(r=new Uint8Array(t/8)),void 0===n&&(n=0),t%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!i.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var s=1,o=n;o<n+t/8;o++)r[o]=e/s&255,s*=256;return r},e.readFloat32BE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(e)},e.readFloat32LE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(e,!0)},e.readFloat64BE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(e)},e.readFloat64LE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(e,!0)},e.writeFloat32BE=function(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat32(r,t),e},e.writeFloat32LE=function(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat32(r,t,!0),e},e.writeFloat64BE=function(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat64(r,t),e},e.writeFloat64LE=function(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat64(r,t,!0),e}},6851:(t,e,r)=>{"use strict";var i=r(9437),n=r(2887);e.cn=128,e.k=64,e.Cv=64,e.fg=16,e.fe=16,e.zS=Math.pow(2,32)-1,e.d=255,e.lV=255;var s=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),o=[[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6],[22,16,24,0,10,4,30,26,20,28,6,12,14,2,18,8],[14,18,6,2,26,24,22,28,4,12,10,20,8,0,30,16],[18,0,10,14,4,8,20,30,28,2,22,24,12,16,6,26],[4,24,12,20,0,22,16,6,8,26,14,10,30,28,2,18],[24,10,2,30,28,26,8,20,0,14,12,6,18,4,16,22],[26,22,14,28,24,2,6,18,10,0,30,8,16,12,4,20],[12,30,28,18,22,6,0,16,24,4,26,14,2,8,20,10],[20,4,16,8,14,12,2,10,30,22,18,28,6,24,26,0],[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6]],a=function(){function t(t,r){if(void 0===t&&(t=64),this.digestLength=t,this.blockSize=e.cn,this._state=new Int32Array(s),this._buffer=new Uint8Array(e.cn),this._bufferLength=0,this._ctr=new Uint32Array(4),this._flag=new Uint32Array(4),this._lastNode=!1,this._finished=!1,this._vtmp=new Uint32Array(32),this._mtmp=new Uint32Array(32),t<1||t>e.k)throw new Error("blake2b: wrong digest length");r&&this.validateConfig(r);var n=0;r&&r.key&&(n=r.key.length);var o=1,a=1;r&&r.tree&&(o=r.tree.fanout,a=r.tree.maxDepth),this._state[0]^=t|n<<8|o<<16|a<<24,r&&r.tree&&(this._state[1]^=r.tree.leafSize,this._state[2]^=r.tree.nodeOffsetLowBits,this._state[3]^=r.tree.nodeOffsetHighBits,this._state[4]^=r.tree.nodeDepth|r.tree.innerDigestLength<<8,this._lastNode=r.tree.lastNode),r&&r.salt&&(this._state[8]^=i.readUint32LE(r.salt,0),this._state[9]^=i.readUint32LE(r.salt,4),this._state[10]^=i.readUint32LE(r.salt,8),this._state[11]^=i.readUint32LE(r.salt,12)),r&&r.personalization&&(this._state[12]^=i.readUint32LE(r.personalization,0),this._state[13]^=i.readUint32LE(r.personalization,4),this._state[14]^=i.readUint32LE(r.personalization,8),this._state[15]^=i.readUint32LE(r.personalization,12)),this._initialState=new Uint32Array(this._state),r&&r.key&&n>0&&(this._paddedKey=new Uint8Array(e.cn),this._paddedKey.set(r.key),this._buffer.set(this._paddedKey),this._bufferLength=e.cn)}return t.prototype.reset=function(){return this._state.set(this._initialState),this._paddedKey?(this._buffer.set(this._paddedKey),this._bufferLength=e.cn):this._bufferLength=0,n.wipe(this._ctr),n.wipe(this._flag),this._finished=!1,this},t.prototype.validateConfig=function(t){if(t.key&&t.key.length>e.Cv)throw new Error("blake2b: wrong key length");if(t.salt&&t.salt.length!==e.fe)throw new Error("blake2b: wrong salt length");if(t.personalization&&t.personalization.length!==e.fg)throw new Error("blake2b: wrong personalization length");if(t.tree){if(t.tree.fanout<0||t.tree.fanout>e.d)throw new Error("blake2b: wrong tree fanout");if(t.tree.maxDepth<0||t.tree.maxDepth>e.lV)throw new Error("blake2b: wrong tree depth");if(t.tree.leafSize<0||t.tree.leafSize>e.zS)throw new Error("blake2b: wrong leaf size");if(t.tree.innerDigestLength<0||t.tree.innerDigestLength>e.k)throw new Error("blake2b: wrong tree inner digest length")}},t.prototype.update=function(t,r){if(void 0===r&&(r=t.length),this._finished)throw new Error("blake2b: can't update because hash was finished.");var i=e.cn-this._bufferLength,n=0;if(0===r)return this;if(r>i){for(var s=0;s<i;s++)this._buffer[this._bufferLength+s]=t[n+s];this._processBlock(e.cn),n+=i,r-=i,this._bufferLength=0}for(;r>e.cn;){for(s=0;s<e.cn;s++)this._buffer[s]=t[n+s];this._processBlock(e.cn),n+=e.cn,r-=e.cn,this._bufferLength=0}for(s=0;s<r;s++)this._buffer[this._bufferLength+s]=t[n+s];return this._bufferLength+=r,this},t.prototype.finish=function(t){if(!this._finished){for(var r=this._bufferLength;r<e.cn;r++)this._buffer[r]=0;this._flag[0]=4294967295,this._flag[1]=4294967295,this._lastNode&&(this._flag[2]=4294967295,this._flag[3]=4294967295),this._processBlock(this._bufferLength),this._finished=!0}var n=this._buffer.subarray(0,64);for(r=0;r<16;r++)i.writeUint32LE(this._state[r],n,4*r);return t.set(n.subarray(0,t.length)),this},t.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},t.prototype.clean=function(){n.wipe(this._vtmp),n.wipe(this._mtmp),n.wipe(this._state),n.wipe(this._buffer),n.wipe(this._initialState),this._paddedKey&&n.wipe(this._paddedKey),this._bufferLength=0,n.wipe(this._ctr),n.wipe(this._flag),this._lastNode=!1,this._finished=!1},t.prototype.saveState=function(){if(this._finished)throw new Error("blake2b: cannot save finished state");return{state:new Uint32Array(this._state),buffer:new Uint8Array(this._buffer),bufferLength:this._bufferLength,ctr:new Uint32Array(this._ctr),flag:new Uint32Array(this._flag),lastNode:this._lastNode,paddedKey:this._paddedKey?new Uint8Array(this._paddedKey):void 0,initialState:new Uint32Array(this._initialState)}},t.prototype.restoreState=function(t){return this._state.set(t.state),this._buffer.set(t.buffer),this._bufferLength=t.bufferLength,this._ctr.set(t.ctr),this._flag.set(t.flag),this._lastNode=t.lastNode,this._paddedKey&&n.wipe(this._paddedKey),this._paddedKey=t.paddedKey?new Uint8Array(t.paddedKey):void 0,this._initialState.set(t.initialState),this},t.prototype.cleanSavedState=function(t){n.wipe(t.state),n.wipe(t.buffer),n.wipe(t.initialState),t.paddedKey&&n.wipe(t.paddedKey),t.bufferLength=0,n.wipe(t.ctr),n.wipe(t.flag),t.lastNode=!1},t.prototype._G=function(t,e,r,i,n,s,o,a,c,u,h,f,l){var d=t[e],p=t[s],b=t[r],g=t[o],m=t[i],v=t[a],y=t[n],w=t[c],_=65535&d,E=d>>>16,S=65535&p,A=p>>>16;E+=b>>>16,S+=65535&g,A+=g>>>16,S+=(E+=(_+=65535&b)>>>16)>>>16,_=65535&(d=65535&_|E<<16),E=d>>>16,S=65535&(p=65535&S|(A+=S>>>16)<<16),A=p>>>16,E+=u>>>16,S+=65535&h,A+=h>>>16,d=65535&(_+=65535&u)|(E+=_>>>16)<<16,_=w^=p=65535&(S+=E>>>16)|(A+=S>>>16)<<16,w=y^=d,y=_,_=65535&m,E=m>>>16,S=65535&v,A=v>>>16,E+=y>>>16,S+=65535&w,A+=w>>>16,_=(b^=m=65535&(_+=65535&y)|(E+=_>>>16)<<16)<<8|(g^=v=65535&(S+=E>>>16)|(A+=S>>>16)<<16)>>>24,b=g<<8|b>>>24,g=_,_=65535&d,E=d>>>16,S=65535&p,A=p>>>16,E+=b>>>16,S+=65535&g,A+=g>>>16,S+=(E+=(_+=65535&b)>>>16)>>>16,_=65535&(d=65535&_|E<<16),E=d>>>16,S=65535&(p=65535&S|(A+=S>>>16)<<16),A=p>>>16,E+=f>>>16,S+=65535&l,A+=l>>>16,_=(y^=d=65535&(_+=65535&f)|(E+=_>>>16)<<16)<<16|(w^=p=65535&(S+=E>>>16)|(A+=S>>>16)<<16)>>>16,y=w<<16|y>>>16,w=_,_=65535&m,E=m>>>16,S=65535&v,A=v>>>16,E+=y>>>16,S+=65535&w,A+=w>>>16,_=(g^=v=65535&(S+=(E+=(_+=65535&y)>>>16)>>>16)|(A+=S>>>16)<<16)<<1|(b^=m=65535&_|E<<16)>>>31,b=b<<1|g>>>31,g=_,t[e]=d,t[s]=p,t[r]=b,t[o]=g,t[i]=m,t[a]=v,t[n]=y,t[c]=w},t.prototype._incrementCounter=function(t){for(var e=0;e<3;e++){var r=this._ctr[e]+t;if(this._ctr[e]=r>>>0,this._ctr[e]===r)return;t=1}},t.prototype._processBlock=function(t){this._incrementCounter(t);var e=this._vtmp;e.set(this._state),e.set(s,16),e[24]^=this._ctr[0],e[25]^=this._ctr[1],e[26]^=this._ctr[2],e[27]^=this._ctr[3],e[28]^=this._flag[0],e[29]^=this._flag[1],e[30]^=this._flag[2],e[31]^=this._flag[3];for(var r=this._mtmp,n=0;n<32;n++)r[n]=i.readUint32LE(this._buffer,4*n);for(var a=0;a<12;a++)this._G(e,0,8,16,24,1,9,17,25,r[o[a][0]],r[o[a][0]+1],r[o[a][1]],r[o[a][1]+1]),this._G(e,2,10,18,26,3,11,19,27,r[o[a][2]],r[o[a][2]+1],r[o[a][3]],r[o[a][3]+1]),this._G(e,4,12,20,28,5,13,21,29,r[o[a][4]],r[o[a][4]+1],r[o[a][5]],r[o[a][5]+1]),this._G(e,6,14,22,30,7,15,23,31,r[o[a][6]],r[o[a][6]+1],r[o[a][7]],r[o[a][7]+1]),this._G(e,0,10,20,30,1,11,21,31,r[o[a][8]],r[o[a][8]+1],r[o[a][9]],r[o[a][9]+1]),this._G(e,2,12,22,24,3,13,23,25,r[o[a][10]],r[o[a][10]+1],r[o[a][11]],r[o[a][11]+1]),this._G(e,4,14,16,26,5,15,17,27,r[o[a][12]],r[o[a][12]+1],r[o[a][13]],r[o[a][13]+1]),this._G(e,6,8,18,28,7,9,19,29,r[o[a][14]],r[o[a][14]+1],r[o[a][15]],r[o[a][15]+1]);for(n=0;n<16;n++)this._state[n]^=e[n]^e[n+16]},t}();e.vp=function(t,r,i){void 0===r&&(r=e.k);var n=new a(r,i);n.update(t);var s=n.digest();return n.clean(),s}},7728:(t,e,r)=>{"use strict";e.T=e.aP=e.KS=e.jQ=void 0;const i=r(1293),n=r(6756),s=r(2887);function o(t){const e=new Float64Array(16);if(t)for(let r=0;r<t.length;r++)e[r]=t[r];return e}e.jQ=64,e.KS=64,e.aP=32;new Uint8Array(32)[0]=9;const a=o(),c=o([1]),u=o([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=o([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),f=o([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),l=o([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),d=o([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(t,e){for(let r=0;r<16;r++)t[r]=0|e[r]}function b(t){let e=1;for(let r=0;r<16;r++){let i=t[r]+e+65535;e=Math.floor(i/65536),t[r]=i-65536*e}t[0]+=e-1+37*(e-1)}function g(t,e,r){const i=~(r-1);for(let r=0;r<16;r++){const n=i&(t[r]^e[r]);t[r]^=n,e[r]^=n}}function m(t,e){const r=o(),i=o();for(let t=0;t<16;t++)i[t]=e[t];b(i),b(i),b(i);for(let t=0;t<2;t++){r[0]=i[0]-65517;for(let t=1;t<15;t++)r[t]=i[t]-65535-(r[t-1]>>16&1),r[t-1]&=65535;r[15]=i[15]-32767-(r[14]>>16&1);const t=r[15]>>16&1;r[14]&=65535,g(i,r,1-t)}for(let e=0;e<16;e++)t[2*e]=255&i[e],t[2*e+1]=i[e]>>8}function v(t,e){let r=0;for(let i=0;i<32;i++)r|=t[i]^e[i];return(1&r-1>>>8)-1}function y(t,e){const r=new Uint8Array(32),i=new Uint8Array(32);return m(r,t),m(i,e),v(r,i)}function w(t){const e=new Uint8Array(32);return m(e,t),1&e[0]}function _(t,e,r){for(let i=0;i<16;i++)t[i]=e[i]+r[i]}function E(t,e,r){for(let i=0;i<16;i++)t[i]=e[i]-r[i]}function S(t,e,r){let i,n,s=0,o=0,a=0,c=0,u=0,h=0,f=0,l=0,d=0,p=0,b=0,g=0,m=0,v=0,y=0,w=0,_=0,E=0,S=0,A=0,O=0,T=0,x=0,P=0,R=0,I=0,N=0,M=0,k=0,L=0,C=0,B=r[0],D=r[1],U=r[2],j=r[3],K=r[4],V=r[5],F=r[6],H=r[7],G=r[8],$=r[9],z=r[10],q=r[11],Z=r[12],W=r[13],Y=r[14],J=r[15];i=e[0],s+=i*B,o+=i*D,a+=i*U,c+=i*j,u+=i*K,h+=i*V,f+=i*F,l+=i*H,d+=i*G,p+=i*$,b+=i*z,g+=i*q,m+=i*Z,v+=i*W,y+=i*Y,w+=i*J,i=e[1],o+=i*B,a+=i*D,c+=i*U,u+=i*j,h+=i*K,f+=i*V,l+=i*F,d+=i*H,p+=i*G,b+=i*$,g+=i*z,m+=i*q,v+=i*Z,y+=i*W,w+=i*Y,_+=i*J,i=e[2],a+=i*B,c+=i*D,u+=i*U,h+=i*j,f+=i*K,l+=i*V,d+=i*F,p+=i*H,b+=i*G,g+=i*$,m+=i*z,v+=i*q,y+=i*Z,w+=i*W,_+=i*Y,E+=i*J,i=e[3],c+=i*B,u+=i*D,h+=i*U,f+=i*j,l+=i*K,d+=i*V,p+=i*F,b+=i*H,g+=i*G,m+=i*$,v+=i*z,y+=i*q,w+=i*Z,_+=i*W,E+=i*Y,S+=i*J,i=e[4],u+=i*B,h+=i*D,f+=i*U,l+=i*j,d+=i*K,p+=i*V,b+=i*F,g+=i*H,m+=i*G,v+=i*$,y+=i*z,w+=i*q,_+=i*Z,E+=i*W,S+=i*Y,A+=i*J,i=e[5],h+=i*B,f+=i*D,l+=i*U,d+=i*j,p+=i*K,b+=i*V,g+=i*F,m+=i*H,v+=i*G,y+=i*$,w+=i*z,_+=i*q,E+=i*Z,S+=i*W,A+=i*Y,O+=i*J,i=e[6],f+=i*B,l+=i*D,d+=i*U,p+=i*j,b+=i*K,g+=i*V,m+=i*F,v+=i*H,y+=i*G,w+=i*$,_+=i*z,E+=i*q,S+=i*Z,A+=i*W,O+=i*Y,T+=i*J,i=e[7],l+=i*B,d+=i*D,p+=i*U,b+=i*j,g+=i*K,m+=i*V,v+=i*F,y+=i*H,w+=i*G,_+=i*$,E+=i*z,S+=i*q,A+=i*Z,O+=i*W,T+=i*Y,x+=i*J,i=e[8],d+=i*B,p+=i*D,b+=i*U,g+=i*j,m+=i*K,v+=i*V,y+=i*F,w+=i*H,_+=i*G,E+=i*$,S+=i*z,A+=i*q,O+=i*Z,T+=i*W,x+=i*Y,P+=i*J,i=e[9],p+=i*B,b+=i*D,g+=i*U,m+=i*j,v+=i*K,y+=i*V,w+=i*F,_+=i*H,E+=i*G,S+=i*$,A+=i*z,O+=i*q,T+=i*Z,x+=i*W,P+=i*Y,R+=i*J,i=e[10],b+=i*B,g+=i*D,m+=i*U,v+=i*j,y+=i*K,w+=i*V,_+=i*F,E+=i*H,S+=i*G,A+=i*$,O+=i*z,T+=i*q,x+=i*Z,P+=i*W,R+=i*Y,I+=i*J,i=e[11],g+=i*B,m+=i*D,v+=i*U,y+=i*j,w+=i*K,_+=i*V,E+=i*F,S+=i*H,A+=i*G,O+=i*$,T+=i*z,x+=i*q,P+=i*Z,R+=i*W,I+=i*Y,N+=i*J,i=e[12],m+=i*B,v+=i*D,y+=i*U,w+=i*j,_+=i*K,E+=i*V,S+=i*F,A+=i*H,O+=i*G,T+=i*$,x+=i*z,P+=i*q,R+=i*Z,I+=i*W,N+=i*Y,M+=i*J,i=e[13],v+=i*B,y+=i*D,w+=i*U,_+=i*j,E+=i*K,S+=i*V,A+=i*F,O+=i*H,T+=i*G,x+=i*$,P+=i*z,R+=i*q,I+=i*Z,N+=i*W,M+=i*Y,k+=i*J,i=e[14],y+=i*B,w+=i*D,_+=i*U,E+=i*j,S+=i*K,A+=i*V,O+=i*F,T+=i*H,x+=i*G,P+=i*$,R+=i*z,I+=i*q,N+=i*Z,M+=i*W,k+=i*Y,L+=i*J,i=e[15],w+=i*B,_+=i*D,E+=i*U,S+=i*j,A+=i*K,O+=i*V,T+=i*F,x+=i*H,P+=i*G,R+=i*$,I+=i*z,N+=i*q,M+=i*Z,k+=i*W,L+=i*Y,C+=i*J,s+=38*_,o+=38*E,a+=38*S,c+=38*A,u+=38*O,h+=38*T,f+=38*x,l+=38*P,d+=38*R,p+=38*I,b+=38*N,g+=38*M,m+=38*k,v+=38*L,y+=38*C,n=1,i=s+n+65535,n=Math.floor(i/65536),s=i-65536*n,i=o+n+65535,n=Math.floor(i/65536),o=i-65536*n,i=a+n+65535,n=Math.floor(i/65536),a=i-65536*n,i=c+n+65535,n=Math.floor(i/65536),c=i-65536*n,i=u+n+65535,n=Math.floor(i/65536),u=i-65536*n,i=h+n+65535,n=Math.floor(i/65536),h=i-65536*n,i=f+n+65535,n=Math.floor(i/65536),f=i-65536*n,i=l+n+65535,n=Math.floor(i/65536),l=i-65536*n,i=d+n+65535,n=Math.floor(i/65536),d=i-65536*n,i=p+n+65535,n=Math.floor(i/65536),p=i-65536*n,i=b+n+65535,n=Math.floor(i/65536),b=i-65536*n,i=g+n+65535,n=Math.floor(i/65536),g=i-65536*n,i=m+n+65535,n=Math.floor(i/65536),m=i-65536*n,i=v+n+65535,n=Math.floor(i/65536),v=i-65536*n,i=y+n+65535,n=Math.floor(i/65536),y=i-65536*n,i=w+n+65535,n=Math.floor(i/65536),w=i-65536*n,s+=n-1+37*(n-1),n=1,i=s+n+65535,n=Math.floor(i/65536),s=i-65536*n,i=o+n+65535,n=Math.floor(i/65536),o=i-65536*n,i=a+n+65535,n=Math.floor(i/65536),a=i-65536*n,i=c+n+65535,n=Math.floor(i/65536),c=i-65536*n,i=u+n+65535,n=Math.floor(i/65536),u=i-65536*n,i=h+n+65535,n=Math.floor(i/65536),h=i-65536*n,i=f+n+65535,n=Math.floor(i/65536),f=i-65536*n,i=l+n+65535,n=Math.floor(i/65536),l=i-65536*n,i=d+n+65535,n=Math.floor(i/65536),d=i-65536*n,i=p+n+65535,n=Math.floor(i/65536),p=i-65536*n,i=b+n+65535,n=Math.floor(i/65536),b=i-65536*n,i=g+n+65535,n=Math.floor(i/65536),g=i-65536*n,i=m+n+65535,n=Math.floor(i/65536),m=i-65536*n,i=v+n+65535,n=Math.floor(i/65536),v=i-65536*n,i=y+n+65535,n=Math.floor(i/65536),y=i-65536*n,i=w+n+65535,n=Math.floor(i/65536),w=i-65536*n,s+=n-1+37*(n-1),t[0]=s,t[1]=o,t[2]=a,t[3]=c,t[4]=u,t[5]=h,t[6]=f,t[7]=l,t[8]=d,t[9]=p,t[10]=b,t[11]=g,t[12]=m,t[13]=v,t[14]=y,t[15]=w}function A(t,e){S(t,e,e)}function O(t,e){const r=o();let i;for(i=0;i<16;i++)r[i]=e[i];for(i=253;i>=0;i--)A(r,r),2!==i&&4!==i&&S(r,r,e);for(i=0;i<16;i++)t[i]=r[i]}function T(t,e){const r=o(),i=o(),n=o(),s=o(),a=o(),c=o(),u=o(),f=o(),l=o();E(r,t[1],t[0]),E(l,e[1],e[0]),S(r,r,l),_(i,t[0],t[1]),_(l,e[0],e[1]),S(i,i,l),S(n,t[3],e[3]),S(n,n,h),S(s,t[2],e[2]),_(s,s,s),E(a,i,r),E(c,s,n),_(u,s,n),_(f,i,r),S(t[0],a,c),S(t[1],f,u),S(t[2],u,c),S(t[3],a,f)}function x(t,e,r){for(let i=0;i<4;i++)g(t[i],e[i],r)}function P(t,e){const r=o(),i=o(),n=o();O(n,e[2]),S(r,e[0],n),S(i,e[1],n),m(t,i),t[31]^=w(r)<<7}function R(t,e,r){p(t[0],a),p(t[1],c),p(t[2],c),p(t[3],a);for(let i=255;i>=0;--i){const n=r[i/8|0]>>(7&i)&1;x(t,e,n),T(e,t),T(t,t),x(t,e,n)}}function I(t,e){const r=[o(),o(),o(),o()];p(r[0],f),p(r[1],l),p(r[2],c),S(r[3],f,l),R(t,r,e)}function N(t){if(t.length!==e.aP)throw new Error(`ed25519: seed must be ${e.aP} bytes`);const r=(0,n.hash)(t);r[0]&=248,r[31]&=127,r[31]|=64;const i=new Uint8Array(32),s=[o(),o(),o(),o()];I(s,r),P(i,s);const a=new Uint8Array(64);return a.set(t),a.set(i,32),{publicKey:i,secretKey:a}}const M=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 k(t,e){let r,i,n,s;for(i=63;i>=32;--i){for(r=0,n=i-32,s=i-12;n<s;++n)e[n]+=r-16*e[i]*M[n-(i-32)],r=Math.floor((e[n]+128)/256),e[n]-=256*r;e[n]+=r,e[i]=0}for(r=0,n=0;n<32;n++)e[n]+=r-(e[31]>>4)*M[n],r=e[n]>>8,e[n]&=255;for(n=0;n<32;n++)e[n]-=r*M[n];for(i=0;i<32;i++)e[i+1]+=e[i]>>8,t[i]=255&e[i]}function L(t){const e=new Float64Array(64);for(let r=0;r<64;r++)e[r]=t[r];for(let e=0;e<64;e++)t[e]=0;k(t,e)}function C(t,e){const r=o(),i=o(),n=o(),s=o(),h=o(),f=o(),l=o();return p(t[2],c),function(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}(t[1],e),A(n,t[1]),S(s,n,u),E(n,n,t[2]),_(s,t[2],s),A(h,s),A(f,h),S(l,f,h),S(r,l,n),S(r,r,s),function(t,e){const r=o();let i;for(i=0;i<16;i++)r[i]=e[i];for(i=250;i>=0;i--)A(r,r),1!==i&&S(r,r,e);for(i=0;i<16;i++)t[i]=r[i]}(r,r),S(r,r,n),S(r,r,s),S(r,r,s),S(t[0],r,s),A(i,t[0]),S(i,i,s),y(i,n)&&S(t[0],t[0],d),A(i,t[0]),S(i,i,s),y(i,n)?-1:(w(t[0])===e[31]>>7&&E(t[0],a,t[0]),S(t[3],t[0],t[1]),0)}e.T=function(t,r,i){const s=new Uint8Array(32),a=[o(),o(),o(),o()],c=[o(),o(),o(),o()];if(i.length!==e.jQ)throw new Error(`ed25519: signature must be ${e.jQ} bytes`);if(C(c,t))return!1;const u=new n.SHA512;u.update(i.subarray(0,32)),u.update(t),u.update(r);const h=u.digest();return L(h),R(a,c,h),I(c,i.subarray(32)),T(a,c),P(s,a),!v(i,s)}},5457:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mul=Math.imul||function(t,e){var r=65535&t,i=65535&e;return r*i+((t>>>16&65535)*i+r*(e>>>16&65535)<<16>>>0)|0},e.add=function(t,e){return t+e|0},e.sub=function(t,e){return t-e|0},e.rotl=function(t,e){return t<<e|t>>>32-e},e.rotr=function(t,e){return t<<32-e|t>>>e},e.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(t){return e.isInteger(t)&&t>=-e.MAX_SAFE_INTEGER&&t<=e.MAX_SAFE_INTEGER}},1293:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const i=r(5147),n=r(9437),s=r(2887);function o(t,r=e.defaultRandomSource){return r.randomBytes(t)}e.defaultRandomSource=new i.SystemRandomSource,e.randomBytes=o,e.randomUint32=function(t=e.defaultRandomSource){const r=o(4,t),i=(0,n.readUint32LE)(r);return(0,s.wipe)(r),i};const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function c(t,r=a,i=e.defaultRandomSource){if(r.length<2)throw new Error("randomString charset is too short");if(r.length>256)throw new Error("randomString charset is too long");let n="";const c=r.length,u=256-256%c;for(;t>0;){const e=o(Math.ceil(256*t/u),i);for(let i=0;i<e.length&&t>0;i++){const s=e[i];s<u&&(n+=r.charAt(s%c),t--)}(0,s.wipe)(e)}return n}e.randomString=c,e.randomStringForEntropy=function(t,r=a,i=e.defaultRandomSource){return c(Math.ceil(t/(Math.log(r.length)/Math.LN2)),r,i)}},2017:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BrowserRandomSource=void 0;e.BrowserRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&void 0!==t.getRandomValues&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const e=new Uint8Array(t);for(let t=0;t<e.length;t+=65536)this._crypto.getRandomValues(e.subarray(t,t+Math.min(e.length-t,65536)));return e}}},7879:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NodeRandomSource=void 0;const i=r(2887);e.NodeRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{const t=r(5477);t&&t.randomBytes&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let e=this._crypto.randomBytes(t);if(e.length!==t)throw new Error("NodeRandomSource: got fewer bytes than requested");const r=new Uint8Array(t);for(let t=0;t<r.length;t++)r[t]=e[t];return(0,i.wipe)(e),r}}},5147:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SystemRandomSource=void 0;const i=r(2017),n=r(7879);e.SystemRandomSource=class{constructor(){return this.isAvailable=!1,this.name="",this._source=new i.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new n.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(t){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(t)}}},6756:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(9437),n=r(2887);e.DIGEST_LENGTH=64,e.BLOCK_SIZE=128;var s=function(){function t(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.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 t.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},t.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},t.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},t.prototype.update=function(t,r){if(void 0===r&&(r=t.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var i=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<e.BLOCK_SIZE&&r>0;)this._buffer[this._bufferLength++]=t[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,t,i,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=t[i++],r--;return this},t.prototype.finish=function(t){if(!this._finished){var e=this._bytesHashed,r=this._bufferLength,n=e/536870912|0,s=e<<3,o=e%128<112?128:256;this._buffer[r]=128;for(var c=r+1;c<o-8;c++)this._buffer[c]=0;i.writeUint32BE(n,this._buffer,o-8),i.writeUint32BE(s,this._buffer,o-4),a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,o),this._finished=!0}for(c=0;c<this.digestLength/8;c++)i.writeUint32BE(this._stateHi[c],t,8*c),i.writeUint32BE(this._stateLo[c],t,8*c+4);return this},t.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},t.prototype.saveState=function(){if(this._finished)throw new 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}},t.prototype.restoreState=function(t){return this._stateHi.set(t.stateHi),this._stateLo.set(t.stateLo),this._bufferLength=t.bufferLength,t.buffer&&this._buffer.set(t.buffer),this._bytesHashed=t.bytesHashed,this._finished=!1,this},t.prototype.cleanSavedState=function(t){n.wipe(t.stateHi),n.wipe(t.stateLo),t.buffer&&n.wipe(t.buffer),t.bufferLength=0,t.bytesHashed=0},t}();e.SHA512=s;var o=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(t,e,r,n,s,a,c){for(var u,h,f,l,d,p,b,g,m=r[0],v=r[1],y=r[2],w=r[3],_=r[4],E=r[5],S=r[6],A=r[7],O=n[0],T=n[1],x=n[2],P=n[3],R=n[4],I=n[5],N=n[6],M=n[7];c>=128;){for(var k=0;k<16;k++){var L=8*k+a;t[k]=i.readUint32BE(s,L),e[k]=i.readUint32BE(s,L+4)}for(k=0;k<80;k++){var C,B,D=m,U=v,j=y,K=w,V=_,F=E,H=S,G=O,$=T,z=x,q=P,Z=R,W=I,Y=N;if(d=65535&(h=M),p=h>>>16,b=65535&(u=A),g=u>>>16,d+=65535&(h=(R>>>14|_<<18)^(R>>>18|_<<14)^(_>>>9|R<<23)),p+=h>>>16,b+=65535&(u=(_>>>14|R<<18)^(_>>>18|R<<14)^(R>>>9|_<<23)),g+=u>>>16,d+=65535&(h=R&I^~R&N),p+=h>>>16,b+=65535&(u=_&E^~_&S),g+=u>>>16,u=o[2*k],d+=65535&(h=o[2*k+1]),p+=h>>>16,b+=65535&u,g+=u>>>16,u=t[k%16],p+=(h=e[k%16])>>>16,b+=65535&u,g+=u>>>16,b+=(p+=(d+=65535&h)>>>16)>>>16,d=65535&(h=l=65535&d|p<<16),p=h>>>16,b=65535&(u=f=65535&b|(g+=b>>>16)<<16),g=u>>>16,d+=65535&(h=(O>>>28|m<<4)^(m>>>2|O<<30)^(m>>>7|O<<25)),p+=h>>>16,b+=65535&(u=(m>>>28|O<<4)^(O>>>2|m<<30)^(O>>>7|m<<25)),g+=u>>>16,p+=(h=O&T^O&x^T&x)>>>16,b+=65535&(u=m&v^m&y^v&y),g+=u>>>16,C=65535&(b+=(p+=(d+=65535&h)>>>16)>>>16)|(g+=b>>>16)<<16,B=65535&d|p<<16,d=65535&(h=q),p=h>>>16,b=65535&(u=K),g=u>>>16,p+=(h=l)>>>16,b+=65535&(u=f),g+=u>>>16,v=D,y=U,w=j,_=K=65535&(b+=(p+=(d+=65535&h)>>>16)>>>16)|(g+=b>>>16)<<16,E=V,S=F,A=H,m=C,T=G,x=$,P=z,R=q=65535&d|p<<16,I=Z,N=W,M=Y,O=B,k%16==15)for(L=0;L<16;L++)u=t[L],d=65535&(h=e[L]),p=h>>>16,b=65535&u,g=u>>>16,u=t[(L+9)%16],d+=65535&(h=e[(L+9)%16]),p+=h>>>16,b+=65535&u,g+=u>>>16,f=t[(L+1)%16],d+=65535&(h=((l=e[(L+1)%16])>>>1|f<<31)^(l>>>8|f<<24)^(l>>>7|f<<25)),p+=h>>>16,b+=65535&(u=(f>>>1|l<<31)^(f>>>8|l<<24)^f>>>7),g+=u>>>16,f=t[(L+14)%16],p+=(h=((l=e[(L+14)%16])>>>19|f<<13)^(f>>>29|l<<3)^(l>>>6|f<<26))>>>16,b+=65535&(u=(f>>>19|l<<13)^(l>>>29|f<<3)^f>>>6),g+=u>>>16,g+=(b+=(p+=(d+=65535&h)>>>16)>>>16)>>>16,t[L]=65535&b|g<<16,e[L]=65535&d|p<<16}d=65535&(h=O),p=h>>>16,b=65535&(u=m),g=u>>>16,u=r[0],p+=(h=n[0])>>>16,b+=65535&u,g+=u>>>16,g+=(b+=(p+=(d+=65535&h)>>>16)>>>16)>>>16,r[0]=m=65535&b|g<<16,n[0]=O=65535&d|p<<16,d=65535&(h=T),p=h>>>16,b=65535&(u=v),g=u>>>16,u=r[1],p+=(h=n[1])>>>16,b+=65535&u,g+=u>>>16,g+=(b+=(p+=(d+=65535&h)>>>16)>>>16)>>>16,r[1]=v=65535&b|g<<16,n[1]=T=65535&d|p<<16,d=65535&(h=x),p=h>>>16,b=65535&(u=y),g=u>>>16,u=r[2],p+=(h=n[2])>>>16,b+=65535&u,g+=u>>>16,g+=(b+=(p+=(d+=65535&h)>>>16)>>>16)>>>16,r[2]=y=65535&b|g<<16,n[2]=x=65535&d|p<<16,d=65535&(h=P),p=h>>>16,b=65535&(u=w),g=u>>>16,u=r[3],p+=(h=n[3])>>>16,b+=65535&u,g+=u>>>16,g+=(b+=(p+=(d+=65535&h)>>>16)>>>16)>>>16,r[3]=w=65535&b|g<<16,n[3]=P=65535&d|p<<16,d=65535&(h=R),p=h>>>16,b=65535&(u=_),g=u>>>16,u=r[4],p+=(h=n[4])>>>16,b+=65535&u,g+=u>>>16,g+=(b+=(p+=(d+=65535&h)>>>16)>>>16)>>>16,r[4]=_=65535&b|g<<16,n[4]=R=65535&d|p<<16,d=65535&(h=I),p=h>>>16,b=65535&(u=E),g=u>>>16,u=r[5],p+=(h=n[5])>>>16,b+=65535&u,g+=u>>>16,g+=(b+=(p+=(d+=65535&h)>>>16)>>>16)>>>16,r[5]=E=65535&b|g<<16,n[5]=I=65535&d|p<<16,d=65535&(h=N),p=h>>>16,b=65535&(u=S),g=u>>>16,u=r[6],p+=(h=n[6])>>>16,b+=65535&u,g+=u>>>16,g+=(b+=(p+=(d+=65535&h)>>>16)>>>16)>>>16,r[6]=S=65535&b|g<<16,n[6]=N=65535&d|p<<16,d=65535&(h=M),p=h>>>16,b=65535&(u=A),g=u>>>16,u=r[7],p+=(h=n[7])>>>16,b+=65535&u,g+=u>>>16,g+=(b+=(p+=(d+=65535&h)>>>16)>>>16)>>>16,r[7]=A=65535&b|g<<16,n[7]=M=65535&d|p<<16,a+=128,c-=128}return a}e.hash=function(t){var e=new s;e.update(t);var r=e.digest();return e.clean(),r}},2887:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.wipe=function(t){for(var e=0;e<t.length;e++)t[e]=0;return t}},8166:(t,e,r)=>{"use strict";var i=r(7834).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var s=t.charAt(n),o=s.charCodeAt(0);if(255!==e[o])throw new TypeError(s+" is ambiguous");e[o]=n}var a=t.length,c=t.charAt(0),u=Math.log(a)/Math.log(256),h=Math.log(256)/Math.log(a);function f(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return i.alloc(0);for(var r=0,n=0,s=0;t[r]===c;)n++,r++;for(var o=(t.length-r)*u+1>>>0,h=new Uint8Array(o);t[r];){var f=e[t.charCodeAt(r)];if(255===f)return;for(var l=0,d=o-1;(0!==f||l<s)&&-1!==d;d--,l++)f+=a*h[d]>>>0,h[d]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");s=l,r++}for(var p=o-s;p!==o&&0===h[p];)p++;var b=i.allocUnsafe(n+(o-p));b.fill(0,0,n);for(var g=n;p!==o;)b[g++]=h[p++];return b}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=i.from(e)),!i.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,n=0,s=0,o=e.length;s!==o&&0===e[s];)s++,r++;for(var u=(o-s)*h+1>>>0,f=new Uint8Array(u);s!==o;){for(var l=e[s],d=0,p=u-1;(0!==l||d<n)&&-1!==p;p--,d++)l+=256*f[p]>>>0,f[p]=l%a>>>0,l=l/a>>>0;if(0!==l)throw new Error("Non-zero carry");n=d,s++}for(var b=u-n;b!==u&&0===f[b];)b++;for(var g=c.repeat(r);b<u;++b)g+=t.charAt(f[b]);return g},decodeUnsafe:f,decode:function(t){var e=f(t);if(e)return e;throw new Error("Non-base"+a+" character")}}}},5766:(t,e)=>{"use strict";e.byteLength=function(t){var e=c(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,s=c(t),o=s[0],a=s[1],u=new n(function(t,e,r){return 3*(e+r)/4-r}(0,o,a)),h=0,f=a>0?o-4:o;for(r=0;r<f;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],u[h++]=e>>16&255,u[h++]=e>>8&255,u[h++]=255&e;2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[h++]=255&e);1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[h++]=e>>8&255,u[h++]=255&e);return u},e.fromByteArray=function(t){for(var e,i=t.length,n=i%3,s=[],o=16383,a=0,c=i-n;a<c;a+=o)s.push(u(t,a,a+o>c?c:a+o));1===n?(e=t[i-1],s.push(r[e>>2]+r[e<<4&63]+"==")):2===n&&(e=(t[i-2]<<8)+t[i-1],s.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return 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 c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,i){for(var n,s,o=[],a=e;a<i;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(r[(s=n)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},6391:function(t,e,r){var i;!function(n){"use strict";var s,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,c=Math.floor,u="[BigNumber Error] ",h=u+"Number primitive has more than 15 significant digits: ",f=1e14,l=14,d=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],b=1e7,g=1e9;function m(t){var e=0|t;return t>0||t===e?e:e-1}function v(t){for(var e,r,i=1,n=t.length,s=t[0]+"";i<n;){for(e=t[i++]+"",r=l-e.length;r--;e="0"+e);s+=e}for(n=s.length;48===s.charCodeAt(--n););return s.slice(0,n+1||1)}function y(t,e){var r,i,n=t.c,s=e.c,o=t.s,a=e.s,c=t.e,u=e.e;if(!o||!a)return null;if(r=n&&!n[0],i=s&&!s[0],r||i)return r?i?0:-a:o;if(o!=a)return o;if(r=o<0,i=c==u,!n||!s)return i?0:!n^r?1:-1;if(!i)return c>u^r?1:-1;for(a=(c=n.length)<(u=s.length)?c:u,o=0;o<a;o++)if(n[o]!=s[o])return n[o]>s[o]^r?1:-1;return c==u?0:c>u^r?1:-1}function w(t,e,r,i){if(t<e||t>r||t!==c(t))throw Error(u+(i||"Argument")+("number"==typeof t?t<e||t>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function _(t){var e=t.c.length-1;return m(t.e/l)==e&&t.c[e]%2!=0}function E(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function S(t,e,r){var i,n;if(e<0){for(n=r+".";++e;n+=r);t=n+t}else if(++e>(i=t.length)){for(n=r,e-=i;--e;n+=r);t+=n}else e<i&&(t=t.slice(0,e)+"."+t.slice(e));return t}s=function t(e){var r,i,n,s,A,O,T,x,P,R,I=G.prototype={constructor:G,toString:null,valueOf:null},N=new G(1),M=20,k=4,L=-7,C=21,B=-1e7,D=1e7,U=!1,j=1,K=0,V={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz",H=!0;function G(t,e){var r,s,a,u,f,p,b,g,m=this;if(!(m instanceof G))return new G(t,e);if(null==e){if(t&&!0===t._isBigNumber)return m.s=t.s,void(!t.c||t.e>D?m.c=m.e=null:t.e<B?m.c=[m.e=0]:(m.e=t.e,m.c=t.c.slice()));if((p="number"==typeof t)&&0*t==0){if(m.s=1/t<0?(t=-t,-1):1,t===~~t){for(u=0,f=t;f>=10;f/=10,u++);return void(u>D?m.c=m.e=null:(m.e=u,m.c=[t]))}g=String(t)}else{if(!o.test(g=String(t)))return n(m,g,p);m.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(u=g.indexOf("."))>-1&&(g=g.replace(".","")),(f=g.search(/e/i))>0?(u<0&&(u=f),u+=+g.slice(f+1),g=g.substring(0,f)):u<0&&(u=g.length)}else{if(w(e,2,F.length,"Base"),10==e&&H)return Z(m=new G(t),M+m.e+1,k);if(g=String(t),p="number"==typeof t){if(0*t!=0)return n(m,g,p,e);if(m.s=1/t<0?(g=g.slice(1),-1):1,G.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(h+t)}else m.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=F.slice(0,e),u=f=0,b=g.length;f<b;f++)if(r.indexOf(s=g.charAt(f))<0){if("."==s){if(f>u){u=b;continue}}else if(!a&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){a=!0,f=-1,u=0;continue}return n(m,String(t),p,e)}p=!1,(u=(g=i(g,e,10,m.s)).indexOf("."))>-1?g=g.replace(".",""):u=g.length}for(f=0;48===g.charCodeAt(f);f++);for(b=g.length;48===g.charCodeAt(--b););if(g=g.slice(f,++b)){if(b-=f,p&&G.DEBUG&&b>15&&(t>d||t!==c(t)))throw Error(h+m.s*t);if((u=u-f-1)>D)m.c=m.e=null;else if(u<B)m.c=[m.e=0];else{if(m.e=u,m.c=[],f=(u+1)%l,u<0&&(f+=l),f<b){for(f&&m.c.push(+g.slice(0,f)),b-=l;f<b;)m.c.push(+g.slice(f,f+=l));f=l-(g=g.slice(f)).length}else f-=b;for(;f--;g+="0");m.c.push(+g)}}else m.c=[m.e=0]}function $(t,e,r,i){var n,s,o,a,c;if(null==r?r=k:w(r,0,8),!t.c)return t.toString();if(n=t.c[0],o=t.e,null==e)c=v(t.c),c=1==i||2==i&&(o<=L||o>=C)?E(c,o):S(c,o,"0");else if(s=(t=Z(new G(t),e,r)).e,a=(c=v(t.c)).length,1==i||2==i&&(e<=s||s<=L)){for(;a<e;c+="0",a++);c=E(c,s)}else if(e-=o,c=S(c,s,"0"),s+1>a){if(--e>0)for(c+=".";e--;c+="0");}else if((e+=s-a)>0)for(s+1==a&&(c+=".");e--;c+="0");return t.s<0&&n?"-"+c:c}function z(t,e){for(var r,i=1,n=new G(t[0]);i<t.length;i++){if(!(r=new G(t[i])).s){n=r;break}e.call(n,r)&&(n=r)}return n}function q(t,e,r){for(var i=1,n=e.length;!e[--n];e.pop());for(n=e[0];n>=10;n/=10,i++);return(r=i+r*l-1)>D?t.c=t.e=null:r<B?t.c=[t.e=0]:(t.e=r,t.c=e),t}function Z(t,e,r,i){var n,s,o,u,h,d,b,g=t.c,m=p;if(g){t:{for(n=1,u=g[0];u>=10;u/=10,n++);if((s=e-n)<0)s+=l,o=e,b=(h=g[d=0])/m[n-o-1]%10|0;else if((d=a((s+1)/l))>=g.length){if(!i)break t;for(;g.length<=d;g.push(0));h=b=0,n=1,o=(s%=l)-l+1}else{for(h=u=g[d],n=1;u>=10;u/=10,n++);b=(o=(s%=l)-l+n)<0?0:h/m[n-o-1]%10|0}if(i=i||e<0||null!=g[d+1]||(o<0?h:h%m[n-o-1]),i=r<4?(b||i)&&(0==r||r==(t.s<0?3:2)):b>5||5==b&&(4==r||i||6==r&&(s>0?o>0?h/m[n-o]:0:g[d-1])%10&1||r==(t.s<0?8:7)),e<1||!g[0])return g.length=0,i?(e-=t.e+1,g[0]=m[(l-e%l)%l],t.e=-e||0):g[0]=t.e=0,t;if(0==s?(g.length=d,u=1,d--):(g.length=d+1,u=m[l-s],g[d]=o>0?c(h/m[n-o]%m[o])*u:0),i)for(;;){if(0==d){for(s=1,o=g[0];o>=10;o/=10,s++);for(o=g[0]+=u,u=1;o>=10;o/=10,u++);s!=u&&(t.e++,g[0]==f&&(g[0]=1));break}if(g[d]+=u,g[d]!=f)break;g[d--]=0,u=1}for(s=g.length;0===g[--s];g.pop());}t.e>D?t.c=t.e=null:t.e<B&&(t.c=[t.e=0])}return t}function W(t){var e,r=t.e;return null===r?t.toString():(e=v(t.c),e=r<=L||r>=C?E(e,r):S(e,r,"0"),t.s<0?"-"+e:e)}return G.clone=t,G.ROUND_UP=0,G.ROUND_DOWN=1,G.ROUND_CEIL=2,G.ROUND_FLOOR=3,G.ROUND_HALF_UP=4,G.ROUND_HALF_DOWN=5,G.ROUND_HALF_EVEN=6,G.ROUND_HALF_CEIL=7,G.ROUND_HALF_FLOOR=8,G.EUCLID=9,G.config=G.set=function(t){var e,r;if(null!=t){if("object"!=typeof t)throw Error(u+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(w(r=t[e],0,g,e),M=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(w(r=t[e],0,8,e),k=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((r=t[e])&&r.pop?(w(r[0],-g,0,e),w(r[1],0,g,e),L=r[0],C=r[1]):(w(r,-g,g,e),L=-(C=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if((r=t[e])&&r.pop)w(r[0],-g,-1,e),w(r[1],1,g,e),B=r[0],D=r[1];else{if(w(r,-g,g,e),!r)throw Error(u+e+" cannot be zero: "+r);B=-(D=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(u+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(u+"crypto unavailable");U=r}else U=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(w(r=t[e],0,9,e),j=r),t.hasOwnProperty(e="POW_PRECISION")&&(w(r=t[e],0,g,e),K=r),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(r=t[e]))throw Error(u+e+" not an object: "+r);V=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(u+e+" invalid: "+r);H="0123456789"==r.slice(0,10),F=r}}return{DECIMAL_PLACES:M,ROUNDING_MODE:k,EXPONENTIAL_AT:[L,C],RANGE:[B,D],CRYPTO:U,MODULO_MODE:j,POW_PRECISION:K,FORMAT:V,ALPHABET:F}},G.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!G.DEBUG)return!0;var e,r,i=t.c,n=t.e,s=t.s;t:if("[object Array]"=={}.toString.call(i)){if((1===s||-1===s)&&n>=-g&&n<=g&&n===c(n)){if(0===i[0]){if(0===n&&1===i.length)return!0;break t}if((e=(n+1)%l)<1&&(e+=l),String(i[0]).length==e){for(e=0;e<i.length;e++)if((r=i[e])<0||r>=f||r!==c(r))break t;if(0!==r)return!0}}}else if(null===i&&null===n&&(null===s||1===s||-1===s))return!0;throw Error(u+"Invalid BigNumber: "+t)},G.maximum=G.max=function(){return z(arguments,I.lt)},G.minimum=G.min=function(){return z(arguments,I.gt)},G.random=(s=9007199254740992,A=Math.random()*s&2097151?function(){return c(Math.random()*s)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,i,n,s,o=0,h=[],f=new G(N);if(null==t?t=M:w(t,0,g),n=a(t/l),U)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(n*=2));o<n;)(s=131072*e[o]+(e[o+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),e[o]=r[0],e[o+1]=r[1]):(h.push(s%1e14),o+=2);o=n/2}else{if(!crypto.randomBytes)throw U=!1,Error(u+"crypto unavailable");for(e=crypto.randomBytes(n*=7);o<n;)(s=281474976710656*(31&e[o])+1099511627776*e[o+1]+4294967296*e[o+2]+16777216*e[o+3]+(e[o+4]<<16)+(e[o+5]<<8)+e[o+6])>=9e15?crypto.randomBytes(7).copy(e,o):(h.push(s%1e14),o+=7);o=n/7}if(!U)for(;o<n;)(s=A())<9e15&&(h[o++]=s%1e14);for(n=h[--o],t%=l,n&&t&&(s=p[l-t],h[o]=c(n/s)*s);0===h[o];h.pop(),o--);if(o<0)h=[i=0];else{for(i=-1;0===h[0];h.splice(0,1),i-=l);for(o=1,s=h[0];s>=10;s/=10,o++);o<l&&(i-=l-o)}return f.e=i,f.c=h,f}),G.sum=function(){for(var t=1,e=arguments,r=new G(e[0]);t<e.length;)r=r.plus(e[t++]);return r},i=function(){var t="0123456789";function e(t,e,r,i){for(var n,s,o=[0],a=0,c=t.length;a<c;){for(s=o.length;s--;o[s]*=e);for(o[0]+=i.indexOf(t.charAt(a++)),n=0;n<o.length;n++)o[n]>r-1&&(null==o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}return function(i,n,s,o,a){var c,u,h,f,l,d,p,b,g=i.indexOf("."),m=M,y=k;for(g>=0&&(f=K,K=0,i=i.replace(".",""),d=(b=new G(n)).pow(i.length-g),K=f,b.c=e(S(v(d.c),d.e,"0"),10,s,t),b.e=b.c.length),h=f=(p=e(i,n,s,a?(c=F,t):(c=t,F))).length;0==p[--f];p.pop());if(!p[0])return c.charAt(0);if(g<0?--h:(d.c=p,d.e=h,d.s=o,p=(d=r(d,b,m,y,s)).c,l=d.r,h=d.e),g=p[u=h+m+1],f=s/2,l=l||u<0||null!=p[u+1],l=y<4?(null!=g||l)&&(0==y||y==(d.s<0?3:2)):g>f||g==f&&(4==y||l||6==y&&1&p[u-1]||y==(d.s<0?8:7)),u<1||!p[0])i=l?S(c.charAt(1),-m,c.charAt(0)):c.charAt(0);else{if(p.length=u,l)for(--s;++p[--u]>s;)p[u]=0,u||(++h,p=[1].concat(p));for(f=p.length;!p[--f];);for(g=0,i="";g<=f;i+=c.charAt(p[g++]));i=S(i,h,c.charAt(0))}return i}}(),r=function(){function t(t,e,r){var i,n,s,o,a=0,c=t.length,u=e%b,h=e/b|0;for(t=t.slice();c--;)a=((n=u*(s=t[c]%b)+(i=h*s+(o=t[c]/b|0)*u)%b*b+a)/r|0)+(i/b|0)+h*o,t[c]=n%r;return a&&(t=[a].concat(t)),t}function e(t,e,r,i){var n,s;if(r!=i)s=r>i?1:-1;else for(n=s=0;n<r;n++)if(t[n]!=e[n]){s=t[n]>e[n]?1:-1;break}return s}function r(t,e,r,i){for(var n=0;r--;)t[r]-=n,n=t[r]<e[r]?1:0,t[r]=n*i+t[r]-e[r];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(i,n,s,o,a){var u,h,d,p,b,g,v,y,w,_,E,S,A,O,T,x,P,R=i.s==n.s?1:-1,I=i.c,N=n.c;if(!(I&&I[0]&&N&&N[0]))return new G(i.s&&n.s&&(I?!N||I[0]!=N[0]:N)?I&&0==I[0]||!N?0*R:R/0:NaN);for(w=(y=new G(R)).c=[],R=s+(h=i.e-n.e)+1,a||(a=f,h=m(i.e/l)-m(n.e/l),R=R/l|0),d=0;N[d]==(I[d]||0);d++);if(N[d]>(I[d]||0)&&h--,R<0)w.push(1),p=!0;else{for(O=I.length,x=N.length,d=0,R+=2,(b=c(a/(N[0]+1)))>1&&(N=t(N,b,a),I=t(I,b,a),x=N.length,O=I.length),A=x,E=(_=I.slice(0,x)).length;E<x;_[E++]=0);P=N.slice(),P=[0].concat(P),T=N[0],N[1]>=a/2&&T++;do{if(b=0,(u=e(N,_,x,E))<0){if(S=_[0],x!=E&&(S=S*a+(_[1]||0)),(b=c(S/T))>1)for(b>=a&&(b=a-1),v=(g=t(N,b,a)).length,E=_.length;1==e(g,_,v,E);)b--,r(g,x<v?P:N,v,a),v=g.length,u=1;else 0==b&&(u=b=1),v=(g=N.slice()).length;if(v<E&&(g=[0].concat(g)),r(_,g,E,a),E=_.length,-1==u)for(;e(N,_,x,E)<1;)b++,r(_,x<E?P:N,E,a),E=_.length}else 0===u&&(b++,_=[0]);w[d++]=b,_[0]?_[E++]=I[A]||0:(_=[I[A]],E=1)}while((A++<O||null!=_[0])&&R--);p=null!=_[0],w[0]||w.splice(0,1)}if(a==f){for(d=1,R=w[0];R>=10;R/=10,d++);Z(y,s+(y.e=d+h*l-1)+1,o,p)}else y.e=h,y.r=+p;return y}}(),O=/^(-?)0([xbo])(?=\w[\w.]*$)/i,T=/^([^.]+)\.$/,x=/^\.([^.]+)$/,P=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(t,e,r,i){var n,s=r?e:e.replace(R,"");if(P.test(s))t.s=isNaN(s)?null:s<0?-1:1;else{if(!r&&(s=s.replace(O,(function(t,e,r){return n="x"==(r=r.toLowerCase())?16:"b"==r?2:8,i&&i!=n?t:e})),i&&(n=i,s=s.replace(T,"$1").replace(x,"0.$1")),e!=s))return new G(s,n);if(G.DEBUG)throw Error(u+"Not a"+(i?" base "+i:"")+" number: "+e);t.s=null}t.c=t.e=null},I.absoluteValue=I.abs=function(){var t=new G(this);return t.s<0&&(t.s=1),t},I.comparedTo=function(t,e){return y(this,new G(t,e))},I.decimalPlaces=I.dp=function(t,e){var r,i,n,s=this;if(null!=t)return w(t,0,g),null==e?e=k:w(e,0,8),Z(new G(s),t+s.e+1,e);if(!(r=s.c))return null;if(i=((n=r.length-1)-m(this.e/l))*l,n=r[n])for(;n%10==0;n/=10,i--);return i<0&&(i=0),i},I.dividedBy=I.div=function(t,e){return r(this,new G(t,e),M,k)},I.dividedToIntegerBy=I.idiv=function(t,e){return r(this,new G(t,e),0,1)},I.exponentiatedBy=I.pow=function(t,e){var r,i,n,s,o,h,f,d,p=this;if((t=new G(t)).c&&!t.isInteger())throw Error(u+"Exponent not an integer: "+W(t));if(null!=e&&(e=new G(e)),o=t.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!t.c||!t.c[0])return d=new G(Math.pow(+W(p),o?2-_(t):+W(t))),e?d.mod(e):d;if(h=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new G(NaN);(i=!h&&p.isInteger()&&e.isInteger())&&(p=p.mod(e))}else{if(t.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||o&&p.c[1]>=24e7:p.c[0]<8e13||o&&p.c[0]<=9999975e7)))return s=p.s<0&&_(t)?-0:0,p.e>-1&&(s=1/s),new G(h?1/s:s);K&&(s=a(K/l+2))}for(o?(r=new G(.5),h&&(t.s=1),f=_(t)):f=(n=Math.abs(+W(t)))%2,d=new G(N);;){if(f){if(!(d=d.times(p)).c)break;s?d.c.length>s&&(d.c.length=s):i&&(d=d.mod(e))}if(n){if(0===(n=c(n/2)))break;f=n%2}else if(Z(t=t.times(r),t.e+1,1),t.e>14)f=_(t);else{if(0===(n=+W(t)))break;f=n%2}p=p.times(p),s?p.c&&p.c.length>s&&(p.c.length=s):i&&(p=p.mod(e))}return i?d:(h&&(d=N.div(d)),e?d.mod(e):s?Z(d,K,k,undefined):d)},I.integerValue=function(t){var e=new G(this);return null==t?t=k:w(t,0,8),Z(e,e.e+1,t)},I.isEqualTo=I.eq=function(t,e){return 0===y(this,new G(t,e))},I.isFinite=function(){return!!this.c},I.isGreaterThan=I.gt=function(t,e){return y(this,new G(t,e))>0},I.isGreaterThanOrEqualTo=I.gte=function(t,e){return 1===(e=y(this,new G(t,e)))||0===e},I.isInteger=function(){return!!this.c&&m(this.e/l)>this.c.length-2},I.isLessThan=I.lt=function(t,e){return y(this,new G(t,e))<0},I.isLessThanOrEqualTo=I.lte=function(t,e){return-1===(e=y(this,new G(t,e)))||0===e},I.isNaN=function(){return!this.s},I.isNegative=function(){return this.s<0},I.isPositive=function(){return this.s>0},I.isZero=function(){return!!this.c&&0==this.c[0]},I.minus=function(t,e){var r,i,n,s,o=this,a=o.s;if(e=(t=new G(t,e)).s,!a||!e)return new G(NaN);if(a!=e)return t.s=-e,o.plus(t);var c=o.e/l,u=t.e/l,h=o.c,d=t.c;if(!c||!u){if(!h||!d)return h?(t.s=-e,t):new G(d?o:NaN);if(!h[0]||!d[0])return d[0]?(t.s=-e,t):new G(h[0]?o:3==k?-0:0)}if(c=m(c),u=m(u),h=h.slice(),a=c-u){for((s=a<0)?(a=-a,n=h):(u=c,n=d),n.reverse(),e=a;e--;n.push(0));n.reverse()}else for(i=(s=(a=h.length)<(e=d.length))?a:e,a=e=0;e<i;e++)if(h[e]!=d[e]){s=h[e]<d[e];break}if(s&&(n=h,h=d,d=n,t.s=-t.s),(e=(i=d.length)-(r=h.length))>0)for(;e--;h[r++]=0);for(e=f-1;i>a;){if(h[--i]<d[i]){for(r=i;r&&!h[--r];h[r]=e);--h[r],h[i]+=f}h[i]-=d[i]}for(;0==h[0];h.splice(0,1),--u);return h[0]?q(t,h,u):(t.s=3==k?-1:1,t.c=[t.e=0],t)},I.modulo=I.mod=function(t,e){var i,n,s=this;return t=new G(t,e),!s.c||!t.s||t.c&&!t.c[0]?new G(NaN):!t.c||s.c&&!s.c[0]?new G(s):(9==j?(n=t.s,t.s=1,i=r(s,t,0,3),t.s=n,i.s*=n):i=r(s,t,0,j),(t=s.minus(i.times(t))).c[0]||1!=j||(t.s=s.s),t)},I.multipliedBy=I.times=function(t,e){var r,i,n,s,o,a,c,u,h,d,p,g,v,y,w,_=this,E=_.c,S=(t=new G(t,e)).c;if(!(E&&S&&E[0]&&S[0]))return!_.s||!t.s||E&&!E[0]&&!S||S&&!S[0]&&!E?t.c=t.e=t.s=null:(t.s*=_.s,E&&S?(t.c=[0],t.e=0):t.c=t.e=null),t;for(i=m(_.e/l)+m(t.e/l),t.s*=_.s,(c=E.length)<(d=S.length)&&(v=E,E=S,S=v,n=c,c=d,d=n),n=c+d,v=[];n--;v.push(0));for(y=f,w=b,n=d;--n>=0;){for(r=0,p=S[n]%w,g=S[n]/w|0,s=n+(o=c);s>n;)r=((u=p*(u=E[--o]%w)+(a=g*u+(h=E[o]/w|0)*p)%w*w+v[s]+r)/y|0)+(a/w|0)+g*h,v[s--]=u%y;v[s]=r}return r?++i:v.splice(0,1),q(t,v,i)},I.negated=function(){var t=new G(this);return t.s=-t.s||null,t},I.plus=function(t,e){var r,i=this,n=i.s;if(e=(t=new G(t,e)).s,!n||!e)return new G(NaN);if(n!=e)return t.s=-e,i.minus(t);var s=i.e/l,o=t.e/l,a=i.c,c=t.c;if(!s||!o){if(!a||!c)return new G(n/0);if(!a[0]||!c[0])return c[0]?t:new G(a[0]?i:0*n)}if(s=m(s),o=m(o),a=a.slice(),n=s-o){for(n>0?(o=s,r=c):(n=-n,r=a),r.reverse();n--;r.push(0));r.reverse()}for((n=a.length)-(e=c.length)<0&&(r=c,c=a,a=r,e=n),n=0;e;)n=(a[--e]=a[e]+c[e]+n)/f|0,a[e]=f===a[e]?0:a[e]%f;return n&&(a=[n].concat(a),++o),q(t,a,o)},I.precision=I.sd=function(t,e){var r,i,n,s=this;if(null!=t&&t!==!!t)return w(t,1,g),null==e?e=k:w(e,0,8),Z(new G(s),t,e);if(!(r=s.c))return null;if(i=(n=r.length-1)*l+1,n=r[n]){for(;n%10==0;n/=10,i--);for(n=r[0];n>=10;n/=10,i++);}return t&&s.e+1>i&&(i=s.e+1),i},I.shiftedBy=function(t){return w(t,-9007199254740991,d),this.times("1e"+t)},I.squareRoot=I.sqrt=function(){var t,e,i,n,s,o=this,a=o.c,c=o.s,u=o.e,h=M+4,f=new G("0.5");if(1!==c||!a||!a[0])return new G(!c||c<0&&(!a||a[0])?NaN:a?o:1/0);if(0==(c=Math.sqrt(+W(o)))||c==1/0?(((e=v(a)).length+u)%2==0&&(e+="0"),c=Math.sqrt(+e),u=m((u+1)/2)-(u<0||u%2),i=new G(e=c==1/0?"5e"+u:(e=c.toExponential()).slice(0,e.indexOf("e")+1)+u)):i=new G(c+""),i.c[0])for((c=(u=i.e)+h)<3&&(c=0);;)if(s=i,i=f.times(s.plus(r(o,s,h,1))),v(s.c).slice(0,c)===(e=v(i.c)).slice(0,c)){if(i.e<u&&--c,"9999"!=(e=e.slice(c-3,c+1))&&(n||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(Z(i,i.e+M+2,1),t=!i.times(i).eq(o));break}if(!n&&(Z(s,s.e+M+2,0),s.times(s).eq(o))){i=s;break}h+=4,c+=4,n=1}return Z(i,i.e+M+1,k,t)},I.toExponential=function(t,e){return null!=t&&(w(t,0,g),t++),$(this,t,e,1)},I.toFixed=function(t,e){return null!=t&&(w(t,0,g),t=t+this.e+1),$(this,t,e)},I.toFormat=function(t,e,r){var i,n=this;if(null==r)null!=t&&e&&"object"==typeof e?(r=e,e=null):t&&"object"==typeof t?(r=t,t=e=null):r=V;else if("object"!=typeof r)throw Error(u+"Argument not an object: "+r);if(i=n.toFixed(t,e),n.c){var s,o=i.split("."),a=+r.groupSize,c=+r.secondaryGroupSize,h=r.groupSeparator||"",f=o[0],l=o[1],d=n.s<0,p=d?f.slice(1):f,b=p.length;if(c&&(s=a,a=c,c=s,b-=s),a>0&&b>0){for(s=b%a||a,f=p.substr(0,s);s<b;s+=a)f+=h+p.substr(s,a);c>0&&(f+=h+p.slice(s)),d&&(f="-"+f)}i=l?f+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?l.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):l):f}return(r.prefix||"")+i+(r.suffix||"")},I.toFraction=function(t){var e,i,n,s,o,a,c,h,f,d,b,g,m=this,y=m.c;if(null!=t&&(!(c=new G(t)).isInteger()&&(c.c||1!==c.s)||c.lt(N)))throw Error(u+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+W(c));if(!y)return new G(m);for(e=new G(N),f=i=new G(N),n=h=new G(N),g=v(y),o=e.e=g.length-m.e-1,e.c[0]=p[(a=o%l)<0?l+a:a],t=!t||c.comparedTo(e)>0?o>0?e:f:c,a=D,D=1/0,c=new G(g),h.c[0]=0;d=r(c,e,0,1),1!=(s=i.plus(d.times(n))).comparedTo(t);)i=n,n=s,f=h.plus(d.times(s=f)),h=s,e=c.minus(d.times(s=e)),c=s;return s=r(t.minus(i),n,0,1),h=h.plus(s.times(f)),i=i.plus(s.times(n)),h.s=f.s=m.s,b=r(f,n,o*=2,k).minus(m).abs().comparedTo(r(h,i,o,k).minus(m).abs())<1?[f,n]:[h,i],D=a,b},I.toNumber=function(){return+W(this)},I.toPrecision=function(t,e){return null!=t&&w(t,1,g),$(this,t,e,2)},I.toString=function(t){var e,r=this,n=r.s,s=r.e;return null===s?n?(e="Infinity",n<0&&(e="-"+e)):e="NaN":(null==t?e=s<=L||s>=C?E(v(r.c),s):S(v(r.c),s,"0"):10===t&&H?e=S(v((r=Z(new G(r),M+s+1,k)).c),r.e,"0"):(w(t,2,F.length,"Base"),e=i(S(v(r.c),s,"0"),10,t,n,!0)),n<0&&r.c[0]&&(e="-"+e)),e},I.valueOf=I.toJSON=function(){return W(this)},I._isBigNumber=!0,null!=e&&G.set(e),G}(),s.default=s.BigNumber=s,void 0===(i=function(){return s}.call(e,r,e,t))||(t.exports=i)}()},651:(t,e,r)=>{const i=r(7967);function n(t,e,r){const i=t[e]+t[r];let n=t[e+1]+t[r+1];i>=4294967296&&n++,t[e]=i,t[e+1]=n}function s(t,e,r,i){let n=t[e]+r;r<0&&(n+=4294967296);let s=t[e+1]+i;n>=4294967296&&s++,t[e]=n,t[e+1]=s}function o(t,e){return t[e]^t[e+1]<<8^t[e+2]<<16^t[e+3]<<24}function a(t,e,r,i,o,a){const c=f[o],u=f[o+1],l=f[a],d=f[a+1];n(h,t,e),s(h,t,c,u);let p=h[i]^h[t],b=h[i+1]^h[t+1];h[i]=b,h[i+1]=p,n(h,r,i),p=h[e]^h[r],b=h[e+1]^h[r+1],h[e]=p>>>24^b<<8,h[e+1]=b>>>24^p<<8,n(h,t,e),s(h,t,l,d),p=h[i]^h[t],b=h[i+1]^h[t+1],h[i]=p>>>16^b<<16,h[i+1]=b>>>16^p<<16,n(h,r,i),p=h[e]^h[r],b=h[e+1]^h[r+1],h[e]=b>>>31^p<<1,h[e+1]=p>>>31^b<<1}const c=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),u=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(t){return 2*t}))),h=new Uint32Array(32),f=new Uint32Array(32);function l(t,e){let r=0;for(r=0;r<16;r++)h[r]=t.h[r],h[r+16]=c[r];for(h[24]=h[24]^t.t,h[25]=h[25]^t.t/4294967296,e&&(h[28]=~h[28],h[29]=~h[29]),r=0;r<32;r++)f[r]=o(t.b,4*r);for(r=0;r<12;r++)a(0,8,16,24,u[16*r+0],u[16*r+1]),a(2,10,18,26,u[16*r+2],u[16*r+3]),a(4,12,20,28,u[16*r+4],u[16*r+5]),a(6,14,22,30,u[16*r+6],u[16*r+7]),a(0,10,20,30,u[16*r+8],u[16*r+9]),a(2,12,22,24,u[16*r+10],u[16*r+11]),a(4,14,16,26,u[16*r+12],u[16*r+13]),a(6,8,18,28,u[16*r+14],u[16*r+15]);for(r=0;r<16;r++)t.h[r]=t.h[r]^h[r]^h[r+16]}const d=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function p(t,e,r,i){if(0===t||t>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(e&&e.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(r&&16!==r.length)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(i&&16!==i.length)throw new Error("Illegal personal, expected Uint8Array with length is 16");const n={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:t};d.fill(0),d[0]=t,e&&(d[1]=e.length),d[2]=1,d[3]=1,r&&d.set(r,32),i&&d.set(i,48);for(let t=0;t<16;t++)n.h[t]=c[t]^o(d,4*t);return e&&(b(n,e),n.c=128),n}function b(t,e){for(let r=0;r<e.length;r++)128===t.c&&(t.t+=t.c,l(t,!1),t.c=0),t.b[t.c++]=e[r]}function g(t){for(t.t+=t.c;t.c<128;)t.b[t.c++]=0;l(t,!0);const e=new Uint8Array(t.outlen);for(let r=0;r<t.outlen;r++)e[r]=t.h[r>>2]>>8*(3&r);return e}function m(t,e,r,n,s){r=r||64,t=i.normalizeInput(t),n&&(n=i.normalizeInput(n)),s&&(s=i.normalizeInput(s));const o=p(r,e,n,s);return b(o,t),g(o)}t.exports={blake2b:m,blake2bHex:function(t,e,r,n,s){const o=m(t,e,r,n,s);return i.toHex(o)},blake2bInit:p,blake2bUpdate:b,blake2bFinal:g}},9962:(t,e,r)=>{const i=r(7967);function n(t,e){return t[e]^t[e+1]<<8^t[e+2]<<16^t[e+3]<<24}function s(t,e,r,i,n,s){u[t]=u[t]+u[e]+n,u[i]=o(u[i]^u[t],16),u[r]=u[r]+u[i],u[e]=o(u[e]^u[r],12),u[t]=u[t]+u[e]+s,u[i]=o(u[i]^u[t],8),u[r]=u[r]+u[i],u[e]=o(u[e]^u[r],7)}function o(t,e){return t>>>e^t<<32-e}const a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),u=new Uint32Array(16),h=new Uint32Array(16);function f(t,e){let r=0;for(r=0;r<8;r++)u[r]=t.h[r],u[r+8]=a[r];for(u[12]^=t.t,u[13]^=t.t/4294967296,e&&(u[14]=~u[14]),r=0;r<16;r++)h[r]=n(t.b,4*r);for(r=0;r<10;r++)s(0,4,8,12,h[c[16*r+0]],h[c[16*r+1]]),s(1,5,9,13,h[c[16*r+2]],h[c[16*r+3]]),s(2,6,10,14,h[c[16*r+4]],h[c[16*r+5]]),s(3,7,11,15,h[c[16*r+6]],h[c[16*r+7]]),s(0,5,10,15,h[c[16*r+8]],h[c[16*r+9]]),s(1,6,11,12,h[c[16*r+10]],h[c[16*r+11]]),s(2,7,8,13,h[c[16*r+12]],h[c[16*r+13]]),s(3,4,9,14,h[c[16*r+14]],h[c[16*r+15]]);for(r=0;r<8;r++)t.h[r]^=u[r]^u[r+8]}function l(t,e){if(!(t>0&&t<=32))throw new Error("Incorrect output length, should be in [1, 32]");const r=e?e.length:0;if(e&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");const i={h:new Uint32Array(a),b:new Uint8Array(64),c:0,t:0,outlen:t};return i.h[0]^=16842752^r<<8^t,r>0&&(d(i,e),i.c=64),i}function d(t,e){for(let r=0;r<e.length;r++)64===t.c&&(t.t+=t.c,f(t,!1),t.c=0),t.b[t.c++]=e[r]}function p(t){for(t.t+=t.c;t.c<64;)t.b[t.c++]=0;f(t,!0);const e=new Uint8Array(t.outlen);for(let r=0;r<t.outlen;r++)e[r]=t.h[r>>2]>>8*(3&r)&255;return e}function b(t,e,r){r=r||32,t=i.normalizeInput(t);const n=l(r,e);return d(n,t),p(n)}t.exports={blake2s:b,blake2sHex:function(t,e,r){const n=b(t,e,r);return i.toHex(n)},blake2sInit:l,blake2sUpdate:d,blake2sFinal:p}},1395:(t,e,r)=>{const i=r(651),n=r(9962);t.exports={blake2b:i.blake2b,blake2bHex:i.blake2bHex,blake2bInit:i.blake2bInit,blake2bUpdate:i.blake2bUpdate,blake2bFinal:i.blake2bFinal,blake2s:n.blake2s,blake2sHex:n.blake2sHex,blake2sInit:n.blake2sInit,blake2sUpdate:n.blake2sUpdate,blake2sFinal:n.blake2sFinal}},7967:t=>{function e(t){return(4294967296+t).toString(16).substring(1)}t.exports={normalizeInput:function(t){let e;if(t instanceof Uint8Array)e=t;else{if("string"!=typeof t)throw new Error("Input must be an string, Buffer or Uint8Array");e=(new TextEncoder).encode(t)}return e},toHex:function(t){return Array.prototype.map.call(t,(function(t){return(t<16?"0":"")+t.toString(16)})).join("")},debugPrint:function(t,r,i){let n="\n"+t+" = ";for(let s=0;s<r.length;s+=2){if(32===i)n+=e(r[s]).toUpperCase(),n+=" ",n+=e(r[s+1]).toUpperCase();else{if(64!==i)throw new Error("Invalid size "+i);n+=e(r[s+1]).toUpperCase(),n+=e(r[s]).toUpperCase()}s%6==4?n+="\n"+new Array(t.length+4).join(" "):s<r.length-2&&(n+=" ")}console.log(n)},testSpeed:function(t,e,r){let i=(new Date).getTime();const n=new Uint8Array(e);for(let t=0;t<e;t++)n[t]=t%256;const s=(new Date).getTime();console.log("Generated random input in "+(s-i)+"ms"),i=s;for(let s=0;s<r;s++){const r=t(n),s=(new Date).getTime(),o=s-i;i=s,console.log("Hashed in "+o+"ms: "+r.substring(0,20)+"..."),console.log(Math.round(e/(1<<20)/(o/1e3)*100)/100+" MB PER SECOND")}}}},2197:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(3196).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function u(t,e,r,i){for(var n=0,s=Math.min(t.length,r),o=e;o<s;o++){var a=t.charCodeAt(o)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,r):(this._parseBase(t,e,n),"le"===r&&this._initArray(this.toArray(),e,r)))},s.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var s,o,a=0;if("be"===r)for(n=t.length-1,s=0;n>=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,s=0,o=0;if("be"===r)for(i=t.length-1;i>=e;i-=2)n=c(t,e,i)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(t.length-e)%2==0?e+1:e;i<t.length;i+=2)n=c(t,e,i)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var s=t.length-r,o=s%i,a=Math.min(s,s-o)+r,c=0,h=r;h<a;h+=i)c=u(t,h,h+i,e),this.imuln(n),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==o){var f=1;for(c=u(t,h,t.length,e),h=0;h<o;h++)f*=e;this.imuln(f),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)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 h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=67108863&o,c=o/67108864|0;r.words[0]=a;for(var u=1;u<i;u++){for(var h=c>>>26,f=67108863&c,l=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=l;d++){var p=u-d|0;h+=(o=(n=0|t.words[p])*(s=0|e.words[d])+f)/67108864|0,f=67108863&o}r.words[u]=0|f,c=0|h}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,s=0,o=0;o<this.length;o++){var a=this.words[o],c=(16777215&(a<<n|s)).toString(16);r=0!==(s=a>>>24-n&16777215)||o!==this.length-1?h[6-c.length]+c+r:c+r,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(r=s.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?b+r:h[u-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=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 t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return i(void 0!==o),this.toArrayLike(o,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){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"),this.strip();var o,a,c="le"===e,u=new t(s),h=this.clone();if(c){for(a=0;!h.isZero();a++)o=h.andln(255),h.iushrn(8),u[a]=o;for(;a<s;a++)u[a]=0}else{for(a=0;a<s-n;a++)u[a]=0;for(a=0;!h.isZero();a++)o=h.andln(255),h.iushrn(8),u[s-a-1]=o}return u},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).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(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},s.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,s=0;s<i.length;s++)e=(0|r.words[s])+(0|i.words[s])+n,this.words[s]=67108863&e,n=e>>>26;for(;0!==n&&s<r.length;s++)e=(0|r.words[s])+n,this.words[s]=67108863&e,n=e>>>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(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var s=0,o=0;o<i.length;o++)s=(e=(0|r.words[o])-(0|i.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<r.length;o++)s=(e=(0|r.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var i,n,s,o=t.words,a=e.words,c=r.words,u=0,h=0|o[0],f=8191&h,l=h>>>13,d=0|o[1],p=8191&d,b=d>>>13,g=0|o[2],m=8191&g,v=g>>>13,y=0|o[3],w=8191&y,_=y>>>13,E=0|o[4],S=8191&E,A=E>>>13,O=0|o[5],T=8191&O,x=O>>>13,P=0|o[6],R=8191&P,I=P>>>13,N=0|o[7],M=8191&N,k=N>>>13,L=0|o[8],C=8191&L,B=L>>>13,D=0|o[9],U=8191&D,j=D>>>13,K=0|a[0],V=8191&K,F=K>>>13,H=0|a[1],G=8191&H,$=H>>>13,z=0|a[2],q=8191&z,Z=z>>>13,W=0|a[3],Y=8191&W,J=W>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],st=8191&nt,ot=nt>>>13,at=0|a[7],ct=8191&at,ut=at>>>13,ht=0|a[8],ft=8191&ht,lt=ht>>>13,dt=0|a[9],pt=8191&dt,bt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(u+(i=Math.imul(f,V))|0)+((8191&(n=(n=Math.imul(f,F))+Math.imul(l,V)|0))<<13)|0;u=((s=Math.imul(l,F))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(p,V),n=(n=Math.imul(p,F))+Math.imul(b,V)|0,s=Math.imul(b,F);var mt=(u+(i=i+Math.imul(f,G)|0)|0)+((8191&(n=(n=n+Math.imul(f,$)|0)+Math.imul(l,G)|0))<<13)|0;u=((s=s+Math.imul(l,$)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,V),n=(n=Math.imul(m,F))+Math.imul(v,V)|0,s=Math.imul(v,F),i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(b,G)|0,s=s+Math.imul(b,$)|0;var vt=(u+(i=i+Math.imul(f,q)|0)|0)+((8191&(n=(n=n+Math.imul(f,Z)|0)+Math.imul(l,q)|0))<<13)|0;u=((s=s+Math.imul(l,Z)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(w,V),n=(n=Math.imul(w,F))+Math.imul(_,V)|0,s=Math.imul(_,F),i=i+Math.imul(m,G)|0,n=(n=n+Math.imul(m,$)|0)+Math.imul(v,G)|0,s=s+Math.imul(v,$)|0,i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(b,q)|0,s=s+Math.imul(b,Z)|0;var yt=(u+(i=i+Math.imul(f,Y)|0)|0)+((8191&(n=(n=n+Math.imul(f,J)|0)+Math.imul(l,Y)|0))<<13)|0;u=((s=s+Math.imul(l,J)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(S,V),n=(n=Math.imul(S,F))+Math.imul(A,V)|0,s=Math.imul(A,F),i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,G)|0,s=s+Math.imul(_,$)|0,i=i+Math.imul(m,q)|0,n=(n=n+Math.imul(m,Z)|0)+Math.imul(v,q)|0,s=s+Math.imul(v,Z)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(b,Y)|0,s=s+Math.imul(b,J)|0;var wt=(u+(i=i+Math.imul(f,Q)|0)|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(l,Q)|0))<<13)|0;u=((s=s+Math.imul(l,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(T,V),n=(n=Math.imul(T,F))+Math.imul(x,V)|0,s=Math.imul(x,F),i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(A,G)|0,s=s+Math.imul(A,$)|0,i=i+Math.imul(w,q)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,q)|0,s=s+Math.imul(_,Z)|0,i=i+Math.imul(m,Y)|0,n=(n=n+Math.imul(m,J)|0)+Math.imul(v,Y)|0,s=s+Math.imul(v,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,s=s+Math.imul(b,tt)|0;var _t=(u+(i=i+Math.imul(f,rt)|0)|0)+((8191&(n=(n=n+Math.imul(f,it)|0)+Math.imul(l,rt)|0))<<13)|0;u=((s=s+Math.imul(l,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(R,V),n=(n=Math.imul(R,F))+Math.imul(I,V)|0,s=Math.imul(I,F),i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,$)|0)+Math.imul(x,G)|0,s=s+Math.imul(x,$)|0,i=i+Math.imul(S,q)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(A,q)|0,s=s+Math.imul(A,Z)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,Y)|0,s=s+Math.imul(_,J)|0,i=i+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(v,Q)|0,s=s+Math.imul(v,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(b,rt)|0,s=s+Math.imul(b,it)|0;var Et=(u+(i=i+Math.imul(f,st)|0)|0)+((8191&(n=(n=n+Math.imul(f,ot)|0)+Math.imul(l,st)|0))<<13)|0;u=((s=s+Math.imul(l,ot)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(M,V),n=(n=Math.imul(M,F))+Math.imul(k,V)|0,s=Math.imul(k,F),i=i+Math.imul(R,G)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(I,G)|0,s=s+Math.imul(I,$)|0,i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(x,q)|0,s=s+Math.imul(x,Z)|0,i=i+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(A,Y)|0,s=s+Math.imul(A,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(v,rt)|0,s=s+Math.imul(v,it)|0,i=i+Math.imul(p,st)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(b,st)|0,s=s+Math.imul(b,ot)|0;var St=(u+(i=i+Math.imul(f,ct)|0)|0)+((8191&(n=(n=n+Math.imul(f,ut)|0)+Math.imul(l,ct)|0))<<13)|0;u=((s=s+Math.imul(l,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(C,V),n=(n=Math.imul(C,F))+Math.imul(B,V)|0,s=Math.imul(B,F),i=i+Math.imul(M,G)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(k,G)|0,s=s+Math.imul(k,$)|0,i=i+Math.imul(R,q)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(I,q)|0,s=s+Math.imul(I,Z)|0,i=i+Math.imul(T,Y)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(x,Y)|0,s=s+Math.imul(x,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(A,Q)|0,s=s+Math.imul(A,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,s=s+Math.imul(_,it)|0,i=i+Math.imul(m,st)|0,n=(n=n+Math.imul(m,ot)|0)+Math.imul(v,st)|0,s=s+Math.imul(v,ot)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(b,ct)|0,s=s+Math.imul(b,ut)|0;var At=(u+(i=i+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;u=((s=s+Math.imul(l,lt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(U,V),n=(n=Math.imul(U,F))+Math.imul(j,V)|0,s=Math.imul(j,F),i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(B,G)|0,s=s+Math.imul(B,$)|0,i=i+Math.imul(M,q)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(k,q)|0,s=s+Math.imul(k,Z)|0,i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,J)|0)+Math.imul(I,Y)|0,s=s+Math.imul(I,J)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(A,rt)|0,s=s+Math.imul(A,it)|0,i=i+Math.imul(w,st)|0,n=(n=n+Math.imul(w,ot)|0)+Math.imul(_,st)|0,s=s+Math.imul(_,ot)|0,i=i+Math.imul(m,ct)|0,n=(n=n+Math.imul(m,ut)|0)+Math.imul(v,ct)|0,s=s+Math.imul(v,ut)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(b,ft)|0,s=s+Math.imul(b,lt)|0;var Ot=(u+(i=i+Math.imul(f,pt)|0)|0)+((8191&(n=(n=n+Math.imul(f,bt)|0)+Math.imul(l,pt)|0))<<13)|0;u=((s=s+Math.imul(l,bt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,$))+Math.imul(j,G)|0,s=Math.imul(j,$),i=i+Math.imul(C,q)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(B,q)|0,s=s+Math.imul(B,Z)|0,i=i+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,J)|0)+Math.imul(k,Y)|0,s=s+Math.imul(k,J)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,s=s+Math.imul(I,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(x,rt)|0,s=s+Math.imul(x,it)|0,i=i+Math.imul(S,st)|0,n=(n=n+Math.imul(S,ot)|0)+Math.imul(A,st)|0,s=s+Math.imul(A,ot)|0,i=i+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,ct)|0,s=s+Math.imul(_,ut)|0,i=i+Math.imul(m,ft)|0,n=(n=n+Math.imul(m,lt)|0)+Math.imul(v,ft)|0,s=s+Math.imul(v,lt)|0;var Tt=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;u=((s=s+Math.imul(b,bt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(U,q),n=(n=Math.imul(U,Z))+Math.imul(j,q)|0,s=Math.imul(j,Z),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(B,Y)|0,s=s+Math.imul(B,J)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,s=s+Math.imul(k,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(I,rt)|0,s=s+Math.imul(I,it)|0,i=i+Math.imul(T,st)|0,n=(n=n+Math.imul(T,ot)|0)+Math.imul(x,st)|0,s=s+Math.imul(x,ot)|0,i=i+Math.imul(S,ct)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(A,ct)|0,s=s+Math.imul(A,ut)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,lt)|0)+Math.imul(_,ft)|0,s=s+Math.imul(_,lt)|0;var xt=(u+(i=i+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,bt)|0)+Math.imul(v,pt)|0))<<13)|0;u=((s=s+Math.imul(v,bt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(U,Y),n=(n=Math.imul(U,J))+Math.imul(j,Y)|0,s=Math.imul(j,J),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(B,Q)|0,s=s+Math.imul(B,tt)|0,i=i+Math.imul(M,rt)|0,n=(n=n+Math.imul(M,it)|0)+Math.imul(k,rt)|0,s=s+Math.imul(k,it)|0,i=i+Math.imul(R,st)|0,n=(n=n+Math.imul(R,ot)|0)+Math.imul(I,st)|0,s=s+Math.imul(I,ot)|0,i=i+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(x,ct)|0,s=s+Math.imul(x,ut)|0,i=i+Math.imul(S,ft)|0,n=(n=n+Math.imul(S,lt)|0)+Math.imul(A,ft)|0,s=s+Math.imul(A,lt)|0;var Pt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((s=s+Math.imul(_,bt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(U,Q),n=(n=Math.imul(U,tt))+Math.imul(j,Q)|0,s=Math.imul(j,tt),i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(B,rt)|0,s=s+Math.imul(B,it)|0,i=i+Math.imul(M,st)|0,n=(n=n+Math.imul(M,ot)|0)+Math.imul(k,st)|0,s=s+Math.imul(k,ot)|0,i=i+Math.imul(R,ct)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(I,ct)|0,s=s+Math.imul(I,ut)|0,i=i+Math.imul(T,ft)|0,n=(n=n+Math.imul(T,lt)|0)+Math.imul(x,ft)|0,s=s+Math.imul(x,lt)|0;var Rt=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,bt)|0)+Math.imul(A,pt)|0))<<13)|0;u=((s=s+Math.imul(A,bt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(U,rt),n=(n=Math.imul(U,it))+Math.imul(j,rt)|0,s=Math.imul(j,it),i=i+Math.imul(C,st)|0,n=(n=n+Math.imul(C,ot)|0)+Math.imul(B,st)|0,s=s+Math.imul(B,ot)|0,i=i+Math.imul(M,ct)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(k,ct)|0,s=s+Math.imul(k,ut)|0,i=i+Math.imul(R,ft)|0,n=(n=n+Math.imul(R,lt)|0)+Math.imul(I,ft)|0,s=s+Math.imul(I,lt)|0;var It=(u+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,bt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((s=s+Math.imul(x,bt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(U,st),n=(n=Math.imul(U,ot))+Math.imul(j,st)|0,s=Math.imul(j,ot),i=i+Math.imul(C,ct)|0,n=(n=n+Math.imul(C,ut)|0)+Math.imul(B,ct)|0,s=s+Math.imul(B,ut)|0,i=i+Math.imul(M,ft)|0,n=(n=n+Math.imul(M,lt)|0)+Math.imul(k,ft)|0,s=s+Math.imul(k,lt)|0;var Nt=(u+(i=i+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,bt)|0)+Math.imul(I,pt)|0))<<13)|0;u=((s=s+Math.imul(I,bt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(U,ct),n=(n=Math.imul(U,ut))+Math.imul(j,ct)|0,s=Math.imul(j,ut),i=i+Math.imul(C,ft)|0,n=(n=n+Math.imul(C,lt)|0)+Math.imul(B,ft)|0,s=s+Math.imul(B,lt)|0;var Mt=(u+(i=i+Math.imul(M,pt)|0)|0)+((8191&(n=(n=n+Math.imul(M,bt)|0)+Math.imul(k,pt)|0))<<13)|0;u=((s=s+Math.imul(k,bt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(U,ft),n=(n=Math.imul(U,lt))+Math.imul(j,ft)|0,s=Math.imul(j,lt);var kt=(u+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,bt)|0)+Math.imul(B,pt)|0))<<13)|0;u=((s=s+Math.imul(B,bt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863;var Lt=(u+(i=Math.imul(U,pt))|0)+((8191&(n=(n=Math.imul(U,bt))+Math.imul(j,pt)|0))<<13)|0;return u=((s=Math.imul(j,bt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,c[0]=gt,c[1]=mt,c[2]=vt,c[3]=yt,c[4]=wt,c[5]=_t,c[6]=Et,c[7]=St,c[8]=At,c[9]=Ot,c[10]=Tt,c[11]=xt,c[12]=Pt,c[13]=Rt,c[14]=It,c[15]=Nt,c[16]=Mt,c[17]=kt,c[18]=Lt,0!==u&&(c[19]=u,r.length++),r};function b(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),s.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):i<63?d(this,t,e):i<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,s=0;s<r.length-1;s++){var o=n;n=0;for(var a=67108863&i,c=Math.min(s,e.length-1),u=Math.max(0,s-t.length+1);u<=c;u++){var h=s-u,f=(0|t.words[h])*(0|e.words[u]),l=67108863&f;a=67108863&(l=l+a|0),n+=(o=(o=o+(f/67108864|0)|0)+(l>>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r.strip()}(this,t,e):b(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},g.prototype.permute=function(t,e,r,i,n,s){for(var o=0;o<s;o++)i[o]=e[t[o]],n[o]=r[t[o]]},g.prototype.transform=function(t,e,r,i,n,s){this.permute(s,t,e,r,i,n);for(var o=1;o<n;o<<=1)for(var a=o<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),h=0;h<n;h+=a)for(var f=c,l=u,d=0;d<o;d++){var p=r[h+d],b=i[h+d],g=r[h+d+o],m=i[h+d+o],v=f*g-l*m;m=f*m+l*g,g=v,r[h+d]=p+g,i[h+d]=b+m,r[h+d+o]=p-g,i[h+d+o]=b-m,d!==a&&(v=c*f-u*l,l=c*l+u*f,f=v)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},g.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},g.prototype.convert13b=function(t,e,r,n){for(var s=0,o=0;o<e;o++)s+=0|t[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<n;++o)r[o]=0;i(0===s),i(0==(-8192&s))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),s=this.stub(i),o=new Array(i),a=new Array(i),c=new Array(i),u=new Array(i),h=new Array(i),f=new Array(i),l=r.words;l.length=i,this.convert13b(t.words,t.length,o,i),this.convert13b(e.words,e.length,u,i),this.transform(o,s,a,c,i,n),this.transform(u,s,h,f,i,n);for(var d=0;d<i;d++){var p=a[d]*h[d]-c[d]*f[d];c[d]=a[d]*f[d]+c[d]*h[d],a[d]=p}return this.conjugate(a,c,i),this.transform(a,c,l,s,i,n),this.conjugate(l,s,i),this.normalize13b(l,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),b(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,s=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=s>>>26,this.words[r]=67108863&s}return 0!==e&&(this.words[r]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new s(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var n=r.sqr();i<e.length;i++,n=n.sqr())0!==e[i]&&(r=r.mul(n));return r},s.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,c=(0|this.words[e])-a<<r;this.words[e]=c|o,o=a>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,c=r;if(n-=o,n=Math.max(0,n),c){for(var u=0;u<o;u++)c.words[u]=this.words[u];c.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 h=0;for(u=this.length-1;u>=0&&(0!==h||u>=n);u--){var f=0|this.words[u];this.words[u]=h<<26-s|f>>>s,h=f&a}return c&&0!==h&&(c.words[c.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},s.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var n,s,o=t.length+r;this._expand(o);var a=0;for(n=0;n<t.length;n++){s=(0|this.words[n+r])+a;var c=(0|t.words[n])*e;a=((s-=67108863&c)>>26)-(c/67108864|0),this.words[n+r]=67108863&s}for(;n<this.length-r;n++)a=(s=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&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]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,o=0|n.words[n.length-1];0!==(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,c=i.length-n.length;if("mod"!==e){(a=new s(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var h=i.clone()._ishlnsubmul(n,1,c);0===h.negative&&(i=h,a&&(a.words[c]=1));for(var f=c-1;f>=0;f--){var l=67108864*(0|i.words[n.length+f])+(0|i.words[n.length+f-1]);for(l=Math.min(l/o|0,67108863),i._ishlnsubmul(n,l,f);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(n,1,f),i.isZero()||(i.negative^=1);a&&(a.words[f]=l)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},s.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},s.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),c=new s(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var h=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(h),o.isub(f)),n.iushrn(1),o.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(h),c.isub(f)),a.iushrn(1),c.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),o.isub(c)):(r.isub(e),a.isub(n),c.isub(o))}return{a,b:c,gcd:r.iushln(u)}},s.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new s(1),a=new s(0),c=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,h=1;0==(e.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var f=0,l=1;0==(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var s=e;e=r,r=s}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;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];s=(a+=s)>>>26,a&=67108863,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(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new S(t)},s.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){S.call(this,t),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)}v.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<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},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},n(y,v),y.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n<i;n++)e.words[n]=t.words[n];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var s=t.words[9];for(e.words[e.length++]=s&r,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(o&r)<<4|s>>>22,s=o}s>>>=22,t.words[n-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(w,v),n(_,v),n(E,v),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return m[t]=e,e},S.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,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),c=a.redNeg(),u=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new s(2*h*h).toRed(this);0!==this.pow(h,u).cmp(c);)h.redIAdd(c);for(var f=this.pow(h,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=o;0!==d.cmp(a);){for(var b=d,g=0;0!==b.cmp(a);g++)b=b.redSqr();i(g<p);var m=this.pow(f,new s(1).iushln(p-g-1));l=l.redMul(m),f=m.redSqr(),d=d.redMul(f),p=g}return l},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new s(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var n=r[0],o=0,a=0,c=e.bitLength()%26;for(0===c&&(c=26),i=e.length-1;i>=0;i--){for(var u=e.words[i],h=c-1;h>=0;h--){var f=u>>h&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==o?(o<<=1,o|=f,(4===++a||0===i&&0===h)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}c=26}return n},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new A(t)},n(A,S),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),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):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},2745:(t,e,r)=>{var i;function n(t){this.rand=t}if(t.exports=function(t){return i||(i=new n(null)),i.generate(t)},t.exports.Rand=n,n.prototype.generate=function(t){return this._rand(t)},n.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var s=r(8087);if("function"!=typeof s.randomBytes)throw new Error("Not supported");n.prototype._rand=function(t){return s.randomBytes(t)}}catch(t){}},7022:(t,e,r)=>{var i=r(8166);t.exports=i("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},8616:(t,e,r)=>{"use strict";var i=r(7022),n=r(7834).Buffer;t.exports=function(t){function e(e){var r=e.slice(0,-4),i=e.slice(-4),n=t(r);if(!(i[0]^n[0]|i[1]^n[1]|i[2]^n[2]|i[3]^n[3]))return r}return{encode:function(e){var r=t(e);return i.encode(n.concat([e,r],e.length+4))},decode:function(t){var r=e(i.decode(t));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(t){var r=i.decodeUnsafe(t);if(r)return e(r)}}}},4075:(t,e,r)=>{"use strict";var i=r(6162),n=r(8616);t.exports=n((function(t){var e=i("sha256").update(t).digest();return i("sha256").update(e).digest()}))},8834:(t,e,r)=>{"use strict";const i=r(5766),n=r(2333),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const o=2147483647;function a(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|b(t,e);let i=a(r);const n=i.write(t,e);n!==r&&(i=i.slice(0,n));return i}(t,e);if(ArrayBuffer.isView(t))return function(t){if(W(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return l(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(W(t,ArrayBuffer)||t&&W(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(W(t,SharedArrayBuffer)||t&&W(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return c.from(i,e,r);const n=function(t){if(c.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||Y(t.length)?a(0):l(t);if("Buffer"===t.type&&Array.isArray(t.data))return l(t.data)}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return h(t),a(t<0?0:0|p(t))}function l(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let i=0;i<e;i+=1)r[i]=255&t[i];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(i,c.prototype),i}function p(t){if(t>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function b(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||W(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(t).length;default:if(n)return i?-1:z(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){let i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return P(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function m(t,e,r){const i=t[e];t[e]=t[r],t[r]=i}function v(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=c.from(e,i)),c.isBuffer(e))return 0===e.length?-1:y(t,e,r,i,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,i,n){let s,o=1,a=t.length,c=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,c/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){let i=-1;for(s=r;s<a;s++)if(u(t,s)===u(e,-1===i?0:s-i)){if(-1===i&&(i=s),s-i+1===c)return i*o}else-1!==i&&(s-=s-i),i=-1}else for(r+c>a&&(r=a-c),s=r;s>=0;s--){let r=!0;for(let i=0;i<c;i++)if(u(t,s+i)!==u(e,i)){r=!1;break}if(r)return s}return-1}function w(t,e,r,i){r=Number(r)||0;const n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;const s=e.length;let o;for(i>s/2&&(i=s/2),o=0;o<i;++o){const i=parseInt(e.substr(2*o,2),16);if(Y(i))return o;t[r+o]=i}return o}function _(t,e,r,i){return Z(z(e,t.length-r),t,r,i)}function E(t,e,r,i){return Z(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,i)}function S(t,e,r,i){return Z(q(e),t,r,i)}function A(t,e,r,i){return Z(function(t,e){let r,i,n;const s=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),i=r>>8,n=r%256,s.push(n),s.push(i);return s}(e,t.length-r),t,r,i)}function O(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function T(t,e,r){r=Math.min(t.length,r);const i=[];let n=e;for(;n<r;){const e=t[n];let s=null,o=e>239?4:e>223?3:e>191?2:1;if(n+o<=r){let r,i,a,c;switch(o){case 1:e<128&&(s=e);break;case 2:r=t[n+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(s=c));break;case 3:r=t[n+1],i=t[n+2],128==(192&r)&&128==(192&i)&&(c=(15&e)<<12|(63&r)<<6|63&i,c>2047&&(c<55296||c>57343)&&(s=c));break;case 4:r=t[n+1],i=t[n+2],a=t[n+3],128==(192&r)&&128==(192&i)&&128==(192&a)&&(c=(15&e)<<18|(63&r)<<12|(63&i)<<6|63&a,c>65535&&c<1114112&&(s=c))}}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(t){const e=t.length;if(e<=x)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=x));return r}(i)}e.kMaxLength=o,c.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),c.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(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(t,e,r){return function(t,e,r){return h(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},c.allocUnsafe=function(t){return f(t)},c.allocUnsafeSlow=function(t){return f(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(W(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),W(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,i=e.length;for(let n=0,s=Math.min(r,i);n<s;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const i=c.allocUnsafe(e);let n=0;for(r=0;r<t.length;++r){let e=t[r];if(W(e,Uint8Array))n+e.length>i.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(i,n)):Uint8Array.prototype.set.call(i,e,n);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(i,n)}n+=e.length}return i},c.byteLength=b,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},c.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},c.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},c.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?T(this,0,t):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(t,e,r,i,n){if(W(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;let s=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(e>>>=0);const a=Math.min(s,o),u=this.slice(i,n),h=t.slice(e,r);for(let t=0;t<a;++t)if(u[t]!==h[t]){s=u[t],o=h[t];break}return s<o?-1:o<s?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return v(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return v(this,t,e,r,!1)},c.prototype.write=function(t,e,r,i){if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return E(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function P(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}function R(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function I(t,e,r){const i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=e;i<r;++i)n+=J[t[i]];return n}function N(t,e,r){const i=t.slice(e,r);let n="";for(let t=0;t<i.length-1;t+=2)n+=String.fromCharCode(i[t]+256*i[t+1]);return n}function M(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,i,n,s){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}function L(t,e,r,i,n){F(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function C(t,e,r,i,n){F(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s>>=8,t[r+6]=s,s>>=8,t[r+5]=s,s>>=8,t[r+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function B(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,i,s){return e=+e,r>>>=0,s||B(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function U(t,e,r,i,s){return e=+e,r>>>=0,s||B(t,0,r,8),n.write(t,e,r,i,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const i=this.subarray(t,e);return Object.setPrototypeOf(i,c.prototype),i},c.prototype.readUintLE=c.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||M(t,e,this.length);let i=this[t],n=1,s=0;for(;++s<e&&(n*=256);)i+=this[t+s]*n;return i},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||M(t,e,this.length);let i=this[t+--e],n=1;for(;e>0&&(n*=256);)i+=this[t+--e]*n;return i},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||M(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||M(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||M(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=X((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const i=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,n=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(i)+(BigInt(n)<<BigInt(32))})),c.prototype.readBigUInt64BE=X((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const i=e*2**24+65536*this[++t]+256*this[++t]+this[++t],n=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)})),c.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||M(t,e,this.length);let i=this[t],n=1,s=0;for(;++s<e&&(n*=256);)i+=this[t+s]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*e)),i},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||M(t,e,this.length);let i=e,n=1,s=this[t+--i];for(;i>0&&(n*=256);)s+=this[t+--i]*n;return n*=128,s>=n&&(s-=Math.pow(2,8*e)),s},c.prototype.readInt8=function(t,e){return t>>>=0,e||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||M(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||M(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=X((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const i=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),c.prototype.readBigInt64BE=X((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const i=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),c.prototype.readFloatLE=function(t,e){return t>>>=0,e||M(t,4,this.length),n.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||M(t,4,this.length),n.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||M(t,8,this.length),n.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||M(t,8,this.length),n.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e>>>=0,r>>>=0,!i){k(this,t,e,r,Math.pow(2,8*r)-1,0)}let n=1,s=0;for(this[e]=255&t;++s<r&&(n*=256);)this[e+s]=t/n&255;return e+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,e,r,i){if(t=+t,e>>>=0,r>>>=0,!i){k(this,t,e,r,Math.pow(2,8*r)-1,0)}let n=r-1,s=1;for(this[e+n]=255&t;--n>=0&&(s*=256);)this[e+n]=t/s&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=X((function(t,e=0){return L(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=X((function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}let n=0,s=1,o=0;for(this[e]=255&t;++n<r&&(s*=256);)t<0&&0===o&&0!==this[e+n-1]&&(o=1),this[e+n]=(t/s>>0)-o&255;return e+r},c.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}let n=r-1,s=1,o=0;for(this[e+n]=255&t;--n>=0&&(s*=256);)t<0&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/s>>0)-o&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=X((function(t,e=0){return L(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=X((function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,i){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);const n=i-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,i):Uint8Array.prototype.set.call(t,this.subarray(r,i),e),n},c.prototype.fill=function(t,e,r,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===t.length){const e=t.charCodeAt(0);("utf8"===i&&e<128||"latin1"===i)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let n;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n<r;++n)this[n]=t;else{const s=c.isBuffer(t)?t:c.from(t,i),o=s.length;if(0===o)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(n=0;n<r-e;++n)this[n+e]=s[n%o]}return this};const j={};function K(t,e,r){j[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function V(t){let e="",r=t.length;const i="-"===t[0]?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function F(t,e,r,i,n,s){if(t>r||t<e){const i="bigint"==typeof e?"n":"";let n;throw n=s>3?0===e||e===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(s+1)}${i}`:`>= -(2${i} ** ${8*(s+1)-1}${i}) and < 2 ** ${8*(s+1)-1}${i}`:`>= ${e}${i} and <= ${r}${i}`,new j.ERR_OUT_OF_RANGE("value",n,t)}!function(t,e,r){H(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||G(e,t.length-(r+1))}(i,n,s)}function H(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function G(t,e,r){if(Math.floor(t)!==t)throw H(t,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}K("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),K("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),K("ERR_OUT_OF_RANGE",(function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=V(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=V(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i}),RangeError);const $=/[^+/0-9A-Za-z-_]/g;function z(t,e){let r;e=e||1/0;const i=t.length;let n=null;const s=[];for(let o=0;o<i;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function q(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace($,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Z(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function W(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function X(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},3973:(t,e,r)=>{var i=r(7834).Buffer,n=r(4851).Transform,s=r(214).s;function o(t){n.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(1285)(o,n),o.prototype.update=function(t,e,r){"string"==typeof t&&(t=i.from(t,e));var n=this._update(t);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},o.prototype.setAutoPadding=function(){},o.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},o.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},o.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},o.prototype._transform=function(t,e,r){var i;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){i=t}finally{r(i)}},o.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},o.prototype._finalOrDigest=function(t){var e=this.__final()||i.alloc(0);return t&&(e=this._toString(e,t,!0)),e},o.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new s(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(t);return r&&(i+=this._decoder.end()),i},t.exports=o},6162:(t,e,r)=>{"use strict";var i=r(1285),n=r(7993),s=r(1445),o=r(9065),a=r(3973);function c(t){a.call(this,"digest"),this._hash=t}i(c,a),c.prototype._update=function(t){this._hash.update(t)},c.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new n:"rmd160"===t||"ripemd160"===t?new s:new c(o(t))}},7554:(t,e,r)=>{"use strict";var i=e;i.version=r(763).i8,i.utils=r(8288),i.rand=r(2745),i.curve=r(8610),i.curves=r(1479),i.ec=r(8596),i.eddsa=r(9208)},8919:(t,e,r)=>{"use strict";var i=r(2197),n=r(8288),s=n.getNAF,o=n.getJSF,a=n.assert;function c(t,e){this.type=t,this.p=new i(e.p,16),this.red=e.prime?i.red(e.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=e.n&&new i(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var 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 u(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),i=s(e,1,this._bitLength),n=(1<<r.step+1)-(r.step%2==0?2:1);n/=3;var o,c,u=[];for(o=0;o<i.length;o+=r.step){c=0;for(var h=o+r.step-1;h>=o;h--)c=(c<<1)+i[h];u.push(c)}for(var f=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=n;d>0;d--){for(o=0;o<u.length;o++)(c=u[o])===d?l=l.mixedAdd(r.points[o]):c===-d&&(l=l.mixedAdd(r.points[o].neg()));f=f.add(l)}return f.toP()},c.prototype._wnafMul=function(t,e){var r=4,i=t._getNAFPoints(r);r=i.wnd;for(var n=i.points,o=s(e,r,this._bitLength),c=this.jpoint(null,null,null),u=o.length-1;u>=0;u--){for(var h=0;u>=0&&0===o[u];u--)h++;if(u>=0&&h++,c=c.dblp(h),u<0)break;var f=o[u];a(0!==f),c="affine"===t.type?f>0?c.mixedAdd(n[f-1>>1]):c.mixedAdd(n[-f-1>>1].neg()):f>0?c.add(n[f-1>>1]):c.add(n[-f-1>>1].neg())}return"affine"===t.type?c.toP():c},c.prototype._wnafMulAdd=function(t,e,r,i,n){var a,c,u,h=this._wnafT1,f=this._wnafT2,l=this._wnafT3,d=0;for(a=0;a<i;a++){var p=(u=e[a])._getNAFPoints(t);h[a]=p.wnd,f[a]=p.points}for(a=i-1;a>=1;a-=2){var b=a-1,g=a;if(1===h[b]&&1===h[g]){var m=[e[b],null,null,e[g]];0===e[b].y.cmp(e[g].y)?(m[1]=e[b].add(e[g]),m[2]=e[b].toJ().mixedAdd(e[g].neg())):0===e[b].y.cmp(e[g].y.redNeg())?(m[1]=e[b].toJ().mixedAdd(e[g]),m[2]=e[b].add(e[g].neg())):(m[1]=e[b].toJ().mixedAdd(e[g]),m[2]=e[b].toJ().mixedAdd(e[g].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=o(r[b],r[g]);for(d=Math.max(y[0].length,d),l[b]=new Array(d),l[g]=new Array(d),c=0;c<d;c++){var w=0|y[0][c],_=0|y[1][c];l[b][c]=v[3*(w+1)+(_+1)],l[g][c]=0,f[b]=m}}else l[b]=s(r[b],h[b],this._bitLength),l[g]=s(r[g],h[g],this._bitLength),d=Math.max(l[b].length,d),d=Math.max(l[g].length,d)}var E=this.jpoint(null,null,null),S=this._wnafT4;for(a=d;a>=0;a--){for(var A=0;a>=0;){var O=!0;for(c=0;c<i;c++)S[c]=0|l[c][a],0!==S[c]&&(O=!1);if(!O)break;A++,a--}if(a>=0&&A++,E=E.dblp(A),a<0)break;for(c=0;c<i;c++){var T=S[c];0!==T&&(T>0?u=f[c][T-1>>1]:T<0&&(u=f[c][-T-1>>1].neg()),E="affine"===u.type?E.mixedAdd(u):E.add(u))}}for(a=0;a<i;a++)f[a]=null;return n?E:E.toP()},c.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},c.prototype.decodePoint=function(t,e){t=n.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?a(t[t.length-1]%2==0):7===t[0]&&a(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(t){return this.encode(t,!0)},u.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},u.prototype.encode=function(t,e){return n.encode(this._encode(e),t)},u.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},u.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},u.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<e;n+=t){for(var s=0;s<t;s++)i=i.dbl();r.push(i)}return{step:t,points:r}},u.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)e[n]=e[n-1].add(i);return{wnd:t,points:e}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},7105:(t,e,r)=>{"use strict";var i=r(8288),n=r(2197),s=r(1285),o=r(8919),a=i.assert;function c(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,o.call(this,"edwards",t),this.a=new n(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function u(t,e,r,i,s){o.BasePoint.call(this,t,"projective"),null===e&&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(e,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(c,o),t.exports=c,c.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},c.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},c.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},c.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.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 new Error("invalid point");var c=a.fromRed().isOdd();return(e&&!c||!e&&c)&&(a=a.redNeg()),this.point(t,a)},c.prototype.pointFromY=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.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(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},c.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(n)},s(u,o.BasePoint),c.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},c.prototype.point=function(t,e,r,i){return new u(this,t,e,r,i)},u.fromJSON=function(t,e){return new u(t,e[0],e[1],e[2])},u.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)+">"},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),s=i.redAdd(e),o=s.redSub(r),a=i.redSub(e),c=n.redMul(o),u=s.redMul(a),h=n.redMul(a),f=o.redMul(s);return this.curve.point(c,u,f,h)},u.prototype._projDbl=function(){var t,e,r,i,n,s,o=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(i=this.curve._mulA(a)).redAdd(c);this.zOne?(t=o.redSub(a).redSub(c).redMul(u.redSub(this.curve.two)),e=u.redMul(i.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(n=this.z.redSqr(),s=u.redSub(n).redISub(n),t=o.redSub(a).redISub(c).redMul(s),e=u.redMul(i.redSub(c)),r=u.redMul(s))}else i=a.redAdd(c),n=this.curve._mulC(this.z).redSqr(),s=i.redSub(n).redSub(n),t=this.curve._mulC(o.redISub(i)).redMul(s),e=this.curve._mulC(i).redMul(a.redISub(c)),r=i.redMul(s);return this.curve.point(t,e,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),s=r.redSub(e),o=n.redSub(i),a=n.redAdd(i),c=r.redAdd(e),u=s.redMul(o),h=a.redMul(c),f=s.redMul(c),l=o.redMul(a);return this.curve.point(u,h,l,f)},u.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),n=i.redSqr(),s=this.x.redMul(t.x),o=this.y.redMul(t.y),a=this.curve.d.redMul(s).redMul(o),c=n.redSub(a),u=n.redAdd(a),h=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(s).redISub(o),f=i.redMul(c).redMul(h);return this.curve.twisted?(e=i.redMul(u).redMul(o.redSub(this.curve._mulA(s))),r=c.redMul(u)):(e=i.redMul(u).redMul(o.redSub(s)),r=this.curve._mulC(c).redMul(u)),this.curve.point(f,e,r)},u.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},u.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},u.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},u.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},8610:(t,e,r)=>{"use strict";var i=e;i.base=r(8919),i.short=r(7715),i.mont=r(5125),i.edwards=r(7105)},5125:(t,e,r)=>{"use strict";var i=r(2197),n=r(1285),s=r(8919),o=r(8288);function a(t){s.call(this,"mont",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.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 c(t,e,r){s.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(e,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),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},n(c,s.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(o.toArray(t,e),1)},a.prototype.point=function(t,e){return new c(this,t,e)},a.prototype.pointFromJSON=function(t){return c.fromJSON(this,t)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(t,e){return new c(t,e[0],e[1]||t.one)},c.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)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),n=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),s=t.x.redSub(t.z).redMul(r),o=n.redMul(i),a=e.z.redMul(s.redAdd(o).redSqr()),c=e.x.redMul(s.redISub(o).redSqr());return this.curve.point(a,c)},c.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.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},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},7715:(t,e,r)=>{"use strict";var i=r(8288),n=r(2197),s=r(1285),o=r(8919),a=i.assert;function c(t){o.call(this,"short",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(t,e,r,i){o.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(e,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 h(t,e,r,i){o.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(e,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(c,o),t.exports=c,c.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new n(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=(e=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(t.lambda)r=new n(t.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(e))?r=s[0]:(r=s[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new n(t.a,16),b:new n(t.b,16)}})):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:n.mont(t),r=new n(2).toRed(e).redInvm(),i=r.redNeg(),s=new n(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(s).fromRed(),i.redSub(s).fromRed()]},c.prototype._getEndoBasis=function(t){for(var e,r,i,s,o,a,c,u,h,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,d=this.n.clone(),p=new n(1),b=new n(0),g=new n(0),m=new n(1),v=0;0!==l.cmpn(0);){var y=d.div(l);u=d.sub(y.mul(l)),h=g.sub(y.mul(p));var w=m.sub(y.mul(b));if(!i&&u.cmp(f)<0)e=c.neg(),r=p,i=u.neg(),s=h;else if(i&&2==++v)break;c=u,d=l,l=u,g=p,p=h,m=b,b=w}o=u.neg(),a=h;var _=i.sqr().add(s.sqr());return o.sqr().add(a.sqr()).cmp(_)>=0&&(o=e,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}]},c.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),c=n.mul(r.b),u=s.mul(i.b);return{k1:t.sub(o).sub(a),k2:c.add(u).neg()}},c.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var s=i.fromRed().isOdd();return(e&&!s||!e&&s)&&(i=i.redNeg()),this.point(t,i)},c.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},c.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s<t.length;s++){var o=this._endoSplit(e[s]),a=t[s],c=a._getBeta();o.k1.negative&&(o.k1.ineg(),a=a.neg(!0)),o.k2.negative&&(o.k2.ineg(),c=c.neg(!0)),i[2*s]=a,i[2*s+1]=c,n[2*s]=o.k1,n[2*s+1]=o.k2}for(var u=this._wnafMulAdd(1,i,n,2*s,r),h=0;h<2*s;h++)i[h]=null,n[h]=null;return u},s(u,o.BasePoint),c.prototype.point=function(t,e,r){return new u(this,t,e,r)},c.prototype.pointFromJSON=function(t,e){return u.fromJSON(this,t,e)},u.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,i=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}},u.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]},u.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);if(!e[2])return i;function n(e){return t.point(e[0],e[1],r)}var s=e[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},u.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)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},u.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).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)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(t){return t=new n(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},u.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},u.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},u.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.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 e},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},s(h,o.BasePoint),c.prototype.jpoint=function(t,e,r){return new h(this,t,e,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),c=s.redSub(o);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),h=u.redMul(a),f=i.redMul(u),l=c.redSqr().redIAdd(h).redISub(f).redISub(f),d=c.redMul(f.redISub(l)).redISub(s.redMul(h)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(l,d,p)},h.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,s=t.y.redMul(e).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 c=o.redSqr(),u=c.redMul(o),h=r.redMul(c),f=a.redSqr().redIAdd(u).redISub(h).redISub(h),l=a.redMul(h.redISub(f)).redISub(n.redMul(u)),d=this.z.redMul(o);return this.curve.jpoint(f,l,d)},h.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,s=this.x,o=this.y,a=this.z,c=a.redSqr().redSqr(),u=o.redAdd(o);for(e=0;e<t;e++){var h=s.redSqr(),f=u.redSqr(),l=f.redSqr(),d=h.redAdd(h).redIAdd(h).redIAdd(i.redMul(c)),p=s.redMul(f),b=d.redSqr().redISub(p.redAdd(p)),g=p.redISub(b),m=d.redMul(g);m=m.redIAdd(m).redISub(l);var v=u.redMul(a);e+1<t&&(c=c.redMul(l)),s=b,a=v,u=m}return this.curve.jpoint(s,u.redMul(n),a)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var 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),c=a.redSqr().redISub(o).redISub(o),u=s.redIAdd(s);u=(u=u.redIAdd(u)).redIAdd(u),t=c,e=a.redMul(o.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),f=this.y.redSqr(),l=f.redSqr(),d=this.x.redAdd(f).redSqr().redISub(h).redISub(l);d=d.redIAdd(d);var p=h.redAdd(h).redIAdd(h),b=p.redSqr(),g=l.redIAdd(l);g=(g=g.redIAdd(g)).redIAdd(g),t=b.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},h.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var 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),c=a.redSqr().redISub(o).redISub(o);t=c;var u=s.redIAdd(s);u=(u=u.redIAdd(u)).redIAdd(u),e=a.redMul(o.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),f=this.y.redSqr(),l=this.x.redMul(f),d=this.x.redSub(h).redMul(this.x.redAdd(h));d=d.redAdd(d).redIAdd(d);var p=l.redIAdd(l),b=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(h);var g=f.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=d.redMul(p.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,r)},h.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),s=e.redSqr(),o=r.redSqr(),a=s.redAdd(s).redIAdd(s).redIAdd(t.redMul(n)),c=e.redAdd(e),u=(c=c.redIAdd(c)).redMul(o),h=a.redSqr().redISub(u.redAdd(u)),f=u.redISub(h),l=o.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=a.redMul(f).redISub(l),p=r.redAdd(r).redMul(i);return this.curve.jpoint(h,d,p)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),i=e.redSqr(),n=t.redAdd(t).redIAdd(t),s=n.redSqr(),o=this.x.redAdd(e).redSqr().redISub(t).redISub(i),a=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(s)).redSqr(),c=i.redIAdd(i);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=n.redIAdd(o).redSqr().redISub(s).redISub(a).redISub(c),h=e.redMul(u);h=(h=h.redIAdd(h)).redIAdd(h);var f=this.x.redMul(a).redISub(h);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.y.redMul(u.redMul(c.redISub(u)).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(f,l,d)},h.prototype.mul=function(t,e){return t=new n(t,e),this.curve._wnafMul(this,t)},h.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var i=e.redMul(this.z),n=r.redMul(t.z);return 0===this.y.redMul(n).redISub(t.y.redMul(i)).cmpn(0)},h.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var i=t.clone(),n=this.curve.redN.redMul(e);;){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}},h.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)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},1479:(t,e,r)=>{"use strict";var i,n=e,s=r(3506),o=r(8610),a=r(8288).assert;function c(t){"short"===t.type?this.curve=new o.short(t):"edwards"===t.type?this.curve=new o.edwards(t):this.curve=new o.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new c(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=c,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:s.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:s.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:s.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:s.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:s.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:s.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:s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r(7983)}catch(t){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:s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},8596:(t,e,r)=>{"use strict";var i=r(2197),n=r(8873),s=r(8288),o=r(1479),a=r(2745),c=s.assert,u=r(2307),h=r(1798);function f(t){if(!(this instanceof f))return new f(t);"string"==typeof t&&(c(Object.prototype.hasOwnProperty.call(o,t),"Unknown curve "+t),t=o[t]),t instanceof o.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=f,f.prototype.keyPair=function(t){return new u(this,t)},f.prototype.keyFromPrivate=function(t,e){return u.fromPrivate(this,t,e)},f.prototype.keyFromPublic=function(t,e){return u.fromPublic(this,t,e)},f.prototype.genKeyPair=function(t){t||(t={});for(var e=new n({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),s=this.n.sub(new i(2));;){var o=new i(e.generate(r));if(!(o.cmp(s)>0))return o.iaddn(1),this.keyFromPrivate(o)}},f.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},f.prototype.sign=function(t,e,r,s){"object"==typeof r&&(s=r,r=null),s||(s={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i(t,16));for(var o=this.n.byteLength(),a=e.getPrivate().toArray("be",o),c=t.toArray("be",o),u=new n({hash:this.hash,entropy:a,nonce:c,pers:s.pers,persEnc:s.persEnc||"utf8"}),f=this.n.sub(new i(1)),l=0;;l++){var d=s.k?s.k(l):new i(u.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(f)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var b=p.getX(),g=b.umod(this.n);if(0!==g.cmpn(0)){var m=d.invm(this.n).mul(g.mul(e.getPrivate()).iadd(t));if(0!==(m=m.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==b.cmp(g)?2:0);return s.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),v^=1),new h({r:g,s:m,recoveryParam:v})}}}}}},f.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n);var s=(e=new h(e,"hex")).r,o=e.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,c=o.invm(this.n),u=c.mul(t).umod(this.n),f=c.mul(s).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),f)).isInfinity()&&a.eqXToP(s):!(a=this.g.mulAdd(u,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(s)},f.prototype.recoverPubKey=function(t,e,r,n){c((3&r)===r,"The recovery param is more than two bits"),e=new h(e,n);var s=this.n,o=new i(t),a=e.r,u=e.s,f=1&r,l=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),f):this.curve.pointFromX(a,f);var d=e.r.invm(s),p=s.sub(o).mul(d).umod(s),b=u.mul(d).umod(s);return this.g.mulAdd(p,a,b)},f.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new h(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(t,e,n)}catch(t){continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},2307:(t,e,r)=>{"use strict";var i=r(2197),n=r(8288).assert;function s(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=s,s.fromPublic=function(t,e,r){return e instanceof s?e:new s(t,{pub:e,pubEnc:r})},s.fromPrivate=function(t,e,r){return e instanceof s?e:new s(t,{priv:e,privEnc:r})},s.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},s.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},s.prototype._importPrivate=function(t,e){this.priv=new i(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},s.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?n(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},s.prototype.derive=function(t){return t.validate()||n(t.validate(),"public point not validated"),t.mul(this.priv).getX()},s.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},s.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},s.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},1798:(t,e,r)=>{"use strict";var i=r(2197),n=r(8288),s=n.assert;function o(t,e){if(t instanceof o)return t;this._importDER(t,e)||(s(t.r&&t.s,"Signature without r or s"),this.r=new i(t.r,16),this.s=new i(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function c(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,s=0,o=e.place;s<i;s++,o++)n<<=8,n|=t[o],n>>>=0;return!(n<=127)&&(e.place=o,n)}function u(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function h(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=o,o.prototype._importDER=function(t,e){t=n.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;var s=c(t,r);if(!1===s)return!1;if(s+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=c(t,r);if(!1===o)return!1;var u=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var h=c(t,r);if(!1===h)return!1;if(t.length!==h+r.place)return!1;var f=t.slice(r.place,h+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new i(u),this.s=new i(f),this.recoveryParam=null,!0},o.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];h(i,e.length),(i=i.concat(e)).push(2),h(i,r.length);var s=i.concat(r),o=[48];return h(o,s.length),o=o.concat(s),n.encode(o,t)}},9208:(t,e,r)=>{"use strict";var i=r(3506),n=r(1479),s=r(8288),o=s.assert,a=s.parseBytes,c=r(851),u=r(6117);function h(t){if(o("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof h))return new h(t);t=n[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=i.sha512}t.exports=h,h.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),n=this.g.mul(i),s=this.encodePoint(n),o=this.hashInt(s,r.pubBytes(),t).mul(r.priv()),c=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:c,Rencoded:s})},h.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var i=this.keyFromPublic(r),n=this.hashInt(e.Rencoded(),i.pubBytes(),t),s=this.g.mul(e.S());return e.R().add(i.pub().mul(n)).eq(s)},h.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return s.intFromLE(t.digest()).umod(this.curve.n)},h.prototype.keyFromPublic=function(t){return c.fromPublic(this,t)},h.prototype.keyFromSecret=function(t){return c.fromSecret(this,t)},h.prototype.makeSignature=function(t){return t instanceof u?t:new u(this,t)},h.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},h.prototype.decodePoint=function(t){var e=(t=s.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),i=0!=(128&t[e]),n=s.intFromLE(r);return this.curve.pointFromY(n,i)},h.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},h.prototype.decodeInt=function(t){return s.intFromLE(t)},h.prototype.isPoint=function(t){return t instanceof this.pointClass}},851:(t,e,r)=>{"use strict";var i=r(8288),n=i.assert,s=i.parseBytes,o=i.cachedProperty;function a(t,e){this.eddsa=t,this._secret=s(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=s(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},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 t=this.eddsa,e=this.hash(),r=t.encodingLength-1,i=e.slice(0,t.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(t){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return n(this._secret,"KeyPair is public only"),i.encode(this.secret(),t)},a.prototype.getPublic=function(t){return i.encode(this.pubBytes(),t)},t.exports=a},6117:(t,e,r)=>{"use strict";var i=r(2197),n=r(8288),s=n.assert,o=n.cachedProperty,a=n.parseBytes;function c(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),s(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof i&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}o(c,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),o(c,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),o(c,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),o(c,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},t.exports=c},7983:t=>{t.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"]]}}},8288:(t,e,r)=>{"use strict";var i=e,n=r(2197),s=r(9561),o=r(3022);i.assert=s,i.toArray=o.toArray,i.zero2=o.zero2,i.toHex=o.toHex,i.encode=o.encode,i.getNAF=function(t,e,r){var i=new Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<<e+1,s=t.clone(),o=0;o<i.length;o++){var a,c=s.andln(n-1);s.isOdd()?(a=c>(n>>1)-1?(n>>1)-c:c,s.isubn(a)):a=0,i[o]=a,s.iushrn(1)}return i},i.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,s=0;t.cmpn(-n)>0||e.cmpn(-s)>0;){var o,a,c=t.andln(3)+n&3,u=e.andln(3)+s&3;3===c&&(c=-1),3===u&&(u=-1),o=0==(1&c)?0:3!==(i=t.andln(7)+n&7)&&5!==i||2!==u?c:-c,r[0].push(o),a=0==(1&u)?0:3!==(i=e.andln(7)+s&7)&&5!==i||2!==c?u:-u,r[1].push(a),2*n===o+1&&(n=1-n),2*s===a+1&&(s=1-s),t.iushrn(1),e.iushrn(1)}return r},i.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(t){return"string"==typeof t?i.toArray(t,"hex"):t},i.intFromLE=function(t){return new n(t,"hex","le")}},2699:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,s),i(r)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}b(t,e,s,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&b(t,"error",e,r)}(t,n,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function u(t,e,r,i){var n,s,o,u;if(a(r),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),void 0===o)o=s[e]=r,++t._eventsCount;else if("function"==typeof o?o=s[e]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=c(t))>0&&o.length>n&&!o.warned){o.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=o.length,u=h,console&&console.warn&&console.warn(u)}return t}function h(){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 f(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=h.bind(i);return n.listener=r,i.wrapFn=n,n}function l(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(n):p(n,n.length)}function d(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function b(t,e,r,i){if("function"==typeof t.on)i.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function n(s){i.once&&t.removeEventListener(e,n),r(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(t){if("number"!=typeof t||t<0||n(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");o=t}}),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(t){if("number"!=typeof t||t<0||n(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[t];if(void 0===c)return!1;if("function"==typeof c)i(c,this,e);else{var u=c.length,h=p(c,u);for(r=0;r<u;++r)i(h[r],this,e)}return!0},s.prototype.addListener=function(t,e){return u(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return u(this,t,e,!0)},s.prototype.once=function(t,e){return a(e),this.on(t,f(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,f(this,t,e)),this},s.prototype.removeListener=function(t,e){var r,i,n,s,o;if(a(e),void 0===(i=this._events))return this;if(void 0===(r=i[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(n=-1,s=r.length-1;s>=0;s--)if(r[s]===e||r[s].listener===e){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,n),1===r.length&&(i[t]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",t,o||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,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[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),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(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},s.prototype.listeners=function(t){return l(this,t,!0)},s.prototype.rawListeners=function(t){return l(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},s.prototype.listenerCount=d,s.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},5695:t=>{"use strict";t.exports=function(t,e){e||(e={}),"function"==typeof e&&(e={cmp:e});var r,i="boolean"==typeof e.cycles&&e.cycles,n=e.cmp&&(r=e.cmp,function(t){return function(e,i){var n={key:e,value:t[e]},s={key:i,value:t[i]};return r(n,s)}}),s=[];return function t(e){if(e&&e.toJSON&&"function"==typeof e.toJSON&&(e=e.toJSON()),void 0!==e){if("number"==typeof e)return isFinite(e)?""+e:"null";if("object"!=typeof e)return JSON.stringify(e);var r,o;if(Array.isArray(e)){for(o="[",r=0;r<e.length;r++)r&&(o+=","),o+=t(e[r])||"null";return o+"]"}if(null===e)return"null";if(-1!==s.indexOf(e)){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var a=s.push(e)-1,c=Object.keys(e).sort(n&&n(e));for(o="",r=0;r<c.length;r++){var u=c[r],h=t(e[u]);h&&(o&&(o+=","),o+=JSON.stringify(u)+":"+h)}return s.splice(a,1),"{"+o+"}"}}(t)}},4485:(t,e,r)=>{"use strict";var i=r(7834).Buffer,n=r(7525).Transform;function s(t){n.call(this),this._block=i.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(1285)(s,n),s.prototype._transform=function(t,e,r){var i=null;try{this.update(t,e)}catch(t){i=t}r(i)},s.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},s.prototype.update=function(t,e){if(function(t,e){if(!i.isBuffer(t)&&"string"!=typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");i.isBuffer(t)||(t=i.from(t,e));for(var r=this._block,n=0;this._blockOffset+t.length-n>=this._blockSize;){for(var s=this._blockOffset;s<this._blockSize;)r[s++]=t[n++];this._update(),this._blockOffset=0}for(;n<t.length;)r[this._blockOffset++]=t[n++];for(var o=0,a=8*t.length;a>0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},s.prototype._update=function(){throw new Error("_update is not implemented")},s.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},s.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=s},3506:(t,e,r)=>{var i=e;i.utils=r(212),i.common=r(4495),i.sha=r(5530),i.ripemd=r(1396),i.hmac=r(5047),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},4495:(t,e,r)=>{"use strict";var i=r(212),n=r(9561);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}e.BlockHash=s,s.prototype.update=function(t,e){if(t=i.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=i.join32(t,0,t.length-r,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},s.prototype.digest=function(t){return this.update(this._pad()),n(null===this.pending),this._digest(t)},s.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(t<<=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++]=t>>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,s=8;s<this.padLength;s++)i[n++]=0;return i}},5047:(t,e,r)=>{"use strict";var i=r(212),n=r(9561);function s(t,e,r){if(!(this instanceof s))return new s(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(e,r))}t.exports=s,s.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),n(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},s.prototype.update=function(t,e){return this.inner.update(t,e),this},s.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},1396:(t,e,r)=>{"use strict";var i=r(212),n=r(4495),s=i.rotl32,o=i.sum32,a=i.sum32_3,c=i.sum32_4,u=n.BlockHash;function h(){if(!(this instanceof h))return new h;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function l(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}i.inherits(h,u),e.ripemd160=h,h.blockSize=512,h.outSize=160,h.hmacStrength=192,h.padLength=64,h.prototype._update=function(t,e){for(var r=this.h[0],i=this.h[1],n=this.h[2],u=this.h[3],h=this.h[4],v=r,y=i,w=n,_=u,E=h,S=0;S<80;S++){var A=o(s(c(r,f(S,i,n,u),t[p[S]+e],l(S)),g[S]),h);r=h,h=u,u=s(n,10),n=i,i=A,A=o(s(c(v,f(79-S,y,w,_),t[b[S]+e],d(S)),m[S]),E),v=E,E=_,_=s(w,10),w=y,y=A}A=a(this.h[1],n,_),this.h[1]=a(this.h[2],u,E),this.h[2]=a(this.h[3],h,v),this.h[3]=a(this.h[4],r,y),this.h[4]=a(this.h[0],i,w),this.h[0]=A},h.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"little"):i.split32(this.h,"little")};var p=[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],b=[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],g=[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],m=[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]},5530:(t,e,r)=>{"use strict";e.sha1=r(5079),e.sha224=r(3823),e.sha256=r(8032),e.sha384=r(5328),e.sha512=r(168)},5079:(t,e,r)=>{"use strict";var i=r(212),n=r(4495),s=r(713),o=i.rotl32,a=i.sum32,c=i.sum32_5,u=s.ft_1,h=n.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(l,h),t.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+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],h=this.h[2],l=this.h[3],d=this.h[4];for(i=0;i<r.length;i++){var p=~~(i/20),b=c(o(n,5),u(p,s,h,l),d,r[i],f[p]);d=l,l=h,h=o(s,30),s=n,n=b}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],s),this.h[2]=a(this.h[2],h),this.h[3]=a(this.h[3],l),this.h[4]=a(this.h[4],d)},l.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},3823:(t,e,r)=>{"use strict";var i=r(212),n=r(8032);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(s,n),t.exports=s,s.blockSize=512,s.outSize=224,s.hmacStrength=192,s.padLength=64,s.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},8032:(t,e,r)=>{"use strict";var i=r(212),n=r(4495),s=r(713),o=r(9561),a=i.sum32,c=i.sum32_4,u=i.sum32_5,h=s.ch32,f=s.maj32,l=s.s0_256,d=s.s1_256,p=s.g0_256,b=s.g1_256,g=n.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}i.inherits(v,g),t.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=c(b(r[i-2]),r[i-7],p(r[i-15]),r[i-16]);var n=this.h[0],s=this.h[1],g=this.h[2],m=this.h[3],v=this.h[4],y=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=u(_,d(v),h(v,y,w),this.k[i],r[i]),S=a(l(n),f(n,s,g));_=w,w=y,y=v,v=a(m,E),m=g,g=s,s=n,n=a(E,S)}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],s),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],m),this.h[4]=a(this.h[4],v),this.h[5]=a(this.h[5],y),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},v.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},5328:(t,e,r)=>{"use strict";var i=r(212),n=r(168);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(s,n),t.exports=s,s.blockSize=1024,s.outSize=384,s.hmacStrength=192,s.padLength=128,s.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},168:(t,e,r)=>{"use strict";var i=r(212),n=r(4495),s=r(9561),o=i.rotr64_hi,a=i.rotr64_lo,c=i.shr64_hi,u=i.shr64_lo,h=i.sum64,f=i.sum64_hi,l=i.sum64_lo,d=i.sum64_4_hi,p=i.sum64_4_lo,b=i.sum64_5_hi,g=i.sum64_5_lo,m=n.BlockHash,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function y(){if(!(this instanceof y))return new y;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function w(t,e,r,i,n){var s=t&r^~t&n;return s<0&&(s+=4294967296),s}function _(t,e,r,i,n,s){var o=e&i^~e&s;return o<0&&(o+=4294967296),o}function E(t,e,r,i,n){var s=t&r^t&n^r&n;return s<0&&(s+=4294967296),s}function S(t,e,r,i,n,s){var o=e&i^e&s^i&s;return o<0&&(o+=4294967296),o}function A(t,e){var r=o(t,e,28)^o(e,t,2)^o(e,t,7);return r<0&&(r+=4294967296),r}function O(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function T(t,e){var r=o(t,e,14)^o(t,e,18)^o(e,t,9);return r<0&&(r+=4294967296),r}function x(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function P(t,e){var r=o(t,e,1)^o(t,e,8)^c(t,e,7);return r<0&&(r+=4294967296),r}function R(t,e){var r=a(t,e,1)^a(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=o(t,e,19)^o(e,t,29)^c(t,e,6);return r<0&&(r+=4294967296),r}function N(t,e){var r=a(t,e,19)^a(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}i.inherits(y,m),t.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(t,e){for(var r=this.W,i=0;i<32;i++)r[i]=t[e+i];for(;i<r.length;i+=2){var n=I(r[i-4],r[i-3]),s=N(r[i-4],r[i-3]),o=r[i-14],a=r[i-13],c=P(r[i-30],r[i-29]),u=R(r[i-30],r[i-29]),h=r[i-32],f=r[i-31];r[i]=d(n,s,o,a,c,u,h,f),r[i+1]=p(n,s,o,a,c,u,h,f)}},y.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,i=this.h[0],n=this.h[1],o=this.h[2],a=this.h[3],c=this.h[4],u=this.h[5],d=this.h[6],p=this.h[7],m=this.h[8],v=this.h[9],y=this.h[10],P=this.h[11],R=this.h[12],I=this.h[13],N=this.h[14],M=this.h[15];s(this.k.length===r.length);for(var k=0;k<r.length;k+=2){var L=N,C=M,B=T(m,v),D=x(m,v),U=w(m,v,y,P,R),j=_(m,v,y,P,R,I),K=this.k[k],V=this.k[k+1],F=r[k],H=r[k+1],G=b(L,C,B,D,U,j,K,V,F,H),$=g(L,C,B,D,U,j,K,V,F,H);L=A(i,n),C=O(i,n),B=E(i,n,o,a,c),D=S(i,n,o,a,c,u);var z=f(L,C,B,D),q=l(L,C,B,D);N=R,M=I,R=y,I=P,y=m,P=v,m=f(d,p,G,$),v=l(p,p,G,$),d=c,p=u,c=o,u=a,o=i,a=n,i=f(G,$,z,q),n=l(G,$,z,q)}h(this.h,0,i,n),h(this.h,2,o,a),h(this.h,4,c,u),h(this.h,6,d,p),h(this.h,8,m,v),h(this.h,10,y,P),h(this.h,12,R,I),h(this.h,14,N,M)},y.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},713:(t,e,r)=>{"use strict";var i=r(212).rotr32;function n(t,e,r){return t&e^~t&r}function s(t,e,r){return t&e^t&r^e&r}function o(t,e,r){return t^e^r}e.ft_1=function(t,e,r,i){return 0===t?n(e,r,i):1===t||3===t?o(e,r,i):2===t?s(e,r,i):void 0},e.ch32=n,e.maj32=s,e.p32=o,e.s0_256=function(t){return i(t,2)^i(t,13)^i(t,22)},e.s1_256=function(t){return i(t,6)^i(t,11)^i(t,25)},e.g0_256=function(t){return i(t,7)^i(t,18)^t>>>3},e.g1_256=function(t){return i(t,17)^i(t,19)^t>>>10}},212:(t,e,r)=>{"use strict";var i=r(9561),n=r(1285);function s(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function c(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=n,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var i=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);o<128?r[i++]=o:o<2048?(r[i++]=o>>6|192,r[i++]=63&o|128):s(t,n)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++n)),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=63&o|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=63&o|128)}else for(n=0;n<t.length;n++)r[n]=0|t[n];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},e.htonl=o,e.toHex32=function(t,e){for(var r="",i=0;i<t.length;i++){var n=t[i];"little"===e&&(n=o(n)),r+=c(n.toString(16))}return r},e.zero2=a,e.zero8=c,e.join32=function(t,e,r,n){var s=r-e;i(s%4==0);for(var o=new Array(s/4),a=0,c=e;a<o.length;a++,c+=4){var u;u="big"===n?t[c]<<24|t[c+1]<<16|t[c+2]<<8|t[c+3]:t[c+3]<<24|t[c+2]<<16|t[c+1]<<8|t[c],o[a]=u>>>0}return o},e.split32=function(t,e){for(var r=new Array(4*t.length),i=0,n=0;i<t.length;i++,n+=4){var s=t[i];"big"===e?(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},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,i){return t+e+r+i>>>0},e.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},e.sum64=function(t,e,r,i){var n=t[e],s=i+t[e+1]>>>0,o=(s<i?1:0)+r+n;t[e]=o>>>0,t[e+1]=s},e.sum64_hi=function(t,e,r,i){return(e+i>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,i){return e+i>>>0},e.sum64_4_hi=function(t,e,r,i,n,s,o,a){var c=0,u=e;return c+=(u=u+i>>>0)<e?1:0,c+=(u=u+s>>>0)<s?1:0,t+r+n+o+(c+=(u=u+a>>>0)<a?1:0)>>>0},e.sum64_4_lo=function(t,e,r,i,n,s,o,a){return e+i+s+a>>>0},e.sum64_5_hi=function(t,e,r,i,n,s,o,a,c,u){var h=0,f=e;return h+=(f=f+i>>>0)<e?1:0,h+=(f=f+s>>>0)<s?1:0,h+=(f=f+a>>>0)<a?1:0,t+r+n+o+c+(h+=(f=f+u>>>0)<u?1:0)>>>0},e.sum64_5_lo=function(t,e,r,i,n,s,o,a,c,u){return e+i+s+a+u>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},8873:(t,e,r)=>{"use strict";var i=r(3506),n=r(3022),s=r(9561);function o(t){if(!(this instanceof o))return new o(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=n.toArray(t.entropy,t.entropyEnc||"hex"),r=n.toArray(t.nonce,t.nonceEnc||"hex"),i=n.toArray(t.pers,t.persEnc||"hex");s(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}t.exports=o,o.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new 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=281474976710656},o.prototype._hmac=function(){return new i.hmac(this.hash,this.K)},o.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},o.prototype.reseed=function(t,e,r,i){"string"!=typeof e&&(i=r,r=e,e=null),t=n.toArray(t,e),r=n.toArray(r,i),s(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},o.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=n.toArray(r,i||"hex"),this._update(r));for(var s=[];s.length<t;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var o=s.slice(0,t);return this._update(r),this._reseed++,n.encode(o,e)}},2333:(t,e)=>{e.read=function(t,e,r,i,n){var s,o,a=8*n-i-1,c=(1<<a)-1,u=c>>1,h=-7,f=r?n-1:0,l=r?-1:1,d=t[e+f];for(f+=l,s=d&(1<<-h)-1,d>>=-h,h+=a;h>0;s=256*s+t[e+f],f+=l,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=i;h>0;o=256*o+t[e+f],f+=l,h-=8);if(0===s)s=1-u;else{if(s===c)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,i),s-=u}return(d?-1:1)*o*Math.pow(2,s-i)},e.write=function(t,e,r,i,n,s){var o,a,c,u=8*s-n-1,h=(1<<u)-1,f=h>>1,l=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:s-1,p=i?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),(e+=o+f>=1?l/c:l*Math.pow(2,1-f))*c>=2&&(o++,c/=2),o+f>=h?(a=0,o=h):o+f>=1?(a=(e*c-1)*Math.pow(2,n),o+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,n),o=0));n>=8;t[r+d]=255&a,d+=p,a/=256,n-=8);for(o=o<<n|a,u+=n;u>0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*b}},1285:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},7993:(t,e,r)=>{"use strict";var i=r(1285),n=r(4485),s=r(7834).Buffer,o=new Array(16);function a(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(t,e){return t<<e|t>>>32-e}function u(t,e,r,i,n,s,o){return c(t+(e&r|~e&i)+n+s|0,o)+e|0}function h(t,e,r,i,n,s,o){return c(t+(e&i|r&~i)+n+s|0,o)+e|0}function f(t,e,r,i,n,s,o){return c(t+(e^r^i)+n+s|0,o)+e|0}function l(t,e,r,i,n,s,o){return c(t+(r^(e|~i))+n+s|0,o)+e|0}i(a,n),a.prototype._update=function(){for(var t=o,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,i=this._b,n=this._c,s=this._d;r=u(r,i,n,s,t[0],3614090360,7),s=u(s,r,i,n,t[1],3905402710,12),n=u(n,s,r,i,t[2],606105819,17),i=u(i,n,s,r,t[3],3250441966,22),r=u(r,i,n,s,t[4],4118548399,7),s=u(s,r,i,n,t[5],1200080426,12),n=u(n,s,r,i,t[6],2821735955,17),i=u(i,n,s,r,t[7],4249261313,22),r=u(r,i,n,s,t[8],1770035416,7),s=u(s,r,i,n,t[9],2336552879,12),n=u(n,s,r,i,t[10],4294925233,17),i=u(i,n,s,r,t[11],2304563134,22),r=u(r,i,n,s,t[12],1804603682,7),s=u(s,r,i,n,t[13],4254626195,12),n=u(n,s,r,i,t[14],2792965006,17),r=h(r,i=u(i,n,s,r,t[15],1236535329,22),n,s,t[1],4129170786,5),s=h(s,r,i,n,t[6],3225465664,9),n=h(n,s,r,i,t[11],643717713,14),i=h(i,n,s,r,t[0],3921069994,20),r=h(r,i,n,s,t[5],3593408605,5),s=h(s,r,i,n,t[10],38016083,9),n=h(n,s,r,i,t[15],3634488961,14),i=h(i,n,s,r,t[4],3889429448,20),r=h(r,i,n,s,t[9],568446438,5),s=h(s,r,i,n,t[14],3275163606,9),n=h(n,s,r,i,t[3],4107603335,14),i=h(i,n,s,r,t[8],1163531501,20),r=h(r,i,n,s,t[13],2850285829,5),s=h(s,r,i,n,t[2],4243563512,9),n=h(n,s,r,i,t[7],1735328473,14),r=f(r,i=h(i,n,s,r,t[12],2368359562,20),n,s,t[5],4294588738,4),s=f(s,r,i,n,t[8],2272392833,11),n=f(n,s,r,i,t[11],1839030562,16),i=f(i,n,s,r,t[14],4259657740,23),r=f(r,i,n,s,t[1],2763975236,4),s=f(s,r,i,n,t[4],1272893353,11),n=f(n,s,r,i,t[7],4139469664,16),i=f(i,n,s,r,t[10],3200236656,23),r=f(r,i,n,s,t[13],681279174,4),s=f(s,r,i,n,t[0],3936430074,11),n=f(n,s,r,i,t[3],3572445317,16),i=f(i,n,s,r,t[6],76029189,23),r=f(r,i,n,s,t[9],3654602809,4),s=f(s,r,i,n,t[12],3873151461,11),n=f(n,s,r,i,t[15],530742520,16),r=l(r,i=f(i,n,s,r,t[2],3299628645,23),n,s,t[0],4096336452,6),s=l(s,r,i,n,t[7],1126891415,10),n=l(n,s,r,i,t[14],2878612391,15),i=l(i,n,s,r,t[5],4237533241,21),r=l(r,i,n,s,t[12],1700485571,6),s=l(s,r,i,n,t[3],2399980690,10),n=l(n,s,r,i,t[10],4293915773,15),i=l(i,n,s,r,t[1],2240044497,21),r=l(r,i,n,s,t[8],1873313359,6),s=l(s,r,i,n,t[15],4264355552,10),n=l(n,s,r,i,t[6],2734768916,15),i=l(i,n,s,r,t[13],1309151649,21),r=l(r,i,n,s,t[4],4149444226,6),s=l(s,r,i,n,t[11],3174756917,10),n=l(n,s,r,i,t[2],718787259,15),i=l(i,n,s,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+s|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=s.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=a},9561:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},3022:(t,e)=>{"use strict";var r=e;function i(t){return 1===t.length?"0"+t:t}function n(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e}r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var i=0;i<t.length;i++)r[i]=0|t[i];return r}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(i=0;i<t.length;i++){var n=t.charCodeAt(i),s=n>>8,o=255&n;s?r.push(s,o):r.push(o)}return r},r.zero2=i,r.toHex=n,r.encode=function(t,e){return"hex"===e?n(t):t}},4452:t=>{"use strict";var e={};function r(t,r,i){i||(i=Error);var n=function(t){var e,i;function n(e,i,n){return t.call(this,function(t,e,i){return"string"==typeof r?r:r(t,e,i)}(e,i,n))||this}return i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,e.__proto__=i,n}(i);n.prototype.name=i.name,n.prototype.code=t,e[t]=n}function i(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,s,o,a;if("string"==typeof e&&(s="not ",e.substr(!o||o<0?0:+o,s.length)===s)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))a="The ".concat(t," ").concat(n," ").concat(i(e,"type"));else{var c=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";a='The "'.concat(t,'" ').concat(c," ").concat(n," ").concat(i(e,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},7073:(t,e,r)=>{"use strict";var i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var n=r(8051),s=r(2557);r(1285)(u,n);for(var o=i(s.prototype),a=0;a<o.length;a++){var c=o[a];u.prototype[c]||(u.prototype[c]=s.prototype[c])}function u(t){if(!(this instanceof u))return new u(t);n.call(this,t),s.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||process.nextTick(f,this)}function f(t){t.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},5163:(t,e,r)=>{"use strict";t.exports=n;var i=r(7640);function n(t){if(!(this instanceof n))return new n(t);i.call(this,t)}r(1285)(n,i),n.prototype._transform=function(t,e,r){r(null,t)}},8051:(t,e,r)=>{"use strict";var i;t.exports=A,A.ReadableState=S;r(2699).EventEmitter;var n=function(t,e){return t.listeners(e).length},s=r(5010),o=r(8834).Buffer,a=r.g.Uint8Array||function(){};var c,u=r(6602);c=u&&u.debuglog?u.debuglog("stream"):function(){};var h,f,l,d=r(6637),p=r(2262),b=r(7605).getHighWaterMark,g=r(4452).q,m=g.ERR_INVALID_ARG_TYPE,v=g.ERR_STREAM_PUSH_AFTER_EOF,y=g.ERR_METHOD_NOT_IMPLEMENTED,w=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(1285)(A,s);var _=p.errorOrDestroy,E=["error","close","destroy","pause","resume"];function S(t,e,n){i=i||r(7073),t=t||{},"boolean"!=typeof n&&(n=e instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=b(this,t,"readableHighWaterMark",n),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(h||(h=r(214).s),this.decoder=new h(t.encoding),this.encoding=t.encoding)}function A(t){if(i=i||r(7073),!(this instanceof A))return new A(t);var e=this instanceof i;this._readableState=new S(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function O(t,e,r,i,n){c("readableAddChunk",e);var s,u=t._readableState;if(null===e)u.reading=!1,function(t,e){if(c("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?R(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}(t,u);else if(n||(s=function(t,e){var r;i=e,o.isBuffer(i)||i instanceof a||"string"==typeof e||void 0===e||t.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],e));var i;return r}(u,e)),s)_(t,s);else if(u.objectMode||e&&e.length>0)if("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===o.prototype||(e=function(t){return o.from(t)}(e)),i)u.endEmitted?_(t,new w):T(t,u,e,!0);else if(u.ended)_(t,new v);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(e=u.decoder.write(e),u.objectMode||0!==e.length?T(t,u,e,!1):N(t,u)):T(t,u,e,!1)}else i||(u.reading=!1,N(t,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function T(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&R(t)),N(t,e)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),A.prototype.destroy=p.destroy,A.prototype._undestroy=p.undestroy,A.prototype._destroy=function(t,e){e(t)},A.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=o.from(t,e),e=""),r=!0),O(this,t,e,!1,r)},A.prototype.unshift=function(t){return O(this,t,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(t){h||(h=r(214).s);var e=new h(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var i=this._readableState.buffer.head,n="";null!==i;)n+=e.write(i.data),i=i.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var x=1073741824;function P(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=x?t=x:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function R(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(I,t))}function I(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,B(t)}function N(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(M,t,e))}function M(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(c("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function k(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function L(t){c("readable nexttick read 0"),t.read(0)}function C(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),B(t),e.flowing&&!e.reading&&t.read(0)}function B(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function D(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function U(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(j,e,t))}function j(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function K(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}A.prototype.read=function(t){c("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):R(this),null;if(0===(t=P(t,e))&&e.ended)return 0===e.length&&U(this),null;var i,n=e.needReadable;return c("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&c("length less than watermark",n=!0),e.ended||e.reading?c("reading or ended",n=!1):n&&(c("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=P(r,e))),null===(i=t>0?D(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&U(this)),null!==i&&this.emit("data",i),i},A.prototype._read=function(t){_(this,new y("_read()"))},A.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,e);var s=(!e||!1!==e.end)&&t!==process.stdout&&t!==process.stderr?a:b;function o(e,n){c("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",u),t.removeListener("error",l),t.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",b),r.removeListener("data",f),h=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}function a(){c("onend"),t.end()}i.endEmitted?process.nextTick(s):r.once("end",s),t.on("unpipe",o);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&n(t,"data")&&(e.flowing=!0,B(t))}}(r);t.on("drain",u);var h=!1;function f(e){c("ondata");var n=t.write(e);c("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==K(i.pipes,t))&&!h&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function l(e){c("onerror",e),b(),t.removeListener("error",l),0===n(t,"error")&&_(t,e)}function d(){t.removeListener("finish",p),b()}function p(){c("onfinish"),t.removeListener("close",d),b()}function b(){c("unpipe"),r.unpipe(t)}return r.on("data",f),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",l),t.once("close",d),t.once("finish",p),t.emit("pipe",r),i.flowing||(c("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<n;s++)i[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=K(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},A.prototype.on=function(t,e){var r=s.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?R(this):i.reading||process.nextTick(L,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(k,this),r},A.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(k,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(C,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var n in t.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(n){(c("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(e.push(n)||(i=!0,t.pause()))})),t)void 0===this[n]&&"function"==typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var s=0;s<E.length;s++)t.on(E[s],this.emit.bind(this,E[s]));return this._read=function(e){c("wrapped _read",e),i&&(i=!1,t.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(1029)),f(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),A._fromList=D,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(t,e){return void 0===l&&(l=r(352)),l(A,t,e)})},7640:(t,e,r)=>{"use strict";t.exports=h;var i=r(4452).q,n=i.ERR_METHOD_NOT_IMPLEMENTED,s=i.ERR_MULTIPLE_CALLBACK,o=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=i.ERR_TRANSFORM_WITH_LENGTH_0,c=r(7073);function u(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new s);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function h(t){if(!(this instanceof h))return new h(t);c.call(this,t),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",f)}function f(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?l(this,null,null):this._flush((function(e,r){l(t,e,r)}))}function l(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new o;return t.push(null)}r(1285)(h,c),h.prototype.push=function(t,e){return this._transformState.needTransform=!1,c.prototype.push.call(this,t,e)},h.prototype._transform=function(t,e,r){r(new n("_transform()"))},h.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},h.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},h.prototype._destroy=function(t,e){c.prototype._destroy.call(this,t,(function(t){e(t)}))}},2557:(t,e,r)=>{"use strict";function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var i=t.entry;t.entry=null;for(;i;){var n=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree.next=t}(e,t)}}var n;t.exports=A,A.WritableState=S;var s={deprecate:r(5803)},o=r(5010),a=r(8834).Buffer,c=r.g.Uint8Array||function(){};var u,h=r(2262),f=r(7605).getHighWaterMark,l=r(4452).q,d=l.ERR_INVALID_ARG_TYPE,p=l.ERR_METHOD_NOT_IMPLEMENTED,b=l.ERR_MULTIPLE_CALLBACK,g=l.ERR_STREAM_CANNOT_PIPE,m=l.ERR_STREAM_DESTROYED,v=l.ERR_STREAM_NULL_VALUES,y=l.ERR_STREAM_WRITE_AFTER_END,w=l.ERR_UNKNOWN_ENCODING,_=h.errorOrDestroy;function E(){}function S(t,e,s){n=n||r(7073),t=t||{},"boolean"!=typeof s&&(s=e instanceof n),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=f(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===t.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if("function"!=typeof n)throw new b;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,i,n){--e.pendingcb,r?(process.nextTick(n,i),process.nextTick(I,t,e),t._writableState.errorEmitted=!0,_(t,i)):(n(i),t._writableState.errorEmitted=!0,_(t,i),I(t,e))}(t,r,i,e,n);else{var s=P(r)||t.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||x(t,r),i?process.nextTick(T,t,r,s,n):T(t,r,s,n)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function A(t){var e=this instanceof(n=n||r(7073));if(!e&&!u.call(A,this))return new A(t);this._writableState=new S(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),o.call(this)}function O(t,e,r,i,n,s,o){e.writelen=i,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):r?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}function T(t,e,r,i){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),I(t,e)}function x(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,s=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var a=0,c=!0;r;)s[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;s.allBuffers=c,O(t,e,!0,e.length,s,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,h=r.encoding,f=r.callback;if(O(t,e,!1,e.objectMode?1:u.length,u,h,f),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function P(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function R(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,e){var r=P(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(R,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}r(1285)(A,o),S.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(S.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(u=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!u.call(this,t)||this===A&&(t&&t._writableState instanceof S)}})):u=function(t){return t instanceof this},A.prototype.pipe=function(){_(this,new g)},A.prototype.write=function(t,e,r){var i,n=this._writableState,s=!1,o=!n.objectMode&&(i=t,a.isBuffer(i)||i instanceof c);return o&&!a.isBuffer(t)&&(t=function(t){return a.from(t)}(t)),"function"==typeof e&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=E),n.ending?function(t,e){var r=new y;_(t,r),process.nextTick(e,r)}(this,r):(o||function(t,e,r,i){var n;return null===r?n=new v:"string"==typeof r||e.objectMode||(n=new d("chunk",["string","Buffer"],r)),!n||(_(t,n),process.nextTick(i,n),!1)}(this,n,t,r))&&(n.pendingcb++,s=function(t,e,r,i,n,s){if(!r){var o=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=a.from(e,r));return e}(e,i,n);i!==o&&(r=!0,n="buffer",i=o)}var c=e.objectMode?1:i.length;e.length+=c;var u=e.length<e.highWaterMark;u||(e.needDrain=!0);if(e.writing||e.corked){var h=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:s,next:null},h?h.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else O(t,e,!1,c,i,n,s);return u}(this,n,o,t,e,r)),s},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||x(this,t))},A.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new p("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var i=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,r){e.ending=!0,I(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,i,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=h.destroy,A.prototype._undestroy=h.undestroy,A.prototype._destroy=function(t,e){e(t)}},1029:(t,e,r)=>{"use strict";var i;function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=r(9885),o=Symbol("lastResolve"),a=Symbol("lastReject"),c=Symbol("error"),u=Symbol("ended"),h=Symbol("lastPromise"),f=Symbol("handlePromise"),l=Symbol("stream");function d(t,e){return{value:t,done:e}}function p(t){var e=t[o];if(null!==e){var r=t[l].read();null!==r&&(t[h]=null,t[o]=null,t[a]=null,e(d(r,!1)))}}function b(t){process.nextTick(p,t)}var g=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((n(i={get stream(){return this[l]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[u])return Promise.resolve(d(void 0,!0));if(this[l].destroyed)return new Promise((function(e,r){process.nextTick((function(){t[c]?r(t[c]):e(d(void 0,!0))}))}));var r,i=this[h];if(i)r=new Promise(function(t,e){return function(r,i){t.then((function(){e[u]?r(d(void 0,!0)):e[f](r,i)}),i)}}(i,this));else{var n=this[l].read();if(null!==n)return Promise.resolve(d(n,!1));r=new Promise(this[f])}return this[h]=r,r}},Symbol.asyncIterator,(function(){return this})),n(i,"return",(function(){var t=this;return new Promise((function(e,r){t[l].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),i),g);t.exports=function(t){var e,r=Object.create(m,(n(e={},l,{value:t,writable:!0}),n(e,o,{value:null,writable:!0}),n(e,a,{value:null,writable:!0}),n(e,c,{value:null,writable:!0}),n(e,u,{value:t._readableState.endEmitted,writable:!0}),n(e,f,{value:function(t,e){var i=r[l].read();i?(r[h]=null,r[o]=null,r[a]=null,t(d(i,!1))):(r[o]=t,r[a]=e)},writable:!0}),e));return r[h]=null,s(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[a];return null!==e&&(r[h]=null,r[o]=null,r[a]=null,e(t)),void(r[c]=t)}var i=r[o];null!==i&&(r[h]=null,r[o]=null,r[a]=null,i(d(void 0,!0))),r[u]=!0})),t.on("readable",b.bind(null,r)),r}},6637:(t,e,r)=>{"use strict";function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=r(8834).Buffer,a=r(4854).inspect,c=a&&a.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r,u;return e=t,r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e,r,i,n=o.allocUnsafe(t>>>0),s=this.head,a=0;s;)e=s.data,r=n,i=a,o.prototype.copy.call(e,r,i),a+=s.data.length,s=s.next;return n}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,i=e.data;for(t-=i.length;e=e.next;){var n=e.data,s=t>n.length?n.length:t;if(s===n.length?i+=n:i+=n.slice(0,t),0==(t-=s)){s===n.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(s));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),r=this.head,i=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var n=r.data,s=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,s),0==(t-=s)){s===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(s));break}++i}return this.length-=i,e}},{key:c,value:function(t,e){return a(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}],r&&s(e.prototype,r),u&&s(e,u),t}()},2262:t=>{"use strict";function e(t,e){i(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,n){var s=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(n?n(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(i,this,t)):process.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!n&&t?s._writableState?s._writableState.errorEmitted?process.nextTick(r,s):(s._writableState.errorEmitted=!0,process.nextTick(e,s,t)):process.nextTick(e,s,t):n?(process.nextTick(r,s),n(t)):process.nextTick(r,s)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}}},9885:(t,e,r)=>{"use strict";var i=r(4452).q.ERR_STREAM_PREMATURE_CLOSE;function n(){}t.exports=function t(e,r,s){if("function"==typeof r)return t(e,null,r);r||(r={}),s=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}(s||n);var o=r.readable||!1!==r.readable&&e.readable,a=r.writable||!1!==r.writable&&e.writable,c=function(){e.writable||h()},u=e._writableState&&e._writableState.finished,h=function(){a=!1,u=!0,o||s.call(e)},f=e._readableState&&e._readableState.endEmitted,l=function(){o=!1,f=!0,a||s.call(e)},d=function(t){s.call(e,t)},p=function(){var t;return o&&!f?(e._readableState&&e._readableState.ended||(t=new i),s.call(e,t)):a&&!u?(e._writableState&&e._writableState.ended||(t=new i),s.call(e,t)):void 0},b=function(){e.req.on("finish",h)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(e)?a&&!e._writableState&&(e.on("end",c),e.on("close",c)):(e.on("complete",h),e.on("abort",p),e.req?b():e.on("request",b)),e.on("end",l),e.on("finish",h),!1!==r.error&&e.on("error",d),e.on("close",p),function(){e.removeListener("complete",h),e.removeListener("abort",p),e.removeListener("request",b),e.req&&e.req.removeListener("finish",h),e.removeListener("end",c),e.removeListener("close",c),e.removeListener("finish",h),e.removeListener("end",l),e.removeListener("error",d),e.removeListener("close",p)}}},352:t=>{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},3495:(t,e,r)=>{"use strict";var i;var n=r(4452).q,s=n.ERR_MISSING_ARGS,o=n.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function c(t,e,n,s){s=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(s);var a=!1;t.on("close",(function(){a=!0})),void 0===i&&(i=r(9885)),i(t,{readable:e,writable:n},(function(t){if(t)return s(t);a=!0,s()}));var c=!1;return function(e){if(!a&&!c)return c=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void s(e||new o("pipe"))}}function u(t){t()}function h(t,e){return t.pipe(e)}function f(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i,n=f(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new s("streams");var o=e.map((function(t,r){var s=r<e.length-1;return c(t,s,r>0,(function(t){i||(i=t),t&&o.forEach(u),s||(o.forEach(u),n(i))}))}));return e.reduce(h)}},7605:(t,e,r)=>{"use strict";var i=r(4452).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,n){var s=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,n,r);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new i(n?r:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}}},5010:(t,e,r)=>{t.exports=r(2699).EventEmitter},7525:(t,e,r)=>{(e=t.exports=r(8051)).Stream=e,e.Readable=e,e.Writable=r(2557),e.Duplex=r(7073),e.Transform=r(7640),e.PassThrough=r(5163),e.finished=r(9885),e.pipeline=r(3495)},1445:(t,e,r)=>{"use strict";var i=r(8834).Buffer,n=r(1285),s=r(4485),o=new Array(16),a=[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],c=[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],u=[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],h=[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],f=[0,1518500249,1859775393,2400959708,2840853838],l=[1352829926,1548603684,1836072691,2053994217,0];function d(){s.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<<e|t>>>32-e}function b(t,e,r,i,n,s,o,a){return p(t+(e^r^i)+s+o|0,a)+n|0}function g(t,e,r,i,n,s,o,a){return p(t+(e&r|~e&i)+s+o|0,a)+n|0}function m(t,e,r,i,n,s,o,a){return p(t+((e|~r)^i)+s+o|0,a)+n|0}function v(t,e,r,i,n,s,o,a){return p(t+(e&i|r&~i)+s+o|0,a)+n|0}function y(t,e,r,i,n,s,o,a){return p(t+(e^(r|~i))+s+o|0,a)+n|0}n(d,s),d.prototype._update=function(){for(var t=o,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,i=0|this._b,n=0|this._c,s=0|this._d,d=0|this._e,w=0|this._a,_=0|this._b,E=0|this._c,S=0|this._d,A=0|this._e,O=0;O<80;O+=1){var T,x;O<16?(T=b(r,i,n,s,d,t[a[O]],f[0],u[O]),x=y(w,_,E,S,A,t[c[O]],l[0],h[O])):O<32?(T=g(r,i,n,s,d,t[a[O]],f[1],u[O]),x=v(w,_,E,S,A,t[c[O]],l[1],h[O])):O<48?(T=m(r,i,n,s,d,t[a[O]],f[2],u[O]),x=m(w,_,E,S,A,t[c[O]],l[2],h[O])):O<64?(T=v(r,i,n,s,d,t[a[O]],f[3],u[O]),x=g(w,_,E,S,A,t[c[O]],l[3],h[O])):(T=y(r,i,n,s,d,t[a[O]],f[4],u[O]),x=b(w,_,E,S,A,t[c[O]],l[4],h[O])),r=d,d=s,s=p(n,10),n=i,i=T,w=A,A=S,S=p(E,10),E=_,_=x}var P=this._b+n+S|0;this._b=this._c+s+A|0,this._c=this._d+d+w|0,this._d=this._e+r+_|0,this._e=this._a+i+E|0,this._a=P},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=i.alloc?i.alloc(20):new i(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},4496:(t,e,r)=>{"use strict";r.r(e),r.d(e,{ArgumentOutOfRangeError:()=>I.W,AsyncSubject:()=>h.c,BehaviorSubject:()=>c.X,ConnectableObservable:()=>n.c,EMPTY:()=>W.E,EmptyError:()=>N.K,GroupedObservable:()=>s.T,NEVER:()=>ft,Notification:()=>O.P,NotificationKind:()=>O.W,ObjectUnsubscribedError:()=>M.N,Observable:()=>i.y,ReplaySubject:()=>u.t,Scheduler:()=>E.b,Subject:()=>a.xQ,Subscriber:()=>A.L,Subscription:()=>S.w,TimeoutError:()=>L.W,UnsubscriptionError:()=>k.B,VirtualAction:()=>_,VirtualTimeScheduler:()=>w,animationFrame:()=>y,animationFrameScheduler:()=>v,asap:()=>f.e,asapScheduler:()=>f.E,async:()=>l.P,asyncScheduler:()=>l.z,bindCallback:()=>j,bindNodeCallback:()=>F,combineLatest:()=>z.aj,concat:()=>q.z,config:()=>Rt.v,defer:()=>Z.P,empty:()=>W.c,forkJoin:()=>X,from:()=>J.D,fromEvent:()=>et,fromEventPattern:()=>it,generate:()=>nt,identity:()=>P.y,iif:()=>ot,interval:()=>ct,isObservable:()=>R,merge:()=>ht.T,never:()=>lt,noop:()=>x.Z,observable:()=>o.L,of:()=>dt.of,onErrorResumeNext:()=>pt,pairs:()=>bt,partition:()=>wt,pipe:()=>T.z,queue:()=>d.c,queueScheduler:()=>d.N,race:()=>_t.S3,range:()=>Et,scheduled:()=>Pt.x,throwError:()=>At._,timer:()=>Ot.H,using:()=>Tt,zip:()=>xt.$R});var i=r(9939),n=r(9386),s=r(453),o=r(8859),a=r(1194),c=r(4580),u=r(1048),h=r(3866),f=r(4858),l=r(646),d=r(7410),p=r(2995),b=r(9795),g=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.scheduler=e,i.work=r,i}return p.ZT(e,t),e.prototype.requestAsyncId=function(e,r,i){return void 0===i&&(i=0),null!==i&&i>0?t.prototype.requestAsyncId.call(this,e,r,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame((function(){return e.flush(null)}))))},e.prototype.recycleAsyncId=function(e,r,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,r,i);0===e.actions.length&&(cancelAnimationFrame(r),e.scheduled=void 0)},e}(b.o),m=r(2966),v=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return p.ZT(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,r=this.actions,i=-1,n=r.length;t=t||r.shift();do{if(e=t.execute(t.state,t.delay))break}while(++i<n&&(t=r.shift()));if(this.active=!1,e){for(;++i<n&&(t=r.shift());)t.unsubscribe();throw e}},e}(m.v))(g),y=v,w=function(t){function e(e,r){void 0===e&&(e=_),void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this,e,(function(){return i.frame}))||this;return i.maxFrames=r,i.frame=0,i.index=-1,i}return p.ZT(e,t),e.prototype.flush=function(){for(var t,e,r=this.actions,i=this.maxFrames;(e=r[0])&&e.delay<=i&&(r.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=r.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10,e}(m.v),_=function(t){function e(e,r,i){void 0===i&&(i=e.index+=1);var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n.index=i,n.active=!0,n.index=e.index=i,n}return p.ZT(e,t),e.prototype.schedule=function(r,i){if(void 0===i&&(i=0),!this.id)return t.prototype.schedule.call(this,r,i);this.active=!1;var n=new e(this.scheduler,this.work);return this.add(n),n.schedule(r,i)},e.prototype.requestAsyncId=function(t,r,i){void 0===i&&(i=0),this.delay=t.frame+i;var n=t.actions;return n.push(this),n.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,r){void 0===r&&(r=0)},e.prototype._execute=function(e,r){if(!0===this.active)return t.prototype._execute.call(this,e,r)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(b.o),E=r(7035),S=r(1586),A=r(1881),O=r(8781),T=r(1199),x=r(4582),P=r(6930);function R(t){return!!t&&(t instanceof i.y||"function"==typeof t.lift&&"function"==typeof t.subscribe)}var I=r(9120),N=r(4397),M=r(906),k=r(2674),L=r(5915),C=r(2188),B=r(4658),D=r(3073),U=r(4070);function j(t,e,r){if(e){if(!(0,U.K)(e))return function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];return j(t,r).apply(void 0,i).pipe((0,C.U)((function(t){return(0,D.k)(t)?e.apply(void 0,t):e(t)})))};r=e}return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var s,o=this,a={context:o,subject:s,callbackFunc:t,scheduler:r};return new i.y((function(i){if(r){var n={args:e,subscriber:i,params:a};return r.schedule(K,0,n)}if(!s){s=new h.c;try{t.apply(o,e.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];s.next(t.length<=1?t[0]:t),s.complete()}]))}catch(t){(0,B._)(s)?s.error(t):console.warn(t)}}return s.subscribe(i)}))}}function K(t){var e=this,r=t.args,i=t.subscriber,n=t.params,s=n.callbackFunc,o=n.context,a=n.scheduler,c=n.subject;if(!c){c=n.subject=new h.c;try{s.apply(o,r.concat([function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=t.length<=1?t[0]:t;e.add(a.schedule(V,0,{value:i,subject:c}))}]))}catch(t){c.error(t)}}this.add(c.subscribe(i))}function V(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function F(t,e,r){if(e){if(!(0,U.K)(e))return function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];return F(t,r).apply(void 0,i).pipe((0,C.U)((function(t){return(0,D.k)(t)?e.apply(void 0,t):e(t)})))};r=e}return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var s={subject:void 0,args:e,callbackFunc:t,scheduler:r,context:this};return new i.y((function(i){var n=s.context,o=s.subject;if(r)return r.schedule(H,0,{params:s,subscriber:i,context:n});if(!o){o=s.subject=new h.c;try{t.apply(n,e.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.shift();r?o.error(r):(o.next(t.length<=1?t[0]:t),o.complete())}]))}catch(t){(0,B._)(o)?o.error(t):console.warn(t)}}return o.subscribe(i)}))}}function H(t){var e=this,r=t.params,i=t.subscriber,n=t.context,s=r.callbackFunc,o=r.args,a=r.scheduler,c=r.subject;if(!c){c=r.subject=new h.c;try{s.apply(n,o.concat([function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=t.shift();if(i)e.add(a.schedule($,0,{err:i,subject:c}));else{var n=t.length<=1?t[0]:t;e.add(a.schedule(G,0,{value:n,subject:c}))}}]))}catch(t){this.add(a.schedule($,0,{err:t,subject:c}))}}this.add(c.subscribe(i))}function G(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function $(t){var e=t.err;t.subject.error(e)}var z=r(97),q=r(4245),Z=r(6542),W=r(4773),Y=r(757),J=r(7238);function X(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){var r=t[0];if((0,D.k)(r))return Q(r,null);if((0,Y.K)(r)&&Object.getPrototypeOf(r)===Object.prototype){var i=Object.keys(r);return Q(i.map((function(t){return r[t]})),i)}}if("function"==typeof t[t.length-1]){var n=t.pop();return Q(t=1===t.length&&(0,D.k)(t[0])?t[0]:t,null).pipe((0,C.U)((function(t){return n.apply(void 0,t)})))}return Q(t,null)}function Q(t,e){return new i.y((function(r){var i=t.length;if(0!==i)for(var n=new Array(i),s=0,o=0,a=function(a){var c=(0,J.D)(t[a]),u=!1;r.add(c.subscribe({next:function(t){u||(u=!0,o++),n[a]=t},error:function(t){return r.error(t)},complete:function(){++s!==i&&u||(o===i&&r.next(e?e.reduce((function(t,e,r){return t[e]=n[r],t}),{}):n),r.complete())}}))},c=0;c<i;c++)a(c);else r.complete()}))}var tt=r(7371);function et(t,e,r,n){return(0,tt.m)(r)&&(n=r,r=void 0),n?et(t,e,r).pipe((0,C.U)((function(t){return(0,D.k)(t)?n.apply(void 0,t):n(t)}))):new i.y((function(i){rt(t,e,(function(t){arguments.length>1?i.next(Array.prototype.slice.call(arguments)):i.next(t)}),i,r)}))}function rt(t,e,r,i,n){var s;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){var o=t;t.addEventListener(e,r,n),s=function(){return o.removeEventListener(e,r,n)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){var a=t;t.on(e,r),s=function(){return a.off(e,r)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){var c=t;t.addListener(e,r),s=function(){return c.removeListener(e,r)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var u=0,h=t.length;u<h;u++)rt(t[u],e,r,i,n)}i.add(s)}function it(t,e,r){return r?it(t,e).pipe((0,C.U)((function(t){return(0,D.k)(t)?r.apply(void 0,t):r(t)}))):new i.y((function(r){var i,n=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r.next(1===t.length?t[0]:t)};try{i=t(n)}catch(t){return void r.error(t)}if((0,tt.m)(e))return function(){return e(n,i)}}))}function nt(t,e,r,n,s){var o,a;if(1==arguments.length){var c=t;a=c.initialState,e=c.condition,r=c.iterate,o=c.resultSelector||P.y,s=c.scheduler}else void 0===n||(0,U.K)(n)?(a=t,o=P.y,s=n):(a=t,o=n);return new i.y((function(t){var i=a;if(s)return s.schedule(st,0,{subscriber:t,iterate:r,condition:e,resultSelector:o,state:i});for(;;){if(e){var n=void 0;try{n=e(i)}catch(e){return void t.error(e)}if(!n){t.complete();break}}var c=void 0;try{c=o(i)}catch(e){return void t.error(e)}if(t.next(c),t.closed)break;try{i=r(i)}catch(e){return void t.error(e)}}}))}function st(t){var e=t.subscriber,r=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(t){return void e.error(t)}else t.needIterate=!0;if(r){var i=void 0;try{i=r(t.state)}catch(t){return void e.error(t)}if(!i)return void e.complete();if(e.closed)return}var n;try{n=t.resultSelector(t.state)}catch(t){return void e.error(t)}if(!e.closed&&(e.next(n),!e.closed))return this.schedule(t)}}function ot(t,e,r){return void 0===e&&(e=W.E),void 0===r&&(r=W.E),(0,Z.P)((function(){return t()?e:r}))}var at=r(6712);function ct(t,e){return void 0===t&&(t=0),void 0===e&&(e=l.P),(!(0,at.k)(t)||t<0)&&(t=0),e&&"function"==typeof e.schedule||(e=l.P),new i.y((function(r){return r.add(e.schedule(ut,t,{subscriber:r,counter:0,period:t})),r}))}function ut(t){var e=t.subscriber,r=t.counter,i=t.period;e.next(r),this.schedule({subscriber:e,counter:r+1,period:i},i)}var ht=r(7686),ft=new i.y(x.Z);function lt(){return ft}var dt=r(6612);function pt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)return W.E;var r=t[0],n=t.slice(1);return 1===t.length&&(0,D.k)(r)?pt.apply(void 0,r):new i.y((function(t){var e=function(){return t.add(pt.apply(void 0,n).subscribe(t))};return(0,J.D)(r).subscribe({next:function(e){t.next(e)},error:e,complete:e})}))}function bt(t,e){return e?new i.y((function(r){var i=Object.keys(t),n=new S.w;return n.add(e.schedule(gt,0,{keys:i,index:0,subscriber:r,subscription:n,obj:t})),n})):new i.y((function(e){for(var r=Object.keys(t),i=0;i<r.length&&!e.closed;i++){var n=r[i];t.hasOwnProperty(n)&&e.next([n,t[n]])}e.complete()}))}function gt(t){var e=t.keys,r=t.index,i=t.subscriber,n=t.subscription,s=t.obj;if(!i.closed)if(r<e.length){var o=e[r];i.next([o,s[o]]),n.add(this.schedule({keys:e,index:r+1,subscriber:i,subscription:n,obj:s}))}else i.complete()}var mt=r(5683),vt=r(1400),yt=r(2730);function wt(t,e,r){return[(0,yt.h)(e,r)(new i.y((0,vt.s)(t))),(0,yt.h)((0,mt.f)(e,r))(new i.y((0,vt.s)(t)))]}var _t=r(2219);function Et(t,e,r){return void 0===t&&(t=0),new i.y((function(i){void 0===e&&(e=t,t=0);var n=0,s=t;if(r)return r.schedule(St,0,{index:n,count:e,start:t,subscriber:i});for(;;){if(n++>=e){i.complete();break}if(i.next(s++),i.closed)break}}))}function St(t){var e=t.start,r=t.index,i=t.count,n=t.subscriber;r>=i?n.complete():(n.next(e),n.closed||(t.index=r+1,t.start=e+1,this.schedule(t)))}var At=r(4236),Ot=r(3254);function Tt(t,e){return new i.y((function(r){var i,n;try{i=t()}catch(t){return void r.error(t)}try{n=e(i)}catch(t){return void r.error(t)}var s=(n?(0,J.D)(n):W.E).subscribe(r);return function(){s.unsubscribe(),i&&i.unsubscribe()}}))}var xt=r(1131),Pt=r(2540),Rt=r(604)},3866:(t,e,r)=>{"use strict";r.d(e,{c:()=>o});var i=r(2995),n=r(1194),s=r(1586),o=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.value=null,e.hasNext=!1,e.hasCompleted=!1,e}return i.ZT(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),s.w.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),s.w.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(n.xQ)},4580:(t,e,r)=>{"use strict";r.d(e,{X:()=>o});var i=r(2995),n=r(1194),s=r(906),o=function(t){function e(e){var r=t.call(this)||this;return r._value=e,r}return i.ZT(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var r=t.prototype._subscribe.call(this,e);return r&&!r.closed&&e.next(this._value),r},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new s.N;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(n.xQ)},8781:(t,e,r)=>{"use strict";r.d(e,{P:()=>a,W:()=>i});var i,n=r(4773),s=r(6612),o=r(4236);i||(i={});var a=function(){function t(t,e,r){this.kind=t,this.value=e,this.error=r,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,r){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return r&&r()}},t.prototype.accept=function(t,e,r){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,r)},t.prototype.toObservable=function(){switch(this.kind){case"N":return(0,s.of)(this.value);case"E":return(0,o._)(this.error);case"C":return(0,n.c)()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}()},9939:(t,e,r)=>{"use strict";r.d(e,{y:()=>h});var i=r(4658),n=r(1881),s=r(2532),o=r(5629);var a=r(8859),c=r(1199),u=r(604),h=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var i=this.operator,a=function(t,e,r){if(t){if(t instanceof n.L)return t;if(t[s.b])return t[s.b]()}return t||e||r?new n.L(t,e,r):new n.L(o.c)}(t,e,r);if(i?a.add(i.call(a,this.source)):a.add(this.source||u.v.useDeprecatedSynchronousErrorHandling&&!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a)),u.v.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){u.v.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),(0,i._)(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=f(e))((function(e,i){var n;n=r.subscribe((function(e){try{t(e)}catch(t){i(t),n&&n.unsubscribe()}}),i,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[a.L]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:(0,c.U)(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=f(t))((function(t,r){var i;e.subscribe((function(t){return i=t}),(function(t){return r(t)}),(function(){return t(i)}))}))},t.create=function(e){return new t(e)},t}();function f(t){if(t||(t=u.v.Promise||Promise),!t)throw new Error("no Promise impl found");return t}},5629:(t,e,r)=>{"use strict";r.d(e,{c:()=>s});var i=r(604),n=r(7804),s={closed:!0,next:function(t){},error:function(t){if(i.v.useDeprecatedSynchronousErrorHandling)throw t;(0,n.z)(t)},complete:function(){}}},6807:(t,e,r)=>{"use strict";r.d(e,{L:()=>n});var i=r(2995),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.ZT(e,t),e.prototype.notifyNext=function(t,e,r,i,n){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(r(1881).L)},1048:(t,e,r)=>{"use strict";r.d(e,{t:()=>h});var i=r(2995),n=r(1194),s=r(7410),o=r(1586),a=r(9433),c=r(906),u=r(7566),h=function(t){function e(e,r,i){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===r&&(r=Number.POSITIVE_INFINITY);var n=t.call(this)||this;return n.scheduler=i,n._events=[],n._infiniteTimeWindow=!1,n._bufferSize=e<1?1:e,n._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(n._infiniteTimeWindow=!0,n.next=n.nextInfiniteTimeWindow):n.next=n.nextTimeWindow,n}return i.ZT(e,t),e.prototype.nextInfiniteTimeWindow=function(e){if(!this.isStopped){var r=this._events;r.push(e),r.length>this._bufferSize&&r.shift()}t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this.isStopped||(this._events.push(new f(this._getNow(),e)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,r=this._infiniteTimeWindow,i=r?this._events:this._trimBufferThenGetEvents(),n=this.scheduler,s=i.length;if(this.closed)throw new c.N;if(this.isStopped||this.hasError?e=o.w.EMPTY:(this.observers.push(t),e=new u.W(this,t)),n&&t.add(t=new a.ht(t,n)),r)for(var h=0;h<s&&!t.closed;h++)t.next(i[h]);else for(h=0;h<s&&!t.closed;h++)t.next(i[h].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||s.c).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,r=this._windowTime,i=this._events,n=i.length,s=0;s<n&&!(t-i[s].time<r);)s++;return n>e&&(s=Math.max(s,n-e)),s>0&&i.splice(0,s),i},e}(n.xQ),f=function(){return function(t,e){this.time=t,this.value=e}}()},7035:(t,e,r)=>{"use strict";r.d(e,{b:()=>i});var i=function(){function t(e,r){void 0===r&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(t,e,r){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(r,e)},t.now=function(){return Date.now()},t}()},1194:(t,e,r)=>{"use strict";r.d(e,{Yc:()=>h,xQ:()=>f});var i=r(2995),n=r(9939),s=r(1881),o=r(1586),a=r(906),c=r(7566),u=r(2532),h=function(t){function e(e){var r=t.call(this,e)||this;return r.destination=e,r}return i.ZT(e,t),e}(s.L),f=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return i.ZT(e,t),e.prototype[u.b]=function(){return new h(this)},e.prototype.lift=function(t){var e=new l(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new a.N;if(!this.isStopped)for(var e=this.observers,r=e.length,i=e.slice(),n=0;n<r;n++)i[n].next(t)},e.prototype.error=function(t){if(this.closed)throw new a.N;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,r=e.length,i=e.slice(),n=0;n<r;n++)i[n].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new a.N;this.isStopped=!0;for(var t=this.observers,e=t.length,r=t.slice(),i=0;i<e;i++)r[i].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new a.N;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new a.N;return this.hasError?(t.error(this.thrownError),o.w.EMPTY):this.isStopped?(t.complete(),o.w.EMPTY):(this.observers.push(t),new c.W(this,t))},e.prototype.asObservable=function(){var t=new n.y;return t.source=this,t},e.create=function(t,e){return new l(t,e)},e}(n.y),l=function(t){function e(e,r){var i=t.call(this)||this;return i.destination=e,i.source=r,i}return i.ZT(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):o.w.EMPTY},e}(f)},7566:(t,e,r)=>{"use strict";r.d(e,{W:()=>n});var i=r(2995),n=function(t){function e(e,r){var i=t.call(this)||this;return i.subject=e,i.subscriber=r,i.closed=!1,i}return i.ZT(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var r=e.indexOf(this.subscriber);-1!==r&&e.splice(r,1)}}},e}(r(1586).w)},1881:(t,e,r)=>{"use strict";r.d(e,{L:()=>h});var i=r(2995),n=r(7371),s=r(5629),o=r(1586),a=r(2532),c=r(604),u=r(7804),h=function(t){function e(r,i,n){var o=t.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=s.c;break;case 1:if(!r){o.destination=s.c;break}if("object"==typeof r){r instanceof e?(o.syncErrorThrowable=r.syncErrorThrowable,o.destination=r,r.add(o)):(o.syncErrorThrowable=!0,o.destination=new f(o,r));break}default:o.syncErrorThrowable=!0,o.destination=new f(o,r,i,n)}return o}return i.ZT(e,t),e.prototype[a.b]=function(){return this},e.create=function(t,r,i){var n=new e(t,r,i);return n.syncErrorThrowable=!1,n},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},e}(o.w),f=function(t){function e(e,r,i,o){var a,c=t.call(this)||this;c._parentSubscriber=e;var u=c;return(0,n.m)(r)?a=r:r&&(a=r.next,i=r.error,o=r.complete,r!==s.c&&(u=Object.create(r),(0,n.m)(u.unsubscribe)&&c.add(u.unsubscribe.bind(u)),u.unsubscribe=c.unsubscribe.bind(c))),c._context=u,c._next=a,c._error=i,c._complete=o,c}return i.ZT(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;c.v.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,r=c.v.useDeprecatedSynchronousErrorHandling;if(this._error)r&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)r?(e.syncErrorValue=t,e.syncErrorThrown=!0):(0,u.z)(t),this.unsubscribe();else{if(this.unsubscribe(),r)throw t;(0,u.z)(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var r=function(){return t._complete.call(t._context)};c.v.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),c.v.useDeprecatedSynchronousErrorHandling)throw t;(0,u.z)(t)}},e.prototype.__tryOrSetError=function(t,e,r){if(!c.v.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,r)}catch(e){return c.v.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):((0,u.z)(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(h)},1586:(t,e,r)=>{"use strict";r.d(e,{w:()=>a});var i=r(3073),n=r(757),s=r(7371),o=r(2674),a=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var e;if(!this.closed){var r=this,a=r._parentOrParents,u=r._ctorUnsubscribe,h=r._unsubscribe,f=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,a instanceof t)a.remove(this);else if(null!==a)for(var l=0;l<a.length;++l){a[l].remove(this)}if((0,s.m)(h)){u&&(this._unsubscribe=void 0);try{h.call(this)}catch(t){e=t instanceof o.B?c(t.errors):[t]}}if((0,i.k)(f)){l=-1;for(var d=f.length;++l<d;){var p=f[l];if((0,n.K)(p))try{p.unsubscribe()}catch(t){e=e||[],t instanceof o.B?e=e.concat(c(t.errors)):e.push(t)}}}if(e)throw new o.B(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(typeof e){case"function":r=new t(e);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var i=r;(r=new t)._subscriptions=[i]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var n=r._parentOrParents;if(null===n)r._parentOrParents=this;else if(n instanceof t){if(n===this)return r;r._parentOrParents=[n,this]}else{if(-1!==n.indexOf(this))return r;n.push(this)}var s=this._subscriptions;return null===s?this._subscriptions=[r]:s.push(r),r},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}},t.EMPTY=((e=new t).closed=!0,e),t}();function c(t){return t.reduce((function(t,e){return t.concat(e instanceof o.B?e.errors:e)}),[])}},604:(t,e,r)=>{"use strict";r.d(e,{v:()=>n});var i=!1,n={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;i=t},get useDeprecatedSynchronousErrorHandling(){return i}}},3694:(t,e,r)=>{"use strict";r.d(e,{Ds:()=>c,IY:()=>a,ft:()=>u});var i=r(2995),n=r(1881),s=r(9939),o=r(1400),a=function(t){function e(e){var r=t.call(this)||this;return r.parent=e,r}return i.ZT(e,t),e.prototype._next=function(t){this.parent.notifyNext(t)},e.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(n.L),c=(n.L,function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.ZT(e,t),e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(n.L));n.L;function u(t,e){if(!e.closed){if(t instanceof s.y)return t.subscribe(e);var r;try{r=(0,o.s)(t)(e)}catch(t){e.error(t)}return r}}},9386:(t,e,r)=>{"use strict";r.d(e,{N:()=>h,c:()=>u});var i=r(2995),n=r(1194),s=r(9939),o=r(1881),a=r(1586),c=r(6840),u=function(t){function e(e,r){var i=t.call(this)||this;return i.source=e,i.subjectFactory=r,i._refCount=0,i._isComplete=!1,i}return i.ZT(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new a.w).add(this.source.subscribe(new f(this.getSubject(),this))),t.closed&&(this._connection=null,t=a.w.EMPTY)),t},e.prototype.refCount=function(){return(0,c.x)()(this)},e}(s.y),h=function(){var t=u.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),f=function(t){function e(e,r){var i=t.call(this,e)||this;return i.connectable=r,i}return i.ZT(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(n.Yc);o.L},97:(t,e,r)=>{"use strict";r.d(e,{Ms:()=>f,aj:()=>h});var i=r(2995),n=r(4070),s=r(3073),o=r(6807),a=r(505),c=r(7),u={};function h(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=void 0,i=void 0;return(0,n.K)(t[t.length-1])&&(i=t.pop()),"function"==typeof t[t.length-1]&&(r=t.pop()),1===t.length&&(0,s.k)(t[0])&&(t=t[0]),(0,c.n)(t,i).lift(new f(r))}var f=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.resultSelector))},t}(),l=function(t){function e(e,r){var i=t.call(this,e)||this;return i.resultSelector=r,i.active=0,i.values=[],i.observables=[],i}return i.ZT(e,t),e.prototype._next=function(t){this.values.push(u),this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var r=0;r<e;r++){var i=t[r];this.add((0,a.D)(this,i,void 0,r))}}},e.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,r){var i=this.values,n=i[r],s=this.toRespond?n===u?--this.toRespond:this.toRespond:0;i[r]=e,0===s&&(this.resultSelector?this._tryResultSelector(i):this.destination.next(i.slice()))},e.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(o.L)},4245:(t,e,r)=>{"use strict";r.d(e,{z:()=>s});var i=r(6612),n=r(430);function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.u)()(i.of.apply(void 0,t))}},6542:(t,e,r)=>{"use strict";r.d(e,{P:()=>o});var i=r(9939),n=r(7238),s=r(4773);function o(t){return new i.y((function(e){var r;try{r=t()}catch(t){return void e.error(t)}return(r?(0,n.D)(r):(0,s.c)()).subscribe(e)}))}},4773:(t,e,r)=>{"use strict";r.d(e,{E:()=>n,c:()=>s});var i=r(9939),n=new i.y((function(t){return t.complete()}));function s(t){return t?function(t){return new i.y((function(e){return t.schedule((function(){return e.complete()}))}))}(t):n}},7238:(t,e,r)=>{"use strict";r.d(e,{D:()=>o});var i=r(9939),n=r(1400),s=r(2540);function o(t,e){return e?(0,s.x)(t,e):t instanceof i.y?t:new i.y((0,n.s)(t))}},7:(t,e,r)=>{"use strict";r.d(e,{n:()=>o});var i=r(9939),n=r(7651),s=r(6405);function o(t,e){return e?(0,s.r)(t,e):new i.y((0,n.V)(t))}},7686:(t,e,r)=>{"use strict";r.d(e,{T:()=>a});var i=r(9939),n=r(4070),s=r(7258),o=r(7);function a(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Number.POSITIVE_INFINITY,a=null,c=t[t.length-1];return(0,n.K)(c)?(a=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(r=t.pop())):"number"==typeof c&&(r=t.pop()),null===a&&1===t.length&&t[0]instanceof i.y?t[0]:(0,s.J)(r)((0,o.n)(t,a))}},6612:(t,e,r)=>{"use strict";r.d(e,{of:()=>o});var i=r(4070),n=r(7),s=r(6405);function o(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return(0,i.K)(r)?(t.pop(),(0,s.r)(t,r)):(0,n.n)(t)}},2219:(t,e,r)=>{"use strict";r.d(e,{S3:()=>c});var i=r(2995),n=r(3073),s=r(7),o=r(6807),a=r(505);function c(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){if(!(0,n.k)(t[0]))return t[0];t=t[0]}return(0,s.n)(t,void 0).lift(new u)}var u=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new h(t))},t}(),h=function(t){function e(e){var r=t.call(this,e)||this;return r.hasFirst=!1,r.observables=[],r.subscriptions=[],r}return i.ZT(e,t),e.prototype._next=function(t){this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(var r=0;r<e&&!this.hasFirst;r++){var i=t[r],n=(0,a.D)(this,i,void 0,r);this.subscriptions&&this.subscriptions.push(n),this.add(n)}this.observables=null}},e.prototype.notifyNext=function(t,e,r){if(!this.hasFirst){this.hasFirst=!0;for(var i=0;i<this.subscriptions.length;i++)if(i!==r){var n=this.subscriptions[i];n.unsubscribe(),this.remove(n)}this.subscriptions=null}this.destination.next(e)},e}(o.L)},4236:(t,e,r)=>{"use strict";r.d(e,{_:()=>n});var i=r(9939);function n(t,e){return e?new i.y((function(r){return e.schedule(s,0,{error:t,subscriber:r})})):new i.y((function(e){return e.error(t)}))}function s(t){var e=t.error;t.subscriber.error(e)}},3254:(t,e,r)=>{"use strict";r.d(e,{H:()=>a});var i=r(9939),n=r(646),s=r(6712),o=r(4070);function a(t,e,r){void 0===t&&(t=0);var a=-1;return(0,s.k)(e)?a=Number(e)<1?1:Number(e):(0,o.K)(e)&&(r=e),(0,o.K)(r)||(r=n.P),new i.y((function(e){var i=(0,s.k)(t)?t:+t-r.now();return r.schedule(c,i,{index:0,period:a,subscriber:e})}))}function c(t){var e=t.index,r=t.period,i=t.subscriber;if(i.next(e),!i.closed){if(-1===r)return i.complete();t.index=e+1,this.schedule(t,r)}}},1131:(t,e,r)=>{"use strict";r.d(e,{$R:()=>u,mx:()=>h});var i=r(2995),n=r(7),s=r(3073),o=r(1881),a=r(2),c=r(3694);function u(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return"function"==typeof r&&t.pop(),(0,n.n)(t,void 0).lift(new h(r))}var h=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new f(t,this.resultSelector))},t}(),f=function(t){function e(e,r,i){void 0===i&&(i=Object.create(null));var n=t.call(this,e)||this;return n.resultSelector=r,n.iterators=[],n.active=0,n.resultSelector="function"==typeof r?r:void 0,n}return i.ZT(e,t),e.prototype._next=function(t){var e=this.iterators;(0,s.k)(t)?e.push(new d(t)):"function"==typeof t[a.hZ]?e.push(new l(t[a.hZ]())):e.push(new p(this.destination,this,t))},e.prototype._complete=function(){var t=this.iterators,e=t.length;if(this.unsubscribe(),0!==e){this.active=e;for(var r=0;r<e;r++){var i=t[r];if(i.stillUnsubscribed)this.destination.add(i.subscribe());else this.active--}}else this.destination.complete()},e.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},e.prototype.checkIterators=function(){for(var t=this.iterators,e=t.length,r=this.destination,i=0;i<e;i++){if("function"==typeof(o=t[i]).hasValue&&!o.hasValue())return}var n=!1,s=[];for(i=0;i<e;i++){var o,a=(o=t[i]).next();if(o.hasCompleted()&&(n=!0),a.done)return void r.complete();s.push(a.value)}this.resultSelector?this._tryresultSelector(s):r.next(s),n&&r.complete()},e.prototype._tryresultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(o.L),l=function(){function t(t){this.iterator=t,this.nextResult=t.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},t.prototype.hasCompleted=function(){var t=this.nextResult;return Boolean(t&&t.done)},t}(),d=function(){function t(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return t.prototype[a.hZ]=function(){return this},t.prototype.next=function(t){var e=this.index++,r=this.array;return e<this.length?{value:r[e],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),p=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.parent=r,n.observable=i,n.stillUnsubscribed=!0,n.buffer=[],n.isComplete=!1,n}return i.ZT(e,t),e.prototype[a.hZ]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t){this.buffer.push(t),this.parent.checkIterators()},e.prototype.subscribe=function(){return(0,c.ft)(this.observable,new c.IY(this))},e}(c.Ds)},430:(t,e,r)=>{"use strict";r.d(e,{u:()=>n});var i=r(7258);function n(){return(0,i.J)(1)}},2730:(t,e,r)=>{"use strict";r.d(e,{h:()=>s});var i=r(2995),n=r(1881);function s(t,e){return function(r){return r.lift(new o(t,e))}}var o=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.thisArg))},t}(),a=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.predicate=r,n.thisArg=i,n.count=0,n}return i.ZT(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(n.L)},453:(t,e,r)=>{"use strict";r.d(e,{T:()=>l,v:()=>c});var i=r(2995),n=r(1881),s=r(1586),o=r(9939),a=r(1194);function c(t,e,r,i){return function(n){return n.lift(new u(t,e,r,i))}}var u=function(){function t(t,e,r,i){this.keySelector=t,this.elementSelector=e,this.durationSelector=r,this.subjectSelector=i}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),h=function(t){function e(e,r,i,n,s){var o=t.call(this,e)||this;return o.keySelector=r,o.elementSelector=i,o.durationSelector=n,o.subjectSelector=s,o.groups=null,o.attemptedToUnsubscribe=!1,o.count=0,o}return i.ZT(e,t),e.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(t){return void this.error(t)}this._group(t,e)},e.prototype._group=function(t,e){var r=this.groups;r||(r=this.groups=new Map);var i,n=r.get(e);if(this.elementSelector)try{i=this.elementSelector(t)}catch(t){this.error(t)}else i=t;if(!n){n=this.subjectSelector?this.subjectSelector():new a.xQ,r.set(e,n);var s=new l(e,n,this);if(this.destination.next(s),this.durationSelector){var o=void 0;try{o=this.durationSelector(new l(e,n))}catch(t){return void this.error(t)}this.add(o.subscribe(new f(e,n,this)))}}n.closed||n.next(i)},e.prototype._error=function(t){var e=this.groups;e&&(e.forEach((function(e,r){e.error(t)})),e.clear()),this.destination.error(t)},e.prototype._complete=function(){var t=this.groups;t&&(t.forEach((function(t,e){t.complete()})),t.clear()),this.destination.complete()},e.prototype.removeGroup=function(t){this.groups.delete(t)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&t.prototype.unsubscribe.call(this))},e}(n.L),f=function(t){function e(e,r,i){var n=t.call(this,r)||this;return n.key=e,n.group=r,n.parent=i,n}return i.ZT(e,t),e.prototype._next=function(t){this.complete()},e.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},e}(n.L),l=function(t){function e(e,r,i){var n=t.call(this)||this;return n.key=e,n.groupSubject=r,n.refCountSubscription=i,n}return i.ZT(e,t),e.prototype._subscribe=function(t){var e=new s.w,r=this.refCountSubscription,i=this.groupSubject;return r&&!r.closed&&e.add(new d(r)),e.add(i.subscribe(t)),e},e}(o.y),d=function(t){function e(e){var r=t.call(this)||this;return r.parent=e,e.count++,r}return i.ZT(e,t),e.prototype.unsubscribe=function(){var e=this.parent;e.closed||this.closed||(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(s.w)},2188:(t,e,r)=>{"use strict";r.d(e,{U:()=>s});var i=r(2995),n=r(1881);function s(t,e){return function(r){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new o(t,e))}}var o=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.project,this.thisArg))},t}(),a=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.project=r,n.count=0,n.thisArg=i||n,n}return i.ZT(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(n.L)},7258:(t,e,r)=>{"use strict";r.d(e,{J:()=>s});var i=r(1710),n=r(6930);function s(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),(0,i.zg)(n.y,t)}},1710:(t,e,r)=>{"use strict";r.d(e,{VS:()=>h,zg:()=>a});var i=r(2995),n=r(2188),s=r(7238),o=r(3694);function a(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof e?function(i){return i.pipe(a((function(r,i){return(0,s.D)(t(r,i)).pipe((0,n.U)((function(t,n){return e(r,t,i,n)})))}),r))}:("number"==typeof e&&(r=e),function(e){return e.lift(new c(t,r))})}var c=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.project,this.concurrent))},t}(),u=function(t){function e(e,r,i){void 0===i&&(i=Number.POSITIVE_INFINITY);var n=t.call(this,e)||this;return n.project=r,n.concurrent=i,n.hasCompleted=!1,n.buffer=[],n.active=0,n.index=0,n}return i.ZT(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e)},e.prototype._innerSub=function(t){var e=new o.IY(this),r=this.destination;r.add(e);var i=(0,o.ft)(t,e);i!==e&&r.add(i)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(o.Ds),h=a},9433:(t,e,r)=>{"use strict";r.d(e,{QV:()=>o,ht:()=>c});var i=r(2995),n=r(1881),s=r(8781);function o(t,e){return void 0===e&&(e=0),function(r){return r.lift(new a(t,e))}}var a=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.scheduler,this.delay))},t}(),c=function(t){function e(e,r,i){void 0===i&&(i=0);var n=t.call(this,e)||this;return n.scheduler=r,n.delay=i,n}return i.ZT(e,t),e.dispatch=function(t){var e=t.notification,r=t.destination;e.observe(r),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new u(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(s.P.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(s.P.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(s.P.createComplete()),this.unsubscribe()},e}(n.L),u=function(){return function(t,e){this.notification=t,this.destination=e}}()},6840:(t,e,r)=>{"use strict";r.d(e,{x:()=>s});var i=r(2995),n=r(1881);function s(){return function(t){return t.lift(new o(t))}}var o=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var r=this.connectable;r._refCount++;var i=new a(t,r),n=e.subscribe(i);return i.closed||(i.connection=r.connect()),n},t}(),a=function(t){function e(e,r){var i=t.call(this,e)||this;return i.connectable=r,i}return i.ZT(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var r=this.connection,i=t._connection;this.connection=null,!i||r&&i!==r||i.unsubscribe()}}else this.connection=null},e}(n.L)},6405:(t,e,r)=>{"use strict";r.d(e,{r:()=>s});var i=r(9939),n=r(1586);function s(t,e){return new i.y((function(r){var i=new n.w,s=0;return i.add(e.schedule((function(){s!==t.length?(r.next(t[s++]),r.closed||i.add(this.schedule())):r.complete()}))),i}))}},2540:(t,e,r)=>{"use strict";r.d(e,{x:()=>h});var i=r(9939),n=r(1586),s=r(8859);var o=r(6405),a=r(2);var c=r(9633),u=r(2318);function h(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[s.L]}(t))return function(t,e){return new i.y((function(r){var i=new n.w;return i.add(e.schedule((function(){var n=t[s.L]();i.add(n.subscribe({next:function(t){i.add(e.schedule((function(){return r.next(t)})))},error:function(t){i.add(e.schedule((function(){return r.error(t)})))},complete:function(){i.add(e.schedule((function(){return r.complete()})))}}))}))),i}))}(t,e);if((0,c.t)(t))return function(t,e){return new i.y((function(r){var i=new n.w;return i.add(e.schedule((function(){return t.then((function(t){i.add(e.schedule((function(){r.next(t),i.add(e.schedule((function(){return r.complete()})))})))}),(function(t){i.add(e.schedule((function(){return r.error(t)})))}))}))),i}))}(t,e);if((0,u.z)(t))return(0,o.r)(t,e);if(function(t){return t&&"function"==typeof t[a.hZ]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new i.y((function(r){var i,s=new n.w;return s.add((function(){i&&"function"==typeof i.return&&i.return()})),s.add(e.schedule((function(){i=t[a.hZ](),s.add(e.schedule((function(){if(!r.closed){var t,e;try{var n=i.next();t=n.value,e=n.done}catch(t){return void r.error(t)}e?r.complete():(r.next(t),this.schedule())}})))}))),s}))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}},9795:(t,e,r)=>{"use strict";r.d(e,{o:()=>n});var i=r(2995),n=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.scheduler=e,i.work=r,i.pending=!1,i}return i.ZT(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(i,this.id,e),this},e.prototype.requestAsyncId=function(t,e,r){return void 0===r&&(r=0),setInterval(t.flush.bind(t,this),r)},e.prototype.recycleAsyncId=function(t,e,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var r=!1,i=void 0;try{this.work(t)}catch(t){r=!0,i=!!t&&t||new Error(t)}if(r)return this.unsubscribe(),i},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,r=e.actions,i=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==i&&r.splice(i,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,r){return t.call(this)||this}return i.ZT(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(r(1586).w))},2966:(t,e,r)=>{"use strict";r.d(e,{v:()=>s});var i=r(2995),n=r(7035),s=function(t){function e(r,i){void 0===i&&(i=n.b.now);var s=t.call(this,r,(function(){return e.delegate&&e.delegate!==s?e.delegate.now():i()}))||this;return s.actions=[],s.active=!1,s.scheduled=void 0,s}return i.ZT(e,t),e.prototype.schedule=function(r,i,n){return void 0===i&&(i=0),e.delegate&&e.delegate!==this?e.delegate.schedule(r,i,n):t.prototype.schedule.call(this,r,i,n)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var r;this.active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}}},e}(n.b)},4858:(t,e,r)=>{"use strict";r.d(e,{e:()=>l,E:()=>f});var i=r(2995),n=1,s=function(){return Promise.resolve()}(),o={};function a(t){return t in o&&(delete o[t],!0)}var c=function(t){var e=n++;return o[e]=!0,s.then((function(){return a(e)&&t()})),e},u=function(t){a(t)},h=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.scheduler=e,i.work=r,i}return i.ZT(e,t),e.prototype.requestAsyncId=function(e,r,i){return void 0===i&&(i=0),null!==i&&i>0?t.prototype.requestAsyncId.call(this,e,r,i):(e.actions.push(this),e.scheduled||(e.scheduled=c(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,r,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,r,i);0===e.actions.length&&(u(r),e.scheduled=void 0)},e}(r(9795).o),f=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.ZT(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,r=this.actions,i=-1,n=r.length;t=t||r.shift();do{if(e=t.execute(t.state,t.delay))break}while(++i<n&&(t=r.shift()));if(this.active=!1,e){for(;++i<n&&(t=r.shift());)t.unsubscribe();throw e}},e}(r(2966).v))(h),l=f},646:(t,e,r)=>{"use strict";r.d(e,{P:()=>s,z:()=>n});var i=r(9795),n=new(r(2966).v)(i.o),s=n},7410:(t,e,r)=>{"use strict";r.d(e,{c:()=>o,N:()=>s});var i=r(2995),n=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.scheduler=e,i.work=r,i}return i.ZT(e,t),e.prototype.schedule=function(e,r){return void 0===r&&(r=0),r>0?t.prototype.schedule.call(this,e,r):(this.delay=r,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,r){return r>0||this.closed?t.prototype.execute.call(this,e,r):this._execute(e,r)},e.prototype.requestAsyncId=function(e,r,i){return void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0?t.prototype.requestAsyncId.call(this,e,r,i):e.flush(this)},e}(r(9795).o),s=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.ZT(e,t),e}(r(2966).v))(n),o=s},2:(t,e,r)=>{"use strict";function i(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}r.d(e,{hZ:()=>n});var n=i()},8859:(t,e,r)=>{"use strict";r.d(e,{L:()=>i});var i=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},2532:(t,e,r)=>{"use strict";r.d(e,{b:()=>i});var i=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}()},9120:(t,e,r)=>{"use strict";r.d(e,{W:()=>i});var i=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}()},4397:(t,e,r)=>{"use strict";r.d(e,{K:()=>i});var i=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}()},906:(t,e,r)=>{"use strict";r.d(e,{N:()=>i});var i=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}()},5915:(t,e,r)=>{"use strict";r.d(e,{W:()=>i});var i=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}()},2674:(t,e,r)=>{"use strict";r.d(e,{B:()=>i});var i=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}()},4658:(t,e,r)=>{"use strict";r.d(e,{_:()=>n});var i=r(1881);function n(t){for(;t;){var e=t,r=e.closed,n=e.destination,s=e.isStopped;if(r||s)return!1;t=n&&n instanceof i.L?n:null}return!0}},7804:(t,e,r)=>{"use strict";function i(t){setTimeout((function(){throw t}),0)}r.d(e,{z:()=>i})},6930:(t,e,r)=>{"use strict";function i(t){return t}r.d(e,{y:()=>i})},3073:(t,e,r)=>{"use strict";r.d(e,{k:()=>i});var i=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}()},2318:(t,e,r)=>{"use strict";r.d(e,{z:()=>i});var i=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t}},7371:(t,e,r)=>{"use strict";function i(t){return"function"==typeof t}r.d(e,{m:()=>i})},6712:(t,e,r)=>{"use strict";r.d(e,{k:()=>n});var i=r(3073);function n(t){return!(0,i.k)(t)&&t-parseFloat(t)+1>=0}},757:(t,e,r)=>{"use strict";function i(t){return null!==t&&"object"==typeof t}r.d(e,{K:()=>i})},9633:(t,e,r)=>{"use strict";function i(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}r.d(e,{t:()=>i})},4070:(t,e,r)=>{"use strict";function i(t){return t&&"function"==typeof t.schedule}r.d(e,{K:()=>i})},4582:(t,e,r)=>{"use strict";function i(){}r.d(e,{Z:()=>i})},5683:(t,e,r)=>{"use strict";function i(t,e){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=t,r.thisArg=e,r}r.d(e,{f:()=>i})},1199:(t,e,r)=>{"use strict";r.d(e,{U:()=>s,z:()=>n});var i=r(6930);function n(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return s(t)}function s(t){return 0===t.length?i.y:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}},1400:(t,e,r)=>{"use strict";r.d(e,{s:()=>h});var i=r(7651),n=r(7804),s=r(2),o=r(8859),a=r(2318),c=r(9633),u=r(757),h=function(t){if(t&&"function"==typeof t[o.L])return h=t,function(t){var e=h[o.L]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if((0,a.z)(t))return(0,i.V)(t);if((0,c.t)(t))return r=t,function(t){return r.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,n.z),t};if(t&&"function"==typeof t[s.hZ])return e=t,function(t){for(var r=e[s.hZ]();;){var i=void 0;try{i=r.next()}catch(e){return t.error(e),t}if(i.done){t.complete();break}if(t.next(i.value),t.closed)break}return"function"==typeof r.return&&t.add((function(){r.return&&r.return()})),t};var e,r,h,f=(0,u.K)(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+f+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},7651:(t,e,r)=>{"use strict";r.d(e,{V:()=>i});var i=function(t){return function(e){for(var r=0,i=t.length;r<i&&!e.closed;r++)e.next(t[r]);e.complete()}}},505:(t,e,r)=>{"use strict";r.d(e,{D:()=>a});var i=r(2995),n=function(t){function e(e,r,i){var n=t.call(this)||this;return n.parent=e,n.outerValue=r,n.outerIndex=i,n.index=0,n}return i.ZT(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(r(1881).L),s=r(1400),o=r(9939);function a(t,e,r,i,a){if(void 0===a&&(a=new n(t,r,i)),!a.closed)return e instanceof o.y?e.subscribe(a):(0,s.s)(e)(a)}},6276:(t,e,r)=>{"use strict";r.r(e),r.d(e,{audit:()=>s,auditTime:()=>h,buffer:()=>f,bufferCount:()=>b,bufferTime:()=>w,bufferToggle:()=>I,bufferWhen:()=>k,catchError:()=>B,combineAll:()=>K,combineLatest:()=>H,concat:()=>$,concatAll:()=>z.u,concatMap:()=>Z,concatMapTo:()=>W,count:()=>Y,debounce:()=>Q,debounceTime:()=>rt,defaultIfEmpty:()=>ot,delay:()=>ft,delayWhen:()=>gt,dematerialize:()=>_t,distinct:()=>At,distinctUntilChanged:()=>xt,distinctUntilKeyChanged:()=>It,elementAt:()=>Ft,endWith:()=>Gt,every:()=>$t,exhaust:()=>Zt,exhaustMap:()=>Xt,expand:()=>ee,filter:()=>Mt.h,finalize:()=>ne,find:()=>ae,findIndex:()=>he,first:()=>le,flatMap:()=>q.VS,groupBy:()=>de.v,ignoreElements:()=>pe,isEmpty:()=>me,last:()=>Se,map:()=>Jt.U,mapTo:()=>Ae,materialize:()=>xe,max:()=>Ce,merge:()=>De,mergeAll:()=>Ue.J,mergeMap:()=>q.zg,mergeMapTo:()=>je,mergeScan:()=>Ke,min:()=>He,multicast:()=>$e,observeOn:()=>qe.QV,onErrorResumeNext:()=>Ze,pairwise:()=>Je,partition:()=>er,pluck:()=>rr,publish:()=>sr,publishBehavior:()=>ar,publishLast:()=>ur,publishReplay:()=>fr,race:()=>dr,reduce:()=>Le,refCount:()=>Tr.x,repeat:()=>pr,repeatWhen:()=>mr,retry:()=>wr,retryWhen:()=>Sr,sample:()=>xr,sampleTime:()=>Ir,scan:()=>Ie,sequenceEqual:()=>Lr,share:()=>jr,shareReplay:()=>Kr,single:()=>Vr,skip:()=>Gr,skipLast:()=>qr,skipUntil:()=>Yr,skipWhile:()=>Qr,startWith:()=>ri,subscribeOn:()=>oi,switchAll:()=>fi,switchMap:()=>ci,switchMapTo:()=>li,take:()=>jt,takeLast:()=>we,takeUntil:()=>di,takeWhile:()=>gi,tap:()=>_i,throttle:()=>Oi,throttleTime:()=>Pi,throwIfEmpty:()=>Lt,timeInterval:()=>ki,timeout:()=>Ki,timeoutWith:()=>Bi,timestamp:()=>Vi,toArray:()=>Gi,window:()=>$i,windowCount:()=>Zi,windowTime:()=>Ji,windowToggle:()=>sn,windowWhen:()=>cn,withLatestFrom:()=>fn,zip:()=>bn,zipAll:()=>gn});var i=r(2995),n=r(3694);function s(t){return function(e){return e.lift(new o(t))}}var o=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.durationSelector))},t}(),a=function(t){function e(e,r){var i=t.call(this,e)||this;return i.durationSelector=r,i.hasValue=!1,i}return i.ZT(e,t),e.prototype._next=function(t){if(this.value=t,this.hasValue=!0,!this.throttled){var e=void 0;try{e=(0,this.durationSelector)(t)}catch(t){return this.destination.error(t)}var r=(0,n.ft)(e,new n.IY(this));!r||r.closed?this.clearThrottle():this.add(this.throttled=r)}},e.prototype.clearThrottle=function(){var t=this,e=t.value,r=t.hasValue,i=t.throttled;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),r&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))},e.prototype.notifyNext=function(){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(n.Ds),c=r(646),u=r(3254);function h(t,e){return void 0===e&&(e=c.P),s((function(){return(0,u.H)(t,e)}))}function f(t){return function(e){return e.lift(new l(t))}}var l=function(){function t(t){this.closingNotifier=t}return t.prototype.call=function(t,e){return e.subscribe(new d(t,this.closingNotifier))},t}(),d=function(t){function e(e,r){var i=t.call(this,e)||this;return i.buffer=[],i.add((0,n.ft)(r,new n.IY(i))),i}return i.ZT(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype.notifyNext=function(){var t=this.buffer;this.buffer=[],this.destination.next(t)},e}(n.Ds),p=r(1881);function b(t,e){return void 0===e&&(e=null),function(r){return r.lift(new g(t,e))}}var g=function(){function t(t,e){this.bufferSize=t,this.startBufferEvery=e,this.subscriberClass=e&&t!==e?v:m}return t.prototype.call=function(t,e){return e.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},t}(),m=function(t){function e(e,r){var i=t.call(this,e)||this;return i.bufferSize=r,i.buffer=[],i}return i.ZT(e,t),e.prototype._next=function(t){var e=this.buffer;e.push(t),e.length==this.bufferSize&&(this.destination.next(e),this.buffer=[])},e.prototype._complete=function(){var e=this.buffer;e.length>0&&this.destination.next(e),t.prototype._complete.call(this)},e}(p.L),v=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.bufferSize=r,n.startBufferEvery=i,n.buffers=[],n.count=0,n}return i.ZT(e,t),e.prototype._next=function(t){var e=this,r=e.bufferSize,i=e.startBufferEvery,n=e.buffers,s=e.count;this.count++,s%i==0&&n.push([]);for(var o=n.length;o--;){var a=n[o];a.push(t),a.length===r&&(n.splice(o,1),this.destination.next(a))}},e.prototype._complete=function(){for(var e=this.buffers,r=this.destination;e.length>0;){var i=e.shift();i.length>0&&r.next(i)}t.prototype._complete.call(this)},e}(p.L),y=r(4070);function w(t){var e=arguments.length,r=c.P;(0,y.K)(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],e--);var i=null;e>=2&&(i=arguments[1]);var n=Number.POSITIVE_INFINITY;return e>=3&&(n=arguments[2]),function(e){return e.lift(new _(t,i,n,r))}}var _=function(){function t(t,e,r,i){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=r,this.scheduler=i}return t.prototype.call=function(t,e){return e.subscribe(new S(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),E=function(){return function(){this.buffer=[]}}(),S=function(t){function e(e,r,i,n,s){var o=t.call(this,e)||this;o.bufferTimeSpan=r,o.bufferCreationInterval=i,o.maxBufferSize=n,o.scheduler=s,o.contexts=[];var a=o.openContext();if(o.timespanOnly=null==i||i<0,o.timespanOnly){var c={subscriber:o,context:a,bufferTimeSpan:r};o.add(a.closeAction=s.schedule(A,r,c))}else{var u={subscriber:o,context:a},h={bufferTimeSpan:r,bufferCreationInterval:i,subscriber:o,scheduler:s};o.add(a.closeAction=s.schedule(T,r,u)),o.add(s.schedule(O,i,h))}return o}return i.ZT(e,t),e.prototype._next=function(t){for(var e,r=this.contexts,i=r.length,n=0;n<i;n++){var s=r[n],o=s.buffer;o.push(t),o.length==this.maxBufferSize&&(e=s)}e&&this.onBufferFull(e)},e.prototype._error=function(e){this.contexts.length=0,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts,r=this.destination;e.length>0;){var i=e.shift();r.next(i.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var r=this.bufferTimeSpan,i={subscriber:this,context:t,bufferTimeSpan:r};this.add(t.closeAction=this.scheduler.schedule(A,r,i))}},e.prototype.openContext=function(){var t=new E;return this.contexts.push(t),t},e.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},e}(p.L);function A(t){var e=t.subscriber,r=t.context;r&&e.closeContext(r),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function O(t){var e=t.bufferCreationInterval,r=t.bufferTimeSpan,i=t.subscriber,n=t.scheduler,s=i.openContext();i.closed||(i.add(s.closeAction=n.schedule(T,r,{subscriber:i,context:s})),this.schedule(t,e))}function T(t){var e=t.subscriber,r=t.context;e.closeContext(r)}var x=r(1586),P=r(505),R=r(6807);function I(t,e){return function(r){return r.lift(new N(t,e))}}var N=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new M(t,this.openings,this.closingSelector))},t}(),M=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.closingSelector=i,n.contexts=[],n.add((0,P.D)(n,r)),n}return i.ZT(e,t),e.prototype._next=function(t){for(var e=this.contexts,r=e.length,i=0;i<r;i++)e[i].buffer.push(t)},e.prototype._error=function(e){for(var r=this.contexts;r.length>0;){var i=r.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var r=e.shift();this.destination.next(r.buffer),r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e){t?this.closeBuffer(t):this.openBuffer(e)},e.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},e.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(t){this._error(t)}},e.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var r=t.buffer,i=t.subscription;this.destination.next(r),e.splice(e.indexOf(t),1),this.remove(i),i.unsubscribe()}},e.prototype.trySubscribe=function(t){var e=this.contexts,r=new x.w,i={buffer:[],subscription:r};e.push(i);var n=(0,P.D)(this,t,i);!n||n.closed?this.closeBuffer(i):(n.context=i,this.add(n),r.add(n))},e}(R.L);function k(t){return function(e){return e.lift(new L(t))}}var L=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new C(t,this.closingSelector))},t}(),C=function(t){function e(e,r){var i=t.call(this,e)||this;return i.closingSelector=r,i.subscribing=!1,i.openBuffer(),i}return i.ZT(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype._complete=function(){var e=this.buffer;e&&this.destination.next(e),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},e.prototype.notifyNext=function(){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var e,r=this.buffer;this.buffer&&this.destination.next(r),this.buffer=[];try{e=(0,this.closingSelector)()}catch(t){return this.error(t)}t=new x.w,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add((0,n.ft)(e,new n.IY(this))),this.subscribing=!1},e}(n.Ds);function B(t){return function(e){var r=new D(t),i=e.lift(r);return r.caught=i}}var D=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new U(t,this.selector,this.caught))},t}(),U=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.selector=r,n.caught=i,n}return i.ZT(e,t),e.prototype.error=function(e){if(!this.isStopped){var r=void 0;try{r=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle();var i=new n.IY(this);this.add(i);var s=(0,n.ft)(r,i);s!==i&&this.add(s)}},e}(n.Ds),j=r(97);function K(t){return function(e){return e.lift(new j.Ms(t))}}var V=r(3073),F=r(7238);function H(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=null;return"function"==typeof t[t.length-1]&&(r=t.pop()),1===t.length&&(0,V.k)(t[0])&&(t=t[0].slice()),function(e){return e.lift.call((0,F.D)([e].concat(t)),new j.Ms(r))}}var G=r(4245);function $(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(G.z.apply(void 0,[e].concat(t)))}}var z=r(430),q=r(1710);function Z(t,e){return(0,q.zg)(t,e,1)}function W(t,e){return Z((function(){return t}),e)}function Y(t){return function(e){return e.lift(new J(t,e))}}var J=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new X(t,this.predicate,this.source))},t}(),X=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.predicate=r,n.source=i,n.count=0,n.index=0,n}return i.ZT(e,t),e.prototype._next=function(t){this.predicate?this._tryPredicate(t):this.count++},e.prototype._tryPredicate=function(t){var e;try{e=this.predicate(t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(p.L);function Q(t){return function(e){return e.lift(new tt(t))}}var tt=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new et(t,this.durationSelector))},t}(),et=function(t){function e(e,r){var i=t.call(this,e)||this;return i.durationSelector=r,i.hasValue=!1,i}return i.ZT(e,t),e.prototype._next=function(t){try{var e=this.durationSelector.call(this,t);e&&this._tryNext(t,e)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(t,e){var r=this.durationSubscription;this.value=t,this.hasValue=!0,r&&(r.unsubscribe(),this.remove(r)),(r=(0,n.ft)(e,new n.IY(this)))&&!r.closed&&this.add(this.durationSubscription=r)},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var e=this.value,r=this.durationSubscription;r&&(this.durationSubscription=void 0,r.unsubscribe(),this.remove(r)),this.value=void 0,this.hasValue=!1,t.prototype._next.call(this,e)}},e}(n.Ds);function rt(t,e){return void 0===e&&(e=c.P),function(r){return r.lift(new it(t,e))}}var it=function(){function t(t,e){this.dueTime=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new nt(t,this.dueTime,this.scheduler))},t}(),nt=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.dueTime=r,n.scheduler=i,n.debouncedSubscription=null,n.lastValue=null,n.hasValue=!1,n}return i.ZT(e,t),e.prototype._next=function(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(st,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var t=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}},e.prototype.clearDebounce=function(){var t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)},e}(p.L);function st(t){t.debouncedNext()}function ot(t){return void 0===t&&(t=null),function(e){return e.lift(new at(t))}}var at=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new ct(t,this.defaultValue))},t}(),ct=function(t){function e(e,r){var i=t.call(this,e)||this;return i.defaultValue=r,i.isEmpty=!0,i}return i.ZT(e,t),e.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(p.L);function ut(t){return t instanceof Date&&!isNaN(+t)}var ht=r(8781);function ft(t,e){void 0===e&&(e=c.P);var r=ut(t)?+t-e.now():Math.abs(t);return function(t){return t.lift(new lt(r,e))}}var lt=function(){function t(t,e){this.delay=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new dt(t,this.delay,this.scheduler))},t}(),dt=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.delay=r,n.scheduler=i,n.queue=[],n.active=!1,n.errored=!1,n}return i.ZT(e,t),e.dispatch=function(t){for(var e=t.source,r=e.queue,i=t.scheduler,n=t.destination;r.length>0&&r[0].time-i.now()<=0;)r.shift().notification.observe(n);if(r.length>0){var s=Math.max(0,r[0].time-i.now());this.schedule(t,s)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(t){this.active=!0,this.destination.add(t.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},e.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,r=new pt(e.now()+this.delay,t);this.queue.push(r),!1===this.active&&this._schedule(e)}},e.prototype._next=function(t){this.scheduleNotification(ht.P.createNext(t))},e.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(ht.P.createComplete()),this.unsubscribe()},e}(p.L),pt=function(){return function(t,e){this.time=t,this.notification=e}}(),bt=r(9939);function gt(t,e){return e?function(r){return new yt(r,e).lift(new mt(t))}:function(e){return e.lift(new mt(t))}}var mt=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new vt(t,this.delayDurationSelector))},t}(),vt=function(t){function e(e,r){var i=t.call(this,e)||this;return i.delayDurationSelector=r,i.completed=!1,i.delayNotifierSubscriptions=[],i.index=0,i}return i.ZT(e,t),e.prototype.notifyNext=function(t,e,r,i,n){this.destination.next(t),this.removeSubscription(n),this.tryComplete()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},e.prototype._next=function(t){var e=this.index++;try{var r=this.delayDurationSelector(t,e);r&&this.tryDelay(r,t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t);return-1!==e&&this.delayNotifierSubscriptions.splice(e,1),t.outerValue},e.prototype.tryDelay=function(t,e){var r=(0,P.D)(this,t,e);r&&!r.closed&&(this.destination.add(r),this.delayNotifierSubscriptions.push(r))},e.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},e}(R.L),yt=function(t){function e(e,r){var i=t.call(this)||this;return i.source=e,i.subscriptionDelay=r,i}return i.ZT(e,t),e.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new wt(t,this.source))},e}(bt.y),wt=function(t){function e(e,r){var i=t.call(this)||this;return i.parent=e,i.source=r,i.sourceSubscribed=!1,i}return i.ZT(e,t),e.prototype._next=function(t){this.subscribeToSource()},e.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(p.L);function _t(){return function(t){return t.lift(new Et)}}var Et=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new St(t))},t}(),St=function(t){function e(e){return t.call(this,e)||this}return i.ZT(e,t),e.prototype._next=function(t){t.observe(this.destination)},e}(p.L);function At(t,e){return function(r){return r.lift(new Ot(t,e))}}var Ot=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new Tt(t,this.keySelector,this.flushes))},t}(),Tt=function(t){function e(e,r,i){var s=t.call(this,e)||this;return s.keySelector=r,s.values=new Set,i&&s.add((0,n.ft)(i,new n.IY(s))),s}return i.ZT(e,t),e.prototype.notifyNext=function(){this.values.clear()},e.prototype.notifyError=function(t){this._error(t)},e.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},e.prototype._useKeySelector=function(t){var e,r=this.destination;try{e=this.keySelector(t)}catch(t){return void r.error(t)}this._finalizeNext(e,t)},e.prototype._finalizeNext=function(t,e){var r=this.values;r.has(t)||(r.add(t),this.destination.next(e))},e}(n.Ds);function xt(t,e){return function(r){return r.lift(new Pt(t,e))}}var Pt=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new Rt(t,this.compare,this.keySelector))},t}(),Rt=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.keySelector=i,n.hasKey=!1,"function"==typeof r&&(n.compare=r),n}return i.ZT(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e;try{var r=this.keySelector;e=r?r(t):t}catch(t){return this.destination.error(t)}var i=!1;if(this.hasKey)try{i=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;i||(this.key=e,this.destination.next(t))},e}(p.L);function It(t,e){return xt((function(r,i){return e?e(r[t],i[t]):r[t]===i[t]}))}var Nt=r(9120),Mt=r(2730),kt=r(4397);function Lt(t){return void 0===t&&(t=Dt),function(e){return e.lift(new Ct(t))}}var Ct=function(){function t(t){this.errorFactory=t}return t.prototype.call=function(t,e){return e.subscribe(new Bt(t,this.errorFactory))},t}(),Bt=function(t){function e(e,r){var i=t.call(this,e)||this;return i.errorFactory=r,i.hasValue=!1,i}return i.ZT(e,t),e.prototype._next=function(t){this.hasValue=!0,this.destination.next(t)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var t=void 0;try{t=this.errorFactory()}catch(e){t=e}this.destination.error(t)},e}(p.L);function Dt(){return new kt.K}var Ut=r(4773);function jt(t){return function(e){return 0===t?(0,Ut.c)():e.lift(new Kt(t))}}var Kt=function(){function t(t){if(this.total=t,this.total<0)throw new Nt.W}return t.prototype.call=function(t,e){return e.subscribe(new Vt(t,this.total))},t}(),Vt=function(t){function e(e,r){var i=t.call(this,e)||this;return i.total=r,i.count=0,i}return i.ZT(e,t),e.prototype._next=function(t){var e=this.total,r=++this.count;r<=e&&(this.destination.next(t),r===e&&(this.destination.complete(),this.unsubscribe()))},e}(p.L);function Ft(t,e){if(t<0)throw new Nt.W;var r=arguments.length>=2;return function(i){return i.pipe((0,Mt.h)((function(e,r){return r===t})),jt(1),r?ot(e):Lt((function(){return new Nt.W})))}}var Ht=r(6612);function Gt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return(0,G.z)(e,Ht.of.apply(void 0,t))}}function $t(t,e){return function(r){return r.lift(new zt(t,e,r))}}var zt=function(){function t(t,e,r){this.predicate=t,this.thisArg=e,this.source=r}return t.prototype.call=function(t,e){return e.subscribe(new qt(t,this.predicate,this.thisArg,this.source))},t}(),qt=function(t){function e(e,r,i,n){var s=t.call(this,e)||this;return s.predicate=r,s.thisArg=i,s.source=n,s.index=0,s.thisArg=i||s,s}return i.ZT(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(p.L);function Zt(){return function(t){return t.lift(new Wt)}}var Wt=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Yt(t))},t}(),Yt=function(t){function e(e){var r=t.call(this,e)||this;return r.hasCompleted=!1,r.hasSubscription=!1,r}return i.ZT(e,t),e.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add((0,n.ft)(t,new n.IY(this))))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(n.Ds),Jt=r(2188);function Xt(t,e){return e?function(r){return r.pipe(Xt((function(r,i){return(0,F.D)(t(r,i)).pipe((0,Jt.U)((function(t,n){return e(r,t,i,n)})))})))}:function(e){return e.lift(new Qt(t))}}var Qt=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new te(t,this.project))},t}(),te=function(t){function e(e,r){var i=t.call(this,e)||this;return i.project=r,i.hasSubscription=!1,i.hasCompleted=!1,i.index=0,i}return i.ZT(e,t),e.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},e.prototype.tryNext=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this.hasSubscription=!0,this._innerSub(e)},e.prototype._innerSub=function(t){var e=new n.IY(this),r=this.destination;r.add(e);var i=(0,n.ft)(t,e);i!==e&&r.add(i)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(n.Ds);function ee(t,e,r){return void 0===e&&(e=Number.POSITIVE_INFINITY),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(i){return i.lift(new re(t,e,r))}}var re=function(){function t(t,e,r){this.project=t,this.concurrent=e,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new ie(t,this.project,this.concurrent,this.scheduler))},t}(),ie=function(t){function e(e,r,i,n){var s=t.call(this,e)||this;return s.project=r,s.concurrent=i,s.scheduler=n,s.index=0,s.active=0,s.hasCompleted=!1,i<Number.POSITIVE_INFINITY&&(s.buffer=[]),s}return i.ZT(e,t),e.dispatch=function(t){var e=t.subscriber,r=t.result,i=t.value,n=t.index;e.subscribeToProjection(r,i,n)},e.prototype._next=function(t){var r=this.destination;if(r.closed)this._complete();else{var i=this.index++;if(this.active<this.concurrent){r.next(t);try{var n=(0,this.project)(t,i);if(this.scheduler){var s={subscriber:this,result:n,value:t,index:i};this.destination.add(this.scheduler.schedule(e.dispatch,0,s))}else this.subscribeToProjection(n,t,i)}catch(t){r.error(t)}}else this.buffer.push(t)}},e.prototype.subscribeToProjection=function(t,e,r){this.active++,this.destination.add((0,n.ft)(t,new n.IY(this)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this._next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t&&t.length>0&&this._next(t.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},e}(n.Ds);function ne(t){return function(e){return e.lift(new se(t))}}var se=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new oe(t,this.callback))},t}(),oe=function(t){function e(e,r){var i=t.call(this,e)||this;return i.add(new x.w(r)),i}return i.ZT(e,t),e}(p.L);function ae(t,e){if("function"!=typeof t)throw new TypeError("predicate is not a function");return function(r){return r.lift(new ce(t,r,!1,e))}}var ce=function(){function t(t,e,r,i){this.predicate=t,this.source=e,this.yieldIndex=r,this.thisArg=i}return t.prototype.call=function(t,e){return e.subscribe(new ue(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),ue=function(t){function e(e,r,i,n,s){var o=t.call(this,e)||this;return o.predicate=r,o.source=i,o.yieldIndex=n,o.thisArg=s,o.index=0,o}return i.ZT(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete(),this.unsubscribe()},e.prototype._next=function(t){var e=this.predicate,r=this.thisArg,i=this.index++;try{e.call(r||this,t,i,this.source)&&this.notifyComplete(this.yieldIndex?i:t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(p.L);function he(t,e){return function(r){return r.lift(new ce(t,r,!0,e))}}var fe=r(6930);function le(t,e){var r=arguments.length>=2;return function(i){return i.pipe(t?(0,Mt.h)((function(e,r){return t(e,r,i)})):fe.y,jt(1),r?ot(e):Lt((function(){return new kt.K})))}}var de=r(453);function pe(){return function(t){return t.lift(new be)}}var be=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new ge(t))},t}(),ge=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.ZT(e,t),e.prototype._next=function(t){},e}(p.L);function me(){return function(t){return t.lift(new ve)}}var ve=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new ye(t))},t}(),ye=function(t){function e(e){return t.call(this,e)||this}return i.ZT(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(p.L);function we(t){return function(e){return 0===t?(0,Ut.c)():e.lift(new _e(t))}}var _e=function(){function t(t){if(this.total=t,this.total<0)throw new Nt.W}return t.prototype.call=function(t,e){return e.subscribe(new Ee(t,this.total))},t}(),Ee=function(t){function e(e,r){var i=t.call(this,e)||this;return i.total=r,i.ring=new Array,i.count=0,i}return i.ZT(e,t),e.prototype._next=function(t){var e=this.ring,r=this.total,i=this.count++;e.length<r?e.push(t):e[i%r]=t},e.prototype._complete=function(){var t=this.destination,e=this.count;if(e>0)for(var r=this.count>=this.total?this.total:this.count,i=this.ring,n=0;n<r;n++){var s=e++%r;t.next(i[s])}t.complete()},e}(p.L);function Se(t,e){var r=arguments.length>=2;return function(i){return i.pipe(t?(0,Mt.h)((function(e,r){return t(e,r,i)})):fe.y,we(1),r?ot(e):Lt((function(){return new kt.K})))}}function Ae(t){return function(e){return e.lift(new Oe(t))}}var Oe=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new Te(t,this.value))},t}(),Te=function(t){function e(e,r){var i=t.call(this,e)||this;return i.value=r,i}return i.ZT(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(p.L);function xe(){return function(t){return t.lift(new Pe)}}var Pe=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Re(t))},t}(),Re=function(t){function e(e){return t.call(this,e)||this}return i.ZT(e,t),e.prototype._next=function(t){this.destination.next(ht.P.createNext(t))},e.prototype._error=function(t){var e=this.destination;e.next(ht.P.createError(t)),e.complete()},e.prototype._complete=function(){var t=this.destination;t.next(ht.P.createComplete()),t.complete()},e}(p.L);function Ie(t,e){var r=!1;return arguments.length>=2&&(r=!0),function(i){return i.lift(new Ne(t,e,r))}}var Ne=function(){function t(t,e,r){void 0===r&&(r=!1),this.accumulator=t,this.seed=e,this.hasSeed=r}return t.prototype.call=function(t,e){return e.subscribe(new Me(t,this.accumulator,this.seed,this.hasSeed))},t}(),Me=function(t){function e(e,r,i,n){var s=t.call(this,e)||this;return s.accumulator=r,s._seed=i,s.hasSeed=n,s.index=0,s}return i.ZT(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,r=this.index++;try{e=this.accumulator(this.seed,t,r)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},e}(p.L),ke=r(1199);function Le(t,e){return arguments.length>=2?function(r){return(0,ke.z)(Ie(t,e),we(1),ot(e))(r)}:function(e){return(0,ke.z)(Ie((function(e,r,i){return t(e,r,i+1)})),we(1))(e)}}function Ce(t){return Le("function"==typeof t?function(e,r){return t(e,r)>0?e:r}:function(t,e){return t>e?t:e})}var Be=r(7686);function De(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(Be.T.apply(void 0,[e].concat(t)))}}var Ue=r(7258);function je(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof e?(0,q.zg)((function(){return t}),e,r):("number"==typeof e&&(r=e),(0,q.zg)((function(){return t}),r))}function Ke(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),function(i){return i.lift(new Ve(t,e,r))}}var Ve=function(){function t(t,e,r){this.accumulator=t,this.seed=e,this.concurrent=r}return t.prototype.call=function(t,e){return e.subscribe(new Fe(t,this.accumulator,this.seed,this.concurrent))},t}(),Fe=function(t){function e(e,r,i,n){var s=t.call(this,e)||this;return s.accumulator=r,s.acc=i,s.concurrent=n,s.hasValue=!1,s.hasCompleted=!1,s.buffer=[],s.active=0,s.index=0,s}return i.ZT(e,t),e.prototype._next=function(t){if(this.active<this.concurrent){var e=this.index++,r=this.destination,i=void 0;try{i=(0,this.accumulator)(this.acc,t,e)}catch(t){return r.error(t)}this.active++,this._innerSub(i)}else this.buffer.push(t)},e.prototype._innerSub=function(t){var e=new n.IY(this),r=this.destination;r.add(e);var i=(0,n.ft)(t,e);i!==e&&r.add(i)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},e.prototype.notifyNext=function(t){var e=this.destination;this.acc=t,this.hasValue=!0,e.next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},e}(n.Ds);function He(t){return Le("function"==typeof t?function(e,r){return t(e,r)<0?e:r}:function(t,e){return t<e?t:e})}var Ge=r(9386);function $e(t,e){return function(r){var i;if(i="function"==typeof t?t:function(){return t},"function"==typeof e)return r.lift(new ze(i,e));var n=Object.create(r,Ge.N);return n.source=r,n.subjectFactory=i,n}}var ze=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var r=this.selector,i=this.subjectFactory(),n=r(i).subscribe(t);return n.add(e.subscribe(i)),n},t}(),qe=r(9433);function Ze(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length&&(0,V.k)(t[0])&&(t=t[0]),function(e){return e.lift(new We(t))}}var We=function(){function t(t){this.nextSources=t}return t.prototype.call=function(t,e){return e.subscribe(new Ye(t,this.nextSources))},t}(),Ye=function(t){function e(e,r){var i=t.call(this,e)||this;return i.destination=e,i.nextSources=r,i}return i.ZT(e,t),e.prototype.notifyError=function(){this.subscribeToNextSource()},e.prototype.notifyComplete=function(){this.subscribeToNextSource()},e.prototype._error=function(t){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var t=this.nextSources.shift();if(t){var e=new n.IY(this),r=this.destination;r.add(e);var i=(0,n.ft)(t,e);i!==e&&r.add(i)}else this.destination.complete()},e}(n.Ds);function Je(){return function(t){return t.lift(new Xe)}}var Xe=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Qe(t))},t}(),Qe=function(t){function e(e){var r=t.call(this,e)||this;return r.hasPrev=!1,r}return i.ZT(e,t),e.prototype._next=function(t){var e;this.hasPrev?e=[this.prev,t]:this.hasPrev=!0,this.prev=t,e&&this.destination.next(e)},e}(p.L),tr=r(5683);function er(t,e){return function(r){return[(0,Mt.h)(t,e)(r),(0,Mt.h)((0,tr.f)(t,e))(r)]}}function rr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.length;if(0===r)throw new Error("list of properties cannot be empty.");return function(e){return(0,Jt.U)(ir(t,r))(e)}}function ir(t,e){return function(r){for(var i=r,n=0;n<e;n++){var s=null!=i?i[t[n]]:void 0;if(void 0===s)return;i=s}return i}}var nr=r(1194);function sr(t){return t?$e((function(){return new nr.xQ}),t):$e(new nr.xQ)}var or=r(4580);function ar(t){return function(e){return $e(new or.X(t))(e)}}var cr=r(3866);function ur(){return function(t){return $e(new cr.c)(t)}}var hr=r(1048);function fr(t,e,r,i){r&&"function"!=typeof r&&(i=r);var n="function"==typeof r?r:void 0,s=new hr.t(t,e,i);return function(t){return $e((function(){return s}),n)(t)}}var lr=r(2219);function dr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return 1===t.length&&(0,V.k)(t[0])&&(t=t[0]),e.lift.call(lr.S3.apply(void 0,[e].concat(t)))}}function pr(t){return void 0===t&&(t=-1),function(e){return 0===t?(0,Ut.c)():t<0?e.lift(new br(-1,e)):e.lift(new br(t-1,e))}}var br=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new gr(t,this.count,this.source))},t}(),gr=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.count=r,n.source=i,n}return i.ZT(e,t),e.prototype.complete=function(){if(!this.isStopped){var e=this.source,r=this.count;if(0===r)return t.prototype.complete.call(this);r>-1&&(this.count=r-1),e.subscribe(this._unsubscribeAndRecycle())}},e}(p.L);function mr(t){return function(e){return e.lift(new vr(t))}}var vr=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new yr(t,this.notifier,e))},t}(),yr=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.notifier=r,n.source=i,n.sourceIsBeingSubscribedTo=!0,n}return i.ZT(e,t),e.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},e.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype._unsubscribeAndRecycle=function(){var e=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=e,this},e.prototype.subscribeToRetries=function(){var e;this.notifications=new nr.xQ;try{e=(0,this.notifier)(this.notifications)}catch(e){return t.prototype.complete.call(this)}this.retries=e,this.retriesSubscription=(0,n.ft)(e,new n.IY(this))},e}(n.Ds);function wr(t){return void 0===t&&(t=-1),function(e){return e.lift(new _r(t,e))}}var _r=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Er(t,this.count,this.source))},t}(),Er=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.count=r,n.source=i,n}return i.ZT(e,t),e.prototype.error=function(e){if(!this.isStopped){var r=this.source,i=this.count;if(0===i)return t.prototype.error.call(this,e);i>-1&&(this.count=i-1),r.subscribe(this._unsubscribeAndRecycle())}},e}(p.L);function Sr(t){return function(e){return e.lift(new Ar(t,e))}}var Ar=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Or(t,this.notifier,this.source))},t}(),Or=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.notifier=r,n.source=i,n}return i.ZT(e,t),e.prototype.error=function(e){if(!this.isStopped){var r=this.errors,i=this.retries,s=this.retriesSubscription;if(i)this.errors=void 0,this.retriesSubscription=void 0;else{r=new nr.xQ;try{i=(0,this.notifier)(r)}catch(e){return t.prototype.error.call(this,e)}s=(0,n.ft)(i,new n.IY(this))}this._unsubscribeAndRecycle(),this.errors=r,this.retries=i,this.retriesSubscription=s,r.next(e)}},e.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype.notifyNext=function(){var t=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=t,this.source.subscribe(this)},e}(n.Ds),Tr=r(6840);function xr(t){return function(e){return e.lift(new Pr(t))}}var Pr=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var r=new Rr(t),i=e.subscribe(r);return i.add((0,n.ft)(this.notifier,new n.IY(r))),i},t}(),Rr=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasValue=!1,e}return i.ZT(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(n.Ds);function Ir(t,e){return void 0===e&&(e=c.P),function(r){return r.lift(new Nr(t,e))}}var Nr=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new Mr(t,this.period,this.scheduler))},t}(),Mr=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.period=r,n.scheduler=i,n.hasValue=!1,n.add(i.schedule(kr,r,{subscriber:n,period:r})),n}return i.ZT(e,t),e.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(p.L);function kr(t){var e=t.subscriber,r=t.period;e.notifyNext(),this.schedule(t,r)}function Lr(t,e){return function(r){return r.lift(new Cr(t,e))}}var Cr=function(){function t(t,e){this.compareTo=t,this.comparator=e}return t.prototype.call=function(t,e){return e.subscribe(new Br(t,this.compareTo,this.comparator))},t}(),Br=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.compareTo=r,n.comparator=i,n._a=[],n._b=[],n._oneComplete=!1,n.destination.add(r.subscribe(new Dr(e,n))),n}return i.ZT(e,t),e.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var t=this,e=t._a,r=t._b,i=t.comparator;e.length>0&&r.length>0;){var n=e.shift(),s=r.shift(),o=!1;try{o=i?i(n,s):n===s}catch(t){this.destination.error(t)}o||this.emit(!1)}},e.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},e}(p.L),Dr=function(t){function e(e,r){var i=t.call(this,e)||this;return i.parent=r,i}return i.ZT(e,t),e.prototype._next=function(t){this.parent.nextB(t)},e.prototype._error=function(t){this.parent.error(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(p.L);function Ur(){return new nr.xQ}function jr(){return function(t){return(0,Tr.x)()($e(Ur)(t))}}function Kr(t,e,r){var i;return i=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:r},function(t){return t.lift(function(t){var e,r,i=t.bufferSize,n=void 0===i?Number.POSITIVE_INFINITY:i,s=t.windowTime,o=void 0===s?Number.POSITIVE_INFINITY:s,a=t.refCount,c=t.scheduler,u=0,h=!1,f=!1;return function(t){var i;u++,!e||h?(h=!1,e=new hr.t(n,o,c),i=e.subscribe(this),r=t.subscribe({next:function(t){e.next(t)},error:function(t){h=!0,e.error(t)},complete:function(){f=!0,r=void 0,e.complete()}}),f&&(r=void 0)):i=e.subscribe(this),this.add((function(){u--,i.unsubscribe(),i=void 0,r&&!f&&a&&0===u&&(r.unsubscribe(),r=void 0,e=void 0)}))}}(i))}}function Vr(t){return function(e){return e.lift(new Fr(t,e))}}var Fr=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Hr(t,this.predicate,this.source))},t}(),Hr=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.predicate=r,n.source=i,n.seenValue=!1,n.index=0,n}return i.ZT(e,t),e.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},e.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},e.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new kt.K)},e}(p.L);function Gr(t){return function(e){return e.lift(new $r(t))}}var $r=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new zr(t,this.total))},t}(),zr=function(t){function e(e,r){var i=t.call(this,e)||this;return i.total=r,i.count=0,i}return i.ZT(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(p.L);function qr(t){return function(e){return e.lift(new Zr(t))}}var Zr=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new Nt.W}return t.prototype.call=function(t,e){return 0===this._skipCount?e.subscribe(new p.L(t)):e.subscribe(new Wr(t,this._skipCount))},t}(),Wr=function(t){function e(e,r){var i=t.call(this,e)||this;return i._skipCount=r,i._count=0,i._ring=new Array(r),i}return i.ZT(e,t),e.prototype._next=function(t){var e=this._skipCount,r=this._count++;if(r<e)this._ring[r]=t;else{var i=r%e,n=this._ring,s=n[i];n[i]=t,this.destination.next(s)}},e}(p.L);function Yr(t){return function(e){return e.lift(new Jr(t))}}var Jr=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new Xr(t,this.notifier))},t}(),Xr=function(t){function e(e,r){var i=t.call(this,e)||this;i.hasValue=!1;var s=new n.IY(i);i.add(s),i.innerSubscription=s;var o=(0,n.ft)(r,s);return o!==s&&(i.add(o),i.innerSubscription=o),i}return i.ZT(e,t),e.prototype._next=function(e){this.hasValue&&t.prototype._next.call(this,e)},e.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(n.Ds);function Qr(t){return function(e){return e.lift(new ti(t))}}var ti=function(){function t(t){this.predicate=t}return t.prototype.call=function(t,e){return e.subscribe(new ei(t,this.predicate))},t}(),ei=function(t){function e(e,r){var i=t.call(this,e)||this;return i.predicate=r,i.skipping=!0,i.index=0,i}return i.ZT(e,t),e.prototype._next=function(t){var e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)},e.prototype.tryCallPredicate=function(t){try{var e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(t){this.destination.error(t)}},e}(p.L);function ri(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return(0,y.K)(r)?(t.pop(),function(e){return(0,G.z)(t,e,r)}):function(e){return(0,G.z)(t,e)}}var ii=r(4858),ni=r(6712),si=function(t){function e(e,r,i){void 0===r&&(r=0),void 0===i&&(i=ii.e);var n=t.call(this)||this;return n.source=e,n.delayTime=r,n.scheduler=i,(!(0,ni.k)(r)||r<0)&&(n.delayTime=0),i&&"function"==typeof i.schedule||(n.scheduler=ii.e),n}return i.ZT(e,t),e.create=function(t,r,i){return void 0===r&&(r=0),void 0===i&&(i=ii.e),new e(t,r,i)},e.dispatch=function(t){var e=t.source,r=t.subscriber;return this.add(e.subscribe(r))},e.prototype._subscribe=function(t){var r=this.delayTime,i=this.source;return this.scheduler.schedule(e.dispatch,r,{source:i,subscriber:t})},e}(bt.y);function oi(t,e){return void 0===e&&(e=0),function(r){return r.lift(new ai(t,e))}}var ai=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new si(e,this.delay,this.scheduler).subscribe(t)},t}();function ci(t,e){return"function"==typeof e?function(r){return r.pipe(ci((function(r,i){return(0,F.D)(t(r,i)).pipe((0,Jt.U)((function(t,n){return e(r,t,i,n)})))})))}:function(e){return e.lift(new ui(t))}}var ui=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new hi(t,this.project))},t}(),hi=function(t){function e(e,r){var i=t.call(this,e)||this;return i.project=r,i.index=0,i}return i.ZT(e,t),e.prototype._next=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this._innerSub(e)},e.prototype._innerSub=function(t){var e=this.innerSubscription;e&&e.unsubscribe();var r=new n.IY(this),i=this.destination;i.add(r),this.innerSubscription=(0,n.ft)(t,r),this.innerSubscription!==r&&i.add(this.innerSubscription)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=void 0},e.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t){this.destination.next(t)},e}(n.Ds);function fi(){return ci(fe.y)}function li(t,e){return e?ci((function(){return t}),e):ci((function(){return t}))}function di(t){return function(e){return e.lift(new pi(t))}}var pi=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var r=new bi(t),i=(0,n.ft)(this.notifier,new n.IY(r));return i&&!r.seenValue?(r.add(i),e.subscribe(r)):r},t}(),bi=function(t){function e(e){var r=t.call(this,e)||this;return r.seenValue=!1,r}return i.ZT(e,t),e.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(n.Ds);function gi(t,e){return void 0===e&&(e=!1),function(r){return r.lift(new mi(t,e))}}var mi=function(){function t(t,e){this.predicate=t,this.inclusive=e}return t.prototype.call=function(t,e){return e.subscribe(new vi(t,this.predicate,this.inclusive))},t}(),vi=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.predicate=r,n.inclusive=i,n.index=0,n}return i.ZT(e,t),e.prototype._next=function(t){var e,r=this.destination;try{e=this.predicate(t,this.index++)}catch(t){return void r.error(t)}this.nextOrComplete(t,e)},e.prototype.nextOrComplete=function(t,e){var r=this.destination;Boolean(e)?r.next(t):(this.inclusive&&r.next(t),r.complete())},e}(p.L),yi=r(4582),wi=r(7371);function _i(t,e,r){return function(i){return i.lift(new Ei(t,e,r))}}var Ei=function(){function t(t,e,r){this.nextOrObserver=t,this.error=e,this.complete=r}return t.prototype.call=function(t,e){return e.subscribe(new Si(t,this.nextOrObserver,this.error,this.complete))},t}(),Si=function(t){function e(e,r,i,n){var s=t.call(this,e)||this;return s._tapNext=yi.Z,s._tapError=yi.Z,s._tapComplete=yi.Z,s._tapError=i||yi.Z,s._tapComplete=n||yi.Z,(0,wi.m)(r)?(s._context=s,s._tapNext=r):r&&(s._context=r,s._tapNext=r.next||yi.Z,s._tapError=r.error||yi.Z,s._tapComplete=r.complete||yi.Z),s}return i.ZT(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(p.L),Ai={leading:!0,trailing:!1};function Oi(t,e){return void 0===e&&(e=Ai),function(r){return r.lift(new Ti(t,!!e.leading,!!e.trailing))}}var Ti=function(){function t(t,e,r){this.durationSelector=t,this.leading=e,this.trailing=r}return t.prototype.call=function(t,e){return e.subscribe(new xi(t,this.durationSelector,this.leading,this.trailing))},t}(),xi=function(t){function e(e,r,i,n){var s=t.call(this,e)||this;return s.destination=e,s.durationSelector=r,s._leading=i,s._trailing=n,s._hasValue=!1,s}return i.ZT(e,t),e.prototype._next=function(t){this._hasValue=!0,this._sendValue=t,this._throttled||(this._leading?this.send():this.throttle(t))},e.prototype.send=function(){var t=this._hasValue,e=this._sendValue;t&&(this.destination.next(e),this.throttle(e)),this._hasValue=!1,this._sendValue=void 0},e.prototype.throttle=function(t){var e=this.tryDurationSelector(t);e&&this.add(this._throttled=(0,n.ft)(e,new n.IY(this)))},e.prototype.tryDurationSelector=function(t){try{return this.durationSelector(t)}catch(t){return this.destination.error(t),null}},e.prototype.throttlingDone=function(){var t=this._throttled,e=this._trailing;t&&t.unsubscribe(),this._throttled=void 0,e&&this.send()},e.prototype.notifyNext=function(){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(n.Ds);function Pi(t,e,r){return void 0===e&&(e=c.P),void 0===r&&(r=Ai),function(i){return i.lift(new Ri(t,e,r.leading,r.trailing))}}var Ri=function(){function t(t,e,r,i){this.duration=t,this.scheduler=e,this.leading=r,this.trailing=i}return t.prototype.call=function(t,e){return e.subscribe(new Ii(t,this.duration,this.scheduler,this.leading,this.trailing))},t}(),Ii=function(t){function e(e,r,i,n,s){var o=t.call(this,e)||this;return o.duration=r,o.scheduler=i,o.leading=n,o.trailing=s,o._hasTrailingValue=!1,o._trailingValue=null,o}return i.ZT(e,t),e.prototype._next=function(t){this.throttled?this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Ni,this.duration,{subscriber:this})),this.leading?this.destination.next(t):this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var t=this.throttled;t&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),t.unsubscribe(),this.remove(t),this.throttled=null)},e}(p.L);function Ni(t){t.subscriber.clearThrottle()}var Mi=r(6542);function ki(t){return void 0===t&&(t=c.P),function(e){return(0,Mi.P)((function(){return e.pipe(Ie((function(e,r){var i=e.current;return{value:r,current:t.now(),last:i}}),{current:t.now(),value:void 0,last:void 0}),(0,Jt.U)((function(t){var e=t.current,r=t.last,i=t.value;return new Li(i,e-r)})))}))}}var Li=function(){return function(t,e){this.value=t,this.interval=e}}(),Ci=r(5915);function Bi(t,e,r){return void 0===r&&(r=c.P),function(i){var n=ut(t),s=n?+t-r.now():Math.abs(t);return i.lift(new Di(s,n,e,r))}}var Di=function(){function t(t,e,r,i){this.waitFor=t,this.absoluteTimeout=e,this.withObservable=r,this.scheduler=i}return t.prototype.call=function(t,e){return e.subscribe(new Ui(t,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),Ui=function(t){function e(e,r,i,n,s){var o=t.call(this,e)||this;return o.absoluteTimeout=r,o.waitFor=i,o.withObservable=n,o.scheduler=s,o.scheduleTimeout(),o}return i.ZT(e,t),e.dispatchTimeout=function(t){var e=t.withObservable;t._unsubscribeAndRecycle(),t.add((0,n.ft)(e,new n.IY(t)))},e.prototype.scheduleTimeout=function(){var t=this.action;t?this.action=t.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(e){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,e)},e.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},e}(n.Ds),ji=r(4236);function Ki(t,e){return void 0===e&&(e=c.P),Bi(t,(0,ji._)(new Ci.W),e)}function Vi(t){return void 0===t&&(t=c.P),(0,Jt.U)((function(e){return new Fi(e,t.now())}))}var Fi=function(){return function(t,e){this.value=t,this.timestamp=e}}();function Hi(t,e,r){return 0===r?[e]:(t.push(e),t)}function Gi(){return Le(Hi,[])}function $i(t){return function(e){return e.lift(new zi(t))}}var zi=function(){function t(t){this.windowBoundaries=t}return t.prototype.call=function(t,e){var r=new qi(t),i=e.subscribe(r);return i.closed||r.add((0,n.ft)(this.windowBoundaries,new n.IY(r))),i},t}(),qi=function(t){function e(e){var r=t.call(this,e)||this;return r.window=new nr.xQ,e.next(r.window),r}return i.ZT(e,t),e.prototype.notifyNext=function(){this.openWindow()},e.prototype.notifyError=function(t){this._error(t)},e.prototype.notifyComplete=function(){this._complete()},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var t=this.window;t&&t.complete();var e=this.destination,r=this.window=new nr.xQ;e.next(r)},e}(n.Ds);function Zi(t,e){return void 0===e&&(e=0),function(r){return r.lift(new Wi(t,e))}}var Wi=function(){function t(t,e){this.windowSize=t,this.startWindowEvery=e}return t.prototype.call=function(t,e){return e.subscribe(new Yi(t,this.windowSize,this.startWindowEvery))},t}(),Yi=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.destination=e,n.windowSize=r,n.startWindowEvery=i,n.windows=[new nr.xQ],n.count=0,e.next(n.windows[0]),n}return i.ZT(e,t),e.prototype._next=function(t){for(var e=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,r=this.destination,i=this.windowSize,n=this.windows,s=n.length,o=0;o<s&&!this.closed;o++)n[o].next(t);var a=this.count-i+1;if(a>=0&&a%e==0&&!this.closed&&n.shift().complete(),++this.count%e==0&&!this.closed){var c=new nr.xQ;n.push(c),r.next(c)}},e.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(p.L);function Ji(t){var e=c.P,r=null,i=Number.POSITIVE_INFINITY;return(0,y.K)(arguments[3])&&(e=arguments[3]),(0,y.K)(arguments[2])?e=arguments[2]:(0,ni.k)(arguments[2])&&(i=Number(arguments[2])),(0,y.K)(arguments[1])?e=arguments[1]:(0,ni.k)(arguments[1])&&(r=Number(arguments[1])),function(n){return n.lift(new Xi(t,r,i,e))}}var Xi=function(){function t(t,e,r,i){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=r,this.scheduler=i}return t.prototype.call=function(t,e){return e.subscribe(new tn(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),Qi=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._numberOfNextedValues=0,e}return i.ZT(e,t),e.prototype.next=function(e){this._numberOfNextedValues++,t.prototype.next.call(this,e)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(nr.xQ),tn=function(t){function e(e,r,i,n,s){var o=t.call(this,e)||this;o.destination=e,o.windowTimeSpan=r,o.windowCreationInterval=i,o.maxWindowSize=n,o.scheduler=s,o.windows=[];var a=o.openWindow();if(null!==i&&i>=0){var c={subscriber:o,window:a,context:null},u={windowTimeSpan:r,windowCreationInterval:i,subscriber:o,scheduler:s};o.add(s.schedule(nn,r,c)),o.add(s.schedule(rn,i,u))}else{var h={subscriber:o,window:a,windowTimeSpan:r};o.add(s.schedule(en,r,h))}return o}return i.ZT(e,t),e.prototype._next=function(t){for(var e=this.windows,r=e.length,i=0;i<r;i++){var n=e[i];n.closed||(n.next(t),n.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(n))}},e.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},e.prototype.openWindow=function(){var t=new Qi;return this.windows.push(t),this.destination.next(t),t},e.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},e}(p.L);function en(t){var e=t.subscriber,r=t.windowTimeSpan,i=t.window;i&&e.closeWindow(i),t.window=e.openWindow(),this.schedule(t,r)}function rn(t){var e=t.windowTimeSpan,r=t.subscriber,i=t.scheduler,n=t.windowCreationInterval,s=r.openWindow(),o=this,a={action:o,subscription:null},c={subscriber:r,window:s,context:a};a.subscription=i.schedule(nn,e,c),o.add(a.subscription),o.schedule(t,n)}function nn(t){var e=t.subscriber,r=t.window,i=t.context;i&&i.action&&i.subscription&&i.action.remove(i.subscription),e.closeWindow(r)}function sn(t,e){return function(r){return r.lift(new on(t,e))}}var on=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new an(t,this.openings,this.closingSelector))},t}(),an=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.openings=r,n.closingSelector=i,n.contexts=[],n.add(n.openSubscription=(0,P.D)(n,r,r)),n}return i.ZT(e,t),e.prototype._next=function(t){var e=this.contexts;if(e)for(var r=e.length,i=0;i<r;i++)e[i].window.next(t)},e.prototype._error=function(e){var r=this.contexts;if(this.contexts=null,r)for(var i=r.length,n=-1;++n<i;){var s=r[n];s.window.error(e),s.subscription.unsubscribe()}t.prototype._error.call(this,e)},e.prototype._complete=function(){var e=this.contexts;if(this.contexts=null,e)for(var r=e.length,i=-1;++i<r;){var n=e[i];n.window.complete(),n.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.contexts;if(this.contexts=null,t)for(var e=t.length,r=-1;++r<e;){var i=t[r];i.window.unsubscribe(),i.subscription.unsubscribe()}},e.prototype.notifyNext=function(t,e,r,i,n){if(t===this.openings){var s=void 0;try{s=(0,this.closingSelector)(e)}catch(t){return this.error(t)}var o=new nr.xQ,a=new x.w,c={window:o,subscription:a};this.contexts.push(c);var u=(0,P.D)(this,s,c);u.closed?this.closeWindow(this.contexts.length-1):(u.context=c,a.add(u)),this.destination.next(o)}else this.closeWindow(this.contexts.indexOf(t))},e.prototype.notifyError=function(t){this.error(t)},e.prototype.notifyComplete=function(t){t!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(t.context))},e.prototype.closeWindow=function(t){if(-1!==t){var e=this.contexts,r=e[t],i=r.window,n=r.subscription;e.splice(t,1),i.complete(),n.unsubscribe()}},e}(R.L);function cn(t){return function(e){return e.lift(new un(t))}}var un=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new hn(t,this.closingSelector))},t}(),hn=function(t){function e(e,r){var i=t.call(this,e)||this;return i.destination=e,i.closingSelector=r,i.openWindow(),i}return i.ZT(e,t),e.prototype.notifyNext=function(t,e,r,i,n){this.openWindow(n)},e.prototype.notifyError=function(t){this._error(t)},e.prototype.notifyComplete=function(t){this.openWindow(t)},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t),this.unsubscribeClosingNotification()},e.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},e.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},e.prototype.openWindow=function(t){void 0===t&&(t=null),t&&(this.remove(t),t.unsubscribe());var e=this.window;e&&e.complete();var r,i=this.window=new nr.xQ;this.destination.next(i);try{r=(0,this.closingSelector)()}catch(t){return this.destination.error(t),void this.window.error(t)}this.add(this.closingNotification=(0,P.D)(this,r))},e}(R.L);function fn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var r;"function"==typeof t[t.length-1]&&(r=t.pop());var i=t;return e.lift(new ln(i,r))}}var ln=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new dn(t,this.observables,this.project))},t}(),dn=function(t){function e(e,r,i){var n=t.call(this,e)||this;n.observables=r,n.project=i,n.toRespond=[];var s=r.length;n.values=new Array(s);for(var o=0;o<s;o++)n.toRespond.push(o);for(o=0;o<s;o++){var a=r[o];n.add((0,P.D)(n,a,void 0,o))}return n}return i.ZT(e,t),e.prototype.notifyNext=function(t,e,r){this.values[r]=e;var i=this.toRespond;if(i.length>0){var n=i.indexOf(r);-1!==n&&i.splice(n,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(R.L),pn=r(1131);function bn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(pn.$R.apply(void 0,[e].concat(t)))}}function gn(t){return function(e){return e.lift(new pn.mx(t))}}},2995:(t,e,r)=>{"use strict";r.d(e,{ZT:()=>n});var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},i(t,e)};function n(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}},7834:(t,e,r)=>{var i=r(8834),n=i.Buffer;function s(t,e){for(var r in t)e[r]=t[r]}function o(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(s(i,e),e.Buffer=o),o.prototype=Object.create(n.prototype),s(n,o),o.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},o.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},3327:(t,e,r)=>{var i=r(7834).Buffer;function n(t,e){this._block=i.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}n.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=i.from(t,e));for(var r=this._block,n=this._blockSize,s=t.length,o=this._len,a=0;a<s;){for(var c=o%n,u=Math.min(s-a,n-c),h=0;h<u;h++)r[c+h]=t[a+h];a+=u,(o+=u)%n==0&&this._update(r)}return this._len+=s,this},n.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n},9065:(t,e,r)=>{var i=t.exports=function(t){t=t.toLowerCase();var e=i[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};i.sha=r(8820),i.sha1=r(7885),i.sha224=r(8321),i.sha256=r(4424),i.sha384=r(213),i.sha512=r(5596)},8820:(t,e,r)=>{var i=r(1285),n=r(3327),s=r(7834).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,n.call(this,64,56)}function u(t){return t<<30|t>>>2}function h(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(c,n),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,s=0|this._c,a=0|this._d,c=0|this._e,f=0;f<16;++f)r[f]=t.readInt32BE(4*f);for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16];for(var l=0;l<80;++l){var d=~~(l/20),p=0|((e=i)<<5|e>>>27)+h(d,n,s,a)+c+r[l]+o[d];c=a,a=s,s=u(n),n=i,i=p}this._a=i+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var t=s.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=c},7885:(t,e,r)=>{var i=r(1285),n=r(3327),s=r(7834).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,n.call(this,64,56)}function u(t){return t<<5|t>>>27}function h(t){return t<<30|t>>>2}function f(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}i(c,n),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,s=0|this._c,a=0|this._d,c=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=(e=r[l-3]^r[l-8]^r[l-14]^r[l-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),b=u(i)+f(p,n,s,a)+c+r[d]+o[p]|0;c=a,a=s,s=h(n),n=i,i=b}this._a=i+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var t=s.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=c},8321:(t,e,r)=>{var i=r(1285),n=r(4424),s=r(3327),o=r(7834).Buffer,a=new Array(64);function c(){this.init(),this._w=a,s.call(this,64,56)}i(c,n),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var t=o.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=c},4424:(t,e,r)=>{var i=r(1285),n=r(3327),s=r(7834).Buffer,o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function c(){this.init(),this._w=a,n.call(this,64,56)}function u(t,e,r){return r^t&(e^r)}function h(t,e,r){return t&e|r&(t|e)}function f(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function l(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}i(c,n),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,s=0|this._c,a=0|this._d,c=0|this._e,p=0|this._f,b=0|this._g,g=0|this._h,m=0;m<16;++m)r[m]=t.readInt32BE(4*m);for(;m<64;++m)r[m]=0|(((e=r[m-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[m-7]+d(r[m-15])+r[m-16];for(var v=0;v<64;++v){var y=g+l(c)+u(c,p,b)+o[v]+r[v]|0,w=f(i)+h(i,n,s)|0;g=b,b=p,p=c,c=a+y|0,a=s,s=n,n=i,i=y+w|0}this._a=i+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=g+this._h|0},c.prototype._hash=function(){var t=s.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=c},213:(t,e,r)=>{var i=r(1285),n=r(5596),s=r(3327),o=r(7834).Buffer,a=new Array(160);function c(){this.init(),this._w=a,s.call(this,128,112)}i(c,n),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var t=o.allocUnsafe(48);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=c},5596:(t,e,r)=>{var i=r(1285),n=r(3327),s=r(7834).Buffer,o=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function c(){this.init(),this._w=a,n.call(this,128,112)}function u(t,e,r){return r^t&(e^r)}function h(t,e,r){return t&e|r&(t|e)}function f(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function l(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function b(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function m(t,e){return t>>>0<e>>>0?1:0}i(c,n),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(t){for(var e=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,s=0|this._dh,a=0|this._eh,c=0|this._fh,v=0|this._gh,y=0|this._hh,w=0|this._al,_=0|this._bl,E=0|this._cl,S=0|this._dl,A=0|this._el,O=0|this._fl,T=0|this._gl,x=0|this._hl,P=0;P<32;P+=2)e[P]=t.readInt32BE(4*P),e[P+1]=t.readInt32BE(4*P+4);for(;P<160;P+=2){var R=e[P-30],I=e[P-30+1],N=d(R,I),M=p(I,R),k=b(R=e[P-4],I=e[P-4+1]),L=g(I,R),C=e[P-14],B=e[P-14+1],D=e[P-32],U=e[P-32+1],j=M+B|0,K=N+C+m(j,M)|0;K=(K=K+k+m(j=j+L|0,L)|0)+D+m(j=j+U|0,U)|0,e[P]=K,e[P+1]=j}for(var V=0;V<160;V+=2){K=e[V],j=e[V+1];var F=h(r,i,n),H=h(w,_,E),G=f(r,w),$=f(w,r),z=l(a,A),q=l(A,a),Z=o[V],W=o[V+1],Y=u(a,c,v),J=u(A,O,T),X=x+q|0,Q=y+z+m(X,x)|0;Q=(Q=(Q=Q+Y+m(X=X+J|0,J)|0)+Z+m(X=X+W|0,W)|0)+K+m(X=X+j|0,j)|0;var tt=$+H|0,et=G+F+m(tt,$)|0;y=v,x=T,v=c,T=O,c=a,O=A,a=s+Q+m(A=S+X|0,S)|0,s=n,S=E,n=i,E=_,i=r,_=w,r=Q+et+m(w=X+tt|0,X)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+E|0,this._dl=this._dl+S|0,this._el=this._el+A|0,this._fl=this._fl+O|0,this._gl=this._gl+T|0,this._hl=this._hl+x|0,this._ah=this._ah+r+m(this._al,w)|0,this._bh=this._bh+i+m(this._bl,_)|0,this._ch=this._ch+n+m(this._cl,E)|0,this._dh=this._dh+s+m(this._dl,S)|0,this._eh=this._eh+a+m(this._el,A)|0,this._fh=this._fh+c+m(this._fl,O)|0,this._gh=this._gh+v+m(this._gl,T)|0,this._hh=this._hh+y+m(this._hl,x)|0},c.prototype._hash=function(){var t=s.allocUnsafe(64);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=c},4851:(t,e,r)=>{t.exports=n;var i=r(2699).EventEmitter;function n(){i.call(this)}r(1285)(n,i),n.Readable=r(8051),n.Writable=r(2557),n.Duplex=r(7073),n.Transform=r(7640),n.PassThrough=r(5163),n.finished=r(9885),n.pipeline=r(3495),n.Stream=n,n.prototype.pipe=function(t,e){var r=this;function n(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function s(){r.readable&&r.resume&&r.resume()}r.on("data",n),t.on("drain",s),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",c));var o=!1;function a(){o||(o=!0,t.end())}function c(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(h(),0===i.listenerCount(this,"error"))throw t}function h(){r.removeListener("data",n),t.removeListener("drain",s),r.removeListener("end",a),r.removeListener("close",c),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",h),r.removeListener("close",h),t.removeListener("close",h)}return r.on("error",u),t.on("error",u),r.on("end",h),r.on("close",h),t.on("close",h),t.emit("pipe",r),t}},214:(t,e,r)=>{"use strict";var i=r(7834).Buffer,n=i.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===n||!n(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=c,this.end=u,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=h,this.end=f,e=3;break;default:return this.write=l,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function c(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function h(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.s=s,s.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},s.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},s.prototype.text=function(t,e){var r=function(t,e,r){var i=e.length-1;if(i<r)return 0;var n=o(e[i]);if(n>=0)return n>0&&(t.lastNeed=n-1),n;if(--i<r||-2===n)return 0;if((n=o(e[i]))>=0)return n>0&&(t.lastNeed=n-2),n;if(--i<r||-2===n)return 0;if((n=o(e[i]))>=0)return n>0&&(2===n?n=0:t.lastNeed=n-3),n;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},s.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},8743:t=>{t.exports=function(t){return ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength):Buffer.from(t)}},5803:(t,e,r)=>{function i(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(i("noDeprecation"))return t;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(e);i("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},5543:(t,e,r)=>{"use strict";r.r(e),r.d(e,{HttpBackend:()=>l,HttpRequestFailed:()=>f,HttpResponseError:()=>h,STATUS_CODE:()=>i,VERSION:()=>a});var i,n=r(1825),s=r.n(n);function o(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))}!function(t){t[t.CONTINUE=100]="CONTINUE",t[t.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",t[t.PROCESSING=102]="PROCESSING",t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.RESET_CONTENT=205]="RESET_CONTENT",t[t.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",t[t.MULTI_STATUS=207]="MULTI_STATUS",t[t.ALREADY_REPORTED=208]="ALREADY_REPORTED",t[t.IM_USED=226]="IM_USED",t[t.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.FOUND=302]="FOUND",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.USE_PROXY=305]="USE_PROXY",t[t.SWITCH_PROXY=306]="SWITCH_PROXY",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",t[t.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",t[t.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",t[t.CONFLICT=409]="CONFLICT",t[t.GONE=410]="GONE",t[t.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",t[t.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",t[t.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",t[t.URI_TOO_LONG=414]="URI_TOO_LONG",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",t[t.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",t[t.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",t[t.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",t[t.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",t[t.LOCKED=423]="LOCKED",t[t.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",t[t.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",t[t.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",t[t.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t[t.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",t[t.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",t[t.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",t[t.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",t[t.LOOP_DETECTED=508]="LOOP_DETECTED",t[t.NOT_EXTENDED=510]="NOT_EXTENDED",t[t.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"}(i||(i={}));const a={commitHash:"22fd810dcadf5272cb7a57d65165caa0eddbc57e",version:"14.2.0"},c="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node?void 0:r.e(462).then(r.bind(r,9462)).then((t=>t.default)).catch((()=>{}));var u;!function(t){t.TEXT="text",t.JSON="json"}(u||(u={}));class h extends Error{constructor(t,e,r,i,n){super(t),this.message=t,this.status=e,this.statusText=r,this.body=i,this.url=n,this.name="HttpResponse"}}class f extends Error{constructor(t){super(t),this.message=t,this.name="HttpRequestFailed"}}class l{constructor(t=3e4){this.timeout=t}serialize(t){if(!t)return"";const e=[];for(const r in t)if(t.hasOwnProperty(r)&&void 0!==t[r]){const i="function"==typeof t[r].toJSON?t[r].toJSON():t[r];if(null===i){e.push(encodeURIComponent(r));continue}if(Array.isArray(i)){i.forEach((t=>{e.push(encodeURIComponent(r)+"="+encodeURIComponent(t))}));continue}e.push(encodeURIComponent(r)+"="+encodeURIComponent(i))}const r=e.join("&");return r?`?${r}`:""}createRequest({url:t,method:e,timeout:r=this.timeout,query:i,headers:n={},json:a=!0},l){return o(this,void 0,void 0,(function*(){let o,d;n["Content-Type"]||(n["Content-Type"]="application/json"),a?o=u.JSON:(o=u.TEXT,d=[t=>t]);try{const a=c&&(yield c);return(yield s().request({url:t+this.serialize(i),method:null!=e?e:"GET",headers:n,responseType:o,transformResponse:d,timeout:r,data:l,adapter:a})).data}catch(r){if(s().isAxiosError(r)&&r.response){let e;throw e="object"==typeof r.response.data?JSON.stringify(r.response.data):r.response.data,new h(`Http error response: (${r.response.status}) ${e}`,r.response.status,r.response.statusText,e,t+this.serialize(i))}throw new f(`${e} ${t+this.serialize(i)} ${String(r)}`)}}))}}},1825:(t,e,r)=>{t.exports=r(6244)},3557:(t,e,r)=>{"use strict";var i=r(7751),n=r(4084),s=r(922),o=r(3514),a=r(9702),c=r(4929),u=r(1105),h=r(9013),f=r(8715),l=r(4310);t.exports=function(t){return new Promise((function(e,r){var d,p=t.data,b=t.headers,g=t.responseType;function m(){t.cancelToken&&t.cancelToken.unsubscribe(d),t.signal&&t.signal.removeEventListener("abort",d)}i.isFormData(p)&&delete b["Content-Type"];var v=new XMLHttpRequest;if(t.auth){var y=t.auth.username||"",w=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";b.Authorization="Basic "+btoa(y+":"+w)}var _=a(t.baseURL,t.url);function E(){if(v){var i="getAllResponseHeaders"in v?c(v.getAllResponseHeaders()):null,s={data:g&&"text"!==g&&"json"!==g?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:i,config:t,request:v};n((function(t){e(t),m()}),(function(t){r(t),m()}),s),v=null}}if(v.open(t.method.toUpperCase(),o(_,t.params,t.paramsSerializer),!0),v.timeout=t.timeout,"onloadend"in v?v.onloadend=E:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(E)},v.onabort=function(){v&&(r(h("Request aborted",t,"ECONNABORTED",v)),v=null)},v.onerror=function(){r(h("Network Error",t,null,v)),v=null},v.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",i=t.transitional||f;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(h(e,t,i.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",v)),v=null},i.isStandardBrowserEnv()){var S=(t.withCredentials||u(_))&&t.xsrfCookieName?s.read(t.xsrfCookieName):void 0;S&&(b[t.xsrfHeaderName]=S)}"setRequestHeader"in v&&i.forEach(b,(function(t,e){void 0===p&&"content-type"===e.toLowerCase()?delete b[e]:v.setRequestHeader(e,t)})),i.isUndefined(t.withCredentials)||(v.withCredentials=!!t.withCredentials),g&&"json"!==g&&(v.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&v.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(d=function(t){v&&(r(!t||t&&t.type?new l("canceled"):t),v.abort(),v=null)},t.cancelToken&&t.cancelToken.subscribe(d),t.signal&&(t.signal.aborted?d():t.signal.addEventListener("abort",d))),p||(p=null),v.send(p)}))}},6244:(t,e,r)=>{"use strict";var i=r(7751),n=r(3958),s=r(3439),o=r(8301);var a=function t(e){var r=new s(e),a=n(s.prototype.request,r);return i.extend(a,s.prototype,r),i.extend(a,r),a.create=function(r){return t(o(e,r))},a}(r(6973));a.Axios=s,a.Cancel=r(4310),a.CancelToken=r(3219),a.isCancel=r(785),a.VERSION=r(7002).version,a.all=function(t){return Promise.all(t)},a.spread=r(7079),a.isAxiosError=r(834),t.exports=a,t.exports.default=a},4310:t=>{"use strict";function e(t){this.message=t}e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},e.prototype.__CANCEL__=!0,t.exports=e},3219:(t,e,r)=>{"use strict";var i=r(4310);function n(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,i=r._listeners.length;for(e=0;e<i;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,i=new Promise((function(t){r.subscribe(t),e=t})).then(t);return i.cancel=function(){r.unsubscribe(e)},i},t((function(t){r.reason||(r.reason=new i(t),e(r.reason))}))}n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},n.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},n.source=function(){var t;return{token:new n((function(e){t=e})),cancel:t}},t.exports=n},785:t=>{"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},3439:(t,e,r)=>{"use strict";var i=r(7751),n=r(3514),s=r(272),o=r(8507),a=r(8301),c=r(9203),u=c.validators;function h(t){this.defaults=t,this.interceptors={request:new s,response:new s}}h.prototype.request=function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var r=e.transitional;void 0!==r&&c.assertOptions(r,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var i=[],n=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,i.unshift(t.fulfilled,t.rejected))}));var s,h=[];if(this.interceptors.response.forEach((function(t){h.push(t.fulfilled,t.rejected)})),!n){var f=[o,void 0];for(Array.prototype.unshift.apply(f,i),f=f.concat(h),s=Promise.resolve(e);f.length;)s=s.then(f.shift(),f.shift());return s}for(var l=e;i.length;){var d=i.shift(),p=i.shift();try{l=d(l)}catch(t){p(t);break}}try{s=o(l)}catch(t){return Promise.reject(t)}for(;h.length;)s=s.then(h.shift(),h.shift());return s},h.prototype.getUri=function(t){return t=a(this.defaults,t),n(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},i.forEach(["delete","get","head","options"],(function(t){h.prototype[t]=function(e,r){return this.request(a(r||{},{method:t,url:e,data:(r||{}).data}))}})),i.forEach(["post","put","patch"],(function(t){h.prototype[t]=function(e,r,i){return this.request(a(i||{},{method:t,url:e,data:r}))}})),t.exports=h},272:(t,e,r)=>{"use strict";var i=r(7751);function n(){this.handlers=[]}n.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},n.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},n.prototype.forEach=function(t){i.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=n},9702:(t,e,r)=>{"use strict";var i=r(6481),n=r(4647);t.exports=function(t,e){return t&&!i(e)?n(t,e):e}},9013:(t,e,r)=>{"use strict";var i=r(24);t.exports=function(t,e,r,n,s){var o=new Error(t);return i(o,e,r,n,s)}},8507:(t,e,r)=>{"use strict";var i=r(7751),n=r(9217),s=r(785),o=r(6973),a=r(4310);function c(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new a("canceled")}t.exports=function(t){return c(t),t.headers=t.headers||{},t.data=n.call(t,t.data,t.headers,t.transformRequest),t.headers=i.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),i.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||o.adapter)(t).then((function(e){return c(t),e.data=n.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return s(e)||(c(t),e&&e.response&&(e.response.data=n.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},24:t=>{"use strict";t.exports=function(t,e,r,i,n){return t.config=e,r&&(t.code=r),t.request=i,t.response=n,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t}},8301:(t,e,r)=>{"use strict";var i=r(7751);t.exports=function(t,e){e=e||{};var r={};function n(t,e){return i.isPlainObject(t)&&i.isPlainObject(e)?i.merge(t,e):i.isPlainObject(e)?i.merge({},e):i.isArray(e)?e.slice():e}function s(r){return i.isUndefined(e[r])?i.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function o(t){if(!i.isUndefined(e[t]))return n(void 0,e[t])}function a(r){return i.isUndefined(e[r])?i.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function c(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c};return i.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||s,n=e(t);i.isUndefined(n)&&e!==c||(r[t]=n)})),r}},4084:(t,e,r)=>{"use strict";var i=r(9013);t.exports=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(i("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)}},9217:(t,e,r)=>{"use strict";var i=r(7751),n=r(6973);t.exports=function(t,e,r){var s=this||n;return i.forEach(r,(function(r){t=r.call(s,t,e)})),t}},6973:(t,e,r)=>{"use strict";var i=r(7751),n=r(5453),s=r(24),o=r(8715),a={"Content-Type":"application/x-www-form-urlencoded"};function c(t,e){!i.isUndefined(t)&&i.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var u,h={transitional:o,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(u=r(3557)),u),transformRequest:[function(t,e){return n(e,"Accept"),n(e,"Content-Type"),i.isFormData(t)||i.isArrayBuffer(t)||i.isBuffer(t)||i.isStream(t)||i.isFile(t)||i.isBlob(t)?t:i.isArrayBufferView(t)?t.buffer:i.isURLSearchParams(t)?(c(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):i.isObject(t)||e&&"application/json"===e["Content-Type"]?(c(e,"application/json"),function(t,e,r){if(i.isString(t))try{return(e||JSON.parse)(t),i.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||h.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,o=!r&&"json"===this.responseType;if(o||n&&i.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(o){if("SyntaxError"===t.name)throw s(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};i.forEach(["delete","get","head"],(function(t){h.headers[t]={}})),i.forEach(["post","put","patch"],(function(t){h.headers[t]=i.merge(a)})),t.exports=h},8715:t=>{"use strict";t.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},7002:t=>{t.exports={version:"0.26.1"}},3958:t=>{"use strict";t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),i=0;i<r.length;i++)r[i]=arguments[i];return t.apply(e,r)}}},3514:(t,e,r)=>{"use strict";var i=r(7751);function n(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,r){if(!e)return t;var s;if(r)s=r(e);else if(i.isURLSearchParams(e))s=e.toString();else{var o=[];i.forEach(e,(function(t,e){null!=t&&(i.isArray(t)?e+="[]":t=[t],i.forEach(t,(function(t){i.isDate(t)?t=t.toISOString():i.isObject(t)&&(t=JSON.stringify(t)),o.push(n(e)+"="+n(t))})))})),s=o.join("&")}if(s){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}},4647:t=>{"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},922:(t,e,r)=>{"use strict";var i=r(7751);t.exports=i.isStandardBrowserEnv()?{write:function(t,e,r,n,s,o){var a=[];a.push(t+"="+encodeURIComponent(e)),i.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),i.isString(n)&&a.push("path="+n),i.isString(s)&&a.push("domain="+s),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},6481:t=>{"use strict";t.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}},834:(t,e,r)=>{"use strict";var i=r(7751);t.exports=function(t){return i.isObject(t)&&!0===t.isAxiosError}},1105:(t,e,r)=>{"use strict";var i=r(7751);t.exports=i.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var i=t;return e&&(r.setAttribute("href",i),i=r.href),r.setAttribute("href",i),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=n(window.location.href),function(e){var r=i.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}},5453:(t,e,r)=>{"use strict";var i=r(7751);t.exports=function(t,e){i.forEach(t,(function(r,i){i!==e&&i.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[i])}))}},4929:(t,e,r)=>{"use strict";var i=r(7751),n=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,r,s,o={};return t?(i.forEach(t.split("\n"),(function(t){if(s=t.indexOf(":"),e=i.trim(t.substr(0,s)).toLowerCase(),r=i.trim(t.substr(s+1)),e){if(o[e]&&n.indexOf(e)>=0)return;o[e]="set-cookie"===e?(o[e]?o[e]:[]).concat([r]):o[e]?o[e]+", "+r:r}})),o):o}},7079:t=>{"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},9203:(t,e,r)=>{"use strict";var i=r(7002).version,n={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){n[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var s={};n.transitional=function(t,e,r){function n(t,e){return"[Axios v"+i+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,i,o){if(!1===t)throw new Error(n(i," has been removed"+(e?" in "+e:"")));return e&&!s[i]&&(s[i]=!0,console.warn(n(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,i,o)}},t.exports={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var i=Object.keys(t),n=i.length;n-- >0;){var s=i[n],o=e[s];if(o){var a=t[s],c=void 0===a||o(a,s,t);if(!0!==c)throw new TypeError("option "+s+" must be "+c)}else if(!0!==r)throw Error("Unknown option "+s)}},validators:n}},7751:(t,e,r)=>{"use strict";var i=r(3958),n=Object.prototype.toString;function s(t){return Array.isArray(t)}function o(t){return void 0===t}function a(t){return"[object ArrayBuffer]"===n.call(t)}function c(t){return null!==t&&"object"==typeof t}function u(t){if("[object Object]"!==n.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function h(t){return"[object Function]"===n.call(t)}function f(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),s(t))for(var r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.call(null,t[n],n,t)}t.exports={isArray:s,isArrayBuffer:a,isBuffer:function(t){return null!==t&&!o(t)&&null!==t.constructor&&!o(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"[object FormData]"===n.call(t)},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&a(t.buffer)},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:c,isPlainObject:u,isUndefined:o,isDate:function(t){return"[object Date]"===n.call(t)},isFile:function(t){return"[object File]"===n.call(t)},isBlob:function(t){return"[object Blob]"===n.call(t)},isFunction:h,isStream:function(t){return c(t)&&h(t.pipe)},isURLSearchParams:function(t){return"[object URLSearchParams]"===n.call(t)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:f,merge:function t(){var e={};function r(r,i){u(e[i])&&u(r)?e[i]=t(e[i],r):u(r)?e[i]=t({},r):s(r)?e[i]=r.slice():e[i]=r}for(var i=0,n=arguments.length;i<n;i++)f(arguments[i],r);return e},extend:function(t,e,r){return f(e,(function(e,n){t[n]=r&&"function"==typeof e?i(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}}},5078:(t,e,r)=>{"use strict";r.r(e),r.d(e,{CODEC:()=>a,LocalForger:()=>Pt,ProtocolsHash:()=>At,Uint8ArrayConsumer:()=>A,VERSION:()=>Ot,decoders:()=>wt,encoders:()=>_t,getCodec:()=>xt,localForger:()=>Rt,opMapping:()=>c,opMappingReverse:()=>u});var i=r(4632),n=r(2558);const s=t=>t.reduce(((t,e)=>t+e.toString(16).padStart(2,"0")),""),o=(t,e=8)=>t.toString(16).padStart(e,"0");var a;!function(t){t.SECRET="secret",t.RAW="raw",t.TZ1="tz1",t.BRANCH="branch",t.ZARITH="zarith",t.PUBLIC_KEY="public_key",t.PKH="pkh",t.DELEGATE="delegate",t.SCRIPT="script",t.BALLOT_STATEMENT="ballotStmt",t.PROPOSAL="proposal",t.PROPOSAL_ARR="proposalArr",t.INT32="int32",t.INT16="int16",t.PARAMETERS="parameters",t.ADDRESS="address",t.SMART_CONTRACT_ADDRESS="smart_contract_address",t.VALUE="value",t.MANAGER="manager",t.BLOCK_PAYLOAD_HASH="blockPayloadHash",t.ENTRYPOINT="entrypoint",t.OPERATION="operation",t.OP_ACTIVATE_ACCOUNT="activate_account",t.OP_DELEGATION="delegation",t.OP_TRANSACTION="transaction",t.OP_ORIGINATION="origination",t.OP_BALLOT="ballot",t.OP_ENDORSEMENT="endorsement",t.OP_SEED_NONCE_REVELATION="seed_nonce_revelation",t.OP_REVEAL="reveal",t.OP_PROPOSALS="proposals",t.OP_REGISTER_GLOBAL_CONSTANT="register_global_constant",t.OP_TRANSFER_TICKET="transfer_ticket",t.OP_TX_ROLLUP_ORIGINATION="tx_rollup_origination",t.OP_TX_ROLLUP_SUBMIT_BATCH="tx_rollup_submit_batch",t.BURN_LIMIT="burn_limit",t.TX_ROLLUP_ORIGINATION_PARAM="tx_rollup_origination_param",t.TX_ROLLUP_ID="tx_rollup_id",t.TX_ROLLUP_BATCH_CONTENT="tx_rollup_batch_content",t.OP_INCREASE_PAID_STORAGE="increase_paid_storage"}(a||(a={}));const c={"00":"parameter","01":"storage","02":"code","03":"False","04":"Elt","05":"Left","06":"None","07":"Pair","08":"Right","09":"Some","0a":"True","0b":"Unit","0c":"PACK","0d":"UNPACK","0e":"BLAKE2B","0f":"SHA256",10:"SHA512",11:"ABS",12:"ADD",13:"AMOUNT",14:"AND",15:"BALANCE",16:"CAR",17:"CDR",18:"CHECK_SIGNATURE",19:"COMPARE","1a":"CONCAT","1b":"CONS","1c":"CREATE_ACCOUNT","1d":"CREATE_CONTRACT","1e":"IMPLICIT_ACCOUNT","1f":"DIP",20:"DROP",21:"DUP",22:"EDIV",23:"EMPTY_MAP",24:"EMPTY_SET",25:"EQ",26:"EXEC",27:"FAILWITH",28:"GE",29:"GET","2a":"GT","2b":"HASH_KEY","2c":"IF","2d":"IF_CONS","2e":"IF_LEFT","2f":"IF_NONE",30:"INT",31:"LAMBDA",32:"LE",33:"LEFT",34:"LOOP",35:"LSL",36:"LSR",37:"LT",38:"MAP",39:"MEM","3a":"MUL","3b":"NEG","3c":"NEQ","3d":"NIL","3e":"NONE","3f":"NOT",40:"NOW",41:"OR",42:"PAIR",43:"PUSH",44:"RIGHT",45:"SIZE",46:"SOME",47:"SOURCE",48:"SENDER",49:"SELF","4a":"STEPS_TO_QUOTA","4b":"SUB","4c":"SWAP","4d":"TRANSFER_TOKENS","4e":"SET_DELEGATE","4f":"UNIT",50:"UPDATE",51:"XOR",52:"ITER",53:"LOOP_LEFT",54:"ADDRESS",55:"CONTRACT",56:"ISNAT",57:"CAST",58:"RENAME",59:"bool","5a":"contract","5b":"int","5c":"key","5d":"key_hash","5e":"lambda","5f":"list",60:"map",61:"big_map",62:"nat",63:"option",64:"or",65:"pair",66:"set",67:"signature",68:"string",69:"bytes","6a":"mutez","6b":"timestamp","6c":"unit","6d":"operation","6e":"address","6f":"SLICE",70:"DIG",71:"DUG",72:"EMPTY_BIG_MAP",73:"APPLY",74:"chain_id",75:"CHAIN_ID",76:"LEVEL",77:"SELF_ADDRESS",78:"never",79:"NEVER","7a":"UNPAIR","7b":"VOTING_POWER","7c":"TOTAL_VOTING_POWER","7d":"KECCAK","7e":"SHA3","7f":"PAIRING_CHECK",80:"bls12_381_g1",81:"bls12_381_g2",82:"bls12_381_fr",83:"sapling_state",84:"sapling_transaction_deprecated",85:"SAPLING_EMPTY_STATE",86:"SAPLING_VERIFY_UPDATE",87:"ticket",88:"TICKET",89:"READ_TICKET","8a":"SPLIT_TICKET","8b":"JOIN_TICKETS","8c":"GET_AND_UPDATE","8d":"chest","8e":"chest_key","8f":"OPEN_CHEST",90:"VIEW",91:"view",92:"constant",93:"SUB_MUTEZ",94:"tx_rollup_l2_address",95:"MIN_BLOCK_TIME",96:"sapling_transaction",97:"EMIT"},u=(()=>{const t={};return Object.keys(c).forEach((e=>{t[c[e]]=e})),t})(),h={4:"activate_account",107:"reveal",110:"delegation",108:"transaction",109:"origination",6:"ballot",21:"endorsement",1:"seed_nonce_revelation",5:"proposals",111:"register_global_constant",150:"tx_rollup_origination",151:"tx_rollup_submit_batch",158:"transfer_ticket",113:"increase_paid_storage"},f=(()=>{const t={};return Object.keys(h).forEach((e=>{const r="string"==typeof e?parseInt(e,10):e;t[h[r]]=o(r,2)})),t})(),l={"00":"default","01":"root","02":"do","03":"set_delegate","04":"remove_delegate"},d=(()=>{const t={};return Object.keys(l).forEach((e=>{t[l[e]]=e})),t})();class p extends Error{constructor(t){super(t),this.message=t,this.name="InvalidBlockHashError"}}class b extends Error{constructor(t){super(t),this.message=t,this.name="InvalidOperationSchemaError"}}class g extends Error{constructor(t){super(`Oversized entrypoint: ${t}. The maximum length of entrypoint is 31`),this.entrypoint=t,this.name="OversizedEntryPointError"}}class m extends Error{constructor(t){super(`The ballot value '${t}' is invalid`),this.ballotValue=t,this.name="InvalidBallotValueError"}}class v extends Error{constructor(t){super(`Failed to decode ballot value ${t}`),this.ballotValue=t,this.name="DecodeBallotValueError"}}class y extends Error{constructor(t){super(`The hex string '${t}' is invalid`),this.hexString=t,this.name="InvalidHexStringError"}}class w extends Error{constructor(t){super(`Failed to encode michelson value '${t}'`),this.value=t,this.name="UnexpectedMichelsonValueError"}}class _ extends Error{constructor(t){super(t),this.message=t,this.name="OperationDecodingError"}}class E extends Error{constructor(t){super(t),this.message=t,this.name="OperationEncodingError"}}class S extends Error{constructor(t){super(`The operation '${t}' is unsupported`),this.op=t,this.name="UnsupportedOperationError"}}class A{constructor(t,e=0){this.arr=t,this.offset=e}static fromHexString(t){const e=t.toLowerCase();if(/^(([a-f]|\d){2})*$/.test(e)){const t=new Uint8Array((e.match(/([a-z]|\d){2}/g)||[]).map((t=>parseInt(t,16))));return new A(t)}throw new y(e)}consume(t){const e=this.arr.subarray(this.offset,this.offset+t);return this.offset+=t,e}get(t){return this.arr[this.offset+t]}length(){return this.arr.length-this.offset}}const O=t=>{if(Array.isArray(t)){const e=t.map((t=>O(t))).join(""),r=e.length/2;return`02${o(r)}${e}`}if((t=>"prim"in t)(t))return L(t);if((t=>"bytes"in t&&"string"==typeof t.bytes)(t))return P(t);if((t=>"string"in t&&"string"==typeof t.string)(t))return I(t);if((t=>"int"in t&&"string"==typeof t.int)(t))return M(t);throw new w(JSON.stringify(t))},T=t=>{const e=t.consume(1);switch(e[0]){case 10:return R(t);case 1:return N(t);case 0:return k(t);case 2:{const e=new A(x(t)),r=[];for(;e.length()>0;)r.push(T(e));return r}default:return C(t,e)}},x=(t,e=4)=>{const r=t.consume(e),i=parseInt(Buffer.from(r).toString("hex"),16);return t.consume(i)},P=t=>{if(!/^([A-Fa-f0-9]{2})*$/.test(t.bytes))throw new y(t.bytes);const e=t.bytes.length/2;return`0a${o(e)}${t.bytes}`},R=t=>{const e=x(t);return{bytes:Buffer.from(e).toString("hex")}},I=t=>{const e=Buffer.from(t.string,"utf8").toString("hex"),r=e.length/2;return`01${o(r)}${e}`},N=t=>{const e=x(t);return{string:Buffer.from(e).toString("utf8")}},M=({int:t})=>{const e=new n.O(t,10),r="-"===e.toString(2)[0]?"1":"0",i=e.toString(2).replace(/-/g,""),s=i.length<=6?6:(i.length-6)%7?i.length+7-(i.length-6)%7:i.length,o=i.padStart(s,"0").match(/\d{6,7}/g).reverse();o[0]=r+o[0];return`00${o.map(((t,e)=>parseInt((e===o.length-1?"0":"1")+t,2).toString(16).padStart(2,"0"))).join("")}`},k=t=>{let e=t.consume(1)[0];const r=[];for(;128&e;)r.push(e),e=t.consume(1)[0];r.push(e);const i=!!(64&r[0]);r[0]=127&r[0];const s=r.map(((t,e)=>t.toString(2).slice(0===e?-6:-7).padStart(0===e?6:7,"0"))).reverse();let o=new n.O(s.join(""),2);return i&&(o=o.times(-1)),{int:o.toFixed()}},L=t=>{const e=+Array.isArray(t.annots),r=Array.isArray(t.args)?t.args.length:0,i=o(Math.min(2*r+e+3,9),2),n=u[t.prim];let s=(t.args||[]).map((t=>O(t))).join("");const a=Array.isArray(t.annots)?U(t.annots):"";return"LAMBDA"===t.prim&&r&&(s=o(s.length/2)+s+o(0)),("pair"===t.prim||"Pair"===t.prim)&&r>2&&(s=""===a?o(s.length/2)+s+o(0):o(s.length/2)+s),"view"===t.prim&&t.args&&(s=o(s.length/2)+s+o(0)),`${i}${n}${s}${a}`},C=(t,e)=>{const r=(e[0]-3)%2==1;let i=Math.floor((e[0]-3)/2);const n=t.consume(1)[0].toString(16).padStart(2,"0"),s={prim:c[n]};if("LAMBDA"===c[n]&&t.consume(4),"view"===c[n])return 0!=i?B(t,s):s;let o,a;("pair"===c[n]||"Pair"===c[n])&&i>2&&(o=D(t),i=0,a=j(t));const u=new Array(i).fill(0).map((()=>T(t)));return"LAMBDA"===c[n]&&t.consume(4),o?s.args=o:u.length&&(s.args=u),a&&""!==a[0]?s.annots=a:r&&(s.annots=j(t)),s},B=(t,e)=>(t.consume(4),e.args=new Array(4).fill(0).map((()=>T(t))),t.consume(4),e),D=t=>{const e=new A(x(t)),r=[];for(;e.length()>0;)r.push(T(e));return r},U=t=>{const e=t.map((t=>Buffer.from(t,"utf8").toString("hex"))).join("20"),r=e.length/2;return`${o(r)}${e}`},j=t=>{const e=t.consume(4),r=parseInt(Buffer.from(e).toString("hex"),16),i=t.consume(r);return Buffer.from(i).toString("hex").split("20").map((t=>Buffer.from(t,"hex").toString("utf8")))},K=t=>e=>(0,i.buf2hex)(Buffer.from((0,i.b58cdecode)(e,i.prefix[t]))),V=t=>e=>{const r=e.consume(i.prefixLength[t]);return(0,i.b58cencode)(r,i.prefix[t])},F=V(i.Prefix.TZ1),H=V(i.Prefix.B),G=t=>{const e=t.consume(1);return 0===e[0]?V(i.Prefix.TZ1)(t):1===e[0]?V(i.Prefix.TZ2)(t):2===e[0]?V(i.Prefix.TZ3)(t):void 0},$=K(i.Prefix.B),z=K(i.Prefix.TZ1),q=t=>t?"ff":"00",Z=t=>K(i.Prefix.P)(t),W=t=>V(i.Prefix.P)(t),Y=t=>{switch(t.substr(0,3)){case i.Prefix.TZ1:return"00"+K(i.Prefix.TZ1)(t);case i.Prefix.TZ2:return"01"+K(i.Prefix.TZ2)(t);case i.Prefix.TZ3:return"02"+K(i.Prefix.TZ3)(t);default:throw new i.InvalidKeyHashError(t)}},J=t=>{const e=[];let r=new n.Z(t,10);if(r.isNaN())throw new TypeError(`Invalid zarith number ${t}`);for(;;){if(r.lt(128)){r.lt(16)&&e.push("0"),e.push(r.toString(16));break}{let t=r.mod(128);r=r.minus(t),r=r.dividedBy(128),t=t.plus(128),e.push(t.toString(16))}}return e.join("")},X=t=>{let e=0;for(;e<t.length()&&0!=(128&t.get(e));)e+=1;let r=new n.Z(0);for(let i=e;i>=0;i-=1){const e=127&t.get(i);r=r.multipliedBy(128),r=r.plus(e)}return t.consume(e+1),new n.Z(r).toString()},Q=K(i.Prefix.VH),tt=V(i.Prefix.VH),et=K(i.Prefix.TXR1),rt=V(i.Prefix.TXR1),it={branch:a.BRANCH,contents:[a.OPERATION]},nt={pkh:a.TZ1,secret:a.SECRET},st={source:a.PKH,fee:a.ZARITH,counter:a.ZARITH,gas_limit:a.ZARITH,storage_limit:a.ZARITH,public_key:a.PUBLIC_KEY},ot={source:a.PKH,fee:a.ZARITH,counter:a.ZARITH,gas_limit:a.ZARITH,storage_limit:a.ZARITH,delegate:a.DELEGATE},at={source:a.PKH,fee:a.ZARITH,counter:a.ZARITH,gas_limit:a.ZARITH,storage_limit:a.ZARITH,amount:a.ZARITH,destination:a.ADDRESS,parameters:a.PARAMETERS},ct={source:a.PKH,fee:a.ZARITH,counter:a.ZARITH,gas_limit:a.ZARITH,storage_limit:a.ZARITH,balance:a.ZARITH,delegate:a.DELEGATE,script:a.SCRIPT},ut={source:a.PKH,period:a.INT32,proposal:a.PROPOSAL,ballot:a.BALLOT_STATEMENT},ht={slot:a.INT16,level:a.INT32,round:a.INT32,block_payload_hash:a.BLOCK_PAYLOAD_HASH},ft={level:a.INT32,nonce:a.RAW},lt={source:a.PKH,period:a.INT32,proposals:a.PROPOSAL_ARR},dt={source:a.PKH,fee:a.ZARITH,counter:a.ZARITH,gas_limit:a.ZARITH,storage_limit:a.ZARITH,value:a.VALUE},pt={source:a.PKH,fee:a.ZARITH,counter:a.ZARITH,gas_limit:a.ZARITH,storage_limit:a.ZARITH,ticket_contents:a.VALUE,ticket_ty:a.VALUE,ticket_ticketer:a.ADDRESS,ticket_amount:a.ZARITH,destination:a.ADDRESS,entrypoint:a.ENTRYPOINT},bt={source:a.PKH,fee:a.ZARITH,counter:a.ZARITH,gas_limit:a.ZARITH,storage_limit:a.ZARITH,tx_rollup_origination:a.TX_ROLLUP_ORIGINATION_PARAM},gt={source:a.PKH,fee:a.ZARITH,counter:a.ZARITH,gas_limit:a.ZARITH,storage_limit:a.ZARITH,rollup:a.TX_ROLLUP_ID,content:a.TX_ROLLUP_BATCH_CONTENT,burn_limit:a.BURN_LIMIT},mt={source:a.PKH,fee:a.ZARITH,counter:a.ZARITH,gas_limit:a.ZARITH,storage_limit:a.ZARITH,amount:a.ZARITH,destination:a.SMART_CONTRACT_ADDRESS},vt=t=>e=>r=>Object.keys(e).reduce(((i,n)=>{const s=e[n];if(r&&Array.isArray(s)){const e=t[s[0]],o=r[n];if(!Array.isArray(o))throw new E(`Expected value to be Array ${JSON.stringify(o)}`);return i+o.reduce(((t,r)=>t+e(r)),"")}return i+(0,t[s])(r[n])}),""),yt=t=>e=>r=>Object.keys(e).reduce(((i,n)=>{const s=e[n];if(Array.isArray(s)){const e=t[s[0]],o=[],a=r.length();for(;r.length()>0;)if(o.push(e(r)),a===r.length())throw new _("Unable to decode value");return Object.assign(Object.assign({},i),{[n]:o})}{const e=(0,t[s])(r);return void 0!==e?Object.assign(Object.assign({},i),{[n]:e}):Object.assign({},i)}}),{}),wt={[a.SECRET]:t=>s(t.consume(20)),[a.RAW]:t=>s(t.consume(32)),[a.TZ1]:F,[a.BRANCH]:H,[a.ZARITH]:X,[a.PUBLIC_KEY]:t=>{switch(t.consume(1)[0]){case 0:return V(i.Prefix.EDPK)(t);case 1:return V(i.Prefix.SPPK)(t);case 2:return V(i.Prefix.P2PK)(t);default:throw new i.InvalidPublicKeyError(t.toString())}},[a.PKH]:G,[a.DELEGATE]:t=>{const e=(t=>255===t.consume(1)[0])(t);if(e)return G(t)},[a.INT32]:t=>{const e=t.consume(4);let r=0;for(let t=0;t<e.length;t++)r|=e[t]<<8*(e.length-(t+1));return r},[a.SCRIPT]:t=>{const e=x(t),r=x(t);return{code:T(new A(e)),storage:T(new A(r))}},[a.BALLOT_STATEMENT]:t=>{const e=t.consume(1);switch(e[0]){case 0:return"yay";case 1:return"nay";case 2:return"pass";default:throw new v(e[0].toString())}},[a.PROPOSAL]:W,[a.PROPOSAL_ARR]:t=>{const e=[];for(t.consume(4);t.length()>0;)e.push(W(t));return e},[a.PARAMETERS]:t=>{if(0!==t.consume(1)[0]){const e=(t=>{const e=o(t.consume(1)[0],2);if(e in l)return l[e];{const e=x(t,1),r=Buffer.from(e).toString("utf8");if(r.length>31)throw new g(r);return r}})(t),r=x(t);return{entrypoint:e,value:T(new A(r))}}},[a.ADDRESS]:t=>{switch(t.consume(1)[0]){case 0:return G(t);case 1:{const e=V(i.Prefix.KT1)(t);return t.consume(1),e}default:throw new i.InvalidAddressError(t.toString())}},[a.SMART_CONTRACT_ADDRESS]:t=>{if(1===t.consume(1)[0]){const e=V(i.Prefix.KT1)(t);return t.consume(1),e}throw new i.InvalidContractAddressError(t.toString())},[a.VALUE]:t=>{const e=x(t);return T(new A(e))},[a.INT16]:t=>{const e=t.consume(2);let r=0;for(let t=0;t<e.length;t++)r|=e[t]<<8*(e.length-(t+1));return r},[a.BLOCK_PAYLOAD_HASH]:tt,[a.ENTRYPOINT]:t=>{const e=x(t);return Buffer.from(e).toString("utf8")},[a.TX_ROLLUP_ORIGINATION_PARAM]:t=>({}),[a.TX_ROLLUP_ID]:rt,[a.TX_ROLLUP_BATCH_CONTENT]:t=>{const e=x(t);return Buffer.from(e).toString("hex")},[a.BURN_LIMIT]:t=>{const e=t.consume(1);if("00"!==Buffer.from(e).toString("hex"))return X(t)}};wt[a.OPERATION]=(t=>e=>{const r=e.consume(1),i=h[r[0]];if(void 0===i)throw new S(r[0].toString());const n=t[i](e);if("object"!=typeof n)throw new _("Decoded invalid operation");return Object.assign({kind:i},n)})(wt),wt[a.OP_ACTIVATE_ACCOUNT]=t=>yt(wt)(nt)(t),wt[a.OP_DELEGATION]=t=>yt(wt)(ot)(t),wt[a.OP_TRANSACTION]=t=>yt(wt)(at)(t),wt[a.OP_ORIGINATION]=t=>yt(wt)(ct)(t),wt[a.OP_BALLOT]=t=>yt(wt)(ut)(t),wt[a.OP_ENDORSEMENT]=t=>yt(wt)(ht)(t),wt[a.OP_SEED_NONCE_REVELATION]=t=>yt(wt)(ft)(t),wt[a.OP_PROPOSALS]=t=>yt(wt)(lt)(t),wt[a.OP_REVEAL]=t=>yt(wt)(st)(t),wt[a.OP_REGISTER_GLOBAL_CONSTANT]=t=>yt(wt)(dt)(t),wt[a.OP_TRANSFER_TICKET]=t=>yt(wt)(pt)(t),wt[a.OP_TX_ROLLUP_ORIGINATION]=t=>yt(wt)(bt)(t),wt[a.OP_TX_ROLLUP_SUBMIT_BATCH]=t=>yt(wt)(gt)(t),wt[a.OP_INCREASE_PAID_STORAGE]=t=>yt(wt)(mt)(t),wt[a.MANAGER]=yt(wt)(it);const _t={[a.SECRET]:t=>t,[a.RAW]:t=>t,[a.TZ1]:z,[a.BRANCH]:$,[a.ZARITH]:J,[a.PUBLIC_KEY]:t=>{switch(t.substr(0,4)){case i.Prefix.EDPK:return"00"+K(i.Prefix.EDPK)(t);case i.Prefix.SPPK:return"01"+K(i.Prefix.SPPK)(t);case i.Prefix.P2PK:return"02"+K(i.Prefix.P2PK)(t);default:throw new i.InvalidPublicKeyError(t)}},[a.PKH]:Y,[a.DELEGATE]:t=>t?q(!0)+Y(t):q(!1),[a.SCRIPT]:t=>{const e=O(t.code),r=O(t.storage);return`${o(e.length/2,8)}${e}${o(r.length/2,8)}${r}`},[a.BALLOT_STATEMENT]:t=>{switch(t){case"yay":return"00";case"nay":return"01";case"pass":return"02";default:throw new m(t)}},[a.PROPOSAL]:Z,[a.PROPOSAL_ARR]:t=>o(32*t.length)+t.map((t=>Z(t))).join(""),[a.INT32]:t=>{const e=parseInt(String(t),10),r=[];for(let t=0;t<4;t++){const i=8*(4-(t+1));r.push((e&255<<i)>>i)}return Buffer.from(r).toString("hex")},[a.PARAMETERS]:t=>{if(!t||"default"===t.entrypoint&&"prim"in t.value&&"Unit"===t.value.prim)return"00";const e=(t=>{if(t in d)return`${d[t]}`;if(t.length>31)throw new g(t);return`ff${O({string:t}).slice(8)}`})(t.entrypoint),r=O(t.value);return`ff${e}${(r.length/2).toString(16).padStart(8,"0")}${r}`},[a.ADDRESS]:t=>{switch(t.substr(0,3)){case i.Prefix.TZ1:case i.Prefix.TZ2:case i.Prefix.TZ3:return"00"+Y(t);case i.Prefix.KT1:return"01"+K(i.Prefix.KT1)(t)+"00";default:throw new i.InvalidAddressError(t)}},[a.SMART_CONTRACT_ADDRESS]:t=>{if(t.substring(0,3)===i.Prefix.KT1)return"01"+K(i.Prefix.KT1)(t)+"00";throw new i.InvalidContractAddressError(t)},[a.VALUE]:t=>{const e=O(t);return`${o(e.length/2)}${e}`},[a.INT16]:t=>{const e=parseInt(String(t),10),r=[];for(let t=0;t<2;t++){const i=8*(2-(t+1));r.push((e&255<<i)>>i)}return Buffer.from(r).toString("hex")},[a.BLOCK_PAYLOAD_HASH]:Q,[a.ENTRYPOINT]:t=>`${O({string:t}).slice(2)}`,[a.TX_ROLLUP_ORIGINATION_PARAM]:t=>"",[a.TX_ROLLUP_ID]:et,[a.TX_ROLLUP_BATCH_CONTENT]:t=>`${o(t.length/2)}${t}`,[a.BURN_LIMIT]:t=>t?`ff${J(t)}`:"00"};_t[a.OPERATION]=(t=>e=>{if(!(e.kind in t)||!(e.kind in f))throw new i.InvalidOperationKindError(e.kind);return f[e.kind]+t[e.kind](e)})(_t),_t[a.OP_ACTIVATE_ACCOUNT]=t=>vt(_t)(nt)(t),_t[a.OP_DELEGATION]=t=>vt(_t)(ot)(t),_t[a.OP_TRANSACTION]=t=>vt(_t)(at)(t),_t[a.OP_ORIGINATION]=t=>vt(_t)(ct)(t),_t[a.OP_BALLOT]=t=>vt(_t)(ut)(t),_t[a.OP_ENDORSEMENT]=t=>vt(_t)(ht)(t),_t[a.OP_SEED_NONCE_REVELATION]=t=>vt(_t)(ft)(t),_t[a.OP_PROPOSALS]=t=>vt(_t)(lt)(t),_t[a.OP_REVEAL]=t=>vt(_t)(st)(t),_t[a.OP_REGISTER_GLOBAL_CONSTANT]=t=>vt(_t)(dt)(t),_t[a.OP_TRANSFER_TICKET]=t=>vt(_t)(pt)(t),_t[a.OP_TX_ROLLUP_ORIGINATION]=t=>vt(_t)(bt)(t),_t[a.OP_TX_ROLLUP_SUBMIT_BATCH]=t=>vt(_t)(gt)(t),_t[a.OP_INCREASE_PAID_STORAGE]=t=>vt(_t)(mt)(t),_t[a.MANAGER]=vt(_t)(it);const Et={activate_account:nt,reveal:st,delegation:ot,transaction:at,origination:ct,ballot:ut,endorsement:ht,seed_nonce_revelation:ft,proposals:lt,register_global_constant:dt,transfer_ticket:pt,tx_rollup_origination:bt,tx_rollup_submit_batch:gt,increase_paid_storage:mt},St=t=>{const e=t.kind,r=Object.keys(t),i=(n="kind",r.filter((t=>t!==n)));var n;const s=Object.keys(Et[e]);return o=i,s.filter((t=>!o.includes(t)));var o};var At;!function(t){t.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",t.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",t.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",t.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",t.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",t.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",t.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",t.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",t.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",t.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",t.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",t.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",t.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(At||(At={}));const Ot={commitHash:"22fd810dcadf5272cb7a57d65165caa0eddbc57e",version:"14.2.0"},Tt=At.Psithaca2;function xt(t,e){return{encoder:_t[t],decoder:e=>{const r=A.fromHexString(e);return wt[t](r)}}}class Pt{constructor(t=Tt){this.protocolHash=t,this.codec=xt(a.MANAGER,this.protocolHash)}forge(t){if((0,i.validateBlock)(t.branch)!==i.ValidationResult.VALID)throw new p(`The block hash ${t.branch} is invalid`);for(const r of t.contents){if(e=r.kind,!Object.keys(Et).includes(e))throw new i.InvalidOperationKindError(r.kind);const t=St(r);if(1===t.length){if("delegation"===r.kind&&"delegate"===t[0])continue;if("origination"===r.kind&&"delegate"===t[0])continue;if("transaction"===r.kind&&"parameters"===t[0])continue;if("tx_rollup_submit_batch"===r.kind&&"burn_limit"===t[0])continue;throw new b(`Missing properties: ${t.join(", ").toString()}`)}if(t.length>1)throw new b(`Missing properties: ${t.join(", ").toString()}`)}var e;const r=this.codec.encoder(t).toLowerCase();return Promise.resolve(r)}parse(t){return Promise.resolve(this.codec.decoder(t))}}const Rt=new Pt},9985:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Contract:()=>rr,DefaultProtocol:()=>p,JSONParseError:()=>C,MacroError:()=>v,MichelineParseError:()=>L,MichelsonError:()=>ut,MichelsonInstructionError:()=>Le,MichelsonTypeError:()=>ft,MichelsonValidationError:()=>Nt,Parser:()=>K,ProtoGreaterOfEqual:()=>g,ProtoInferiorTo:()=>m,Protocol:()=>d,VERSION:()=>ar,assertContractValid:()=>Ze,assertDataListIfAny:()=>ne,assertDataValid:()=>We,assertMichelsonBigMapStorableType:()=>zt,assertMichelsonComparableType:()=>Vt,assertMichelsonContract:()=>Xt,assertMichelsonData:()=>Jt,assertMichelsonInstruction:()=>Kt,assertMichelsonPackableType:()=>Ft,assertMichelsonPassableType:()=>$t,assertMichelsonPushableType:()=>Ht,assertMichelsonStorableType:()=>Gt,assertMichelsonType:()=>Wt,assertTypeAnnotationsValid:()=>je,assertTypesEqual:()=>Je,assertViewNameValid:()=>Zt,contractEntryPoint:()=>ze,contractEntryPoints:()=>qe,contractSection:()=>He,contractViews:()=>Ge,decodeAddressBytes:()=>Ne,decodePublicKeyBytes:()=>ke,decodePublicKeyHashBytes:()=>Me,dummyContract:()=>ir,emitMicheline:()=>$,formatError:()=>or,formatStack:()=>nr,functionType:()=>Ye,instructionIDs:()=>Pt,isContractValid:()=>Qe,isDataValid:()=>tr,isInstruction:()=>ie,isMichelsonCode:()=>ee,isMichelsonData:()=>te,isMichelsonError:()=>ht,isMichelsonScript:()=>Qt,isMichelsonType:()=>re,isTypeAnnotationsValid:()=>Xe,isTypeEqual:()=>er,packData:()=>Oe,packDataBytes:()=>Te,refContract:()=>l,sourceReference:()=>i,traceDumpFunc:()=>sr,unpackData:()=>Re,unpackDataBytes:()=>Ie});const i=Symbol("source_reference");class n extends Error{constructor(t,e,r){super(r),this.src=t,this.idx=e,Object.setPrototypeOf(this,n.prototype)}}var s;!function(t){t[t.Comment=0]="Comment",t[t.Number=1]="Number",t[t.String=2]="String",t[t.Bytes=3]="Bytes",t[t.Ident=4]="Ident"}(s||(s={}));const o=new RegExp("\\s"),a=new RegExp("[:@%_A-Za-z]"),c=new RegExp("[@%_\\.A-Za-z0-9]"),u=new RegExp("[0-9]"),h=new RegExp("[0-9a-fA-F]");function*f(t,e=!1){let r=0;for(;r<t.length;){for(;r<t.length&&o.test(t[r]);)r++;if(r===t.length)return;const i=t[r],f=r;if(a.test(i)){for(r++;r<t.length&&c.test(t[r]);)r++;yield{t:s.Ident,v:t.slice(f,r),first:f,last:r}}else if(t.length-r>1&&"0x"===t.substr(r,2)){for(r+=2;r<t.length&&h.test(t[r]);)r++;if(0!=(r-f&1))throw new n(t,r,"Bytes literal length is expected to be power of two");yield{t:s.Bytes,v:t.slice(f,r),first:f,last:r}}else if(u.test(i)||"-"===i){"-"===i&&r++;const e=r;for(;r<t.length&&u.test(t[r]);)r++;if(e===r)throw new n(t,r,"Number literal is too short");yield{t:s.Number,v:t.slice(f,r),first:f,last:r}}else if('"'===i){r++;let e=!1;for(;r<t.length&&(e||'"'!==t[r]);r++)e=!e&&"\\"===t[r];if(r===t.length)throw new n(t,r,"Unterminated string literal");r++,yield{t:s.String,v:t.slice(f,r),first:f,last:r}}else if("#"===i){for(r++;r<t.length&&"\n"!==t[r];)r++;e&&(yield{t:s.Comment,v:t.slice(f,r),first:f,last:r})}else if(t.length-r>1&&"/*"===t.substr(r,2)){for(r+=2;r<t.length&&!(t.length-r>1&&"*/"===t.substr(r,2));)r++;if(r===t.length)throw new n(t,r,"Unterminated C style comment");r+=2,e&&(yield{t:s.Comment,v:t.slice(f,r),first:f,last:r})}else{if("("!==i&&")"!==i&&"{"!==i&&"}"!==i&&";"!==i)throw new n(t,r,`Invalid character at offset ${r}: \`${i}'`);r++,yield{t:i,v:i,first:f,last:r}}}}const l=Symbol("ref_contract");var d;!function(t){t.Ps9mPmXa="Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P",t.PtCJ7pwo="PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY",t.PsYLVpVv="PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",t.PsddFKi3="PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP",t.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",t.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",t.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",t.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",t.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",t.PtEdoTez="PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq",t.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",t.PsFLoren="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",t.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",t.PtGRANAD="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",t.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",t.PtHangzH="PtHangzHogokSuiMHemCuowEavgYTP8J5qQ9fQS793MHYFpCY3r",t.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",t.PsiThaCa="PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP",t.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",t.PtJakarta="PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw",t.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",t.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",t.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(d||(d={}));const p=d.Psithaca2,b={Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P:0,PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY:1,PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt:2,PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP:3,Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd:4,PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU:5,PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS:5,PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb:6,PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo:7,PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq:8,PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA:8,PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i:9,PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV:10,PtHangzHogokSuiMHemCuowEavgYTP8J5qQ9fQS793MHYFpCY3r:11,PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx:11,PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP:12,Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A:12,PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw:13,PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY:13,PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg:14,ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK:15};function g(t,e){return b[t]>=b[e]}function m(t,e){return b[t]<b[e]}class v extends Error{constructor(t,e){super(e),this.prim=t,Object.setPrototypeOf(this,v.prototype)}}function y(t,e){var r,i;if(0===e&&void 0===t.args||(null===(r=t.args)||void 0===r?void 0:r.length)===e)return!0;throw new v(t,`macro ${t.prim} expects ${e} arguments, was given ${null===(i=t.args)||void 0===i?void 0:i.length}`)}function w(t){if(void 0===t.annots)return!0;throw new v(t,`unexpected annotation on macro ${t.prim}: ${t.annots}`)}function _(t,e){if("int"in e)return!0;throw new v(t,`macro ${t.prim} expects int argument`)}function E(t,e,r,i){let n=0,s=0;const o=[null,null];let a;if(n===e.length)throw new v(t,`unexpected end: ${t.prim}`);let c,u=e[n++];switch(u){case"P":{const{r:o,n:c,an:u}=E(t,e.slice(n),r.slice(s),i);a=o,n+=c,s+=u;break}case"A":s!==r.length&&(o[0]=r[s++]);break;default:throw new v(t,`${t.prim}: unexpected character: ${u}`)}if(n===e.length)throw new v(t,`unexpected end: ${t.prim}`);switch(u=e[n++],u){case"P":{const{r:o,n:a,an:u}=E(t,e.slice(n),r.slice(s),i);c=o.map((([t,e])=>[t+1,e])),n+=a,s+=u;break}case"I":s!==r.length&&(o[1]=r[s++]);break;default:throw new v(t,`${t.prim}: unexpected character: ${u}`)}return{r:i(a,c,[0,o]),n,an:s}}function S(t,e,r,i){const n=e[0];switch(n){case"A":return e.length>1?[{prim:"DUP"},{prim:"DIP",args:[[{prim:"CAR",annots:["@%%"]},S(t,e.slice(1),[],i)]]},{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:["%@","%@",...r]}]:i.a;case"D":return e.length>1?[{prim:"DUP"},{prim:"DIP",args:[[{prim:"CDR",annots:["@%%"]},S(t,e.slice(1),[],i)]]},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@","%@",...r]}]:i.d;default:throw new v(t,`${t.prim}: unexpected character: ${n}`)}}function A(t,e){let r=t.length;for(;r>0&&t[r-1]===e;)r--;return t.slice(0,r)}function O(t){const e=[],r=[];if(void 0!==t)for(const i of t)(0!==i.length&&"%"===i[0]?e:r).push(i);return{fields:e,rest:r}}function T({prim:t,annots:e,args:r}){return Object.assign(Object.assign({prim:t},e&&{annots:e}),r&&{args:r})}const x=/^P[PAI]{3,}R$/,P=/^UNP[PAI]{2,}R$/,R=/^C[AD]{2,}R$/,I=/^SET_C[AD]+R$/,N=/^MAP_C[AD]+R$/,M=/^DI{2,}P$/,k=/^DU+P$/;class L extends Error{constructor(t,e){super(e),this.token=t,Object.setPrototypeOf(this,L.prototype)}}class C extends Error{constructor(t,e){super(e),this.node=t,Object.setPrototypeOf(this,C.prototype)}}const B=new L(null,"Unexpected EOF");function D(t){return t.t===s.Ident&&("@"===t.v[0]||"%"===t.v[0]||":"===t.v[0])}const U=new RegExp("^-?[0-9]+$"),j=new RegExp("^([0-9a-fA-F]{2})*$");class K{constructor(t){this.opt=t}expand(t){var e,r,n;if(void 0!==(null===(e=this.opt)||void 0===e?void 0:e.expandGlobalConstant)&&"constant"===t.prim){const e=function(t,e){return void 0!==t.args&&1===t.args.length&&"string"in t.args[0]&&t.args[0].string in e?e[t.args[0].string]:t}(t,this.opt.expandGlobalConstant);return e!==t&&(e[i]=Object.assign(Object.assign({},t[i]||{first:0,last:0}),{globalConstant:t})),e}if(void 0===(null===(r=this.opt)||void 0===r?void 0:r.expandMacros)||(null===(n=this.opt)||void 0===n?void 0:n.expandMacros)){const e=function(t,e){const r=(null==e?void 0:e.protocol)||p;function i(t){return void 0!==t?[{prim:"RENAME",annots:t}]:[]}switch(t.prim){case"CMPEQ":case"CMPNEQ":case"CMPLT":case"CMPGT":case"CMPLE":case"CMPGE":if(y(t,0))return[{prim:"COMPARE"},T({prim:t.prim.slice(3),annots:t.annots})];break;case"IFEQ":case"IFNEQ":case"IFLT":case"IFGT":case"IFLE":case"IFGE":if(y(t,2))return[{prim:t.prim.slice(2)},T({prim:"IF",annots:t.annots,args:t.args})];break;case"IFCMPEQ":case"IFCMPNEQ":case"IFCMPLT":case"IFCMPGT":case"IFCMPLE":case"IFCMPGE":if(y(t,2))return[{prim:"COMPARE"},{prim:t.prim.slice(5)},T({prim:"IF",annots:t.annots,args:t.args})];break;case"FAIL":if(y(t,0)&&w(t))return[{prim:"UNIT"},{prim:"FAILWITH"}];break;case"ASSERT":if(y(t,0)&&w(t))return[{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_EQ":case"ASSERT_NEQ":case"ASSERT_LT":case"ASSERT_GT":case"ASSERT_LE":case"ASSERT_GE":if(y(t,0)&&w(t))return[{prim:t.prim.slice(7)},{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_CMPEQ":case"ASSERT_CMPNEQ":case"ASSERT_CMPLT":case"ASSERT_CMPGT":case"ASSERT_CMPLE":case"ASSERT_CMPGE":if(y(t,0)&&w(t))return[[{prim:"COMPARE"},{prim:t.prim.slice(10)}],{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_NONE":if(y(t,0)&&w(t))return[{prim:"IF_NONE",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_SOME":if(y(t,0))return[{prim:"IF_NONE",args:[[[{prim:"UNIT"},{prim:"FAILWITH"}]],i(t.annots)]}];break;case"ASSERT_LEFT":if(y(t,0))return[{prim:"IF_LEFT",args:[i(t.annots),[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_RIGHT":if(y(t,0))return[{prim:"IF_LEFT",args:[[[{prim:"UNIT"},{prim:"FAILWITH"}]],i(t.annots)]}];break;case"IF_SOME":if(y(t,2))return[T({prim:"IF_NONE",annots:t.annots,args:[t.args[1],t.args[0]]})];break;case"IF_RIGHT":if(y(t,2))return[T({prim:"IF_LEFT",annots:t.annots,args:[t.args[1],t.args[0]]})];break;case"CAR":case"CDR":if(void 0===t.args)return t;if(y(t,1)&&_(t,t.args[0])){const e=parseInt(t.args[0].int,10);return T({prim:"GET",args:[{int:"CAR"===t.prim?String(2*e+1):String(2*e)}],annots:t.annots})}}if(x.test(t.prim)&&y(t,0)){const{fields:e,rest:r}=O(t.annots),{r:i}=E(t,t.prim.slice(1),e,((t,e,r)=>[...t||[],...e||[],r]));return i.map((([t,e],n)=>{const s=[...A(e,null).map((t=>null===t?"%":t)),...0===t&&n===i.length-1?r:[]],o=T({prim:"PAIR",annots:0!==s.length?s:void 0});return 0===t?o:{prim:"DIP",args:1===t?[[o]]:[{int:String(t)},[o]]}}))}if(P.test(t.prim)){if(m(r,d.PtEdo2Zk)&&y(t,0)){const{r:e}=E(t,t.prim.slice(3),t.annots||[],((t,e,r)=>[r,...e||[],...t||[]]));return e.map((([t,e])=>{const r=[{prim:"DUP"},T({prim:"CAR",annots:null!==e[0]?[e[0]]:void 0}),{prim:"DIP",args:[[T({prim:"CDR",annots:null!==e[1]?[e[1]]:void 0})]]}];return 0===t?r:{prim:"DIP",args:1===t?[[r]]:[{int:String(t)},[r]]}}))}if("UNPAIR"===t.prim)return t;if(y(t,0)){const{r:e}=E(t,t.prim.slice(3),[],((t,e,r)=>[r,...e||[],...t||[]]));return e.map((([t])=>{const e=T({prim:"UNPAIR"});return 0===t?e:{prim:"DIP",args:1===t?[[e]]:[{int:String(t)},[e]]}}))}}if(R.test(t.prim)&&y(t,0)){const e=[...t.prim.slice(1,t.prim.length-1)];return e.map(((r,i)=>{const n=i===e.length-1?t.annots:void 0;switch(r){case"A":return T({prim:"CAR",annots:n});case"D":return T({prim:"CDR",annots:n});default:throw new v(t,`unexpected character: ${r}`)}}))}if(I.test(t.prim)&&y(t,0)){const{fields:e,rest:r}=O(t.annots);if(e.length>1)throw new v(t,`unexpected annotation on macro ${t.prim}: ${e}`);const i=0!==e.length?{a:[{prim:"DUP"},{prim:"CAR",annots:e},{prim:"DROP"},{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:[e[0],"%@"]}],d:[{prim:"DUP"},{prim:"CDR",annots:e},{prim:"DROP"},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@",e[0]]}]}:{a:[{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:["%","%@"]}],d:[{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@","%"]}]};return S(t,t.prim.slice(5,t.prim.length-1),r,i)}if(N.test(t.prim)&&y(t,1)){const{fields:e}=O(t.annots);if(e.length>1)throw new v(t,`unexpected annotation on macro ${t.prim}: ${e}`);const r={a:[{prim:"DUP"},{prim:"CDR",annots:["@%%"]},{prim:"DIP",args:[[T({prim:"CAR",annots:0!==e.length?["@"+e[0].slice(1)]:void 0}),t.args[0]]]},{prim:"SWAP"},{prim:"PAIR",annots:[0!==e.length?e[0]:"%","%@"]}],d:[{prim:"DUP"},T({prim:"CDR",annots:0!==e.length?["@"+e[0].slice(1)]:void 0}),t.args[0],{prim:"SWAP"},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@",0!==e.length?e[0]:"%"]}]};return S(t,t.prim.slice(5,t.prim.length-1),[],r)}if(M.test(t.prim)&&y(t,1)){let e=0;for(;"I"===t.prim[1+e];)e++;return T({prim:"DIP",args:[{int:String(e)},t.args[0]]})}if(k.test(t.prim)){let e=0;for(;"U"===t.prim[1+e];)e++;if(m(r,d.PtEdo2Zk)){if(1===e){if(void 0===t.args)return t;y(t,1)&&_(t,t.args[0])&&(e=parseInt(t.args[0].int,10))}else y(t,0);return 1===e?[T({prim:"DUP",annots:t.annots})]:2===e?[{prim:"DIP",args:[[T({prim:"DUP",annots:t.annots})]]},{prim:"SWAP"}]:[{prim:"DIP",args:[{int:String(e-1)},[T({prim:"DUP",annots:t.annots})]]},{prim:"DIG",args:[{int:String(e)}]}]}if(1===e)return t;if(y(t,0))return T({prim:"DUP",args:[{int:String(e)}],annots:t.annots})}return t}(t,this.opt);return e!==t&&(e[i]=Object.assign(Object.assign({},t[i]||{first:0,last:0}),{macro:t})),e}return t}parseListExpr(t,e){var r;const n={first:e.first,last:e.last},o="("===e.t;let a;if(o){if(a=t.next(),a.done)throw B;n.last=a.value.last}else a={value:e};if(a.value.t!==s.Ident)throw new L(a.value,`not an identifier: ${a.value.v}`);const c={prim:a.value.v,[i]:n};for(;;){const e=t.next();if(e.done){if(o)throw B;break}if(")"===e.value.t){if(!o)throw new L(e.value,"unexpected closing bracket");n.last=e.value.last;break}if(D(e.value))c.annots=c.annots||[],c.annots.push(e.value.v),n.last=e.value.last;else{c.args=c.args||[];const s=this.parseExpr(t,e.value);n.last=(null===(r=s[i])||void 0===r?void 0:r.last)||n.last,c.args.push(s)}}return this.expand(c)}parseArgs(t,e){var r;const n={first:e.first,last:e.last},s={prim:e.v,[i]:n};for(;;){const e=t.next();if(e.done||"}"===e.value.t||";"===e.value.t)return[s,e];if(D(e.value))n.last=e.value.last,s.annots=s.annots||[],s.annots.push(e.value.v);else{const o=this.parseExpr(t,e.value);n.last=(null===(r=o[i])||void 0===r?void 0:r.last)||n.last,s.args=s.args||[],s.args.push(o)}}}parseSequenceExpr(t,e){var r,n;const o={first:e.first,last:e.last},a=[];a[i]=o;const c="{"===e.t;let u="{"===e.t?null:{value:e};for(;;){if(null===u&&(u=t.next(),u.done||(o.last=u.value.last)),u.done){if(c)throw B;return a}if("}"===u.value.t){if(c)return a;throw new L(u.value,"unexpected closing bracket")}if(u.value.t===s.Ident){const[e,n]=this.parseArgs(t,u.value);o.last=(null===(r=e[i])||void 0===r?void 0:r.last)||o.last,a.push(this.expand(e)),u=n}else{const e=this.parseExpr(t,u.value);o.last=(null===(n=e[i])||void 0===n?void 0:n.last)||o.last,a.push(e),u=null}null===u&&(u=t.next(),u.done||(o.last=u.value.last)),u.done||";"!==u.value.t||(u=null)}}parseExpr(t,e){switch(e.t){case s.Ident:return this.expand({prim:e.v,[i]:{first:e.first,last:e.last}});case s.Number:return{int:e.v,[i]:{first:e.first,last:e.last}};case s.String:return{string:JSON.parse(e.v),[i]:{first:e.first,last:e.last}};case s.Bytes:return{bytes:e.v.slice(2),[i]:{first:e.first,last:e.last}};case"{":return this.parseSequenceExpr(t,e);default:return this.parseListExpr(t,e)}}parseSequence(t){if("string"!=typeof t)throw new TypeError(`string type was expected, got ${typeof t} instead`);const e=f(t),r=e.next();return r.done?null:this.parseSequenceExpr(e,r.value)}parseList(t){if("string"!=typeof t)throw new TypeError(`string type was expected, got ${typeof t} instead`);const e=f(t),r=e.next();return r.done?null:this.parseListExpr(e,r.value)}parseMichelineExpression(t){if("string"!=typeof t)throw new TypeError(`string type was expected, got ${typeof t} instead`);const e=f(t),r=e.next();return r.done?null:this.parseExpr(e,r.value)}parseScript(t){return this.parseSequence(t)}parseData(t){return this.parseList(t)}parseJSON(t){if("object"!=typeof t)throw new TypeError(`object type was expected, got ${typeof t} instead`);if(Array.isArray(t)){const e=[];for(const r of t){if(null===r||"object"!=typeof r)throw new C(r,`unexpected sequence element: ${r}`);e.push(this.parseJSON(r))}return e}if("prim"in t){const e=t;if("string"==typeof e.prim&&(void 0===e.annots||Array.isArray(e.annots))&&(void 0===e.args||Array.isArray(e.args))){const t={prim:e.prim};if(void 0!==e.annots){for(const t of e.annots)if("string"!=typeof t)throw new C(t,`string expected: ${t}`);t.annots=e.annots}if(void 0!==e.args){t.args=[];for(const r of e.args){if(null===r||"object"!=typeof r)throw new C(r,`unexpected argument: ${r}`);t.args.push(this.parseJSON(r))}}return this.expand(t)}throw new C(t,`malformed prim expression: ${t}`)}if("string"in t){if("string"==typeof t.string)return{string:t.string};throw new C(t,`malformed string literal: ${t}`)}if("int"in t){if("string"==typeof t.int&&U.test(t.int))return{int:t.int};throw new C(t,`malformed int literal: ${t}`)}if("bytes"in t){if("string"==typeof t.bytes&&j.test(t.bytes))return{bytes:t.bytes};throw new C(t,`malformed bytes literal: ${t}`)}throw new C(t,`unexpected object: ${t}`)}}class V{constructor(t,e=0){this.opt=t,this.lev=e}indent(t=0){var e;let r="";if(void 0!==(null===(e=this.opt)||void 0===e?void 0:e.indent))for(let e=this.lev+t;e>0;e--)r+=this.opt.indent;return r}get lf(){var t;return(null===(t=this.opt)||void 0===t?void 0:t.newline)||""}get lfsp(){var t;return(null===(t=this.opt)||void 0===t?void 0:t.newline)||" "}down(t){return new V(this.opt,this.lev+t)}}function F(t){return"prim"in t&&(void 0!==t.annots&&0!==t.annots.length||void 0!==t.args&&0!==t.args.length)}function H(t){if(void 0!==t.args)for(const e of t.args)if(Array.isArray(e)||F(e))return!0;return!1}function G(t,e,r){var n;const s=null===(n=t[i])||void 0===n?void 0:n.macro;if(r&&s)return G(s,e,r);if(Array.isArray(t))return function(t,e,r){let i="{"+e.lf,n=t.length;for(const s of t){if(i+=e.indent(1),"prim"in s){if(i+=s.prim,void 0!==s.annots)for(const t of s.annots)i+=" "+t;if(void 0!==s.args){const t=H(s);for(const n of s.args)i+=t?e.lfsp+e.indent(2)+G(n,e.down(2),r):" "+G(n,e,r)}}else i+=G(s,e.down(1),r);i+=n>1?";"+e.lfsp:e.lf,n--}return i+e.indent()+"}"}(t,e,r);if("string"in t)return JSON.stringify(t.string);if("int"in t)return t.int;if("bytes"in t)return"0x"+t.bytes;{if(!(void 0!==t.annots&&0!==t.annots.length||void 0!==t.args&&0!==t.args.length))return t.prim;let i="("+t.prim;if(void 0!==t.annots)for(const e of t.annots)i+=" "+e;if(void 0!==t.args){const n=H(t);for(const s of t.args)i+=n?e.lfsp+e.indent(1)+G(s,e.down(1),r):" "+G(s,e,r)}return i+")"}}function $(t,e,r=!1){if("object"!=typeof t)throw new TypeError(`object type was expected, got ${typeof t} instead`);return G(t,new V(e),r)}const z=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],q=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998];class Z extends Error{constructor(t){super(t),this.message=t,this.name="Base58DecodingError"}}class W extends Error{constructor(t){super(t),this.message=t,this.name="InvalidMessageError"}}function Y(t){const e=(t.length+9)%64,r=0===e?0:64-e;if(t.length>268435455)throw new W(`SHA-256 -- message length is too big: ${t.length}`);const i=t.length<<3,n=[...t,128,...new Array(r).fill(0),0,0,0,0,i>>24&255,i>>16&255,i>>8&255,255&i];function s(t,e){return t>>>e|t<<32-e}const o=[...z],a=new Array(64),c=new Array(8);for(let t=0;t<n.length;t+=64){let e=t,r=0;for(;r<16;)a[r]=n[e]<<24|n[e+1]<<16|n[e+2]<<8|n[e+3],e+=4,r++;for(;r<64;){const t=s(a[r-15],7)^s(a[r-15],18)^a[r-15]>>>3,e=s(a[r-2],17)^s(a[r-2],19)^a[r-2]>>>10;a[r]=(0|e)+a[r-7]+t+a[r-16]|0,r++}for(let t=0;t<8;t++)c[t]=o[t];for(let t=0;t<64;t++){const e=s(c[0],2)^s(c[0],13)^s(c[0],22),r=s(c[4],6)^s(c[4],11)^s(c[4],25),i=c[7]+r+(c[4]&c[5]^~c[4]&c[6])+q[t]+a[t]|0,n=e+(c[0]&c[1]^c[0]&c[2]^c[1]&c[2])|0;c[7]=c[6],c[6]=c[5],c[5]=c[4],c[4]=c[3]+i|0,c[3]=c[2],c[2]=c[1],c[1]=c[0],c[0]=i+n|0}for(let t=0;t<8;t++)o[t]=o[t]+c[t]|0}const u=[];for(const t of o)u.push(t>>24&255),u.push(t>>16&255),u.push(t>>8&255),u.push(255&t);return u}const J=[0,1,2,3,4,5,6,7,8,-1,-1,-1,-1,-1,-1,-1,9,10,11,12,13,14,15,16,-1,17,18,19,20,21,-1,22,23,24,25,26,27,28,29,30,31,32,-1,-1,-1,-1,-1,-1,33,34,35,36,37,38,39,40,41,42,43,-1,44,45,46,47,48,49,50,51,52,53,54,55,56,57],X=[0,1,2,3,4,5,6,7,8,16,17,18,19,20,21,22,23,25,26,27,28,29,31,32,33,34,35,36,37,38,39,40,41,48,49,50,51,52,53,54,55,56,57,58,60,61,62,63,64,65,66,67,68,69,70,71,72,73];function Q(t,e){const r=t.charCodeAt(e)-49;if(r>=J.length||-1===J[r])throw new Z(`Unexpected character at position ${e}: ${t[e]}`);return J[r]}function tt(t){const e=function(t){const e=[];let r=0;for(;r<t.length&&0===Q(t,r);)r++;let i=r;for(;r<t.length;){let i=Q(t,r++),n=0;for(;0!==i||n<e.length;){const t=58*(e[n]||0)+i;e[n++]=t%256,i=Math.floor(t/256)}}for(;i-- >0;)e.push(0);return e.reverse()}(t);if(e.length<4)throw new Z(`Data is too short ${e.length}`);const r=e.slice(0,e.length-4),i=e.slice(e.length-4),n=Y(Y(r));if(i[0]!==n[0]||i[1]!==n[1]||i[2]!==n[2]||i[3]!==n[3])throw new Z("Invalid checksum");return r}function et(t){const e=Y(Y(t));return function(t){const e=[];let r=0;for(;r<t.length&&0===t[r];)r++;let i=r;for(;r<t.length;){let i=t[r++],n=0;for(;0!==i||n<e.length;){const t=256*(e[n]||0)+i;e[n++]=t%58,i=Math.floor(t/58)}}for(;i-- >0;)e.push(0);return e.reverse(),String.fromCharCode(...e.map((t=>X[t]+49)))}([...t,...e.slice(0,4)])}class rt extends Error{constructor(t){super(t),this.message=t,this.name="InvalidContractError"}}class it extends Error{constructor(t){super(t),this.message=t,this.name="InvalidTypeExpressionError"}}class nt extends Error{constructor(t){super(t),this.message=t,this.name="InvalidDataExpressionError"}}class st extends Error{constructor(t){super(`Contract has no entrypoint named: '${t}'`),this.entrypoint=t,this.name="InvalidEntrypointError"}}class ot extends Error{constructor(t){super(t),this.message=t,this.name="TezosIdEncodeError"}}class at extends Error{constructor(t){super(t),this.message=t,this.name="LongIntegerError"}}class ct extends Error{constructor(t){super(`Unable to parse hex byte: ${t}`),this.hexByte=t,this.name="HexParseError"}}class ut extends Error{constructor(t,e){super(e),this.val=t,Object.setPrototypeOf(this,ut.prototype)}}function ht(t){return t instanceof ut}class ft extends ut{constructor(t,e,r){super(t,r),void 0!==e&&(this.data=e),Object.setPrototypeOf(this,ft.prototype)}}class lt{constructor(t){if(this.neg=!1,this.buf=[],void 0!==t)if("string"==typeof t)for(let e=0;e<t.length;e++){const r=t.charCodeAt(e);if(0===e&&45===r)this.neg=!0;else{if(r<48||r>57)throw new at(`unexpected character in integer constant: ${t[e]}`);this.append(r-48)}}else t<0?(this.neg=!0,this.append(-t)):this.append(t)}append(t){let e=0;for(;0!==t||e<this.buf.length;){const r=10*(this.buf[e]||0)+t;this.buf[e++]=r%256,t=Math.floor(r/256)}}cmp(t){if(this.neg!==t.neg)return(t.neg?1:0)-(this.neg?1:0);{let e=0;if(this.buf.length!==t.buf.length)e=this.buf.length<t.buf.length?-1:1;else if(0!==this.buf.length){let r=t.buf.length-1;for(;r>=0&&this.buf[r]===t.buf[r];)r--;e=r<0?0:this.buf[r]<t.buf[r]?-1:1}return this.neg?0===e?0:-e:e}}get sign(){return 0===this.buf.length?0:this.neg?-1:1}}function dt(t){const e=[];for(let r=0;r<t.length;r+=2){const i=parseInt(t.slice(r,r+2),16);if(Number.isNaN(i))return null;e.push(i)}return e}function pt(t){try{return new lt(t),!0}catch(t){return!1}}function bt(t){try{return new lt(t).sign>=0}catch(t){return!1}}const gt=/^(@%|@%%|%@|[@:%]([_0-9a-zA-Z][_0-9a-zA-Z.%@]*)?)$/;function mt(t,e){if(Array.isArray(t))return{};let r,i,n;if(void 0!==t.annots)for(const s of t.annots)if(0!==s.length){if(!gt.test(s)||!(null==e?void 0:e.specialVar)&&("@%"===s||"@%%"===s)||!(null==e?void 0:e.specialFields)&&"%@"===s)throw new ut(t,`${t.prim}: unexpected annotation: ${s}`);switch(s[0]){case"%":((null==e?void 0:e.emptyFields)||s.length>1)&&(r=r||[],r.push(s));break;case":":s.length>1&&(i=i||[],i.push(s));break;case"@":((null==e?void 0:e.emptyVar)||s.length>1)&&(n=n||[],n.push(s))}}return{f:r,t:i,v:n}}const vt={BlockHash:[32,[1,52]],OperationHash:[32,[5,116]],OperationListHash:[32,[133,233]],OperationListListHash:[32,[29,159,109]],ProtocolHash:[32,[2,170]],ContextHash:[32,[79,199]],ED25519PublicKeyHash:[20,[6,161,159]],SECP256K1PublicKeyHash:[20,[6,161,161]],P256PublicKeyHash:[20,[6,161,164]],ContractHash:[20,[2,90,121]],CryptoboxPublicKeyHash:[16,[153,103]],ED25519Seed:[32,[13,15,58,7]],ED25519PublicKey:[32,[13,15,37,217]],SECP256K1SecretKey:[32,[17,162,224,201]],P256SecretKey:[32,[16,81,238,189]],ED25519EncryptedSeed:[56,[7,90,60,179,41]],SECP256K1EncryptedSecretKey:[56,[9,237,241,174,150]],P256EncryptedSecretKey:[56,[9,48,57,115,171]],SECP256K1PublicKey:[33,[3,254,226,86]],P256PublicKey:[33,[3,178,139,127]],SECP256K1Scalar:[33,[38,248,136]],SECP256K1Element:[33,[5,92,0]],ED25519SecretKey:[64,[43,246,78,7]],ED25519Signature:[64,[9,245,205,134,18]],SECP256K1Signature:[64,[13,115,101,19,63]],P256Signature:[64,[54,240,44,52]],GenericSignature:[64,[4,130,43]],ChainID:[4,[87,82,0]],RollupAddress:[20,[1,128,120,31]],TxRollupL2Address:[20,[6,161,166]]};function yt(t,...e){const r=tt(t);for(const t of e){const[e,i]=vt[t];if(r.length===e+i.length){let e=0;for(;e<i.length&&r[e]===i[e];)e++;if(e===i.length)return[t,r.slice(i.length)]}}return null}function wt(t,e){const[r,i]=vt[t];if(e.length!==r)throw new ot(`Incorrect data length for ${t}: ${e.length}`);return et([...i,...e])}function _t(t,e){const r=e,i=Array.isArray(r)?r:r.args;if(2===i.length){return"pair"===t?{prim:"pair",args:i}:{prim:"Pair",args:i}}return Object.assign(Object.assign({},Array.isArray(r)?{prim:t}:r),{args:[i[0],{prim:t,args:i.slice(1)}]})}function Et(t){return Array.isArray(t)||"pair"===t.prim}function St(t){return Array.isArray(t)||"prim"in t&&"Pair"===t.prim}const At=/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])[T ]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):([0-5][0-9]))$/;function Ot(t){if("string"in t){if(bt(t.string))return new Date(parseInt(t.string,10));if(At.test(t.string)){const e=new Date(t.string);if(!Number.isNaN(e.valueOf))return e}}else if(pt(t.int))return new Date(parseInt(t.int,10));return null}function Tt(t){return t.map((t=>(t>>4&15).toString(16)+(15&t).toString(16))).join("")}const xt={ABS:!0,ADD:!0,ADDRESS:!0,AMOUNT:!0,AND:!0,APPLY:!0,BALANCE:!0,BLAKE2B:!0,CAR:!0,CDR:!0,CHAIN_ID:!0,CHECK_SIGNATURE:!0,COMPARE:!0,CONCAT:!0,CONS:!0,EDIV:!0,EQ:!0,EXEC:!0,FAILWITH:!0,GE:!0,GET_AND_UPDATE:!0,GT:!0,HASH_KEY:!0,IMPLICIT_ACCOUNT:!0,INT:!0,ISNAT:!0,JOIN_TICKETS:!0,KECCAK:!0,LE:!0,LEVEL:!0,LSL:!0,LSR:!0,LT:!0,MEM:!0,MUL:!0,NEG:!0,NEQ:!0,NEVER:!0,NOT:!0,NOW:!0,OR:!0,PACK:!0,PAIRING_CHECK:!0,READ_TICKET:!0,SAPLING_VERIFY_UPDATE:!0,SELF:!0,SELF_ADDRESS:!0,SENDER:!0,SET_DELEGATE:!0,SHA256:!0,SHA3:!0,SHA512:!0,SIZE:!0,SLICE:!0,SOME:!0,SOURCE:!0,SPLIT_TICKET:!0,SUB:!0,SWAP:!0,TICKET:!0,TOTAL_VOTING_POWER:!0,TRANSFER_TOKENS:!0,UNIT:!0,VOTING_POWER:!0,XOR:!0,RENAME:!0,OPEN_CHEST:!0,SUB_MUTEZ:!0,MIN_BLOCK_TIME:!0},Pt=Object.assign({},xt,{CONTRACT:!0,CREATE_CONTRACT:!0,DIG:!0,DIP:!0,DROP:!0,DUG:!0,DUP:!0,EMIT:!0,EMPTY_BIG_MAP:!0,EMPTY_MAP:!0,EMPTY_SET:!0,GET:!0,IF:!0,IF_CONS:!0,IF_LEFT:!0,IF_NONE:!0,ITER:!0,LAMBDA:!0,LEFT:!0,LOOP:!0,LOOP_LEFT:!0,MAP:!0,NIL:!0,NONE:!0,PAIR:!0,PUSH:!0,RIGHT:!0,SAPLING_EMPTY_STATE:!0,UNPACK:!0,UNPAIR:!0,UPDATE:!0,CAST:!0,VIEW:!0}),Rt={unit:!0,never:!0,bool:!0,int:!0,nat:!0,string:!0,chain_id:!0,bytes:!0,mutez:!0,key_hash:!0,key:!0,signature:!0,timestamp:!0,address:!0,tx_rollup_l2_address:!0},It=Object.assign({},Rt,{or:!0,pair:!0,set:!0,big_map:!0,contract:!0,lambda:!0,list:!0,map:!0,operation:!0,option:!0,bls12_381_g1:!0,bls12_381_g2:!0,bls12_381_fr:!0,sapling_transaction:!0,sapling_state:!0,ticket:!0,chest_key:!0,chest:!0});class Nt extends ut{constructor(t,e){super(t,e),this.val=t,Object.setPrototypeOf(this,Nt.prototype)}}function Mt(t){return"prim"in t}function kt(t){if(Mt(t))return!0;throw new Nt(t,"prim expression expected")}function Lt(t){if(Array.isArray(t))return!0;throw new Nt(t,"sequence expression expected")}function Ct(t){if(function(t){return Array.isArray(t)||"prim"in t}(t))return!0;throw new Nt(t,"prim or sequence expression expected")}function Bt(t){if("-"===t.int[0])throw new Nt(t,"natural number expected")}function Dt(t){if("int"in t)return!0;throw new Nt(t,"int literal expected")}function Ut(t){if("string"in t)return!0;throw new Nt(t,"string literal expected")}function jt(t,e){var r;if(0===e&&void 0===t.args||(null===(r=t.args)||void 0===r?void 0:r.length)===e)return!0;throw new Nt(t,`${e} arguments expected`)}function Kt(t){var e,r;if(Array.isArray(t)){for(const e of t){if(!Array.isArray(e)&&!Mt(e))throw new Nt(t,"sequence or prim expected");Kt(e)}return!0}if(kt(t)){if(Object.prototype.hasOwnProperty.call(xt,t.prim))return jt(t,0),!0;switch(t.prim){case"DROP":case"PAIR":case"UNPAIR":case"DUP":case"UPDATE":case"GET":void 0!==t.args&&jt(t,1)&&Dt(t.args[0])&&Bt(t.args[0]);break;case"DIG":case"DUG":case"SAPLING_EMPTY_STATE":jt(t,1)&&Dt(t.args[0])&&Bt(t.args[0]);break;case"NONE":case"LEFT":case"RIGHT":case"NIL":case"CAST":jt(t,1)&&Wt(t.args[0]);break;case"UNPACK":jt(t,1)&&Ft(t.args[0]);break;case"CONTRACT":jt(t,1)&&$t(t.args[0]);break;case"IF_NONE":case"IF_LEFT":case"IF_CONS":case"IF":jt(t,2)&&(Lt(t.args[0])&&Kt(t.args[0]),Lt(t.args[1])&&Kt(t.args[1]));break;case"MAP":case"ITER":case"LOOP":case"LOOP_LEFT":jt(t,1)&&Kt(t.args[0]);break;case"CREATE_CONTRACT":jt(t,1)&&Xt(t.args[0]);break;case"DIP":if(2===(null===(e=t.args)||void 0===e?void 0:e.length))Dt(t.args[0])&&Bt(t.args[0]),Lt(t.args[1])&&Kt(t.args[1]);else{if(1!==(null===(r=t.args)||void 0===r?void 0:r.length))throw new Nt(t,"1 or 2 arguments expected");Lt(t.args[0])&&Kt(t.args[0])}break;case"PUSH":jt(t,2)&&(Ht(t.args[0]),Jt(t.args[1]));break;case"EMPTY_SET":jt(t,1)&&Vt(t.args[0]);break;case"EMPTY_MAP":jt(t,2)&&(Vt(t.args[0]),Wt(t.args[1]));break;case"EMPTY_BIG_MAP":jt(t,2)&&(Vt(t.args[0]),zt(t.args[1]));break;case"LAMBDA":jt(t,3)&&(Wt(t.args[0]),Wt(t.args[1]),Lt(t.args[2])&&Kt(t.args[2]));break;case"VIEW":jt(t,2)&&(Ut(t.args[0])&&Zt(t.args[0]),Wt(t.args[1])&&Ht(t.args[1]));break;case"EMIT":t.args&&t.args.length>0?jt(t,1):jt(t,0);break;default:throw new Nt(t,"instruction expected")}}return!0}function Vt(t){if(Ct(t))if(Array.isArray(t)||"pair"===t.prim||"or"===t.prim||"option"===t.prim)Yt(t,(t=>Vt(t)));else if(!Object.prototype.hasOwnProperty.call(Rt,t.prim))throw new Nt(t,`${t.prim}: type is not comparable`);return!0}function Ft(t){if(Ct(t)&&Mt(t)){if(!Object.prototype.hasOwnProperty.call(It,t.prim)||"big_map"===t.prim||"operation"===t.prim||"sapling_state"===t.prim||"ticket"===t.prim)throw new Nt(t,`${t.prim}: type can't be used inside PACK/UNPACK instructions`);Yt(t,(t=>Ft(t)))}return!0}function Ht(t){if(Ct(t)&&Mt(t)){if(!Object.prototype.hasOwnProperty.call(It,t.prim)||"big_map"===t.prim||"operation"===t.prim||"sapling_state"===t.prim||"ticket"===t.prim||"contract"===t.prim)throw new Nt(t,`${t.prim}: type can't be pushed`);Yt(t,(t=>Ht(t)))}return!0}function Gt(t){if(Ct(t)&&Mt(t)){if(!Object.prototype.hasOwnProperty.call(It,t.prim)||"operation"===t.prim||"contract"===t.prim)throw new Nt(t,`${t.prim}: type can't be used as part of a storage`);Yt(t,(t=>Gt(t)))}return!0}function $t(t){if(Ct(t)&&Mt(t)){if(!Object.prototype.hasOwnProperty.call(It,t.prim)||"operation"===t.prim)throw new Nt(t,`${t.prim}: type can't be used as part of a parameter`);Yt(t,(t=>$t(t)))}return!0}function zt(t){if(Ct(t)&&Mt(t)){if(!Object.prototype.hasOwnProperty.call(It,t.prim)||"big_map"===t.prim||"operation"===t.prim||"sapling_state"===t.prim)throw new Nt(t,`${t.prim}: type can't be used inside a big_map`);Yt(t,(t=>zt(t)))}return!0}const qt=new RegExp("^[a-zA-Z0-9_.%@]*$");function Zt(t){if(t.string.length>31)throw new Nt(t,`view name too long: ${t.string}`);if(!qt.test(t.string))throw new Nt(t,`invalid character(s) in view name: ${t.string}`)}function Wt(t){if(Ct(t)&&Mt(t)){if(!Object.prototype.hasOwnProperty.call(It,t.prim))throw new Nt(t,"type expected");Yt(t,(t=>Wt(t)))}return!0}function Yt(t,e){if(Array.isArray(t)||"pair"===t.prim){const r=Array.isArray(t)?t:t.args;if(void 0===r||r.length<2)throw new Nt(t,"at least 2 arguments expected");return r.forEach((t=>{Ct(t)&&e(t)})),!0}switch(t.prim){case"option":case"list":jt(t,1)&&Ct(t.args[0])&&e(t.args[0]);break;case"contract":jt(t,1)&&$t(t.args[0]);break;case"or":jt(t,2)&&Ct(t.args[0])&&Ct(t.args[1])&&(e(t.args[0]),e(t.args[1]));break;case"lambda":jt(t,2)&&(Wt(t.args[0]),Wt(t.args[1]));break;case"set":jt(t,1)&&Vt(t.args[0]);break;case"map":jt(t,2)&&Ct(t.args[0])&&Ct(t.args[1])&&(Vt(t.args[0]),e(t.args[1]));break;case"big_map":jt(t,2)&&Ct(t.args[0])&&Ct(t.args[1])&&(Vt(t.args[0]),zt(t.args[1]),e(t.args[1]));break;case"ticket":jt(t,1)&&Ct(t.args[0])&&Vt(t.args[0]);break;case"sapling_state":case"sapling_transaction":jt(t,1)&&Dt(t.args[0]);break;default:jt(t,0)}return!0}function Jt(t){if("int"in t||"string"in t||"bytes"in t)return!0;if(Array.isArray(t)){let e=0;for(const r of t)Mt(r)&&"Elt"===r.prim?(jt(r,2)&&(Jt(r.args[0]),Jt(r.args[1])),e++):Jt(r);if(0!==e&&e!==t.length)throw new Nt(t,"data entries and map elements can't be intermixed");return!0}if(!Mt(t))throw new Nt(t,"data entry expected");switch(t.prim){case"Unit":case"True":case"False":case"None":jt(t,0);break;case"Pair":if(void 0===t.args||t.args.length<2)throw new Nt(t,"at least 2 arguments expected");for(const e of t.args)Jt(e);break;case"Left":case"Right":case"Some":jt(t,1)&&Jt(t.args[0]);break;default:if(!Object.prototype.hasOwnProperty.call(Pt,t.prim))throw new Nt(t,"data entry or instruction expected");Kt(t)}return!0}function Xt(t){if(Lt(t)){const e={},r={};for(const i of t)if(kt(i)){if("view"!==i.prim){if(i.prim in e)throw new Nt(t,`duplicate contract section: ${i.prim}`);e[i.prim]=!0}switch(i.prim){case"code":jt(i,1)&&Lt(i.args[0])&&Kt(i.args[0]);break;case"parameter":if(jt(i,1)&&$t(i.args[0]),i.annots)throw new Nt(i,"Annotation must be part of the parameter type");break;case"storage":jt(i,1)&&Gt(i.args[0]);break;case"view":if(jt(i,4)){if(Ut(i.args[0])){const e=i.args[0];if(e.string in r)throw new Nt(t,`duplicate view name: ${e.string}`);r[e.string]=!0,Zt(e)}Ht(i.args[1]),Ht(i.args[2]),Lt(i.args[3])&&Kt(i.args[3])}break;default:throw new Nt(t,`unexpected contract section: ${i.prim}`)}}}return!0}function Qt(t){try{return Xt(t),!0}catch(t){return!1}}function te(t){try{return Jt(t),!0}catch(t){return!1}}function ee(t){try{return Kt(t),!0}catch(t){return!1}}function re(t){try{return Wt(t),!0}catch(t){return!1}}function ie(t){return Object.prototype.hasOwnProperty.call(Pt,t.prim)}function ne(t){if(!Array.isArray(t))return!1;for(const e of t)if("prim"in e){if(ie(e))throw new ut(t,`Instruction outside of a lambda: ${JSON.stringify(t)}`);if("Elt"===e.prim)throw new ut(t,`Elt item outside of a map literal: ${JSON.stringify(t)}`)}return!0}const se=["parameter","storage","code","False","Elt","Left","None","Pair","Right","Some","True","Unit","PACK","UNPACK","BLAKE2B","SHA256","SHA512","ABS","ADD","AMOUNT","AND","BALANCE","CAR","CDR","CHECK_SIGNATURE","COMPARE","CONCAT","CONS","CREATE_ACCOUNT","CREATE_CONTRACT","IMPLICIT_ACCOUNT","DIP","DROP","DUP","EDIV","EMPTY_MAP","EMPTY_SET","EQ","EXEC","FAILWITH","GE","GET","GT","HASH_KEY","IF","IF_CONS","IF_LEFT","IF_NONE","INT","LAMBDA","LE","LEFT","LOOP","LSL","LSR","LT","MAP","MEM","MUL","NEG","NEQ","NIL","NONE","NOT","NOW","OR","PAIR","PUSH","RIGHT","SIZE","SOME","SOURCE","SENDER","SELF","STEPS_TO_QUOTA","SUB","SWAP","TRANSFER_TOKENS","SET_DELEGATE","UNIT","UPDATE","XOR","ITER","LOOP_LEFT","ADDRESS","CONTRACT","ISNAT","CAST","RENAME","bool","contract","int","key","key_hash","lambda","list","map","big_map","nat","option","or","pair","set","signature","string","bytes","mutez","timestamp","unit","operation","address","SLICE","DIG","DUG","EMPTY_BIG_MAP","APPLY","chain_id","CHAIN_ID","LEVEL","SELF_ADDRESS","never","NEVER","UNPAIR","VOTING_POWER","TOTAL_VOTING_POWER","KECCAK","SHA3","PAIRING_CHECK","bls12_381_g1","bls12_381_g2","bls12_381_fr","sapling_state","sapling_transaction","SAPLING_EMPTY_STATE","SAPLING_VERIFY_UPDATE","ticket","TICKET","READ_TICKET","SPLIT_TICKET","JOIN_TICKETS","GET_AND_UPDATE","chest","chest_key","OPEN_CHEST","VIEW","view","constant","SUB_MUTEZ","EMIT"],oe=Object.assign({},...se.map(((t,e)=>({[t]:e}))));var ae;!function(t){t[t.Int=0]="Int",t[t.String=1]="String",t[t.Sequence=2]="Sequence",t[t.Prim0=3]="Prim0",t[t.Prim0Annot=4]="Prim0Annot",t[t.Prim1=5]="Prim1",t[t.Prim1Annot=6]="Prim1Annot",t[t.Prim2=7]="Prim2",t[t.Prim2Annot=8]="Prim2Annot",t[t.Prim=9]="Prim",t[t.Bytes=10]="Bytes"}(ae||(ae={}));class ce{constructor(){this.buffer=[]}get length(){return this.buffer.length}writeBytes(t){this.buffer.push(...t.map((t=>255&t)))}writeUint8(t){const e=0|t;this.buffer.push(255&e)}writeUint16(t){const e=0|t;this.buffer.push(e>>8&255),this.buffer.push(255&e)}writeUint32(t){const e=0|t;this.buffer.push(e>>24&255),this.buffer.push(e>>16&255),this.buffer.push(e>>8&255),this.buffer.push(255&e)}writeInt8(t){this.writeUint8(t)}writeInt16(t){this.writeUint16(t)}writeInt32(t){this.writeUint32(t)}}const ue=new Error("bounds out of range");class he{constructor(t,e=0,r=t.length){this.buffer=t,this.idx=e,this.cap=r}get length(){return this.cap-this.idx}readBytes(t){if(this.cap-this.idx<t)throw ue;const e=this.buffer.slice(this.idx,this.idx+t);return this.idx+=t,e}reader(t){if(this.cap-this.idx<t)throw ue;const e=new he(this.buffer,this.idx,this.idx+t);return this.idx+=t,e}copy(){return new he(this.buffer,this.idx,this.cap)}readUint8(){if(this.cap-this.idx<1)throw ue;return this.buffer[this.idx++]>>>0}readUint16(){if(this.cap-this.idx<2)throw ue;return(this.buffer[this.idx++]<<8|this.buffer[this.idx++])>>>0}readUint32(){if(this.cap-this.idx<4)throw ue;return(this.buffer[this.idx++]<<24|this.buffer[this.idx++]<<16|this.buffer[this.idx++]<<8|this.buffer[this.idx++])>>>0}readInt8(){if(this.cap-this.idx<1)throw ue;return this.buffer[this.idx++]<<24>>24}readInt16(){if(this.cap-this.idx<2)throw ue;return(this.buffer[this.idx++]<<8|this.buffer[this.idx++])<<16>>16}readInt32(){if(this.cap-this.idx<4)throw ue;return this.buffer[this.idx++]<<24|this.buffer[this.idx++]<<16|this.buffer[this.idx++]<<8|this.buffer[this.idx++]}}var fe,le,de;function pe(t){let e;const r=t.readUint8();switch(r){case le.ED25519:e="ED25519PublicKeyHash";break;case le.SECP256K1:e="SECP256K1PublicKeyHash";break;case le.P256:e="P256PublicKeyHash";break;default:throw new Error(`unknown public key hash tag: ${r}`)}return{type:e,hash:t.readBytes(20)}}function be(t){let e;const r=t.readUint8();switch(r){case fe.Implicit:e=pe(t);break;case fe.Originated:e={type:"ContractHash",hash:t.readBytes(20)},t.readBytes(1);break;default:throw new Error(`unknown address tag: ${r}`)}if(0!==t.length){const r=new TextDecoder;e.entryPoint=r.decode(new Uint8Array(t.readBytes(t.length)))}return e}function ge(t,e){let r;switch(t.type){case"ED25519PublicKeyHash":r=le.ED25519;break;case"SECP256K1PublicKeyHash":r=le.SECP256K1;break;case"P256PublicKeyHash":r=le.P256;break;default:throw new Error(`unexpected address type: ${t.type}`)}e.writeUint8(r),e.writeBytes(Array.from(t.hash))}function me(t){let e,r;const i=t.readUint8();switch(i){case de.ED25519:r="ED25519PublicKey",e=32;break;case de.SECP256K1:r="SECP256K1PublicKey",e=33;break;case de.P256:r="P256PublicKey",e=33;break;default:throw new Error(`unknown public key tag: ${i}`)}return{type:r,publicKey:t.readBytes(e)}}function ve(t,e,r){var i,n;const[s,o]=r(t);if(Array.isArray(s)){const t=new ce;for(const e of s){const r=o.next();if(r.done)throw new Error("REPORT ME: iterator is done");ve(e,t,r.value)}return e.writeUint8(ae.Sequence),e.writeUint32(t.length),void e.writeBytes(t.buffer)}if("string"in s){const t=(new TextEncoder).encode(s.string);return e.writeUint8(ae.String),e.writeUint32(t.length),void e.writeBytes(Array.from(t))}if("int"in s){e.writeUint8(ae.Int);let t=BigInt(s.int);const r=t<0;r&&(t=-t);let i=0;do{const n=0===i?BigInt(6):BigInt(7);let s=t&(BigInt(1)<<n)-BigInt(1);t>>=n,t&&(s|=BigInt(128)),0===i&&r&&(s|=BigInt(64)),e.writeUint8(Number(s)),i++}while(t);return}if("bytes"in s){const t=function(t){const e=[];for(let r=0;r<t.length;r+=2){const i=t.slice(r,r+2),n=parseInt(i,16);if(Number.isNaN(n))throw new ct(i);e.push(n)}return e}(s.bytes);return e.writeUint8(ae.Bytes),e.writeUint32(t.length),void e.writeBytes(t)}const a=oe[s.prim];if(void 0===a)throw new TypeError(`Can't encode primary: ${s.prim}`);const c=((null===(i=s.args)||void 0===i?void 0:i.length)||0)<3?ae.Prim0+2*((null===(n=s.args)||void 0===n?void 0:n.length)||0)+(void 0===s.annots||0===s.annots.length?0:1):ae.Prim;if(e.writeUint8(c),e.writeUint8(a),void 0!==s.args)if(s.args.length<3)for(const t of s.args){const r=o.next();if(r.done)throw new Error("REPORT ME: iterator is done");ve(t,e,r.value)}else{const t=new ce;for(const e of s.args){const r=o.next();if(r.done)throw new Error("REPORT ME: iterator is done");ve(e,t,r.value)}e.writeUint32(t.length),e.writeBytes(t.buffer)}if(void 0!==s.annots&&0!==s.annots.length){const t=(new TextEncoder).encode(s.annots.join(" "));e.writeUint32(t.length),e.writeBytes(Array.from(t))}else void 0!==s.args&&s.args.length>=3&&e.writeUint32(0)}function ye(t,e){function*r(){for(;;)yield Pe}const[i,n]=e,s=t.readUint8();switch(s){case ae.Int:{const e=[];let r;do{r=t.readInt8(),e.push(r)}while(0!=(128&r));let i=BigInt(0),s=!1;for(let t=e.length-1;t>=0;t--){const r=0===t?BigInt(6):BigInt(7),n=BigInt(e[t]);i<<=r,i|=n&(BigInt(1)<<r)-BigInt(1),0===t&&(s=!!(n&BigInt(64)))}return s&&(i=-i),n({int:String(i)})}case ae.String:{const e=t.readUint32(),r=t.readBytes(e);return n({string:(new TextDecoder).decode(new Uint8Array(r))})}case ae.Bytes:{const e=t.readUint32(),r=t.readBytes(e);return n({bytes:Tt(Array.from(r))})}case ae.Sequence:{const e=t.readUint32();let s=[],o=t.copy(),a=r();for(let r=0;r<2;r++){const r=o.reader(e);for(s=[];r.length>0;){const t=a.next();if(t.done)throw new Error("REPORT ME: iterator is done");s.push(ye(r,t.value))}a=i(s),o=t}return n(s)}default:{if(s>9)throw new Error(`Unknown tag: ${s}`);const e=t.readUint8();if(e>=se.length)throw new Error(`Unknown primitive tag: ${e}`);const o=se[e],a=s-3>>1;let c={prim:o},u=r(),h=t.copy();for(let e=0;e<2;e++){if(c={prim:o},a<3)for(let t=0;t<a;t++){const t=u.next();if(t.done)throw new Error("REPORT ME: iterator is done");c.args=c.args||[],c.args.push(ye(h,t.value))}else{c.args=c.args||[];const t=h.readUint32(),e=h.reader(t);for(;e.length>0;){const t=u.next();if(t.done)throw new Error("REPORT ME: iterator is done");c.args.push(ye(e,t.value))}}u=i(c),h=t}if(1==(s-3&1)||3===a){const e=t.readUint32();if(0!==e){const r=t.readBytes(e),i=new TextDecoder;c.annots=i.decode(new Uint8Array(r)).split(" ")}}return n(c)}}}!function(t){t[t.Implicit=0]="Implicit",t[t.Originated=1]="Originated"}(fe||(fe={})),function(t){t[t.ED25519=0]="ED25519",t[t.SECP256K1=1]="SECP256K1",t[t.P256=2]="P256"}(le||(le={})),function(t){t[t.ED25519=0]="ED25519",t[t.SECP256K1=1]="SECP256K1",t[t.P256=2]="P256"}(de||(de={}));const we=t=>"prim"in t&&("Left"===t.prim||"Right"===t.prim),_e=t=>"prim"in t&&("Some"===t.prim||"None"===t.prim),Ee=t=>{if(Et(t))return e=>{if(!St(e))throw new ft(t,e,`pair expected: ${JSON.stringify(e)}`);ne(e);const r=_t("pair",t);return[_t("Pair",e),function*(){for(const t of r.args)yield Ee(t)}()]};switch(t.prim){case"or":return e=>{if(!we(e))throw new ft(t,e,`or expected: ${JSON.stringify(e)}`);return[e,function*(){yield Ee(t.args["Left"===e.prim?0:1])}()]};case"option":return e=>{if(!_e(e))throw new ft(t,e,`option expected: ${JSON.stringify(e)}`);return[e,function*(){"Some"===e.prim&&(yield Ee(t.args[0]))}()]};case"list":case"set":return e=>{if(!Array.isArray(e))throw new ft(t,e,`${t.prim} expected: ${JSON.stringify(e)}`);return[e,function*(){for(const r of e)yield Ee(t.args[0])}()]};case"map":return e=>{if(!Array.isArray(e))throw new ft(t,e,`map expected: ${JSON.stringify(e)}`);return[e,function*(){for(const r of e)yield e=>{if(!("prim"in e)||"Elt"!==e.prim)throw new ft(t,e,`map element expected: ${JSON.stringify(e)}`);return[e,function*(){for(const e of t.args)yield Ee(e)}()]}}()]};case"chain_id":return e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`chain id expected: ${JSON.stringify(e)}`);let r;if("string"in e){const i=yt(e.string,"ChainID");if(null===i)throw new ft(t,e,`chain id base58 expected: ${e.string}`);r={bytes:Tt(i[1])}}else r=e;return[r,[][Symbol.iterator]()]};case"signature":return e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`signature expected: ${JSON.stringify(e)}`);let r;if("string"in e){const i=yt(e.string,"ED25519Signature","SECP256K1Signature","P256Signature","GenericSignature");if(null===i)throw new ft(t,e,`signature base58 expected: ${e.string}`);r={bytes:Tt(i[1])}}else r=e;return[r,[][Symbol.iterator]()]};case"key_hash":return e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`key hash expected: ${JSON.stringify(e)}`);let r;if("string"in e){const i=yt(e.string,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash");if(null===i)throw new ft(t,e,`key hash base58 expected: ${e.string}`);const n=new ce;ge({type:i[0],hash:i[1]},n),r={bytes:Tt(n.buffer)}}else r=e;return[r,[][Symbol.iterator]()]};case"key":return e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`public key expected: ${JSON.stringify(e)}`);let r;if("string"in e){const i=yt(e.string,"ED25519PublicKey","SECP256K1PublicKey","P256PublicKey");if(null===i)throw new ft(t,e,`public key base58 expected: ${e.string}`);const n=new ce;!function(t,e){let r;switch(t.type){case"ED25519PublicKey":r=de.ED25519;break;case"SECP256K1PublicKey":r=de.SECP256K1;break;case"P256PublicKey":r=de.P256;break;default:throw new Error(`unexpected public key type: ${t.type}`)}e.writeUint8(r),e.writeBytes(Array.from(t.publicKey))}({type:i[0],publicKey:i[1]},n),r={bytes:Tt(n.buffer)}}else r=e;return[r,[][Symbol.iterator]()]};case"address":return e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`address expected: ${JSON.stringify(e)}`);let r;if("string"in e){const i=e.string.split("%"),n=yt(i[0],"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash","ContractHash");if(null===n)throw new ft(t,e,`address base58 expected: ${e.string}`);const s=new ce;!function(t,e){if("ContractHash"===t.type?(e.writeUint8(fe.Originated),e.writeBytes(Array.from(t.hash)),e.writeUint8(0)):(e.writeUint8(fe.Implicit),ge(t,e)),void 0!==t.entryPoint&&""!==t.entryPoint&&"default"!==t.entryPoint){const r=(new TextEncoder).encode(t.entryPoint);e.writeBytes(Array.from(r))}}({type:n[0],hash:n[1],entryPoint:i.length>1?i[1]:void 0},s),r={bytes:Tt(s.buffer)}}else r=e;return[r,[][Symbol.iterator]()]};case"timestamp":return e=>{if(!("string"in e)&&!("int"in e))throw new ft(t,e,`timestamp expected: ${JSON.stringify(e)}`);let r;if("string"in e){const i=Ot(e);if(null===i)throw new ft(t,e,`can't parse date: ${e.string}`);r={int:String(Math.floor(i.getTime()/1e3))}}else r=e;return[r,[][Symbol.iterator]()]};default:return Ae}},Se=t=>"prim"in t&&"PUSH"===t.prim,Ae=t=>Se(t)?(Kt(t),[t,function*(){yield Ae,yield Ee(t.args[0])}()]):[t,function*(){for(;;)yield Ae}()];function Oe(t,e){const r=new ce;return r.writeUint8(5),ve(t,r,void 0!==e?Ee(e):Ae),r.buffer}function Te(t,e){return{bytes:Tt(Oe(t,e))}}const xe=t=>{if(Et(t))return[e=>{if(!St(e))throw new ft(t,e,`pair expected: ${JSON.stringify(e)}`);const r=_t("pair",t);return function*(){for(const t of r.args)yield xe(t)}()},t=>t];switch(t.prim){case"or":return[e=>{if(!we(e))throw new ft(t,e,`or expected: ${JSON.stringify(e)}`);return function*(){yield xe(t.args["Left"===e.prim?0:1])}()},t=>t];case"option":return[e=>{if(!_e(e))throw new ft(t,e,`option expected: ${JSON.stringify(e)}`);return function*(){"Some"===e.prim&&(yield xe(t.args[0]))}()},t=>t];case"list":case"set":return[e=>{if(!Array.isArray(e))throw new ft(t,e,`${t.prim} expected: ${JSON.stringify(e)}`);return function*(){for(;;)yield xe(t.args[0])}()},t=>t];case"map":return[e=>{if(!Array.isArray(e))throw new ft(t,e,`map expected: ${JSON.stringify(e)}`);return function*(){for(;;)yield[e=>{if(!("prim"in e)||"Elt"!==e.prim)throw new ft(t,e,`map element expected: ${JSON.stringify(e)}`);return function*(){for(const e of t.args)yield xe(e)}()},t=>t]}()},t=>t];case"chain_id":return[()=>[][Symbol.iterator](),e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`chain id expected: ${JSON.stringify(e)}`);if("string"in e)return e;const r=dt(e.bytes);if(null===r)throw new ft(t,e,`can't parse bytes: ${e.bytes}`);return{string:wt("ChainID",r)}}];case"signature":return[()=>[][Symbol.iterator](),e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`signature expected: ${JSON.stringify(e)}`);if("string"in e)return e;const r=dt(e.bytes);if(null===r)throw new ft(t,e,`can't parse bytes: ${e.bytes}`);return{string:wt("GenericSignature",r)}}];case"key_hash":return[()=>[][Symbol.iterator](),e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`key hash expected: ${JSON.stringify(e)}`);if("string"in e)return e;const r=dt(e.bytes);if(null===r)throw new ft(t,e,`can't parse bytes: ${e.bytes}`);const i=pe(new he(new Uint8Array(r)));return{string:wt(i.type,i.hash)+(i.entryPoint?"%"+i.entryPoint:"")}}];case"key":return[()=>[][Symbol.iterator](),e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`public key expected: ${JSON.stringify(e)}`);if("string"in e)return e;const r=dt(e.bytes);if(null===r)throw new ft(t,e,`can't parse bytes: ${e.bytes}`);const i=me(new he(new Uint8Array(r)));return{string:wt(i.type,i.publicKey)}}];case"address":return[()=>[][Symbol.iterator](),e=>{if(!("bytes"in e)&&!("string"in e))throw new ft(t,e,`address expected: ${JSON.stringify(e)}`);if("string"in e)return e;const r=dt(e.bytes);if(null===r)throw new ft(t,e,`can't parse bytes: ${e.bytes}`);const i=be(new he(new Uint8Array(r)));return{string:wt(i.type,i.hash)+(i.entryPoint?"%"+i.entryPoint:"")}}];case"timestamp":return[()=>[][Symbol.iterator](),e=>{if(!("int"in e)&&!("string"in e))throw new ft(t,e,`address expected: ${JSON.stringify(e)}`);if("string"in e)return e;return{string:new Date(1e3*parseInt(e.int,10)).toISOString().slice(0,19)+"Z"}}];default:return Pe}},Pe=[t=>Se(t)?(Kt(t),function*(){yield Pe,yield xe(t.args[0])}()):function*(){for(;;)yield Pe}(),t=>t];function Re(t,e){const r=new he(t);if(5!==r.readUint8())throw new Error("incorrect packed data magic number");const i=ye(r,void 0!==e?xe(e):Pe);if(Jt(i))return i;throw new Error}function Ie(t,e){const r=dt(t.bytes);if(null===r)throw new Error(`can't parse bytes: "${t.bytes}"`);return Re(r,e)}function Ne(t){const e=dt(t.bytes);if(null===e)throw new Error(`can't parse bytes: "${t.bytes}"`);return be(new he(new Uint8Array(e)))}function Me(t){const e=dt(t.bytes);if(null===e)throw new Error(`can't parse bytes: "${t.bytes}"`);return pe(new he(new Uint8Array(e)))}function ke(t){const e=dt(t.bytes);if(null===e)throw new Error(`can't parse bytes: "${t.bytes}"`);return me(new he(new Uint8Array(e)))}class Le extends ut{constructor(t,e,r){super(t,r),this.stackState=e,Object.setPrototypeOf(this,Le.prototype)}}function Ce(t){return Array.isArray(t)?"pair":t.prim}function Be(t){return"prim"in t?t.args:t}function De(t,e,r=!1){if(Ce(t)!==Ce(e))throw new ft(t,void 0,`types mismatch: ${Ce(t)} != ${Ce(e)}`);const i=[mt(t),mt(e)];if(i[0].t&&i[1].t&&i[0].t[0]!==i[1].t[0])throw new ft(t,void 0,`${Ce(t)}: type names mismatch: ${i[0].t[0]} != ${i[1].t[0]}`);if(r&&i[0].f&&i[1].f&&i[0].f[0]!==i[1].f[0])throw new ft(t,void 0,`${Ce(t)}: field names mismatch: ${i[0].f[0]} != ${i[1].f}`);if(Et(t)){const r=_t("pair",t),i=_t("pair",e);return De(r.args[0],i.args[0],!0),void De(r.args[1],i.args[1],!0)}switch(t.prim){case"option":case"list":case"contract":case"set":case"ticket":De(t.args[0],e.args[0]);break;case"or":De(t.args[0],e.args[0],!0),De(t.args[1],e.args[1],!0);break;case"lambda":case"map":case"big_map":De(t.args[0],e.args[0]),De(t.args[1],e.args[1]);break;case"sapling_state":case"sapling_transaction":if(parseInt(t.args[0].int,10)!==parseInt(e.args[0].int,10))throw new ft(t,void 0,`${Ce(t)}: type argument mismatch: ${t.args[0].int} != ${e.args[0].int}`)}}function Ue(t,e){if(t.length!==e.length)throw new ft(t,void 0,`stack length mismatch: ${t.length} != ${e.length}`);for(let r=0;r<t.length;r++)De(t[r],e[r])}function je(t,e=!1){var r,i,n;if(!Array.isArray(t)){const s=mt(t);if(((null===(r=s.t)||void 0===r?void 0:r.length)||0)>1)throw new ft(t,void 0,`${t.prim}: at most one type annotation allowed: ${t.annots}`);if(e){if(((null===(i=s.f)||void 0===i?void 0:i.length)||0)>1)throw new ft(t,void 0,`${t.prim}: at most one field annotation allowed: ${t.annots}`)}else if(((null===(n=s.f)||void 0===n?void 0:n.length)||0)>0)throw new ft(t,void 0,`${t.prim}: field annotations aren't allowed: ${t.annots}`)}if(Et(t)){const e=Be(t);for(const t of e)je(t,!0)}else switch(t.prim){case"option":case"list":case"contract":case"set":je(t.args[0]);break;case"or":for(const e of t.args)je(e,!0);break;case"lambda":case"map":case"big_map":je(t.args[0]),je(t.args[1])}}function Ke(t){if(!Array.isArray(t))return!1;for(const e of t)if(!(Array.isArray(e)&&Ke(e)||"prim"in e&&ie(e)))return!1;return!0}function Ve(t,e,r){if(Et(e)){if(St(t)){ne(t);const i=_t("Pair",t),n=_t("pair",e);return Ve(i.args[0],n.args[0],r),void Ve(i.args[1],n.args[1],r)}throw new ft(e,t,`pair expected: ${JSON.stringify(t)}`)}switch(e.prim){case"int":if("int"in t&&pt(t.int))return;throw new ft(e,t,`integer value expected: ${JSON.stringify(t)}`);case"nat":case"mutez":if("int"in t&&bt(t.int))return;throw new ft(e,t,`natural value expected: ${JSON.stringify(t)}`);case"string":if("string"in t)return;throw new ft(e,t,`string value expected: ${JSON.stringify(t)}`);case"bytes":case"bls12_381_g1":case"bls12_381_g2":if("bytes"in t&&null!==dt(t.bytes))return;throw new ft(e,t,`bytes value expected: ${JSON.stringify(t)}`);case"bool":if("prim"in t&&("True"===t.prim||"False"===t.prim))return;throw new ft(e,t,`boolean value expected: ${JSON.stringify(t)}`);case"key_hash":if("string"in t&&null!==yt(t.string,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash"))return;if("bytes"in t)try{return void Me(t)}catch(t){}throw new ft(e,t,`key hash expected: ${JSON.stringify(t)}`);case"timestamp":if(("string"in t||"int"in t)&&null!==Ot(t))return;throw new ft(e,t,`timestamp expected: ${JSON.stringify(t)}`);case"address":if("string"in t){let e=t.string;const r=t.string.indexOf("%");if(r>=0&&(e=t.string.slice(0,r)),null!==yt(e,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash","ContractHash","TxRollupL2Address","RollupAddress"))return}else if("bytes"in t)try{return void Ne(t)}catch(t){}throw new ft(e,t,`address expected: ${JSON.stringify(t)}`);case"key":if("string"in t&&null!==yt(t.string,"ED25519PublicKey","SECP256K1PublicKey","P256PublicKey"))return;if("bytes"in t)try{return void ke(t)}catch(t){}throw new ft(e,t,`public key expected: ${JSON.stringify(t)}`);case"unit":if("prim"in t&&"Unit"===t.prim)return;throw new ft(e,t,`unit value expected: ${JSON.stringify(t)}`);case"signature":if("bytes"in t||"string"in t&&null!==yt(t.string,"ED25519Signature","SECP256K1Signature","P256Signature","GenericSignature"))return;throw new ft(e,t,`signature expected: ${JSON.stringify(t)}`);case"chain_id":if("bytes"in t||"string"in t){if(null!==("string"in t?tt(t.string):dt(t.bytes)))return}throw new ft(e,t,`chain id expected: ${JSON.stringify(t)}`);case"option":if("prim"in t){if("None"===t.prim)return;if("Some"===t.prim)return void Ve(t.args[0],e.args[0],r)}throw new ft(e,t,`option expected: ${JSON.stringify(t)}`);case"list":case"set":if(ne(t)){for(const i of t)Ve(i,e.args[0],r);return}throw new ft(e,t,`${e.prim} expected: ${JSON.stringify(t)}`);case"or":if("prim"in t){if("Left"===t.prim)return void Ve(t.args[0],e.args[0],r);if("Right"===t.prim)return void Ve(t.args[0],e.args[1],r)}throw new ft(e,t,`union (or) expected: ${JSON.stringify(t)}`);case"lambda":if(Ke(t)){const i=Fe(t,[e.args[0]],r);if("failed"in i)throw new ft(e,t,`function is failed with error type: ${i.failed}`);if(1!==i.length)throw new ft(e,t,"function must return a value");return void De(e.args[1],i[0])}throw new ft(e,t,`function expected: ${JSON.stringify(t)}`);case"map":case"big_map":if(Array.isArray(t)){for(const i of t){if(!("prim"in i)||"Elt"!==i.prim)throw new ft(e,t,`map elements expected: ${JSON.stringify(t)}`);Ve(i.args[0],e.args[0],r),Ve(i.args[1],e.args[1],r)}return}throw new ft(e,t,`${e.prim} expected: ${JSON.stringify(t)}`);case"bls12_381_fr":if("int"in t&&pt(t.int)||"bytes"in t&&null!==dt(t.bytes))return;throw new ft(e,t,`BLS12-381 element expected: ${JSON.stringify(t)}`);case"sapling_state":if(Array.isArray(t))return;throw new ft(e,t,`sapling state expected: ${JSON.stringify(t)}`);case"ticket":return void Ve(t,{prim:"pair",args:[{prim:"address"},e.args[0],{prim:"nat"}]},r);default:throw new ft(e,t,`type ${Ce(e)} don't have Michelson literal representation`)}}function Fe(t,e,r){const i=(null==r?void 0:r.protocol)||p;if(Array.isArray(t))return function(t,e,r){let i=e,n=e,s=0;for(const e of t){const t=Fe(e,n,r);if(i=t,"failed"in t)break;n=t,s++}if("failed"in i&&0==i.level&&(!("prim"in i.failed)||"never"!==i.failed.prim)&&s!==t.length-1)throw new Le(t,i,"FAIL must appear in a tail position");if(void 0!==(null==r?void 0:r.traceCallback)){const n={op:t,in:e,out:i};r.traceCallback(n)}return"failed"in i?{failed:i.failed,level:i.level+1}:i}(t,e,r);const n=t;function s(t,...r){if(e.length<r.length+t)throw new Le(n,e,`${n.prim}: stack must have at least ${r.length} element(s)`);let i=t;for(const t of r){if(null!==t&&0!==t.length){let r=0;for(;r<t.length&&t[r]!==Ce(e[i]);)r++;if(r===t.length)throw new Le(n,e,`${n.prim}: stack type mismatch: [${i}] expected to be ${t}, got ${Ce(e[i])} instead`)}i++}return e.slice(t,r.length+t)}function o(t){return(...r)=>{try{return t(...r)}catch(t){throw t instanceof ut?new Le(n,e,t.message):t}}}function a(t){return r=>{try{return t(r)}catch(t){throw t instanceof ut?new Le(n,e,t.message):t}}}const c=o(mt),u=o(Ue),h=o(De),f=a(Vt),b=a(Ft),g=a(Gt),v=a(Ht),y=a(zt);function w(t,r){const i=c(n,Object.assign(Object.assign({},r),{emptyFields:void 0!==t.f&&t.f>1,emptyVar:void 0!==t.v&&t.v>1})),s=(t,r,i)=>{if(t&&t.length>(r||0))throw new Le(n,e,`${n.prim}: at most ${r||0} ${i} annotations allowed`)};return s(i.f,t.f,"field"),s(i.t,t.t,"type"),s(i.v,t.v,"variable"),i}function _(t,e){const r=t,i=Array.isArray(r)?{prim:"pair",args:r}:r,n=c(i),s=void 0!==e.v||void 0!==e.t||void 0!==e.f?[...(null===e.v?n.v:e.v)||[],...(null===e.t?n.t:e.t)||[],...(null===e.f?n.f:e.f)||[]]:void 0,o=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r}(i,["annots"]);return Object.assign(Object.assign({},o),s&&0!==s.length&&{annots:s})}function E(t,e){const r=w({v:1});return _(t,{v:void 0!==r.v?r.v:void 0!==e?[e]:null,t:null})}function S(t,r,i,s,o){var a,u,h,f;const l=null===(a=c(r).f)||void 0===a?void 0:a[0],d=null===(u=i.f)||void 0===u?void 0:u[s];if(void 0!==d&&"%"!==d&&void 0!==l&&d!==l)throw new Le(n,e,`${n.prim}: field names doesn't match: ${d} !== ${l}`);const p=null===(h=i.v)||void 0===h?void 0:h[s],b=null===(f=c(t).v)||void 0===f?void 0:f[0];return _(r,{t:null,v:p?"@%"===p?l?["@"+l.slice(1)]:void 0:"@%%"===p?b?["@"+b.slice(1)+"."+(l?l.slice(1):o)]:l?["@"+l.slice(1)]:void 0:[p]:null})}function A(t,r,i=r){const s=_t("pair",t);if(1===i)return[s.args[0]];if(2===i)return s.args;const o=s.args[1];if(Et(o))return[s.args[0],...A(o,r,i-1)];throw new Le(n,e,`${n.prim}: at least ${r} fields are expected`)}function O(t,r,i=r){if(0===i)return t;const s=_t("pair",t);if(1===i)return s.args[0];const o=s.args[1];if(Et(o))return O(o,r,i-2);if(2===i)return o;throw new Le(n,e,`${n.prim}: at least ${r+1} fields are expected`)}function T(t,r,i,s=i){if(0===s)return r;const o=_t("pair",t);if(1===s)return Object.assign(Object.assign({},o),{args:[r,o.args[1]]});const a=o.args[1];if(Et(a))return Object.assign(Object.assign({},o),{args:[o.args[0],T(a,r,i,s-2)]});if(2===s)return Object.assign(Object.assign({},o),{args:[o.args[0],r]});throw new Le(n,e,`${n.prim}: at least ${i+1} fields are expected`)}const x=(t,e)=>["@"+(t.v?t.v[0].slice(1)+".":"")+e];function P(t,e){return"failed"in t||"failed"in e?"failed"in t?e:t:(u(t,e),t)}const R=(t=>{var n,o,a,p,R;switch(t.prim){case"DUP":{const r=t.args?parseInt(t.args[0].int,10):1;if(0===r)throw new Le(t,e,"DUP 0 is forbidden");const i=s(r-1,null)[0];if("ticket"===Ce(i))throw new Le(t,e,"ticket can't be DUPed");return[i,...e]}case"SWAP":{const t=s(0,null,null);return w({}),[t[1],t[0],...e.slice(2)]}case"SOME":return[_({prim:"option",args:[s(0,null)[0]]},w({t:1,v:1})),...e.slice(1)];case"UNIT":return[_({prim:"unit"},w({v:1,t:1})),...e];case"PAIR":{const r=t.args?parseInt(t.args[0].int,10):2;if(r<2)throw new Le(t,e,`PAIR ${r} is forbidden`);const i=s(0,...new Array(r).fill(null)),n=w({f:r,t:1,v:1},{specialFields:!0}),o=t=>{const e=t.lastIndexOf(".");return t.slice(e>0?e+1:1)},a=i.map(((t,e)=>{var r;const i=c(t);return _(t,{v:null,t:null,f:n.f&&n.f.length>e&&"%"!==n.f[e]?"%@"===n.f[e]?i.v?["%"+o((null===(r=i.v)||void 0===r?void 0:r[0])||"")]:void 0:[n.f[e]]:void 0})}));return[_({prim:"pair",args:a},{t:n.t,v:n.v}),...e.slice(r)]}case"UNPAIR":{const r=t.args?parseInt(t.args[0].int,10):2;if(r<2)throw new Le(t,e,`UNPAIR ${r} is forbidden`);const i=s(0,["pair"])[0],n=w({f:2,v:2},{specialVar:!0});return[...A(i,r).map(((t,e)=>S(i,t,n,e,0===e?"car":"cdr"))),...e.slice(1)]}case"CAR":case"CDR":{const r=_t("pair",s(0,["pair"])[0]);return[S(r,r.args["CAR"===t.prim?0:1],w({f:1,v:1},{specialVar:!0}),0,t.prim.toLocaleLowerCase()),...e.slice(1)]}case"CONS":{const t=s(0,null,["list"]);return h(t[0],t[1].args[0]),[E({prim:"list",args:[t[1].args[0]]}),...e.slice(2)]}case"SIZE":return s(0,["string","list","set","map","bytes"]),[E({prim:"nat"}),...e.slice(1)];case"MEM":{const t=s(0,null,["set","map","big_map"]);return f(t[0]),h(t[0],t[1].args[0]),[E({prim:"bool"}),...e.slice(2)]}case"GET":if(t.args){const r=parseInt(t.args[0].int,10);return[E(O(s(0,["pair"])[0],r)),...e.slice(1)]}{const t=s(0,null,["map","big_map"]);return f(t[0]),h(t[0],t[1].args[0]),[E({prim:"option",args:[t[1].args[1]]}),...e.slice(2)]}case"UPDATE":if(t.args){const r=parseInt(t.args[0].int,10),i=s(0,null,["pair"]);return[E(T(i[1],i[0],r)),...e.slice(2)]}{const t=s(0,null,["bool","option"]);if(f(t[0]),"bool"===t[1].prim){const r=s(2,["set"]);return h(t[0],r[0].args[0]),[E({prim:"set",args:[_(t[0],{t:null})]}),...e.slice(3)]}const r=s(2,["map","big_map"]);return h(t[0],r[0].args[0]),"map"===r[0].prim?[E({prim:"map",args:[_(t[0],{t:null}),_(t[1].args[0],{t:null})]}),...e.slice(3)]:(y(t[1].args[0]),[E({prim:"big_map",args:[_(t[0],{t:null}),_(t[1].args[0],{t:null})]}),...e.slice(3)])}case"GET_AND_UPDATE":{const t=w({v:2}),r=s(0,null,["option"],["map","big_map"]);f(r[0]),h(r[0],r[2].args[0]),h(r[1].args[0],r[2].args[1]);const i=null===(n=t.v)||void 0===n?void 0:n.map((t=>"@"!==t?[t]:void 0));return"map"===r[2].prim?[_({prim:"option",args:[r[2].args[1]]},{v:null==i?void 0:i[0]}),_({prim:"map",args:[_(r[0],{t:null}),_(r[1].args[0],{t:null})]},{v:null==i?void 0:i[1]}),...e.slice(3)]:(y(r[1].args[0]),[_({prim:"option",args:[r[2].args[1]]},{v:null==i?void 0:i[0]}),_({prim:"big_map",args:[_(r[0],{t:null}),_(r[1].args[0],{t:null})]},{v:null==i?void 0:i[1]}),...e.slice(3)])}case"EXEC":{const t=s(0,null,["lambda"]);return h(t[0],t[1].args[0]),[E(t[1].args[1]),...e.slice(2)]}case"APPLY":{const r=s(0,null,["lambda"]);if(g(r[0]),v(r[0]),!Et(r[1].args[0]))throw new Le(t,e,`${t.prim}: function's argument must be a pair: ${Ce(r[1].args[0])}`);const i=r[1].args[0];return h(r[0],Be(i)[0]),[E({prim:"lambda",args:[Be(i)[1],r[1].args[1]]}),...e.slice(2)]}case"FAILWITH":{const t=s(0,null)[0];return m(i,d.PtEdo2Zk)||b(t),{failed:t,level:0}}case"NEVER":return s(0,["never"]),{failed:{prim:"never"},level:0};case"RENAME":return[E(s(0,null)[0]),...e.slice(1)];case"CONCAT":{const r=s(0,["string","list","bytes"]);if("list"===r[0].prim){if("string"!==Ce(r[0].args[0])&&"bytes"!==Ce(r[0].args[0]))throw new Le(t,e,`${t.prim}: can't concatenate list of ${Ce(r[0].args[0])}'s`);return[E(r[0].args[0]),...e.slice(1)]}const i=s(1,["string","bytes"]);if(r[0].prim!==i[0].prim)throw new Le(t,e,`${t.prim}: can't concatenate ${r[0].prim} with ${i[0].prim}`);return[E(i[0]),...e.slice(2)]}case"SLICE":return[E({prim:"option",args:[s(0,["nat"],["nat"],["string","bytes"])[2]]},"@slice"),...e.slice(3)];case"PACK":{const t=s(0,null)[0];return b(t),[E({prim:"bytes"},"@packed"),...e.slice(1)]}case"ADD":{const r=s(0,["nat","int","timestamp","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"],["nat","int","timestamp","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"]);if("nat"===r[0].prim&&"int"===r[1].prim||"int"===r[0].prim&&"nat"===r[1].prim)return[E({prim:"int"}),...e.slice(2)];if("int"===r[0].prim&&"timestamp"===r[1].prim||"timestamp"===r[0].prim&&"int"===r[1].prim)return[E({prim:"timestamp"}),...e.slice(2)];if(("int"===r[0].prim||"nat"===r[0].prim||"mutez"===r[0].prim||"bls12_381_g1"===r[0].prim||"bls12_381_g2"===r[0].prim||"bls12_381_fr"===r[0].prim)&&r[0].prim===r[1].prim)return[E(r[0]),...e.slice(2)];throw new Le(t,e,`${t.prim}: can't add ${r[0].prim} to ${r[1].prim}`)}case"SUB":{const r=m(i,d.PsiThaCa)?s(0,["nat","int","timestamp","mutez"],["nat","int","timestamp","mutez"]):s(0,["nat","int","timestamp"],["nat","int","timestamp"]);if(("nat"===r[0].prim||"int"===r[0].prim)&&("nat"===r[1].prim||"int"===r[1].prim)||"timestamp"===r[0].prim&&"timestamp"===r[1].prim)return[E({prim:"int"}),...e.slice(2)];if("timestamp"===r[0].prim&&"int"===r[1].prim)return[E({prim:"timestamp"}),...e.slice(2)];if("mutez"===r[0].prim&&"mutez"===r[1].prim)return[E({prim:"mutez"}),...e.slice(2)];throw new Le(t,e,`${t.prim}: can't subtract ${r[0].prim} from ${r[1].prim}`)}case"SUB_MUTEZ":return s(0,["mutez"],["mutez"]),[E({prim:"option",args:[{prim:"mutez"}]}),...e.slice(2)];case"MUL":{const r=s(0,["nat","int","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"],["nat","int","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"]);if("nat"===r[0].prim&&"int"===r[1].prim||"int"===r[0].prim&&"nat"===r[1].prim)return[E({prim:"int"}),...e.slice(2)];if("nat"===r[0].prim&&"mutez"===r[1].prim||"mutez"===r[0].prim&&"nat"===r[1].prim)return[E({prim:"mutez"}),...e.slice(2)];if(("bls12_381_g1"===r[0].prim||"bls12_381_g2"===r[0].prim||"bls12_381_fr"===r[0].prim)&&"bls12_381_fr"===r[1].prim||("nat"===r[0].prim||"int"===r[0].prim)&&r[0].prim===r[1].prim)return[E(r[0]),...e.slice(2)];if(("nat"===r[0].prim||"int"===r[0].prim)&&"bls12_381_fr"===r[1].prim||("nat"===r[1].prim||"int"===r[1].prim)&&"bls12_381_fr"===r[0].prim)return[E({prim:"bls12_381_fr"}),...e.slice(2)];throw new Le(t,e,`${t.prim}: can't multiply ${r[0].prim} by ${r[1].prim}`)}case"EDIV":{const r=(t,e)=>({prim:"option",args:[{prim:"pair",args:[{prim:t},{prim:e}]}]}),i=s(0,["nat","int","mutez"],["nat","int","mutez"]);if("nat"===i[0].prim&&"nat"===i[1].prim)return[E(r("nat","nat")),...e.slice(2)];if(!("nat"!==i[0].prim&&"int"!==i[0].prim||"nat"!==i[1].prim&&"int"!==i[1].prim))return[E(r("int","nat")),...e.slice(2)];if("mutez"===i[0].prim&&"nat"===i[1].prim)return[E(r("mutez","mutez")),...e.slice(2)];if("mutez"===i[0].prim&&"mutez"===i[1].prim)return[E(r("nat","mutez")),...e.slice(2)];throw new Le(t,e,`${t.prim}: can't euclideally divide ${i[0].prim} by ${i[1].prim}`)}case"ABS":return s(0,["int"]),[E({prim:"nat"}),...e.slice(1)];case"ISNAT":return s(0,["int"]),[E({prim:"option",args:[{prim:"nat"}]}),...e.slice(1)];case"INT":return s(0,["nat","bls12_381_fr"]),[E({prim:"int"}),...e.slice(1)];case"NEG":{const t=s(0,["nat","int","bls12_381_g1","bls12_381_g2","bls12_381_fr"])[0];return"nat"===t.prim||"int"===t.prim?[E({prim:"int"}),...e.slice(1)]:[E(t),...e.slice(1)]}case"LSL":case"LSR":return s(0,["nat"],["nat"]),[E({prim:"nat"}),...e.slice(2)];case"OR":case"XOR":{const r=s(0,["nat","bool"],["nat","bool"]);if(r[0].prim!==r[1].prim)throw new Le(t,e,`${t.prim}: both arguments must be of the same type: ${r[0].prim}, ${r[1].prim}`);return[E(r[1]),...e.slice(2)]}case"AND":{const r=s(0,["nat","bool","int"],["nat","bool"]);if(("int"!==r[0].prim||"nat"!==r[1].prim)&&r[0].prim!==r[1].prim)throw new Le(t,e,`${t.prim}: both arguments must be of the same type: ${r[0].prim}, ${r[1].prim}`);return[E(r[1]),...e.slice(2)]}case"NOT":return"bool"===s(0,["nat","bool","int"])[0].prim?[E({prim:"bool"}),...e.slice(1)]:[E({prim:"int"}),...e.slice(1)];case"COMPARE":{const t=s(0,null,null);return f(t[0]),f(t[1]),[E({prim:"int"}),...e.slice(2)]}case"EQ":case"NEQ":case"LT":case"GT":case"LE":case"GE":return s(0,["int"]),[E({prim:"bool"}),...e.slice(1)];case"SELF":{if(void 0===(null==r?void 0:r.contract))throw new Le(t,e,`${t.prim}: contract required`);const i=w({f:1,v:1}),n=ze(r.contract,null===(o=i.f)||void 0===o?void 0:o[0]);if(null===n)throw new Le(t,e,`${t.prim}: contract has no entrypoint ${n}`);return[_({prim:"contract",args:[n]},{v:i.v?i.v:["@self"]}),...e]}case"TRANSFER_TOKENS":{const t=s(0,null,["mutez"],["contract"]);return h(t[0],t[2].args[0]),[E({prim:"operation"}),...e.slice(3)]}case"SET_DELEGATE":{const r=s(0,["option"])[0];if("key_hash"!==Ce(r.args[0]))throw new Le(t,e,`${t.prim}: key hash expected: ${Ce(r.args[0])}`);return[E({prim:"operation"}),...e.slice(1)]}case"IMPLICIT_ACCOUNT":return s(0,["key_hash"]),[E({prim:"contract",args:[{prim:"unit"}]}),...e.slice(1)];case"NOW":return[E({prim:"timestamp"},"@now"),...e];case"AMOUNT":return[E({prim:"mutez"},"@amount"),...e];case"BALANCE":return[E({prim:"mutez"},"@balance"),...e];case"CHECK_SIGNATURE":return s(0,["key"],["signature"],["bytes"]),[E({prim:"bool"}),...e.slice(3)];case"BLAKE2B":case"SHA256":case"SHA512":case"KECCAK":case"SHA3":return s(0,["bytes"]),[E({prim:"bytes"}),...e.slice(1)];case"HASH_KEY":return s(0,["key"]),[E({prim:"key_hash"}),...e.slice(1)];case"SOURCE":return[E({prim:"address"},"@source"),...e];case"SENDER":return[E({prim:"address"},"@sender"),...e];case"ADDRESS":{const t=s(0,["contract"])[0],r=w({v:1});return[_({prim:"address",[l]:t},{v:r.v?r.v:x(c(t),"address")}),...e.slice(1)]}case"SELF_ADDRESS":{const t={prim:"address"};return void 0!==(null==r?void 0:r.contract)&&(t[l]={prim:"contract",args:[He(r.contract,"parameter").args[0]]}),[E(t,"@address"),...e]}case"CHAIN_ID":return[E({prim:"chain_id"}),...e];case"DROP":{w({});const r=void 0!==t.args?parseInt(t.args[0].int,10):1;return s(r-1,null),e.slice(r)}case"DIG":{w({});const r=parseInt(t.args[0].int,10);return[s(r,null)[0],...e.slice(0,r),...e.slice(r+1)]}case"DUG":{w({});const r=parseInt(t.args[0].int,10);return[...e.slice(1,r+1),s(0,null)[0],...e.slice(r+1)]}case"NONE":return je(t.args[0]),[_({prim:"option",args:[t.args[0]]},w({t:1,v:1})),...e];case"LEFT":case"RIGHT":{const r=s(0,null)[0],i=w({f:2,t:1,v:1},{specialFields:!0}),n=c(r),o=[_(r,{t:null,v:null,f:i.f&&i.f.length>0&&"%"!==i.f[0]?"%@"===i.f[0]?n.v?["%"+n.v[0].slice(1)]:void 0:i.f:void 0}),_(t.args[0],{t:null,f:i.f&&i.f.length>1&&"%"!==i.f[1]?i.f:void 0})];return[_({prim:"or",args:"LEFT"===t.prim?o:[o[1],o[0]]},{t:i.t,v:i.v}),...e.slice(1)]}case"NIL":return je(t.args[0]),[_({prim:"list",args:[t.args[0]]},w({t:1,v:1})),...e];case"UNPACK":return s(0,["bytes"]),je(t.args[0]),[E({prim:"option",args:[t.args[0]]},"@unpacked"),...e.slice(1)];case"CONTRACT":{const r=s(0,["address"])[0];je(t.args[0]);const i=w({v:1,f:1}),n=r[l];if(void 0!==n){const r=ze(n,null===(a=i.f)||void 0===a?void 0:a[0]);if(null===r)throw new Le(t,e,`${t.prim}: contract has no entrypoint ${r}`);h(r,t.args[0])}return[_({prim:"option",args:[{prim:"contract",args:[t.args[0]]}]},{v:i.v?i.v:x(c(r),"contract")}),...e.slice(1)]}case"CAST":{w({});const r=s(0,null)[0];return je(t.args[0]),h(t.args[0],r),[t.args[0],...e.slice(1)]}case"IF_NONE":{w({});const i=s(0,["option"])[0],n=e.slice(1);return P(Fe(t.args[0],n,r),Fe(t.args[1],[_(i.args[0],{t:null,v:x(c(i),"some")}),...n],r))}case"IF_LEFT":{w({});const i=s(0,["or"])[0],n=c(i),o=c(i.args[0]),a=c(i.args[1]),u=e.slice(1);return P(Fe(t.args[0],[_(i.args[0],{t:null,v:x(n,o.f?o.f[0].slice(1):"left")}),...u],r),Fe(t.args[1],[_(i.args[1],{t:null,v:x(n,a.f?a.f[0].slice(1):"right")}),...u],r))}case"IF_CONS":{w({});const i=s(0,["list"])[0],n=c(i),o=e.slice(1);return P(Fe(t.args[0],[_(i.args[0],{t:null,v:x(n,"hd")}),_(i,{t:null,v:x(n,"tl")}),...o],r),Fe(t.args[1],o,r))}case"IF":{w({}),s(0,["bool"]);const i=e.slice(1);return P(Fe(t.args[0],i,r),Fe(t.args[1],i,r))}case"MAP":{const i=s(0,["list","map","option"])[0],n=e.slice(1),o="map"===i.prim?{prim:"pair",args:i.args}:i.args[0],a=Fe(t.args[0],[_(o,{t:null,v:x(c(i),"elt")}),...n],r);if("failed"in a){if(!("prim"in a.failed)||"never"!==a.failed.prim)throw new Le(t,e,`${t.prim}: FAIL is not allowed in MAP`);return{failed:a.failed,level:a.level+1}}if(a.length<1)throw new Le(t,e,`${t.prim}: function must return a value`);return u(a.slice(1),n),"list"===i.prim?[E({prim:"list",args:[a[0]]}),...n]:"map"===i.prim?[E({prim:"map",args:[i.args[0],a[0]]}),...n]:[E({prim:"option",args:[a[0]]}),...n]}case"ITER":{w({});const i=s(0,["set","list","map"])[0],n=e.slice(1),o="map"===i.prim?{prim:"pair",args:i.args}:i.args[0],a=Fe(t.args[0],[_(o,{t:null,v:x(c(i),"elt")}),...n],r);return"failed"in a?{failed:a.failed,level:a.level+1}:(u(a,n),n)}case"LOOP":{w({}),s(0,["bool"]);const i=e.slice(1),n=Fe(t.args[0],i,r);return"failed"in n?{failed:n.failed,level:n.level+1}:(u(n,[{prim:"bool"},...i]),i)}case"LOOP_LEFT":{w({});const i=s(0,["or"])[0],n=e.slice(1),o=Fe(t.args[0],[_(i.args[0],{t:null,v:x(c(i),"left")}),...n],r);return"failed"in o?{failed:o.failed,level:o.level+1}:(u(o,[i,...n]),[_(i.args[1],{t:null,v:w({v:1}).v}),...n])}case"DIP":{w({});const i=2===t.args.length?parseInt(t.args[0].int,10):1;s(i-1,null);const n=e.slice(0,i),o=e.slice(i),a=2===t.args.length?Fe(t.args[1],o,r):Fe(t.args[0],o,r);return"failed"in a?{failed:a.failed,level:a.level+1}:[...n,...a]}case"CREATE_CONTRACT":{const r=w({v:2}),i=s(0,["option"],["mutez"],null);if("key_hash"!==Ce(i[0].args[0]))throw new Le(t,e,`${t.prim}: key hash expected: ${Ce(i[0].args[0])}`);g(i[2])&&(Ze(t.args[0]),De(He(t.args[0],"storage").args[0],i[2]));const n=null===(p=r.v)||void 0===p?void 0:p.map((t=>"@"!==t?[t]:void 0));return[_({prim:"operation"},{v:null==n?void 0:n[0]}),_({prim:"address",[l]:{prim:"contract",args:[He(t.args[0],"parameter").args[0]]}},{v:null==n?void 0:n[1]}),...e.slice(3)]}case"PUSH":return je(t.args[0]),Ve(t.args[1],t.args[0],Object.assign(Object.assign({},r),{contract:void 0})),[E(t.args[0]),...e];case"EMPTY_SET":return je(t.args[0]),f(t.args[0]),[_({prim:"set",args:t.args},w({t:1,v:1})),...e];case"EMPTY_MAP":return je(t.args[0]),f(t.args[0]),je(t.args[1]),[_({prim:"map",args:t.args},w({t:1,v:1})),...e];case"EMPTY_BIG_MAP":return je(t.args[0]),f(t.args[0]),je(t.args[1]),y(t.args[0]),[_({prim:"big_map",args:t.args},w({t:1,v:1})),...e];case"LAMBDA":{je(t.args[0]),je(t.args[1]);const i=Fe(t.args[2],[t.args[0]],Object.assign(Object.assign({},r),{contract:void 0}));if("failed"in i)return{failed:i.failed,level:i.level+1};if(1!==i.length)throw new Le(t,e,`${t.prim}: function must return a value`);return h(t.args[1],i[0]),[E({prim:"lambda",args:[t.args[0],t.args[1]]}),...e]}case"LEVEL":return[E({prim:"nat"},"@level"),...e];case"TOTAL_VOTING_POWER":case"MIN_BLOCK_TIME":return[E({prim:"nat"}),...e];case"VOTING_POWER":return s(0,["key_hash"]),[E({prim:"nat"}),...e.slice(1)];case"TICKET":{const t=s(0,null,["nat"])[0];return f(t),[_({prim:"ticket",args:[t]},w({t:1,v:1})),...e.slice(2)]}case"JOIN_TICKETS":{const r=_t("pair",s(0,["pair"])[0]);if("ticket"!==Ce(r.args[0]))throw new Le(t,e,`${t.prim}: ticket expected: ${Ce(r.args[0])}`);return h(r.args[0],r.args[1]),[E({prim:"option",args:[_(r.args[0],{t:null})]}),...e.slice(1)]}case"SPLIT_TICKET":{const r=s(0,["ticket"],["pair"]),i=_t("pair",r[1]);if("nat"!==Ce(i.args[0]))throw new Le(t,e,`${t.prim}: nat expected: ${Ce(i.args[0])}`);return h(i.args[0],i.args[1]),[E({prim:"option",args:[{prim:"pair",args:[_(r[0],{t:null}),_(r[0],{t:null})]}]}),...e.slice(2)]}case"READ_TICKET":{const t=w({v:2}),r=s(0,["ticket"])[0],i=null===(R=t.v)||void 0===R?void 0:R.map((t=>"@"!==t?[t]:void 0));return[_({prim:"pair",args:[{prim:"address"},_(r.args[0],{t:null}),{prim:"nat"}]},{v:null==i?void 0:i[0]}),_(r,{v:null==i?void 0:i[1],t:null}),...e.slice(1)]}case"PAIRING_CHECK":{const r=s(0,["list"])[0].args[0];if(!Et(r))throw new Le(t,e,`${t.prim}: pair expected: ${Ce(r)}`);const i=_t("pair",r);if("bls12_381_g1"!==Ce(i.args[0]))throw new Le(t,e,`${t.prim}: bls12_381_g1 expected: ${Ce(i.args[0])}`);if("bls12_381_g2"!==Ce(i.args[1]))throw new Le(t,e,`${t.prim}: bls12_381_g2 expected: ${Ce(i.args[1])}`);return[E({prim:"bool"}),...e.slice(1)]}case"SAPLING_EMPTY_STATE":return[_({prim:"sapling_state",args:[t.args[0]]},w({v:1,t:1})),...e];case"SAPLING_VERIFY_UPDATE":{const r=s(0,["sapling_transaction"],["sapling_state"]);if(parseInt(r[0].args[0].int,10)!==parseInt(r[1].args[0].int,10))throw new Le(t,e,`${t.prim}: sapling memo size mismatch: ${r[0].args[0].int} != ${r[1].args[0].int}`);return m(i,d.PtJakarta)?[E({prim:"option",args:[{prim:"pair",args:[{prim:"int"},_(r[1],{t:null})]}]}),...e.slice(2)]:[E({prim:"option",args:[{prim:"pair",args:[{prim:"bytes"},{prim:"pair",args:[{prim:"int"},_(r[1],{t:null})]}]}]}),...e.slice(2)]}case"OPEN_CHEST":return s(0,["chest_key"],["chest"],["nat"]),[E({prim:"or",args:[{prim:"bytes"},{prim:"bool"}]}),...e.slice(3)];case"VIEW":{const r=s(0,null,["address"]);return v(r[0]),[E({prim:"option",args:[t.args[1]]}),...e.slice(2)]}case"EMIT":{const r=w({f:1,t:1});if(t.args){const i=s(0,null);return h(i[0],t.args[0]),[_({prim:"operation"},r),...e.slice(1)]}return[_({prim:"operation"},r),...e.slice(1)]}default:throw new ut(t,`unexpected instruction: ${t.prim}`)}})(n);if(void 0!==(null==r?void 0:r.traceCallback)){const t={op:n,in:e,out:R};r.traceCallback(t)}return R}function He(t,e){for(const r of t)if(r.prim===e)return r;throw new ut(t,`missing contract section: ${e}`)}function Ge(t){const e={};for(const r of t)"view"===r.prim&&(e[r.args[0].string]=r);return e}function $e(t){if(Array.isArray(t))for(const e of t)if("prim"in e&&("parameter"===e.prim||"storage"===e.prim||"code"===e.prim))return!0;return!1}function ze(t,e){e=e||"%default";const r=qe(t).find((t=>t[0]===e));return void 0!==r?r[1]:"%default"===e?$e(t)?He(t,"parameter").args[0]:t:null}function qe(t){if($e(t)){const e=He(t,"parameter"),r=qe(e.args[0]),i=mt(e);return i.f?[[i.f[0],e.args[0]],...r]:r}if(e=t,Array.isArray(e)||"or"===e.prim){const e=Be(t),r=t=>{const r=mt(e[t]);if("or"===Ce(e[t])){const i=qe(e[t]);return r.f?[[r.f[0],e[t]],...i]:i}return r.f?[[r.f[0],e[t]]]:[]};return[...r(0),...r(1)]}var e;return[]}function Ze(t,e){const r=(r,i,n,s)=>{je(r,!0),je(i);const o=Fe(s,[{prim:"pair",args:[Object.assign(Object.assign({},r),{annots:["@parameter"]}),Object.assign(Object.assign({},i),{annots:["@storage"]})]}],Object.assign(Object.assign({},e),{contract:t}));if("failed"in o)return o;try{Ue(o,[n])}catch(t){throw t instanceof ut?new Le(s,o,t.message):t}return o},i=He(t,"parameter").args[0],n=He(t,"storage").args[0],s=r(i,n,{prim:"pair",args:[{prim:"list",args:[{prim:"operation"}]},n]},He(t,"code").args[0]);for(const e of Object.values(Ge(t)))r(e.args[1],n,e.args[2],e.args[3]);return s}function We(t,e,r){je(e),Ve(t,e,r||null)}function Ye(t,e,r){for(const t of e)je(t);if(void 0!==(null==r?void 0:r.contract))for(const t of["parameter","storage"]){je(He(r.contract,t).args[0])}return Fe(t,e,r||null)}function Je(t,e,r=!1){if(Array.isArray(t)){for(const e of t)je(e);for(const t of e)je(t)}else je(t),je(e);De(t,e,r)}function Xe(t,e=!1){try{return je(t,e),!0}catch(t){return!1}}function Qe(t,e){try{return Ze(t,e)}catch(t){return null}}function tr(t,e,r){try{return We(t,e,r),!0}catch(t){return!1}}function er(t,e,r=!1){try{return Je(t,e,r),!0}catch(t){return!1}}class rr{constructor(t,e){this.contract=t,this.ctx=Object.assign({contract:t},e),this.output=Ze(t,this.ctx)}static parse(t,e){const r=new K(e),i="string"==typeof t?r.parseScript(t):r.parseJSON(t);if(null===i)throw new rt("empty contract");if(Xt(i))return new rr(i,e)}static parseTypeExpression(t,e){const r=new K(e),i="string"==typeof t?r.parseScript(t):r.parseJSON(t);if(null===i)throw new it("empty type expression");if(Wt(i))return je(i),i}static parseDataExpression(t,e){const r=new K(e),i="string"==typeof t?r.parseScript(t):r.parseJSON(t);if(null===i)throw new nt("empty data expression");if(Jt(i))return i;throw void 0}section(t){return He(this.contract,t)}entryPoints(){return qe(this.contract)}entryPoint(t){return ze(this.contract,t)}assertDataValid(t,e){We(t,e,this.ctx)}isDataValid(t,e){return tr(t,e,this.ctx)}assertParameterValid(t,e){const r=this.entryPoint(t||void 0);if(null===r)throw new st(null==t?void 0:t.toString());this.assertDataValid(e,r)}isParameterValid(t,e){try{return this.assertParameterValid(t,e),!0}catch(t){return!1}}functionType(t,e){return Ye(t,e,this.ctx)}}const ir=new rr([{prim:"parameter",args:[{prim:"unit"}]},{prim:"storage",args:[{prim:"unit"}]},{prim:"code",args:[[{prim:"CAR"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PAIR"}]]}]);function nr(t){return"failed"in t?`[FAILED: ${$(t.failed)}]`:t.map(((t,e)=>{const r=mt(t);return`[${e}${r.v?"/"+r.v[0]:""}]: ${$(t)}`})).join("\n")}function sr(t,e){return r=>{var n;if(Array.isArray(r)&&!t)return;const s=null===(n=r.op[i])||void 0===n?void 0:n.macro,o=`${s?"Macro":"Op"}: ${s?$(s,void 0,!0)+" / ":""}${$(r.op)}\nInput:\n${nr(r.in)}\nOutput:\n${nr(r.out)}\n`;e(o)}}function or(t){var e;if(t instanceof Le){const r=null===(e=t.val[i])||void 0===e?void 0:e.macro;return`${r?"Macro":"Op"}: ${r?$(r,void 0,!0)+" / ":""}${$(t.val)}\nStack:\n${nr(t.stackState)}\n`}if(t instanceof ft){return`Type: ${Array.isArray(t.val)?"["+t.val.map(((t,e)=>`[${e}]: ${$(t)}`)).join("; ")+"]":$(t.val)}\n${t.data?`Data: ${$(t.data)}\n`:""}\n`}return`Value: ${$(t.val)}`}const ar={commitHash:"22fd810dcadf5272cb7a57d65165caa0eddbc57e",version:"14.2.0"}},8899:(t,e,r)=>{"use strict";r.r(e),r.d(e,{AddressValidationError:()=>T,BigMapEncodingError:()=>Ut,BigMapValidationError:()=>b,BytesValidationError:()=>j,ChainIDValidationError:()=>rt,ContractValidationError:()=>k,EncodeTicketError:()=>nt,IntValidationError:()=>H,InvalidBigMapDiff:()=>Dt,InvalidBigMapSchema:()=>Bt,InvalidMapTypeError:()=>c,InvalidRpcResponseError:()=>Lt,InvalidScriptError:()=>kt,KeyHashValidationError:()=>Z,KeyValidationError:()=>z,ListValidationError:()=>C,MapTypecheckError:()=>h,MapValidationError:()=>P,MichelsonMap:()=>f,MissingArgumentError:()=>Kt,MutezValidationError:()=>D,NatValidationError:()=>S,OrTokenDecodingError:()=>m,ParameterEncodingError:()=>Ct,ParameterSchema:()=>zt,SaplingStateValue:()=>Yt,Schema:()=>$t,SetValidationError:()=>tt,SignatureValidationError:()=>Y,StorageEncodingError:()=>jt,Token:()=>d,TokenArgumentValidationError:()=>y,TokenComparisonError:()=>w,UnitValue:()=>Wt,VERSION:()=>Zt,ViewEncodingError:()=>Mt,ViewSchema:()=>qt});var i,n=r(5695),s=r.n(n),o=r(2558),a=r(4632);class c extends Error{constructor(t){super(`The map type '${t}' is invalid`),this.mapType=t,this.name="InvalidMapTypeError"}}const u=Symbol.for("taquito-michelson-map-type-symbol");class h extends Error{constructor(t,e,r){super(`${r} not compliant with underlying michelson type`),this.value=t,this.type=e,this.name="MapTypecheckError"}}class f{constructor(t){this.valueMap=new Map,this.keyMap=new Map,this[i]=!0,t&&this.setType(t)}static isMichelsonMap(t){return t&&!0===t[u]}setType(t){if(!("args"in(e=t))||!Array.isArray(e.args)||2!==e.args.length)throw new c(t.toString());var e;this.keySchema=new $t(t.args[0]),this.valueSchema=new $t(t.args[1])}removeType(){this.keySchema=void 0,this.valueSchema=void 0}static fromLiteral(t,e){const r=new f(e);return Object.keys(t).forEach((e=>{r.set(e,t[e])})),r}typecheckKey(t){return!this.keySchema||this.keySchema.Typecheck(t)}typecheckValue(t){return!this.valueSchema||this.valueSchema.Typecheck(t)}assertTypecheckValue(t){if(!this.typecheckValue(t))throw new h(t,this.valueSchema,"value")}assertTypecheckKey(t){if(!this.typecheckKey(t))throw new h(t,this.keySchema,"key")}serializeDeterministically(t){return s()(t)}*keys(){for(const[t]of this.entries())yield t}*values(){for(const[,t]of this.entries())yield t}*entries(){for(const t of this.valueMap.keys())yield[this.keyMap.get(t),this.valueMap.get(t)]}get(t){this.assertTypecheckKey(t);const e=this.serializeDeterministically(t);return this.valueMap.get(e)}set(t,e){this.assertTypecheckKey(t),this.assertTypecheckValue(e);const r=this.serializeDeterministically(t);this.keyMap.set(r,t),this.valueMap.set(r,e)}delete(t){this.assertTypecheckKey(t),this.keyMap.delete(this.serializeDeterministically(t)),this.valueMap.delete(this.serializeDeterministically(t))}has(t){this.assertTypecheckKey(t);const e=this.serializeDeterministically(t);return this.keyMap.has(e)&&this.valueMap.has(e)}clear(){this.keyMap.clear(),this.valueMap.clear()}get size(){return this.keyMap.size}forEach(t){for(const[e,r]of this.entries())t(r,e,this)}}i=u;class l extends Error{constructor(t,e,r){super(),this.value=t,this.token=e,this.name="ValidationError";const i=this.token.annot(),n=i?`[${i}] `:"";this.message=`${n}${r}`}}class d{constructor(t,e,r){this.val=t,this.idx=e,this.fac=r,this.createToken=this.fac}typeWithoutAnnotations(){const t=e=>{if("object"==typeof e){if(Array.isArray(e)){return e.map((e=>t(e)))}const r=e;return r.args?{prim:r.prim,args:r.args.map((e=>t(e)))}:{prim:r.prim}}return e};return(e=this.val).args?{prim:e.prim,args:e.args.map((e=>t(e)))}:{prim:e.prim};var e}annot(){return(Array.isArray(this.val.annots)&&this.val.annots.length>0?this.val.annots[0]:String(this.idx)).replace(/(%|:)(_Liq_entry_)?/,"")}hasAnnotations(){return Array.isArray(this.val.annots)&&this.val.annots.length}get tokenVal(){return this.val}ExtractSignature(){return[[this.ExtractSchema()]]}}class p extends d{compare(t,e){return t===e?0:t<e?-1:1}}class b extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="BigMapValidationError"}}class g extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}get ValueSchema(){return this.createToken(this.val.args[1],0)}get KeySchema(){return this.createToken(this.val.args[0],0)}ExtractSchema(){return{big_map:{key:this.KeySchema.ExtractSchema(),value:this.ValueSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:g.prim,schema:{key:this.KeySchema.generateSchema(),value:this.ValueSchema.generateSchema()}}}isValid(t){return f.isMichelsonMap(t)?null:new b(t,this,"Value must be a MichelsonMap")}objLitToMichelsonMap(t){return t instanceof f?t:"object"==typeof t?0===Object.keys(t).length?new f:f.fromLiteral(t):t}Encode(t){const e=this.objLitToMichelsonMap(t.pop()),r=this.isValid(e);if(r)throw r;return Array.from(e.keys()).sort(((t,e)=>this.KeySchema.compare(t,e))).map((t=>({prim:"Elt",args:[this.KeySchema.EncodeObject(t),this.ValueSchema.EncodeObject(e.get(t))]})))}EncodeObject(t,e){const r=this.objLitToMichelsonMap(t),i=this.isValid(r);if(i)throw i;return e&&e[g.prim]?e[g.prim](r,this.val):Array.from(r.keys()).sort(((t,e)=>this.KeySchema.compare(t,e))).map((t=>({prim:"Elt",args:[this.KeySchema.EncodeObject(t),this.ValueSchema.EncodeObject(r.get(t))]})))}Execute(t,e){if(e&&e[g.prim])return e[g.prim](t,this.val);if(Array.isArray(t)){const e=new f(this.val);return t.forEach((t=>{e.set(this.KeySchema.ToKey(t.args[0]),this.ValueSchema.Execute(t.args[1]))})),e}if("int"in t)return t.int;throw new b(t,this,`Big map is expecting either an array (Athens) or an object with an int property (Babylon). Got ${JSON.stringify(t)}`)}findAndReturnTokens(t,e){return g.prim===t&&e.push(this),this.KeySchema.findAndReturnTokens(t,e),this.ValueSchema.findAndReturnTokens(t,e),e}}g.prim="big_map";class m extends Error{constructor(t){super(t),this.message=t,this.name="OrTokenDecodingError"}}class v extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Encode(t){const e=t[t.length-1],r=this.createToken(this.val.args[0],this.idx);let i=1;r instanceof v&&(i=Object.keys(r.ExtractSchema()).length);const n=this.createToken(this.val.args[1],this.idx+i);if(String(r.annot())!==String(e)||r instanceof v){if(String(n.annot())!==String(e)||n instanceof v){if(r instanceof v){const e=r.Encode(t);if(e)return{prim:"Left",args:[e]}}if(n instanceof v){const e=n.Encode(t);if(e)return{prim:"Right",args:[e]}}return null}return t.pop(),{prim:"Right",args:[n.Encode(t)]}}return t.pop(),{prim:"Left",args:[r.Encode(t)]}}ExtractSignature(){const t=this.createToken(this.val.args[0],this.idx);let e=1;t instanceof v&&(e=Object.keys(t.ExtractSchema()).length);const r=this.createToken(this.val.args[1],this.idx+e),i=[];if(t instanceof v)i.push(...t.ExtractSignature());else for(const e of t.ExtractSignature())i.push([t.annot(),...e]);if(r instanceof v)i.push(...r.ExtractSignature());else for(const t of r.ExtractSignature())i.push([r.annot(),...t]);return i}EncodeObject(t,e){const r=Object.keys(t)[0],i=this.createToken(this.val.args[0],this.idx);let n=1;i instanceof v&&(n=Object.keys(i.ExtractSchema()).length);const s=this.createToken(this.val.args[1],this.idx+n);if(String(i.annot())!==String(r)||i instanceof v){if(String(s.annot())!==String(r)||s instanceof v){if(i instanceof v){const r=i.EncodeObject(t,e);if(r)return{prim:"Left",args:[r]}}if(s instanceof v){const r=s.EncodeObject(t,e);if(r)return{prim:"Right",args:[r]}}return null}return{prim:"Right",args:[s.EncodeObject(t[r],e)]}}return{prim:"Left",args:[i.EncodeObject(t[r],e)]}}Execute(t,e){const r=this.createToken(this.val.args[0],this.idx);let i=1;r instanceof v&&(i=Object.keys(r.ExtractSchema()).length);const n=this.createToken(this.val.args[1],this.idx+i);if("Right"===t.prim)return n instanceof v?n.Execute(t.args[0],e):{[n.annot()]:n.Execute(t.args[0],e)};if("Left"===t.prim)return r instanceof v?r.Execute(t.args[0],e):{[r.annot()]:r.Execute(t.args[0],e)};throw new m(`Was expecting Left or Right prim but got: ${t.prim}`)}traversal(t,e,r){const i=this.createToken(this.val.args[0],this.idx);let n,s=1;i instanceof v&&!i.hasAnnotations()?(n=t(i),s=Object.keys(i.ExtractSchema()).length):n={[i.annot()]:t(i)};const o=this.createToken(this.val.args[1],this.idx+s);let a;a=o instanceof v&&!o.hasAnnotations()?e(o):{[o.annot()]:e(o)};return r(n,a)}ExtractSchema(){return this.traversal((t=>t.ExtractSchema()),(t=>t.ExtractSchema()),((t,e)=>Object.assign(Object.assign({},t),e)))}generateSchema(){return{__michelsonType:v.prim,schema:this.traversal((t=>t instanceof v&&!t.hasAnnotations()?t.generateSchema().schema:t.generateSchema()),(t=>t instanceof v&&!t.hasAnnotations()?t.generateSchema().schema:t.generateSchema()),((t,e)=>Object.assign(Object.assign({},t),e)))}}findToken(t){const e=this.createToken(this.val.args[0],this.idx);let r=1;e instanceof v&&(r=Object.keys(e.ExtractSchema()).length);const i=this.createToken(this.val.args[1],this.idx+r);if(String(e.annot())===String(t)&&!(e instanceof v)&&e instanceof p)return e;if(String(i.annot())===String(t)&&!(i instanceof v)&&i instanceof p)return i;if(e instanceof v){const r=e.findToken(t);if(r)return r}if(i instanceof v){const e=i.findToken(t);if(e)return e}return null}compare(t,e){const r=Object.keys(t)[0];if(r!==Object.keys(e)[0]){return JSON.stringify(this.EncodeObject(t))<JSON.stringify(this.EncodeObject(e))?-1:1}{const i=this.findToken(r);if(i instanceof p)return i.compare(t[r],e[r])}}ToKey(t){return this.Execute(t)}ToBigMapKey(t){return{key:this.EncodeObject(t),type:this.typeWithoutAnnotations()}}findAndReturnTokens(t,e){return v.prim===t&&e.push(this),this.traversal((r=>r.findAndReturnTokens(t,e)),(r=>r.findAndReturnTokens(t,e)),((t,e)=>Object.assign(Object.assign({},t),e))),e}}v.prim="or";class y extends Error{constructor(t){super(t),this.message=t,this.name="TokenArgumentValidationError"}}class w extends Error{constructor(t,e){super(`Tokens ${t} and ${e} are not comparable`),this.val1=t,this.val2=e,this.name="TokenComparisonError"}}function _(t,e=E.prim){if(Array.isArray(t))return _({prim:e,args:t},e);if(void 0===t.args)throw new y("Encountered an invalid PairToken with no arguments, a pair must have two or more arguments");return t.args.length>2?[t.args[0],{prim:e,args:t.args.slice(1)}]:[t.args[0],t.args[1]]}class E extends p{constructor(t,e,r){super(Array.isArray(t)?{prim:E.prim,args:t}:t.prim?t:{prim:E.prim,args:t},e,r)}args(){return _(this.val)}tokens(){let t=0;return this.args().map((e=>{const r=this.createToken(e,this.idx+t);return r instanceof E?t+=Object.keys(r.ExtractSchema()).length:t++,r}))}Encode(t){return{prim:"Pair",args:this.tokens().map((e=>e.Encode(t)))}}ExtractSignature(){const t=this.args(),e=this.createToken(t[0],this.idx);let r=1;e instanceof v&&(r=Object.keys(e.ExtractSchema()).length);const i=this.createToken(t[1],this.idx+r),n=[];for(const t of e.ExtractSignature())for(const e of i.ExtractSignature())n.push([...t,...e]);return n}ToBigMapKey(t){return{key:this.EncodeObject(t),type:this.typeWithoutAnnotations()}}ToKey(t){return this.Execute(t)}EncodeObject(t,e){const[r,i]=this.tokens();let n,s;return n=r instanceof E&&!r.hasAnnotations()?t:t[r.annot()],s=i instanceof E&&!i.hasAnnotations()?t:t[i.annot()],{prim:"Pair",args:[r.EncodeObject(n,e),i.EncodeObject(s,e)]}}traversal(t,e){const r=this.args(),i=this.createToken(r[0],this.idx);let n,s=1;i instanceof E&&(s=Object.keys(i.ExtractSchema()).length),n=i instanceof E&&!i.hasAnnotations()?t(i):{[i.annot()]:t(i)};const o=this.createToken(r[1],this.idx+s);let a;a=o instanceof E&&!o.hasAnnotations()?e(o):{[o.annot()]:e(o)};return Object.assign(Object.assign({},n),a)}Execute(t,e){const r=_(t,"Pair");return this.traversal((t=>t.Execute(r[0],e)),(t=>t.Execute(r[1],e)))}ExtractSchema(){return this.traversal((t=>t.ExtractSchema()),(t=>t.ExtractSchema()))}generateSchema(){return{__michelsonType:E.prim,schema:this.traversal((t=>t instanceof E&&!t.hasAnnotations()?t.generateSchema().schema:t.generateSchema()),(t=>t instanceof E&&!t.hasAnnotations()?t.generateSchema().schema:t.generateSchema()))}}compare(t,e){const[r,i]=this.tokens(),n=(t,e)=>t instanceof E&&!t.hasAnnotations()?e:e[t.annot()];if(r instanceof p&&i instanceof p){const s=r.compare(n(r,t),n(r,e));return 0===s?i.compare(n(i,t),n(i,e)):s}throw new w(t,e)}findAndReturnTokens(t,e){return E.prim===t&&e.push(this),this.tokens().map((r=>r.findAndReturnTokens(t,e))),e}}E.prim="pair";class S extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="NatValidationError"}}class A extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return new o.Z(t[Object.keys(t)[0]])}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return{int:new o.Z(e).toFixed()}}isValid(t){const e=new o.Z(t);return e.isNaN()?new S(t,this,`Value is not a number: ${t}`):e.isNegative()?new S(t,this,`Value cannot be negative: ${t}`):null}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[A.prim]?e[A.prim](t):{int:new o.Z(t).toFixed()}}ExtractSchema(){return A.prim}generateSchema(){return{__michelsonType:A.prim,schema:A.prim}}ToBigMapKey(t){return{key:{int:String(t)},type:{prim:A.prim}}}ToKey({int:t}){return new o.Z(t)}compare(t,e){const r=Number(t),i=Number(e);return r===i?0:r<i?-1:1}findAndReturnTokens(t,e){return A.prim===t&&e.push(this),e}}A.prim="nat";class O extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return t[Object.keys(t)[0]]}ExtractSchema(){return O.prim}generateSchema(){return{__michelsonType:O.prim,schema:O.prim}}Encode(t){return{string:t.pop()}}EncodeObject(t,e){return e&&e[O.prim]?e[O.prim](t):{string:t}}ToKey({string:t}){return t}ToBigMapKey(t){return{key:{string:t},type:{prim:O.prim}}}findAndReturnTokens(t,e){return O.prim===t&&e.push(this),e}}O.prim="string";class T extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="AddressValidationError"}}class x extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}ToBigMapKey(t){return{key:{bytes:(0,a.b58decode)(t)},type:{prim:"bytes"}}}isValid(t){return(0,a.validateAddress)(t)!==a.ValidationResult.VALID?new T(t,this,`Address is not valid: ${t}`):null}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return{string:e}}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[x.prim]?e[x.prim](t):{string:t}}Execute(t){if(t.string)return t.string;if(!t.bytes)throw new T(t,this,`cannot be missing both string and bytes: ${t}`);return(0,a.encodePubKey)(t.bytes)}ExtractSchema(){return x.prim}generateSchema(){return{__michelsonType:x.prim,schema:x.prim}}ToKey({bytes:t,string:e}){if(e)return e;if(!t)throw new T({bytes:t,string:e},this,`cannot be missing both string and bytes ${{string:e,bytes:t}}`);return(0,a.encodePubKey)(t)}compare(t,e){const r=t=>t.startsWith("tz"),i=r(t),n=r(e);return i&&!n?-1:n&&!i?1:super.compare(t,e)}findAndReturnTokens(t,e){return x.prim===t&&e.push(this),e}}x.prim="address";class P extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="MapValidationError"}}class R extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}get ValueSchema(){return this.createToken(this.val.args[1],0)}get KeySchema(){return this.createToken(this.val.args[0],0)}isValid(t){return f.isMichelsonMap(t)?null:new P(t,this,"Value must be a MichelsonMap")}Execute(t,e){const r=new f(this.val);return t.forEach((t=>{r.set(this.KeySchema.ToKey(t.args[0]),this.ValueSchema.Execute(t.args[1],e))})),r}objLitToMichelsonMap(t){return t instanceof f?t:"object"==typeof t?0===Object.keys(t).length?new f:f.fromLiteral(t):t}Encode(t){const e=this.objLitToMichelsonMap(t.pop()),r=this.isValid(e);if(r)throw r;return Array.from(e.keys()).sort(((t,e)=>this.KeySchema.compare(t,e))).map((t=>({prim:"Elt",args:[this.KeySchema.EncodeObject(t),this.ValueSchema.EncodeObject(e.get(t))]})))}EncodeObject(t,e){const r=this.objLitToMichelsonMap(t),i=this.isValid(r);if(i)throw i;return e&&e[R.prim]?e[R.prim](r):Array.from(r.keys()).sort(((t,e)=>this.KeySchema.compare(t,e))).map((t=>({prim:"Elt",args:[this.KeySchema.EncodeObject(t),this.ValueSchema.EncodeObject(r.get(t))]})))}ExtractSchema(){return{map:{key:this.KeySchema.ExtractSchema(),value:this.ValueSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:R.prim,schema:{key:this.KeySchema.generateSchema(),value:this.ValueSchema.generateSchema()}}}findAndReturnTokens(t,e){return R.prim===t&&e.push(this),this.KeySchema.findAndReturnTokens(t,e),this.ValueSchema.findAndReturnTokens(t,e),e}}R.prim="map";class I extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return"true"===String(t.prim).toLowerCase()}Encode(t){return{prim:t.pop()?"True":"False"}}EncodeObject(t,e){return e&&e[I.prim]?e[I.prim](t):{prim:t?"True":"False"}}ExtractSchema(){return I.prim}generateSchema(){return{__michelsonType:I.prim,schema:I.prim}}ToBigMapKey(t){return{key:this.EncodeObject(t),type:{prim:I.prim}}}ToKey(t){return this.EncodeObject(t)}compare(t,e){return t&&e||!t&&!e?0:t?1:-1}findAndReturnTokens(t,e){return I.prim===t&&e.push(this),e}}I.prim="bool";class N extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="TxRollupL2AddressValidationError"}}class M extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}ToBigMapKey(t){return{key:{bytes:(0,a.b58decodeL2Address)(t)},type:{prim:"bytes"}}}isValid(t){if((0,a.validateAddress)(t)!==a.ValidationResult.VALID)throw new N(t,this,`tx_rollup_l2_address is not valid: ${t}`);return null}Encode(t){const e=t.pop();if(!e)throw new N(e,this,`arg missing to encode: this -> "${e}"`);return this.isValid(e),{string:e}}EncodeObject(t,e){return this.isValid(t),e&&e[M.prim]?e[M.prim](t):{string:t}}Execute(t){if(t.string)return t.string;if(!t.bytes)throw new N(t,this,`value cannot be missing string and byte value. must have one ${JSON.stringify(t)}`);return(0,a.encodeL2Address)(t.bytes)}ExtractSchema(){return M.prim}generateSchema(){return{__michelsonType:M.prim,schema:M.prim}}ToKey({bytes:t,string:e}){if(e)return e;if(!t)throw new N(t,this,`value cannot be missing string and byte value. must have one: bytes = ${t}`);return(0,a.encodeL2Address)(t)}findAndReturnTokens(t,e){return M.prim===t&&e.push(this),e}}M.prim="tx_rollup_l2_address";class k extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="ContractValidationError"}}class L extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}isValid(t){return(0,a.validateAddress)(t)!==a.ValidationResult.VALID?new k(t,this,"Contract address is not valid"):null}Execute(t){if(t.string)return t.string;if(!t.bytes)throw new k(t,this,"must contain bytes or string");return(0,a.encodePubKey)(t.bytes)}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return{string:e}}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[L.prim]?e[L.prim](t):{string:t}}ExtractSchema(){return L.prim}generateSchema(){const t=this.createToken(this.val.args[0],0);return{__michelsonType:L.prim,schema:{parameter:this.val.args[0]?t.generateSchema():{}}}}findAndReturnTokens(t,e){return L.prim===t&&e.push(this),e}}L.prim="contract";class C extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="ListValidationError"}}class B extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}get valueSchema(){return this.createToken(this.val.args[0],this.idx)}isValid(t){return Array.isArray(t)?null:new C(t,this,"Value must be an array")}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;const i=this.createToken(this.val.args[0],0);return e.reduce(((t,e)=>[...t,i.EncodeObject(e)]),[])}Execute(t,e){const r=this.createToken(this.val.args[0],0),i=this.isValid(t);if(i)throw i;return t.reduce(((t,i)=>[...t,r.Execute(i,e)]),[])}EncodeObject(t,e){const r=this.createToken(this.val.args[0],0),i=this.isValid(t);if(i)throw i;return e&&e[B.prim]?e[B.prim](t):t.reduce(((t,e)=>[...t,r.EncodeObject(e)]),[])}ExtractSchema(){return{[B.prim]:this.valueSchema.ExtractSchema()}}generateSchema(){return{__michelsonType:B.prim,schema:this.valueSchema.generateSchema()}}findAndReturnTokens(t,e){return B.prim===t&&e.push(this),this.createToken(this.val.args[0],this.idx).findAndReturnTokens(t,e),e}}B.prim="list";class D extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="MutezValidationError"}}class U extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return new o.Z(t[Object.keys(t)[0]])}ExtractSchema(){return U.prim}generateSchema(){return{__michelsonType:U.prim,schema:U.prim}}isValid(t){return new o.Z(t).isNaN()?new D(t,this,`Value is not a number: ${t}`):null}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return{int:String(e).toString()}}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[U.prim]?e[U.prim](t):{int:String(t).toString()}}ToBigMapKey(t){return{key:{int:String(t)},type:{prim:U.prim}}}ToKey({int:t}){return t}compare(t,e){const r=Number(t),i=Number(e);return r===i?0:r<i?-1:1}findAndReturnTokens(t,e){return U.prim===t&&e.push(this),e}}U.prim="mutez";class j extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="BytesValidationError"}}class K extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}ToBigMapKey(t){return{key:{bytes:t},type:{prim:K.prim}}}isValid(t){return"string"==typeof t&&/^[0-9a-fA-F]*$/.test(t)&&t.length%2==0?null:new j(t,this,`Invalid bytes: ${t}`)}convertUint8ArrayToHexString(t){return t.constructor===Uint8Array?Buffer.from(t).toString("hex"):t}Encode(t){let e=t.pop();e=(0,a.stripHexPrefix)(this.convertUint8ArrayToHexString(e));const r=this.isValid(e);if(r)throw r;return{bytes:String(e).toString()}}EncodeObject(t,e){"string"==typeof(t=this.convertUint8ArrayToHexString(t))&&(t=(0,a.stripHexPrefix)(t));const r=this.isValid(t);if(r)throw r;return e&&e[K.prim]?e[K.prim](t):{bytes:String(t).toString()}}Execute(t){return t.bytes}ExtractSchema(){return K.prim}generateSchema(){return{__michelsonType:K.prim,schema:K.prim}}ToKey({bytes:t,string:e}){return e||t}findAndReturnTokens(t,e){return K.prim===t&&e.push(this),e}}K.prim="bytes";class V extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}subToken(){return this.createToken(this.val.args[0],this.idx)}schema(){return this.createToken(this.val.args[0],0)}annot(){return Array.isArray(this.val.annots)?super.annot():this.createToken(this.val.args[0],this.idx).annot()}Encode(t){const e=t;return null==e?{prim:"None"}:!Array.isArray(e)||void 0!==e[e.length-1]&&null!==e[e.length-1]?{prim:"Some",args:[this.schema().Encode(t)]}:(e.pop(),{prim:"None"})}EncodeObject(t,e){const r=t;return null==r?{prim:"None"}:{prim:"Some",args:[this.schema().EncodeObject(r,e)]}}Execute(t,e){return"None"===t.prim?null:this.schema().Execute(t.args[0],e)}ExtractSchema(){return this.schema().ExtractSchema()}generateSchema(){return{__michelsonType:V.prim,schema:this.schema().generateSchema()}}ExtractSignature(){return[...this.schema().ExtractSignature(),[]]}get KeySchema(){return this.schema()}compare(t,e){return t?e?this.KeySchema.compare(t,e):1:-1}ToKey(t){return this.Execute(t)}ToBigMapKey(t){return{key:this.EncodeObject(t),type:this.typeWithoutAnnotations()}}findAndReturnTokens(t,e){return V.prim===t&&e.push(this),this.subToken().findAndReturnTokens(t,e),e}}V.prim="option";class F extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return t.string&&/^\d+$/.test(t.string)?new Date(1e3*Number(t.string)).toISOString():t.string?new Date(t.string).toISOString():t.int?new Date(1e3*Number(t.int)).toISOString():void 0}Encode(t){const e=t.pop();return"number"==typeof e?{int:String(e)}:{string:e}}EncodeObject(t,e){return e&&e[F.prim]?e[F.prim](t):"number"==typeof t?{int:String(t)}:{string:t}}ExtractSchema(){return F.prim}generateSchema(){return{__michelsonType:F.prim,schema:F.prim}}ToKey({string:t}){return t}ToBigMapKey(t){return{key:{string:t},type:{prim:F.prim}}}findAndReturnTokens(t,e){return F.prim===t&&e.push(this),e}}F.prim="timestamp";class H extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="IntValidationError"}}class G extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return new o.Z(t[Object.keys(t)[0]])}ExtractSchema(){return G.prim}generateSchema(){return{__michelsonType:G.prim,schema:G.prim}}isValid(t){return new o.Z(t).isNaN()?new H(t,this,`Value is not a number: ${t}`):null}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return{int:new o.Z(e).toFixed()}}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[G.prim]?e[G.prim](t):{int:new o.Z(t).toFixed()}}ToBigMapKey(t){return{key:{int:String(t)},type:{prim:G.prim}}}ToKey({int:t}){return t}compare(t,e){const r=Number(t),i=Number(e);return r===i?0:r<i?-1:1}findAndReturnTokens(t,e){return G.prim===t&&e.push(this),e}}G.prim="int";class $ extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Encode(t){return t.pop(),{prim:"Unit"}}EncodeObject(t,e){return e&&e[$.prim]?e[$.prim](t):{prim:"Unit"}}Execute(t){return Wt}ExtractSchema(){return $.prim}generateSchema(){return{__michelsonType:$.prim,schema:$.prim}}compare(t,e){return 0}ToKey(t){return Wt}ToBigMapKey(t){return{key:{prim:"Unit"},type:{prim:$.prim}}}findAndReturnTokens(t,e){return $.prim===t&&e.push(this),e}}$.prim="unit";class z extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="KeyValidationError"}}class q extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return t.string?t.string:(0,a.encodeKey)(t.bytes)}isValid(t){return(0,a.validatePublicKey)(t)!==a.ValidationResult.VALID?new z(t,this,"Key is not valid"):null}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return{string:e}}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[q.prim]?e[q.prim](t):{string:t}}ExtractSchema(){return q.prim}generateSchema(){return{__michelsonType:q.prim,schema:q.prim}}ToKey(t){return this.Execute(t)}ToBigMapKey(t){return{key:{string:t},type:{prim:q.prim}}}compare(t,e){const r=this.getPrefix(t),i=this.getPrefix(e);if(r===a.Prefix.EDPK&&i!==a.Prefix.EDPK)return-1;if(r===a.Prefix.SPPK&&i!==a.Prefix.SPPK)return i===a.Prefix.EDPK?1:-1;if(r===a.Prefix.P2PK){if(i!==a.Prefix.P2PK)return 1;const r=this.getP256PublicKeyComparableBytes(t),n=this.getP256PublicKeyComparableBytes(e);return Buffer.compare(r,n)}return super.compare(t,e)}getPrefix(t){return t.substring(0,4)}getP256PublicKeyComparableBytes(t){return(0,a.b58cdecode)(t,a.prefix[a.Prefix.P2PK]).slice(1)}findAndReturnTokens(t,e){return q.prim===t&&e.push(this),e}}q.prim="key";class Z extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="KeyHashValidationError"}}class W extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return t.string?t.string:(0,a.encodeKeyHash)(t.bytes)}isValid(t){return(0,a.validateKeyHash)(t)!==a.ValidationResult.VALID?new Z(t,this,`KeyHash is not valid: ${t}`):null}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return{string:e}}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[W.prim]?e[W.prim](t):{string:t}}ExtractSchema(){return W.prim}generateSchema(){return{__michelsonType:W.prim,schema:W.prim}}ToKey({string:t,bytes:e}){return t||(0,a.encodeKeyHash)(e)}ToBigMapKey(t){return{key:{string:t},type:{prim:W.prim}}}findAndReturnTokens(t,e){return W.prim===t&&e.push(this),e}}W.prim="key_hash";class Y extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="SignatureValidationError"}}class J extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return t.string?t.string:t.bytes}isValid(t){return(0,a.validateSignature)(t)!==a.ValidationResult.VALID?new Y(t,this,"Signature is not valid"):null}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return{string:e}}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[J.prim]?e[J.prim](t):{string:t}}ExtractSchema(){return J.prim}generateSchema(){return{__michelsonType:J.prim,schema:J.prim}}ToKey(t){return this.Execute(t)}ToBigMapKey(t){return{key:{string:t},type:{prim:J.prim}}}findAndReturnTokens(t,e){return J.prim===t&&e.push(this),e}}J.prim="signature";class X extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}get paramSchema(){return this.createToken(this.val.args[0],this.idx)}get returnSchema(){return this.createToken(this.val.args[1],this.idx+1)}Execute(t){return t.string?t.string:t}Encode(t){return t.pop()}EncodeObject(t,e){return e&&e[X.prim]?e[X.prim](t):t}ExtractSchema(){return{[X.prim]:{parameters:this.paramSchema.ExtractSchema(),returns:this.returnSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:X.prim,schema:{parameters:this.paramSchema.generateSchema(),returns:this.returnSchema.generateSchema()}}}findAndReturnTokens(t,e){return X.prim===t&&e.push(this),this.createToken(this.val.args[0],this.idx).findAndReturnTokens(t,e),this.createToken(this.val.args[1],this.idx).findAndReturnTokens(t,e),e}}X.prim="lambda";class Q extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){return t.string}Encode(...t){return{string:t.pop()}}EncodeObject(t,e){return e&&e[Q.prim]?e[Q.prim](t):{string:t}}ExtractSchema(){return Q.prim}generateSchema(){return{__michelsonType:Q.prim,schema:Q.prim}}findAndReturnTokens(t,e){return Q.prim===t&&e.push(this),e}}Q.prim="operation";class tt extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="SetValidationError"}}class et extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}get KeySchema(){return this.createToken(this.val.args[0],0)}isValid(t){return Array.isArray(t)?null:new tt(t,this,"Value must be an array")}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return e.sort(((t,e)=>this.KeySchema.compare(t,e))).reduce(((t,e)=>[...t,this.KeySchema.EncodeObject(e)]),[])}Execute(t,e){return t.reduce(((t,r)=>[...t,this.KeySchema.Execute(r,e)]),[])}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[et.prim]?e[et.prim](t):t.sort(((t,e)=>this.KeySchema.compare(t,e))).reduce(((t,e)=>[...t,this.KeySchema.EncodeObject(e)]),[])}ExtractSchema(){return et.prim}generateSchema(){return{__michelsonType:et.prim,schema:this.KeySchema.generateSchema()}}findAndReturnTokens(t,e){return et.prim===t&&e.push(this),this.KeySchema.findAndReturnTokens(t,e),e}}et.prim="set";class rt extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="ChainIDValidationError"}}class it extends p{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}isValid(t){return(0,a.validateChain)(t)!==a.ValidationResult.VALID?new rt(t,this,"ChainID is not valid"):null}Execute(t){return t[Object.keys(t)[0]]}ExtractSchema(){return it.prim}generateSchema(){return{__michelsonType:it.prim,schema:it.prim}}Encode(t){const e=t.pop(),r=this.isValid(e);if(r)throw r;return{string:e}}EncodeObject(t,e){const r=this.isValid(t);if(r)throw r;return e&&e[it.prim]?e[it.prim](t):{string:t}}ToKey({string:t}){return t}ToBigMapKey(t){return{key:{string:t},type:{prim:it.prim}}}findAndReturnTokens(t,e){return it.prim===t&&e.push(this),e}}it.prim="chain_id";class nt extends Error{constructor(){super("Tickets cannot be sent to the blockchain; they are created on-chain"),this.name="TicketEncodeError"}}const st={prim:"contract"},ot={prim:"int"};class at extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}get valueToken(){return this.createToken(this.val.args[0],this.idx)}Encode(t){throw new nt}EncodeObject(t,e){if(e&&e[at.prim])return e[at.prim](t,this.val);throw new nt}Execute(t,e){if(e&&e[at.prim])return e[at.prim](t,this.val);const r=this.createToken(st,this.idx),i=this.valueToken,n=this.createToken(ot,this.idx);return void 0===t.args[2]&&void 0!==t.args[1].args?{ticketer:r.Execute(t.args[0],e),value:i.Execute(t.args[1].args[0],e),amount:n.Execute(t.args[1].args[1],e)}:{ticketer:r.Execute(t.args[0],e),value:i.Execute(t.args[1],e),amount:n.Execute(t.args[2],e)}}ExtractSchema(){return{ticketer:L.prim,value:this.valueToken.ExtractSchema(),amount:G.prim}}generateSchema(){return{__michelsonType:at.prim,schema:{value:this.valueToken.generateSchema(),ticketer:{__michelsonType:L.prim,schema:L.prim},amount:{__michelsonType:G.prim,schema:G.prim}}}}findAndReturnTokens(t,e){return at.prim===t&&e.push(this),this.valueToken.findAndReturnTokens(t,e),e}}at.prim="ticket";class ct extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="NeverTokenError"}}class ut extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Encode(t){const e=t.pop();throw new ct(e,this,"Assigning a value to the type never is forbidden.")}EncodeObject(t,e){if(e&&e[ut.prim])return e[ut.prim](t);throw new ct(t,this,"Assigning a value to the type never is forbidden.")}Execute(t){throw new ct(t,this,"There is no literal value for the type never.")}ExtractSchema(){return ut.prim}generateSchema(){return{__michelsonType:ut.prim,schema:ut.prim}}findAndReturnTokens(t,e){return ut.prim===t&&e.push(this),e}}ut.prim="never";class ht extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="SaplingStateValidationError"}}class ft extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}isValid(t){return"object"==typeof t&&0===Object.keys(t).length}Execute(t,e){if(e&&e[ft.prim])return e[ft.prim](t,this.val);if("int"in t)return t.int;throw new ht(t,this,`Sapling state is expecting an object with an int property. Got ${JSON.stringify(t)}`)}Encode(t){const e=t.pop();if(this.isValid(e))return[];throw new ht(e,this,`Invalid sapling_state. Received: ${e} while expecting: {}`)}EncodeObject(t,e){if(e&&e[ft.prim])return e[ft.prim](t);if(this.isValid(t))return[];throw new ht(t,this,`Invalid sapling_state. Received: ${t} while expecting: {}`)}ExtractSchema(){return{[ft.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:ft.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(t,e){return ft.prim===t&&e.push(this),e}}ft.prim="sapling_state";class lt extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="SaplingTransactionValidationError"}}class dt extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){throw new lt(t,this,"There is no literal value for the sapling_transaction type.")}validateBytes(t){const e=/^(0x|0X)?([0-9a-fA-F]*$)/.exec(t);if(e&&e[2].length%2==0)return e[2];throw new lt(t,this,`Invalid bytes: ${t}`)}convertUint8ArrayToHexString(t){return t.constructor===Uint8Array?Buffer.from(t).toString("hex"):t}Encode(t){let e=t.pop();return e=this.validateBytes(this.convertUint8ArrayToHexString(e)),{bytes:String(e).toString()}}EncodeObject(t,e){return t=this.validateBytes(this.convertUint8ArrayToHexString(t)),e&&e[dt.prim]?e[dt.prim](t):{bytes:String(t).toString()}}ExtractSchema(){return{[dt.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:dt.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(t,e){return dt.prim===t&&e.push(this),e}}dt.prim="sapling_transaction";class pt extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="SaplingTransactionDeprecatedValidationError"}}class bt extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t){throw new pt(t,this,"There is no literal value for the sapling_transaction_deprecated type.")}validateBytes(t){const e=/^(0x|0X)?([0-9a-fA-F]*$)/.exec(t);if(e&&e[2].length%2==0)return e[2];throw new pt(t,this,`Invalid bytes: ${t}`)}convertUint8ArrayToHexString(t){return t.constructor===Uint8Array?Buffer.from(t).toString("hex"):t}Encode(t){let e=t.pop();return e=this.validateBytes(this.convertUint8ArrayToHexString(e)),{bytes:String(e).toString()}}EncodeObject(t,e){return t=this.validateBytes(this.convertUint8ArrayToHexString(t)),e&&e[bt.prim]?e[bt.prim](t):{bytes:String(t).toString()}}ExtractSchema(){return{[bt.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:bt.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(t,e){return bt.prim===t&&e.push(this),e}}bt.prim="sapling_transaction_deprecated";class gt extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="Bls12381frValidationError"}}class mt extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}isValid(t){return/^[0-9a-fA-F]*$/.test(t)&&t.length%2==0?null:new gt(t,this,`Invalid bytes: ${t}`)}convertUint8ArrayToHexString(t){return t.constructor===Uint8Array?Buffer.from(t).toString("hex"):t}Encode(t){let e=t.pop();if("number"==typeof e)return{int:e.toString()};{e=this.convertUint8ArrayToHexString(e);const t=this.isValid(e);if(t)throw t;return{bytes:e}}}EncodeObject(t,e){if(e&&e[mt.prim])return e[mt.prim](t);if("number"==typeof t)return{int:t.toString()};{t=this.convertUint8ArrayToHexString(t);const e=this.isValid(t);if(e)throw e;return{bytes:t}}}Execute(t){return t.bytes}ExtractSchema(){return mt.prim}generateSchema(){return{__michelsonType:mt.prim,schema:mt.prim}}findAndReturnTokens(t,e){return mt.prim===t&&e.push(this),e}}mt.prim="bls12_381_fr";class vt extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="Bls12381g1ValidationError"}}class yt extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}isValid(t){return/^[0-9a-fA-F]*$/.test(t)&&t.length%2==0?null:new vt(t,this,`Invalid bytes: ${t}`)}convertUint8ArrayToHexString(t){return t.constructor===Uint8Array?Buffer.from(t).toString("hex"):t}Encode(t){let e=t.pop();e=this.convertUint8ArrayToHexString(e);const r=this.isValid(e);if(r)throw r;return{bytes:e}}EncodeObject(t,e){t=this.convertUint8ArrayToHexString(t);const r=this.isValid(t);if(r)throw r;return e&&e[yt.prim]?e[yt.prim](t):{bytes:t}}Execute(t){return t.bytes}ExtractSchema(){return yt.prim}generateSchema(){return{__michelsonType:yt.prim,schema:yt.prim}}findAndReturnTokens(t,e){return yt.prim===t&&e.push(this),e}}yt.prim="bls12_381_g1";class wt extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="Bls12381g2ValidationError"}}class _t extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}isValid(t){return/^[0-9a-fA-F]*$/.test(t)&&t.length%2==0?null:new wt(t,this,`Invalid bytes: ${t}`)}convertUint8ArrayToHexString(t){return t.constructor===Uint8Array?Buffer.from(t).toString("hex"):t}Encode(t){let e=t.pop();e=this.convertUint8ArrayToHexString(e);const r=this.isValid(e);if(r)throw r;return{bytes:e}}EncodeObject(t,e){t=this.convertUint8ArrayToHexString(t);const r=this.isValid(t);if(r)throw r;return e&&e[_t.prim]?e[_t.prim](t):{bytes:t}}Execute(t){return t.bytes}ExtractSchema(){return _t.prim}generateSchema(){return{__michelsonType:_t.prim,schema:_t.prim}}findAndReturnTokens(t,e){return _t.prim===t&&e.push(this),e}}_t.prim="bls12_381_g2";class Et extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="ChestValidationError"}}class St extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}isValid(t){return/^[0-9a-fA-F]*$/.test(t)&&t.length%2==0?null:new Et(t,this,`Invalid bytes: ${t}`)}convertUint8ArrayToHexString(t){return t.constructor===Uint8Array?Buffer.from(t).toString("hex"):t}Encode(t){let e=t.pop();e=this.convertUint8ArrayToHexString(e);const r=this.isValid(e);if(r)throw r;return{bytes:e}}EncodeObject(t,e){t=this.convertUint8ArrayToHexString(t);const r=this.isValid(t);if(r)throw r;return e&&e[St.prim]?e[St.prim](t):{bytes:t}}Execute(t){return t.bytes}ExtractSchema(){return St.prim}generateSchema(){return{__michelsonType:St.prim,schema:St.prim}}findAndReturnTokens(t,e){return St.prim===t&&e.push(this),e}}St.prim="chest";class At extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="ChestKeyValidationError"}}class Ot extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}isValid(t){return/^[0-9a-fA-F]*$/.test(t)&&t.length%2==0?null:new At(t,this,`Invalid bytes: ${t}`)}convertUint8ArrayToHexString(t){return t.constructor===Uint8Array?Buffer.from(t).toString("hex"):t}Encode(t){let e=t.pop();e=this.convertUint8ArrayToHexString(e);const r=this.isValid(e);if(r)throw r;return{bytes:e}}EncodeObject(t,e){t=this.convertUint8ArrayToHexString(t);const r=this.isValid(t);if(r)throw r;return e&&e[Ot.prim]?e[Ot.prim](t):{bytes:t}}Execute(t){return t.bytes}ExtractSchema(){return Ot.prim}generateSchema(){return{__michelsonType:Ot.prim,schema:Ot.prim}}findAndReturnTokens(t,e){return Ot.prim===t&&e.push(this),e}}Ot.prim="chest_key";class Tt extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="GlobalConstantEncodingError"}}class xt extends l{constructor(t,e,r){super(t,e,r),this.value=t,this.token=e,this.name="GlobalConstantDecodingError"}}class Pt extends d{constructor(t,e,r){super(t,e,r),this.val=t,this.idx=e,this.fac=r}Execute(t,e){if(e&&e[Pt.prim])return e[Pt.prim](t,this.val);throw new xt(t,this,`Unable to decode a value represented by a global constants. Please provide an expanded script to the Michelson-Encoder or semantics for the decoding. The following global constant hash was encountered: ${this.val.args[0].string}.`)}Encode(t){throw new Tt(t,this,`Unable to encode a script containing global constants. Please provide an expanded script to the Michelson-Encoder. The following global constant hash was encountered: ${this.val.args[0].string}.`)}EncodeObject(t,e){if(e&&e[Pt.prim])return e[Pt.prim](t);throw new Tt(t,this,`Unable to encode a script containing global constants. Please provide an expanded script to the Michelson-Encoder. The following global constant hash was encountered: ${this.val.args[0].string}.`)}ExtractSchema(){return Pt.prim}generateSchema(){return{__michelsonType:Pt.prim,schema:{hash:this.val.args[0].string}}}findAndReturnTokens(t,e){return Pt.prim===t&&e.push(this),e}}Pt.prim="constant";const Rt=[E,A,O,g,x,M,R,I,v,L,B,U,K,V,F,G,$,q,W,J,X,Q,et,it,at,ut,ft,dt,bt,mt,yt,_t,St,Ot,Pt];class It extends Error{constructor(t,e){super(t),this.message=t,this.data=e,this.name="Invalid token error"}}function Nt(t,e){if(Array.isArray(t))return new E(t,e,Nt);const r=Rt.find((e=>e.prim===t.prim));if(!r)throw new It("Malformed data expected a value with a valid prim property",t);return new r(t,e,Nt)}class Mt extends Error{constructor(t,e){super(`Unable to encode the parameter of the view: ${t}.`),this.smartContractViewName=t,this.originalError=e,this.name="ViewEncodingError"}}class kt extends Error{constructor(t){super(t),this.message=t,this.name="InvalidScriptError"}}class Lt extends Error{constructor(t){super("Invalid RPC response passed as argument(s)"),this.script=t,this.name="InvalidRpcResponseError"}}class Ct extends Error{constructor(t,e,r){super(`\n ${t}. Error encountered when trying to encode arguments: \n\n [${e}]\n `),this.message=t,this.args=e,this.originalError=r,this.name="ParameterEncodingError"}}class Bt extends Error{constructor(t){super(t),this.message=t,this.name="InvalidBigMapSchema"}}class Dt extends Error{constructor(t){super(t),this.message=t,this.name="InvalidBigMapDiff"}}class Ut extends Error{constructor(t,e){super(`Unable to encode ${t}. ${e}`),this.obj=t,this.details=e,this.name="BigMapEncodingError"}}class jt extends Error{constructor(t,e){super(`Unable to encode ${t}. ${e}`),this.obj=t,this.details=e,this.name="StorageEncodingError"}}class Kt extends Error{constructor(t){super(t),this.message=t,this.name="MissingArgumentError"}}var Vt;const Ft=Symbol.for("taquito-schema-type-symbol");function Ht(t,e=E.prim){var r,i;if(Array.isArray(t))return Ht({prim:e,args:t},e);const n=t;return n.prim===e&&n.args&&n.args.length>2?Object.assign(Object.assign({},n),{args:[null===(r=n.args)||void 0===r?void 0:r[0],{prim:e,args:null===(i=n.args)||void 0===i?void 0:i.slice(1)}]}):n}function Gt(t,e){const r=Ht(t),i=Ht(e);return r.prim===i.prim&&(void 0===r.args&&void 0===i.args||void 0!==r.args&&void 0!==i.args&&r.args.length===i.args.length&&r.args.every(((t,e)=>{var r,n;return Gt(t,null!==(n=null===(r=i.args)||void 0===r?void 0:r[e])&&void 0!==n?n:{})})))&&(void 0===r.annots&&void 0===i.annots||void 0!==r.annots&&void 0!==i.annots&&r.annots.length===i.annots.length&&r.annots.every(((t,e)=>{var r;return t===(null===(r=i.annots)||void 0===r?void 0:r[e])})))}class $t{constructor(t){if(this.val=t,this[Vt]=!0,this.root=Nt(t,0),this.root instanceof g)this.bigMap=this.root;else if(this.isExpressionExtended(t)&&"pair"===t.prim){const e=t.args[0];this.isExpressionExtended(e)&&"big_map"===e.prim&&(this.bigMap=new g(e,0,Nt))}}static isSchema(t){return t&&!0===t[Ft]}static fromRPCResponse(t){const e=t&&t.script&&Array.isArray(t.script.code)&&t.script.code.find((e=>{if(!Array.isArray(e)){const t=e;return!!t.prim&&"storage"===t.prim}this.fromRPCResponse({script:{code:e,storage:t.script.storage}})}));if(!e||!Array.isArray(e.args))throw new Lt(t.script);return new $t(e.args[0])}isExpressionExtended(t){return"prim"in t&&Array.isArray(t.args)}removeTopLevelAnnotation(t){return(this.root instanceof E||this.root instanceof v)&&this.root.hasAnnotations()&&"object"==typeof t&&1===Object.keys(t).length?t[Object.keys(t)[0]]:t}Execute(t,e){const r=this.root.Execute(t,e);return this.removeTopLevelAnnotation(r)}Typecheck(t){if(this.root instanceof g&&Number.isInteger(Number(t)))return!0;if(this.root instanceof at&&t.ticketer&&t.value&&t.amount)return!0;try{return this.root.EncodeObject(t),!0}catch(t){return!1}}ExecuteOnBigMapDiff(t,e){if(!this.bigMap)throw new Bt("Big map schema is undefined");if(!Array.isArray(t))throw new Dt("Big map diff must be an array");const r=t.map((({key:t,value:e})=>({args:[t,e]})));return this.bigMap.Execute(r,e)}ExecuteOnBigMapValue(t,e){if(!this.bigMap)throw new Bt("No big map schema");return this.bigMap.ValueSchema.Execute(t,e)}EncodeBigMapKey(t){if(!this.bigMap)throw new Bt("Big map schema is undefined");try{return this.bigMap.KeySchema.ToBigMapKey(t)}catch(t){throw new Ut("big map key",t)}}Encode(t,e){try{return this.root.EncodeObject(t,e)}catch(t){if(t instanceof l)throw t;throw new jt("storage object",t)}}ExtractSchema(){return this.removeTopLevelAnnotation(this.root.ExtractSchema())}generateSchema(){return this.removeTopLevelAnnotation(this.root.generateSchema())}ComputeState(t,e){if(!this.bigMap)throw new Bt("Big map schema is undefined");const r=t.reduce(((t,e)=>Object.assign(Object.assign({},t),this.ExecuteOnBigMapDiff(e.contents[0].metadata.operation_result.big_map_diff))),{});return Object.assign(Object.assign({},this.Execute(e)),{[this.bigMap.annot()]:r})}FindFirstInTopLevelPair(t,e){return this.findValue(this.root.val,t,e)}findValue(t,e,r){if(Gt(r,t))return e;if(Array.isArray(t)||"pair"===t.prim){const i=Ht(t),n=Ht(e,"Pair");if(void 0===i.args||void 0===n.args)throw new Kt("Tokens have no arguments");if(i.args[0])return this.findValue(i.args[0],n.args[0],r)||this.findValue(i.args[1],n.args[1],r)}}findToken(t){return this.root.findAndReturnTokens(t,[])}}Vt=Ft;class zt{constructor(t){this.root=Nt(t,0)}static fromRPCResponse(t){const e=t&&t.script&&Array.isArray(t.script.code)&&t.script.code.find((t=>"parameter"===t.prim));if(!e||!Array.isArray(e.args))throw new Lt(t.script);return new zt(e.args[0])}get isMultipleEntryPoint(){return this.root instanceof v||this.root instanceof V&&this.root.subToken()instanceof v}get hasAnnotation(){return!this.isMultipleEntryPoint||"0"!==Object.keys(this.ExtractSchema())[0]}Execute(t,e){return this.root.Execute(t,e)}Encode(...t){try{return this.root.Encode(t.reverse())}catch(e){if(e instanceof l)throw e;throw new Ct("Unable to encode parameter",t.toString(),e)}}EncodeObject(t,e){try{return this.root.EncodeObject(t,e)}catch(e){if(e instanceof l)throw e;throw new Ct("Unable to encode parameter object",t,e)}}ExtractSchema(){return this.root.ExtractSchema()}generateSchema(){return this.root.generateSchema()}ExtractSignatures(){return this.root.ExtractSignature()}}class qt{constructor(t){if(4!==t.length||!("string"in t[0]))throw new kt(`Invalid on-chain view: ${JSON.stringify(t)}`);this.viewName=t[0].string,this.viewArgsType=t[1],this.viewReturnType=t[2],this.instructions=t[3],this.rootArgsType=Nt(this.viewArgsType,0),this.rootReturnType=Nt(this.viewReturnType,0)}static fromRPCResponse(t){const e=[],r=t&&t.script&&Array.isArray(t.script.code)&&t.script.code.filter((t=>"view"===t.prim));return r&&r.forEach((t=>{if(!t.args||4!==t.args.length)throw new kt(`Invalid on-chain view found in the script: ${JSON.stringify(t)}`);e.push(new qt(t.args))})),e}encodeViewArgs(t){try{return this.rootArgsType.EncodeObject(t)}catch(t){throw new Mt(this.viewName,t)}}decodeViewResult(t,e){return this.rootReturnType.Execute(t,e)}extractArgsSchema(){return this.rootArgsType.ExtractSchema()}extractResultSchema(){return this.rootReturnType.ExtractSchema()}}const Zt={commitHash:"22fd810dcadf5272cb7a57d65165caa0eddbc57e",version:"14.2.0"},Wt=Symbol(),Yt={}},6368:(t,e,r)=>{"use strict";r.r(e),r.d(e,{METADATA_BALANCE_UPDATES_CATEGORY:()=>p,OPERATION_METADATA:()=>d,OpKind:()=>b,RpcClient:()=>m,RpcClientCache:()=>l,VERSION:()=>g,castToBigNumber:()=>f,defaultChain:()=>c,defaultRPCOptions:()=>u});var i=r(5543),n=r(2558),s=r(4632);function o(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r}function a(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))}const c="main",u={block:"head"};var h;function f(t,e){const r=Array.isArray(t);void 0===e&&(e=Object.keys(t));const i=r?[]:{};return e.forEach((e=>{const r=t[e];let s;if(void 0!==r){if(Array.isArray(r))return s=f(r),void(i[e]=s);s=new n.Z(r),i[e]=s}})),i}!function(t){t.GET_BAKING_RIGHTS="getBakingRights",t.GET_BALLOTS="getBallots",t.GET_BALLOT_LIST="getBallotList",t.GET_BIG_MAP_KEY="getBigMapKey",t.GET_BIG_MAP_EXPR="getBigMapExpr",t.GET_BLOCK_HASH="getBlockHash",t.GET_BLOCK="getBlock",t.GET_BLOCK_HEADER="getBlockHeader",t.GET_BLOCK_METADATA="getBlockMetadata",t.GET_BALANCE="getBalance",t.GET_CHAIN_ID="getChainId",t.GET_CONSTANTS="getConstants",t.GET_CONTRACT="getContract",t.GET_CURRENT_PERIOD="getCurrentPeriod",t.GET_CURRENT_PROPOSAL="getCurrentProposal",t.GET_CURRENT_QUORUM="getCurrentQuorum",t.GET_DELEGATE="getDelegate",t.GET_DELEGATES="getDelegates",t.GET_VOTING_INFO="getVotingInfo",t.GET_ENDORSING_RIGHTS="getEndorsingRights",t.GET_ENTRYPOINTS="getEntrypoints",t.GET_LIVE_BLOCKS="getLiveBlocks",t.GET_MANAGER_KEY="getManagerKey",t.GET_NORMALIZED_SCRIPT="getNormalizedScript",t.GET_PROPOSALS="getProposals",t.GET_PROTOCOLS="getProtocols",t.GET_SAPLING_DIFF_BY_CONTRACT="getSaplingDiffByContract",t.GET_SAPLING_DIFF_BY_ID="getSaplingDiffById",t.GET_SCRIPT="getScript",t.GET_STORAGE="getStorage",t.GET_SUCCESSOR_PERIOD="getSuccessorPeriod",t.GET_TX_ROLLUP_INBOX="getTxRollupInbox",t.GET_TX_ROLLUP_STATE="getTxRollupState",t.GET_VOTES_LISTINGS="getVotesListings",t.PACK_DATA="packData"}(h||(h={}));class l{constructor(t,e=1e3){this.rpcClient=t,this.ttl=e,this._cache={}}getAllCachedData(){return this._cache}deleteAllCachedData(){for(const t in this._cache)delete this._cache[t]}formatCacheKey(t,e,r,i){let n="";return r.forEach((t=>{n="object"==typeof t?n+JSON.stringify(t)+"/":n+t+"/"})),i?`${t}/${e}/${n}/${JSON.stringify(i)}`:`${t}/${e}/${n}`}has(t){return t in this._cache}get(t){return this._cache[t].response}put(t,e){const r=setTimeout((()=>this.remove(t)),this.ttl);Object.assign(this._cache,{[t]:{handle:r,response:e}})}remove(t){t in this._cache&&delete this._cache[t]}validateAddress(t){if((0,s.validateAddress)(t)!==s.ValidationResult.VALID)throw new s.InvalidAddressError(t)}validateContract(t){if((0,s.validateContractAddress)(t)!==s.ValidationResult.VALID)throw new s.InvalidContractAddressError(t)}getBlockHash({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BLOCK_HASH,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getBlockHash({block:t});return this.put(e,r),r}}))}getLiveBlocks({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_LIVE_BLOCKS,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getLiveBlocks({block:t});return this.put(e,r),r}}))}getBalance(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BALANCE,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getBalance(t,{block:e});return this.put(r,i),i}}))}getStorage(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateContract(t);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_STORAGE,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getStorage(t,{block:e});return this.put(r,i),i}}))}getScript(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateContract(t);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_SCRIPT,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getScript(t,{block:e});return this.put(r,i),i}}))}getNormalizedScript(t,e={unparsing_mode:"Readable"},{block:r}=u){return a(this,void 0,void 0,(function*(){this.validateContract(t);const i=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_NORMALIZED_SCRIPT,[r,t,e]);if(this.has(i))return this.get(i);{const n=this.rpcClient.getNormalizedScript(t,e,{block:r});return this.put(i,n),n}}))}getContract(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_CONTRACT,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getContract(t,{block:e});return this.put(r,i),i}}))}getManagerKey(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_MANAGER_KEY,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getManagerKey(t,{block:e});return this.put(r,i),i}}))}getDelegate(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_DELEGATE,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getDelegate(t,{block:e});return this.put(r,i),i}}))}getBigMapKey(t,e,{block:r}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const i=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BIG_MAP_KEY,[r,t,e]);if(this.has(i))return this.get(i);{const n=this.rpcClient.getBigMapKey(t,e,{block:r});return this.put(i,n),n}}))}getBigMapExpr(t,e,{block:r}=u){return a(this,void 0,void 0,(function*(){const i=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BIG_MAP_EXPR,[r,t,e]);if(this.has(i))return this.get(i);{const n=this.rpcClient.getBigMapExpr(t,e,{block:r});return this.put(i,n),n}}))}getDelegates(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_DELEGATES,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getDelegates(t,{block:e});return this.put(r,i),i}}))}getVotingInfo(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_VOTING_INFO,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getVotingInfo(t,{block:e});return this.put(r,i),i}}))}getConstants({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_CONSTANTS,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getConstants({block:t});return this.put(e,r),r}}))}getBlock({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BLOCK,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getBlock({block:t});return this.put(e,r),r}}))}getBlockHeader({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BLOCK_HEADER,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getBlockHeader({block:t});return this.put(e,r),r}}))}getBlockMetadata({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BLOCK_METADATA,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getBlockMetadata({block:t});return this.put(e,r),r}}))}getBakingRights(t={},{block:e}=u){return a(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BAKING_RIGHTS,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getBakingRights(t,{block:e});return this.put(r,i),i}}))}getEndorsingRights(t={},{block:e}=u){return a(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_ENDORSING_RIGHTS,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getEndorsingRights(t,{block:e});return this.put(r,i),i}}))}getBallotList({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BALLOT_LIST,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getBallotList({block:t});return this.put(e,r),r}}))}getBallots({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_BALLOTS,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getBallots({block:t});return this.put(e,r),r}}))}getCurrentProposal({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_CURRENT_PROPOSAL,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getCurrentProposal({block:t});return this.put(e,r),r}}))}getCurrentQuorum({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_CURRENT_QUORUM,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getCurrentQuorum({block:t});return this.put(e,r),r}}))}getVotesListings({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_VOTES_LISTINGS,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getVotesListings({block:t});return this.put(e,r),r}}))}getProposals({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_PROPOSALS,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getProposals({block:t});return this.put(e,r),r}}))}forgeOperations(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.rpcClient.forgeOperations(t,{block:e})}))}injectOperation(t){return a(this,void 0,void 0,(function*(){return this.rpcClient.injectOperation(t)}))}preapplyOperations(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.rpcClient.preapplyOperations(t,{block:e})}))}getEntrypoints(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateContract(t);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_ENTRYPOINTS,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getEntrypoints(t,{block:e});return this.put(r,i),i}}))}runOperation(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.rpcClient.runOperation(t,{block:e})}))}runCode(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.rpcClient.runCode(t,{block:e})}))}runScriptView(t,{block:e}=u){var{unparsing_mode:r="Readable"}=t,i=o(t,["unparsing_mode"]);return a(this,void 0,void 0,(function*(){return this.rpcClient.runScriptView(Object.assign({unparsing_mode:r},i),{block:e})}))}runView(t,{block:e}=u){var{unparsing_mode:r="Readable"}=t,i=o(t,["unparsing_mode"]);return a(this,void 0,void 0,(function*(){return this.rpcClient.runView(Object.assign({unparsing_mode:r},i),{block:e})}))}getChainId(){return a(this,void 0,void 0,(function*(){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_CHAIN_ID,[]);if(this.has(t))return this.get(t);{const e=this.rpcClient.getChainId();return this.put(t,e),e}}))}packData(t,{block:e}=u){return a(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.PACK_DATA,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.packData(t,{block:e});return this.put(r,i),i}}))}getRpcUrl(){return this.rpcClient.getRpcUrl()}getCurrentPeriod({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_CURRENT_PERIOD,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getCurrentPeriod({block:t});return this.put(e,r),r}}))}getSuccessorPeriod({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_SUCCESSOR_PERIOD,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getSuccessorPeriod({block:t});return this.put(e,r),r}}))}getSaplingDiffById(t,{block:e}=u){return a(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_SAPLING_DIFF_BY_ID,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getSaplingDiffById(t,{block:e});return this.put(r,i),i}}))}getSaplingDiffByContract(t,{block:e}=u){return a(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_SAPLING_DIFF_BY_CONTRACT,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getSaplingDiffByContract(t,{block:e});return this.put(r,i),i}}))}getProtocols({block:t}=u){return a(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_PROTOCOLS,[t]);if(this.has(e))return this.get(e);{const r=this.rpcClient.getProtocols({block:t});return this.put(e,r),r}}))}getTxRollupState(t,{block:e}=u){return a(this,void 0,void 0,(function*(){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_TX_ROLLUP_STATE,[e,t]);if(this.has(r))return this.get(r);{const i=this.rpcClient.getTxRollupState(t,{block:e});return this.put(r,i),i}}))}getTxRollupInbox(t,e,{block:r}=u){return a(this,void 0,void 0,(function*(){const i=this.formatCacheKey(this.rpcClient.getRpcUrl(),h.GET_TX_ROLLUP_INBOX,[r,t,e]);if(this.has(i))return this.get(i);{const n=this.rpcClient.getTxRollupInbox(t,e,{block:r});return this.put(i,n),n}}))}}var d,p,b;!function(t){t.TOO_LARGE="too large"}(d||(d={})),function(t){t.BAKING_REWARDS="baking rewards",t.REWARDS="rewards",t.FEES="fees",t.DEPOSITS="deposits",t.LEGACY_REWARDS="legacy_rewards",t.LEGACY_FEES="legacy_fees",t.LEGACY_DEPOSITS="legacy_deposits",t.BLOCK_FEES="block fees",t.NONCE_REVELATION_REWARDS="nonce revelation rewards",t.DOUBLE_SIGNING_EVIDENCE_REWARDS="double signing evidence rewards",t.ENDORSING_REWARDS="endorsing rewards",t.BAKING_BONUSES="baking bonuses",t.STORAGE_FEES="storage fees",t.PUNISHMENTS="punishments",t.LOST_ENDORSING_REWARDS="lost endorsing rewards",t.SUBSIDY="subsidy",t.BURNED="burned",t.COMMITMENT="commitment",t.BOOTSTRAP="bootstrap",t.INVOICE="invoice",t.MINTED="minted",t.TX_ROLLUP_REJECTION_REWARDS="tx_rollup_rejection_rewards",t.TX_ROLLUP_REJECTION_PUNISHMENTS="tx_rollup_rejection_punishments",t.BONDS="bonds"}(p||(p={})),function(t){t.ORIGINATION="origination",t.DELEGATION="delegation",t.REVEAL="reveal",t.TRANSACTION="transaction",t.ACTIVATION="activate_account",t.ENDORSEMENT="endorsement",t.PREENDORSEMENT="preendorsement",t.SET_DEPOSITS_LIMIT="set_deposits_limit",t.DOUBLE_PREENDORSEMENT_EVIDENCE="double_preendorsement_evidence",t.ENDORSEMENT_WITH_SLOT="endorsement_with_slot",t.SEED_NONCE_REVELATION="seed_nonce_revelation",t.DOUBLE_ENDORSEMENT_EVIDENCE="double_endorsement_evidence",t.DOUBLE_BAKING_EVIDENCE="double_baking_evidence",t.PROPOSALS="proposals",t.BALLOT="ballot",t.FAILING_NOOP="failing_noop",t.REGISTER_GLOBAL_CONSTANT="register_global_constant",t.TX_ROLLUP_ORIGINATION="tx_rollup_origination",t.TX_ROLLUP_SUBMIT_BATCH="tx_rollup_submit_batch",t.TX_ROLLUP_COMMIT="tx_rollup_commit",t.TX_ROLLUP_RETURN_BOND="tx_rollup_return_bond",t.TX_ROLLUP_FINALIZE_COMMITMENT="tx_rollup_finalize_commitment",t.TX_ROLLUP_REMOVE_COMMITMENT="tx_rollup_remove_commitment",t.TX_ROLLUP_REJECTION="tx_rollup_rejection",t.TX_ROLLUP_DISPATCH_TICKETS="tx_rollup_dispatch_tickets",t.TRANSFER_TICKET="transfer_ticket",t.INCREASE_PAID_STORAGE="increase_paid_storage",t.VDF_REVELATION="vdf_revelation",t.EVENT="event"}(b||(b={}));const g={commitHash:"22fd810dcadf5272cb7a57d65165caa0eddbc57e",version:"14.2.0"};class m{constructor(t,e=c,r=new i.HttpBackend){this.url=t,this.chain=e,this.httpBackend=r}createURL(t){return`${this.url.replace(/\/+$/g,"")}${t}`}validateAddress(t){if((0,s.validateAddress)(t)!==s.ValidationResult.VALID)throw new s.InvalidAddressError(t)}validateContract(t){if((0,s.validateContractAddress)(t)!==s.ValidationResult.VALID)throw new s.InvalidAddressError(t)}getBlockHash({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/hash`),method:"GET"})}))}getLiveBlocks({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/live_blocks`),method:"GET"})}))}getBalance(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/contracts/${t}/balance`),method:"GET"});return new n.Z(r)}))}getStorage(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.validateContract(t),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/contracts/${t}/storage`),method:"GET"})}))}getScript(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.validateContract(t),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/contracts/${t}/script`),method:"GET"})}))}getNormalizedScript(t,e={unparsing_mode:"Readable"},{block:r}=u){return a(this,void 0,void 0,(function*(){return this.validateContract(t),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/contracts/${t}/script/normalized`),method:"POST"},e)}))}getContract(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/contracts/${t}`),method:"GET"});return Object.assign(Object.assign({},r),{balance:new n.Z(r.balance)})}))}getManagerKey(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.validateAddress(t),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/contracts/${t}/manager_key`),method:"GET"})}))}getDelegate(t,{block:e}=u){return a(this,void 0,void 0,(function*(){let r;this.validateAddress(t);try{r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/contracts/${t}/delegate`),method:"GET"})}catch(t){if(!(t instanceof i.HttpResponseError&&t.status===i.STATUS_CODE.NOT_FOUND))throw t;r=null}return r}))}getBigMapKey(t,e,{block:r}=u){return a(this,void 0,void 0,(function*(){return this.validateAddress(t),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/contracts/${t}/big_map_get`),method:"POST"},e)}))}getBigMapExpr(t,e,{block:r}=u){return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/big_maps/${t}/${e}`),method:"GET"})}))}getDelegates(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateAddress(t);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/delegates/${t}`),method:"GET"}),i=f(r,["balance","full_balance","current_frozen_deposits","frozen_deposits","frozen_balance","frozen_deposits_limit","staking_balance","delegated_balance","voting_power"]);return Object.assign(Object.assign(Object.assign({},r),i),{frozen_balance_by_cycle:r.frozen_balance_by_cycle?r.frozen_balance_by_cycle.map((t=>{var{deposit:e,deposits:r,fees:i,rewards:n}=t,s=o(t,["deposit","deposits","fees","rewards"]);const a=f({deposit:e,deposits:r,fees:i,rewards:n},["deposit","deposits","fees","rewards"]);return Object.assign(Object.assign({},s),{deposit:a.deposit,deposits:a.deposits,fees:a.fees,rewards:a.rewards})})):void 0})}))}getVotingInfo(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.validateAddress(t),yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/delegates/${t}/voting_info`),method:"GET"})}))}getConstants({block:t}=u){return a(this,void 0,void 0,(function*(){const e=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/constants`),method:"GET"}),r=f(e,["time_between_blocks","hard_gas_limit_per_operation","hard_gas_limit_per_block","proof_of_work_threshold","tokens_per_roll","seed_nonce_revelation_tip","block_security_deposit","endorsement_security_deposit","block_reward","endorsement_reward","cost_per_byte","hard_storage_limit_per_operation","test_chain_duration","baking_reward_per_endorsement","delay_per_missing_endorsement","minimal_block_delay","liquidity_baking_subsidy","cache_layout","baking_reward_fixed_portion","baking_reward_bonus_per_slot","endorsing_reward_per_slot","double_baking_punishment","delay_increment_per_round","tx_rollup_commitment_bond","vdf_difficulty","sc_rollup_stake_amount"]);return Object.assign(Object.assign({},e),r)}))}getBlock({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}`),method:"GET"})}))}getBlockHeader({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/header`),method:"GET"})}))}getBlockMetadata({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/metadata`),method:"GET"})}))}getBakingRights(t={},{block:e}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/helpers/baking_rights`),method:"GET",query:t})}))}getEndorsingRights(t={},{block:e}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/helpers/endorsing_rights`),method:"GET",query:t})}))}getBallotList({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/votes/ballot_list`),method:"GET"})}))}getBallots({block:t}=u){return a(this,void 0,void 0,(function*(){return f(yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/votes/ballots`),method:"GET"}),["yay","nay","pass"])}))}getCurrentProposal({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/votes/current_proposal`),method:"GET"})}))}getCurrentQuorum({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/votes/current_quorum`),method:"GET"})}))}getVotesListings({block:t}=u){return a(this,void 0,void 0,(function*(){const e=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/votes/listings`),method:"GET"});return e.map((t=>(t.voting_power&&(t.voting_power=new n.Z(t.voting_power)),t))),e}))}getProposals({block:t}=u){return a(this,void 0,void 0,(function*(){const e=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/votes/proposals`),method:"GET"});return e.map((t=>t[1]=new n.Z(t[1]))),e}))}forgeOperations(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/helpers/forge/operations`),method:"POST"},t)}))}injectOperation(t){return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL("/injection/operation"),method:"POST"},t)}))}preapplyOperations(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/helpers/preapply/operations`),method:"POST"},t)}))}getEntrypoints(t,{block:e}=u){return a(this,void 0,void 0,(function*(){this.validateContract(t);return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/contracts/${t}/entrypoints`),method:"GET"})}))}runOperation(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/helpers/scripts/run_operation`),method:"POST"},t)}))}runCode(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/helpers/scripts/run_code`),method:"POST"},t)}))}runScriptView(t,{block:e}=u){var{unparsing_mode:r="Readable"}=t,i=o(t,["unparsing_mode"]);return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/helpers/scripts/run_script_view`),method:"POST"},Object.assign({unparsing_mode:r},i))}))}runView(t,{block:e}=u){var{unparsing_mode:r="Readable"}=t,i=o(t,["unparsing_mode"]);return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/helpers/scripts/run_view`),method:"POST"},Object.assign({unparsing_mode:r},i))}))}getChainId(){return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/chain_id`),method:"GET"})}))}packData(t,{block:e}=u){return a(this,void 0,void 0,(function*(){const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/helpers/scripts/pack_data`),method:"POST"},t),{gas:i}=r,s=o(r,["gas"]);let a=i;const c=new n.Z(i||"");return c.isNaN()||(a=c),Object.assign({gas:a},s)}))}getRpcUrl(){return this.url}getCurrentPeriod({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/votes/current_period`),method:"GET"})}))}getSuccessorPeriod({block:t}=u){return a(this,void 0,void 0,(function*(){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/votes/successor_period`),method:"GET"})}))}getSaplingDiffById(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/sapling/${t}/get_diff`),method:"GET"})}))}getSaplingDiffByContract(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/contracts/${t}/single_sapling_get_diff`),method:"GET"})}))}getProtocols({block:t}=u){return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/protocols`),method:"GET"})}))}getTxRollupState(t,{block:e}=u){return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/tx_rollup/${t}/state`),method:"GET"})}))}getTxRollupInbox(t,e,{block:r}=u){return a(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/tx_rollup/${t}/inbox/${e}`),method:"GET"})}))}}},4632:(t,e,r)=>{"use strict";r.r(e),r.d(e,{DeprecationError:()=>I,InvalidAddressError:()=>S,InvalidBlockHashError:()=>T,InvalidChainIdError:()=>A,InvalidContractAddressError:()=>E,InvalidHexStringError:()=>k,InvalidKeyError:()=>v,InvalidKeyHashError:()=>O,InvalidMessageError:()=>_,InvalidOperationHashError:()=>P,InvalidOperationKindError:()=>R,InvalidProtocolHashError:()=>x,InvalidPublicKeyError:()=>y,InvalidSignatureError:()=>w,Prefix:()=>i,ProhibitedActionError:()=>N,VERSION:()=>it,ValidationResult:()=>D,ValueConversionError:()=>M,b58cdecode:()=>ut,b58cencode:()=>ct,b58decode:()=>ht,b58decodeL2Address:()=>ft,buf2hex:()=>yt,bytes2Char:()=>Et,char2Bytes:()=>_t,encodeExpr:()=>ot,encodeKey:()=>pt,encodeKeyHash:()=>bt,encodeL2Address:()=>dt,encodeOpHash:()=>at,encodePubKey:()=>lt,format:()=>st,getPkhfromPk:()=>wt,hex2Bytes:()=>St,hex2buf:()=>gt,isValidPrefix:()=>U,mergebuf:()=>mt,mic2arr:()=>vt,num2PaddedHex:()=>Ot,prefix:()=>g,prefixLength:()=>m,stripHexPrefix:()=>Tt,toHexBuf:()=>At,validateAddress:()=>q,validateBlock:()=>et,validateChain:()=>Z,validateContractAddress:()=>W,validateKeyHash:()=>Y,validateOperation:()=>Q,validatePkAndExtractPrefix:()=>C,validateProtocol:()=>tt,validatePublicKey:()=>X,validateSignature:()=>J,validateSpendingKey:()=>rt,verifySignature:()=>L});var i,n=r(8834),s=r(7728),o=r(6851),a=r(1395),c=r.n(a),u=r(4075),h=r.n(u),f=r(2558),l=r(7554),d=r.n(l),p=r(8743),b=r.n(p);!function(t){t.TZ1="tz1",t.TZ2="tz2",t.TZ3="tz3",t.TZ4="tz4",t.KT="KT",t.KT1="KT1",t.EDSK2="edsk2",t.SPSK="spsk",t.P2SK="p2sk",t.EDPK="edpk",t.SPPK="sppk",t.P2PK="p2pk",t.BLPK="BLpk",t.EDESK="edesk",t.SPESK="spesk",t.P2ESK="p2esk",t.EDSK="edsk",t.EDSIG="edsig",t.SPSIG="spsig",t.P2SIG="p2sig",t.SIG="sig",t.NET="Net",t.NCE="nce",t.B="B",t.O="o",t.LO="Lo",t.LLO="LLo",t.P="P",t.CO="Co",t.ID="id",t.EXPR="expr",t.TZ="TZ",t.VH="vh",t.SASK="sask",t.ZET1="zet1",t.TXR1="txr1",t.TXI="txi",t.TXM="txm",t.TXC="txc",t.TXMR="txmr",t.TXRL="txM",t.TXW="txw"}(i||(i={}));const g={[i.TZ1]:new Uint8Array([6,161,159]),[i.TZ2]:new Uint8Array([6,161,161]),[i.TZ3]:new Uint8Array([6,161,164]),[i.TZ4]:new Uint8Array([6,161,166]),[i.KT]:new Uint8Array([2,90,121]),[i.KT1]:new Uint8Array([2,90,121]),[i.EDSK]:new Uint8Array([43,246,78,7]),[i.EDSK2]:new Uint8Array([13,15,58,7]),[i.SPSK]:new Uint8Array([17,162,224,201]),[i.P2SK]:new Uint8Array([16,81,238,189]),[i.EDPK]:new Uint8Array([13,15,37,217]),[i.SPPK]:new Uint8Array([3,254,226,86]),[i.P2PK]:new Uint8Array([3,178,139,127]),[i.BLPK]:new Uint8Array([6,149,135,204]),[i.EDESK]:new Uint8Array([7,90,60,179,41]),[i.SPESK]:new Uint8Array([9,237,241,174,150]),[i.P2ESK]:new Uint8Array([9,48,57,115,171]),[i.EDSIG]:new Uint8Array([9,245,205,134,18]),[i.SPSIG]:new Uint8Array([13,115,101,19,63]),[i.P2SIG]:new Uint8Array([54,240,44,52]),[i.SIG]:new Uint8Array([4,130,43]),[i.NET]:new Uint8Array([87,82,0]),[i.NCE]:new Uint8Array([69,220,169]),[i.B]:new Uint8Array([1,52]),[i.O]:new Uint8Array([5,116]),[i.LO]:new Uint8Array([133,233]),[i.LLO]:new Uint8Array([29,159,109]),[i.P]:new Uint8Array([2,170]),[i.CO]:new Uint8Array([79,179]),[i.ID]:new Uint8Array([153,103]),[i.EXPR]:new Uint8Array([13,44,64,27]),[i.TZ]:new Uint8Array([2,90,121]),[i.VH]:new Uint8Array([1,106,242]),[i.SASK]:new Uint8Array([11,237,20,92]),[i.ZET1]:new Uint8Array([18,71,40,223]),[i.TXR1]:new Uint8Array([1,128,120,31]),[i.TXI]:new Uint8Array([79,148,196]),[i.TXM]:new Uint8Array([79,149,30]),[i.TXC]:new Uint8Array([79,148,17]),[i.TXMR]:new Uint8Array([18,7,206,87]),[i.TXRL]:new Uint8Array([79,146,82]),[i.TXW]:new Uint8Array([79,150,72])},m={[i.TZ1]:20,[i.TZ2]:20,[i.TZ3]:20,[i.TZ4]:20,[i.KT]:20,[i.KT1]:20,[i.EDPK]:32,[i.SPPK]:33,[i.P2PK]:33,[i.BLPK]:48,[i.EDSIG]:64,[i.SPSIG]:64,[i.P2SIG]:64,[i.SIG]:64,[i.NET]:4,[i.B]:32,[i.P]:32,[i.O]:32,[i.VH]:32,[i.SASK]:169,[i.ZET1]:43,[i.TXR1]:20,[i.TXI]:32,[i.TXM]:32,[i.TXC]:32,[i.TXMR]:32,[i.TXRL]:32,[i.TXW]:32};class v extends Error{constructor(t,e){super(),this.key=t,this.errorDetail=e,this.name="InvalidKeyError";const r=`The key ${t} is invalid.`;this.message=e?`${r} ${e}`:r}}class y extends Error{constructor(t,e){super(),this.publicKey=t,this.name="InvalidPublicKeyError";const r=`The public key '${t}' is invalid.`;this.message=e?`${r} ${e}`:r}}class w extends Error{constructor(t,e){super(),this.signature=t,this.name="InvalidSignatureError";const r=`The signature '${t}' is invalid.`;this.message=e?`${r} ${e}`:r}}class _ extends Error{constructor(t,e){super(),this.msg=t,this.errorDetail=e,this.name="InvalidMessageError";const r=`The message '${t}' is invalid.`;this.message=e?`${r} ${e}`:r}}class E extends Error{constructor(t){super(`The contract address '${t}' is invalid`),this.contractAddress=t,this.name="InvalidContractAddressError"}}class S extends Error{constructor(t,e){super(),this.address=t,this.name="InvalidAddressError";const r=`The address '${t}' is invalid.`;this.message=e?`${r} ${e}`:r}}class A extends Error{constructor(t){super(`The chain id '${t}' is invalid`),this.chainId=t,this.name="InvalidChainIdError"}}class O extends Error{constructor(t){super(`The public key hash '${t}' is invalid`),this.keyHash=t,this.name="InvalidKeyHashError"}}class T extends Error{constructor(t){super(`The block hash '${t}' is invalid`),this.blockHash=t,this.name="InvalidBlockHashError"}}class x extends Error{constructor(t){super(`The protocol hash '${t}' is invalid`),this.protocolHash=t,this.name="InvalidProtocolHashError"}}class P extends Error{constructor(t){super(`The operation hash '${t}' is invalid`),this.operationHash=t,this.name="InvalidOperationHashError"}}class R extends Error{constructor(t){super(`The operation kind '${t}' is unsupported`),this.operationKind=t,this.name="InvalidOperationKindError"}}class I extends Error{constructor(t){super(t),this.message=t,this.name="DeprecationError"}}class N extends Error{constructor(t){super(t),this.message=t,this.name="ProhibitedActionError"}}class M extends Error{constructor(t,e){super(`Unable to convert ${t} to a ${e}`),this.value=t,this.desiredType=e,this.name="ValueConversionError"}}class k extends Error{constructor(t){super(t),this.message=t,this.name="InvalidHexStringError"}}function L(t,e,r){const n=C(e),a=function(t){const e=t.startsWith("sig")?t.substr(0,3):t.substr(0,5),r=J(t);if(r!==D.VALID){if(r===D.INVALID_CHECKSUM)throw new w(t,"invalid checksum");if(r===D.INVALID_LENGTH)throw new w(t,"invalid length");if(r===D.NO_PREFIX_MATCHED)throw new w(e,"unsupported prefix")}return e}(r),c=ut(e,g[n]),u=ut(r,g[a]),h=(0,o.vp)(gt(function(t){if(""===t)throw new _(t,"The message provided for verifying signature cannot be empty.");return t}(t)),32);return n===i.EDPK?function(t,e,r){try{return(0,s.T)(r,e,t)}catch(t){return!1}}(u,h,c):n===i.SPPK?function(t,e,r){const i=new(d().ec)("secp256k1").keyFromPublic(r);return B(t,e,i)}(u,h,c):n===i.P2PK&&function(t,e,r){const i=new(d().ec)("p256").keyFromPublic(r);return B(t,e,i)}(u,h,c)}function C(t){if(""===t)throw new y(t,"Public key cannot be empty");const e=t.substring(0,4),r=X(t);if(r!==D.VALID){if(r===D.INVALID_CHECKSUM)throw new y(t,"The public key provided has an invalid checksum");if(r===D.INVALID_LENGTH)throw new y(t,"The public key provided has an invalid length");if(r===D.NO_PREFIX_MATCHED)throw new y(t,`The public key provided has an unsupported prefix: ${e}`)}return e}function B(t,e,r){const i=yt(b()(t)).match(/([a-f\d]{64})/gi);if(i)try{const[t,n]=i;return r.verify(e,{r:t,s:n})}catch(t){return!1}return!1}var D;function U(t){return"string"==typeof t&&t in g}function j(t,e){const r=new RegExp(`^(${e.join("|")})`).exec(t);if(!r||0===r.length)return D.NO_PREFIX_MATCHED;const i=r[0];if(!U(i))return D.NO_PREFIX_MATCHED;const n=/^(KT1\w{33})(%(.*))?/.exec(t);n&&(t=n[1]);let s=h().decodeUnsafe(t);return s?(s=s.slice(g[i].length),s.length!==m[i]?D.INVALID_LENGTH:D.VALID):D.INVALID_CHECKSUM}!function(t){t[t.NO_PREFIX_MATCHED=0]="NO_PREFIX_MATCHED",t[t.INVALID_CHECKSUM=1]="INVALID_CHECKSUM",t[t.INVALID_LENGTH=2]="INVALID_LENGTH",t[t.VALID=3]="VALID"}(D||(D={}));const K=[i.TZ1,i.TZ2,i.TZ3,i.TZ4],V=[i.KT1,i.TXR1],F=[i.EDSIG,i.P2SIG,i.SPSIG,i.SIG],H=[i.EDPK,i.SPPK,i.P2PK,i.BLPK],G=[i.O],$=[i.P],z=[i.B];function q(t){return j(t,[...K,...V])}function Z(t){return j(t,[i.NET])}function W(t){return j(t,V)}function Y(t){return j(t,K)}function J(t){return j(t,F)}function X(t){return j(t,H)}function Q(t){return j(t,G)}function tt(t){return j(t,$)}function et(t){return j(t,z)}function rt(t){return j(t,[i.SASK])}const it={commitHash:"22fd810dcadf5272cb7a57d65165caa0eddbc57e",version:"14.2.0"};function nt(t){switch(t){case"tz":return 6;case"mtz":return 3;default:return 0}}function st(t="mutez",e="mutez",r){const i=new f.Z(r);return i.isNaN()?r:i.multipliedBy(Math.pow(10,nt(t))).dividedBy(Math.pow(10,nt(e)))}function ot(t){return ct(c().blake2b(gt(t),void 0,32),g.expr)}function at(t){return ct(c().blake2b(gt(t),void 0,32),g.o)}function ct(t,e){const r="string"==typeof t?Uint8Array.from(n.Buffer.from(t,"hex")):t,i=new Uint8Array(e.length+r.length);return i.set(e),i.set(r,e.length),h().encode(n.Buffer.from(i.buffer))}const ut=(t,e)=>h().decode(t).slice(e.length);function ht(t){const e=h().decode(t),r={[g.tz1.toString()]:"0000",[g.tz2.toString()]:"0001",[g.tz3.toString()]:"0002"},i={[g.txr1.toString()]:"02"},n=r[new Uint8Array(e.slice(0,3)).toString()],s=i[new Uint8Array(e.slice(0,4)).toString()];if(n){return n+yt(e.slice(3))}if(s){return s+yt(e.slice(4))+"00"}return"01"+yt(e.slice(3,42))+"00"}function ft(t){const e=h().decode(t);return yt(e.slice(3,42))}function lt(t){if("00"===t.substring(0,2)){const e={"0000":g.tz1,"0001":g.tz2,"0002":g.tz3};return ct(t.substring(4),e[t.substring(0,4)])}return"02"===t.substring(0,2)?ct(t.substring(2,t.length-2),g.txr1):ct(t.substring(2,42),g.KT)}function dt(t){return ct(t,g.tz4)}function pt(t){if("0"===t[0]){const e={"00":new Uint8Array([13,15,37,217]),"01":new Uint8Array([3,254,226,86]),"02":new Uint8Array([3,178,139,127])};return ct(t.substring(2),e[t.substring(0,2)])}}function bt(t){if("0"===t[0]){const e={"00":new Uint8Array([6,161,159]),"01":new Uint8Array([6,161,161]),"02":new Uint8Array([6,161,164])};return ct(t.substring(2),e[t.substring(0,2)])}}const gt=t=>{const e=t.match(/[\da-f]{2}/gi);if(e)return new Uint8Array(e.map((t=>parseInt(t,16))));throw new M(t,"Uint8Array")},mt=(t,e)=>{const r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r},vt=function t(e){let r=[];if(Object.prototype.hasOwnProperty.call(e,"prim"))"Pair"===e.prim?(r.push(t(e.args[0])),r=r.concat(t(e.args[1]))):"Elt"===e.prim?r={key:t(e.args[0]),val:t(e.args[1])}:"True"===e.prim?r=!0:"False"===e.prim&&(r=!1);else if(Array.isArray(e)){const i=e.length;for(let n=0;n<i;n++){const i=t(e[n]);void 0!==i.key?(Array.isArray(r)&&(r={keys:[],vals:[]}),r.keys.push(i.key),r.vals.push(i.val)):r.push(i)}}else r=Object.prototype.hasOwnProperty.call(e,"string")?e.string:Object.prototype.hasOwnProperty.call(e,"int")?parseInt(e.int,10):e;return r},yt=t=>{const e=new Uint8Array(t),r=[];return e.forEach((t=>{const e=`00${t.toString(16)}`.slice(-2);r.push(e)})),r.join("")},wt=t=>{let e,r;const n=C(t),s=ut(t,g[n]);switch(n){case i.EDPK:e=g[i.TZ1],r=m[i.TZ1];break;case i.SPPK:e=g[i.TZ2],r=m[i.TZ2];break;case i.P2PK:e=g[i.TZ3],r=m[i.TZ3];break;case i.BLPK:e=g[i.TZ4],r=m[i.TZ4]}return ct((0,o.vp)(s,r),e)};function _t(t){return n.Buffer.from(t,"utf8").toString("hex")}function Et(t){return n.Buffer.from(gt(t)).toString("utf8")}function St(t){if(!t.match(/[\da-f]{2}/gi))throw new k(`The hex string ${t} does not have an even number of characters`);return n.Buffer.from(t,"hex")}function At(t,e=8){return n.Buffer.from(Ot(t,e),"hex")}function Ot(t,e=8){if(new f.Z(t).isPositive()){const r=Math.ceil(e/4),i=t.toString(16);let n=i.length>=r?i.length:r;return n=n%2==0?n:n+1,function(t,e){const r="0";if(t.length>=e)return t;{const i=e-t.length;return r.repeat(i)+t}}(i,n)}return new f.Z(2).pow(e).minus(new f.Z(t).abs()).toString(16)}function Tt(t){return t.startsWith("0x")?t.slice(2):t}},150:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.RPCBatchProvider=e.OperationBatch=e.BATCH_KINDS=void 0;const n=r(9480),s=r(3650),o=r(2026),a=r(807),c=r(6368),u=r(4632);e.BATCH_KINDS=[c.OpKind.ACTIVATION,c.OpKind.ORIGINATION,c.OpKind.TRANSACTION,c.OpKind.DELEGATION];class h extends o.OperationEmitter{constructor(t,e){super(t),this.estimator=e,this.operations=[]}withTransfer(t){if(u.validateAddress(t.to)!==u.ValidationResult.VALID)throw new u.InvalidAddressError(t.to);return this.operations.push(Object.assign({kind:c.OpKind.TRANSACTION},t)),this}withTransferTicket(t){if(u.validateContractAddress(t.destination)!==u.ValidationResult.VALID)throw new u.InvalidContractAddressError(t.destination);return this.operations.push(Object.assign({kind:c.OpKind.TRANSFER_TICKET},t)),this}withContractCall(t,e={}){return this.withTransfer(t.toTransferParams(e))}withDelegation(t){if(t.source&&u.validateAddress(t.source)!==u.ValidationResult.VALID)throw new u.InvalidAddressError(t.source);if(t.delegate&&u.validateAddress(t.delegate)!==u.ValidationResult.VALID)throw new u.InvalidAddressError(t.delegate);return this.operations.push(Object.assign({kind:c.OpKind.DELEGATION},t)),this}withActivation({pkh:t,secret:e}){if(u.validateKeyHash(t)!==u.ValidationResult.VALID)throw new u.InvalidKeyHashError(t);return this.operations.push({kind:c.OpKind.ACTIVATION,pkh:t,secret:e}),this}withOrigination(t){return this.operations.push(Object.assign({kind:c.OpKind.ORIGINATION},t)),this}withRegisterGlobalConstant(t){return this.operations.push(Object.assign({kind:c.OpKind.REGISTER_GLOBAL_CONSTANT},t)),this}withIncreasePaidStorage(t){return this.operations.push(Object.assign({kind:c.OpKind.INCREASE_PAID_STORAGE},t)),this}withTxRollupOrigination(t){return this.operations.push(Object.assign({kind:c.OpKind.TX_ROLLUP_ORIGINATION},t)),this}withTxRollupSubmitBatch(t){return this.operations.push(Object.assign({kind:c.OpKind.TX_ROLLUP_SUBMIT_BATCH},t)),this}getRPCOp(t){return i(this,void 0,void 0,(function*(){switch(t.kind){case c.OpKind.TRANSACTION:return n.createTransferOperation(Object.assign({},t));case c.OpKind.ORIGINATION:return n.createOriginationOperation(yield this.context.parser.prepareCodeOrigination(Object.assign({},t)));case c.OpKind.DELEGATION:return n.createSetDelegateOperation(Object.assign({},t));case c.OpKind.ACTIVATION:return Object.assign({},t);case c.OpKind.REGISTER_GLOBAL_CONSTANT:return n.createRegisterGlobalConstantOperation(Object.assign({},t));case c.OpKind.INCREASE_PAID_STORAGE:return n.createIncreasePaidStorageOperation(Object.assign({},t));case c.OpKind.TX_ROLLUP_ORIGINATION:return n.createTxRollupOriginationOperation(Object.assign({},t));case c.OpKind.TX_ROLLUP_SUBMIT_BATCH:return n.createTxRollupBatchOperation(Object.assign({},t));case c.OpKind.TRANSFER_TICKET:return n.createTransferTicketOperation(Object.assign({},t));default:throw new u.InvalidOperationKindError(t.kind)}}))}with(t){for(const e of t)switch(e.kind){case c.OpKind.TRANSACTION:this.withTransfer(e);break;case c.OpKind.ORIGINATION:this.withOrigination(e);break;case c.OpKind.DELEGATION:this.withDelegation(e);break;case c.OpKind.ACTIVATION:this.withActivation(e);break;case c.OpKind.REGISTER_GLOBAL_CONSTANT:this.withRegisterGlobalConstant(e);break;case c.OpKind.INCREASE_PAID_STORAGE:this.withIncreasePaidStorage(e);break;case c.OpKind.TX_ROLLUP_ORIGINATION:this.withTxRollupOrigination(e);break;case c.OpKind.TX_ROLLUP_SUBMIT_BATCH:this.withTxRollupSubmitBatch(e);break;case c.OpKind.TRANSFER_TICKET:this.withTransferTicket(e);break;default:throw new u.InvalidOperationKindError(e.kind)}return this}send(t){return i(this,void 0,void 0,(function*(){const e=yield this.signer.publicKeyHash(),r=yield this.signer.publicKey(),o=yield this.estimator.batch(this.operations),u=yield this.isRevealOpNeeded(this.operations,e);let h=u?1:0;const f=[];for(const t of this.operations){if(a.isOpWithFee(t)){const e=yield this.estimate(t,(()=>i(this,void 0,void 0,(function*(){return o[h]}))));f.push(yield this.getRPCOp(Object.assign(Object.assign({},t),e)))}else f.push(Object.assign({},t));h++}if(u){const t={kind:c.OpKind.REVEAL},s=yield this.estimate(t,(()=>i(this,void 0,void 0,(function*(){return o[0]}))));f.unshift(yield n.createRevealOperation(Object.assign({},s),e,r))}const l=t&&t.source||e,d=yield this.prepareOperation({operation:f,source:l}),p=yield this.forge(d),{hash:b,context:g,forgedBytes:m,opResponse:v}=yield this.signAndInject(p);return new s.BatchOperation(b,f,l,m,v,g)}))}}e.OperationBatch=h;e.RPCBatchProvider=class{constructor(t,e){this.context=t,this.estimator=e}batch(t){const e=new h(this.context,this.estimator);return Array.isArray(t)&&e.with(t),e}}},4593:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ChainIds=e.protocols=e.Protocols=e.COST_PER_BYTE=e.DEFAULT_STORAGE_LIMIT=e.DEFAULT_FEE=e.DEFAULT_GAS_LIMIT=void 0,function(t){t[t.DELEGATION=10600]="DELEGATION",t[t.ORIGINATION=10600]="ORIGINATION",t[t.TRANSFER=10600]="TRANSFER",t[t.REVEAL=1100]="REVEAL"}(e.DEFAULT_GAS_LIMIT||(e.DEFAULT_GAS_LIMIT={})),function(t){t[t.DELEGATION=1257]="DELEGATION",t[t.ORIGINATION=1e4]="ORIGINATION",t[t.TRANSFER=1e4]="TRANSFER",t[t.REVEAL=374]="REVEAL"}(e.DEFAULT_FEE||(e.DEFAULT_FEE={})),function(t){t[t.DELEGATION=0]="DELEGATION",t[t.ORIGINATION=257]="ORIGINATION",t[t.TRANSFER=257]="TRANSFER",t[t.REVEAL=0]="REVEAL"}(e.DEFAULT_STORAGE_LIMIT||(e.DEFAULT_STORAGE_LIMIT={})),e.COST_PER_BYTE=250,function(t){t.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",t.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",t.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",t.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",t.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",t.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",t.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",t.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",t.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",t.PsiThaCa="PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP",t.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",t.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",t.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",t.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(r=e.Protocols||(e.Protocols={})),e.protocols={"004":[r.Pt24m4xi],"005":[r.PsBABY5H,r.PsBabyM1],"006":[r.PsCARTHA],"007":[r.PsDELPH1],"008":[r.PtEdo2Zk],"009":[r.PsFLorena],"010":[r.PtGRANADs],"011":[r.PtHangz2],"012":[r.PsiThaCa,r.Psithaca2],"013":[r.PtJakart2],"014":[r.PtKathman],"015":[r.ProtoALpha]},function(t){t.MAINNET="NetXdQprcVkpaWU",t.CARTHAGENET="NetXjD3HPJJjmcd",t.DELPHINET="NetXm8tYqnMWky1",t.EDONET="NetXSgo1ZT2DRUG",t.FLORENCENET="NetXxkAx4woPLyu",t.GRANADANET="NetXz969SFaFn8k",t.HANGZHOUNET="NetXZSsxBpMQeAT",t.ITHACANET="NetXbhmtAbMukLc",t.ITHACANET2="NetXnHfVqm9iesp",t.JAKARTANET2="NetXLH1uAxK7CCh",t.KATHMANDUNET="NetXazhm4yetmff"}(e.ChainIds||(e.ChainIds={}))},4984:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Context=e.defaultConfigConfirmation=void 0;const n=r(6368),s=r(5744),o=r(1067),a=r(8286),c=r(992),u=r(4782),h=r(1151),f=r(150),l=r(635),d=r(5286),p=r(6395),b=r(4496),g=r(9494),m=r(259),v=r(5032),y=r(6713);e.defaultConfigConfirmation={defaultConfirmationCount:1,confirmationPollingTimeoutSecond:180};class w{constructor(t,r=new o.NoopSigner,i,w=new b.BehaviorSubject(Object.assign({},e.defaultConfigConfirmation)),_,E,S,A,O,T,x,P){this._rpc=t,this._signer=r,this._proto=i,this._config=w,this.providerDecorator=[],this.tz=new c.RpcTzProvider(this),this.estimate=new u.RPCEstimateProvider(this),this.contract=new h.RpcContractProvider(this,this.estimate),this.batch=new f.RPCBatchProvider(this,this.estimate),this.wallet=new l.Wallet(this),this.withExtensions=()=>{let t=this.clone();return this.providerDecorator.forEach((e=>{t=e(t)})),t},"string"==typeof this._rpc?this._rpcClient=new n.RpcClient(this._rpc):this._rpcClient=this._rpc,this._forger=_||new y.TaquitoLocalForger(this),this._injector=E||new s.RpcInjector(this),this.operationFactory=new a.OperationFactory(this),this._walletProvider=A||new l.LegacyWalletProvider(this),this._parser=O||new d.MichelCodecParser(this),this._packer=S||new p.RpcPacker(this),this._globalConstantsProvider=T||new g.NoopGlobalConstantsProvider,this._readProvider=x||new m.RpcReadAdapter(this._rpcClient),this._stream=P||new v.PollingSubscribeProvider(this)}get config(){return this._config.getValue()}set config(t){this._config.next(Object.assign({},t))}setPartialConfig(t){this._config.next(Object.assign(Object.assign({},this._config.getValue()),t))}get rpc(){return this._rpcClient}set rpc(t){this._rpcClient=t}get injector(){return this._injector}set injector(t){this._injector=t}get forger(){return this._forger}set forger(t){this._forger=t}get signer(){return this._signer}set signer(t){this._signer=t}get walletProvider(){return this._walletProvider}set walletProvider(t){this._walletProvider=t}set proto(t){this._proto=t}get proto(){return this._proto}get parser(){return this._parser}set parser(t){this._parser=t}get packer(){return this._packer}set packer(t){this._packer=t}get globalConstantsProvider(){return this._globalConstantsProvider}set globalConstantsProvider(t){this._globalConstantsProvider=t}get readProvider(){return this._readProvider}set readProvider(t){this._readProvider=t}get stream(){return this._stream}set stream(t){this._stream=t}isAnyProtocolActive(t=[]){return i(this,void 0,void 0,(function*(){if(this._proto)return t.includes(this._proto);{const e=yield this.readProvider.getNextProtocol("head");return t.includes(e)}}))}isAnySignerConfigured(){return!(this.signer instanceof o.NoopSigner)}clone(){return new w(this.rpc,this.signer,this.proto,this._config,this.forger,this._injector,this.packer,this._walletProvider,this._parser,this._globalConstantsProvider,this._readProvider,this._stream)}registerProviderDecorator(t){this.providerDecorator.push(t)}}e.Context=w},5225:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.BigMapAbstraction=void 0;const n=r(5543);e.BigMapAbstraction=class{constructor(t,e,r){this.id=t,this.schema=e,this.provider=r}get(t,e){return i(this,void 0,void 0,(function*(){try{return yield this.provider.getBigMapKeyByID(this.id.toString(),t,this.schema,e)}catch(t){if(t instanceof n.HttpResponseError&&t.status===n.STATUS_CODE.NOT_FOUND)return;throw t}}))}getMultipleValues(t,e,r=5){return i(this,void 0,void 0,(function*(){return this.provider.getBigMapKeysByID(this.id.toString(),t,this.schema,e,r)}))}toJSON(){return this.id.toString()}toString(){return this.id.toString()}}},191:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.compose=void 0,e.compose=function(t,e){return(r,i)=>e(t(r,i),i)}},2298:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContractMethodFactory=void 0;const i=r(3687),n=r(7864),s=r(3849);e.ContractMethodFactory=class{constructor(t,e){this.provider=t,this.contractAddress=e}createContractMethodFlatParams(t,e,r,i=!0,s=!1){return new n.ContractMethod(this.provider,this.contractAddress,t,e,r,i,s)}createContractMethodObjectParam(t,e,r,n=!0,s=!1){return new i.ContractMethodObject(this.provider,this.contractAddress,t,e,r,n,s)}createContractViewObjectParam(t,e,r,i,n){return new s.OnChainView(t,e,this.contractAddress,r,i,n)}}},7864:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContractMethod=void 0;const i=r(635),n=r(1863),s=r(6700);e.ContractMethod=class{constructor(t,e,r,i,n,s=!0,o=!1){this.provider=t,this.address=e,this.parameterSchema=r,this.name=i,this.args=n,this.isMultipleEntrypoint=s,this.isAnonymous=o}validateArgs(t,e,r){const i=e.ExtractSignatures();if(!i.find((e=>e.length===t.length)))throw new s.InvalidParameterError(r,i,t)}get schema(){return this.isAnonymous?this.parameterSchema.ExtractSchema()[this.name]:this.parameterSchema.ExtractSchema()}getSignature(){if(!this.isAnonymous){const t=this.parameterSchema.ExtractSignatures();return 1==t.length?t[0]:t}{const t=this.parameterSchema.ExtractSignatures().find((t=>t[0]===this.name));if(t)return t.shift(),t}}send(t={}){return this.provider instanceof i.Wallet?this.provider.transfer(this.toTransferParams(t)).send():this.provider.transfer(this.toTransferParams(t))}toTransferParams({fee:t,gasLimit:e,storageLimit:r,source:i,amount:s=0,mutez:o=!1}={}){return{to:this.address,amount:s,fee:t,mutez:o,source:i,gasLimit:e,storageLimit:r,parameter:{entrypoint:this.isMultipleEntrypoint?this.name:n.DEFAULT_SMART_CONTRACT_METHOD_NAME,value:this.isAnonymous?this.parameterSchema.Encode(this.name,...this.args):this.parameterSchema.Encode(...this.args)}}}}},4662:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3687:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContractMethodObject=void 0;const i=r(635),n=r(1863);e.ContractMethodObject=class{constructor(t,e,r,i,n="unit",s=!0,o=!1){this.provider=t,this.address=e,this.parameterSchema=r,this.name=i,this.args=n,this.isMultipleEntrypoint=s,this.isAnonymous=o}getSignature(){return this.isAnonymous?this.parameterSchema.ExtractSchema()[this.name]:this.parameterSchema.ExtractSchema()}send(t={}){return this.provider instanceof i.Wallet?this.provider.transfer(this.toTransferParams(t)).send():this.provider.transfer(this.toTransferParams(t))}toTransferParams({fee:t,gasLimit:e,storageLimit:r,source:i,amount:s=0,mutez:o=!1}={}){return{to:this.address,amount:s,fee:t,mutez:o,source:i,gasLimit:e,storageLimit:r,parameter:{entrypoint:this.isMultipleEntrypoint?this.name:n.DEFAULT_SMART_CONTRACT_METHOD_NAME,value:this.isAnonymous?this.parameterSchema.EncodeObject({[this.name]:this.args}):this.parameterSchema.EncodeObject(this.args)}}}}},3849:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.OnChainView=void 0;const n=r(4632),s=r(6700),o=r(4593);e.OnChainView=class{constructor(t,e,r,i,n,s="Unit"){this._rpc=t,this._readProvider=e,this._contractAddress=r,this._smartContractViewSchema=i,this._contractStorageType=n,this._args=s}getSignature(){return{parameter:this._smartContractViewSchema.extractArgsSchema(),result:this._smartContractViewSchema.extractResultSchema()}}executeView(t){return i(this,void 0,void 0,(function*(){const e=(yield this._rpc.getProtocols()).protocol;if(e===o.Protocols.PtJakart2){this.verifyContextExecution(t);const r=(yield this._readProvider.getBalance(this._contractAddress,"head")).toString(),i=yield this._readProvider.getChainId(),n=yield this._readProvider.getStorage(this._contractAddress,"head");return this.executeViewAndDecodeResult(((t,e,r,i,n,s,o,a,c,u="0")=>({script:[{prim:"parameter",args:[{prim:"pair",args:[t,r]}]},{prim:"storage",args:[{prim:"option",args:[e]}]},{prim:"code",args:[[{prim:"CAR"},i,{prim:"SOME"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PAIR"}]]}],storage:{prim:"None"},input:{prim:"Pair",args:[n,s]},amount:u,balance:o,chain_id:a,source:c}))(this._smartContractViewSchema.viewArgsType,this._smartContractViewSchema.viewReturnType,this._contractStorageType,this.adaptViewCodeToContext(this._smartContractViewSchema.instructions,t.viewCaller,r),this.transformArgsToMichelson(),n,r,i,t.source),e)}{this.verifyContextExecution(t);const r=yield this._readProvider.getChainId(),i=this.transformArgsToMichelson(),n={contract:this._contractAddress,view:this._smartContractViewSchema.viewName,input:i,chain_id:r,source:t.viewCaller};return t.source&&(n.payer=t.source),this.executeViewAndDecodeResult(n,e)}}))}verifyContextExecution(t){if(t.source&&n.validateAddress(t.source)!==n.ValidationResult.VALID)throw new s.InvalidViewSimulationContext(`The source account who initialized the view execution is invalid: ${t.source}.`);if(!t.viewCaller||n.validateAddress(t.viewCaller)!==n.ValidationResult.VALID)throw new s.InvalidViewSimulationContext(`The contract which is the caller of view is invalid: ${t.viewCaller}.`)}transformArgsToMichelson(){try{return this._smartContractViewSchema.encodeViewArgs(this._args)}catch(t){throw new s.InvalidViewParameterError(this._smartContractViewSchema.viewName,this.getSignature(),this._args,t)}}adaptViewCodeToContext(t,e,r){const i={BALANCE:[{prim:"PUSH",args:[{prim:"mutez"},{int:r}]}],SENDER:[{prim:"PUSH",args:[{prim:"address"},{string:e}]}],SELF_ADDRESS:[{prim:"PUSH",args:[{prim:"address"},{string:this._contractAddress}]}],AMOUNT:[{prim:"PUSH",args:[{prim:"mutez"},{int:"0"}]}]};return t.forEach(((n,s)=>{n.prim in i&&(t[s]=Object(i)[n.prim]),n.args&&0!==n.args.length?this.adaptViewCodeToContext(n.args,e,r):Array.isArray(n)&&this.adaptViewCodeToContext(n,e,r)})),t}executeViewAndDecodeResult(t,e){return i(this,void 0,void 0,(function*(){if(e===o.Protocols.PtJakart2){let e;try{e=(yield this._rpc.runCode(t)).storage}catch(t){const e=s.validateAndExtractFailwith(t);throw e?new s.ViewSimulationError(`The simulation of the on-chain view named ${this._smartContractViewSchema.viewName} failed with: ${JSON.stringify(e)}`,this._smartContractViewSchema.viewName,e,t):t}if(!e.args)throw new s.ViewSimulationError(`View simulation failed with an invalid result: ${e}`,this._smartContractViewSchema.viewName);return this._smartContractViewSchema.decodeViewResult(e.args[0])}{let e;try{e=(yield this._rpc.runScriptView(t)).data}catch(t){const e=s.validateAndExtractFailwith(t);throw e?new s.ViewSimulationError(`The simulation of the on-chain view named ${this._smartContractViewSchema.viewName} failed with: ${JSON.stringify(e)}`,this._smartContractViewSchema.viewName,e,t):t}return this._smartContractViewSchema.decodeViewResult(e)}}))}}},1863:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.ContractAbstraction=e.ContractView=e.DEFAULT_SMART_CONTRACT_METHOD_NAME=void 0;const n=r(8899),s=r(4632),o=r(2298),a=r(6700);e.DEFAULT_SMART_CONTRACT_METHOD_NAME="default";class c{constructor(t,e,r,i,n,s,o){this.currentContract=t,this.name=e,this.callbackParametersSchema=r,this.parameterSchema=i,this.args=n,this.rpc=s,this.readProvider=o}read(t){return i(this,void 0,void 0,(function*(){if(s.validateContractAddress(null!=t?t:"")==s.ValidationResult.VALID)throw new s.DeprecationError("Since version 12, the lambda view no longer depends on a lambda contract. The read method no longer accepts a contract address as a parameter.");if(t&&s.validateChain(t)!==s.ValidationResult.VALID)throw new s.InvalidChainIdError(t);const e=this.parameterSchema.Encode(...this.args),r=yield this.rpc.runView({contract:this.currentContract.address,entrypoint:this.name,input:e,chain_id:t||(yield this.readProvider.getChainId())});return this.callbackParametersSchema.Execute(r.data)}))}}e.ContractView=c;e.ContractAbstraction=class{constructor(t,e,r,i,s,a,c){this.address=t,this.script=e,this.storageProvider=i,this.entrypoints=s,this.rpc=a,this.readProvider=c,this.methods={},this.methodsObject={},this.views={},this.contractViews={},this.contractMethodFactory=new o.ContractMethodFactory(r,t),this.schema=n.Schema.fromRPCResponse({script:this.script}),this.parameterSchema=n.ParameterSchema.fromRPCResponse({script:this.script}),this.viewSchema=n.ViewSchema.fromRPCResponse({script:this.script}),0!==this.viewSchema.length&&this._initializeOnChainViews(this,a,this.readProvider,this.viewSchema),this._initializeMethods(this,this.entrypoints.entrypoints,this.rpc,this.readProvider)}_initializeMethods(t,r,i,s){const o=this.parameterSchema,u=Object.keys(r);if(o.isMultipleEntryPoint){u.forEach((e=>{const o=new n.ParameterSchema(r[e]);if(this.methods[e]=function(...r){return t.contractMethodFactory.createContractMethodFlatParams(o,e,r)},this.methodsObject[e]=function(r){return t.contractMethodFactory.createContractMethodObjectParam(o,e,r)},(t=>{let e=!1;if("prim"in t&&"pair"===t.prim&&t.args){const r=t.args[t.args.length-1];"prim"in r&&"contract"===r.prim&&(e=!0)}return e})(r[e])){const o=function(...o){const u=r[e].args[0],h=new n.ParameterSchema(u),f=r[e].args[1].args[0],l=new n.ParameterSchema(f);return((t,e,r)=>{const i=e.ExtractSignatures();if(!i.find((e=>e.length===t.length)))throw new a.InvalidParameterError(r,i,t)})(o,h,e),new c(t,e,l,h,o,i,s)};this.views[e]=o}}));Object.keys(o.ExtractSchema()).filter((t=>-1===Object.keys(r).indexOf(t))).forEach((e=>{this.methods[e]=function(...r){return t.contractMethodFactory.createContractMethodFlatParams(o,e,r,!1,!0)},this.methodsObject[e]=function(r){return t.contractMethodFactory.createContractMethodObjectParam(o,e,r,!1,!0)}}))}else{const r=this.parameterSchema;this.methods[e.DEFAULT_SMART_CONTRACT_METHOD_NAME]=function(...i){return t.contractMethodFactory.createContractMethodFlatParams(r,e.DEFAULT_SMART_CONTRACT_METHOD_NAME,i,!1)},this.methodsObject[e.DEFAULT_SMART_CONTRACT_METHOD_NAME]=function(i){return t.contractMethodFactory.createContractMethodObjectParam(r,e.DEFAULT_SMART_CONTRACT_METHOD_NAME,i,!1)}}}_initializeOnChainViews(t,e,r,i){const n=this.schema.val;i.forEach((i=>{this.contractViews[i.viewName]=function(s){return t.contractMethodFactory.createContractViewObjectParam(e,r,i,n,s)}}))}storage(){return this.storageProvider.getStorage(this.address,this.schema)}bigMap(t){return this.storageProvider.getBigMapKey(this.address,t,this.schema)}}},6700:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IntegerError=e.OriginationParameterError=e.RevealOperationError=e.InvalidViewSimulationContext=e.validateAndExtractFailwith=e.ViewSimulationError=e.InvalidViewParameterError=e.InvalidInitParameter=e.InvalidCodeParameter=e.InvalidDelegationSource=e.InvalidParameterError=void 0;class r extends Error{constructor(t,e,r){super(`${t} Received ${r.length} arguments while expecting one of the following signatures (${JSON.stringify(e)})`),this.smartContractMethodName=t,this.sigs=e,this.args=r,this.name="Invalid parameters error"}}e.InvalidParameterError=r;class i extends Error{constructor(t){super(`Since Babylon delegation source can no longer be a contract address ${t}. Please use the smart contract abstraction to set your delegate.`),this.source=t,this.name="Invalid delegation source error"}}e.InvalidDelegationSource=i;class n extends Error{constructor(t,e){super(t),this.message=t,this.data=e,this.name="InvalidCodeParameter"}}e.InvalidCodeParameter=n;class s extends Error{constructor(t,e){super(t),this.message=t,this.data=e,this.name="InvalidInitParameter"}}e.InvalidInitParameter=s;class o extends Error{constructor(t,e,r,i){super(`Unable to encode the parameter of the view: ${t}. Received ${r} as parameter while expecting one of the following signatures (${JSON.stringify(e)})`),this.smartContractViewName=t,this.sigs=e,this.args=r,this.originalError=i,this.name="Invalid view parameters error",this.cause=i}}e.InvalidViewParameterError=o;class a extends Error{constructor(t,e,r,i){super(t),this.message=t,this.viewName=e,this.failWith=r,this.originalError=i,this.name="ViewSimulationError"}}e.ViewSimulationError=a;e.validateAndExtractFailwith=t=>{if(c(t.body)){const e=JSON.parse(t.body);if(Array.isArray(e)&&"with"in e[e.length-1])return e[e.length-1].with}};const c=t=>{try{JSON.parse(t)}catch(t){return!1}return!0};class u extends Error{constructor(t){super(`${t} Please configure the context of the view execution in the executeView method.`),this.info=t,this.name="InvalidViewSimulationContext"}}e.InvalidViewSimulationContext=u;class h extends Error{constructor(t){super(t),this.message=t,this.name="RevealOperationError"}}e.RevealOperationError=h;class f extends Error{constructor(t){super(t),this.message=t,this.name="OriginationParameterError"}}e.OriginationParameterError=f;class l extends Error{constructor(t){super(t),this.message=t,this.name="IntegerError"}}e.IntegerError=l},238:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.compose=void 0,n(r(1863),e),n(r(6700),e),n(r(2619),e),n(r(4007),e),n(r(9480),e),n(r(120),e);var s=r(191);Object.defineProperty(e,"compose",{enumerable:!0,get:function(){return s.compose}}),n(r(4662),e),n(r(7864),e),n(r(3687),e),n(r(5491),e)},2619:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4007:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MANAGER_LAMBDA=void 0;e.MANAGER_LAMBDA={setDelegate:t=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"key_hash"},{string:t}]},{prim:"SOME"},{prim:"SET_DELEGATE"},{prim:"CONS"}],removeDelegate:()=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"NONE",args:[{prim:"key_hash"}]},{prim:"SET_DELEGATE"},{prim:"CONS"}],transferImplicit:(t,e)=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"key_hash"},{string:t}]},{prim:"IMPLICIT_ACCOUNT"},{prim:"PUSH",args:[{prim:"mutez"},{int:`${e}`}]},{prim:"UNIT"},{prim:"TRANSFER_TOKENS"},{prim:"CONS"}],transferToContract:(t,e)=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"address"},{string:t}]},{prim:"CONTRACT",args:[{prim:"unit"}]},[{prim:"IF_NONE",args:[[[{prim:"UNIT"},{prim:"FAILWITH"}]],[]]}],{prim:"PUSH",args:[{prim:"mutez"},{int:`${e}`}]},{prim:"UNIT"},{prim:"TRANSFER_TOKENS"},{prim:"CONS"}]}},9480:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.createProposalsOperation=e.createBallotOperation=e.createIncreasePaidStorageOperation=e.createTransferTicketOperation=e.createTxRollupBatchOperation=e.createTxRollupOriginationOperation=e.createRegisterGlobalConstantOperation=e.createRevealOperation=e.createRegisterDelegateOperation=e.createSetDelegateOperation=e.createTransferOperation=e.createOriginationOperation=void 0;const n=r(8899),s=r(6368),o=r(4593),a=r(4632),c=r(6700);e.createOriginationOperation=({code:t,init:e,balance:r="0",delegate:u,storage:h,fee:f=o.DEFAULT_FEE.ORIGINATION,gasLimit:l=o.DEFAULT_GAS_LIMIT.ORIGINATION,storageLimit:d=o.DEFAULT_STORAGE_LIMIT.ORIGINATION,mutez:p=!1})=>i(void 0,void 0,void 0,(function*(){if(void 0!==h&&void 0!==e)throw new c.OriginationParameterError("Storage and Init cannot be set a the same time. Please either use storage or init but not both.");if(!Array.isArray(t))throw new c.InvalidCodeParameter("Wrong code parameter type, expected an array",t);let i;if(void 0!==h){const e=t.find((t=>"prim"in t&&"storage"===t.prim));if(void 0===(null==e?void 0:e.args))throw new c.InvalidCodeParameter("The storage section is missing from the script",t);i=new n.Schema(e.args[0]).Encode(h)}else{if(void 0===e||"object"!=typeof e)throw new c.InvalidInitParameter("Wrong init parameter type, expected JSON Michelson",e);i=e}const o={code:t,storage:i};if(isNaN(Number(r)))throw new c.IntegerError(`Unexpected Invalid Integer ${r}`);const b={kind:s.OpKind.ORIGINATION,fee:f,gas_limit:l,storage_limit:d,balance:p?r.toString():a.format("tz","mutez",r).toString(),script:o};return u&&(b.delegate=u),b}));e.createTransferOperation=({to:t,amount:e,parameter:r,fee:n=o.DEFAULT_FEE.TRANSFER,gasLimit:c=o.DEFAULT_GAS_LIMIT.TRANSFER,storageLimit:u=o.DEFAULT_STORAGE_LIMIT.TRANSFER,mutez:h=!1})=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.TRANSACTION,fee:n,gas_limit:c,storage_limit:u,amount:h?e.toString():a.format("tz","mutez",e).toString(),destination:t,parameters:r}}));e.createSetDelegateOperation=({delegate:t,source:e,fee:r=o.DEFAULT_FEE.DELEGATION,gasLimit:n=o.DEFAULT_GAS_LIMIT.DELEGATION,storageLimit:a=o.DEFAULT_STORAGE_LIMIT.DELEGATION})=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.DELEGATION,source:e,fee:r,gas_limit:n,storage_limit:a,delegate:t}}));e.createRegisterDelegateOperation=({fee:t=o.DEFAULT_FEE.DELEGATION,gasLimit:e=o.DEFAULT_GAS_LIMIT.DELEGATION,storageLimit:r=o.DEFAULT_STORAGE_LIMIT.DELEGATION},n)=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.DELEGATION,fee:t,gas_limit:e,storage_limit:r,delegate:n}}));e.createRevealOperation=({fee:t=o.DEFAULT_FEE.REVEAL,gasLimit:e=o.DEFAULT_GAS_LIMIT.REVEAL,storageLimit:r=o.DEFAULT_STORAGE_LIMIT.REVEAL},n,a)=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.REVEAL,fee:t,public_key:a,source:n,gas_limit:e,storage_limit:r}}));e.createRegisterGlobalConstantOperation=({value:t,source:e,fee:r,gasLimit:n,storageLimit:o})=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.REGISTER_GLOBAL_CONSTANT,value:t,fee:r,gas_limit:n,storage_limit:o,source:e}}));e.createTxRollupOriginationOperation=({source:t,fee:e,gasLimit:r,storageLimit:n})=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.TX_ROLLUP_ORIGINATION,fee:e,gas_limit:r,storage_limit:n,source:t,tx_rollup_origination:{}}}));e.createTxRollupBatchOperation=({content:t,rollup:e,source:r,fee:n,gasLimit:o,storageLimit:a})=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.TX_ROLLUP_SUBMIT_BATCH,fee:n,gas_limit:o,storage_limit:a,source:r,content:t,rollup:e}}));e.createTransferTicketOperation=({ticketContents:t,ticketTy:e,ticketTicketer:r,ticketAmount:n,destination:o,entrypoint:a,source:c,fee:u,gasLimit:h,storageLimit:f})=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.TRANSFER_TICKET,fee:u,gas_limit:h,storage_limit:f,source:c,ticket_contents:t,ticket_ty:e,ticket_ticketer:r,ticket_amount:n,destination:o,entrypoint:a}}));e.createIncreasePaidStorageOperation=({source:t,fee:e,gasLimit:r,storageLimit:n,amount:o,destination:a})=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.INCREASE_PAID_STORAGE,source:t,fee:e,gas_limit:r,storage_limit:n,amount:o,destination:a}}));e.createBallotOperation=({source:t,proposal:e,ballot:r})=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.BALLOT,source:t,proposal:e,ballot:r}}));e.createProposalsOperation=({source:t,proposals:e})=>i(void 0,void 0,void 0,(function*(){return{kind:s.OpKind.PROPOSALS,source:t,proposals:e}}))},1151:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.RpcContractProvider=void 0;const n=r(5543),s=r(8899),o=r(6368),a=r(4632),c=r(150),u=r(9785),h=r(2026),f=r(6646),l=r(5544),d=r(2342),p=r(1846),b=r(807),g=r(1863),m=r(6700),v=r(9480),y=r(22),w=r(4632),_=r(9989),E=r(280),S=r(8983),A=r(106),O=r(3323),T=r(7279);class x extends h.OperationEmitter{constructor(t,e){super(t),this.estimator=e,this.contractProviderTypeSymbol=Symbol.for("taquito--provider-type-symbol")}getStorage(t,e){return i(this,void 0,void 0,(function*(){if(w.validateContractAddress(t)!==w.ValidationResult.VALID)throw new w.InvalidContractAddressError(t);const r=yield this.context.readProvider.getScript(t,"head");let i;return e||(e=r),i=s.Schema.isSchema(e)?e:s.Schema.fromRPCResponse({script:e}),i.Execute(r.storage,y.smartContractAbstractionSemantic(this))}))}getBigMapKey(t,e,r){return i(this,void 0,void 0,(function*(){if(w.validateContractAddress(t)!==w.ValidationResult.VALID)throw new w.InvalidContractAddressError(t);let i;r||(r=(yield this.rpc.getContract(t)).script),i=s.Schema.isSchema(r)?r:s.Schema.fromRPCResponse({script:r});const n=i.EncodeBigMapKey(e),o=yield this.rpc.getBigMapKey(t,n);return i.ExecuteOnBigMapValue(o)}))}getBigMapKeyByID(t,e,r,n){return i(this,void 0,void 0,(function*(){const{key:i,type:s}=r.EncodeBigMapKey(e),{packed:o}=yield this.context.packer.packData({data:i,type:s}),c=a.encodeExpr(o),u=n?yield this.context.readProvider.getBigMapValue({id:t.toString(),expr:c},n):yield this.context.readProvider.getBigMapValue({id:t.toString(),expr:c},"head");return r.ExecuteOnBigMapValue(u,y.smartContractAbstractionSemantic(this))}))}getBigMapKeysByID(t,e,r,n,o=5){return i(this,void 0,void 0,(function*(){const i=yield this.getBlockForRequest(e,n),a=new s.MichelsonMap;let c=0,u=[];for(;c<e.length;){const n=e.slice(c,c+o).map((e=>this.getBigMapValueOrUndefined(e,t,r,i)));u=[...u,...yield Promise.all(n)],c+=o}for(let t=0;t<u.length;t++)a.set(e[t],u[t]);return a}))}getBlockForRequest(t,e){return i(this,void 0,void 0,(function*(){return 1===t.length||void 0!==e?e:yield this.context.readProvider.getBlockLevel("head")}))}getBigMapValueOrUndefined(t,e,r,s){return i(this,void 0,void 0,(function*(){try{return yield this.getBigMapKeyByID(e,t,r,s)}catch(t){if(t instanceof n.HttpResponseError&&t.status===n.STATUS_CODE.NOT_FOUND)return;throw t}}))}getSaplingDiffByID(t,e){return i(this,void 0,void 0,(function*(){return e?yield this.context.readProvider.getSaplingDiffById({id:t.toString()},e):yield this.context.readProvider.getSaplingDiffById({id:t.toString()},"head")}))}addRevealOperationIfNeeded(t,e){return i(this,void 0,void 0,(function*(){if(b.isOpRequireReveal(t)){const r=[t],n=yield this.signer.publicKey(),s=yield this.estimator.reveal();if(s){const t={kind:o.OpKind.REVEAL},a=yield this.estimate(t,(()=>i(this,void 0,void 0,(function*(){return s}))));return r.unshift(yield v.createRevealOperation(Object.assign({},a),e,n)),r}}return t}))}originate(t){return i(this,void 0,void 0,(function*(){const e=yield this.estimate(t,this.estimator.originate.bind(this.estimator)),r=yield this.signer.publicKeyHash(),i=yield v.createOriginationOperation(yield this.context.parser.prepareCodeOrigination(Object.assign(Object.assign({},t),e))),n=yield this.addRevealOperationIfNeeded(i,r),s=yield this.prepareOperation({operation:n,source:r}),o=yield this.forge(s),{hash:a,context:c,forgedBytes:u,opResponse:h}=yield this.signAndInject(o);return new f.OriginationOperation(a,i,u,h,c,this)}))}setDelegate(t){return i(this,void 0,void 0,(function*(){if(t.source&&w.validateAddress(t.source)!==w.ValidationResult.VALID)throw new w.InvalidAddressError(t.source);if(t.delegate&&w.validateAddress(t.delegate)!==w.ValidationResult.VALID)throw new w.InvalidAddressError(t.delegate);if(/kt1/i.test(t.source))throw new m.InvalidDelegationSource(t.source);const e=yield this.estimate(t,this.estimator.setDelegate.bind(this.estimator)),r=yield this.signer.publicKeyHash(),i=yield v.createSetDelegateOperation(Object.assign(Object.assign({},t),e)),n=t.source||r,s=yield this.addRevealOperationIfNeeded(i,r),o=yield this.prepareOperation({operation:s,source:n}),a=yield this.forge(o),{hash:c,context:h,forgedBytes:f,opResponse:l}=yield this.signAndInject(a);return new u.DelegateOperation(c,i,n,f,l,h)}))}registerDelegate(t){return i(this,void 0,void 0,(function*(){const e=yield this.estimate(t,this.estimator.registerDelegate.bind(this.estimator)),r=yield this.signer.publicKeyHash(),i=yield v.createRegisterDelegateOperation(Object.assign(Object.assign({},t),e),r),n=yield this.addRevealOperationIfNeeded(i,r),s=yield this.prepareOperation({operation:n}),o=yield this.forge(s),{hash:a,context:c,forgedBytes:h,opResponse:f}=yield this.signAndInject(o);return new u.DelegateOperation(a,i,r,h,f,c)}))}transfer(t){return i(this,void 0,void 0,(function*(){if(w.validateAddress(t.to)!==w.ValidationResult.VALID)throw new w.InvalidAddressError(t.to);if(t.source&&w.validateAddress(t.source)!==w.ValidationResult.VALID)throw new w.InvalidAddressError(t.source);const e=yield this.signer.publicKeyHash(),r=yield this.estimate(t,this.estimator.transfer.bind(this.estimator)),i=yield v.createTransferOperation(Object.assign(Object.assign({},t),r)),n=t.source||e,s=yield this.addRevealOperationIfNeeded(i,e),o=yield this.prepareOperation({operation:s,source:t.source}),a=yield this.forge(o),{hash:c,context:u,forgedBytes:h,opResponse:f}=yield this.signAndInject(a);return new p.TransactionOperation(c,i,n,h,f,u)}))}transferTicket(t){var e;return i(this,void 0,void 0,(function*(){if(w.validateContractAddress(t.destination)!==w.ValidationResult.VALID)throw new w.InvalidContractAddressError(t.destination);if(t.source&&w.validateAddress(t.source)!==w.ValidationResult.VALID)throw new w.InvalidAddressError(t.source);const r=yield this.signer.publicKeyHash(),i=yield this.estimate(t,this.estimator.transferTicket.bind(this.estimator)),n=yield v.createTransferTicketOperation(Object.assign(Object.assign({},t),i)),s=null!==(e=t.source)&&void 0!==e?e:r,o=yield this.addRevealOperationIfNeeded(n,r),a=yield this.prepareOperation({operation:o,source:t.source}),c=yield this.forge(a),{hash:u,context:h,forgedBytes:f,opResponse:l}=yield this.signAndInject(c);return new S.TransferTicketOperation(u,n,s,f,l,h)}))}reveal(t){return i(this,void 0,void 0,(function*(){const e=yield this.signer.publicKeyHash(),r=yield this.estimator.reveal(t);if(r){const n=yield this.estimate(t,(()=>i(this,void 0,void 0,(function*(){return r})))),s=yield v.createRevealOperation(Object.assign({},n),e,yield this.signer.publicKey()),o=yield this.prepareOperation({operation:s,source:e}),a=yield this.forge(o),{hash:c,context:u,forgedBytes:h,opResponse:f}=yield this.signAndInject(a);return new d.RevealOperation(c,s,e,h,f,u)}throw new m.RevealOperationError(`The publicKeyHash '${e}' has already been revealed.`)}))}registerGlobalConstant(t){return i(this,void 0,void 0,(function*(){const e=yield this.signer.publicKeyHash(),r=yield this.estimate(t,this.estimator.registerGlobalConstant.bind(this.estimator)),i=yield v.createRegisterGlobalConstantOperation(Object.assign(Object.assign({},t),r)),n=yield this.addRevealOperationIfNeeded(i,e),s=yield this.prepareOperation({operation:n,source:e}),o=yield this.forge(s),{hash:a,context:c,forgedBytes:u,opResponse:h}=yield this.signAndInject(o);return new l.RegisterGlobalConstantOperation(a,i,e,u,h,c)}))}increasePaidStorage(t){return i(this,void 0,void 0,(function*(){const e=yield this.signer.publicKeyHash(),r=yield this.estimate(t,this.estimator.increasePaidStorage.bind(this.estimator)),i=yield v.createIncreasePaidStorageOperation(Object.assign(Object.assign({},t),r)),n=yield this.addRevealOperationIfNeeded(i,e),s=yield this.prepareOperation({operation:n,source:e}),o=yield this.forge(s),{hash:a,context:c,forgedBytes:u,opResponse:h}=yield this.signAndInject(o);return new A.IncreasePaidStorageOperation(a,i,e,u,h,c)}))}txRollupOriginate(t){return i(this,void 0,void 0,(function*(){const e=yield this.signer.publicKeyHash(),r=yield this.estimate(t||{},this.estimator.txRollupOriginate.bind(this.estimator)),i=yield v.createTxRollupOriginationOperation(Object.assign(Object.assign({},t),r)),n=yield this.addRevealOperationIfNeeded(i,e),s=yield this.prepareOperation({operation:n,source:e}),o=yield this.forge(s),{hash:a,context:c,forgedBytes:u,opResponse:h}=yield this.signAndInject(o);return new _.TxRollupOriginationOperation(a,i,e,u,h,c)}))}txRollupSubmitBatch(t){return i(this,void 0,void 0,(function*(){const e=yield this.signer.publicKeyHash(),r=yield this.estimate(t,this.estimator.txRollupSubmitBatch.bind(this.estimator)),i=yield v.createTxRollupBatchOperation(Object.assign(Object.assign({},t),r)),n=yield this.addRevealOperationIfNeeded(i,e),s=yield this.prepareOperation({operation:n,source:e}),o=yield this.forge(s),{hash:a,context:c,forgedBytes:u,opResponse:h}=yield this.signAndInject(o);return new E.TxRollupBatchOperation(a,i,e,u,h,c)}))}ballot(t){var e;return i(this,void 0,void 0,(function*(){const r=yield this.signer.publicKeyHash();if(t.source&&w.validateAddress(t.source)!==w.ValidationResult.VALID)throw new w.InvalidAddressError(t.source);const i=null!==(e=t.source)&&void 0!==e?e:r,n=yield v.createBallotOperation(Object.assign(Object.assign({},t),{source:i})),s=yield this.prepareOperation({operation:n,source:i}),o=yield this.forge(s),{hash:a,context:c,forgedBytes:u,opResponse:h}=yield this.signAndInject(o);return new O.BallotOperation(a,n,r,u,h,c)}))}proposals(t){var e;return i(this,void 0,void 0,(function*(){const r=yield this.signer.publicKeyHash();if(t.source&&w.validateAddress(t.source)!==w.ValidationResult.VALID)throw new w.InvalidAddressError(t.source);const i=null!==(e=t.source)&&void 0!==e?e:r,n=yield v.createProposalsOperation(Object.assign(Object.assign({},t),{source:i})),s=yield this.prepareOperation({operation:n,source:i}),o=yield this.forge(s),{hash:a,context:c,forgedBytes:u,opResponse:h}=yield this.signAndInject(o);return new T.ProposalsOperation(a,n,r,u,h,c)}))}at(t,e=(t=>t)){return i(this,void 0,void 0,(function*(){if(w.validateContractAddress(t)!==w.ValidationResult.VALID)throw new w.InvalidContractAddressError(t);const r=this.context.withExtensions().rpc,i=this.context.withExtensions().readProvider,n=yield i.getScript(t,"head"),s=yield i.getEntrypoints(t),o=new g.ContractAbstraction(t,n,this,this,s,r,i);return e(o,this.context)}))}batch(t){const e=new c.OperationBatch(this.context,this.estimator);return Array.isArray(t)&&e.with(t),e}}e.RpcContractProvider=x},5491:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.SaplingStateAbstraction=void 0;e.SaplingStateAbstraction=class{constructor(t,e){this.id=t,this.provider=e}getSaplingDiff(t){return r(this,void 0,void 0,(function*(){return this.provider.getSaplingDiffByID(this.id.toString(),t)}))}getId(){return this.id.toString()}}},22:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.smartContractAbstractionSemantic=void 0;const i=r(8899),n=r(5225),s=r(6391),o=r(5491);e.smartContractAbstractionSemantic=t=>({big_map:(e,r)=>{if(e&&"int"in e&&void 0!==e.int){const o=new i.Schema(r);return new n.BigMapAbstraction(new s.default(e.int),o,t)}return{}},sapling_state:e=>e&&"int"in e&&void 0!==e.int?new o.SaplingStateAbstraction(new s.default(e.int),t):{}})},120:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VIEW_LAMBDA=void 0;e.VIEW_LAMBDA={code:[{prim:"parameter",args:[{prim:"lambda",args:[{prim:"unit"},{prim:"pair",args:[{prim:"list",args:[{prim:"operation"}]},{prim:"unit"}]}]}]},{prim:"storage",args:[{prim:"unit"}]},{prim:"code",args:[[{prim:"CAR"},{prim:"UNIT"},{prim:"EXEC"}]]}],storage:"Unit"}},3010:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RPCResponseError=e.InvalidFilterExpressionError=e.ConfirmationUndefinedError=e.InvalidConfirmationCountError=void 0;class r extends Error{constructor(t){super(t),this.message=t,this.name="InvalidConfirmationCountError"}}e.InvalidConfirmationCountError=r;class i extends Error{constructor(t){super(t),this.message=t,this.name="ConfirmationUndefinedError"}}e.ConfirmationUndefinedError=i;class n extends Error{constructor(t){super(t),this.message=t,this.name="InvalidFilterExpressionError"}}e.InvalidFilterExpressionError=n;class s extends Error{constructor(t){super(t),this.message=t,this.name="RPCResponseError"}}e.RPCResponseError=s},2382:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RevealEstimateError=void 0;class r extends Error{constructor(){super("Unable to estimate the reveal operation, the public key is unknown"),this.name="Reveal Estimate Error"}}e.RevealEstimateError=r},1243:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4705:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Estimate=void 0;const r=100;class i{constructor(t,e,r,i,n=100){this._milligasLimit=t,this._storageLimit=e,this.opSize=r,this.minimalFeePerStorageByteMutez=i,this.baseFeeMutez=n}get burnFeeMutez(){return this.roundUp(Number(this.storageLimit)*Number(this.minimalFeePerStorageByteMutez))}get storageLimit(){const t=Math.max(Number(this._storageLimit),0);return t>0?t:0}get gasLimit(){return this.roundUp(Number(this._milligasLimit)/1e3+100)}get operationFeeMutez(){return.1*(Number(this._milligasLimit)/1e3+100)+1*Number(this.opSize)}roundUp(t){return Math.ceil(Number(t))}get minimalFeeMutez(){return this.roundUp(r+this.operationFeeMutez)}get suggestedFeeMutez(){return this.roundUp(this.operationFeeMutez+200)}get usingBaseFeeMutez(){return Math.max(Number(this.baseFeeMutez),r)+this.roundUp(this.operationFeeMutez)}get totalCost(){return this.minimalFeeMutez+this.burnFeeMutez}get consumedMilligas(){return Number(this._milligasLimit)}static createEstimateInstanceFromProperties(t){let e,r=0,n=0,s=0,o=0;return t.forEach((t=>{r+=t.milligasLimit,n+=t.storageLimit,s+=t.opSize,o=Math.max(t.minimalFeePerStorageByteMutez,o),t.baseFeeMutez&&(e=e?e+t.baseFeeMutez:t.baseFeeMutez)})),new i(r,n,s,o,e)}static createArrayEstimateInstancesFromProperties(t){return t.map((t=>new i(t.milligasLimit,t.storageLimit,t.opSize,t.minimalFeePerStorageByteMutez,t.baseFeeMutez)))}}e.Estimate=i},8794:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4705),e),n(r(1243),e),n(r(4782),e),n(r(2382),e)},4782:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))},n=this&&this.__rest||function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r};Object.defineProperty(e,"__esModule",{value:!0}),e.RPCEstimateProvider=void 0;const s=r(6368),o=r(6391),a=r(4593),c=r(2026),u=r(8974),h=r(807),f=r(4705),l=r(9480),d=r(4632),p=r(2382),b=(t,e)=>({fee:void 0===t.fee?e.fee:t.fee,gasLimit:void 0===t.gasLimit?e.gasLimit:t.gasLimit,storageLimit:void 0===t.storageLimit?e.storageLimit:t.storageLimit});class g extends c.OperationEmitter{constructor(){super(...arguments),this.ALLOCATION_STORAGE=257,this.ORIGINATION_STORAGE=257,this.OP_SIZE_REVEAL=128}getKeys(){return i(this,void 0,void 0,(function*(){const t=this.context.isAnySignerConfigured();return{publicKeyHash:t?yield this.signer.publicKeyHash():yield this.context.walletProvider.getPKH(),publicKey:t?yield this.signer.publicKey():void 0}}))}getAccountLimits(t,e,r){return i(this,void 0,void 0,(function*(){const i=yield this.context.readProvider.getBalance(t,"head"),{hard_gas_limit_per_operation:n,hard_gas_limit_per_block:s,hard_storage_limit_per_operation:a,cost_per_byte:c}=e;return{fee:0,gasLimit:r?Math.floor(this.ajustGasForBatchOperation(s,n,r).toNumber()):n.toNumber(),storageLimit:Math.floor(o.default.min(i.dividedBy(c),a).toNumber())}}))}ajustGasForBatchOperation(t,e,r){return o.default.min(e,t.div(r+1))}getEstimationPropertiesFromOperationContent(t,e,r,i){const n=u.flattenOperationResult({contents:[t]});let s=0,o=0;return n.forEach((t=>{o+="originated_contracts"in t&&void 0!==t.originated_contracts?t.originated_contracts.length*this.ORIGINATION_STORAGE:0,o+="allocated_destination_contract"in t?this.ALLOCATION_STORAGE:0,s+=Number(t.consumed_milligas)||0,o+="paid_storage_size_diff"in t&&Number(t.paid_storage_size_diff)||0,o+="storage_size"in t&&"global_address"in t&&Number(t.storage_size)||0,o+="originated_rollup"in t?i:0})),h.isOpWithFee(t)?{milligasLimit:s||0,storageLimit:Number(o||0),opSize:e,minimalFeePerStorageByteMutez:r.toNumber()}:{milligasLimit:0,storageLimit:0,opSize:e,minimalFeePerStorageByteMutez:r.toNumber(),baseFeeMutez:0}}prepareEstimate(t,e,r){return i(this,void 0,void 0,(function*(){const i=yield this.prepareOperation(t,r),{opbytes:n,opOb:{branch:s,contents:o}}=yield this.forge(i),a={operation:{branch:s,contents:o,signature:"edsigtkpiSSschcaCt9pUVrpNPf7TTcgvgDEDD6NCEHMy8NNQJCGnMfLZzYoQj74yLjo9wx6MPVV29CvVzgi7qEcEUok3k7AuMg"},chain_id:yield this.context.readProvider.getChainId()},{opResponse:c}=yield this.simulate(a),{cost_per_byte:h,tx_rollup_origination_size:f}=e,l=[...u.flattenErrors(c,"backtracked"),...u.flattenErrors(c)];if(l.length)throw new u.TezosOperationError(l,"Error occurred during estimation");let d=1;return Array.isArray(t.operation)&&t.operation.length>1&&(d="reveal"===c.contents[0].kind?t.operation.length-1:t.operation.length),c.contents.map((t=>this.getEstimationPropertiesFromOperationContent(t,"reveal"===t.kind?this.OP_SIZE_REVEAL/2:n.length/2/d,h,null!=f?f:0)))}))}originate(t){var{fee:e,storageLimit:r,gasLimit:s}=t,o=n(t,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const{publicKeyHash:t}=yield this.getKeys(),i=yield this.context.readProvider.getProtocolConstants("head"),n=yield this.getAccountLimits(t,i),a=yield l.createOriginationOperation(yield this.context.parser.prepareCodeOrigination(Object.assign(Object.assign({},o),b({fee:e,storageLimit:r,gasLimit:s},n)))),c=yield this.isRevealOpNeeded([a],t),u=c?yield this.addRevealOp([a],t):a,h=yield this.prepareEstimate({operation:u,source:t},i,t);return c&&h.shift(),f.Estimate.createEstimateInstanceFromProperties(h)}))}transfer(t){var{fee:e,storageLimit:r,gasLimit:s}=t,o=n(t,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){if(d.validateAddress(o.to)!==d.ValidationResult.VALID)throw new d.InvalidAddressError(o.to);if(o.source&&d.validateAddress(o.source)!==d.ValidationResult.VALID)throw new d.InvalidAddressError(o.source);const t=(yield this.getKeys()).publicKeyHash,i=yield this.context.readProvider.getProtocolConstants("head"),n=yield this.getAccountLimits(t,i),a=yield l.createTransferOperation(Object.assign(Object.assign({},o),b({fee:e,storageLimit:r,gasLimit:s},n))),c=yield this.isRevealOpNeeded([a],t),u=c?yield this.addRevealOp([a],t):a,h=yield this.prepareEstimate({operation:u,source:t},i,t);return c&&h.shift(),f.Estimate.createEstimateInstanceFromProperties(h)}))}transferTicket(t){var e,{fee:r,storageLimit:s,gasLimit:o}=t,a=n(t,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){if(d.validateContractAddress(a.destination)!==d.ValidationResult.VALID)throw new d.InvalidContractAddressError(a.destination);if(a.source&&d.validateAddress(a.source)!==d.ValidationResult.VALID)throw new d.InvalidAddressError(null!==(e=a.source)&&void 0!==e?e:"");const t=(yield this.getKeys()).publicKeyHash,i=yield this.context.readProvider.getProtocolConstants("head"),n=yield this.getAccountLimits(t,i),c=yield l.createTransferTicketOperation(Object.assign(Object.assign({},a),b({fee:r,storageLimit:s,gasLimit:o},n))),u=yield this.isRevealOpNeeded([c],t),h=u?yield this.addRevealOp([c],t):c,p=yield this.prepareEstimate({operation:h,source:t},i,t);return u&&p.shift(),f.Estimate.createEstimateInstanceFromProperties(p)}))}setDelegate(t){var{fee:e,gasLimit:r,storageLimit:s}=t,o=n(t,["fee","gasLimit","storageLimit"]);return i(this,void 0,void 0,(function*(){if(o.source&&d.validateAddress(o.source)!==d.ValidationResult.VALID)throw new d.InvalidAddressError(o.source);if(o.delegate&&d.validateAddress(o.delegate)!==d.ValidationResult.VALID)throw new d.InvalidAddressError(o.delegate);const t=(yield this.getKeys()).publicKeyHash,i=o.source||t,n=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getAccountLimits(i,n),c=yield l.createSetDelegateOperation(Object.assign(Object.assign({},o),b({fee:e,storageLimit:s,gasLimit:r},a))),u=yield this.isRevealOpNeeded([c],t),h=u?yield this.addRevealOp([c],t):c,p=yield this.prepareEstimate({operation:h,source:t},n,t);return u&&p.shift(),f.Estimate.createEstimateInstanceFromProperties(p)}))}batch(t){return i(this,void 0,void 0,(function*(){const{publicKeyHash:e}=yield this.getKeys();let r=[];const i=yield this.context.readProvider.getProtocolConstants("head"),n=yield this.getAccountLimits(e,i,t.length);for(const e of t)switch(e.kind){case s.OpKind.TRANSACTION:r.push(yield l.createTransferOperation(Object.assign(Object.assign({},e),b(e,n))));break;case s.OpKind.ORIGINATION:r.push(yield l.createOriginationOperation(yield this.context.parser.prepareCodeOrigination(Object.assign(Object.assign({},e),b(e,n)))));break;case s.OpKind.DELEGATION:r.push(yield l.createSetDelegateOperation(Object.assign(Object.assign({},e),b(e,n))));break;case s.OpKind.ACTIVATION:r.push(Object.assign(Object.assign({},e),n));break;case s.OpKind.REGISTER_GLOBAL_CONSTANT:r.push(yield l.createRegisterGlobalConstantOperation(Object.assign(Object.assign({},e),b(e,n))));break;case s.OpKind.TX_ROLLUP_ORIGINATION:r.push(yield l.createTxRollupOriginationOperation(Object.assign(Object.assign({},e),b(e,n))));break;case s.OpKind.TX_ROLLUP_SUBMIT_BATCH:r.push(yield l.createTxRollupBatchOperation(Object.assign(Object.assign({},e),b(e,n))));break;case s.OpKind.TRANSFER_TICKET:r.push(yield l.createTransferTicketOperation(Object.assign(Object.assign({},e),b(e,n))));break;case s.OpKind.INCREASE_PAID_STORAGE:r.push(yield l.createIncreasePaidStorageOperation(Object.assign(Object.assign({},e),b(e,n))));break;default:throw new d.InvalidOperationKindError(t.kind)}r=(yield this.isRevealOpNeeded(r,e))?yield this.addRevealOp(r,e):r;const o=yield this.prepareEstimate({operation:r,source:e},i,e);return f.Estimate.createArrayEstimateInstancesFromProperties(o)}))}registerDelegate(t){return i(this,void 0,void 0,(function*(){const e=(yield this.getKeys()).publicKeyHash,r=yield this.context.readProvider.getProtocolConstants("head"),i=yield this.getAccountLimits(e,r),n=yield l.createRegisterDelegateOperation(Object.assign(Object.assign({},t),i),e),s=yield this.isRevealOpNeeded([n],e),o=s?yield this.addRevealOp([n],e):n,a=yield this.prepareEstimate({operation:o,source:e},r,e);return s&&a.shift(),f.Estimate.createEstimateInstanceFromProperties(a)}))}reveal(t){return i(this,void 0,void 0,(function*(){const{publicKeyHash:e,publicKey:r}=yield this.getKeys();if(!r)throw new p.RevealEstimateError;if(yield this.isAccountRevealRequired(e)){const i=yield this.context.readProvider.getProtocolConstants("head"),n=yield this.getAccountLimits(e,i),s=yield l.createRevealOperation(Object.assign(Object.assign({},t),n),e,r),o=yield this.prepareEstimate({operation:s,source:e},i,e);return f.Estimate.createEstimateInstanceFromProperties(o)}}))}registerGlobalConstant(t){var{fee:e,storageLimit:r,gasLimit:s}=t,o=n(t,["fee","storageLimit","gasLimit"]);return i(this,void 0,void 0,(function*(){const t=(yield this.getKeys()).publicKeyHash,i=yield this.context.readProvider.getProtocolConstants("head"),n=yield this.getAccountLimits(t,i),a=yield l.createRegisterGlobalConstantOperation(Object.assign(Object.assign({},o),b({fee:e,storageLimit:r,gasLimit:s},n))),c=yield this.isRevealOpNeeded([a],t),u=c?yield this.addRevealOp([a],t):a,h=yield this.prepareEstimate({operation:u,source:t},i,t);return c&&h.shift(),f.Estimate.createEstimateInstanceFromProperties(h)}))}increasePaidStorage(t){return i(this,void 0,void 0,(function*(){const{fee:e,storageLimit:r,gasLimit:i}=t,s=n(t,["fee","storageLimit","gasLimit"]),o=(yield this.getKeys()).publicKeyHash,a=yield this.context.readProvider.getProtocolConstants("head"),c=yield this.getAccountLimits(o,a),u=yield l.createIncreasePaidStorageOperation(Object.assign(Object.assign({},s),b({fee:e,storageLimit:r,gasLimit:i},c))),h=yield this.isRevealOpNeeded([u],o),d=h?yield this.addRevealOp([u],o):u,p=yield this.prepareEstimate({operation:d,source:o},a,o);return h&&p.shift(),f.Estimate.createEstimateInstanceFromProperties(p)}))}txRollupOriginate(t){return i(this,void 0,void 0,(function*(){t=t||{};const{fee:e,storageLimit:r,gasLimit:i}=t,s=n(t,["fee","storageLimit","gasLimit"]),o=(yield this.getKeys()).publicKeyHash,a=yield this.context.readProvider.getProtocolConstants("head"),c=yield this.getAccountLimits(o,a),u=yield l.createTxRollupOriginationOperation(Object.assign(Object.assign({},s),b({fee:e,storageLimit:r,gasLimit:i},c))),h=yield this.isRevealOpNeeded([u],o),d=h?yield this.addRevealOp([u],o):u,p=yield this.prepareEstimate({operation:d,source:o},a,o);return h&&p.shift(),f.Estimate.createEstimateInstanceFromProperties(p)}))}txRollupSubmitBatch(t){return i(this,void 0,void 0,(function*(){const{fee:e,storageLimit:r,gasLimit:i}=t,s=n(t,["fee","storageLimit","gasLimit"]),o=(yield this.getKeys()).publicKeyHash,a=yield this.context.readProvider.getProtocolConstants("head"),c=yield this.getAccountLimits(o,a),u=yield l.createTxRollupBatchOperation(Object.assign(Object.assign({},s),b({fee:e,storageLimit:r,gasLimit:i},c))),h=yield this.isRevealOpNeeded([u],o),d=h?yield this.addRevealOp([u],o):u,p=yield this.prepareEstimate({operation:d,source:o},a,o);return h&&p.shift(),f.Estimate.createEstimateInstanceFromProperties(p)}))}addRevealOp(t,e){return i(this,void 0,void 0,(function*(){const{publicKey:r}=yield this.getKeys();if(!r)throw new p.RevealEstimateError;return t.unshift(yield l.createRevealOperation(Object.assign({fee:a.DEFAULT_FEE.REVEAL,gasLimit:a.DEFAULT_GAS_LIMIT.REVEAL,storageLimit:a.DEFAULT_STORAGE_LIMIT.REVEAL}),e,yield this.signer.publicKey())),t}))}}e.RPCEstimateProvider=g},7336:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.CompositeForger=e.UnspecifiedForgerError=e.ForgingMismatchError=void 0;class i extends Error{constructor(t){super("Forging mismatch error"),this.results=t,this.name="ForgingMismatchError"}}e.ForgingMismatchError=i;class n extends Error{constructor(){super("At least one forger must be specified"),this.name="UnspecifiedForgerError"}}e.UnspecifiedForgerError=n;e.CompositeForger=class{constructor(t){if(this.forgers=t,0===t.length)throw new n}forge({branch:t,contents:e}){return r(this,void 0,void 0,(function*(){const r=yield Promise.all(this.forgers.map((r=>r.forge({branch:t,contents:e}))));if(0===r.length)throw new n;let s=r.pop();for(;r.length;){const t=r.pop();if(t!==s)throw new i([s,t]);s=t}return s}))}}},794:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RpcForger=void 0;e.RpcForger=class{constructor(t){this.context=t}forge({branch:t,contents:e}){return this.context.rpc.forgeOperations({branch:t,contents:e})}}},6713:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.TaquitoLocalForger=void 0;const n=r(5078);e.TaquitoLocalForger=class{constructor(t){this.context=t}getNextProto(){return i(this,void 0,void 0,(function*(){if(!this.context.proto){const t=yield this.context.readProvider.getNextProtocol("head");this.context.proto=t}return this.context.proto}))}forge({branch:t,contents:e}){return i(this,void 0,void 0,(function*(){return new n.LocalForger(yield this.getNextProto()).forge({branch:t,contents:e})}))}}},5505:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultGlobalConstantsProvider=void 0;const n=r(1452);e.DefaultGlobalConstantsProvider=class{constructor(){this._globalConstantsLibrary={}}loadGlobalConstant(t){for(const e in t)Object.assign(this._globalConstantsLibrary,{[e]:t[e]})}getGlobalConstantByHash(t){return i(this,void 0,void 0,(function*(){const e=this._globalConstantsLibrary[t];if(!e)throw new n.GlobalConstantNotFound(t);return e}))}}},1452:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UnconfiguredGlobalConstantsProviderError=e.GlobalConstantNotFound=void 0;class r extends Error{constructor(t){super(`Please load the value associated with the constant ${t} using the loadGlobalConstant method of the DefaultGlobalConstantsProvider.`),this.hash=t,this.name="GlobalConstantNotFound"}}e.GlobalConstantNotFound=r;class i extends Error{constructor(){super("No global constants provider has been configured. Please configure one by calling setGlobalConstantsProvider({globalConstantsProvider}) on your TezosToolkit instance."),this.name="UnconfiguredGlobalConstantsProviderError"}}e.UnconfiguredGlobalConstantsProviderError=i},3171:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},9494:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.NoopGlobalConstantsProvider=void 0;const n=r(1452);e.NoopGlobalConstantsProvider=class{getGlobalConstantByHash(t){return i(this,void 0,void 0,(function*(){throw new n.UnconfiguredGlobalConstantsProviderError}))}}},5180:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.formatErrorMessage=void 0;const i=r(5543);e.formatErrorMessage=function(t,e){const r=JSON.parse(t.body);if(r[0]&&r[0].kind&&r[0].msg){const n=JSON.stringify({kind:r[0].kind,id:r[0].id,msg:r[0].msg.replace(e,"")});return new i.HttpResponseError(`Http error response: (${t.status}) ${n}`,t.status,t.statusText,n,t.url)}return t}},5744:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.RpcInjector=void 0;const n=r(5180),s=r(5543);e.RpcInjector=class{constructor(t){this.context=t}inject(t){return i(this,void 0,void 0,(function*(){let e;try{e=yield this.context.rpc.injectOperation(t)}catch(t){const e=". You may want to use --replace to provide adequate fee and replace it";throw t instanceof s.HttpResponseError&&t.message.includes(e)?n.formatErrorMessage(t,e):t}return e}))}}},3729:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BallotOperation=void 0;const i=r(8361);class n extends i.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"ballot"===t.kind));return t||void 0}get period(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.period}get proposal(){return this.params.proposal}get ballot(){return this.params.ballot}}e.BallotOperation=n},3650:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BatchOperation=void 0;const i=r(6391),n=r(150),s=r(8974),o=r(8361),a=r(807);class c extends o.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r}sumProp(t,e){return t.reduce(((t,r)=>e in r?Number(r[e])+t:t),0)}getOriginatedContractAddresses(){const t=this.results.filter((t=>"origination"===t.kind));let e=[];for(const r of t)r.metadata.operation_result.originated_contracts&&(e=[...e,...r.metadata.operation_result.originated_contracts]);return e}get status(){return this.results.filter((t=>-1!==n.BATCH_KINDS.indexOf(t.kind))).map((t=>a.hasMetadataWithResult(t)?t.metadata.operation_result.status:"unknown"))[0]||"unknown"}get fee(){return this.sumProp(this.params,"fee")}get gasLimit(){return this.sumProp(this.params,"gas_limit")}get storageLimit(){return this.sumProp(this.params,"storage_limit")}get consumedGas(){return i.default.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.default.ROUND_UP}),new i.default(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp(s.flattenOperationResult({contents:this.results}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp(s.flattenOperationResult({contents:this.results}),"paid_storage_size_diff"))}get errors(){return s.flattenErrors({contents:this.results})}}e.BatchOperation=c},9785:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DelegateOperation=void 0;const i=r(6391),n=r(8361);class s extends n.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"delegation"===t.kind)),e=t&&t.metadata&&t.metadata.operation_result;return e||void 0}get status(){var t,e;return null!==(e=null===(t=this.operationResults)||void 0===t?void 0:t.status)&&void 0!==e?e:"unknown"}get delegate(){return this.params.delegate}get isRegisterOperation(){return this.delegate===this.source}get fee(){return this.params.fee}get gasLimit(){return this.params.gas_limit}get storageLimit(){return this.params.storage_limit}get consumedGas(){return i.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.BigNumber.ROUND_UP}),this.consumedMilliGas?new i.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.consumed_milligas}get errors(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.errors}}e.DelegateOperation=s},106:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IncreasePaidStorageOperation=void 0;const i=r(8361);class n extends i.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"increase_paid_storage"===t.kind)),e=t&&t.metadata&&t.metadata.operation_result;return e||void 0}get status(){var t,e;return null!==(e=null===(t=this.operationResults)||void 0===t?void 0:t.status)&&void 0!==e?e:"unknown"}get fee(){return this.params.fee}get gasLimit(){return this.params.gas_limit}get storageLimit(){return this.params.storage_limit}get errors(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.errors}get consumedMilliGas(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.consumed_milligas}get amount(){return this.params.amount}get destination(){return this.params.destination}}e.IncreasePaidStorageOperation=n},3323:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Operation=e.BallotOperation=e.TransactionOperation=e.OriginationOperation=e.DelegateOperation=e.BatchOperation=e.TezosPreapplyFailureError=e.TezosOperationError=e.OpKind=void 0;var i=r(807);Object.defineProperty(e,"OpKind",{enumerable:!0,get:function(){return i.OpKind}});var n=r(8974);Object.defineProperty(e,"TezosOperationError",{enumerable:!0,get:function(){return n.TezosOperationError}}),Object.defineProperty(e,"TezosPreapplyFailureError",{enumerable:!0,get:function(){return n.TezosPreapplyFailureError}});var s=r(3650);Object.defineProperty(e,"BatchOperation",{enumerable:!0,get:function(){return s.BatchOperation}});var o=r(9785);Object.defineProperty(e,"DelegateOperation",{enumerable:!0,get:function(){return o.DelegateOperation}});var a=r(6646);Object.defineProperty(e,"OriginationOperation",{enumerable:!0,get:function(){return a.OriginationOperation}});var c=r(1846);Object.defineProperty(e,"TransactionOperation",{enumerable:!0,get:function(){return c.TransactionOperation}});var u=r(3729);Object.defineProperty(e,"BallotOperation",{enumerable:!0,get:function(){return u.BallotOperation}});var h=r(8361);Object.defineProperty(e,"Operation",{enumerable:!0,get:function(){return h.Operation}})},2026:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))},n=this&&this.__rest||function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r};Object.defineProperty(e,"__esModule",{value:!0}),e.OperationEmitter=void 0;const s=r(6368),o=r(4593),a=r(3010),c=r(8974),u=r(4632),h=r(807);e.OperationEmitter=class{constructor(t){this.context=t}get rpc(){return this.context.rpc}get signer(){return this.context.signer}isRevealOpNeeded(t,e){return i(this,void 0,void 0,(function*(){return!(!(yield this.isAccountRevealRequired(e))||!this.isRevealRequiredForOpType(t))}))}isAccountRevealRequired(t){return i(this,void 0,void 0,(function*(){return!(yield this.context.readProvider.isAccountRevealed(t,"head"))}))}isRevealRequiredForOpType(t){let e=!1;for(const r of t)h.isOpRequireReveal(r)&&(e=!0);return e}prepareOperation({operation:t,source:e},r){return i(this,void 0,void 0,(function*(){const n={};let c=[];const f=this.context.readProvider.getBlockHash("head~2"),l=this.context.readProvider.getNextProtocol("head");c=Array.isArray(t)?[...t]:[t];const d=r||(yield this.signer.publicKeyHash());let p=Promise.resolve(void 0),b=Promise.resolve(void 0);c.find((t=>i(this,void 0,void 0,(function*(){if("ballot"===t.kind||"proposals"===t.kind)try{b=this.rpc.getCurrentPeriod()}catch(t){throw new a.RPCResponseError(`Failed to get the current voting period index: ${JSON.stringify(t)}`)}}))));for(let t=0;t<c.length;t++)if(h.isOpRequireReveal(c[t])||"reveal"===c[t].kind){p=this.context.readProvider.getCounter(d,"head");break}const[g,m,v,y]=yield Promise.all([f,l,p,b]),w=parseInt(v||"0",10);(!n[d]||n[d]<w)&&(n[d]=w);const _=t=>({counter:`${++n[d]}`,fee:void 0===t.fee?"0":`${t.fee}`,gas_limit:void 0===t.gas_limit?"0":`${t.gas_limit}`,storage_limit:void 0===t.storage_limit?"0":`${t.storage_limit}`}),E=t=>({source:void 0===t.source?e||d:t.source});return{opOb:{branch:g,contents:c.map((t=>{switch(t.kind){case s.OpKind.ACTIVATION:return Object.assign({},t);case s.OpKind.ORIGINATION:return Object.assign(Object.assign(Object.assign(Object.assign({},t),{balance:void 0!==t.balance?`${t.balance}`:"0"}),E(t)),_(t));case s.OpKind.TRANSACTION:{const e=Object.assign(Object.assign(Object.assign(Object.assign({},t),{amount:void 0!==t.amount?`${t.amount}`:"0"}),E(t)),_(t));if(e.source.toLowerCase().startsWith("kt1"))throw new u.DeprecationError(`KT1 addresses are not supported as source since ${o.Protocols.PsBabyM1}`);return e}case s.OpKind.REVEAL:case s.OpKind.DELEGATION:case s.OpKind.REGISTER_GLOBAL_CONSTANT:case s.OpKind.TX_ROLLUP_ORIGINATION:case s.OpKind.TX_ROLLUP_SUBMIT_BATCH:return Object.assign(Object.assign(Object.assign({},t),E(t)),_(t));case s.OpKind.TRANSFER_TICKET:return Object.assign(Object.assign(Object.assign(Object.assign({},t),{ticket_amount:`${t.ticket_amount}`}),E(t)),_(t));case s.OpKind.INCREASE_PAID_STORAGE:return Object.assign(Object.assign(Object.assign(Object.assign({},t),{amount:`${t.amount}`}),E(t)),_(t));case s.OpKind.BALLOT:case s.OpKind.PROPOSALS:if(void 0===y)throw new a.RPCResponseError("Failed to get the current voting period index");return Object.assign(Object.assign({},t),{period:null==y?void 0:y.voting_period.index});default:throw new u.InvalidOperationKindError(t.kind)}})),protocol:m},counter:w}}))}forge({opOb:{branch:t,contents:e,protocol:r},counter:n}){return i(this,void 0,void 0,(function*(){return{opbytes:yield this.context.forger.forge({branch:t,contents:e}),opOb:{branch:t,contents:e,protocol:r},counter:n}}))}simulate(t){return i(this,void 0,void 0,(function*(){return{opResponse:yield this.rpc.runOperation(t),op:t,context:this.context.clone()}}))}estimate(t,e){var{fee:r,gasLimit:s,storageLimit:o}=t,a=n(t,["fee","gasLimit","storageLimit"]);return i(this,void 0,void 0,(function*(){let t=r,i=s,n=o;if(void 0===r||void 0===s||void 0===o){const c=yield e(Object.assign({fee:r,gasLimit:s,storageLimit:o},a));void 0===t&&(t=c.suggestedFeeMutez),void 0===i&&(i=c.gasLimit),void 0===n&&(n=c.storageLimit)}return{fee:t,gasLimit:i,storageLimit:n}}))}signAndInject(t){return i(this,void 0,void 0,(function*(){const e=yield this.signer.sign(t.opbytes,new Uint8Array([3]));t.opbytes=e.sbytes,t.opOb.signature=e.prefixSig;const r=[],i=yield this.rpc.preapplyOperations([t.opOb]);if(!Array.isArray(i))throw new c.TezosPreapplyFailureError(i);for(let t=0;t<i.length;t++)for(let e=0;e<i[t].contents.length;e++)r.push(i[t].contents[e]);const n=c.flattenErrors(i);if(n.length)throw new c.TezosOperationError(n,"Error occurred during validation simulation of operation");return{hash:yield this.context.injector.inject(t.opbytes),forgedBytes:t,opResponse:r,context:this.context.clone()}}))}}},8974:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OriginationOperationError=e.flattenErrors=e.flattenOperationResult=e.TezosPreapplyFailureError=e.TezosOperationError=void 0;const i=r(807);class n extends Error{constructor(t,e){super(),this.errors=t,this.errorDetails=e,this.name="TezosOperationError";const r=t[t.length-1];this.id=r.id,this.kind=r.kind,this.message=`(${this.kind}) ${this.id}`,"with"in r&&(r.with.string?this.message=r.with.string:r.with.int?this.message=r.with.int:this.message=JSON.stringify(r.with))}}e.TezosOperationError=n;class s extends Error{constructor(t){super("Preapply returned an unexpected result"),this.result=t,this.name="TezosPreapplyFailureError"}}e.TezosPreapplyFailureError=s;e.flattenOperationResult=t=>{const e=Array.isArray(t)?t:[t],r=[];for(let t=0;t<e.length;t++)for(let n=0;n<e[t].contents.length;n++){const s=e[t].contents[n];i.hasMetadataWithResult(s)&&(r.push(Object.assign({fee:s.fee},s.metadata.operation_result)),Array.isArray(s.metadata.internal_operation_results)&&s.metadata.internal_operation_results.forEach((t=>r.push(t.result))))}return r};e.flattenErrors=(t,e="failed")=>{const r=Array.isArray(t)?t:[t];let n=[];for(let t=0;t<r.length;t++)for(let s=0;s<r[t].contents.length;s++){const o=r[t].contents[s];if(i.hasMetadata(o)&&(i.hasMetadataWithResult(o)&&o.metadata.operation_result.status===e&&(n=n.concat(o.metadata.operation_result.errors||[])),i.hasMetadataWithInternalOperationResult(o)&&Array.isArray(o.metadata.internal_operation_results)))for(const t of o.metadata.internal_operation_results)"result"in t&&t.result.status===e&&(n=n.concat(t.result.errors||[]))}return n};class o extends Error{constructor(t){super(t),this.message=t,this.name="OriginationOperationError"}}e.OriginationOperationError=o},8361:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Operation=void 0;const n=r(4496),s=r(6276),o=r(807),a=r(4632),c=r(552),u=r(3010);e.Operation=class{constructor(t,e,r,i){if(this.hash=t,this.raw=e,this.results=r,this.context=i,this._pollingConfig$=new n.ReplaySubject(1),this.currentHead$=this._pollingConfig$.pipe(s.switchMap((t=>new n.BehaviorSubject(t).pipe(s.timeoutWith(1e3*t.timeout,n.throwError(new Error("Confirmation polling timed out")))))),s.switchMap((()=>n.defer((()=>c.createObservableFromSubscription(this.context.stream.subscribeBlock("head")))).pipe(s.switchMap((t=>{var e,r;const i=null!==(r=null===(e=this.lastHead)||void 0===e?void 0:e.header.level)&&void 0!==r?r:t.header.level-1;return n.range(i+1,t.header.level-i-1).pipe(s.concatMap((t=>this.context.readProvider.getBlock(t))),s.endWith(t))})),s.tap((t=>this.lastHead=t))))),s.shareReplay({refCount:!0})),this.confirmed$=this.currentHead$.pipe(s.map((t=>{for(let e=3;e>=0;e--)t.operations[e].forEach((e=>{e.hash===this.hash&&(this._foundAt=t.header.level)}));if(t.header.level-this._foundAt>=0)return this._foundAt})),s.filter((t=>void 0!==t)),s.first(),s.shareReplay()),this._foundAt=Number.POSITIVE_INFINITY,a.validateOperation(this.hash)!==a.ValidationResult.VALID)throw new a.InvalidOperationHashError(this.hash);this.confirmed$.pipe(s.first(),s.catchError((()=>n.of(n.EMPTY)))).subscribe()}get includedInBlock(){return this._foundAt}get revealOperation(){return Array.isArray(this.results)&&this.results.find((t=>"reveal"===t.kind))}get revealStatus(){return this.revealOperation?this.revealOperation.metadata.operation_result.status:"unknown"}get status(){return this.results.map((t=>o.hasMetadataWithResult(t)?t.metadata.operation_result.status:"unknown"))[0]||"unknown"}confirmation(t,e){return i(this,void 0,void 0,(function*(){if(void 0!==t&&t<1)throw new u.InvalidConfirmationCountError("Confirmation count must be at least 1");const{defaultConfirmationCount:r,confirmationPollingTimeoutSecond:i}=this.context.config;this._pollingConfig$.next({timeout:e||i});const n=void 0!==t?t:r;return new Promise(((t,e)=>{this.confirmed$.pipe(s.switchMap((()=>this.currentHead$)),s.filter((t=>t.header.level-this._foundAt>=n-1)),s.first()).subscribe((e=>{t(this._foundAt+(n-1))}),e)}))}))}}},6646:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.OriginationOperation=void 0;const n=r(6391),s=r(8974),o=r(8361),a=r(807);class c extends o.Operation{constructor(t,e,r,i,n,s){super(t,r,i,n),this.params=e,this.contractProvider=s;const o=this.operationResults&&this.operationResults.originated_contracts;Array.isArray(o)&&(this.contractAddress=o[0])}get status(){var t,e;return null!==(e=null===(t=this.operationResults)||void 0===t?void 0:t.status)&&void 0!==e?e:"unknown"}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"origination"===t.kind)),e=t&&a.hasMetadataWithResult(t)&&t.metadata.operation_result;return e||void 0}get fee(){return this.params.fee}get gasLimit(){return this.params.gas_limit}get storageLimit(){return this.params.storage_limit}get consumedGas(){return n.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.BigNumber.ROUND_UP}),this.consumedMilliGas?new n.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.consumed_milligas}get storageDiff(){const t=this.operationResults&&this.operationResults.paid_storage_size_diff;return t||void 0}get storageSize(){const t=this.operationResults&&this.operationResults.storage_size;return t||void 0}get errors(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.errors}contract(t,e){return i(this,void 0,void 0,(function*(){if(!this.contractAddress)throw new s.OriginationOperationError("No contract was originated in this operation");return yield this.confirmation(t,e),this.contractProvider.at(this.contractAddress)}))}}e.OriginationOperation=c},7279:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProposalsOperation=void 0;const i=r(8361);class n extends i.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"proposals"===t.kind));return t||void 0}get proposals(){return this.params.proposals}get period(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.period}}e.ProposalsOperation=n},5544:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RegisterGlobalConstantOperation=void 0;const i=r(6391),n=r(8361);class s extends n.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r,this.globalConstantHash=this.operationResults&&this.operationResults.global_address}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"register_global_constant"===t.kind)),e=t&&t.metadata&&t.metadata.operation_result;return e||void 0}get status(){var t,e;return null!==(e=null===(t=this.operationResults)||void 0===t?void 0:t.status)&&void 0!==e?e:"unknown"}get registeredExpression(){return this.params.value}get fee(){return this.params.fee}get gasLimit(){return this.params.gas_limit}get storageLimit(){return this.params.storage_limit}get errors(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.errors}get consumedGas(){return i.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.BigNumber.ROUND_UP}),this.consumedMilliGas?new i.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.consumed_milligas}}e.RegisterGlobalConstantOperation=s},2342:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RevealOperation=void 0;const i=r(6391),n=r(8974),s=r(8361);class o extends s.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"reveal"===t.kind));return t?[t]:[]}get status(){const t=this.operationResults[0];return t?t.metadata.operation_result.status:"unknown"}get fee(){return this.params.fee}get gasLimit(){return this.params.gas_limit}get storageLimit(){return this.params.storage_limit}get publicKey(){return this.params.public_key}sumProp(t,e){return t.reduce(((t,r)=>e in r?Number(r[e])+t:t),0)}get consumedGas(){return i.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.BigNumber.ROUND_UP}),new i.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp(n.flattenOperationResult({contents:this.operationResults}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp(n.flattenOperationResult({contents:this.operationResults}),"paid_storage_size_diff"))}get storageSize(){return String(this.sumProp(n.flattenOperationResult({contents:this.operationResults}),"storage_size"))}get errors(){return n.flattenErrors({contents:this.operationResults})}}e.RevealOperation=o},1846:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TransactionOperation=void 0;const i=r(6391),n=r(8974),s=r(8361);class o extends s.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"transaction"===t.kind));return t?[t]:[]}get status(){const t=this.operationResults[0];return t?t.metadata.operation_result.status:"unknown"}get amount(){return new i.default(this.params.amount)}get destination(){return this.params.destination}get fee(){return this.params.fee}get gasLimit(){return this.params.gas_limit}get storageLimit(){return this.params.storage_limit}sumProp(t,e){return t.reduce(((t,r)=>e in r?Number(r[e])+t:t),0)}get consumedGas(){return i.default.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.default.ROUND_UP}),new i.default(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp(n.flattenOperationResult({contents:this.operationResults}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp(n.flattenOperationResult({contents:this.operationResults}),"paid_storage_size_diff"))}get storageSize(){return String(this.sumProp(n.flattenOperationResult({contents:this.operationResults}),"storage_size"))}get errors(){return n.flattenErrors({contents:this.operationResults})}}e.TransactionOperation=o},8983:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TransferTicketOperation=void 0;const i=r(6368),n=r(6391),s=r(3323);class o extends s.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>t.kind===i.OpKind.TRANSFER_TICKET)),e=t&&t.metadata&&t.metadata.operation_result;return e||void 0}get status(){var t,e;return null!==(e=null===(t=this.operationResults)||void 0===t?void 0:t.status)&&void 0!==e?e:"unknown"}get fee(){return this.params.fee}get gasLimit(){return this.params.gas_limit}get storageLimit(){return this.params.storage_limit}get consumedGas(){return n.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.BigNumber.ROUND_UP}),this.consumedMilliGas?new n.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.consumed_milligas}}e.TransferTicketOperation=o},280:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TxRollupBatchOperation=void 0;const i=r(6391),n=r(8361);class s extends n.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"tx_rollup_submit_batch"===t.kind)),e=t&&t.metadata&&t.metadata.operation_result;return e||void 0}get status(){var t,e;return null!==(e=null===(t=this.operationResults)||void 0===t?void 0:t.status)&&void 0!==e?e:"unknown"}get content(){return this.params.content}get fee(){return this.params.fee}get gasLimit(){return this.params.gas_limit}get storageLimit(){return this.params.storage_limit}get errors(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.errors}get consumedGas(){return i.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.BigNumber.ROUND_UP}),this.consumedMilliGas?new i.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.consumed_milligas}}e.TxRollupBatchOperation=s},9989:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TxRollupOriginationOperation=void 0;const i=r(6391),n=r(8361);class s extends n.Operation{constructor(t,e,r,i,n,s){super(t,i,n,s),this.params=e,this.source=r,this.originatedRollup=this.operationResults&&this.operationResults.originated_rollup}get operationResults(){const t=Array.isArray(this.results)&&this.results.find((t=>"tx_rollup_origination"===t.kind)),e=t&&t.metadata&&t.metadata.operation_result;return e||void 0}get status(){var t,e;return null!==(e=null===(t=this.operationResults)||void 0===t?void 0:t.status)&&void 0!==e?e:"unknown"}get fee(){return this.params.fee}get gasLimit(){return this.params.gas_limit}get storageLimit(){return this.params.storage_limit}get errors(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.errors}get consumedGas(){return i.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.BigNumber.ROUND_UP}),this.consumedMilliGas?new i.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var t;return null===(t=this.operationResults)||void 0===t?void 0:t.consumed_milligas}}e.TxRollupOriginationOperation=s},807:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasMetadataWithInternalOperationResult=e.hasMetadataWithResult=e.hasMetadata=e.isSourceOp=e.isOpRequireReveal=e.isOpWithFee=e.isKind=e.findWithKind=e.attachKind=e.OpKind=void 0;var i=r(6368);Object.defineProperty(e,"OpKind",{enumerable:!0,get:function(){return i.OpKind}});e.attachKind=(t,e)=>Object.assign(Object.assign({},t),{kind:e});e.findWithKind=(t,r)=>{if(Array.isArray(t)){const i=t.find((t=>t.kind===r));if(i&&e.isKind(i,r))return i}};e.isKind=(t,e)=>t.kind===e;e.isOpWithFee=t=>-1!==["transaction","delegation","origination","reveal","register_global_constant","increase_paid_storage","tx_rollup_origination","tx_rollup_submit_batch","transfer_ticket"].indexOf(t.kind);e.isOpRequireReveal=t=>-1!==["transaction","delegation","origination","register_global_constant","increase_paid_storage","tx_rollup_origination","tx_rollup_submit_batch","transfer_ticket"].indexOf(t.kind);e.isSourceOp=t=>-1!==["transaction","delegation","origination","reveal","ballot"].indexOf(t.kind);e.hasMetadata=t=>"metadata"in t;e.hasMetadataWithResult=t=>e.hasMetadata(t)&&"operation_result"in t.metadata;e.hasMetadataWithInternalOperationResult=t=>e.hasMetadata(t)&&"internal_operation_results"in t.metadata},4762:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3482:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.MichelCodecPacker=void 0;const n=r(9985);e.MichelCodecPacker=class{packData(t){return i(this,void 0,void 0,(function*(){const{bytes:e}=n.packDataBytes(t.data,t.type);return{packed:e}}))}}},6395:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.RpcPacker=void 0;e.RpcPacker=class{constructor(t){this.context=t}packData(t){return r(this,void 0,void 0,(function*(){return this.context.rpc.packData(t)}))}}},9813:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5286:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.MichelCodecParser=void 0;const n=r(9985),s=r(6700),o=r(8899);e.MichelCodecParser=class{constructor(t){this.context=t}getNextProto(){return i(this,void 0,void 0,(function*(){if(!this.context.proto){const t=yield this.context.readProvider.getNextProtocol("head");this.context.proto=t}return this.context.proto}))}parseScript(t){return i(this,void 0,void 0,(function*(){return new n.Parser({protocol:yield this.getNextProto()}).parseScript(t)}))}parseMichelineExpression(t){return i(this,void 0,void 0,(function*(){return new n.Parser({protocol:yield this.getNextProto()}).parseMichelineExpression(t)}))}parseJSON(t){return i(this,void 0,void 0,(function*(){return new n.Parser({protocol:yield this.getNextProto()}).parseJSON(t)}))}prepareCodeOrigination(t){return i(this,void 0,void 0,(function*(){const e=t;if(e.code=yield this.formatCodeParam(t.code),t.init)e.init=yield this.formatInitParam(t.init);else if(t.storage){const r=e.code.find((t=>"prim"in t&&"storage"===t.prim));if(!(null==r?void 0:r.args))throw new s.InvalidCodeParameter("The storage section is missing from the script",t.code);const i=new o.Schema(r.args[0]),a=yield this.findGlobalConstantsHashAndValue(i);if(0!==Object.keys(a).length){const i=new n.Parser({expandGlobalConstant:a}).parseJSON(r.args[0]),s=new o.Schema(i);e.init=s.Encode(t.storage)}else e.init=i.Encode(t.storage);delete e.storage}return e}))}formatCodeParam(t){return i(this,void 0,void 0,(function*(){let e;if("string"==typeof t){const r=yield this.parseScript(t);if(null===r)throw new s.InvalidCodeParameter("Invalid code parameter",t);e=r}else{const r=yield this.parseJSON(t),i=["parameter","storage","code"];e=r.sort(((t,e)=>i.indexOf(t.prim)-i.indexOf(e.prim)))}return e}))}formatInitParam(t){return i(this,void 0,void 0,(function*(){let e;if("string"==typeof t){const r=yield this.parseMichelineExpression(t);if(null===r)throw new s.InvalidInitParameter("Invalid init parameter",t);e=r}else e=yield this.parseJSON(t);return e}))}findGlobalConstantsHashAndValue(t){return i(this,void 0,void 0,(function*(){const e=t.findToken("constant"),r={};if(0!==e.length)for(const t of e){const e=t.tokenVal.args;if(e){const t=e[0];if(t.string){const e=t.string,i=yield this.context.globalConstantsProvider.getGlobalConstantByHash(e);Object.assign(r,{[e]:i})}}}return r}))}}},3259:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.NoopParser=void 0;e.NoopParser=class{prepareCodeOrigination(t){return r(this,void 0,void 0,(function*(){return t}))}}},259:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.RpcReadAdapter=void 0;e.RpcReadAdapter=class{constructor(t){this.rpc=t}getBalance(t,e){return r(this,void 0,void 0,(function*(){return this.rpc.getBalance(t,{block:String(e)})}))}getDelegate(t,e){return r(this,void 0,void 0,(function*(){return this.rpc.getDelegate(t,{block:String(e)})}))}getNextProtocol(t){return r(this,void 0,void 0,(function*(){return(yield this.rpc.getProtocols({block:String(t)})).next_protocol}))}getProtocolConstants(t){return r(this,void 0,void 0,(function*(){const{time_between_blocks:e,minimal_block_delay:r,hard_gas_limit_per_operation:i,hard_gas_limit_per_block:n,hard_storage_limit_per_operation:s,cost_per_byte:o,tx_rollup_origination_size:a}=yield this.rpc.getConstants({block:String(t)});return{time_between_blocks:e,minimal_block_delay:r,hard_gas_limit_per_operation:i,hard_gas_limit_per_block:n,hard_storage_limit_per_operation:s,cost_per_byte:o,tx_rollup_origination_size:a}}))}getScript(t,e){return r(this,void 0,void 0,(function*(){const{script:r}=yield this.rpc.getContract(t,{block:String(e)});return r}))}getStorage(t,e){return r(this,void 0,void 0,(function*(){return this.rpc.getStorage(t,{block:String(e)})}))}getBlockHash(t){return r(this,void 0,void 0,(function*(){const{hash:e}=yield this.rpc.getBlockHeader({block:String(t)});return e}))}getBlockLevel(t){return r(this,void 0,void 0,(function*(){const{level:e}=yield this.rpc.getBlockHeader({block:String(t)});return e}))}getCounter(t,e){return r(this,void 0,void 0,(function*(){const{counter:r}=yield this.rpc.getContract(t,{block:String(e)});return r||"0"}))}getBlockTimestamp(t){return r(this,void 0,void 0,(function*(){const{timestamp:e}=yield this.rpc.getBlockHeader({block:String(t)});return e}))}getBigMapValue(t,e){return r(this,void 0,void 0,(function*(){return this.rpc.getBigMapExpr(t.id,t.expr,{block:String(e)})}))}getSaplingDiffById(t,e){return r(this,void 0,void 0,(function*(){return this.rpc.getSaplingDiffById(t.id,{block:String(e)})}))}getSaplingDiffByContract(t,e){return r(this,void 0,void 0,(function*(){return this.rpc.getSaplingDiffByContract(t,{block:String(e)})}))}getEntrypoints(t){return r(this,void 0,void 0,(function*(){return this.rpc.getEntrypoints(t)}))}getChainId(){return r(this,void 0,void 0,(function*(){return this.rpc.getChainId()}))}isAccountRevealed(t,e){return r(this,void 0,void 0,(function*(){const r=yield this.rpc.getManagerKey(t,{block:String(e)});return r&&"object"==typeof r?!!r.key:!!r}))}getBlock(t){return r(this,void 0,void 0,(function*(){return this.rpc.getBlock({block:String(t)})}))}getLiveBlocks(t){return this.rpc.getLiveBlocks({block:String(t)})}}},1527:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1067:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.NoopSigner=e.UnconfiguredSignerError=void 0;class i extends Error{constructor(){super("No signer has been configured. Please configure one by calling setProvider({signer}) on your TezosToolkit instance."),this.name="UnconfiguredSignerError"}}e.UnconfiguredSignerError=i;e.NoopSigner=class{publicKey(){return r(this,void 0,void 0,(function*(){throw new i}))}publicKeyHash(){return r(this,void 0,void 0,(function*(){throw new i}))}secretKey(){return r(this,void 0,void 0,(function*(){throw new i}))}sign(t,e){return r(this,void 0,void 0,(function*(){throw new i}))}}},552:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createObservableFromSubscription=void 0;const i=r(4496);e.createObservableFromSubscription=function(t){return new i.Observable((e=>(t.on("data",(t=>{e.next(t)})),t.on("error",(t=>{e.error(t)})),t.on("close",(()=>{e.complete()})),()=>{t.close()})))}},8176:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.evaluateFilter=e.evaluateExpression=e.evaluateOpFilter=e.eventFilter=void 0;const i=r(3010);e.eventFilter=(t,e,r)=>"event"===t.kind&&(e&&r?t.source===e&&t.tag===r:e&&!r?t.source===e:!r||t.tag===r);e.evaluateOpFilter=(t,e)=>"opHash"in e?((t,e)=>t.hash===e.opHash)(t,e):"source"in e?((t,e)=>{switch(t.kind){case"endorsement":return"metadata"in t&&t.metadata.delegate===e.source;case"activate_account":return"metadata"in t&&t.pkh===e.source;default:return"source"in t&&t.source===e.source}})(t,e):"kind"in e?((t,e)=>"kind"in t&&t.kind===e.kind)(t,e):"destination"in e&&((t,e)=>{switch(t.kind){case"delegation":return t.delegate===e.destination;case"origination":if("metadata"in t&&"operation_result"in t.metadata&&"originated_contracts"in t.metadata.operation_result&&Array.isArray(t.metadata.operation_result.originated_contracts))return t.metadata.operation_result.originated_contracts.some((t=>t===e.destination));break;case"transaction":return t.destination===e.destination;default:return!1}})(t,e);e.evaluateExpression=(t,r)=>{if(Array.isArray(r.and))return r.and.every((r=>e.evaluateFilter(t,r)));if(Array.isArray(r.or))return r.or.some((r=>e.evaluateFilter(t,r)));throw new i.InvalidFilterExpressionError("Filter expression must contain either and/or property")};e.evaluateFilter=(t,r)=>{const i=[];return Array.isArray(r)?i.push(...r):i.push(r),i.every((r=>"and"in r||"or"in r?e.evaluateExpression(t,r):e.evaluateOpFilter(t,r)))}},440:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4435:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ObservableSubscription=e.UnsupportedEventError=void 0;const i=r(4496),n=r(6276);class s extends Error{constructor(t){super(t),this.message=t,this.name="UnsupportedEventError"}}e.UnsupportedEventError=s;e.ObservableSubscription=class{constructor(t,e=!1,r=n.retry()){this.shouldRetry=e,this.operatorFunction=r,this.errorListeners=[],this.messageListeners=[],this.closeListeners=[],this.completed$=new i.Subject,t.pipe(n.takeUntil(this.completed$),n.tap((t=>{this.call(this.messageListeners,t)}),(t=>{this.call(this.errorListeners,t)}),(()=>{this.call(this.closeListeners)})),this.shouldRetry?r:n.tap(),n.catchError((()=>i.NEVER))).subscribe()}call(t,e){for(const r of t)try{r(e)}catch(t){console.error(t)}}remove(t,e){const r=t.indexOf(e);-1!==r&&t.splice(r,1)}on(t,e){switch(t){case"data":this.messageListeners.push(e);break;case"error":this.errorListeners.push(e);break;case"close":this.closeListeners.push(e);break;default:throw new s(`Trying to register on an unsupported event: ${t}`)}}off(t,e){switch(t){case"data":this.remove(this.messageListeners,e);break;case"error":this.remove(this.errorListeners,e);break;case"close":this.remove(this.closeListeners,e);break;default:throw new s(`Trying to unregister on an unsupported event: ${t}`)}}close(){this.completed$.next()}}},5032:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.PollingSubscribeProvider=e.defaultConfigStreamer=void 0;const n=r(4496),s=r(6276),o=r(8176),a=r(4435),c=r(6391);e.defaultConfigStreamer={shouldObservableSubscriptionRetry:!1,observableSubscriptionRetryFunction:s.retry()};e.PollingSubscribeProvider=class{constructor(t,r={}){this.context=t,this._config$=new n.BehaviorSubject(Object.assign(Object.assign({},e.defaultConfigStreamer),r)),this.timer$=this._config$.pipe(s.pluck("pollingIntervalMilliseconds"),s.switchMap((t=>t?n.timer(0,t):n.from(this.getConfirmationPollingInterval()).pipe(s.switchMap((t=>n.timer(0,t))))))),this.newBlock$=this.timer$.pipe(s.switchMap((()=>(t=>n.from(t.rpc.getBlock()).pipe(s.first()))(this.context))),s.distinctUntilKeyChanged("hash"),s.publish(),s.refCount())}get config(){return this._config$.getValue()}getConfirmationPollingInterval(){return i(this,void 0,void 0,(function*(){if(!this.config.pollingIntervalMilliseconds){const t=5e3,e=1e3;try{const r=yield this.context.readProvider.getProtocolConstants("head"),i=(r.minimal_block_delay?r.minimal_block_delay.multipliedBy(1e3):r.time_between_blocks?r.time_between_blocks[0].multipliedBy(1e3):new c.default(t)).dividedBy(3);this.config.pollingIntervalMilliseconds=0===i.toNumber()?e:i.toNumber()}catch(e){return t}}return this.config.pollingIntervalMilliseconds}))}subscribeBlock(t){return new a.ObservableSubscription(this.newBlock$,this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribe(t){return new a.ObservableSubscription(this.newBlock$.pipe(s.pluck("hash")),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribeOperation(t){return new a.ObservableSubscription(this.newBlock$.pipe((t=>s.concatMap((e=>new n.Observable((r=>{for(const i of e.operations)for(const e of i)for(const i of e.contents)o.evaluateFilter(Object.assign({hash:e.hash},i),t)&&r.next(Object.assign({hash:e.hash},i));r.complete()})))))(t)),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribeEvent(t){return new a.ObservableSubscription(this.newBlock$.pipe((e=t,s.concatMap((t=>new n.Observable((r=>{for(const i of t.operations)for(const n of i)for(const i of n.contents){const s=i.metadata.internal_operation_results;if(s)for(const i of s)o.eventFilter(i,null==e?void 0:e.address,null==e?void 0:e.tag)&&r.next(Object.assign({opHash:n.hash,blockHash:t.hash,level:t.header.level},i))}r.complete()})))))),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction);var e}}},2353:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.TezosToolkit=e.TaquitoLocalForger=e.RpcReadAdapter=e.ObservableSubscription=e.PollingSubscribeProvider=e.OperationBatch=e.RpcForger=e.CompositeForger=e.UnitValue=e.MichelsonMap=void 0;const s=r(6368),o=r(4984),a=r(4632),c=r(9494),u=r(6395),h=r(259),f=r(1067),l=r(5032),d=r(8023),p=r(635),b=r(6713),g=r(5286);var m=r(8899);Object.defineProperty(e,"MichelsonMap",{enumerable:!0,get:function(){return m.MichelsonMap}}),Object.defineProperty(e,"UnitValue",{enumerable:!0,get:function(){return m.UnitValue}}),n(r(4593),e),n(r(4984),e),n(r(238),e),n(r(5225),e);var v=r(7336);Object.defineProperty(e,"CompositeForger",{enumerable:!0,get:function(){return v.CompositeForger}});var y=r(794);Object.defineProperty(e,"RpcForger",{enumerable:!0,get:function(){return y.RpcForger}}),n(r(3323),e);var w=r(150);Object.defineProperty(e,"OperationBatch",{enumerable:!0,get:function(){return w.OperationBatch}}),n(r(1527),e),n(r(440),e);var _=r(5032);Object.defineProperty(e,"PollingSubscribeProvider",{enumerable:!0,get:function(){return _.PollingSubscribeProvider}});var E=r(4435);Object.defineProperty(e,"ObservableSubscription",{enumerable:!0,get:function(){return E.ObservableSubscription}}),n(r(4946),e),n(r(635),e),n(r(9813),e),n(r(5286),e),n(r(3259),e),n(r(4762),e),n(r(3482),e),n(r(6395),e),n(r(5505),e),n(r(1452),e),n(r(3171),e);var S=r(259);Object.defineProperty(e,"RpcReadAdapter",{enumerable:!0,get:function(){return S.RpcReadAdapter}}),n(r(8794),e);var A=r(6713);Object.defineProperty(e,"TaquitoLocalForger",{enumerable:!0,get:function(){return A.TaquitoLocalForger}});e.TezosToolkit=class{constructor(t){this._rpc=t,this._options={},this.format=a.format,"string"==typeof this._rpc?this._rpcClient=new s.RpcClient(this._rpc):this._rpcClient=this._rpc,this._context=new o.Context(t),this._wallet=new p.Wallet(this._context),this.setProvider({rpc:this._rpcClient}),this.batch=this._context.batch.batch.bind(this._context.batch)}setProvider({rpc:t,stream:e,signer:r,protocol:i,config:n,forger:s,wallet:o,packer:a,globalConstantsProvider:c,readProvider:u,parserProvider:h}){this.setRpcProvider(t),this.setStreamProvider(e),this.setSignerProvider(r),this.setForgerProvider(s),this.setWalletProvider(o),this.setPackerProvider(a),this.setGlobalConstantsProvider(c),this.setReadProvider(u),this.setParserProvider(h),this._context.proto=i,n&&this._context.setPartialConfig(n)}setSignerProvider(t){this._options.signer||void 0!==t?void 0!==t&&(this._context.signer=t,this._options.signer=t):(this._context.signer=new f.NoopSigner,this._options.signer=t)}setRpcProvider(t){"string"==typeof t?this._rpcClient=new s.RpcClient(t):void 0===t||(this._rpcClient=t),this._options.rpc=this._rpcClient,this._context.rpc=this._rpcClient}setForgerProvider(t){if(void 0!==t)this._options.forger=t,this._context.forger=t;else if(void 0===this._options.forger){const t=this.getFactory(b.TaquitoLocalForger)();this._options.forger=t,this._context.forger=t}}setStreamProvider(t){if("string"==typeof t){const e=new l.PollingSubscribeProvider(new o.Context(new s.RpcClient(t)));this._options.stream=e,this._context.stream=e}else if(void 0!==t)this._options.stream=t,this._context.stream=t;else if(void 0===this._options.stream){const t=this.getFactory(l.PollingSubscribeProvider)();this._options.stream=t,this._context.stream=t}}setWalletProvider(t){if(this._options.wallet||void 0!==t)void 0!==t&&(this._options.wallet=t,this._context.walletProvider=t);else{const t=this.getFactory(p.LegacyWalletProvider)();this._options.wallet=t,this._context.walletProvider=t}}setPackerProvider(t){if(this._options.packer||void 0!==t)void 0!==t&&(this._context.packer=t,this._options.packer=t);else{const t=this.getFactory(u.RpcPacker)();this._context.packer=t,this._options.packer=t}}setGlobalConstantsProvider(t){if(this._options.globalConstantsProvider||void 0!==t)void 0!==t&&(this._context.globalConstantsProvider=t,this._options.globalConstantsProvider=t);else{const t=new c.NoopGlobalConstantsProvider;this._context.globalConstantsProvider=t,this._options.globalConstantsProvider=t}}setReadProvider(t){const e=t||new h.RpcReadAdapter(this._context.rpc);this._options.readProvider=e,this._context.readProvider=e}setParserProvider(t){if(this._options.parserProvider||void 0!==t)void 0!==t&&(this._context.parser=t,this._options.parserProvider=t);else{const t=new g.MichelCodecParser(this._context);this._context.parser=t,this._options.parserProvider=t}}get tz(){return this._context.tz}get contract(){return this._context.contract}get wallet(){return this._wallet}get operation(){return this._context.operationFactory}get estimate(){return this._context.estimate}get stream(){return this._context.stream}get rpc(){return this._context.rpc}get signer(){return this._context.signer}get globalConstants(){return this._context.globalConstantsProvider}addExtension(t){Array.isArray(t)?t.forEach((t=>t.configureContext(this._context))):t.configureContext(this._context)}getFactory(t){return(...e)=>new t(this._context,...e)}getVersionInfo(){return d.VERSION}}},4946:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},992:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.RpcTzProvider=void 0;const n=r(2026),s=r(8361),o=r(6368),a=r(4632);class c extends n.OperationEmitter{constructor(t){super(t)}getBalance(t){return i(this,void 0,void 0,(function*(){if(a.validateAddress(t)!==a.ValidationResult.VALID)throw new a.InvalidAddressError(t);return this.context.readProvider.getBalance(t,"head")}))}getDelegate(t){return i(this,void 0,void 0,(function*(){if(a.validateAddress(t)!==a.ValidationResult.VALID)throw new a.InvalidAddressError(t);return this.context.readProvider.getDelegate(t,"head")}))}activate(t,e){return i(this,void 0,void 0,(function*(){if(a.validateKeyHash(t)!==a.ValidationResult.VALID)throw new a.InvalidKeyHashError(t);const r={kind:o.OpKind.ACTIVATION,pkh:t,secret:e},i=yield this.prepareOperation({operation:[r],source:t}),n=yield this.forge(i),c=`${n.opbytes}00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000`;return new s.Operation(yield this.rpc.injectOperation(c),Object.assign(Object.assign({},n),{opbytes:c}),[],this.context.clone())}))}}e.RpcTzProvider=c},8023:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION=void 0,e.VERSION={commitHash:"22fd810dcadf5272cb7a57d65165caa0eddbc57e",version:"14.2.0"}},1626:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.BatchWalletOperation=void 0;const n=r(6368),s=r(150),o=r(807),a=r(2809);class c extends a.WalletOperation{constructor(t,e,r){super(t,e,r),this.opHash=t,this.context=e,this.getOriginatedContractAddresses=()=>i(this,void 0,void 0,(function*(){const t=(yield this.operationResults()).filter((t=>"origination"===t.kind));let e=[];for(const r of t)r.metadata.operation_result.originated_contracts&&(e=[...e,...r.metadata.operation_result.originated_contracts]);return e}))}revealOperation(){return i(this,void 0,void 0,(function*(){return(yield this.operationResults()).find((t=>t.kind===n.OpKind.REVEAL))}))}status(){return i(this,void 0,void 0,(function*(){if(!this._included)return"pending";return(yield this.operationResults()).filter((t=>-1!==s.BATCH_KINDS.indexOf(t.kind))).map((t=>o.hasMetadataWithResult(t)?t.metadata.operation_result.status:"unknown"))[0]||"unknown"}))}}e.BatchWalletOperation=c},4364:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.DelegationWalletOperation=void 0;const n=r(6368),s=r(2809);class o extends s.WalletOperation{constructor(t,e,r){super(t,e,r),this.opHash=t,this.context=e}revealOperation(){return i(this,void 0,void 0,(function*(){return(yield this.operationResults()).find((t=>t.kind===n.OpKind.REVEAL))}))}delegationOperation(){return i(this,void 0,void 0,(function*(){return(yield this.operationResults()).find((t=>t.kind===n.OpKind.DELEGATION))}))}status(){return i(this,void 0,void 0,(function*(){if(!this._included)return"pending";const t=yield this.delegationOperation();return t?t.metadata.operation_result.status:"unknown"}))}}e.DelegationWalletOperation=o},635:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(5277),e),n(r(2809),e),n(r(4685),e),n(r(7654),e),n(r(4364),e),n(r(7432),e),n(r(8562),e)},7432:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},8562:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.LegacyWalletProvider=void 0;const n=r(807);e.LegacyWalletProvider=class{constructor(t){this.context=t}getPKH(){return i(this,void 0,void 0,(function*(){return this.context.signer.publicKeyHash()}))}mapTransferParamsToWalletParams(t){return i(this,void 0,void 0,(function*(){return n.attachKind(yield t(),n.OpKind.TRANSACTION)}))}mapOriginateParamsToWalletParams(t){return i(this,void 0,void 0,(function*(){return n.attachKind(yield t(),n.OpKind.ORIGINATION)}))}mapDelegateParamsToWalletParams(t){return i(this,void 0,void 0,(function*(){return n.attachKind(yield t(),n.OpKind.DELEGATION)}))}sendOperations(t){return i(this,void 0,void 0,(function*(){return(yield this.context.batch.batch(t).send()).hash}))}}},8286:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.OperationFactory=e.createNewPollingBasedHeadObservable=e.timeoutAfter=void 0;const n=r(4496),s=r(6276),o=r(552),a=r(1626),c=r(4364),u=r(2809),h=r(7654),f=r(4685);function l(t){return function(e){return new n.BehaviorSubject(null).pipe(s.timeoutWith(t,n.throwError(new Error("Confirmation polling timed out"))),s.mergeMap((()=>e)))}}e.timeoutAfter=l;e.createNewPollingBasedHeadObservable=(t,e,r)=>t.pipe(l(1e3*e.config.confirmationPollingTimeoutSecond),s.publishReplay(1),s.refCount());e.OperationFactory=class{constructor(t){this.context=t,this.sharedHeadObs=n.defer((()=>o.createObservableFromSubscription(this.context.stream.subscribeBlock("head"))))}createNewHeadObservable(){return i(this,void 0,void 0,(function*(){return e.createNewPollingBasedHeadObservable(this.sharedHeadObs,this.context)}))}createPastBlockWalker(t,e=1){return n.from(this.context.readProvider.getBlock(t)).pipe(s.switchMap((t=>1===e?n.of(t):n.range(t.header.level,e-1).pipe(s.startWith(t),s.concatMap((t=>i(this,void 0,void 0,(function*(){return this.context.readProvider.getBlock("number"==typeof t?t:t.header.level)}))))))))}createHeadObservableFromConfig({blockIdentifier:t}){return i(this,void 0,void 0,(function*(){const e=[];return t&&e.push(this.createPastBlockWalker(t)),e.push(yield this.createNewHeadObservable()),n.concat(...e)}))}createOperation(t,e={}){return i(this,void 0,void 0,(function*(){return new u.WalletOperation(t,this.context.clone(),yield this.createHeadObservableFromConfig(e))}))}createBatchOperation(t,e={}){return i(this,void 0,void 0,(function*(){return new a.BatchWalletOperation(t,this.context.clone(),yield this.createHeadObservableFromConfig(e))}))}createTransactionOperation(t,e={}){return i(this,void 0,void 0,(function*(){return new f.TransactionWalletOperation(t,this.context.clone(),yield this.createHeadObservableFromConfig(e))}))}createDelegationOperation(t,e={}){return i(this,void 0,void 0,(function*(){return new c.DelegationWalletOperation(t,this.context.clone(),yield this.createHeadObservableFromConfig(e))}))}createOriginationOperation(t,e={}){return i(this,void 0,void 0,(function*(){return new h.OriginationWalletOperation(t,this.context.clone(),yield this.createHeadObservableFromConfig(e))}))}}},2809:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.WalletOperation=void 0;const n=r(4496),s=r(6276),o=r(6298),a=r(4632),c=r(3010);e.WalletOperation=class{constructor(t,e,r){if(this.opHash=t,this.context=e,this._newHead$=r,this._operationResult=new n.ReplaySubject(1),this._includedInBlock=new n.ReplaySubject(1),this._included=!1,this.newHead$=this._newHead$.pipe(s.switchMap((t=>{var e,r;const i=null!==(r=null===(e=this.lastHead)||void 0===e?void 0:e.header.level)&&void 0!==r?r:t.header.level-1;return n.range(i+1,t.header.level-i-1).pipe(s.concatMap((t=>this.context.readProvider.getBlock(t))),s.endWith(t))})),s.tap((t=>this.lastHead=t)),s.publishReplay(1),s.refCount()),this.confirmed$=this.newHead$.pipe(s.map((t=>{for(const e of t.operations)for(const r of e)if(r.hash===this.opHash)return this._included=!0,this._includedInBlock.next(t),this._operationResult.next(r.contents),t})),s.filter((t=>void 0!==t)),s.first(),s.publishReplay(1),s.refCount()),a.validateOperation(this.opHash)!==a.ValidationResult.VALID)throw new a.InvalidOperationHashError(this.opHash);this.confirmed$.pipe(s.first(),s.catchError((()=>n.of(void 0)))).subscribe()}operationResults(){return i(this,void 0,void 0,(function*(){return this._operationResult.pipe(s.first()).toPromise()}))}receipt(){return i(this,void 0,void 0,(function*(){return o.receiptFromOperation(yield this.operationResults())}))}getCurrentConfirmation(){return i(this,void 0,void 0,(function*(){return this._included?n.combineLatest([this._includedInBlock,n.from(this.context.readProvider.getBlock("head"))]).pipe(s.map((([t,e])=>e.header.level-t.header.level+1)),s.first()).toPromise():0}))}isInCurrentBranch(t="head"){return i(this,void 0,void 0,(function*(){if(!this._included)return!0;const e=yield this.context.readProvider.getBlockLevel(t),r=yield this._includedInBlock.pipe(s.first()).toPromise(),i=e-r.header.level;if(i<=0)return!0;const n=Math.min(r.header.level+i,r.header.level+60);return new Set(yield this.context.readProvider.getLiveBlocks(n)).has(r.hash)}))}confirmationObservable(t){if(void 0!==t&&t<1)throw new c.InvalidConfirmationCountError("Confirmation count must be at least 1");const{defaultConfirmationCount:e}=this.context.config,r=void 0!==t?t:e;if(void 0===r)throw new c.ConfirmationUndefinedError("Default confirmation count can not be undefined!");return n.combineLatest([this._includedInBlock,this.newHead$]).pipe(s.distinctUntilChanged((([,t],[,e])=>t.hash===e.hash)),s.map((([t,e])=>({block:e,expectedConfirmation:r,currentConfirmation:e.header.level-t.header.level+1,completed:e.header.level-t.header.level>=r-1,isInCurrentBranch:()=>this.isInCurrentBranch(e.hash)}))),s.takeWhile((({completed:t})=>!t),!0))}confirmation(t){return this.confirmationObservable(t).toPromise()}}},7654:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.OriginationWalletOperation=void 0;const n=r(6368),s=r(807),o=r(2809);class a extends o.WalletOperation{constructor(t,e,r){super(t,e,r),this.opHash=t,this.context=e}originationOperation(){return i(this,void 0,void 0,(function*(){const t=yield this.operationResults();return s.findWithKind(t,n.OpKind.ORIGINATION)}))}revealOperation(){return i(this,void 0,void 0,(function*(){const t=yield this.operationResults();return s.findWithKind(t,n.OpKind.REVEAL)}))}status(){return i(this,void 0,void 0,(function*(){if(!this._included)return"pending";const t=yield this.originationOperation();return t?t.metadata.operation_result.status:"unknown"}))}contract(){return i(this,void 0,void 0,(function*(){const t=yield this.originationOperation(),e=((null==t?void 0:t.metadata.operation_result.originated_contracts)||[])[0];return this.context.wallet.at(e)}))}}e.OriginationWalletOperation=a},6298:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.receiptFromOperation=void 0;const i=r(6391),n=r(4593),s=r(8974);e.receiptFromOperation=(t,{ALLOCATION_BURN:e,ORIGINATION_BURN:r}={ALLOCATION_BURN:257,ORIGINATION_BURN:257})=>{i.default.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.default.ROUND_UP});const o=s.flattenOperationResult({contents:t});let a=new i.default(0),c=new i.default(0),u=new i.default(0),h=new i.default(0),f=new i.default(0),l=new i.default(0);return o.forEach((t=>{u=u.plus(t.fee||0),h=h.plus(Array.isArray(t.originated_contracts)?t.originated_contracts.length*r:0),f=f.plus("allocated_destination_contract"in t?e:0),a=a.plus(t.consumed_milligas||0),l=l.plus("paid_storage_size_diff"in t&&Number(t.paid_storage_size_diff)||0)})),c=c.plus(f).plus(h).plus(l),{totalFee:u,totalMilliGas:a,totalGas:a.dividedBy(1e3),totalStorage:c,totalAllocationBurn:f,totalOriginationBurn:h,totalPaidStorageDiff:l,totalStorageBurn:new i.default(c.multipliedBy(n.COST_PER_BYTE))}}},4685:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.TransactionWalletOperation=void 0;const n=r(2809),s=r(6368);class o extends n.WalletOperation{constructor(t,e,r){super(t,e,r),this.opHash=t,this.context=e}revealOperation(){return i(this,void 0,void 0,(function*(){return(yield this.operationResults()).find((t=>t.kind===s.OpKind.REVEAL))}))}transactionOperation(){return i(this,void 0,void 0,(function*(){return(yield this.operationResults()).find((t=>t.kind===s.OpKind.TRANSACTION))}))}status(){return i(this,void 0,void 0,(function*(){if(!this._included)return"pending";const t=yield this.transactionOperation();return t?t.metadata.operation_result.status:"unknown"}))}}e.TransactionWalletOperation=o},5277:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Wallet=e.WalletOperationBatch=void 0;const n=r(238),s=r(807),o=r(4632);class a{constructor(t,e){this.walletProvider=t,this.context=e,this.operations=[]}withTransfer(t){if(o.validateAddress(t.to)!==o.ValidationResult.VALID)throw new o.InvalidAddressError(t.to);return this.operations.push(Object.assign({kind:s.OpKind.TRANSACTION},t)),this}withContractCall(t,e={}){return this.withTransfer(t.toTransferParams(e))}withDelegation(t){if(t.delegate&&o.validateAddress(t.delegate)!==o.ValidationResult.VALID)throw new o.InvalidAddressError(t.delegate);return this.operations.push(Object.assign({kind:s.OpKind.DELEGATION},t)),this}withOrigination(t){return this.operations.push(Object.assign({kind:s.OpKind.ORIGINATION},t)),this}mapOperation(t){return i(this,void 0,void 0,(function*(){switch(t.kind){case s.OpKind.TRANSACTION:return this.walletProvider.mapTransferParamsToWalletParams((()=>i(this,void 0,void 0,(function*(){return t}))));case s.OpKind.ORIGINATION:return this.walletProvider.mapOriginateParamsToWalletParams((()=>i(this,void 0,void 0,(function*(){return this.context.parser.prepareCodeOrigination(Object.assign({},t))}))));case s.OpKind.DELEGATION:return this.walletProvider.mapDelegateParamsToWalletParams((()=>i(this,void 0,void 0,(function*(){return t}))));default:throw new o.InvalidOperationKindError(t.kind)}}))}with(t){for(const e of t)switch(e.kind){case s.OpKind.TRANSACTION:this.withTransfer(e);break;case s.OpKind.ORIGINATION:this.withOrigination(e);break;case s.OpKind.DELEGATION:this.withDelegation(e);break;default:throw new o.InvalidOperationKindError(e.kind)}return this}send(){return i(this,void 0,void 0,(function*(){const t=[];for(const e of this.operations)t.push(yield this.mapOperation(e));const e=yield this.walletProvider.sendOperations(t);return this.context.operationFactory.createBatchOperation(e)}))}}e.WalletOperationBatch=a;e.Wallet=class{constructor(t){this.context=t,this.walletCommand=t=>({send:t})}get walletProvider(){return this.context.walletProvider}pkh({forceRefetch:t}={}){return i(this,void 0,void 0,(function*(){return this._pkh&&!t||(this._pkh=yield this.walletProvider.getPKH()),this._pkh}))}originate(t){return this.walletCommand((()=>i(this,void 0,void 0,(function*(){const e=yield this.walletProvider.mapOriginateParamsToWalletParams((()=>this.context.parser.prepareCodeOrigination(Object.assign({},t)))),r=yield this.walletProvider.sendOperations([e]);return this.context.operationFactory.createOriginationOperation(r)}))))}setDelegate(t){if(t.delegate&&o.validateAddress(t.delegate)!==o.ValidationResult.VALID)throw new o.InvalidAddressError(t.delegate);return this.walletCommand((()=>i(this,void 0,void 0,(function*(){const e=yield this.walletProvider.mapDelegateParamsToWalletParams((()=>i(this,void 0,void 0,(function*(){return t})))),r=yield this.walletProvider.sendOperations([e]);return this.context.operationFactory.createDelegationOperation(r)}))))}registerDelegate(){return this.walletCommand((()=>i(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapDelegateParamsToWalletParams((()=>i(this,void 0,void 0,(function*(){return{delegate:yield this.pkh()}})))),e=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createDelegationOperation(e)}))))}transfer(t){if(o.validateAddress(t.to)!==o.ValidationResult.VALID)throw new o.InvalidAddressError(t.to);return this.walletCommand((()=>i(this,void 0,void 0,(function*(){const e=yield this.walletProvider.mapTransferParamsToWalletParams((()=>i(this,void 0,void 0,(function*(){return t})))),r=yield this.walletProvider.sendOperations([e]);return this.context.operationFactory.createTransactionOperation(r)}))))}batch(t){const e=new a(this.walletProvider,this.context);return Array.isArray(t)&&e.with(t),e}at(t,e=(t=>t)){return i(this,void 0,void 0,(function*(){if(o.validateContractAddress(t)!==o.ValidationResult.VALID)throw new o.InvalidContractAddressError(t);const r=this.context.withExtensions().rpc,i=this.context.withExtensions().readProvider,s=yield i.getScript(t,"head"),a=yield i.getEntrypoints(t),c=new n.ContractAbstraction(t,s,this,this.context.contract,a,r,i);return e(c,this.context)}))}}},5477:()=>{},3196:()=>{},8087:()=>{},4854:()=>{},6602:()=>{},2558:(t,e,r)=>{"use strict";r.d(e,{O:()=>_,Z:()=>E});var i=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,s=Math.floor,o="[BigNumber Error] ",a=o+"Number primitive has more than 15 significant digits: ",c=1e14,u=14,h=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],l=1e7,d=1e9;function p(t){var e=0|t;return t>0||t===e?e:e-1}function b(t){for(var e,r,i=1,n=t.length,s=t[0]+"";i<n;){for(e=t[i++]+"",r=u-e.length;r--;e="0"+e);s+=e}for(n=s.length;48===s.charCodeAt(--n););return s.slice(0,n+1||1)}function g(t,e){var r,i,n=t.c,s=e.c,o=t.s,a=e.s,c=t.e,u=e.e;if(!o||!a)return null;if(r=n&&!n[0],i=s&&!s[0],r||i)return r?i?0:-a:o;if(o!=a)return o;if(r=o<0,i=c==u,!n||!s)return i?0:!n^r?1:-1;if(!i)return c>u^r?1:-1;for(a=(c=n.length)<(u=s.length)?c:u,o=0;o<a;o++)if(n[o]!=s[o])return n[o]>s[o]^r?1:-1;return c==u?0:c>u^r?1:-1}function m(t,e,r,i){if(t<e||t>r||t!==s(t))throw Error(o+(i||"Argument")+("number"==typeof t?t<e||t>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function v(t){var e=t.c.length-1;return p(t.e/u)==e&&t.c[e]%2!=0}function y(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function w(t,e,r){var i,n;if(e<0){for(n=r+".";++e;n+=r);t=n+t}else if(++e>(i=t.length)){for(n=r,e-=i;--e;n+=r);t+=n}else e<i&&(t=t.slice(0,e)+"."+t.slice(e));return t}var _=function t(e){var r,_,E,S,A,O,T,x,P,R,I=G.prototype={constructor:G,toString:null,valueOf:null},N=new G(1),M=20,k=4,L=-7,C=21,B=-1e7,D=1e7,U=!1,j=1,K=0,V={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz",H=!0;function G(t,e){var r,n,o,c,f,l,d,p,b=this;if(!(b instanceof G))return new G(t,e);if(null==e){if(t&&!0===t._isBigNumber)return b.s=t.s,void(!t.c||t.e>D?b.c=b.e=null:t.e<B?b.c=[b.e=0]:(b.e=t.e,b.c=t.c.slice()));if((l="number"==typeof t)&&0*t==0){if(b.s=1/t<0?(t=-t,-1):1,t===~~t){for(c=0,f=t;f>=10;f/=10,c++);return void(c>D?b.c=b.e=null:(b.e=c,b.c=[t]))}p=String(t)}else{if(!i.test(p=String(t)))return E(b,p,l);b.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(c=p.indexOf("."))>-1&&(p=p.replace(".","")),(f=p.search(/e/i))>0?(c<0&&(c=f),c+=+p.slice(f+1),p=p.substring(0,f)):c<0&&(c=p.length)}else{if(m(e,2,F.length,"Base"),10==e&&H)return Z(b=new G(t),M+b.e+1,k);if(p=String(t),l="number"==typeof t){if(0*t!=0)return E(b,p,l,e);if(b.s=1/t<0?(p=p.slice(1),-1):1,G.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(a+t)}else b.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(r=F.slice(0,e),c=f=0,d=p.length;f<d;f++)if(r.indexOf(n=p.charAt(f))<0){if("."==n){if(f>c){c=d;continue}}else if(!o&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){o=!0,f=-1,c=0;continue}return E(b,String(t),l,e)}l=!1,(c=(p=_(p,e,10,b.s)).indexOf("."))>-1?p=p.replace(".",""):c=p.length}for(f=0;48===p.charCodeAt(f);f++);for(d=p.length;48===p.charCodeAt(--d););if(p=p.slice(f,++d)){if(d-=f,l&&G.DEBUG&&d>15&&(t>h||t!==s(t)))throw Error(a+b.s*t);if((c=c-f-1)>D)b.c=b.e=null;else if(c<B)b.c=[b.e=0];else{if(b.e=c,b.c=[],f=(c+1)%u,c<0&&(f+=u),f<d){for(f&&b.c.push(+p.slice(0,f)),d-=u;f<d;)b.c.push(+p.slice(f,f+=u));f=u-(p=p.slice(f)).length}else f-=d;for(;f--;p+="0");b.c.push(+p)}}else b.c=[b.e=0]}function $(t,e,r,i){var n,s,o,a,c;if(null==r?r=k:m(r,0,8),!t.c)return t.toString();if(n=t.c[0],o=t.e,null==e)c=b(t.c),c=1==i||2==i&&(o<=L||o>=C)?y(c,o):w(c,o,"0");else if(s=(t=Z(new G(t),e,r)).e,a=(c=b(t.c)).length,1==i||2==i&&(e<=s||s<=L)){for(;a<e;c+="0",a++);c=y(c,s)}else if(e-=o,c=w(c,s,"0"),s+1>a){if(--e>0)for(c+=".";e--;c+="0");}else if((e+=s-a)>0)for(s+1==a&&(c+=".");e--;c+="0");return t.s<0&&n?"-"+c:c}function z(t,e){for(var r,i=1,n=new G(t[0]);i<t.length;i++){if(!(r=new G(t[i])).s){n=r;break}e.call(n,r)&&(n=r)}return n}function q(t,e,r){for(var i=1,n=e.length;!e[--n];e.pop());for(n=e[0];n>=10;n/=10,i++);return(r=i+r*u-1)>D?t.c=t.e=null:r<B?t.c=[t.e=0]:(t.e=r,t.c=e),t}function Z(t,e,r,i){var o,a,h,l,d,p,b,g=t.c,m=f;if(g){t:{for(o=1,l=g[0];l>=10;l/=10,o++);if((a=e-o)<0)a+=u,h=e,b=(d=g[p=0])/m[o-h-1]%10|0;else if((p=n((a+1)/u))>=g.length){if(!i)break t;for(;g.length<=p;g.push(0));d=b=0,o=1,h=(a%=u)-u+1}else{for(d=l=g[p],o=1;l>=10;l/=10,o++);b=(h=(a%=u)-u+o)<0?0:d/m[o-h-1]%10|0}if(i=i||e<0||null!=g[p+1]||(h<0?d:d%m[o-h-1]),i=r<4?(b||i)&&(0==r||r==(t.s<0?3:2)):b>5||5==b&&(4==r||i||6==r&&(a>0?h>0?d/m[o-h]:0:g[p-1])%10&1||r==(t.s<0?8:7)),e<1||!g[0])return g.length=0,i?(e-=t.e+1,g[0]=m[(u-e%u)%u],t.e=-e||0):g[0]=t.e=0,t;if(0==a?(g.length=p,l=1,p--):(g.length=p+1,l=m[u-a],g[p]=h>0?s(d/m[o-h]%m[h])*l:0),i)for(;;){if(0==p){for(a=1,h=g[0];h>=10;h/=10,a++);for(h=g[0]+=l,l=1;h>=10;h/=10,l++);a!=l&&(t.e++,g[0]==c&&(g[0]=1));break}if(g[p]+=l,g[p]!=c)break;g[p--]=0,l=1}for(a=g.length;0===g[--a];g.pop());}t.e>D?t.c=t.e=null:t.e<B&&(t.c=[t.e=0])}return t}function W(t){var e,r=t.e;return null===r?t.toString():(e=b(t.c),e=r<=L||r>=C?y(e,r):w(e,r,"0"),t.s<0?"-"+e:e)}return G.clone=t,G.ROUND_UP=0,G.ROUND_DOWN=1,G.ROUND_CEIL=2,G.ROUND_FLOOR=3,G.ROUND_HALF_UP=4,G.ROUND_HALF_DOWN=5,G.ROUND_HALF_EVEN=6,G.ROUND_HALF_CEIL=7,G.ROUND_HALF_FLOOR=8,G.EUCLID=9,G.config=G.set=function(t){var e,r;if(null!=t){if("object"!=typeof t)throw Error(o+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(m(r=t[e],0,d,e),M=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(m(r=t[e],0,8,e),k=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((r=t[e])&&r.pop?(m(r[0],-d,0,e),m(r[1],0,d,e),L=r[0],C=r[1]):(m(r,-d,d,e),L=-(C=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if((r=t[e])&&r.pop)m(r[0],-d,-1,e),m(r[1],1,d,e),B=r[0],D=r[1];else{if(m(r,-d,d,e),!r)throw Error(o+e+" cannot be zero: "+r);B=-(D=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(o+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(o+"crypto unavailable");U=r}else U=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(m(r=t[e],0,9,e),j=r),t.hasOwnProperty(e="POW_PRECISION")&&(m(r=t[e],0,d,e),K=r),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(r=t[e]))throw Error(o+e+" not an object: "+r);V=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(o+e+" invalid: "+r);H="0123456789"==r.slice(0,10),F=r}}return{DECIMAL_PLACES:M,ROUNDING_MODE:k,EXPONENTIAL_AT:[L,C],RANGE:[B,D],CRYPTO:U,MODULO_MODE:j,POW_PRECISION:K,FORMAT:V,ALPHABET:F}},G.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!G.DEBUG)return!0;var e,r,i=t.c,n=t.e,a=t.s;t:if("[object Array]"=={}.toString.call(i)){if((1===a||-1===a)&&n>=-d&&n<=d&&n===s(n)){if(0===i[0]){if(0===n&&1===i.length)return!0;break t}if((e=(n+1)%u)<1&&(e+=u),String(i[0]).length==e){for(e=0;e<i.length;e++)if((r=i[e])<0||r>=c||r!==s(r))break t;if(0!==r)return!0}}}else if(null===i&&null===n&&(null===a||1===a||-1===a))return!0;throw Error(o+"Invalid BigNumber: "+t)},G.maximum=G.max=function(){return z(arguments,I.lt)},G.minimum=G.min=function(){return z(arguments,I.gt)},G.random=(S=9007199254740992,A=Math.random()*S&2097151?function(){return s(Math.random()*S)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,i,a,c,h=0,l=[],p=new G(N);if(null==t?t=M:m(t,0,d),a=n(t/u),U)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(a*=2));h<a;)(c=131072*e[h]+(e[h+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),e[h]=r[0],e[h+1]=r[1]):(l.push(c%1e14),h+=2);h=a/2}else{if(!crypto.randomBytes)throw U=!1,Error(o+"crypto unavailable");for(e=crypto.randomBytes(a*=7);h<a;)(c=281474976710656*(31&e[h])+1099511627776*e[h+1]+4294967296*e[h+2]+16777216*e[h+3]+(e[h+4]<<16)+(e[h+5]<<8)+e[h+6])>=9e15?crypto.randomBytes(7).copy(e,h):(l.push(c%1e14),h+=7);h=a/7}if(!U)for(;h<a;)(c=A())<9e15&&(l[h++]=c%1e14);for(a=l[--h],t%=u,a&&t&&(c=f[u-t],l[h]=s(a/c)*c);0===l[h];l.pop(),h--);if(h<0)l=[i=0];else{for(i=-1;0===l[0];l.splice(0,1),i-=u);for(h=1,c=l[0];c>=10;c/=10,h++);h<u&&(i-=u-h)}return p.e=i,p.c=l,p}),G.sum=function(){for(var t=1,e=arguments,r=new G(e[0]);t<e.length;)r=r.plus(e[t++]);return r},_=function(){var t="0123456789";function e(t,e,r,i){for(var n,s,o=[0],a=0,c=t.length;a<c;){for(s=o.length;s--;o[s]*=e);for(o[0]+=i.indexOf(t.charAt(a++)),n=0;n<o.length;n++)o[n]>r-1&&(null==o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}return function(i,n,s,o,a){var c,u,h,f,l,d,p,g,m=i.indexOf("."),v=M,y=k;for(m>=0&&(f=K,K=0,i=i.replace(".",""),d=(g=new G(n)).pow(i.length-m),K=f,g.c=e(w(b(d.c),d.e,"0"),10,s,t),g.e=g.c.length),h=f=(p=e(i,n,s,a?(c=F,t):(c=t,F))).length;0==p[--f];p.pop());if(!p[0])return c.charAt(0);if(m<0?--h:(d.c=p,d.e=h,d.s=o,p=(d=r(d,g,v,y,s)).c,l=d.r,h=d.e),m=p[u=h+v+1],f=s/2,l=l||u<0||null!=p[u+1],l=y<4?(null!=m||l)&&(0==y||y==(d.s<0?3:2)):m>f||m==f&&(4==y||l||6==y&&1&p[u-1]||y==(d.s<0?8:7)),u<1||!p[0])i=l?w(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(p.length=u,l)for(--s;++p[--u]>s;)p[u]=0,u||(++h,p=[1].concat(p));for(f=p.length;!p[--f];);for(m=0,i="";m<=f;i+=c.charAt(p[m++]));i=w(i,h,c.charAt(0))}return i}}(),r=function(){function t(t,e,r){var i,n,s,o,a=0,c=t.length,u=e%l,h=e/l|0;for(t=t.slice();c--;)a=((n=u*(s=t[c]%l)+(i=h*s+(o=t[c]/l|0)*u)%l*l+a)/r|0)+(i/l|0)+h*o,t[c]=n%r;return a&&(t=[a].concat(t)),t}function e(t,e,r,i){var n,s;if(r!=i)s=r>i?1:-1;else for(n=s=0;n<r;n++)if(t[n]!=e[n]){s=t[n]>e[n]?1:-1;break}return s}function r(t,e,r,i){for(var n=0;r--;)t[r]-=n,n=t[r]<e[r]?1:0,t[r]=n*i+t[r]-e[r];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(i,n,o,a,h){var f,l,d,b,g,m,v,y,w,_,E,S,A,O,T,x,P,R=i.s==n.s?1:-1,I=i.c,N=n.c;if(!(I&&I[0]&&N&&N[0]))return new G(i.s&&n.s&&(I?!N||I[0]!=N[0]:N)?I&&0==I[0]||!N?0*R:R/0:NaN);for(w=(y=new G(R)).c=[],R=o+(l=i.e-n.e)+1,h||(h=c,l=p(i.e/u)-p(n.e/u),R=R/u|0),d=0;N[d]==(I[d]||0);d++);if(N[d]>(I[d]||0)&&l--,R<0)w.push(1),b=!0;else{for(O=I.length,x=N.length,d=0,R+=2,(g=s(h/(N[0]+1)))>1&&(N=t(N,g,h),I=t(I,g,h),x=N.length,O=I.length),A=x,E=(_=I.slice(0,x)).length;E<x;_[E++]=0);P=N.slice(),P=[0].concat(P),T=N[0],N[1]>=h/2&&T++;do{if(g=0,(f=e(N,_,x,E))<0){if(S=_[0],x!=E&&(S=S*h+(_[1]||0)),(g=s(S/T))>1)for(g>=h&&(g=h-1),v=(m=t(N,g,h)).length,E=_.length;1==e(m,_,v,E);)g--,r(m,x<v?P:N,v,h),v=m.length,f=1;else 0==g&&(f=g=1),v=(m=N.slice()).length;if(v<E&&(m=[0].concat(m)),r(_,m,E,h),E=_.length,-1==f)for(;e(N,_,x,E)<1;)g++,r(_,x<E?P:N,E,h),E=_.length}else 0===f&&(g++,_=[0]);w[d++]=g,_[0]?_[E++]=I[A]||0:(_=[I[A]],E=1)}while((A++<O||null!=_[0])&&R--);b=null!=_[0],w[0]||w.splice(0,1)}if(h==c){for(d=1,R=w[0];R>=10;R/=10,d++);Z(y,o+(y.e=d+l*u-1)+1,a,b)}else y.e=l,y.r=+b;return y}}(),O=/^(-?)0([xbo])(?=\w[\w.]*$)/i,T=/^([^.]+)\.$/,x=/^\.([^.]+)$/,P=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g,E=function(t,e,r,i){var n,s=r?e:e.replace(R,"");if(P.test(s))t.s=isNaN(s)?null:s<0?-1:1;else{if(!r&&(s=s.replace(O,(function(t,e,r){return n="x"==(r=r.toLowerCase())?16:"b"==r?2:8,i&&i!=n?t:e})),i&&(n=i,s=s.replace(T,"$1").replace(x,"0.$1")),e!=s))return new G(s,n);if(G.DEBUG)throw Error(o+"Not a"+(i?" base "+i:"")+" number: "+e);t.s=null}t.c=t.e=null},I.absoluteValue=I.abs=function(){var t=new G(this);return t.s<0&&(t.s=1),t},I.comparedTo=function(t,e){return g(this,new G(t,e))},I.decimalPlaces=I.dp=function(t,e){var r,i,n,s=this;if(null!=t)return m(t,0,d),null==e?e=k:m(e,0,8),Z(new G(s),t+s.e+1,e);if(!(r=s.c))return null;if(i=((n=r.length-1)-p(this.e/u))*u,n=r[n])for(;n%10==0;n/=10,i--);return i<0&&(i=0),i},I.dividedBy=I.div=function(t,e){return r(this,new G(t,e),M,k)},I.dividedToIntegerBy=I.idiv=function(t,e){return r(this,new G(t,e),0,1)},I.exponentiatedBy=I.pow=function(t,e){var r,i,a,c,h,f,l,d,p=this;if((t=new G(t)).c&&!t.isInteger())throw Error(o+"Exponent not an integer: "+W(t));if(null!=e&&(e=new G(e)),h=t.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!t.c||!t.c[0])return d=new G(Math.pow(+W(p),h?2-v(t):+W(t))),e?d.mod(e):d;if(f=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new G(NaN);(i=!f&&p.isInteger()&&e.isInteger())&&(p=p.mod(e))}else{if(t.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||h&&p.c[1]>=24e7:p.c[0]<8e13||h&&p.c[0]<=9999975e7)))return c=p.s<0&&v(t)?-0:0,p.e>-1&&(c=1/c),new G(f?1/c:c);K&&(c=n(K/u+2))}for(h?(r=new G(.5),f&&(t.s=1),l=v(t)):l=(a=Math.abs(+W(t)))%2,d=new G(N);;){if(l){if(!(d=d.times(p)).c)break;c?d.c.length>c&&(d.c.length=c):i&&(d=d.mod(e))}if(a){if(0===(a=s(a/2)))break;l=a%2}else if(Z(t=t.times(r),t.e+1,1),t.e>14)l=v(t);else{if(0===(a=+W(t)))break;l=a%2}p=p.times(p),c?p.c&&p.c.length>c&&(p.c.length=c):i&&(p=p.mod(e))}return i?d:(f&&(d=N.div(d)),e?d.mod(e):c?Z(d,K,k,undefined):d)},I.integerValue=function(t){var e=new G(this);return null==t?t=k:m(t,0,8),Z(e,e.e+1,t)},I.isEqualTo=I.eq=function(t,e){return 0===g(this,new G(t,e))},I.isFinite=function(){return!!this.c},I.isGreaterThan=I.gt=function(t,e){return g(this,new G(t,e))>0},I.isGreaterThanOrEqualTo=I.gte=function(t,e){return 1===(e=g(this,new G(t,e)))||0===e},I.isInteger=function(){return!!this.c&&p(this.e/u)>this.c.length-2},I.isLessThan=I.lt=function(t,e){return g(this,new G(t,e))<0},I.isLessThanOrEqualTo=I.lte=function(t,e){return-1===(e=g(this,new G(t,e)))||0===e},I.isNaN=function(){return!this.s},I.isNegative=function(){return this.s<0},I.isPositive=function(){return this.s>0},I.isZero=function(){return!!this.c&&0==this.c[0]},I.minus=function(t,e){var r,i,n,s,o=this,a=o.s;if(e=(t=new G(t,e)).s,!a||!e)return new G(NaN);if(a!=e)return t.s=-e,o.plus(t);var h=o.e/u,f=t.e/u,l=o.c,d=t.c;if(!h||!f){if(!l||!d)return l?(t.s=-e,t):new G(d?o:NaN);if(!l[0]||!d[0])return d[0]?(t.s=-e,t):new G(l[0]?o:3==k?-0:0)}if(h=p(h),f=p(f),l=l.slice(),a=h-f){for((s=a<0)?(a=-a,n=l):(f=h,n=d),n.reverse(),e=a;e--;n.push(0));n.reverse()}else for(i=(s=(a=l.length)<(e=d.length))?a:e,a=e=0;e<i;e++)if(l[e]!=d[e]){s=l[e]<d[e];break}if(s&&(n=l,l=d,d=n,t.s=-t.s),(e=(i=d.length)-(r=l.length))>0)for(;e--;l[r++]=0);for(e=c-1;i>a;){if(l[--i]<d[i]){for(r=i;r&&!l[--r];l[r]=e);--l[r],l[i]+=c}l[i]-=d[i]}for(;0==l[0];l.splice(0,1),--f);return l[0]?q(t,l,f):(t.s=3==k?-1:1,t.c=[t.e=0],t)},I.modulo=I.mod=function(t,e){var i,n,s=this;return t=new G(t,e),!s.c||!t.s||t.c&&!t.c[0]?new G(NaN):!t.c||s.c&&!s.c[0]?new G(s):(9==j?(n=t.s,t.s=1,i=r(s,t,0,3),t.s=n,i.s*=n):i=r(s,t,0,j),(t=s.minus(i.times(t))).c[0]||1!=j||(t.s=s.s),t)},I.multipliedBy=I.times=function(t,e){var r,i,n,s,o,a,h,f,d,b,g,m,v,y,w,_=this,E=_.c,S=(t=new G(t,e)).c;if(!(E&&S&&E[0]&&S[0]))return!_.s||!t.s||E&&!E[0]&&!S||S&&!S[0]&&!E?t.c=t.e=t.s=null:(t.s*=_.s,E&&S?(t.c=[0],t.e=0):t.c=t.e=null),t;for(i=p(_.e/u)+p(t.e/u),t.s*=_.s,(h=E.length)<(b=S.length)&&(v=E,E=S,S=v,n=h,h=b,b=n),n=h+b,v=[];n--;v.push(0));for(y=c,w=l,n=b;--n>=0;){for(r=0,g=S[n]%w,m=S[n]/w|0,s=n+(o=h);s>n;)r=((f=g*(f=E[--o]%w)+(a=m*f+(d=E[o]/w|0)*g)%w*w+v[s]+r)/y|0)+(a/w|0)+m*d,v[s--]=f%y;v[s]=r}return r?++i:v.splice(0,1),q(t,v,i)},I.negated=function(){var t=new G(this);return t.s=-t.s||null,t},I.plus=function(t,e){var r,i=this,n=i.s;if(e=(t=new G(t,e)).s,!n||!e)return new G(NaN);if(n!=e)return t.s=-e,i.minus(t);var s=i.e/u,o=t.e/u,a=i.c,h=t.c;if(!s||!o){if(!a||!h)return new G(n/0);if(!a[0]||!h[0])return h[0]?t:new G(a[0]?i:0*n)}if(s=p(s),o=p(o),a=a.slice(),n=s-o){for(n>0?(o=s,r=h):(n=-n,r=a),r.reverse();n--;r.push(0));r.reverse()}for((n=a.length)-(e=h.length)<0&&(r=h,h=a,a=r,e=n),n=0;e;)n=(a[--e]=a[e]+h[e]+n)/c|0,a[e]=c===a[e]?0:a[e]%c;return n&&(a=[n].concat(a),++o),q(t,a,o)},I.precision=I.sd=function(t,e){var r,i,n,s=this;if(null!=t&&t!==!!t)return m(t,1,d),null==e?e=k:m(e,0,8),Z(new G(s),t,e);if(!(r=s.c))return null;if(i=(n=r.length-1)*u+1,n=r[n]){for(;n%10==0;n/=10,i--);for(n=r[0];n>=10;n/=10,i++);}return t&&s.e+1>i&&(i=s.e+1),i},I.shiftedBy=function(t){return m(t,-9007199254740991,h),this.times("1e"+t)},I.squareRoot=I.sqrt=function(){var t,e,i,n,s,o=this,a=o.c,c=o.s,u=o.e,h=M+4,f=new G("0.5");if(1!==c||!a||!a[0])return new G(!c||c<0&&(!a||a[0])?NaN:a?o:1/0);if(0==(c=Math.sqrt(+W(o)))||c==1/0?(((e=b(a)).length+u)%2==0&&(e+="0"),c=Math.sqrt(+e),u=p((u+1)/2)-(u<0||u%2),i=new G(e=c==1/0?"5e"+u:(e=c.toExponential()).slice(0,e.indexOf("e")+1)+u)):i=new G(c+""),i.c[0])for((c=(u=i.e)+h)<3&&(c=0);;)if(s=i,i=f.times(s.plus(r(o,s,h,1))),b(s.c).slice(0,c)===(e=b(i.c)).slice(0,c)){if(i.e<u&&--c,"9999"!=(e=e.slice(c-3,c+1))&&(n||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(Z(i,i.e+M+2,1),t=!i.times(i).eq(o));break}if(!n&&(Z(s,s.e+M+2,0),s.times(s).eq(o))){i=s;break}h+=4,c+=4,n=1}return Z(i,i.e+M+1,k,t)},I.toExponential=function(t,e){return null!=t&&(m(t,0,d),t++),$(this,t,e,1)},I.toFixed=function(t,e){return null!=t&&(m(t,0,d),t=t+this.e+1),$(this,t,e)},I.toFormat=function(t,e,r){var i,n=this;if(null==r)null!=t&&e&&"object"==typeof e?(r=e,e=null):t&&"object"==typeof t?(r=t,t=e=null):r=V;else if("object"!=typeof r)throw Error(o+"Argument not an object: "+r);if(i=n.toFixed(t,e),n.c){var s,a=i.split("."),c=+r.groupSize,u=+r.secondaryGroupSize,h=r.groupSeparator||"",f=a[0],l=a[1],d=n.s<0,p=d?f.slice(1):f,b=p.length;if(u&&(s=c,c=u,u=s,b-=s),c>0&&b>0){for(s=b%c||c,f=p.substr(0,s);s<b;s+=c)f+=h+p.substr(s,c);u>0&&(f+=h+p.slice(s)),d&&(f="-"+f)}i=l?f+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?l.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):l):f}return(r.prefix||"")+i+(r.suffix||"")},I.toFraction=function(t){var e,i,n,s,a,c,h,l,d,p,g,m,v=this,y=v.c;if(null!=t&&(!(h=new G(t)).isInteger()&&(h.c||1!==h.s)||h.lt(N)))throw Error(o+"Argument "+(h.isInteger()?"out of range: ":"not an integer: ")+W(h));if(!y)return new G(v);for(e=new G(N),d=i=new G(N),n=l=new G(N),m=b(y),a=e.e=m.length-v.e-1,e.c[0]=f[(c=a%u)<0?u+c:c],t=!t||h.comparedTo(e)>0?a>0?e:d:h,c=D,D=1/0,h=new G(m),l.c[0]=0;p=r(h,e,0,1),1!=(s=i.plus(p.times(n))).comparedTo(t);)i=n,n=s,d=l.plus(p.times(s=d)),l=s,e=h.minus(p.times(s=e)),h=s;return s=r(t.minus(i),n,0,1),l=l.plus(s.times(d)),i=i.plus(s.times(n)),l.s=d.s=v.s,g=r(d,n,a*=2,k).minus(v).abs().comparedTo(r(l,i,a,k).minus(v).abs())<1?[d,n]:[l,i],D=c,g},I.toNumber=function(){return+W(this)},I.toPrecision=function(t,e){return null!=t&&m(t,1,d),$(this,t,e,2)},I.toString=function(t){var e,r=this,i=r.s,n=r.e;return null===n?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(null==t?e=n<=L||n>=C?y(b(r.c),n):w(b(r.c),n,"0"):10===t&&H?e=w(b((r=Z(new G(r),M+n+1,k)).c),r.e,"0"):(m(t,2,F.length,"Base"),e=_(w(b(r.c),n,"0"),10,t,i,!0)),i<0&&r.c[0]&&(e="-"+e)),e},I.valueOf=I.toJSON=function(){return W(this)},I._isBigNumber=!0,I[Symbol.toStringTag]="BigNumber",I[Symbol.for("nodejs.util.inspect.custom")]=I.valueOf,null!=e&&G.set(e),G}();const E=_},763:t=>{"use strict";t.exports={i8:"6.5.4"}}},i={};function n(t){var e=i[t];if(void 0!==e)return e.exports;var s=i[t]={id:t,loaded:!1,exports:{}};return r[t].call(s.exports,s,s.exports,n),s.loaded=!0,s.exports}return n.m=r,n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.f={},n.e=t=>Promise.all(Object.keys(n.f).reduce(((e,r)=>(n.f[r](t,e),e)),[])),n.u=t=>"dist/"+t+".taquito.min.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="taquito:",n.l=(r,i,s,o)=>{if(t[r])t[r].push(i);else{var a,c;if(void 0!==s)for(var u=document.getElementsByTagName("script"),h=0;h<u.length;h++){var f=u[h];if(f.getAttribute("src")==r||f.getAttribute("data-webpack")==e+s){a=f;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,n.nc&&a.setAttribute("nonce",n.nc),a.setAttribute("data-webpack",e+s),a.src=r,0!==a.src.indexOf(window.location.origin+"/")&&(a.crossOrigin="anonymous"),a.integrity=n.sriHashes[s.match(/^chunk-(.+)$/)[1]],a.crossOrigin="anonymous"),t[r]=[i];var l=(e,i)=>{a.onerror=a.onload=null,clearTimeout(d);var n=t[r];if(delete t[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((t=>t(i))),e)return e(i)},d=setTimeout(l.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=l.bind(null,a.onerror),a.onload=l.bind(null,a.onload),c&&document.head.appendChild(a)}},n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");r.length&&(t=r[r.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t+"../"})(),n.sriHashes={462:"sha384-UvtzH4LwwNxGc/Jb4FV5cZhAVvXuKcpf8RjLC02oG9slpnoBi5tBQ4duxpGSPaLb"},(()=>{var t={179:0};n.f.j=(e,r)=>{var i=n.o(t,e)?t[e]:void 0;if(0!==i)if(i)r.push(i[2]);else{var s=new Promise(((r,n)=>i=t[e]=[r,n]));r.push(i[2]=s);var o=n.p+n.u(e),a=new Error;n.l(o,(r=>{if(n.o(t,e)&&(0!==(i=t[e])&&(t[e]=void 0),i)){var s=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;a.message="Loading chunk "+e+" failed.\n("+s+": "+o+")",a.name="ChunkLoadError",a.type=s,a.request=o,i[1](a)}}),"chunk-"+e,e)}};var e=(e,r)=>{var i,s,[o,a,c]=r,u=0;if(o.some((e=>0!==t[e]))){for(i in a)n.o(a,i)&&(n.m[i]=a[i]);if(c)c(n)}for(e&&e(r);u<o.length;u++)s=o[u],n.o(t,s)&&t[s]&&t[s][0](),t[s]=0},r=self.webpackChunktaquito=self.webpackChunktaquito||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})(),n(2353)})()));