/*! For license information please see merkleTreeWorker.umd.min.js.LICENSE.txt */ globalThis.process={browser:!0,env:{}},function(e,a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var c=a();for(var f in c)("object"==typeof exports?exports:e)[f]=c[f]}}(self,(()=>(()=>{var __webpack_modules__={8176:(e,a,c)=>{const f=c(6613);a.cidForWeb=e=>{let a=new f(e);0===a.version&&(a=a.toV1());let c=a.toString("base32");if(c.length>63){const e=a.toString("base36");if(e.length<=63)return e;throw new TypeError("CID is longer than DNS limit of 63 characters and is not compatible with public gateways")}return c},a.cidV0ToV1Base32=e=>{let a=new f(e);return 0===a.version&&(a=a.toV1()),a.toString("base32")}},1810:(e,a,c)=>{const f=c(2021),d=c(4243),{hexStringToBuffer:b,profiles:t}=c(5262),{cidForWeb:i,cidV0ToV1Base32:r}=c(8176);e.exports={helpers:{cidForWeb:i,cidV0ToV1Base32:r},decode:function(e){const a=b(e),c=f.getCodec(a),d=f.rmPrefix(a);let i=t[c];return i||(i=t.default),i.decode(d)},fromIpfs:function(e){return this.encode("ipfs-ns",e)},fromSkylink:function(e){return this.encode("skynet-ns",e)},fromSwarm:function(e){return this.encode("swarm-ns",e)},fromArweave:function(e){return this.encode("arweave-ns",e)},encode:function(e,a){let c=t[e];c||(c=t.default);const b=c.encode(a);return d.toHexString(f.addPrefix(e,b))},getCodec:function(e){let a=b(e);return f.getCodec(a)}}},5262:(e,a,c)=>{var f=c(2045).hp;const d=c(6613),b=c(4243),t=c(8127),i=e=>{let a=e.slice(0,2),c=e.slice(2),f="";return f="0x"===a?c:e,b.fromHexString(f)},r=e=>{try{const{multihash:a}=e;if(a.length<38){const e=b.decode(a);if("identity"===e.name&&e.length<36)return!1}return!0}catch(e){return!1}},n={skynet:e=>t.toUint8Array(e),swarm:e=>{const a=b.encode(i(e),"keccak-256");return new d(1,"swarm-manifest",a).bytes},ipfs:e=>new d(e).toV1().bytes,ipns:e=>{const a=new d(e);if(!r(a))throw Error("ipns-ns allows only valid cryptographic libp2p-key identifiers, try using ED25519 pubkey instead");return new d(1,"libp2p-key",a.multihash).bytes},utf8:e=>f.from(e,"utf8"),arweave:e=>t.toUint8Array(e)},o={hexMultiHash:e=>{const a=new d(e);return b.decode(a.multihash).digest.toString("hex")},ipfs:e=>{const a=new d(e).toV1();return a.toString("libp2p-key"===a.codec?"base36":"base32")},ipns:e=>{const a=new d(e).toV1();return r(a)?a.toString("base36"):(console.warn("[ensdomains/content-hash] use of non-cryptographic identifiers in ipns-ns is deprecated and will be removed, migrate to ED25519 libp2p-key"),String(b.decode(new d(e).multihash).digest))},utf8:e=>e.toString("utf8"),base64:e=>t.fromUint8Array(e,!0)},s={"skynet-ns":{encode:n.skynet,decode:o.base64},"swarm-ns":{encode:n.swarm,decode:o.hexMultiHash},"ipfs-ns":{encode:n.ipfs,decode:o.ipfs},"ipns-ns":{encode:n.ipns,decode:o.ipns},"arweave-ns":{encode:n.arweave,decode:o.base64},default:{encode:n.utf8,decode:o.utf8}};a.hexStringToBuffer=i,a.profiles=s},5084:e=>{"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var a=new Uint8Array(256),c=0;c>>0,n=new Uint8Array(b);e[c];){var o=a[e.charCodeAt(c)];if(255===o)return;for(var s=0,l=b-1;(0!==o||s>>0,n[l]=o%256>>>0,o=o/256>>>0;if(0!==o)throw new Error("Non-zero carry");d=s,c++}if(" "!==e[c]){for(var h=b-d;h!==b&&0===n[h];)h++;for(var u=new Uint8Array(f+(b-h)),x=f;h!==b;)u[x++]=n[h++];return u}}}return{encode:function(a){if(a instanceof Uint8Array||(ArrayBuffer.isView(a)?a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength):Array.isArray(a)&&(a=Uint8Array.from(a))),!(a instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===a.length)return"";for(var c=0,f=0,d=0,b=a.length;d!==b&&0===a[d];)d++,c++;for(var r=(b-d)*n+1>>>0,o=new Uint8Array(r);d!==b;){for(var s=a[d],l=0,h=r-1;(0!==s||l>>0,o[h]=s%t>>>0,s=s/t>>>0;if(0!==s)throw new Error("Non-zero carry");f=l,d++}for(var u=r-f;u!==r&&0===o[u];)u++;for(var x=i.repeat(c);u{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.BaseTree=void 0,a.BaseTree=class{get capacity(){return 2**this.levels}get layers(){return this._layers.slice()}get zeros(){return this._zeros.slice()}get elements(){return this._layers[0].slice()}get root(){var e;return null!==(e=this._layers[this.levels][0])&&void 0!==e?e:this._zeros[this.levels]}static indexOf(e,a,c,f){return f?e.findIndex((e=>f(a,e))):e.indexOf(a,c)}insert(e){if(this._layers[0].length>=this.capacity)throw new Error("Tree is full");this.update(this._layers[0].length,e)}bulkInsert(e){if(e.length){if(this._layers[0].length+e.length>this.capacity)throw new Error("Tree is full");for(let a=0;a>=1;const e=this._layers[c-1][2*f],a=this._layers[c-1][2*f+1];this._layers[c][f]=this._hashFn(e,a)}}this.insert(e[e.length-1])}}update(e,a){if(isNaN(Number(e))||e<0||e>this._layers[0].length||e>=this.capacity)throw new Error("Insert index out of bounds: "+e);this._layers[0][e]=a,this._processUpdate(e)}path(e){if(isNaN(Number(e))||e<0||e>=this._layers[0].length)throw new Error("Index out of bounds: "+e);let a=+e;const c=[],f=[],d=[];for(let e=0;e>=1}return{pathElements:c,pathIndices:f,pathPositions:d,pathRoot:this.root}}_buildZeros(){this._zeros=[this.zeroElement];for(let e=1;e<=this.levels;e++)this._zeros[e]=this._hashFn(this._zeros[e-1],this._zeros[e-1])}_processNodes(e,a){const c=e.length;let f=Math.ceil(c/2);const d=new Array(f);f--;const b=c-(c%2^1);let t=0;for(let i=b;i>=0&&void 0!==e[i-1];i-=2){const r=e[i-1],n=i===b&&c%2==1?this._zeros[a-1]:e[i];d[f-t]=this._hashFn(r,n),t++}return d}_processUpdate(e){for(let a=1;a<=this.levels;a++){e>>=1;const c=this._layers[a-1][2*e],f=2*e+1this.capacity)throw new Error("Tree is full");this._hashFn=c,this.zeroElement=f,this._layers=[];const b=a.slice();this._layers=[b],this._buildZeros(),this._buildHashes()}_buildHashes(){for(let e=1;e<=this.levels;e++){const a=this._layers[e-1];this._layers[e]=this._processNodes(a,e)}}bulkInsert(e){if(e.length){if(this._layers[0].length+e.length>this.capacity)throw new Error("Tree is full");for(let a=0;a>=1,this._layers[c][f]=this._hashFn(this._layers[c-1][2*f],this._layers[c-1][2*f+1])}this.insert(e[e.length-1])}}indexOf(e,a){return b.BaseTree.indexOf(this._layers[0],e,0,a)}proof(e){const a=this.indexOf(e);return this.path(a)}getTreeEdge(e){const a=this._layers[0][e];if(void 0===a)throw new Error("Element not found");return{edgePath:this.path(e),edgeElement:a,edgeIndex:e,edgeElementsCount:this._layers[0].length}}getTreeSlices(e=4){const a=this._layers[0].length;let c=Math.ceil(a/e);c%2&&c++;const f=[];for(let e=0;e(e.set(c,[a,this.edgeLeafProof.pathElements[c]]),e)),new Map),this._proofMap.set(this.levels,[0,this.edgeLeafProof.pathRoot])}_buildTree(){const e=this._edgeLeaf.index;if(this._leaves=Array(e).concat(this._leavesAfterEdge),this._proofMap.has(0)){const[e,a]=this._proofMap.get(0);this._leaves[e]=a}this._layers=[this._leaves],this._buildZeros(),this._buildHashes()}_buildHashes(){for(let e=1;e<=this.levels;e++){const a=this._layers[e-1],c=this._processNodes(a,e);if(this._proofMap.has(e)){const[a,f]=this._proofMap.get(e);c[a]||(c[a]=f)}this._layers[e]=c}}update(e,a){if(isNaN(Number(e))||e<0||e>this._layers[0].length||e>=this.capacity)throw new Error("Insert index out of bounds: "+e);if(e=this._layers[0].length)throw new Error("Index out of bounds: "+e);if(e>=1}return{pathElements:f,pathIndices:d,pathPositions:b,pathRoot:this.root}}indexOf(e,a){return b.BaseTree.indexOf(this._layers[0],e,this.edgeIndex,a)}proof(e){const a=this.indexOf(e);return this.path(a)}shiftEdge(e,a){if(this._edgeLeaf.index<=e.edgeIndex)throw new Error(`New edgeIndex should be smaller then ${this._edgeLeaf.index}`);if(a.length!==this._edgeLeaf.index-e.edgeIndex)throw new Error("Elements length should be "+(this._edgeLeaf.index-e.edgeIndex));this._edgeLeafProof=e.edgePath,this._edgeLeaf={index:e.edgeIndex,data:e.edgeElement},this._leavesAfterEdge=[...a,...this._leavesAfterEdge],this._createProofMap(),this._buildTree()}serialize(){return{_edgeLeafProof:this._edgeLeafProof,_edgeLeaf:this._edgeLeaf,_layers:this._layers,_zeros:this._zeros,levels:this.levels}}static deserialize(e,a){const c=Object.assign(Object.create(this.prototype),e);return c._hashFn=a||d.default,c._initialRoot=e._edgeLeafProof.pathRoot,c.zeroElement=c._zeros[0],c._leavesAfterEdge=c._layers[0].slice(e._edgeLeaf.index),c._createProofMap(),c}toString(){return JSON.stringify(this.serialize())}}a.PartialMerkleTree=t},1217:function(e,a,c){"use strict";var f=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.MerkleTree=a.simpleHash=a.PartialMerkleTree=void 0;const d=f(c(9093));Object.defineProperty(a,"MerkleTree",{enumerable:!0,get:function(){return d.default}});var b=c(1230);Object.defineProperty(a,"PartialMerkleTree",{enumerable:!0,get:function(){return b.PartialMerkleTree}});var t=c(5319);Object.defineProperty(a,"simpleHash",{enumerable:!0,get:function(){return t.simpleHash}}),a.default=d.default},5319:(e,a)=>{"use strict";function c(e,a,c=40){const f=e.join("");let d,b,t=null!=a?a:34658180293;for(d=0,b=f.length;d>>0).toString(16);return BigInt("0x"+i.padEnd(c-(i.length-1),"0")).toString(10)}Object.defineProperty(a,"__esModule",{value:!0}),a.simpleHash=void 0,a.simpleHash=c,a.default=(e,a)=>c([e,a])},7568:(e,a,c)=>{var f=a;f.bignum=c(2344),f.define=c(7363).define,f.base=c(9673),f.constants=c(2153),f.decoders=c(2853),f.encoders=c(4669)},7363:(e,a,c)=>{var f=c(7568),d=c(6698);function b(e,a){this.name=e,this.body=a,this.decoders={},this.encoders={}}a.define=function(e,a){return new b(e,a)},b.prototype._createNamed=function(e){var a;try{a=c(8961).runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){a=function(e){this._initNamed(e)}}return d(a,e),a.prototype._initNamed=function(a){e.call(this,a)},new a(this)},b.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(f.decoders[e])),this.decoders[e]},b.prototype.decode=function(e,a,c){return this._getDecoder(a).decode(e,c)},b.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(f.encoders[e])),this.encoders[e]},b.prototype.encode=function(e,a,c){return this._getEncoder(a).encode(e,c)}},7227:(e,a,c)=>{var f=c(6698),d=c(9673).Reporter,b=c(8287).Buffer;function t(e,a){d.call(this,a),b.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function i(e,a){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return e instanceof i||(e=new i(e,a)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return a.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=b.byteLength(e);else{if(!b.isBuffer(e))return a.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}f(t,d),a.t=t,t.prototype.save=function(){return{offset:this.offset,reporter:d.prototype.save.call(this)}},t.prototype.restore=function(e){var a=new t(this.base);return a.offset=e.offset,a.length=this.offset,this.offset=e.offset,d.prototype.restore.call(this,e.reporter),a},t.prototype.isEmpty=function(){return this.offset===this.length},t.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},t.prototype.skip=function(e,a){if(!(this.offset+e<=this.length))return this.error(a||"DecoderBuffer overrun");var c=new t(this.base);return c._reporterState=this._reporterState,c.offset=this.offset,c.length=this.offset+e,this.offset+=e,c},t.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},a.d=i,i.prototype.join=function(e,a){return e||(e=new b(this.length)),a||(a=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(c){c.join(e,a),a+=c.length})):("number"==typeof this.value?e[a]=this.value:"string"==typeof this.value?e.write(this.value,a):b.isBuffer(this.value)&&this.value.copy(e,a),a+=this.length)),e}},9673:(e,a,c)=>{var f=a;f.Reporter=c(9220).a,f.DecoderBuffer=c(7227).t,f.EncoderBuffer=c(7227).d,f.Node=c(993)},993:(e,a,c)=>{var f=c(9673).Reporter,d=c(9673).EncoderBuffer,b=c(9673).DecoderBuffer,t=c(3349),i=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],r=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(i);function n(e,a){var c={};this._baseState=c,c.enc=e,c.parent=a||null,c.children=null,c.tag=null,c.args=null,c.reverseArgs=null,c.choice=null,c.optional=!1,c.any=!1,c.obj=!1,c.use=null,c.useDecoder=null,c.key=null,c.default=null,c.explicit=null,c.implicit=null,c.contains=null,c.parent||(c.children=[],this._wrap())}e.exports=n;var o=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];n.prototype.clone=function(){var e=this._baseState,a={};o.forEach((function(c){a[c]=e[c]}));var c=new this.constructor(a.parent);return c._baseState=a,c},n.prototype._wrap=function(){var e=this._baseState;r.forEach((function(a){this[a]=function(){var c=new this.constructor(this);return e.children.push(c),c[a].apply(c,arguments)}}),this)},n.prototype._init=function(e){var a=this._baseState;t(null===a.parent),e.call(this),a.children=a.children.filter((function(e){return e._baseState.parent===this}),this),t.equal(a.children.length,1,"Root node can have only one child")},n.prototype._useArgs=function(e){var a=this._baseState,c=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==c.length&&(t(null===a.children),a.children=c,c.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(t(null===a.args),a.args=e,a.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;var a={};return Object.keys(e).forEach((function(c){c==(0|c)&&(c|=0);var f=e[c];a[f]=c})),a})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){n.prototype[e]=function(){var a=this._baseState;throw new Error(e+" not implemented for encoding: "+a.enc)}})),i.forEach((function(e){n.prototype[e]=function(){var a=this._baseState,c=Array.prototype.slice.call(arguments);return t(null===a.tag),a.tag=e,this._useArgs(c),this}})),n.prototype.use=function(e){t(e);var a=this._baseState;return t(null===a.use),a.use=e,this},n.prototype.optional=function(){return this._baseState.optional=!0,this},n.prototype.def=function(e){var a=this._baseState;return t(null===a.default),a.default=e,a.optional=!0,this},n.prototype.explicit=function(e){var a=this._baseState;return t(null===a.explicit&&null===a.implicit),a.explicit=e,this},n.prototype.implicit=function(e){var a=this._baseState;return t(null===a.explicit&&null===a.implicit),a.implicit=e,this},n.prototype.obj=function(){var e=this._baseState,a=Array.prototype.slice.call(arguments);return e.obj=!0,0!==a.length&&this._useArgs(a),this},n.prototype.key=function(e){var a=this._baseState;return t(null===a.key),a.key=e,this},n.prototype.any=function(){return this._baseState.any=!0,this},n.prototype.choice=function(e){var a=this._baseState;return t(null===a.choice),a.choice=e,this._useArgs(Object.keys(e).map((function(a){return e[a]}))),this},n.prototype.contains=function(e){var a=this._baseState;return t(null===a.use),a.contains=e,this},n.prototype._decode=function(e,a){var c=this._baseState;if(null===c.parent)return e.wrapResult(c.children[0]._decode(e,a));var f,d=c.default,t=!0,i=null;if(null!==c.key&&(i=e.enterKey(c.key)),c.optional){var r=null;if(null!==c.explicit?r=c.explicit:null!==c.implicit?r=c.implicit:null!==c.tag&&(r=c.tag),null!==r||c.any){if(t=this._peekTag(e,r,c.any),e.isError(t))return t}else{var n=e.save();try{null===c.choice?this._decodeGeneric(c.tag,e,a):this._decodeChoice(e,a),t=!0}catch(e){t=!1}e.restore(n)}}if(c.obj&&t&&(f=e.enterObject()),t){if(null!==c.explicit){var o=this._decodeTag(e,c.explicit);if(e.isError(o))return o;e=o}var s=e.offset;if(null===c.use&&null===c.choice){c.any&&(n=e.save());var l=this._decodeTag(e,null!==c.implicit?c.implicit:c.tag,c.any);if(e.isError(l))return l;c.any?d=e.raw(n):e=l}if(a&&a.track&&null!==c.tag&&a.track(e.path(),s,e.length,"tagged"),a&&a.track&&null!==c.tag&&a.track(e.path(),e.offset,e.length,"content"),c.any||(d=null===c.choice?this._decodeGeneric(c.tag,e,a):this._decodeChoice(e,a)),e.isError(d))return d;if(c.any||null!==c.choice||null===c.children||c.children.forEach((function(c){c._decode(e,a)})),c.contains&&("octstr"===c.tag||"bitstr"===c.tag)){var h=new b(d);d=this._getUse(c.contains,e._reporterState.obj)._decode(h,a)}}return c.obj&&t&&(d=e.leaveObject(f)),null===c.key||null===d&&!0!==t?null!==i&&e.exitKey(i):e.leaveKey(i,c.key,d),d},n.prototype._decodeGeneric=function(e,a,c){var f=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(a,e,f.args[0],c):/str$/.test(e)?this._decodeStr(a,e,c):"objid"===e&&f.args?this._decodeObjid(a,f.args[0],f.args[1],c):"objid"===e?this._decodeObjid(a,null,null,c):"gentime"===e||"utctime"===e?this._decodeTime(a,e,c):"null_"===e?this._decodeNull(a,c):"bool"===e?this._decodeBool(a,c):"objDesc"===e?this._decodeStr(a,e,c):"int"===e||"enum"===e?this._decodeInt(a,f.args&&f.args[0],c):null!==f.use?this._getUse(f.use,a._reporterState.obj)._decode(a,c):a.error("unknown tag: "+e)},n.prototype._getUse=function(e,a){var c=this._baseState;return c.useDecoder=this._use(e,a),t(null===c.useDecoder._baseState.parent),c.useDecoder=c.useDecoder._baseState.children[0],c.implicit!==c.useDecoder._baseState.implicit&&(c.useDecoder=c.useDecoder.clone(),c.useDecoder._baseState.implicit=c.implicit),c.useDecoder},n.prototype._decodeChoice=function(e,a){var c=this._baseState,f=null,d=!1;return Object.keys(c.choice).some((function(b){var t=e.save(),i=c.choice[b];try{var r=i._decode(e,a);if(e.isError(r))return!1;f={type:b,value:r},d=!0}catch(a){return e.restore(t),!1}return!0}),this),d?f:e.error("Choice not matched")},n.prototype._createEncoderBuffer=function(e){return new d(e,this.reporter)},n.prototype._encode=function(e,a,c){var f=this._baseState;if(null===f.default||f.default!==e){var d=this._encodeValue(e,a,c);if(void 0!==d&&!this._skipDefault(d,a,c))return d}},n.prototype._encodeValue=function(e,a,c){var d=this._baseState;if(null===d.parent)return d.children[0]._encode(e,a||new f);var b=null;if(this.reporter=a,d.optional&&void 0===e){if(null===d.default)return;e=d.default}var t=null,i=!1;if(d.any)b=this._createEncoderBuffer(e);else if(d.choice)b=this._encodeChoice(e,a);else if(d.contains)t=this._getUse(d.contains,c)._encode(e,a),i=!0;else if(d.children)t=d.children.map((function(c){if("null_"===c._baseState.tag)return c._encode(null,a,e);if(null===c._baseState.key)return a.error("Child should have a key");var f=a.enterKey(c._baseState.key);if("object"!=typeof e)return a.error("Child expected, but input is not object");var d=c._encode(e[c._baseState.key],a,e);return a.leaveKey(f),d}),this).filter((function(e){return e})),t=this._createEncoderBuffer(t);else if("seqof"===d.tag||"setof"===d.tag){if(!d.args||1!==d.args.length)return a.error("Too many args for : "+d.tag);if(!Array.isArray(e))return a.error("seqof/setof, but data is not Array");var r=this.clone();r._baseState.implicit=null,t=this._createEncoderBuffer(e.map((function(c){var f=this._baseState;return this._getUse(f.args[0],e)._encode(c,a)}),r))}else null!==d.use?b=this._getUse(d.use,c)._encode(e,a):(t=this._encodePrimitive(d.tag,e),i=!0);if(!d.any&&null===d.choice){var n=null!==d.implicit?d.implicit:d.tag,o=null===d.implicit?"universal":"context";null===n?null===d.use&&a.error("Tag could be omitted only for .use()"):null===d.use&&(b=this._encodeComposite(n,i,o,t))}return null!==d.explicit&&(b=this._encodeComposite(d.explicit,!1,"context",b)),b},n.prototype._encodeChoice=function(e,a){var c=this._baseState,f=c.choice[e.type];return f||t(!1,e.type+" not found in "+JSON.stringify(Object.keys(c.choice))),f._encode(e.value,a)},n.prototype._encodePrimitive=function(e,a){var c=this._baseState;if(/str$/.test(e))return this._encodeStr(a,e);if("objid"===e&&c.args)return this._encodeObjid(a,c.reverseArgs[0],c.args[1]);if("objid"===e)return this._encodeObjid(a,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(a,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(a,c.args&&c.reverseArgs[0]);if("bool"===e)return this._encodeBool(a);if("objDesc"===e)return this._encodeStr(a,e);throw new Error("Unsupported tag: "+e)},n.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},n.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},9220:(e,a,c)=>{var f=c(6698);function d(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function b(e,a){this.path=e,this.rethrow(a)}a.a=d,d.prototype.isError=function(e){return e instanceof b},d.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},d.prototype.restore=function(e){var a=this._reporterState;a.obj=e.obj,a.path=a.path.slice(0,e.pathLen)},d.prototype.enterKey=function(e){return this._reporterState.path.push(e)},d.prototype.exitKey=function(e){var a=this._reporterState;a.path=a.path.slice(0,e-1)},d.prototype.leaveKey=function(e,a,c){var f=this._reporterState;this.exitKey(e),null!==f.obj&&(f.obj[a]=c)},d.prototype.path=function(){return this._reporterState.path.join("/")},d.prototype.enterObject=function(){var e=this._reporterState,a=e.obj;return e.obj={},a},d.prototype.leaveObject=function(e){var a=this._reporterState,c=a.obj;return a.obj=e,c},d.prototype.error=function(e){var a,c=this._reporterState,f=e instanceof b;if(a=f?e:new b(c.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!c.options.partial)throw a;return f||c.errors.push(a),a},d.prototype.wrapResult=function(e){var a=this._reporterState;return a.options.partial?{result:this.isError(e)?null:e,errors:a.errors}:e},f(b,Error),b.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,b),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},4598:(e,a,c)=>{var f=c(2153);a.tagClass={0:"universal",1:"application",2:"context",3:"private"},a.tagClassByName=f._reverse(a.tagClass),a.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},a.tagByName=f._reverse(a.tag)},2153:(e,a,c)=>{var f=a;f._reverse=function(e){var a={};return Object.keys(e).forEach((function(c){(0|c)==c&&(c|=0);var f=e[c];a[f]=c})),a},f.der=c(4598)},2010:(e,a,c)=>{var f=c(6698),d=c(7568),b=d.base,t=d.bignum,i=d.constants.der;function r(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new n,this.tree._init(e.body)}function n(e){b.Node.call(this,"der",e)}function o(e,a){var c=e.readUInt8(a);if(e.isError(c))return c;var f=i.tagClass[c>>6],d=!(32&c);if(31&~c)c&=31;else{var b=c;for(c=0;!(128&~b);){if(b=e.readUInt8(a),e.isError(b))return b;c<<=7,c|=127&b}}return{cls:f,primitive:d,tag:c,tagStr:i.tag[c]}}function s(e,a,c){var f=e.readUInt8(c);if(e.isError(f))return f;if(!a&&128===f)return null;if(!(128&f))return f;var d=127&f;if(d>4)return e.error("length octect is too long");f=0;for(var b=0;b{var f=a;f.der=c(2010),f.pem=c(8903)},8903:(e,a,c)=>{var f=c(6698),d=c(8287).Buffer,b=c(2010);function t(e){b.call(this,e),this.enc="pem"}f(t,b),e.exports=t,t.prototype.decode=function(e,a){for(var c=e.toString().split(/[\r\n]+/g),f=a.label.toUpperCase(),t=/^-----(BEGIN|END) ([^-]+)-----$/,i=-1,r=-1,n=0;n{var f=c(6698),d=c(8287).Buffer,b=c(7568),t=b.base,i=b.constants.der;function r(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new n,this.tree._init(e.body)}function n(e){t.Node.call(this,"der",e)}function o(e){return e<10?"0"+e:e}e.exports=r,r.prototype.encode=function(e,a){return this.tree._encode(e,a).join()},f(n,t.Node),n.prototype._encodeComposite=function(e,a,c,f){var b,t=function(e,a,c,f){var d;if("seqof"===e?e="seq":"setof"===e&&(e="set"),i.tagByName.hasOwnProperty(e))d=i.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return f.error("Unknown tag: "+e);d=e}return d>=31?f.error("Multi-octet tag encoding unsupported"):(a||(d|=32),d|=i.tagClassByName[c||"universal"]<<6)}(e,a,c,this.reporter);if(f.length<128)return(b=new d(2))[0]=t,b[1]=f.length,this._createEncoderBuffer([b,f]);for(var r=1,n=f.length;n>=256;n>>=8)r++;(b=new d(2+r))[0]=t,b[1]=128|r,n=1+r;for(var o=f.length;o>0;n--,o>>=8)b[n]=255&o;return this._createEncoderBuffer([b,f])},n.prototype._encodeStr=function(e,a){if("bitstr"===a)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===a){for(var c=new d(2*e.length),f=0;f=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var b=0;for(f=0;f=128;t>>=7)b++}var i=new d(b),r=i.length-1;for(f=e.length-1;f>=0;f--)for(t=e[f],i[r--]=127&t;(t>>=7)>0;)i[r--]=128|127&t;return this._createEncoderBuffer(i)},n.prototype._encodeTime=function(e,a){var c,f=new Date(e);return"gentime"===a?c=[o(f.getFullYear()),o(f.getUTCMonth()+1),o(f.getUTCDate()),o(f.getUTCHours()),o(f.getUTCMinutes()),o(f.getUTCSeconds()),"Z"].join(""):"utctime"===a?c=[o(f.getFullYear()%100),o(f.getUTCMonth()+1),o(f.getUTCDate()),o(f.getUTCHours()),o(f.getUTCMinutes()),o(f.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+a+" time is not supported yet"),this._encodeStr(c,"octstr")},n.prototype._encodeNull=function(){return this._createEncoderBuffer("")},n.prototype._encodeInt=function(e,a){if("string"==typeof e){if(!a)return this.reporter.error("String int or enum given, but no values map");if(!a.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=a[e]}if("number"!=typeof e&&!d.isBuffer(e)){var c=e.toArray();!e.sign&&128&c[0]&&c.unshift(0),e=new d(c)}if(d.isBuffer(e)){var f=e.length;0===e.length&&f++;var b=new d(f);return e.copy(b),0===e.length&&(b[0]=0),this._createEncoderBuffer(b)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);f=1;for(var t=e;t>=256;t>>=8)f++;for(t=(b=new Array(f)).length-1;t>=0;t--)b[t]=255&e,e>>=8;return 128&b[0]&&b.unshift(0),this._createEncoderBuffer(new d(b))},n.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},n.prototype._use=function(e,a){return"function"==typeof e&&(e=e(a)),e._getEncoder("der").tree},n.prototype._skipDefault=function(e,a,c){var f,d=this._baseState;if(null===d.default)return!1;var b=e.join();if(void 0===d.defaultBuffer&&(d.defaultBuffer=this._encodeValue(d.default,a,c).join()),b.length!==d.defaultBuffer.length)return!1;for(f=0;f{var f=a;f.der=c(82),f.pem=c(735)},735:(e,a,c)=>{var f=c(6698),d=c(82);function b(e){d.call(this,e),this.enc="pem"}f(b,d),e.exports=b,b.prototype.encode=function(e,a){for(var c=d.prototype.encode.call(this,e).toString("base64"),f=["-----BEGIN "+a.label+"-----"],b=0;b=65&&c<=70?c-55:c>=97&&c<=102?c-87:c-48&15}function r(e,a,c){var f=i(e,c);return c-1>=a&&(f|=i(e,c-1)<<4),f}function n(e,a,c,f){for(var d=0,b=Math.min(e.length,c),t=a;t=49?i-49+10:i>=17?i-17+10:i}return d}b.isBN=function(e){return e instanceof b||null!==e&&"object"==typeof e&&e.constructor.wordSize===b.wordSize&&Array.isArray(e.words)},b.max=function(e,a){return e.cmp(a)>0?e:a},b.min=function(e,a){return e.cmp(a)<0?e:a},b.prototype._init=function(e,a,c){if("number"==typeof e)return this._initNumber(e,a,c);if("object"==typeof e)return this._initArray(e,a,c);"hex"===a&&(a=16),f(a===(0|a)&&a>=2&&a<=36);var d=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(d++,this.negative=1),d=0;d-=3)t=e[d]|e[d-1]<<8|e[d-2]<<16,this.words[b]|=t<>>26-i&67108863,(i+=24)>=26&&(i-=26,b++);else if("le"===c)for(d=0,b=0;d>>26-i&67108863,(i+=24)>=26&&(i-=26,b++);return this.strip()},b.prototype._parseHex=function(e,a,c){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var f=0;f=a;f-=2)d=r(e,a,f)<=18?(b-=18,t+=1,this.words[t]|=d>>>26):b+=8;else for(f=(e.length-a)%2==0?a+1:a;f=18?(b-=18,t+=1,this.words[t]|=d>>>26):b+=8;this.strip()},b.prototype._parseBase=function(e,a,c){this.words=[0],this.length=1;for(var f=0,d=1;d<=67108863;d*=a)f++;f--,d=d/a|0;for(var b=e.length-c,t=b%f,i=Math.min(b,b-t)+c,r=0,o=c;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},b.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},b.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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 h(e,a,c){c.negative=a.negative^e.negative;var f=e.length+a.length|0;c.length=f,f=f-1|0;var d=0|e.words[0],b=0|a.words[0],t=d*b,i=67108863&t,r=t/67108864|0;c.words[0]=i;for(var n=1;n>>26,s=67108863&r,l=Math.min(n,a.length-1),h=Math.max(0,n-e.length+1);h<=l;h++){var u=n-h|0;o+=(t=(d=0|e.words[u])*(b=0|a.words[h])+s)/67108864|0,s=67108863&t}c.words[n]=0|s,r=0|o}return 0!==r?c.words[n]=0|r:c.length--,c.strip()}b.prototype.toString=function(e,a){var c;if(a=0|a||1,16===(e=e||10)||"hex"===e){c="";for(var d=0,b=0,t=0;t>>24-d&16777215)||t!==this.length-1?o[6-r.length]+r+c:r+c,(d+=2)>=26&&(d-=26,t--)}for(0!==b&&(c=b.toString(16)+c);c.length%a!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(e===(0|e)&&e>=2&&e<=36){var n=s[e],h=l[e];c="";var u=this.clone();for(u.negative=0;!u.isZero();){var x=u.modn(h).toString(e);c=(u=u.idivn(h)).isZero()?x+c:o[n-x.length]+x+c}for(this.isZero()&&(c="0"+c);c.length%a!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}f(!1,"Base should be between 2 and 36")},b.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&f(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},b.prototype.toJSON=function(){return this.toString(16)},b.prototype.toBuffer=function(e,a){return f(void 0!==t),this.toArrayLike(t,e,a)},b.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},b.prototype.toArrayLike=function(e,a,c){var d=this.byteLength(),b=c||Math.max(1,d);f(d<=b,"byte array longer than desired length"),f(b>0,"Requested array length <= 0"),this.strip();var t,i,r="le"===a,n=new e(b),o=this.clone();if(r){for(i=0;!o.isZero();i++)t=o.andln(255),o.iushrn(8),n[i]=t;for(;i=4096&&(c+=13,a>>>=13),a>=64&&(c+=7,a>>>=7),a>=8&&(c+=4,a>>>=4),a>=2&&(c+=2,a>>>=2),c+a},b.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,c=0;return 8191&a||(c+=13,a>>>=13),127&a||(c+=7,a>>>=7),15&a||(c+=4,a>>>=4),3&a||(c+=2,a>>>=2),1&a||c++,c},b.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},b.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},b.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},b.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var c=0;ce.length?this.clone().iand(e):e.clone().iand(this)},b.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},b.prototype.iuxor=function(e){var a,c;this.length>e.length?(a=this,c=e):(a=e,c=this);for(var f=0;fe.length?this.clone().ixor(e):e.clone().ixor(this)},b.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},b.prototype.inotn=function(e){f("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),c=e%26;this._expand(a),c>0&&a--;for(var d=0;d0&&(this.words[d]=~this.words[d]&67108863>>26-c),this.strip()},b.prototype.notn=function(e){return this.clone().inotn(e)},b.prototype.setn=function(e,a){f("number"==typeof e&&e>=0);var c=e/26|0,d=e%26;return this._expand(c+1),this.words[c]=a?this.words[c]|1<e.length?(c=this,f=e):(c=e,f=this);for(var d=0,b=0;b>>26;for(;0!==d&&b>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;be.length?this.clone().iadd(e):e.clone().iadd(this)},b.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var c,f,d=this.cmp(e);if(0===d)return this.negative=0,this.length=1,this.words[0]=0,this;d>0?(c=this,f=e):(c=e,f=this);for(var b=0,t=0;t>26,this.words[t]=67108863&a;for(;0!==b&&t>26,this.words[t]=67108863&a;if(0===b&&t>>13,h=0|t[1],u=8191&h,x=h>>>13,p=0|t[2],g=8191&p,m=p>>>13,y=0|t[3],_=8191&y,v=y>>>13,w=0|t[4],M=8191&w,A=w>>>13,L=0|t[5],I=8191&L,k=L>>>13,E=0|t[6],S=8191&E,C=E>>>13,B=0|t[7],F=8191&B,O=B>>>13,P=0|t[8],R=8191&P,T=P>>>13,U=0|t[9],j=8191&U,N=U>>>13,q=0|i[0],D=8191&q,z=q>>>13,Q=0|i[1],G=8191&Q,K=Q>>>13,H=0|i[2],V=8191&H,Z=H>>>13,W=0|i[3],Y=8191&W,J=W>>>13,$=0|i[4],X=8191&$,ee=$>>>13,ae=0|i[5],ce=8191&ae,fe=ae>>>13,de=0|i[6],be=8191&de,te=de>>>13,ie=0|i[7],re=8191&ie,ne=ie>>>13,oe=0|i[8],se=8191&oe,le=oe>>>13,he=0|i[9],ue=8191&he,xe=he>>>13;c.negative=e.negative^a.negative,c.length=19;var pe=(n+(f=Math.imul(s,D))|0)+((8191&(d=(d=Math.imul(s,z))+Math.imul(l,D)|0))<<13)|0;n=((b=Math.imul(l,z))+(d>>>13)|0)+(pe>>>26)|0,pe&=67108863,f=Math.imul(u,D),d=(d=Math.imul(u,z))+Math.imul(x,D)|0,b=Math.imul(x,z);var ge=(n+(f=f+Math.imul(s,G)|0)|0)+((8191&(d=(d=d+Math.imul(s,K)|0)+Math.imul(l,G)|0))<<13)|0;n=((b=b+Math.imul(l,K)|0)+(d>>>13)|0)+(ge>>>26)|0,ge&=67108863,f=Math.imul(g,D),d=(d=Math.imul(g,z))+Math.imul(m,D)|0,b=Math.imul(m,z),f=f+Math.imul(u,G)|0,d=(d=d+Math.imul(u,K)|0)+Math.imul(x,G)|0,b=b+Math.imul(x,K)|0;var me=(n+(f=f+Math.imul(s,V)|0)|0)+((8191&(d=(d=d+Math.imul(s,Z)|0)+Math.imul(l,V)|0))<<13)|0;n=((b=b+Math.imul(l,Z)|0)+(d>>>13)|0)+(me>>>26)|0,me&=67108863,f=Math.imul(_,D),d=(d=Math.imul(_,z))+Math.imul(v,D)|0,b=Math.imul(v,z),f=f+Math.imul(g,G)|0,d=(d=d+Math.imul(g,K)|0)+Math.imul(m,G)|0,b=b+Math.imul(m,K)|0,f=f+Math.imul(u,V)|0,d=(d=d+Math.imul(u,Z)|0)+Math.imul(x,V)|0,b=b+Math.imul(x,Z)|0;var ye=(n+(f=f+Math.imul(s,Y)|0)|0)+((8191&(d=(d=d+Math.imul(s,J)|0)+Math.imul(l,Y)|0))<<13)|0;n=((b=b+Math.imul(l,J)|0)+(d>>>13)|0)+(ye>>>26)|0,ye&=67108863,f=Math.imul(M,D),d=(d=Math.imul(M,z))+Math.imul(A,D)|0,b=Math.imul(A,z),f=f+Math.imul(_,G)|0,d=(d=d+Math.imul(_,K)|0)+Math.imul(v,G)|0,b=b+Math.imul(v,K)|0,f=f+Math.imul(g,V)|0,d=(d=d+Math.imul(g,Z)|0)+Math.imul(m,V)|0,b=b+Math.imul(m,Z)|0,f=f+Math.imul(u,Y)|0,d=(d=d+Math.imul(u,J)|0)+Math.imul(x,Y)|0,b=b+Math.imul(x,J)|0;var _e=(n+(f=f+Math.imul(s,X)|0)|0)+((8191&(d=(d=d+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;n=((b=b+Math.imul(l,ee)|0)+(d>>>13)|0)+(_e>>>26)|0,_e&=67108863,f=Math.imul(I,D),d=(d=Math.imul(I,z))+Math.imul(k,D)|0,b=Math.imul(k,z),f=f+Math.imul(M,G)|0,d=(d=d+Math.imul(M,K)|0)+Math.imul(A,G)|0,b=b+Math.imul(A,K)|0,f=f+Math.imul(_,V)|0,d=(d=d+Math.imul(_,Z)|0)+Math.imul(v,V)|0,b=b+Math.imul(v,Z)|0,f=f+Math.imul(g,Y)|0,d=(d=d+Math.imul(g,J)|0)+Math.imul(m,Y)|0,b=b+Math.imul(m,J)|0,f=f+Math.imul(u,X)|0,d=(d=d+Math.imul(u,ee)|0)+Math.imul(x,X)|0,b=b+Math.imul(x,ee)|0;var ve=(n+(f=f+Math.imul(s,ce)|0)|0)+((8191&(d=(d=d+Math.imul(s,fe)|0)+Math.imul(l,ce)|0))<<13)|0;n=((b=b+Math.imul(l,fe)|0)+(d>>>13)|0)+(ve>>>26)|0,ve&=67108863,f=Math.imul(S,D),d=(d=Math.imul(S,z))+Math.imul(C,D)|0,b=Math.imul(C,z),f=f+Math.imul(I,G)|0,d=(d=d+Math.imul(I,K)|0)+Math.imul(k,G)|0,b=b+Math.imul(k,K)|0,f=f+Math.imul(M,V)|0,d=(d=d+Math.imul(M,Z)|0)+Math.imul(A,V)|0,b=b+Math.imul(A,Z)|0,f=f+Math.imul(_,Y)|0,d=(d=d+Math.imul(_,J)|0)+Math.imul(v,Y)|0,b=b+Math.imul(v,J)|0,f=f+Math.imul(g,X)|0,d=(d=d+Math.imul(g,ee)|0)+Math.imul(m,X)|0,b=b+Math.imul(m,ee)|0,f=f+Math.imul(u,ce)|0,d=(d=d+Math.imul(u,fe)|0)+Math.imul(x,ce)|0,b=b+Math.imul(x,fe)|0;var we=(n+(f=f+Math.imul(s,be)|0)|0)+((8191&(d=(d=d+Math.imul(s,te)|0)+Math.imul(l,be)|0))<<13)|0;n=((b=b+Math.imul(l,te)|0)+(d>>>13)|0)+(we>>>26)|0,we&=67108863,f=Math.imul(F,D),d=(d=Math.imul(F,z))+Math.imul(O,D)|0,b=Math.imul(O,z),f=f+Math.imul(S,G)|0,d=(d=d+Math.imul(S,K)|0)+Math.imul(C,G)|0,b=b+Math.imul(C,K)|0,f=f+Math.imul(I,V)|0,d=(d=d+Math.imul(I,Z)|0)+Math.imul(k,V)|0,b=b+Math.imul(k,Z)|0,f=f+Math.imul(M,Y)|0,d=(d=d+Math.imul(M,J)|0)+Math.imul(A,Y)|0,b=b+Math.imul(A,J)|0,f=f+Math.imul(_,X)|0,d=(d=d+Math.imul(_,ee)|0)+Math.imul(v,X)|0,b=b+Math.imul(v,ee)|0,f=f+Math.imul(g,ce)|0,d=(d=d+Math.imul(g,fe)|0)+Math.imul(m,ce)|0,b=b+Math.imul(m,fe)|0,f=f+Math.imul(u,be)|0,d=(d=d+Math.imul(u,te)|0)+Math.imul(x,be)|0,b=b+Math.imul(x,te)|0;var Me=(n+(f=f+Math.imul(s,re)|0)|0)+((8191&(d=(d=d+Math.imul(s,ne)|0)+Math.imul(l,re)|0))<<13)|0;n=((b=b+Math.imul(l,ne)|0)+(d>>>13)|0)+(Me>>>26)|0,Me&=67108863,f=Math.imul(R,D),d=(d=Math.imul(R,z))+Math.imul(T,D)|0,b=Math.imul(T,z),f=f+Math.imul(F,G)|0,d=(d=d+Math.imul(F,K)|0)+Math.imul(O,G)|0,b=b+Math.imul(O,K)|0,f=f+Math.imul(S,V)|0,d=(d=d+Math.imul(S,Z)|0)+Math.imul(C,V)|0,b=b+Math.imul(C,Z)|0,f=f+Math.imul(I,Y)|0,d=(d=d+Math.imul(I,J)|0)+Math.imul(k,Y)|0,b=b+Math.imul(k,J)|0,f=f+Math.imul(M,X)|0,d=(d=d+Math.imul(M,ee)|0)+Math.imul(A,X)|0,b=b+Math.imul(A,ee)|0,f=f+Math.imul(_,ce)|0,d=(d=d+Math.imul(_,fe)|0)+Math.imul(v,ce)|0,b=b+Math.imul(v,fe)|0,f=f+Math.imul(g,be)|0,d=(d=d+Math.imul(g,te)|0)+Math.imul(m,be)|0,b=b+Math.imul(m,te)|0,f=f+Math.imul(u,re)|0,d=(d=d+Math.imul(u,ne)|0)+Math.imul(x,re)|0,b=b+Math.imul(x,ne)|0;var Ae=(n+(f=f+Math.imul(s,se)|0)|0)+((8191&(d=(d=d+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;n=((b=b+Math.imul(l,le)|0)+(d>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,f=Math.imul(j,D),d=(d=Math.imul(j,z))+Math.imul(N,D)|0,b=Math.imul(N,z),f=f+Math.imul(R,G)|0,d=(d=d+Math.imul(R,K)|0)+Math.imul(T,G)|0,b=b+Math.imul(T,K)|0,f=f+Math.imul(F,V)|0,d=(d=d+Math.imul(F,Z)|0)+Math.imul(O,V)|0,b=b+Math.imul(O,Z)|0,f=f+Math.imul(S,Y)|0,d=(d=d+Math.imul(S,J)|0)+Math.imul(C,Y)|0,b=b+Math.imul(C,J)|0,f=f+Math.imul(I,X)|0,d=(d=d+Math.imul(I,ee)|0)+Math.imul(k,X)|0,b=b+Math.imul(k,ee)|0,f=f+Math.imul(M,ce)|0,d=(d=d+Math.imul(M,fe)|0)+Math.imul(A,ce)|0,b=b+Math.imul(A,fe)|0,f=f+Math.imul(_,be)|0,d=(d=d+Math.imul(_,te)|0)+Math.imul(v,be)|0,b=b+Math.imul(v,te)|0,f=f+Math.imul(g,re)|0,d=(d=d+Math.imul(g,ne)|0)+Math.imul(m,re)|0,b=b+Math.imul(m,ne)|0,f=f+Math.imul(u,se)|0,d=(d=d+Math.imul(u,le)|0)+Math.imul(x,se)|0,b=b+Math.imul(x,le)|0;var Le=(n+(f=f+Math.imul(s,ue)|0)|0)+((8191&(d=(d=d+Math.imul(s,xe)|0)+Math.imul(l,ue)|0))<<13)|0;n=((b=b+Math.imul(l,xe)|0)+(d>>>13)|0)+(Le>>>26)|0,Le&=67108863,f=Math.imul(j,G),d=(d=Math.imul(j,K))+Math.imul(N,G)|0,b=Math.imul(N,K),f=f+Math.imul(R,V)|0,d=(d=d+Math.imul(R,Z)|0)+Math.imul(T,V)|0,b=b+Math.imul(T,Z)|0,f=f+Math.imul(F,Y)|0,d=(d=d+Math.imul(F,J)|0)+Math.imul(O,Y)|0,b=b+Math.imul(O,J)|0,f=f+Math.imul(S,X)|0,d=(d=d+Math.imul(S,ee)|0)+Math.imul(C,X)|0,b=b+Math.imul(C,ee)|0,f=f+Math.imul(I,ce)|0,d=(d=d+Math.imul(I,fe)|0)+Math.imul(k,ce)|0,b=b+Math.imul(k,fe)|0,f=f+Math.imul(M,be)|0,d=(d=d+Math.imul(M,te)|0)+Math.imul(A,be)|0,b=b+Math.imul(A,te)|0,f=f+Math.imul(_,re)|0,d=(d=d+Math.imul(_,ne)|0)+Math.imul(v,re)|0,b=b+Math.imul(v,ne)|0,f=f+Math.imul(g,se)|0,d=(d=d+Math.imul(g,le)|0)+Math.imul(m,se)|0,b=b+Math.imul(m,le)|0;var Ie=(n+(f=f+Math.imul(u,ue)|0)|0)+((8191&(d=(d=d+Math.imul(u,xe)|0)+Math.imul(x,ue)|0))<<13)|0;n=((b=b+Math.imul(x,xe)|0)+(d>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,f=Math.imul(j,V),d=(d=Math.imul(j,Z))+Math.imul(N,V)|0,b=Math.imul(N,Z),f=f+Math.imul(R,Y)|0,d=(d=d+Math.imul(R,J)|0)+Math.imul(T,Y)|0,b=b+Math.imul(T,J)|0,f=f+Math.imul(F,X)|0,d=(d=d+Math.imul(F,ee)|0)+Math.imul(O,X)|0,b=b+Math.imul(O,ee)|0,f=f+Math.imul(S,ce)|0,d=(d=d+Math.imul(S,fe)|0)+Math.imul(C,ce)|0,b=b+Math.imul(C,fe)|0,f=f+Math.imul(I,be)|0,d=(d=d+Math.imul(I,te)|0)+Math.imul(k,be)|0,b=b+Math.imul(k,te)|0,f=f+Math.imul(M,re)|0,d=(d=d+Math.imul(M,ne)|0)+Math.imul(A,re)|0,b=b+Math.imul(A,ne)|0,f=f+Math.imul(_,se)|0,d=(d=d+Math.imul(_,le)|0)+Math.imul(v,se)|0,b=b+Math.imul(v,le)|0;var ke=(n+(f=f+Math.imul(g,ue)|0)|0)+((8191&(d=(d=d+Math.imul(g,xe)|0)+Math.imul(m,ue)|0))<<13)|0;n=((b=b+Math.imul(m,xe)|0)+(d>>>13)|0)+(ke>>>26)|0,ke&=67108863,f=Math.imul(j,Y),d=(d=Math.imul(j,J))+Math.imul(N,Y)|0,b=Math.imul(N,J),f=f+Math.imul(R,X)|0,d=(d=d+Math.imul(R,ee)|0)+Math.imul(T,X)|0,b=b+Math.imul(T,ee)|0,f=f+Math.imul(F,ce)|0,d=(d=d+Math.imul(F,fe)|0)+Math.imul(O,ce)|0,b=b+Math.imul(O,fe)|0,f=f+Math.imul(S,be)|0,d=(d=d+Math.imul(S,te)|0)+Math.imul(C,be)|0,b=b+Math.imul(C,te)|0,f=f+Math.imul(I,re)|0,d=(d=d+Math.imul(I,ne)|0)+Math.imul(k,re)|0,b=b+Math.imul(k,ne)|0,f=f+Math.imul(M,se)|0,d=(d=d+Math.imul(M,le)|0)+Math.imul(A,se)|0,b=b+Math.imul(A,le)|0;var Ee=(n+(f=f+Math.imul(_,ue)|0)|0)+((8191&(d=(d=d+Math.imul(_,xe)|0)+Math.imul(v,ue)|0))<<13)|0;n=((b=b+Math.imul(v,xe)|0)+(d>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,f=Math.imul(j,X),d=(d=Math.imul(j,ee))+Math.imul(N,X)|0,b=Math.imul(N,ee),f=f+Math.imul(R,ce)|0,d=(d=d+Math.imul(R,fe)|0)+Math.imul(T,ce)|0,b=b+Math.imul(T,fe)|0,f=f+Math.imul(F,be)|0,d=(d=d+Math.imul(F,te)|0)+Math.imul(O,be)|0,b=b+Math.imul(O,te)|0,f=f+Math.imul(S,re)|0,d=(d=d+Math.imul(S,ne)|0)+Math.imul(C,re)|0,b=b+Math.imul(C,ne)|0,f=f+Math.imul(I,se)|0,d=(d=d+Math.imul(I,le)|0)+Math.imul(k,se)|0,b=b+Math.imul(k,le)|0;var Se=(n+(f=f+Math.imul(M,ue)|0)|0)+((8191&(d=(d=d+Math.imul(M,xe)|0)+Math.imul(A,ue)|0))<<13)|0;n=((b=b+Math.imul(A,xe)|0)+(d>>>13)|0)+(Se>>>26)|0,Se&=67108863,f=Math.imul(j,ce),d=(d=Math.imul(j,fe))+Math.imul(N,ce)|0,b=Math.imul(N,fe),f=f+Math.imul(R,be)|0,d=(d=d+Math.imul(R,te)|0)+Math.imul(T,be)|0,b=b+Math.imul(T,te)|0,f=f+Math.imul(F,re)|0,d=(d=d+Math.imul(F,ne)|0)+Math.imul(O,re)|0,b=b+Math.imul(O,ne)|0,f=f+Math.imul(S,se)|0,d=(d=d+Math.imul(S,le)|0)+Math.imul(C,se)|0,b=b+Math.imul(C,le)|0;var Ce=(n+(f=f+Math.imul(I,ue)|0)|0)+((8191&(d=(d=d+Math.imul(I,xe)|0)+Math.imul(k,ue)|0))<<13)|0;n=((b=b+Math.imul(k,xe)|0)+(d>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,f=Math.imul(j,be),d=(d=Math.imul(j,te))+Math.imul(N,be)|0,b=Math.imul(N,te),f=f+Math.imul(R,re)|0,d=(d=d+Math.imul(R,ne)|0)+Math.imul(T,re)|0,b=b+Math.imul(T,ne)|0,f=f+Math.imul(F,se)|0,d=(d=d+Math.imul(F,le)|0)+Math.imul(O,se)|0,b=b+Math.imul(O,le)|0;var Be=(n+(f=f+Math.imul(S,ue)|0)|0)+((8191&(d=(d=d+Math.imul(S,xe)|0)+Math.imul(C,ue)|0))<<13)|0;n=((b=b+Math.imul(C,xe)|0)+(d>>>13)|0)+(Be>>>26)|0,Be&=67108863,f=Math.imul(j,re),d=(d=Math.imul(j,ne))+Math.imul(N,re)|0,b=Math.imul(N,ne),f=f+Math.imul(R,se)|0,d=(d=d+Math.imul(R,le)|0)+Math.imul(T,se)|0,b=b+Math.imul(T,le)|0;var Fe=(n+(f=f+Math.imul(F,ue)|0)|0)+((8191&(d=(d=d+Math.imul(F,xe)|0)+Math.imul(O,ue)|0))<<13)|0;n=((b=b+Math.imul(O,xe)|0)+(d>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,f=Math.imul(j,se),d=(d=Math.imul(j,le))+Math.imul(N,se)|0,b=Math.imul(N,le);var Oe=(n+(f=f+Math.imul(R,ue)|0)|0)+((8191&(d=(d=d+Math.imul(R,xe)|0)+Math.imul(T,ue)|0))<<13)|0;n=((b=b+Math.imul(T,xe)|0)+(d>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Pe=(n+(f=Math.imul(j,ue))|0)+((8191&(d=(d=Math.imul(j,xe))+Math.imul(N,ue)|0))<<13)|0;return n=((b=Math.imul(N,xe))+(d>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r[0]=pe,r[1]=ge,r[2]=me,r[3]=ye,r[4]=_e,r[5]=ve,r[6]=we,r[7]=Me,r[8]=Ae,r[9]=Le,r[10]=Ie,r[11]=ke,r[12]=Ee,r[13]=Se,r[14]=Ce,r[15]=Be,r[16]=Fe,r[17]=Oe,r[18]=Pe,0!==n&&(r[19]=n,c.length++),c};function x(e,a,c){return(new p).mulp(e,a,c)}function p(e,a){this.x=e,this.y=a}Math.imul||(u=h),b.prototype.mulTo=function(e,a){var c,f=this.length+e.length;return c=10===this.length&&10===e.length?u(this,e,a):f<63?h(this,e,a):f<1024?function(e,a,c){c.negative=a.negative^e.negative,c.length=e.length+a.length;for(var f=0,d=0,b=0;b>>26)|0)>>>26,t&=67108863}c.words[b]=i,f=t,t=d}return 0!==f?c.words[b]=f:c.length--,c.strip()}(this,e,a):x(this,e,a),c},p.prototype.makeRBT=function(e){for(var a=new Array(e),c=b.prototype._countBits(e)-1,f=0;f>=1;return f},p.prototype.permute=function(e,a,c,f,d,b){for(var t=0;t>>=1)d++;return 1<>>=13,c[2*t+1]=8191&b,b>>>=13;for(t=2*a;t>=26,a+=d/67108864|0,a+=b>>>26,this.words[c]=67108863&b}return 0!==a&&(this.words[c]=a,this.length++),this},b.prototype.muln=function(e){return this.clone().imuln(e)},b.prototype.sqr=function(){return this.mul(this)},b.prototype.isqr=function(){return this.imul(this.clone())},b.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),c=0;c>>d}return a}(e);if(0===a.length)return new b(1);for(var c=this,f=0;f=0);var a,c=e%26,d=(e-c)/26,b=67108863>>>26-c<<26-c;if(0!==c){var t=0;for(a=0;a>>26-c}t&&(this.words[a]=t,this.length++)}if(0!==d){for(a=this.length-1;a>=0;a--)this.words[a+d]=this.words[a];for(a=0;a=0),d=a?(a-a%26)/26:0;var b=e%26,t=Math.min((e-b)/26,this.length),i=67108863^67108863>>>b<t)for(this.length-=t,n=0;n=0&&(0!==o||n>=d);n--){var s=0|this.words[n];this.words[n]=o<<26-b|s>>>b,o=s&i}return r&&0!==o&&(r.words[r.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},b.prototype.ishrn=function(e,a,c){return f(0===this.negative),this.iushrn(e,a,c)},b.prototype.shln=function(e){return this.clone().ishln(e)},b.prototype.ushln=function(e){return this.clone().iushln(e)},b.prototype.shrn=function(e){return this.clone().ishrn(e)},b.prototype.ushrn=function(e){return this.clone().iushrn(e)},b.prototype.testn=function(e){f("number"==typeof e&&e>=0);var a=e%26,c=(e-a)/26,d=1<=0);var a=e%26,c=(e-a)/26;if(f(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)return this;if(0!==a&&c++,this.length=Math.min(c,this.length),0!==a){var d=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},b.prototype.isubn=function(e){if(f("number"==typeof e),f(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(r/67108864|0),this.words[d+c]=67108863&b}for(;d>26,this.words[d+c]=67108863&b;if(0===i)return this.strip();for(f(-1===i),i=0,d=0;d>26,this.words[d]=67108863&b;return this.negative=1,this.strip()},b.prototype._wordDiv=function(e,a){var c=(this.length,e.length),f=this.clone(),d=e,t=0|d.words[d.length-1];0!=(c=26-this._countBits(t))&&(d=d.ushln(c),f.iushln(c),t=0|d.words[d.length-1]);var i,r=f.length-d.length;if("mod"!==a){(i=new b(null)).length=r+1,i.words=new Array(i.length);for(var n=0;n=0;s--){var l=67108864*(0|f.words[d.length+s])+(0|f.words[d.length+s-1]);for(l=Math.min(l/t|0,67108863),f._ishlnsubmul(d,l,s);0!==f.negative;)l--,f.negative=0,f._ishlnsubmul(d,1,s),f.isZero()||(f.negative^=1);i&&(i.words[s]=l)}return i&&i.strip(),f.strip(),"div"!==a&&0!==c&&f.iushrn(c),{div:i||null,mod:f}},b.prototype.divmod=function(e,a,c){return f(!e.isZero()),this.isZero()?{div:new b(0),mod:new b(0)}:0!==this.negative&&0===e.negative?(i=this.neg().divmod(e,a),"mod"!==a&&(d=i.div.neg()),"div"!==a&&(t=i.mod.neg(),c&&0!==t.negative&&t.iadd(e)),{div:d,mod:t}):0===this.negative&&0!==e.negative?(i=this.divmod(e.neg(),a),"mod"!==a&&(d=i.div.neg()),{div:d,mod:i.mod}):this.negative&e.negative?(i=this.neg().divmod(e.neg(),a),"div"!==a&&(t=i.mod.neg(),c&&0!==t.negative&&t.isub(e)),{div:i.div,mod:t}):e.length>this.length||this.cmp(e)<0?{div:new b(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new b(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new b(this.modn(e.words[0]))}:this._wordDiv(e,a);var d,t,i},b.prototype.div=function(e){return this.divmod(e,"div",!1).div},b.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},b.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},b.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var c=0!==a.div.negative?a.mod.isub(e):a.mod,f=e.ushrn(1),d=e.andln(1),b=c.cmp(f);return b<0||1===d&&0===b?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},b.prototype.modn=function(e){f(e<=67108863);for(var a=(1<<26)%e,c=0,d=this.length-1;d>=0;d--)c=(a*c+(0|this.words[d]))%e;return c},b.prototype.idivn=function(e){f(e<=67108863);for(var a=0,c=this.length-1;c>=0;c--){var d=(0|this.words[c])+67108864*a;this.words[c]=d/e|0,a=d%e}return this.strip()},b.prototype.divn=function(e){return this.clone().idivn(e)},b.prototype.egcd=function(e){f(0===e.negative),f(!e.isZero());var a=this,c=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var d=new b(1),t=new b(0),i=new b(0),r=new b(1),n=0;a.isEven()&&c.isEven();)a.iushrn(1),c.iushrn(1),++n;for(var o=c.clone(),s=a.clone();!a.isZero();){for(var l=0,h=1;!(a.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(d.isOdd()||t.isOdd())&&(d.iadd(o),t.isub(s)),d.iushrn(1),t.iushrn(1);for(var u=0,x=1;!(c.words[0]&x)&&u<26;++u,x<<=1);if(u>0)for(c.iushrn(u);u-- >0;)(i.isOdd()||r.isOdd())&&(i.iadd(o),r.isub(s)),i.iushrn(1),r.iushrn(1);a.cmp(c)>=0?(a.isub(c),d.isub(i),t.isub(r)):(c.isub(a),i.isub(d),r.isub(t))}return{a:i,b:r,gcd:c.iushln(n)}},b.prototype._invmp=function(e){f(0===e.negative),f(!e.isZero());var a=this,c=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var d,t=new b(1),i=new b(0),r=c.clone();a.cmpn(1)>0&&c.cmpn(1)>0;){for(var n=0,o=1;!(a.words[0]&o)&&n<26;++n,o<<=1);if(n>0)for(a.iushrn(n);n-- >0;)t.isOdd()&&t.iadd(r),t.iushrn(1);for(var s=0,l=1;!(c.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(c.iushrn(s);s-- >0;)i.isOdd()&&i.iadd(r),i.iushrn(1);a.cmp(c)>=0?(a.isub(c),t.isub(i)):(c.isub(a),i.isub(t))}return(d=0===a.cmpn(1)?t:i).cmpn(0)<0&&d.iadd(e),d},b.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),c=e.clone();a.negative=0,c.negative=0;for(var f=0;a.isEven()&&c.isEven();f++)a.iushrn(1),c.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=a.cmp(c);if(d<0){var b=a;a=c,c=b}else if(0===d||0===c.cmpn(1))break;a.isub(c)}return c.iushln(f)},b.prototype.invm=function(e){return this.egcd(e).a.umod(e)},b.prototype.isEven=function(){return!(1&this.words[0])},b.prototype.isOdd=function(){return!(1&~this.words[0])},b.prototype.andln=function(e){return this.words[0]&e},b.prototype.bincn=function(e){f("number"==typeof e);var a=e%26,c=(e-a)/26,d=1<>>26,i&=67108863,this.words[t]=i}return 0!==b&&(this.words[t]=b,this.length++),this},b.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},b.prototype.cmpn=function(e){var a,c=e<0;if(0!==this.negative&&!c)return-1;if(0===this.negative&&c)return 1;if(this.strip(),this.length>1)a=1;else{c&&(e=-e),f(e<=67108863,"Number is too big");var d=0|this.words[0];a=d===e?0:de.length)return 1;if(this.length=0;c--){var f=0|this.words[c],d=0|e.words[c];if(f!==d){fd&&(a=1);break}}return a},b.prototype.gtn=function(e){return 1===this.cmpn(e)},b.prototype.gt=function(e){return 1===this.cmp(e)},b.prototype.gten=function(e){return this.cmpn(e)>=0},b.prototype.gte=function(e){return this.cmp(e)>=0},b.prototype.ltn=function(e){return-1===this.cmpn(e)},b.prototype.lt=function(e){return-1===this.cmp(e)},b.prototype.lten=function(e){return this.cmpn(e)<=0},b.prototype.lte=function(e){return this.cmp(e)<=0},b.prototype.eqn=function(e){return 0===this.cmpn(e)},b.prototype.eq=function(e){return 0===this.cmp(e)},b.red=function(e){return new M(e)},b.prototype.toRed=function(e){return f(!this.red,"Already a number in reduction context"),f(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},b.prototype.fromRed=function(){return f(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},b.prototype._forceRed=function(e){return this.red=e,this},b.prototype.forceRed=function(e){return f(!this.red,"Already a number in reduction context"),this._forceRed(e)},b.prototype.redAdd=function(e){return f(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},b.prototype.redIAdd=function(e){return f(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},b.prototype.redSub=function(e){return f(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},b.prototype.redISub=function(e){return f(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},b.prototype.redShl=function(e){return f(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},b.prototype.redMul=function(e){return f(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},b.prototype.redIMul=function(e){return f(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},b.prototype.redSqr=function(){return f(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},b.prototype.redISqr=function(){return f(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},b.prototype.redSqrt=function(){return f(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},b.prototype.redInvm=function(){return f(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},b.prototype.redNeg=function(){return f(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},b.prototype.redPow=function(e){return f(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function m(e,a){this.name=e,this.p=new b(a,16),this.n=this.p.bitLength(),this.k=new b(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var a=b._prime(e);this.m=a.p,this.prime=a}else f(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new b(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)}m.prototype._tmp=function(){var e=new b(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var a,c=e;do{this.split(c,this.tmp),a=(c=(c=this.imulK(c)).iadd(this.tmp)).bitLength()}while(a>this.n);var f=a0?c.isub(this.p):void 0!==c.strip?c.strip():c._strip(),c},m.prototype.split=function(e,a){e.iushrn(this.n,0,a)},m.prototype.imulK=function(e){return e.imul(this.k)},d(y,m),y.prototype.split=function(e,a){for(var c=4194303,f=Math.min(e.length,9),d=0;d>>22,b=t}b>>>=22,e.words[d-10]=b,0===b&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,c=0;c>>=26,e.words[c]=d,a=f}return 0!==a&&(e.words[e.length++]=a),e},b._prime=function(e){if(g[e])return g[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new _;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return g[e]=a,a},M.prototype._verify1=function(e){f(0===e.negative,"red works only with positives"),f(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,a){f(!(e.negative|a.negative),"red works only with positives"),f(e.red&&e.red===a.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,a){this._verify2(e,a);var c=e.add(a);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},M.prototype.iadd=function(e,a){this._verify2(e,a);var c=e.iadd(a);return c.cmp(this.m)>=0&&c.isub(this.m),c},M.prototype.sub=function(e,a){this._verify2(e,a);var c=e.sub(a);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},M.prototype.isub=function(e,a){this._verify2(e,a);var c=e.isub(a);return c.cmpn(0)<0&&c.iadd(this.m),c},M.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},M.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},M.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(f(a%2==1),3===a){var c=this.m.add(new b(1)).iushrn(2);return this.pow(e,c)}for(var d=this.m.subn(1),t=0;!d.isZero()&&0===d.andln(1);)t++,d.iushrn(1);f(!d.isZero());var i=new b(1).toRed(this),r=i.redNeg(),n=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new b(2*o*o).toRed(this);0!==this.pow(o,n).cmp(r);)o.redIAdd(r);for(var s=this.pow(o,d),l=this.pow(e,d.addn(1).iushrn(1)),h=this.pow(e,d),u=t;0!==h.cmp(i);){for(var x=h,p=0;0!==x.cmp(i);p++)x=x.redSqr();f(p=0;f--){for(var n=a.words[f],o=r-1;o>=0;o--){var s=n>>o&1;d!==c[0]&&(d=this.sqr(d)),0!==s||0!==t?(t<<=1,t|=s,(4==++i||0===f&&0===o)&&(d=this.mul(d,c[t]),i=0,t=0)):i=0}r=26}return d},M.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},M.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},b.mont=function(e){return new A(e)},d(A,M),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},A.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var c=e.imul(a),f=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(f).iushrn(this.shift),b=d;return d.cmp(this.m)>=0?b=d.isub(this.m):d.cmpn(0)<0&&(b=d.iadd(this.m)),b._forceRed(this)},A.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new b(0)._forceRed(this);var c=e.mul(a),f=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(f).iushrn(this.shift),t=d;return d.cmp(this.m)>=0?t=d.isub(this.m):d.cmpn(0)<0&&(t=d.iadd(this.m)),t._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=c.nmd(e),this)},4148:(e,a,c)=>{"use strict";function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function d(e,a){for(var c=0;c1?c-1:0),d=1;d1?c-1:0),d=1;d1?c-1:0),d=1;d1?c-1:0),d=1;d{"use strict";function f(e,a){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(e);a&&(f=f.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),c.push.apply(c,f)}return c}function d(e){for(var a=1;ae.length)&&(c=e.length),e.substring(c-a.length,c)===a}var m="",y="",_="",v="",w={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function M(e){var a=Object.keys(e),c=Object.create(Object.getPrototypeOf(e));return a.forEach((function(a){c[a]=e[a]})),Object.defineProperty(c,"message",{value:e.message}),c}function A(e){return x(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var L=function(e,a){!function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),a&&l(e,a)}(L,e);var c,f,t,n,o=(c=L,f=s(),function(){var e,a=h(c);if(f){var d=h(this).constructor;e=Reflect.construct(a,arguments,d)}else e=a.apply(this,arguments);return i(this,e)});function L(e){var a;if(function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,L),"object"!==u(e)||null===e)throw new p("options","Object",e);var c=e.message,f=e.operator,d=e.stackStartFn,b=e.actual,t=e.expected,n=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=c)a=o.call(this,String(c));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&1!==process.stderr.getColorDepth()?(m="",y="",v="",_=""):(m="",y="",v="",_="")),"object"===u(b)&&null!==b&&"object"===u(t)&&null!==t&&"stack"in b&&b instanceof Error&&"stack"in t&&t instanceof Error&&(b=M(b),t=M(t)),"deepStrictEqual"===f||"strictEqual"===f)a=o.call(this,function(e,a,c){var f="",d="",b=0,t="",i=!1,r=A(e),n=r.split("\n"),o=A(a).split("\n"),s=0,l="";if("strictEqual"===c&&"object"===u(e)&&"object"===u(a)&&null!==e&&null!==a&&(c="strictEqualObject"),1===n.length&&1===o.length&&n[0]!==o[0]){var h=n[0].length+o[0].length;if(h<=10){if(!("object"===u(e)&&null!==e||"object"===u(a)&&null!==a||0===e&&0===a))return"".concat(w[c],"\n\n")+"".concat(n[0]," !== ").concat(o[0],"\n")}else if("strictEqualObject"!==c&&h<(process.stderr&&process.stderr.isTTY?process.stderr.columns:80)){for(;n[0][s]===o[0][s];)s++;s>2&&(l="\n ".concat(function(e,a){if(a=Math.floor(a),0==e.length||0==a)return"";var c=e.length*a;for(a=Math.floor(Math.log(a)/Math.log(2));a;)e+=e,a--;return e+e.substring(0,c-e.length)}(" ",s),"^"),s=0)}}for(var x=n[n.length-1],p=o[o.length-1];x===p&&(s++<2?t="\n ".concat(x).concat(t):f=x,n.pop(),o.pop(),0!==n.length&&0!==o.length);)x=n[n.length-1],p=o[o.length-1];var M=Math.max(n.length,o.length);if(0===M){var L=r.split("\n");if(L.length>30)for(L[26]="".concat(m,"...").concat(v);L.length>27;)L.pop();return"".concat(w.notIdentical,"\n\n").concat(L.join("\n"),"\n")}s>3&&(t="\n".concat(m,"...").concat(v).concat(t),i=!0),""!==f&&(t="\n ".concat(f).concat(t),f="");var I=0,k=w[c]+"\n".concat(y,"+ actual").concat(v," ").concat(_,"- expected").concat(v),E=" ".concat(m,"...").concat(v," Lines skipped");for(s=0;s1&&s>2&&(S>4?(d+="\n".concat(m,"...").concat(v),i=!0):S>3&&(d+="\n ".concat(o[s-2]),I++),d+="\n ".concat(o[s-1]),I++),b=s,f+="\n".concat(_,"-").concat(v," ").concat(o[s]),I++;else if(o.length1&&s>2&&(S>4?(d+="\n".concat(m,"...").concat(v),i=!0):S>3&&(d+="\n ".concat(n[s-2]),I++),d+="\n ".concat(n[s-1]),I++),b=s,d+="\n".concat(y,"+").concat(v," ").concat(n[s]),I++;else{var C=o[s],B=n[s],F=B!==C&&(!g(B,",")||B.slice(0,-1)!==C);F&&g(C,",")&&C.slice(0,-1)===B&&(F=!1,B+=","),F?(S>1&&s>2&&(S>4?(d+="\n".concat(m,"...").concat(v),i=!0):S>3&&(d+="\n ".concat(n[s-2]),I++),d+="\n ".concat(n[s-1]),I++),b=s,d+="\n".concat(y,"+").concat(v," ").concat(B),f+="\n".concat(_,"-").concat(v," ").concat(C),I+=2):(d+=f,f="",1!==S&&0!==s||(d+="\n ".concat(B),I++))}if(I>20&&s30)for(l[26]="".concat(m,"...").concat(v);l.length>27;)l.pop();a=1===l.length?o.call(this,"".concat(s," ").concat(l[0])):o.call(this,"".concat(s,"\n\n").concat(l.join("\n"),"\n"))}else{var h=A(b),x="",I=w[f];"notDeepEqual"===f||"notEqual"===f?(h="".concat(w[f],"\n\n").concat(h)).length>1024&&(h="".concat(h.slice(0,1021),"...")):(x="".concat(A(t)),h.length>512&&(h="".concat(h.slice(0,509),"...")),x.length>512&&(x="".concat(x.slice(0,509),"...")),"deepEqual"===f||"equal"===f?h="".concat(I,"\n\n").concat(h,"\n\nshould equal\n\n"):x=" ".concat(f," ").concat(x)),a=o.call(this,"".concat(h).concat(x))}return Error.stackTraceLimit=n,a.generatedMessage=!c,Object.defineProperty(r(a),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),a.code="ERR_ASSERTION",a.actual=b,a.expected=t,a.operator=f,Error.captureStackTrace&&Error.captureStackTrace(r(a),d),a.stack,a.name="AssertionError",i(a)}return t=L,(n=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:a,value:function(e,a){return x(this,d(d({},a),{},{customInspect:!1,depth:0}))}}])&&b(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),L}(n(Error),x.custom);e.exports=L},9597:(e,a,c)=>{"use strict";function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function d(e,a){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,a){return e.__proto__=a,e},d(e,a)}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}var t,i,r={};function n(e,a,c){c||(c=Error);var t=function(c){!function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),a&&d(e,a)}(o,c);var t,i,r,n=(i=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=b(i);if(r){var c=b(this).constructor;e=Reflect.construct(a,arguments,c)}else e=a.apply(this,arguments);return function(e,a){if(a&&("object"===f(a)||"function"==typeof a))return a;if(void 0!==a)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function o(c,f,d){var b;return function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,o),b=n.call(this,function(e,c,f){return"string"==typeof a?a:a(e,c,f)}(c,f,d)),b.code=e,b}return t=o,Object.defineProperty(t,"prototype",{writable:!1}),t}(c);r[e]=t}function o(e,a){if(Array.isArray(e)){var c=e.length;return e=e.map((function(e){return String(e)})),c>2?"one of ".concat(a," ").concat(e.slice(0,c-1).join(", "),", or ")+e[c-1]:2===c?"one of ".concat(a," ").concat(e[0]," or ").concat(e[1]):"of ".concat(a," ").concat(e[0])}return"of ".concat(a," ").concat(String(e))}n("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,a,d){var b,i,r,n,s;if(void 0===t&&(t=c(4148)),t("string"==typeof e,"'name' must be a string"),"string"==typeof a&&(i="not ",a.substr(0,4)===i)?(b="must not be",a=a.replace(/^not /,"")):b="must be",function(e,a,c){return(void 0===c||c>e.length)&&(c=e.length),e.substring(c-9,c)===a}(e," argument"))r="The ".concat(e," ").concat(b," ").concat(o(a,"type"));else{var l=("number"!=typeof s&&(s=0),s+1>(n=e).length||-1===n.indexOf(".",s)?"argument":"property");r='The "'.concat(e,'" ').concat(l," ").concat(b," ").concat(o(a,"type"))}return r+". Received type ".concat(f(d))}),TypeError),n("ERR_INVALID_ARG_VALUE",(function(e,a){var f=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===i&&(i=c(537));var d=i.inspect(a);return d.length>128&&(d="".concat(d.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(f,". Received ").concat(d)}),TypeError,RangeError),n("ERR_INVALID_RETURN_VALUE",(function(e,a,c){var d;return d=c&&c.constructor&&c.constructor.name?"instance of ".concat(c.constructor.name):"type ".concat(f(c)),"Expected ".concat(e,' to be returned from the "').concat(a,'"')+" function but got ".concat(d,".")}),TypeError),n("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,a=new Array(e),f=0;f0,"At least one arg needs to be specified");var d="The ",b=a.length;switch(a=a.map((function(e){return'"'.concat(e,'"')})),b){case 1:d+="".concat(a[0]," argument");break;case 2:d+="".concat(a[0]," and ").concat(a[1]," arguments");break;default:d+=a.slice(0,b-1).join(", "),d+=", and ".concat(a[b-1]," arguments")}return"".concat(d," must be specified")}),TypeError),e.exports.codes=r},2299:(e,a,c)=>{"use strict";function f(e,a){return function(e){if(Array.isArray(e))return e}(e)||function(e,a){var c=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=c){var f,d,b,t,i=[],r=!0,n=!1;try{if(b=(c=c.call(e)).next,0===a){if(Object(c)!==c)return;r=!1}else for(;!(r=(f=b.call(c)).done)&&(i.push(f.value),i.length!==a);r=!0);}catch(e){n=!0,d=e}finally{try{if(!r&&null!=c.return&&(t=c.return(),Object(t)!==t))return}finally{if(n)throw d}}return i}}(e,a)||function(e,a){if(e){if("string"==typeof e)return d(e,a);var c=Object.prototype.toString.call(e).slice(8,-1);return"Object"===c&&e.constructor&&(c=e.constructor.name),"Map"===c||"Set"===c?Array.from(e):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?d(e,a):void 0}}(e,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,a){(null==a||a>e.length)&&(a=e.length);for(var c=0,f=new Array(a);c10)return!0;for(var a=0;a57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function O(e){return Object.keys(e).filter(F).concat(o(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function P(e,a){if(e===a)return 0;for(var c=e.length,f=a.length,d=0,b=Math.min(c,f);d{const f=c(6209),d=c(943),b=c(1847),t=c(6679),i=c(5435),r=255===new Uint8Array(Uint16Array.of(255).buffer)[0];function n(e){switch(e){case"ascii":return f;case"base64":return d;case"hex":return b;case"utf8":case"utf-8":case void 0:return t;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i;default:throw new Error(`Unknown encoding: ${e}`)}}function o(e){return e instanceof Uint8Array}function s(e,a,c){return"string"==typeof e?function(e,a){const c=n(a),f=new Uint8Array(c.byteLength(e));return c.write(f,e,0,f.byteLength),f}(e,a):Array.isArray(e)?function(e){const a=new Uint8Array(e.length);return a.set(e),a}(e):ArrayBuffer.isView(e)?function(e){const a=new Uint8Array(e.byteLength);return a.set(e),a}(e):function(e,a,c){return new Uint8Array(e,a,c)}(e,a,c)}function l(e,a,c,f,d){if(0===e.byteLength)return-1;if("string"==typeof c?(f=c,c=0):void 0===c?c=d?0:e.length-1:c<0&&(c+=e.byteLength),c>=e.byteLength){if(d)return-1;c=e.byteLength-1}else if(c<0){if(!d)return-1;c=0}if("string"==typeof a)a=s(a,f);else if("number"==typeof a)return a&=255,d?e.indexOf(a,c):e.lastIndexOf(a,c);if(0===a.byteLength)return-1;if(d){let f=-1;for(let d=c;de.byteLength&&(c=e.byteLength-a.byteLength);for(let f=c;f>=0;f--){let c=!0;for(let d=0;dd)return 1}return e.byteLength>a.byteLength?1:e.byteLengthe+a.byteLength),0));const c=new Uint8Array(a);let f=0;for(const a of e){if(f+a.byteLength>c.byteLength){const e=a.subarray(0,c.byteLength-f);return c.set(e,f),c}c.set(a,f),f+=a.byteLength}return c},copy:function(e,a,c=0,f=0,d=e.byteLength){if(d>0&&d=e.byteLength)throw new RangeError("sourceStart is out of range");if(d<0)throw new RangeError("sourceEnd is out of range");c>=a.byteLength&&(c=a.byteLength),d>e.byteLength&&(d=e.byteLength),a.byteLength-c=d||f<=c?"":(c<0&&(c=0),f>d&&(f=d),(0!==c||f{function a(e){return e.length}e.exports={byteLength:a,toString:function(e){const a=e.byteLength;let c="";for(let f=0;f{const a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=new Uint8Array(256);for(let e=0;e<64;e++)c[a.charCodeAt(e)]=e;function f(e){let a=e.length;return 61===e.charCodeAt(a-1)&&a--,a>1&&61===e.charCodeAt(a-1)&&a--,3*a>>>2}c[45]=62,c[95]=63,e.exports={byteLength:f,toString:function(e){const c=e.byteLength;let f="";for(let d=0;d>2]+a[(3&e[d])<<4|e[d+1]>>4]+a[(15&e[d+1])<<2|e[d+2]>>6]+a[63&e[d+2]];return c%3==2?f=f.substring(0,f.length-1)+"=":c%3==1&&(f=f.substring(0,f.length-2)+"=="),f},write:function(e,a,d=0,b=f(a)){const t=Math.min(b,e.byteLength-d);for(let f=0,d=0;d>4,e[d++]=(15&t)<<4|i>>2,e[d++]=(3&i)<<6|63&r}return t}}},1847:e=>{function a(e){return e.length>>>1}function c(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:void 0}e.exports={byteLength:a,toString:function(e){const a=e.byteLength;e=new DataView(e.buffer,e.byteOffset,a);let c="",f=0;for(let d=a-a%4;f{function a(e){return 2*e.length}e.exports={byteLength:a,toString:function(e){const a=e.byteLength;let c="";for(let f=0;f>8,t=d%256;e[f+2*a]=t,e[f+2*a+1]=b}return b}}},6679:e=>{function a(e){let a=0;for(let c=0,f=e.length;c=55296&&d<=56319&&c+1=56320&&f<=57343){a+=4,c++;continue}}a+=d<=127?1:d<=2047?2:3}return a}let c,f;if("undefined"!=typeof TextDecoder){const e=new TextDecoder;c=function(a){return e.decode(a)}}else c=function(e){const a=e.byteLength;let c="",f=0;for(;f0){let a=0;for(;a>f,f-=6;f>=0;)e[i++]=128|a>>f&63,f-=6;t+=a>=65536?2:1}return b};e.exports={byteLength:a,toString:c,write:f}},5364:(e,a,c)=>{"use strict";var f=c(2861).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var a=new Uint8Array(256),c=0;c>>0,o=new Uint8Array(t);c>>0,o[h]=s%256>>>0,s=s/256>>>0;if(0!==s)throw new Error("Non-zero carry");b=l,c++}for(var u=t-b;u!==t&&0===o[u];)u++;var x=f.allocUnsafe(d+(t-u));x.fill(0,0,d);for(var p=d;u!==t;)x[p++]=o[u++];return x}return{encode:function(a){if((Array.isArray(a)||a instanceof Uint8Array)&&(a=f.from(a)),!f.isBuffer(a))throw new TypeError("Expected Buffer");if(0===a.length)return"";for(var c=0,d=0,b=0,t=a.length;b!==t&&0===a[b];)b++,c++;for(var n=(t-b)*o+1>>>0,s=new Uint8Array(n);b!==t;){for(var l=a[b],h=0,u=n-1;(0!==l||h>>0,s[u]=l%i>>>0,l=l/i>>>0;if(0!==l)throw new Error("Non-zero carry");d=h,b++}for(var x=n-d;x!==n&&0===s[x];)x++;for(var p=r.repeat(c);x{"use strict";a.byteLength=function(e){var a=i(e),c=a[0],f=a[1];return 3*(c+f)/4-f},a.toByteArray=function(e){var a,c,b=i(e),t=b[0],r=b[1],n=new d(function(e,a,c){return 3*(a+c)/4-c}(0,t,r)),o=0,s=r>0?t-4:t;for(c=0;c>16&255,n[o++]=a>>8&255,n[o++]=255&a;return 2===r&&(a=f[e.charCodeAt(c)]<<2|f[e.charCodeAt(c+1)]>>4,n[o++]=255&a),1===r&&(a=f[e.charCodeAt(c)]<<10|f[e.charCodeAt(c+1)]<<4|f[e.charCodeAt(c+2)]>>2,n[o++]=a>>8&255,n[o++]=255&a),n},a.fromByteArray=function(e){for(var a,f=e.length,d=f%3,b=[],t=16383,i=0,n=f-d;in?n:i+t));return 1===d?(a=e[f-1],b.push(c[a>>2]+c[a<<4&63]+"==")):2===d&&(a=(e[f-2]<<8)+e[f-1],b.push(c[a>>10]+c[a>>4&63]+c[a<<2&63]+"=")),b.join("")};for(var c=[],f=[],d="undefined"!=typeof Uint8Array?Uint8Array:Array,b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)c[t]=b[t],f[b.charCodeAt(t)]=t;function i(e){var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=e.indexOf("=");return-1===c&&(c=a),[c,c===a?0:4-c%4]}function r(e,a,f){for(var d,b,t=[],i=a;i>18&63]+c[b>>12&63]+c[b>>6&63]+c[63&b]);return t.join("")}f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63},654:(e,a,c)=>{e.exports=c(5702)(c(6989))},4315:(e,a,c)=>{var f=c(2045).hp;const d=c(8399).Transform;e.exports=class extends d{constructor(e,a){super(a),this._engine=e,this._finalized=!1}_transform(e,a,c){let f=null;try{this.update(e,a)}catch(e){f=e}c(f)}_flush(e){let a=null;try{this.push(this.digest())}catch(e){a=e}e(a)}update(e,a){if(!f.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return f.isBuffer(e)||(e=f.from(e,a)),this._engine.update(e),this}digest(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;let a=this._engine.digest();return void 0!==e&&(a=a.toString(e)),a}}},5702:(e,a,c)=>{const f=c(4315);e.exports=e=>(a,c)=>{const d=(a=>{switch("string"==typeof a?a.toLowerCase():a){case"blake224":return e.Blake224;case"blake256":return e.Blake256;case"blake384":return e.Blake384;case"blake512":return e.Blake512;default:throw new Error("Invald algorithm: "+a)}})(a);return new f(new d,c)}},4588:(e,a,c)=>{var f=c(2045).hp;class d{_lengthCarry(e){for(let a=0;a=a.length;){for(let f=this._blockOffset;f{var f=c(2045).hp;const d=c(3287),b=f.from([0]),t=f.from([128]);e.exports=class extends d{constructor(){super(),this._h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],this._zo=b,this._oo=t}digest(){this._padding();const e=f.alloc(28);for(let a=0;a<7;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},3287:(e,a,c)=>{var f=c(2045).hp;const d=c(4588),b=f.from([1]),t=f.from([129]),i=(e,a)=>(e<<32-a|e>>>a)>>>0;function r(e,a,c,f,b,t,r,n){const o=d.sigma,s=d.u256;e[f]=e[f]+((a[o[c][n]]^s[o[c][n+1]])>>>0)+e[b]>>>0,e[r]=i(e[r]^e[f],16),e[t]=e[t]+e[r]>>>0,e[b]=i(e[b]^e[t],12),e[f]=e[f]+((a[o[c][n+1]]^s[o[c][n]])>>>0)+e[b]>>>0,e[r]=i(e[r]^e[f],8),e[t]=e[t]+e[r]>>>0,e[b]=i(e[b]^e[t],7)}e.exports=class extends d{constructor(){super(),this._h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this._s=[0,0,0,0],this._block=f.alloc(64),this._blockOffset=0,this._length=[0,0],this._nullt=!1,this._zo=b,this._oo=t}_compress(){const e=d.u256,a=new Array(16),c=new Array(16);let f;for(f=0;f<16;++f)c[f]=this._block.readUInt32BE(4*f);for(f=0;f<8;++f)a[f]=this._h[f]>>>0;for(f=8;f<12;++f)a[f]=(this._s[f-8]^e[f-8])>>>0;for(f=12;f<16;++f)a[f]=e[f-8];for(this._nullt||(a[12]=(a[12]^this._length[0])>>>0,a[13]=(a[13]^this._length[0])>>>0,a[14]=(a[14]^this._length[1])>>>0,a[15]=(a[15]^this._length[1])>>>0),f=0;f<14;++f)r(a,c,f,0,4,8,12,0),r(a,c,f,1,5,9,13,2),r(a,c,f,2,6,10,14,4),r(a,c,f,3,7,11,15,6),r(a,c,f,0,5,10,15,8),r(a,c,f,1,6,11,12,10),r(a,c,f,2,7,8,13,12),r(a,c,f,3,4,9,14,14);for(f=0;f<16;++f)this._h[f%8]=(this._h[f%8]^a[f])>>>0;for(f=0;f<8;++f)this._h[f]=(this._h[f]^this._s[f%4])>>>0}_padding(){let e=this._length[0]+8*this._blockOffset,a=this._length[1];e>=4294967296&&(e-=4294967296,a+=1);const c=f.alloc(8);c.writeUInt32BE(a,0),c.writeUInt32BE(e,4),55===this._blockOffset?(this._length[0]-=8,this.update(this._oo)):(this._blockOffset<55?(0===this._blockOffset&&(this._nullt=!0),this._length[0]-=8*(55-this._blockOffset),this.update(d.padding.slice(0,55-this._blockOffset))):(this._length[0]-=8*(64-this._blockOffset),this.update(d.padding.slice(0,64-this._blockOffset)),this._length[0]-=440,this.update(d.padding.slice(1,56)),this._nullt=!0),this.update(this._zo),this._length[0]-=8),this._length[0]-=64,this.update(c)}digest(){this._padding();const e=f.alloc(32);for(let a=0;a<8;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},399:(e,a,c)=>{var f=c(2045).hp;const d=c(1070),b=f.from([0]),t=f.from([128]);e.exports=class extends d{constructor(){super(),this._h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428],this._zo=b,this._oo=t}digest(){this._padding();const e=f.alloc(48);for(let a=0;a<12;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},1070:(e,a,c)=>{var f=c(2045).hp;const d=c(4588),b=f.from([1]),t=f.from([129]);function i(e,a,c,f){let d=e[2*a]^e[2*c],b=e[2*a+1]^e[2*c+1];f>=32&&(b^=d,d^=b,b^=d,f-=32),0===f?(e[2*a]=d>>>0,e[2*a+1]=b>>>0):(e[2*a]=(d>>>f|b<<32-f)>>>0,e[2*a+1]=(b>>>f|d<<32-f)>>>0)}function r(e,a,c,f,b,t,r,n){const o=d.sigma,s=d.u512;let l;l=e[2*f+1]+((a[2*o[c][n]+1]^s[2*o[c][n+1]+1])>>>0)+e[2*b+1],e[2*f]=e[2*f]+((a[2*o[c][n]]^s[2*o[c][n+1]])>>>0)+e[2*b]+~~(l/4294967296)>>>0,e[2*f+1]=l>>>0,i(e,r,f,32),l=e[2*t+1]+e[2*r+1],e[2*t]=e[2*t]+e[2*r]+~~(l/4294967296)>>>0,e[2*t+1]=l>>>0,i(e,b,t,25),l=e[2*f+1]+((a[2*o[c][n+1]+1]^s[2*o[c][n]+1])>>>0)+e[2*b+1],e[2*f]=e[2*f]+((a[2*o[c][n+1]]^s[2*o[c][n]])>>>0)+e[2*b]+~~(l/4294967296)>>>0,e[2*f+1]=l>>>0,i(e,r,f,16),l=e[2*t+1]+e[2*r+1],e[2*t]=e[2*t]+e[2*r]+~~(l/4294967296)>>>0,e[2*t+1]=l>>>0,i(e,b,t,11)}e.exports=class extends d{constructor(){super(),this._h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this._s=[0,0,0,0,0,0,0,0],this._block=f.alloc(128),this._blockOffset=0,this._length=[0,0,0,0],this._nullt=!1,this._zo=b,this._oo=t}_compress(){const e=d.u512,a=new Array(32),c=new Array(32);let f;for(f=0;f<32;++f)c[f]=this._block.readUInt32BE(4*f);for(f=0;f<16;++f)a[f]=this._h[f]>>>0;for(f=16;f<24;++f)a[f]=(this._s[f-16]^e[f-16])>>>0;for(f=24;f<32;++f)a[f]=e[f-16];for(this._nullt||(a[24]=(a[24]^this._length[1])>>>0,a[25]=(a[25]^this._length[0])>>>0,a[26]=(a[26]^this._length[1])>>>0,a[27]=(a[27]^this._length[0])>>>0,a[28]=(a[28]^this._length[3])>>>0,a[29]=(a[29]^this._length[2])>>>0,a[30]=(a[30]^this._length[3])>>>0,a[31]=(a[31]^this._length[2])>>>0),f=0;f<16;++f)r(a,c,f,0,4,8,12,0),r(a,c,f,1,5,9,13,2),r(a,c,f,2,6,10,14,4),r(a,c,f,3,7,11,15,6),r(a,c,f,0,5,10,15,8),r(a,c,f,1,6,11,12,10),r(a,c,f,2,7,8,13,12),r(a,c,f,3,4,9,14,14);for(f=0;f<16;++f)this._h[f%8*2]=(this._h[f%8*2]^a[2*f])>>>0,this._h[f%8*2+1]=(this._h[f%8*2+1]^a[2*f+1])>>>0;for(f=0;f<8;++f)this._h[2*f]=(this._h[2*f]^this._s[f%4*2])>>>0,this._h[2*f+1]=(this._h[2*f+1]^this._s[f%4*2+1])>>>0}_padding(){const e=this._length.slice();e[0]+=8*this._blockOffset,this._lengthCarry(e);const a=f.alloc(16);for(let c=0;c<4;++c)a.writeUInt32BE(e[3-c],4*c);111===this._blockOffset?(this._length[0]-=8,this.update(this._oo)):(this._blockOffset<111?(0===this._blockOffset&&(this._nullt=!0),this._length[0]-=8*(111-this._blockOffset),this.update(d.padding.slice(0,111-this._blockOffset))):(this._length[0]-=8*(128-this._blockOffset),this.update(d.padding.slice(0,128-this._blockOffset)),this._length[0]-=888,this.update(d.padding.slice(1,112)),this._nullt=!0),this.update(this._zo),this._length[0]-=8),this._length[0]-=128,this.update(a)}digest(){this._padding();const e=f.alloc(64);for(let a=0;a<16;++a)e.writeUInt32BE(this._h[a],4*a);return e}}},6989:(e,a,c)=>{e.exports={Blake224:c(8746),Blake256:c(3287),Blake384:c(399),Blake512:c(1070)}},1892:e=>{var a,c,f=(()=>{for(var e=new Uint8Array(128),a=0;a<64;a++)e[a<26?a+65:a<52?a+71:a<62?a-4:4*a-205]=a;return a=>{for(var c=a.length,f=new Uint8Array(3*(c-("="==a[c-1])-("="==a[c-2]))/4|0),d=0,b=0;d>4,f[b++]=i<<4|r>>2,f[b++]=r<<6|n}return f}})(),d=(a={"wasm-binary:./blake2b.wat"(e,a){a.exports=f("AGFzbQEAAAABEANgAn9/AGADf39/AGABfwADBQQAAQICBQUBAQroBwdNBQZtZW1vcnkCAAxibGFrZTJiX2luaXQAAA5ibGFrZTJiX3VwZGF0ZQABDWJsYWtlMmJfZmluYWwAAhBibGFrZTJiX2NvbXByZXNzAAMKvz8EwAIAIABCADcDACAAQgA3AwggAEIANwMQIABCADcDGCAAQgA3AyAgAEIANwMoIABCADcDMCAAQgA3AzggAEIANwNAIABCADcDSCAAQgA3A1AgAEIANwNYIABCADcDYCAAQgA3A2ggAEIANwNwIABCADcDeCAAQoiS853/zPmE6gBBACkDAIU3A4ABIABCu86qptjQ67O7f0EIKQMAhTcDiAEgAEKr8NP0r+68tzxBECkDAIU3A5ABIABC8e30+KWn/aelf0EYKQMAhTcDmAEgAELRhZrv+s+Uh9EAQSApAwCFNwOgASAAQp/Y+dnCkdqCm39BKCkDAIU3A6gBIABC6/qG2r+19sEfQTApAwCFNwOwASAAQvnC+JuRo7Pw2wBBOCkDAIU3A7gBIABCADcDwAEgAEIANwPIASAAQgA3A9ABC20BA38gAEHAAWohAyAAQcgBaiEEIAQpAwCnIQUCQANAIAEgAkYNASAFQYABRgRAIAMgAykDACAFrXw3AwBBACEFIAAQAwsgACAFaiABLQAAOgAAIAVBAWohBSABQQFqIQEMAAsLIAQgBa03AwALYQEDfyAAQcABaiEBIABByAFqIQIgASABKQMAIAIpAwB8NwMAIABCfzcD0AEgAikDAKchAwJAA0AgA0GAAUYNASAAIANqQQA6AAAgA0EBaiEDDAALCyACIAOtNwMAIAAQAwuqOwIgfgl/IABBgAFqISEgAEGIAWohIiAAQZABaiEjIABBmAFqISQgAEGgAWohJSAAQagBaiEmIABBsAFqIScgAEG4AWohKCAhKQMAIQEgIikDACECICMpAwAhAyAkKQMAIQQgJSkDACEFICYpAwAhBiAnKQMAIQcgKCkDACEIQoiS853/zPmE6gAhCUK7zqqm2NDrs7t/IQpCq/DT9K/uvLc8IQtC8e30+KWn/aelfyEMQtGFmu/6z5SH0QAhDUKf2PnZwpHagpt/IQ5C6/qG2r+19sEfIQ9C+cL4m5Gjs/DbACEQIAApAwAhESAAKQMIIRIgACkDECETIAApAxghFCAAKQMgIRUgACkDKCEWIAApAzAhFyAAKQM4IRggACkDQCEZIAApA0ghGiAAKQNQIRsgACkDWCEcIAApA2AhHSAAKQNoIR4gACkDcCEfIAApA3ghICANIAApA8ABhSENIA8gACkD0AGFIQ8gASAFIBF8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSASfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgE3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBR8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAVfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgFnx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBd8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAYfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgGXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBp8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAbfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgHHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIB18fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAefHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgH3x8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFICB8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAffHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgG3x8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBV8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAZfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgGnx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHICB8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAefHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggF3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBJ8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAdfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgEXx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBN8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAcfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggGHx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBZ8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAUfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgHHx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBl8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAdfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgEXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBZ8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByATfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggIHx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIB58fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAbfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgH3x8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBR8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAXfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggGHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBJ8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAafHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFXx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBh8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAafHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgFHx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBJ8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAefHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHXx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBx8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAffHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgE3x8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBd8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAWfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgG3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBV8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCARfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgIHx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBl8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAafHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEXx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBZ8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAYfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgE3x8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBV8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAbfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggIHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIB98fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiASfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgHHx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIB18fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAXfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggGXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBR8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAefHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgE3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIB18fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAXfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgG3x8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBF8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAcfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggGXx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBR8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAVfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBh8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAWfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggIHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIB98fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSASfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgGnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIB18fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAWfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgEnx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGICB8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAffHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHnx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBV8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAbfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgEXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBh8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAXfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgFHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBp8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCATfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgGXx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBx8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAefHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgHHx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBh8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAffHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgHXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBJ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAUfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGnx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBZ8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiARfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgIHx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBV8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAZfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggF3x8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBN8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAbfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgF3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFICB8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAffHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGnx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBx8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAUfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggEXx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBl8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAdfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgE3x8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIB58fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAYfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggEnx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBV8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAbfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBt8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSATfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgGXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBV8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAYfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgF3x8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBJ8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAWfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgIHx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBx8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAafHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgH3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBR8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAdfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgHnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBF8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSARfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBN8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAUfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgFXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBZ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAXfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBl8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAafHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgG3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBx8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAdfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHnx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB98fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAgfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgH3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBt8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAVfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBp8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAgfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggHnx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBd8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiASfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBF8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByATfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBh8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAWfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgISAhKQMAIAEgCYWFNwMAICIgIikDACACIAqFhTcDACAjICMpAwAgAyALhYU3AwAgJCAkKQMAIAQgDIWFNwMAICUgJSkDACAFIA2FhTcDACAmICYpAwAgBiAOhYU3AwAgJyAnKQMAIAcgD4WFNwMAICggKCkDACAIIBCFhTcDAAs=")}},function(){return c||(0,a[Object.keys(a)[0]])((c={exports:{}}).exports,c),c.exports})(),b=WebAssembly.compile(d);e.exports=async e=>(await WebAssembly.instantiate(await b,e)).exports},1685:(e,a,c)=>{var f=c(6889),d=c(5682),b=null,t="undefined"!=typeof WebAssembly&&c(1892)().then((e=>{b=e})),i=64,r=[];e.exports=x;var n=e.exports.BYTES_MIN=16,o=e.exports.BYTES_MAX=64,s=(e.exports.BYTES=32,e.exports.KEYBYTES_MIN=16),l=e.exports.KEYBYTES_MAX=64,h=(e.exports.KEYBYTES=32,e.exports.SALTBYTES=16),u=e.exports.PERSONALBYTES=16;function x(e,a,c,d,t){if(!(this instanceof x))return new x(e,a,c,d,t);if(!b)throw new Error("WASM not loaded. Wait for Blake2b.ready(cb)");e||(e=32),!0!==t&&(f(e>=n,"digestLength must be at least "+n+", was given "+e),f(e<=o,"digestLength must be at most "+o+", was given "+e),null!=a&&(f(a instanceof Uint8Array,"key must be Uint8Array or Buffer"),f(a.length>=s,"key must be at least "+s+", was given "+a.length),f(a.length<=l,"key must be at least "+l+", was given "+a.length)),null!=c&&(f(c instanceof Uint8Array,"salt must be Uint8Array or Buffer"),f(c.length===h,"salt must be exactly "+h+", was given "+c.length)),null!=d&&(f(d instanceof Uint8Array,"personal must be Uint8Array or Buffer"),f(d.length===u,"personal must be exactly "+u+", was given "+d.length))),r.length||(r.push(i),i+=216),this.digestLength=e,this.finalized=!1,this.pointer=r.pop(),this._memory=new Uint8Array(b.memory.buffer),this._memory.fill(0,0,64),this._memory[0]=this.digestLength,this._memory[1]=a?a.length:0,this._memory[2]=1,this._memory[3]=1,c&&this._memory.set(c,32),d&&this._memory.set(d,48),this.pointer+216>this._memory.length&&this._realloc(this.pointer+216),b.blake2b_init(this.pointer,this.digestLength),a&&(this.update(a),this._memory.fill(0,i,i+a.length),this._memory[this.pointer+200]=128)}function p(){}x.prototype._realloc=function(e){b.memory.grow(Math.max(0,Math.ceil(Math.abs(e-this._memory.length)/65536))),this._memory=new Uint8Array(b.memory.buffer)},x.prototype.update=function(e){return f(!1===this.finalized,"Hash instance finalized"),f(e instanceof Uint8Array,"input must be Uint8Array or Buffer"),i+e.length>this._memory.length&&this._realloc(i+e.length),this._memory.set(e,i),b.blake2b_update(this.pointer,i,i+e.length),this},x.prototype.digest=function(e){if(f(!1===this.finalized,"Hash instance finalized"),this.finalized=!0,r.push(this.pointer),b.blake2b_final(this.pointer),!e||"binary"===e)return this._memory.slice(this.pointer+128,this.pointer+128+this.digestLength);if("string"==typeof e)return d.toString(this._memory,e,this.pointer+128,this.pointer+128+this.digestLength);f(e instanceof Uint8Array&&e.length>=this.digestLength,"input must be Uint8Array or Buffer");for(var a=0;ae()),e):e(new Error("WebAssembly not supported"))},x.prototype.ready=x.ready,x.prototype.getPartialHash=function(){return this._memory.slice(this.pointer,this.pointer+216)},x.prototype.setPartialHash=function(e){this._memory.set(e,this.pointer)}},2206:(e,a,c)=>{var f=c(6889),d=c(1685);function b(e,a,c){var f=e[a]+e[c],d=e[a+1]+e[c+1];f>=4294967296&&d++,e[a]=f,e[a+1]=d}function t(e,a,c,f){var d=e[a]+c;c<0&&(d+=4294967296);var b=e[a+1]+f;d>=4294967296&&b++,e[a]=d,e[a+1]=b}function i(e,a){return e[a]^e[a+1]<<8^e[a+2]<<16^e[a+3]<<24}function r(e,a,c,f,d,i){var r=l[d],n=l[d+1],o=l[i],h=l[i+1];b(s,e,a),t(s,e,r,n);var u=s[f]^s[e],x=s[f+1]^s[e+1];s[f]=x,s[f+1]=u,b(s,c,f),u=s[a]^s[c],x=s[a+1]^s[c+1],s[a]=u>>>24^x<<8,s[a+1]=x>>>24^u<<8,b(s,e,a),t(s,e,o,h),u=s[f]^s[e],x=s[f+1]^s[e+1],s[f]=u>>>16^x<<16,s[f+1]=x>>>16^u<<16,b(s,c,f),u=s[a]^s[c],x=s[a+1]^s[c+1],s[a]=x>>>31^u<<1,s[a+1]=u>>>31^x<<1}var n=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),o=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(e){return 2*e}))),s=new Uint32Array(32),l=new Uint32Array(32);function h(e,a){var c=0;for(c=0;c<16;c++)s[c]=e.h[c],s[c+16]=n[c];for(s[24]=s[24]^e.t,s[25]=s[25]^e.t/4294967296,a&&(s[28]=~s[28],s[29]=~s[29]),c=0;c<32;c++)l[c]=i(e.b,4*c);for(c=0;c<12;c++)r(0,8,16,24,o[16*c+0],o[16*c+1]),r(2,10,18,26,o[16*c+2],o[16*c+3]),r(4,12,20,28,o[16*c+4],o[16*c+5]),r(6,14,22,30,o[16*c+6],o[16*c+7]),r(0,10,20,30,o[16*c+8],o[16*c+9]),r(2,12,22,24,o[16*c+10],o[16*c+11]),r(4,14,16,26,o[16*c+12],o[16*c+13]),r(6,8,18,28,o[16*c+14],o[16*c+15]);for(c=0;c<16;c++)e.h[c]=e.h[c]^s[c]^s[c+16]}var u=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 x(e,a,c,f){u.fill(0),this.b=new Uint8Array(128),this.h=new Uint32Array(16),this.t=0,this.c=0,this.outlen=e,u[0]=e,a&&(u[1]=a.length),u[2]=1,u[3]=1,c&&u.set(c,32),f&&u.set(f,48);for(var d=0;d<16;d++)this.h[d]=n[d]^i(u,4*d);a&&(p(this,a),this.c=128)}function p(e,a){for(var c=0;c=this.outlen,"out must have at least outlen bytes of space"),function(e,a){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;h(e,!0);for(var c=0;c>2]>>8*(3&c)}(this,a),"hex"===e?function(e){for(var a="",c=0;c=m,"outlen must be at least "+m+", was given "+e),f(e<=y,"outlen must be at most "+y+", was given "+e),null!=a&&(f(a instanceof Uint8Array,"key must be Uint8Array or Buffer"),f(a.length>=_,"key must be at least "+_+", was given "+a.length),f(a.length<=v,"key must be at most "+v+", was given "+a.length)),null!=c&&(f(c instanceof Uint8Array,"salt must be Uint8Array or Buffer"),f(c.length===w,"salt must be exactly "+w+", was given "+c.length)),null!=d&&(f(d instanceof Uint8Array,"personal must be Uint8Array or Buffer"),f(d.length===M,"personal must be exactly "+M+", was given "+d.length))),new g(e,a,c,d)},e.exports.ready=function(e){d.ready((function(){e()}))},e.exports.WASM_SUPPORTED=d.SUPPORTED,e.exports.WASM_LOADED=!1;var m=e.exports.BYTES_MIN=16,y=e.exports.BYTES_MAX=64,_=(e.exports.BYTES=32,e.exports.KEYBYTES_MIN=16),v=e.exports.KEYBYTES_MAX=64,w=(e.exports.KEYBYTES=32,e.exports.SALTBYTES=16),M=e.exports.PERSONALBYTES=16;d.ready((function(a){a||(e.exports.WASM_LOADED=!0,e.exports=d)}))},9404:function(e,a,c){!function(e,a){"use strict";function f(e,a){if(!e)throw new Error(a||"Assertion failed")}function d(e,a){e.super_=a;var c=function(){};c.prototype=a.prototype,e.prototype=new c,e.prototype.constructor=e}function b(e,a,c){if(b.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==a&&"be"!==a||(c=a,a=10),this._init(e||0,a||10,c||"be"))}var t;"object"==typeof e?e.exports=b:a.BN=b,b.BN=b,b.wordSize=26;try{t="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:c(7790).Buffer}catch(e){}function i(e,a){var c=e.charCodeAt(a);return c>=48&&c<=57?c-48:c>=65&&c<=70?c-55:c>=97&&c<=102?c-87:void f(!1,"Invalid character in "+e)}function r(e,a,c){var f=i(e,c);return c-1>=a&&(f|=i(e,c-1)<<4),f}function n(e,a,c,d){for(var b=0,t=0,i=Math.min(e.length,c),r=a;r=49?n-49+10:n>=17?n-17+10:n,f(n>=0&&t0?e:a},b.min=function(e,a){return e.cmp(a)<0?e:a},b.prototype._init=function(e,a,c){if("number"==typeof e)return this._initNumber(e,a,c);if("object"==typeof e)return this._initArray(e,a,c);"hex"===a&&(a=16),f(a===(0|a)&&a>=2&&a<=36);var d=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(d++,this.negative=1),d=0;d-=3)t=e[d]|e[d-1]<<8|e[d-2]<<16,this.words[b]|=t<>>26-i&67108863,(i+=24)>=26&&(i-=26,b++);else if("le"===c)for(d=0,b=0;d>>26-i&67108863,(i+=24)>=26&&(i-=26,b++);return this._strip()},b.prototype._parseHex=function(e,a,c){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var f=0;f=a;f-=2)d=r(e,a,f)<=18?(b-=18,t+=1,this.words[t]|=d>>>26):b+=8;else for(f=(e.length-a)%2==0?a+1:a;f=18?(b-=18,t+=1,this.words[t]|=d>>>26):b+=8;this._strip()},b.prototype._parseBase=function(e,a,c){this.words=[0],this.length=1;for(var f=0,d=1;d<=67108863;d*=a)f++;f--,d=d/a|0;for(var b=e.length-c,t=b%f,i=Math.min(b,b-t)+c,r=0,o=c;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},b.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{b.prototype[Symbol.for("nodejs.util.inspect.custom")]=s}catch(e){b.prototype.inspect=s}else b.prototype.inspect=s;function s(){return(this.red?""}var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[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 x(e,a,c){c.negative=a.negative^e.negative;var f=e.length+a.length|0;c.length=f,f=f-1|0;var d=0|e.words[0],b=0|a.words[0],t=d*b,i=67108863&t,r=t/67108864|0;c.words[0]=i;for(var n=1;n>>26,s=67108863&r,l=Math.min(n,a.length-1),h=Math.max(0,n-e.length+1);h<=l;h++){var u=n-h|0;o+=(t=(d=0|e.words[u])*(b=0|a.words[h])+s)/67108864|0,s=67108863&t}c.words[n]=0|s,r=0|o}return 0!==r?c.words[n]=0|r:c.length--,c._strip()}b.prototype.toString=function(e,a){var c;if(a=0|a||1,16===(e=e||10)||"hex"===e){c="";for(var d=0,b=0,t=0;t>>24-d&16777215,(d+=2)>=26&&(d-=26,t--),c=0!==b||t!==this.length-1?l[6-r.length]+r+c:r+c}for(0!==b&&(c=b.toString(16)+c);c.length%a!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(e===(0|e)&&e>=2&&e<=36){var n=h[e],o=u[e];c="";var s=this.clone();for(s.negative=0;!s.isZero();){var x=s.modrn(o).toString(e);c=(s=s.idivn(o)).isZero()?x+c:l[n-x.length]+x+c}for(this.isZero()&&(c="0"+c);c.length%a!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}f(!1,"Base should be between 2 and 36")},b.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&f(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},b.prototype.toJSON=function(){return this.toString(16,2)},t&&(b.prototype.toBuffer=function(e,a){return this.toArrayLike(t,e,a)}),b.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},b.prototype.toArrayLike=function(e,a,c){this._strip();var d=this.byteLength(),b=c||Math.max(1,d);f(d<=b,"byte array longer than desired length"),f(b>0,"Requested array length <= 0");var t=function(e,a){return e.allocUnsafe?e.allocUnsafe(a):new e(a)}(e,b);return this["_toArrayLike"+("le"===a?"LE":"BE")](t,d),t},b.prototype._toArrayLikeLE=function(e,a){for(var c=0,f=0,d=0,b=0;d>8&255),c>16&255),6===b?(c>24&255),f=0,b=0):(f=t>>>24,b+=2)}if(c=0&&(e[c--]=t>>8&255),c>=0&&(e[c--]=t>>16&255),6===b?(c>=0&&(e[c--]=t>>24&255),f=0,b=0):(f=t>>>24,b+=2)}if(c>=0)for(e[c--]=f;c>=0;)e[c--]=0},Math.clz32?b.prototype._countBits=function(e){return 32-Math.clz32(e)}:b.prototype._countBits=function(e){var a=e,c=0;return a>=4096&&(c+=13,a>>>=13),a>=64&&(c+=7,a>>>=7),a>=8&&(c+=4,a>>>=4),a>=2&&(c+=2,a>>>=2),c+a},b.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,c=0;return 8191&a||(c+=13,a>>>=13),127&a||(c+=7,a>>>=7),15&a||(c+=4,a>>>=4),3&a||(c+=2,a>>>=2),1&a||c++,c},b.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},b.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},b.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},b.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var c=0;ce.length?this.clone().iand(e):e.clone().iand(this)},b.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},b.prototype.iuxor=function(e){var a,c;this.length>e.length?(a=this,c=e):(a=e,c=this);for(var f=0;fe.length?this.clone().ixor(e):e.clone().ixor(this)},b.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},b.prototype.inotn=function(e){f("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),c=e%26;this._expand(a),c>0&&a--;for(var d=0;d0&&(this.words[d]=~this.words[d]&67108863>>26-c),this._strip()},b.prototype.notn=function(e){return this.clone().inotn(e)},b.prototype.setn=function(e,a){f("number"==typeof e&&e>=0);var c=e/26|0,d=e%26;return this._expand(c+1),this.words[c]=a?this.words[c]|1<e.length?(c=this,f=e):(c=e,f=this);for(var d=0,b=0;b>>26;for(;0!==d&&b>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;be.length?this.clone().iadd(e):e.clone().iadd(this)},b.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var c,f,d=this.cmp(e);if(0===d)return this.negative=0,this.length=1,this.words[0]=0,this;d>0?(c=this,f=e):(c=e,f=this);for(var b=0,t=0;t>26,this.words[t]=67108863&a;for(;0!==b&&t>26,this.words[t]=67108863&a;if(0===b&&t>>13,h=0|t[1],u=8191&h,x=h>>>13,p=0|t[2],g=8191&p,m=p>>>13,y=0|t[3],_=8191&y,v=y>>>13,w=0|t[4],M=8191&w,A=w>>>13,L=0|t[5],I=8191&L,k=L>>>13,E=0|t[6],S=8191&E,C=E>>>13,B=0|t[7],F=8191&B,O=B>>>13,P=0|t[8],R=8191&P,T=P>>>13,U=0|t[9],j=8191&U,N=U>>>13,q=0|i[0],D=8191&q,z=q>>>13,Q=0|i[1],G=8191&Q,K=Q>>>13,H=0|i[2],V=8191&H,Z=H>>>13,W=0|i[3],Y=8191&W,J=W>>>13,$=0|i[4],X=8191&$,ee=$>>>13,ae=0|i[5],ce=8191&ae,fe=ae>>>13,de=0|i[6],be=8191&de,te=de>>>13,ie=0|i[7],re=8191&ie,ne=ie>>>13,oe=0|i[8],se=8191&oe,le=oe>>>13,he=0|i[9],ue=8191&he,xe=he>>>13;c.negative=e.negative^a.negative,c.length=19;var pe=(n+(f=Math.imul(s,D))|0)+((8191&(d=(d=Math.imul(s,z))+Math.imul(l,D)|0))<<13)|0;n=((b=Math.imul(l,z))+(d>>>13)|0)+(pe>>>26)|0,pe&=67108863,f=Math.imul(u,D),d=(d=Math.imul(u,z))+Math.imul(x,D)|0,b=Math.imul(x,z);var ge=(n+(f=f+Math.imul(s,G)|0)|0)+((8191&(d=(d=d+Math.imul(s,K)|0)+Math.imul(l,G)|0))<<13)|0;n=((b=b+Math.imul(l,K)|0)+(d>>>13)|0)+(ge>>>26)|0,ge&=67108863,f=Math.imul(g,D),d=(d=Math.imul(g,z))+Math.imul(m,D)|0,b=Math.imul(m,z),f=f+Math.imul(u,G)|0,d=(d=d+Math.imul(u,K)|0)+Math.imul(x,G)|0,b=b+Math.imul(x,K)|0;var me=(n+(f=f+Math.imul(s,V)|0)|0)+((8191&(d=(d=d+Math.imul(s,Z)|0)+Math.imul(l,V)|0))<<13)|0;n=((b=b+Math.imul(l,Z)|0)+(d>>>13)|0)+(me>>>26)|0,me&=67108863,f=Math.imul(_,D),d=(d=Math.imul(_,z))+Math.imul(v,D)|0,b=Math.imul(v,z),f=f+Math.imul(g,G)|0,d=(d=d+Math.imul(g,K)|0)+Math.imul(m,G)|0,b=b+Math.imul(m,K)|0,f=f+Math.imul(u,V)|0,d=(d=d+Math.imul(u,Z)|0)+Math.imul(x,V)|0,b=b+Math.imul(x,Z)|0;var ye=(n+(f=f+Math.imul(s,Y)|0)|0)+((8191&(d=(d=d+Math.imul(s,J)|0)+Math.imul(l,Y)|0))<<13)|0;n=((b=b+Math.imul(l,J)|0)+(d>>>13)|0)+(ye>>>26)|0,ye&=67108863,f=Math.imul(M,D),d=(d=Math.imul(M,z))+Math.imul(A,D)|0,b=Math.imul(A,z),f=f+Math.imul(_,G)|0,d=(d=d+Math.imul(_,K)|0)+Math.imul(v,G)|0,b=b+Math.imul(v,K)|0,f=f+Math.imul(g,V)|0,d=(d=d+Math.imul(g,Z)|0)+Math.imul(m,V)|0,b=b+Math.imul(m,Z)|0,f=f+Math.imul(u,Y)|0,d=(d=d+Math.imul(u,J)|0)+Math.imul(x,Y)|0,b=b+Math.imul(x,J)|0;var _e=(n+(f=f+Math.imul(s,X)|0)|0)+((8191&(d=(d=d+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;n=((b=b+Math.imul(l,ee)|0)+(d>>>13)|0)+(_e>>>26)|0,_e&=67108863,f=Math.imul(I,D),d=(d=Math.imul(I,z))+Math.imul(k,D)|0,b=Math.imul(k,z),f=f+Math.imul(M,G)|0,d=(d=d+Math.imul(M,K)|0)+Math.imul(A,G)|0,b=b+Math.imul(A,K)|0,f=f+Math.imul(_,V)|0,d=(d=d+Math.imul(_,Z)|0)+Math.imul(v,V)|0,b=b+Math.imul(v,Z)|0,f=f+Math.imul(g,Y)|0,d=(d=d+Math.imul(g,J)|0)+Math.imul(m,Y)|0,b=b+Math.imul(m,J)|0,f=f+Math.imul(u,X)|0,d=(d=d+Math.imul(u,ee)|0)+Math.imul(x,X)|0,b=b+Math.imul(x,ee)|0;var ve=(n+(f=f+Math.imul(s,ce)|0)|0)+((8191&(d=(d=d+Math.imul(s,fe)|0)+Math.imul(l,ce)|0))<<13)|0;n=((b=b+Math.imul(l,fe)|0)+(d>>>13)|0)+(ve>>>26)|0,ve&=67108863,f=Math.imul(S,D),d=(d=Math.imul(S,z))+Math.imul(C,D)|0,b=Math.imul(C,z),f=f+Math.imul(I,G)|0,d=(d=d+Math.imul(I,K)|0)+Math.imul(k,G)|0,b=b+Math.imul(k,K)|0,f=f+Math.imul(M,V)|0,d=(d=d+Math.imul(M,Z)|0)+Math.imul(A,V)|0,b=b+Math.imul(A,Z)|0,f=f+Math.imul(_,Y)|0,d=(d=d+Math.imul(_,J)|0)+Math.imul(v,Y)|0,b=b+Math.imul(v,J)|0,f=f+Math.imul(g,X)|0,d=(d=d+Math.imul(g,ee)|0)+Math.imul(m,X)|0,b=b+Math.imul(m,ee)|0,f=f+Math.imul(u,ce)|0,d=(d=d+Math.imul(u,fe)|0)+Math.imul(x,ce)|0,b=b+Math.imul(x,fe)|0;var we=(n+(f=f+Math.imul(s,be)|0)|0)+((8191&(d=(d=d+Math.imul(s,te)|0)+Math.imul(l,be)|0))<<13)|0;n=((b=b+Math.imul(l,te)|0)+(d>>>13)|0)+(we>>>26)|0,we&=67108863,f=Math.imul(F,D),d=(d=Math.imul(F,z))+Math.imul(O,D)|0,b=Math.imul(O,z),f=f+Math.imul(S,G)|0,d=(d=d+Math.imul(S,K)|0)+Math.imul(C,G)|0,b=b+Math.imul(C,K)|0,f=f+Math.imul(I,V)|0,d=(d=d+Math.imul(I,Z)|0)+Math.imul(k,V)|0,b=b+Math.imul(k,Z)|0,f=f+Math.imul(M,Y)|0,d=(d=d+Math.imul(M,J)|0)+Math.imul(A,Y)|0,b=b+Math.imul(A,J)|0,f=f+Math.imul(_,X)|0,d=(d=d+Math.imul(_,ee)|0)+Math.imul(v,X)|0,b=b+Math.imul(v,ee)|0,f=f+Math.imul(g,ce)|0,d=(d=d+Math.imul(g,fe)|0)+Math.imul(m,ce)|0,b=b+Math.imul(m,fe)|0,f=f+Math.imul(u,be)|0,d=(d=d+Math.imul(u,te)|0)+Math.imul(x,be)|0,b=b+Math.imul(x,te)|0;var Me=(n+(f=f+Math.imul(s,re)|0)|0)+((8191&(d=(d=d+Math.imul(s,ne)|0)+Math.imul(l,re)|0))<<13)|0;n=((b=b+Math.imul(l,ne)|0)+(d>>>13)|0)+(Me>>>26)|0,Me&=67108863,f=Math.imul(R,D),d=(d=Math.imul(R,z))+Math.imul(T,D)|0,b=Math.imul(T,z),f=f+Math.imul(F,G)|0,d=(d=d+Math.imul(F,K)|0)+Math.imul(O,G)|0,b=b+Math.imul(O,K)|0,f=f+Math.imul(S,V)|0,d=(d=d+Math.imul(S,Z)|0)+Math.imul(C,V)|0,b=b+Math.imul(C,Z)|0,f=f+Math.imul(I,Y)|0,d=(d=d+Math.imul(I,J)|0)+Math.imul(k,Y)|0,b=b+Math.imul(k,J)|0,f=f+Math.imul(M,X)|0,d=(d=d+Math.imul(M,ee)|0)+Math.imul(A,X)|0,b=b+Math.imul(A,ee)|0,f=f+Math.imul(_,ce)|0,d=(d=d+Math.imul(_,fe)|0)+Math.imul(v,ce)|0,b=b+Math.imul(v,fe)|0,f=f+Math.imul(g,be)|0,d=(d=d+Math.imul(g,te)|0)+Math.imul(m,be)|0,b=b+Math.imul(m,te)|0,f=f+Math.imul(u,re)|0,d=(d=d+Math.imul(u,ne)|0)+Math.imul(x,re)|0,b=b+Math.imul(x,ne)|0;var Ae=(n+(f=f+Math.imul(s,se)|0)|0)+((8191&(d=(d=d+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;n=((b=b+Math.imul(l,le)|0)+(d>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,f=Math.imul(j,D),d=(d=Math.imul(j,z))+Math.imul(N,D)|0,b=Math.imul(N,z),f=f+Math.imul(R,G)|0,d=(d=d+Math.imul(R,K)|0)+Math.imul(T,G)|0,b=b+Math.imul(T,K)|0,f=f+Math.imul(F,V)|0,d=(d=d+Math.imul(F,Z)|0)+Math.imul(O,V)|0,b=b+Math.imul(O,Z)|0,f=f+Math.imul(S,Y)|0,d=(d=d+Math.imul(S,J)|0)+Math.imul(C,Y)|0,b=b+Math.imul(C,J)|0,f=f+Math.imul(I,X)|0,d=(d=d+Math.imul(I,ee)|0)+Math.imul(k,X)|0,b=b+Math.imul(k,ee)|0,f=f+Math.imul(M,ce)|0,d=(d=d+Math.imul(M,fe)|0)+Math.imul(A,ce)|0,b=b+Math.imul(A,fe)|0,f=f+Math.imul(_,be)|0,d=(d=d+Math.imul(_,te)|0)+Math.imul(v,be)|0,b=b+Math.imul(v,te)|0,f=f+Math.imul(g,re)|0,d=(d=d+Math.imul(g,ne)|0)+Math.imul(m,re)|0,b=b+Math.imul(m,ne)|0,f=f+Math.imul(u,se)|0,d=(d=d+Math.imul(u,le)|0)+Math.imul(x,se)|0,b=b+Math.imul(x,le)|0;var Le=(n+(f=f+Math.imul(s,ue)|0)|0)+((8191&(d=(d=d+Math.imul(s,xe)|0)+Math.imul(l,ue)|0))<<13)|0;n=((b=b+Math.imul(l,xe)|0)+(d>>>13)|0)+(Le>>>26)|0,Le&=67108863,f=Math.imul(j,G),d=(d=Math.imul(j,K))+Math.imul(N,G)|0,b=Math.imul(N,K),f=f+Math.imul(R,V)|0,d=(d=d+Math.imul(R,Z)|0)+Math.imul(T,V)|0,b=b+Math.imul(T,Z)|0,f=f+Math.imul(F,Y)|0,d=(d=d+Math.imul(F,J)|0)+Math.imul(O,Y)|0,b=b+Math.imul(O,J)|0,f=f+Math.imul(S,X)|0,d=(d=d+Math.imul(S,ee)|0)+Math.imul(C,X)|0,b=b+Math.imul(C,ee)|0,f=f+Math.imul(I,ce)|0,d=(d=d+Math.imul(I,fe)|0)+Math.imul(k,ce)|0,b=b+Math.imul(k,fe)|0,f=f+Math.imul(M,be)|0,d=(d=d+Math.imul(M,te)|0)+Math.imul(A,be)|0,b=b+Math.imul(A,te)|0,f=f+Math.imul(_,re)|0,d=(d=d+Math.imul(_,ne)|0)+Math.imul(v,re)|0,b=b+Math.imul(v,ne)|0,f=f+Math.imul(g,se)|0,d=(d=d+Math.imul(g,le)|0)+Math.imul(m,se)|0,b=b+Math.imul(m,le)|0;var Ie=(n+(f=f+Math.imul(u,ue)|0)|0)+((8191&(d=(d=d+Math.imul(u,xe)|0)+Math.imul(x,ue)|0))<<13)|0;n=((b=b+Math.imul(x,xe)|0)+(d>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,f=Math.imul(j,V),d=(d=Math.imul(j,Z))+Math.imul(N,V)|0,b=Math.imul(N,Z),f=f+Math.imul(R,Y)|0,d=(d=d+Math.imul(R,J)|0)+Math.imul(T,Y)|0,b=b+Math.imul(T,J)|0,f=f+Math.imul(F,X)|0,d=(d=d+Math.imul(F,ee)|0)+Math.imul(O,X)|0,b=b+Math.imul(O,ee)|0,f=f+Math.imul(S,ce)|0,d=(d=d+Math.imul(S,fe)|0)+Math.imul(C,ce)|0,b=b+Math.imul(C,fe)|0,f=f+Math.imul(I,be)|0,d=(d=d+Math.imul(I,te)|0)+Math.imul(k,be)|0,b=b+Math.imul(k,te)|0,f=f+Math.imul(M,re)|0,d=(d=d+Math.imul(M,ne)|0)+Math.imul(A,re)|0,b=b+Math.imul(A,ne)|0,f=f+Math.imul(_,se)|0,d=(d=d+Math.imul(_,le)|0)+Math.imul(v,se)|0,b=b+Math.imul(v,le)|0;var ke=(n+(f=f+Math.imul(g,ue)|0)|0)+((8191&(d=(d=d+Math.imul(g,xe)|0)+Math.imul(m,ue)|0))<<13)|0;n=((b=b+Math.imul(m,xe)|0)+(d>>>13)|0)+(ke>>>26)|0,ke&=67108863,f=Math.imul(j,Y),d=(d=Math.imul(j,J))+Math.imul(N,Y)|0,b=Math.imul(N,J),f=f+Math.imul(R,X)|0,d=(d=d+Math.imul(R,ee)|0)+Math.imul(T,X)|0,b=b+Math.imul(T,ee)|0,f=f+Math.imul(F,ce)|0,d=(d=d+Math.imul(F,fe)|0)+Math.imul(O,ce)|0,b=b+Math.imul(O,fe)|0,f=f+Math.imul(S,be)|0,d=(d=d+Math.imul(S,te)|0)+Math.imul(C,be)|0,b=b+Math.imul(C,te)|0,f=f+Math.imul(I,re)|0,d=(d=d+Math.imul(I,ne)|0)+Math.imul(k,re)|0,b=b+Math.imul(k,ne)|0,f=f+Math.imul(M,se)|0,d=(d=d+Math.imul(M,le)|0)+Math.imul(A,se)|0,b=b+Math.imul(A,le)|0;var Ee=(n+(f=f+Math.imul(_,ue)|0)|0)+((8191&(d=(d=d+Math.imul(_,xe)|0)+Math.imul(v,ue)|0))<<13)|0;n=((b=b+Math.imul(v,xe)|0)+(d>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,f=Math.imul(j,X),d=(d=Math.imul(j,ee))+Math.imul(N,X)|0,b=Math.imul(N,ee),f=f+Math.imul(R,ce)|0,d=(d=d+Math.imul(R,fe)|0)+Math.imul(T,ce)|0,b=b+Math.imul(T,fe)|0,f=f+Math.imul(F,be)|0,d=(d=d+Math.imul(F,te)|0)+Math.imul(O,be)|0,b=b+Math.imul(O,te)|0,f=f+Math.imul(S,re)|0,d=(d=d+Math.imul(S,ne)|0)+Math.imul(C,re)|0,b=b+Math.imul(C,ne)|0,f=f+Math.imul(I,se)|0,d=(d=d+Math.imul(I,le)|0)+Math.imul(k,se)|0,b=b+Math.imul(k,le)|0;var Se=(n+(f=f+Math.imul(M,ue)|0)|0)+((8191&(d=(d=d+Math.imul(M,xe)|0)+Math.imul(A,ue)|0))<<13)|0;n=((b=b+Math.imul(A,xe)|0)+(d>>>13)|0)+(Se>>>26)|0,Se&=67108863,f=Math.imul(j,ce),d=(d=Math.imul(j,fe))+Math.imul(N,ce)|0,b=Math.imul(N,fe),f=f+Math.imul(R,be)|0,d=(d=d+Math.imul(R,te)|0)+Math.imul(T,be)|0,b=b+Math.imul(T,te)|0,f=f+Math.imul(F,re)|0,d=(d=d+Math.imul(F,ne)|0)+Math.imul(O,re)|0,b=b+Math.imul(O,ne)|0,f=f+Math.imul(S,se)|0,d=(d=d+Math.imul(S,le)|0)+Math.imul(C,se)|0,b=b+Math.imul(C,le)|0;var Ce=(n+(f=f+Math.imul(I,ue)|0)|0)+((8191&(d=(d=d+Math.imul(I,xe)|0)+Math.imul(k,ue)|0))<<13)|0;n=((b=b+Math.imul(k,xe)|0)+(d>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,f=Math.imul(j,be),d=(d=Math.imul(j,te))+Math.imul(N,be)|0,b=Math.imul(N,te),f=f+Math.imul(R,re)|0,d=(d=d+Math.imul(R,ne)|0)+Math.imul(T,re)|0,b=b+Math.imul(T,ne)|0,f=f+Math.imul(F,se)|0,d=(d=d+Math.imul(F,le)|0)+Math.imul(O,se)|0,b=b+Math.imul(O,le)|0;var Be=(n+(f=f+Math.imul(S,ue)|0)|0)+((8191&(d=(d=d+Math.imul(S,xe)|0)+Math.imul(C,ue)|0))<<13)|0;n=((b=b+Math.imul(C,xe)|0)+(d>>>13)|0)+(Be>>>26)|0,Be&=67108863,f=Math.imul(j,re),d=(d=Math.imul(j,ne))+Math.imul(N,re)|0,b=Math.imul(N,ne),f=f+Math.imul(R,se)|0,d=(d=d+Math.imul(R,le)|0)+Math.imul(T,se)|0,b=b+Math.imul(T,le)|0;var Fe=(n+(f=f+Math.imul(F,ue)|0)|0)+((8191&(d=(d=d+Math.imul(F,xe)|0)+Math.imul(O,ue)|0))<<13)|0;n=((b=b+Math.imul(O,xe)|0)+(d>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,f=Math.imul(j,se),d=(d=Math.imul(j,le))+Math.imul(N,se)|0,b=Math.imul(N,le);var Oe=(n+(f=f+Math.imul(R,ue)|0)|0)+((8191&(d=(d=d+Math.imul(R,xe)|0)+Math.imul(T,ue)|0))<<13)|0;n=((b=b+Math.imul(T,xe)|0)+(d>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Pe=(n+(f=Math.imul(j,ue))|0)+((8191&(d=(d=Math.imul(j,xe))+Math.imul(N,ue)|0))<<13)|0;return n=((b=Math.imul(N,xe))+(d>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r[0]=pe,r[1]=ge,r[2]=me,r[3]=ye,r[4]=_e,r[5]=ve,r[6]=we,r[7]=Me,r[8]=Ae,r[9]=Le,r[10]=Ie,r[11]=ke,r[12]=Ee,r[13]=Se,r[14]=Ce,r[15]=Be,r[16]=Fe,r[17]=Oe,r[18]=Pe,0!==n&&(r[19]=n,c.length++),c};function g(e,a,c){c.negative=a.negative^e.negative,c.length=e.length+a.length;for(var f=0,d=0,b=0;b>>26)|0)>>>26,t&=67108863}c.words[b]=i,f=t,t=d}return 0!==f?c.words[b]=f:c.length--,c._strip()}function m(e,a,c){return g(e,a,c)}function y(e,a){this.x=e,this.y=a}Math.imul||(p=x),b.prototype.mulTo=function(e,a){var c=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,a):c<63?x(this,e,a):c<1024?g(this,e,a):m(this,e,a)},y.prototype.makeRBT=function(e){for(var a=new Array(e),c=b.prototype._countBits(e)-1,f=0;f>=1;return f},y.prototype.permute=function(e,a,c,f,d,b){for(var t=0;t>>=1)d++;return 1<>>=13,c[2*t+1]=8191&b,b>>>=13;for(t=2*a;t>=26,c+=b/67108864|0,c+=t>>>26,this.words[d]=67108863&t}return 0!==c&&(this.words[d]=c,this.length++),a?this.ineg():this},b.prototype.muln=function(e){return this.clone().imuln(e)},b.prototype.sqr=function(){return this.mul(this)},b.prototype.isqr=function(){return this.imul(this.clone())},b.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),c=0;c>>d&1}return a}(e);if(0===a.length)return new b(1);for(var c=this,f=0;f=0);var a,c=e%26,d=(e-c)/26,b=67108863>>>26-c<<26-c;if(0!==c){var t=0;for(a=0;a>>26-c}t&&(this.words[a]=t,this.length++)}if(0!==d){for(a=this.length-1;a>=0;a--)this.words[a+d]=this.words[a];for(a=0;a=0),d=a?(a-a%26)/26:0;var b=e%26,t=Math.min((e-b)/26,this.length),i=67108863^67108863>>>b<t)for(this.length-=t,n=0;n=0&&(0!==o||n>=d);n--){var s=0|this.words[n];this.words[n]=o<<26-b|s>>>b,o=s&i}return r&&0!==o&&(r.words[r.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},b.prototype.ishrn=function(e,a,c){return f(0===this.negative),this.iushrn(e,a,c)},b.prototype.shln=function(e){return this.clone().ishln(e)},b.prototype.ushln=function(e){return this.clone().iushln(e)},b.prototype.shrn=function(e){return this.clone().ishrn(e)},b.prototype.ushrn=function(e){return this.clone().iushrn(e)},b.prototype.testn=function(e){f("number"==typeof e&&e>=0);var a=e%26,c=(e-a)/26,d=1<=0);var a=e%26,c=(e-a)/26;if(f(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)return this;if(0!==a&&c++,this.length=Math.min(c,this.length),0!==a){var d=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},b.prototype.isubn=function(e){if(f("number"==typeof e),f(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(r/67108864|0),this.words[d+c]=67108863&b}for(;d>26,this.words[d+c]=67108863&b;if(0===i)return this._strip();for(f(-1===i),i=0,d=0;d>26,this.words[d]=67108863&b;return this.negative=1,this._strip()},b.prototype._wordDiv=function(e,a){var c=(this.length,e.length),f=this.clone(),d=e,t=0|d.words[d.length-1];0!=(c=26-this._countBits(t))&&(d=d.ushln(c),f.iushln(c),t=0|d.words[d.length-1]);var i,r=f.length-d.length;if("mod"!==a){(i=new b(null)).length=r+1,i.words=new Array(i.length);for(var n=0;n=0;s--){var l=67108864*(0|f.words[d.length+s])+(0|f.words[d.length+s-1]);for(l=Math.min(l/t|0,67108863),f._ishlnsubmul(d,l,s);0!==f.negative;)l--,f.negative=0,f._ishlnsubmul(d,1,s),f.isZero()||(f.negative^=1);i&&(i.words[s]=l)}return i&&i._strip(),f._strip(),"div"!==a&&0!==c&&f.iushrn(c),{div:i||null,mod:f}},b.prototype.divmod=function(e,a,c){return f(!e.isZero()),this.isZero()?{div:new b(0),mod:new b(0)}:0!==this.negative&&0===e.negative?(i=this.neg().divmod(e,a),"mod"!==a&&(d=i.div.neg()),"div"!==a&&(t=i.mod.neg(),c&&0!==t.negative&&t.iadd(e)),{div:d,mod:t}):0===this.negative&&0!==e.negative?(i=this.divmod(e.neg(),a),"mod"!==a&&(d=i.div.neg()),{div:d,mod:i.mod}):this.negative&e.negative?(i=this.neg().divmod(e.neg(),a),"div"!==a&&(t=i.mod.neg(),c&&0!==t.negative&&t.isub(e)),{div:i.div,mod:t}):e.length>this.length||this.cmp(e)<0?{div:new b(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new b(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new b(this.modrn(e.words[0]))}:this._wordDiv(e,a);var d,t,i},b.prototype.div=function(e){return this.divmod(e,"div",!1).div},b.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},b.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},b.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var c=0!==a.div.negative?a.mod.isub(e):a.mod,f=e.ushrn(1),d=e.andln(1),b=c.cmp(f);return b<0||1===d&&0===b?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},b.prototype.modrn=function(e){var a=e<0;a&&(e=-e),f(e<=67108863);for(var c=(1<<26)%e,d=0,b=this.length-1;b>=0;b--)d=(c*d+(0|this.words[b]))%e;return a?-d:d},b.prototype.modn=function(e){return this.modrn(e)},b.prototype.idivn=function(e){var a=e<0;a&&(e=-e),f(e<=67108863);for(var c=0,d=this.length-1;d>=0;d--){var b=(0|this.words[d])+67108864*c;this.words[d]=b/e|0,c=b%e}return this._strip(),a?this.ineg():this},b.prototype.divn=function(e){return this.clone().idivn(e)},b.prototype.egcd=function(e){f(0===e.negative),f(!e.isZero());var a=this,c=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var d=new b(1),t=new b(0),i=new b(0),r=new b(1),n=0;a.isEven()&&c.isEven();)a.iushrn(1),c.iushrn(1),++n;for(var o=c.clone(),s=a.clone();!a.isZero();){for(var l=0,h=1;!(a.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(d.isOdd()||t.isOdd())&&(d.iadd(o),t.isub(s)),d.iushrn(1),t.iushrn(1);for(var u=0,x=1;!(c.words[0]&x)&&u<26;++u,x<<=1);if(u>0)for(c.iushrn(u);u-- >0;)(i.isOdd()||r.isOdd())&&(i.iadd(o),r.isub(s)),i.iushrn(1),r.iushrn(1);a.cmp(c)>=0?(a.isub(c),d.isub(i),t.isub(r)):(c.isub(a),i.isub(d),r.isub(t))}return{a:i,b:r,gcd:c.iushln(n)}},b.prototype._invmp=function(e){f(0===e.negative),f(!e.isZero());var a=this,c=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var d,t=new b(1),i=new b(0),r=c.clone();a.cmpn(1)>0&&c.cmpn(1)>0;){for(var n=0,o=1;!(a.words[0]&o)&&n<26;++n,o<<=1);if(n>0)for(a.iushrn(n);n-- >0;)t.isOdd()&&t.iadd(r),t.iushrn(1);for(var s=0,l=1;!(c.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(c.iushrn(s);s-- >0;)i.isOdd()&&i.iadd(r),i.iushrn(1);a.cmp(c)>=0?(a.isub(c),t.isub(i)):(c.isub(a),i.isub(t))}return(d=0===a.cmpn(1)?t:i).cmpn(0)<0&&d.iadd(e),d},b.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),c=e.clone();a.negative=0,c.negative=0;for(var f=0;a.isEven()&&c.isEven();f++)a.iushrn(1),c.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=a.cmp(c);if(d<0){var b=a;a=c,c=b}else if(0===d||0===c.cmpn(1))break;a.isub(c)}return c.iushln(f)},b.prototype.invm=function(e){return this.egcd(e).a.umod(e)},b.prototype.isEven=function(){return!(1&this.words[0])},b.prototype.isOdd=function(){return!(1&~this.words[0])},b.prototype.andln=function(e){return this.words[0]&e},b.prototype.bincn=function(e){f("number"==typeof e);var a=e%26,c=(e-a)/26,d=1<>>26,i&=67108863,this.words[t]=i}return 0!==b&&(this.words[t]=b,this.length++),this},b.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},b.prototype.cmpn=function(e){var a,c=e<0;if(0!==this.negative&&!c)return-1;if(0===this.negative&&c)return 1;if(this._strip(),this.length>1)a=1;else{c&&(e=-e),f(e<=67108863,"Number is too big");var d=0|this.words[0];a=d===e?0:de.length)return 1;if(this.length=0;c--){var f=0|this.words[c],d=0|e.words[c];if(f!==d){fd&&(a=1);break}}return a},b.prototype.gtn=function(e){return 1===this.cmpn(e)},b.prototype.gt=function(e){return 1===this.cmp(e)},b.prototype.gten=function(e){return this.cmpn(e)>=0},b.prototype.gte=function(e){return this.cmp(e)>=0},b.prototype.ltn=function(e){return-1===this.cmpn(e)},b.prototype.lt=function(e){return-1===this.cmp(e)},b.prototype.lten=function(e){return this.cmpn(e)<=0},b.prototype.lte=function(e){return this.cmp(e)<=0},b.prototype.eqn=function(e){return 0===this.cmpn(e)},b.prototype.eq=function(e){return 0===this.cmp(e)},b.red=function(e){return new I(e)},b.prototype.toRed=function(e){return f(!this.red,"Already a number in reduction context"),f(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},b.prototype.fromRed=function(){return f(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},b.prototype._forceRed=function(e){return this.red=e,this},b.prototype.forceRed=function(e){return f(!this.red,"Already a number in reduction context"),this._forceRed(e)},b.prototype.redAdd=function(e){return f(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},b.prototype.redIAdd=function(e){return f(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},b.prototype.redSub=function(e){return f(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},b.prototype.redISub=function(e){return f(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},b.prototype.redShl=function(e){return f(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},b.prototype.redMul=function(e){return f(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},b.prototype.redIMul=function(e){return f(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},b.prototype.redSqr=function(){return f(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},b.prototype.redISqr=function(){return f(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},b.prototype.redSqrt=function(){return f(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},b.prototype.redInvm=function(){return f(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},b.prototype.redNeg=function(){return f(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},b.prototype.redPow=function(e){return f(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var _={k256:null,p224:null,p192:null,p25519:null};function v(e,a){this.name=e,this.p=new b(a,16),this.n=this.p.bitLength(),this.k=new b(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function L(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function I(e){if("string"==typeof e){var a=b._prime(e);this.m=a.p,this.prime=a}else f(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){I.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new b(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 e=new b(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var a,c=e;do{this.split(c,this.tmp),a=(c=(c=this.imulK(c)).iadd(this.tmp)).bitLength()}while(a>this.n);var f=a0?c.isub(this.p):void 0!==c.strip?c.strip():c._strip(),c},v.prototype.split=function(e,a){e.iushrn(this.n,0,a)},v.prototype.imulK=function(e){return e.imul(this.k)},d(w,v),w.prototype.split=function(e,a){for(var c=4194303,f=Math.min(e.length,9),d=0;d>>22,b=t}b>>>=22,e.words[d-10]=b,0===b&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,c=0;c>>=26,e.words[c]=d,a=f}return 0!==a&&(e.words[e.length++]=a),e},b._prime=function(e){if(_[e])return _[e];var a;if("k256"===e)a=new w;else if("p224"===e)a=new M;else if("p192"===e)a=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new L}return _[e]=a,a},I.prototype._verify1=function(e){f(0===e.negative,"red works only with positives"),f(e.red,"red works only with red numbers")},I.prototype._verify2=function(e,a){f(!(e.negative|a.negative),"red works only with positives"),f(e.red&&e.red===a.red,"red works only with red numbers")},I.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(o(e,e.umod(this.m)._forceRed(this)),e)},I.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},I.prototype.add=function(e,a){this._verify2(e,a);var c=e.add(a);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},I.prototype.iadd=function(e,a){this._verify2(e,a);var c=e.iadd(a);return c.cmp(this.m)>=0&&c.isub(this.m),c},I.prototype.sub=function(e,a){this._verify2(e,a);var c=e.sub(a);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},I.prototype.isub=function(e,a){this._verify2(e,a);var c=e.isub(a);return c.cmpn(0)<0&&c.iadd(this.m),c},I.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},I.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},I.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},I.prototype.isqr=function(e){return this.imul(e,e.clone())},I.prototype.sqr=function(e){return this.mul(e,e)},I.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(f(a%2==1),3===a){var c=this.m.add(new b(1)).iushrn(2);return this.pow(e,c)}for(var d=this.m.subn(1),t=0;!d.isZero()&&0===d.andln(1);)t++,d.iushrn(1);f(!d.isZero());var i=new b(1).toRed(this),r=i.redNeg(),n=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new b(2*o*o).toRed(this);0!==this.pow(o,n).cmp(r);)o.redIAdd(r);for(var s=this.pow(o,d),l=this.pow(e,d.addn(1).iushrn(1)),h=this.pow(e,d),u=t;0!==h.cmp(i);){for(var x=h,p=0;0!==x.cmp(i);p++)x=x.redSqr();f(p=0;f--){for(var n=a.words[f],o=r-1;o>=0;o--){var s=n>>o&1;d!==c[0]&&(d=this.sqr(d)),0!==s||0!==t?(t<<=1,t|=s,(4==++i||0===f&&0===o)&&(d=this.mul(d,c[t]),i=0,t=0)):i=0}r=26}return d},I.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},I.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},b.mont=function(e){return new k(e)},d(k,I),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},k.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var c=e.imul(a),f=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(f).iushrn(this.shift),b=d;return d.cmp(this.m)>=0?b=d.isub(this.m):d.cmpn(0)<0&&(b=d.iadd(this.m)),b._forceRed(this)},k.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new b(0)._forceRed(this);var c=e.mul(a),f=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(f).iushrn(this.shift),t=d;return d.cmp(this.m)>=0?t=d.isub(this.m):d.cmpn(0)<0&&(t=d.iadd(this.m)),t._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=c.nmd(e),this)},5037:(e,a,c)=>{var f;function d(e){this.rand=e}if(e.exports=function(e){return f||(f=new d(null)),f.generate(e)},e.exports.Rand=d,d.prototype.generate=function(e){return this._rand(e)},d.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var a=new Uint8Array(e),c=0;c{var f=c(2861).Buffer;function d(e){f.isBuffer(e)||(e=f.from(e));for(var a=e.length/4|0,c=new Array(a),d=0;d>>24]^o[u>>>16&255]^s[x>>>8&255]^l[255&p]^a[g++],t=n[u>>>24]^o[x>>>16&255]^s[p>>>8&255]^l[255&h]^a[g++],i=n[x>>>24]^o[p>>>16&255]^s[h>>>8&255]^l[255&u]^a[g++],r=n[p>>>24]^o[h>>>16&255]^s[u>>>8&255]^l[255&x]^a[g++],h=b,u=t,x=i,p=r;return b=(f[h>>>24]<<24|f[u>>>16&255]<<16|f[x>>>8&255]<<8|f[255&p])^a[g++],t=(f[u>>>24]<<24|f[x>>>16&255]<<16|f[p>>>8&255]<<8|f[255&h])^a[g++],i=(f[x>>>24]<<24|f[p>>>16&255]<<16|f[h>>>8&255]<<8|f[255&u])^a[g++],r=(f[p>>>24]<<24|f[h>>>16&255]<<16|f[u>>>8&255]<<8|f[255&x])^a[g++],[b>>>=0,t>>>=0,i>>>=0,r>>>=0]}var i=[0,1,2,4,8,16,32,64,128,27,54],r=function(){for(var e=new Array(256),a=0;a<256;a++)e[a]=a<128?a<<1:a<<1^283;for(var c=[],f=[],d=[[],[],[],[]],b=[[],[],[],[]],t=0,i=0,r=0;r<256;++r){var n=i^i<<1^i<<2^i<<3^i<<4;n=n>>>8^255&n^99,c[t]=n,f[n]=t;var o=e[t],s=e[o],l=e[s],h=257*e[n]^16843008*n;d[0][t]=h<<24|h>>>8,d[1][t]=h<<16|h>>>16,d[2][t]=h<<8|h>>>24,d[3][t]=h,h=16843009*l^65537*s^257*o^16843008*t,b[0][n]=h<<24|h>>>8,b[1][n]=h<<16|h>>>16,b[2][n]=h<<8|h>>>24,b[3][n]=h,0===t?t=i=1:(t=o^e[e[e[l^o]]],i^=e[e[i]])}return{SBOX:c,INV_SBOX:f,SUB_MIX:d,INV_SUB_MIX:b}}();function n(e){this._key=d(e),this._reset()}n.blockSize=16,n.keySize=32,n.prototype.blockSize=n.blockSize,n.prototype.keySize=n.keySize,n.prototype._reset=function(){for(var e=this._key,a=e.length,c=a+6,f=4*(c+1),d=[],b=0;b>>24,t=r.SBOX[t>>>24]<<24|r.SBOX[t>>>16&255]<<16|r.SBOX[t>>>8&255]<<8|r.SBOX[255&t],t^=i[b/a|0]<<24):a>6&&b%a==4&&(t=r.SBOX[t>>>24]<<24|r.SBOX[t>>>16&255]<<16|r.SBOX[t>>>8&255]<<8|r.SBOX[255&t]),d[b]=d[b-a]^t}for(var n=[],o=0;o>>24]]^r.INV_SUB_MIX[1][r.SBOX[l>>>16&255]]^r.INV_SUB_MIX[2][r.SBOX[l>>>8&255]]^r.INV_SUB_MIX[3][r.SBOX[255&l]]}this._nRounds=c,this._keySchedule=d,this._invKeySchedule=n},n.prototype.encryptBlockRaw=function(e){return t(e=d(e),this._keySchedule,r.SUB_MIX,r.SBOX,this._nRounds)},n.prototype.encryptBlock=function(e){var a=this.encryptBlockRaw(e),c=f.allocUnsafe(16);return c.writeUInt32BE(a[0],0),c.writeUInt32BE(a[1],4),c.writeUInt32BE(a[2],8),c.writeUInt32BE(a[3],12),c},n.prototype.decryptBlock=function(e){var a=(e=d(e))[1];e[1]=e[3],e[3]=a;var c=t(e,this._invKeySchedule,r.INV_SUB_MIX,r.INV_SBOX,this._nRounds),b=f.allocUnsafe(16);return b.writeUInt32BE(c[0],0),b.writeUInt32BE(c[3],4),b.writeUInt32BE(c[2],8),b.writeUInt32BE(c[1],12),b},n.prototype.scrub=function(){b(this._keySchedule),b(this._invKeySchedule),b(this._key)},e.exports.AES=n},2356:(e,a,c)=>{var f=c(462),d=c(2861).Buffer,b=c(6168),t=c(6698),i=c(5892),r=c(295),n=c(5122);function o(e,a,c,t){b.call(this);var r=d.alloc(4,0);this._cipher=new f.AES(a);var o=this._cipher.encryptBlock(r);this._ghash=new i(o),c=function(e,a,c){if(12===a.length)return e._finID=d.concat([a,d.from([0,0,0,1])]),d.concat([a,d.from([0,0,0,2])]);var f=new i(c),b=a.length,t=b%16;f.update(a),t&&(t=16-t,f.update(d.alloc(t,0))),f.update(d.alloc(8,0));var r=8*b,o=d.alloc(8);o.writeUIntBE(r,0,8),f.update(o),e._finID=f.state;var s=d.from(e._finID);return n(s),s}(this,c,o),this._prev=d.from(c),this._cache=d.allocUnsafe(0),this._secCache=d.allocUnsafe(0),this._decrypt=t,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}t(o,b),o.prototype._update=function(e){if(!this._called&&this._alen){var a=16-this._alen%16;a<16&&(a=d.alloc(a,0),this._ghash.update(a))}this._called=!0;var c=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(c),this._len+=e.length,c},o.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=r(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,a){var c=0;e.length!==a.length&&c++;for(var f=Math.min(e.length,a.length),d=0;d{var f=c(5799),d=c(6171),b=c(3219);a.createCipher=a.Cipher=f.createCipher,a.createCipheriv=a.Cipheriv=f.createCipheriv,a.createDecipher=a.Decipher=d.createDecipher,a.createDecipheriv=a.Decipheriv=d.createDecipheriv,a.listCiphers=a.getCiphers=function(){return Object.keys(b)}},6171:(e,a,c)=>{var f=c(2356),d=c(2861).Buffer,b=c(530),t=c(650),i=c(6168),r=c(462),n=c(8078);function o(e,a,c){i.call(this),this._cache=new s,this._last=void 0,this._cipher=new r.AES(a),this._prev=d.from(c),this._mode=e,this._autopadding=!0}function s(){this.cache=d.allocUnsafe(0)}function l(e,a,c){var i=b[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");if("string"==typeof c&&(c=d.from(c)),"GCM"!==i.mode&&c.length!==i.iv)throw new TypeError("invalid iv length "+c.length);if("string"==typeof a&&(a=d.from(a)),a.length!==i.key/8)throw new TypeError("invalid key length "+a.length);return"stream"===i.type?new t(i.module,a,c,!0):"auth"===i.type?new f(i.module,a,c,!0):new o(i.module,a,c)}c(6698)(o,i),o.prototype._update=function(e){var a,c;this._cache.add(e);for(var f=[];a=this._cache.get(this._autopadding);)c=this._mode.decrypt(this,a),f.push(c);return d.concat(f)},o.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var a=e[15];if(a<1||a>16)throw new Error("unable to decrypt data");for(var c=-1;++c16)return a=this.cache.slice(0,16),this.cache=this.cache.slice(16),a}else if(this.cache.length>=16)return a=this.cache.slice(0,16),this.cache=this.cache.slice(16),a;return null},s.prototype.flush=function(){if(this.cache.length)return this.cache},a.createDecipher=function(e,a){var c=b[e.toLowerCase()];if(!c)throw new TypeError("invalid suite type");var f=n(a,!1,c.key,c.iv);return l(e,f.key,f.iv)},a.createDecipheriv=l},5799:(e,a,c)=>{var f=c(530),d=c(2356),b=c(2861).Buffer,t=c(650),i=c(6168),r=c(462),n=c(8078);function o(e,a,c){i.call(this),this._cache=new l,this._cipher=new r.AES(a),this._prev=b.from(c),this._mode=e,this._autopadding=!0}c(6698)(o,i),o.prototype._update=function(e){var a,c;this._cache.add(e);for(var f=[];a=this._cache.get();)c=this._mode.encrypt(this,a),f.push(c);return b.concat(f)};var s=b.alloc(16,16);function l(){this.cache=b.allocUnsafe(0)}function h(e,a,c){var i=f[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");if("string"==typeof a&&(a=b.from(a)),a.length!==i.key/8)throw new TypeError("invalid key length "+a.length);if("string"==typeof c&&(c=b.from(c)),"GCM"!==i.mode&&c.length!==i.iv)throw new TypeError("invalid iv length "+c.length);return"stream"===i.type?new t(i.module,a,c):"auth"===i.type?new d(i.module,a,c):new o(i.module,a,c)}o.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(s))throw this._cipher.scrub(),new Error("data not multiple of block length")},o.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},l.prototype.add=function(e){this.cache=b.concat([this.cache,e])},l.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},l.prototype.flush=function(){for(var e=16-this.cache.length,a=b.allocUnsafe(e),c=-1;++c{var f=c(2861).Buffer,d=f.alloc(16,0);function b(e){var a=f.allocUnsafe(16);return a.writeUInt32BE(e[0]>>>0,0),a.writeUInt32BE(e[1]>>>0,4),a.writeUInt32BE(e[2]>>>0,8),a.writeUInt32BE(e[3]>>>0,12),a}function t(e){this.h=e,this.state=f.alloc(16,0),this.cache=f.allocUnsafe(0)}t.prototype.ghash=function(e){for(var a=-1;++a0;a--)f[a]=f[a]>>>1|(1&f[a-1])<<31;f[0]=f[0]>>>1,c&&(f[0]=f[0]^225<<24)}this.state=b(d)},t.prototype.update=function(e){var a;for(this.cache=f.concat([this.cache,e]);this.cache.length>=16;)a=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(a)},t.prototype.final=function(e,a){return this.cache.length&&this.ghash(f.concat([this.cache,d],16)),this.ghash(b([0,e,0,a])),this.state},e.exports=t},5122:e=>{e.exports=function(e){for(var a,c=e.length;c--;){if(255!==(a=e.readUInt8(c))){a++,e.writeUInt8(a,c);break}e.writeUInt8(0,c)}}},2884:(e,a,c)=>{var f=c(295);a.encrypt=function(e,a){var c=f(a,e._prev);return e._prev=e._cipher.encryptBlock(c),e._prev},a.decrypt=function(e,a){var c=e._prev;e._prev=a;var d=e._cipher.decryptBlock(a);return f(d,c)}},6383:(e,a,c)=>{var f=c(2861).Buffer,d=c(295);function b(e,a,c){var b=a.length,t=d(a,e._cache);return e._cache=e._cache.slice(b),e._prev=f.concat([e._prev,c?a:t]),t}a.encrypt=function(e,a,c){for(var d,t=f.allocUnsafe(0);a.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=f.allocUnsafe(0)),!(e._cache.length<=a.length)){t=f.concat([t,b(e,a,c)]);break}d=e._cache.length,t=f.concat([t,b(e,a.slice(0,d),c)]),a=a.slice(d)}return t}},5264:(e,a,c)=>{var f=c(2861).Buffer;function d(e,a,c){for(var f,d,t=-1,i=0;++t<8;)f=a&1<<7-t?128:0,i+=(128&(d=e._cipher.encryptBlock(e._prev)[0]^f))>>t%8,e._prev=b(e._prev,c?f:d);return i}function b(e,a){var c=e.length,d=-1,b=f.allocUnsafe(e.length);for(e=f.concat([e,f.from([a])]);++d>7;return b}a.encrypt=function(e,a,c){for(var b=a.length,t=f.allocUnsafe(b),i=-1;++i{var f=c(2861).Buffer;function d(e,a,c){var d=e._cipher.encryptBlock(e._prev)[0]^a;return e._prev=f.concat([e._prev.slice(1),f.from([c?a:d])]),d}a.encrypt=function(e,a,c){for(var b=a.length,t=f.allocUnsafe(b),i=-1;++i{var f=c(295),d=c(2861).Buffer,b=c(5122);function t(e){var a=e._cipher.encryptBlockRaw(e._prev);return b(e._prev),a}a.encrypt=function(e,a){var c=Math.ceil(a.length/16),b=e._cache.length;e._cache=d.concat([e._cache,d.allocUnsafe(16*c)]);for(var i=0;i{a.encrypt=function(e,a){return e._cipher.encryptBlock(a)},a.decrypt=function(e,a){return e._cipher.decryptBlock(a)}},530:(e,a,c)=>{var f={ECB:c(2632),CBC:c(2884),CFB:c(6383),CFB8:c(6975),CFB1:c(5264),OFB:c(6843),CTR:c(3053),GCM:c(3053)},d=c(3219);for(var b in d)d[b].module=f[d[b].mode];e.exports=d},6843:(e,a,c)=>{var f=c(2045).hp,d=c(295);function b(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}a.encrypt=function(e,a){for(;e._cache.length{var f=c(462),d=c(2861).Buffer,b=c(6168);function t(e,a,c,t){b.call(this),this._cipher=new f.AES(a),this._prev=d.from(c),this._cache=d.allocUnsafe(0),this._secCache=d.allocUnsafe(0),this._decrypt=t,this._mode=e}c(6698)(t,b),t.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},t.prototype._final=function(){this._cipher.scrub()},e.exports=t},125:(e,a,c)=>{var f=c(4050),d=c(1241),b=c(530),t=c(2438),i=c(8078);function r(e,a,c){if(e=e.toLowerCase(),b[e])return d.createCipheriv(e,a,c);if(t[e])return new f({key:a,iv:c,mode:e});throw new TypeError("invalid suite type")}function n(e,a,c){if(e=e.toLowerCase(),b[e])return d.createDecipheriv(e,a,c);if(t[e])return new f({key:a,iv:c,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}a.createCipher=a.Cipher=function(e,a){var c,f;if(e=e.toLowerCase(),b[e])c=b[e].key,f=b[e].iv;else{if(!t[e])throw new TypeError("invalid suite type");c=8*t[e].key,f=t[e].iv}var d=i(a,!1,c,f);return r(e,d.key,d.iv)},a.createCipheriv=a.Cipheriv=r,a.createDecipher=a.Decipher=function(e,a){var c,f;if(e=e.toLowerCase(),b[e])c=b[e].key,f=b[e].iv;else{if(!t[e])throw new TypeError("invalid suite type");c=8*t[e].key,f=t[e].iv}var d=i(a,!1,c,f);return n(e,d.key,d.iv)},a.createDecipheriv=a.Decipheriv=n,a.listCiphers=a.getCiphers=function(){return Object.keys(t).concat(d.getCiphers())}},4050:(e,a,c)=>{var f=c(6168),d=c(9560),b=c(6698),t=c(2861).Buffer,i={"des-ede3-cbc":d.CBC.instantiate(d.EDE),"des-ede3":d.EDE,"des-ede-cbc":d.CBC.instantiate(d.EDE),"des-ede":d.EDE,"des-cbc":d.CBC.instantiate(d.DES),"des-ecb":d.DES};function r(e){f.call(this);var a,c=e.mode.toLowerCase(),d=i[c];a=e.decrypt?"decrypt":"encrypt";var b=e.key;t.isBuffer(b)||(b=t.from(b)),"des-ede"!==c&&"des-ede-cbc"!==c||(b=t.concat([b,b.slice(0,8)]));var r=e.iv;t.isBuffer(r)||(r=t.from(r)),this._des=d.create({key:b,iv:r,type:a})}i.des=i["des-cbc"],i.des3=i["des-ede3-cbc"],e.exports=r,b(r,f),r.prototype._update=function(e){return t.from(this._des.update(e))},r.prototype._final=function(){return t.from(this._des.final())}},2438:(e,a)=>{a["des-ecb"]={key:8,iv:0},a["des-cbc"]=a.des={key:8,iv:8},a["des-ede3-cbc"]=a.des3={key:24,iv:8},a["des-ede3"]={key:24,iv:0},a["des-ede-cbc"]={key:16,iv:8},a["des-ede"]={key:16,iv:0}},7332:(e,a,c)=>{var f=c(2045).hp,d=c(9404),b=c(3209);function t(e){var a,c=e.modulus.byteLength();do{a=new d(b(c))}while(a.cmp(e.modulus)>=0||!a.umod(e.prime1)||!a.umod(e.prime2));return a}function i(e,a){var c=function(e){var a=t(e);return{blinder:a.toRed(d.mont(e.modulus)).redPow(new d(e.publicExponent)).fromRed(),unblinder:a.invm(e.modulus)}}(a),b=a.modulus.byteLength(),i=new d(e).mul(c.blinder).umod(a.modulus),r=i.toRed(d.mont(a.prime1)),n=i.toRed(d.mont(a.prime2)),o=a.coefficient,s=a.prime1,l=a.prime2,h=r.redPow(a.exponent1).fromRed(),u=n.redPow(a.exponent2).fromRed(),x=h.isub(u).imul(o).umod(s).imul(l);return u.iadd(x).imul(c.unblinder).umod(a.modulus).toArrayLike(f,"be",b)}i.getr=t,e.exports=i},5715:(e,a,c)=>{"use strict";e.exports=c(2951)},20:(e,a,c)=>{"use strict";var f=c(2861).Buffer,d=c(7108),b=c(6737),t=c(6698),i=c(5359),r=c(4847),n=c(2951);function o(e){b.Writable.call(this);var a=n[e];if(!a)throw new Error("Unknown message digest");this._hashType=a.hash,this._hash=d(a.hash),this._tag=a.id,this._signType=a.sign}function s(e){b.Writable.call(this);var a=n[e];if(!a)throw new Error("Unknown message digest");this._hash=d(a.hash),this._tag=a.id,this._signType=a.sign}function l(e){return new o(e)}function h(e){return new s(e)}Object.keys(n).forEach((function(e){n[e].id=f.from(n[e].id,"hex"),n[e.toLowerCase()]=n[e]})),t(o,b.Writable),o.prototype._write=function(e,a,c){this._hash.update(e),c()},o.prototype.update=function(e,a){return this._hash.update("string"==typeof e?f.from(e,a):e),this},o.prototype.sign=function(e,a){this.end();var c=this._hash.digest(),f=i(c,e,this._hashType,this._signType,this._tag);return a?f.toString(a):f},t(s,b.Writable),s.prototype._write=function(e,a,c){this._hash.update(e),c()},s.prototype.update=function(e,a){return this._hash.update("string"==typeof e?f.from(e,a):e),this},s.prototype.verify=function(e,a,c){var d="string"==typeof a?f.from(a,c):a;this.end();var b=this._hash.digest();return r(d,b,e,this._signType,this._tag)},e.exports={Sign:l,Verify:h,createSign:l,createVerify:h}},5359:(e,a,c)=>{"use strict";var f=c(2861).Buffer,d=c(3507),b=c(7332),t=c(6729).ec,i=c(9404),r=c(8170),n=c(4589);function o(e,a,c,b){if((e=f.from(e.toArray())).length0&&c.ishrn(f),c}function l(e,a,c){var b,t;do{for(b=f.alloc(0);8*b.length{"use strict";var f=c(2861).Buffer,d=c(9404),b=c(6729).ec,t=c(8170),i=c(4589);function r(e,a){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(a)>=0)throw new Error("invalid sig")}e.exports=function(e,a,c,n,o){var s=t(c);if("ec"===s.type){if("ecdsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong public key type");return function(e,a,c){var f=i[c.data.algorithm.curve.join(".")];if(!f)throw new Error("unknown curve "+c.data.algorithm.curve.join("."));var d=new b(f),t=c.data.subjectPrivateKey.data;return d.verify(a,e,t)}(e,a,s)}if("dsa"===s.type){if("dsa"!==n)throw new Error("wrong public key type");return function(e,a,c){var f=c.data.p,b=c.data.q,i=c.data.g,n=c.data.pub_key,o=t.signature.decode(e,"der"),s=o.s,l=o.r;r(s,b),r(l,b);var h=d.mont(f),u=s.invm(b);return 0===i.toRed(h).redPow(new d(a).mul(u).mod(b)).fromRed().mul(n.toRed(h).redPow(l.mul(u).mod(b)).fromRed()).mod(f).mod(b).cmp(l)}(e,a,s)}if("rsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong public key type");a=f.concat([o,a]);for(var l=s.modulus.byteLength(),h=[1],u=0;a.length+h.length+2{var a={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==a.call(e)}},6248:(e,a,c)=>{"use strict";var f=c(3225),d=Object.keys||function(e){var a=[];for(var c in e)a.push(c);return a};e.exports=s;var b=Object.create(c(5622));b.inherits=c(6698);var t=c(206),i=c(7314);b.inherits(s,t);for(var r=d(i.prototype),n=0;n{"use strict";e.exports=b;var f=c(1816),d=Object.create(c(5622));function b(e){if(!(this instanceof b))return new b(e);f.call(this,e)}d.inherits=c(6698),d.inherits(b,f),b.prototype._transform=function(e,a,c){c(null,e)}},206:(e,a,c)=>{"use strict";var f=c(3225);e.exports=m;var d,b=c(2240);m.ReadableState=g,c(7007).EventEmitter;var t=function(e,a){return e.listeners(a).length},i=c(5567),r=c(4116).Buffer,n=(void 0!==c.g?c.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},o=Object.create(c(5622));o.inherits=c(6698);var s=c(2668),l=void 0;l=s&&s.debuglog?s.debuglog("stream"):function(){};var h,u=c(672),x=c(6278);o.inherits(m,i);var p=["error","close","destroy","pause","resume"];function g(e,a){e=e||{};var f=a instanceof(d=d||c(6248));this.objectMode=!!e.objectMode,f&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var b=e.highWaterMark,t=e.readableHighWaterMark,i=this.objectMode?16:16384;this.highWaterMark=b||0===b?b:f&&(t||0===t)?t:i,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new u,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.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=c(6427).I),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function m(e){if(d=d||c(6248),!(this instanceof m))return new m(e);this._readableState=new g(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),i.call(this)}function y(e,a,c,f,d){var b,t=e._readableState;return null===a?(t.reading=!1,function(e,a){if(!a.ended){if(a.decoder){var c=a.decoder.end();c&&c.length&&(a.buffer.push(c),a.length+=a.objectMode?1:c.length)}a.ended=!0,M(e)}}(e,t)):(d||(b=function(e,a){var c,f;return f=a,r.isBuffer(f)||f instanceof n||"string"==typeof a||void 0===a||e.objectMode||(c=new TypeError("Invalid non-string/buffer chunk")),c}(t,a)),b?e.emit("error",b):t.objectMode||a&&a.length>0?("string"==typeof a||t.objectMode||Object.getPrototypeOf(a)===r.prototype||(a=function(e){return r.from(e)}(a)),f?t.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,t,a,!0):t.ended?e.emit("error",new Error("stream.push() after EOF")):(t.reading=!1,t.decoder&&!c?(a=t.decoder.write(a),t.objectMode||0!==a.length?_(e,t,a,!1):L(e,t)):_(e,t,a,!1))):f||(t.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.lengtha.highWaterMark&&(a.highWaterMark=function(e){return e>=v?e=v:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=a.length?e:a.ended?a.length:(a.needReadable=!0,0))}function M(e){var a=e._readableState;a.needReadable=!1,a.emittedReadable||(l("emitReadable",a.flowing),a.emittedReadable=!0,a.sync?f.nextTick(A,e):A(e))}function A(e){l("emit readable"),e.emit("readable"),S(e)}function L(e,a){a.readingMore||(a.readingMore=!0,f.nextTick(I,e,a))}function I(e,a){for(var c=a.length;!a.reading&&!a.flowing&&!a.ended&&a.length=a.length?(c=a.decoder?a.buffer.join(""):1===a.buffer.length?a.buffer.head.data:a.buffer.concat(a.length),a.buffer.clear()):c=function(e,a,c){var f;return eb.length?b.length:e;if(t===b.length?d+=b:d+=b.slice(0,e),0==(e-=t)){t===b.length?(++f,c.next?a.head=c.next:a.head=a.tail=null):(a.head=c,c.data=b.slice(t));break}++f}return a.length-=f,d}(e,a):function(e,a){var c=r.allocUnsafe(e),f=a.head,d=1;for(f.data.copy(c),e-=f.data.length;f=f.next;){var b=f.data,t=e>b.length?b.length:e;if(b.copy(c,c.length-e,0,t),0==(e-=t)){t===b.length?(++d,f.next?a.head=f.next:a.head=a.tail=null):(a.head=f,f.data=b.slice(t));break}++d}return a.length-=d,c}(e,a),f}(e,a.buffer,a.decoder),c);var c}function B(e){var a=e._readableState;if(a.length>0)throw new Error('"endReadable()" called on non-empty stream');a.endEmitted||(a.ended=!0,f.nextTick(F,a,e))}function F(e,a){e.endEmitted||0!==e.length||(e.endEmitted=!0,a.readable=!1,a.emit("end"))}function O(e,a){for(var c=0,f=e.length;c=a.highWaterMark||a.ended))return l("read: emitReadable",a.length,a.ended),0===a.length&&a.ended?B(this):M(this),null;if(0===(e=w(e,a))&&a.ended)return 0===a.length&&B(this),null;var f,d=a.needReadable;return l("need readable",d),(0===a.length||a.length-e0?C(e,a):null)?(a.needReadable=!0,e=0):a.length-=e,0===a.length&&(a.ended||(a.needReadable=!0),c!==e&&a.ended&&B(this)),null!==f&&this.emit("data",f),f},m.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(e,a){var c=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,l("pipe count=%d opts=%j",d.pipesCount,a);var i=a&&!1===a.end||e===process.stdout||e===process.stderr?g:r;function r(){l("onend"),e.end()}d.endEmitted?f.nextTick(i):c.once("end",i),e.on("unpipe",(function a(f,b){l("onunpipe"),f===c&&b&&!1===b.hasUnpiped&&(b.hasUnpiped=!0,l("cleanup"),e.removeListener("close",x),e.removeListener("finish",p),e.removeListener("drain",n),e.removeListener("error",u),e.removeListener("unpipe",a),c.removeListener("end",r),c.removeListener("end",g),c.removeListener("data",h),o=!0,!d.awaitDrain||e._writableState&&!e._writableState.needDrain||n())}));var n=function(e){return function(){var a=e._readableState;l("pipeOnDrain",a.awaitDrain),a.awaitDrain&&a.awaitDrain--,0===a.awaitDrain&&t(e,"data")&&(a.flowing=!0,S(e))}}(c);e.on("drain",n);var o=!1,s=!1;function h(a){l("ondata"),s=!1,!1!==e.write(a)||s||((1===d.pipesCount&&d.pipes===e||d.pipesCount>1&&-1!==O(d.pipes,e))&&!o&&(l("false write response, pause",d.awaitDrain),d.awaitDrain++,s=!0),c.pause())}function u(a){l("onerror",a),g(),e.removeListener("error",u),0===t(e,"error")&&e.emit("error",a)}function x(){e.removeListener("finish",p),g()}function p(){l("onfinish"),e.removeListener("close",x),g()}function g(){l("unpipe"),c.unpipe(e)}return c.on("data",h),function(e,a,c){if("function"==typeof e.prependListener)return e.prependListener(a,c);e._events&&e._events[a]?b(e._events[a])?e._events[a].unshift(c):e._events[a]=[c,e._events[a]]:e.on(a,c)}(e,"error",u),e.once("close",x),e.once("finish",p),e.emit("pipe",c),d.flowing||(l("pipe resume"),c.resume()),e},m.prototype.unpipe=function(e){var a=this._readableState,c={hasUnpiped:!1};if(0===a.pipesCount)return this;if(1===a.pipesCount)return e&&e!==a.pipes||(e||(e=a.pipes),a.pipes=null,a.pipesCount=0,a.flowing=!1,e&&e.emit("unpipe",this,c)),this;if(!e){var f=a.pipes,d=a.pipesCount;a.pipes=null,a.pipesCount=0,a.flowing=!1;for(var b=0;b{"use strict";e.exports=t;var f=c(6248),d=Object.create(c(5622));function b(e,a){var c=this._transformState;c.transforming=!1;var f=c.writecb;if(!f)return this.emit("error",new Error("write callback called multiple times"));c.writechunk=null,c.writecb=null,null!=a&&this.push(a),f(e);var d=this._readableState;d.reading=!1,(d.needReadable||d.length{"use strict";var f=c(3225);function d(e){var a=this;this.next=null,this.entry=null,this.finish=function(){!function(e,a){var c=e.entry;for(e.entry=null;c;){var f=c.callback;a.pendingcb--,f(undefined),c=c.next}a.corkedRequestsFree.next=e}(a,e)}}e.exports=p;var b,t=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:f.nextTick;p.WritableState=x;var i=Object.create(c(5622));i.inherits=c(6698);var r,n={deprecate:c(4643)},o=c(5567),s=c(4116).Buffer,l=(void 0!==c.g?c.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},h=c(6278);function u(){}function x(e,a){b=b||c(6248),e=e||{};var i=a instanceof b;this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var r=e.highWaterMark,n=e.writableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i&&(n||0===n)?n:o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,a){var c=e._writableState,d=c.sync,b=c.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(c),a)!function(e,a,c,d,b){--a.pendingcb,c?(f.nextTick(b,d),f.nextTick(w,e,a),e._writableState.errorEmitted=!0,e.emit("error",d)):(b(d),e._writableState.errorEmitted=!0,e.emit("error",d),w(e,a))}(e,c,d,a,b);else{var i=_(c);i||c.corked||c.bufferProcessing||!c.bufferedRequest||y(e,c),d?t(m,e,c,i,b):m(e,c,i,b)}}(a,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new d(this)}function p(e){if(b=b||c(6248),!(r.call(p,this)||this instanceof b))return new p(e);this._writableState=new x(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o.call(this)}function g(e,a,c,f,d,b,t){a.writelen=f,a.writecb=t,a.writing=!0,a.sync=!0,c?e._writev(d,a.onwrite):e._write(d,b,a.onwrite),a.sync=!1}function m(e,a,c,f){c||function(e,a){0===a.length&&a.needDrain&&(a.needDrain=!1,e.emit("drain"))}(e,a),a.pendingcb--,f(),w(e,a)}function y(e,a){a.bufferProcessing=!0;var c=a.bufferedRequest;if(e._writev&&c&&c.next){var f=a.bufferedRequestCount,b=new Array(f),t=a.corkedRequestsFree;t.entry=c;for(var i=0,r=!0;c;)b[i]=c,c.isBuf||(r=!1),c=c.next,i+=1;b.allBuffers=r,g(e,a,!0,a.length,b,"",t.finish),a.pendingcb++,a.lastBufferedRequest=null,t.next?(a.corkedRequestsFree=t.next,t.next=null):a.corkedRequestsFree=new d(a),a.bufferedRequestCount=0}else{for(;c;){var n=c.chunk,o=c.encoding,s=c.callback;if(g(e,a,!1,a.objectMode?1:n.length,n,o,s),c=c.next,a.bufferedRequestCount--,a.writing)break}null===c&&(a.lastBufferedRequest=null)}a.bufferedRequest=c,a.bufferProcessing=!1}function _(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function v(e,a){e._final((function(c){a.pendingcb--,c&&e.emit("error",c),a.prefinished=!0,e.emit("prefinish"),w(e,a)}))}function w(e,a){var c=_(a);return c&&(function(e,a){a.prefinished||a.finalCalled||("function"==typeof e._final?(a.pendingcb++,a.finalCalled=!0,f.nextTick(v,e,a)):(a.prefinished=!0,e.emit("prefinish")))}(e,a),0===a.pendingcb&&(a.finished=!0,e.emit("finish"))),c}i.inherits(p,o),x.prototype.getBuffer=function(){for(var e=this.bufferedRequest,a=[];e;)a.push(e),e=e.next;return a},function(){try{Object.defineProperty(x.prototype,"buffer",{get:n.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(r=Function.prototype[Symbol.hasInstance],Object.defineProperty(p,Symbol.hasInstance,{value:function(e){return!!r.call(this,e)||this===p&&e&&e._writableState instanceof x}})):r=function(e){return e instanceof this},p.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},p.prototype.write=function(e,a,c){var d,b=this._writableState,t=!1,i=!b.objectMode&&(d=e,s.isBuffer(d)||d instanceof l);return i&&!s.isBuffer(e)&&(e=function(e){return s.from(e)}(e)),"function"==typeof a&&(c=a,a=null),i?a="buffer":a||(a=b.defaultEncoding),"function"!=typeof c&&(c=u),b.ended?function(e,a){var c=new Error("write after end");e.emit("error",c),f.nextTick(a,c)}(this,c):(i||function(e,a,c,d){var b=!0,t=!1;return null===c?t=new TypeError("May not write null values to stream"):"string"==typeof c||void 0===c||a.objectMode||(t=new TypeError("Invalid non-string/buffer chunk")),t&&(e.emit("error",t),f.nextTick(d,t),b=!1),b}(this,b,e,c))&&(b.pendingcb++,t=function(e,a,c,f,d,b){if(!c){var t=function(e,a,c){return e.objectMode||!1===e.decodeStrings||"string"!=typeof a||(a=s.from(a,c)),a}(a,f,d);f!==t&&(c=!0,d="buffer",f=t)}var i=a.objectMode?1:f.length;a.length+=i;var r=a.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),p.prototype._write=function(e,a,c){c(new Error("_write() is not implemented"))},p.prototype._writev=null,p.prototype.end=function(e,a,c){var d=this._writableState;"function"==typeof e?(c=e,e=null,a=null):"function"==typeof a&&(c=a,a=null),null!=e&&this.write(e,a),d.corked&&(d.corked=1,this.uncork()),d.ending||function(e,a,c){a.ending=!0,w(e,a),c&&(a.finished?f.nextTick(c):e.once("finish",c)),a.ended=!0,e.writable=!1}(this,d,c)},Object.defineProperty(p.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),p.prototype.destroy=h.destroy,p.prototype._undestroy=h.undestroy,p.prototype._destroy=function(e,a){this.end(),a(e)}},672:(e,a,c)=>{"use strict";var f=c(4116).Buffer,d=c(1638);e.exports=function(){function e(){!function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var a={data:e,next:null};this.length>0?this.tail.next=a:this.head=a,this.tail=a,++this.length},e.prototype.unshift=function(e){var a={data:e,next:this.head};0===this.length&&(this.tail=a),this.head=a,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var a=this.head,c=""+a.data;a=a.next;)c+=e+a.data;return c},e.prototype.concat=function(e){if(0===this.length)return f.alloc(0);for(var a,c,d=f.allocUnsafe(e>>>0),b=this.head,t=0;b;)a=d,c=t,b.data.copy(a,c),t+=b.data.length,b=b.next;return d},e}(),d&&d.inspect&&d.inspect.custom&&(e.exports.prototype[d.inspect.custom]=function(){var e=d.inspect({length:this.length});return this.constructor.name+" "+e})},6278:(e,a,c)=>{"use strict";var f=c(3225);function d(e,a){e.emit("error",a)}e.exports={destroy:function(e,a){var c=this,b=this._readableState&&this._readableState.destroyed,t=this._writableState&&this._writableState.destroyed;return b||t?(a?a(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,f.nextTick(d,this,e)):f.nextTick(d,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!a&&e?c._writableState?c._writableState.errorEmitted||(c._writableState.errorEmitted=!0,f.nextTick(d,c,e)):f.nextTick(d,c,e):a&&a(e)})),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)}}},5567:(e,a,c)=>{e.exports=c(7007).EventEmitter},4116:(e,a,c)=>{var f=c(8287),d=f.Buffer;function b(e,a){for(var c in e)a[c]=e[c]}function t(e,a,c){return d(e,a,c)}d.from&&d.alloc&&d.allocUnsafe&&d.allocUnsafeSlow?e.exports=f:(b(f,a),a.Buffer=t),b(d,t),t.from=function(e,a,c){if("number"==typeof e)throw new TypeError("Argument must not be a number");return d(e,a,c)},t.alloc=function(e,a,c){if("number"!=typeof e)throw new TypeError("Argument must be a number");var f=d(e);return void 0!==a?"string"==typeof c?f.fill(a,c):f.fill(a):f.fill(0),f},t.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return d(e)},t.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return f.SlowBuffer(e)}},6737:(e,a,c)=>{(a=e.exports=c(206)).Stream=a,a.Readable=a,a.Writable=c(7314),a.Duplex=c(6248),a.Transform=c(1816),a.PassThrough=c(5242)},6427:(e,a,c)=>{"use strict";var f=c(8393).Buffer,d=f.isEncoding||function(e){switch((e=""+e)&&e.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 b(e){var a;switch(this.encoding=function(e){var a=function(e){if(!e)return"utf8";for(var a;;)switch(e){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 e;default:if(a)return;e=(""+e).toLowerCase(),a=!0}}(e);if("string"!=typeof a&&(f.isEncoding===d||!d(e)))throw new Error("Unknown encoding: "+e);return a||e}(e),this.encoding){case"utf16le":this.text=r,this.end=n,a=4;break;case"utf8":this.fillLast=i,a=4;break;case"base64":this.text=o,this.end=s,a=3;break;default:return this.write=l,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=f.allocUnsafe(a)}function t(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function i(e){var a=this.lastTotal-this.lastNeed,c=function(e,a){if(128!=(192&a[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&a.length>1){if(128!=(192&a[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&a.length>2&&128!=(192&a[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==c?c:this.lastNeed<=e.length?(e.copy(this.lastChar,a,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,a,0,e.length),void(this.lastNeed-=e.length))}function r(e,a){if((e.length-a)%2==0){var c=e.toString("utf16le",a);if(c){var f=c.charCodeAt(c.length-1);if(f>=55296&&f<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],c.slice(0,-1)}return c}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",a,e.length-1)}function n(e){var a=e&&e.length?this.write(e):"";if(this.lastNeed){var c=this.lastTotal-this.lastNeed;return a+this.lastChar.toString("utf16le",0,c)}return a}function o(e,a){var c=(e.length-a)%3;return 0===c?e.toString("base64",a):(this.lastNeed=3-c,this.lastTotal=3,1===c?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",a,e.length-c))}function s(e){var a=e&&e.length?this.write(e):"";return this.lastNeed?a+this.lastChar.toString("base64",0,3-this.lastNeed):a}function l(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}a.I=b,b.prototype.write=function(e){if(0===e.length)return"";var a,c;if(this.lastNeed){if(void 0===(a=this.fillLast(e)))return"";c=this.lastNeed,this.lastNeed=0}else c=0;return c=0?(d>0&&(e.lastNeed=d-1),d):--f=0?(d>0&&(e.lastNeed=d-2),d):--f=0?(d>0&&(2===d?d=0:e.lastNeed=d-3),d):0}(this,e,a);if(!this.lastNeed)return e.toString("utf8",a);this.lastTotal=c;var f=e.length-(c-this.lastNeed);return e.copy(this.lastChar,0,f),e.toString("utf8",a,f)},b.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},8393:(e,a,c)=>{var f=c(8287),d=f.Buffer;function b(e,a){for(var c in e)a[c]=e[c]}function t(e,a,c){return d(e,a,c)}d.from&&d.alloc&&d.allocUnsafe&&d.allocUnsafeSlow?e.exports=f:(b(f,a),a.Buffer=t),b(d,t),t.from=function(e,a,c){if("number"==typeof e)throw new TypeError("Argument must not be a number");return d(e,a,c)},t.alloc=function(e,a,c){if("number"!=typeof e)throw new TypeError("Argument must be a number");var f=d(e);return void 0!==a?"string"==typeof c?f.fill(a,c):f.fill(a):f.fill(0),f},t.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return d(e)},t.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return f.SlowBuffer(e)}},295:(e,a,c)=>{var f=c(2045).hp;e.exports=function(e,a){for(var c=Math.min(e.length,a.length),d=new f(c),b=0;b{"use strict";var f=c(7526),d=c(251),b="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;a.Buffer=r,a.SlowBuffer=function(e){return+e!=e&&(e=0),r.alloc(+e)},a.INSPECT_MAX_BYTES=50;var t=2147483647;function i(e){if(e>t)throw new RangeError('The value "'+e+'" is invalid for option "size"');var a=new Uint8Array(e);return Object.setPrototypeOf(a,r.prototype),a}function r(e,a,c){if("number"==typeof e){if("string"==typeof a)throw new TypeError('The "string" argument must be of type string. Received type number');return s(e)}return n(e,a,c)}function n(e,a,c){if("string"==typeof e)return function(e,a){if("string"==typeof a&&""!==a||(a="utf8"),!r.isEncoding(a))throw new TypeError("Unknown encoding: "+a);var c=0|x(e,a),f=i(c),d=f.write(e,a);return d!==c&&(f=f.slice(0,d)),f}(e,a);if(ArrayBuffer.isView(e))return function(e){if(D(e,Uint8Array)){var a=new Uint8Array(e);return h(a.buffer,a.byteOffset,a.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(D(e,ArrayBuffer)||e&&D(e.buffer,ArrayBuffer))return h(e,a,c);if("undefined"!=typeof SharedArrayBuffer&&(D(e,SharedArrayBuffer)||e&&D(e.buffer,SharedArrayBuffer)))return h(e,a,c);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var f=e.valueOf&&e.valueOf();if(null!=f&&f!==e)return r.from(f,a,c);var d=function(e){if(r.isBuffer(e)){var a=0|u(e.length),c=i(a);return 0===c.length||e.copy(c,0,0,a),c}return void 0!==e.length?"number"!=typeof e.length||z(e.length)?i(0):l(e):"Buffer"===e.type&&Array.isArray(e.data)?l(e.data):void 0}(e);if(d)return d;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return r.from(e[Symbol.toPrimitive]("string"),a,c);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function s(e){return o(e),i(e<0?0:0|u(e))}function l(e){for(var a=e.length<0?0:0|u(e.length),c=i(a),f=0;f=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+t.toString(16)+" bytes");return 0|e}function x(e,a){if(r.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||D(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var c=e.length,f=arguments.length>2&&!0===arguments[2];if(!f&&0===c)return 0;for(var d=!1;;)switch(a){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return N(e).length;default:if(d)return f?-1:j(e).length;a=(""+a).toLowerCase(),d=!0}}function p(e,a,c){var f=!1;if((void 0===a||a<0)&&(a=0),a>this.length)return"";if((void 0===c||c>this.length)&&(c=this.length),c<=0)return"";if((c>>>=0)<=(a>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,a,c);case"utf8":case"utf-8":return I(this,a,c);case"ascii":return E(this,a,c);case"latin1":case"binary":return S(this,a,c);case"base64":return L(this,a,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,a,c);default:if(f)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),f=!0}}function g(e,a,c){var f=e[a];e[a]=e[c],e[c]=f}function m(e,a,c,f,d){if(0===e.length)return-1;if("string"==typeof c?(f=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),z(c=+c)&&(c=d?0:e.length-1),c<0&&(c=e.length+c),c>=e.length){if(d)return-1;c=e.length-1}else if(c<0){if(!d)return-1;c=0}if("string"==typeof a&&(a=r.from(a,f)),r.isBuffer(a))return 0===a.length?-1:y(e,a,c,f,d);if("number"==typeof a)return a&=255,"function"==typeof Uint8Array.prototype.indexOf?d?Uint8Array.prototype.indexOf.call(e,a,c):Uint8Array.prototype.lastIndexOf.call(e,a,c):y(e,[a],c,f,d);throw new TypeError("val must be string, number or Buffer")}function y(e,a,c,f,d){var b,t=1,i=e.length,r=a.length;if(void 0!==f&&("ucs2"===(f=String(f).toLowerCase())||"ucs-2"===f||"utf16le"===f||"utf-16le"===f)){if(e.length<2||a.length<2)return-1;t=2,i/=2,r/=2,c/=2}function n(e,a){return 1===t?e[a]:e.readUInt16BE(a*t)}if(d){var o=-1;for(b=c;bi&&(c=i-r),b=c;b>=0;b--){for(var s=!0,l=0;ld&&(f=d):f=d;var b=a.length;f>b/2&&(f=b/2);for(var t=0;t>8,d=c%256,b.push(d),b.push(f);return b}(a,e.length-c),e,c,f)}function L(e,a,c){return 0===a&&c===e.length?f.fromByteArray(e):f.fromByteArray(e.slice(a,c))}function I(e,a,c){c=Math.min(e.length,c);for(var f=[],d=a;d239?4:n>223?3:n>191?2:1;if(d+s<=c)switch(s){case 1:n<128&&(o=n);break;case 2:128==(192&(b=e[d+1]))&&(r=(31&n)<<6|63&b)>127&&(o=r);break;case 3:b=e[d+1],t=e[d+2],128==(192&b)&&128==(192&t)&&(r=(15&n)<<12|(63&b)<<6|63&t)>2047&&(r<55296||r>57343)&&(o=r);break;case 4:b=e[d+1],t=e[d+2],i=e[d+3],128==(192&b)&&128==(192&t)&&128==(192&i)&&(r=(15&n)<<18|(63&b)<<12|(63&t)<<6|63&i)>65535&&r<1114112&&(o=r)}null===o?(o=65533,s=1):o>65535&&(o-=65536,f.push(o>>>10&1023|55296),o=56320|1023&o),f.push(o),d+=s}return function(e){var a=e.length;if(a<=k)return String.fromCharCode.apply(String,e);for(var c="",f=0;ff.length?r.from(b).copy(f,d):Uint8Array.prototype.set.call(f,b,d);else{if(!r.isBuffer(b))throw new TypeError('"list" argument must be an Array of Buffers');b.copy(f,d)}d+=b.length}return f},r.byteLength=x,r.prototype._isBuffer=!0,r.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var a=0;ac&&(e+=" ... "),""},b&&(r.prototype[b]=r.prototype.inspect),r.prototype.compare=function(e,a,c,f,d){if(D(e,Uint8Array)&&(e=r.from(e,e.offset,e.byteLength)),!r.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===a&&(a=0),void 0===c&&(c=e?e.length:0),void 0===f&&(f=0),void 0===d&&(d=this.length),a<0||c>e.length||f<0||d>this.length)throw new RangeError("out of range index");if(f>=d&&a>=c)return 0;if(f>=d)return-1;if(a>=c)return 1;if(this===e)return 0;for(var b=(d>>>=0)-(f>>>=0),t=(c>>>=0)-(a>>>=0),i=Math.min(b,t),n=this.slice(f,d),o=e.slice(a,c),s=0;s>>=0,isFinite(c)?(c>>>=0,void 0===f&&(f="utf8")):(f=c,c=void 0)}var d=this.length-a;if((void 0===c||c>d)&&(c=d),e.length>0&&(c<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");f||(f="utf8");for(var b=!1;;)switch(f){case"hex":return _(this,e,a,c);case"utf8":case"utf-8":return v(this,e,a,c);case"ascii":case"latin1":case"binary":return w(this,e,a,c);case"base64":return M(this,e,a,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,a,c);default:if(b)throw new TypeError("Unknown encoding: "+f);f=(""+f).toLowerCase(),b=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function E(e,a,c){var f="";c=Math.min(e.length,c);for(var d=a;df)&&(c=f);for(var d="",b=a;bc)throw new RangeError("Trying to access beyond buffer length")}function O(e,a,c,f,d,b){if(!r.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>d||ae.length)throw new RangeError("Index out of range")}function P(e,a,c,f,d,b){if(c+f>e.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function R(e,a,c,f,b){return a=+a,c>>>=0,b||P(e,0,c,4),d.write(e,a,c,f,23,4),c+4}function T(e,a,c,f,b){return a=+a,c>>>=0,b||P(e,0,c,8),d.write(e,a,c,f,52,8),c+8}r.prototype.slice=function(e,a){var c=this.length;(e=~~e)<0?(e+=c)<0&&(e=0):e>c&&(e=c),(a=void 0===a?c:~~a)<0?(a+=c)<0&&(a=0):a>c&&(a=c),a>>=0,a>>>=0,c||F(e,a,this.length);for(var f=this[e],d=1,b=0;++b>>=0,a>>>=0,c||F(e,a,this.length);for(var f=this[e+--a],d=1;a>0&&(d*=256);)f+=this[e+--a]*d;return f},r.prototype.readUint8=r.prototype.readUInt8=function(e,a){return e>>>=0,a||F(e,1,this.length),this[e]},r.prototype.readUint16LE=r.prototype.readUInt16LE=function(e,a){return e>>>=0,a||F(e,2,this.length),this[e]|this[e+1]<<8},r.prototype.readUint16BE=r.prototype.readUInt16BE=function(e,a){return e>>>=0,a||F(e,2,this.length),this[e]<<8|this[e+1]},r.prototype.readUint32LE=r.prototype.readUInt32LE=function(e,a){return e>>>=0,a||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},r.prototype.readUint32BE=r.prototype.readUInt32BE=function(e,a){return e>>>=0,a||F(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},r.prototype.readIntLE=function(e,a,c){e>>>=0,a>>>=0,c||F(e,a,this.length);for(var f=this[e],d=1,b=0;++b=(d*=128)&&(f-=Math.pow(2,8*a)),f},r.prototype.readIntBE=function(e,a,c){e>>>=0,a>>>=0,c||F(e,a,this.length);for(var f=a,d=1,b=this[e+--f];f>0&&(d*=256);)b+=this[e+--f]*d;return b>=(d*=128)&&(b-=Math.pow(2,8*a)),b},r.prototype.readInt8=function(e,a){return e>>>=0,a||F(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},r.prototype.readInt16LE=function(e,a){e>>>=0,a||F(e,2,this.length);var c=this[e]|this[e+1]<<8;return 32768&c?4294901760|c:c},r.prototype.readInt16BE=function(e,a){e>>>=0,a||F(e,2,this.length);var c=this[e+1]|this[e]<<8;return 32768&c?4294901760|c:c},r.prototype.readInt32LE=function(e,a){return e>>>=0,a||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},r.prototype.readInt32BE=function(e,a){return e>>>=0,a||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},r.prototype.readFloatLE=function(e,a){return e>>>=0,a||F(e,4,this.length),d.read(this,e,!0,23,4)},r.prototype.readFloatBE=function(e,a){return e>>>=0,a||F(e,4,this.length),d.read(this,e,!1,23,4)},r.prototype.readDoubleLE=function(e,a){return e>>>=0,a||F(e,8,this.length),d.read(this,e,!0,52,8)},r.prototype.readDoubleBE=function(e,a){return e>>>=0,a||F(e,8,this.length),d.read(this,e,!1,52,8)},r.prototype.writeUintLE=r.prototype.writeUIntLE=function(e,a,c,f){e=+e,a>>>=0,c>>>=0,f||O(this,e,a,c,Math.pow(2,8*c)-1,0);var d=1,b=0;for(this[a]=255&e;++b>>=0,c>>>=0,f||O(this,e,a,c,Math.pow(2,8*c)-1,0);var d=c-1,b=1;for(this[a+d]=255&e;--d>=0&&(b*=256);)this[a+d]=e/b&255;return a+c},r.prototype.writeUint8=r.prototype.writeUInt8=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,1,255,0),this[a]=255&e,a+1},r.prototype.writeUint16LE=r.prototype.writeUInt16LE=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,2,65535,0),this[a]=255&e,this[a+1]=e>>>8,a+2},r.prototype.writeUint16BE=r.prototype.writeUInt16BE=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,2,65535,0),this[a]=e>>>8,this[a+1]=255&e,a+2},r.prototype.writeUint32LE=r.prototype.writeUInt32LE=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,4,4294967295,0),this[a+3]=e>>>24,this[a+2]=e>>>16,this[a+1]=e>>>8,this[a]=255&e,a+4},r.prototype.writeUint32BE=r.prototype.writeUInt32BE=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,4,4294967295,0),this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e,a+4},r.prototype.writeIntLE=function(e,a,c,f){if(e=+e,a>>>=0,!f){var d=Math.pow(2,8*c-1);O(this,e,a,c,d-1,-d)}var b=0,t=1,i=0;for(this[a]=255&e;++b>>=0,!f){var d=Math.pow(2,8*c-1);O(this,e,a,c,d-1,-d)}var b=c-1,t=1,i=0;for(this[a+b]=255&e;--b>=0&&(t*=256);)e<0&&0===i&&0!==this[a+b+1]&&(i=1),this[a+b]=(e/t|0)-i&255;return a+c},r.prototype.writeInt8=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,1,127,-128),e<0&&(e=255+e+1),this[a]=255&e,a+1},r.prototype.writeInt16LE=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,2,32767,-32768),this[a]=255&e,this[a+1]=e>>>8,a+2},r.prototype.writeInt16BE=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,2,32767,-32768),this[a]=e>>>8,this[a+1]=255&e,a+2},r.prototype.writeInt32LE=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,4,2147483647,-2147483648),this[a]=255&e,this[a+1]=e>>>8,this[a+2]=e>>>16,this[a+3]=e>>>24,a+4},r.prototype.writeInt32BE=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e,a+4},r.prototype.writeFloatLE=function(e,a,c){return R(this,e,a,!0,c)},r.prototype.writeFloatBE=function(e,a,c){return R(this,e,a,!1,c)},r.prototype.writeDoubleLE=function(e,a,c){return T(this,e,a,!0,c)},r.prototype.writeDoubleBE=function(e,a,c){return T(this,e,a,!1,c)},r.prototype.copy=function(e,a,c,f){if(!r.isBuffer(e))throw new TypeError("argument should be a Buffer");if(c||(c=0),f||0===f||(f=this.length),a>=e.length&&(a=e.length),a||(a=0),f>0&&f=this.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("sourceEnd out of bounds");f>this.length&&(f=this.length),e.length-a>>=0,c=void 0===c?this.length:c>>>0,e||(e=0),"number"==typeof e)for(b=a;b55295&&c<57344){if(!d){if(c>56319){(a-=3)>-1&&b.push(239,191,189);continue}if(t+1===f){(a-=3)>-1&&b.push(239,191,189);continue}d=c;continue}if(c<56320){(a-=3)>-1&&b.push(239,191,189),d=c;continue}c=65536+(d-55296<<10|c-56320)}else d&&(a-=3)>-1&&b.push(239,191,189);if(d=null,c<128){if((a-=1)<0)break;b.push(c)}else if(c<2048){if((a-=2)<0)break;b.push(c>>6|192,63&c|128)}else if(c<65536){if((a-=3)<0)break;b.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(c<1114112))throw new Error("Invalid code point");if((a-=4)<0)break;b.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return b}function N(e){return f.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,a,c,f){for(var d=0;d=a.length||d>=e.length);++d)a[d+c]=e[d];return d}function D(e,a){return e instanceof a||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===a.name}function z(e){return e!=e}var Q=function(){for(var e="0123456789abcdef",a=new Array(256),c=0;c<16;++c)for(var f=16*c,d=0;d<16;++d)a[f+d]=e[c]+e[d];return a}()},8075:(e,a,c)=>{"use strict";var f=c(453),d=c(487),b=d(f("String.prototype.indexOf"));e.exports=function(e,a){var c=f(e,!!a);return"function"==typeof c&&b(e,".prototype.")>-1?d(c):c}},487:(e,a,c)=>{"use strict";var f=c(6743),d=c(453),b=c(6897),t=c(9675),i=d("%Function.prototype.apply%"),r=d("%Function.prototype.call%"),n=d("%Reflect.apply%",!0)||f.call(r,i),o=c(655),s=d("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new t("a function is required");var a=n(f,r,arguments);return b(a,1+s(0,e.length-(arguments.length-1)),!0)};var l=function(){return n(f,i,arguments)};o?o(e.exports,"apply",{value:l}):e.exports.apply=l},297:e=>{"use strict";const a=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});e.exports={names:a}},7684:(e,a,c)=>{"use strict";const f=c(1466),d=c(1203),{names:b}=c(297),{toString:t}=c(7302),{fromString:i}=c(4117),{concat:r}=c(5007),n={};for(const e in b){const a=e;n[b[a]]=a}function o(e){if(!(e instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(e.length<2)throw new Error("multihash too short. must be > 2 bytes.");const a=d.decode(e);if(!h(a))throw new Error(`multihash unknown function code: 0x${a.toString(16)}`);e=e.slice(d.decode.bytes);const c=d.decode(e);if(c<0)throw new Error(`multihash invalid length: ${c}`);if((e=e.slice(d.decode.bytes)).length!==c)throw new Error(`multihash length inconsistent: 0x${t(e,"base16")}`);return{code:a,name:n[a],length:c,digest:e}}function s(e){let a=e;if("string"==typeof e){if(void 0===b[e])throw new Error(`Unrecognized hash function named: ${e}`);a=b[e]}if("number"!=typeof a)throw new Error(`Hash function code should be a number. Got: ${a}`);if(void 0===n[a]&&!l(a))throw new Error(`Unrecognized function code: ${a}`);return a}function l(e){return e>0&&e<16}function h(e){return!!l(e)||!!n[e]}function u(e){o(e)}Object.freeze(n),e.exports={names:b,codes:n,toHexString:function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return t(e,"base16")},fromHexString:function(e){return i(e,"base16")},toB58String:function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return t(f.encode("base58btc",e)).slice(1)},fromB58String:function(e){const a=e instanceof Uint8Array?t(e):e;return f.decode("z"+a)},decode:o,encode:function(e,a,c){if(!e||void 0===a)throw new Error("multihash encode requires at least two args: digest, code");const f=s(a);if(!(e instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(null==c&&(c=e.length),c&&e.length!==c)throw new Error("digest length should be equal to specified length.");const b=d.encode(f),t=d.encode(c);return r([b,t,e],b.length+t.length+e.length)},coerceCode:s,isAppCode:l,validate:u,prefix:function(e){return u(e),e.subarray(0,2)},isValidCode:h}},4378:(e,a,c)=>{"use strict";const f=c(7684),d={checkCIDComponents:function(e){if(null==e)return"null values are not valid CIDs";if(0!==e.version&&1!==e.version)return"Invalid version, must be a number equal to 1 or 0";if("string"!=typeof e.codec)return"codec must be string";if(0===e.version){if("dag-pb"!==e.codec)return"codec must be 'dag-pb' for CIDv0";if("base58btc"!==e.multibaseName)return"multibaseName must be 'base58btc' for CIDv0"}if(!(e.multihash instanceof Uint8Array))return"multihash must be a Uint8Array";try{f.validate(e.multihash)}catch(e){let a=e.message;return a||(a="Multihash validation failed"),a}}};e.exports=d},6613:(e,a,c)=>{"use strict";const f=c(7684),d=c(1466),b=c(2021),t=c(4378),{concat:i}=c(5007),{toString:r}=c(7302),{equals:n}=c(8402),o=b.nameToCode,s=Object.keys(o).reduce(((e,a)=>(e[o[a]]=a,e)),{}),l=Symbol.for("@ipld/js-cid/CID");class h{constructor(e,a,c,t){if(this.version,this.codec,this.multihash,Object.defineProperty(this,l,{value:!0}),h.isCID(e)){const a=e;return this.version=a.version,this.codec=a.codec,this.multihash=a.multihash,void(this.multibaseName=a.multibaseName||(0===a.version?"base58btc":"base32"))}if("string"==typeof e){const a=d.isEncoded(e);if(a){const c=d.decode(e);this.version=parseInt(c[0].toString(),16),this.codec=b.getCodec(c.slice(1)),this.multihash=b.rmPrefix(c.slice(1)),this.multibaseName=a}else this.version=0,this.codec="dag-pb",this.multihash=f.fromB58String(e),this.multibaseName="base58btc";return h.validateCID(this),void Object.defineProperty(this,"string",{value:e})}if(e instanceof Uint8Array){const a=parseInt(e[0].toString(),16);if(1===a){const c=e;this.version=a,this.codec=b.getCodec(c.slice(1)),this.multihash=b.rmPrefix(c.slice(1)),this.multibaseName="base32"}else this.version=0,this.codec="dag-pb",this.multihash=e,this.multibaseName="base58btc";h.validateCID(this)}else this.version=e,"number"==typeof a&&(a=s[a]),this.codec=a,this.multihash=c,this.multibaseName=t||(0===e?"base58btc":"base32"),h.validateCID(this)}get bytes(){let e=this._bytes;if(!e){if(0===this.version)e=this.multihash;else{if(1!==this.version)throw new Error("unsupported version");{const a=b.getCodeVarint(this.codec);e=i([[1],a,this.multihash],1+a.byteLength+this.multihash.byteLength)}}Object.defineProperty(this,"_bytes",{value:e})}return e}get prefix(){const e=b.getCodeVarint(this.codec),a=f.prefix(this.multihash);return i([[this.version],e,a],1+e.byteLength+a.byteLength)}get code(){return o[this.codec]}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");const{name:e,length:a}=f.decode(this.multihash);if("sha2-256"!==e)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");if(32!==a)throw new Error("Cannot convert non 32 byte multihash CID to CIDv0");return new h(0,this.codec,this.multihash)}toV1(){return new h(1,this.codec,this.multihash,this.multibaseName)}toBaseEncodedString(e=this.multibaseName){if(this.string&&0!==this.string.length&&e===this.multibaseName)return this.string;let a;if(0===this.version){if("base58btc"!==e)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");a=f.toB58String(this.multihash)}else{if(1!==this.version)throw new Error("unsupported version");a=r(d.encode(e,this.bytes))}return e===this.multibaseName&&Object.defineProperty(this,"string",{value:a}),a}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}toString(e){return this.toBaseEncodedString(e)}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(e){return this.codec===e.codec&&this.version===e.version&&n(this.multihash,e.multihash)}static validateCID(e){const a=t.checkCIDComponents(e);if(a)throw new Error(a)}static isCID(e){return e instanceof h||Boolean(e&&e[l])}}h.codecs=o,e.exports=h},6168:(e,a,c)=>{var f=c(2861).Buffer,d=c(8310).Transform,b=c(3141).I;function t(e){d.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}c(6698)(t,d),t.prototype.update=function(e,a,c){"string"==typeof e&&(e=f.from(e,a));var d=this._update(e);return this.hashMode?this:(c&&(d=this._toString(d,c)),d)},t.prototype.setAutoPadding=function(){},t.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},t.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},t.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},t.prototype._transform=function(e,a,c){var f;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){f=e}finally{c(f)}},t.prototype._flush=function(e){var a;try{this.push(this.__final())}catch(e){a=e}e(a)},t.prototype._finalOrDigest=function(e){var a=this.__final()||f.alloc(0);return e&&(a=this._toString(a,e,!0)),a},t.prototype._toString=function(e,a,c){if(this._decoder||(this._decoder=new b(a),this._encoding=a),this._encoding!==a)throw new Error("can't switch encodings");var f=this._decoder.write(e);return c&&(f+=this._decoder.end()),f},e.exports=t},5622:(e,a,c)=>{function f(e){return Object.prototype.toString.call(e)}a.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===f(e)},a.isBoolean=function(e){return"boolean"==typeof e},a.isNull=function(e){return null===e},a.isNullOrUndefined=function(e){return null==e},a.isNumber=function(e){return"number"==typeof e},a.isString=function(e){return"string"==typeof e},a.isSymbol=function(e){return"symbol"==typeof e},a.isUndefined=function(e){return void 0===e},a.isRegExp=function(e){return"[object RegExp]"===f(e)},a.isObject=function(e){return"object"==typeof e&&null!==e},a.isDate=function(e){return"[object Date]"===f(e)},a.isError=function(e){return"[object Error]"===f(e)||e instanceof Error},a.isFunction=function(e){return"function"==typeof e},a.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},a.isBuffer=c(8287).Buffer.isBuffer},1324:(e,a,c)=>{var f=c(2045).hp,d=c(6729),b=c(2801);e.exports=function(e){return new i(e)};var t={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function i(e){this.curveType=t[e],this.curveType||(this.curveType={name:e}),this.curve=new d.ec(this.curveType.name),this.keys=void 0}function r(e,a,c){Array.isArray(e)||(e=e.toArray());var d=new f(e);if(c&&d.length=65&&c<=70?c-55:c>=97&&c<=102?c-87:c-48&15}function r(e,a,c){var f=i(e,c);return c-1>=a&&(f|=i(e,c-1)<<4),f}function n(e,a,c,f){for(var d=0,b=Math.min(e.length,c),t=a;t=49?i-49+10:i>=17?i-17+10:i}return d}b.isBN=function(e){return e instanceof b||null!==e&&"object"==typeof e&&e.constructor.wordSize===b.wordSize&&Array.isArray(e.words)},b.max=function(e,a){return e.cmp(a)>0?e:a},b.min=function(e,a){return e.cmp(a)<0?e:a},b.prototype._init=function(e,a,c){if("number"==typeof e)return this._initNumber(e,a,c);if("object"==typeof e)return this._initArray(e,a,c);"hex"===a&&(a=16),f(a===(0|a)&&a>=2&&a<=36);var d=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(d++,this.negative=1),d=0;d-=3)t=e[d]|e[d-1]<<8|e[d-2]<<16,this.words[b]|=t<>>26-i&67108863,(i+=24)>=26&&(i-=26,b++);else if("le"===c)for(d=0,b=0;d>>26-i&67108863,(i+=24)>=26&&(i-=26,b++);return this.strip()},b.prototype._parseHex=function(e,a,c){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var f=0;f=a;f-=2)d=r(e,a,f)<=18?(b-=18,t+=1,this.words[t]|=d>>>26):b+=8;else for(f=(e.length-a)%2==0?a+1:a;f=18?(b-=18,t+=1,this.words[t]|=d>>>26):b+=8;this.strip()},b.prototype._parseBase=function(e,a,c){this.words=[0],this.length=1;for(var f=0,d=1;d<=67108863;d*=a)f++;f--,d=d/a|0;for(var b=e.length-c,t=b%f,i=Math.min(b,b-t)+c,r=0,o=c;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},b.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},b.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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 h(e,a,c){c.negative=a.negative^e.negative;var f=e.length+a.length|0;c.length=f,f=f-1|0;var d=0|e.words[0],b=0|a.words[0],t=d*b,i=67108863&t,r=t/67108864|0;c.words[0]=i;for(var n=1;n>>26,s=67108863&r,l=Math.min(n,a.length-1),h=Math.max(0,n-e.length+1);h<=l;h++){var u=n-h|0;o+=(t=(d=0|e.words[u])*(b=0|a.words[h])+s)/67108864|0,s=67108863&t}c.words[n]=0|s,r=0|o}return 0!==r?c.words[n]=0|r:c.length--,c.strip()}b.prototype.toString=function(e,a){var c;if(a=0|a||1,16===(e=e||10)||"hex"===e){c="";for(var d=0,b=0,t=0;t>>24-d&16777215)||t!==this.length-1?o[6-r.length]+r+c:r+c,(d+=2)>=26&&(d-=26,t--)}for(0!==b&&(c=b.toString(16)+c);c.length%a!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(e===(0|e)&&e>=2&&e<=36){var n=s[e],h=l[e];c="";var u=this.clone();for(u.negative=0;!u.isZero();){var x=u.modn(h).toString(e);c=(u=u.idivn(h)).isZero()?x+c:o[n-x.length]+x+c}for(this.isZero()&&(c="0"+c);c.length%a!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}f(!1,"Base should be between 2 and 36")},b.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&f(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},b.prototype.toJSON=function(){return this.toString(16)},b.prototype.toBuffer=function(e,a){return f(void 0!==t),this.toArrayLike(t,e,a)},b.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},b.prototype.toArrayLike=function(e,a,c){var d=this.byteLength(),b=c||Math.max(1,d);f(d<=b,"byte array longer than desired length"),f(b>0,"Requested array length <= 0"),this.strip();var t,i,r="le"===a,n=new e(b),o=this.clone();if(r){for(i=0;!o.isZero();i++)t=o.andln(255),o.iushrn(8),n[i]=t;for(;i=4096&&(c+=13,a>>>=13),a>=64&&(c+=7,a>>>=7),a>=8&&(c+=4,a>>>=4),a>=2&&(c+=2,a>>>=2),c+a},b.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,c=0;return 8191&a||(c+=13,a>>>=13),127&a||(c+=7,a>>>=7),15&a||(c+=4,a>>>=4),3&a||(c+=2,a>>>=2),1&a||c++,c},b.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},b.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},b.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},b.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var c=0;ce.length?this.clone().iand(e):e.clone().iand(this)},b.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},b.prototype.iuxor=function(e){var a,c;this.length>e.length?(a=this,c=e):(a=e,c=this);for(var f=0;fe.length?this.clone().ixor(e):e.clone().ixor(this)},b.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},b.prototype.inotn=function(e){f("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),c=e%26;this._expand(a),c>0&&a--;for(var d=0;d0&&(this.words[d]=~this.words[d]&67108863>>26-c),this.strip()},b.prototype.notn=function(e){return this.clone().inotn(e)},b.prototype.setn=function(e,a){f("number"==typeof e&&e>=0);var c=e/26|0,d=e%26;return this._expand(c+1),this.words[c]=a?this.words[c]|1<e.length?(c=this,f=e):(c=e,f=this);for(var d=0,b=0;b>>26;for(;0!==d&&b>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;be.length?this.clone().iadd(e):e.clone().iadd(this)},b.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var c,f,d=this.cmp(e);if(0===d)return this.negative=0,this.length=1,this.words[0]=0,this;d>0?(c=this,f=e):(c=e,f=this);for(var b=0,t=0;t>26,this.words[t]=67108863&a;for(;0!==b&&t>26,this.words[t]=67108863&a;if(0===b&&t>>13,h=0|t[1],u=8191&h,x=h>>>13,p=0|t[2],g=8191&p,m=p>>>13,y=0|t[3],_=8191&y,v=y>>>13,w=0|t[4],M=8191&w,A=w>>>13,L=0|t[5],I=8191&L,k=L>>>13,E=0|t[6],S=8191&E,C=E>>>13,B=0|t[7],F=8191&B,O=B>>>13,P=0|t[8],R=8191&P,T=P>>>13,U=0|t[9],j=8191&U,N=U>>>13,q=0|i[0],D=8191&q,z=q>>>13,Q=0|i[1],G=8191&Q,K=Q>>>13,H=0|i[2],V=8191&H,Z=H>>>13,W=0|i[3],Y=8191&W,J=W>>>13,$=0|i[4],X=8191&$,ee=$>>>13,ae=0|i[5],ce=8191&ae,fe=ae>>>13,de=0|i[6],be=8191&de,te=de>>>13,ie=0|i[7],re=8191&ie,ne=ie>>>13,oe=0|i[8],se=8191&oe,le=oe>>>13,he=0|i[9],ue=8191&he,xe=he>>>13;c.negative=e.negative^a.negative,c.length=19;var pe=(n+(f=Math.imul(s,D))|0)+((8191&(d=(d=Math.imul(s,z))+Math.imul(l,D)|0))<<13)|0;n=((b=Math.imul(l,z))+(d>>>13)|0)+(pe>>>26)|0,pe&=67108863,f=Math.imul(u,D),d=(d=Math.imul(u,z))+Math.imul(x,D)|0,b=Math.imul(x,z);var ge=(n+(f=f+Math.imul(s,G)|0)|0)+((8191&(d=(d=d+Math.imul(s,K)|0)+Math.imul(l,G)|0))<<13)|0;n=((b=b+Math.imul(l,K)|0)+(d>>>13)|0)+(ge>>>26)|0,ge&=67108863,f=Math.imul(g,D),d=(d=Math.imul(g,z))+Math.imul(m,D)|0,b=Math.imul(m,z),f=f+Math.imul(u,G)|0,d=(d=d+Math.imul(u,K)|0)+Math.imul(x,G)|0,b=b+Math.imul(x,K)|0;var me=(n+(f=f+Math.imul(s,V)|0)|0)+((8191&(d=(d=d+Math.imul(s,Z)|0)+Math.imul(l,V)|0))<<13)|0;n=((b=b+Math.imul(l,Z)|0)+(d>>>13)|0)+(me>>>26)|0,me&=67108863,f=Math.imul(_,D),d=(d=Math.imul(_,z))+Math.imul(v,D)|0,b=Math.imul(v,z),f=f+Math.imul(g,G)|0,d=(d=d+Math.imul(g,K)|0)+Math.imul(m,G)|0,b=b+Math.imul(m,K)|0,f=f+Math.imul(u,V)|0,d=(d=d+Math.imul(u,Z)|0)+Math.imul(x,V)|0,b=b+Math.imul(x,Z)|0;var ye=(n+(f=f+Math.imul(s,Y)|0)|0)+((8191&(d=(d=d+Math.imul(s,J)|0)+Math.imul(l,Y)|0))<<13)|0;n=((b=b+Math.imul(l,J)|0)+(d>>>13)|0)+(ye>>>26)|0,ye&=67108863,f=Math.imul(M,D),d=(d=Math.imul(M,z))+Math.imul(A,D)|0,b=Math.imul(A,z),f=f+Math.imul(_,G)|0,d=(d=d+Math.imul(_,K)|0)+Math.imul(v,G)|0,b=b+Math.imul(v,K)|0,f=f+Math.imul(g,V)|0,d=(d=d+Math.imul(g,Z)|0)+Math.imul(m,V)|0,b=b+Math.imul(m,Z)|0,f=f+Math.imul(u,Y)|0,d=(d=d+Math.imul(u,J)|0)+Math.imul(x,Y)|0,b=b+Math.imul(x,J)|0;var _e=(n+(f=f+Math.imul(s,X)|0)|0)+((8191&(d=(d=d+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;n=((b=b+Math.imul(l,ee)|0)+(d>>>13)|0)+(_e>>>26)|0,_e&=67108863,f=Math.imul(I,D),d=(d=Math.imul(I,z))+Math.imul(k,D)|0,b=Math.imul(k,z),f=f+Math.imul(M,G)|0,d=(d=d+Math.imul(M,K)|0)+Math.imul(A,G)|0,b=b+Math.imul(A,K)|0,f=f+Math.imul(_,V)|0,d=(d=d+Math.imul(_,Z)|0)+Math.imul(v,V)|0,b=b+Math.imul(v,Z)|0,f=f+Math.imul(g,Y)|0,d=(d=d+Math.imul(g,J)|0)+Math.imul(m,Y)|0,b=b+Math.imul(m,J)|0,f=f+Math.imul(u,X)|0,d=(d=d+Math.imul(u,ee)|0)+Math.imul(x,X)|0,b=b+Math.imul(x,ee)|0;var ve=(n+(f=f+Math.imul(s,ce)|0)|0)+((8191&(d=(d=d+Math.imul(s,fe)|0)+Math.imul(l,ce)|0))<<13)|0;n=((b=b+Math.imul(l,fe)|0)+(d>>>13)|0)+(ve>>>26)|0,ve&=67108863,f=Math.imul(S,D),d=(d=Math.imul(S,z))+Math.imul(C,D)|0,b=Math.imul(C,z),f=f+Math.imul(I,G)|0,d=(d=d+Math.imul(I,K)|0)+Math.imul(k,G)|0,b=b+Math.imul(k,K)|0,f=f+Math.imul(M,V)|0,d=(d=d+Math.imul(M,Z)|0)+Math.imul(A,V)|0,b=b+Math.imul(A,Z)|0,f=f+Math.imul(_,Y)|0,d=(d=d+Math.imul(_,J)|0)+Math.imul(v,Y)|0,b=b+Math.imul(v,J)|0,f=f+Math.imul(g,X)|0,d=(d=d+Math.imul(g,ee)|0)+Math.imul(m,X)|0,b=b+Math.imul(m,ee)|0,f=f+Math.imul(u,ce)|0,d=(d=d+Math.imul(u,fe)|0)+Math.imul(x,ce)|0,b=b+Math.imul(x,fe)|0;var we=(n+(f=f+Math.imul(s,be)|0)|0)+((8191&(d=(d=d+Math.imul(s,te)|0)+Math.imul(l,be)|0))<<13)|0;n=((b=b+Math.imul(l,te)|0)+(d>>>13)|0)+(we>>>26)|0,we&=67108863,f=Math.imul(F,D),d=(d=Math.imul(F,z))+Math.imul(O,D)|0,b=Math.imul(O,z),f=f+Math.imul(S,G)|0,d=(d=d+Math.imul(S,K)|0)+Math.imul(C,G)|0,b=b+Math.imul(C,K)|0,f=f+Math.imul(I,V)|0,d=(d=d+Math.imul(I,Z)|0)+Math.imul(k,V)|0,b=b+Math.imul(k,Z)|0,f=f+Math.imul(M,Y)|0,d=(d=d+Math.imul(M,J)|0)+Math.imul(A,Y)|0,b=b+Math.imul(A,J)|0,f=f+Math.imul(_,X)|0,d=(d=d+Math.imul(_,ee)|0)+Math.imul(v,X)|0,b=b+Math.imul(v,ee)|0,f=f+Math.imul(g,ce)|0,d=(d=d+Math.imul(g,fe)|0)+Math.imul(m,ce)|0,b=b+Math.imul(m,fe)|0,f=f+Math.imul(u,be)|0,d=(d=d+Math.imul(u,te)|0)+Math.imul(x,be)|0,b=b+Math.imul(x,te)|0;var Me=(n+(f=f+Math.imul(s,re)|0)|0)+((8191&(d=(d=d+Math.imul(s,ne)|0)+Math.imul(l,re)|0))<<13)|0;n=((b=b+Math.imul(l,ne)|0)+(d>>>13)|0)+(Me>>>26)|0,Me&=67108863,f=Math.imul(R,D),d=(d=Math.imul(R,z))+Math.imul(T,D)|0,b=Math.imul(T,z),f=f+Math.imul(F,G)|0,d=(d=d+Math.imul(F,K)|0)+Math.imul(O,G)|0,b=b+Math.imul(O,K)|0,f=f+Math.imul(S,V)|0,d=(d=d+Math.imul(S,Z)|0)+Math.imul(C,V)|0,b=b+Math.imul(C,Z)|0,f=f+Math.imul(I,Y)|0,d=(d=d+Math.imul(I,J)|0)+Math.imul(k,Y)|0,b=b+Math.imul(k,J)|0,f=f+Math.imul(M,X)|0,d=(d=d+Math.imul(M,ee)|0)+Math.imul(A,X)|0,b=b+Math.imul(A,ee)|0,f=f+Math.imul(_,ce)|0,d=(d=d+Math.imul(_,fe)|0)+Math.imul(v,ce)|0,b=b+Math.imul(v,fe)|0,f=f+Math.imul(g,be)|0,d=(d=d+Math.imul(g,te)|0)+Math.imul(m,be)|0,b=b+Math.imul(m,te)|0,f=f+Math.imul(u,re)|0,d=(d=d+Math.imul(u,ne)|0)+Math.imul(x,re)|0,b=b+Math.imul(x,ne)|0;var Ae=(n+(f=f+Math.imul(s,se)|0)|0)+((8191&(d=(d=d+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;n=((b=b+Math.imul(l,le)|0)+(d>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,f=Math.imul(j,D),d=(d=Math.imul(j,z))+Math.imul(N,D)|0,b=Math.imul(N,z),f=f+Math.imul(R,G)|0,d=(d=d+Math.imul(R,K)|0)+Math.imul(T,G)|0,b=b+Math.imul(T,K)|0,f=f+Math.imul(F,V)|0,d=(d=d+Math.imul(F,Z)|0)+Math.imul(O,V)|0,b=b+Math.imul(O,Z)|0,f=f+Math.imul(S,Y)|0,d=(d=d+Math.imul(S,J)|0)+Math.imul(C,Y)|0,b=b+Math.imul(C,J)|0,f=f+Math.imul(I,X)|0,d=(d=d+Math.imul(I,ee)|0)+Math.imul(k,X)|0,b=b+Math.imul(k,ee)|0,f=f+Math.imul(M,ce)|0,d=(d=d+Math.imul(M,fe)|0)+Math.imul(A,ce)|0,b=b+Math.imul(A,fe)|0,f=f+Math.imul(_,be)|0,d=(d=d+Math.imul(_,te)|0)+Math.imul(v,be)|0,b=b+Math.imul(v,te)|0,f=f+Math.imul(g,re)|0,d=(d=d+Math.imul(g,ne)|0)+Math.imul(m,re)|0,b=b+Math.imul(m,ne)|0,f=f+Math.imul(u,se)|0,d=(d=d+Math.imul(u,le)|0)+Math.imul(x,se)|0,b=b+Math.imul(x,le)|0;var Le=(n+(f=f+Math.imul(s,ue)|0)|0)+((8191&(d=(d=d+Math.imul(s,xe)|0)+Math.imul(l,ue)|0))<<13)|0;n=((b=b+Math.imul(l,xe)|0)+(d>>>13)|0)+(Le>>>26)|0,Le&=67108863,f=Math.imul(j,G),d=(d=Math.imul(j,K))+Math.imul(N,G)|0,b=Math.imul(N,K),f=f+Math.imul(R,V)|0,d=(d=d+Math.imul(R,Z)|0)+Math.imul(T,V)|0,b=b+Math.imul(T,Z)|0,f=f+Math.imul(F,Y)|0,d=(d=d+Math.imul(F,J)|0)+Math.imul(O,Y)|0,b=b+Math.imul(O,J)|0,f=f+Math.imul(S,X)|0,d=(d=d+Math.imul(S,ee)|0)+Math.imul(C,X)|0,b=b+Math.imul(C,ee)|0,f=f+Math.imul(I,ce)|0,d=(d=d+Math.imul(I,fe)|0)+Math.imul(k,ce)|0,b=b+Math.imul(k,fe)|0,f=f+Math.imul(M,be)|0,d=(d=d+Math.imul(M,te)|0)+Math.imul(A,be)|0,b=b+Math.imul(A,te)|0,f=f+Math.imul(_,re)|0,d=(d=d+Math.imul(_,ne)|0)+Math.imul(v,re)|0,b=b+Math.imul(v,ne)|0,f=f+Math.imul(g,se)|0,d=(d=d+Math.imul(g,le)|0)+Math.imul(m,se)|0,b=b+Math.imul(m,le)|0;var Ie=(n+(f=f+Math.imul(u,ue)|0)|0)+((8191&(d=(d=d+Math.imul(u,xe)|0)+Math.imul(x,ue)|0))<<13)|0;n=((b=b+Math.imul(x,xe)|0)+(d>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,f=Math.imul(j,V),d=(d=Math.imul(j,Z))+Math.imul(N,V)|0,b=Math.imul(N,Z),f=f+Math.imul(R,Y)|0,d=(d=d+Math.imul(R,J)|0)+Math.imul(T,Y)|0,b=b+Math.imul(T,J)|0,f=f+Math.imul(F,X)|0,d=(d=d+Math.imul(F,ee)|0)+Math.imul(O,X)|0,b=b+Math.imul(O,ee)|0,f=f+Math.imul(S,ce)|0,d=(d=d+Math.imul(S,fe)|0)+Math.imul(C,ce)|0,b=b+Math.imul(C,fe)|0,f=f+Math.imul(I,be)|0,d=(d=d+Math.imul(I,te)|0)+Math.imul(k,be)|0,b=b+Math.imul(k,te)|0,f=f+Math.imul(M,re)|0,d=(d=d+Math.imul(M,ne)|0)+Math.imul(A,re)|0,b=b+Math.imul(A,ne)|0,f=f+Math.imul(_,se)|0,d=(d=d+Math.imul(_,le)|0)+Math.imul(v,se)|0,b=b+Math.imul(v,le)|0;var ke=(n+(f=f+Math.imul(g,ue)|0)|0)+((8191&(d=(d=d+Math.imul(g,xe)|0)+Math.imul(m,ue)|0))<<13)|0;n=((b=b+Math.imul(m,xe)|0)+(d>>>13)|0)+(ke>>>26)|0,ke&=67108863,f=Math.imul(j,Y),d=(d=Math.imul(j,J))+Math.imul(N,Y)|0,b=Math.imul(N,J),f=f+Math.imul(R,X)|0,d=(d=d+Math.imul(R,ee)|0)+Math.imul(T,X)|0,b=b+Math.imul(T,ee)|0,f=f+Math.imul(F,ce)|0,d=(d=d+Math.imul(F,fe)|0)+Math.imul(O,ce)|0,b=b+Math.imul(O,fe)|0,f=f+Math.imul(S,be)|0,d=(d=d+Math.imul(S,te)|0)+Math.imul(C,be)|0,b=b+Math.imul(C,te)|0,f=f+Math.imul(I,re)|0,d=(d=d+Math.imul(I,ne)|0)+Math.imul(k,re)|0,b=b+Math.imul(k,ne)|0,f=f+Math.imul(M,se)|0,d=(d=d+Math.imul(M,le)|0)+Math.imul(A,se)|0,b=b+Math.imul(A,le)|0;var Ee=(n+(f=f+Math.imul(_,ue)|0)|0)+((8191&(d=(d=d+Math.imul(_,xe)|0)+Math.imul(v,ue)|0))<<13)|0;n=((b=b+Math.imul(v,xe)|0)+(d>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,f=Math.imul(j,X),d=(d=Math.imul(j,ee))+Math.imul(N,X)|0,b=Math.imul(N,ee),f=f+Math.imul(R,ce)|0,d=(d=d+Math.imul(R,fe)|0)+Math.imul(T,ce)|0,b=b+Math.imul(T,fe)|0,f=f+Math.imul(F,be)|0,d=(d=d+Math.imul(F,te)|0)+Math.imul(O,be)|0,b=b+Math.imul(O,te)|0,f=f+Math.imul(S,re)|0,d=(d=d+Math.imul(S,ne)|0)+Math.imul(C,re)|0,b=b+Math.imul(C,ne)|0,f=f+Math.imul(I,se)|0,d=(d=d+Math.imul(I,le)|0)+Math.imul(k,se)|0,b=b+Math.imul(k,le)|0;var Se=(n+(f=f+Math.imul(M,ue)|0)|0)+((8191&(d=(d=d+Math.imul(M,xe)|0)+Math.imul(A,ue)|0))<<13)|0;n=((b=b+Math.imul(A,xe)|0)+(d>>>13)|0)+(Se>>>26)|0,Se&=67108863,f=Math.imul(j,ce),d=(d=Math.imul(j,fe))+Math.imul(N,ce)|0,b=Math.imul(N,fe),f=f+Math.imul(R,be)|0,d=(d=d+Math.imul(R,te)|0)+Math.imul(T,be)|0,b=b+Math.imul(T,te)|0,f=f+Math.imul(F,re)|0,d=(d=d+Math.imul(F,ne)|0)+Math.imul(O,re)|0,b=b+Math.imul(O,ne)|0,f=f+Math.imul(S,se)|0,d=(d=d+Math.imul(S,le)|0)+Math.imul(C,se)|0,b=b+Math.imul(C,le)|0;var Ce=(n+(f=f+Math.imul(I,ue)|0)|0)+((8191&(d=(d=d+Math.imul(I,xe)|0)+Math.imul(k,ue)|0))<<13)|0;n=((b=b+Math.imul(k,xe)|0)+(d>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,f=Math.imul(j,be),d=(d=Math.imul(j,te))+Math.imul(N,be)|0,b=Math.imul(N,te),f=f+Math.imul(R,re)|0,d=(d=d+Math.imul(R,ne)|0)+Math.imul(T,re)|0,b=b+Math.imul(T,ne)|0,f=f+Math.imul(F,se)|0,d=(d=d+Math.imul(F,le)|0)+Math.imul(O,se)|0,b=b+Math.imul(O,le)|0;var Be=(n+(f=f+Math.imul(S,ue)|0)|0)+((8191&(d=(d=d+Math.imul(S,xe)|0)+Math.imul(C,ue)|0))<<13)|0;n=((b=b+Math.imul(C,xe)|0)+(d>>>13)|0)+(Be>>>26)|0,Be&=67108863,f=Math.imul(j,re),d=(d=Math.imul(j,ne))+Math.imul(N,re)|0,b=Math.imul(N,ne),f=f+Math.imul(R,se)|0,d=(d=d+Math.imul(R,le)|0)+Math.imul(T,se)|0,b=b+Math.imul(T,le)|0;var Fe=(n+(f=f+Math.imul(F,ue)|0)|0)+((8191&(d=(d=d+Math.imul(F,xe)|0)+Math.imul(O,ue)|0))<<13)|0;n=((b=b+Math.imul(O,xe)|0)+(d>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,f=Math.imul(j,se),d=(d=Math.imul(j,le))+Math.imul(N,se)|0,b=Math.imul(N,le);var Oe=(n+(f=f+Math.imul(R,ue)|0)|0)+((8191&(d=(d=d+Math.imul(R,xe)|0)+Math.imul(T,ue)|0))<<13)|0;n=((b=b+Math.imul(T,xe)|0)+(d>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Pe=(n+(f=Math.imul(j,ue))|0)+((8191&(d=(d=Math.imul(j,xe))+Math.imul(N,ue)|0))<<13)|0;return n=((b=Math.imul(N,xe))+(d>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r[0]=pe,r[1]=ge,r[2]=me,r[3]=ye,r[4]=_e,r[5]=ve,r[6]=we,r[7]=Me,r[8]=Ae,r[9]=Le,r[10]=Ie,r[11]=ke,r[12]=Ee,r[13]=Se,r[14]=Ce,r[15]=Be,r[16]=Fe,r[17]=Oe,r[18]=Pe,0!==n&&(r[19]=n,c.length++),c};function x(e,a,c){return(new p).mulp(e,a,c)}function p(e,a){this.x=e,this.y=a}Math.imul||(u=h),b.prototype.mulTo=function(e,a){var c,f=this.length+e.length;return c=10===this.length&&10===e.length?u(this,e,a):f<63?h(this,e,a):f<1024?function(e,a,c){c.negative=a.negative^e.negative,c.length=e.length+a.length;for(var f=0,d=0,b=0;b>>26)|0)>>>26,t&=67108863}c.words[b]=i,f=t,t=d}return 0!==f?c.words[b]=f:c.length--,c.strip()}(this,e,a):x(this,e,a),c},p.prototype.makeRBT=function(e){for(var a=new Array(e),c=b.prototype._countBits(e)-1,f=0;f>=1;return f},p.prototype.permute=function(e,a,c,f,d,b){for(var t=0;t>>=1)d++;return 1<>>=13,c[2*t+1]=8191&b,b>>>=13;for(t=2*a;t>=26,a+=d/67108864|0,a+=b>>>26,this.words[c]=67108863&b}return 0!==a&&(this.words[c]=a,this.length++),this},b.prototype.muln=function(e){return this.clone().imuln(e)},b.prototype.sqr=function(){return this.mul(this)},b.prototype.isqr=function(){return this.imul(this.clone())},b.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),c=0;c>>d}return a}(e);if(0===a.length)return new b(1);for(var c=this,f=0;f=0);var a,c=e%26,d=(e-c)/26,b=67108863>>>26-c<<26-c;if(0!==c){var t=0;for(a=0;a>>26-c}t&&(this.words[a]=t,this.length++)}if(0!==d){for(a=this.length-1;a>=0;a--)this.words[a+d]=this.words[a];for(a=0;a=0),d=a?(a-a%26)/26:0;var b=e%26,t=Math.min((e-b)/26,this.length),i=67108863^67108863>>>b<t)for(this.length-=t,n=0;n=0&&(0!==o||n>=d);n--){var s=0|this.words[n];this.words[n]=o<<26-b|s>>>b,o=s&i}return r&&0!==o&&(r.words[r.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},b.prototype.ishrn=function(e,a,c){return f(0===this.negative),this.iushrn(e,a,c)},b.prototype.shln=function(e){return this.clone().ishln(e)},b.prototype.ushln=function(e){return this.clone().iushln(e)},b.prototype.shrn=function(e){return this.clone().ishrn(e)},b.prototype.ushrn=function(e){return this.clone().iushrn(e)},b.prototype.testn=function(e){f("number"==typeof e&&e>=0);var a=e%26,c=(e-a)/26,d=1<=0);var a=e%26,c=(e-a)/26;if(f(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)return this;if(0!==a&&c++,this.length=Math.min(c,this.length),0!==a){var d=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},b.prototype.isubn=function(e){if(f("number"==typeof e),f(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(r/67108864|0),this.words[d+c]=67108863&b}for(;d>26,this.words[d+c]=67108863&b;if(0===i)return this.strip();for(f(-1===i),i=0,d=0;d>26,this.words[d]=67108863&b;return this.negative=1,this.strip()},b.prototype._wordDiv=function(e,a){var c=(this.length,e.length),f=this.clone(),d=e,t=0|d.words[d.length-1];0!=(c=26-this._countBits(t))&&(d=d.ushln(c),f.iushln(c),t=0|d.words[d.length-1]);var i,r=f.length-d.length;if("mod"!==a){(i=new b(null)).length=r+1,i.words=new Array(i.length);for(var n=0;n=0;s--){var l=67108864*(0|f.words[d.length+s])+(0|f.words[d.length+s-1]);for(l=Math.min(l/t|0,67108863),f._ishlnsubmul(d,l,s);0!==f.negative;)l--,f.negative=0,f._ishlnsubmul(d,1,s),f.isZero()||(f.negative^=1);i&&(i.words[s]=l)}return i&&i.strip(),f.strip(),"div"!==a&&0!==c&&f.iushrn(c),{div:i||null,mod:f}},b.prototype.divmod=function(e,a,c){return f(!e.isZero()),this.isZero()?{div:new b(0),mod:new b(0)}:0!==this.negative&&0===e.negative?(i=this.neg().divmod(e,a),"mod"!==a&&(d=i.div.neg()),"div"!==a&&(t=i.mod.neg(),c&&0!==t.negative&&t.iadd(e)),{div:d,mod:t}):0===this.negative&&0!==e.negative?(i=this.divmod(e.neg(),a),"mod"!==a&&(d=i.div.neg()),{div:d,mod:i.mod}):this.negative&e.negative?(i=this.neg().divmod(e.neg(),a),"div"!==a&&(t=i.mod.neg(),c&&0!==t.negative&&t.isub(e)),{div:i.div,mod:t}):e.length>this.length||this.cmp(e)<0?{div:new b(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new b(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new b(this.modn(e.words[0]))}:this._wordDiv(e,a);var d,t,i},b.prototype.div=function(e){return this.divmod(e,"div",!1).div},b.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},b.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},b.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var c=0!==a.div.negative?a.mod.isub(e):a.mod,f=e.ushrn(1),d=e.andln(1),b=c.cmp(f);return b<0||1===d&&0===b?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},b.prototype.modn=function(e){f(e<=67108863);for(var a=(1<<26)%e,c=0,d=this.length-1;d>=0;d--)c=(a*c+(0|this.words[d]))%e;return c},b.prototype.idivn=function(e){f(e<=67108863);for(var a=0,c=this.length-1;c>=0;c--){var d=(0|this.words[c])+67108864*a;this.words[c]=d/e|0,a=d%e}return this.strip()},b.prototype.divn=function(e){return this.clone().idivn(e)},b.prototype.egcd=function(e){f(0===e.negative),f(!e.isZero());var a=this,c=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var d=new b(1),t=new b(0),i=new b(0),r=new b(1),n=0;a.isEven()&&c.isEven();)a.iushrn(1),c.iushrn(1),++n;for(var o=c.clone(),s=a.clone();!a.isZero();){for(var l=0,h=1;!(a.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(d.isOdd()||t.isOdd())&&(d.iadd(o),t.isub(s)),d.iushrn(1),t.iushrn(1);for(var u=0,x=1;!(c.words[0]&x)&&u<26;++u,x<<=1);if(u>0)for(c.iushrn(u);u-- >0;)(i.isOdd()||r.isOdd())&&(i.iadd(o),r.isub(s)),i.iushrn(1),r.iushrn(1);a.cmp(c)>=0?(a.isub(c),d.isub(i),t.isub(r)):(c.isub(a),i.isub(d),r.isub(t))}return{a:i,b:r,gcd:c.iushln(n)}},b.prototype._invmp=function(e){f(0===e.negative),f(!e.isZero());var a=this,c=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var d,t=new b(1),i=new b(0),r=c.clone();a.cmpn(1)>0&&c.cmpn(1)>0;){for(var n=0,o=1;!(a.words[0]&o)&&n<26;++n,o<<=1);if(n>0)for(a.iushrn(n);n-- >0;)t.isOdd()&&t.iadd(r),t.iushrn(1);for(var s=0,l=1;!(c.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(c.iushrn(s);s-- >0;)i.isOdd()&&i.iadd(r),i.iushrn(1);a.cmp(c)>=0?(a.isub(c),t.isub(i)):(c.isub(a),i.isub(t))}return(d=0===a.cmpn(1)?t:i).cmpn(0)<0&&d.iadd(e),d},b.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),c=e.clone();a.negative=0,c.negative=0;for(var f=0;a.isEven()&&c.isEven();f++)a.iushrn(1),c.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=a.cmp(c);if(d<0){var b=a;a=c,c=b}else if(0===d||0===c.cmpn(1))break;a.isub(c)}return c.iushln(f)},b.prototype.invm=function(e){return this.egcd(e).a.umod(e)},b.prototype.isEven=function(){return!(1&this.words[0])},b.prototype.isOdd=function(){return!(1&~this.words[0])},b.prototype.andln=function(e){return this.words[0]&e},b.prototype.bincn=function(e){f("number"==typeof e);var a=e%26,c=(e-a)/26,d=1<>>26,i&=67108863,this.words[t]=i}return 0!==b&&(this.words[t]=b,this.length++),this},b.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},b.prototype.cmpn=function(e){var a,c=e<0;if(0!==this.negative&&!c)return-1;if(0===this.negative&&c)return 1;if(this.strip(),this.length>1)a=1;else{c&&(e=-e),f(e<=67108863,"Number is too big");var d=0|this.words[0];a=d===e?0:de.length)return 1;if(this.length=0;c--){var f=0|this.words[c],d=0|e.words[c];if(f!==d){fd&&(a=1);break}}return a},b.prototype.gtn=function(e){return 1===this.cmpn(e)},b.prototype.gt=function(e){return 1===this.cmp(e)},b.prototype.gten=function(e){return this.cmpn(e)>=0},b.prototype.gte=function(e){return this.cmp(e)>=0},b.prototype.ltn=function(e){return-1===this.cmpn(e)},b.prototype.lt=function(e){return-1===this.cmp(e)},b.prototype.lten=function(e){return this.cmpn(e)<=0},b.prototype.lte=function(e){return this.cmp(e)<=0},b.prototype.eqn=function(e){return 0===this.cmpn(e)},b.prototype.eq=function(e){return 0===this.cmp(e)},b.red=function(e){return new M(e)},b.prototype.toRed=function(e){return f(!this.red,"Already a number in reduction context"),f(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},b.prototype.fromRed=function(){return f(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},b.prototype._forceRed=function(e){return this.red=e,this},b.prototype.forceRed=function(e){return f(!this.red,"Already a number in reduction context"),this._forceRed(e)},b.prototype.redAdd=function(e){return f(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},b.prototype.redIAdd=function(e){return f(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},b.prototype.redSub=function(e){return f(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},b.prototype.redISub=function(e){return f(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},b.prototype.redShl=function(e){return f(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},b.prototype.redMul=function(e){return f(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},b.prototype.redIMul=function(e){return f(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},b.prototype.redSqr=function(){return f(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},b.prototype.redISqr=function(){return f(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},b.prototype.redSqrt=function(){return f(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},b.prototype.redInvm=function(){return f(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},b.prototype.redNeg=function(){return f(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},b.prototype.redPow=function(e){return f(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function m(e,a){this.name=e,this.p=new b(a,16),this.n=this.p.bitLength(),this.k=new b(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var a=b._prime(e);this.m=a.p,this.prime=a}else f(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new b(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)}m.prototype._tmp=function(){var e=new b(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var a,c=e;do{this.split(c,this.tmp),a=(c=(c=this.imulK(c)).iadd(this.tmp)).bitLength()}while(a>this.n);var f=a0?c.isub(this.p):void 0!==c.strip?c.strip():c._strip(),c},m.prototype.split=function(e,a){e.iushrn(this.n,0,a)},m.prototype.imulK=function(e){return e.imul(this.k)},d(y,m),y.prototype.split=function(e,a){for(var c=4194303,f=Math.min(e.length,9),d=0;d>>22,b=t}b>>>=22,e.words[d-10]=b,0===b&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,c=0;c>>=26,e.words[c]=d,a=f}return 0!==a&&(e.words[e.length++]=a),e},b._prime=function(e){if(g[e])return g[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new _;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return g[e]=a,a},M.prototype._verify1=function(e){f(0===e.negative,"red works only with positives"),f(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,a){f(!(e.negative|a.negative),"red works only with positives"),f(e.red&&e.red===a.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,a){this._verify2(e,a);var c=e.add(a);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},M.prototype.iadd=function(e,a){this._verify2(e,a);var c=e.iadd(a);return c.cmp(this.m)>=0&&c.isub(this.m),c},M.prototype.sub=function(e,a){this._verify2(e,a);var c=e.sub(a);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},M.prototype.isub=function(e,a){this._verify2(e,a);var c=e.isub(a);return c.cmpn(0)<0&&c.iadd(this.m),c},M.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},M.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},M.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(f(a%2==1),3===a){var c=this.m.add(new b(1)).iushrn(2);return this.pow(e,c)}for(var d=this.m.subn(1),t=0;!d.isZero()&&0===d.andln(1);)t++,d.iushrn(1);f(!d.isZero());var i=new b(1).toRed(this),r=i.redNeg(),n=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new b(2*o*o).toRed(this);0!==this.pow(o,n).cmp(r);)o.redIAdd(r);for(var s=this.pow(o,d),l=this.pow(e,d.addn(1).iushrn(1)),h=this.pow(e,d),u=t;0!==h.cmp(i);){for(var x=h,p=0;0!==x.cmp(i);p++)x=x.redSqr();f(p=0;f--){for(var n=a.words[f],o=r-1;o>=0;o--){var s=n>>o&1;d!==c[0]&&(d=this.sqr(d)),0!==s||0!==t?(t<<=1,t|=s,(4==++i||0===f&&0===o)&&(d=this.mul(d,c[t]),i=0,t=0)):i=0}r=26}return d},M.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},M.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},b.mont=function(e){return new A(e)},d(A,M),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},A.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var c=e.imul(a),f=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(f).iushrn(this.shift),b=d;return d.cmp(this.m)>=0?b=d.isub(this.m):d.cmpn(0)<0&&(b=d.iadd(this.m)),b._forceRed(this)},A.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new b(0)._forceRed(this);var c=e.mul(a),f=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(f).iushrn(this.shift),t=d;return d.cmp(this.m)>=0?t=d.isub(this.m):d.cmpn(0)<0&&(t=d.iadd(this.m)),t._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=c.nmd(e),this)},7108:(e,a,c)=>{"use strict";var f=c(6698),d=c(8276),b=c(6011),t=c(2802),i=c(6168);function r(e){i.call(this,"digest"),this._hash=e}f(r,i),r.prototype._update=function(e){this._hash.update(e)},r.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new d:"rmd160"===e||"ripemd160"===e?new b:new r(t(e))}},320:(e,a,c)=>{var f=c(8276);e.exports=function(e){return(new f).update(e).digest()}},3507:(e,a,c)=>{"use strict";var f=c(6698),d=c(1800),b=c(6168),t=c(2861).Buffer,i=c(320),r=c(6011),n=c(2802),o=t.alloc(128);function s(e,a){b.call(this,"digest"),"string"==typeof a&&(a=t.from(a));var c="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=a,a.length>c?a=("rmd160"===e?new r:n(e)).update(a).digest():a.length{"use strict";var f=c(6698),d=c(2861).Buffer,b=c(6168),t=d.alloc(128),i=64;function r(e,a){b.call(this,"digest"),"string"==typeof a&&(a=d.from(a)),this._alg=e,this._key=a,a.length>i?a=e(a):a.length{"use strict";c(3209),c(7108),c(3507);var f=c(5715),d=Object.keys(f),b=(["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(d),c(8396));b.pbkdf2,b.pbkdf2Sync;var t=c(125);t.Cipher,t.createCipher,t.Cipheriv,t.createCipheriv,t.Decipher,t.createDecipher,t.Decipheriv,t.createDecipheriv,t.getCiphers,t.listCiphers;var i=c(5380);i.DiffieHellmanGroup,i.createDiffieHellmanGroup,i.getDiffieHellman,i.createDiffieHellman,i.DiffieHellman;var r=c(20);r.createSign,r.Sign,r.createVerify,r.Verify,c(1324);var n=c(7168);n.publicEncrypt,n.privateEncrypt,n.publicDecrypt,n.privateDecrypt;var o=c(6983);o.randomFill,o.randomFillSync},41:(e,a,c)=>{"use strict";var f=c(655),d=c(8068),b=c(9675),t=c(5795);e.exports=function(e,a,c){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new b("`obj` must be an object or a function`");if("string"!=typeof a&&"symbol"!=typeof a)throw new b("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new b("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new b("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new b("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new b("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,r=arguments.length>4?arguments[4]:null,n=arguments.length>5?arguments[5]:null,o=arguments.length>6&&arguments[6],s=!!t&&t(e,a);if(f)f(e,a,{configurable:null===n&&s?s.configurable:!n,enumerable:null===i&&s?s.enumerable:!i,value:c,writable:null===r&&s?s.writable:!r});else{if(!o&&(i||r||n))throw new d("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[a]=c}}},8452:(e,a,c)=>{"use strict";var f=c(1189),d="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),b=Object.prototype.toString,t=Array.prototype.concat,i=c(41),r=c(592)(),n=function(e,a,c,f){if(a in e)if(!0===f){if(e[a]===c)return}else if("function"!=typeof(d=f)||"[object Function]"!==b.call(d)||!f())return;var d;r?i(e,a,c,!0):i(e,a,c)},o=function(e,a){var c=arguments.length>2?arguments[2]:{},b=f(a);d&&(b=t.call(b,Object.getOwnPropertySymbols(a)));for(var i=0;i{"use strict";a.utils=c(7626),a.Cipher=c(2808),a.DES=c(2211),a.CBC=c(3389),a.EDE=c(5279)},3389:(e,a,c)=>{"use strict";var f=c(3349),d=c(6698),b={};function t(e){f.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var a=0;a{"use strict";var f=c(3349);function d(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=!1!==e.padding}e.exports=d,d.prototype._init=function(){},d.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},d.prototype._buffer=function(e,a){for(var c=Math.min(this.buffer.length-this.bufferOff,e.length-a),f=0;f0;f--)a+=this._buffer(e,a),c+=this._flushBuffer(d,c);return a+=this._buffer(e,a),d},d.prototype.final=function(e){var a,c;return e&&(a=this.update(e)),c="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),a?a.concat(c):c},d.prototype._pad=function(e,a){if(0===a)return!1;for(;a{"use strict";var f=c(3349),d=c(6698),b=c(7626),t=c(2808);function i(){this.tmp=new Array(2),this.keys=null}function r(e){t.call(this,e);var a=new i;this._desState=a,this.deriveKeys(a,e.key)}d(r,t),e.exports=r,r.create=function(e){return new r(e)};var n=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];r.prototype.deriveKeys=function(e,a){e.keys=new Array(32),f.equal(a.length,this.blockSize,"Invalid key length");var c=b.readUInt32BE(a,0),d=b.readUInt32BE(a,4);b.pc1(c,d,e.tmp,0),c=e.tmp[0],d=e.tmp[1];for(var t=0;t>>1];c=b.r28shl(c,i),d=b.r28shl(d,i),b.pc2(c,d,e.keys,t)}},r.prototype._update=function(e,a,c,f){var d=this._desState,t=b.readUInt32BE(e,a),i=b.readUInt32BE(e,a+4);b.ip(t,i,d.tmp,0),t=d.tmp[0],i=d.tmp[1],"encrypt"===this.type?this._encrypt(d,t,i,d.tmp,0):this._decrypt(d,t,i,d.tmp,0),t=d.tmp[0],i=d.tmp[1],b.writeUInt32BE(c,t,f),b.writeUInt32BE(c,i,f+4)},r.prototype._pad=function(e,a){if(!1===this.padding)return!1;for(var c=e.length-a,f=a;f>>0,t=l}b.rip(i,t,f,d)},r.prototype._decrypt=function(e,a,c,f,d){for(var t=c,i=a,r=e.keys.length-2;r>=0;r-=2){var n=e.keys[r],o=e.keys[r+1];b.expand(t,e.tmp,0),n^=e.tmp[0],o^=e.tmp[1];var s=b.substitute(n,o),l=t;t=(i^b.permute(s))>>>0,i=l}b.rip(t,i,f,d)}},5279:(e,a,c)=>{"use strict";var f=c(3349),d=c(6698),b=c(2808),t=c(2211);function i(e,a){f.equal(a.length,24,"Invalid key length");var c=a.slice(0,8),d=a.slice(8,16),b=a.slice(16,24);this.ciphers="encrypt"===e?[t.create({type:"encrypt",key:c}),t.create({type:"decrypt",key:d}),t.create({type:"encrypt",key:b})]:[t.create({type:"decrypt",key:b}),t.create({type:"encrypt",key:d}),t.create({type:"decrypt",key:c})]}function r(e){b.call(this,e);var a=new i(this.type,this.options.key);this._edeState=a}d(r,b),e.exports=r,r.create=function(e){return new r(e)},r.prototype._update=function(e,a,c,f){var d=this._edeState;d.ciphers[0]._update(e,a,c,f),d.ciphers[1]._update(c,f,c,f),d.ciphers[2]._update(c,f,c,f)},r.prototype._pad=t.prototype._pad,r.prototype._unpad=t.prototype._unpad},7626:(e,a)=>{"use strict";a.readUInt32BE=function(e,a){return(e[0+a]<<24|e[1+a]<<16|e[2+a]<<8|e[3+a])>>>0},a.writeUInt32BE=function(e,a,c){e[0+c]=a>>>24,e[1+c]=a>>>16&255,e[2+c]=a>>>8&255,e[3+c]=255&a},a.ip=function(e,a,c,f){for(var d=0,b=0,t=6;t>=0;t-=2){for(var i=0;i<=24;i+=8)d<<=1,d|=a>>>i+t&1;for(i=0;i<=24;i+=8)d<<=1,d|=e>>>i+t&1}for(t=6;t>=0;t-=2){for(i=1;i<=25;i+=8)b<<=1,b|=a>>>i+t&1;for(i=1;i<=25;i+=8)b<<=1,b|=e>>>i+t&1}c[f+0]=d>>>0,c[f+1]=b>>>0},a.rip=function(e,a,c,f){for(var d=0,b=0,t=0;t<4;t++)for(var i=24;i>=0;i-=8)d<<=1,d|=a>>>i+t&1,d<<=1,d|=e>>>i+t&1;for(t=4;t<8;t++)for(i=24;i>=0;i-=8)b<<=1,b|=a>>>i+t&1,b<<=1,b|=e>>>i+t&1;c[f+0]=d>>>0,c[f+1]=b>>>0},a.pc1=function(e,a,c,f){for(var d=0,b=0,t=7;t>=5;t--){for(var i=0;i<=24;i+=8)d<<=1,d|=a>>i+t&1;for(i=0;i<=24;i+=8)d<<=1,d|=e>>i+t&1}for(i=0;i<=24;i+=8)d<<=1,d|=a>>i+t&1;for(t=1;t<=3;t++){for(i=0;i<=24;i+=8)b<<=1,b|=a>>i+t&1;for(i=0;i<=24;i+=8)b<<=1,b|=e>>i+t&1}for(i=0;i<=24;i+=8)b<<=1,b|=e>>i+t&1;c[f+0]=d>>>0,c[f+1]=b>>>0},a.r28shl=function(e,a){return e<>>28-a};var c=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];a.pc2=function(e,a,f,d){for(var b=0,t=0,i=c.length>>>1,r=0;r>>c[r]&1;for(r=i;r>>c[r]&1;f[d+0]=b>>>0,f[d+1]=t>>>0},a.expand=function(e,a,c){var f=0,d=0;f=(1&e)<<5|e>>>27;for(var b=23;b>=15;b-=4)f<<=6,f|=e>>>b&63;for(b=11;b>=3;b-=4)d|=e>>>b&63,d<<=6;d|=(31&e)<<1|e>>>31,a[c+0]=f>>>0,a[c+1]=d>>>0};var f=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];a.substitute=function(e,a){for(var c=0,d=0;d<4;d++)c<<=4,c|=f[64*d+(e>>>18-6*d&63)];for(d=0;d<4;d++)c<<=4,c|=f[256+64*d+(a>>>18-6*d&63)];return c>>>0};var d=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];a.permute=function(e){for(var a=0,c=0;c>>d[c]&1;return a>>>0},a.padSplit=function(e,a,c){for(var f=e.toString(2);f.length{var f=c(2045).hp,d=c(4934),b=c(3241),t=c(4910),i={binary:!0,hex:!0,base64:!0};a.DiffieHellmanGroup=a.createDiffieHellmanGroup=a.getDiffieHellman=function(e){var a=new f(b[e].prime,"hex"),c=new f(b[e].gen,"hex");return new t(a,c)},a.createDiffieHellman=a.DiffieHellman=function e(a,c,b,r){return f.isBuffer(c)||void 0===i[c]?e(a,"binary",c,b):(c=c||"binary",r=r||"binary",b=b||new f([2]),f.isBuffer(b)||(b=new f(b,r)),"number"==typeof a?new t(d(a,b),b,!0):(f.isBuffer(a)||(a=new f(a,c)),new t(a,b,!0)))}},4910:(e,a,c)=>{var f=c(2045).hp,d=c(6473),b=new(c(2244)),t=new d(24),i=new d(11),r=new d(10),n=new d(3),o=new d(7),s=c(4934),l=c(3209);function h(e,a){return a=a||"utf8",f.isBuffer(e)||(e=new f(e,a)),this._pub=new d(e),this}function u(e,a){return a=a||"utf8",f.isBuffer(e)||(e=new f(e,a)),this._priv=new d(e),this}e.exports=p;var x={};function p(e,a,c){this.setGenerator(a),this.__prime=new d(e),this._prime=d.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,c?(this.setPublicKey=h,this.setPrivateKey=u):this._primeCode=8}function g(e,a){var c=new f(e.toArray());return a?c.toString(a):c}Object.defineProperty(p.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,a){var c=a.toString("hex"),f=[c,e.toString(16)].join("_");if(f in x)return x[f];var d,l=0;if(e.isEven()||!s.simpleSieve||!s.fermatTest(e)||!b.test(e))return l+=1,l+="02"===c||"05"===c?8:4,x[f]=l,l;switch(b.test(e.shrn(1))||(l+=2),c){case"02":e.mod(t).cmp(i)&&(l+=8);break;case"05":(d=e.mod(r)).cmp(n)&&d.cmp(o)&&(l+=8);break;default:l+=4}return x[f]=l,l}(this.__prime,this.__gen)),this._primeCode}}),p.prototype.generateKeys=function(){return this._priv||(this._priv=new d(l(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},p.prototype.computeSecret=function(e){var a=(e=(e=new d(e)).toRed(this._prime)).redPow(this._priv).fromRed(),c=new f(a.toArray()),b=this.getPrime();if(c.length{var f=c(3209);e.exports=m,m.simpleSieve=p,m.fermatTest=g;var d=c(6473),b=new d(24),t=new(c(2244)),i=new d(1),r=new d(2),n=new d(5),o=(new d(16),new d(8),new d(10)),s=new d(3),l=(new d(7),new d(11)),h=new d(4),u=(new d(12),null);function x(){if(null!==u)return u;var e=[];e[0]=2;for(var a=1,c=3;c<1048576;c+=2){for(var f=Math.ceil(Math.sqrt(c)),d=0;de;)c.ishrn(1);if(c.isEven()&&c.iadd(i),c.testn(1)||c.iadd(r),a.cmp(r)){if(!a.cmp(n))for(;c.mod(o).cmp(s);)c.iadd(h)}else for(;c.mod(b).cmp(l);)c.iadd(h);if(p(u=c.shrn(1))&&p(c)&&g(u)&&g(c)&&t.test(u)&&t.test(c))return c}}},6473:function(e,a,c){!function(e,a){"use strict";function f(e,a){if(!e)throw new Error(a||"Assertion failed")}function d(e,a){e.super_=a;var c=function(){};c.prototype=a.prototype,e.prototype=new c,e.prototype.constructor=e}function b(e,a,c){if(b.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==a&&"be"!==a||(c=a,a=10),this._init(e||0,a||10,c||"be"))}var t;"object"==typeof e?e.exports=b:a.BN=b,b.BN=b,b.wordSize=26;try{t="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:c(6089).Buffer}catch(e){}function i(e,a){var c=e.charCodeAt(a);return c>=65&&c<=70?c-55:c>=97&&c<=102?c-87:c-48&15}function r(e,a,c){var f=i(e,c);return c-1>=a&&(f|=i(e,c-1)<<4),f}function n(e,a,c,f){for(var d=0,b=Math.min(e.length,c),t=a;t=49?i-49+10:i>=17?i-17+10:i}return d}b.isBN=function(e){return e instanceof b||null!==e&&"object"==typeof e&&e.constructor.wordSize===b.wordSize&&Array.isArray(e.words)},b.max=function(e,a){return e.cmp(a)>0?e:a},b.min=function(e,a){return e.cmp(a)<0?e:a},b.prototype._init=function(e,a,c){if("number"==typeof e)return this._initNumber(e,a,c);if("object"==typeof e)return this._initArray(e,a,c);"hex"===a&&(a=16),f(a===(0|a)&&a>=2&&a<=36);var d=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(d++,this.negative=1),d=0;d-=3)t=e[d]|e[d-1]<<8|e[d-2]<<16,this.words[b]|=t<>>26-i&67108863,(i+=24)>=26&&(i-=26,b++);else if("le"===c)for(d=0,b=0;d>>26-i&67108863,(i+=24)>=26&&(i-=26,b++);return this.strip()},b.prototype._parseHex=function(e,a,c){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var f=0;f=a;f-=2)d=r(e,a,f)<=18?(b-=18,t+=1,this.words[t]|=d>>>26):b+=8;else for(f=(e.length-a)%2==0?a+1:a;f=18?(b-=18,t+=1,this.words[t]|=d>>>26):b+=8;this.strip()},b.prototype._parseBase=function(e,a,c){this.words=[0],this.length=1;for(var f=0,d=1;d<=67108863;d*=a)f++;f--,d=d/a|0;for(var b=e.length-c,t=b%f,i=Math.min(b,b-t)+c,r=0,o=c;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},b.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},b.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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 h(e,a,c){c.negative=a.negative^e.negative;var f=e.length+a.length|0;c.length=f,f=f-1|0;var d=0|e.words[0],b=0|a.words[0],t=d*b,i=67108863&t,r=t/67108864|0;c.words[0]=i;for(var n=1;n>>26,s=67108863&r,l=Math.min(n,a.length-1),h=Math.max(0,n-e.length+1);h<=l;h++){var u=n-h|0;o+=(t=(d=0|e.words[u])*(b=0|a.words[h])+s)/67108864|0,s=67108863&t}c.words[n]=0|s,r=0|o}return 0!==r?c.words[n]=0|r:c.length--,c.strip()}b.prototype.toString=function(e,a){var c;if(a=0|a||1,16===(e=e||10)||"hex"===e){c="";for(var d=0,b=0,t=0;t>>24-d&16777215)||t!==this.length-1?o[6-r.length]+r+c:r+c,(d+=2)>=26&&(d-=26,t--)}for(0!==b&&(c=b.toString(16)+c);c.length%a!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(e===(0|e)&&e>=2&&e<=36){var n=s[e],h=l[e];c="";var u=this.clone();for(u.negative=0;!u.isZero();){var x=u.modn(h).toString(e);c=(u=u.idivn(h)).isZero()?x+c:o[n-x.length]+x+c}for(this.isZero()&&(c="0"+c);c.length%a!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}f(!1,"Base should be between 2 and 36")},b.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&f(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},b.prototype.toJSON=function(){return this.toString(16)},b.prototype.toBuffer=function(e,a){return f(void 0!==t),this.toArrayLike(t,e,a)},b.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},b.prototype.toArrayLike=function(e,a,c){var d=this.byteLength(),b=c||Math.max(1,d);f(d<=b,"byte array longer than desired length"),f(b>0,"Requested array length <= 0"),this.strip();var t,i,r="le"===a,n=new e(b),o=this.clone();if(r){for(i=0;!o.isZero();i++)t=o.andln(255),o.iushrn(8),n[i]=t;for(;i=4096&&(c+=13,a>>>=13),a>=64&&(c+=7,a>>>=7),a>=8&&(c+=4,a>>>=4),a>=2&&(c+=2,a>>>=2),c+a},b.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,c=0;return 8191&a||(c+=13,a>>>=13),127&a||(c+=7,a>>>=7),15&a||(c+=4,a>>>=4),3&a||(c+=2,a>>>=2),1&a||c++,c},b.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},b.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},b.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},b.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var c=0;ce.length?this.clone().iand(e):e.clone().iand(this)},b.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},b.prototype.iuxor=function(e){var a,c;this.length>e.length?(a=this,c=e):(a=e,c=this);for(var f=0;fe.length?this.clone().ixor(e):e.clone().ixor(this)},b.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},b.prototype.inotn=function(e){f("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),c=e%26;this._expand(a),c>0&&a--;for(var d=0;d0&&(this.words[d]=~this.words[d]&67108863>>26-c),this.strip()},b.prototype.notn=function(e){return this.clone().inotn(e)},b.prototype.setn=function(e,a){f("number"==typeof e&&e>=0);var c=e/26|0,d=e%26;return this._expand(c+1),this.words[c]=a?this.words[c]|1<e.length?(c=this,f=e):(c=e,f=this);for(var d=0,b=0;b>>26;for(;0!==d&&b>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;be.length?this.clone().iadd(e):e.clone().iadd(this)},b.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var c,f,d=this.cmp(e);if(0===d)return this.negative=0,this.length=1,this.words[0]=0,this;d>0?(c=this,f=e):(c=e,f=this);for(var b=0,t=0;t>26,this.words[t]=67108863&a;for(;0!==b&&t>26,this.words[t]=67108863&a;if(0===b&&t>>13,h=0|t[1],u=8191&h,x=h>>>13,p=0|t[2],g=8191&p,m=p>>>13,y=0|t[3],_=8191&y,v=y>>>13,w=0|t[4],M=8191&w,A=w>>>13,L=0|t[5],I=8191&L,k=L>>>13,E=0|t[6],S=8191&E,C=E>>>13,B=0|t[7],F=8191&B,O=B>>>13,P=0|t[8],R=8191&P,T=P>>>13,U=0|t[9],j=8191&U,N=U>>>13,q=0|i[0],D=8191&q,z=q>>>13,Q=0|i[1],G=8191&Q,K=Q>>>13,H=0|i[2],V=8191&H,Z=H>>>13,W=0|i[3],Y=8191&W,J=W>>>13,$=0|i[4],X=8191&$,ee=$>>>13,ae=0|i[5],ce=8191&ae,fe=ae>>>13,de=0|i[6],be=8191&de,te=de>>>13,ie=0|i[7],re=8191&ie,ne=ie>>>13,oe=0|i[8],se=8191&oe,le=oe>>>13,he=0|i[9],ue=8191&he,xe=he>>>13;c.negative=e.negative^a.negative,c.length=19;var pe=(n+(f=Math.imul(s,D))|0)+((8191&(d=(d=Math.imul(s,z))+Math.imul(l,D)|0))<<13)|0;n=((b=Math.imul(l,z))+(d>>>13)|0)+(pe>>>26)|0,pe&=67108863,f=Math.imul(u,D),d=(d=Math.imul(u,z))+Math.imul(x,D)|0,b=Math.imul(x,z);var ge=(n+(f=f+Math.imul(s,G)|0)|0)+((8191&(d=(d=d+Math.imul(s,K)|0)+Math.imul(l,G)|0))<<13)|0;n=((b=b+Math.imul(l,K)|0)+(d>>>13)|0)+(ge>>>26)|0,ge&=67108863,f=Math.imul(g,D),d=(d=Math.imul(g,z))+Math.imul(m,D)|0,b=Math.imul(m,z),f=f+Math.imul(u,G)|0,d=(d=d+Math.imul(u,K)|0)+Math.imul(x,G)|0,b=b+Math.imul(x,K)|0;var me=(n+(f=f+Math.imul(s,V)|0)|0)+((8191&(d=(d=d+Math.imul(s,Z)|0)+Math.imul(l,V)|0))<<13)|0;n=((b=b+Math.imul(l,Z)|0)+(d>>>13)|0)+(me>>>26)|0,me&=67108863,f=Math.imul(_,D),d=(d=Math.imul(_,z))+Math.imul(v,D)|0,b=Math.imul(v,z),f=f+Math.imul(g,G)|0,d=(d=d+Math.imul(g,K)|0)+Math.imul(m,G)|0,b=b+Math.imul(m,K)|0,f=f+Math.imul(u,V)|0,d=(d=d+Math.imul(u,Z)|0)+Math.imul(x,V)|0,b=b+Math.imul(x,Z)|0;var ye=(n+(f=f+Math.imul(s,Y)|0)|0)+((8191&(d=(d=d+Math.imul(s,J)|0)+Math.imul(l,Y)|0))<<13)|0;n=((b=b+Math.imul(l,J)|0)+(d>>>13)|0)+(ye>>>26)|0,ye&=67108863,f=Math.imul(M,D),d=(d=Math.imul(M,z))+Math.imul(A,D)|0,b=Math.imul(A,z),f=f+Math.imul(_,G)|0,d=(d=d+Math.imul(_,K)|0)+Math.imul(v,G)|0,b=b+Math.imul(v,K)|0,f=f+Math.imul(g,V)|0,d=(d=d+Math.imul(g,Z)|0)+Math.imul(m,V)|0,b=b+Math.imul(m,Z)|0,f=f+Math.imul(u,Y)|0,d=(d=d+Math.imul(u,J)|0)+Math.imul(x,Y)|0,b=b+Math.imul(x,J)|0;var _e=(n+(f=f+Math.imul(s,X)|0)|0)+((8191&(d=(d=d+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;n=((b=b+Math.imul(l,ee)|0)+(d>>>13)|0)+(_e>>>26)|0,_e&=67108863,f=Math.imul(I,D),d=(d=Math.imul(I,z))+Math.imul(k,D)|0,b=Math.imul(k,z),f=f+Math.imul(M,G)|0,d=(d=d+Math.imul(M,K)|0)+Math.imul(A,G)|0,b=b+Math.imul(A,K)|0,f=f+Math.imul(_,V)|0,d=(d=d+Math.imul(_,Z)|0)+Math.imul(v,V)|0,b=b+Math.imul(v,Z)|0,f=f+Math.imul(g,Y)|0,d=(d=d+Math.imul(g,J)|0)+Math.imul(m,Y)|0,b=b+Math.imul(m,J)|0,f=f+Math.imul(u,X)|0,d=(d=d+Math.imul(u,ee)|0)+Math.imul(x,X)|0,b=b+Math.imul(x,ee)|0;var ve=(n+(f=f+Math.imul(s,ce)|0)|0)+((8191&(d=(d=d+Math.imul(s,fe)|0)+Math.imul(l,ce)|0))<<13)|0;n=((b=b+Math.imul(l,fe)|0)+(d>>>13)|0)+(ve>>>26)|0,ve&=67108863,f=Math.imul(S,D),d=(d=Math.imul(S,z))+Math.imul(C,D)|0,b=Math.imul(C,z),f=f+Math.imul(I,G)|0,d=(d=d+Math.imul(I,K)|0)+Math.imul(k,G)|0,b=b+Math.imul(k,K)|0,f=f+Math.imul(M,V)|0,d=(d=d+Math.imul(M,Z)|0)+Math.imul(A,V)|0,b=b+Math.imul(A,Z)|0,f=f+Math.imul(_,Y)|0,d=(d=d+Math.imul(_,J)|0)+Math.imul(v,Y)|0,b=b+Math.imul(v,J)|0,f=f+Math.imul(g,X)|0,d=(d=d+Math.imul(g,ee)|0)+Math.imul(m,X)|0,b=b+Math.imul(m,ee)|0,f=f+Math.imul(u,ce)|0,d=(d=d+Math.imul(u,fe)|0)+Math.imul(x,ce)|0,b=b+Math.imul(x,fe)|0;var we=(n+(f=f+Math.imul(s,be)|0)|0)+((8191&(d=(d=d+Math.imul(s,te)|0)+Math.imul(l,be)|0))<<13)|0;n=((b=b+Math.imul(l,te)|0)+(d>>>13)|0)+(we>>>26)|0,we&=67108863,f=Math.imul(F,D),d=(d=Math.imul(F,z))+Math.imul(O,D)|0,b=Math.imul(O,z),f=f+Math.imul(S,G)|0,d=(d=d+Math.imul(S,K)|0)+Math.imul(C,G)|0,b=b+Math.imul(C,K)|0,f=f+Math.imul(I,V)|0,d=(d=d+Math.imul(I,Z)|0)+Math.imul(k,V)|0,b=b+Math.imul(k,Z)|0,f=f+Math.imul(M,Y)|0,d=(d=d+Math.imul(M,J)|0)+Math.imul(A,Y)|0,b=b+Math.imul(A,J)|0,f=f+Math.imul(_,X)|0,d=(d=d+Math.imul(_,ee)|0)+Math.imul(v,X)|0,b=b+Math.imul(v,ee)|0,f=f+Math.imul(g,ce)|0,d=(d=d+Math.imul(g,fe)|0)+Math.imul(m,ce)|0,b=b+Math.imul(m,fe)|0,f=f+Math.imul(u,be)|0,d=(d=d+Math.imul(u,te)|0)+Math.imul(x,be)|0,b=b+Math.imul(x,te)|0;var Me=(n+(f=f+Math.imul(s,re)|0)|0)+((8191&(d=(d=d+Math.imul(s,ne)|0)+Math.imul(l,re)|0))<<13)|0;n=((b=b+Math.imul(l,ne)|0)+(d>>>13)|0)+(Me>>>26)|0,Me&=67108863,f=Math.imul(R,D),d=(d=Math.imul(R,z))+Math.imul(T,D)|0,b=Math.imul(T,z),f=f+Math.imul(F,G)|0,d=(d=d+Math.imul(F,K)|0)+Math.imul(O,G)|0,b=b+Math.imul(O,K)|0,f=f+Math.imul(S,V)|0,d=(d=d+Math.imul(S,Z)|0)+Math.imul(C,V)|0,b=b+Math.imul(C,Z)|0,f=f+Math.imul(I,Y)|0,d=(d=d+Math.imul(I,J)|0)+Math.imul(k,Y)|0,b=b+Math.imul(k,J)|0,f=f+Math.imul(M,X)|0,d=(d=d+Math.imul(M,ee)|0)+Math.imul(A,X)|0,b=b+Math.imul(A,ee)|0,f=f+Math.imul(_,ce)|0,d=(d=d+Math.imul(_,fe)|0)+Math.imul(v,ce)|0,b=b+Math.imul(v,fe)|0,f=f+Math.imul(g,be)|0,d=(d=d+Math.imul(g,te)|0)+Math.imul(m,be)|0,b=b+Math.imul(m,te)|0,f=f+Math.imul(u,re)|0,d=(d=d+Math.imul(u,ne)|0)+Math.imul(x,re)|0,b=b+Math.imul(x,ne)|0;var Ae=(n+(f=f+Math.imul(s,se)|0)|0)+((8191&(d=(d=d+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;n=((b=b+Math.imul(l,le)|0)+(d>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,f=Math.imul(j,D),d=(d=Math.imul(j,z))+Math.imul(N,D)|0,b=Math.imul(N,z),f=f+Math.imul(R,G)|0,d=(d=d+Math.imul(R,K)|0)+Math.imul(T,G)|0,b=b+Math.imul(T,K)|0,f=f+Math.imul(F,V)|0,d=(d=d+Math.imul(F,Z)|0)+Math.imul(O,V)|0,b=b+Math.imul(O,Z)|0,f=f+Math.imul(S,Y)|0,d=(d=d+Math.imul(S,J)|0)+Math.imul(C,Y)|0,b=b+Math.imul(C,J)|0,f=f+Math.imul(I,X)|0,d=(d=d+Math.imul(I,ee)|0)+Math.imul(k,X)|0,b=b+Math.imul(k,ee)|0,f=f+Math.imul(M,ce)|0,d=(d=d+Math.imul(M,fe)|0)+Math.imul(A,ce)|0,b=b+Math.imul(A,fe)|0,f=f+Math.imul(_,be)|0,d=(d=d+Math.imul(_,te)|0)+Math.imul(v,be)|0,b=b+Math.imul(v,te)|0,f=f+Math.imul(g,re)|0,d=(d=d+Math.imul(g,ne)|0)+Math.imul(m,re)|0,b=b+Math.imul(m,ne)|0,f=f+Math.imul(u,se)|0,d=(d=d+Math.imul(u,le)|0)+Math.imul(x,se)|0,b=b+Math.imul(x,le)|0;var Le=(n+(f=f+Math.imul(s,ue)|0)|0)+((8191&(d=(d=d+Math.imul(s,xe)|0)+Math.imul(l,ue)|0))<<13)|0;n=((b=b+Math.imul(l,xe)|0)+(d>>>13)|0)+(Le>>>26)|0,Le&=67108863,f=Math.imul(j,G),d=(d=Math.imul(j,K))+Math.imul(N,G)|0,b=Math.imul(N,K),f=f+Math.imul(R,V)|0,d=(d=d+Math.imul(R,Z)|0)+Math.imul(T,V)|0,b=b+Math.imul(T,Z)|0,f=f+Math.imul(F,Y)|0,d=(d=d+Math.imul(F,J)|0)+Math.imul(O,Y)|0,b=b+Math.imul(O,J)|0,f=f+Math.imul(S,X)|0,d=(d=d+Math.imul(S,ee)|0)+Math.imul(C,X)|0,b=b+Math.imul(C,ee)|0,f=f+Math.imul(I,ce)|0,d=(d=d+Math.imul(I,fe)|0)+Math.imul(k,ce)|0,b=b+Math.imul(k,fe)|0,f=f+Math.imul(M,be)|0,d=(d=d+Math.imul(M,te)|0)+Math.imul(A,be)|0,b=b+Math.imul(A,te)|0,f=f+Math.imul(_,re)|0,d=(d=d+Math.imul(_,ne)|0)+Math.imul(v,re)|0,b=b+Math.imul(v,ne)|0,f=f+Math.imul(g,se)|0,d=(d=d+Math.imul(g,le)|0)+Math.imul(m,se)|0,b=b+Math.imul(m,le)|0;var Ie=(n+(f=f+Math.imul(u,ue)|0)|0)+((8191&(d=(d=d+Math.imul(u,xe)|0)+Math.imul(x,ue)|0))<<13)|0;n=((b=b+Math.imul(x,xe)|0)+(d>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,f=Math.imul(j,V),d=(d=Math.imul(j,Z))+Math.imul(N,V)|0,b=Math.imul(N,Z),f=f+Math.imul(R,Y)|0,d=(d=d+Math.imul(R,J)|0)+Math.imul(T,Y)|0,b=b+Math.imul(T,J)|0,f=f+Math.imul(F,X)|0,d=(d=d+Math.imul(F,ee)|0)+Math.imul(O,X)|0,b=b+Math.imul(O,ee)|0,f=f+Math.imul(S,ce)|0,d=(d=d+Math.imul(S,fe)|0)+Math.imul(C,ce)|0,b=b+Math.imul(C,fe)|0,f=f+Math.imul(I,be)|0,d=(d=d+Math.imul(I,te)|0)+Math.imul(k,be)|0,b=b+Math.imul(k,te)|0,f=f+Math.imul(M,re)|0,d=(d=d+Math.imul(M,ne)|0)+Math.imul(A,re)|0,b=b+Math.imul(A,ne)|0,f=f+Math.imul(_,se)|0,d=(d=d+Math.imul(_,le)|0)+Math.imul(v,se)|0,b=b+Math.imul(v,le)|0;var ke=(n+(f=f+Math.imul(g,ue)|0)|0)+((8191&(d=(d=d+Math.imul(g,xe)|0)+Math.imul(m,ue)|0))<<13)|0;n=((b=b+Math.imul(m,xe)|0)+(d>>>13)|0)+(ke>>>26)|0,ke&=67108863,f=Math.imul(j,Y),d=(d=Math.imul(j,J))+Math.imul(N,Y)|0,b=Math.imul(N,J),f=f+Math.imul(R,X)|0,d=(d=d+Math.imul(R,ee)|0)+Math.imul(T,X)|0,b=b+Math.imul(T,ee)|0,f=f+Math.imul(F,ce)|0,d=(d=d+Math.imul(F,fe)|0)+Math.imul(O,ce)|0,b=b+Math.imul(O,fe)|0,f=f+Math.imul(S,be)|0,d=(d=d+Math.imul(S,te)|0)+Math.imul(C,be)|0,b=b+Math.imul(C,te)|0,f=f+Math.imul(I,re)|0,d=(d=d+Math.imul(I,ne)|0)+Math.imul(k,re)|0,b=b+Math.imul(k,ne)|0,f=f+Math.imul(M,se)|0,d=(d=d+Math.imul(M,le)|0)+Math.imul(A,se)|0,b=b+Math.imul(A,le)|0;var Ee=(n+(f=f+Math.imul(_,ue)|0)|0)+((8191&(d=(d=d+Math.imul(_,xe)|0)+Math.imul(v,ue)|0))<<13)|0;n=((b=b+Math.imul(v,xe)|0)+(d>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,f=Math.imul(j,X),d=(d=Math.imul(j,ee))+Math.imul(N,X)|0,b=Math.imul(N,ee),f=f+Math.imul(R,ce)|0,d=(d=d+Math.imul(R,fe)|0)+Math.imul(T,ce)|0,b=b+Math.imul(T,fe)|0,f=f+Math.imul(F,be)|0,d=(d=d+Math.imul(F,te)|0)+Math.imul(O,be)|0,b=b+Math.imul(O,te)|0,f=f+Math.imul(S,re)|0,d=(d=d+Math.imul(S,ne)|0)+Math.imul(C,re)|0,b=b+Math.imul(C,ne)|0,f=f+Math.imul(I,se)|0,d=(d=d+Math.imul(I,le)|0)+Math.imul(k,se)|0,b=b+Math.imul(k,le)|0;var Se=(n+(f=f+Math.imul(M,ue)|0)|0)+((8191&(d=(d=d+Math.imul(M,xe)|0)+Math.imul(A,ue)|0))<<13)|0;n=((b=b+Math.imul(A,xe)|0)+(d>>>13)|0)+(Se>>>26)|0,Se&=67108863,f=Math.imul(j,ce),d=(d=Math.imul(j,fe))+Math.imul(N,ce)|0,b=Math.imul(N,fe),f=f+Math.imul(R,be)|0,d=(d=d+Math.imul(R,te)|0)+Math.imul(T,be)|0,b=b+Math.imul(T,te)|0,f=f+Math.imul(F,re)|0,d=(d=d+Math.imul(F,ne)|0)+Math.imul(O,re)|0,b=b+Math.imul(O,ne)|0,f=f+Math.imul(S,se)|0,d=(d=d+Math.imul(S,le)|0)+Math.imul(C,se)|0,b=b+Math.imul(C,le)|0;var Ce=(n+(f=f+Math.imul(I,ue)|0)|0)+((8191&(d=(d=d+Math.imul(I,xe)|0)+Math.imul(k,ue)|0))<<13)|0;n=((b=b+Math.imul(k,xe)|0)+(d>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,f=Math.imul(j,be),d=(d=Math.imul(j,te))+Math.imul(N,be)|0,b=Math.imul(N,te),f=f+Math.imul(R,re)|0,d=(d=d+Math.imul(R,ne)|0)+Math.imul(T,re)|0,b=b+Math.imul(T,ne)|0,f=f+Math.imul(F,se)|0,d=(d=d+Math.imul(F,le)|0)+Math.imul(O,se)|0,b=b+Math.imul(O,le)|0;var Be=(n+(f=f+Math.imul(S,ue)|0)|0)+((8191&(d=(d=d+Math.imul(S,xe)|0)+Math.imul(C,ue)|0))<<13)|0;n=((b=b+Math.imul(C,xe)|0)+(d>>>13)|0)+(Be>>>26)|0,Be&=67108863,f=Math.imul(j,re),d=(d=Math.imul(j,ne))+Math.imul(N,re)|0,b=Math.imul(N,ne),f=f+Math.imul(R,se)|0,d=(d=d+Math.imul(R,le)|0)+Math.imul(T,se)|0,b=b+Math.imul(T,le)|0;var Fe=(n+(f=f+Math.imul(F,ue)|0)|0)+((8191&(d=(d=d+Math.imul(F,xe)|0)+Math.imul(O,ue)|0))<<13)|0;n=((b=b+Math.imul(O,xe)|0)+(d>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,f=Math.imul(j,se),d=(d=Math.imul(j,le))+Math.imul(N,se)|0,b=Math.imul(N,le);var Oe=(n+(f=f+Math.imul(R,ue)|0)|0)+((8191&(d=(d=d+Math.imul(R,xe)|0)+Math.imul(T,ue)|0))<<13)|0;n=((b=b+Math.imul(T,xe)|0)+(d>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Pe=(n+(f=Math.imul(j,ue))|0)+((8191&(d=(d=Math.imul(j,xe))+Math.imul(N,ue)|0))<<13)|0;return n=((b=Math.imul(N,xe))+(d>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r[0]=pe,r[1]=ge,r[2]=me,r[3]=ye,r[4]=_e,r[5]=ve,r[6]=we,r[7]=Me,r[8]=Ae,r[9]=Le,r[10]=Ie,r[11]=ke,r[12]=Ee,r[13]=Se,r[14]=Ce,r[15]=Be,r[16]=Fe,r[17]=Oe,r[18]=Pe,0!==n&&(r[19]=n,c.length++),c};function x(e,a,c){return(new p).mulp(e,a,c)}function p(e,a){this.x=e,this.y=a}Math.imul||(u=h),b.prototype.mulTo=function(e,a){var c,f=this.length+e.length;return c=10===this.length&&10===e.length?u(this,e,a):f<63?h(this,e,a):f<1024?function(e,a,c){c.negative=a.negative^e.negative,c.length=e.length+a.length;for(var f=0,d=0,b=0;b>>26)|0)>>>26,t&=67108863}c.words[b]=i,f=t,t=d}return 0!==f?c.words[b]=f:c.length--,c.strip()}(this,e,a):x(this,e,a),c},p.prototype.makeRBT=function(e){for(var a=new Array(e),c=b.prototype._countBits(e)-1,f=0;f>=1;return f},p.prototype.permute=function(e,a,c,f,d,b){for(var t=0;t>>=1)d++;return 1<>>=13,c[2*t+1]=8191&b,b>>>=13;for(t=2*a;t>=26,a+=d/67108864|0,a+=b>>>26,this.words[c]=67108863&b}return 0!==a&&(this.words[c]=a,this.length++),this},b.prototype.muln=function(e){return this.clone().imuln(e)},b.prototype.sqr=function(){return this.mul(this)},b.prototype.isqr=function(){return this.imul(this.clone())},b.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),c=0;c>>d}return a}(e);if(0===a.length)return new b(1);for(var c=this,f=0;f=0);var a,c=e%26,d=(e-c)/26,b=67108863>>>26-c<<26-c;if(0!==c){var t=0;for(a=0;a>>26-c}t&&(this.words[a]=t,this.length++)}if(0!==d){for(a=this.length-1;a>=0;a--)this.words[a+d]=this.words[a];for(a=0;a=0),d=a?(a-a%26)/26:0;var b=e%26,t=Math.min((e-b)/26,this.length),i=67108863^67108863>>>b<t)for(this.length-=t,n=0;n=0&&(0!==o||n>=d);n--){var s=0|this.words[n];this.words[n]=o<<26-b|s>>>b,o=s&i}return r&&0!==o&&(r.words[r.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},b.prototype.ishrn=function(e,a,c){return f(0===this.negative),this.iushrn(e,a,c)},b.prototype.shln=function(e){return this.clone().ishln(e)},b.prototype.ushln=function(e){return this.clone().iushln(e)},b.prototype.shrn=function(e){return this.clone().ishrn(e)},b.prototype.ushrn=function(e){return this.clone().iushrn(e)},b.prototype.testn=function(e){f("number"==typeof e&&e>=0);var a=e%26,c=(e-a)/26,d=1<=0);var a=e%26,c=(e-a)/26;if(f(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)return this;if(0!==a&&c++,this.length=Math.min(c,this.length),0!==a){var d=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},b.prototype.isubn=function(e){if(f("number"==typeof e),f(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(r/67108864|0),this.words[d+c]=67108863&b}for(;d>26,this.words[d+c]=67108863&b;if(0===i)return this.strip();for(f(-1===i),i=0,d=0;d>26,this.words[d]=67108863&b;return this.negative=1,this.strip()},b.prototype._wordDiv=function(e,a){var c=(this.length,e.length),f=this.clone(),d=e,t=0|d.words[d.length-1];0!=(c=26-this._countBits(t))&&(d=d.ushln(c),f.iushln(c),t=0|d.words[d.length-1]);var i,r=f.length-d.length;if("mod"!==a){(i=new b(null)).length=r+1,i.words=new Array(i.length);for(var n=0;n=0;s--){var l=67108864*(0|f.words[d.length+s])+(0|f.words[d.length+s-1]);for(l=Math.min(l/t|0,67108863),f._ishlnsubmul(d,l,s);0!==f.negative;)l--,f.negative=0,f._ishlnsubmul(d,1,s),f.isZero()||(f.negative^=1);i&&(i.words[s]=l)}return i&&i.strip(),f.strip(),"div"!==a&&0!==c&&f.iushrn(c),{div:i||null,mod:f}},b.prototype.divmod=function(e,a,c){return f(!e.isZero()),this.isZero()?{div:new b(0),mod:new b(0)}:0!==this.negative&&0===e.negative?(i=this.neg().divmod(e,a),"mod"!==a&&(d=i.div.neg()),"div"!==a&&(t=i.mod.neg(),c&&0!==t.negative&&t.iadd(e)),{div:d,mod:t}):0===this.negative&&0!==e.negative?(i=this.divmod(e.neg(),a),"mod"!==a&&(d=i.div.neg()),{div:d,mod:i.mod}):this.negative&e.negative?(i=this.neg().divmod(e.neg(),a),"div"!==a&&(t=i.mod.neg(),c&&0!==t.negative&&t.isub(e)),{div:i.div,mod:t}):e.length>this.length||this.cmp(e)<0?{div:new b(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new b(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new b(this.modn(e.words[0]))}:this._wordDiv(e,a);var d,t,i},b.prototype.div=function(e){return this.divmod(e,"div",!1).div},b.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},b.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},b.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var c=0!==a.div.negative?a.mod.isub(e):a.mod,f=e.ushrn(1),d=e.andln(1),b=c.cmp(f);return b<0||1===d&&0===b?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},b.prototype.modn=function(e){f(e<=67108863);for(var a=(1<<26)%e,c=0,d=this.length-1;d>=0;d--)c=(a*c+(0|this.words[d]))%e;return c},b.prototype.idivn=function(e){f(e<=67108863);for(var a=0,c=this.length-1;c>=0;c--){var d=(0|this.words[c])+67108864*a;this.words[c]=d/e|0,a=d%e}return this.strip()},b.prototype.divn=function(e){return this.clone().idivn(e)},b.prototype.egcd=function(e){f(0===e.negative),f(!e.isZero());var a=this,c=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var d=new b(1),t=new b(0),i=new b(0),r=new b(1),n=0;a.isEven()&&c.isEven();)a.iushrn(1),c.iushrn(1),++n;for(var o=c.clone(),s=a.clone();!a.isZero();){for(var l=0,h=1;!(a.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(d.isOdd()||t.isOdd())&&(d.iadd(o),t.isub(s)),d.iushrn(1),t.iushrn(1);for(var u=0,x=1;!(c.words[0]&x)&&u<26;++u,x<<=1);if(u>0)for(c.iushrn(u);u-- >0;)(i.isOdd()||r.isOdd())&&(i.iadd(o),r.isub(s)),i.iushrn(1),r.iushrn(1);a.cmp(c)>=0?(a.isub(c),d.isub(i),t.isub(r)):(c.isub(a),i.isub(d),r.isub(t))}return{a:i,b:r,gcd:c.iushln(n)}},b.prototype._invmp=function(e){f(0===e.negative),f(!e.isZero());var a=this,c=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var d,t=new b(1),i=new b(0),r=c.clone();a.cmpn(1)>0&&c.cmpn(1)>0;){for(var n=0,o=1;!(a.words[0]&o)&&n<26;++n,o<<=1);if(n>0)for(a.iushrn(n);n-- >0;)t.isOdd()&&t.iadd(r),t.iushrn(1);for(var s=0,l=1;!(c.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(c.iushrn(s);s-- >0;)i.isOdd()&&i.iadd(r),i.iushrn(1);a.cmp(c)>=0?(a.isub(c),t.isub(i)):(c.isub(a),i.isub(t))}return(d=0===a.cmpn(1)?t:i).cmpn(0)<0&&d.iadd(e),d},b.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),c=e.clone();a.negative=0,c.negative=0;for(var f=0;a.isEven()&&c.isEven();f++)a.iushrn(1),c.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=a.cmp(c);if(d<0){var b=a;a=c,c=b}else if(0===d||0===c.cmpn(1))break;a.isub(c)}return c.iushln(f)},b.prototype.invm=function(e){return this.egcd(e).a.umod(e)},b.prototype.isEven=function(){return!(1&this.words[0])},b.prototype.isOdd=function(){return!(1&~this.words[0])},b.prototype.andln=function(e){return this.words[0]&e},b.prototype.bincn=function(e){f("number"==typeof e);var a=e%26,c=(e-a)/26,d=1<>>26,i&=67108863,this.words[t]=i}return 0!==b&&(this.words[t]=b,this.length++),this},b.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},b.prototype.cmpn=function(e){var a,c=e<0;if(0!==this.negative&&!c)return-1;if(0===this.negative&&c)return 1;if(this.strip(),this.length>1)a=1;else{c&&(e=-e),f(e<=67108863,"Number is too big");var d=0|this.words[0];a=d===e?0:de.length)return 1;if(this.length=0;c--){var f=0|this.words[c],d=0|e.words[c];if(f!==d){fd&&(a=1);break}}return a},b.prototype.gtn=function(e){return 1===this.cmpn(e)},b.prototype.gt=function(e){return 1===this.cmp(e)},b.prototype.gten=function(e){return this.cmpn(e)>=0},b.prototype.gte=function(e){return this.cmp(e)>=0},b.prototype.ltn=function(e){return-1===this.cmpn(e)},b.prototype.lt=function(e){return-1===this.cmp(e)},b.prototype.lten=function(e){return this.cmpn(e)<=0},b.prototype.lte=function(e){return this.cmp(e)<=0},b.prototype.eqn=function(e){return 0===this.cmpn(e)},b.prototype.eq=function(e){return 0===this.cmp(e)},b.red=function(e){return new M(e)},b.prototype.toRed=function(e){return f(!this.red,"Already a number in reduction context"),f(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},b.prototype.fromRed=function(){return f(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},b.prototype._forceRed=function(e){return this.red=e,this},b.prototype.forceRed=function(e){return f(!this.red,"Already a number in reduction context"),this._forceRed(e)},b.prototype.redAdd=function(e){return f(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},b.prototype.redIAdd=function(e){return f(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},b.prototype.redSub=function(e){return f(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},b.prototype.redISub=function(e){return f(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},b.prototype.redShl=function(e){return f(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},b.prototype.redMul=function(e){return f(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},b.prototype.redIMul=function(e){return f(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},b.prototype.redSqr=function(){return f(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},b.prototype.redISqr=function(){return f(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},b.prototype.redSqrt=function(){return f(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},b.prototype.redInvm=function(){return f(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},b.prototype.redNeg=function(){return f(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},b.prototype.redPow=function(e){return f(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function m(e,a){this.name=e,this.p=new b(a,16),this.n=this.p.bitLength(),this.k=new b(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var a=b._prime(e);this.m=a.p,this.prime=a}else f(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new b(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)}m.prototype._tmp=function(){var e=new b(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var a,c=e;do{this.split(c,this.tmp),a=(c=(c=this.imulK(c)).iadd(this.tmp)).bitLength()}while(a>this.n);var f=a0?c.isub(this.p):void 0!==c.strip?c.strip():c._strip(),c},m.prototype.split=function(e,a){e.iushrn(this.n,0,a)},m.prototype.imulK=function(e){return e.imul(this.k)},d(y,m),y.prototype.split=function(e,a){for(var c=4194303,f=Math.min(e.length,9),d=0;d>>22,b=t}b>>>=22,e.words[d-10]=b,0===b&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,c=0;c>>=26,e.words[c]=d,a=f}return 0!==a&&(e.words[e.length++]=a),e},b._prime=function(e){if(g[e])return g[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new _;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return g[e]=a,a},M.prototype._verify1=function(e){f(0===e.negative,"red works only with positives"),f(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,a){f(!(e.negative|a.negative),"red works only with positives"),f(e.red&&e.red===a.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,a){this._verify2(e,a);var c=e.add(a);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},M.prototype.iadd=function(e,a){this._verify2(e,a);var c=e.iadd(a);return c.cmp(this.m)>=0&&c.isub(this.m),c},M.prototype.sub=function(e,a){this._verify2(e,a);var c=e.sub(a);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},M.prototype.isub=function(e,a){this._verify2(e,a);var c=e.isub(a);return c.cmpn(0)<0&&c.iadd(this.m),c},M.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},M.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},M.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(f(a%2==1),3===a){var c=this.m.add(new b(1)).iushrn(2);return this.pow(e,c)}for(var d=this.m.subn(1),t=0;!d.isZero()&&0===d.andln(1);)t++,d.iushrn(1);f(!d.isZero());var i=new b(1).toRed(this),r=i.redNeg(),n=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new b(2*o*o).toRed(this);0!==this.pow(o,n).cmp(r);)o.redIAdd(r);for(var s=this.pow(o,d),l=this.pow(e,d.addn(1).iushrn(1)),h=this.pow(e,d),u=t;0!==h.cmp(i);){for(var x=h,p=0;0!==x.cmp(i);p++)x=x.redSqr();f(p=0;f--){for(var n=a.words[f],o=r-1;o>=0;o--){var s=n>>o&1;d!==c[0]&&(d=this.sqr(d)),0!==s||0!==t?(t<<=1,t|=s,(4==++i||0===f&&0===o)&&(d=this.mul(d,c[t]),i=0,t=0)):i=0}r=26}return d},M.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},M.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},b.mont=function(e){return new A(e)},d(A,M),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},A.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var c=e.imul(a),f=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(f).iushrn(this.shift),b=d;return d.cmp(this.m)>=0?b=d.isub(this.m):d.cmpn(0)<0&&(b=d.iadd(this.m)),b._forceRed(this)},A.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new b(0)._forceRed(this);var c=e.mul(a),f=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(f).iushrn(this.shift),t=d;return d.cmp(this.m)>=0?t=d.isub(this.m):d.cmpn(0)<0&&(t=d.iadd(this.m)),t._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=c.nmd(e),this)},6729:(e,a,c)=>{"use strict";var f=a;f.version=c(1636).rE,f.utils=c(7011),f.rand=c(5037),f.curve=c(894),f.curves=c(480),f.ec=c(7447),f.eddsa=c(8650)},6677:(e,a,c)=>{"use strict";var f=c(8490),d=c(7011),b=d.getNAF,t=d.getJSF,i=d.assert;function r(e,a){this.type=e,this.p=new f(a.p,16),this.red=a.prime?f.red(a.prime):f.mont(this.p),this.zero=new f(0).toRed(this.red),this.one=new f(1).toRed(this.red),this.two=new f(2).toRed(this.red),this.n=a.n&&new f(a.n,16),this.g=a.g&&this.pointFromJSON(a.g,a.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 c=this.n&&this.p.div(this.n);!c||c.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function n(e,a){this.curve=e,this.type=a,this.precomputed=null}e.exports=r,r.prototype.point=function(){throw new Error("Not implemented")},r.prototype.validate=function(){throw new Error("Not implemented")},r.prototype._fixedNafMul=function(e,a){i(e.precomputed);var c=e._getDoubles(),f=b(a,1,this._bitLength),d=(1<=t;o--)r=(r<<1)+f[o];n.push(r)}for(var s=this.jpoint(null,null,null),l=this.jpoint(null,null,null),h=d;h>0;h--){for(t=0;t=0;n--){for(var o=0;n>=0&&0===t[n];n--)o++;if(n>=0&&o++,r=r.dblp(o),n<0)break;var s=t[n];i(0!==s),r="affine"===e.type?s>0?r.mixedAdd(d[s-1>>1]):r.mixedAdd(d[-s-1>>1].neg()):s>0?r.add(d[s-1>>1]):r.add(d[-s-1>>1].neg())}return"affine"===e.type?r.toP():r},r.prototype._wnafMulAdd=function(e,a,c,f,d){var i,r,n,o=this._wnafT1,s=this._wnafT2,l=this._wnafT3,h=0;for(i=0;i=1;i-=2){var x=i-1,p=i;if(1===o[x]&&1===o[p]){var g=[a[x],null,null,a[p]];0===a[x].y.cmp(a[p].y)?(g[1]=a[x].add(a[p]),g[2]=a[x].toJ().mixedAdd(a[p].neg())):0===a[x].y.cmp(a[p].y.redNeg())?(g[1]=a[x].toJ().mixedAdd(a[p]),g[2]=a[x].add(a[p].neg())):(g[1]=a[x].toJ().mixedAdd(a[p]),g[2]=a[x].toJ().mixedAdd(a[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],y=t(c[x],c[p]);for(h=Math.max(y[0].length,h),l[x]=new Array(h),l[p]=new Array(h),r=0;r=0;i--){for(var A=0;i>=0;){var L=!0;for(r=0;r=0&&A++,w=w.dblp(A),i<0)break;for(r=0;r0?n=s[r][I-1>>1]:I<0&&(n=s[r][-I-1>>1].neg()),w="affine"===n.type?w.mixedAdd(n):w.add(n))}}for(i=0;i=Math.ceil((e.bitLength()+1)/a.step)},n.prototype._getDoubles=function(e,a){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var c=[this],f=this,d=0;d{"use strict";var f=c(7011),d=c(8490),b=c(6698),t=c(6677),i=f.assert;function r(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,t.call(this,"edwards",e),this.a=new d(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new d(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new d(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),i(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function n(e,a,c,f,b){t.BasePoint.call(this,e,"projective"),null===a&&null===c&&null===f?(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 d(a,16),this.y=new d(c,16),this.z=f?new d(f,16):this.curve.one,this.t=b&&new d(b,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()))))}b(r,t),e.exports=r,r.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},r.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},r.prototype.jpoint=function(e,a,c,f){return this.point(e,a,c,f)},r.prototype.pointFromX=function(e,a){(e=new d(e,16)).red||(e=e.toRed(this.red));var c=e.redSqr(),f=this.c2.redSub(this.a.redMul(c)),b=this.one.redSub(this.c2.redMul(this.d).redMul(c)),t=f.redMul(b.redInvm()),i=t.redSqrt();if(0!==i.redSqr().redSub(t).cmp(this.zero))throw new Error("invalid point");var r=i.fromRed().isOdd();return(a&&!r||!a&&r)&&(i=i.redNeg()),this.point(e,i)},r.prototype.pointFromY=function(e,a){(e=new d(e,16)).red||(e=e.toRed(this.red));var c=e.redSqr(),f=c.redSub(this.c2),b=c.redMul(this.d).redMul(this.c2).redSub(this.a),t=f.redMul(b.redInvm());if(0===t.cmp(this.zero)){if(a)throw new Error("invalid point");return this.point(this.zero,e)}var i=t.redSqrt();if(0!==i.redSqr().redSub(t).cmp(this.zero))throw new Error("invalid point");return i.fromRed().isOdd()!==a&&(i=i.redNeg()),this.point(i,e)},r.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var a=e.x.redSqr(),c=e.y.redSqr(),f=a.redMul(this.a).redAdd(c),d=this.c2.redMul(this.one.redAdd(this.d.redMul(a).redMul(c)));return 0===f.cmp(d)},b(n,t.BasePoint),r.prototype.pointFromJSON=function(e){return n.fromJSON(this,e)},r.prototype.point=function(e,a,c,f){return new n(this,e,a,c,f)},n.fromJSON=function(e,a){return new n(e,a[0],a[1],a[2])},n.prototype.inspect=function(){return this.isInfinity()?"":""},n.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},n.prototype._extDbl=function(){var e=this.x.redSqr(),a=this.y.redSqr(),c=this.z.redSqr();c=c.redIAdd(c);var f=this.curve._mulA(e),d=this.x.redAdd(this.y).redSqr().redISub(e).redISub(a),b=f.redAdd(a),t=b.redSub(c),i=f.redSub(a),r=d.redMul(t),n=b.redMul(i),o=d.redMul(i),s=t.redMul(b);return this.curve.point(r,n,s,o)},n.prototype._projDbl=function(){var e,a,c,f,d,b,t=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),r=this.y.redSqr();if(this.curve.twisted){var n=(f=this.curve._mulA(i)).redAdd(r);this.zOne?(e=t.redSub(i).redSub(r).redMul(n.redSub(this.curve.two)),a=n.redMul(f.redSub(r)),c=n.redSqr().redSub(n).redSub(n)):(d=this.z.redSqr(),b=n.redSub(d).redISub(d),e=t.redSub(i).redISub(r).redMul(b),a=n.redMul(f.redSub(r)),c=n.redMul(b))}else f=i.redAdd(r),d=this.curve._mulC(this.z).redSqr(),b=f.redSub(d).redSub(d),e=this.curve._mulC(t.redISub(f)).redMul(b),a=this.curve._mulC(f).redMul(i.redISub(r)),c=f.redMul(b);return this.curve.point(e,a,c)},n.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},n.prototype._extAdd=function(e){var a=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),c=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),f=this.t.redMul(this.curve.dd).redMul(e.t),d=this.z.redMul(e.z.redAdd(e.z)),b=c.redSub(a),t=d.redSub(f),i=d.redAdd(f),r=c.redAdd(a),n=b.redMul(t),o=i.redMul(r),s=b.redMul(r),l=t.redMul(i);return this.curve.point(n,o,l,s)},n.prototype._projAdd=function(e){var a,c,f=this.z.redMul(e.z),d=f.redSqr(),b=this.x.redMul(e.x),t=this.y.redMul(e.y),i=this.curve.d.redMul(b).redMul(t),r=d.redSub(i),n=d.redAdd(i),o=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(b).redISub(t),s=f.redMul(r).redMul(o);return this.curve.twisted?(a=f.redMul(n).redMul(t.redSub(this.curve._mulA(b))),c=r.redMul(n)):(a=f.redMul(n).redMul(t.redSub(b)),c=this.curve._mulC(r).redMul(n)),this.curve.point(s,a,c)},n.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},n.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},n.prototype.mulAdd=function(e,a,c){return this.curve._wnafMulAdd(1,[this,a],[e,c],2,!1)},n.prototype.jmulAdd=function(e,a,c){return this.curve._wnafMulAdd(1,[this,a],[e,c],2,!0)},n.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},n.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},n.prototype.getX=function(){return this.normalize(),this.x.fromRed()},n.prototype.getY=function(){return this.normalize(),this.y.fromRed()},n.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},n.prototype.eqXToP=function(e){var a=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(a))return!0;for(var c=e.clone(),f=this.curve.redN.redMul(this.z);;){if(c.iadd(this.curve.n),c.cmp(this.curve.p)>=0)return!1;if(a.redIAdd(f),0===this.x.cmp(a))return!0}},n.prototype.toP=n.prototype.normalize,n.prototype.mixedAdd=n.prototype.add},894:(e,a,c)=>{"use strict";var f=a;f.base=c(6677),f.short=c(9188),f.mont=c(370),f.edwards=c(1298)},370:(e,a,c)=>{"use strict";var f=c(8490),d=c(6698),b=c(6677),t=c(7011);function i(e){b.call(this,"mont",e),this.a=new f(e.a,16).toRed(this.red),this.b=new f(e.b,16).toRed(this.red),this.i4=new f(4).toRed(this.red).redInvm(),this.two=new f(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function r(e,a,c){b.BasePoint.call(this,e,"projective"),null===a&&null===c?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new f(a,16),this.z=new f(c,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}d(i,b),e.exports=i,i.prototype.validate=function(e){var a=e.normalize().x,c=a.redSqr(),f=c.redMul(a).redAdd(c.redMul(this.a)).redAdd(a);return 0===f.redSqrt().redSqr().cmp(f)},d(r,b.BasePoint),i.prototype.decodePoint=function(e,a){return this.point(t.toArray(e,a),1)},i.prototype.point=function(e,a){return new r(this,e,a)},i.prototype.pointFromJSON=function(e){return r.fromJSON(this,e)},r.prototype.precompute=function(){},r.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},r.fromJSON=function(e,a){return new r(e,a[0],a[1]||e.one)},r.prototype.inspect=function(){return this.isInfinity()?"":""},r.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},r.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),a=this.x.redSub(this.z).redSqr(),c=e.redSub(a),f=e.redMul(a),d=c.redMul(a.redAdd(this.curve.a24.redMul(c)));return this.curve.point(f,d)},r.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},r.prototype.diffAdd=function(e,a){var c=this.x.redAdd(this.z),f=this.x.redSub(this.z),d=e.x.redAdd(e.z),b=e.x.redSub(e.z).redMul(c),t=d.redMul(f),i=a.z.redMul(b.redAdd(t).redSqr()),r=a.x.redMul(b.redISub(t).redSqr());return this.curve.point(i,r)},r.prototype.mul=function(e){for(var a=e.clone(),c=this,f=this.curve.point(null,null),d=[];0!==a.cmpn(0);a.iushrn(1))d.push(a.andln(1));for(var b=d.length-1;b>=0;b--)0===d[b]?(c=c.diffAdd(f,this),f=f.dbl()):(f=c.diffAdd(f,this),c=c.dbl());return f},r.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},r.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},r.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},r.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},r.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},9188:(e,a,c)=>{"use strict";var f=c(7011),d=c(8490),b=c(6698),t=c(6677),i=f.assert;function r(e){t.call(this,"short",e),this.a=new d(e.a,16).toRed(this.red),this.b=new d(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function n(e,a,c,f){t.BasePoint.call(this,e,"affine"),null===a&&null===c?(this.x=null,this.y=null,this.inf=!0):(this.x=new d(a,16),this.y=new d(c,16),f&&(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 o(e,a,c,f){t.BasePoint.call(this,e,"jacobian"),null===a&&null===c&&null===f?(this.x=this.curve.one,this.y=this.curve.one,this.z=new d(0)):(this.x=new d(a,16),this.y=new d(c,16),this.z=new d(f,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}b(r,t),e.exports=r,r.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var a,c;if(e.beta)a=new d(e.beta,16).toRed(this.red);else{var f=this._getEndoRoots(this.p);a=(a=f[0].cmp(f[1])<0?f[0]:f[1]).toRed(this.red)}if(e.lambda)c=new d(e.lambda,16);else{var b=this._getEndoRoots(this.n);0===this.g.mul(b[0]).x.cmp(this.g.x.redMul(a))?c=b[0]:(c=b[1],i(0===this.g.mul(c).x.cmp(this.g.x.redMul(a))))}return{beta:a,lambda:c,basis:e.basis?e.basis.map((function(e){return{a:new d(e.a,16),b:new d(e.b,16)}})):this._getEndoBasis(c)}}},r.prototype._getEndoRoots=function(e){var a=e===this.p?this.red:d.mont(e),c=new d(2).toRed(a).redInvm(),f=c.redNeg(),b=new d(3).toRed(a).redNeg().redSqrt().redMul(c);return[f.redAdd(b).fromRed(),f.redSub(b).fromRed()]},r.prototype._getEndoBasis=function(e){for(var a,c,f,b,t,i,r,n,o,s=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,h=this.n.clone(),u=new d(1),x=new d(0),p=new d(0),g=new d(1),m=0;0!==l.cmpn(0);){var y=h.div(l);n=h.sub(y.mul(l)),o=p.sub(y.mul(u));var _=g.sub(y.mul(x));if(!f&&n.cmp(s)<0)a=r.neg(),c=u,f=n.neg(),b=o;else if(f&&2==++m)break;r=n,h=l,l=n,p=u,u=o,g=x,x=_}t=n.neg(),i=o;var v=f.sqr().add(b.sqr());return t.sqr().add(i.sqr()).cmp(v)>=0&&(t=a,i=c),f.negative&&(f=f.neg(),b=b.neg()),t.negative&&(t=t.neg(),i=i.neg()),[{a:f,b},{a:t,b:i}]},r.prototype._endoSplit=function(e){var a=this.endo.basis,c=a[0],f=a[1],d=f.b.mul(e).divRound(this.n),b=c.b.neg().mul(e).divRound(this.n),t=d.mul(c.a),i=b.mul(f.a),r=d.mul(c.b),n=b.mul(f.b);return{k1:e.sub(t).sub(i),k2:r.add(n).neg()}},r.prototype.pointFromX=function(e,a){(e=new d(e,16)).red||(e=e.toRed(this.red));var c=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),f=c.redSqrt();if(0!==f.redSqr().redSub(c).cmp(this.zero))throw new Error("invalid point");var b=f.fromRed().isOdd();return(a&&!b||!a&&b)&&(f=f.redNeg()),this.point(e,f)},r.prototype.validate=function(e){if(e.inf)return!0;var a=e.x,c=e.y,f=this.a.redMul(a),d=a.redSqr().redMul(a).redIAdd(f).redIAdd(this.b);return 0===c.redSqr().redISub(d).cmpn(0)},r.prototype._endoWnafMulAdd=function(e,a,c){for(var f=this._endoWnafT1,d=this._endoWnafT2,b=0;b":""},n.prototype.isInfinity=function(){return this.inf},n.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var a=this.y.redSub(e.y);0!==a.cmpn(0)&&(a=a.redMul(this.x.redSub(e.x).redInvm()));var c=a.redSqr().redISub(this.x).redISub(e.x),f=a.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,f)},n.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var a=this.curve.a,c=this.x.redSqr(),f=e.redInvm(),d=c.redAdd(c).redIAdd(c).redIAdd(a).redMul(f),b=d.redSqr().redISub(this.x.redAdd(this.x)),t=d.redMul(this.x.redSub(b)).redISub(this.y);return this.curve.point(b,t)},n.prototype.getX=function(){return this.x.fromRed()},n.prototype.getY=function(){return this.y.fromRed()},n.prototype.mul=function(e){return e=new d(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},n.prototype.mulAdd=function(e,a,c){var f=[this,a],d=[e,c];return this.curve.endo?this.curve._endoWnafMulAdd(f,d):this.curve._wnafMulAdd(1,f,d,2)},n.prototype.jmulAdd=function(e,a,c){var f=[this,a],d=[e,c];return this.curve.endo?this.curve._endoWnafMulAdd(f,d,!0):this.curve._wnafMulAdd(1,f,d,2,!0)},n.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},n.prototype.neg=function(e){if(this.inf)return this;var a=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var c=this.precomputed,f=function(e){return e.neg()};a.precomputed={naf:c.naf&&{wnd:c.naf.wnd,points:c.naf.points.map(f)},doubles:c.doubles&&{step:c.doubles.step,points:c.doubles.points.map(f)}}}return a},n.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},b(o,t.BasePoint),r.prototype.jpoint=function(e,a,c){return new o(this,e,a,c)},o.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),a=e.redSqr(),c=this.x.redMul(a),f=this.y.redMul(a).redMul(e);return this.curve.point(c,f)},o.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},o.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var a=e.z.redSqr(),c=this.z.redSqr(),f=this.x.redMul(a),d=e.x.redMul(c),b=this.y.redMul(a.redMul(e.z)),t=e.y.redMul(c.redMul(this.z)),i=f.redSub(d),r=b.redSub(t);if(0===i.cmpn(0))return 0!==r.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var n=i.redSqr(),o=n.redMul(i),s=f.redMul(n),l=r.redSqr().redIAdd(o).redISub(s).redISub(s),h=r.redMul(s.redISub(l)).redISub(b.redMul(o)),u=this.z.redMul(e.z).redMul(i);return this.curve.jpoint(l,h,u)},o.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var a=this.z.redSqr(),c=this.x,f=e.x.redMul(a),d=this.y,b=e.y.redMul(a).redMul(this.z),t=c.redSub(f),i=d.redSub(b);if(0===t.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var r=t.redSqr(),n=r.redMul(t),o=c.redMul(r),s=i.redSqr().redIAdd(n).redISub(o).redISub(o),l=i.redMul(o.redISub(s)).redISub(d.redMul(n)),h=this.z.redMul(t);return this.curve.jpoint(s,l,h)},o.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var a;if(this.curve.zeroA||this.curve.threeA){var c=this;for(a=0;a=0)return!1;if(c.redIAdd(d),0===this.x.cmp(c))return!0}},o.prototype.inspect=function(){return this.isInfinity()?"":""},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},480:(e,a,c)=>{"use strict";var f,d=a,b=c(7952),t=c(894),i=c(7011).assert;function r(e){"short"===e.type?this.curve=new t.short(e):"edwards"===e.type?this.curve=new t.edwards(e):this.curve=new t.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function n(e,a){Object.defineProperty(d,e,{configurable:!0,enumerable:!0,get:function(){var c=new r(a);return Object.defineProperty(d,e,{configurable:!0,enumerable:!0,value:c}),c}})}d.PresetCurve=r,n("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:b.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),n("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:b.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),n("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:b.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),n("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:b.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"]}),n("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:b.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"]}),n("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:b.sha256,gRed:!1,g:["9"]}),n("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:b.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{f=c(4011)}catch(e){f=void 0}n("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:b.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",f]})},7447:(e,a,c)=>{"use strict";var f=c(8490),d=c(2723),b=c(7011),t=c(480),i=c(5037),r=b.assert,n=c(1200),o=c(8545);function s(e){if(!(this instanceof s))return new s(e);"string"==typeof e&&(r(Object.prototype.hasOwnProperty.call(t,e),"Unknown curve "+e),e=t[e]),e instanceof t.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=s,s.prototype.keyPair=function(e){return new n(this,e)},s.prototype.keyFromPrivate=function(e,a){return n.fromPrivate(this,e,a)},s.prototype.keyFromPublic=function(e,a){return n.fromPublic(this,e,a)},s.prototype.genKeyPair=function(e){e||(e={});for(var a=new d({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||i(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),c=this.n.byteLength(),b=this.n.sub(new f(2));;){var t=new f(a.generate(c));if(!(t.cmp(b)>0))return t.iaddn(1),this.keyFromPrivate(t)}},s.prototype._truncateToN=function(e,a){var c=8*e.byteLength()-this.n.bitLength();return c>0&&(e=e.ushrn(c)),!a&&e.cmp(this.n)>=0?e.sub(this.n):e},s.prototype.sign=function(e,a,c,b){"object"==typeof c&&(b=c,c=null),b||(b={}),a=this.keyFromPrivate(a,c),e=this._truncateToN(new f(e,16));for(var t=this.n.byteLength(),i=a.getPrivate().toArray("be",t),r=e.toArray("be",t),n=new d({hash:this.hash,entropy:i,nonce:r,pers:b.pers,persEnc:b.persEnc||"utf8"}),s=this.n.sub(new f(1)),l=0;;l++){var h=b.k?b.k(l):new f(n.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(s)>=0)){var u=this.g.mul(h);if(!u.isInfinity()){var x=u.getX(),p=x.umod(this.n);if(0!==p.cmpn(0)){var g=h.invm(this.n).mul(p.mul(a.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var m=(u.getY().isOdd()?1:0)|(0!==x.cmp(p)?2:0);return b.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),m^=1),new o({r:p,s:g,recoveryParam:m})}}}}}},s.prototype.verify=function(e,a,c,d){e=this._truncateToN(new f(e,16)),c=this.keyFromPublic(c,d);var b=(a=new o(a,"hex")).r,t=a.s;if(b.cmpn(1)<0||b.cmp(this.n)>=0)return!1;if(t.cmpn(1)<0||t.cmp(this.n)>=0)return!1;var i,r=t.invm(this.n),n=r.mul(e).umod(this.n),s=r.mul(b).umod(this.n);return this.curve._maxwellTrick?!(i=this.g.jmulAdd(n,c.getPublic(),s)).isInfinity()&&i.eqXToP(b):!(i=this.g.mulAdd(n,c.getPublic(),s)).isInfinity()&&0===i.getX().umod(this.n).cmp(b)},s.prototype.recoverPubKey=function(e,a,c,d){r((3&c)===c,"The recovery param is more than two bits"),a=new o(a,d);var b=this.n,t=new f(e),i=a.r,n=a.s,s=1&c,l=c>>1;if(i.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");i=l?this.curve.pointFromX(i.add(this.curve.n),s):this.curve.pointFromX(i,s);var h=a.r.invm(b),u=b.sub(t).mul(h).umod(b),x=n.mul(h).umod(b);return this.g.mulAdd(u,i,x)},s.prototype.getKeyRecoveryParam=function(e,a,c,f){if(null!==(a=new o(a,f)).recoveryParam)return a.recoveryParam;for(var d=0;d<4;d++){var b;try{b=this.recoverPubKey(e,a,d)}catch(e){continue}if(b.eq(c))return d}throw new Error("Unable to find valid recovery factor")}},1200:(e,a,c)=>{"use strict";var f=c(8490),d=c(7011).assert;function b(e,a){this.ec=e,this.priv=null,this.pub=null,a.priv&&this._importPrivate(a.priv,a.privEnc),a.pub&&this._importPublic(a.pub,a.pubEnc)}e.exports=b,b.fromPublic=function(e,a,c){return a instanceof b?a:new b(e,{pub:a,pubEnc:c})},b.fromPrivate=function(e,a,c){return a instanceof b?a:new b(e,{priv:a,privEnc:c})},b.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},b.prototype.getPublic=function(e,a){return"string"==typeof e&&(a=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),a?this.pub.encode(a,e):this.pub},b.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},b.prototype._importPrivate=function(e,a){this.priv=new f(e,a||16),this.priv=this.priv.umod(this.ec.curve.n)},b.prototype._importPublic=function(e,a){if(e.x||e.y)return"mont"===this.ec.curve.type?d(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||d(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,a)},b.prototype.derive=function(e){return e.validate()||d(e.validate(),"public point not validated"),e.mul(this.priv).getX()},b.prototype.sign=function(e,a,c){return this.ec.sign(e,this,a,c)},b.prototype.verify=function(e,a){return this.ec.verify(e,a,this)},b.prototype.inspect=function(){return""}},8545:(e,a,c)=>{"use strict";var f=c(8490),d=c(7011),b=d.assert;function t(e,a){if(e instanceof t)return e;this._importDER(e,a)||(b(e.r&&e.s,"Signature without r or s"),this.r=new f(e.r,16),this.s=new f(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function i(){this.place=0}function r(e,a){var c=e[a.place++];if(!(128&c))return c;var f=15&c;if(0===f||f>4)return!1;if(0===e[a.place])return!1;for(var d=0,b=0,t=a.place;b>>=0;return!(d<=127)&&(a.place=t,d)}function n(e){for(var a=0,c=e.length-1;!e[a]&&!(128&e[a+1])&&a>>3);for(e.push(128|c);--c;)e.push(a>>>(c<<3)&255);e.push(a)}}e.exports=t,t.prototype._importDER=function(e,a){e=d.toArray(e,a);var c=new i;if(48!==e[c.place++])return!1;var b=r(e,c);if(!1===b)return!1;if(b+c.place!==e.length)return!1;if(2!==e[c.place++])return!1;var t=r(e,c);if(!1===t)return!1;if(128&e[c.place])return!1;var n=e.slice(c.place,t+c.place);if(c.place+=t,2!==e[c.place++])return!1;var o=r(e,c);if(!1===o)return!1;if(e.length!==o+c.place)return!1;if(128&e[c.place])return!1;var s=e.slice(c.place,o+c.place);if(0===n[0]){if(!(128&n[1]))return!1;n=n.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new f(n),this.s=new f(s),this.recoveryParam=null,!0},t.prototype.toDER=function(e){var a=this.r.toArray(),c=this.s.toArray();for(128&a[0]&&(a=[0].concat(a)),128&c[0]&&(c=[0].concat(c)),a=n(a),c=n(c);!(c[0]||128&c[1]);)c=c.slice(1);var f=[2];o(f,a.length),(f=f.concat(a)).push(2),o(f,c.length);var b=f.concat(c),t=[48];return o(t,b.length),t=t.concat(b),d.encode(t,e)}},8650:(e,a,c)=>{"use strict";var f=c(7952),d=c(480),b=c(7011),t=b.assert,i=b.parseBytes,r=c(6661),n=c(220);function o(e){if(t("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof o))return new o(e);e=d[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=f.sha512}e.exports=o,o.prototype.sign=function(e,a){e=i(e);var c=this.keyFromSecret(a),f=this.hashInt(c.messagePrefix(),e),d=this.g.mul(f),b=this.encodePoint(d),t=this.hashInt(b,c.pubBytes(),e).mul(c.priv()),r=f.add(t).umod(this.curve.n);return this.makeSignature({R:d,S:r,Rencoded:b})},o.prototype.verify=function(e,a,c){if(e=i(e),(a=this.makeSignature(a)).S().gte(a.eddsa.curve.n)||a.S().isNeg())return!1;var f=this.keyFromPublic(c),d=this.hashInt(a.Rencoded(),f.pubBytes(),e),b=this.g.mul(a.S());return a.R().add(f.pub().mul(d)).eq(b)},o.prototype.hashInt=function(){for(var e=this.hash(),a=0;a{"use strict";var f=c(7011),d=f.assert,b=f.parseBytes,t=f.cachedProperty;function i(e,a){this.eddsa=e,this._secret=b(a.secret),e.isPoint(a.pub)?this._pub=a.pub:this._pubBytes=b(a.pub)}i.fromPublic=function(e,a){return a instanceof i?a:new i(e,{pub:a})},i.fromSecret=function(e,a){return a instanceof i?a:new i(e,{secret:a})},i.prototype.secret=function(){return this._secret},t(i,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),t(i,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),t(i,"privBytes",(function(){var e=this.eddsa,a=this.hash(),c=e.encodingLength-1,f=a.slice(0,e.encodingLength);return f[0]&=248,f[c]&=127,f[c]|=64,f})),t(i,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),t(i,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),t(i,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),i.prototype.sign=function(e){return d(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},i.prototype.verify=function(e,a){return this.eddsa.verify(e,a,this)},i.prototype.getSecret=function(e){return d(this._secret,"KeyPair is public only"),f.encode(this.secret(),e)},i.prototype.getPublic=function(e){return f.encode(this.pubBytes(),e)},e.exports=i},220:(e,a,c)=>{"use strict";var f=c(8490),d=c(7011),b=d.assert,t=d.cachedProperty,i=d.parseBytes;function r(e,a){this.eddsa=e,"object"!=typeof a&&(a=i(a)),Array.isArray(a)&&(b(a.length===2*e.encodingLength,"Signature has invalid size"),a={R:a.slice(0,e.encodingLength),S:a.slice(e.encodingLength)}),b(a.R&&a.S,"Signature without R or S"),e.isPoint(a.R)&&(this._R=a.R),a.S instanceof f&&(this._S=a.S),this._Rencoded=Array.isArray(a.R)?a.R:a.Rencoded,this._Sencoded=Array.isArray(a.S)?a.S:a.Sencoded}t(r,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),t(r,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),t(r,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),t(r,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),r.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},r.prototype.toHex=function(){return d.encode(this.toBytes(),"hex").toUpperCase()},e.exports=r},4011:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},7011:(e,a,c)=>{"use strict";var f=a,d=c(8490),b=c(3349),t=c(4367);f.assert=b,f.toArray=t.toArray,f.zero2=t.zero2,f.toHex=t.toHex,f.encode=t.encode,f.getNAF=function(e,a,c){var f,d=new Array(Math.max(e.bitLength(),c)+1);for(f=0;f(b>>1)-1?(b>>1)-r:r,t.isubn(i)):i=0,d[f]=i,t.iushrn(1)}return d},f.getJSF=function(e,a){var c=[[],[]];e=e.clone(),a=a.clone();for(var f,d=0,b=0;e.cmpn(-d)>0||a.cmpn(-b)>0;){var t,i,r=e.andln(3)+d&3,n=a.andln(3)+b&3;3===r&&(r=-1),3===n&&(n=-1),t=1&r?3!=(f=e.andln(7)+d&7)&&5!==f||2!==n?r:-r:0,c[0].push(t),i=1&n?3!=(f=a.andln(7)+b&7)&&5!==f||2!==r?n:-n:0,c[1].push(i),2*d===t+1&&(d=1-d),2*b===i+1&&(b=1-b),e.iushrn(1),a.iushrn(1)}return c},f.cachedProperty=function(e,a,c){var f="_"+a;e.prototype[a]=function(){return void 0!==this[f]?this[f]:this[f]=c.call(this)}},f.parseBytes=function(e){return"string"==typeof e?f.toArray(e,"hex"):e},f.intFromLE=function(e){return new d(e,"hex","le")}},8490:function(e,a,c){!function(e,a){"use strict";function f(e,a){if(!e)throw new Error(a||"Assertion failed")}function d(e,a){e.super_=a;var c=function(){};c.prototype=a.prototype,e.prototype=new c,e.prototype.constructor=e}function b(e,a,c){if(b.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==a&&"be"!==a||(c=a,a=10),this._init(e||0,a||10,c||"be"))}var t;"object"==typeof e?e.exports=b:a.BN=b,b.BN=b,b.wordSize=26;try{t="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:c(9368).Buffer}catch(e){}function i(e,a){var c=e.charCodeAt(a);return c>=65&&c<=70?c-55:c>=97&&c<=102?c-87:c-48&15}function r(e,a,c){var f=i(e,c);return c-1>=a&&(f|=i(e,c-1)<<4),f}function n(e,a,c,f){for(var d=0,b=Math.min(e.length,c),t=a;t=49?i-49+10:i>=17?i-17+10:i}return d}b.isBN=function(e){return e instanceof b||null!==e&&"object"==typeof e&&e.constructor.wordSize===b.wordSize&&Array.isArray(e.words)},b.max=function(e,a){return e.cmp(a)>0?e:a},b.min=function(e,a){return e.cmp(a)<0?e:a},b.prototype._init=function(e,a,c){if("number"==typeof e)return this._initNumber(e,a,c);if("object"==typeof e)return this._initArray(e,a,c);"hex"===a&&(a=16),f(a===(0|a)&&a>=2&&a<=36);var d=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(d++,this.negative=1),d=0;d-=3)t=e[d]|e[d-1]<<8|e[d-2]<<16,this.words[b]|=t<>>26-i&67108863,(i+=24)>=26&&(i-=26,b++);else if("le"===c)for(d=0,b=0;d>>26-i&67108863,(i+=24)>=26&&(i-=26,b++);return this.strip()},b.prototype._parseHex=function(e,a,c){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var f=0;f=a;f-=2)d=r(e,a,f)<=18?(b-=18,t+=1,this.words[t]|=d>>>26):b+=8;else for(f=(e.length-a)%2==0?a+1:a;f=18?(b-=18,t+=1,this.words[t]|=d>>>26):b+=8;this.strip()},b.prototype._parseBase=function(e,a,c){this.words=[0],this.length=1;for(var f=0,d=1;d<=67108863;d*=a)f++;f--,d=d/a|0;for(var b=e.length-c,t=b%f,i=Math.min(b,b-t)+c,r=0,o=c;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},b.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},b.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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 h(e,a,c){c.negative=a.negative^e.negative;var f=e.length+a.length|0;c.length=f,f=f-1|0;var d=0|e.words[0],b=0|a.words[0],t=d*b,i=67108863&t,r=t/67108864|0;c.words[0]=i;for(var n=1;n>>26,s=67108863&r,l=Math.min(n,a.length-1),h=Math.max(0,n-e.length+1);h<=l;h++){var u=n-h|0;o+=(t=(d=0|e.words[u])*(b=0|a.words[h])+s)/67108864|0,s=67108863&t}c.words[n]=0|s,r=0|o}return 0!==r?c.words[n]=0|r:c.length--,c.strip()}b.prototype.toString=function(e,a){var c;if(a=0|a||1,16===(e=e||10)||"hex"===e){c="";for(var d=0,b=0,t=0;t>>24-d&16777215)||t!==this.length-1?o[6-r.length]+r+c:r+c,(d+=2)>=26&&(d-=26,t--)}for(0!==b&&(c=b.toString(16)+c);c.length%a!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(e===(0|e)&&e>=2&&e<=36){var n=s[e],h=l[e];c="";var u=this.clone();for(u.negative=0;!u.isZero();){var x=u.modn(h).toString(e);c=(u=u.idivn(h)).isZero()?x+c:o[n-x.length]+x+c}for(this.isZero()&&(c="0"+c);c.length%a!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}f(!1,"Base should be between 2 and 36")},b.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&f(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},b.prototype.toJSON=function(){return this.toString(16)},b.prototype.toBuffer=function(e,a){return f(void 0!==t),this.toArrayLike(t,e,a)},b.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},b.prototype.toArrayLike=function(e,a,c){var d=this.byteLength(),b=c||Math.max(1,d);f(d<=b,"byte array longer than desired length"),f(b>0,"Requested array length <= 0"),this.strip();var t,i,r="le"===a,n=new e(b),o=this.clone();if(r){for(i=0;!o.isZero();i++)t=o.andln(255),o.iushrn(8),n[i]=t;for(;i=4096&&(c+=13,a>>>=13),a>=64&&(c+=7,a>>>=7),a>=8&&(c+=4,a>>>=4),a>=2&&(c+=2,a>>>=2),c+a},b.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,c=0;return 8191&a||(c+=13,a>>>=13),127&a||(c+=7,a>>>=7),15&a||(c+=4,a>>>=4),3&a||(c+=2,a>>>=2),1&a||c++,c},b.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},b.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},b.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},b.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var c=0;ce.length?this.clone().iand(e):e.clone().iand(this)},b.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},b.prototype.iuxor=function(e){var a,c;this.length>e.length?(a=this,c=e):(a=e,c=this);for(var f=0;fe.length?this.clone().ixor(e):e.clone().ixor(this)},b.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},b.prototype.inotn=function(e){f("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),c=e%26;this._expand(a),c>0&&a--;for(var d=0;d0&&(this.words[d]=~this.words[d]&67108863>>26-c),this.strip()},b.prototype.notn=function(e){return this.clone().inotn(e)},b.prototype.setn=function(e,a){f("number"==typeof e&&e>=0);var c=e/26|0,d=e%26;return this._expand(c+1),this.words[c]=a?this.words[c]|1<e.length?(c=this,f=e):(c=e,f=this);for(var d=0,b=0;b>>26;for(;0!==d&&b>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;be.length?this.clone().iadd(e):e.clone().iadd(this)},b.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var c,f,d=this.cmp(e);if(0===d)return this.negative=0,this.length=1,this.words[0]=0,this;d>0?(c=this,f=e):(c=e,f=this);for(var b=0,t=0;t>26,this.words[t]=67108863&a;for(;0!==b&&t>26,this.words[t]=67108863&a;if(0===b&&t>>13,h=0|t[1],u=8191&h,x=h>>>13,p=0|t[2],g=8191&p,m=p>>>13,y=0|t[3],_=8191&y,v=y>>>13,w=0|t[4],M=8191&w,A=w>>>13,L=0|t[5],I=8191&L,k=L>>>13,E=0|t[6],S=8191&E,C=E>>>13,B=0|t[7],F=8191&B,O=B>>>13,P=0|t[8],R=8191&P,T=P>>>13,U=0|t[9],j=8191&U,N=U>>>13,q=0|i[0],D=8191&q,z=q>>>13,Q=0|i[1],G=8191&Q,K=Q>>>13,H=0|i[2],V=8191&H,Z=H>>>13,W=0|i[3],Y=8191&W,J=W>>>13,$=0|i[4],X=8191&$,ee=$>>>13,ae=0|i[5],ce=8191&ae,fe=ae>>>13,de=0|i[6],be=8191&de,te=de>>>13,ie=0|i[7],re=8191&ie,ne=ie>>>13,oe=0|i[8],se=8191&oe,le=oe>>>13,he=0|i[9],ue=8191&he,xe=he>>>13;c.negative=e.negative^a.negative,c.length=19;var pe=(n+(f=Math.imul(s,D))|0)+((8191&(d=(d=Math.imul(s,z))+Math.imul(l,D)|0))<<13)|0;n=((b=Math.imul(l,z))+(d>>>13)|0)+(pe>>>26)|0,pe&=67108863,f=Math.imul(u,D),d=(d=Math.imul(u,z))+Math.imul(x,D)|0,b=Math.imul(x,z);var ge=(n+(f=f+Math.imul(s,G)|0)|0)+((8191&(d=(d=d+Math.imul(s,K)|0)+Math.imul(l,G)|0))<<13)|0;n=((b=b+Math.imul(l,K)|0)+(d>>>13)|0)+(ge>>>26)|0,ge&=67108863,f=Math.imul(g,D),d=(d=Math.imul(g,z))+Math.imul(m,D)|0,b=Math.imul(m,z),f=f+Math.imul(u,G)|0,d=(d=d+Math.imul(u,K)|0)+Math.imul(x,G)|0,b=b+Math.imul(x,K)|0;var me=(n+(f=f+Math.imul(s,V)|0)|0)+((8191&(d=(d=d+Math.imul(s,Z)|0)+Math.imul(l,V)|0))<<13)|0;n=((b=b+Math.imul(l,Z)|0)+(d>>>13)|0)+(me>>>26)|0,me&=67108863,f=Math.imul(_,D),d=(d=Math.imul(_,z))+Math.imul(v,D)|0,b=Math.imul(v,z),f=f+Math.imul(g,G)|0,d=(d=d+Math.imul(g,K)|0)+Math.imul(m,G)|0,b=b+Math.imul(m,K)|0,f=f+Math.imul(u,V)|0,d=(d=d+Math.imul(u,Z)|0)+Math.imul(x,V)|0,b=b+Math.imul(x,Z)|0;var ye=(n+(f=f+Math.imul(s,Y)|0)|0)+((8191&(d=(d=d+Math.imul(s,J)|0)+Math.imul(l,Y)|0))<<13)|0;n=((b=b+Math.imul(l,J)|0)+(d>>>13)|0)+(ye>>>26)|0,ye&=67108863,f=Math.imul(M,D),d=(d=Math.imul(M,z))+Math.imul(A,D)|0,b=Math.imul(A,z),f=f+Math.imul(_,G)|0,d=(d=d+Math.imul(_,K)|0)+Math.imul(v,G)|0,b=b+Math.imul(v,K)|0,f=f+Math.imul(g,V)|0,d=(d=d+Math.imul(g,Z)|0)+Math.imul(m,V)|0,b=b+Math.imul(m,Z)|0,f=f+Math.imul(u,Y)|0,d=(d=d+Math.imul(u,J)|0)+Math.imul(x,Y)|0,b=b+Math.imul(x,J)|0;var _e=(n+(f=f+Math.imul(s,X)|0)|0)+((8191&(d=(d=d+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;n=((b=b+Math.imul(l,ee)|0)+(d>>>13)|0)+(_e>>>26)|0,_e&=67108863,f=Math.imul(I,D),d=(d=Math.imul(I,z))+Math.imul(k,D)|0,b=Math.imul(k,z),f=f+Math.imul(M,G)|0,d=(d=d+Math.imul(M,K)|0)+Math.imul(A,G)|0,b=b+Math.imul(A,K)|0,f=f+Math.imul(_,V)|0,d=(d=d+Math.imul(_,Z)|0)+Math.imul(v,V)|0,b=b+Math.imul(v,Z)|0,f=f+Math.imul(g,Y)|0,d=(d=d+Math.imul(g,J)|0)+Math.imul(m,Y)|0,b=b+Math.imul(m,J)|0,f=f+Math.imul(u,X)|0,d=(d=d+Math.imul(u,ee)|0)+Math.imul(x,X)|0,b=b+Math.imul(x,ee)|0;var ve=(n+(f=f+Math.imul(s,ce)|0)|0)+((8191&(d=(d=d+Math.imul(s,fe)|0)+Math.imul(l,ce)|0))<<13)|0;n=((b=b+Math.imul(l,fe)|0)+(d>>>13)|0)+(ve>>>26)|0,ve&=67108863,f=Math.imul(S,D),d=(d=Math.imul(S,z))+Math.imul(C,D)|0,b=Math.imul(C,z),f=f+Math.imul(I,G)|0,d=(d=d+Math.imul(I,K)|0)+Math.imul(k,G)|0,b=b+Math.imul(k,K)|0,f=f+Math.imul(M,V)|0,d=(d=d+Math.imul(M,Z)|0)+Math.imul(A,V)|0,b=b+Math.imul(A,Z)|0,f=f+Math.imul(_,Y)|0,d=(d=d+Math.imul(_,J)|0)+Math.imul(v,Y)|0,b=b+Math.imul(v,J)|0,f=f+Math.imul(g,X)|0,d=(d=d+Math.imul(g,ee)|0)+Math.imul(m,X)|0,b=b+Math.imul(m,ee)|0,f=f+Math.imul(u,ce)|0,d=(d=d+Math.imul(u,fe)|0)+Math.imul(x,ce)|0,b=b+Math.imul(x,fe)|0;var we=(n+(f=f+Math.imul(s,be)|0)|0)+((8191&(d=(d=d+Math.imul(s,te)|0)+Math.imul(l,be)|0))<<13)|0;n=((b=b+Math.imul(l,te)|0)+(d>>>13)|0)+(we>>>26)|0,we&=67108863,f=Math.imul(F,D),d=(d=Math.imul(F,z))+Math.imul(O,D)|0,b=Math.imul(O,z),f=f+Math.imul(S,G)|0,d=(d=d+Math.imul(S,K)|0)+Math.imul(C,G)|0,b=b+Math.imul(C,K)|0,f=f+Math.imul(I,V)|0,d=(d=d+Math.imul(I,Z)|0)+Math.imul(k,V)|0,b=b+Math.imul(k,Z)|0,f=f+Math.imul(M,Y)|0,d=(d=d+Math.imul(M,J)|0)+Math.imul(A,Y)|0,b=b+Math.imul(A,J)|0,f=f+Math.imul(_,X)|0,d=(d=d+Math.imul(_,ee)|0)+Math.imul(v,X)|0,b=b+Math.imul(v,ee)|0,f=f+Math.imul(g,ce)|0,d=(d=d+Math.imul(g,fe)|0)+Math.imul(m,ce)|0,b=b+Math.imul(m,fe)|0,f=f+Math.imul(u,be)|0,d=(d=d+Math.imul(u,te)|0)+Math.imul(x,be)|0,b=b+Math.imul(x,te)|0;var Me=(n+(f=f+Math.imul(s,re)|0)|0)+((8191&(d=(d=d+Math.imul(s,ne)|0)+Math.imul(l,re)|0))<<13)|0;n=((b=b+Math.imul(l,ne)|0)+(d>>>13)|0)+(Me>>>26)|0,Me&=67108863,f=Math.imul(R,D),d=(d=Math.imul(R,z))+Math.imul(T,D)|0,b=Math.imul(T,z),f=f+Math.imul(F,G)|0,d=(d=d+Math.imul(F,K)|0)+Math.imul(O,G)|0,b=b+Math.imul(O,K)|0,f=f+Math.imul(S,V)|0,d=(d=d+Math.imul(S,Z)|0)+Math.imul(C,V)|0,b=b+Math.imul(C,Z)|0,f=f+Math.imul(I,Y)|0,d=(d=d+Math.imul(I,J)|0)+Math.imul(k,Y)|0,b=b+Math.imul(k,J)|0,f=f+Math.imul(M,X)|0,d=(d=d+Math.imul(M,ee)|0)+Math.imul(A,X)|0,b=b+Math.imul(A,ee)|0,f=f+Math.imul(_,ce)|0,d=(d=d+Math.imul(_,fe)|0)+Math.imul(v,ce)|0,b=b+Math.imul(v,fe)|0,f=f+Math.imul(g,be)|0,d=(d=d+Math.imul(g,te)|0)+Math.imul(m,be)|0,b=b+Math.imul(m,te)|0,f=f+Math.imul(u,re)|0,d=(d=d+Math.imul(u,ne)|0)+Math.imul(x,re)|0,b=b+Math.imul(x,ne)|0;var Ae=(n+(f=f+Math.imul(s,se)|0)|0)+((8191&(d=(d=d+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;n=((b=b+Math.imul(l,le)|0)+(d>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,f=Math.imul(j,D),d=(d=Math.imul(j,z))+Math.imul(N,D)|0,b=Math.imul(N,z),f=f+Math.imul(R,G)|0,d=(d=d+Math.imul(R,K)|0)+Math.imul(T,G)|0,b=b+Math.imul(T,K)|0,f=f+Math.imul(F,V)|0,d=(d=d+Math.imul(F,Z)|0)+Math.imul(O,V)|0,b=b+Math.imul(O,Z)|0,f=f+Math.imul(S,Y)|0,d=(d=d+Math.imul(S,J)|0)+Math.imul(C,Y)|0,b=b+Math.imul(C,J)|0,f=f+Math.imul(I,X)|0,d=(d=d+Math.imul(I,ee)|0)+Math.imul(k,X)|0,b=b+Math.imul(k,ee)|0,f=f+Math.imul(M,ce)|0,d=(d=d+Math.imul(M,fe)|0)+Math.imul(A,ce)|0,b=b+Math.imul(A,fe)|0,f=f+Math.imul(_,be)|0,d=(d=d+Math.imul(_,te)|0)+Math.imul(v,be)|0,b=b+Math.imul(v,te)|0,f=f+Math.imul(g,re)|0,d=(d=d+Math.imul(g,ne)|0)+Math.imul(m,re)|0,b=b+Math.imul(m,ne)|0,f=f+Math.imul(u,se)|0,d=(d=d+Math.imul(u,le)|0)+Math.imul(x,se)|0,b=b+Math.imul(x,le)|0;var Le=(n+(f=f+Math.imul(s,ue)|0)|0)+((8191&(d=(d=d+Math.imul(s,xe)|0)+Math.imul(l,ue)|0))<<13)|0;n=((b=b+Math.imul(l,xe)|0)+(d>>>13)|0)+(Le>>>26)|0,Le&=67108863,f=Math.imul(j,G),d=(d=Math.imul(j,K))+Math.imul(N,G)|0,b=Math.imul(N,K),f=f+Math.imul(R,V)|0,d=(d=d+Math.imul(R,Z)|0)+Math.imul(T,V)|0,b=b+Math.imul(T,Z)|0,f=f+Math.imul(F,Y)|0,d=(d=d+Math.imul(F,J)|0)+Math.imul(O,Y)|0,b=b+Math.imul(O,J)|0,f=f+Math.imul(S,X)|0,d=(d=d+Math.imul(S,ee)|0)+Math.imul(C,X)|0,b=b+Math.imul(C,ee)|0,f=f+Math.imul(I,ce)|0,d=(d=d+Math.imul(I,fe)|0)+Math.imul(k,ce)|0,b=b+Math.imul(k,fe)|0,f=f+Math.imul(M,be)|0,d=(d=d+Math.imul(M,te)|0)+Math.imul(A,be)|0,b=b+Math.imul(A,te)|0,f=f+Math.imul(_,re)|0,d=(d=d+Math.imul(_,ne)|0)+Math.imul(v,re)|0,b=b+Math.imul(v,ne)|0,f=f+Math.imul(g,se)|0,d=(d=d+Math.imul(g,le)|0)+Math.imul(m,se)|0,b=b+Math.imul(m,le)|0;var Ie=(n+(f=f+Math.imul(u,ue)|0)|0)+((8191&(d=(d=d+Math.imul(u,xe)|0)+Math.imul(x,ue)|0))<<13)|0;n=((b=b+Math.imul(x,xe)|0)+(d>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,f=Math.imul(j,V),d=(d=Math.imul(j,Z))+Math.imul(N,V)|0,b=Math.imul(N,Z),f=f+Math.imul(R,Y)|0,d=(d=d+Math.imul(R,J)|0)+Math.imul(T,Y)|0,b=b+Math.imul(T,J)|0,f=f+Math.imul(F,X)|0,d=(d=d+Math.imul(F,ee)|0)+Math.imul(O,X)|0,b=b+Math.imul(O,ee)|0,f=f+Math.imul(S,ce)|0,d=(d=d+Math.imul(S,fe)|0)+Math.imul(C,ce)|0,b=b+Math.imul(C,fe)|0,f=f+Math.imul(I,be)|0,d=(d=d+Math.imul(I,te)|0)+Math.imul(k,be)|0,b=b+Math.imul(k,te)|0,f=f+Math.imul(M,re)|0,d=(d=d+Math.imul(M,ne)|0)+Math.imul(A,re)|0,b=b+Math.imul(A,ne)|0,f=f+Math.imul(_,se)|0,d=(d=d+Math.imul(_,le)|0)+Math.imul(v,se)|0,b=b+Math.imul(v,le)|0;var ke=(n+(f=f+Math.imul(g,ue)|0)|0)+((8191&(d=(d=d+Math.imul(g,xe)|0)+Math.imul(m,ue)|0))<<13)|0;n=((b=b+Math.imul(m,xe)|0)+(d>>>13)|0)+(ke>>>26)|0,ke&=67108863,f=Math.imul(j,Y),d=(d=Math.imul(j,J))+Math.imul(N,Y)|0,b=Math.imul(N,J),f=f+Math.imul(R,X)|0,d=(d=d+Math.imul(R,ee)|0)+Math.imul(T,X)|0,b=b+Math.imul(T,ee)|0,f=f+Math.imul(F,ce)|0,d=(d=d+Math.imul(F,fe)|0)+Math.imul(O,ce)|0,b=b+Math.imul(O,fe)|0,f=f+Math.imul(S,be)|0,d=(d=d+Math.imul(S,te)|0)+Math.imul(C,be)|0,b=b+Math.imul(C,te)|0,f=f+Math.imul(I,re)|0,d=(d=d+Math.imul(I,ne)|0)+Math.imul(k,re)|0,b=b+Math.imul(k,ne)|0,f=f+Math.imul(M,se)|0,d=(d=d+Math.imul(M,le)|0)+Math.imul(A,se)|0,b=b+Math.imul(A,le)|0;var Ee=(n+(f=f+Math.imul(_,ue)|0)|0)+((8191&(d=(d=d+Math.imul(_,xe)|0)+Math.imul(v,ue)|0))<<13)|0;n=((b=b+Math.imul(v,xe)|0)+(d>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,f=Math.imul(j,X),d=(d=Math.imul(j,ee))+Math.imul(N,X)|0,b=Math.imul(N,ee),f=f+Math.imul(R,ce)|0,d=(d=d+Math.imul(R,fe)|0)+Math.imul(T,ce)|0,b=b+Math.imul(T,fe)|0,f=f+Math.imul(F,be)|0,d=(d=d+Math.imul(F,te)|0)+Math.imul(O,be)|0,b=b+Math.imul(O,te)|0,f=f+Math.imul(S,re)|0,d=(d=d+Math.imul(S,ne)|0)+Math.imul(C,re)|0,b=b+Math.imul(C,ne)|0,f=f+Math.imul(I,se)|0,d=(d=d+Math.imul(I,le)|0)+Math.imul(k,se)|0,b=b+Math.imul(k,le)|0;var Se=(n+(f=f+Math.imul(M,ue)|0)|0)+((8191&(d=(d=d+Math.imul(M,xe)|0)+Math.imul(A,ue)|0))<<13)|0;n=((b=b+Math.imul(A,xe)|0)+(d>>>13)|0)+(Se>>>26)|0,Se&=67108863,f=Math.imul(j,ce),d=(d=Math.imul(j,fe))+Math.imul(N,ce)|0,b=Math.imul(N,fe),f=f+Math.imul(R,be)|0,d=(d=d+Math.imul(R,te)|0)+Math.imul(T,be)|0,b=b+Math.imul(T,te)|0,f=f+Math.imul(F,re)|0,d=(d=d+Math.imul(F,ne)|0)+Math.imul(O,re)|0,b=b+Math.imul(O,ne)|0,f=f+Math.imul(S,se)|0,d=(d=d+Math.imul(S,le)|0)+Math.imul(C,se)|0,b=b+Math.imul(C,le)|0;var Ce=(n+(f=f+Math.imul(I,ue)|0)|0)+((8191&(d=(d=d+Math.imul(I,xe)|0)+Math.imul(k,ue)|0))<<13)|0;n=((b=b+Math.imul(k,xe)|0)+(d>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,f=Math.imul(j,be),d=(d=Math.imul(j,te))+Math.imul(N,be)|0,b=Math.imul(N,te),f=f+Math.imul(R,re)|0,d=(d=d+Math.imul(R,ne)|0)+Math.imul(T,re)|0,b=b+Math.imul(T,ne)|0,f=f+Math.imul(F,se)|0,d=(d=d+Math.imul(F,le)|0)+Math.imul(O,se)|0,b=b+Math.imul(O,le)|0;var Be=(n+(f=f+Math.imul(S,ue)|0)|0)+((8191&(d=(d=d+Math.imul(S,xe)|0)+Math.imul(C,ue)|0))<<13)|0;n=((b=b+Math.imul(C,xe)|0)+(d>>>13)|0)+(Be>>>26)|0,Be&=67108863,f=Math.imul(j,re),d=(d=Math.imul(j,ne))+Math.imul(N,re)|0,b=Math.imul(N,ne),f=f+Math.imul(R,se)|0,d=(d=d+Math.imul(R,le)|0)+Math.imul(T,se)|0,b=b+Math.imul(T,le)|0;var Fe=(n+(f=f+Math.imul(F,ue)|0)|0)+((8191&(d=(d=d+Math.imul(F,xe)|0)+Math.imul(O,ue)|0))<<13)|0;n=((b=b+Math.imul(O,xe)|0)+(d>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,f=Math.imul(j,se),d=(d=Math.imul(j,le))+Math.imul(N,se)|0,b=Math.imul(N,le);var Oe=(n+(f=f+Math.imul(R,ue)|0)|0)+((8191&(d=(d=d+Math.imul(R,xe)|0)+Math.imul(T,ue)|0))<<13)|0;n=((b=b+Math.imul(T,xe)|0)+(d>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Pe=(n+(f=Math.imul(j,ue))|0)+((8191&(d=(d=Math.imul(j,xe))+Math.imul(N,ue)|0))<<13)|0;return n=((b=Math.imul(N,xe))+(d>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r[0]=pe,r[1]=ge,r[2]=me,r[3]=ye,r[4]=_e,r[5]=ve,r[6]=we,r[7]=Me,r[8]=Ae,r[9]=Le,r[10]=Ie,r[11]=ke,r[12]=Ee,r[13]=Se,r[14]=Ce,r[15]=Be,r[16]=Fe,r[17]=Oe,r[18]=Pe,0!==n&&(r[19]=n,c.length++),c};function x(e,a,c){return(new p).mulp(e,a,c)}function p(e,a){this.x=e,this.y=a}Math.imul||(u=h),b.prototype.mulTo=function(e,a){var c,f=this.length+e.length;return c=10===this.length&&10===e.length?u(this,e,a):f<63?h(this,e,a):f<1024?function(e,a,c){c.negative=a.negative^e.negative,c.length=e.length+a.length;for(var f=0,d=0,b=0;b>>26)|0)>>>26,t&=67108863}c.words[b]=i,f=t,t=d}return 0!==f?c.words[b]=f:c.length--,c.strip()}(this,e,a):x(this,e,a),c},p.prototype.makeRBT=function(e){for(var a=new Array(e),c=b.prototype._countBits(e)-1,f=0;f>=1;return f},p.prototype.permute=function(e,a,c,f,d,b){for(var t=0;t>>=1)d++;return 1<>>=13,c[2*t+1]=8191&b,b>>>=13;for(t=2*a;t>=26,a+=d/67108864|0,a+=b>>>26,this.words[c]=67108863&b}return 0!==a&&(this.words[c]=a,this.length++),this},b.prototype.muln=function(e){return this.clone().imuln(e)},b.prototype.sqr=function(){return this.mul(this)},b.prototype.isqr=function(){return this.imul(this.clone())},b.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),c=0;c>>d}return a}(e);if(0===a.length)return new b(1);for(var c=this,f=0;f=0);var a,c=e%26,d=(e-c)/26,b=67108863>>>26-c<<26-c;if(0!==c){var t=0;for(a=0;a>>26-c}t&&(this.words[a]=t,this.length++)}if(0!==d){for(a=this.length-1;a>=0;a--)this.words[a+d]=this.words[a];for(a=0;a=0),d=a?(a-a%26)/26:0;var b=e%26,t=Math.min((e-b)/26,this.length),i=67108863^67108863>>>b<t)for(this.length-=t,n=0;n=0&&(0!==o||n>=d);n--){var s=0|this.words[n];this.words[n]=o<<26-b|s>>>b,o=s&i}return r&&0!==o&&(r.words[r.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},b.prototype.ishrn=function(e,a,c){return f(0===this.negative),this.iushrn(e,a,c)},b.prototype.shln=function(e){return this.clone().ishln(e)},b.prototype.ushln=function(e){return this.clone().iushln(e)},b.prototype.shrn=function(e){return this.clone().ishrn(e)},b.prototype.ushrn=function(e){return this.clone().iushrn(e)},b.prototype.testn=function(e){f("number"==typeof e&&e>=0);var a=e%26,c=(e-a)/26,d=1<=0);var a=e%26,c=(e-a)/26;if(f(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)return this;if(0!==a&&c++,this.length=Math.min(c,this.length),0!==a){var d=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},b.prototype.isubn=function(e){if(f("number"==typeof e),f(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(r/67108864|0),this.words[d+c]=67108863&b}for(;d>26,this.words[d+c]=67108863&b;if(0===i)return this.strip();for(f(-1===i),i=0,d=0;d>26,this.words[d]=67108863&b;return this.negative=1,this.strip()},b.prototype._wordDiv=function(e,a){var c=(this.length,e.length),f=this.clone(),d=e,t=0|d.words[d.length-1];0!=(c=26-this._countBits(t))&&(d=d.ushln(c),f.iushln(c),t=0|d.words[d.length-1]);var i,r=f.length-d.length;if("mod"!==a){(i=new b(null)).length=r+1,i.words=new Array(i.length);for(var n=0;n=0;s--){var l=67108864*(0|f.words[d.length+s])+(0|f.words[d.length+s-1]);for(l=Math.min(l/t|0,67108863),f._ishlnsubmul(d,l,s);0!==f.negative;)l--,f.negative=0,f._ishlnsubmul(d,1,s),f.isZero()||(f.negative^=1);i&&(i.words[s]=l)}return i&&i.strip(),f.strip(),"div"!==a&&0!==c&&f.iushrn(c),{div:i||null,mod:f}},b.prototype.divmod=function(e,a,c){return f(!e.isZero()),this.isZero()?{div:new b(0),mod:new b(0)}:0!==this.negative&&0===e.negative?(i=this.neg().divmod(e,a),"mod"!==a&&(d=i.div.neg()),"div"!==a&&(t=i.mod.neg(),c&&0!==t.negative&&t.iadd(e)),{div:d,mod:t}):0===this.negative&&0!==e.negative?(i=this.divmod(e.neg(),a),"mod"!==a&&(d=i.div.neg()),{div:d,mod:i.mod}):this.negative&e.negative?(i=this.neg().divmod(e.neg(),a),"div"!==a&&(t=i.mod.neg(),c&&0!==t.negative&&t.isub(e)),{div:i.div,mod:t}):e.length>this.length||this.cmp(e)<0?{div:new b(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new b(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new b(this.modn(e.words[0]))}:this._wordDiv(e,a);var d,t,i},b.prototype.div=function(e){return this.divmod(e,"div",!1).div},b.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},b.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},b.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var c=0!==a.div.negative?a.mod.isub(e):a.mod,f=e.ushrn(1),d=e.andln(1),b=c.cmp(f);return b<0||1===d&&0===b?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},b.prototype.modn=function(e){f(e<=67108863);for(var a=(1<<26)%e,c=0,d=this.length-1;d>=0;d--)c=(a*c+(0|this.words[d]))%e;return c},b.prototype.idivn=function(e){f(e<=67108863);for(var a=0,c=this.length-1;c>=0;c--){var d=(0|this.words[c])+67108864*a;this.words[c]=d/e|0,a=d%e}return this.strip()},b.prototype.divn=function(e){return this.clone().idivn(e)},b.prototype.egcd=function(e){f(0===e.negative),f(!e.isZero());var a=this,c=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var d=new b(1),t=new b(0),i=new b(0),r=new b(1),n=0;a.isEven()&&c.isEven();)a.iushrn(1),c.iushrn(1),++n;for(var o=c.clone(),s=a.clone();!a.isZero();){for(var l=0,h=1;!(a.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(d.isOdd()||t.isOdd())&&(d.iadd(o),t.isub(s)),d.iushrn(1),t.iushrn(1);for(var u=0,x=1;!(c.words[0]&x)&&u<26;++u,x<<=1);if(u>0)for(c.iushrn(u);u-- >0;)(i.isOdd()||r.isOdd())&&(i.iadd(o),r.isub(s)),i.iushrn(1),r.iushrn(1);a.cmp(c)>=0?(a.isub(c),d.isub(i),t.isub(r)):(c.isub(a),i.isub(d),r.isub(t))}return{a:i,b:r,gcd:c.iushln(n)}},b.prototype._invmp=function(e){f(0===e.negative),f(!e.isZero());var a=this,c=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var d,t=new b(1),i=new b(0),r=c.clone();a.cmpn(1)>0&&c.cmpn(1)>0;){for(var n=0,o=1;!(a.words[0]&o)&&n<26;++n,o<<=1);if(n>0)for(a.iushrn(n);n-- >0;)t.isOdd()&&t.iadd(r),t.iushrn(1);for(var s=0,l=1;!(c.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(c.iushrn(s);s-- >0;)i.isOdd()&&i.iadd(r),i.iushrn(1);a.cmp(c)>=0?(a.isub(c),t.isub(i)):(c.isub(a),i.isub(t))}return(d=0===a.cmpn(1)?t:i).cmpn(0)<0&&d.iadd(e),d},b.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),c=e.clone();a.negative=0,c.negative=0;for(var f=0;a.isEven()&&c.isEven();f++)a.iushrn(1),c.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=a.cmp(c);if(d<0){var b=a;a=c,c=b}else if(0===d||0===c.cmpn(1))break;a.isub(c)}return c.iushln(f)},b.prototype.invm=function(e){return this.egcd(e).a.umod(e)},b.prototype.isEven=function(){return!(1&this.words[0])},b.prototype.isOdd=function(){return!(1&~this.words[0])},b.prototype.andln=function(e){return this.words[0]&e},b.prototype.bincn=function(e){f("number"==typeof e);var a=e%26,c=(e-a)/26,d=1<>>26,i&=67108863,this.words[t]=i}return 0!==b&&(this.words[t]=b,this.length++),this},b.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},b.prototype.cmpn=function(e){var a,c=e<0;if(0!==this.negative&&!c)return-1;if(0===this.negative&&c)return 1;if(this.strip(),this.length>1)a=1;else{c&&(e=-e),f(e<=67108863,"Number is too big");var d=0|this.words[0];a=d===e?0:de.length)return 1;if(this.length=0;c--){var f=0|this.words[c],d=0|e.words[c];if(f!==d){fd&&(a=1);break}}return a},b.prototype.gtn=function(e){return 1===this.cmpn(e)},b.prototype.gt=function(e){return 1===this.cmp(e)},b.prototype.gten=function(e){return this.cmpn(e)>=0},b.prototype.gte=function(e){return this.cmp(e)>=0},b.prototype.ltn=function(e){return-1===this.cmpn(e)},b.prototype.lt=function(e){return-1===this.cmp(e)},b.prototype.lten=function(e){return this.cmpn(e)<=0},b.prototype.lte=function(e){return this.cmp(e)<=0},b.prototype.eqn=function(e){return 0===this.cmpn(e)},b.prototype.eq=function(e){return 0===this.cmp(e)},b.red=function(e){return new M(e)},b.prototype.toRed=function(e){return f(!this.red,"Already a number in reduction context"),f(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},b.prototype.fromRed=function(){return f(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},b.prototype._forceRed=function(e){return this.red=e,this},b.prototype.forceRed=function(e){return f(!this.red,"Already a number in reduction context"),this._forceRed(e)},b.prototype.redAdd=function(e){return f(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},b.prototype.redIAdd=function(e){return f(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},b.prototype.redSub=function(e){return f(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},b.prototype.redISub=function(e){return f(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},b.prototype.redShl=function(e){return f(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},b.prototype.redMul=function(e){return f(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},b.prototype.redIMul=function(e){return f(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},b.prototype.redSqr=function(){return f(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},b.prototype.redISqr=function(){return f(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},b.prototype.redSqrt=function(){return f(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},b.prototype.redInvm=function(){return f(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},b.prototype.redNeg=function(){return f(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},b.prototype.redPow=function(e){return f(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function m(e,a){this.name=e,this.p=new b(a,16),this.n=this.p.bitLength(),this.k=new b(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var a=b._prime(e);this.m=a.p,this.prime=a}else f(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new b(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)}m.prototype._tmp=function(){var e=new b(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var a,c=e;do{this.split(c,this.tmp),a=(c=(c=this.imulK(c)).iadd(this.tmp)).bitLength()}while(a>this.n);var f=a0?c.isub(this.p):void 0!==c.strip?c.strip():c._strip(),c},m.prototype.split=function(e,a){e.iushrn(this.n,0,a)},m.prototype.imulK=function(e){return e.imul(this.k)},d(y,m),y.prototype.split=function(e,a){for(var c=4194303,f=Math.min(e.length,9),d=0;d>>22,b=t}b>>>=22,e.words[d-10]=b,0===b&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,c=0;c>>=26,e.words[c]=d,a=f}return 0!==a&&(e.words[e.length++]=a),e},b._prime=function(e){if(g[e])return g[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new _;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return g[e]=a,a},M.prototype._verify1=function(e){f(0===e.negative,"red works only with positives"),f(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,a){f(!(e.negative|a.negative),"red works only with positives"),f(e.red&&e.red===a.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,a){this._verify2(e,a);var c=e.add(a);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},M.prototype.iadd=function(e,a){this._verify2(e,a);var c=e.iadd(a);return c.cmp(this.m)>=0&&c.isub(this.m),c},M.prototype.sub=function(e,a){this._verify2(e,a);var c=e.sub(a);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},M.prototype.isub=function(e,a){this._verify2(e,a);var c=e.isub(a);return c.cmpn(0)<0&&c.iadd(this.m),c},M.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},M.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},M.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(f(a%2==1),3===a){var c=this.m.add(new b(1)).iushrn(2);return this.pow(e,c)}for(var d=this.m.subn(1),t=0;!d.isZero()&&0===d.andln(1);)t++,d.iushrn(1);f(!d.isZero());var i=new b(1).toRed(this),r=i.redNeg(),n=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new b(2*o*o).toRed(this);0!==this.pow(o,n).cmp(r);)o.redIAdd(r);for(var s=this.pow(o,d),l=this.pow(e,d.addn(1).iushrn(1)),h=this.pow(e,d),u=t;0!==h.cmp(i);){for(var x=h,p=0;0!==x.cmp(i);p++)x=x.redSqr();f(p=0;f--){for(var n=a.words[f],o=r-1;o>=0;o--){var s=n>>o&1;d!==c[0]&&(d=this.sqr(d)),0!==s||0!==t?(t<<=1,t|=s,(4==++i||0===f&&0===o)&&(d=this.mul(d,c[t]),i=0,t=0)):i=0}r=26}return d},M.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},M.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},b.mont=function(e){return new A(e)},d(A,M),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},A.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var c=e.imul(a),f=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(f).iushrn(this.shift),b=d;return d.cmp(this.m)>=0?b=d.isub(this.m):d.cmpn(0)<0&&(b=d.iadd(this.m)),b._forceRed(this)},A.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new b(0)._forceRed(this);var c=e.mul(a),f=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(f).iushrn(this.shift),t=d;return d.cmp(this.m)>=0?t=d.isub(this.m):d.cmpn(0)<0&&(t=d.iadd(this.m)),t._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=c.nmd(e),this)},655:(e,a,c)=>{"use strict";var f=c(453)("%Object.defineProperty%",!0)||!1;if(f)try{f({},"a",{value:1})}catch(e){f=!1}e.exports=f},1237:e=>{"use strict";e.exports=EvalError},9383:e=>{"use strict";e.exports=Error},9290:e=>{"use strict";e.exports=RangeError},9538:e=>{"use strict";e.exports=ReferenceError},8068:e=>{"use strict";e.exports=SyntaxError},9675:e=>{"use strict";e.exports=TypeError},5345:e=>{"use strict";e.exports=URIError},7007:e=>{"use strict";var a,c="object"==typeof Reflect?Reflect:null,f=c&&"function"==typeof c.apply?c.apply:function(e,a,c){return Function.prototype.apply.call(e,a,c)};a=c&&"function"==typeof c.ownKeys?c.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var d=Number.isNaN||function(e){return e!=e};function b(){b.init.call(this)}e.exports=b,e.exports.once=function(e,a){return new Promise((function(c,f){function d(c){e.removeListener(a,b),f(c)}function b(){"function"==typeof e.removeListener&&e.removeListener("error",d),c([].slice.call(arguments))}x(e,a,b,{once:!0}),"error"!==a&&function(e,a){"function"==typeof e.on&&x(e,"error",a,{once:!0})}(e,d)}))},b.EventEmitter=b,b.prototype._events=void 0,b.prototype._eventsCount=0,b.prototype._maxListeners=void 0;var t=10;function i(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function r(e){return void 0===e._maxListeners?b.defaultMaxListeners:e._maxListeners}function n(e,a,c,f){var d,b,t,n;if(i(c),void 0===(b=e._events)?(b=e._events=Object.create(null),e._eventsCount=0):(void 0!==b.newListener&&(e.emit("newListener",a,c.listener?c.listener:c),b=e._events),t=b[a]),void 0===t)t=b[a]=c,++e._eventsCount;else if("function"==typeof t?t=b[a]=f?[c,t]:[t,c]:f?t.unshift(c):t.push(c),(d=r(e))>0&&t.length>d&&!t.warned){t.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+t.length+" "+String(a)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=e,o.type=a,o.count=t.length,n=o,console&&console.warn&&console.warn(n)}return e}function o(){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 s(e,a,c){var f={fired:!1,wrapFn:void 0,target:e,type:a,listener:c},d=o.bind(f);return d.listener=c,f.wrapFn=d,d}function l(e,a,c){var f=e._events;if(void 0===f)return[];var d=f[a];return void 0===d?[]:"function"==typeof d?c?[d.listener||d]:[d]:c?function(e){for(var a=new Array(e.length),c=0;c0&&(t=a[0]),t instanceof Error)throw t;var i=new Error("Unhandled error."+(t?" ("+t.message+")":""));throw i.context=t,i}var r=b[e];if(void 0===r)return!1;if("function"==typeof r)f(r,this,a);else{var n=r.length,o=u(r,n);for(c=0;c=0;b--)if(c[b]===a||c[b].listener===a){t=c[b].listener,d=b;break}if(d<0)return this;0===d?c.shift():function(e,a){for(;a+1=0;f--)this.removeListener(e,a[f]);return this},b.prototype.listeners=function(e){return l(this,e,!0)},b.prototype.rawListeners=function(e){return l(this,e,!1)},b.listenerCount=function(e,a){return"function"==typeof e.listenerCount?e.listenerCount(a):h.call(e,a)},b.prototype.listenerCount=h,b.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},8078:(e,a,c)=>{var f=c(2861).Buffer,d=c(8276);e.exports=function(e,a,c,b){if(f.isBuffer(e)||(e=f.from(e,"binary")),a&&(f.isBuffer(a)||(a=f.from(a,"binary")),8!==a.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var t=c/8,i=f.alloc(t),r=f.alloc(b||0),n=f.alloc(0);t>0||b>0;){var o=new d;o.update(n),o.update(e),a&&o.update(a),n=o.digest();var s=0;if(t>0){var l=i.length-t;s=Math.min(t,n.length),n.copy(i,l,0,s),t-=s}if(s0){var h=r.length-b,u=Math.min(b,n.length-s);n.copy(r,h,s,s+u),b-=u}}return n.fill(0),{key:i,iv:r}}},2682:(e,a,c)=>{"use strict";var f=c(9600),d=Object.prototype.toString,b=Object.prototype.hasOwnProperty;e.exports=function(e,a,c){if(!f(a))throw new TypeError("iterator must be a function");var t;arguments.length>=3&&(t=c),"[object Array]"===d.call(e)?function(e,a,c){for(var f=0,d=e.length;f{"use strict";var a=Object.prototype.toString,c=Math.max,f=function(e,a){for(var c=[],f=0;f{"use strict";var f=c(9353);e.exports=Function.prototype.bind||f},453:(e,a,c)=>{"use strict";var f,d=c(9383),b=c(1237),t=c(9290),i=c(9538),r=c(8068),n=c(9675),o=c(5345),s=Function,l=function(e){try{return s('"use strict"; return ('+e+").constructor;")()}catch(e){}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch(e){h=null}var u=function(){throw new n},x=h?function(){try{return u}catch(e){try{return h(arguments,"callee").get}catch(e){return u}}}():u,p=c(4039)(),g=c(24)(),m=Object.getPrototypeOf||(g?function(e){return e.__proto__}:null),y={},_="undefined"!=typeof Uint8Array&&m?m(Uint8Array):f,v={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?f:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?f:ArrayBuffer,"%ArrayIteratorPrototype%":p&&m?m([][Symbol.iterator]()):f,"%AsyncFromSyncIteratorPrototype%":f,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":"undefined"==typeof Atomics?f:Atomics,"%BigInt%":"undefined"==typeof BigInt?f:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?f:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?f:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?f:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":d,"%eval%":eval,"%EvalError%":b,"%Float32Array%":"undefined"==typeof Float32Array?f:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?f:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?f:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":y,"%Int8Array%":"undefined"==typeof Int8Array?f:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?f:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?f:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p&&m?m(m([][Symbol.iterator]())):f,"%JSON%":"object"==typeof JSON?JSON:f,"%Map%":"undefined"==typeof Map?f:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&p&&m?m((new Map)[Symbol.iterator]()):f,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?f:Promise,"%Proxy%":"undefined"==typeof Proxy?f:Proxy,"%RangeError%":t,"%ReferenceError%":i,"%Reflect%":"undefined"==typeof Reflect?f:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?f:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&p&&m?m((new Set)[Symbol.iterator]()):f,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?f:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p&&m?m(""[Symbol.iterator]()):f,"%Symbol%":p?Symbol:f,"%SyntaxError%":r,"%ThrowTypeError%":x,"%TypedArray%":_,"%TypeError%":n,"%Uint8Array%":"undefined"==typeof Uint8Array?f:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?f:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?f:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?f:Uint32Array,"%URIError%":o,"%WeakMap%":"undefined"==typeof WeakMap?f:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?f:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?f:WeakSet};if(m)try{null.error}catch(e){var w=m(m(e));v["%Error.prototype%"]=w}var M=function e(a){var c;if("%AsyncFunction%"===a)c=l("async function () {}");else if("%GeneratorFunction%"===a)c=l("function* () {}");else if("%AsyncGeneratorFunction%"===a)c=l("async function* () {}");else if("%AsyncGenerator%"===a){var f=e("%AsyncGeneratorFunction%");f&&(c=f.prototype)}else if("%AsyncIteratorPrototype%"===a){var d=e("%AsyncGenerator%");d&&m&&(c=m(d.prototype))}return v[a]=c,c},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},L=c(6743),I=c(9957),k=L.call(Function.call,Array.prototype.concat),E=L.call(Function.apply,Array.prototype.splice),S=L.call(Function.call,String.prototype.replace),C=L.call(Function.call,String.prototype.slice),B=L.call(Function.call,RegExp.prototype.exec),F=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,O=/\\(\\)?/g,P=function(e,a){var c,f=e;if(I(A,f)&&(f="%"+(c=A[f])[0]+"%"),I(v,f)){var d=v[f];if(d===y&&(d=M(f)),void 0===d&&!a)throw new n("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:c,name:f,value:d}}throw new r("intrinsic "+e+" does not exist!")};e.exports=function(e,a){if("string"!=typeof e||0===e.length)throw new n("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof a)throw new n('"allowMissing" argument must be a boolean');if(null===B(/^%?[^%]*%?$/,e))throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var c=function(e){var a=C(e,0,1),c=C(e,-1);if("%"===a&&"%"!==c)throw new r("invalid intrinsic syntax, expected closing `%`");if("%"===c&&"%"!==a)throw new r("invalid intrinsic syntax, expected opening `%`");var f=[];return S(e,F,(function(e,a,c,d){f[f.length]=c?S(d,O,"$1"):a||e})),f}(e),f=c.length>0?c[0]:"",d=P("%"+f+"%",a),b=d.name,t=d.value,i=!1,o=d.alias;o&&(f=o[0],E(c,k([0,1],o)));for(var s=1,l=!0;s=c.length){var g=h(t,u);t=(l=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:t[u]}else l=I(t,u),t=t[u];l&&!i&&(v[b]=t)}}return t}},5795:(e,a,c)=>{"use strict";var f=c(453)("%Object.getOwnPropertyDescriptor%",!0);if(f)try{f([],"length")}catch(e){f=null}e.exports=f},592:(e,a,c)=>{"use strict";var f=c(655),d=function(){return!!f};d.hasArrayLengthDefineBug=function(){if(!f)return null;try{return 1!==f([],"length",{value:1}).length}catch(e){return!0}},e.exports=d},24:e=>{"use strict";var a={__proto__:null,foo:{}},c=Object;e.exports=function(){return{__proto__:a}.foo===a.foo&&!(a instanceof c)}},4039:(e,a,c)=>{"use strict";var f="undefined"!=typeof Symbol&&Symbol,d=c(1333);e.exports=function(){return"function"==typeof f&&"function"==typeof Symbol&&"symbol"==typeof f("foo")&&"symbol"==typeof Symbol("bar")&&d()}},1333:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},a=Symbol("test"),c=Object(a);if("string"==typeof a)return!1;if("[object Symbol]"!==Object.prototype.toString.call(a))return!1;if("[object Symbol]"!==Object.prototype.toString.call(c))return!1;for(a in e[a]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var f=Object.getOwnPropertySymbols(e);if(1!==f.length||f[0]!==a)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,a))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var d=Object.getOwnPropertyDescriptor(e,a);if(42!==d.value||!0!==d.enumerable)return!1}return!0}},9092:(e,a,c)=>{"use strict";var f=c(1333);e.exports=function(){return f()&&!!Symbol.toStringTag}},7952:(e,a,c)=>{var f=a;f.utils=c(7426),f.common=c(6166),f.sha=c(6229),f.ripemd=c(6784),f.hmac=c(8948),f.sha1=f.sha.sha1,f.sha256=f.sha.sha256,f.sha224=f.sha.sha224,f.sha384=f.sha.sha384,f.sha512=f.sha.sha512,f.ripemd160=f.ripemd.ripemd160},6166:(e,a,c)=>{"use strict";var f=c(7426),d=c(3349);function b(){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}a.BlockHash=b,b.prototype.update=function(e,a){if(e=f.toArray(e,a),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var c=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-c,e.length),0===this.pending.length&&(this.pending=null),e=f.join32(e,0,e.length-c,this.endian);for(var d=0;d>>24&255,f[d++]=e>>>16&255,f[d++]=e>>>8&255,f[d++]=255&e}else for(f[d++]=255&e,f[d++]=e>>>8&255,f[d++]=e>>>16&255,f[d++]=e>>>24&255,f[d++]=0,f[d++]=0,f[d++]=0,f[d++]=0,b=8;b{"use strict";var f=c(7426),d=c(3349);function b(e,a,c){if(!(this instanceof b))return new b(e,a,c);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(f.toArray(a,c))}e.exports=b,b.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),d(e.length<=this.blockSize);for(var a=e.length;a{"use strict";var f=c(7426),d=c(6166),b=f.rotl32,t=f.sum32,i=f.sum32_3,r=f.sum32_4,n=d.BlockHash;function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function s(e,a,c,f){return e<=15?a^c^f:e<=31?a&c|~a&f:e<=47?(a|~c)^f:e<=63?a&f|c&~f:a^(c|~f)}function l(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}f.inherits(o,n),a.ripemd160=o,o.blockSize=512,o.outSize=160,o.hmacStrength=192,o.padLength=64,o.prototype._update=function(e,a){for(var c=this.h[0],f=this.h[1],d=this.h[2],n=this.h[3],o=this.h[4],m=c,y=f,_=d,v=n,w=o,M=0;M<80;M++){var A=t(b(r(c,s(M,f,d,n),e[u[M]+a],l(M)),p[M]),o);c=o,o=n,n=b(d,10),d=f,f=A,A=t(b(r(m,s(79-M,y,_,v),e[x[M]+a],h(M)),g[M]),w),m=w,w=v,v=b(_,10),_=y,y=A}A=i(this.h[1],d,v),this.h[1]=i(this.h[2],n,w),this.h[2]=i(this.h[3],o,m),this.h[3]=i(this.h[4],c,y),this.h[4]=i(this.h[0],f,_),this.h[0]=A},o.prototype._digest=function(e){return"hex"===e?f.toHex32(this.h,"little"):f.split32(this.h,"little")};var u=[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],x=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],p=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},6229:(e,a,c)=>{"use strict";a.sha1=c(3917),a.sha224=c(7714),a.sha256=c(2287),a.sha384=c(1911),a.sha512=c(7766)},3917:(e,a,c)=>{"use strict";var f=c(7426),d=c(6166),b=c(6225),t=f.rotl32,i=f.sum32,r=f.sum32_5,n=b.ft_1,o=d.BlockHash,s=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;o.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}f.inherits(l,o),e.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(e,a){for(var c=this.W,f=0;f<16;f++)c[f]=e[a+f];for(;f{"use strict";var f=c(7426),d=c(2287);function b(){if(!(this instanceof b))return new b;d.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}f.inherits(b,d),e.exports=b,b.blockSize=512,b.outSize=224,b.hmacStrength=192,b.padLength=64,b.prototype._digest=function(e){return"hex"===e?f.toHex32(this.h.slice(0,7),"big"):f.split32(this.h.slice(0,7),"big")}},2287:(e,a,c)=>{"use strict";var f=c(7426),d=c(6166),b=c(6225),t=c(3349),i=f.sum32,r=f.sum32_4,n=f.sum32_5,o=b.ch32,s=b.maj32,l=b.s0_256,h=b.s1_256,u=b.g0_256,x=b.g1_256,p=d.BlockHash,g=[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 m(){if(!(this instanceof m))return new m;p.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}f.inherits(m,p),e.exports=m,m.blockSize=512,m.outSize=256,m.hmacStrength=192,m.padLength=64,m.prototype._update=function(e,a){for(var c=this.W,f=0;f<16;f++)c[f]=e[a+f];for(;f{"use strict";var f=c(7426),d=c(7766);function b(){if(!(this instanceof b))return new b;d.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}f.inherits(b,d),e.exports=b,b.blockSize=1024,b.outSize=384,b.hmacStrength=192,b.padLength=128,b.prototype._digest=function(e){return"hex"===e?f.toHex32(this.h.slice(0,12),"big"):f.split32(this.h.slice(0,12),"big")}},7766:(e,a,c)=>{"use strict";var f=c(7426),d=c(6166),b=c(3349),t=f.rotr64_hi,i=f.rotr64_lo,r=f.shr64_hi,n=f.shr64_lo,o=f.sum64,s=f.sum64_hi,l=f.sum64_lo,h=f.sum64_4_hi,u=f.sum64_4_lo,x=f.sum64_5_hi,p=f.sum64_5_lo,g=d.BlockHash,m=[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;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=m,this.W=new Array(160)}function _(e,a,c,f,d){var b=e&c^~e&d;return b<0&&(b+=4294967296),b}function v(e,a,c,f,d,b){var t=a&f^~a&b;return t<0&&(t+=4294967296),t}function w(e,a,c,f,d){var b=e&c^e&d^c&d;return b<0&&(b+=4294967296),b}function M(e,a,c,f,d,b){var t=a&f^a&b^f&b;return t<0&&(t+=4294967296),t}function A(e,a){var c=t(e,a,28)^t(a,e,2)^t(a,e,7);return c<0&&(c+=4294967296),c}function L(e,a){var c=i(e,a,28)^i(a,e,2)^i(a,e,7);return c<0&&(c+=4294967296),c}function I(e,a){var c=i(e,a,14)^i(e,a,18)^i(a,e,9);return c<0&&(c+=4294967296),c}function k(e,a){var c=t(e,a,1)^t(e,a,8)^r(e,a,7);return c<0&&(c+=4294967296),c}function E(e,a){var c=i(e,a,1)^i(e,a,8)^n(e,a,7);return c<0&&(c+=4294967296),c}function S(e,a){var c=i(e,a,19)^i(a,e,29)^n(e,a,6);return c<0&&(c+=4294967296),c}f.inherits(y,g),e.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(e,a){for(var c=this.W,f=0;f<32;f++)c[f]=e[a+f];for(;f{"use strict";var f=c(7426).rotr32;function d(e,a,c){return e&a^~e&c}function b(e,a,c){return e&a^e&c^a&c}function t(e,a,c){return e^a^c}a.ft_1=function(e,a,c,f){return 0===e?d(a,c,f):1===e||3===e?t(a,c,f):2===e?b(a,c,f):void 0},a.ch32=d,a.maj32=b,a.p32=t,a.s0_256=function(e){return f(e,2)^f(e,13)^f(e,22)},a.s1_256=function(e){return f(e,6)^f(e,11)^f(e,25)},a.g0_256=function(e){return f(e,7)^f(e,18)^e>>>3},a.g1_256=function(e){return f(e,17)^f(e,19)^e>>>10}},7426:(e,a,c)=>{"use strict";var f=c(3349),d=c(6698);function b(e,a){return 55296==(64512&e.charCodeAt(a))&&!(a<0||a+1>=e.length)&&56320==(64512&e.charCodeAt(a+1))}function t(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function i(e){return 1===e.length?"0"+e:e}function r(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}a.inherits=d,a.toArray=function(e,a){if(Array.isArray(e))return e.slice();if(!e)return[];var c=[];if("string"==typeof e)if(a){if("hex"===a)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),d=0;d>6|192,c[f++]=63&t|128):b(e,d)?(t=65536+((1023&t)<<10)+(1023&e.charCodeAt(++d)),c[f++]=t>>18|240,c[f++]=t>>12&63|128,c[f++]=t>>6&63|128,c[f++]=63&t|128):(c[f++]=t>>12|224,c[f++]=t>>6&63|128,c[f++]=63&t|128)}else for(d=0;d>>0}return t},a.split32=function(e,a){for(var c=new Array(4*e.length),f=0,d=0;f>>24,c[d+1]=b>>>16&255,c[d+2]=b>>>8&255,c[d+3]=255&b):(c[d+3]=b>>>24,c[d+2]=b>>>16&255,c[d+1]=b>>>8&255,c[d]=255&b)}return c},a.rotr32=function(e,a){return e>>>a|e<<32-a},a.rotl32=function(e,a){return e<>>32-a},a.sum32=function(e,a){return e+a>>>0},a.sum32_3=function(e,a,c){return e+a+c>>>0},a.sum32_4=function(e,a,c,f){return e+a+c+f>>>0},a.sum32_5=function(e,a,c,f,d){return e+a+c+f+d>>>0},a.sum64=function(e,a,c,f){var d=e[a],b=f+e[a+1]>>>0,t=(b>>0,e[a+1]=b},a.sum64_hi=function(e,a,c,f){return(a+f>>>0>>0},a.sum64_lo=function(e,a,c,f){return a+f>>>0},a.sum64_4_hi=function(e,a,c,f,d,b,t,i){var r=0,n=a;return r+=(n=n+f>>>0)>>0)>>0)>>0},a.sum64_4_lo=function(e,a,c,f,d,b,t,i){return a+f+b+i>>>0},a.sum64_5_hi=function(e,a,c,f,d,b,t,i,r,n){var o=0,s=a;return o+=(s=s+f>>>0)>>0)>>0)>>0)>>0},a.sum64_5_lo=function(e,a,c,f,d,b,t,i,r,n){return a+f+b+i+n>>>0},a.rotr64_hi=function(e,a,c){return(a<<32-c|e>>>c)>>>0},a.rotr64_lo=function(e,a,c){return(e<<32-c|a>>>c)>>>0},a.shr64_hi=function(e,a,c){return e>>>c},a.shr64_lo=function(e,a,c){return(e<<32-c|a>>>c)>>>0}},9957:(e,a,c)=>{"use strict";var f=Function.prototype.call,d=Object.prototype.hasOwnProperty,b=c(6743);e.exports=b.call(f,d)},2723:(e,a,c)=>{"use strict";var f=c(7952),d=c(4367),b=c(3349);function t(e){if(!(this instanceof t))return new t(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var a=d.toArray(e.entropy,e.entropyEnc||"hex"),c=d.toArray(e.nonce,e.nonceEnc||"hex"),f=d.toArray(e.pers,e.persEnc||"hex");b(a.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(a,c,f)}e.exports=t,t.prototype._init=function(e,a,c){var f=e.concat(a).concat(c);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var d=0;d=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(c||[])),this._reseed=1},t.prototype.generate=function(e,a,c,f){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof a&&(f=c,c=a,a=null),c&&(c=d.toArray(c,f||"hex"),this._update(c));for(var b=[];b.length{a.read=function(e,a,c,f,d){var b,t,i=8*d-f-1,r=(1<>1,o=-7,s=c?d-1:0,l=c?-1:1,h=e[a+s];for(s+=l,b=h&(1<<-o)-1,h>>=-o,o+=i;o>0;b=256*b+e[a+s],s+=l,o-=8);for(t=b&(1<<-o)-1,b>>=-o,o+=f;o>0;t=256*t+e[a+s],s+=l,o-=8);if(0===b)b=1-n;else{if(b===r)return t?NaN:1/0*(h?-1:1);t+=Math.pow(2,f),b-=n}return(h?-1:1)*t*Math.pow(2,b-f)},a.write=function(e,a,c,f,d,b){var t,i,r,n=8*b-d-1,o=(1<>1,l=23===d?Math.pow(2,-24)-Math.pow(2,-77):0,h=f?0:b-1,u=f?1:-1,x=a<0||0===a&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(i=isNaN(a)?1:0,t=o):(t=Math.floor(Math.log(a)/Math.LN2),a*(r=Math.pow(2,-t))<1&&(t--,r*=2),(a+=t+s>=1?l/r:l*Math.pow(2,1-s))*r>=2&&(t++,r/=2),t+s>=o?(i=0,t=o):t+s>=1?(i=(a*r-1)*Math.pow(2,d),t+=s):(i=a*Math.pow(2,s-1)*Math.pow(2,d),t=0));d>=8;e[c+h]=255&i,h+=u,i/=256,d-=8);for(t=t<0;e[c+h]=255&t,h+=u,t/=256,n-=8);e[c+h-u]|=128*x}},6698:e=>{"function"==typeof Object.create?e.exports=function(e,a){a&&(e.super_=a,e.prototype=Object.create(a.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,a){if(a){e.super_=a;var c=function(){};c.prototype=a.prototype,e.prototype=new c,e.prototype.constructor=e}}},7244:(e,a,c)=>{"use strict";var f=c(9092)(),d=c(8075)("Object.prototype.toString"),b=function(e){return!(f&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===d(e)},t=function(e){return!!b(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==d(e)&&"[object Function]"===d(e.callee)},i=function(){return b(arguments)}();b.isLegacyArguments=t,e.exports=i?b:t},9600:e=>{"use strict";var a,c,f=Function.prototype.toString,d="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof d&&"function"==typeof Object.defineProperty)try{a=Object.defineProperty({},"length",{get:function(){throw c}}),c={},d((function(){throw 42}),null,a)}catch(e){e!==c&&(d=null)}else d=null;var b=/^\s*class\b/,t=function(e){try{var a=f.call(e);return b.test(a)}catch(e){return!1}},i=function(e){try{return!t(e)&&(f.call(e),!0)}catch(e){return!1}},r=Object.prototype.toString,n="function"==typeof Symbol&&!!Symbol.toStringTag,o=!(0 in[,]),s=function(){return!1};if("object"==typeof document){var l=document.all;r.call(l)===r.call(document.all)&&(s=function(e){if((o||!e)&&(void 0===e||"object"==typeof e))try{var a=r.call(e);return("[object HTMLAllCollection]"===a||"[object HTML document.all class]"===a||"[object HTMLCollection]"===a||"[object Object]"===a)&&null==e("")}catch(e){}return!1})}e.exports=d?function(e){if(s(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{d(e,null,a)}catch(e){if(e!==c)return!1}return!t(e)&&i(e)}:function(e){if(s(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(n)return i(e);if(t(e))return!1;var a=r.call(e);return!("[object Function]"!==a&&"[object GeneratorFunction]"!==a&&!/^\[object HTML/.test(a))&&i(e)}},8184:(e,a,c)=>{"use strict";var f,d=Object.prototype.toString,b=Function.prototype.toString,t=/^\s*(?:function)?\*/,i=c(9092)(),r=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(t.test(b.call(e)))return!0;if(!i)return"[object GeneratorFunction]"===d.call(e);if(!r)return!1;if(void 0===f){var a=function(){if(!i)return!1;try{return Function("return function*() {}")()}catch(e){}}();f=!!a&&r(a)}return r(e)===f}},3003:e=>{"use strict";e.exports=function(e){return e!=e}},4133:(e,a,c)=>{"use strict";var f=c(487),d=c(8452),b=c(3003),t=c(6642),i=c(2464),r=f(t(),Number);d(r,{getPolyfill:t,implementation:b,shim:i}),e.exports=r},6642:(e,a,c)=>{"use strict";var f=c(3003);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:f}},2464:(e,a,c)=>{"use strict";var f=c(8452),d=c(6642);e.exports=function(){var e=d();return f(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},5680:(e,a,c)=>{"use strict";var f=c(5767);e.exports=function(e){return!!f(e)}},8127:function(e,a,c){var f=c(2045).hp;"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==c.g&&c.g,e.exports=function(){"use strict";var e,a="3.7.7",c=a,d="function"==typeof f,b="function"==typeof TextDecoder?new TextDecoder:void 0,t="function"==typeof TextEncoder?new TextEncoder:void 0,i=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),r=(e={},i.forEach((function(a,c){return e[a]=c})),e),n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,o=String.fromCharCode.bind(String),s="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):function(e){return new Uint8Array(Array.prototype.slice.call(e,0))},l=function(e){return e.replace(/=/g,"").replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"}))},h=function(e){return e.replace(/[^A-Za-z0-9\+\/]/g,"")},u=function(e){for(var a,c,f,d,b="",t=e.length%3,r=0;r255||(f=e.charCodeAt(r++))>255||(d=e.charCodeAt(r++))>255)throw new TypeError("invalid character found");b+=i[(a=c<<16|f<<8|d)>>18&63]+i[a>>12&63]+i[a>>6&63]+i[63&a]}return t?b.slice(0,t-3)+"===".substring(t):b},x="function"==typeof btoa?function(e){return btoa(e)}:d?function(e){return f.from(e,"binary").toString("base64")}:u,p=d?function(e){return f.from(e).toString("base64")}:function(e){for(var a=[],c=0,f=e.length;c>>6)+o(128|63&a):o(224|a>>>12&15)+o(128|a>>>6&63)+o(128|63&a);var a=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return o(240|a>>>18&7)+o(128|a>>>12&63)+o(128|a>>>6&63)+o(128|63&a)},y=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,_=function(e){return e.replace(y,m)},v=d?function(e){return f.from(e,"utf8").toString("base64")}:t?function(e){return p(t.encode(e))}:function(e){return x(_(e))},w=function(e,a){return void 0===a&&(a=!1),a?l(v(e)):v(e)},M=function(e){return w(e,!0)},A=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,L=function(e){switch(e.length){case 4:var a=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return o(55296+(a>>>10))+o(56320+(1023&a));case 3:return o((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return o((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},I=function(e){return e.replace(A,L)},k=function(e){if(e=e.replace(/\s+/g,""),!n.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));for(var a,c,f,d="",b=0;b>16&255):64===f?o(a>>16&255,a>>8&255):o(a>>16&255,a>>8&255,255&a);return d},E="function"==typeof atob?function(e){return atob(h(e))}:d?function(e){return f.from(e,"base64").toString("binary")}:k,S=d?function(e){return s(f.from(e,"base64"))}:function(e){return s(E(e).split("").map((function(e){return e.charCodeAt(0)})))},C=function(e){return S(F(e))},B=d?function(e){return f.from(e,"base64").toString("utf8")}:b?function(e){return b.decode(S(e))}:function(e){return I(E(e))},F=function(e){return h(e.replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})))},O=function(e){return B(F(e))},P=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}},R=function(){var e=function(e,a){return Object.defineProperty(String.prototype,e,P(a))};e("fromBase64",(function(){return O(this)})),e("toBase64",(function(e){return w(this,e)})),e("toBase64URI",(function(){return w(this,!0)})),e("toBase64URL",(function(){return w(this,!0)})),e("toUint8Array",(function(){return C(this)}))},T=function(){var e=function(e,a){return Object.defineProperty(Uint8Array.prototype,e,P(a))};e("toBase64",(function(e){return g(this,e)})),e("toBase64URI",(function(){return g(this,!0)})),e("toBase64URL",(function(){return g(this,!0)}))},U={version:a,VERSION:c,atob:E,atobPolyfill:k,btoa:x,btoaPolyfill:u,fromBase64:O,toBase64:w,encode:w,encodeURI:M,encodeURL:M,utob:_,btou:I,decode:O,isValid:function(e){if("string"!=typeof e)return!1;var a=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(a)||!/[^\s0-9a-zA-Z\-_]/.test(a)},fromUint8Array:g,toUint8Array:C,extendString:R,extendUint8Array:T,extendBuiltins:function(){R(),T()},Base64:{}};return Object.keys(U).forEach((function(e){return U.Base64[e]=U[e]})),U}()},1176:(e,a,c)=>{var f;!function(){"use strict";var d="input is invalid type",b="object"==typeof window,t=b?window:{};t.JS_SHA3_NO_WINDOW&&(b=!1);var i=!b&&"object"==typeof self;!t.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?t=c.g:i&&(t=self);var r=!t.JS_SHA3_NO_COMMON_JS&&e.exports,n=c.amdO,o=!t.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),l=[4,1024,262144,67108864],h=[0,8,16,24],u=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],x=[224,256,384,512],p=[128,256],g=["hex","buffer","arrayBuffer","array","digest"],m={128:168,256:136};!t.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!o||!t.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var y=function(e,a,c){return function(f){return new P(e,a,e).update(f)[c]()}},_=function(e,a,c){return function(f,d){return new P(e,a,d).update(f)[c]()}},v=function(e,a,c){return function(a,f,d,b){return I["cshake"+e].update(a,f,d,b)[c]()}},w=function(e,a,c){return function(a,f,d,b){return I["kmac"+e].update(a,f,d,b)[c]()}},M=function(e,a,c,f){for(var d=0;d>5,this.byteCount=this.blockCount<<2,this.outputBlocks=c>>5,this.extraBytes=(31&c)>>3;for(var f=0;f<50;++f)this.s[f]=0}function R(e,a,c){P.call(this,e,a,c)}P.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var a,c=typeof e;if("string"!==c){if("object"!==c)throw new Error(d);if(null===e)throw new Error(d);if(o&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||o&&ArrayBuffer.isView(e)))throw new Error(d);a=!0}for(var f,b,t=this.blocks,i=this.byteCount,r=e.length,n=this.blockCount,s=0,l=this.s;s>2]|=e[s]<>2]|=b<>2]|=(192|b>>6)<>2]|=(128|63&b)<=57344?(t[f>>2]|=(224|b>>12)<>2]|=(128|b>>6&63)<>2]|=(128|63&b)<>2]|=(240|b>>18)<>2]|=(128|b>>12&63)<>2]|=(128|b>>6&63)<>2]|=(128|63&b)<=i){for(this.start=f-i,this.block=t[n],f=0;f>=8);c>0;)d.unshift(c),c=255&(e>>=8),++f;return a?d.push(f):d.unshift(f),this.update(d),d.length},P.prototype.encodeString=function(e){var a,c=typeof e;if("string"!==c){if("object"!==c)throw new Error(d);if(null===e)throw new Error(d);if(o&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||o&&ArrayBuffer.isView(e)))throw new Error(d);a=!0}var f=0,b=e.length;if(a)f=b;else for(var t=0;t=57344?f+=3:(i=65536+((1023&i)<<10|1023&e.charCodeAt(++t)),f+=4)}return f+=this.encode(8*f),this.update(e),f},P.prototype.bytepad=function(e,a){for(var c=this.encode(a),f=0;f>2]|=this.padding[3&a],this.lastByteIndex===this.byteCount)for(e[0]=e[c],a=1;a>4&15]+s[15&e]+s[e>>12&15]+s[e>>8&15]+s[e>>20&15]+s[e>>16&15]+s[e>>28&15]+s[e>>24&15];t%a==0&&(T(c),b=0)}return d&&(e=c[b],i+=s[e>>4&15]+s[15&e],d>1&&(i+=s[e>>12&15]+s[e>>8&15]),d>2&&(i+=s[e>>20&15]+s[e>>16&15])),i},P.prototype.arrayBuffer=function(){this.finalize();var e,a=this.blockCount,c=this.s,f=this.outputBlocks,d=this.extraBytes,b=0,t=0,i=this.outputBits>>3;e=d?new ArrayBuffer(f+1<<2):new ArrayBuffer(i);for(var r=new Uint32Array(e);t>8&255,r[e+2]=a>>16&255,r[e+3]=a>>24&255;i%c==0&&T(f)}return b&&(e=i<<2,a=f[t],r[e]=255&a,b>1&&(r[e+1]=a>>8&255),b>2&&(r[e+2]=a>>16&255)),r},R.prototype=new P,R.prototype.finalize=function(){return this.encode(this.outputBits,!0),P.prototype.finalize.call(this)};var T=function(e){var a,c,f,d,b,t,i,r,n,o,s,l,h,x,p,g,m,y,_,v,w,M,A,L,I,k,E,S,C,B,F,O,P,R,T,U,j,N,q,D,z,Q,G,K,H,V,Z,W,Y,J,$,X,ee,ae,ce,fe,de,be,te,ie,re,ne,oe;for(f=0;f<48;f+=2)d=e[0]^e[10]^e[20]^e[30]^e[40],b=e[1]^e[11]^e[21]^e[31]^e[41],t=e[2]^e[12]^e[22]^e[32]^e[42],i=e[3]^e[13]^e[23]^e[33]^e[43],r=e[4]^e[14]^e[24]^e[34]^e[44],n=e[5]^e[15]^e[25]^e[35]^e[45],o=e[6]^e[16]^e[26]^e[36]^e[46],s=e[7]^e[17]^e[27]^e[37]^e[47],a=(l=e[8]^e[18]^e[28]^e[38]^e[48])^(t<<1|i>>>31),c=(h=e[9]^e[19]^e[29]^e[39]^e[49])^(i<<1|t>>>31),e[0]^=a,e[1]^=c,e[10]^=a,e[11]^=c,e[20]^=a,e[21]^=c,e[30]^=a,e[31]^=c,e[40]^=a,e[41]^=c,a=d^(r<<1|n>>>31),c=b^(n<<1|r>>>31),e[2]^=a,e[3]^=c,e[12]^=a,e[13]^=c,e[22]^=a,e[23]^=c,e[32]^=a,e[33]^=c,e[42]^=a,e[43]^=c,a=t^(o<<1|s>>>31),c=i^(s<<1|o>>>31),e[4]^=a,e[5]^=c,e[14]^=a,e[15]^=c,e[24]^=a,e[25]^=c,e[34]^=a,e[35]^=c,e[44]^=a,e[45]^=c,a=r^(l<<1|h>>>31),c=n^(h<<1|l>>>31),e[6]^=a,e[7]^=c,e[16]^=a,e[17]^=c,e[26]^=a,e[27]^=c,e[36]^=a,e[37]^=c,e[46]^=a,e[47]^=c,a=o^(d<<1|b>>>31),c=s^(b<<1|d>>>31),e[8]^=a,e[9]^=c,e[18]^=a,e[19]^=c,e[28]^=a,e[29]^=c,e[38]^=a,e[39]^=c,e[48]^=a,e[49]^=c,x=e[0],p=e[1],V=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,S=e[20]<<3|e[21]>>>29,C=e[21]<<3|e[20]>>>29,ie=e[31]<<9|e[30]>>>23,re=e[30]<<9|e[31]>>>23,Q=e[40]<<18|e[41]>>>14,G=e[41]<<18|e[40]>>>14,R=e[2]<<1|e[3]>>>31,T=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,W=e[22]<<10|e[23]>>>22,Y=e[23]<<10|e[22]>>>22,B=e[33]<<13|e[32]>>>19,F=e[32]<<13|e[33]>>>19,ne=e[42]<<2|e[43]>>>30,oe=e[43]<<2|e[42]>>>30,ae=e[5]<<30|e[4]>>>2,ce=e[4]<<30|e[5]>>>2,U=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,_=e[24]<<11|e[25]>>>21,J=e[34]<<15|e[35]>>>17,$=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,P=e[44]<<29|e[45]>>>3,L=e[6]<<28|e[7]>>>4,I=e[7]<<28|e[6]>>>4,fe=e[17]<<23|e[16]>>>9,de=e[16]<<23|e[17]>>>9,N=e[26]<<25|e[27]>>>7,q=e[27]<<25|e[26]>>>7,v=e[36]<<21|e[37]>>>11,w=e[37]<<21|e[36]>>>11,X=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,K=e[8]<<27|e[9]>>>5,H=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,E=e[19]<<20|e[18]>>>12,be=e[29]<<7|e[28]>>>25,te=e[28]<<7|e[29]>>>25,D=e[38]<<8|e[39]>>>24,z=e[39]<<8|e[38]>>>24,M=e[48]<<14|e[49]>>>18,A=e[49]<<14|e[48]>>>18,e[0]=x^~g&y,e[1]=p^~m&_,e[10]=L^~k&S,e[11]=I^~E&C,e[20]=R^~U&N,e[21]=T^~j&q,e[30]=K^~V&W,e[31]=H^~Z&Y,e[40]=ae^~fe&be,e[41]=ce^~de&te,e[2]=g^~y&v,e[3]=m^~_&w,e[12]=k^~S&B,e[13]=E^~C&F,e[22]=U^~N&D,e[23]=j^~q&z,e[32]=V^~W&J,e[33]=Z^~Y&$,e[42]=fe^~be&ie,e[43]=de^~te&re,e[4]=y^~v&M,e[5]=_^~w&A,e[14]=S^~B&O,e[15]=C^~F&P,e[24]=N^~D&Q,e[25]=q^~z&G,e[34]=W^~J&X,e[35]=Y^~$&ee,e[44]=be^~ie&ne,e[45]=te^~re&oe,e[6]=v^~M&x,e[7]=w^~A&p,e[16]=B^~O&L,e[17]=F^~P&I,e[26]=D^~Q&R,e[27]=z^~G&T,e[36]=J^~X&K,e[37]=$^~ee&H,e[46]=ie^~ne&ae,e[47]=re^~oe&ce,e[8]=M^~x&g,e[9]=A^~p&m,e[18]=O^~L&k,e[19]=P^~I&E,e[28]=Q^~R&U,e[29]=G^~T&j,e[38]=X^~K&V,e[39]=ee^~H&Z,e[48]=ne^~ae&fe,e[49]=oe^~ce&de,e[0]^=u[f],e[1]^=u[f+1]};if(r)e.exports=I;else{for(E=0;E{"use strict";var f=c(6698),d=c(3726),b=c(2861).Buffer,t=new Array(16);function i(){d.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function r(e,a){return e<>>32-a}function n(e,a,c,f,d,b,t){return r(e+(a&c|~a&f)+d+b|0,t)+a|0}function o(e,a,c,f,d,b,t){return r(e+(a&f|c&~f)+d+b|0,t)+a|0}function s(e,a,c,f,d,b,t){return r(e+(a^c^f)+d+b|0,t)+a|0}function l(e,a,c,f,d,b,t){return r(e+(c^(a|~f))+d+b|0,t)+a|0}f(i,d),i.prototype._update=function(){for(var e=t,a=0;a<16;++a)e[a]=this._block.readInt32LE(4*a);var c=this._a,f=this._b,d=this._c,b=this._d;c=n(c,f,d,b,e[0],3614090360,7),b=n(b,c,f,d,e[1],3905402710,12),d=n(d,b,c,f,e[2],606105819,17),f=n(f,d,b,c,e[3],3250441966,22),c=n(c,f,d,b,e[4],4118548399,7),b=n(b,c,f,d,e[5],1200080426,12),d=n(d,b,c,f,e[6],2821735955,17),f=n(f,d,b,c,e[7],4249261313,22),c=n(c,f,d,b,e[8],1770035416,7),b=n(b,c,f,d,e[9],2336552879,12),d=n(d,b,c,f,e[10],4294925233,17),f=n(f,d,b,c,e[11],2304563134,22),c=n(c,f,d,b,e[12],1804603682,7),b=n(b,c,f,d,e[13],4254626195,12),d=n(d,b,c,f,e[14],2792965006,17),c=o(c,f=n(f,d,b,c,e[15],1236535329,22),d,b,e[1],4129170786,5),b=o(b,c,f,d,e[6],3225465664,9),d=o(d,b,c,f,e[11],643717713,14),f=o(f,d,b,c,e[0],3921069994,20),c=o(c,f,d,b,e[5],3593408605,5),b=o(b,c,f,d,e[10],38016083,9),d=o(d,b,c,f,e[15],3634488961,14),f=o(f,d,b,c,e[4],3889429448,20),c=o(c,f,d,b,e[9],568446438,5),b=o(b,c,f,d,e[14],3275163606,9),d=o(d,b,c,f,e[3],4107603335,14),f=o(f,d,b,c,e[8],1163531501,20),c=o(c,f,d,b,e[13],2850285829,5),b=o(b,c,f,d,e[2],4243563512,9),d=o(d,b,c,f,e[7],1735328473,14),c=s(c,f=o(f,d,b,c,e[12],2368359562,20),d,b,e[5],4294588738,4),b=s(b,c,f,d,e[8],2272392833,11),d=s(d,b,c,f,e[11],1839030562,16),f=s(f,d,b,c,e[14],4259657740,23),c=s(c,f,d,b,e[1],2763975236,4),b=s(b,c,f,d,e[4],1272893353,11),d=s(d,b,c,f,e[7],4139469664,16),f=s(f,d,b,c,e[10],3200236656,23),c=s(c,f,d,b,e[13],681279174,4),b=s(b,c,f,d,e[0],3936430074,11),d=s(d,b,c,f,e[3],3572445317,16),f=s(f,d,b,c,e[6],76029189,23),c=s(c,f,d,b,e[9],3654602809,4),b=s(b,c,f,d,e[12],3873151461,11),d=s(d,b,c,f,e[15],530742520,16),c=l(c,f=s(f,d,b,c,e[2],3299628645,23),d,b,e[0],4096336452,6),b=l(b,c,f,d,e[7],1126891415,10),d=l(d,b,c,f,e[14],2878612391,15),f=l(f,d,b,c,e[5],4237533241,21),c=l(c,f,d,b,e[12],1700485571,6),b=l(b,c,f,d,e[3],2399980690,10),d=l(d,b,c,f,e[10],4293915773,15),f=l(f,d,b,c,e[1],2240044497,21),c=l(c,f,d,b,e[8],1873313359,6),b=l(b,c,f,d,e[15],4264355552,10),d=l(d,b,c,f,e[6],2734768916,15),f=l(f,d,b,c,e[13],1309151649,21),c=l(c,f,d,b,e[4],4149444226,6),b=l(b,c,f,d,e[11],3174756917,10),d=l(d,b,c,f,e[2],718787259,15),f=l(f,d,b,c,e[9],3951481745,21),this._a=this._a+c|0,this._b=this._b+f|0,this._c=this._c+d|0,this._d=this._d+b|0},i.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 e=b.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=i},3726:(e,a,c)=>{"use strict";var f=c(2861).Buffer,d=c(8399).Transform;function b(e){d.call(this),this._block=f.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}c(6698)(b,d),b.prototype._transform=function(e,a,c){var f=null;try{this.update(e,a)}catch(e){f=e}c(f)},b.prototype._flush=function(e){var a=null;try{this.push(this.digest())}catch(e){a=e}e(a)},b.prototype.update=function(e,a){if(function(e){if(!f.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");f.isBuffer(e)||(e=f.from(e,a));for(var c=this._block,d=0;this._blockOffset+e.length-d>=this._blockSize;){for(var b=this._blockOffset;b0;++t)this._length[t]+=i,(i=this._length[t]/4294967296|0)>0&&(this._length[t]-=4294967296*i);return this},b.prototype._update=function(){throw new Error("_update is not implemented")},b.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var a=this._digest();void 0!==e&&(a=a.toString(e)),this._block.fill(0),this._blockOffset=0;for(var c=0;c<4;++c)this._length[c]=0;return a},b.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=b},2244:(e,a,c)=>{var f=c(1158),d=c(5037);function b(e){this.rand=e||new d.Rand}e.exports=b,b.create=function(e){return new b(e)},b.prototype._randbelow=function(e){var a=e.bitLength(),c=Math.ceil(a/8);do{var d=new f(this.rand.generate(c))}while(d.cmp(e)>=0);return d},b.prototype._randrange=function(e,a){var c=a.sub(e);return e.add(this._randbelow(c))},b.prototype.test=function(e,a,c){var d=e.bitLength(),b=f.mont(e),t=new f(1).toRed(b);a||(a=Math.max(1,d/48|0));for(var i=e.subn(1),r=0;!i.testn(r);r++);for(var n=e.shrn(r),o=i.toRed(b);a>0;a--){var s=this._randrange(new f(2),i);c&&c(s);var l=s.toRed(b).redPow(n);if(0!==l.cmp(t)&&0!==l.cmp(o)){for(var h=1;h0;a--){var o=this._randrange(new f(2),t),s=e.gcd(o);if(0!==s.cmpn(1))return s;var l=o.toRed(d).redPow(r);if(0!==l.cmp(b)&&0!==l.cmp(n)){for(var h=1;h=65&&c<=70?c-55:c>=97&&c<=102?c-87:c-48&15}function r(e,a,c){var f=i(e,c);return c-1>=a&&(f|=i(e,c-1)<<4),f}function n(e,a,c,f){for(var d=0,b=Math.min(e.length,c),t=a;t=49?i-49+10:i>=17?i-17+10:i}return d}b.isBN=function(e){return e instanceof b||null!==e&&"object"==typeof e&&e.constructor.wordSize===b.wordSize&&Array.isArray(e.words)},b.max=function(e,a){return e.cmp(a)>0?e:a},b.min=function(e,a){return e.cmp(a)<0?e:a},b.prototype._init=function(e,a,c){if("number"==typeof e)return this._initNumber(e,a,c);if("object"==typeof e)return this._initArray(e,a,c);"hex"===a&&(a=16),f(a===(0|a)&&a>=2&&a<=36);var d=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(d++,this.negative=1),d=0;d-=3)t=e[d]|e[d-1]<<8|e[d-2]<<16,this.words[b]|=t<>>26-i&67108863,(i+=24)>=26&&(i-=26,b++);else if("le"===c)for(d=0,b=0;d>>26-i&67108863,(i+=24)>=26&&(i-=26,b++);return this.strip()},b.prototype._parseHex=function(e,a,c){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var f=0;f=a;f-=2)d=r(e,a,f)<=18?(b-=18,t+=1,this.words[t]|=d>>>26):b+=8;else for(f=(e.length-a)%2==0?a+1:a;f=18?(b-=18,t+=1,this.words[t]|=d>>>26):b+=8;this.strip()},b.prototype._parseBase=function(e,a,c){this.words=[0],this.length=1;for(var f=0,d=1;d<=67108863;d*=a)f++;f--,d=d/a|0;for(var b=e.length-c,t=b%f,i=Math.min(b,b-t)+c,r=0,o=c;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},b.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},b.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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 h(e,a,c){c.negative=a.negative^e.negative;var f=e.length+a.length|0;c.length=f,f=f-1|0;var d=0|e.words[0],b=0|a.words[0],t=d*b,i=67108863&t,r=t/67108864|0;c.words[0]=i;for(var n=1;n>>26,s=67108863&r,l=Math.min(n,a.length-1),h=Math.max(0,n-e.length+1);h<=l;h++){var u=n-h|0;o+=(t=(d=0|e.words[u])*(b=0|a.words[h])+s)/67108864|0,s=67108863&t}c.words[n]=0|s,r=0|o}return 0!==r?c.words[n]=0|r:c.length--,c.strip()}b.prototype.toString=function(e,a){var c;if(a=0|a||1,16===(e=e||10)||"hex"===e){c="";for(var d=0,b=0,t=0;t>>24-d&16777215)||t!==this.length-1?o[6-r.length]+r+c:r+c,(d+=2)>=26&&(d-=26,t--)}for(0!==b&&(c=b.toString(16)+c);c.length%a!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(e===(0|e)&&e>=2&&e<=36){var n=s[e],h=l[e];c="";var u=this.clone();for(u.negative=0;!u.isZero();){var x=u.modn(h).toString(e);c=(u=u.idivn(h)).isZero()?x+c:o[n-x.length]+x+c}for(this.isZero()&&(c="0"+c);c.length%a!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}f(!1,"Base should be between 2 and 36")},b.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&f(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},b.prototype.toJSON=function(){return this.toString(16)},b.prototype.toBuffer=function(e,a){return f(void 0!==t),this.toArrayLike(t,e,a)},b.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},b.prototype.toArrayLike=function(e,a,c){var d=this.byteLength(),b=c||Math.max(1,d);f(d<=b,"byte array longer than desired length"),f(b>0,"Requested array length <= 0"),this.strip();var t,i,r="le"===a,n=new e(b),o=this.clone();if(r){for(i=0;!o.isZero();i++)t=o.andln(255),o.iushrn(8),n[i]=t;for(;i=4096&&(c+=13,a>>>=13),a>=64&&(c+=7,a>>>=7),a>=8&&(c+=4,a>>>=4),a>=2&&(c+=2,a>>>=2),c+a},b.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,c=0;return 8191&a||(c+=13,a>>>=13),127&a||(c+=7,a>>>=7),15&a||(c+=4,a>>>=4),3&a||(c+=2,a>>>=2),1&a||c++,c},b.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},b.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},b.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},b.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var c=0;ce.length?this.clone().iand(e):e.clone().iand(this)},b.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},b.prototype.iuxor=function(e){var a,c;this.length>e.length?(a=this,c=e):(a=e,c=this);for(var f=0;fe.length?this.clone().ixor(e):e.clone().ixor(this)},b.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},b.prototype.inotn=function(e){f("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),c=e%26;this._expand(a),c>0&&a--;for(var d=0;d0&&(this.words[d]=~this.words[d]&67108863>>26-c),this.strip()},b.prototype.notn=function(e){return this.clone().inotn(e)},b.prototype.setn=function(e,a){f("number"==typeof e&&e>=0);var c=e/26|0,d=e%26;return this._expand(c+1),this.words[c]=a?this.words[c]|1<e.length?(c=this,f=e):(c=e,f=this);for(var d=0,b=0;b>>26;for(;0!==d&&b>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;be.length?this.clone().iadd(e):e.clone().iadd(this)},b.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var c,f,d=this.cmp(e);if(0===d)return this.negative=0,this.length=1,this.words[0]=0,this;d>0?(c=this,f=e):(c=e,f=this);for(var b=0,t=0;t>26,this.words[t]=67108863&a;for(;0!==b&&t>26,this.words[t]=67108863&a;if(0===b&&t>>13,h=0|t[1],u=8191&h,x=h>>>13,p=0|t[2],g=8191&p,m=p>>>13,y=0|t[3],_=8191&y,v=y>>>13,w=0|t[4],M=8191&w,A=w>>>13,L=0|t[5],I=8191&L,k=L>>>13,E=0|t[6],S=8191&E,C=E>>>13,B=0|t[7],F=8191&B,O=B>>>13,P=0|t[8],R=8191&P,T=P>>>13,U=0|t[9],j=8191&U,N=U>>>13,q=0|i[0],D=8191&q,z=q>>>13,Q=0|i[1],G=8191&Q,K=Q>>>13,H=0|i[2],V=8191&H,Z=H>>>13,W=0|i[3],Y=8191&W,J=W>>>13,$=0|i[4],X=8191&$,ee=$>>>13,ae=0|i[5],ce=8191&ae,fe=ae>>>13,de=0|i[6],be=8191&de,te=de>>>13,ie=0|i[7],re=8191&ie,ne=ie>>>13,oe=0|i[8],se=8191&oe,le=oe>>>13,he=0|i[9],ue=8191&he,xe=he>>>13;c.negative=e.negative^a.negative,c.length=19;var pe=(n+(f=Math.imul(s,D))|0)+((8191&(d=(d=Math.imul(s,z))+Math.imul(l,D)|0))<<13)|0;n=((b=Math.imul(l,z))+(d>>>13)|0)+(pe>>>26)|0,pe&=67108863,f=Math.imul(u,D),d=(d=Math.imul(u,z))+Math.imul(x,D)|0,b=Math.imul(x,z);var ge=(n+(f=f+Math.imul(s,G)|0)|0)+((8191&(d=(d=d+Math.imul(s,K)|0)+Math.imul(l,G)|0))<<13)|0;n=((b=b+Math.imul(l,K)|0)+(d>>>13)|0)+(ge>>>26)|0,ge&=67108863,f=Math.imul(g,D),d=(d=Math.imul(g,z))+Math.imul(m,D)|0,b=Math.imul(m,z),f=f+Math.imul(u,G)|0,d=(d=d+Math.imul(u,K)|0)+Math.imul(x,G)|0,b=b+Math.imul(x,K)|0;var me=(n+(f=f+Math.imul(s,V)|0)|0)+((8191&(d=(d=d+Math.imul(s,Z)|0)+Math.imul(l,V)|0))<<13)|0;n=((b=b+Math.imul(l,Z)|0)+(d>>>13)|0)+(me>>>26)|0,me&=67108863,f=Math.imul(_,D),d=(d=Math.imul(_,z))+Math.imul(v,D)|0,b=Math.imul(v,z),f=f+Math.imul(g,G)|0,d=(d=d+Math.imul(g,K)|0)+Math.imul(m,G)|0,b=b+Math.imul(m,K)|0,f=f+Math.imul(u,V)|0,d=(d=d+Math.imul(u,Z)|0)+Math.imul(x,V)|0,b=b+Math.imul(x,Z)|0;var ye=(n+(f=f+Math.imul(s,Y)|0)|0)+((8191&(d=(d=d+Math.imul(s,J)|0)+Math.imul(l,Y)|0))<<13)|0;n=((b=b+Math.imul(l,J)|0)+(d>>>13)|0)+(ye>>>26)|0,ye&=67108863,f=Math.imul(M,D),d=(d=Math.imul(M,z))+Math.imul(A,D)|0,b=Math.imul(A,z),f=f+Math.imul(_,G)|0,d=(d=d+Math.imul(_,K)|0)+Math.imul(v,G)|0,b=b+Math.imul(v,K)|0,f=f+Math.imul(g,V)|0,d=(d=d+Math.imul(g,Z)|0)+Math.imul(m,V)|0,b=b+Math.imul(m,Z)|0,f=f+Math.imul(u,Y)|0,d=(d=d+Math.imul(u,J)|0)+Math.imul(x,Y)|0,b=b+Math.imul(x,J)|0;var _e=(n+(f=f+Math.imul(s,X)|0)|0)+((8191&(d=(d=d+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;n=((b=b+Math.imul(l,ee)|0)+(d>>>13)|0)+(_e>>>26)|0,_e&=67108863,f=Math.imul(I,D),d=(d=Math.imul(I,z))+Math.imul(k,D)|0,b=Math.imul(k,z),f=f+Math.imul(M,G)|0,d=(d=d+Math.imul(M,K)|0)+Math.imul(A,G)|0,b=b+Math.imul(A,K)|0,f=f+Math.imul(_,V)|0,d=(d=d+Math.imul(_,Z)|0)+Math.imul(v,V)|0,b=b+Math.imul(v,Z)|0,f=f+Math.imul(g,Y)|0,d=(d=d+Math.imul(g,J)|0)+Math.imul(m,Y)|0,b=b+Math.imul(m,J)|0,f=f+Math.imul(u,X)|0,d=(d=d+Math.imul(u,ee)|0)+Math.imul(x,X)|0,b=b+Math.imul(x,ee)|0;var ve=(n+(f=f+Math.imul(s,ce)|0)|0)+((8191&(d=(d=d+Math.imul(s,fe)|0)+Math.imul(l,ce)|0))<<13)|0;n=((b=b+Math.imul(l,fe)|0)+(d>>>13)|0)+(ve>>>26)|0,ve&=67108863,f=Math.imul(S,D),d=(d=Math.imul(S,z))+Math.imul(C,D)|0,b=Math.imul(C,z),f=f+Math.imul(I,G)|0,d=(d=d+Math.imul(I,K)|0)+Math.imul(k,G)|0,b=b+Math.imul(k,K)|0,f=f+Math.imul(M,V)|0,d=(d=d+Math.imul(M,Z)|0)+Math.imul(A,V)|0,b=b+Math.imul(A,Z)|0,f=f+Math.imul(_,Y)|0,d=(d=d+Math.imul(_,J)|0)+Math.imul(v,Y)|0,b=b+Math.imul(v,J)|0,f=f+Math.imul(g,X)|0,d=(d=d+Math.imul(g,ee)|0)+Math.imul(m,X)|0,b=b+Math.imul(m,ee)|0,f=f+Math.imul(u,ce)|0,d=(d=d+Math.imul(u,fe)|0)+Math.imul(x,ce)|0,b=b+Math.imul(x,fe)|0;var we=(n+(f=f+Math.imul(s,be)|0)|0)+((8191&(d=(d=d+Math.imul(s,te)|0)+Math.imul(l,be)|0))<<13)|0;n=((b=b+Math.imul(l,te)|0)+(d>>>13)|0)+(we>>>26)|0,we&=67108863,f=Math.imul(F,D),d=(d=Math.imul(F,z))+Math.imul(O,D)|0,b=Math.imul(O,z),f=f+Math.imul(S,G)|0,d=(d=d+Math.imul(S,K)|0)+Math.imul(C,G)|0,b=b+Math.imul(C,K)|0,f=f+Math.imul(I,V)|0,d=(d=d+Math.imul(I,Z)|0)+Math.imul(k,V)|0,b=b+Math.imul(k,Z)|0,f=f+Math.imul(M,Y)|0,d=(d=d+Math.imul(M,J)|0)+Math.imul(A,Y)|0,b=b+Math.imul(A,J)|0,f=f+Math.imul(_,X)|0,d=(d=d+Math.imul(_,ee)|0)+Math.imul(v,X)|0,b=b+Math.imul(v,ee)|0,f=f+Math.imul(g,ce)|0,d=(d=d+Math.imul(g,fe)|0)+Math.imul(m,ce)|0,b=b+Math.imul(m,fe)|0,f=f+Math.imul(u,be)|0,d=(d=d+Math.imul(u,te)|0)+Math.imul(x,be)|0,b=b+Math.imul(x,te)|0;var Me=(n+(f=f+Math.imul(s,re)|0)|0)+((8191&(d=(d=d+Math.imul(s,ne)|0)+Math.imul(l,re)|0))<<13)|0;n=((b=b+Math.imul(l,ne)|0)+(d>>>13)|0)+(Me>>>26)|0,Me&=67108863,f=Math.imul(R,D),d=(d=Math.imul(R,z))+Math.imul(T,D)|0,b=Math.imul(T,z),f=f+Math.imul(F,G)|0,d=(d=d+Math.imul(F,K)|0)+Math.imul(O,G)|0,b=b+Math.imul(O,K)|0,f=f+Math.imul(S,V)|0,d=(d=d+Math.imul(S,Z)|0)+Math.imul(C,V)|0,b=b+Math.imul(C,Z)|0,f=f+Math.imul(I,Y)|0,d=(d=d+Math.imul(I,J)|0)+Math.imul(k,Y)|0,b=b+Math.imul(k,J)|0,f=f+Math.imul(M,X)|0,d=(d=d+Math.imul(M,ee)|0)+Math.imul(A,X)|0,b=b+Math.imul(A,ee)|0,f=f+Math.imul(_,ce)|0,d=(d=d+Math.imul(_,fe)|0)+Math.imul(v,ce)|0,b=b+Math.imul(v,fe)|0,f=f+Math.imul(g,be)|0,d=(d=d+Math.imul(g,te)|0)+Math.imul(m,be)|0,b=b+Math.imul(m,te)|0,f=f+Math.imul(u,re)|0,d=(d=d+Math.imul(u,ne)|0)+Math.imul(x,re)|0,b=b+Math.imul(x,ne)|0;var Ae=(n+(f=f+Math.imul(s,se)|0)|0)+((8191&(d=(d=d+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;n=((b=b+Math.imul(l,le)|0)+(d>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,f=Math.imul(j,D),d=(d=Math.imul(j,z))+Math.imul(N,D)|0,b=Math.imul(N,z),f=f+Math.imul(R,G)|0,d=(d=d+Math.imul(R,K)|0)+Math.imul(T,G)|0,b=b+Math.imul(T,K)|0,f=f+Math.imul(F,V)|0,d=(d=d+Math.imul(F,Z)|0)+Math.imul(O,V)|0,b=b+Math.imul(O,Z)|0,f=f+Math.imul(S,Y)|0,d=(d=d+Math.imul(S,J)|0)+Math.imul(C,Y)|0,b=b+Math.imul(C,J)|0,f=f+Math.imul(I,X)|0,d=(d=d+Math.imul(I,ee)|0)+Math.imul(k,X)|0,b=b+Math.imul(k,ee)|0,f=f+Math.imul(M,ce)|0,d=(d=d+Math.imul(M,fe)|0)+Math.imul(A,ce)|0,b=b+Math.imul(A,fe)|0,f=f+Math.imul(_,be)|0,d=(d=d+Math.imul(_,te)|0)+Math.imul(v,be)|0,b=b+Math.imul(v,te)|0,f=f+Math.imul(g,re)|0,d=(d=d+Math.imul(g,ne)|0)+Math.imul(m,re)|0,b=b+Math.imul(m,ne)|0,f=f+Math.imul(u,se)|0,d=(d=d+Math.imul(u,le)|0)+Math.imul(x,se)|0,b=b+Math.imul(x,le)|0;var Le=(n+(f=f+Math.imul(s,ue)|0)|0)+((8191&(d=(d=d+Math.imul(s,xe)|0)+Math.imul(l,ue)|0))<<13)|0;n=((b=b+Math.imul(l,xe)|0)+(d>>>13)|0)+(Le>>>26)|0,Le&=67108863,f=Math.imul(j,G),d=(d=Math.imul(j,K))+Math.imul(N,G)|0,b=Math.imul(N,K),f=f+Math.imul(R,V)|0,d=(d=d+Math.imul(R,Z)|0)+Math.imul(T,V)|0,b=b+Math.imul(T,Z)|0,f=f+Math.imul(F,Y)|0,d=(d=d+Math.imul(F,J)|0)+Math.imul(O,Y)|0,b=b+Math.imul(O,J)|0,f=f+Math.imul(S,X)|0,d=(d=d+Math.imul(S,ee)|0)+Math.imul(C,X)|0,b=b+Math.imul(C,ee)|0,f=f+Math.imul(I,ce)|0,d=(d=d+Math.imul(I,fe)|0)+Math.imul(k,ce)|0,b=b+Math.imul(k,fe)|0,f=f+Math.imul(M,be)|0,d=(d=d+Math.imul(M,te)|0)+Math.imul(A,be)|0,b=b+Math.imul(A,te)|0,f=f+Math.imul(_,re)|0,d=(d=d+Math.imul(_,ne)|0)+Math.imul(v,re)|0,b=b+Math.imul(v,ne)|0,f=f+Math.imul(g,se)|0,d=(d=d+Math.imul(g,le)|0)+Math.imul(m,se)|0,b=b+Math.imul(m,le)|0;var Ie=(n+(f=f+Math.imul(u,ue)|0)|0)+((8191&(d=(d=d+Math.imul(u,xe)|0)+Math.imul(x,ue)|0))<<13)|0;n=((b=b+Math.imul(x,xe)|0)+(d>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,f=Math.imul(j,V),d=(d=Math.imul(j,Z))+Math.imul(N,V)|0,b=Math.imul(N,Z),f=f+Math.imul(R,Y)|0,d=(d=d+Math.imul(R,J)|0)+Math.imul(T,Y)|0,b=b+Math.imul(T,J)|0,f=f+Math.imul(F,X)|0,d=(d=d+Math.imul(F,ee)|0)+Math.imul(O,X)|0,b=b+Math.imul(O,ee)|0,f=f+Math.imul(S,ce)|0,d=(d=d+Math.imul(S,fe)|0)+Math.imul(C,ce)|0,b=b+Math.imul(C,fe)|0,f=f+Math.imul(I,be)|0,d=(d=d+Math.imul(I,te)|0)+Math.imul(k,be)|0,b=b+Math.imul(k,te)|0,f=f+Math.imul(M,re)|0,d=(d=d+Math.imul(M,ne)|0)+Math.imul(A,re)|0,b=b+Math.imul(A,ne)|0,f=f+Math.imul(_,se)|0,d=(d=d+Math.imul(_,le)|0)+Math.imul(v,se)|0,b=b+Math.imul(v,le)|0;var ke=(n+(f=f+Math.imul(g,ue)|0)|0)+((8191&(d=(d=d+Math.imul(g,xe)|0)+Math.imul(m,ue)|0))<<13)|0;n=((b=b+Math.imul(m,xe)|0)+(d>>>13)|0)+(ke>>>26)|0,ke&=67108863,f=Math.imul(j,Y),d=(d=Math.imul(j,J))+Math.imul(N,Y)|0,b=Math.imul(N,J),f=f+Math.imul(R,X)|0,d=(d=d+Math.imul(R,ee)|0)+Math.imul(T,X)|0,b=b+Math.imul(T,ee)|0,f=f+Math.imul(F,ce)|0,d=(d=d+Math.imul(F,fe)|0)+Math.imul(O,ce)|0,b=b+Math.imul(O,fe)|0,f=f+Math.imul(S,be)|0,d=(d=d+Math.imul(S,te)|0)+Math.imul(C,be)|0,b=b+Math.imul(C,te)|0,f=f+Math.imul(I,re)|0,d=(d=d+Math.imul(I,ne)|0)+Math.imul(k,re)|0,b=b+Math.imul(k,ne)|0,f=f+Math.imul(M,se)|0,d=(d=d+Math.imul(M,le)|0)+Math.imul(A,se)|0,b=b+Math.imul(A,le)|0;var Ee=(n+(f=f+Math.imul(_,ue)|0)|0)+((8191&(d=(d=d+Math.imul(_,xe)|0)+Math.imul(v,ue)|0))<<13)|0;n=((b=b+Math.imul(v,xe)|0)+(d>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,f=Math.imul(j,X),d=(d=Math.imul(j,ee))+Math.imul(N,X)|0,b=Math.imul(N,ee),f=f+Math.imul(R,ce)|0,d=(d=d+Math.imul(R,fe)|0)+Math.imul(T,ce)|0,b=b+Math.imul(T,fe)|0,f=f+Math.imul(F,be)|0,d=(d=d+Math.imul(F,te)|0)+Math.imul(O,be)|0,b=b+Math.imul(O,te)|0,f=f+Math.imul(S,re)|0,d=(d=d+Math.imul(S,ne)|0)+Math.imul(C,re)|0,b=b+Math.imul(C,ne)|0,f=f+Math.imul(I,se)|0,d=(d=d+Math.imul(I,le)|0)+Math.imul(k,se)|0,b=b+Math.imul(k,le)|0;var Se=(n+(f=f+Math.imul(M,ue)|0)|0)+((8191&(d=(d=d+Math.imul(M,xe)|0)+Math.imul(A,ue)|0))<<13)|0;n=((b=b+Math.imul(A,xe)|0)+(d>>>13)|0)+(Se>>>26)|0,Se&=67108863,f=Math.imul(j,ce),d=(d=Math.imul(j,fe))+Math.imul(N,ce)|0,b=Math.imul(N,fe),f=f+Math.imul(R,be)|0,d=(d=d+Math.imul(R,te)|0)+Math.imul(T,be)|0,b=b+Math.imul(T,te)|0,f=f+Math.imul(F,re)|0,d=(d=d+Math.imul(F,ne)|0)+Math.imul(O,re)|0,b=b+Math.imul(O,ne)|0,f=f+Math.imul(S,se)|0,d=(d=d+Math.imul(S,le)|0)+Math.imul(C,se)|0,b=b+Math.imul(C,le)|0;var Ce=(n+(f=f+Math.imul(I,ue)|0)|0)+((8191&(d=(d=d+Math.imul(I,xe)|0)+Math.imul(k,ue)|0))<<13)|0;n=((b=b+Math.imul(k,xe)|0)+(d>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,f=Math.imul(j,be),d=(d=Math.imul(j,te))+Math.imul(N,be)|0,b=Math.imul(N,te),f=f+Math.imul(R,re)|0,d=(d=d+Math.imul(R,ne)|0)+Math.imul(T,re)|0,b=b+Math.imul(T,ne)|0,f=f+Math.imul(F,se)|0,d=(d=d+Math.imul(F,le)|0)+Math.imul(O,se)|0,b=b+Math.imul(O,le)|0;var Be=(n+(f=f+Math.imul(S,ue)|0)|0)+((8191&(d=(d=d+Math.imul(S,xe)|0)+Math.imul(C,ue)|0))<<13)|0;n=((b=b+Math.imul(C,xe)|0)+(d>>>13)|0)+(Be>>>26)|0,Be&=67108863,f=Math.imul(j,re),d=(d=Math.imul(j,ne))+Math.imul(N,re)|0,b=Math.imul(N,ne),f=f+Math.imul(R,se)|0,d=(d=d+Math.imul(R,le)|0)+Math.imul(T,se)|0,b=b+Math.imul(T,le)|0;var Fe=(n+(f=f+Math.imul(F,ue)|0)|0)+((8191&(d=(d=d+Math.imul(F,xe)|0)+Math.imul(O,ue)|0))<<13)|0;n=((b=b+Math.imul(O,xe)|0)+(d>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,f=Math.imul(j,se),d=(d=Math.imul(j,le))+Math.imul(N,se)|0,b=Math.imul(N,le);var Oe=(n+(f=f+Math.imul(R,ue)|0)|0)+((8191&(d=(d=d+Math.imul(R,xe)|0)+Math.imul(T,ue)|0))<<13)|0;n=((b=b+Math.imul(T,xe)|0)+(d>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Pe=(n+(f=Math.imul(j,ue))|0)+((8191&(d=(d=Math.imul(j,xe))+Math.imul(N,ue)|0))<<13)|0;return n=((b=Math.imul(N,xe))+(d>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r[0]=pe,r[1]=ge,r[2]=me,r[3]=ye,r[4]=_e,r[5]=ve,r[6]=we,r[7]=Me,r[8]=Ae,r[9]=Le,r[10]=Ie,r[11]=ke,r[12]=Ee,r[13]=Se,r[14]=Ce,r[15]=Be,r[16]=Fe,r[17]=Oe,r[18]=Pe,0!==n&&(r[19]=n,c.length++),c};function x(e,a,c){return(new p).mulp(e,a,c)}function p(e,a){this.x=e,this.y=a}Math.imul||(u=h),b.prototype.mulTo=function(e,a){var c,f=this.length+e.length;return c=10===this.length&&10===e.length?u(this,e,a):f<63?h(this,e,a):f<1024?function(e,a,c){c.negative=a.negative^e.negative,c.length=e.length+a.length;for(var f=0,d=0,b=0;b>>26)|0)>>>26,t&=67108863}c.words[b]=i,f=t,t=d}return 0!==f?c.words[b]=f:c.length--,c.strip()}(this,e,a):x(this,e,a),c},p.prototype.makeRBT=function(e){for(var a=new Array(e),c=b.prototype._countBits(e)-1,f=0;f>=1;return f},p.prototype.permute=function(e,a,c,f,d,b){for(var t=0;t>>=1)d++;return 1<>>=13,c[2*t+1]=8191&b,b>>>=13;for(t=2*a;t>=26,a+=d/67108864|0,a+=b>>>26,this.words[c]=67108863&b}return 0!==a&&(this.words[c]=a,this.length++),this},b.prototype.muln=function(e){return this.clone().imuln(e)},b.prototype.sqr=function(){return this.mul(this)},b.prototype.isqr=function(){return this.imul(this.clone())},b.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),c=0;c>>d}return a}(e);if(0===a.length)return new b(1);for(var c=this,f=0;f=0);var a,c=e%26,d=(e-c)/26,b=67108863>>>26-c<<26-c;if(0!==c){var t=0;for(a=0;a>>26-c}t&&(this.words[a]=t,this.length++)}if(0!==d){for(a=this.length-1;a>=0;a--)this.words[a+d]=this.words[a];for(a=0;a=0),d=a?(a-a%26)/26:0;var b=e%26,t=Math.min((e-b)/26,this.length),i=67108863^67108863>>>b<t)for(this.length-=t,n=0;n=0&&(0!==o||n>=d);n--){var s=0|this.words[n];this.words[n]=o<<26-b|s>>>b,o=s&i}return r&&0!==o&&(r.words[r.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},b.prototype.ishrn=function(e,a,c){return f(0===this.negative),this.iushrn(e,a,c)},b.prototype.shln=function(e){return this.clone().ishln(e)},b.prototype.ushln=function(e){return this.clone().iushln(e)},b.prototype.shrn=function(e){return this.clone().ishrn(e)},b.prototype.ushrn=function(e){return this.clone().iushrn(e)},b.prototype.testn=function(e){f("number"==typeof e&&e>=0);var a=e%26,c=(e-a)/26,d=1<=0);var a=e%26,c=(e-a)/26;if(f(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)return this;if(0!==a&&c++,this.length=Math.min(c,this.length),0!==a){var d=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},b.prototype.isubn=function(e){if(f("number"==typeof e),f(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(r/67108864|0),this.words[d+c]=67108863&b}for(;d>26,this.words[d+c]=67108863&b;if(0===i)return this.strip();for(f(-1===i),i=0,d=0;d>26,this.words[d]=67108863&b;return this.negative=1,this.strip()},b.prototype._wordDiv=function(e,a){var c=(this.length,e.length),f=this.clone(),d=e,t=0|d.words[d.length-1];0!=(c=26-this._countBits(t))&&(d=d.ushln(c),f.iushln(c),t=0|d.words[d.length-1]);var i,r=f.length-d.length;if("mod"!==a){(i=new b(null)).length=r+1,i.words=new Array(i.length);for(var n=0;n=0;s--){var l=67108864*(0|f.words[d.length+s])+(0|f.words[d.length+s-1]);for(l=Math.min(l/t|0,67108863),f._ishlnsubmul(d,l,s);0!==f.negative;)l--,f.negative=0,f._ishlnsubmul(d,1,s),f.isZero()||(f.negative^=1);i&&(i.words[s]=l)}return i&&i.strip(),f.strip(),"div"!==a&&0!==c&&f.iushrn(c),{div:i||null,mod:f}},b.prototype.divmod=function(e,a,c){return f(!e.isZero()),this.isZero()?{div:new b(0),mod:new b(0)}:0!==this.negative&&0===e.negative?(i=this.neg().divmod(e,a),"mod"!==a&&(d=i.div.neg()),"div"!==a&&(t=i.mod.neg(),c&&0!==t.negative&&t.iadd(e)),{div:d,mod:t}):0===this.negative&&0!==e.negative?(i=this.divmod(e.neg(),a),"mod"!==a&&(d=i.div.neg()),{div:d,mod:i.mod}):this.negative&e.negative?(i=this.neg().divmod(e.neg(),a),"div"!==a&&(t=i.mod.neg(),c&&0!==t.negative&&t.isub(e)),{div:i.div,mod:t}):e.length>this.length||this.cmp(e)<0?{div:new b(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new b(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new b(this.modn(e.words[0]))}:this._wordDiv(e,a);var d,t,i},b.prototype.div=function(e){return this.divmod(e,"div",!1).div},b.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},b.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},b.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var c=0!==a.div.negative?a.mod.isub(e):a.mod,f=e.ushrn(1),d=e.andln(1),b=c.cmp(f);return b<0||1===d&&0===b?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},b.prototype.modn=function(e){f(e<=67108863);for(var a=(1<<26)%e,c=0,d=this.length-1;d>=0;d--)c=(a*c+(0|this.words[d]))%e;return c},b.prototype.idivn=function(e){f(e<=67108863);for(var a=0,c=this.length-1;c>=0;c--){var d=(0|this.words[c])+67108864*a;this.words[c]=d/e|0,a=d%e}return this.strip()},b.prototype.divn=function(e){return this.clone().idivn(e)},b.prototype.egcd=function(e){f(0===e.negative),f(!e.isZero());var a=this,c=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var d=new b(1),t=new b(0),i=new b(0),r=new b(1),n=0;a.isEven()&&c.isEven();)a.iushrn(1),c.iushrn(1),++n;for(var o=c.clone(),s=a.clone();!a.isZero();){for(var l=0,h=1;!(a.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(d.isOdd()||t.isOdd())&&(d.iadd(o),t.isub(s)),d.iushrn(1),t.iushrn(1);for(var u=0,x=1;!(c.words[0]&x)&&u<26;++u,x<<=1);if(u>0)for(c.iushrn(u);u-- >0;)(i.isOdd()||r.isOdd())&&(i.iadd(o),r.isub(s)),i.iushrn(1),r.iushrn(1);a.cmp(c)>=0?(a.isub(c),d.isub(i),t.isub(r)):(c.isub(a),i.isub(d),r.isub(t))}return{a:i,b:r,gcd:c.iushln(n)}},b.prototype._invmp=function(e){f(0===e.negative),f(!e.isZero());var a=this,c=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var d,t=new b(1),i=new b(0),r=c.clone();a.cmpn(1)>0&&c.cmpn(1)>0;){for(var n=0,o=1;!(a.words[0]&o)&&n<26;++n,o<<=1);if(n>0)for(a.iushrn(n);n-- >0;)t.isOdd()&&t.iadd(r),t.iushrn(1);for(var s=0,l=1;!(c.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(c.iushrn(s);s-- >0;)i.isOdd()&&i.iadd(r),i.iushrn(1);a.cmp(c)>=0?(a.isub(c),t.isub(i)):(c.isub(a),i.isub(t))}return(d=0===a.cmpn(1)?t:i).cmpn(0)<0&&d.iadd(e),d},b.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),c=e.clone();a.negative=0,c.negative=0;for(var f=0;a.isEven()&&c.isEven();f++)a.iushrn(1),c.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=a.cmp(c);if(d<0){var b=a;a=c,c=b}else if(0===d||0===c.cmpn(1))break;a.isub(c)}return c.iushln(f)},b.prototype.invm=function(e){return this.egcd(e).a.umod(e)},b.prototype.isEven=function(){return!(1&this.words[0])},b.prototype.isOdd=function(){return!(1&~this.words[0])},b.prototype.andln=function(e){return this.words[0]&e},b.prototype.bincn=function(e){f("number"==typeof e);var a=e%26,c=(e-a)/26,d=1<>>26,i&=67108863,this.words[t]=i}return 0!==b&&(this.words[t]=b,this.length++),this},b.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},b.prototype.cmpn=function(e){var a,c=e<0;if(0!==this.negative&&!c)return-1;if(0===this.negative&&c)return 1;if(this.strip(),this.length>1)a=1;else{c&&(e=-e),f(e<=67108863,"Number is too big");var d=0|this.words[0];a=d===e?0:de.length)return 1;if(this.length=0;c--){var f=0|this.words[c],d=0|e.words[c];if(f!==d){fd&&(a=1);break}}return a},b.prototype.gtn=function(e){return 1===this.cmpn(e)},b.prototype.gt=function(e){return 1===this.cmp(e)},b.prototype.gten=function(e){return this.cmpn(e)>=0},b.prototype.gte=function(e){return this.cmp(e)>=0},b.prototype.ltn=function(e){return-1===this.cmpn(e)},b.prototype.lt=function(e){return-1===this.cmp(e)},b.prototype.lten=function(e){return this.cmpn(e)<=0},b.prototype.lte=function(e){return this.cmp(e)<=0},b.prototype.eqn=function(e){return 0===this.cmpn(e)},b.prototype.eq=function(e){return 0===this.cmp(e)},b.red=function(e){return new M(e)},b.prototype.toRed=function(e){return f(!this.red,"Already a number in reduction context"),f(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},b.prototype.fromRed=function(){return f(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},b.prototype._forceRed=function(e){return this.red=e,this},b.prototype.forceRed=function(e){return f(!this.red,"Already a number in reduction context"),this._forceRed(e)},b.prototype.redAdd=function(e){return f(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},b.prototype.redIAdd=function(e){return f(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},b.prototype.redSub=function(e){return f(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},b.prototype.redISub=function(e){return f(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},b.prototype.redShl=function(e){return f(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},b.prototype.redMul=function(e){return f(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},b.prototype.redIMul=function(e){return f(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},b.prototype.redSqr=function(){return f(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},b.prototype.redISqr=function(){return f(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},b.prototype.redSqrt=function(){return f(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},b.prototype.redInvm=function(){return f(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},b.prototype.redNeg=function(){return f(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},b.prototype.redPow=function(e){return f(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function m(e,a){this.name=e,this.p=new b(a,16),this.n=this.p.bitLength(),this.k=new b(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var a=b._prime(e);this.m=a.p,this.prime=a}else f(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new b(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)}m.prototype._tmp=function(){var e=new b(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var a,c=e;do{this.split(c,this.tmp),a=(c=(c=this.imulK(c)).iadd(this.tmp)).bitLength()}while(a>this.n);var f=a0?c.isub(this.p):void 0!==c.strip?c.strip():c._strip(),c},m.prototype.split=function(e,a){e.iushrn(this.n,0,a)},m.prototype.imulK=function(e){return e.imul(this.k)},d(y,m),y.prototype.split=function(e,a){for(var c=4194303,f=Math.min(e.length,9),d=0;d>>22,b=t}b>>>=22,e.words[d-10]=b,0===b&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,c=0;c>>=26,e.words[c]=d,a=f}return 0!==a&&(e.words[e.length++]=a),e},b._prime=function(e){if(g[e])return g[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new _;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return g[e]=a,a},M.prototype._verify1=function(e){f(0===e.negative,"red works only with positives"),f(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,a){f(!(e.negative|a.negative),"red works only with positives"),f(e.red&&e.red===a.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,a){this._verify2(e,a);var c=e.add(a);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},M.prototype.iadd=function(e,a){this._verify2(e,a);var c=e.iadd(a);return c.cmp(this.m)>=0&&c.isub(this.m),c},M.prototype.sub=function(e,a){this._verify2(e,a);var c=e.sub(a);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},M.prototype.isub=function(e,a){this._verify2(e,a);var c=e.isub(a);return c.cmpn(0)<0&&c.iadd(this.m),c},M.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},M.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},M.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(f(a%2==1),3===a){var c=this.m.add(new b(1)).iushrn(2);return this.pow(e,c)}for(var d=this.m.subn(1),t=0;!d.isZero()&&0===d.andln(1);)t++,d.iushrn(1);f(!d.isZero());var i=new b(1).toRed(this),r=i.redNeg(),n=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new b(2*o*o).toRed(this);0!==this.pow(o,n).cmp(r);)o.redIAdd(r);for(var s=this.pow(o,d),l=this.pow(e,d.addn(1).iushrn(1)),h=this.pow(e,d),u=t;0!==h.cmp(i);){for(var x=h,p=0;0!==x.cmp(i);p++)x=x.redSqr();f(p=0;f--){for(var n=a.words[f],o=r-1;o>=0;o--){var s=n>>o&1;d!==c[0]&&(d=this.sqr(d)),0!==s||0!==t?(t<<=1,t|=s,(4==++i||0===f&&0===o)&&(d=this.mul(d,c[t]),i=0,t=0)):i=0}r=26}return d},M.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},M.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},b.mont=function(e){return new A(e)},d(A,M),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},A.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var c=e.imul(a),f=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(f).iushrn(this.shift),b=d;return d.cmp(this.m)>=0?b=d.isub(this.m):d.cmpn(0)<0&&(b=d.iadd(this.m)),b._forceRed(this)},A.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new b(0)._forceRed(this);var c=e.mul(a),f=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(f).iushrn(this.shift),t=d;return d.cmp(this.m)>=0?t=d.isub(this.m):d.cmpn(0)<0&&(t=d.iadd(this.m)),t._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=c.nmd(e),this)},3349:e=>{function a(e,a){if(!e)throw new Error(a||"Assertion failed")}e.exports=a,a.equal=function(e,a,c){if(e!=a)throw new Error(c||"Assertion failed: "+e+" != "+a)}},4367:(e,a)=>{"use strict";var c=a;function f(e){return 1===e.length?"0"+e:e}function d(e){for(var a="",c=0;c>8,t=255&d;b?c.push(b,t):c.push(t)}return c},c.zero2=f,c.toHex=d,c.encode=function(e,a){return"hex"===a?d(e):e}},8633:(e,a,c)=>{"use strict";const{encodeText:f}=c(4084);e.exports=class{constructor(e,a,c,d){this.name=e,this.code=a,this.codeBuf=f(this.code),this.alphabet=d,this.codec=c(d)}encode(e){return this.codec.encode(e)}decode(e){for(const a of e)if(this.alphabet&&this.alphabet.indexOf(a)<0)throw new Error(`invalid character '${a}' in '${e}'`);return this.codec.decode(e)}}},7579:(e,a,c)=>{"use strict";const f=c(5084),d=c(8633),{rfc4648:b}=c(9417),{decodeText:t,encodeText:i}=c(4084),r=[["identity","\0",()=>({encode:t,decode:i}),""],["base2","0",b(1),"01"],["base8","7",b(3),"01234567"],["base10","9",f,"0123456789"],["base16","f",b(4),"0123456789abcdef"],["base16upper","F",b(4),"0123456789ABCDEF"],["base32hex","v",b(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",b(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",b(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",b(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",b(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",b(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",b(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",b(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",b(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",f,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",f,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",f,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",f,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",b(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",b(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",b(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",b(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],n=r.reduce(((e,a)=>(e[a[0]]=new d(a[0],a[1],a[2],a[3]),e)),{}),o=r.reduce(((e,a)=>(e[a[1]]=n[a[0]],e)),{});e.exports={names:n,codes:o}},1466:(e,a,c)=>{"use strict";const f=c(7579),{encodeText:d,decodeText:b,concat:t}=c(4084);function i(e){if(Object.prototype.hasOwnProperty.call(f.names,e))return f.names[e];if(Object.prototype.hasOwnProperty.call(f.codes,e))return f.codes[e];throw new Error(`Unsupported encoding: ${e}`)}(a=e.exports=function(e,a){if(!a)throw new Error("requires an encoded Uint8Array");const{name:c,codeBuf:f}=i(e);return function(e,a){i(e).decode(b(a))}(c,a),t([f,a],f.length+a.length)}).encode=function(e,a){const c=i(e),f=d(c.encode(a));return t([c.codeBuf,f],c.codeBuf.length+f.length)},a.decode=function(e){e instanceof Uint8Array&&(e=b(e));const a=e[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(a)&&(e=e.toLowerCase()),i(e[0]).decode(e.substring(1))},a.isEncoded=function(e){if(e instanceof Uint8Array&&(e=b(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return i(e[0]).name}catch(e){return!1}},a.encoding=i,a.encodingFromData=function(e){return e instanceof Uint8Array&&(e=b(e)),i(e[0])};const r=Object.freeze(f.names),n=Object.freeze(f.codes);a.names=r,a.codes=n},9417:e=>{"use strict";e.exports={rfc4648:e=>a=>({encode:c=>((e,a,c)=>{const f="="===a[a.length-1],d=(1<c;)t-=c,b+=a[d&i>>t];if(t&&(b+=a[d&i<((e,a,c)=>{const f={};for(let e=0;e=8&&(t-=8,b[r++]=255&i>>t)}if(t>=c||255&i<<8-t)throw new SyntaxError("Unexpected end of data");return b})(c,a,e)})}},4084:e=>{"use strict";const a=new TextDecoder,c=new TextEncoder;e.exports={decodeText:e=>a.decode(e),encodeText:e=>c.encode(e),concat:function(e,a){const c=new Uint8Array(a);let f=0;for(const a of e)c.set(a,f),f+=a.length;return c}}},5194:e=>{e.exports=function e(f,d){var b,t=0,i=0,r=d=d||0,n=f.length;do{if(r>=n||i>49)throw e.bytes=0,new RangeError("Could not decode varint");b=f[r++],t+=i<28?(b&c)<=a);return e.bytes=r-d,t};var a=128,c=127},5134:e=>{e.exports=function e(d,b,t){if(Number.MAX_SAFE_INTEGER&&d>Number.MAX_SAFE_INTEGER)throw e.bytes=0,new RangeError("Could not encode varint");b=b||[];for(var i=t=t||0;d>=f;)b[t++]=255&d|a,d/=128;for(;d&c;)b[t++]=255&d|a,d>>>=7;return b[t]=0|d,e.bytes=t-i+1,b};var a=128,c=-128,f=Math.pow(2,31)},38:(e,a,c)=>{e.exports={encode:c(5134),decode:c(5194),encodingLength:c(6516)}},6516:e=>{var a=Math.pow(2,7),c=Math.pow(2,14),f=Math.pow(2,21),d=Math.pow(2,28),b=Math.pow(2,35),t=Math.pow(2,42),i=Math.pow(2,49),r=Math.pow(2,56),n=Math.pow(2,63);e.exports=function(e){return e{"use strict";const a=Object.freeze({identity:0,cidv1:1,cidv2:2,cidv3:3,ip4:4,tcp:6,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,dccp:33,"murmur3-128":34,"murmur3-32":35,ip6:41,ip6zone:42,path:47,multicodec:48,multihash:49,multiaddr:50,multibase:51,dns:53,dns4:54,dns6:55,dnsaddr:56,protobuf:80,cbor:81,raw:85,"dbl-sha2-256":86,rlp:96,bencode:99,"dag-pb":112,"dag-cbor":113,"libp2p-key":114,"git-raw":120,"torrent-info":123,"torrent-file":124,"leofcoin-block":129,"leofcoin-tx":130,"leofcoin-pr":131,sctp:132,"dag-jose":133,"dag-cose":134,"eth-block":144,"eth-block-list":145,"eth-tx-trie":146,"eth-tx":147,"eth-tx-receipt-trie":148,"eth-tx-receipt":149,"eth-state-trie":150,"eth-account-snapshot":151,"eth-storage-trie":152,"eth-receipt-log-trie":153,"eth-reciept-log":154,"bitcoin-block":176,"bitcoin-tx":177,"bitcoin-witness-commitment":178,"zcash-block":192,"zcash-tx":193,"caip-50":202,streamid:206,"stellar-block":208,"stellar-tx":209,md4:212,md5:213,bmt:214,"decred-block":224,"decred-tx":225,"ipld-ns":226,"ipfs-ns":227,"swarm-ns":228,"ipns-ns":229,zeronet:230,"secp256k1-pub":231,"bls12_381-g1-pub":234,"bls12_381-g2-pub":235,"x25519-pub":236,"ed25519-pub":237,"bls12_381-g1g2-pub":238,"dash-block":240,"dash-tx":241,"swarm-manifest":250,"swarm-feed":251,udp:273,"p2p-webrtc-star":275,"p2p-webrtc-direct":276,"p2p-stardust":277,"p2p-circuit":290,"dag-json":297,udt:301,utp:302,unix:400,thread:406,p2p:421,ipfs:421,https:443,onion:444,onion3:445,garlic64:446,garlic32:447,tls:448,noise:454,quic:460,ws:477,wss:478,"p2p-websocket-star":479,http:480,"swhid-1-snp":496,json:512,messagepack:513,"libp2p-peer-record":769,"libp2p-relay-rsvp":770,"car-index-sorted":1024,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,"p256-pub":4608,"p384-pub":4609,"p521-pub":4610,"ed448-pub":4611,"x448-pub":4612,"ed25519-priv":4864,"secp256k1-priv":4865,"x25519-priv":4866,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082,"zeroxcert-imprint-256":52753,"fil-commitment-unsealed":61697,"fil-commitment-sealed":61698,"holochain-adr-v0":8417572,"holochain-adr-v1":8483108,"holochain-key-v0":9728292,"holochain-key-v1":9793828,"holochain-sig-v0":10645796,"holochain-sig-v1":10711332,"skynet-ns":11639056,"arweave-ns":11704592});e.exports={baseTable:a}},2021:(e,a,c)=>{"use strict";const f=c(38),{concat:d}=c(5007),b=c(2693),{nameToVarint:t,constantToCode:i,nameToCode:r,codeToName:n}=c(482);function o(e){const a=f.decode(e),c=n[a];if(void 0===c)throw new Error(`Code "${a}" not found`);return c}function s(e){return n[e]}function l(e){const a=r[e];if(void 0===a)throw new Error(`Codec "${e}" not found`);return a}function h(e){return f.decode(e)}function u(e){const a=t[e];if(void 0===a)throw new Error(`Codec "${e}" not found`);return a}function x(e){return b.varintEncode(e)}e.exports={addPrefix:function(e,a){let c;if(e instanceof Uint8Array)c=b.varintUint8ArrayEncode(e);else{if(!t[e])throw new Error("multicodec not recognized");c=t[e]}return d([c,a],c.length+a.length)},rmPrefix:function(e){return f.decode(e),e.slice(f.decode.bytes)},getNameFromData:o,getNameFromCode:s,getCodeFromName:l,getCodeFromData:h,getVarintFromName:u,getVarintFromCode:x,getCodec:function(e){return o(e)},getName:function(e){return s(e)},getNumber:function(e){return l(e)},getCode:function(e){return h(e)},getCodeVarint:function(e){return u(e)},getVarint:function(e){return Array.from(x(e))},...i,nameToVarint:t,nameToCode:r,codeToName:n}},482:(e,a,c)=>{"use strict";const{baseTable:f}=c(5661),d=c(2693).varintEncode,b={},t={},i={};for(const e in f){const a=e,c=f[a];b[a]=d(c),t[a.toUpperCase().replace(/-/g,"_")]=c,i[c]||(i[c]=a)}Object.freeze(b),Object.freeze(t),Object.freeze(i);const r=Object.freeze(f);e.exports={nameToVarint:b,constantToCode:t,nameToCode:r,codeToName:i}},2693:(e,a,c)=>{"use strict";const f=c(38),{toString:d}=c(7302),{fromString:b}=c(4117);function t(e){return parseInt(d(e,"base16"),16)}e.exports={numberToUint8Array:function(e){let a=e.toString(16);return a.length%2==1&&(a="0"+a),b(a,"base16")},uint8ArrayToNumber:t,varintUint8ArrayEncode:function(e){return Uint8Array.from(f.encode(t(e)))},varintEncode:function(e){return Uint8Array.from(f.encode(e))}}},6994:(e,a,c)=>{"use strict";const{Buffer:f}=c(8287);e.exports=class{constructor(e,a,c,d){this.name=e,this.code=a,this.codeBuf=f.from(this.code),this.alphabet=d,this.engine=c(d)}encode(e){return this.engine.encode(e)}decode(e){for(const a of e)if(this.alphabet&&this.alphabet.indexOf(a)<0)throw new Error(`invalid character '${a}' in '${e}'`);return this.engine.decode(e)}}},6082:(e,a,c)=>{"use strict";const f=c(5364),d=c(6994),b=c(5920),{decodeText:t,encodeText:i}=c(639),r=[["identity","\0",()=>({encode:t,decode:i}),""],["base2","0",b(1),"01"],["base8","7",b(3),"01234567"],["base10","9",f,"0123456789"],["base16","f",b(4),"0123456789abcdef"],["base16upper","F",b(4),"0123456789ABCDEF"],["base32hex","v",b(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",b(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",b(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",b(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",b(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",b(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",b(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",b(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",b(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",f,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",f,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",f,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",f,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",b(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",b(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",b(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",b(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],n=r.reduce(((e,a)=>(e[a[0]]=new d(a[0],a[1],a[2],a[3]),e)),{}),o=r.reduce(((e,a)=>(e[a[1]]=n[a[0]],e)),{});e.exports={names:n,codes:o}},2879:(e,a,c)=>{"use strict";const{Buffer:f}=c(8287),d=c(6082),{decodeText:b,asBuffer:t}=c(639);function i(e){if(d.names[e])return d.names[e];if(d.codes[e])return d.codes[e];throw new Error(`Unsupported encoding: ${e}`)}(a=e.exports=function(e,a){if(!a)throw new Error("requires an encoded buffer");const{name:c,codeBuf:d}=i(e);!function(e,a){i(e).decode(b(a))}(c,a);const t=f.alloc(d.length+a.length);return t.set(d,0),t.set(a,d.length),t}).encode=function(e,a){const c=i(e);return f.concat([c.codeBuf,f.from(c.encode(a))])},a.decode=function(e){ArrayBuffer.isView(e)&&(e=b(e));const a=e[0];["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(a)&&(e=e.toLowerCase());const c=i(e[0]);return t(c.decode(e.substring(1)))},a.isEncoded=function(e){if(e instanceof Uint8Array&&(e=b(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return i(e[0]).name}catch(e){return!1}},a.encoding=i,a.encodingFromData=function(e){return e instanceof Uint8Array&&(e=b(e)),i(e[0])},a.names=Object.freeze(d.names),a.codes=Object.freeze(d.codes)},5920:e=>{"use strict";e.exports=e=>a=>({encode:c=>((e,a,c)=>{const f="="===a[a.length-1],d=(1<c;)t-=c,b+=a[d&i>>t];if(t&&(b+=a[d&i<((e,a,c)=>{const f={};for(let e=0;e=8&&(t-=8,b[r++]=255&i>>t)}if(t>=c||255&i<<8-t)throw new SyntaxError("Unexpected end of data");return b})(c,a,e)})},639:(e,a,c)=>{"use strict";const{Buffer:f}=c(8287),{TextEncoder:d,TextDecoder:b}=c(7019),t=new b,i=new d;e.exports={decodeText:e=>t.decode(e),encodeText:e=>i.encode(e),asBuffer:({buffer:e,byteLength:a,byteOffset:c})=>f.from(e,c,a)}},3702:e=>{"use strict";const a=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});e.exports={names:a}},4243:(e,a,c)=>{"use strict";const{Buffer:f}=c(8287),d=c(2879),b=c(1203),{names:t}=c(3702),{TextDecoder:i}=c(7019),r=new i,n={};for(const e in t)n[t[e]]=e;function o(e){a.decode(e)}a.names=t,a.codes=Object.freeze(n),a.toHexString=function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return(f.isBuffer(e)?e:f.from(e.buffer,e.byteOffset,e.byteLength)).toString("hex")},a.fromHexString=function(e){return f.from(e,"hex")},a.toB58String=function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return r.decode(d.encode("base58btc",e)).slice(1)},a.fromB58String=function(e){const a=e instanceof Uint8Array?r.decode(e):e;return d.decode("z"+a)},a.decode=function(e){if(!(e instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");let c=f.isBuffer(e)?e:f.from(e.buffer,e.byteOffset,e.byteLength);if(c.length<2)throw new Error("multihash too short. must be > 2 bytes.");const d=b.decode(c);if(!a.isValidCode(d))throw new Error(`multihash unknown function code: 0x${d.toString(16)}`);c=c.slice(b.decode.bytes);const t=b.decode(c);if(t<0)throw new Error(`multihash invalid length: ${t}`);if(c=c.slice(b.decode.bytes),c.length!==t)throw new Error(`multihash length inconsistent: 0x${c.toString("hex")}`);return{code:d,name:n[d],length:t,digest:c}},a.encode=function(e,c,d){if(!e||void 0===c)throw new Error("multihash encode requires at least two args: digest, code");const t=a.coerceCode(c);if(!(e instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(null==d&&(d=e.length),d&&e.length!==d)throw new Error("digest length should be equal to specified length.");const i=b.encode(t),r=b.encode(d),n=f.alloc(i.length+r.length+e.length);return n.set(i,0),n.set(r,i.length),n.set(e,i.length+r.length),n},a.coerceCode=function(e){let c=e;if("string"==typeof e){if(void 0===t[e])throw new Error(`Unrecognized hash function named: ${e}`);c=t[e]}if("number"!=typeof c)throw new Error(`Hash function code should be a number. Got: ${c}`);if(void 0===n[c]&&!a.isAppCode(c))throw new Error(`Unrecognized function code: ${c}`);return c},a.isAppCode=function(e){return e>0&&e<16},a.isValidCode=function(e){return!!a.isAppCode(e)||!!n[e]},a.validate=o,a.prefix=function(e){return o(e),f.from(e.buffer,e.byteOffset,2)}},6889:e=>{e.exports=function e(c,f){if(!c){var d=new a(f);throw Error.captureStackTrace&&Error.captureStackTrace(d,e),d}};class a extends Error{}a.prototype.name="AssertionError"},2045:(e,a,c)=>{"use strict";const f=c(7526),d=c(251),b="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;a.hp=r,a.IS=50;const t=2147483647;function i(e){if(e>t)throw new RangeError('The value "'+e+'" is invalid for option "size"');const a=new Uint8Array(e);return Object.setPrototypeOf(a,r.prototype),a}function r(e,a,c){if("number"==typeof e){if("string"==typeof a)throw new TypeError('The "string" argument must be of type string. Received type number');return s(e)}return n(e,a,c)}function n(e,a,c){if("string"==typeof e)return function(e,a){if("string"==typeof a&&""!==a||(a="utf8"),!r.isEncoding(a))throw new TypeError("Unknown encoding: "+a);const c=0|x(e,a);let f=i(c);const d=f.write(e,a);return d!==c&&(f=f.slice(0,d)),f}(e,a);if(ArrayBuffer.isView(e))return function(e){if(W(e,Uint8Array)){const a=new Uint8Array(e);return h(a.buffer,a.byteOffset,a.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer))return h(e,a,c);if("undefined"!=typeof SharedArrayBuffer&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return h(e,a,c);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const f=e.valueOf&&e.valueOf();if(null!=f&&f!==e)return r.from(f,a,c);const d=function(e){if(r.isBuffer(e)){const a=0|u(e.length),c=i(a);return 0===c.length||e.copy(c,0,0,a),c}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?i(0):l(e):"Buffer"===e.type&&Array.isArray(e.data)?l(e.data):void 0}(e);if(d)return d;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return r.from(e[Symbol.toPrimitive]("string"),a,c);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function s(e){return o(e),i(e<0?0:0|u(e))}function l(e){const a=e.length<0?0:0|u(e.length),c=i(a);for(let f=0;f=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+t.toString(16)+" bytes");return 0|e}function x(e,a){if(r.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const c=e.length,f=arguments.length>2&&!0===arguments[2];if(!f&&0===c)return 0;let d=!1;for(;;)switch(a){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return V(e).length;default:if(d)return f?-1:H(e).length;a=(""+a).toLowerCase(),d=!0}}function p(e,a,c){let f=!1;if((void 0===a||a<0)&&(a=0),a>this.length)return"";if((void 0===c||c>this.length)&&(c=this.length),c<=0)return"";if((c>>>=0)<=(a>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,a,c);case"utf8":case"utf-8":return I(this,a,c);case"ascii":return E(this,a,c);case"latin1":case"binary":return S(this,a,c);case"base64":return L(this,a,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,a,c);default:if(f)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),f=!0}}function g(e,a,c){const f=e[a];e[a]=e[c],e[c]=f}function m(e,a,c,f,d){if(0===e.length)return-1;if("string"==typeof c?(f=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),Y(c=+c)&&(c=d?0:e.length-1),c<0&&(c=e.length+c),c>=e.length){if(d)return-1;c=e.length-1}else if(c<0){if(!d)return-1;c=0}if("string"==typeof a&&(a=r.from(a,f)),r.isBuffer(a))return 0===a.length?-1:y(e,a,c,f,d);if("number"==typeof a)return a&=255,"function"==typeof Uint8Array.prototype.indexOf?d?Uint8Array.prototype.indexOf.call(e,a,c):Uint8Array.prototype.lastIndexOf.call(e,a,c):y(e,[a],c,f,d);throw new TypeError("val must be string, number or Buffer")}function y(e,a,c,f,d){let b,t=1,i=e.length,r=a.length;if(void 0!==f&&("ucs2"===(f=String(f).toLowerCase())||"ucs-2"===f||"utf16le"===f||"utf-16le"===f)){if(e.length<2||a.length<2)return-1;t=2,i/=2,r/=2,c/=2}function n(e,a){return 1===t?e[a]:e.readUInt16BE(a*t)}if(d){let f=-1;for(b=c;bi&&(c=i-r),b=c;b>=0;b--){let c=!0;for(let f=0;fd&&(f=d):f=d;const b=a.length;let t;for(f>b/2&&(f=b/2),t=0;t>8,d=c%256,b.push(d),b.push(f);return b}(a,e.length-c),e,c,f)}function L(e,a,c){return 0===a&&c===e.length?f.fromByteArray(e):f.fromByteArray(e.slice(a,c))}function I(e,a,c){c=Math.min(e.length,c);const f=[];let d=a;for(;d239?4:a>223?3:a>191?2:1;if(d+t<=c){let c,f,i,r;switch(t){case 1:a<128&&(b=a);break;case 2:c=e[d+1],128==(192&c)&&(r=(31&a)<<6|63&c,r>127&&(b=r));break;case 3:c=e[d+1],f=e[d+2],128==(192&c)&&128==(192&f)&&(r=(15&a)<<12|(63&c)<<6|63&f,r>2047&&(r<55296||r>57343)&&(b=r));break;case 4:c=e[d+1],f=e[d+2],i=e[d+3],128==(192&c)&&128==(192&f)&&128==(192&i)&&(r=(15&a)<<18|(63&c)<<12|(63&f)<<6|63&i,r>65535&&r<1114112&&(b=r))}}null===b?(b=65533,t=1):b>65535&&(b-=65536,f.push(b>>>10&1023|55296),b=56320|1023&b),f.push(b),d+=t}return function(e){const a=e.length;if(a<=k)return String.fromCharCode.apply(String,e);let c="",f=0;for(;ff.length?(r.isBuffer(a)||(a=r.from(a)),a.copy(f,d)):Uint8Array.prototype.set.call(f,a,d);else{if(!r.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(f,d)}d+=a.length}return f},r.byteLength=x,r.prototype._isBuffer=!0,r.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let a=0;ac&&(e+=" ... "),""},b&&(r.prototype[b]=r.prototype.inspect),r.prototype.compare=function(e,a,c,f,d){if(W(e,Uint8Array)&&(e=r.from(e,e.offset,e.byteLength)),!r.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===a&&(a=0),void 0===c&&(c=e?e.length:0),void 0===f&&(f=0),void 0===d&&(d=this.length),a<0||c>e.length||f<0||d>this.length)throw new RangeError("out of range index");if(f>=d&&a>=c)return 0;if(f>=d)return-1;if(a>=c)return 1;if(this===e)return 0;let b=(d>>>=0)-(f>>>=0),t=(c>>>=0)-(a>>>=0);const i=Math.min(b,t),n=this.slice(f,d),o=e.slice(a,c);for(let e=0;e>>=0,isFinite(c)?(c>>>=0,void 0===f&&(f="utf8")):(f=c,c=void 0)}const d=this.length-a;if((void 0===c||c>d)&&(c=d),e.length>0&&(c<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");f||(f="utf8");let b=!1;for(;;)switch(f){case"hex":return _(this,e,a,c);case"utf8":case"utf-8":return v(this,e,a,c);case"ascii":case"latin1":case"binary":return w(this,e,a,c);case"base64":return M(this,e,a,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,a,c);default:if(b)throw new TypeError("Unknown encoding: "+f);f=(""+f).toLowerCase(),b=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function E(e,a,c){let f="";c=Math.min(e.length,c);for(let d=a;df)&&(c=f);let d="";for(let f=a;fc)throw new RangeError("Trying to access beyond buffer length")}function O(e,a,c,f,d,b){if(!r.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>d||ae.length)throw new RangeError("Index out of range")}function P(e,a,c,f,d){z(a,f,d,e,c,7);let b=Number(a&BigInt(4294967295));e[c++]=b,b>>=8,e[c++]=b,b>>=8,e[c++]=b,b>>=8,e[c++]=b;let t=Number(a>>BigInt(32)&BigInt(4294967295));return e[c++]=t,t>>=8,e[c++]=t,t>>=8,e[c++]=t,t>>=8,e[c++]=t,c}function R(e,a,c,f,d){z(a,f,d,e,c,7);let b=Number(a&BigInt(4294967295));e[c+7]=b,b>>=8,e[c+6]=b,b>>=8,e[c+5]=b,b>>=8,e[c+4]=b;let t=Number(a>>BigInt(32)&BigInt(4294967295));return e[c+3]=t,t>>=8,e[c+2]=t,t>>=8,e[c+1]=t,t>>=8,e[c]=t,c+8}function T(e,a,c,f,d,b){if(c+f>e.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function U(e,a,c,f,b){return a=+a,c>>>=0,b||T(e,0,c,4),d.write(e,a,c,f,23,4),c+4}function j(e,a,c,f,b){return a=+a,c>>>=0,b||T(e,0,c,8),d.write(e,a,c,f,52,8),c+8}r.prototype.slice=function(e,a){const c=this.length;(e=~~e)<0?(e+=c)<0&&(e=0):e>c&&(e=c),(a=void 0===a?c:~~a)<0?(a+=c)<0&&(a=0):a>c&&(a=c),a>>=0,a>>>=0,c||F(e,a,this.length);let f=this[e],d=1,b=0;for(;++b>>=0,a>>>=0,c||F(e,a,this.length);let f=this[e+--a],d=1;for(;a>0&&(d*=256);)f+=this[e+--a]*d;return f},r.prototype.readUint8=r.prototype.readUInt8=function(e,a){return e>>>=0,a||F(e,1,this.length),this[e]},r.prototype.readUint16LE=r.prototype.readUInt16LE=function(e,a){return e>>>=0,a||F(e,2,this.length),this[e]|this[e+1]<<8},r.prototype.readUint16BE=r.prototype.readUInt16BE=function(e,a){return e>>>=0,a||F(e,2,this.length),this[e]<<8|this[e+1]},r.prototype.readUint32LE=r.prototype.readUInt32LE=function(e,a){return e>>>=0,a||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},r.prototype.readUint32BE=r.prototype.readUInt32BE=function(e,a){return e>>>=0,a||F(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},r.prototype.readBigUInt64LE=$((function(e){Q(e>>>=0,"offset");const a=this[e],c=this[e+7];void 0!==a&&void 0!==c||G(e,this.length-8);const f=a+256*this[++e]+65536*this[++e]+this[++e]*2**24,d=this[++e]+256*this[++e]+65536*this[++e]+c*2**24;return BigInt(f)+(BigInt(d)<>>=0,"offset");const a=this[e],c=this[e+7];void 0!==a&&void 0!==c||G(e,this.length-8);const f=a*2**24+65536*this[++e]+256*this[++e]+this[++e],d=this[++e]*2**24+65536*this[++e]+256*this[++e]+c;return(BigInt(f)<>>=0,a>>>=0,c||F(e,a,this.length);let f=this[e],d=1,b=0;for(;++b=d&&(f-=Math.pow(2,8*a)),f},r.prototype.readIntBE=function(e,a,c){e>>>=0,a>>>=0,c||F(e,a,this.length);let f=a,d=1,b=this[e+--f];for(;f>0&&(d*=256);)b+=this[e+--f]*d;return d*=128,b>=d&&(b-=Math.pow(2,8*a)),b},r.prototype.readInt8=function(e,a){return e>>>=0,a||F(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},r.prototype.readInt16LE=function(e,a){e>>>=0,a||F(e,2,this.length);const c=this[e]|this[e+1]<<8;return 32768&c?4294901760|c:c},r.prototype.readInt16BE=function(e,a){e>>>=0,a||F(e,2,this.length);const c=this[e+1]|this[e]<<8;return 32768&c?4294901760|c:c},r.prototype.readInt32LE=function(e,a){return e>>>=0,a||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},r.prototype.readInt32BE=function(e,a){return e>>>=0,a||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},r.prototype.readBigInt64LE=$((function(e){Q(e>>>=0,"offset");const a=this[e],c=this[e+7];void 0!==a&&void 0!==c||G(e,this.length-8);const f=this[e+4]+256*this[e+5]+65536*this[e+6]+(c<<24);return(BigInt(f)<>>=0,"offset");const a=this[e],c=this[e+7];void 0!==a&&void 0!==c||G(e,this.length-8);const f=(a<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(f)<>>=0,a||F(e,4,this.length),d.read(this,e,!0,23,4)},r.prototype.readFloatBE=function(e,a){return e>>>=0,a||F(e,4,this.length),d.read(this,e,!1,23,4)},r.prototype.readDoubleLE=function(e,a){return e>>>=0,a||F(e,8,this.length),d.read(this,e,!0,52,8)},r.prototype.readDoubleBE=function(e,a){return e>>>=0,a||F(e,8,this.length),d.read(this,e,!1,52,8)},r.prototype.writeUintLE=r.prototype.writeUIntLE=function(e,a,c,f){e=+e,a>>>=0,c>>>=0,f||O(this,e,a,c,Math.pow(2,8*c)-1,0);let d=1,b=0;for(this[a]=255&e;++b>>=0,c>>>=0,f||O(this,e,a,c,Math.pow(2,8*c)-1,0);let d=c-1,b=1;for(this[a+d]=255&e;--d>=0&&(b*=256);)this[a+d]=e/b&255;return a+c},r.prototype.writeUint8=r.prototype.writeUInt8=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,1,255,0),this[a]=255&e,a+1},r.prototype.writeUint16LE=r.prototype.writeUInt16LE=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,2,65535,0),this[a]=255&e,this[a+1]=e>>>8,a+2},r.prototype.writeUint16BE=r.prototype.writeUInt16BE=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,2,65535,0),this[a]=e>>>8,this[a+1]=255&e,a+2},r.prototype.writeUint32LE=r.prototype.writeUInt32LE=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,4,4294967295,0),this[a+3]=e>>>24,this[a+2]=e>>>16,this[a+1]=e>>>8,this[a]=255&e,a+4},r.prototype.writeUint32BE=r.prototype.writeUInt32BE=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,4,4294967295,0),this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e,a+4},r.prototype.writeBigUInt64LE=$((function(e,a=0){return P(this,e,a,BigInt(0),BigInt("0xffffffffffffffff"))})),r.prototype.writeBigUInt64BE=$((function(e,a=0){return R(this,e,a,BigInt(0),BigInt("0xffffffffffffffff"))})),r.prototype.writeIntLE=function(e,a,c,f){if(e=+e,a>>>=0,!f){const f=Math.pow(2,8*c-1);O(this,e,a,c,f-1,-f)}let d=0,b=1,t=0;for(this[a]=255&e;++d>>=0,!f){const f=Math.pow(2,8*c-1);O(this,e,a,c,f-1,-f)}let d=c-1,b=1,t=0;for(this[a+d]=255&e;--d>=0&&(b*=256);)e<0&&0===t&&0!==this[a+d+1]&&(t=1),this[a+d]=(e/b|0)-t&255;return a+c},r.prototype.writeInt8=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,1,127,-128),e<0&&(e=255+e+1),this[a]=255&e,a+1},r.prototype.writeInt16LE=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,2,32767,-32768),this[a]=255&e,this[a+1]=e>>>8,a+2},r.prototype.writeInt16BE=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,2,32767,-32768),this[a]=e>>>8,this[a+1]=255&e,a+2},r.prototype.writeInt32LE=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,4,2147483647,-2147483648),this[a]=255&e,this[a+1]=e>>>8,this[a+2]=e>>>16,this[a+3]=e>>>24,a+4},r.prototype.writeInt32BE=function(e,a,c){return e=+e,a>>>=0,c||O(this,e,a,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[a]=e>>>24,this[a+1]=e>>>16,this[a+2]=e>>>8,this[a+3]=255&e,a+4},r.prototype.writeBigInt64LE=$((function(e,a=0){return P(this,e,a,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),r.prototype.writeBigInt64BE=$((function(e,a=0){return R(this,e,a,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),r.prototype.writeFloatLE=function(e,a,c){return U(this,e,a,!0,c)},r.prototype.writeFloatBE=function(e,a,c){return U(this,e,a,!1,c)},r.prototype.writeDoubleLE=function(e,a,c){return j(this,e,a,!0,c)},r.prototype.writeDoubleBE=function(e,a,c){return j(this,e,a,!1,c)},r.prototype.copy=function(e,a,c,f){if(!r.isBuffer(e))throw new TypeError("argument should be a Buffer");if(c||(c=0),f||0===f||(f=this.length),a>=e.length&&(a=e.length),a||(a=0),f>0&&f=this.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("sourceEnd out of bounds");f>this.length&&(f=this.length),e.length-a>>=0,c=void 0===c?this.length:c>>>0,e||(e=0),"number"==typeof e)for(d=a;d=f+4;c-=3)a=`_${e.slice(c-3,c)}${a}`;return`${e.slice(0,c)}${a}`}function z(e,a,c,f,d,b){if(e>c||e3?0===a||a===BigInt(0)?`>= 0${f} and < 2${f} ** ${8*(b+1)}${f}`:`>= -(2${f} ** ${8*(b+1)-1}${f}) and < 2 ** ${8*(b+1)-1}${f}`:`>= ${a}${f} and <= ${c}${f}`,new N.ERR_OUT_OF_RANGE("value",d,e)}!function(e,a,c){Q(a,"offset"),void 0!==e[a]&&void 0!==e[a+c]||G(a,e.length-(c+1))}(f,d,b)}function Q(e,a){if("number"!=typeof e)throw new N.ERR_INVALID_ARG_TYPE(a,"number",e)}function G(e,a,c){if(Math.floor(e)!==e)throw Q(e,c),new N.ERR_OUT_OF_RANGE(c||"offset","an integer",e);if(a<0)throw new N.ERR_BUFFER_OUT_OF_BOUNDS;throw new N.ERR_OUT_OF_RANGE(c||"offset",`>= ${c?1:0} and <= ${a}`,e)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(e,a){return`The "${e}" argument must be of type number. Received type ${typeof a}`}),TypeError),q("ERR_OUT_OF_RANGE",(function(e,a,c){let f=`The value of "${e}" is out of range.`,d=c;return Number.isInteger(c)&&Math.abs(c)>2**32?d=D(String(c)):"bigint"==typeof c&&(d=String(c),(c>BigInt(2)**BigInt(32)||c<-(BigInt(2)**BigInt(32)))&&(d=D(d)),d+="n"),f+=` It must be ${a}. Received ${d}`,f}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function H(e,a){let c;a=a||1/0;const f=e.length;let d=null;const b=[];for(let t=0;t55295&&c<57344){if(!d){if(c>56319){(a-=3)>-1&&b.push(239,191,189);continue}if(t+1===f){(a-=3)>-1&&b.push(239,191,189);continue}d=c;continue}if(c<56320){(a-=3)>-1&&b.push(239,191,189),d=c;continue}c=65536+(d-55296<<10|c-56320)}else d&&(a-=3)>-1&&b.push(239,191,189);if(d=null,c<128){if((a-=1)<0)break;b.push(c)}else if(c<2048){if((a-=2)<0)break;b.push(c>>6|192,63&c|128)}else if(c<65536){if((a-=3)<0)break;b.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(c<1114112))throw new Error("Invalid code point");if((a-=4)<0)break;b.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return b}function V(e){return f.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Z(e,a,c,f){let d;for(d=0;d=a.length||d>=e.length);++d)a[d+c]=e[d];return d}function W(e,a){return e instanceof a||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===a.name}function Y(e){return e!=e}const J=function(){const e="0123456789abcdef",a=new Array(256);for(let c=0;c<16;++c){const f=16*c;for(let d=0;d<16;++d)a[f+d]=e[c]+e[d]}return a}();function $(e){return"undefined"==typeof BigInt?X:e}function X(){throw new Error("BigInt not supported")}},9211:e=>{"use strict";var a=function(e){return e!=e};e.exports=function(e,c){return 0===e&&0===c?1/e==1/c:e===c||!(!a(e)||!a(c))}},7653:(e,a,c)=>{"use strict";var f=c(8452),d=c(487),b=c(9211),t=c(9394),i=c(6576),r=d(t(),Object);f(r,{getPolyfill:t,implementation:b,shim:i}),e.exports=r},9394:(e,a,c)=>{"use strict";var f=c(9211);e.exports=function(){return"function"==typeof Object.is?Object.is:f}},6576:(e,a,c)=>{"use strict";var f=c(9394),d=c(8452);e.exports=function(){var e=f();return d(Object,{is:e},{is:function(){return Object.is!==e}}),e}},8875:(e,a,c)=>{"use strict";var f;if(!Object.keys){var d=Object.prototype.hasOwnProperty,b=Object.prototype.toString,t=c(1093),i=Object.prototype.propertyIsEnumerable,r=!i.call({toString:null},"toString"),n=i.call((function(){}),"prototype"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],s=function(e){var a=e.constructor;return a&&a.prototype===e},l={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!l["$"+e]&&d.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{s(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();f=function(e){var a=null!==e&&"object"==typeof e,c="[object Function]"===b.call(e),f=t(e),i=a&&"[object String]"===b.call(e),l=[];if(!a&&!c&&!f)throw new TypeError("Object.keys called on a non-object");var u=n&&c;if(i&&e.length>0&&!d.call(e,0))for(var x=0;x0)for(var p=0;p{"use strict";var f=Array.prototype.slice,d=c(1093),b=Object.keys,t=b?function(e){return b(e)}:c(8875),i=Object.keys;t.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return d(e)?i(f.call(e)):i(e)})}else Object.keys=t;return Object.keys||t},e.exports=t},1093:e=>{"use strict";var a=Object.prototype.toString;e.exports=function(e){var c=a.call(e),f="[object Arguments]"===c;return f||(f="[object Array]"!==c&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===a.call(e.callee)),f}},8403:(e,a,c)=>{"use strict";var f=c(1189),d=c(1333)(),b=c(8075),t=Object,i=b("Array.prototype.push"),r=b("Object.prototype.propertyIsEnumerable"),n=d?Object.getOwnPropertySymbols:null;e.exports=function(e,a){if(null==e)throw new TypeError("target must be an object");var c=t(e);if(1===arguments.length)return c;for(var b=1;b{"use strict";var f=c(8403);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",a=e.split(""),c={},f=0;f{"use strict";var f=c(7568);a.certificate=c(6413);var d=f.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));a.RSAPrivateKey=d;var b=f.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));a.RSAPublicKey=b;var t=f.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),i=f.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(t),this.key("subjectPublicKey").bitstr())}));a.PublicKey=i;var r=f.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(t),this.key("subjectPrivateKey").octstr())}));a.PrivateKey=r;var n=f.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));a.EncryptedPrivateKey=n;var o=f.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));a.DSAPrivateKey=o,a.DSAparam=f.define("DSAparam",(function(){this.int()}));var s=f.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})})),l=f.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(s),this.key("publicKey").optional().explicit(1).bitstr())}));a.ECPrivateKey=l,a.signature=f.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},6413:(e,a,c)=>{"use strict";var f=c(7568),d=f.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),b=f.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),t=f.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),i=f.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(t),this.key("subjectPublicKey").bitstr())})),r=f.define("RelativeDistinguishedName",(function(){this.setof(b)})),n=f.define("RDNSequence",(function(){this.seqof(r)})),o=f.define("Name",(function(){this.choice({rdnSequence:this.use(n)})})),s=f.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(d),this.key("notAfter").use(d))})),l=f.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),h=f.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(t),this.key("issuer").use(o),this.key("validity").use(s),this.key("subject").use(o),this.key("subjectPublicKeyInfo").use(i),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(l).optional())})),u=f.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(h),this.key("signatureAlgorithm").use(t),this.key("signatureValue").bitstr())}));e.exports=u},4101:(e,a,c)=>{"use strict";var f=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,d=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,b=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,t=c(8078),i=c(1241),r=c(2861).Buffer;e.exports=function(e,a){var c,n=e.toString(),o=n.match(f);if(o){var s="aes"+o[1],l=r.from(o[2],"hex"),h=r.from(o[3].replace(/[\r\n]/g,""),"base64"),u=t(a,l.slice(0,8),parseInt(o[1],10)).key,x=[],p=i.createDecipheriv(s,u,l);x.push(p.update(h)),x.push(p.final()),c=r.concat(x)}else{var g=n.match(b);c=r.from(g[2].replace(/[\r\n]/g,""),"base64")}return{tag:n.match(d)[1],data:c}}},8170:(e,a,c)=>{"use strict";var f=c(1137),d=c(5579),b=c(4101),t=c(1241),i=c(8396),r=c(2861).Buffer;function n(e){var a;"object"!=typeof e||r.isBuffer(e)||(a=e.passphrase,e=e.key),"string"==typeof e&&(e=r.from(e));var c,n,o=b(e,a),s=o.tag,l=o.data;switch(s){case"CERTIFICATE":n=f.certificate.decode(l,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(n||(n=f.PublicKey.decode(l,"der")),c=n.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return f.RSAPublicKey.decode(n.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return n.subjectPrivateKey=n.subjectPublicKey,{type:"ec",data:n};case"1.2.840.10040.4.1":return n.algorithm.params.pub_key=f.DSAparam.decode(n.subjectPublicKey.data,"der"),{type:"dsa",data:n.algorithm.params};default:throw new Error("unknown key id "+c)}case"ENCRYPTED PRIVATE KEY":l=function(e,a){var c=e.algorithm.decrypt.kde.kdeparams.salt,f=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),b=d[e.algorithm.decrypt.cipher.algo.join(".")],n=e.algorithm.decrypt.cipher.iv,o=e.subjectPrivateKey,s=parseInt(b.split("-")[1],10)/8,l=i.pbkdf2Sync(a,c,f,s,"sha1"),h=t.createDecipheriv(b,l,n),u=[];return u.push(h.update(o)),u.push(h.final()),r.concat(u)}(l=f.EncryptedPrivateKey.decode(l,"der"),a);case"PRIVATE KEY":switch(c=(n=f.PrivateKey.decode(l,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return f.RSAPrivateKey.decode(n.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:n.algorithm.curve,privateKey:f.ECPrivateKey.decode(n.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return n.algorithm.params.priv_key=f.DSAparam.decode(n.subjectPrivateKey,"der"),{type:"dsa",params:n.algorithm.params};default:throw new Error("unknown key id "+c)}case"RSA PUBLIC KEY":return f.RSAPublicKey.decode(l,"der");case"RSA PRIVATE KEY":return f.RSAPrivateKey.decode(l,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:f.DSAPrivateKey.decode(l,"der")};case"EC PRIVATE KEY":return{curve:(l=f.ECPrivateKey.decode(l,"der")).parameters.value,privateKey:l.privateKey};default:throw new Error("unknown key type "+s)}}n.signature=f.signature,e.exports=n},8396:(e,a,c)=>{a.pbkdf2=c(3832),a.pbkdf2Sync=c(1352)},3832:(e,a,c)=>{var f,d,b=c(2861).Buffer,t=c(4196),i=c(2455),r=c(1352),n=c(3382),o=c.g.crypto&&c.g.crypto.subtle,s={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},l=[];function h(){return d||(d=c.g.process&&c.g.process.nextTick?c.g.process.nextTick:c.g.queueMicrotask?c.g.queueMicrotask:c.g.setImmediate?c.g.setImmediate:c.g.setTimeout)}function u(e,a,c,f,d){return o.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return o.deriveBits({name:"PBKDF2",salt:a,iterations:c,hash:{name:d}},e,f<<3)})).then((function(e){return b.from(e)}))}e.exports=function(e,a,d,x,p,g){"function"==typeof p&&(g=p,p=void 0);var m=s[(p=p||"sha1").toLowerCase()];if(m&&"function"==typeof c.g.Promise){if(t(d,x),e=n(e,i,"Password"),a=n(a,i,"Salt"),"function"!=typeof g)throw new Error("No callback provided to pbkdf2");!function(e,a){e.then((function(e){h()((function(){a(null,e)}))}),(function(e){h()((function(){a(e)}))}))}(function(e){if(c.g.process&&!c.g.process.browser)return Promise.resolve(!1);if(!o||!o.importKey||!o.deriveBits)return Promise.resolve(!1);if(void 0!==l[e])return l[e];var a=u(f=f||b.alloc(8),f,10,128,e).then((function(){return!0})).catch((function(){return!1}));return l[e]=a,a}(m).then((function(c){return c?u(e,a,d,x,m):r(e,a,d,x,p)})),g)}else h()((function(){var c;try{c=r(e,a,d,x,p)}catch(e){return g(e)}g(null,c)}))}},2455:(e,a,c)=>{var f;f=c.g.process&&c.g.process.browser?"utf-8":c.g.process&&c.g.process.version?parseInt(process.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",e.exports=f},4196:e=>{var a=Math.pow(2,30)-1;e.exports=function(e,c){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof c)throw new TypeError("Key length not a number");if(c<0||c>a||c!=c)throw new TypeError("Bad key length")}},1352:(e,a,c)=>{var f=c(320),d=c(6011),b=c(2802),t=c(2861).Buffer,i=c(4196),r=c(2455),n=c(3382),o=t.alloc(128),s={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(e,a,c){var i=function(e){return"rmd160"===e||"ripemd160"===e?function(e){return(new d).update(e).digest()}:"md5"===e?f:function(a){return b(e).update(a).digest()}}(e),r="sha512"===e||"sha384"===e?128:64;a.length>r?a=i(a):a.length{var f=c(2861).Buffer;e.exports=function(e,a,c){if(f.isBuffer(e))return e;if("string"==typeof e)return f.from(e,a);if(ArrayBuffer.isView(e))return f.from(e.buffer);throw new TypeError(c+" must be a string, a Buffer, a typed array or a DataView")}},6578:e=>{"use strict";e.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},3225:e=>{"use strict";"undefined"==typeof process||!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?e.exports={nextTick:function(e,a,c,f){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var d,b,t=arguments.length;switch(t){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick((function(){e.call(null,a)}));case 3:return process.nextTick((function(){e.call(null,a,c)}));case 4:return process.nextTick((function(){e.call(null,a,c,f)}));default:for(d=new Array(t-1),b=0;b{a.publicEncrypt=c(8902),a.privateDecrypt=c(7362),a.privateEncrypt=function(e,c){return a.publicEncrypt(e,c,!0)},a.publicDecrypt=function(e,c){return a.privateDecrypt(e,c,!0)}},8206:(e,a,c)=>{var f=c(7108),d=c(2861).Buffer;function b(e){var a=d.allocUnsafe(4);return a.writeUInt32BE(e,0),a}e.exports=function(e,a){for(var c,t=d.alloc(0),i=0;t.length=65&&c<=70?c-55:c>=97&&c<=102?c-87:c-48&15}function r(e,a,c){var f=i(e,c);return c-1>=a&&(f|=i(e,c-1)<<4),f}function n(e,a,c,f){for(var d=0,b=Math.min(e.length,c),t=a;t=49?i-49+10:i>=17?i-17+10:i}return d}b.isBN=function(e){return e instanceof b||null!==e&&"object"==typeof e&&e.constructor.wordSize===b.wordSize&&Array.isArray(e.words)},b.max=function(e,a){return e.cmp(a)>0?e:a},b.min=function(e,a){return e.cmp(a)<0?e:a},b.prototype._init=function(e,a,c){if("number"==typeof e)return this._initNumber(e,a,c);if("object"==typeof e)return this._initArray(e,a,c);"hex"===a&&(a=16),f(a===(0|a)&&a>=2&&a<=36);var d=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(d++,this.negative=1),d=0;d-=3)t=e[d]|e[d-1]<<8|e[d-2]<<16,this.words[b]|=t<>>26-i&67108863,(i+=24)>=26&&(i-=26,b++);else if("le"===c)for(d=0,b=0;d>>26-i&67108863,(i+=24)>=26&&(i-=26,b++);return this.strip()},b.prototype._parseHex=function(e,a,c){this.length=Math.ceil((e.length-a)/6),this.words=new Array(this.length);for(var f=0;f=a;f-=2)d=r(e,a,f)<=18?(b-=18,t+=1,this.words[t]|=d>>>26):b+=8;else for(f=(e.length-a)%2==0?a+1:a;f=18?(b-=18,t+=1,this.words[t]|=d>>>26):b+=8;this.strip()},b.prototype._parseBase=function(e,a,c){this.words=[0],this.length=1;for(var f=0,d=1;d<=67108863;d*=a)f++;f--,d=d/a|0;for(var b=e.length-c,t=b%f,i=Math.min(b,b-t)+c,r=0,o=c;o1&&0===this.words[this.length-1];)this.length--;return this._normSign()},b.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},b.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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 h(e,a,c){c.negative=a.negative^e.negative;var f=e.length+a.length|0;c.length=f,f=f-1|0;var d=0|e.words[0],b=0|a.words[0],t=d*b,i=67108863&t,r=t/67108864|0;c.words[0]=i;for(var n=1;n>>26,s=67108863&r,l=Math.min(n,a.length-1),h=Math.max(0,n-e.length+1);h<=l;h++){var u=n-h|0;o+=(t=(d=0|e.words[u])*(b=0|a.words[h])+s)/67108864|0,s=67108863&t}c.words[n]=0|s,r=0|o}return 0!==r?c.words[n]=0|r:c.length--,c.strip()}b.prototype.toString=function(e,a){var c;if(a=0|a||1,16===(e=e||10)||"hex"===e){c="";for(var d=0,b=0,t=0;t>>24-d&16777215)||t!==this.length-1?o[6-r.length]+r+c:r+c,(d+=2)>=26&&(d-=26,t--)}for(0!==b&&(c=b.toString(16)+c);c.length%a!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(e===(0|e)&&e>=2&&e<=36){var n=s[e],h=l[e];c="";var u=this.clone();for(u.negative=0;!u.isZero();){var x=u.modn(h).toString(e);c=(u=u.idivn(h)).isZero()?x+c:o[n-x.length]+x+c}for(this.isZero()&&(c="0"+c);c.length%a!=0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}f(!1,"Base should be between 2 and 36")},b.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&f(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},b.prototype.toJSON=function(){return this.toString(16)},b.prototype.toBuffer=function(e,a){return f(void 0!==t),this.toArrayLike(t,e,a)},b.prototype.toArray=function(e,a){return this.toArrayLike(Array,e,a)},b.prototype.toArrayLike=function(e,a,c){var d=this.byteLength(),b=c||Math.max(1,d);f(d<=b,"byte array longer than desired length"),f(b>0,"Requested array length <= 0"),this.strip();var t,i,r="le"===a,n=new e(b),o=this.clone();if(r){for(i=0;!o.isZero();i++)t=o.andln(255),o.iushrn(8),n[i]=t;for(;i=4096&&(c+=13,a>>>=13),a>=64&&(c+=7,a>>>=7),a>=8&&(c+=4,a>>>=4),a>=2&&(c+=2,a>>>=2),c+a},b.prototype._zeroBits=function(e){if(0===e)return 26;var a=e,c=0;return 8191&a||(c+=13,a>>>=13),127&a||(c+=7,a>>>=7),15&a||(c+=4,a>>>=4),3&a||(c+=2,a>>>=2),1&a||c++,c},b.prototype.bitLength=function(){var e=this.words[this.length-1],a=this._countBits(e);return 26*(this.length-1)+a},b.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,a=0;ae.length?this.clone().ior(e):e.clone().ior(this)},b.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},b.prototype.iuand=function(e){var a;a=this.length>e.length?e:this;for(var c=0;ce.length?this.clone().iand(e):e.clone().iand(this)},b.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},b.prototype.iuxor=function(e){var a,c;this.length>e.length?(a=this,c=e):(a=e,c=this);for(var f=0;fe.length?this.clone().ixor(e):e.clone().ixor(this)},b.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},b.prototype.inotn=function(e){f("number"==typeof e&&e>=0);var a=0|Math.ceil(e/26),c=e%26;this._expand(a),c>0&&a--;for(var d=0;d0&&(this.words[d]=~this.words[d]&67108863>>26-c),this.strip()},b.prototype.notn=function(e){return this.clone().inotn(e)},b.prototype.setn=function(e,a){f("number"==typeof e&&e>=0);var c=e/26|0,d=e%26;return this._expand(c+1),this.words[c]=a?this.words[c]|1<e.length?(c=this,f=e):(c=e,f=this);for(var d=0,b=0;b>>26;for(;0!==d&&b>>26;if(this.length=c.length,0!==d)this.words[this.length]=d,this.length++;else if(c!==this)for(;be.length?this.clone().iadd(e):e.clone().iadd(this)},b.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var a=this.iadd(e);return e.negative=1,a._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var c,f,d=this.cmp(e);if(0===d)return this.negative=0,this.length=1,this.words[0]=0,this;d>0?(c=this,f=e):(c=e,f=this);for(var b=0,t=0;t>26,this.words[t]=67108863&a;for(;0!==b&&t>26,this.words[t]=67108863&a;if(0===b&&t>>13,h=0|t[1],u=8191&h,x=h>>>13,p=0|t[2],g=8191&p,m=p>>>13,y=0|t[3],_=8191&y,v=y>>>13,w=0|t[4],M=8191&w,A=w>>>13,L=0|t[5],I=8191&L,k=L>>>13,E=0|t[6],S=8191&E,C=E>>>13,B=0|t[7],F=8191&B,O=B>>>13,P=0|t[8],R=8191&P,T=P>>>13,U=0|t[9],j=8191&U,N=U>>>13,q=0|i[0],D=8191&q,z=q>>>13,Q=0|i[1],G=8191&Q,K=Q>>>13,H=0|i[2],V=8191&H,Z=H>>>13,W=0|i[3],Y=8191&W,J=W>>>13,$=0|i[4],X=8191&$,ee=$>>>13,ae=0|i[5],ce=8191&ae,fe=ae>>>13,de=0|i[6],be=8191&de,te=de>>>13,ie=0|i[7],re=8191&ie,ne=ie>>>13,oe=0|i[8],se=8191&oe,le=oe>>>13,he=0|i[9],ue=8191&he,xe=he>>>13;c.negative=e.negative^a.negative,c.length=19;var pe=(n+(f=Math.imul(s,D))|0)+((8191&(d=(d=Math.imul(s,z))+Math.imul(l,D)|0))<<13)|0;n=((b=Math.imul(l,z))+(d>>>13)|0)+(pe>>>26)|0,pe&=67108863,f=Math.imul(u,D),d=(d=Math.imul(u,z))+Math.imul(x,D)|0,b=Math.imul(x,z);var ge=(n+(f=f+Math.imul(s,G)|0)|0)+((8191&(d=(d=d+Math.imul(s,K)|0)+Math.imul(l,G)|0))<<13)|0;n=((b=b+Math.imul(l,K)|0)+(d>>>13)|0)+(ge>>>26)|0,ge&=67108863,f=Math.imul(g,D),d=(d=Math.imul(g,z))+Math.imul(m,D)|0,b=Math.imul(m,z),f=f+Math.imul(u,G)|0,d=(d=d+Math.imul(u,K)|0)+Math.imul(x,G)|0,b=b+Math.imul(x,K)|0;var me=(n+(f=f+Math.imul(s,V)|0)|0)+((8191&(d=(d=d+Math.imul(s,Z)|0)+Math.imul(l,V)|0))<<13)|0;n=((b=b+Math.imul(l,Z)|0)+(d>>>13)|0)+(me>>>26)|0,me&=67108863,f=Math.imul(_,D),d=(d=Math.imul(_,z))+Math.imul(v,D)|0,b=Math.imul(v,z),f=f+Math.imul(g,G)|0,d=(d=d+Math.imul(g,K)|0)+Math.imul(m,G)|0,b=b+Math.imul(m,K)|0,f=f+Math.imul(u,V)|0,d=(d=d+Math.imul(u,Z)|0)+Math.imul(x,V)|0,b=b+Math.imul(x,Z)|0;var ye=(n+(f=f+Math.imul(s,Y)|0)|0)+((8191&(d=(d=d+Math.imul(s,J)|0)+Math.imul(l,Y)|0))<<13)|0;n=((b=b+Math.imul(l,J)|0)+(d>>>13)|0)+(ye>>>26)|0,ye&=67108863,f=Math.imul(M,D),d=(d=Math.imul(M,z))+Math.imul(A,D)|0,b=Math.imul(A,z),f=f+Math.imul(_,G)|0,d=(d=d+Math.imul(_,K)|0)+Math.imul(v,G)|0,b=b+Math.imul(v,K)|0,f=f+Math.imul(g,V)|0,d=(d=d+Math.imul(g,Z)|0)+Math.imul(m,V)|0,b=b+Math.imul(m,Z)|0,f=f+Math.imul(u,Y)|0,d=(d=d+Math.imul(u,J)|0)+Math.imul(x,Y)|0,b=b+Math.imul(x,J)|0;var _e=(n+(f=f+Math.imul(s,X)|0)|0)+((8191&(d=(d=d+Math.imul(s,ee)|0)+Math.imul(l,X)|0))<<13)|0;n=((b=b+Math.imul(l,ee)|0)+(d>>>13)|0)+(_e>>>26)|0,_e&=67108863,f=Math.imul(I,D),d=(d=Math.imul(I,z))+Math.imul(k,D)|0,b=Math.imul(k,z),f=f+Math.imul(M,G)|0,d=(d=d+Math.imul(M,K)|0)+Math.imul(A,G)|0,b=b+Math.imul(A,K)|0,f=f+Math.imul(_,V)|0,d=(d=d+Math.imul(_,Z)|0)+Math.imul(v,V)|0,b=b+Math.imul(v,Z)|0,f=f+Math.imul(g,Y)|0,d=(d=d+Math.imul(g,J)|0)+Math.imul(m,Y)|0,b=b+Math.imul(m,J)|0,f=f+Math.imul(u,X)|0,d=(d=d+Math.imul(u,ee)|0)+Math.imul(x,X)|0,b=b+Math.imul(x,ee)|0;var ve=(n+(f=f+Math.imul(s,ce)|0)|0)+((8191&(d=(d=d+Math.imul(s,fe)|0)+Math.imul(l,ce)|0))<<13)|0;n=((b=b+Math.imul(l,fe)|0)+(d>>>13)|0)+(ve>>>26)|0,ve&=67108863,f=Math.imul(S,D),d=(d=Math.imul(S,z))+Math.imul(C,D)|0,b=Math.imul(C,z),f=f+Math.imul(I,G)|0,d=(d=d+Math.imul(I,K)|0)+Math.imul(k,G)|0,b=b+Math.imul(k,K)|0,f=f+Math.imul(M,V)|0,d=(d=d+Math.imul(M,Z)|0)+Math.imul(A,V)|0,b=b+Math.imul(A,Z)|0,f=f+Math.imul(_,Y)|0,d=(d=d+Math.imul(_,J)|0)+Math.imul(v,Y)|0,b=b+Math.imul(v,J)|0,f=f+Math.imul(g,X)|0,d=(d=d+Math.imul(g,ee)|0)+Math.imul(m,X)|0,b=b+Math.imul(m,ee)|0,f=f+Math.imul(u,ce)|0,d=(d=d+Math.imul(u,fe)|0)+Math.imul(x,ce)|0,b=b+Math.imul(x,fe)|0;var we=(n+(f=f+Math.imul(s,be)|0)|0)+((8191&(d=(d=d+Math.imul(s,te)|0)+Math.imul(l,be)|0))<<13)|0;n=((b=b+Math.imul(l,te)|0)+(d>>>13)|0)+(we>>>26)|0,we&=67108863,f=Math.imul(F,D),d=(d=Math.imul(F,z))+Math.imul(O,D)|0,b=Math.imul(O,z),f=f+Math.imul(S,G)|0,d=(d=d+Math.imul(S,K)|0)+Math.imul(C,G)|0,b=b+Math.imul(C,K)|0,f=f+Math.imul(I,V)|0,d=(d=d+Math.imul(I,Z)|0)+Math.imul(k,V)|0,b=b+Math.imul(k,Z)|0,f=f+Math.imul(M,Y)|0,d=(d=d+Math.imul(M,J)|0)+Math.imul(A,Y)|0,b=b+Math.imul(A,J)|0,f=f+Math.imul(_,X)|0,d=(d=d+Math.imul(_,ee)|0)+Math.imul(v,X)|0,b=b+Math.imul(v,ee)|0,f=f+Math.imul(g,ce)|0,d=(d=d+Math.imul(g,fe)|0)+Math.imul(m,ce)|0,b=b+Math.imul(m,fe)|0,f=f+Math.imul(u,be)|0,d=(d=d+Math.imul(u,te)|0)+Math.imul(x,be)|0,b=b+Math.imul(x,te)|0;var Me=(n+(f=f+Math.imul(s,re)|0)|0)+((8191&(d=(d=d+Math.imul(s,ne)|0)+Math.imul(l,re)|0))<<13)|0;n=((b=b+Math.imul(l,ne)|0)+(d>>>13)|0)+(Me>>>26)|0,Me&=67108863,f=Math.imul(R,D),d=(d=Math.imul(R,z))+Math.imul(T,D)|0,b=Math.imul(T,z),f=f+Math.imul(F,G)|0,d=(d=d+Math.imul(F,K)|0)+Math.imul(O,G)|0,b=b+Math.imul(O,K)|0,f=f+Math.imul(S,V)|0,d=(d=d+Math.imul(S,Z)|0)+Math.imul(C,V)|0,b=b+Math.imul(C,Z)|0,f=f+Math.imul(I,Y)|0,d=(d=d+Math.imul(I,J)|0)+Math.imul(k,Y)|0,b=b+Math.imul(k,J)|0,f=f+Math.imul(M,X)|0,d=(d=d+Math.imul(M,ee)|0)+Math.imul(A,X)|0,b=b+Math.imul(A,ee)|0,f=f+Math.imul(_,ce)|0,d=(d=d+Math.imul(_,fe)|0)+Math.imul(v,ce)|0,b=b+Math.imul(v,fe)|0,f=f+Math.imul(g,be)|0,d=(d=d+Math.imul(g,te)|0)+Math.imul(m,be)|0,b=b+Math.imul(m,te)|0,f=f+Math.imul(u,re)|0,d=(d=d+Math.imul(u,ne)|0)+Math.imul(x,re)|0,b=b+Math.imul(x,ne)|0;var Ae=(n+(f=f+Math.imul(s,se)|0)|0)+((8191&(d=(d=d+Math.imul(s,le)|0)+Math.imul(l,se)|0))<<13)|0;n=((b=b+Math.imul(l,le)|0)+(d>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,f=Math.imul(j,D),d=(d=Math.imul(j,z))+Math.imul(N,D)|0,b=Math.imul(N,z),f=f+Math.imul(R,G)|0,d=(d=d+Math.imul(R,K)|0)+Math.imul(T,G)|0,b=b+Math.imul(T,K)|0,f=f+Math.imul(F,V)|0,d=(d=d+Math.imul(F,Z)|0)+Math.imul(O,V)|0,b=b+Math.imul(O,Z)|0,f=f+Math.imul(S,Y)|0,d=(d=d+Math.imul(S,J)|0)+Math.imul(C,Y)|0,b=b+Math.imul(C,J)|0,f=f+Math.imul(I,X)|0,d=(d=d+Math.imul(I,ee)|0)+Math.imul(k,X)|0,b=b+Math.imul(k,ee)|0,f=f+Math.imul(M,ce)|0,d=(d=d+Math.imul(M,fe)|0)+Math.imul(A,ce)|0,b=b+Math.imul(A,fe)|0,f=f+Math.imul(_,be)|0,d=(d=d+Math.imul(_,te)|0)+Math.imul(v,be)|0,b=b+Math.imul(v,te)|0,f=f+Math.imul(g,re)|0,d=(d=d+Math.imul(g,ne)|0)+Math.imul(m,re)|0,b=b+Math.imul(m,ne)|0,f=f+Math.imul(u,se)|0,d=(d=d+Math.imul(u,le)|0)+Math.imul(x,se)|0,b=b+Math.imul(x,le)|0;var Le=(n+(f=f+Math.imul(s,ue)|0)|0)+((8191&(d=(d=d+Math.imul(s,xe)|0)+Math.imul(l,ue)|0))<<13)|0;n=((b=b+Math.imul(l,xe)|0)+(d>>>13)|0)+(Le>>>26)|0,Le&=67108863,f=Math.imul(j,G),d=(d=Math.imul(j,K))+Math.imul(N,G)|0,b=Math.imul(N,K),f=f+Math.imul(R,V)|0,d=(d=d+Math.imul(R,Z)|0)+Math.imul(T,V)|0,b=b+Math.imul(T,Z)|0,f=f+Math.imul(F,Y)|0,d=(d=d+Math.imul(F,J)|0)+Math.imul(O,Y)|0,b=b+Math.imul(O,J)|0,f=f+Math.imul(S,X)|0,d=(d=d+Math.imul(S,ee)|0)+Math.imul(C,X)|0,b=b+Math.imul(C,ee)|0,f=f+Math.imul(I,ce)|0,d=(d=d+Math.imul(I,fe)|0)+Math.imul(k,ce)|0,b=b+Math.imul(k,fe)|0,f=f+Math.imul(M,be)|0,d=(d=d+Math.imul(M,te)|0)+Math.imul(A,be)|0,b=b+Math.imul(A,te)|0,f=f+Math.imul(_,re)|0,d=(d=d+Math.imul(_,ne)|0)+Math.imul(v,re)|0,b=b+Math.imul(v,ne)|0,f=f+Math.imul(g,se)|0,d=(d=d+Math.imul(g,le)|0)+Math.imul(m,se)|0,b=b+Math.imul(m,le)|0;var Ie=(n+(f=f+Math.imul(u,ue)|0)|0)+((8191&(d=(d=d+Math.imul(u,xe)|0)+Math.imul(x,ue)|0))<<13)|0;n=((b=b+Math.imul(x,xe)|0)+(d>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,f=Math.imul(j,V),d=(d=Math.imul(j,Z))+Math.imul(N,V)|0,b=Math.imul(N,Z),f=f+Math.imul(R,Y)|0,d=(d=d+Math.imul(R,J)|0)+Math.imul(T,Y)|0,b=b+Math.imul(T,J)|0,f=f+Math.imul(F,X)|0,d=(d=d+Math.imul(F,ee)|0)+Math.imul(O,X)|0,b=b+Math.imul(O,ee)|0,f=f+Math.imul(S,ce)|0,d=(d=d+Math.imul(S,fe)|0)+Math.imul(C,ce)|0,b=b+Math.imul(C,fe)|0,f=f+Math.imul(I,be)|0,d=(d=d+Math.imul(I,te)|0)+Math.imul(k,be)|0,b=b+Math.imul(k,te)|0,f=f+Math.imul(M,re)|0,d=(d=d+Math.imul(M,ne)|0)+Math.imul(A,re)|0,b=b+Math.imul(A,ne)|0,f=f+Math.imul(_,se)|0,d=(d=d+Math.imul(_,le)|0)+Math.imul(v,se)|0,b=b+Math.imul(v,le)|0;var ke=(n+(f=f+Math.imul(g,ue)|0)|0)+((8191&(d=(d=d+Math.imul(g,xe)|0)+Math.imul(m,ue)|0))<<13)|0;n=((b=b+Math.imul(m,xe)|0)+(d>>>13)|0)+(ke>>>26)|0,ke&=67108863,f=Math.imul(j,Y),d=(d=Math.imul(j,J))+Math.imul(N,Y)|0,b=Math.imul(N,J),f=f+Math.imul(R,X)|0,d=(d=d+Math.imul(R,ee)|0)+Math.imul(T,X)|0,b=b+Math.imul(T,ee)|0,f=f+Math.imul(F,ce)|0,d=(d=d+Math.imul(F,fe)|0)+Math.imul(O,ce)|0,b=b+Math.imul(O,fe)|0,f=f+Math.imul(S,be)|0,d=(d=d+Math.imul(S,te)|0)+Math.imul(C,be)|0,b=b+Math.imul(C,te)|0,f=f+Math.imul(I,re)|0,d=(d=d+Math.imul(I,ne)|0)+Math.imul(k,re)|0,b=b+Math.imul(k,ne)|0,f=f+Math.imul(M,se)|0,d=(d=d+Math.imul(M,le)|0)+Math.imul(A,se)|0,b=b+Math.imul(A,le)|0;var Ee=(n+(f=f+Math.imul(_,ue)|0)|0)+((8191&(d=(d=d+Math.imul(_,xe)|0)+Math.imul(v,ue)|0))<<13)|0;n=((b=b+Math.imul(v,xe)|0)+(d>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,f=Math.imul(j,X),d=(d=Math.imul(j,ee))+Math.imul(N,X)|0,b=Math.imul(N,ee),f=f+Math.imul(R,ce)|0,d=(d=d+Math.imul(R,fe)|0)+Math.imul(T,ce)|0,b=b+Math.imul(T,fe)|0,f=f+Math.imul(F,be)|0,d=(d=d+Math.imul(F,te)|0)+Math.imul(O,be)|0,b=b+Math.imul(O,te)|0,f=f+Math.imul(S,re)|0,d=(d=d+Math.imul(S,ne)|0)+Math.imul(C,re)|0,b=b+Math.imul(C,ne)|0,f=f+Math.imul(I,se)|0,d=(d=d+Math.imul(I,le)|0)+Math.imul(k,se)|0,b=b+Math.imul(k,le)|0;var Se=(n+(f=f+Math.imul(M,ue)|0)|0)+((8191&(d=(d=d+Math.imul(M,xe)|0)+Math.imul(A,ue)|0))<<13)|0;n=((b=b+Math.imul(A,xe)|0)+(d>>>13)|0)+(Se>>>26)|0,Se&=67108863,f=Math.imul(j,ce),d=(d=Math.imul(j,fe))+Math.imul(N,ce)|0,b=Math.imul(N,fe),f=f+Math.imul(R,be)|0,d=(d=d+Math.imul(R,te)|0)+Math.imul(T,be)|0,b=b+Math.imul(T,te)|0,f=f+Math.imul(F,re)|0,d=(d=d+Math.imul(F,ne)|0)+Math.imul(O,re)|0,b=b+Math.imul(O,ne)|0,f=f+Math.imul(S,se)|0,d=(d=d+Math.imul(S,le)|0)+Math.imul(C,se)|0,b=b+Math.imul(C,le)|0;var Ce=(n+(f=f+Math.imul(I,ue)|0)|0)+((8191&(d=(d=d+Math.imul(I,xe)|0)+Math.imul(k,ue)|0))<<13)|0;n=((b=b+Math.imul(k,xe)|0)+(d>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,f=Math.imul(j,be),d=(d=Math.imul(j,te))+Math.imul(N,be)|0,b=Math.imul(N,te),f=f+Math.imul(R,re)|0,d=(d=d+Math.imul(R,ne)|0)+Math.imul(T,re)|0,b=b+Math.imul(T,ne)|0,f=f+Math.imul(F,se)|0,d=(d=d+Math.imul(F,le)|0)+Math.imul(O,se)|0,b=b+Math.imul(O,le)|0;var Be=(n+(f=f+Math.imul(S,ue)|0)|0)+((8191&(d=(d=d+Math.imul(S,xe)|0)+Math.imul(C,ue)|0))<<13)|0;n=((b=b+Math.imul(C,xe)|0)+(d>>>13)|0)+(Be>>>26)|0,Be&=67108863,f=Math.imul(j,re),d=(d=Math.imul(j,ne))+Math.imul(N,re)|0,b=Math.imul(N,ne),f=f+Math.imul(R,se)|0,d=(d=d+Math.imul(R,le)|0)+Math.imul(T,se)|0,b=b+Math.imul(T,le)|0;var Fe=(n+(f=f+Math.imul(F,ue)|0)|0)+((8191&(d=(d=d+Math.imul(F,xe)|0)+Math.imul(O,ue)|0))<<13)|0;n=((b=b+Math.imul(O,xe)|0)+(d>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,f=Math.imul(j,se),d=(d=Math.imul(j,le))+Math.imul(N,se)|0,b=Math.imul(N,le);var Oe=(n+(f=f+Math.imul(R,ue)|0)|0)+((8191&(d=(d=d+Math.imul(R,xe)|0)+Math.imul(T,ue)|0))<<13)|0;n=((b=b+Math.imul(T,xe)|0)+(d>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Pe=(n+(f=Math.imul(j,ue))|0)+((8191&(d=(d=Math.imul(j,xe))+Math.imul(N,ue)|0))<<13)|0;return n=((b=Math.imul(N,xe))+(d>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r[0]=pe,r[1]=ge,r[2]=me,r[3]=ye,r[4]=_e,r[5]=ve,r[6]=we,r[7]=Me,r[8]=Ae,r[9]=Le,r[10]=Ie,r[11]=ke,r[12]=Ee,r[13]=Se,r[14]=Ce,r[15]=Be,r[16]=Fe,r[17]=Oe,r[18]=Pe,0!==n&&(r[19]=n,c.length++),c};function x(e,a,c){return(new p).mulp(e,a,c)}function p(e,a){this.x=e,this.y=a}Math.imul||(u=h),b.prototype.mulTo=function(e,a){var c,f=this.length+e.length;return c=10===this.length&&10===e.length?u(this,e,a):f<63?h(this,e,a):f<1024?function(e,a,c){c.negative=a.negative^e.negative,c.length=e.length+a.length;for(var f=0,d=0,b=0;b>>26)|0)>>>26,t&=67108863}c.words[b]=i,f=t,t=d}return 0!==f?c.words[b]=f:c.length--,c.strip()}(this,e,a):x(this,e,a),c},p.prototype.makeRBT=function(e){for(var a=new Array(e),c=b.prototype._countBits(e)-1,f=0;f>=1;return f},p.prototype.permute=function(e,a,c,f,d,b){for(var t=0;t>>=1)d++;return 1<>>=13,c[2*t+1]=8191&b,b>>>=13;for(t=2*a;t>=26,a+=d/67108864|0,a+=b>>>26,this.words[c]=67108863&b}return 0!==a&&(this.words[c]=a,this.length++),this},b.prototype.muln=function(e){return this.clone().imuln(e)},b.prototype.sqr=function(){return this.mul(this)},b.prototype.isqr=function(){return this.imul(this.clone())},b.prototype.pow=function(e){var a=function(e){for(var a=new Array(e.bitLength()),c=0;c>>d}return a}(e);if(0===a.length)return new b(1);for(var c=this,f=0;f=0);var a,c=e%26,d=(e-c)/26,b=67108863>>>26-c<<26-c;if(0!==c){var t=0;for(a=0;a>>26-c}t&&(this.words[a]=t,this.length++)}if(0!==d){for(a=this.length-1;a>=0;a--)this.words[a+d]=this.words[a];for(a=0;a=0),d=a?(a-a%26)/26:0;var b=e%26,t=Math.min((e-b)/26,this.length),i=67108863^67108863>>>b<t)for(this.length-=t,n=0;n=0&&(0!==o||n>=d);n--){var s=0|this.words[n];this.words[n]=o<<26-b|s>>>b,o=s&i}return r&&0!==o&&(r.words[r.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},b.prototype.ishrn=function(e,a,c){return f(0===this.negative),this.iushrn(e,a,c)},b.prototype.shln=function(e){return this.clone().ishln(e)},b.prototype.ushln=function(e){return this.clone().iushln(e)},b.prototype.shrn=function(e){return this.clone().ishrn(e)},b.prototype.ushrn=function(e){return this.clone().iushrn(e)},b.prototype.testn=function(e){f("number"==typeof e&&e>=0);var a=e%26,c=(e-a)/26,d=1<=0);var a=e%26,c=(e-a)/26;if(f(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)return this;if(0!==a&&c++,this.length=Math.min(c,this.length),0!==a){var d=67108863^67108863>>>a<=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},b.prototype.isubn=function(e){if(f("number"==typeof e),f(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a>26)-(r/67108864|0),this.words[d+c]=67108863&b}for(;d>26,this.words[d+c]=67108863&b;if(0===i)return this.strip();for(f(-1===i),i=0,d=0;d>26,this.words[d]=67108863&b;return this.negative=1,this.strip()},b.prototype._wordDiv=function(e,a){var c=(this.length,e.length),f=this.clone(),d=e,t=0|d.words[d.length-1];0!=(c=26-this._countBits(t))&&(d=d.ushln(c),f.iushln(c),t=0|d.words[d.length-1]);var i,r=f.length-d.length;if("mod"!==a){(i=new b(null)).length=r+1,i.words=new Array(i.length);for(var n=0;n=0;s--){var l=67108864*(0|f.words[d.length+s])+(0|f.words[d.length+s-1]);for(l=Math.min(l/t|0,67108863),f._ishlnsubmul(d,l,s);0!==f.negative;)l--,f.negative=0,f._ishlnsubmul(d,1,s),f.isZero()||(f.negative^=1);i&&(i.words[s]=l)}return i&&i.strip(),f.strip(),"div"!==a&&0!==c&&f.iushrn(c),{div:i||null,mod:f}},b.prototype.divmod=function(e,a,c){return f(!e.isZero()),this.isZero()?{div:new b(0),mod:new b(0)}:0!==this.negative&&0===e.negative?(i=this.neg().divmod(e,a),"mod"!==a&&(d=i.div.neg()),"div"!==a&&(t=i.mod.neg(),c&&0!==t.negative&&t.iadd(e)),{div:d,mod:t}):0===this.negative&&0!==e.negative?(i=this.divmod(e.neg(),a),"mod"!==a&&(d=i.div.neg()),{div:d,mod:i.mod}):this.negative&e.negative?(i=this.neg().divmod(e.neg(),a),"div"!==a&&(t=i.mod.neg(),c&&0!==t.negative&&t.isub(e)),{div:i.div,mod:t}):e.length>this.length||this.cmp(e)<0?{div:new b(0),mod:this}:1===e.length?"div"===a?{div:this.divn(e.words[0]),mod:null}:"mod"===a?{div:null,mod:new b(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new b(this.modn(e.words[0]))}:this._wordDiv(e,a);var d,t,i},b.prototype.div=function(e){return this.divmod(e,"div",!1).div},b.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},b.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},b.prototype.divRound=function(e){var a=this.divmod(e);if(a.mod.isZero())return a.div;var c=0!==a.div.negative?a.mod.isub(e):a.mod,f=e.ushrn(1),d=e.andln(1),b=c.cmp(f);return b<0||1===d&&0===b?a.div:0!==a.div.negative?a.div.isubn(1):a.div.iaddn(1)},b.prototype.modn=function(e){f(e<=67108863);for(var a=(1<<26)%e,c=0,d=this.length-1;d>=0;d--)c=(a*c+(0|this.words[d]))%e;return c},b.prototype.idivn=function(e){f(e<=67108863);for(var a=0,c=this.length-1;c>=0;c--){var d=(0|this.words[c])+67108864*a;this.words[c]=d/e|0,a=d%e}return this.strip()},b.prototype.divn=function(e){return this.clone().idivn(e)},b.prototype.egcd=function(e){f(0===e.negative),f(!e.isZero());var a=this,c=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var d=new b(1),t=new b(0),i=new b(0),r=new b(1),n=0;a.isEven()&&c.isEven();)a.iushrn(1),c.iushrn(1),++n;for(var o=c.clone(),s=a.clone();!a.isZero();){for(var l=0,h=1;!(a.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(a.iushrn(l);l-- >0;)(d.isOdd()||t.isOdd())&&(d.iadd(o),t.isub(s)),d.iushrn(1),t.iushrn(1);for(var u=0,x=1;!(c.words[0]&x)&&u<26;++u,x<<=1);if(u>0)for(c.iushrn(u);u-- >0;)(i.isOdd()||r.isOdd())&&(i.iadd(o),r.isub(s)),i.iushrn(1),r.iushrn(1);a.cmp(c)>=0?(a.isub(c),d.isub(i),t.isub(r)):(c.isub(a),i.isub(d),r.isub(t))}return{a:i,b:r,gcd:c.iushln(n)}},b.prototype._invmp=function(e){f(0===e.negative),f(!e.isZero());var a=this,c=e.clone();a=0!==a.negative?a.umod(e):a.clone();for(var d,t=new b(1),i=new b(0),r=c.clone();a.cmpn(1)>0&&c.cmpn(1)>0;){for(var n=0,o=1;!(a.words[0]&o)&&n<26;++n,o<<=1);if(n>0)for(a.iushrn(n);n-- >0;)t.isOdd()&&t.iadd(r),t.iushrn(1);for(var s=0,l=1;!(c.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(c.iushrn(s);s-- >0;)i.isOdd()&&i.iadd(r),i.iushrn(1);a.cmp(c)>=0?(a.isub(c),t.isub(i)):(c.isub(a),i.isub(t))}return(d=0===a.cmpn(1)?t:i).cmpn(0)<0&&d.iadd(e),d},b.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),c=e.clone();a.negative=0,c.negative=0;for(var f=0;a.isEven()&&c.isEven();f++)a.iushrn(1),c.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;c.isEven();)c.iushrn(1);var d=a.cmp(c);if(d<0){var b=a;a=c,c=b}else if(0===d||0===c.cmpn(1))break;a.isub(c)}return c.iushln(f)},b.prototype.invm=function(e){return this.egcd(e).a.umod(e)},b.prototype.isEven=function(){return!(1&this.words[0])},b.prototype.isOdd=function(){return!(1&~this.words[0])},b.prototype.andln=function(e){return this.words[0]&e},b.prototype.bincn=function(e){f("number"==typeof e);var a=e%26,c=(e-a)/26,d=1<>>26,i&=67108863,this.words[t]=i}return 0!==b&&(this.words[t]=b,this.length++),this},b.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},b.prototype.cmpn=function(e){var a,c=e<0;if(0!==this.negative&&!c)return-1;if(0===this.negative&&c)return 1;if(this.strip(),this.length>1)a=1;else{c&&(e=-e),f(e<=67108863,"Number is too big");var d=0|this.words[0];a=d===e?0:de.length)return 1;if(this.length=0;c--){var f=0|this.words[c],d=0|e.words[c];if(f!==d){fd&&(a=1);break}}return a},b.prototype.gtn=function(e){return 1===this.cmpn(e)},b.prototype.gt=function(e){return 1===this.cmp(e)},b.prototype.gten=function(e){return this.cmpn(e)>=0},b.prototype.gte=function(e){return this.cmp(e)>=0},b.prototype.ltn=function(e){return-1===this.cmpn(e)},b.prototype.lt=function(e){return-1===this.cmp(e)},b.prototype.lten=function(e){return this.cmpn(e)<=0},b.prototype.lte=function(e){return this.cmp(e)<=0},b.prototype.eqn=function(e){return 0===this.cmpn(e)},b.prototype.eq=function(e){return 0===this.cmp(e)},b.red=function(e){return new M(e)},b.prototype.toRed=function(e){return f(!this.red,"Already a number in reduction context"),f(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},b.prototype.fromRed=function(){return f(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},b.prototype._forceRed=function(e){return this.red=e,this},b.prototype.forceRed=function(e){return f(!this.red,"Already a number in reduction context"),this._forceRed(e)},b.prototype.redAdd=function(e){return f(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},b.prototype.redIAdd=function(e){return f(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},b.prototype.redSub=function(e){return f(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},b.prototype.redISub=function(e){return f(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},b.prototype.redShl=function(e){return f(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},b.prototype.redMul=function(e){return f(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},b.prototype.redIMul=function(e){return f(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},b.prototype.redSqr=function(){return f(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},b.prototype.redISqr=function(){return f(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},b.prototype.redSqrt=function(){return f(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},b.prototype.redInvm=function(){return f(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},b.prototype.redNeg=function(){return f(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},b.prototype.redPow=function(e){return f(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function m(e,a){this.name=e,this.p=new b(a,16),this.n=this.p.bitLength(),this.k=new b(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var a=b._prime(e);this.m=a.p,this.prime=a}else f(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new b(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)}m.prototype._tmp=function(){var e=new b(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var a,c=e;do{this.split(c,this.tmp),a=(c=(c=this.imulK(c)).iadd(this.tmp)).bitLength()}while(a>this.n);var f=a0?c.isub(this.p):void 0!==c.strip?c.strip():c._strip(),c},m.prototype.split=function(e,a){e.iushrn(this.n,0,a)},m.prototype.imulK=function(e){return e.imul(this.k)},d(y,m),y.prototype.split=function(e,a){for(var c=4194303,f=Math.min(e.length,9),d=0;d>>22,b=t}b>>>=22,e.words[d-10]=b,0===b&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var a=0,c=0;c>>=26,e.words[c]=d,a=f}return 0!==a&&(e.words[e.length++]=a),e},b._prime=function(e){if(g[e])return g[e];var a;if("k256"===e)a=new y;else if("p224"===e)a=new _;else if("p192"===e)a=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);a=new w}return g[e]=a,a},M.prototype._verify1=function(e){f(0===e.negative,"red works only with positives"),f(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,a){f(!(e.negative|a.negative),"red works only with positives"),f(e.red&&e.red===a.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,a){this._verify2(e,a);var c=e.add(a);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},M.prototype.iadd=function(e,a){this._verify2(e,a);var c=e.iadd(a);return c.cmp(this.m)>=0&&c.isub(this.m),c},M.prototype.sub=function(e,a){this._verify2(e,a);var c=e.sub(a);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},M.prototype.isub=function(e,a){this._verify2(e,a);var c=e.isub(a);return c.cmpn(0)<0&&c.iadd(this.m),c},M.prototype.shl=function(e,a){return this._verify1(e),this.imod(e.ushln(a))},M.prototype.imul=function(e,a){return this._verify2(e,a),this.imod(e.imul(a))},M.prototype.mul=function(e,a){return this._verify2(e,a),this.imod(e.mul(a))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var a=this.m.andln(3);if(f(a%2==1),3===a){var c=this.m.add(new b(1)).iushrn(2);return this.pow(e,c)}for(var d=this.m.subn(1),t=0;!d.isZero()&&0===d.andln(1);)t++,d.iushrn(1);f(!d.isZero());var i=new b(1).toRed(this),r=i.redNeg(),n=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new b(2*o*o).toRed(this);0!==this.pow(o,n).cmp(r);)o.redIAdd(r);for(var s=this.pow(o,d),l=this.pow(e,d.addn(1).iushrn(1)),h=this.pow(e,d),u=t;0!==h.cmp(i);){for(var x=h,p=0;0!==x.cmp(i);p++)x=x.redSqr();f(p=0;f--){for(var n=a.words[f],o=r-1;o>=0;o--){var s=n>>o&1;d!==c[0]&&(d=this.sqr(d)),0!==s||0!==t?(t<<=1,t|=s,(4==++i||0===f&&0===o)&&(d=this.mul(d,c[t]),i=0,t=0)):i=0}r=26}return d},M.prototype.convertTo=function(e){var a=e.umod(this.m);return a===e?a.clone():a},M.prototype.convertFrom=function(e){var a=e.clone();return a.red=null,a},b.mont=function(e){return new A(e)},d(A,M),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var a=this.imod(e.mul(this.rinv));return a.red=null,a},A.prototype.imul=function(e,a){if(e.isZero()||a.isZero())return e.words[0]=0,e.length=1,e;var c=e.imul(a),f=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(f).iushrn(this.shift),b=d;return d.cmp(this.m)>=0?b=d.isub(this.m):d.cmpn(0)<0&&(b=d.iadd(this.m)),b._forceRed(this)},A.prototype.mul=function(e,a){if(e.isZero()||a.isZero())return new b(0)._forceRed(this);var c=e.mul(a),f=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=c.isub(f).iushrn(this.shift),t=d;return d.cmp(this.m)>=0?t=d.isub(this.m):d.cmpn(0)<0&&(t=d.iadd(this.m)),t._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=c.nmd(e),this)},7362:(e,a,c)=>{var f=c(8170),d=c(8206),b=c(2061),t=c(2509),i=c(7332),r=c(7108),n=c(9247),o=c(2861).Buffer;e.exports=function(e,a,c){var s;s=e.padding?e.padding:c?1:4;var l,h=f(e),u=h.modulus.byteLength();if(a.length>u||new t(a).cmp(h.modulus)>=0)throw new Error("decryption error");l=c?n(new t(a),h):i(a,h);var x=o.alloc(u-l.length);if(l=o.concat([x,l],u),4===s)return function(e,a){var c=e.modulus.byteLength(),f=r("sha1").update(o.alloc(0)).digest(),t=f.length;if(0!==a[0])throw new Error("decryption error");var i=a.slice(1,t+1),n=a.slice(t+1),s=b(i,d(n,t)),l=b(n,d(s,c-t-1));if(function(e,a){e=o.from(e),a=o.from(a);var c=0,f=e.length;e.length!==a.length&&(c++,f=Math.min(e.length,a.length));for(var d=-1;++d=a.length){b++;break}var t=a.slice(2,d-1);if(("0002"!==f.toString("hex")&&!c||"0001"!==f.toString("hex")&&c)&&b++,t.length<8&&b++,b)throw new Error("decryption error");return a.slice(d)}(0,l,c);if(3===s)return l;throw new Error("unknown padding")}},8902:(e,a,c)=>{var f=c(8170),d=c(3209),b=c(7108),t=c(8206),i=c(2061),r=c(2509),n=c(9247),o=c(7332),s=c(2861).Buffer;e.exports=function(e,a,c){var l;l=e.padding?e.padding:c?1:4;var h,u=f(e);if(4===l)h=function(e,a){var c=e.modulus.byteLength(),f=a.length,n=b("sha1").update(s.alloc(0)).digest(),o=n.length,l=2*o;if(f>c-l-2)throw new Error("message too long");var h=s.alloc(c-f-l-2),u=c-o-1,x=d(o),p=i(s.concat([n,h,s.alloc(1,1),a],u),t(x,u)),g=i(x,t(p,o));return new r(s.concat([s.alloc(1),g,p],c))}(u,a);else if(1===l)h=function(e,a,c){var f,b=a.length,t=e.modulus.byteLength();if(b>t-11)throw new Error("message too long");return f=c?s.alloc(t-b-3,255):function(e){for(var a,c=s.allocUnsafe(e),f=0,b=d(2*e),t=0;f=0)throw new Error("data too long for modulus")}return c?o(h,u):n(h,u)}},9247:(e,a,c)=>{var f=c(2509),d=c(2861).Buffer;e.exports=function(e,a){return d.from(e.toRed(f.mont(a.modulus)).redPow(new f(a.publicExponent)).fromRed().toArray())}},2061:e=>{e.exports=function(e,a){for(var c=e.length,f=-1;++f{"use strict";var f=65536,d=c(2861).Buffer,b=c.g.crypto||c.g.msCrypto;b&&b.getRandomValues?e.exports=function(e,a){if(e>4294967295)throw new RangeError("requested too many random bytes");var c=d.allocUnsafe(e);if(e>0)if(e>f)for(var t=0;t{"use strict";function f(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var d=c(2861),b=c(3209),t=d.Buffer,i=d.kMaxLength,r=c.g.crypto||c.g.msCrypto,n=Math.pow(2,32)-1;function o(e,a){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>n||e<0)throw new TypeError("offset must be a uint32");if(e>i||e>a)throw new RangeError("offset out of range")}function s(e,a,c){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>n||e<0)throw new TypeError("size must be a uint32");if(e+a>c||e>i)throw new RangeError("buffer too small")}function l(e,a,c,f){if(process.browser){var d=e.buffer,t=new Uint8Array(d,a,c);return r.getRandomValues(t),f?void process.nextTick((function(){f(null,e)})):e}if(!f)return b(c).copy(e,a),e;b(c,(function(c,d){if(c)return f(c);d.copy(e,a),f(null,e)}))}r&&r.getRandomValues||!process.browser?(a.randomFill=function(e,a,f,d){if(!(t.isBuffer(e)||e instanceof c.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof a)d=a,a=0,f=e.length;else if("function"==typeof f)d=f,f=e.length-a;else if("function"!=typeof d)throw new TypeError('"cb" argument must be a function');return o(a,e.length),s(f,a,e.length),l(e,a,f,d)},a.randomFillSync=function(e,a,f){if(void 0===a&&(a=0),!(t.isBuffer(e)||e instanceof c.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return o(a,e.length),void 0===f&&(f=e.length-a),s(f,a,e.length),l(e,a,f)}):(a.randomFill=f,a.randomFillSync=f)},6048:e=>{"use strict";var a={};function c(e,c,f){f||(f=Error);var d=function(e){var a,f;function d(a,f,d){return e.call(this,function(e,a,f){return"string"==typeof c?c:c(e,a,f)}(a,f,d))||this}return f=e,(a=d).prototype=Object.create(f.prototype),a.prototype.constructor=a,a.__proto__=f,d}(f);d.prototype.name=f.name,d.prototype.code=e,a[e]=d}function f(e,a){if(Array.isArray(e)){var c=e.length;return e=e.map((function(e){return String(e)})),c>2?"one of ".concat(a," ").concat(e.slice(0,c-1).join(", "),", or ")+e[c-1]:2===c?"one of ".concat(a," ").concat(e[0]," or ").concat(e[1]):"of ".concat(a," ").concat(e[0])}return"of ".concat(a," ").concat(String(e))}c("ERR_INVALID_OPT_VALUE",(function(e,a){return'The value "'+a+'" is invalid for option "'+e+'"'}),TypeError),c("ERR_INVALID_ARG_TYPE",(function(e,a,c){var d,b,t,i,r;if("string"==typeof a&&(b="not ",a.substr(0,4)===b)?(d="must not be",a=a.replace(/^not /,"")):d="must be",function(e,a,c){return(void 0===c||c>e.length)&&(c=e.length),e.substring(c-9,c)===a}(e," argument"))t="The ".concat(e," ").concat(d," ").concat(f(a,"type"));else{var n=("number"!=typeof r&&(r=0),r+1>(i=e).length||-1===i.indexOf(".",r)?"argument":"property");t='The "'.concat(e,'" ').concat(n," ").concat(d," ").concat(f(a,"type"))}return t+". Received type ".concat(typeof c)}),TypeError),c("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),c("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),c("ERR_STREAM_PREMATURE_CLOSE","Premature close"),c("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),c("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),c("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),c("ERR_STREAM_WRITE_AFTER_END","write after end"),c("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),c("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),c("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=a},5382:(e,a,c)=>{"use strict";var f=Object.keys||function(e){var a=[];for(var c in e)a.push(c);return a};e.exports=n;var d=c(5412),b=c(6708);c(6698)(n,d);for(var t=f(b.prototype),i=0;i{"use strict";e.exports=d;var f=c(4610);function d(e){if(!(this instanceof d))return new d(e);f.call(this,e)}c(6698)(d,f),d.prototype._transform=function(e,a,c){c(null,e)}},5412:(e,a,c)=>{"use strict";var f;e.exports=A,A.ReadableState=M,c(7007).EventEmitter;var d,b=function(e,a){return e.listeners(a).length},t=c(345),i=c(8287).Buffer,r=(void 0!==c.g?c.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},n=c(9838);d=n&&n.debuglog?n.debuglog("stream"):function(){};var o,s,l,h=c(2726),u=c(5896),x=c(5291).getHighWaterMark,p=c(6048).F,g=p.ERR_INVALID_ARG_TYPE,m=p.ERR_STREAM_PUSH_AFTER_EOF,y=p.ERR_METHOD_NOT_IMPLEMENTED,_=p.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;c(6698)(A,t);var v=u.errorOrDestroy,w=["error","close","destroy","pause","resume"];function M(e,a,d){f=f||c(5382),e=e||{},"boolean"!=typeof d&&(d=a instanceof f),this.objectMode=!!e.objectMode,d&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=x(this,e,"readableHighWaterMark",d),this.buffer=new h,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!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(o||(o=c(3141).I),this.decoder=new o(e.encoding),this.encoding=e.encoding)}function A(e){if(f=f||c(5382),!(this instanceof A))return new A(e);var a=this instanceof f;this._readableState=new M(e,this,a),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),t.call(this)}function L(e,a,c,f,b){d("readableAddChunk",a);var t,n=e._readableState;if(null===a)n.reading=!1,function(e,a){if(d("onEofChunk"),!a.ended){if(a.decoder){var c=a.decoder.end();c&&c.length&&(a.buffer.push(c),a.length+=a.objectMode?1:c.length)}a.ended=!0,a.sync?S(e):(a.needReadable=!1,a.emittedReadable||(a.emittedReadable=!0,C(e)))}}(e,n);else if(b||(t=function(e,a){var c,f;return f=a,i.isBuffer(f)||f instanceof r||"string"==typeof a||void 0===a||e.objectMode||(c=new g("chunk",["string","Buffer","Uint8Array"],a)),c}(n,a)),t)v(e,t);else if(n.objectMode||a&&a.length>0)if("string"==typeof a||n.objectMode||Object.getPrototypeOf(a)===i.prototype||(a=function(e){return i.from(e)}(a)),f)n.endEmitted?v(e,new _):I(e,n,a,!0);else if(n.ended)v(e,new m);else{if(n.destroyed)return!1;n.reading=!1,n.decoder&&!c?(a=n.decoder.write(a),n.objectMode||0!==a.length?I(e,n,a,!1):B(e,n)):I(e,n,a,!1)}else f||(n.reading=!1,B(e,n));return!n.ended&&(n.lengtha.highWaterMark&&(a.highWaterMark=function(e){return e>=k?e=k:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=a.length?e:a.ended?a.length:(a.needReadable=!0,0))}function S(e){var a=e._readableState;d("emitReadable",a.needReadable,a.emittedReadable),a.needReadable=!1,a.emittedReadable||(d("emitReadable",a.flowing),a.emittedReadable=!0,process.nextTick(C,e))}function C(e){var a=e._readableState;d("emitReadable_",a.destroyed,a.length,a.ended),a.destroyed||!a.length&&!a.ended||(e.emit("readable"),a.emittedReadable=!1),a.needReadable=!a.flowing&&!a.ended&&a.length<=a.highWaterMark,T(e)}function B(e,a){a.readingMore||(a.readingMore=!0,process.nextTick(F,e,a))}function F(e,a){for(;!a.reading&&!a.ended&&(a.length0,a.resumeScheduled&&!a.paused?a.flowing=!0:e.listenerCount("data")>0&&e.resume()}function P(e){d("readable nexttick read 0"),e.read(0)}function R(e,a){d("resume",a.reading),a.reading||e.read(0),a.resumeScheduled=!1,e.emit("resume"),T(e),a.flowing&&!a.reading&&e.read(0)}function T(e){var a=e._readableState;for(d("flow",a.flowing);a.flowing&&null!==e.read(););}function U(e,a){return 0===a.length?null:(a.objectMode?c=a.buffer.shift():!e||e>=a.length?(c=a.decoder?a.buffer.join(""):1===a.buffer.length?a.buffer.first():a.buffer.concat(a.length),a.buffer.clear()):c=a.buffer.consume(e,a.decoder),c);var c}function j(e){var a=e._readableState;d("endReadable",a.endEmitted),a.endEmitted||(a.ended=!0,process.nextTick(N,a,e))}function N(e,a){if(d("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,a.readable=!1,a.emit("end"),e.autoDestroy)){var c=a._writableState;(!c||c.autoDestroy&&c.finished)&&a.destroy()}}function q(e,a){for(var c=0,f=e.length;c=a.highWaterMark:a.length>0)||a.ended))return d("read: emitReadable",a.length,a.ended),0===a.length&&a.ended?j(this):S(this),null;if(0===(e=E(e,a))&&a.ended)return 0===a.length&&j(this),null;var f,b=a.needReadable;return d("need readable",b),(0===a.length||a.length-e0?U(e,a):null)?(a.needReadable=a.length<=a.highWaterMark,e=0):(a.length-=e,a.awaitDrain=0),0===a.length&&(a.ended||(a.needReadable=!0),c!==e&&a.ended&&j(this)),null!==f&&this.emit("data",f),f},A.prototype._read=function(e){v(this,new y("_read()"))},A.prototype.pipe=function(e,a){var c=this,f=this._readableState;switch(f.pipesCount){case 0:f.pipes=e;break;case 1:f.pipes=[f.pipes,e];break;default:f.pipes.push(e)}f.pipesCount+=1,d("pipe count=%d opts=%j",f.pipesCount,a);var t=a&&!1===a.end||e===process.stdout||e===process.stderr?u:i;function i(){d("onend"),e.end()}f.endEmitted?process.nextTick(t):c.once("end",t),e.on("unpipe",(function a(b,t){d("onunpipe"),b===c&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,d("cleanup"),e.removeListener("close",l),e.removeListener("finish",h),e.removeListener("drain",r),e.removeListener("error",s),e.removeListener("unpipe",a),c.removeListener("end",i),c.removeListener("end",u),c.removeListener("data",o),n=!0,!f.awaitDrain||e._writableState&&!e._writableState.needDrain||r())}));var r=function(e){return function(){var a=e._readableState;d("pipeOnDrain",a.awaitDrain),a.awaitDrain&&a.awaitDrain--,0===a.awaitDrain&&b(e,"data")&&(a.flowing=!0,T(e))}}(c);e.on("drain",r);var n=!1;function o(a){d("ondata");var b=e.write(a);d("dest.write",b),!1===b&&((1===f.pipesCount&&f.pipes===e||f.pipesCount>1&&-1!==q(f.pipes,e))&&!n&&(d("false write response, pause",f.awaitDrain),f.awaitDrain++),c.pause())}function s(a){d("onerror",a),u(),e.removeListener("error",s),0===b(e,"error")&&v(e,a)}function l(){e.removeListener("finish",h),u()}function h(){d("onfinish"),e.removeListener("close",l),u()}function u(){d("unpipe"),c.unpipe(e)}return c.on("data",o),function(e,a,c){if("function"==typeof e.prependListener)return e.prependListener(a,c);e._events&&e._events[a]?Array.isArray(e._events[a])?e._events[a].unshift(c):e._events[a]=[c,e._events[a]]:e.on(a,c)}(e,"error",s),e.once("close",l),e.once("finish",h),e.emit("pipe",c),f.flowing||(d("pipe resume"),c.resume()),e},A.prototype.unpipe=function(e){var a=this._readableState,c={hasUnpiped:!1};if(0===a.pipesCount)return this;if(1===a.pipesCount)return e&&e!==a.pipes||(e||(e=a.pipes),a.pipes=null,a.pipesCount=0,a.flowing=!1,e&&e.emit("unpipe",this,c)),this;if(!e){var f=a.pipes,d=a.pipesCount;a.pipes=null,a.pipesCount=0,a.flowing=!1;for(var b=0;b0,!1!==f.flowing&&this.resume()):"readable"===e&&(f.endEmitted||f.readableListening||(f.readableListening=f.needReadable=!0,f.flowing=!1,f.emittedReadable=!1,d("on readable",f.length,f.reading),f.length?S(this):f.reading||process.nextTick(P,this))),c},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,a){var c=t.prototype.removeListener.call(this,e,a);return"readable"===e&&process.nextTick(O,this),c},A.prototype.removeAllListeners=function(e){var a=t.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(O,this),a},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!e.readableListening,function(e,a){a.resumeScheduled||(a.resumeScheduled=!0,process.nextTick(R,e,a))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var a=this,c=this._readableState,f=!1;for(var b in e.on("end",(function(){if(d("wrapped end"),c.decoder&&!c.ended){var e=c.decoder.end();e&&e.length&&a.push(e)}a.push(null)})),e.on("data",(function(b){d("wrapped data"),c.decoder&&(b=c.decoder.write(b)),c.objectMode&&null==b||(c.objectMode||b&&b.length)&&(a.push(b)||(f=!0,e.pause()))})),e)void 0===this[b]&&"function"==typeof e[b]&&(this[b]=function(a){return function(){return e[a].apply(e,arguments)}}(b));for(var t=0;t{"use strict";e.exports=o;var f=c(6048).F,d=f.ERR_METHOD_NOT_IMPLEMENTED,b=f.ERR_MULTIPLE_CALLBACK,t=f.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=f.ERR_TRANSFORM_WITH_LENGTH_0,r=c(5382);function n(e,a){var c=this._transformState;c.transforming=!1;var f=c.writecb;if(null===f)return this.emit("error",new b);c.writechunk=null,c.writecb=null,null!=a&&this.push(a),f(e);var d=this._readableState;d.reading=!1,(d.needReadable||d.length{"use strict";function f(e){var a=this;this.next=null,this.entry=null,this.finish=function(){!function(e,a){var c=e.entry;for(e.entry=null;c;){var f=c.callback;a.pendingcb--,f(undefined),c=c.next}a.corkedRequestsFree.next=e}(a,e)}}var d;e.exports=A,A.WritableState=M;var b,t={deprecate:c(4643)},i=c(345),r=c(8287).Buffer,n=(void 0!==c.g?c.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},o=c(5896),s=c(5291).getHighWaterMark,l=c(6048).F,h=l.ERR_INVALID_ARG_TYPE,u=l.ERR_METHOD_NOT_IMPLEMENTED,x=l.ERR_MULTIPLE_CALLBACK,p=l.ERR_STREAM_CANNOT_PIPE,g=l.ERR_STREAM_DESTROYED,m=l.ERR_STREAM_NULL_VALUES,y=l.ERR_STREAM_WRITE_AFTER_END,_=l.ERR_UNKNOWN_ENCODING,v=o.errorOrDestroy;function w(){}function M(e,a,b){d=d||c(5382),e=e||{},"boolean"!=typeof b&&(b=a instanceof d),this.objectMode=!!e.objectMode,b&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=s(this,e,"writableHighWaterMark",b),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var t=!1===e.decodeStrings;this.decodeStrings=!t,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,a){var c=e._writableState,f=c.sync,d=c.writecb;if("function"!=typeof d)throw new x;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(c),a)!function(e,a,c,f,d){--a.pendingcb,c?(process.nextTick(d,f),process.nextTick(C,e,a),e._writableState.errorEmitted=!0,v(e,f)):(d(f),e._writableState.errorEmitted=!0,v(e,f),C(e,a))}(e,c,f,a,d);else{var b=E(c)||e.destroyed;b||c.corked||c.bufferProcessing||!c.bufferedRequest||k(e,c),f?process.nextTick(I,e,c,b,d):I(e,c,b,d)}}(a,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new f(this)}function A(e){var a=this instanceof(d=d||c(5382));if(!a&&!b.call(A,this))return new A(e);this._writableState=new M(e,this,a),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),i.call(this)}function L(e,a,c,f,d,b,t){a.writelen=f,a.writecb=t,a.writing=!0,a.sync=!0,a.destroyed?a.onwrite(new g("write")):c?e._writev(d,a.onwrite):e._write(d,b,a.onwrite),a.sync=!1}function I(e,a,c,f){c||function(e,a){0===a.length&&a.needDrain&&(a.needDrain=!1,e.emit("drain"))}(e,a),a.pendingcb--,f(),C(e,a)}function k(e,a){a.bufferProcessing=!0;var c=a.bufferedRequest;if(e._writev&&c&&c.next){var d=a.bufferedRequestCount,b=new Array(d),t=a.corkedRequestsFree;t.entry=c;for(var i=0,r=!0;c;)b[i]=c,c.isBuf||(r=!1),c=c.next,i+=1;b.allBuffers=r,L(e,a,!0,a.length,b,"",t.finish),a.pendingcb++,a.lastBufferedRequest=null,t.next?(a.corkedRequestsFree=t.next,t.next=null):a.corkedRequestsFree=new f(a),a.bufferedRequestCount=0}else{for(;c;){var n=c.chunk,o=c.encoding,s=c.callback;if(L(e,a,!1,a.objectMode?1:n.length,n,o,s),c=c.next,a.bufferedRequestCount--,a.writing)break}null===c&&(a.lastBufferedRequest=null)}a.bufferedRequest=c,a.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,a){e._final((function(c){a.pendingcb--,c&&v(e,c),a.prefinished=!0,e.emit("prefinish"),C(e,a)}))}function C(e,a){var c=E(a);if(c&&(function(e,a){a.prefinished||a.finalCalled||("function"!=typeof e._final||a.destroyed?(a.prefinished=!0,e.emit("prefinish")):(a.pendingcb++,a.finalCalled=!0,process.nextTick(S,e,a)))}(e,a),0===a.pendingcb&&(a.finished=!0,e.emit("finish"),a.autoDestroy))){var f=e._readableState;(!f||f.autoDestroy&&f.endEmitted)&&e.destroy()}return c}c(6698)(A,i),M.prototype.getBuffer=function(){for(var e=this.bufferedRequest,a=[];e;)a.push(e),e=e.next;return a},function(){try{Object.defineProperty(M.prototype,"buffer",{get:t.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(b=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(e){return!!b.call(this,e)||this===A&&e&&e._writableState instanceof M}})):b=function(e){return e instanceof this},A.prototype.pipe=function(){v(this,new p)},A.prototype.write=function(e,a,c){var f,d=this._writableState,b=!1,t=!d.objectMode&&(f=e,r.isBuffer(f)||f instanceof n);return t&&!r.isBuffer(e)&&(e=function(e){return r.from(e)}(e)),"function"==typeof a&&(c=a,a=null),t?a="buffer":a||(a=d.defaultEncoding),"function"!=typeof c&&(c=w),d.ending?function(e,a){var c=new y;v(e,c),process.nextTick(a,c)}(this,c):(t||function(e,a,c,f){var d;return null===c?d=new m:"string"==typeof c||a.objectMode||(d=new h("chunk",["string","Buffer"],c)),!d||(v(e,d),process.nextTick(f,d),!1)}(this,d,e,c))&&(d.pendingcb++,b=function(e,a,c,f,d,b){if(!c){var t=function(e,a,c){return e.objectMode||!1===e.decodeStrings||"string"!=typeof a||(a=r.from(a,c)),a}(a,f,d);f!==t&&(c=!0,d="buffer",f=t)}var i=a.objectMode?1:f.length;a.length+=i;var n=a.length-1))throw new _(e);return this._writableState.defaultEncoding=e,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(e,a,c){c(new u("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,a,c){var f=this._writableState;return"function"==typeof e?(c=e,e=null,a=null):"function"==typeof a&&(c=a,a=null),null!=e&&this.write(e,a),f.corked&&(f.corked=1,this.uncork()),f.ending||function(e,a,c){a.ending=!0,C(e,a),c&&(a.finished?process.nextTick(c):e.once("finish",c)),a.ended=!0,e.writable=!1}(this,f,c),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(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=o.destroy,A.prototype._undestroy=o.undestroy,A.prototype._destroy=function(e,a){a(e)}},2955:(e,a,c)=>{"use strict";var f;function d(e,a,c){return(a=function(e){var a=function(e){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var c=a.call(e,"string");if("object"!=typeof c)return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof a?a:String(a)}(a))in e?Object.defineProperty(e,a,{value:c,enumerable:!0,configurable:!0,writable:!0}):e[a]=c,e}var b=c(6238),t=Symbol("lastResolve"),i=Symbol("lastReject"),r=Symbol("error"),n=Symbol("ended"),o=Symbol("lastPromise"),s=Symbol("handlePromise"),l=Symbol("stream");function h(e,a){return{value:e,done:a}}function u(e){var a=e[t];if(null!==a){var c=e[l].read();null!==c&&(e[o]=null,e[t]=null,e[i]=null,a(h(c,!1)))}}function x(e){process.nextTick(u,e)}var p=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((d(f={get stream(){return this[l]},next:function(){var e=this,a=this[r];if(null!==a)return Promise.reject(a);if(this[n])return Promise.resolve(h(void 0,!0));if(this[l].destroyed)return new Promise((function(a,c){process.nextTick((function(){e[r]?c(e[r]):a(h(void 0,!0))}))}));var c,f=this[o];if(f)c=new Promise(function(e,a){return function(c,f){e.then((function(){a[n]?c(h(void 0,!0)):a[s](c,f)}),f)}}(f,this));else{var d=this[l].read();if(null!==d)return Promise.resolve(h(d,!1));c=new Promise(this[s])}return this[o]=c,c}},Symbol.asyncIterator,(function(){return this})),d(f,"return",(function(){var e=this;return new Promise((function(a,c){e[l].destroy(null,(function(e){e?c(e):a(h(void 0,!0))}))}))})),f),p);e.exports=function(e){var a,c=Object.create(g,(d(a={},l,{value:e,writable:!0}),d(a,t,{value:null,writable:!0}),d(a,i,{value:null,writable:!0}),d(a,r,{value:null,writable:!0}),d(a,n,{value:e._readableState.endEmitted,writable:!0}),d(a,s,{value:function(e,a){var f=c[l].read();f?(c[o]=null,c[t]=null,c[i]=null,e(h(f,!1))):(c[t]=e,c[i]=a)},writable:!0}),a));return c[o]=null,b(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var a=c[i];return null!==a&&(c[o]=null,c[t]=null,c[i]=null,a(e)),void(c[r]=e)}var f=c[t];null!==f&&(c[o]=null,c[t]=null,c[i]=null,f(h(void 0,!0))),c[n]=!0})),e.on("readable",x.bind(null,c)),c}},2726:(e,a,c)=>{"use strict";function f(e,a){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(e);a&&(f=f.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),c.push.apply(c,f)}return c}function d(e){for(var a=1;a0?this.tail.next=a:this.head=a,this.tail=a,++this.length}},{key:"unshift",value:function(e){var a={data:e,next:this.head};0===this.length&&(this.tail=a),this.head=a,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var a=this.head,c=""+a.data;a=a.next;)c+=e+a.data;return c}},{key:"concat",value:function(e){if(0===this.length)return r.alloc(0);for(var a,c,f,d=r.allocUnsafe(e>>>0),b=this.head,t=0;b;)a=b.data,c=d,f=t,r.prototype.copy.call(a,c,f),t+=b.data.length,b=b.next;return d}},{key:"consume",value:function(e,a){var c;return ed.length?d.length:e;if(b===d.length?f+=d:f+=d.slice(0,e),0==(e-=b)){b===d.length?(++c,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=d.slice(b));break}++c}return this.length-=c,f}},{key:"_getBuffer",value:function(e){var a=r.allocUnsafe(e),c=this.head,f=1;for(c.data.copy(a),e-=c.data.length;c=c.next;){var d=c.data,b=e>d.length?d.length:e;if(d.copy(a,a.length-e,0,b),0==(e-=b)){b===d.length?(++f,c.next?this.head=c.next:this.head=this.tail=null):(this.head=c,c.data=d.slice(b));break}++f}return this.length-=f,a}},{key:o,value:function(e,a){return n(this,d(d({},a),{},{depth:0,customInspect:!1}))}}])&&t(a.prototype,c),Object.defineProperty(a,"prototype",{writable:!1}),e}()},5896:e=>{"use strict";function a(e,a){f(e,a),c(e)}function c(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function f(e,a){e.emit("error",a)}e.exports={destroy:function(e,d){var b=this,t=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return t||i?(d?d(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(f,this,e)):process.nextTick(f,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!d&&e?b._writableState?b._writableState.errorEmitted?process.nextTick(c,b):(b._writableState.errorEmitted=!0,process.nextTick(a,b,e)):process.nextTick(a,b,e):d?(process.nextTick(c,b),d(e)):process.nextTick(c,b)})),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(e,a){var c=e._readableState,f=e._writableState;c&&c.autoDestroy||f&&f.autoDestroy?e.destroy(a):e.emit("error",a)}}},6238:(e,a,c)=>{"use strict";var f=c(6048).F.ERR_STREAM_PREMATURE_CLOSE;function d(){}e.exports=function e(a,c,b){if("function"==typeof c)return e(a,null,c);c||(c={}),b=function(e){var a=!1;return function(){if(!a){a=!0;for(var c=arguments.length,f=new Array(c),d=0;d{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},7758:(e,a,c)=>{"use strict";var f,d=c(6048).F,b=d.ERR_MISSING_ARGS,t=d.ERR_STREAM_DESTROYED;function i(e){if(e)throw e}function r(e){e()}function n(e,a){return e.pipe(a)}e.exports=function(){for(var e=arguments.length,a=new Array(e),d=0;d0,(function(e){o||(o=e),e&&l.forEach(r),b||(l.forEach(r),s(o))}))}));return a.reduce(n)}},5291:(e,a,c)=>{"use strict";var f=c(6048).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,a,c,d){var b=function(e,a,c){return null!=e.highWaterMark?e.highWaterMark:a?e[c]:null}(a,d,c);if(null!=b){if(!isFinite(b)||Math.floor(b)!==b||b<0)throw new f(d?c:"highWaterMark",b);return Math.floor(b)}return e.objectMode?16:16384}}},345:(e,a,c)=>{e.exports=c(7007).EventEmitter},8399:(e,a,c)=>{(a=e.exports=c(5412)).Stream=a,a.Readable=a,a.Writable=c(6708),a.Duplex=c(5382),a.Transform=c(4610),a.PassThrough=c(3600),a.finished=c(6238),a.pipeline=c(7758)},6011:(e,a,c)=>{"use strict";var f=c(8287).Buffer,d=c(6698),b=c(1147),t=new Array(16),i=[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],r=[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],n=[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],o=[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],s=[0,1518500249,1859775393,2400959708,2840853838],l=[1352829926,1548603684,1836072691,2053994217,0];function h(){b.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function u(e,a){return e<>>32-a}function x(e,a,c,f,d,b,t,i){return u(e+(a^c^f)+b+t|0,i)+d|0}function p(e,a,c,f,d,b,t,i){return u(e+(a&c|~a&f)+b+t|0,i)+d|0}function g(e,a,c,f,d,b,t,i){return u(e+((a|~c)^f)+b+t|0,i)+d|0}function m(e,a,c,f,d,b,t,i){return u(e+(a&f|c&~f)+b+t|0,i)+d|0}function y(e,a,c,f,d,b,t,i){return u(e+(a^(c|~f))+b+t|0,i)+d|0}d(h,b),h.prototype._update=function(){for(var e=t,a=0;a<16;++a)e[a]=this._block.readInt32LE(4*a);for(var c=0|this._a,f=0|this._b,d=0|this._c,b=0|this._d,h=0|this._e,_=0|this._a,v=0|this._b,w=0|this._c,M=0|this._d,A=0|this._e,L=0;L<80;L+=1){var I,k;L<16?(I=x(c,f,d,b,h,e[i[L]],s[0],n[L]),k=y(_,v,w,M,A,e[r[L]],l[0],o[L])):L<32?(I=p(c,f,d,b,h,e[i[L]],s[1],n[L]),k=m(_,v,w,M,A,e[r[L]],l[1],o[L])):L<48?(I=g(c,f,d,b,h,e[i[L]],s[2],n[L]),k=g(_,v,w,M,A,e[r[L]],l[2],o[L])):L<64?(I=m(c,f,d,b,h,e[i[L]],s[3],n[L]),k=p(_,v,w,M,A,e[r[L]],l[3],o[L])):(I=y(c,f,d,b,h,e[i[L]],s[4],n[L]),k=x(_,v,w,M,A,e[r[L]],l[4],o[L])),c=h,h=b,b=u(d,10),d=f,f=I,_=A,A=M,M=u(w,10),w=v,v=k}var E=this._b+d+M|0;this._b=this._c+b+A|0,this._c=this._d+h+_|0,this._d=this._e+c+v|0,this._e=this._a+f+w|0,this._a=E},h.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 e=f.alloc?f.alloc(20):new f(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h},1147:(e,a,c)=>{"use strict";var f=c(2861).Buffer,d=c(8399).Transform;function b(e){d.call(this),this._block=f.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}c(6698)(b,d),b.prototype._transform=function(e,a,c){var f=null;try{this.update(e,a)}catch(e){f=e}c(f)},b.prototype._flush=function(e){var a=null;try{this.push(this.digest())}catch(e){a=e}e(a)},b.prototype.update=function(e,a){if(function(e){if(!f.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");f.isBuffer(e)||(e=f.from(e,a));for(var c=this._block,d=0;this._blockOffset+e.length-d>=this._blockSize;){for(var b=this._blockOffset;b0;++t)this._length[t]+=i,(i=this._length[t]/4294967296|0)>0&&(this._length[t]-=4294967296*i);return this},b.prototype._update=function(){throw new Error("_update is not implemented")},b.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var a=this._digest();void 0!==e&&(a=a.toString(e)),this._block.fill(0),this._blockOffset=0;for(var c=0;c<4;++c)this._length[c]=0;return a},b.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=b},2861:(e,a,c)=>{var f=c(8287),d=f.Buffer;function b(e,a){for(var c in e)a[c]=e[c]}function t(e,a,c){return d(e,a,c)}d.from&&d.alloc&&d.allocUnsafe&&d.allocUnsafeSlow?e.exports=f:(b(f,a),a.Buffer=t),t.prototype=Object.create(d.prototype),b(d,t),t.from=function(e,a,c){if("number"==typeof e)throw new TypeError("Argument must not be a number");return d(e,a,c)},t.alloc=function(e,a,c){if("number"!=typeof e)throw new TypeError("Argument must be a number");var f=d(e);return void 0!==a?"string"==typeof c?f.fill(a,c):f.fill(a):f.fill(0),f},t.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return d(e)},t.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return f.SlowBuffer(e)}},6897:(e,a,c)=>{"use strict";var f=c(453),d=c(41),b=c(592)(),t=c(5795),i=c(9675),r=f("%Math.floor%");e.exports=function(e,a){if("function"!=typeof e)throw new i("`fn` is not a function");if("number"!=typeof a||a<0||a>4294967295||r(a)!==a)throw new i("`length` must be a positive 32-bit integer");var c=arguments.length>2&&!!arguments[2],f=!0,n=!0;if("length"in e&&t){var o=t(e,"length");o&&!o.configurable&&(f=!1),o&&!o.writable&&(n=!1)}return(f||n||!c)&&(b?d(e,"length",a,!0,!0):d(e,"length",a)),e}},392:(e,a,c)=>{var f=c(2861).Buffer;function d(e,a){this._block=f.alloc(e),this._finalSize=a,this._blockSize=e,this._len=0}d.prototype.update=function(e,a){"string"==typeof e&&(a=a||"utf8",e=f.from(e,a));for(var c=this._block,d=this._blockSize,b=e.length,t=this._len,i=0;i=this._finalSize&&(this._update(this._block),this._block.fill(0));var c=8*this._len;if(c<=4294967295)this._block.writeUInt32BE(c,this._blockSize-4);else{var f=(4294967295&c)>>>0,d=(c-f)/4294967296;this._block.writeUInt32BE(d,this._blockSize-8),this._block.writeUInt32BE(f,this._blockSize-4)}this._update(this._block);var b=this._hash();return e?b.toString(e):b},d.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=d},2802:(e,a,c)=>{var f=e.exports=function(e){e=e.toLowerCase();var a=f[e];if(!a)throw new Error(e+" is not supported (we accept pull requests)");return new a};f.sha=c(7816),f.sha1=c(3737),f.sha224=c(6710),f.sha256=c(4107),f.sha384=c(2827),f.sha512=c(2890)},7816:(e,a,c)=>{var f=c(6698),d=c(392),b=c(2861).Buffer,t=[1518500249,1859775393,-1894007588,-899497514],i=new Array(80);function r(){this.init(),this._w=i,d.call(this,64,56)}function n(e){return e<<30|e>>>2}function o(e,a,c,f){return 0===e?a&c|~a&f:2===e?a&c|a&f|c&f:a^c^f}f(r,d),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},r.prototype._update=function(e){for(var a,c=this._w,f=0|this._a,d=0|this._b,b=0|this._c,i=0|this._d,r=0|this._e,s=0;s<16;++s)c[s]=e.readInt32BE(4*s);for(;s<80;++s)c[s]=c[s-3]^c[s-8]^c[s-14]^c[s-16];for(var l=0;l<80;++l){var h=~~(l/20),u=0|((a=f)<<5|a>>>27)+o(h,d,b,i)+r+c[l]+t[h];r=i,i=b,b=n(d),d=f,f=u}this._a=f+this._a|0,this._b=d+this._b|0,this._c=b+this._c|0,this._d=i+this._d|0,this._e=r+this._e|0},r.prototype._hash=function(){var e=b.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=r},3737:(e,a,c)=>{var f=c(6698),d=c(392),b=c(2861).Buffer,t=[1518500249,1859775393,-1894007588,-899497514],i=new Array(80);function r(){this.init(),this._w=i,d.call(this,64,56)}function n(e){return e<<5|e>>>27}function o(e){return e<<30|e>>>2}function s(e,a,c,f){return 0===e?a&c|~a&f:2===e?a&c|a&f|c&f:a^c^f}f(r,d),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},r.prototype._update=function(e){for(var a,c=this._w,f=0|this._a,d=0|this._b,b=0|this._c,i=0|this._d,r=0|this._e,l=0;l<16;++l)c[l]=e.readInt32BE(4*l);for(;l<80;++l)c[l]=(a=c[l-3]^c[l-8]^c[l-14]^c[l-16])<<1|a>>>31;for(var h=0;h<80;++h){var u=~~(h/20),x=n(f)+s(u,d,b,i)+r+c[h]+t[u]|0;r=i,i=b,b=o(d),d=f,f=x}this._a=f+this._a|0,this._b=d+this._b|0,this._c=b+this._c|0,this._d=i+this._d|0,this._e=r+this._e|0},r.prototype._hash=function(){var e=b.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=r},6710:(e,a,c)=>{var f=c(6698),d=c(4107),b=c(392),t=c(2861).Buffer,i=new Array(64);function r(){this.init(),this._w=i,b.call(this,64,56)}f(r,d),r.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},r.prototype._hash=function(){var e=t.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=r},4107:(e,a,c)=>{var f=c(6698),d=c(392),b=c(2861).Buffer,t=[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],i=new Array(64);function r(){this.init(),this._w=i,d.call(this,64,56)}function n(e,a,c){return c^e&(a^c)}function o(e,a,c){return e&a|c&(e|a)}function s(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function l(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}f(r,d),r.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},r.prototype._update=function(e){for(var a,c=this._w,f=0|this._a,d=0|this._b,b=0|this._c,i=0|this._d,r=0|this._e,u=0|this._f,x=0|this._g,p=0|this._h,g=0;g<16;++g)c[g]=e.readInt32BE(4*g);for(;g<64;++g)c[g]=0|(((a=c[g-2])>>>17|a<<15)^(a>>>19|a<<13)^a>>>10)+c[g-7]+h(c[g-15])+c[g-16];for(var m=0;m<64;++m){var y=p+l(r)+n(r,u,x)+t[m]+c[m]|0,_=s(f)+o(f,d,b)|0;p=x,x=u,u=r,r=i+y|0,i=b,b=d,d=f,f=y+_|0}this._a=f+this._a|0,this._b=d+this._b|0,this._c=b+this._c|0,this._d=i+this._d|0,this._e=r+this._e|0,this._f=u+this._f|0,this._g=x+this._g|0,this._h=p+this._h|0},r.prototype._hash=function(){var e=b.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=r},2827:(e,a,c)=>{var f=c(6698),d=c(2890),b=c(392),t=c(2861).Buffer,i=new Array(160);function r(){this.init(),this._w=i,b.call(this,128,112)}f(r,d),r.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},r.prototype._hash=function(){var e=t.allocUnsafe(48);function a(a,c,f){e.writeInt32BE(a,f),e.writeInt32BE(c,f+4)}return a(this._ah,this._al,0),a(this._bh,this._bl,8),a(this._ch,this._cl,16),a(this._dh,this._dl,24),a(this._eh,this._el,32),a(this._fh,this._fl,40),e},e.exports=r},2890:(e,a,c)=>{var f=c(6698),d=c(392),b=c(2861).Buffer,t=[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],i=new Array(160);function r(){this.init(),this._w=i,d.call(this,128,112)}function n(e,a,c){return c^e&(a^c)}function o(e,a,c){return e&a|c&(e|a)}function s(e,a){return(e>>>28|a<<4)^(a>>>2|e<<30)^(a>>>7|e<<25)}function l(e,a){return(e>>>14|a<<18)^(e>>>18|a<<14)^(a>>>9|e<<23)}function h(e,a){return(e>>>1|a<<31)^(e>>>8|a<<24)^e>>>7}function u(e,a){return(e>>>1|a<<31)^(e>>>8|a<<24)^(e>>>7|a<<25)}function x(e,a){return(e>>>19|a<<13)^(a>>>29|e<<3)^e>>>6}function p(e,a){return(e>>>19|a<<13)^(a>>>29|e<<3)^(e>>>6|a<<26)}function g(e,a){return e>>>0>>0?1:0}f(r,d),r.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},r.prototype._update=function(e){for(var a=this._w,c=0|this._ah,f=0|this._bh,d=0|this._ch,b=0|this._dh,i=0|this._eh,r=0|this._fh,m=0|this._gh,y=0|this._hh,_=0|this._al,v=0|this._bl,w=0|this._cl,M=0|this._dl,A=0|this._el,L=0|this._fl,I=0|this._gl,k=0|this._hl,E=0;E<32;E+=2)a[E]=e.readInt32BE(4*E),a[E+1]=e.readInt32BE(4*E+4);for(;E<160;E+=2){var S=a[E-30],C=a[E-30+1],B=h(S,C),F=u(C,S),O=x(S=a[E-4],C=a[E-4+1]),P=p(C,S),R=a[E-14],T=a[E-14+1],U=a[E-32],j=a[E-32+1],N=F+T|0,q=B+R+g(N,F)|0;q=(q=q+O+g(N=N+P|0,P)|0)+U+g(N=N+j|0,j)|0,a[E]=q,a[E+1]=N}for(var D=0;D<160;D+=2){q=a[D],N=a[D+1];var z=o(c,f,d),Q=o(_,v,w),G=s(c,_),K=s(_,c),H=l(i,A),V=l(A,i),Z=t[D],W=t[D+1],Y=n(i,r,m),J=n(A,L,I),$=k+V|0,X=y+H+g($,k)|0;X=(X=(X=X+Y+g($=$+J|0,J)|0)+Z+g($=$+W|0,W)|0)+q+g($=$+N|0,N)|0;var ee=K+Q|0,ae=G+z+g(ee,K)|0;y=m,k=I,m=r,I=L,r=i,L=A,i=b+X+g(A=M+$|0,M)|0,b=d,M=w,d=f,w=v,f=c,v=_,c=X+ae+g(_=$+ee|0,$)|0}this._al=this._al+_|0,this._bl=this._bl+v|0,this._cl=this._cl+w|0,this._dl=this._dl+M|0,this._el=this._el+A|0,this._fl=this._fl+L|0,this._gl=this._gl+I|0,this._hl=this._hl+k|0,this._ah=this._ah+c+g(this._al,_)|0,this._bh=this._bh+f+g(this._bl,v)|0,this._ch=this._ch+d+g(this._cl,w)|0,this._dh=this._dh+b+g(this._dl,M)|0,this._eh=this._eh+i+g(this._el,A)|0,this._fh=this._fh+r+g(this._fl,L)|0,this._gh=this._gh+m+g(this._gl,I)|0,this._hh=this._hh+y+g(this._hl,k)|0},r.prototype._hash=function(){var e=b.allocUnsafe(64);function a(a,c,f){e.writeInt32BE(a,f),e.writeInt32BE(c,f+4)}return a(this._ah,this._al,0),a(this._bh,this._bl,8),a(this._ch,this._cl,16),a(this._dh,this._dl,24),a(this._eh,this._el,32),a(this._fh,this._fl,40),a(this._gh,this._gl,48),a(this._hh,this._hl,56),e},e.exports=r},8310:(e,a,c)=>{e.exports=d;var f=c(7007).EventEmitter;function d(){f.call(this)}c(6698)(d,f),d.Readable=c(5412),d.Writable=c(6708),d.Duplex=c(5382),d.Transform=c(4610),d.PassThrough=c(3600),d.finished=c(6238),d.pipeline=c(7758),d.Stream=d,d.prototype.pipe=function(e,a){var c=this;function d(a){e.writable&&!1===e.write(a)&&c.pause&&c.pause()}function b(){c.readable&&c.resume&&c.resume()}c.on("data",d),e.on("drain",b),e._isStdio||a&&!1===a.end||(c.on("end",i),c.on("close",r));var t=!1;function i(){t||(t=!0,e.end())}function r(){t||(t=!0,"function"==typeof e.destroy&&e.destroy())}function n(e){if(o(),0===f.listenerCount(this,"error"))throw e}function o(){c.removeListener("data",d),e.removeListener("drain",b),c.removeListener("end",i),c.removeListener("close",r),c.removeListener("error",n),e.removeListener("error",n),c.removeListener("end",o),c.removeListener("close",o),e.removeListener("close",o)}return c.on("error",n),e.on("error",n),c.on("end",o),c.on("close",o),e.on("close",o),e.emit("pipe",c),e}},3141:(e,a,c)=>{"use strict";var f=c(2861).Buffer,d=f.isEncoding||function(e){switch((e=""+e)&&e.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 b(e){var a;switch(this.encoding=function(e){var a=function(e){if(!e)return"utf8";for(var a;;)switch(e){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 e;default:if(a)return;e=(""+e).toLowerCase(),a=!0}}(e);if("string"!=typeof a&&(f.isEncoding===d||!d(e)))throw new Error("Unknown encoding: "+e);return a||e}(e),this.encoding){case"utf16le":this.text=r,this.end=n,a=4;break;case"utf8":this.fillLast=i,a=4;break;case"base64":this.text=o,this.end=s,a=3;break;default:return this.write=l,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=f.allocUnsafe(a)}function t(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function i(e){var a=this.lastTotal-this.lastNeed,c=function(e,a){if(128!=(192&a[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&a.length>1){if(128!=(192&a[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&a.length>2&&128!=(192&a[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==c?c:this.lastNeed<=e.length?(e.copy(this.lastChar,a,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,a,0,e.length),void(this.lastNeed-=e.length))}function r(e,a){if((e.length-a)%2==0){var c=e.toString("utf16le",a);if(c){var f=c.charCodeAt(c.length-1);if(f>=55296&&f<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],c.slice(0,-1)}return c}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",a,e.length-1)}function n(e){var a=e&&e.length?this.write(e):"";if(this.lastNeed){var c=this.lastTotal-this.lastNeed;return a+this.lastChar.toString("utf16le",0,c)}return a}function o(e,a){var c=(e.length-a)%3;return 0===c?e.toString("base64",a):(this.lastNeed=3-c,this.lastTotal=3,1===c?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",a,e.length-c))}function s(e){var a=e&&e.length?this.write(e):"";return this.lastNeed?a+this.lastChar.toString("base64",0,3-this.lastNeed):a}function l(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}a.I=b,b.prototype.write=function(e){if(0===e.length)return"";var a,c;if(this.lastNeed){if(void 0===(a=this.fillLast(e)))return"";c=this.lastNeed,this.lastNeed=0}else c=0;return c=0?(d>0&&(e.lastNeed=d-1),d):--f=0?(d>0&&(e.lastNeed=d-2),d):--f=0?(d>0&&(2===d?d=0:e.lastNeed=d-3),d):0}(this,e,a);if(!this.lastNeed)return e.toString("utf8",a);this.lastTotal=c;var f=e.length-(c-this.lastNeed);return e.copy(this.lastChar,0,f),e.toString("utf8",a,f)},b.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},4643:(e,a,c)=>{function f(e){try{if(!c.g.localStorage)return!1}catch(e){return!1}var a=c.g.localStorage[e];return null!=a&&"true"===String(a).toLowerCase()}e.exports=function(e,a){if(f("noDeprecation"))return e;var c=!1;return function(){if(!c){if(f("throwDeprecation"))throw new Error(a);f("traceDeprecation")?console.trace(a):console.warn(a),c=!0}return e.apply(this,arguments)}}},1135:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},9032:(e,a,c)=>{"use strict";var f=c(7244),d=c(8184),b=c(5767),t=c(5680);function i(e){return e.call.bind(e)}var r="undefined"!=typeof BigInt,n="undefined"!=typeof Symbol,o=i(Object.prototype.toString),s=i(Number.prototype.valueOf),l=i(String.prototype.valueOf),h=i(Boolean.prototype.valueOf);if(r)var u=i(BigInt.prototype.valueOf);if(n)var x=i(Symbol.prototype.valueOf);function p(e,a){if("object"!=typeof e)return!1;try{return a(e),!0}catch(e){return!1}}function g(e){return"[object Map]"===o(e)}function m(e){return"[object Set]"===o(e)}function y(e){return"[object WeakMap]"===o(e)}function _(e){return"[object WeakSet]"===o(e)}function v(e){return"[object ArrayBuffer]"===o(e)}function w(e){return"undefined"!=typeof ArrayBuffer&&(v.working?v(e):e instanceof ArrayBuffer)}function M(e){return"[object DataView]"===o(e)}function A(e){return"undefined"!=typeof DataView&&(M.working?M(e):e instanceof DataView)}a.isArgumentsObject=f,a.isGeneratorFunction=d,a.isTypedArray=t,a.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},a.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):t(e)||A(e)},a.isUint8Array=function(e){return"Uint8Array"===b(e)},a.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===b(e)},a.isUint16Array=function(e){return"Uint16Array"===b(e)},a.isUint32Array=function(e){return"Uint32Array"===b(e)},a.isInt8Array=function(e){return"Int8Array"===b(e)},a.isInt16Array=function(e){return"Int16Array"===b(e)},a.isInt32Array=function(e){return"Int32Array"===b(e)},a.isFloat32Array=function(e){return"Float32Array"===b(e)},a.isFloat64Array=function(e){return"Float64Array"===b(e)},a.isBigInt64Array=function(e){return"BigInt64Array"===b(e)},a.isBigUint64Array=function(e){return"BigUint64Array"===b(e)},g.working="undefined"!=typeof Map&&g(new Map),a.isMap=function(e){return"undefined"!=typeof Map&&(g.working?g(e):e instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),a.isSet=function(e){return"undefined"!=typeof Set&&(m.working?m(e):e instanceof Set)},y.working="undefined"!=typeof WeakMap&&y(new WeakMap),a.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(y.working?y(e):e instanceof WeakMap)},_.working="undefined"!=typeof WeakSet&&_(new WeakSet),a.isWeakSet=function(e){return _(e)},v.working="undefined"!=typeof ArrayBuffer&&v(new ArrayBuffer),a.isArrayBuffer=w,M.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&M(new DataView(new ArrayBuffer(1),0,1)),a.isDataView=A;var L="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function I(e){return"[object SharedArrayBuffer]"===o(e)}function k(e){return void 0!==L&&(void 0===I.working&&(I.working=I(new L)),I.working?I(e):e instanceof L)}function E(e){return p(e,s)}function S(e){return p(e,l)}function C(e){return p(e,h)}function B(e){return r&&p(e,u)}function F(e){return n&&p(e,x)}a.isSharedArrayBuffer=k,a.isAsyncFunction=function(e){return"[object AsyncFunction]"===o(e)},a.isMapIterator=function(e){return"[object Map Iterator]"===o(e)},a.isSetIterator=function(e){return"[object Set Iterator]"===o(e)},a.isGeneratorObject=function(e){return"[object Generator]"===o(e)},a.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===o(e)},a.isNumberObject=E,a.isStringObject=S,a.isBooleanObject=C,a.isBigIntObject=B,a.isSymbolObject=F,a.isBoxedPrimitive=function(e){return E(e)||S(e)||C(e)||B(e)||F(e)},a.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(w(e)||k(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(a,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},537:(e,a,c)=>{var f=Object.getOwnPropertyDescriptors||function(e){for(var a=Object.keys(e),c={},f=0;f=b)return e;switch(e){case"%s":return String(f[c++]);case"%d":return Number(f[c++]);case"%j":try{return JSON.stringify(f[c++])}catch(e){return"[Circular]"}default:return e}})),i=f[c];c=3&&(f.depth=arguments[2]),arguments.length>=4&&(f.colors=arguments[3]),x(c)?f.showHidden=c:c&&a._extend(f,c),y(f.showHidden)&&(f.showHidden=!1),y(f.depth)&&(f.depth=2),y(f.colors)&&(f.colors=!1),y(f.customInspect)&&(f.customInspect=!0),f.colors&&(f.stylize=n),s(f,e,f.depth)}function n(e,a){var c=r.styles[a];return c?"["+r.colors[c][0]+"m"+e+"["+r.colors[c][1]+"m":e}function o(e,a){return e}function s(e,c,f){if(e.customInspect&&c&&A(c.inspect)&&c.inspect!==a.inspect&&(!c.constructor||c.constructor.prototype!==c)){var d=c.inspect(f,e);return m(d)||(d=s(e,d,f)),d}var b=function(e,a){if(y(a))return e.stylize("undefined","undefined");if(m(a)){var c="'"+JSON.stringify(a).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(c,"string")}return g(a)?e.stylize(""+a,"number"):x(a)?e.stylize(""+a,"boolean"):p(a)?e.stylize("null","null"):void 0}(e,c);if(b)return b;var t=Object.keys(c),i=function(e){var a={};return e.forEach((function(e,c){a[e]=!0})),a}(t);if(e.showHidden&&(t=Object.getOwnPropertyNames(c)),M(c)&&(t.indexOf("message")>=0||t.indexOf("description")>=0))return l(c);if(0===t.length){if(A(c)){var r=c.name?": "+c.name:"";return e.stylize("[Function"+r+"]","special")}if(_(c))return e.stylize(RegExp.prototype.toString.call(c),"regexp");if(w(c))return e.stylize(Date.prototype.toString.call(c),"date");if(M(c))return l(c)}var n,o="",v=!1,L=["{","}"];return u(c)&&(v=!0,L=["[","]"]),A(c)&&(o=" [Function"+(c.name?": "+c.name:"")+"]"),_(c)&&(o=" "+RegExp.prototype.toString.call(c)),w(c)&&(o=" "+Date.prototype.toUTCString.call(c)),M(c)&&(o=" "+l(c)),0!==t.length||v&&0!=c.length?f<0?_(c)?e.stylize(RegExp.prototype.toString.call(c),"regexp"):e.stylize("[Object]","special"):(e.seen.push(c),n=v?function(e,a,c,f,d){for(var b=[],t=0,i=a.length;t60?c[0]+(""===a?"":a+"\n ")+" "+e.join(",\n ")+" "+c[1]:c[0]+a+" "+e.join(", ")+" "+c[1]}(n,o,L)):L[0]+o+L[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,a,c,f,d,b){var t,i,r;if((r=Object.getOwnPropertyDescriptor(a,d)||{value:a[d]}).get?i=r.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):r.set&&(i=e.stylize("[Setter]","special")),E(f,d)||(t="["+d+"]"),i||(e.seen.indexOf(r.value)<0?(i=p(c)?s(e,r.value,null):s(e,r.value,c-1)).indexOf("\n")>-1&&(i=b?i.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+i.split("\n").map((function(e){return" "+e})).join("\n")):i=e.stylize("[Circular]","special")),y(t)){if(b&&d.match(/^\d+$/))return i;(t=JSON.stringify(""+d)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(t=t.slice(1,-1),t=e.stylize(t,"name")):(t=t.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),t=e.stylize(t,"string"))}return t+": "+i}function u(e){return Array.isArray(e)}function x(e){return"boolean"==typeof e}function p(e){return null===e}function g(e){return"number"==typeof e}function m(e){return"string"==typeof e}function y(e){return void 0===e}function _(e){return v(e)&&"[object RegExp]"===L(e)}function v(e){return"object"==typeof e&&null!==e}function w(e){return v(e)&&"[object Date]"===L(e)}function M(e){return v(e)&&("[object Error]"===L(e)||e instanceof Error)}function A(e){return"function"==typeof e}function L(e){return Object.prototype.toString.call(e)}function I(e){return e<10?"0"+e.toString(10):e.toString(10)}a.debuglog=function(e){if(e=e.toUpperCase(),!b[e])if(t.test(e)){var c=process.pid;b[e]=function(){var f=a.format.apply(a,arguments);console.error("%s %d: %s",e,c,f)}}else b[e]=function(){};return b[e]},a.inspect=r,r.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},r.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},a.types=c(9032),a.isArray=u,a.isBoolean=x,a.isNull=p,a.isNullOrUndefined=function(e){return null==e},a.isNumber=g,a.isString=m,a.isSymbol=function(e){return"symbol"==typeof e},a.isUndefined=y,a.isRegExp=_,a.types.isRegExp=_,a.isObject=v,a.isDate=w,a.types.isDate=w,a.isError=M,a.types.isNativeError=M,a.isFunction=A,a.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},a.isBuffer=c(1135);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(e,a){return Object.prototype.hasOwnProperty.call(e,a)}a.log=function(){var e,c;console.log("%s - %s",(c=[I((e=new Date).getHours()),I(e.getMinutes()),I(e.getSeconds())].join(":"),[e.getDate(),k[e.getMonth()],c].join(" ")),a.format.apply(a,arguments))},a.inherits=c(6698),a._extend=function(e,a){if(!a||!v(a))return e;for(var c=Object.keys(a),f=c.length;f--;)e[c[f]]=a[c[f]];return e};var S="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function C(e,a){if(!e){var c=new Error("Promise was rejected with a falsy value");c.reason=e,e=c}return a(e)}a.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(S&&e[S]){var a;if("function"!=typeof(a=e[S]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(a,S,{value:a,enumerable:!1,writable:!1,configurable:!0}),a}function a(){for(var a,c,f=new Promise((function(e,f){a=e,c=f})),d=[],b=0;b{e.exports=function e(f,d){var b,t=0,i=0,r=d=d||0,n=f.length;do{if(r>=n)throw e.bytes=0,new RangeError("Could not decode varint");b=f[r++],t+=i<28?(b&c)<=a);return e.bytes=r-d,t};var a=128,c=127},1877:e=>{e.exports=function e(d,b,t){b=b||[];for(var i=t=t||0;d>=f;)b[t++]=255&d|a,d/=128;for(;d&c;)b[t++]=255&d|a,d>>>=7;return b[t]=0|d,e.bytes=t-i+1,b};var a=128,c=-128,f=Math.pow(2,31)},1203:(e,a,c)=>{e.exports={encode:c(1877),decode:c(6797),encodingLength:c(7867)}},7867:e=>{var a=Math.pow(2,7),c=Math.pow(2,14),f=Math.pow(2,21),d=Math.pow(2,28),b=Math.pow(2,35),t=Math.pow(2,42),i=Math.pow(2,49),r=Math.pow(2,56),n=Math.pow(2,63);e.exports=function(e){return e{var indexOf=function(e,a){if(e.indexOf)return e.indexOf(a);for(var c=0;c{"use strict";a.TextEncoder="undefined"!=typeof TextEncoder?TextEncoder:c(537).TextEncoder,a.TextDecoder="undefined"!=typeof TextDecoder?TextDecoder:c(537).TextDecoder},5767:(e,a,c)=>{"use strict";var f=c(2682),d=c(9209),b=c(487),t=c(8075),i=c(5795),r=t("Object.prototype.toString"),n=c(9092)(),o="undefined"==typeof globalThis?c.g:globalThis,s=d(),l=t("String.prototype.slice"),h=Object.getPrototypeOf,u=t("Array.prototype.indexOf",!0)||function(e,a){for(var c=0;c-1?a:"Object"===a&&function(e){var a=!1;return f(x,(function(c,f){if(!a)try{c(e),a=l(f,1)}catch(e){}})),a}(e)}return i?function(e){var a=!1;return f(x,(function(c,f){if(!a)try{"$"+c(e)===f&&(a=l(f,1))}catch(e){}})),a}(e):null}},8982:()=>{},7790:()=>{},3776:()=>{},1638:()=>{},2668:()=>{},7965:()=>{},6089:()=>{},9368:()=>{},4688:()=>{},1069:()=>{},5340:()=>{},9838:()=>{},7882:()=>{},9209:(e,a,c)=>{"use strict";var f=c(6578),d="undefined"==typeof globalThis?c.g:globalThis;e.exports=function(){for(var e=[],a=0;a{"use strict";c.d(a,{K:()=>d});var f=c(5930);function d(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?(0,f.o)(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}},5007:(e,a,c)=>{"use strict";c.r(a),c.d(a,{concat:()=>b});var f=c(5238),d=c(5930);function b(e,a){a||(a=e.reduce(((e,a)=>e+a.length),0));const c=(0,f.K)(a);let b=0;for(const a of e)c.set(a,b),b+=a.length;return(0,d.o)(c)}},8402:(e,a,c)=>{"use strict";function f(e,a){if(e===a)return!0;if(e.byteLength!==a.byteLength)return!1;for(let c=0;cf})},4117:(e,a,c)=>{"use strict";c.r(a),c.d(a,{fromString:()=>b});var f=c(40),d=c(5930);function b(e,a="utf8"){const c=f.A[a];if(!c)throw new Error(`Unsupported encoding "${a}"`);return"utf8"!==a&&"utf-8"!==a||null==globalThis.Buffer||null==globalThis.Buffer.from?c.decoder.decode(`${c.prefix}${e}`):(0,d.o)(globalThis.Buffer.from(e,"utf-8"))}},7302:(e,a,c)=>{"use strict";c.r(a),c.d(a,{toString:()=>d});var f=c(40);function d(e,a="utf8"){const c=f.A[a];if(!c)throw new Error(`Unsupported encoding "${a}"`);return"utf8"!==a&&"utf-8"!==a||null==globalThis.Buffer||null==globalThis.Buffer.from?c.encoder.encode(e).substring(1):globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8")}},5930:(e,a,c)=>{"use strict";function f(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}c.d(a,{o:()=>f})},40:(e,a,c)=>{"use strict";c.d(a,{A:()=>qe});var f={};c.r(f),c.d(f,{identity:()=>k});var d={};c.r(d),c.d(d,{base2:()=>E});var b={};c.r(b),c.d(b,{base8:()=>S});var t={};c.r(t),c.d(t,{base10:()=>C});var i={};c.r(i),c.d(i,{base16:()=>B,base16upper:()=>F});var r={};c.r(r),c.d(r,{base32:()=>O,base32hex:()=>U,base32hexpad:()=>N,base32hexpadupper:()=>q,base32hexupper:()=>j,base32pad:()=>R,base32padupper:()=>T,base32upper:()=>P,base32z:()=>D});var n={};c.r(n),c.d(n,{base36:()=>z,base36upper:()=>Q});var o={};c.r(o),c.d(o,{base58btc:()=>G,base58flickr:()=>K});var s={};c.r(s),c.d(s,{base64:()=>H,base64pad:()=>V,base64url:()=>Z,base64urlpad:()=>W});var l={};c.r(l),c.d(l,{base256emoji:()=>X});var h={};c.r(h),c.d(h,{sha256:()=>ve,sha512:()=>we});var u={};c.r(u),c.d(u,{identity:()=>Ae});var x={};c.r(x),c.d(x,{code:()=>Ie,decode:()=>Ee,encode:()=>ke,name:()=>Le});var p={};c.r(p),c.d(p,{code:()=>Fe,decode:()=>Pe,encode:()=>Oe,name:()=>Be});const g=function(e,a){if(e.length>=255)throw new TypeError("Alphabet too long");for(var c=new Uint8Array(256),f=0;f>>0,t=new Uint8Array(b);e[a];){var o=c[e.charCodeAt(a)];if(255===o)return;for(var s=0,l=b-1;(0!==o||s>>0,t[l]=o%256>>>0,o=o/256>>>0;if(0!==o)throw new Error("Non-zero carry");d=s,a++}if(" "!==e[a]){for(var h=b-d;h!==b&&0===t[h];)h++;for(var u=new Uint8Array(f+(b-h)),x=f;h!==b;)u[x++]=t[h++];return u}}}return{encode:function(a){if(a instanceof Uint8Array||(ArrayBuffer.isView(a)?a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength):Array.isArray(a)&&(a=Uint8Array.from(a))),!(a instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===a.length)return"";for(var c=0,f=0,d=0,b=a.length;d!==b&&0===a[d];)d++,c++;for(var t=(b-d)*o+1>>>0,n=new Uint8Array(t);d!==b;){for(var s=a[d],l=0,h=t-1;(0!==s||l>>0,n[h]=s%i>>>0,s=s/i>>>0;if(0!==s)throw new Error("Non-zero carry");f=l,d++}for(var u=t-f;u!==t&&0===n[u];)u++;for(var x=r.repeat(c);u{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")});class y{constructor(e,a,c){this.name=e,this.prefix=a,this.baseEncode=c}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class _{constructor(e,a,c){if(this.name=e,this.prefix=a,void 0===a.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=a.codePointAt(0),this.baseDecode=c}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return w(this,e)}}class v{constructor(e){this.decoders=e}or(e){return w(this,e)}decode(e){const a=e[0],c=this.decoders[a];if(c)return c.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const w=(e,a)=>new v({...e.decoders||{[e.prefix]:e},...a.decoders||{[a.prefix]:a}});class M{constructor(e,a,c,f){this.name=e,this.prefix=a,this.baseEncode=c,this.baseDecode=f,this.encoder=new y(e,a,c),this.decoder=new _(e,a,f)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const A=({name:e,prefix:a,encode:c,decode:f})=>new M(e,a,c,f),L=({prefix:e,name:a,alphabet:c})=>{const{encode:f,decode:d}=g(c,a);return A({prefix:e,name:a,encode:f,decode:e=>m(d(e))})},I=({name:e,prefix:a,bitsPerChar:c,alphabet:f})=>A({prefix:a,name:e,encode:e=>((e,a,c)=>{const f="="===a[a.length-1],d=(1<c;)t-=c,b+=a[d&i>>t];if(t&&(b+=a[d&i<((e,a,c,f)=>{const d={};for(let e=0;e=8&&(i-=8,t[n++]=255&r>>i)}if(i>=c||255&r<<8-i)throw new SyntaxError("Unexpected end of data");return t})(a,f,c,e)}),k=A({prefix:"\0",name:"identity",encode:e=>{return a=e,(new TextDecoder).decode(a);var a},decode:e=>(e=>(new TextEncoder).encode(e))(e)}),E=I({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),S=I({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),C=L({prefix:"9",name:"base10",alphabet:"0123456789"}),B=I({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),F=I({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),O=I({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),P=I({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),R=I({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),T=I({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),U=I({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),j=I({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),N=I({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),q=I({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),D=I({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),z=L({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Q=L({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),G=L({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),K=L({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),H=I({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),V=I({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Z=I({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),W=I({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Y=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),J=Y.reduce(((e,a,c)=>(e[c]=a,e)),[]),$=Y.reduce(((e,a,c)=>(e[a.codePointAt(0)]=c,e)),[]),X=A({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce(((e,a)=>e+J[a]),"")},decode:function(e){const a=[];for(const c of e){const e=$[c.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${c}`);a.push(e)}return new Uint8Array(a)}});var ee=128,ae=-128,ce=Math.pow(2,31),fe=Math.pow(2,7),de=Math.pow(2,14),be=Math.pow(2,21),te=Math.pow(2,28),ie=Math.pow(2,35),re=Math.pow(2,42),ne=Math.pow(2,49),oe=Math.pow(2,56),se=Math.pow(2,63);const le=function e(a,c,f){c=c||[];for(var d=f=f||0;a>=ce;)c[f++]=255&a|ee,a/=128;for(;a&ae;)c[f++]=255&a|ee,a>>>=7;return c[f]=0|a,e.bytes=f-d+1,c},he=function(e){return e(le(e,a,c),a),xe=e=>he(e),pe=(e,a)=>{const c=a.byteLength,f=xe(e),d=f+xe(c),b=new Uint8Array(d+c);return ue(e,b,0),ue(c,b,f),b.set(a,d),new ge(e,c,a,b)};class ge{constructor(e,a,c,f){this.code=e,this.size=a,this.digest=c,this.bytes=f}}const me=({name:e,code:a,encode:c})=>new ye(e,a,c);class ye{constructor(e,a,c){this.name=e,this.code=a,this.encode=c}digest(e){if(e instanceof Uint8Array){const a=this.encode(e);return a instanceof Uint8Array?pe(this.code,a):a.then((e=>pe(this.code,e)))}throw Error("Unknown type, must be binary type")}}const _e=e=>async a=>new Uint8Array(await crypto.subtle.digest(e,a)),ve=me({name:"sha2-256",code:18,encode:_e("SHA-256")}),we=me({name:"sha2-512",code:19,encode:_e("SHA-512")}),Me=m,Ae={code:0,name:"identity",encode:Me,digest:e=>pe(0,Me(e))},Le="raw",Ie=85,ke=e=>m(e),Ee=e=>m(e),Se=new TextEncoder,Ce=new TextDecoder,Be="json",Fe=512,Oe=e=>Se.encode(JSON.stringify(e)),Pe=e=>JSON.parse(Ce.decode(e));Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"),Symbol.for("@ipld/js-cid/CID");const Re={...f,...d,...b,...t,...i,...r,...n,...o,...s,...l};var Te=c(5238);function Ue(e,a,c,f){return{name:e,prefix:a,encoder:{name:e,prefix:a,encode:c},decoder:{decode:f}}}const je=Ue("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),Ne=Ue("ascii","a",(e=>{let a="a";for(let c=0;c{e=e.substring(1);const a=(0,Te.K)(e.length);for(let c=0;c{"use strict";e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},2951:e=>{"use strict";e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},4589:e=>{"use strict";e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},3241:e=>{"use strict";e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},1636:e=>{"use strict";e.exports={rE:"6.5.7"}},5579:e=>{"use strict";e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')}},__webpack_module_cache__={};function __webpack_require__(e){var a=__webpack_module_cache__[e];if(void 0!==a)return a.exports;var c=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(c.exports,c,c.exports,__webpack_require__),c.loaded=!0,c.exports}__webpack_require__.amdO={},__webpack_require__.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(a,{a}),a},__webpack_require__.d=(e,a)=>{for(var c in a)__webpack_require__.o(a,c)&&!__webpack_require__.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};return(()=>{"use strict";var e=__webpack_require__(7882),a=__webpack_require__.n(e),c=__webpack_require__(1217);const f=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];function d(e,a){return a&&10!=a?16==a?"0x"==e.slice(0,2)?BigInt(e):BigInt("0x"+e):void 0:BigInt(e)}const b=d;function t(e){const a=e.toString(16);return 4*(a.length-1)+f[parseInt(a[0],16)]}function i(e){return BigInt(e)>BigInt(a)}const o=r,s=n;function l(e){return(BigInt(e)&BigInt(1))==BigInt(1)}function h(e){if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("Number too big");return Number(e)}function u(e,a){return BigInt(e)+BigInt(a)}function x(e,a){return BigInt(e)-BigInt(a)}function p(e){return-BigInt(e)}function g(e,a){return BigInt(e)*BigInt(a)}function m(e,a){return BigInt(e)%BigInt(a)}function y(e,a){return BigInt(e)>BigInt(a)}function _(e,a){return BigInt(e)>=BigInt(a)}function v(e,a){return BigInt(e)&BigInt(a)}function w(e,a,c,f){const d="0000000"+c.toString(16),b=new Uint32Array(e.buffer,e.byteOffset+a,f/4),t=1+(4*(d.length-7)-1>>5);for(let e=0;eb[b.length-a-1]=e.toString(16).padStart(8,"0"))),d(b.join(""),16)}function A(e,a){return e.toString(a)}function L(e){const a=new Uint8Array(Math.floor((t(e)-1)/8)+1);return w(a,0,e,a.byteLength),a}const I=b(0),k=b(1);var E=Object.freeze({__proto__:null,abs:function(e){return BigInt(e)>=0?BigInt(e):-BigInt(e)},add:u,band:v,bitLength:t,bits:function(e){let a=BigInt(e);const c=[];for(;a;)a&BigInt(1)?c.push(1):c.push(0),a>>=BigInt(1);return c},bor:function(e,a){return BigInt(e)|BigInt(a)},bxor:function(e,a){return BigInt(e)^BigInt(a)},div:function(e,a){return BigInt(e)/BigInt(a)},e:b,eq:function(e,a){return BigInt(e)==BigInt(a)},exp:function(e,a){return BigInt(e)**BigInt(a)},fromArray:function(e,a){let c=BigInt(0);a=BigInt(a);for(let f=0;f>=BigInt(1)}return c},neg:p,neq:function(e,a){return BigInt(e)!=BigInt(a)},one:k,pow:function(e,a){return BigInt(e)**BigInt(a)},shiftLeft:r,shiftRight:n,shl:o,shr:s,square:function(e){return BigInt(e)*BigInt(e)},sub:x,toArray:function(e,a){const c=[];let f=BigInt(e);for(a=BigInt(a);f;)c.unshift(Number(f%a)),f/=a;return c},toLEBuff:L,toNumber:h,toRprBE:function(e,a,c,f){const d="0000000"+c.toString(16),b=new DataView(e.buffer,e.byteOffset+a,f),t=1+(4*(d.length-7)-1>>5);for(let e=0;e>=1;return c}function B(e,a,c,f,d){e[a]=e[a]+e[c]>>>0,e[d]=(e[d]^e[a])>>>0,e[d]=(e[d]<<16|e[d]>>>16&65535)>>>0,e[f]=e[f]+e[d]>>>0,e[c]=(e[c]^e[f])>>>0,e[c]=(e[c]<<12|e[c]>>>20&4095)>>>0,e[a]=e[a]+e[c]>>>0,e[d]=(e[d]^e[a])>>>0,e[d]=(e[d]<<8|e[d]>>>24&255)>>>0,e[f]=e[f]+e[d]>>>0,e[c]=(e[c]^e[f])>>>0,e[c]=(e[c]<<7|e[c]>>>25&127)>>>0}class F{constructor(e){e=e||[0,0,0,0,0,0,0,0],this.state=[1634760805,857760878,2036477234,1797285236,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],0,0,0,0],this.idx=16,this.buff=new Array(16)}nextU32(){return 16==this.idx&&this.update(),this.buff[this.idx++]}nextU64(){return u(g(this.nextU32(),4294967296),this.nextU32())}nextBool(){return!(1&~this.nextU32())}update(){for(let e=0;e<16;e++)this.buff[e]=this.state[e];for(let a=0;a<10;a++)B(e=this.buff,0,4,8,12),B(e,1,5,9,13),B(e,2,6,10,14),B(e,3,7,11,15),B(e,0,5,10,15),B(e,1,6,11,12),B(e,2,7,8,13),B(e,3,4,9,14);var e;for(let e=0;e<16;e++)this.buff[e]=this.buff[e]+this.state[e]>>>0;this.idx=0,this.state[12]=this.state[12]+1>>>0,0==this.state[12]&&(this.state[13]=this.state[13]+1>>>0,0==this.state[13]&&(this.state[14]=this.state[14]+1>>>0,0==this.state[14]&&(this.state[15]=this.state[15]+1>>>0)))}}let O=null;function P(){return O||(O=new F(function(){const e=function(e){let a=new Uint8Array(e);if(void 0!==globalThis.crypto)globalThis.crypto.getRandomValues(a);else for(let c=0;c>>0;return a}(32),a=new Uint32Array(e.buffer),c=[];for(let e=0;e<8;e++)c.push(a[e]);return c}()),O)}function R(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var T={bigInt2BytesLE:function(e,a){const c=Array(a);let f=BigInt(e);for(let e=0;e>=8n;return c},bigInt2U32LE:function(e,a){const c=Array(a);let f=BigInt(e);for(let e=0;e>=32n;return c},isOcamNum:function(e){return!!Array.isArray(e)&&3==e.length&&"number"==typeof e[0]&&"number"==typeof e[1]&&!!Array.isArray(e[2])}},U=function(e,a,c,f,d,b,t){const i=e.addFunction(a);i.addParam("base","i32"),i.addParam("scalar","i32"),i.addParam("scalarLength","i32"),i.addParam("r","i32"),i.addLocal("i","i32"),i.addLocal("b","i32");const r=i.getCodeBuilder(),n=r.i32_const(e.alloc(c));i.addCode(r.if(r.i32_eqz(r.getLocal("scalarLength")),[...r.call(t,r.getLocal("r")),...r.ret([])])),i.addCode(r.call(b,r.getLocal("base"),n)),i.addCode(r.call(t,r.getLocal("r"))),i.addCode(r.setLocal("i",r.getLocal("scalarLength"))),i.addCode(r.block(r.loop(r.setLocal("i",r.i32_sub(r.getLocal("i"),r.i32_const(1))),r.setLocal("b",r.i32_load8_u(r.i32_add(r.getLocal("scalar"),r.getLocal("i")))),...function(){const e=[];for(let a=0;a<8;a++)e.push(...r.call(d,r.getLocal("r"),r.getLocal("r")),...r.if(r.i32_ge_u(r.getLocal("b"),r.i32_const(128>>a)),[...r.setLocal("b",r.i32_sub(r.getLocal("b"),r.i32_const(128>>a))),...r.call(f,r.getLocal("r"),n,r.getLocal("r"))]));return e}(),r.br_if(1,r.i32_eqz(r.getLocal("i"))),r.br(0))))},j=function(e,a){const c=8*e.modules[a].n64,f=e.addFunction(a+"_batchInverse");f.addParam("pIn","i32"),f.addParam("inStep","i32"),f.addParam("n","i32"),f.addParam("pOut","i32"),f.addParam("outStep","i32"),f.addLocal("itAux","i32"),f.addLocal("itIn","i32"),f.addLocal("itOut","i32"),f.addLocal("i","i32");const d=f.getCodeBuilder(),b=d.i32_const(e.alloc(c));f.addCode(d.setLocal("itAux",d.i32_load(d.i32_const(0))),d.i32_store(d.i32_const(0),d.i32_add(d.getLocal("itAux"),d.i32_mul(d.i32_add(d.getLocal("n"),d.i32_const(1)),d.i32_const(c))))),f.addCode(d.call(a+"_one",d.getLocal("itAux")),d.setLocal("itIn",d.getLocal("pIn")),d.setLocal("itAux",d.i32_add(d.getLocal("itAux"),d.i32_const(c))),d.setLocal("i",d.i32_const(0)),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("i"),d.getLocal("n"))),d.if(d.call(a+"_isZero",d.getLocal("itIn")),d.call(a+"_copy",d.i32_sub(d.getLocal("itAux"),d.i32_const(c)),d.getLocal("itAux")),d.call(a+"_mul",d.getLocal("itIn"),d.i32_sub(d.getLocal("itAux"),d.i32_const(c)),d.getLocal("itAux"))),d.setLocal("itIn",d.i32_add(d.getLocal("itIn"),d.getLocal("inStep"))),d.setLocal("itAux",d.i32_add(d.getLocal("itAux"),d.i32_const(c))),d.setLocal("i",d.i32_add(d.getLocal("i"),d.i32_const(1))),d.br(0))),d.setLocal("itIn",d.i32_sub(d.getLocal("itIn"),d.getLocal("inStep"))),d.setLocal("itAux",d.i32_sub(d.getLocal("itAux"),d.i32_const(c))),d.setLocal("itOut",d.i32_add(d.getLocal("pOut"),d.i32_mul(d.i32_sub(d.getLocal("n"),d.i32_const(1)),d.getLocal("outStep")))),d.call(a+"_inverse",d.getLocal("itAux"),d.getLocal("itAux")),d.block(d.loop(d.br_if(1,d.i32_eqz(d.getLocal("i"))),d.if(d.call(a+"_isZero",d.getLocal("itIn")),[...d.call(a+"_copy",d.getLocal("itAux"),d.i32_sub(d.getLocal("itAux"),d.i32_const(c))),...d.call(a+"_zero",d.getLocal("itOut"))],[...d.call(a+"_copy",d.i32_sub(d.getLocal("itAux"),d.i32_const(c)),b),...d.call(a+"_mul",d.getLocal("itAux"),d.getLocal("itIn"),d.i32_sub(d.getLocal("itAux"),d.i32_const(c))),...d.call(a+"_mul",d.getLocal("itAux"),b,d.getLocal("itOut"))]),d.setLocal("itIn",d.i32_sub(d.getLocal("itIn"),d.getLocal("inStep"))),d.setLocal("itOut",d.i32_sub(d.getLocal("itOut"),d.getLocal("outStep"))),d.setLocal("itAux",d.i32_sub(d.getLocal("itAux"),d.i32_const(c))),d.setLocal("i",d.i32_sub(d.getLocal("i"),d.i32_const(1))),d.br(0)))),f.addCode(d.i32_store(d.i32_const(0),d.getLocal("itAux")))},N=function(e,a,c,f,d,b){void 0===b&&(b=fa?1:-1}function z(e){return e*e}function Q(e){return e%2n!==0n}function G(e){return e%2n===0n}function K(e){return e<0n}function H(e){return e>0n}function V(e){return K(e)?e.toString(2).length-1:e.toString(2).length}function Z(e){return e<0n?-e:e}function W(e){return 1n===Z(e)}function Y(e,a){for(var c,f,d,b=0n,t=1n,i=a,r=Z(e);0n!==r;)c=i/r,f=b,d=i,b=t,i=r,t=f-c*t,r=d-c*r;if(!W(i))throw new Error(e.toString()+" and "+a.toString()+" are not co-prime");return-1===D(b,0n)&&(b+=a),K(e)?-b:b}function J(e,a,c){if(0n===c)throw new Error("Cannot take modPow with modulus 0");var f=1n,d=e%c;for(K(a)&&(a*=-1n,d=Y(d,c));H(a);){if(0n===d)return 0n;Q(a)&&(f=f*d%c),a/=2n,d=z(d)%c}return f}function $(e,a){return 0n!==a&&(!!W(a)||(0===function(e,a){return(e=e>=0n?e:-e)===(a=a>=0n?a:-a)?0:e>a?1:-1}(a,2n)?G(e):e%a===0n))}function X(e,a){for(var c,f,d,b=function(e){return e-1n}(e),t=b,i=0;G(t);)t/=2n,i++;e:for(f=0;f>1&&f>1,e>>1)))),a.addCode(c.setLocal(r,c.i64_add(c.getLocal(r),c.i64_shr_u(c.getLocal(i),c.i64_const(32)))))),e>0&&(a.addCode(c.setLocal(i,c.i64_add(c.i64_and(c.getLocal(i),c.i64_const(4294967295)),c.i64_and(c.getLocal(n),c.i64_const(4294967295))))),a.addCode(c.setLocal(r,c.i64_add(c.i64_add(c.getLocal(r),c.i64_shr_u(c.getLocal(i),c.i64_const(32))),c.getLocal(o))))),a.addCode(c.i64_store32(c.getLocal("r"),4*e,c.getLocal(i))),a.addCode(c.setLocal(n,c.getLocal(r)),c.setLocal(o,c.i64_shr_u(c.getLocal(n),c.i64_const(32))))}a.addCode(c.i64_store32(c.getLocal("r"),4*d*2-4,c.getLocal(n)))}(),function(){const a=e.addFunction(f+"_squareOld");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder();a.addCode(c.call(f+"_mul",c.getLocal("x"),c.getLocal("x"),c.getLocal("r")))}(),function(){!function(){const a=e.addFunction(f+"__mul1");a.addParam("px","i32"),a.addParam("y","i64"),a.addParam("pr","i32"),a.addLocal("c","i64");const c=a.getCodeBuilder();a.addCode(c.setLocal("c",c.i64_mul(c.i64_load32_u(c.getLocal("px"),0,0),c.getLocal("y")))),a.addCode(c.i64_store32(c.getLocal("pr"),0,0,c.getLocal("c")));for(let e=1;e>1n,p=e.alloc(i,ee.bigInt2BytesLE(x,i)),g=x+1n,m=e.alloc(i,ee.bigInt2BytesLE(g,i));e.modules[r]={pq:o,pR2:s,n64:b,q:d,pOne:l,pZero:h,pePlusOne:m};let y=2n;if(re(d))for(;ie(y,x,d)!==u;)y+=1n;let _=0,v=u;for(;!ne(v)&&0n!==v;)_++,v>>=1n;const w=e.alloc(i,ee.bigInt2BytesLE(v,i)),M=ie(y,v,d),A=e.alloc(ee.bigInt2BytesLE((M<>1n,I=e.alloc(i,ee.bigInt2BytesLE(L,i));return e.exportFunction(n+"_copy",r+"_copy"),e.exportFunction(n+"_zero",r+"_zero"),e.exportFunction(n+"_isZero",r+"_isZero"),e.exportFunction(n+"_eq",r+"_eq"),function(){const a=e.addFunction(r+"_isOne");a.addParam("x","i32"),a.setReturnType("i32");const c=a.getCodeBuilder();a.addCode(c.ret(c.call(n+"_eq",c.getLocal("x"),c.i32_const(l))))}(),function(){const a=e.addFunction(r+"_add");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const c=a.getCodeBuilder();a.addCode(c.if(c.call(n+"_add",c.getLocal("x"),c.getLocal("y"),c.getLocal("r")),c.drop(c.call(n+"_sub",c.getLocal("r"),c.i32_const(o),c.getLocal("r"))),c.if(c.call(n+"_gte",c.getLocal("r"),c.i32_const(o)),c.drop(c.call(n+"_sub",c.getLocal("r"),c.i32_const(o),c.getLocal("r"))))))}(),function(){const a=e.addFunction(r+"_sub");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const c=a.getCodeBuilder();a.addCode(c.if(c.call(n+"_sub",c.getLocal("x"),c.getLocal("y"),c.getLocal("r")),c.drop(c.call(n+"_add",c.getLocal("r"),c.i32_const(o),c.getLocal("r")))))}(),function(){const a=e.addFunction(r+"_neg");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder();a.addCode(c.call(r+"_sub",c.i32_const(h),c.getLocal("x"),c.getLocal("r")))}(),function(){const a=e.alloc(t*t*8),c=e.addFunction(r+"_mReduct");c.addParam("t","i32"),c.addParam("r","i32"),c.addLocal("np32","i64"),c.addLocal("c","i64"),c.addLocal("m","i64");const f=c.getCodeBuilder(),b=Number(0x100000000n-te(d,0x100000000n));c.addCode(f.setLocal("np32",f.i64_const(b)));for(let e=0;e=t&&a.addCode(c.i64_store32(c.getLocal("r"),4*(e-t),c.getLocal(u))),[u,x]=[x,u],a.addCode(c.setLocal(x,c.i64_shr_u(c.getLocal(u),c.i64_const(32))))}a.addCode(c.i64_store32(c.getLocal("r"),4*t-4,c.getLocal(u))),a.addCode(c.if(c.i32_wrap_i64(c.getLocal(x)),c.drop(c.call(n+"_sub",c.getLocal("r"),c.i32_const(o),c.getLocal("r"))),c.if(c.call(n+"_gte",c.getLocal("r"),c.i32_const(o)),c.drop(c.call(n+"_sub",c.getLocal("r"),c.i32_const(o),c.getLocal("r"))))))}(),function(){const a=e.addFunction(r+"_square");a.addParam("x","i32"),a.addParam("r","i32"),a.addLocal("c0","i64"),a.addLocal("c1","i64"),a.addLocal("c0_old","i64"),a.addLocal("c1_old","i64"),a.addLocal("np32","i64");for(let e=0;e>1&&f>1,e>>1)))),a.addCode(c.setLocal(u,c.i64_add(c.getLocal(u),c.i64_shr_u(c.getLocal(h),c.i64_const(32)))))),e>0&&(a.addCode(c.setLocal(h,c.i64_add(c.i64_and(c.getLocal(h),c.i64_const(4294967295)),c.i64_and(c.getLocal(x),c.i64_const(4294967295))))),a.addCode(c.setLocal(u,c.i64_add(c.i64_add(c.getLocal(u),c.i64_shr_u(c.getLocal(h),c.i64_const(32))),c.getLocal(p)))));for(let f=Math.max(1,e-t+1);f<=e&&f=t&&a.addCode(c.i64_store32(c.getLocal("r"),4*(e-t),c.getLocal(h))),a.addCode(c.setLocal(x,c.getLocal(u)),c.setLocal(p,c.i64_shr_u(c.getLocal(x),c.i64_const(32))))}a.addCode(c.i64_store32(c.getLocal("r"),4*t-4,c.getLocal(x))),a.addCode(c.if(c.i32_wrap_i64(c.getLocal(p)),c.drop(c.call(n+"_sub",c.getLocal("r"),c.i32_const(o),c.getLocal("r"))),c.if(c.call(n+"_gte",c.getLocal("r"),c.i32_const(o)),c.drop(c.call(n+"_sub",c.getLocal("r"),c.i32_const(o),c.getLocal("r"))))))}(),function(){const a=e.addFunction(r+"_squareOld");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder();a.addCode(c.call(r+"_mul",c.getLocal("x"),c.getLocal("x"),c.getLocal("r")))}(),function(){const a=e.addFunction(r+"_toMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder();a.addCode(c.call(r+"_mul",c.getLocal("x"),c.i32_const(s),c.getLocal("r")))}(),function(){const a=e.alloc(2*i),c=e.addFunction(r+"_fromMontgomery");c.addParam("x","i32"),c.addParam("r","i32");const f=c.getCodeBuilder();c.addCode(f.call(n+"_copy",f.getLocal("x"),f.i32_const(a))),c.addCode(f.call(n+"_zero",f.i32_const(a+i))),c.addCode(f.call(r+"_mReduct",f.i32_const(a),f.getLocal("r")))}(),function(){const a=e.addFunction(r+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const c=a.getCodeBuilder(),f=c.i32_const(e.alloc(i));a.addCode(c.call(r+"_fromMontgomery",c.getLocal("x"),f),c.call(n+"_gte",f,c.i32_const(m)))}(),function(){const a=e.addFunction(r+"_sign");a.addParam("x","i32"),a.setReturnType("i32");const c=a.getCodeBuilder(),f=c.i32_const(e.alloc(i));a.addCode(c.if(c.call(n+"_isZero",c.getLocal("x")),c.ret(c.i32_const(0))),c.call(r+"_fromMontgomery",c.getLocal("x"),f),c.if(c.call(n+"_gte",f,c.i32_const(m)),c.ret(c.i32_const(-1))),c.ret(c.i32_const(1)))}(),function(){const a=e.addFunction(r+"_inverse");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder();a.addCode(c.call(r+"_fromMontgomery",c.getLocal("x"),c.getLocal("r"))),a.addCode(c.call(n+"_inverseMod",c.getLocal("r"),c.i32_const(o),c.getLocal("r"))),a.addCode(c.call(r+"_toMontgomery",c.getLocal("r"),c.getLocal("r")))}(),function(){const a=e.addFunction(r+"_one");a.addParam("pr","i32");const c=a.getCodeBuilder();a.addCode(c.call(n+"_copy",c.i32_const(l),c.getLocal("pr")))}(),function(){const a=e.addFunction(r+"_load");a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32"),a.addLocal("p","i32"),a.addLocal("l","i32"),a.addLocal("i","i32"),a.addLocal("j","i32");const c=a.getCodeBuilder(),f=c.i32_const(e.alloc(i)),d=e.alloc(i),b=c.i32_const(d);a.addCode(c.call(n+"_zero",c.getLocal("r")),c.setLocal("i",c.i32_const(i)),c.setLocal("p",c.getLocal("scalar")),c.block(c.loop(c.br_if(1,c.i32_gt_u(c.getLocal("i"),c.getLocal("scalarLen"))),c.if(c.i32_eq(c.getLocal("i"),c.i32_const(i)),c.call(r+"_one",f),c.call(r+"_mul",f,c.i32_const(s),f)),c.call(r+"_mul",c.getLocal("p"),f,b),c.call(r+"_add",c.getLocal("r"),b,c.getLocal("r")),c.setLocal("p",c.i32_add(c.getLocal("p"),c.i32_const(i))),c.setLocal("i",c.i32_add(c.getLocal("i"),c.i32_const(i))),c.br(0))),c.setLocal("l",c.i32_rem_u(c.getLocal("scalarLen"),c.i32_const(i))),c.if(c.i32_eqz(c.getLocal("l")),c.ret([])),c.call(n+"_zero",b),c.setLocal("j",c.i32_const(0)),c.block(c.loop(c.br_if(1,c.i32_eq(c.getLocal("j"),c.getLocal("l"))),c.i32_store8(c.getLocal("j"),d,c.i32_load8_u(c.getLocal("p"))),c.setLocal("p",c.i32_add(c.getLocal("p"),c.i32_const(1))),c.setLocal("j",c.i32_add(c.getLocal("j"),c.i32_const(1))),c.br(0))),c.if(c.i32_eq(c.getLocal("i"),c.i32_const(i)),c.call(r+"_one",f),c.call(r+"_mul",f,c.i32_const(s),f)),c.call(r+"_mul",b,f,b),c.call(r+"_add",c.getLocal("r"),b,c.getLocal("r")))}(),function(){const a=e.addFunction(r+"_timesScalar");a.addParam("x","i32"),a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32");const c=a.getCodeBuilder(),f=c.i32_const(e.alloc(i));a.addCode(c.call(r+"_load",c.getLocal("scalar"),c.getLocal("scalarLen"),f),c.call(r+"_toMontgomery",f,f),c.call(r+"_mul",c.getLocal("x"),f,c.getLocal("r")))}(),ce(e,r),fe(e,r+"_batchToMontgomery",r+"_toMontgomery",i,i),fe(e,r+"_batchFromMontgomery",r+"_fromMontgomery",i,i),fe(e,r+"_batchNeg",r+"_neg",i,i),de(e,r+"_batchAdd",r+"_add",i,i),de(e,r+"_batchSub",r+"_sub",i,i),de(e,r+"_batchMul",r+"_mul",i,i),e.exportFunction(r+"_add"),e.exportFunction(r+"_sub"),e.exportFunction(r+"_neg"),e.exportFunction(r+"_isNegative"),e.exportFunction(r+"_isOne"),e.exportFunction(r+"_sign"),e.exportFunction(r+"_mReduct"),e.exportFunction(r+"_mul"),e.exportFunction(r+"_square"),e.exportFunction(r+"_squareOld"),e.exportFunction(r+"_fromMontgomery"),e.exportFunction(r+"_toMontgomery"),e.exportFunction(r+"_inverse"),e.exportFunction(r+"_one"),e.exportFunction(r+"_load"),e.exportFunction(r+"_timesScalar"),ae(e,r+"_exp",i,r+"_mul",r+"_square",n+"_copy",r+"_one"),e.exportFunction(r+"_exp"),e.exportFunction(r+"_batchInverse"),re(d)&&(function(){const a=e.addFunction(r+"_sqrt");a.addParam("n","i32"),a.addParam("r","i32"),a.addLocal("m","i32"),a.addLocal("i","i32"),a.addLocal("j","i32");const c=a.getCodeBuilder(),f=c.i32_const(l),d=c.i32_const(e.alloc(i)),b=c.i32_const(e.alloc(i)),t=c.i32_const(e.alloc(i)),n=c.i32_const(e.alloc(i)),o=c.i32_const(e.alloc(i));a.addCode(c.if(c.call(r+"_isZero",c.getLocal("n")),c.ret(c.call(r+"_zero",c.getLocal("r")))),c.setLocal("m",c.i32_const(_)),c.call(r+"_copy",c.i32_const(A),d),c.call(r+"_exp",c.getLocal("n"),c.i32_const(w),c.i32_const(i),b),c.call(r+"_exp",c.getLocal("n"),c.i32_const(I),c.i32_const(i),t),c.block(c.loop(c.br_if(1,c.call(r+"_eq",b,f)),c.call(r+"_square",b,n),c.setLocal("i",c.i32_const(1)),c.block(c.loop(c.br_if(1,c.call(r+"_eq",n,f)),c.call(r+"_square",n,n),c.setLocal("i",c.i32_add(c.getLocal("i"),c.i32_const(1))),c.br(0))),c.call(r+"_copy",d,o),c.setLocal("j",c.i32_sub(c.i32_sub(c.getLocal("m"),c.getLocal("i")),c.i32_const(1))),c.block(c.loop(c.br_if(1,c.i32_eqz(c.getLocal("j"))),c.call(r+"_square",o,o),c.setLocal("j",c.i32_sub(c.getLocal("j"),c.i32_const(1))),c.br(0))),c.setLocal("m",c.getLocal("i")),c.call(r+"_square",o,d),c.call(r+"_mul",b,d,b),c.call(r+"_mul",t,o,t),c.br(0))),c.if(c.call(r+"_isNegative",t),c.call(r+"_neg",t,c.getLocal("r")),c.call(r+"_copy",t,c.getLocal("r"))))}(),function(){const a=e.addFunction(r+"_isSquare");a.addParam("n","i32"),a.setReturnType("i32");const c=a.getCodeBuilder(),f=c.i32_const(l),d=c.i32_const(e.alloc(i));a.addCode(c.if(c.call(r+"_isZero",c.getLocal("n")),c.ret(c.i32_const(1))),c.call(r+"_exp",c.getLocal("n"),c.i32_const(p),c.i32_const(i),d),c.call(r+"_eq",d,f))}(),e.exportFunction(r+"_sqrt"),e.exportFunction(r+"_isSquare")),e.exportFunction(r+"_batchToMontgomery"),e.exportFunction(r+"_batchFromMontgomery"),r};const le=se,{bitLength:he}=q;var ue=function(e,a,c,f,d){const b=BigInt(a),t=Math.floor((he(b-1n)-1)/64)+1,i=8*t,r=c||"f1";if(e.modules[r])return r;e.modules[r]={n64:t};const n=d||"int",o=le(e,b,f,n),s=e.modules[o].pR2,l=e.modules[o].pq,h=e.modules[o].pePlusOne;return function(){const a=e.alloc(i),c=e.addFunction(r+"_mul");c.addParam("x","i32"),c.addParam("y","i32"),c.addParam("r","i32");const f=c.getCodeBuilder();c.addCode(f.call(o+"_mul",f.getLocal("x"),f.getLocal("y"),f.i32_const(a))),c.addCode(f.call(o+"_mul",f.i32_const(a),f.i32_const(s),f.getLocal("r")))}(),function(){const a=e.addFunction(r+"_square");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder();a.addCode(c.call(r+"_mul",c.getLocal("x"),c.getLocal("x"),c.getLocal("r")))}(),function(){const a=e.addFunction(r+"_inverse");a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder();a.addCode(c.call(n+"_inverseMod",c.getLocal("x"),c.i32_const(l),c.getLocal("r")))}(),function(){const a=e.addFunction(r+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const c=a.getCodeBuilder();a.addCode(c.call(n+"_gte",c.getLocal("x"),c.i32_const(h)))}(),e.exportFunction(o+"_add",r+"_add"),e.exportFunction(o+"_sub",r+"_sub"),e.exportFunction(o+"_neg",r+"_neg"),e.exportFunction(r+"_mul"),e.exportFunction(r+"_square"),e.exportFunction(r+"_inverse"),e.exportFunction(r+"_isNegative"),e.exportFunction(o+"_copy",r+"_copy"),e.exportFunction(o+"_zero",r+"_zero"),e.exportFunction(o+"_one",r+"_one"),e.exportFunction(o+"_isZero",r+"_isZero"),e.exportFunction(o+"_eq",r+"_eq"),r};const xe=U,pe=j,ge=T;var me=function(e,a,c,f){if(e.modules[c])return c;const d=8*e.modules[f].n64,b=e.modules[f].q;return e.modules[c]={n64:2*e.modules[f].n64},function(){const a=e.addFunction(c+"_isZero");a.addParam("x","i32"),a.setReturnType("i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d));a.addCode(b.i32_and(b.call(f+"_isZero",t),b.call(f+"_isZero",i)))}(),function(){const a=e.addFunction(c+"_isOne");a.addParam("x","i32"),a.setReturnType("i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d));a.addCode(b.ret(b.i32_and(b.call(f+"_isOne",t),b.call(f+"_isZero",i))))}(),function(){const a=e.addFunction(c+"_zero");a.addParam("x","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d));a.addCode(b.call(f+"_zero",t),b.call(f+"_zero",i))}(),function(){const a=e.addFunction(c+"_one");a.addParam("x","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d));a.addCode(b.call(f+"_one",t),b.call(f+"_zero",i))}(),function(){const a=e.addFunction(c+"_copy");a.addParam("x","i32"),a.addParam("r","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.getLocal("r"),n=b.i32_add(b.getLocal("r"),b.i32_const(d));a.addCode(b.call(f+"_copy",t,r),b.call(f+"_copy",i,n))}(),function(){const b=e.addFunction(c+"_mul");b.addParam("x","i32"),b.addParam("y","i32"),b.addParam("r","i32");const t=b.getCodeBuilder(),i=t.getLocal("x"),r=t.i32_add(t.getLocal("x"),t.i32_const(d)),n=t.getLocal("y"),o=t.i32_add(t.getLocal("y"),t.i32_const(d)),s=t.getLocal("r"),l=t.i32_add(t.getLocal("r"),t.i32_const(d)),h=t.i32_const(e.alloc(d)),u=t.i32_const(e.alloc(d)),x=t.i32_const(e.alloc(d)),p=t.i32_const(e.alloc(d));b.addCode(t.call(f+"_mul",i,n,h),t.call(f+"_mul",r,o,u),t.call(f+"_add",i,r,x),t.call(f+"_add",n,o,p),t.call(f+"_mul",x,p,x),t.call(a,u,s),t.call(f+"_add",h,s,s),t.call(f+"_add",h,u,l),t.call(f+"_sub",x,l,l))}(),function(){const a=e.addFunction(c+"_mul1");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.getLocal("y"),n=b.getLocal("r"),o=b.i32_add(b.getLocal("r"),b.i32_const(d));a.addCode(b.call(f+"_mul",t,r,n),b.call(f+"_mul",i,r,o))}(),function(){const b=e.addFunction(c+"_square");b.addParam("x","i32"),b.addParam("r","i32");const t=b.getCodeBuilder(),i=t.getLocal("x"),r=t.i32_add(t.getLocal("x"),t.i32_const(d)),n=t.getLocal("r"),o=t.i32_add(t.getLocal("r"),t.i32_const(d)),s=t.i32_const(e.alloc(d)),l=t.i32_const(e.alloc(d)),h=t.i32_const(e.alloc(d)),u=t.i32_const(e.alloc(d));b.addCode(t.call(f+"_mul",i,r,s),t.call(f+"_add",i,r,l),t.call(a,r,h),t.call(f+"_add",i,h,h),t.call(a,s,u),t.call(f+"_add",u,s,u),t.call(f+"_mul",l,h,n),t.call(f+"_sub",n,u,n),t.call(f+"_add",s,s,o))}(),function(){const a=e.addFunction(c+"_add");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.getLocal("y"),n=b.i32_add(b.getLocal("y"),b.i32_const(d)),o=b.getLocal("r"),s=b.i32_add(b.getLocal("r"),b.i32_const(d));a.addCode(b.call(f+"_add",t,r,o),b.call(f+"_add",i,n,s))}(),function(){const a=e.addFunction(c+"_sub");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.getLocal("y"),n=b.i32_add(b.getLocal("y"),b.i32_const(d)),o=b.getLocal("r"),s=b.i32_add(b.getLocal("r"),b.i32_const(d));a.addCode(b.call(f+"_sub",t,r,o),b.call(f+"_sub",i,n,s))}(),function(){const a=e.addFunction(c+"_neg");a.addParam("x","i32"),a.addParam("r","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.getLocal("r"),n=b.i32_add(b.getLocal("r"),b.i32_const(d));a.addCode(b.call(f+"_neg",t,r),b.call(f+"_neg",i,n))}(),function(){const a=e.addFunction(c+"_conjugate");a.addParam("x","i32"),a.addParam("r","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.getLocal("r"),n=b.i32_add(b.getLocal("r"),b.i32_const(d));a.addCode(b.call(f+"_copy",t,r),b.call(f+"_neg",i,n))}(),function(){const a=e.addFunction(c+"_toMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.getLocal("r"),n=b.i32_add(b.getLocal("r"),b.i32_const(d));a.addCode(b.call(f+"_toMontgomery",t,r),b.call(f+"_toMontgomery",i,n))}(),function(){const a=e.addFunction(c+"_fromMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.getLocal("r"),n=b.i32_add(b.getLocal("r"),b.i32_const(d));a.addCode(b.call(f+"_fromMontgomery",t,r),b.call(f+"_fromMontgomery",i,n))}(),function(){const a=e.addFunction(c+"_eq");a.addParam("x","i32"),a.addParam("y","i32"),a.setReturnType("i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.getLocal("y"),n=b.i32_add(b.getLocal("y"),b.i32_const(d));a.addCode(b.i32_and(b.call(f+"_eq",t,r),b.call(f+"_eq",i,n)))}(),function(){const b=e.addFunction(c+"_inverse");b.addParam("x","i32"),b.addParam("r","i32");const t=b.getCodeBuilder(),i=t.getLocal("x"),r=t.i32_add(t.getLocal("x"),t.i32_const(d)),n=t.getLocal("r"),o=t.i32_add(t.getLocal("r"),t.i32_const(d)),s=t.i32_const(e.alloc(d)),l=t.i32_const(e.alloc(d)),h=t.i32_const(e.alloc(d)),u=t.i32_const(e.alloc(d));b.addCode(t.call(f+"_square",i,s),t.call(f+"_square",r,l),t.call(a,l,h),t.call(f+"_sub",s,h,h),t.call(f+"_inverse",h,u),t.call(f+"_mul",i,u,n),t.call(f+"_mul",r,u,o),t.call(f+"_neg",o,o))}(),function(){const a=e.addFunction(c+"_timesScalar");a.addParam("x","i32"),a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.getLocal("r"),n=b.i32_add(b.getLocal("r"),b.i32_const(d));a.addCode(b.call(f+"_timesScalar",t,b.getLocal("scalar"),b.getLocal("scalarLen"),r),b.call(f+"_timesScalar",i,b.getLocal("scalar"),b.getLocal("scalarLen"),n))}(),function(){const a=e.addFunction(c+"_sign");a.addParam("x","i32"),a.addLocal("s","i32"),a.setReturnType("i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d));a.addCode(b.setLocal("s",b.call(f+"_sign",i)),b.if(b.getLocal("s"),b.ret(b.getLocal("s"))),b.ret(b.call(f+"_sign",t)))}(),function(){const a=e.addFunction(c+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d));a.addCode(b.if(b.call(f+"_isZero",i),b.ret(b.call(f+"_isNegative",t))),b.ret(b.call(f+"_isNegative",i)))}(),e.exportFunction(c+"_isZero"),e.exportFunction(c+"_isOne"),e.exportFunction(c+"_zero"),e.exportFunction(c+"_one"),e.exportFunction(c+"_copy"),e.exportFunction(c+"_mul"),e.exportFunction(c+"_mul1"),e.exportFunction(c+"_square"),e.exportFunction(c+"_add"),e.exportFunction(c+"_sub"),e.exportFunction(c+"_neg"),e.exportFunction(c+"_sign"),e.exportFunction(c+"_conjugate"),e.exportFunction(c+"_fromMontgomery"),e.exportFunction(c+"_toMontgomery"),e.exportFunction(c+"_eq"),e.exportFunction(c+"_inverse"),pe(e,c),xe(e,c+"_exp",2*d,c+"_mul",c+"_square",c+"_copy",c+"_one"),function(){const a=e.addFunction(c+"_sqrt");a.addParam("a","i32"),a.addParam("pr","i32");const t=a.getCodeBuilder(),i=t.i32_const(e.alloc(ge.bigInt2BytesLE((BigInt(b||0)-3n)/4n,d))),r=t.i32_const(e.alloc(ge.bigInt2BytesLE((BigInt(b||0)-1n)/2n,d))),n=t.getLocal("a"),o=t.i32_const(e.alloc(2*d)),s=t.i32_const(e.alloc(2*d)),l=t.i32_const(e.alloc(2*d)),h=e.alloc(2*d),u=t.i32_const(h),x=t.i32_const(h),p=t.i32_const(h+d),g=t.i32_const(e.alloc(2*d)),m=t.i32_const(e.alloc(2*d));a.addCode(t.call(c+"_one",u),t.call(c+"_neg",u,u),t.call(c+"_exp",n,i,t.i32_const(d),o),t.call(c+"_square",o,s),t.call(c+"_mul",n,s,s),t.call(c+"_conjugate",s,l),t.call(c+"_mul",l,s,l),t.if(t.call(c+"_eq",l,u),t.unreachable()),t.call(c+"_mul",o,n,g),t.if(t.call(c+"_eq",s,u),[...t.call(f+"_zero",x),...t.call(f+"_one",p),...t.call(c+"_mul",u,g,t.getLocal("pr"))],[...t.call(c+"_one",m),...t.call(c+"_add",m,s,m),...t.call(c+"_exp",m,r,t.i32_const(d),m),...t.call(c+"_mul",m,g,t.getLocal("pr"))]))}(),function(){const a=e.addFunction(c+"_isSquare");a.addParam("a","i32"),a.setReturnType("i32");const f=a.getCodeBuilder(),t=f.i32_const(e.alloc(ge.bigInt2BytesLE((BigInt(b||0)-3n)/4n,d))),i=f.getLocal("a"),r=f.i32_const(e.alloc(2*d)),n=f.i32_const(e.alloc(2*d)),o=f.i32_const(e.alloc(2*d)),s=e.alloc(2*d),l=f.i32_const(s);a.addCode(f.call(c+"_one",l),f.call(c+"_neg",l,l),f.call(c+"_exp",i,t,f.i32_const(d),r),f.call(c+"_square",r,n),f.call(c+"_mul",i,n,n),f.call(c+"_conjugate",n,o),f.call(c+"_mul",o,n,o),f.if(f.call(c+"_eq",o,l),f.ret(f.i32_const(0))),f.ret(f.i32_const(1)))}(),e.exportFunction(c+"_exp"),e.exportFunction(c+"_timesScalar"),e.exportFunction(c+"_batchInverse"),e.exportFunction(c+"_sqrt"),e.exportFunction(c+"_isSquare"),e.exportFunction(c+"_isNegative"),c};const ye=U,_e=j;var ve=function(e,a,c,f){if(e.modules[c])return c;const d=8*e.modules[f].n64;return e.modules[c]={n64:3*e.modules[f].n64},function(){const a=e.addFunction(c+"_isZero");a.addParam("x","i32"),a.setReturnType("i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.i32_add(b.getLocal("x"),b.i32_const(2*d));a.addCode(b.i32_and(b.i32_and(b.call(f+"_isZero",t),b.call(f+"_isZero",i)),b.call(f+"_isZero",r)))}(),function(){const a=e.addFunction(c+"_isOne");a.addParam("x","i32"),a.setReturnType("i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.i32_add(b.getLocal("x"),b.i32_const(2*d));a.addCode(b.ret(b.i32_and(b.i32_and(b.call(f+"_isOne",t),b.call(f+"_isZero",i)),b.call(f+"_isZero",r))))}(),function(){const a=e.addFunction(c+"_zero");a.addParam("x","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.i32_add(b.getLocal("x"),b.i32_const(2*d));a.addCode(b.call(f+"_zero",t),b.call(f+"_zero",i),b.call(f+"_zero",r))}(),function(){const a=e.addFunction(c+"_one");a.addParam("x","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.i32_add(b.getLocal("x"),b.i32_const(2*d));a.addCode(b.call(f+"_one",t),b.call(f+"_zero",i),b.call(f+"_zero",r))}(),function(){const a=e.addFunction(c+"_copy");a.addParam("x","i32"),a.addParam("r","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.i32_add(b.getLocal("x"),b.i32_const(2*d)),n=b.getLocal("r"),o=b.i32_add(b.getLocal("r"),b.i32_const(d)),s=b.i32_add(b.getLocal("r"),b.i32_const(2*d));a.addCode(b.call(f+"_copy",t,n),b.call(f+"_copy",i,o),b.call(f+"_copy",r,s))}(),function(){const b=e.addFunction(c+"_mul");b.addParam("x","i32"),b.addParam("y","i32"),b.addParam("r","i32");const t=b.getCodeBuilder(),i=t.getLocal("x"),r=t.i32_add(t.getLocal("x"),t.i32_const(d)),n=t.i32_add(t.getLocal("x"),t.i32_const(2*d)),o=t.getLocal("y"),s=t.i32_add(t.getLocal("y"),t.i32_const(d)),l=t.i32_add(t.getLocal("y"),t.i32_const(2*d)),h=t.getLocal("r"),u=t.i32_add(t.getLocal("r"),t.i32_const(d)),x=t.i32_add(t.getLocal("r"),t.i32_const(2*d)),p=t.i32_const(e.alloc(d)),g=t.i32_const(e.alloc(d)),m=t.i32_const(e.alloc(d)),y=t.i32_const(e.alloc(d)),_=t.i32_const(e.alloc(d)),v=t.i32_const(e.alloc(d)),w=t.i32_const(e.alloc(d)),M=t.i32_const(e.alloc(d)),A=t.i32_const(e.alloc(d)),L=t.i32_const(e.alloc(d)),I=t.i32_const(e.alloc(d)),k=t.i32_const(e.alloc(d)),E=t.i32_const(e.alloc(d));b.addCode(t.call(f+"_mul",i,o,p),t.call(f+"_mul",r,s,g),t.call(f+"_mul",n,l,m),t.call(f+"_add",i,r,y),t.call(f+"_add",o,s,_),t.call(f+"_add",i,n,v),t.call(f+"_add",o,l,w),t.call(f+"_add",r,n,M),t.call(f+"_add",s,l,A),t.call(f+"_add",p,g,L),t.call(f+"_add",p,m,I),t.call(f+"_add",g,m,k),t.call(f+"_mul",M,A,h),t.call(f+"_sub",h,k,h),t.call(a,h,h),t.call(f+"_add",p,h,h),t.call(f+"_mul",y,_,u),t.call(f+"_sub",u,L,u),t.call(a,m,E),t.call(f+"_add",u,E,u),t.call(f+"_mul",v,w,x),t.call(f+"_sub",x,I,x),t.call(f+"_add",x,g,x))}(),function(){const b=e.addFunction(c+"_square");b.addParam("x","i32"),b.addParam("r","i32");const t=b.getCodeBuilder(),i=t.getLocal("x"),r=t.i32_add(t.getLocal("x"),t.i32_const(d)),n=t.i32_add(t.getLocal("x"),t.i32_const(2*d)),o=t.getLocal("r"),s=t.i32_add(t.getLocal("r"),t.i32_const(d)),l=t.i32_add(t.getLocal("r"),t.i32_const(2*d)),h=t.i32_const(e.alloc(d)),u=t.i32_const(e.alloc(d)),x=t.i32_const(e.alloc(d)),p=t.i32_const(e.alloc(d)),g=t.i32_const(e.alloc(d)),m=t.i32_const(e.alloc(d)),y=t.i32_const(e.alloc(d));b.addCode(t.call(f+"_square",i,h),t.call(f+"_mul",i,r,u),t.call(f+"_add",u,u,x),t.call(f+"_sub",i,r,p),t.call(f+"_add",p,n,p),t.call(f+"_square",p,p),t.call(f+"_mul",r,n,g),t.call(f+"_add",g,g,m),t.call(f+"_square",n,y),t.call(a,m,o),t.call(f+"_add",h,o,o),t.call(a,y,s),t.call(f+"_add",x,s,s),t.call(f+"_add",h,y,l),t.call(f+"_sub",m,l,l),t.call(f+"_add",p,l,l),t.call(f+"_add",x,l,l))}(),function(){const a=e.addFunction(c+"_add");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.i32_add(b.getLocal("x"),b.i32_const(2*d)),n=b.getLocal("y"),o=b.i32_add(b.getLocal("y"),b.i32_const(d)),s=b.i32_add(b.getLocal("y"),b.i32_const(2*d)),l=b.getLocal("r"),h=b.i32_add(b.getLocal("r"),b.i32_const(d)),u=b.i32_add(b.getLocal("r"),b.i32_const(2*d));a.addCode(b.call(f+"_add",t,n,l),b.call(f+"_add",i,o,h),b.call(f+"_add",r,s,u))}(),function(){const a=e.addFunction(c+"_sub");a.addParam("x","i32"),a.addParam("y","i32"),a.addParam("r","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.i32_add(b.getLocal("x"),b.i32_const(2*d)),n=b.getLocal("y"),o=b.i32_add(b.getLocal("y"),b.i32_const(d)),s=b.i32_add(b.getLocal("y"),b.i32_const(2*d)),l=b.getLocal("r"),h=b.i32_add(b.getLocal("r"),b.i32_const(d)),u=b.i32_add(b.getLocal("r"),b.i32_const(2*d));a.addCode(b.call(f+"_sub",t,n,l),b.call(f+"_sub",i,o,h),b.call(f+"_sub",r,s,u))}(),function(){const a=e.addFunction(c+"_neg");a.addParam("x","i32"),a.addParam("r","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.i32_add(b.getLocal("x"),b.i32_const(2*d)),n=b.getLocal("r"),o=b.i32_add(b.getLocal("r"),b.i32_const(d)),s=b.i32_add(b.getLocal("r"),b.i32_const(2*d));a.addCode(b.call(f+"_neg",t,n),b.call(f+"_neg",i,o),b.call(f+"_neg",r,s))}(),function(){const a=e.addFunction(c+"_sign");a.addParam("x","i32"),a.addLocal("s","i32"),a.setReturnType("i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.i32_add(b.getLocal("x"),b.i32_const(2*d));a.addCode(b.setLocal("s",b.call(f+"_sign",r)),b.if(b.getLocal("s"),b.ret(b.getLocal("s"))),b.setLocal("s",b.call(f+"_sign",i)),b.if(b.getLocal("s"),b.ret(b.getLocal("s"))),b.ret(b.call(f+"_sign",t)))}(),function(){const a=e.addFunction(c+"_toMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.i32_add(b.getLocal("x"),b.i32_const(2*d)),n=b.getLocal("r"),o=b.i32_add(b.getLocal("r"),b.i32_const(d)),s=b.i32_add(b.getLocal("r"),b.i32_const(2*d));a.addCode(b.call(f+"_toMontgomery",t,n),b.call(f+"_toMontgomery",i,o),b.call(f+"_toMontgomery",r,s))}(),function(){const a=e.addFunction(c+"_fromMontgomery");a.addParam("x","i32"),a.addParam("r","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.i32_add(b.getLocal("x"),b.i32_const(2*d)),n=b.getLocal("r"),o=b.i32_add(b.getLocal("r"),b.i32_const(d)),s=b.i32_add(b.getLocal("r"),b.i32_const(2*d));a.addCode(b.call(f+"_fromMontgomery",t,n),b.call(f+"_fromMontgomery",i,o),b.call(f+"_fromMontgomery",r,s))}(),function(){const a=e.addFunction(c+"_eq");a.addParam("x","i32"),a.addParam("y","i32"),a.setReturnType("i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.i32_add(b.getLocal("x"),b.i32_const(2*d)),n=b.getLocal("y"),o=b.i32_add(b.getLocal("y"),b.i32_const(d)),s=b.i32_add(b.getLocal("y"),b.i32_const(2*d));a.addCode(b.i32_and(b.i32_and(b.call(f+"_eq",t,n),b.call(f+"_eq",i,o)),b.call(f+"_eq",r,s)))}(),function(){const b=e.addFunction(c+"_inverse");b.addParam("x","i32"),b.addParam("r","i32");const t=b.getCodeBuilder(),i=t.getLocal("x"),r=t.i32_add(t.getLocal("x"),t.i32_const(d)),n=t.i32_add(t.getLocal("x"),t.i32_const(2*d)),o=t.getLocal("r"),s=t.i32_add(t.getLocal("r"),t.i32_const(d)),l=t.i32_add(t.getLocal("r"),t.i32_const(2*d)),h=t.i32_const(e.alloc(d)),u=t.i32_const(e.alloc(d)),x=t.i32_const(e.alloc(d)),p=t.i32_const(e.alloc(d)),g=t.i32_const(e.alloc(d)),m=t.i32_const(e.alloc(d)),y=t.i32_const(e.alloc(d)),_=t.i32_const(e.alloc(d)),v=t.i32_const(e.alloc(d)),w=t.i32_const(e.alloc(d)),M=t.i32_const(e.alloc(d));b.addCode(t.call(f+"_square",i,h),t.call(f+"_square",r,u),t.call(f+"_square",n,x),t.call(f+"_mul",i,r,p),t.call(f+"_mul",i,n,g),t.call(f+"_mul",r,n,m),t.call(a,m,y),t.call(f+"_sub",h,y,y),t.call(a,x,_),t.call(f+"_sub",_,p,_),t.call(f+"_sub",u,g,v),t.call(f+"_mul",n,_,w),t.call(f+"_mul",r,v,M),t.call(f+"_add",w,M,w),t.call(a,w,w),t.call(f+"_mul",i,y,M),t.call(f+"_add",M,w,w),t.call(f+"_inverse",w,w),t.call(f+"_mul",w,y,o),t.call(f+"_mul",w,_,s),t.call(f+"_mul",w,v,l))}(),function(){const a=e.addFunction(c+"_timesScalar");a.addParam("x","i32"),a.addParam("scalar","i32"),a.addParam("scalarLen","i32"),a.addParam("r","i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.i32_add(b.getLocal("x"),b.i32_const(2*d)),n=b.getLocal("r"),o=b.i32_add(b.getLocal("r"),b.i32_const(d)),s=b.i32_add(b.getLocal("r"),b.i32_const(2*d));a.addCode(b.call(f+"_timesScalar",t,b.getLocal("scalar"),b.getLocal("scalarLen"),n),b.call(f+"_timesScalar",i,b.getLocal("scalar"),b.getLocal("scalarLen"),o),b.call(f+"_timesScalar",r,b.getLocal("scalar"),b.getLocal("scalarLen"),s))}(),function(){const a=e.addFunction(c+"_isNegative");a.addParam("x","i32"),a.setReturnType("i32");const b=a.getCodeBuilder(),t=b.getLocal("x"),i=b.i32_add(b.getLocal("x"),b.i32_const(d)),r=b.i32_add(b.getLocal("x"),b.i32_const(2*d));a.addCode(b.if(b.call(f+"_isZero",r),b.if(b.call(f+"_isZero",i),b.ret(b.call(f+"_isNegative",t)),b.ret(b.call(f+"_isNegative",i)))),b.ret(b.call(f+"_isNegative",r)))}(),e.exportFunction(c+"_isZero"),e.exportFunction(c+"_isOne"),e.exportFunction(c+"_zero"),e.exportFunction(c+"_one"),e.exportFunction(c+"_copy"),e.exportFunction(c+"_mul"),e.exportFunction(c+"_square"),e.exportFunction(c+"_add"),e.exportFunction(c+"_sub"),e.exportFunction(c+"_neg"),e.exportFunction(c+"_sign"),e.exportFunction(c+"_fromMontgomery"),e.exportFunction(c+"_toMontgomery"),e.exportFunction(c+"_eq"),e.exportFunction(c+"_inverse"),_e(e,c),ye(e,c+"_exp",3*d,c+"_mul",c+"_square",c+"_copy",c+"_one"),e.exportFunction(c+"_exp"),e.exportFunction(c+"_timesScalar"),e.exportFunction(c+"_batchInverse"),e.exportFunction(c+"_isNegative"),c};const we=function(e,a,c,f,d,b,t,i){const r=e.addFunction(a);r.addParam("base","i32"),r.addParam("scalar","i32"),r.addParam("scalarLength","i32"),r.addParam("r","i32"),r.addLocal("old0","i32"),r.addLocal("nbits","i32"),r.addLocal("i","i32"),r.addLocal("last","i32"),r.addLocal("cur","i32"),r.addLocal("carry","i32"),r.addLocal("p","i32");const n=r.getCodeBuilder(),o=n.i32_const(e.alloc(c));function s(e){return n.i32_and(n.i32_shr_u(n.i32_load(n.i32_add(n.getLocal("scalar"),n.i32_and(n.i32_shr_u(e,n.i32_const(3)),n.i32_const(4294967292)))),n.i32_and(e,n.i32_const(31))),n.i32_const(1))}function l(e){return[...n.i32_store8(n.getLocal("p"),n.i32_const(e)),...n.setLocal("p",n.i32_add(n.getLocal("p"),n.i32_const(1)))]}r.addCode(n.if(n.i32_eqz(n.getLocal("scalarLength")),[...n.call(i,n.getLocal("r")),...n.ret([])]),n.setLocal("nbits",n.i32_shl(n.getLocal("scalarLength"),n.i32_const(3))),n.setLocal("old0",n.i32_load(n.i32_const(0))),n.setLocal("p",n.getLocal("old0")),n.i32_store(n.i32_const(0),n.i32_and(n.i32_add(n.i32_add(n.getLocal("old0"),n.i32_const(32)),n.getLocal("nbits")),n.i32_const(4294967288))),n.setLocal("i",n.i32_const(1)),n.setLocal("last",s(n.i32_const(0))),n.setLocal("carry",n.i32_const(0)),n.block(n.loop(n.br_if(1,n.i32_eq(n.getLocal("i"),n.getLocal("nbits"))),n.setLocal("cur",s(n.getLocal("i"))),n.if(n.getLocal("last"),n.if(n.getLocal("cur"),n.if(n.getLocal("carry"),[...n.setLocal("last",n.i32_const(0)),...n.setLocal("carry",n.i32_const(1)),...l(1)],[...n.setLocal("last",n.i32_const(0)),...n.setLocal("carry",n.i32_const(1)),...l(255)]),n.if(n.getLocal("carry"),[...n.setLocal("last",n.i32_const(0)),...n.setLocal("carry",n.i32_const(1)),...l(255)],[...n.setLocal("last",n.i32_const(0)),...n.setLocal("carry",n.i32_const(0)),...l(1)])),n.if(n.getLocal("cur"),n.if(n.getLocal("carry"),[...n.setLocal("last",n.i32_const(0)),...n.setLocal("carry",n.i32_const(1)),...l(0)],[...n.setLocal("last",n.i32_const(1)),...n.setLocal("carry",n.i32_const(0)),...l(0)]),n.if(n.getLocal("carry"),[...n.setLocal("last",n.i32_const(1)),...n.setLocal("carry",n.i32_const(0)),...l(0)],[...n.setLocal("last",n.i32_const(0)),...n.setLocal("carry",n.i32_const(0)),...l(0)]))),n.setLocal("i",n.i32_add(n.getLocal("i"),n.i32_const(1))),n.br(0))),n.if(n.getLocal("last"),n.if(n.getLocal("carry"),[...l(255),...l(0),...l(1)],[...l(1)]),n.if(n.getLocal("carry"),[...l(0),...l(1)])),n.setLocal("p",n.i32_sub(n.getLocal("p"),n.i32_const(1))),n.call(t,n.getLocal("base"),o),n.call(i,n.getLocal("r")),n.block(n.loop(n.call(d,n.getLocal("r"),n.getLocal("r")),n.setLocal("cur",n.i32_load8_u(n.getLocal("p"))),n.if(n.getLocal("cur"),n.if(n.i32_eq(n.getLocal("cur"),n.i32_const(1)),n.call(f,n.getLocal("r"),o,n.getLocal("r")),n.call(b,n.getLocal("r"),o,n.getLocal("r")))),n.br_if(1,n.i32_eq(n.getLocal("old0"),n.getLocal("p"))),n.setLocal("p",n.i32_sub(n.getLocal("p"),n.i32_const(1))),n.br(0))),n.i32_store(n.i32_const(0),n.getLocal("old0")))},Me=N,Ae=function(e,a,c,f,d){const b=8*e.modules[a].n64;!function(){const a=e.addFunction(c+"_getChunk");a.addParam("pScalar","i32"),a.addParam("scalarSize","i32"),a.addParam("startBit","i32"),a.addParam("chunkSize","i32"),a.addLocal("bitsToEnd","i32"),a.addLocal("mask","i32"),a.setReturnType("i32");const f=a.getCodeBuilder();a.addCode(f.setLocal("bitsToEnd",f.i32_sub(f.i32_mul(f.getLocal("scalarSize"),f.i32_const(8)),f.getLocal("startBit"))),f.if(f.i32_gt_s(f.getLocal("chunkSize"),f.getLocal("bitsToEnd")),f.setLocal("mask",f.i32_sub(f.i32_shl(f.i32_const(1),f.getLocal("bitsToEnd")),f.i32_const(1))),f.setLocal("mask",f.i32_sub(f.i32_shl(f.i32_const(1),f.getLocal("chunkSize")),f.i32_const(1)))),f.i32_and(f.i32_shr_u(f.i32_load(f.i32_add(f.getLocal("pScalar"),f.i32_shr_u(f.getLocal("startBit"),f.i32_const(3))),0,0),f.i32_and(f.getLocal("startBit"),f.i32_const(7))),f.getLocal("mask")))}(),function(){const f=e.addFunction(c+"_reduceTable");f.addParam("pTable","i32"),f.addParam("p","i32"),f.addLocal("half","i32"),f.addLocal("it1","i32"),f.addLocal("it2","i32"),f.addLocal("pAcc","i32");const d=f.getCodeBuilder();f.addCode(d.if(d.i32_eq(d.getLocal("p"),d.i32_const(1)),d.ret([])),d.setLocal("half",d.i32_shl(d.i32_const(1),d.i32_sub(d.getLocal("p"),d.i32_const(1)))),d.setLocal("it1",d.getLocal("pTable")),d.setLocal("it2",d.i32_add(d.getLocal("pTable"),d.i32_mul(d.getLocal("half"),d.i32_const(b)))),d.setLocal("pAcc",d.i32_sub(d.getLocal("it2"),d.i32_const(b))),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("it1"),d.getLocal("pAcc"))),d.call(a+"_add",d.getLocal("it1"),d.getLocal("it2"),d.getLocal("it1")),d.call(a+"_add",d.getLocal("pAcc"),d.getLocal("it2"),d.getLocal("pAcc")),d.setLocal("it1",d.i32_add(d.getLocal("it1"),d.i32_const(b))),d.setLocal("it2",d.i32_add(d.getLocal("it2"),d.i32_const(b))),d.br(0))),d.call(c+"_reduceTable",d.getLocal("pTable"),d.i32_sub(d.getLocal("p"),d.i32_const(1))),d.setLocal("p",d.i32_sub(d.getLocal("p"),d.i32_const(1))),d.block(d.loop(d.br_if(1,d.i32_eqz(d.getLocal("p"))),d.call(a+"_double",d.getLocal("pAcc"),d.getLocal("pAcc")),d.setLocal("p",d.i32_sub(d.getLocal("p"),d.i32_const(1))),d.br(0))),d.call(a+"_add",d.getLocal("pTable"),d.getLocal("pAcc"),d.getLocal("pTable")))}(),function(){const t=e.addFunction(c+"_chunk");t.addParam("pBases","i32"),t.addParam("pScalars","i32"),t.addParam("scalarSize","i32"),t.addParam("n","i32"),t.addParam("startBit","i32"),t.addParam("chunkSize","i32"),t.addParam("pr","i32"),t.addLocal("nChunks","i32"),t.addLocal("itScalar","i32"),t.addLocal("endScalar","i32"),t.addLocal("itBase","i32"),t.addLocal("i","i32"),t.addLocal("j","i32"),t.addLocal("nTable","i32"),t.addLocal("pTable","i32"),t.addLocal("idx","i32"),t.addLocal("pIdxTable","i32");const i=t.getCodeBuilder();t.addCode(i.if(i.i32_eqz(i.getLocal("n")),[...i.call(a+"_zero",i.getLocal("pr")),...i.ret([])]),i.setLocal("nTable",i.i32_shl(i.i32_const(1),i.getLocal("chunkSize"))),i.setLocal("pTable",i.i32_load(i.i32_const(0))),i.i32_store(i.i32_const(0),i.i32_add(i.getLocal("pTable"),i.i32_mul(i.getLocal("nTable"),i.i32_const(b)))),i.setLocal("j",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("j"),i.getLocal("nTable"))),i.call(a+"_zero",i.i32_add(i.getLocal("pTable"),i.i32_mul(i.getLocal("j"),i.i32_const(b)))),i.setLocal("j",i.i32_add(i.getLocal("j"),i.i32_const(1))),i.br(0))),i.setLocal("itBase",i.getLocal("pBases")),i.setLocal("itScalar",i.getLocal("pScalars")),i.setLocal("endScalar",i.i32_add(i.getLocal("pScalars"),i.i32_mul(i.getLocal("n"),i.getLocal("scalarSize")))),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("itScalar"),i.getLocal("endScalar"))),i.setLocal("idx",i.call(c+"_getChunk",i.getLocal("itScalar"),i.getLocal("scalarSize"),i.getLocal("startBit"),i.getLocal("chunkSize"))),i.if(i.getLocal("idx"),[...i.setLocal("pIdxTable",i.i32_add(i.getLocal("pTable"),i.i32_mul(i.i32_sub(i.getLocal("idx"),i.i32_const(1)),i.i32_const(b)))),...i.call(f,i.getLocal("pIdxTable"),i.getLocal("itBase"),i.getLocal("pIdxTable"))]),i.setLocal("itScalar",i.i32_add(i.getLocal("itScalar"),i.getLocal("scalarSize"))),i.setLocal("itBase",i.i32_add(i.getLocal("itBase"),i.i32_const(d))),i.br(0))),i.call(c+"_reduceTable",i.getLocal("pTable"),i.getLocal("chunkSize")),i.call(a+"_copy",i.getLocal("pTable"),i.getLocal("pr")),i.i32_store(i.i32_const(0),i.getLocal("pTable")))}(),function(){const f=e.addFunction(c);f.addParam("pBases","i32"),f.addParam("pScalars","i32"),f.addParam("scalarSize","i32"),f.addParam("n","i32"),f.addParam("pr","i32"),f.addLocal("chunkSize","i32"),f.addLocal("nChunks","i32"),f.addLocal("itScalar","i32"),f.addLocal("endScalar","i32"),f.addLocal("itBase","i32"),f.addLocal("itBit","i32"),f.addLocal("i","i32"),f.addLocal("j","i32"),f.addLocal("nTable","i32"),f.addLocal("pTable","i32"),f.addLocal("idx","i32"),f.addLocal("pIdxTable","i32");const d=f.getCodeBuilder(),t=d.i32_const(e.alloc(b)),i=e.alloc([17,17,17,17,17,17,17,17,17,17,16,16,15,14,13,13,12,11,10,9,8,7,7,6,5,4,3,2,1,1,1,1]);f.addCode(d.call(a+"_zero",d.getLocal("pr")),d.if(d.i32_eqz(d.getLocal("n")),d.ret([])),d.setLocal("chunkSize",d.i32_load8_u(d.i32_clz(d.getLocal("n")),i)),d.setLocal("nChunks",d.i32_add(d.i32_div_u(d.i32_sub(d.i32_shl(d.getLocal("scalarSize"),d.i32_const(3)),d.i32_const(1)),d.getLocal("chunkSize")),d.i32_const(1))),d.setLocal("itBit",d.i32_mul(d.i32_sub(d.getLocal("nChunks"),d.i32_const(1)),d.getLocal("chunkSize"))),d.block(d.loop(d.br_if(1,d.i32_lt_s(d.getLocal("itBit"),d.i32_const(0))),d.if(d.i32_eqz(d.call(a+"_isZero",d.getLocal("pr"))),[...d.setLocal("j",d.i32_const(0)),...d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("j"),d.getLocal("chunkSize"))),d.call(a+"_double",d.getLocal("pr"),d.getLocal("pr")),d.setLocal("j",d.i32_add(d.getLocal("j"),d.i32_const(1))),d.br(0)))]),d.call(c+"_chunk",d.getLocal("pBases"),d.getLocal("pScalars"),d.getLocal("scalarSize"),d.getLocal("n"),d.getLocal("itBit"),d.getLocal("chunkSize"),t),d.call(a+"_add",d.getLocal("pr"),t,d.getLocal("pr")),d.setLocal("itBit",d.i32_sub(d.getLocal("itBit"),d.getLocal("chunkSize"))),d.br(0))))}(),e.exportFunction(c),e.exportFunction(c+"_chunk")};var Le=function(e,a,c,f){const d=e.modules[c].n64,b=8*d;return e.modules[a]||(e.modules[a]={n64:3*d},function(){const f=e.addFunction(a+"_isZeroAffine");f.addParam("p1","i32"),f.setReturnType("i32");const d=f.getCodeBuilder();f.addCode(d.i32_and(d.call(c+"_isZero",d.getLocal("p1")),d.call(c+"_isZero",d.i32_add(d.getLocal("p1"),d.i32_const(b)))))}(),function(){const f=e.addFunction(a+"_isZero");f.addParam("p1","i32"),f.setReturnType("i32");const d=f.getCodeBuilder();f.addCode(d.call(c+"_isZero",d.i32_add(d.getLocal("p1"),d.i32_const(2*b))))}(),function(){const f=e.addFunction(a+"_zeroAffine");f.addParam("pr","i32");const d=f.getCodeBuilder();f.addCode(d.call(c+"_zero",d.getLocal("pr"))),f.addCode(d.call(c+"_zero",d.i32_add(d.getLocal("pr"),d.i32_const(b))))}(),function(){const f=e.addFunction(a+"_zero");f.addParam("pr","i32");const d=f.getCodeBuilder();f.addCode(d.call(c+"_zero",d.getLocal("pr"))),f.addCode(d.call(c+"_one",d.i32_add(d.getLocal("pr"),d.i32_const(b)))),f.addCode(d.call(c+"_zero",d.i32_add(d.getLocal("pr"),d.i32_const(2*b))))}(),function(){const c=e.addFunction(a+"_copyAffine");c.addParam("ps","i32"),c.addParam("pd","i32");const f=c.getCodeBuilder();for(let e=0;e<2*d;e++)c.addCode(f.i64_store(f.getLocal("pd"),8*e,f.i64_load(f.getLocal("ps"),8*e)))}(),function(){const c=e.addFunction(a+"_copy");c.addParam("ps","i32"),c.addParam("pd","i32");const f=c.getCodeBuilder();for(let e=0;e<3*d;e++)c.addCode(f.i64_store(f.getLocal("pd"),8*e,f.i64_load(f.getLocal("ps"),8*e)))}(),function(){const f=e.addFunction(a+"_toJacobian");f.addParam("p1","i32"),f.addParam("pr","i32");const d=f.getCodeBuilder(),t=d.getLocal("p1"),i=d.i32_add(d.getLocal("p1"),d.i32_const(b)),r=d.getLocal("pr"),n=d.i32_add(d.getLocal("pr"),d.i32_const(b)),o=d.i32_add(d.getLocal("pr"),d.i32_const(2*b));f.addCode(d.if(d.call(a+"_isZeroAffine",d.getLocal("p1")),d.call(a+"_zero",d.getLocal("pr")),[...d.call(c+"_one",o),...d.call(c+"_copy",i,n),...d.call(c+"_copy",t,r)]))}(),function(){const f=e.addFunction(a+"_eqAffine");f.addParam("p1","i32"),f.addParam("p2","i32"),f.setReturnType("i32"),f.addLocal("z1","i32");const d=f.getCodeBuilder();f.addCode(d.ret(d.i32_and(d.call(c+"_eq",d.getLocal("p1"),d.getLocal("p2")),d.call(c+"_eq",d.i32_add(d.getLocal("p1"),d.i32_const(b)),d.i32_add(d.getLocal("p2"),d.i32_const(b))))))}(),function(){const f=e.addFunction(a+"_eqMixed");f.addParam("p1","i32"),f.addParam("p2","i32"),f.setReturnType("i32"),f.addLocal("z1","i32");const d=f.getCodeBuilder(),t=d.getLocal("p1"),i=d.i32_add(d.getLocal("p1"),d.i32_const(b));f.addCode(d.setLocal("z1",d.i32_add(d.getLocal("p1"),d.i32_const(2*b))));const r=d.getLocal("z1"),n=d.getLocal("p2"),o=d.i32_add(d.getLocal("p2"),d.i32_const(b)),s=d.i32_const(e.alloc(b)),l=d.i32_const(e.alloc(b)),h=d.i32_const(e.alloc(b)),u=d.i32_const(e.alloc(b));f.addCode(d.if(d.call(a+"_isZero",d.getLocal("p1")),d.ret(d.call(a+"_isZeroAffine",d.getLocal("p2")))),d.if(d.call(a+"_isZeroAffine",d.getLocal("p2")),d.ret(d.i32_const(0))),d.if(d.call(c+"_isOne",r),d.ret(d.call(a+"_eqAffine",d.getLocal("p1"),d.getLocal("p2")))),d.call(c+"_square",r,s),d.call(c+"_mul",n,s,l),d.call(c+"_mul",r,s,h),d.call(c+"_mul",o,h,u),d.if(d.call(c+"_eq",t,l),d.if(d.call(c+"_eq",i,u),d.ret(d.i32_const(1)))),d.ret(d.i32_const(0)))}(),function(){const f=e.addFunction(a+"_eq");f.addParam("p1","i32"),f.addParam("p2","i32"),f.setReturnType("i32"),f.addLocal("z1","i32"),f.addLocal("z2","i32");const d=f.getCodeBuilder(),t=d.getLocal("p1"),i=d.i32_add(d.getLocal("p1"),d.i32_const(b));f.addCode(d.setLocal("z1",d.i32_add(d.getLocal("p1"),d.i32_const(2*b))));const r=d.getLocal("z1"),n=d.getLocal("p2"),o=d.i32_add(d.getLocal("p2"),d.i32_const(b));f.addCode(d.setLocal("z2",d.i32_add(d.getLocal("p2"),d.i32_const(2*b))));const s=d.getLocal("z2"),l=d.i32_const(e.alloc(b)),h=d.i32_const(e.alloc(b)),u=d.i32_const(e.alloc(b)),x=d.i32_const(e.alloc(b)),p=d.i32_const(e.alloc(b)),g=d.i32_const(e.alloc(b)),m=d.i32_const(e.alloc(b)),y=d.i32_const(e.alloc(b));f.addCode(d.if(d.call(a+"_isZero",d.getLocal("p1")),d.ret(d.call(a+"_isZero",d.getLocal("p2")))),d.if(d.call(a+"_isZero",d.getLocal("p2")),d.ret(d.i32_const(0))),d.if(d.call(c+"_isOne",r),d.ret(d.call(a+"_eqMixed",d.getLocal("p2"),d.getLocal("p1")))),d.if(d.call(c+"_isOne",s),d.ret(d.call(a+"_eqMixed",d.getLocal("p1"),d.getLocal("p2")))),d.call(c+"_square",r,l),d.call(c+"_square",s,h),d.call(c+"_mul",t,h,u),d.call(c+"_mul",n,l,x),d.call(c+"_mul",r,l,p),d.call(c+"_mul",s,h,g),d.call(c+"_mul",i,g,m),d.call(c+"_mul",o,p,y),d.if(d.call(c+"_eq",u,x),d.if(d.call(c+"_eq",m,y),d.ret(d.i32_const(1)))),d.ret(d.i32_const(0)))}(),function(){const f=e.addFunction(a+"_doubleAffine");f.addParam("p1","i32"),f.addParam("pr","i32");const d=f.getCodeBuilder(),t=d.getLocal("p1"),i=d.i32_add(d.getLocal("p1"),d.i32_const(b)),r=d.getLocal("pr"),n=d.i32_add(d.getLocal("pr"),d.i32_const(b)),o=d.i32_add(d.getLocal("pr"),d.i32_const(2*b)),s=d.i32_const(e.alloc(b)),l=d.i32_const(e.alloc(b)),h=d.i32_const(e.alloc(b)),u=d.i32_const(e.alloc(b)),x=d.i32_const(e.alloc(b)),p=d.i32_const(e.alloc(b));f.addCode(d.if(d.call(a+"_isZeroAffine",d.getLocal("p1")),[...d.call(a+"_toJacobian",d.getLocal("p1"),d.getLocal("pr")),...d.ret([])]),d.call(c+"_square",t,s),d.call(c+"_square",i,l),d.call(c+"_square",l,h),d.call(c+"_add",t,l,u),d.call(c+"_square",u,u),d.call(c+"_sub",u,s,u),d.call(c+"_sub",u,h,u),d.call(c+"_add",u,u,u),d.call(c+"_add",s,s,x),d.call(c+"_add",x,s,x),d.call(c+"_add",i,i,o),d.call(c+"_square",x,r),d.call(c+"_sub",r,u,r),d.call(c+"_sub",r,u,r),d.call(c+"_add",h,h,p),d.call(c+"_add",p,p,p),d.call(c+"_add",p,p,p),d.call(c+"_sub",u,r,n),d.call(c+"_mul",n,x,n),d.call(c+"_sub",n,p,n))}(),function(){const f=e.addFunction(a+"_double");f.addParam("p1","i32"),f.addParam("pr","i32");const d=f.getCodeBuilder(),t=d.getLocal("p1"),i=d.i32_add(d.getLocal("p1"),d.i32_const(b)),r=d.i32_add(d.getLocal("p1"),d.i32_const(2*b)),n=d.getLocal("pr"),o=d.i32_add(d.getLocal("pr"),d.i32_const(b)),s=d.i32_add(d.getLocal("pr"),d.i32_const(2*b)),l=d.i32_const(e.alloc(b)),h=d.i32_const(e.alloc(b)),u=d.i32_const(e.alloc(b)),x=d.i32_const(e.alloc(b)),p=d.i32_const(e.alloc(b)),g=d.i32_const(e.alloc(b)),m=d.i32_const(e.alloc(b)),y=d.i32_const(e.alloc(b));f.addCode(d.if(d.call(a+"_isZero",d.getLocal("p1")),[...d.call(a+"_copy",d.getLocal("p1"),d.getLocal("pr")),...d.ret([])]),d.if(d.call(c+"_isOne",r),[...d.ret(d.call(a+"_doubleAffine",d.getLocal("p1"),d.getLocal("pr"))),...d.ret([])]),d.call(c+"_square",t,l),d.call(c+"_square",i,h),d.call(c+"_square",h,u),d.call(c+"_add",t,h,x),d.call(c+"_square",x,x),d.call(c+"_sub",x,l,x),d.call(c+"_sub",x,u,x),d.call(c+"_add",x,x,x),d.call(c+"_add",l,l,p),d.call(c+"_add",p,l,p),d.call(c+"_square",p,g),d.call(c+"_mul",i,r,m),d.call(c+"_add",x,x,n),d.call(c+"_sub",g,n,n),d.call(c+"_add",u,u,y),d.call(c+"_add",y,y,y),d.call(c+"_add",y,y,y),d.call(c+"_sub",x,n,o),d.call(c+"_mul",o,p,o),d.call(c+"_sub",o,y,o),d.call(c+"_add",m,m,s))}(),function(){const f=e.addFunction(a+"_addAffine");f.addParam("p1","i32"),f.addParam("p2","i32"),f.addParam("pr","i32"),f.addLocal("z1","i32");const d=f.getCodeBuilder(),t=d.getLocal("p1"),i=d.i32_add(d.getLocal("p1"),d.i32_const(b));f.addCode(d.setLocal("z1",d.i32_add(d.getLocal("p1"),d.i32_const(2*b))));const r=d.getLocal("p2"),n=d.i32_add(d.getLocal("p2"),d.i32_const(b)),o=d.getLocal("pr"),s=d.i32_add(d.getLocal("pr"),d.i32_const(b)),l=d.i32_add(d.getLocal("pr"),d.i32_const(2*b)),h=d.i32_const(e.alloc(b)),u=d.i32_const(e.alloc(b)),x=d.i32_const(e.alloc(b)),p=d.i32_const(e.alloc(b)),g=d.i32_const(e.alloc(b)),m=d.i32_const(e.alloc(b)),y=d.i32_const(e.alloc(b)),_=d.i32_const(e.alloc(b)),v=d.i32_const(e.alloc(b)),w=d.i32_const(e.alloc(b));f.addCode(d.if(d.call(a+"_isZeroAffine",d.getLocal("p1")),[...d.call(a+"_copyAffine",d.getLocal("p2"),d.getLocal("pr")),...d.call(c+"_one",d.i32_add(d.getLocal("pr"),d.i32_const(2*b))),...d.ret([])]),d.if(d.call(a+"_isZeroAffine",d.getLocal("p2")),[...d.call(a+"_copyAffine",d.getLocal("p1"),d.getLocal("pr")),...d.call(c+"_one",d.i32_add(d.getLocal("pr"),d.i32_const(2*b))),...d.ret([])]),d.if(d.call(c+"_eq",t,r),d.if(d.call(c+"_eq",i,n),[...d.call(a+"_doubleAffine",d.getLocal("p2"),d.getLocal("pr")),...d.ret([])])),d.call(c+"_sub",r,t,h),d.call(c+"_sub",n,i,x),d.call(c+"_square",h,u),d.call(c+"_add",u,u,p),d.call(c+"_add",p,p,p),d.call(c+"_mul",h,p,g),d.call(c+"_add",x,x,m),d.call(c+"_mul",t,p,_),d.call(c+"_square",m,y),d.call(c+"_add",_,_,v),d.call(c+"_sub",y,g,o),d.call(c+"_sub",o,v,o),d.call(c+"_mul",i,g,w),d.call(c+"_add",w,w,w),d.call(c+"_sub",_,o,s),d.call(c+"_mul",s,m,s),d.call(c+"_sub",s,w,s),d.call(c+"_add",h,h,l))}(),function(){const f=e.addFunction(a+"_addMixed");f.addParam("p1","i32"),f.addParam("p2","i32"),f.addParam("pr","i32"),f.addLocal("z1","i32");const d=f.getCodeBuilder(),t=d.getLocal("p1"),i=d.i32_add(d.getLocal("p1"),d.i32_const(b));f.addCode(d.setLocal("z1",d.i32_add(d.getLocal("p1"),d.i32_const(2*b))));const r=d.getLocal("z1"),n=d.getLocal("p2"),o=d.i32_add(d.getLocal("p2"),d.i32_const(b)),s=d.getLocal("pr"),l=d.i32_add(d.getLocal("pr"),d.i32_const(b)),h=d.i32_add(d.getLocal("pr"),d.i32_const(2*b)),u=d.i32_const(e.alloc(b)),x=d.i32_const(e.alloc(b)),p=d.i32_const(e.alloc(b)),g=d.i32_const(e.alloc(b)),m=d.i32_const(e.alloc(b)),y=d.i32_const(e.alloc(b)),_=d.i32_const(e.alloc(b)),v=d.i32_const(e.alloc(b)),w=d.i32_const(e.alloc(b)),M=d.i32_const(e.alloc(b)),A=d.i32_const(e.alloc(b)),L=d.i32_const(e.alloc(b)),I=d.i32_const(e.alloc(b)),k=d.i32_const(e.alloc(b));f.addCode(d.if(d.call(a+"_isZero",d.getLocal("p1")),[...d.call(a+"_copyAffine",d.getLocal("p2"),d.getLocal("pr")),...d.call(c+"_one",d.i32_add(d.getLocal("pr"),d.i32_const(2*b))),...d.ret([])]),d.if(d.call(a+"_isZeroAffine",d.getLocal("p2")),[...d.call(a+"_copy",d.getLocal("p1"),d.getLocal("pr")),...d.ret([])]),d.if(d.call(c+"_isOne",r),[...d.call(a+"_addAffine",t,n,s),...d.ret([])]),d.call(c+"_square",r,u),d.call(c+"_mul",n,u,x),d.call(c+"_mul",r,u,p),d.call(c+"_mul",o,p,g),d.if(d.call(c+"_eq",t,x),d.if(d.call(c+"_eq",i,g),[...d.call(a+"_doubleAffine",d.getLocal("p2"),d.getLocal("pr")),...d.ret([])])),d.call(c+"_sub",x,t,m),d.call(c+"_sub",g,i,_),d.call(c+"_square",m,y),d.call(c+"_add",y,y,v),d.call(c+"_add",v,v,v),d.call(c+"_mul",m,v,w),d.call(c+"_add",_,_,M),d.call(c+"_mul",t,v,L),d.call(c+"_square",M,A),d.call(c+"_add",L,L,I),d.call(c+"_sub",A,w,s),d.call(c+"_sub",s,I,s),d.call(c+"_mul",i,w,k),d.call(c+"_add",k,k,k),d.call(c+"_sub",L,s,l),d.call(c+"_mul",l,M,l),d.call(c+"_sub",l,k,l),d.call(c+"_add",r,m,h),d.call(c+"_square",h,h),d.call(c+"_sub",h,u,h),d.call(c+"_sub",h,y,h))}(),function(){const f=e.addFunction(a+"_add");f.addParam("p1","i32"),f.addParam("p2","i32"),f.addParam("pr","i32"),f.addLocal("z1","i32"),f.addLocal("z2","i32");const d=f.getCodeBuilder(),t=d.getLocal("p1"),i=d.i32_add(d.getLocal("p1"),d.i32_const(b));f.addCode(d.setLocal("z1",d.i32_add(d.getLocal("p1"),d.i32_const(2*b))));const r=d.getLocal("z1"),n=d.getLocal("p2"),o=d.i32_add(d.getLocal("p2"),d.i32_const(b));f.addCode(d.setLocal("z2",d.i32_add(d.getLocal("p2"),d.i32_const(2*b))));const s=d.getLocal("z2"),l=d.getLocal("pr"),h=d.i32_add(d.getLocal("pr"),d.i32_const(b)),u=d.i32_add(d.getLocal("pr"),d.i32_const(2*b)),x=d.i32_const(e.alloc(b)),p=d.i32_const(e.alloc(b)),g=d.i32_const(e.alloc(b)),m=d.i32_const(e.alloc(b)),y=d.i32_const(e.alloc(b)),_=d.i32_const(e.alloc(b)),v=d.i32_const(e.alloc(b)),w=d.i32_const(e.alloc(b)),M=d.i32_const(e.alloc(b)),A=d.i32_const(e.alloc(b)),L=d.i32_const(e.alloc(b)),I=d.i32_const(e.alloc(b)),k=d.i32_const(e.alloc(b)),E=d.i32_const(e.alloc(b)),S=d.i32_const(e.alloc(b)),C=d.i32_const(e.alloc(b)),B=d.i32_const(e.alloc(b));f.addCode(d.if(d.call(a+"_isZero",d.getLocal("p1")),[...d.call(a+"_copy",d.getLocal("p2"),d.getLocal("pr")),...d.ret([])]),d.if(d.call(a+"_isZero",d.getLocal("p2")),[...d.call(a+"_copy",d.getLocal("p1"),d.getLocal("pr")),...d.ret([])]),d.if(d.call(c+"_isOne",r),[...d.call(a+"_addMixed",n,t,l),...d.ret([])]),d.if(d.call(c+"_isOne",s),[...d.call(a+"_addMixed",t,n,l),...d.ret([])]),d.call(c+"_square",r,x),d.call(c+"_square",s,p),d.call(c+"_mul",t,p,g),d.call(c+"_mul",n,x,m),d.call(c+"_mul",r,x,y),d.call(c+"_mul",s,p,_),d.call(c+"_mul",i,_,v),d.call(c+"_mul",o,y,w),d.if(d.call(c+"_eq",g,m),d.if(d.call(c+"_eq",v,w),[...d.call(a+"_double",d.getLocal("p1"),d.getLocal("pr")),...d.ret([])])),d.call(c+"_sub",m,g,M),d.call(c+"_sub",w,v,A),d.call(c+"_add",M,M,L),d.call(c+"_square",L,L),d.call(c+"_mul",M,L,I),d.call(c+"_add",A,A,k),d.call(c+"_mul",g,L,S),d.call(c+"_square",k,E),d.call(c+"_add",S,S,C),d.call(c+"_sub",E,I,l),d.call(c+"_sub",l,C,l),d.call(c+"_mul",v,I,B),d.call(c+"_add",B,B,B),d.call(c+"_sub",S,l,h),d.call(c+"_mul",h,k,h),d.call(c+"_sub",h,B,h),d.call(c+"_add",r,s,u),d.call(c+"_square",u,u),d.call(c+"_sub",u,x,u),d.call(c+"_sub",u,p,u),d.call(c+"_mul",u,M,u))}(),function(){const f=e.addFunction(a+"_negAffine");f.addParam("p1","i32"),f.addParam("pr","i32");const d=f.getCodeBuilder(),t=d.getLocal("p1"),i=d.i32_add(d.getLocal("p1"),d.i32_const(b)),r=d.getLocal("pr"),n=d.i32_add(d.getLocal("pr"),d.i32_const(b));f.addCode(d.call(c+"_copy",t,r),d.call(c+"_neg",i,n))}(),function(){const f=e.addFunction(a+"_neg");f.addParam("p1","i32"),f.addParam("pr","i32");const d=f.getCodeBuilder(),t=d.getLocal("p1"),i=d.i32_add(d.getLocal("p1"),d.i32_const(b)),r=d.i32_add(d.getLocal("p1"),d.i32_const(2*b)),n=d.getLocal("pr"),o=d.i32_add(d.getLocal("pr"),d.i32_const(b)),s=d.i32_add(d.getLocal("pr"),d.i32_const(2*b));f.addCode(d.call(c+"_copy",t,n),d.call(c+"_neg",i,o),d.call(c+"_copy",r,s))}(),function(){const c=e.addFunction(a+"_subAffine");c.addParam("p1","i32"),c.addParam("p2","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),d=f.i32_const(e.alloc(3*b));c.addCode(f.call(a+"_negAffine",f.getLocal("p2"),d),f.call(a+"_addAffine",f.getLocal("p1"),d,f.getLocal("pr")))}(),function(){const c=e.addFunction(a+"_subMixed");c.addParam("p1","i32"),c.addParam("p2","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),d=f.i32_const(e.alloc(3*b));c.addCode(f.call(a+"_negAffine",f.getLocal("p2"),d),f.call(a+"_addMixed",f.getLocal("p1"),d,f.getLocal("pr")))}(),function(){const c=e.addFunction(a+"_sub");c.addParam("p1","i32"),c.addParam("p2","i32"),c.addParam("pr","i32");const f=c.getCodeBuilder(),d=f.i32_const(e.alloc(3*b));c.addCode(f.call(a+"_neg",f.getLocal("p2"),d),f.call(a+"_add",f.getLocal("p1"),d,f.getLocal("pr")))}(),function(){const f=e.addFunction(a+"_fromMontgomeryAffine");f.addParam("p1","i32"),f.addParam("pr","i32");const d=f.getCodeBuilder();f.addCode(d.call(c+"_fromMontgomery",d.getLocal("p1"),d.getLocal("pr")));for(let e=1;e<2;e++)f.addCode(d.call(c+"_fromMontgomery",d.i32_add(d.getLocal("p1"),d.i32_const(e*b)),d.i32_add(d.getLocal("pr"),d.i32_const(e*b))))}(),function(){const f=e.addFunction(a+"_fromMontgomery");f.addParam("p1","i32"),f.addParam("pr","i32");const d=f.getCodeBuilder();f.addCode(d.call(c+"_fromMontgomery",d.getLocal("p1"),d.getLocal("pr")));for(let e=1;e<3;e++)f.addCode(d.call(c+"_fromMontgomery",d.i32_add(d.getLocal("p1"),d.i32_const(e*b)),d.i32_add(d.getLocal("pr"),d.i32_const(e*b))))}(),function(){const f=e.addFunction(a+"_toMontgomeryAffine");f.addParam("p1","i32"),f.addParam("pr","i32");const d=f.getCodeBuilder();f.addCode(d.call(c+"_toMontgomery",d.getLocal("p1"),d.getLocal("pr")));for(let e=1;e<2;e++)f.addCode(d.call(c+"_toMontgomery",d.i32_add(d.getLocal("p1"),d.i32_const(e*b)),d.i32_add(d.getLocal("pr"),d.i32_const(e*b))))}(),function(){const f=e.addFunction(a+"_toMontgomery");f.addParam("p1","i32"),f.addParam("pr","i32");const d=f.getCodeBuilder();f.addCode(d.call(c+"_toMontgomery",d.getLocal("p1"),d.getLocal("pr")));for(let e=1;e<3;e++)f.addCode(d.call(c+"_toMontgomery",d.i32_add(d.getLocal("p1"),d.i32_const(e*b)),d.i32_add(d.getLocal("pr"),d.i32_const(e*b))))}(),function(){const f=e.addFunction(a+"_toAffine");f.addParam("p1","i32"),f.addParam("pr","i32");const d=f.getCodeBuilder(),t=d.getLocal("p1"),i=d.i32_add(d.getLocal("p1"),d.i32_const(b)),r=d.i32_add(d.getLocal("p1"),d.i32_const(2*b)),n=d.getLocal("pr"),o=d.i32_add(d.getLocal("pr"),d.i32_const(b)),s=d.i32_const(e.alloc(b)),l=d.i32_const(e.alloc(b)),h=d.i32_const(e.alloc(b));f.addCode(d.if(d.call(a+"_isZero",d.getLocal("p1")),[...d.call(c+"_zero",n),...d.call(c+"_zero",o)],[...d.call(c+"_inverse",r,s),...d.call(c+"_square",s,l),...d.call(c+"_mul",s,l,h),...d.call(c+"_mul",t,l,n),...d.call(c+"_mul",i,h,o)]))}(),function(){const d=e.addFunction(a+"_inCurveAffine");d.addParam("pIn","i32"),d.setReturnType("i32");const t=d.getCodeBuilder(),i=t.getLocal("pIn"),r=t.i32_add(t.getLocal("pIn"),t.i32_const(b)),n=t.i32_const(e.alloc(b)),o=t.i32_const(e.alloc(b));d.addCode(t.call(c+"_square",r,n),t.call(c+"_square",i,o),t.call(c+"_mul",i,o,o),t.call(c+"_add",o,t.i32_const(f),o),t.ret(t.call(c+"_eq",n,o)))}(),function(){const c=e.addFunction(a+"_inCurve");c.addParam("pIn","i32"),c.setReturnType("i32");const f=c.getCodeBuilder(),d=f.i32_const(e.alloc(2*b));c.addCode(f.call(a+"_toAffine",f.getLocal("pIn"),d),f.ret(f.call(a+"_inCurveAffine",d)))}(),function(){const f=e.addFunction(a+"_batchToAffine");f.addParam("pIn","i32"),f.addParam("n","i32"),f.addParam("pOut","i32"),f.addLocal("pAux","i32"),f.addLocal("itIn","i32"),f.addLocal("itAux","i32"),f.addLocal("itOut","i32"),f.addLocal("i","i32");const d=f.getCodeBuilder(),t=d.i32_const(e.alloc(b));f.addCode(d.setLocal("pAux",d.i32_load(d.i32_const(0))),d.i32_store(d.i32_const(0),d.i32_add(d.getLocal("pAux"),d.i32_mul(d.getLocal("n"),d.i32_const(b)))),d.call(c+"_batchInverse",d.i32_add(d.getLocal("pIn"),d.i32_const(2*b)),d.i32_const(3*b),d.getLocal("n"),d.getLocal("pAux"),d.i32_const(b)),d.setLocal("itIn",d.getLocal("pIn")),d.setLocal("itAux",d.getLocal("pAux")),d.setLocal("itOut",d.getLocal("pOut")),d.setLocal("i",d.i32_const(0)),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("i"),d.getLocal("n"))),d.if(d.call(c+"_isZero",d.getLocal("itAux")),[...d.call(c+"_zero",d.getLocal("itOut")),...d.call(c+"_zero",d.i32_add(d.getLocal("itOut"),d.i32_const(b)))],[...d.call(c+"_mul",d.getLocal("itAux"),d.i32_add(d.getLocal("itIn"),d.i32_const(b)),t),...d.call(c+"_square",d.getLocal("itAux"),d.getLocal("itAux")),...d.call(c+"_mul",d.getLocal("itAux"),d.getLocal("itIn"),d.getLocal("itOut")),...d.call(c+"_mul",d.getLocal("itAux"),t,d.i32_add(d.getLocal("itOut"),d.i32_const(b)))]),d.setLocal("itIn",d.i32_add(d.getLocal("itIn"),d.i32_const(3*b))),d.setLocal("itOut",d.i32_add(d.getLocal("itOut"),d.i32_const(2*b))),d.setLocal("itAux",d.i32_add(d.getLocal("itAux"),d.i32_const(b))),d.setLocal("i",d.i32_add(d.getLocal("i"),d.i32_const(1))),d.br(0))),d.i32_store(d.i32_const(0),d.getLocal("pAux")))}(),function(){const f=e.addFunction(a+"_normalize");f.addParam("p1","i32"),f.addParam("pr","i32");const d=f.getCodeBuilder(),t=d.getLocal("p1"),i=d.i32_add(d.getLocal("p1"),d.i32_const(b)),r=d.i32_add(d.getLocal("p1"),d.i32_const(2*b)),n=d.getLocal("pr"),o=d.i32_add(d.getLocal("pr"),d.i32_const(b)),s=d.i32_add(d.getLocal("pr"),d.i32_const(2*b)),l=d.i32_const(e.alloc(b)),h=d.i32_const(e.alloc(b)),u=d.i32_const(e.alloc(b));f.addCode(d.if(d.call(a+"_isZero",d.getLocal("p1")),d.call(a+"_zero",d.getLocal("pr")),[...d.call(c+"_inverse",r,l),...d.call(c+"_square",l,h),...d.call(c+"_mul",l,h,u),...d.call(c+"_mul",t,h,n),...d.call(c+"_mul",i,u,o),...d.call(c+"_one",s)]))}(),function(){const c=e.addFunction(a+"__reverseBytes");c.addParam("pIn","i32"),c.addParam("n","i32"),c.addParam("pOut","i32"),c.addLocal("itOut","i32"),c.addLocal("itIn","i32");const f=c.getCodeBuilder();c.addCode(f.setLocal("itOut",f.i32_sub(f.i32_add(f.getLocal("pOut"),f.getLocal("n")),f.i32_const(1))),f.setLocal("itIn",f.getLocal("pIn")),f.block(f.loop(f.br_if(1,f.i32_lt_s(f.getLocal("itOut"),f.getLocal("pOut"))),f.i32_store8(f.getLocal("itOut"),f.i32_load8_u(f.getLocal("itIn"))),f.setLocal("itOut",f.i32_sub(f.getLocal("itOut"),f.i32_const(1))),f.setLocal("itIn",f.i32_add(f.getLocal("itIn"),f.i32_const(1))),f.br(0))))}(),function(){const c=e.addFunction(a+"_LEMtoU");c.addParam("pIn","i32"),c.addParam("pOut","i32");const f=c.getCodeBuilder(),d=e.alloc(2*b),t=f.i32_const(d),i=f.i32_const(d),r=f.i32_const(d+b);c.addCode(f.if(f.call(a+"_isZeroAffine",f.getLocal("pIn")),[...f.call(a+"_zeroAffine",f.getLocal("pOut")),...f.ret([])]),f.call(a+"_fromMontgomeryAffine",f.getLocal("pIn"),t),f.call(a+"__reverseBytes",i,f.i32_const(b),f.getLocal("pOut")),f.call(a+"__reverseBytes",r,f.i32_const(b),f.i32_add(f.getLocal("pOut"),f.i32_const(b))))}(),function(){const f=e.addFunction(a+"_LEMtoC");f.addParam("pIn","i32"),f.addParam("pOut","i32");const d=f.getCodeBuilder(),t=d.i32_const(e.alloc(b));f.addCode(d.if(d.call(a+"_isZeroAffine",d.getLocal("pIn")),[...d.call(c+"_zero",d.getLocal("pOut")),...d.i32_store8(d.getLocal("pOut"),d.i32_const(64)),...d.ret([])]),d.call(c+"_fromMontgomery",d.getLocal("pIn"),t),d.call(a+"__reverseBytes",t,d.i32_const(b),d.getLocal("pOut")),d.if(d.i32_eq(d.call(c+"_sign",d.i32_add(d.getLocal("pIn"),d.i32_const(b))),d.i32_const(-1)),d.i32_store8(d.getLocal("pOut"),d.i32_or(d.i32_load8_u(d.getLocal("pOut")),d.i32_const(128)))))}(),function(){const c=e.addFunction(a+"_UtoLEM");c.addParam("pIn","i32"),c.addParam("pOut","i32");const f=c.getCodeBuilder(),d=e.alloc(2*b),t=f.i32_const(d),i=f.i32_const(d),r=f.i32_const(d+b);c.addCode(f.if(f.i32_and(f.i32_load8_u(f.getLocal("pIn")),f.i32_const(64)),[...f.call(a+"_zeroAffine",f.getLocal("pOut")),...f.ret([])]),f.call(a+"__reverseBytes",f.getLocal("pIn"),f.i32_const(b),i),f.call(a+"__reverseBytes",f.i32_add(f.getLocal("pIn"),f.i32_const(b)),f.i32_const(b),r),f.call(a+"_toMontgomeryAffine",t,f.getLocal("pOut")))}(),function(){const d=e.addFunction(a+"_CtoLEM");d.addParam("pIn","i32"),d.addParam("pOut","i32"),d.addLocal("firstByte","i32"),d.addLocal("greatest","i32");const t=d.getCodeBuilder(),i=e.alloc(2*b),r=t.i32_const(i),n=t.i32_const(i+b);d.addCode(t.setLocal("firstByte",t.i32_load8_u(t.getLocal("pIn"))),t.if(t.i32_and(t.getLocal("firstByte"),t.i32_const(64)),[...t.call(a+"_zeroAffine",t.getLocal("pOut")),...t.ret([])]),t.setLocal("greatest",t.i32_and(t.getLocal("firstByte"),t.i32_const(128))),t.call(c+"_copy",t.getLocal("pIn"),n),t.i32_store8(n,t.i32_and(t.getLocal("firstByte"),t.i32_const(63))),t.call(a+"__reverseBytes",n,t.i32_const(b),r),t.call(c+"_toMontgomery",r,t.getLocal("pOut")),t.call(c+"_square",t.getLocal("pOut"),n),t.call(c+"_mul",t.getLocal("pOut"),n,n),t.call(c+"_add",n,t.i32_const(f),n),t.call(c+"_sqrt",n,n),t.call(c+"_neg",n,r),t.if(t.i32_eq(t.call(c+"_sign",n),t.i32_const(-1)),t.if(t.getLocal("greatest"),t.call(c+"_copy",n,t.i32_add(t.getLocal("pOut"),t.i32_const(b))),t.call(c+"_neg",n,t.i32_add(t.getLocal("pOut"),t.i32_const(b)))),t.if(t.getLocal("greatest"),t.call(c+"_neg",n,t.i32_add(t.getLocal("pOut"),t.i32_const(b))),t.call(c+"_copy",n,t.i32_add(t.getLocal("pOut"),t.i32_const(b))))))}(),Me(e,a+"_batchLEMtoU",a+"_LEMtoU",2*b,2*b),Me(e,a+"_batchLEMtoC",a+"_LEMtoC",2*b,b),Me(e,a+"_batchUtoLEM",a+"_UtoLEM",2*b,2*b),Me(e,a+"_batchCtoLEM",a+"_CtoLEM",b,2*b,!0),Me(e,a+"_batchToJacobian",a+"_toJacobian",2*b,3*b,!0),Ae(e,a,a+"_multiexp",a+"_add",3*b),Ae(e,a,a+"_multiexpAffine",a+"_addMixed",2*b),we(e,a+"_timesScalar",3*b,a+"_add",a+"_double",a+"_sub",a+"_copy",a+"_zero"),we(e,a+"_timesScalarAffine",2*b,a+"_addMixed",a+"_double",a+"_subMixed",a+"_copyAffine",a+"_zero"),e.exportFunction(a+"_isZero"),e.exportFunction(a+"_isZeroAffine"),e.exportFunction(a+"_eq"),e.exportFunction(a+"_eqMixed"),e.exportFunction(a+"_eqAffine"),e.exportFunction(a+"_copy"),e.exportFunction(a+"_copyAffine"),e.exportFunction(a+"_zero"),e.exportFunction(a+"_zeroAffine"),e.exportFunction(a+"_double"),e.exportFunction(a+"_doubleAffine"),e.exportFunction(a+"_add"),e.exportFunction(a+"_addMixed"),e.exportFunction(a+"_addAffine"),e.exportFunction(a+"_neg"),e.exportFunction(a+"_negAffine"),e.exportFunction(a+"_sub"),e.exportFunction(a+"_subMixed"),e.exportFunction(a+"_subAffine"),e.exportFunction(a+"_fromMontgomery"),e.exportFunction(a+"_fromMontgomeryAffine"),e.exportFunction(a+"_toMontgomery"),e.exportFunction(a+"_toMontgomeryAffine"),e.exportFunction(a+"_timesScalar"),e.exportFunction(a+"_timesScalarAffine"),e.exportFunction(a+"_normalize"),e.exportFunction(a+"_LEMtoU"),e.exportFunction(a+"_LEMtoC"),e.exportFunction(a+"_UtoLEM"),e.exportFunction(a+"_CtoLEM"),e.exportFunction(a+"_batchLEMtoU"),e.exportFunction(a+"_batchLEMtoC"),e.exportFunction(a+"_batchUtoLEM"),e.exportFunction(a+"_batchCtoLEM"),e.exportFunction(a+"_toAffine"),e.exportFunction(a+"_toJacobian"),e.exportFunction(a+"_batchToAffine"),e.exportFunction(a+"_batchToJacobian"),e.exportFunction(a+"_inCurve"),e.exportFunction(a+"_inCurveAffine")),a};const{isOdd:Ie,modInv:ke,modPow:Ee}=q,Se=T;var Ce=function(e,a,c,f,d){const b=8*e.modules[f].n64,t=8*e.modules[c].n64,i=e.modules[f].q;let r=i-1n,n=0;for(;!Ie(r);)n++,r>>=1n;let o=2n;for(;1n===Ee(o,i>>1n,i);)o+=1n;const s=new Array(n+1);s[n]=Ee(o,r,i);let l=n-1;for(;l>=0;)s[l]=Ee(s[l+1],2n,i),l--;const h=[],u=(1n<>c);return a}const L=Array(256);for(let e=0;e<256;e++)L[e]=A(e);const I=e.alloc(L);!function(){const c=e.addFunction(a+"__rev");c.addParam("x","i32"),c.addParam("bits","i32"),c.setReturnType("i32");const f=c.getCodeBuilder();c.addCode(f.i32_rotl(f.i32_add(f.i32_add(f.i32_shl(f.i32_load8_u(f.i32_and(f.getLocal("x"),f.i32_const(255)),I,0),f.i32_const(24)),f.i32_shl(f.i32_load8_u(f.i32_and(f.i32_shr_u(f.getLocal("x"),f.i32_const(8)),f.i32_const(255)),I,0),f.i32_const(16))),f.i32_add(f.i32_shl(f.i32_load8_u(f.i32_and(f.i32_shr_u(f.getLocal("x"),f.i32_const(16)),f.i32_const(255)),I,0),f.i32_const(8)),f.i32_load8_u(f.i32_and(f.i32_shr_u(f.getLocal("x"),f.i32_const(24)),f.i32_const(255)),I,0))),f.getLocal("bits")))}(),function(){const f=e.addFunction(a+"__reversePermutation");f.addParam("px","i32"),f.addParam("bits","i32"),f.addLocal("n","i32"),f.addLocal("i","i32"),f.addLocal("ri","i32"),f.addLocal("idx1","i32"),f.addLocal("idx2","i32");const d=f.getCodeBuilder(),b=d.i32_const(e.alloc(t));f.addCode(d.setLocal("n",d.i32_shl(d.i32_const(1),d.getLocal("bits"))),d.setLocal("i",d.i32_const(0)),d.block(d.loop(d.br_if(1,d.i32_eq(d.getLocal("i"),d.getLocal("n"))),d.setLocal("idx1",d.i32_add(d.getLocal("px"),d.i32_mul(d.getLocal("i"),d.i32_const(t)))),d.setLocal("ri",d.call(a+"__rev",d.getLocal("i"),d.getLocal("bits"))),d.setLocal("idx2",d.i32_add(d.getLocal("px"),d.i32_mul(d.getLocal("ri"),d.i32_const(t)))),d.if(d.i32_lt_u(d.getLocal("i"),d.getLocal("ri")),[...d.call(c+"_copy",d.getLocal("idx1"),b),...d.call(c+"_copy",d.getLocal("idx2"),d.getLocal("idx1")),...d.call(c+"_copy",b,d.getLocal("idx2"))]),d.setLocal("i",d.i32_add(d.getLocal("i"),d.i32_const(1))),d.br(0))))}(),function(){const b=e.addFunction(a+"__fftFinal");b.addParam("px","i32"),b.addParam("bits","i32"),b.addParam("reverse","i32"),b.addParam("mulFactor","i32"),b.addLocal("n","i32"),b.addLocal("ndiv2","i32"),b.addLocal("pInv2","i32"),b.addLocal("i","i32"),b.addLocal("mask","i32"),b.addLocal("idx1","i32"),b.addLocal("idx2","i32");const i=b.getCodeBuilder(),r=i.i32_const(e.alloc(t));b.addCode(i.if(i.i32_and(i.i32_eqz(i.getLocal("reverse")),i.call(f+"_isOne",i.getLocal("mulFactor"))),i.ret([])),i.setLocal("n",i.i32_shl(i.i32_const(1),i.getLocal("bits"))),i.setLocal("mask",i.i32_sub(i.getLocal("n"),i.i32_const(1))),i.setLocal("i",i.i32_const(1)),i.setLocal("ndiv2",i.i32_shr_u(i.getLocal("n"),i.i32_const(1))),i.block(i.loop(i.br_if(1,i.i32_ge_u(i.getLocal("i"),i.getLocal("ndiv2"))),i.setLocal("idx1",i.i32_add(i.getLocal("px"),i.i32_mul(i.getLocal("i"),i.i32_const(t)))),i.setLocal("idx2",i.i32_add(i.getLocal("px"),i.i32_mul(i.i32_sub(i.getLocal("n"),i.getLocal("i")),i.i32_const(t)))),i.if(i.getLocal("reverse"),i.if(i.call(f+"_isOne",i.getLocal("mulFactor")),[...i.call(c+"_copy",i.getLocal("idx1"),r),...i.call(c+"_copy",i.getLocal("idx2"),i.getLocal("idx1")),...i.call(c+"_copy",r,i.getLocal("idx2"))],[...i.call(c+"_copy",i.getLocal("idx1"),r),...i.call(d,i.getLocal("idx2"),i.getLocal("mulFactor"),i.getLocal("idx1")),...i.call(d,r,i.getLocal("mulFactor"),i.getLocal("idx2"))]),i.if(i.call(f+"_isOne",i.getLocal("mulFactor")),[],[...i.call(d,i.getLocal("idx1"),i.getLocal("mulFactor"),i.getLocal("idx1")),...i.call(d,i.getLocal("idx2"),i.getLocal("mulFactor"),i.getLocal("idx2"))])),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))),i.if(i.call(f+"_isOne",i.getLocal("mulFactor")),[],[...i.call(d,i.getLocal("px"),i.getLocal("mulFactor"),i.getLocal("px")),...i.setLocal("idx2",i.i32_add(i.getLocal("px"),i.i32_mul(i.getLocal("ndiv2"),i.i32_const(t)))),...i.call(d,i.getLocal("idx2"),i.getLocal("mulFactor"),i.getLocal("idx2"))]))}(),function(){const i=e.addFunction(a+"_rawfft");i.addParam("px","i32"),i.addParam("bits","i32"),i.addParam("reverse","i32"),i.addParam("mulFactor","i32"),i.addLocal("s","i32"),i.addLocal("k","i32"),i.addLocal("j","i32"),i.addLocal("m","i32"),i.addLocal("mdiv2","i32"),i.addLocal("n","i32"),i.addLocal("pwm","i32"),i.addLocal("idx1","i32"),i.addLocal("idx2","i32");const r=i.getCodeBuilder(),n=r.i32_const(e.alloc(b)),o=r.i32_const(e.alloc(t)),s=r.i32_const(e.alloc(t));i.addCode(r.call(a+"__reversePermutation",r.getLocal("px"),r.getLocal("bits")),r.setLocal("n",r.i32_shl(r.i32_const(1),r.getLocal("bits"))),r.setLocal("s",r.i32_const(1)),r.block(r.loop(r.br_if(1,r.i32_gt_u(r.getLocal("s"),r.getLocal("bits"))),r.setLocal("m",r.i32_shl(r.i32_const(1),r.getLocal("s"))),r.setLocal("pwm",r.i32_add(r.i32_const(x),r.i32_mul(r.getLocal("s"),r.i32_const(b)))),r.setLocal("k",r.i32_const(0)),r.block(r.loop(r.br_if(1,r.i32_ge_u(r.getLocal("k"),r.getLocal("n"))),r.call(f+"_one",n),r.setLocal("mdiv2",r.i32_shr_u(r.getLocal("m"),r.i32_const(1))),r.setLocal("j",r.i32_const(0)),r.block(r.loop(r.br_if(1,r.i32_ge_u(r.getLocal("j"),r.getLocal("mdiv2"))),r.setLocal("idx1",r.i32_add(r.getLocal("px"),r.i32_mul(r.i32_add(r.getLocal("k"),r.getLocal("j")),r.i32_const(t)))),r.setLocal("idx2",r.i32_add(r.getLocal("idx1"),r.i32_mul(r.getLocal("mdiv2"),r.i32_const(t)))),r.call(d,r.getLocal("idx2"),n,o),r.call(c+"_copy",r.getLocal("idx1"),s),r.call(c+"_add",s,o,r.getLocal("idx1")),r.call(c+"_sub",s,o,r.getLocal("idx2")),r.call(f+"_mul",n,r.getLocal("pwm"),n),r.setLocal("j",r.i32_add(r.getLocal("j"),r.i32_const(1))),r.br(0))),r.setLocal("k",r.i32_add(r.getLocal("k"),r.getLocal("m"))),r.br(0))),r.setLocal("s",r.i32_add(r.getLocal("s"),r.i32_const(1))),r.br(0))),r.call(a+"__fftFinal",r.getLocal("px"),r.getLocal("bits"),r.getLocal("reverse"),r.getLocal("mulFactor")))}(),function(){const c=e.addFunction(a+"__log2");c.addParam("n","i32"),c.setReturnType("i32"),c.addLocal("bits","i32"),c.addLocal("aux","i32");const f=c.getCodeBuilder();c.addCode(f.setLocal("aux",f.i32_shr_u(f.getLocal("n"),f.i32_const(1)))),c.addCode(f.setLocal("bits",f.i32_const(0))),c.addCode(f.block(f.loop(f.br_if(1,f.i32_eqz(f.getLocal("aux"))),f.setLocal("aux",f.i32_shr_u(f.getLocal("aux"),f.i32_const(1))),f.setLocal("bits",f.i32_add(f.getLocal("bits"),f.i32_const(1))),f.br(0)))),c.addCode(f.if(f.i32_ne(f.getLocal("n"),f.i32_shl(f.i32_const(1),f.getLocal("bits"))),f.unreachable())),c.addCode(f.if(f.i32_gt_u(f.getLocal("bits"),f.i32_const(n)),f.unreachable())),c.addCode(f.getLocal("bits"))}(),function(){const c=e.addFunction(a+"_fft");c.addParam("px","i32"),c.addParam("n","i32"),c.addLocal("bits","i32");const d=c.getCodeBuilder(),t=d.i32_const(e.alloc(b));c.addCode(d.setLocal("bits",d.call(a+"__log2",d.getLocal("n"))),d.call(f+"_one",t),d.call(a+"_rawfft",d.getLocal("px"),d.getLocal("bits"),d.i32_const(0),t))}(),function(){const c=e.addFunction(a+"_ifft");c.addParam("px","i32"),c.addParam("n","i32"),c.addLocal("bits","i32"),c.addLocal("pInv2","i32");const f=c.getCodeBuilder();c.addCode(f.setLocal("bits",f.call(a+"__log2",f.getLocal("n"))),f.setLocal("pInv2",f.i32_add(f.i32_const(m),f.i32_mul(f.getLocal("bits"),f.i32_const(b)))),f.call(a+"_rawfft",f.getLocal("px"),f.getLocal("bits"),f.i32_const(1),f.getLocal("pInv2")))}(),function(){const i=e.addFunction(a+"_fftJoin");i.addParam("pBuff1","i32"),i.addParam("pBuff2","i32"),i.addParam("n","i32"),i.addParam("first","i32"),i.addParam("inc","i32"),i.addLocal("idx1","i32"),i.addLocal("idx2","i32"),i.addLocal("i","i32");const r=i.getCodeBuilder(),n=r.i32_const(e.alloc(b)),o=r.i32_const(e.alloc(t)),s=r.i32_const(e.alloc(t));i.addCode(r.call(f+"_copy",r.getLocal("first"),n),r.setLocal("i",r.i32_const(0)),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("i"),r.getLocal("n"))),r.setLocal("idx1",r.i32_add(r.getLocal("pBuff1"),r.i32_mul(r.getLocal("i"),r.i32_const(t)))),r.setLocal("idx2",r.i32_add(r.getLocal("pBuff2"),r.i32_mul(r.getLocal("i"),r.i32_const(t)))),r.call(d,r.getLocal("idx2"),n,o),r.call(c+"_copy",r.getLocal("idx1"),s),r.call(c+"_add",s,o,r.getLocal("idx1")),r.call(c+"_sub",s,o,r.getLocal("idx2")),r.call(f+"_mul",n,r.getLocal("inc"),n),r.setLocal("i",r.i32_add(r.getLocal("i"),r.i32_const(1))),r.br(0))))}(),function(){const i=e.addFunction(a+"_fftJoinExt");i.addParam("pBuff1","i32"),i.addParam("pBuff2","i32"),i.addParam("n","i32"),i.addParam("first","i32"),i.addParam("inc","i32"),i.addParam("totalBits","i32"),i.addLocal("idx1","i32"),i.addLocal("idx2","i32"),i.addLocal("i","i32"),i.addLocal("pShiftToM","i32");const r=i.getCodeBuilder(),n=r.i32_const(e.alloc(b)),o=r.i32_const(e.alloc(t));i.addCode(r.setLocal("pShiftToM",r.i32_add(r.i32_const(w),r.i32_mul(r.getLocal("totalBits"),r.i32_const(b)))),r.call(f+"_copy",r.getLocal("first"),n),r.setLocal("i",r.i32_const(0)),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("i"),r.getLocal("n"))),r.setLocal("idx1",r.i32_add(r.getLocal("pBuff1"),r.i32_mul(r.getLocal("i"),r.i32_const(t)))),r.setLocal("idx2",r.i32_add(r.getLocal("pBuff2"),r.i32_mul(r.getLocal("i"),r.i32_const(t)))),r.call(c+"_add",r.getLocal("idx1"),r.getLocal("idx2"),o),r.call(d,r.getLocal("idx2"),r.getLocal("pShiftToM"),r.getLocal("idx2")),r.call(c+"_add",r.getLocal("idx1"),r.getLocal("idx2"),r.getLocal("idx2")),r.call(d,r.getLocal("idx2"),n,r.getLocal("idx2")),r.call(c+"_copy",o,r.getLocal("idx1")),r.call(f+"_mul",n,r.getLocal("inc"),n),r.setLocal("i",r.i32_add(r.getLocal("i"),r.i32_const(1))),r.br(0))))}(),function(){const i=e.addFunction(a+"_fftJoinExtInv");i.addParam("pBuff1","i32"),i.addParam("pBuff2","i32"),i.addParam("n","i32"),i.addParam("first","i32"),i.addParam("inc","i32"),i.addParam("totalBits","i32"),i.addLocal("idx1","i32"),i.addLocal("idx2","i32"),i.addLocal("i","i32"),i.addLocal("pShiftToM","i32"),i.addLocal("pSConst","i32");const r=i.getCodeBuilder(),n=r.i32_const(e.alloc(b)),o=r.i32_const(e.alloc(t));i.addCode(r.setLocal("pShiftToM",r.i32_add(r.i32_const(w),r.i32_mul(r.getLocal("totalBits"),r.i32_const(b)))),r.setLocal("pSConst",r.i32_add(r.i32_const(M),r.i32_mul(r.getLocal("totalBits"),r.i32_const(b)))),r.call(f+"_copy",r.getLocal("first"),n),r.setLocal("i",r.i32_const(0)),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("i"),r.getLocal("n"))),r.setLocal("idx1",r.i32_add(r.getLocal("pBuff1"),r.i32_mul(r.getLocal("i"),r.i32_const(t)))),r.setLocal("idx2",r.i32_add(r.getLocal("pBuff2"),r.i32_mul(r.getLocal("i"),r.i32_const(t)))),r.call(d,r.getLocal("idx2"),n,o),r.call(c+"_sub",r.getLocal("idx1"),o,r.getLocal("idx2")),r.call(d,r.getLocal("idx2"),r.getLocal("pSConst"),r.getLocal("idx2")),r.call(d,r.getLocal("idx1"),r.getLocal("pShiftToM"),r.getLocal("idx1")),r.call(c+"_sub",o,r.getLocal("idx1"),r.getLocal("idx1")),r.call(d,r.getLocal("idx1"),r.getLocal("pSConst"),r.getLocal("idx1")),r.call(f+"_mul",n,r.getLocal("inc"),n),r.setLocal("i",r.i32_add(r.getLocal("i"),r.i32_const(1))),r.br(0))))}(),function(){const i=e.addFunction(a+"_fftMix");i.addParam("pBuff","i32"),i.addParam("n","i32"),i.addParam("exp","i32"),i.addLocal("nGroups","i32"),i.addLocal("nPerGroup","i32"),i.addLocal("nPerGroupDiv2","i32"),i.addLocal("pairOffset","i32"),i.addLocal("idx1","i32"),i.addLocal("idx2","i32"),i.addLocal("i","i32"),i.addLocal("j","i32"),i.addLocal("pwm","i32");const r=i.getCodeBuilder(),n=r.i32_const(e.alloc(b)),o=r.i32_const(e.alloc(t)),s=r.i32_const(e.alloc(t));i.addCode(r.setLocal("nPerGroup",r.i32_shl(r.i32_const(1),r.getLocal("exp"))),r.setLocal("nPerGroupDiv2",r.i32_shr_u(r.getLocal("nPerGroup"),r.i32_const(1))),r.setLocal("nGroups",r.i32_shr_u(r.getLocal("n"),r.getLocal("exp"))),r.setLocal("pairOffset",r.i32_mul(r.getLocal("nPerGroupDiv2"),r.i32_const(t))),r.setLocal("pwm",r.i32_add(r.i32_const(x),r.i32_mul(r.getLocal("exp"),r.i32_const(b)))),r.setLocal("i",r.i32_const(0)),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("i"),r.getLocal("nGroups"))),r.call(f+"_one",n),r.setLocal("j",r.i32_const(0)),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("j"),r.getLocal("nPerGroupDiv2"))),r.setLocal("idx1",r.i32_add(r.getLocal("pBuff"),r.i32_mul(r.i32_add(r.i32_mul(r.getLocal("i"),r.getLocal("nPerGroup")),r.getLocal("j")),r.i32_const(t)))),r.setLocal("idx2",r.i32_add(r.getLocal("idx1"),r.getLocal("pairOffset"))),r.call(d,r.getLocal("idx2"),n,o),r.call(c+"_copy",r.getLocal("idx1"),s),r.call(c+"_add",s,o,r.getLocal("idx1")),r.call(c+"_sub",s,o,r.getLocal("idx2")),r.call(f+"_mul",n,r.getLocal("pwm"),n),r.setLocal("j",r.i32_add(r.getLocal("j"),r.i32_const(1))),r.br(0))),r.setLocal("i",r.i32_add(r.getLocal("i"),r.i32_const(1))),r.br(0))))}(),function(){const f=e.addFunction(a+"_fftFinal");f.addParam("pBuff","i32"),f.addParam("n","i32"),f.addParam("factor","i32"),f.addLocal("idx1","i32"),f.addLocal("idx2","i32"),f.addLocal("i","i32"),f.addLocal("ndiv2","i32");const b=f.getCodeBuilder(),i=b.i32_const(e.alloc(t));f.addCode(b.setLocal("ndiv2",b.i32_shr_u(b.getLocal("n"),b.i32_const(1))),b.if(b.i32_and(b.getLocal("n"),b.i32_const(1)),b.call(d,b.i32_add(b.getLocal("pBuff"),b.i32_mul(b.getLocal("ndiv2"),b.i32_const(t))),b.getLocal("factor"),b.i32_add(b.getLocal("pBuff"),b.i32_mul(b.getLocal("ndiv2"),b.i32_const(t))))),b.setLocal("i",b.i32_const(0)),b.block(b.loop(b.br_if(1,b.i32_ge_u(b.getLocal("i"),b.getLocal("ndiv2"))),b.setLocal("idx1",b.i32_add(b.getLocal("pBuff"),b.i32_mul(b.getLocal("i"),b.i32_const(t)))),b.setLocal("idx2",b.i32_add(b.getLocal("pBuff"),b.i32_mul(b.i32_sub(b.i32_sub(b.getLocal("n"),b.i32_const(1)),b.getLocal("i")),b.i32_const(t)))),b.call(d,b.getLocal("idx2"),b.getLocal("factor"),i),b.call(d,b.getLocal("idx1"),b.getLocal("factor"),b.getLocal("idx2")),b.call(c+"_copy",i,b.getLocal("idx1")),b.setLocal("i",b.i32_add(b.getLocal("i"),b.i32_const(1))),b.br(0))))}(),function(){const i=e.addFunction(a+"_prepareLagrangeEvaluation");i.addParam("pBuff1","i32"),i.addParam("pBuff2","i32"),i.addParam("n","i32"),i.addParam("first","i32"),i.addParam("inc","i32"),i.addParam("totalBits","i32"),i.addLocal("idx1","i32"),i.addLocal("idx2","i32"),i.addLocal("i","i32"),i.addLocal("pShiftToM","i32"),i.addLocal("pSConst","i32");const r=i.getCodeBuilder(),n=r.i32_const(e.alloc(b)),o=r.i32_const(e.alloc(t));i.addCode(r.setLocal("pShiftToM",r.i32_add(r.i32_const(w),r.i32_mul(r.getLocal("totalBits"),r.i32_const(b)))),r.setLocal("pSConst",r.i32_add(r.i32_const(M),r.i32_mul(r.getLocal("totalBits"),r.i32_const(b)))),r.call(f+"_copy",r.getLocal("first"),n),r.setLocal("i",r.i32_const(0)),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("i"),r.getLocal("n"))),r.setLocal("idx1",r.i32_add(r.getLocal("pBuff1"),r.i32_mul(r.getLocal("i"),r.i32_const(t)))),r.setLocal("idx2",r.i32_add(r.getLocal("pBuff2"),r.i32_mul(r.getLocal("i"),r.i32_const(t)))),r.call(d,r.getLocal("idx1"),r.getLocal("pShiftToM"),o),r.call(c+"_sub",r.getLocal("idx2"),o,o),r.call(c+"_sub",r.getLocal("idx1"),r.getLocal("idx2"),r.getLocal("idx2")),r.call(d,o,r.getLocal("pSConst"),r.getLocal("idx1")),r.call(d,r.getLocal("idx2"),n,r.getLocal("idx2")),r.call(f+"_mul",n,r.getLocal("inc"),n),r.setLocal("i",r.i32_add(r.getLocal("i"),r.i32_const(1))),r.br(0))))}(),e.exportFunction(a+"_fft"),e.exportFunction(a+"_ifft"),e.exportFunction(a+"_rawfft"),e.exportFunction(a+"_fftJoin"),e.exportFunction(a+"_fftJoinExt"),e.exportFunction(a+"_fftJoinExtInv"),e.exportFunction(a+"_fftMix"),e.exportFunction(a+"_fftFinal"),e.exportFunction(a+"_prepareLagrangeEvaluation")},Be=function(e,a,c){const f=8*e.modules[c].n64;return function(){const d=e.addFunction(a+"_zero");d.addParam("px","i32"),d.addParam("n","i32"),d.addLocal("lastp","i32"),d.addLocal("p","i32");const b=d.getCodeBuilder();d.addCode(b.setLocal("p",b.getLocal("px")),b.setLocal("lastp",b.i32_add(b.getLocal("px"),b.i32_mul(b.getLocal("n"),b.i32_const(f)))),b.block(b.loop(b.br_if(1,b.i32_eq(b.getLocal("p"),b.getLocal("lastp"))),b.call(c+"_zero",b.getLocal("p")),b.setLocal("p",b.i32_add(b.getLocal("p"),b.i32_const(f))),b.br(0))))}(),function(){const d=e.addFunction(a+"_constructLC");d.addParam("ppolynomials","i32"),d.addParam("psignals","i32"),d.addParam("nSignals","i32"),d.addParam("pres","i32"),d.addLocal("i","i32"),d.addLocal("j","i32"),d.addLocal("pp","i32"),d.addLocal("ps","i32"),d.addLocal("pd","i32"),d.addLocal("ncoefs","i32");const b=d.getCodeBuilder(),t=b.i32_const(e.alloc(f));d.addCode(b.setLocal("i",b.i32_const(0)),b.setLocal("pp",b.getLocal("ppolynomials")),b.setLocal("ps",b.getLocal("psignals")),b.block(b.loop(b.br_if(1,b.i32_eq(b.getLocal("i"),b.getLocal("nSignals"))),b.setLocal("ncoefs",b.i32_load(b.getLocal("pp"))),b.setLocal("pp",b.i32_add(b.getLocal("pp"),b.i32_const(4))),b.setLocal("j",b.i32_const(0)),b.block(b.loop(b.br_if(1,b.i32_eq(b.getLocal("j"),b.getLocal("ncoefs"))),b.setLocal("pd",b.i32_add(b.getLocal("pres"),b.i32_mul(b.i32_load(b.getLocal("pp")),b.i32_const(f)))),b.setLocal("pp",b.i32_add(b.getLocal("pp"),b.i32_const(4))),b.call(c+"_mul",b.getLocal("ps"),b.getLocal("pp"),t),b.call(c+"_add",t,b.getLocal("pd"),b.getLocal("pd")),b.setLocal("pp",b.i32_add(b.getLocal("pp"),b.i32_const(f))),b.setLocal("j",b.i32_add(b.getLocal("j"),b.i32_const(1))),b.br(0))),b.setLocal("ps",b.i32_add(b.getLocal("ps"),b.i32_const(f))),b.setLocal("i",b.i32_add(b.getLocal("i"),b.i32_const(1))),b.br(0))))}(),e.exportFunction(a+"_zero"),e.exportFunction(a+"_constructLC"),a},Fe=function(e,a,c){const f=8*e.modules[c].n64;return function(){const d=e.addFunction(a+"_buildABC");d.addParam("pCoefs","i32"),d.addParam("nCoefs","i32"),d.addParam("pWitness","i32"),d.addParam("pA","i32"),d.addParam("pB","i32"),d.addParam("pC","i32"),d.addParam("offsetOut","i32"),d.addParam("nOut","i32"),d.addParam("offsetWitness","i32"),d.addParam("nWitness","i32"),d.addLocal("it","i32"),d.addLocal("ita","i32"),d.addLocal("itb","i32"),d.addLocal("last","i32"),d.addLocal("m","i32"),d.addLocal("c","i32"),d.addLocal("s","i32"),d.addLocal("pOut","i32");const b=d.getCodeBuilder(),t=b.i32_const(e.alloc(f));d.addCode(b.setLocal("ita",b.getLocal("pA")),b.setLocal("itb",b.getLocal("pB")),b.setLocal("last",b.i32_add(b.getLocal("pA"),b.i32_mul(b.getLocal("nOut"),b.i32_const(f)))),b.block(b.loop(b.br_if(1,b.i32_eq(b.getLocal("ita"),b.getLocal("last"))),b.call(c+"_zero",b.getLocal("ita")),b.call(c+"_zero",b.getLocal("itb")),b.setLocal("ita",b.i32_add(b.getLocal("ita"),b.i32_const(f))),b.setLocal("itb",b.i32_add(b.getLocal("itb"),b.i32_const(f))),b.br(0))),b.setLocal("it",b.getLocal("pCoefs")),b.setLocal("last",b.i32_add(b.getLocal("pCoefs"),b.i32_mul(b.getLocal("nCoefs"),b.i32_const(f+12)))),b.block(b.loop(b.br_if(1,b.i32_eq(b.getLocal("it"),b.getLocal("last"))),b.setLocal("s",b.i32_load(b.getLocal("it"),8)),b.if(b.i32_or(b.i32_lt_u(b.getLocal("s"),b.getLocal("offsetWitness")),b.i32_ge_u(b.getLocal("s"),b.i32_add(b.getLocal("offsetWitness"),b.getLocal("nWitness")))),[...b.setLocal("it",b.i32_add(b.getLocal("it"),b.i32_const(f+12))),...b.br(1)]),b.setLocal("m",b.i32_load(b.getLocal("it"))),b.if(b.i32_eq(b.getLocal("m"),b.i32_const(0)),b.setLocal("pOut",b.getLocal("pA")),b.if(b.i32_eq(b.getLocal("m"),b.i32_const(1)),b.setLocal("pOut",b.getLocal("pB")),[...b.setLocal("it",b.i32_add(b.getLocal("it"),b.i32_const(f+12))),...b.br(1)])),b.setLocal("c",b.i32_load(b.getLocal("it"),4)),b.if(b.i32_or(b.i32_lt_u(b.getLocal("c"),b.getLocal("offsetOut")),b.i32_ge_u(b.getLocal("c"),b.i32_add(b.getLocal("offsetOut"),b.getLocal("nOut")))),[...b.setLocal("it",b.i32_add(b.getLocal("it"),b.i32_const(f+12))),...b.br(1)]),b.setLocal("pOut",b.i32_add(b.getLocal("pOut"),b.i32_mul(b.i32_sub(b.getLocal("c"),b.getLocal("offsetOut")),b.i32_const(f)))),b.call(c+"_mul",b.i32_add(b.getLocal("pWitness"),b.i32_mul(b.i32_sub(b.getLocal("s"),b.getLocal("offsetWitness")),b.i32_const(f))),b.i32_add(b.getLocal("it"),b.i32_const(12)),t),b.call(c+"_add",b.getLocal("pOut"),t,b.getLocal("pOut")),b.setLocal("it",b.i32_add(b.getLocal("it"),b.i32_const(f+12))),b.br(0))),b.setLocal("ita",b.getLocal("pA")),b.setLocal("itb",b.getLocal("pB")),b.setLocal("it",b.getLocal("pC")),b.setLocal("last",b.i32_add(b.getLocal("pA"),b.i32_mul(b.getLocal("nOut"),b.i32_const(f)))),b.block(b.loop(b.br_if(1,b.i32_eq(b.getLocal("ita"),b.getLocal("last"))),b.call(c+"_mul",b.getLocal("ita"),b.getLocal("itb"),b.getLocal("it")),b.setLocal("ita",b.i32_add(b.getLocal("ita"),b.i32_const(f))),b.setLocal("itb",b.i32_add(b.getLocal("itb"),b.i32_const(f))),b.setLocal("it",b.i32_add(b.getLocal("it"),b.i32_const(f))),b.br(0))))}(),function(){const d=e.addFunction(a+"_joinABC");d.addParam("pA","i32"),d.addParam("pB","i32"),d.addParam("pC","i32"),d.addParam("n","i32"),d.addParam("pP","i32"),d.addLocal("ita","i32"),d.addLocal("itb","i32"),d.addLocal("itc","i32"),d.addLocal("itp","i32"),d.addLocal("last","i32");const b=d.getCodeBuilder(),t=b.i32_const(e.alloc(f));d.addCode(b.setLocal("ita",b.getLocal("pA")),b.setLocal("itb",b.getLocal("pB")),b.setLocal("itc",b.getLocal("pC")),b.setLocal("itp",b.getLocal("pP")),b.setLocal("last",b.i32_add(b.getLocal("pA"),b.i32_mul(b.getLocal("n"),b.i32_const(f)))),b.block(b.loop(b.br_if(1,b.i32_eq(b.getLocal("ita"),b.getLocal("last"))),b.call(c+"_mul",b.getLocal("ita"),b.getLocal("itb"),t),b.call(c+"_sub",t,b.getLocal("itc"),b.getLocal("itp")),b.setLocal("ita",b.i32_add(b.getLocal("ita"),b.i32_const(f))),b.setLocal("itb",b.i32_add(b.getLocal("itb"),b.i32_const(f))),b.setLocal("itc",b.i32_add(b.getLocal("itc"),b.i32_const(f))),b.setLocal("itp",b.i32_add(b.getLocal("itp"),b.i32_const(f))),b.br(0))))}(),function(){const d=e.addFunction(a+"_batchAdd");d.addParam("pa","i32"),d.addParam("pb","i32"),d.addParam("n","i32"),d.addParam("pr","i32"),d.addLocal("ita","i32"),d.addLocal("itb","i32"),d.addLocal("itr","i32"),d.addLocal("last","i32");const b=d.getCodeBuilder();d.addCode(b.setLocal("ita",b.getLocal("pa")),b.setLocal("itb",b.getLocal("pb")),b.setLocal("itr",b.getLocal("pr")),b.setLocal("last",b.i32_add(b.getLocal("pa"),b.i32_mul(b.getLocal("n"),b.i32_const(f)))),b.block(b.loop(b.br_if(1,b.i32_eq(b.getLocal("ita"),b.getLocal("last"))),b.call(c+"_add",b.getLocal("ita"),b.getLocal("itb"),b.getLocal("itr")),b.setLocal("ita",b.i32_add(b.getLocal("ita"),b.i32_const(f))),b.setLocal("itb",b.i32_add(b.getLocal("itb"),b.i32_const(f))),b.setLocal("itr",b.i32_add(b.getLocal("itr"),b.i32_const(f))),b.br(0))))}(),e.exportFunction(a+"_buildABC"),e.exportFunction(a+"_joinABC"),e.exportFunction(a+"_batchAdd"),a},Oe=function(e,a,c,f,d,b,t,i){const r=e.addFunction(a);r.addParam("pIn","i32"),r.addParam("n","i32"),r.addParam("pFirst","i32"),r.addParam("pInc","i32"),r.addParam("pOut","i32"),r.addLocal("pOldFree","i32"),r.addLocal("i","i32"),r.addLocal("pFrom","i32"),r.addLocal("pTo","i32");const n=r.getCodeBuilder(),o=n.i32_const(e.alloc(t));r.addCode(n.setLocal("pFrom",n.getLocal("pIn")),n.setLocal("pTo",n.getLocal("pOut"))),r.addCode(n.call(f+"_copy",n.getLocal("pFirst"),o)),r.addCode(n.setLocal("i",n.i32_const(0)),n.block(n.loop(n.br_if(1,n.i32_eq(n.getLocal("i"),n.getLocal("n"))),n.call(i,n.getLocal("pFrom"),o,n.getLocal("pTo")),n.setLocal("pFrom",n.i32_add(n.getLocal("pFrom"),n.i32_const(d))),n.setLocal("pTo",n.i32_add(n.getLocal("pTo"),n.i32_const(b))),n.call(f+"_mul",o,n.getLocal("pInc"),o),n.setLocal("i",n.i32_add(n.getLocal("i"),n.i32_const(1))),n.br(0)))),e.exportFunction(a)};const Pe=T,Re=se,Te=ue,Ue=me,je=ve,Ne=Le,qe=Ce,De=Be,ze=Fe,Qe=Oe,{bitLength:Ge,modInv:Ke,isOdd:He,isNegative:Ve}=q,Ze=T,We=se,Ye=ue,Je=me,$e=ve,Xe=Le,ea=Ce,aa=Be,ca=Fe,fa=Oe,{bitLength:da,isOdd:ba,isNegative:ta}=q;var ia=function(e,a){const c=a||"bn128";if(e.modules[c])return c;const f=21888242871839275222246405745257275088696311157297823662689037894645226208583n,d=21888242871839275222246405745257275088548364400416034343698204186575808495617n,b=Math.floor((Ge(f-1n)-1)/64)+1,t=8*b,i=t,r=t,n=2*r,o=12*r,s=e.alloc(Pe.bigInt2BytesLE(d,i)),l=Re(e,f,"f1m");Te(e,d,"fr","frm");const h=e.alloc(Pe.bigInt2BytesLE(y(3n),r)),u=Ne(e,"g1m","f1m",h);qe(e,"frm","frm","frm","frm_mul"),De(e,"pol","frm"),ze(e,"qap","frm");const x=Ue(e,"f1m_neg","f2m","f1m"),p=e.alloc([...Pe.bigInt2BytesLE(y(19485874751759354771024239261021720505790618469301721065564631296452457478373n),r),...Pe.bigInt2BytesLE(y(266929791119991161246907387137283842545076965332900288569378510910307636690n),r)]),g=Ne(e,"g2m","f2m",p);function m(a,c){const f=e.addFunction(a);f.addParam("pG","i32"),f.addParam("pFr","i32"),f.addParam("pr","i32");const d=f.getCodeBuilder(),b=d.i32_const(e.alloc(t));f.addCode(d.call("frm_fromMontgomery",d.getLocal("pFr"),b),d.call(c,d.getLocal("pG"),b,d.i32_const(t),d.getLocal("pr"))),e.exportFunction(a)}function y(e){return BigInt(e)*(1n<0n;)He(e)?a.push(1):a.push(0),e>>=1n;return a}(),T=e.alloc(R),U=3*n,j=R.length-1,N=R.reduce(((e,a)=>e+(0!=a?1:0)),0),q=6*t,D=3*t*2+(N+j+1)*U;function z(a){const d=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[8376118865763821496583973867626364092589906065868298776909617916018768340080n,16469823323077808223889137241176536799009286646108169935659301613961712198316n],[21888242871839275220042445260109153167277707414472061641714758635765020556617n,0n],[11697423496358154304825782922584725312912383441159505038794027105778954184319n,303847389135065887422783454877609941456349188919719272345083954437860409601n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[3321304630594332808241809054958361220322477375291206261884409189760185844239n,5722266937896532885780051958958348231143373700109372999374820235121374419868n],[21888242871839275222246405745257275088696311157297823662689037894645226208582n,0n],[13512124006075453725662431877630910996106405091429524885779419978626457868503n,5418419548761466998357268504080738289687024511189653727029736280683514010267n],[2203960485148121921418603742825762020974279258880205651966n,0n],[10190819375481120917420622822672549775783927716138318623895010788866272024264n,21584395482704209334823622290379665147239961968378104390343953940207365798982n],[2203960485148121921418603742825762020974279258880205651967n,0n],[18566938241244942414004596690298913868373833782006617400804628704885040364344n,16165975933942742336466353786298926857552937457188450663314217659523851788715n]]],b=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[21575463638280843010398324269430826099269044274347216827212613867836435027261n,10307601595873709700152284273816112264069230130616436755625194854815875713954n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[3772000881919853776433695186713858239009073593817195771773381919316419345261n,2236595495967245188281701248203181795121068902605861227855261137820944008926n],[2203960485148121921418603742825762020974279258880205651966n,0n],[18429021223477853657660792034369865839114504446431234726392080002137598044644n,9344045779998320333812420223237981029506012124075525679208581902008406485703n]],[[1n,0n],[2581911344467009335267311115468803099551665605076196740867805258568234346338n,19937756971775647987995932169929341994314640652964949448313374472400716661030n],[2203960485148121921418603742825762020974279258880205651966n,0n],[5324479202449903542726783395506214481928257762400643279780343368557297135718n,16208900380737693084919495127334387981393726419856888799917914180988844123039n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[13981852324922362344252311234282257507216387789820983642040889267519694726527n,7629828391165209371577384193250820201684255241773809077146787135900891633097n]]],t=e.addFunction(c+"__frobeniusMap"+a);t.addParam("x","i32"),t.addParam("r","i32");const i=t.getCodeBuilder();for(let c=0;c<6;c++){const f=0==c?i.getLocal("x"):i.i32_add(i.getLocal("x"),i.i32_const(c*n)),s=f,h=i.i32_add(i.getLocal("x"),i.i32_const(c*n+r)),u=0==c?i.getLocal("r"):i.i32_add(i.getLocal("r"),i.i32_const(c*n)),p=u,g=i.i32_add(i.getLocal("r"),i.i32_const(c*n+r)),m=o(d[Math.floor(c/3)][a%12],b[c%3][a%6]),_=e.alloc([...Pe.bigInt2BytesLE(y(m[0]),32),...Pe.bigInt2BytesLE(y(m[1]),32)]);a%2==1?t.addCode(i.call(l+"_copy",s,p),i.call(l+"_neg",h,g),i.call(x+"_mul",u,i.i32_const(_),u)):t.addCode(i.call(x+"_mul",f,i.i32_const(_),u))}function o(e,a){const c=BigInt(e[0]),d=BigInt(e[1]),b=BigInt(a[0]),t=BigInt(a[1]),i=[(c*b-d*t)%f,(c*t+d*b)%f];return Ve(i[0])&&(i[0]=i[0]+f),i}}function Q(){!function(){const a=e.addFunction(c+"__cyclotomicSquare");a.addParam("x","i32"),a.addParam("r","i32");const f=a.getCodeBuilder(),d=f.getLocal("x"),b=f.i32_add(f.getLocal("x"),f.i32_const(n)),t=f.i32_add(f.getLocal("x"),f.i32_const(2*n)),i=f.i32_add(f.getLocal("x"),f.i32_const(3*n)),r=f.i32_add(f.getLocal("x"),f.i32_const(4*n)),o=f.i32_add(f.getLocal("x"),f.i32_const(5*n)),s=f.getLocal("r"),l=f.i32_add(f.getLocal("r"),f.i32_const(n)),h=f.i32_add(f.getLocal("r"),f.i32_const(2*n)),u=f.i32_add(f.getLocal("r"),f.i32_const(3*n)),p=f.i32_add(f.getLocal("r"),f.i32_const(4*n)),g=f.i32_add(f.getLocal("r"),f.i32_const(5*n)),m=f.i32_const(e.alloc(n)),y=f.i32_const(e.alloc(n)),_=f.i32_const(e.alloc(n)),v=f.i32_const(e.alloc(n)),w=f.i32_const(e.alloc(n)),M=f.i32_const(e.alloc(n)),A=f.i32_const(e.alloc(n)),L=f.i32_const(e.alloc(n));a.addCode(f.call(x+"_mul",d,r,A),f.call(x+"_mul",r,f.i32_const(S),m),f.call(x+"_add",d,m,m),f.call(x+"_add",d,r,L),f.call(x+"_mul",L,m,m),f.call(x+"_mul",f.i32_const(S),A,L),f.call(x+"_add",A,L,L),f.call(x+"_sub",m,L,m),f.call(x+"_add",A,A,y),f.call(x+"_mul",i,t,A),f.call(x+"_mul",t,f.i32_const(S),_),f.call(x+"_add",i,_,_),f.call(x+"_add",i,t,L),f.call(x+"_mul",L,_,_),f.call(x+"_mul",f.i32_const(S),A,L),f.call(x+"_add",A,L,L),f.call(x+"_sub",_,L,_),f.call(x+"_add",A,A,v),f.call(x+"_mul",b,o,A),f.call(x+"_mul",o,f.i32_const(S),w),f.call(x+"_add",b,w,w),f.call(x+"_add",b,o,L),f.call(x+"_mul",L,w,w),f.call(x+"_mul",f.i32_const(S),A,L),f.call(x+"_add",A,L,L),f.call(x+"_sub",w,L,w),f.call(x+"_add",A,A,M),f.call(x+"_sub",m,d,s),f.call(x+"_add",s,s,s),f.call(x+"_add",m,s,s),f.call(x+"_add",y,r,p),f.call(x+"_add",p,p,p),f.call(x+"_add",y,p,p),f.call(x+"_mul",M,f.i32_const(B),L),f.call(x+"_add",L,i,u),f.call(x+"_add",u,u,u),f.call(x+"_add",L,u,u),f.call(x+"_sub",w,t,h),f.call(x+"_add",h,h,h),f.call(x+"_add",w,h,h),f.call(x+"_sub",_,b,l),f.call(x+"_add",l,l,l),f.call(x+"_add",_,l,l),f.call(x+"_add",v,o,g),f.call(x+"_add",g,g,g),f.call(x+"_add",v,g,g))}(),function(a,f){const d=function(e){let a=e;const c=[];for(;a>0n;){if(He(a)){const e=2-Number(a%4n);c.push(e),a-=BigInt(e)}else c.push(0);a>>=1n}return c}(a).map((e=>-1==e?255:e)),b=e.alloc(d),t=e.addFunction(c+"__cyclotomicExp_"+f);t.addParam("x","i32"),t.addParam("r","i32"),t.addLocal("bit","i32"),t.addLocal("i","i32");const i=t.getCodeBuilder(),r=i.getLocal("x"),n=i.getLocal("r"),s=i.i32_const(e.alloc(o));t.addCode(i.call(P+"_conjugate",r,s),i.call(P+"_one",n),i.if(i.teeLocal("bit",i.i32_load8_s(i.i32_const(d.length-1),b)),i.if(i.i32_eq(i.getLocal("bit"),i.i32_const(1)),i.call(P+"_mul",n,r,n),i.call(P+"_mul",n,s,n))),i.setLocal("i",i.i32_const(d.length-2)),i.block(i.loop(i.call(c+"__cyclotomicSquare",n,n),i.if(i.teeLocal("bit",i.i32_load8_s(i.getLocal("i"),b)),i.if(i.i32_eq(i.getLocal("bit"),i.i32_const(1)),i.call(P+"_mul",n,r,n),i.call(P+"_mul",n,s,n))),i.br_if(1,i.i32_eqz(i.getLocal("i"))),i.setLocal("i",i.i32_sub(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(4965661367192848881n,"w0");const a=e.addFunction(c+"__finalExponentiationLastChunk");a.addParam("x","i32"),a.addParam("r","i32");const f=a.getCodeBuilder(),d=f.getLocal("x"),b=f.getLocal("r"),t=f.i32_const(e.alloc(o)),i=f.i32_const(e.alloc(o)),r=f.i32_const(e.alloc(o)),s=f.i32_const(e.alloc(o)),l=f.i32_const(e.alloc(o)),h=f.i32_const(e.alloc(o)),u=f.i32_const(e.alloc(o)),p=f.i32_const(e.alloc(o)),g=f.i32_const(e.alloc(o)),m=f.i32_const(e.alloc(o)),y=f.i32_const(e.alloc(o)),_=f.i32_const(e.alloc(o)),v=f.i32_const(e.alloc(o)),w=f.i32_const(e.alloc(o)),M=f.i32_const(e.alloc(o)),A=f.i32_const(e.alloc(o)),L=f.i32_const(e.alloc(o)),I=f.i32_const(e.alloc(o)),k=f.i32_const(e.alloc(o)),E=f.i32_const(e.alloc(o)),C=f.i32_const(e.alloc(o));a.addCode(f.call(c+"__cyclotomicExp_w0",d,t),f.call(P+"_conjugate",t,t),f.call(c+"__cyclotomicSquare",t,i),f.call(c+"__cyclotomicSquare",i,r),f.call(P+"_mul",r,i,s),f.call(c+"__cyclotomicExp_w0",s,l),f.call(P+"_conjugate",l,l),f.call(c+"__cyclotomicSquare",l,h),f.call(c+"__cyclotomicExp_w0",h,u),f.call(P+"_conjugate",u,u),f.call(P+"_conjugate",s,p),f.call(P+"_conjugate",u,g),f.call(P+"_mul",g,l,m),f.call(P+"_mul",m,p,y),f.call(P+"_mul",y,i,_),f.call(P+"_mul",y,l,v),f.call(P+"_mul",v,d,w),f.call(c+"__frobeniusMap1",_,M),f.call(P+"_mul",M,w,A),f.call(c+"__frobeniusMap2",y,L),f.call(P+"_mul",L,A,I),f.call(P+"_conjugate",d,k),f.call(P+"_mul",k,_,E),f.call(c+"__frobeniusMap3",E,C),f.call(P+"_mul",C,I,b))}e.modules[c]={n64:b,pG1gen:v,pG1zero:M,pG1b:h,pG2gen:L,pG2zero:k,pG2b:p,pq:e.modules.f1m.pq,pr:s,pOneT:E,prePSize:q,preQSize:D,r:d.toString(),q:f.toString()};const G=e.alloc(q),K=e.alloc(D);function H(a){const f=e.addFunction(c+"_pairingEq"+a);for(let e=0;e0n;)ba(e)?a.push(1):a.push(0),e>>=1n;return a}(),R=e.alloc(P),T=3*r,U=P.length-1,j=P.reduce(((e,a)=>e+(0!=a?1:0)),0),N=6*t,q=3*t*2+(j+U+1)*T,D=15132376222941642752n;function z(a){const c=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[3850754370037169011952147076051364057158807420970682438676050522613628423219637725072182697113062777891589506424760n,151655185184498381465642749684540099398075398968325446656007613510403227271200139370504932015952886146304766135027n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620351n,0n],[2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530n,1028732146235106349975324479215795277384839936929757896155643118032610843298655225875571310552543014690878354869257n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[3125332594171059424908108096204648978570118281977575435832422631601824034463382777937621250592425535493320683825557n,877076961050607968509681729531255177986764537961432449499635504522207616027455086505066378536590128544573588734230n],[4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559786n,0n],[151655185184498381465642749684540099398075398968325446656007613510403227271200139370504932015952886146304766135027n,3850754370037169011952147076051364057158807420970682438676050522613628423219637725072182697113062777891589506424760n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[1028732146235106349975324479215795277384839936929757896155643118032610843298655225875571310552543014690878354869257n,2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939437n,0n],[877076961050607968509681729531255177986764537961432449499635504522207616027455086505066378536590128544573588734230n,3125332594171059424908108096204648978570118281977575435832422631601824034463382777937621250592425535493320683825557n]]],d=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[0n,4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[0n,1n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[0n,793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n]],[[1n,0n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939437n,0n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559786n,0n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620351n,0n]]],b=e.addFunction(O+"_frobeniusMap"+a);b.addParam("x","i32"),b.addParam("r","i32");const n=b.getCodeBuilder();for(let f=0;f<6;f++){const s=0==f?n.getLocal("x"):n.i32_add(n.getLocal("x"),n.i32_const(f*r)),l=s,h=n.i32_add(n.getLocal("x"),n.i32_const(f*r+i)),x=0==f?n.getLocal("r"):n.i32_add(n.getLocal("r"),n.i32_const(f*r)),p=x,m=n.i32_add(n.getLocal("r"),n.i32_const(f*r+i)),y=o(c[Math.floor(f/3)][a%12],d[f%3][a%6]),_=e.alloc([...Ze.bigInt2BytesLE(v(y[0]),t),...Ze.bigInt2BytesLE(v(y[1]),t)]);a%2==1?b.addCode(n.call(u+"_copy",l,p),n.call(u+"_neg",h,m),n.call(g+"_mul",x,n.i32_const(_),x)):b.addCode(n.call(g+"_mul",s,n.i32_const(_),x))}function o(e,a){const c=e[0],d=e[1],b=a[0],t=a[1],i=[(c*b-d*t)%f,(c*t+d*b)%f];return ta(i[0])&&(i[0]=i[0]+f),i}}e.modules[c]={n64q:b,n64r:o,n8q:t,n8r:s,pG1gen:M,pG1zero:L,pG1b:x,pG2gen:k,pG2zero:S,pG2b:m,pq:e.modules.f1m.pq,pr:h,pOneT:C,r:d,q:f,prePSize:N,preQSize:q},function(){const a=e.addFunction(F+"_mul1");a.addParam("pA","i32"),a.addParam("pC1","i32"),a.addParam("pR","i32");const c=a.getCodeBuilder(),f=c.getLocal("pA"),d=c.i32_add(c.getLocal("pA"),c.i32_const(2*i)),b=c.i32_add(c.getLocal("pA"),c.i32_const(4*i)),t=c.getLocal("pC1"),r=c.getLocal("pR"),n=c.i32_add(c.getLocal("pR"),c.i32_const(2*i)),o=c.i32_add(c.getLocal("pR"),c.i32_const(4*i)),s=c.i32_const(e.alloc(2*i)),l=c.i32_const(e.alloc(2*i));a.addCode(c.call(g+"_add",f,d,s),c.call(g+"_add",d,b,l),c.call(g+"_mul",d,t,o),c.call(g+"_mul",l,t,r),c.call(g+"_sub",r,o,r),c.call(g+"_mulNR",r,r),c.call(g+"_mul",s,t,n),c.call(g+"_sub",n,o,n))}(),function(){const a=e.addFunction(F+"_mul01");a.addParam("pA","i32"),a.addParam("pC0","i32"),a.addParam("pC1","i32"),a.addParam("pR","i32");const c=a.getCodeBuilder(),f=c.getLocal("pA"),d=c.i32_add(c.getLocal("pA"),c.i32_const(2*i)),b=c.i32_add(c.getLocal("pA"),c.i32_const(4*i)),t=c.getLocal("pC0"),r=c.getLocal("pC1"),n=c.getLocal("pR"),o=c.i32_add(c.getLocal("pR"),c.i32_const(2*i)),s=c.i32_add(c.getLocal("pR"),c.i32_const(4*i)),l=c.i32_const(e.alloc(2*i)),h=c.i32_const(e.alloc(2*i)),u=c.i32_const(e.alloc(2*i)),x=c.i32_const(e.alloc(2*i));a.addCode(c.call(g+"_mul",f,t,l),c.call(g+"_mul",d,r,h),c.call(g+"_add",f,d,u),c.call(g+"_add",f,b,x),c.call(g+"_add",d,b,n),c.call(g+"_mul",n,r,n),c.call(g+"_sub",n,h,n),c.call(g+"_mulNR",n,n),c.call(g+"_add",n,l,n),c.call(g+"_add",t,r,o),c.call(g+"_mul",o,u,o),c.call(g+"_sub",o,l,o),c.call(g+"_sub",o,h,o),c.call(g+"_mul",x,t,s),c.call(g+"_sub",s,l,s),c.call(g+"_add",s,h,s))}(),function(){const a=e.addFunction(O+"_mul014");a.addParam("pA","i32"),a.addParam("pC0","i32"),a.addParam("pC1","i32"),a.addParam("pC4","i32"),a.addParam("pR","i32");const c=a.getCodeBuilder(),f=c.getLocal("pA"),d=c.i32_add(c.getLocal("pA"),c.i32_const(6*i)),b=c.getLocal("pC0"),t=c.getLocal("pC1"),r=c.getLocal("pC4"),n=c.i32_const(e.alloc(6*i)),o=c.i32_const(e.alloc(6*i)),s=c.i32_const(e.alloc(2*i)),l=c.getLocal("pR"),h=c.i32_add(c.getLocal("pR"),c.i32_const(6*i));a.addCode(c.call(F+"_mul01",f,b,t,n),c.call(F+"_mul1",d,r,o),c.call(g+"_add",t,r,s),c.call(F+"_add",d,f,h),c.call(F+"_mul01",h,b,s,h),c.call(F+"_sub",h,n,h),c.call(F+"_sub",h,o,h),c.call(F+"_copy",o,l),c.call(F+"_mulNR",l,l),c.call(F+"_add",l,n,l))}(),function(){const a=e.addFunction(c+"_ell");a.addParam("pP","i32"),a.addParam("pCoefs","i32"),a.addParam("pF","i32");const f=a.getCodeBuilder(),d=f.getLocal("pP"),b=f.i32_add(f.getLocal("pP"),f.i32_const(t)),r=f.getLocal("pF"),n=f.getLocal("pCoefs"),o=f.i32_add(f.getLocal("pCoefs"),f.i32_const(i)),s=f.i32_add(f.getLocal("pCoefs"),f.i32_const(2*i)),l=f.i32_add(f.getLocal("pCoefs"),f.i32_const(3*i)),h=f.i32_add(f.getLocal("pCoefs"),f.i32_const(4*i)),x=e.alloc(2*i),p=f.i32_const(x),g=f.i32_const(x),m=f.i32_const(x+i),y=e.alloc(2*i),_=f.i32_const(y),v=f.i32_const(y),w=f.i32_const(y+i);a.addCode(f.call(u+"_mul",n,b,g),f.call(u+"_mul",o,b,m),f.call(u+"_mul",s,d,v),f.call(u+"_mul",l,d,w),f.call(O+"_mul014",r,h,_,p,r))}();const Q=e.alloc(N),G=e.alloc(q);function K(a){const f=e.addFunction(c+"_pairingEq"+a);for(let e=0;e0n;){if(ba(a)){const e=2-Number(a%4n);c.push(e),a-=BigInt(e)}else c.push(0);a>>=1n}return c}(a).map((e=>-1==e?255:e)),t=e.alloc(b),i=e.addFunction(c+"__cyclotomicExp_"+d);i.addParam("x","i32"),i.addParam("r","i32"),i.addLocal("bit","i32"),i.addLocal("i","i32");const r=i.getCodeBuilder(),o=r.getLocal("x"),s=r.getLocal("r"),l=r.i32_const(e.alloc(n));i.addCode(r.call(O+"_conjugate",o,l),r.call(O+"_one",s),r.if(r.teeLocal("bit",r.i32_load8_s(r.i32_const(b.length-1),t)),r.if(r.i32_eq(r.getLocal("bit"),r.i32_const(1)),r.call(O+"_mul",s,o,s),r.call(O+"_mul",s,l,s))),r.setLocal("i",r.i32_const(b.length-2)),r.block(r.loop(r.call(c+"__cyclotomicSquare",s,s),r.if(r.teeLocal("bit",r.i32_load8_s(r.getLocal("i"),t)),r.if(r.i32_eq(r.getLocal("bit"),r.i32_const(1)),r.call(O+"_mul",s,o,s),r.call(O+"_mul",s,l,s))),r.br_if(1,r.i32_eqz(r.getLocal("i"))),r.setLocal("i",r.i32_sub(r.getLocal("i"),r.i32_const(1))),r.br(0)))),f&&i.addCode(r.call(O+"_conjugate",s,s))}(D,!0,"w0");const a=e.addFunction(c+"_finalExponentiation");a.addParam("x","i32"),a.addParam("r","i32");const f=a.getCodeBuilder(),d=f.getLocal("x"),b=f.getLocal("r"),t=f.i32_const(e.alloc(n)),i=f.i32_const(e.alloc(n)),o=f.i32_const(e.alloc(n)),s=f.i32_const(e.alloc(n)),l=f.i32_const(e.alloc(n)),h=f.i32_const(e.alloc(n)),u=f.i32_const(e.alloc(n));a.addCode(f.call(O+"_frobeniusMap6",d,t),f.call(O+"_inverse",d,i),f.call(O+"_mul",t,i,o),f.call(O+"_copy",o,i),f.call(O+"_frobeniusMap2",o,o),f.call(O+"_mul",o,i,o),f.call(c+"__cyclotomicSquare",o,i),f.call(O+"_conjugate",i,i),f.call(c+"__cyclotomicExp_w0",o,s),f.call(c+"__cyclotomicSquare",s,l),f.call(O+"_mul",i,s,h),f.call(c+"__cyclotomicExp_w0",h,i),f.call(c+"__cyclotomicExp_w0",i,t),f.call(c+"__cyclotomicExp_w0",t,u),f.call(O+"_mul",u,l,u),f.call(c+"__cyclotomicExp_w0",u,l),f.call(O+"_conjugate",h,h),f.call(O+"_mul",l,h,l),f.call(O+"_mul",l,o,l),f.call(O+"_conjugate",o,h),f.call(O+"_mul",i,o,i),f.call(O+"_frobeniusMap3",i,i),f.call(O+"_mul",u,h,u),f.call(O+"_frobeniusMap1",u,u),f.call(O+"_mul",s,t,s),f.call(O+"_frobeniusMap2",s,s),f.call(O+"_mul",s,i,s),f.call(O+"_mul",s,u,s),f.call(O+"_mul",s,l,b))}();for(let a=1;a<=5;a++)K(a),e.exportFunction(c+"_pairingEq"+a);!function(){const a=e.addFunction(c+"_pairing");a.addParam("p","i32"),a.addParam("q","i32"),a.addParam("r","i32");const f=a.getCodeBuilder(),d=f.i32_const(e.alloc(n));a.addCode(f.call(c+"_prepareG1",f.getLocal("p"),f.i32_const(Q))),a.addCode(f.call(c+"_prepareG2",f.getLocal("q"),f.i32_const(G))),a.addCode(f.call(c+"_millerLoop",f.i32_const(Q),f.i32_const(G),d)),a.addCode(f.call(c+"_finalExponentiation",d,f.getLocal("r")))}(),e.exportFunction(c+"_pairing"),e.exportFunction(c+"_prepareG1"),e.exportFunction(c+"_prepareG2"),e.exportFunction(c+"_millerLoop"),e.exportFunction(c+"_finalExponentiation"),e.exportFunction(c+"_finalExponentiationOld"),e.exportFunction(c+"__cyclotomicSquare"),e.exportFunction(c+"__cyclotomicExp_w0"),e.exportFunction(F+"_mul1"),e.exportFunction(F+"_mul01"),e.exportFunction(O+"_mul014"),e.exportFunction(p+"_inGroupAffine"),e.exportFunction(p+"_inGroup"),e.exportFunction(y+"_inGroupAffine"),e.exportFunction(y+"_inGroup")};function na(e,a){let c=e;void 0===a&&0==(a=Math.floor((t(e)-1)/8)+1)&&(a=1);const f=new Uint8Array(a),d=new DataView(f.buffer);let b=0;for(;b>=BigInt(32)):b+2<=a?(d.setUint16(b,Number(c&BigInt(65535)),!0),b+=2,c>>=BigInt(16)):(d.setUint8(b,Number(c&BigInt(255)),!0),b+=1,c>>=BigInt(8));if(c)throw new Error("Number does not fit in this length");return f}const oa=[];for(let e=0;e<256;e++)oa[e]=sa(e,8);function sa(e,a){let c=0,f=e;for(let e=0;e>=1;return c}function la(e,a){return(oa[e>>>24]|oa[e>>>16&255]<<8|oa[e>>>8&255]<<16|oa[255&e]<<24)>>>32-a}function ha(e){return(4294901760&e?(e&=4294901760,16):0)|(4278255360&e?(e&=4278255360,8):0)|(4042322160&e?(e&=4042322160,4):0)|(3435973836&e?(e&=3435973836,2):0)|!!(2863311530&e)}function ua(e,a){const c=e.byteLength/a,f=ha(c);if(c!=1<c){const f=e.slice(d*a,(d+1)*a);e.set(e.slice(c*a,(c+1)*a),d*a),e.set(f,c*a)}}}function xa(e,a){const c=new Uint8Array(a*e.length);for(let f=0;f0;)c>=4?(c-=4,a+=BigInt(d.getUint32(c))<=2?(c-=2,a+=BigInt(d.getUint16(c))<0;)b-4>=0?(b-=4,d.setUint32(b,Number(c&BigInt(4294967295))),c>>=BigInt(32)):b-2>=0?(b-=2,d.setUint16(b,Number(c&BigInt(65535))),c>>=BigInt(16)):(b-=1,d.setUint8(b,Number(c&BigInt(255))),c>>=BigInt(8));if(c)throw new Error("Number does not fit in this length");return f},bitReverse:la,buffReverseBits:ua,buffer2array:pa,leBuff2int:function(e){let a=BigInt(0),c=0;const f=new DataView(e.buffer,e.byteOffset,e.byteLength);for(;c{c[f]=e(a[f])})),c}return a},stringifyFElements:function e(a,c){if("bigint"==typeof c||void 0!==c.eq)return c.toString(10);if(c instanceof Uint8Array)return a.toString(a.e(c));if(Array.isArray(c))return c.map(e.bind(this,a));if("object"==typeof c){const f={};return Object.keys(c).forEach((d=>{f[d]=e(a,c[d])})),f}return c},unstringifyBigInts:function e(a){if("string"==typeof a&&/^[0-9]+$/.test(a))return BigInt(a);if("string"==typeof a&&/^0x[0-9a-fA-F]+$/.test(a))return BigInt(a);if(Array.isArray(a))return a.map(e);if("object"==typeof a){if(null===a)return null;const c={};return Object.keys(a).forEach((f=>{c[f]=e(a[f])})),c}return a},unstringifyFElements:function e(a,c){if("string"==typeof c&&/^[0-9]+$/.test(c))return a.e(c);if("string"==typeof c&&/^0x[0-9a-fA-F]+$/.test(c))return a.e(c);if(Array.isArray(c))return c.map(e.bind(this,a));if("object"==typeof c){if(null===c)return null;const f={};return Object.keys(c).forEach((d=>{f[d]=e(a,c[d])})),f}return c}});const ma=1<<30;class ya{constructor(e){this.buffers=[],this.byteLength=e;for(let a=0;a0;){const e=t+i>ma?ma-t:i,a=new Uint8Array(this.buffers[b].buffer,this.buffers[b].byteOffset+t,e);if(e==c)return a.slice();d||(d=c<=ma?new Uint8Array(c):new ya(c)),d.set(a,c-i),i-=e,b++,t=0}return d}set(e,a){void 0===a&&(a=0);const c=e.byteLength;if(0==c)return;const f=Math.floor(a/ma);if(f==Math.floor((a+c-1)/ma))return e instanceof ya&&1==e.buffers.length?this.buffers[f].set(e.buffers[0],a%ma):this.buffers[f].set(e,a%ma);let d=f,b=a%ma,t=c;for(;t>0;){const a=b+t>ma?ma-b:t,f=e.slice(c-t,c-t+a);new Uint8Array(this.buffers[d].buffer,this.buffers[d].byteOffset+b,a).set(f),t-=a,d++,b=0}}}function _a(e,a,c,f){return async function(d){const b=Math.floor(d.byteLength/c);if(b*c!==d.byteLength)throw new Error("Invalid buffer size");const t=Math.floor(b/e.concurrency),i=[];for(let r=0;r=0;e--)this.w[e]=this.square(this.w[e+1]);if(!this.eq(this.w[0],this.one))throw new Error("Error calculating roots of unity");this.batchToMontgomery=_a(e,a+"_batchToMontgomery",this.n8,this.n8),this.batchFromMontgomery=_a(e,a+"_batchFromMontgomery",this.n8,this.n8)}op2(e,a,c){return this.tm.setBuff(this.pOp1,a),this.tm.setBuff(this.pOp2,c),this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op2Bool(e,a,c){return this.tm.setBuff(this.pOp1,a),this.tm.setBuff(this.pOp2,c),!!this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp2)}op1(e,a){return this.tm.setBuff(this.pOp1,a),this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op1Bool(e,a){return this.tm.setBuff(this.pOp1,a),!!this.tm.instance.exports[this.prefix+e](this.pOp1,this.pOp3)}add(e,a){return this.op2("_add",e,a)}eq(e,a){return this.op2Bool("_eq",e,a)}isZero(e){return this.op1Bool("_isZero",e)}sub(e,a){return this.op2("_sub",e,a)}neg(e){return this.op1("_neg",e)}inv(e){return this.op1("_inverse",e)}toMontgomery(e){return this.op1("_toMontgomery",e)}fromMontgomery(e){return this.op1("_fromMontgomery",e)}mul(e,a){return this.op2("_mul",e,a)}div(e,a){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,a),this.tm.instance.exports[this.prefix+"_inverse"](this.pOp2,this.pOp2),this.tm.instance.exports[this.prefix+"_mul"](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}square(e){return this.op1("_square",e)}isSquare(e){return this.op1Bool("_isSquare",e)}sqrt(e){return this.op1("_sqrt",e)}exp(e,a){return a instanceof Uint8Array||(a=L(b(a))),this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,a),this.tm.instance.exports[this.prefix+"_exp"](this.pOp1,this.pOp2,a.byteLength,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}isNegative(e){return this.op1Bool("_isNegative",e)}e(e,a){if(e instanceof Uint8Array)return e;let c=b(e,a);i(c)?(c=p(c),y(c,this.p)&&(c=m(c,this.p)),c=x(this.p,c)):y(c,this.p)&&(c=m(c,this.p));const f=na(c,this.n8);return this.toMontgomery(f)}toString(e,a){return A(M(this.fromMontgomery(e),0),a)}fromRng(e){let a;const c=new Uint8Array(this.n8);do{a=I;for(let c=0;c{this.reject=a,this.resolve=e}))}}const ka="data:application/javascript;base64,"+globalThis.btoa('(function thread(self) {\n const MAXMEM = 32767;\n let instance;\n let memory;\n\n if (self) {\n self.onmessage = function(e) {\n let data;\n if (e.data) {\n data = e.data;\n } else {\n data = e;\n }\n\n if (data[0].cmd == "INIT") {\n init(data[0]).then(function() {\n self.postMessage(data.result);\n });\n } else if (data[0].cmd == "TERMINATE") {\n self.close();\n } else {\n const res = runTask(data);\n self.postMessage(res);\n }\n };\n }\n\n async function init(data) {\n const code = new Uint8Array(data.code);\n const wasmModule = await WebAssembly.compile(code);\n memory = new WebAssembly.Memory({initial:data.init, maximum: MAXMEM});\n\n instance = await WebAssembly.instantiate(wasmModule, {\n env: {\n "memory": memory\n }\n });\n }\n\n\n\n function alloc(length) {\n const u32 = new Uint32Array(memory.buffer, 0, 1);\n while (u32[0] & 3) u32[0]++; // Return always aligned pointers\n const res = u32[0];\n u32[0] += length;\n if (u32[0] + length > memory.buffer.byteLength) {\n const currentPages = memory.buffer.byteLength / 0x10000;\n let requiredPages = Math.floor((u32[0] + length) / 0x10000)+1;\n if (requiredPages>MAXMEM) requiredPages=MAXMEM;\n memory.grow(requiredPages-currentPages);\n }\n return res;\n }\n\n function allocBuffer(buffer) {\n const p = alloc(buffer.byteLength);\n setBuffer(p, buffer);\n return p;\n }\n\n function getBuffer(pointer, length) {\n const u8 = new Uint8Array(memory.buffer);\n return new Uint8Array(u8.buffer, u8.byteOffset + pointer, length);\n }\n\n function setBuffer(pointer, buffer) {\n const u8 = new Uint8Array(memory.buffer);\n u8.set(new Uint8Array(buffer), pointer);\n }\n\n function runTask(task) {\n if (task[0].cmd == "INIT") {\n return init(task[0]);\n }\n const ctx = {\n vars: [],\n out: []\n };\n const u32a = new Uint32Array(memory.buffer, 0, 1);\n const oldAlloc = u32a[0];\n for (let i=0; i0;e++)if(0==this.working[e]){const a=this.actionQueue.shift();this.postAction(e,a.data,a.transfers,a.deferred)}}queueAction(e,a){const c=new Ia;if(this.singleThread){const a=this.taskManager(e);c.resolve(a)}else this.actionQueue.push({data:e,transfers:a,deferred:c}),this.processWorks();return c.promise}resetMemory(){this.u32[0]=this.initalPFree}allocBuff(e){const a=this.alloc(e.byteLength);return this.setBuff(a,e),a}getBuff(e,a){return this.u8.slice(e,e+a)}setBuff(e,a){this.u8.set(new Uint8Array(a),e)}alloc(e){for(;3&this.u32[0];)this.u32[0]++;const a=this.u32[0];return this.u32[0]+=e,a}async terminate(){for(let e=0;esetTimeout(e,200)))}}function Sa(e,a){const c=e[a],f=e.Fr,d=e.tm;e[a].batchApplyKey=async function(e,b,t,i,r){let n,o,s,l,h;if(i=i||"affine",r=r||"affine","G1"==a)"jacobian"==i?(s=3*c.F.n8,n="g1m_batchApplyKey"):(s=2*c.F.n8,n="g1m_batchApplyKeyMixed"),l=3*c.F.n8,"jacobian"==r?h=3*c.F.n8:(o="g1m_batchToAffine",h=2*c.F.n8);else if("G2"==a)"jacobian"==i?(s=3*c.F.n8,n="g2m_batchApplyKey"):(s=2*c.F.n8,n="g2m_batchApplyKeyMixed"),l=3*c.F.n8,"jacobian"==r?h=3*c.F.n8:(o="g2m_batchToAffine",h=2*c.F.n8);else{if("Fr"!=a)throw new Error("Invalid group: "+a);n="frm_batchApplyKey",s=c.n8,l=c.n8,h=c.n8}const u=Math.floor(e.byteLength/s),x=Math.floor(u/d.concurrency),p=[];t=f.e(t);let g=f.e(b);for(let a=0;a=0;e--){if(!c.isZero(x))for(let e=0;en&&(x=n),x<1024&&(x=1024);const p=[];for(let a=0;a(i&&i.debug(`Multiexp end: ${r}: ${a}/${s}`),e))))}const g=await Promise.all(p);let m=c.zero;for(let e=g.length-1;e>=0;e--)m=c.add(m,g[e]);return m}c.multiExp=async function(e,a,c,f){return await b(e,a,"jacobian",c,f)},c.multiExpAffine=async function(e,a,c,f){return await b(e,a,"affine",c,f)}}function Fa(e,a){const c=e[a],f=e.Fr,d=c.tm;async function b(e,i,r,n,o,s){let l,h,u,x,p,g,m,y;r=r||"affine",n=n||"affine","G1"==a?("affine"==r?(l=2*c.F.n8,x="g1m_batchToJacobian"):l=3*c.F.n8,h=3*c.F.n8,i&&(y="g1m_fftFinal"),m="g1m_fftJoin",g="g1m_fftMix","affine"==n?(u=2*c.F.n8,p="g1m_batchToAffine"):u=3*c.F.n8):"G2"==a?("affine"==r?(l=2*c.F.n8,x="g2m_batchToJacobian"):l=3*c.F.n8,h=3*c.F.n8,i&&(y="g2m_fftFinal"),m="g2m_fftJoin",g="g2m_fftMix","affine"==n?(u=2*c.F.n8,p="g2m_batchToAffine"):u=3*c.F.n8):"Fr"==a&&(l=c.n8,h=c.n8,u=c.n8,i&&(y="frm_fftFinal"),g="frm_fftMix",m="frm_fftJoin");let _=!1;Array.isArray(e)?(e=xa(e,l),_=!0):e=e.slice(0,e.byteLength);const v=e.byteLength/l,w=ha(v);if(1<1<<28?new ya(2*s[0].byteLength):new Uint8Array(2*s[0].byteLength),l.set(s[0]),l.set(s[1],s[0].byteLength),l}(e,r,n,o,s):await async function(e,a,c,d,i){let r,n;r=e.slice(0,e.byteLength/2),n=e.slice(e.byteLength/2,e.byteLength);const o=[];[r,n]=await t(r,n,"fftJoinExt",f.one,f.shift,a,"jacobian",d,i),o.push(b(r,!1,"jacobian",c,d,i)),o.push(b(n,!1,"jacobian",c,d,i));const s=await Promise.all(o);let l;return l=s[0].byteLength>1<<28?new ya(2*s[0].byteLength):new Uint8Array(2*s[0].byteLength),l.set(s[0]),l.set(s[1],s[0].byteLength),l}(e,r,n,o,s),_?pa(a,u):a}let M,A,L;i&&(M=f.inv(f.e(v))),ua(e,l);let I=Math.min(16384,v),k=v/I;for(;k=16;)k*=2,I/=2;const E=ha(I),S=[];for(let a=0;a(o&&o.debug(`${s}: fft ${w} mix end: ${a}/${k}`),e))))}L=await Promise.all(S);for(let e=0;e(o&&o.debug(`${s}: fft ${w} join ${e}/${w} ${t+1}/${a} ${i}/${c/2}`),f))))}const t=await Promise.all(b);for(let e=0;e0;a--)A.set(L[a],e),e+=I*u,delete L[a];A.set(L[0].slice(0,(I-1)*u),e),delete L[0]}else for(let e=0;e65536&&(_=65536);const v=[];for(let a=0;a(s&&s.debug(`${l}: fftJoinExt End: ${a}/${y}`),e))))}const w=await Promise.all(v);let M,A;y*p>1<<28?(M=new ya(y*p),A=new ya(y*p)):(M=new Uint8Array(y*p),A=new Uint8Array(y*p));let L=0;for(let e=0;ef.s+1)throw r&&r.error("lagrangeEvaluations input too big"),new Error("lagrangeEvaluations input too big");let h=e.slice(0,e.byteLength/2),u=e.slice(e.byteLength/2,e.byteLength);const x=f.exp(f.shift,s/2),p=f.inv(f.sub(f.one,x));[h,u]=await t(h,u,"prepareLagrangeEvaluation",p,f.shiftInv,d,"jacobian",r,n+" prep");const g=[];let m;return g.push(b(h,!0,"jacobian",i,r,n+" t0")),g.push(b(u,!0,"jacobian",i,r,n+" t1")),[h,u]=await Promise.all(g),m=h.byteLength>1<<28?new ya(2*h.byteLength):new Uint8Array(2*h.byteLength),m.set(h),m.set(u,h.byteLength),m},c.fftMix=async function(e){const b=3*c.F.n8;let t,i;if("G1"==a)t="g1m_fftMix",i="g1m_fftJoin";else if("G2"==a)t="g2m_fftMix",i="g2m_fftJoin";else{if("Fr"!=a)throw new Error("Invalid group");t="frm_fftMix",i="frm_fftJoin"}const r=Math.floor(e.byteLength/b),n=ha(r);let o=1<=0;e--)h.set(l[e][0],u),u+=l[e][0].byteLength;return h}}async function Oa(e){const a=await async function(e,a){const c=new Ea;c.memory=new WebAssembly.Memory({initial:25}),c.u8=new Uint8Array(c.memory.buffer),c.u32=new Uint32Array(c.memory.buffer);const f=await WebAssembly.compile(e.code);if(c.instance=await WebAssembly.instantiate(f,{env:{memory:c.memory}}),c.singleThread=a,c.initalPFree=c.u32[0],c.pq=e.pq,c.pr=e.pr,c.pG1gen=e.pG1gen,c.pG1zero=e.pG1zero,c.pG2gen=e.pG2gen,c.pG2zero=e.pG2zero,c.pOneT=e.pOneT,a)c.code=e.code,c.taskManager=function(){const e=32767;let a,c;async function f(f){const d=new Uint8Array(f.code),b=await WebAssembly.compile(d);c=new WebAssembly.Memory({initial:f.init,maximum:e}),a=await WebAssembly.instantiate(b,{env:{memory:c}})}function d(a){const f=new Uint32Array(c.buffer,0,1);for(;3&f[0];)f[0]++;const d=f[0];if(f[0]+=a,f[0]+a>c.buffer.byteLength){const d=c.buffer.byteLength/65536;let b=Math.floor((f[0]+a)/65536)+1;b>e&&(b=e),c.grow(b-d)}return d}function b(e){const a=d(e.byteLength);return i(a,e),a}function t(e,a){const f=new Uint8Array(c.buffer);return new Uint8Array(f.buffer,f.byteOffset+e,a)}function i(e,a){new Uint8Array(c.buffer).set(new Uint8Array(a),e)}function r(e){if("INIT"==e[0].cmd)return f(e[0]);const r={vars:[],out:[]},n=new Uint32Array(c.buffer,0,1)[0];for(let c=0;c64&&(a=64),c.concurrency=a;for(let e=0;e>8n&0xFFn)),a.push(Number(c>>16n&0xFFn)),a.push(Number(c>>24n&0xFFn)),a}function ja(e){const a=function(e){for(var a=[],c=0;c>6,128|63&f):f<55296||f>=57344?a.push(224|f>>12,128|f>>6&63,128|63&f):(c++,f=65536+((1023&f)<<10|1023&e.charCodeAt(c)),a.push(240|f>>18,128|f>>12&63,128|f>>6&63,128|63&f))}return a}(e);return[...Qa(a.length),...a]}function Na(e){const a=[];let c=Pa(e);if(Ra(c))throw new Error("Number cannot be negative");for(;!Ta(c);)a.push(Number(0x7Fn&c)),c>>=7n;0==a.length&&a.push(0);for(let e=0;e0xFFFFFFFFn)throw new Error("Number too big");if(a>0x7FFFFFFFn&&(a-=0x100000000n),a<-2147483648n)throw new Error("Number too small");return qa(a)}function za(e){let a=Pa(e);if(a>0xFFFFFFFFFFFFFFFFn)throw new Error("Number too big");if(a>0x7FFFFFFFFFFFFFFFn&&(a-=0x10000000000000000n),a<-9223372036854775808n)throw new Error("Number too small");return qa(a)}function Qa(e){let a=Pa(e);if(a>0xFFFFFFFFn)throw new Error("Number too big");return Na(a)}function Ga(e){return Array.from(e,(function(e){return("0"+(255&e).toString(16)).slice(-2)})).join("")}class Ka{constructor(e){this.func=e,this.functionName=e.functionName,this.module=e.module}setLocal(e,a){const c=this.func.localIdxByName[e];if(void 0===c)throw new Error(`Local Variable not defined: Function: ${this.functionName} local: ${e} `);return[...a,33,...Qa(c)]}teeLocal(e,a){const c=this.func.localIdxByName[e];if(void 0===c)throw new Error(`Local Variable not defined: Function: ${this.functionName} local: ${e} `);return[...a,34,...Qa(c)]}getLocal(e){const a=this.func.localIdxByName[e];if(void 0===a)throw new Error(`Local Variable not defined: Function: ${this.functionName} local: ${e} `);return[32,...Qa(a)]}i64_load8_s(e,a,c){return[...e,48,void 0===c?0:c,...Qa(a||0)]}i64_load8_u(e,a,c){return[...e,49,void 0===c?0:c,...Qa(a||0)]}i64_load16_s(e,a,c){return[...e,50,void 0===c?1:c,...Qa(a||0)]}i64_load16_u(e,a,c){return[...e,51,void 0===c?1:c,...Qa(a||0)]}i64_load32_s(e,a,c){return[...e,52,void 0===c?2:c,...Qa(a||0)]}i64_load32_u(e,a,c){return[...e,53,void 0===c?2:c,...Qa(a||0)]}i64_load(e,a,c){return[...e,41,void 0===c?3:c,...Qa(a||0)]}i64_store(e,a,c,f){let d,b,t;return Array.isArray(a)?(d=0,b=3,t=a):Array.isArray(c)?(d=a,b=3,t=c):Array.isArray(f)&&(d=a,b=c,t=f),[...e,...t,55,b,...Qa(d)]}i64_store32(e,a,c,f){let d,b,t;return Array.isArray(a)?(d=0,b=2,t=a):Array.isArray(c)?(d=a,b=2,t=c):Array.isArray(f)&&(d=a,b=c,t=f),[...e,...t,62,b,...Qa(d)]}i64_store16(e,a,c,f){let d,b,t;return Array.isArray(a)?(d=0,b=1,t=a):Array.isArray(c)?(d=a,b=1,t=c):Array.isArray(f)&&(d=a,b=c,t=f),[...e,...t,61,b,...Qa(d)]}i64_store8(e,a,c,f){let d,b,t;return Array.isArray(a)?(d=0,b=0,t=a):Array.isArray(c)?(d=a,b=0,t=c):Array.isArray(f)&&(d=a,b=c,t=f),[...e,...t,60,b,...Qa(d)]}i32_load8_s(e,a,c){return[...e,44,void 0===c?0:c,...Qa(a||0)]}i32_load8_u(e,a,c){return[...e,45,void 0===c?0:c,...Qa(a||0)]}i32_load16_s(e,a,c){return[...e,46,void 0===c?1:c,...Qa(a||0)]}i32_load16_u(e,a,c){return[...e,47,void 0===c?1:c,...Qa(a||0)]}i32_load(e,a,c){return[...e,40,void 0===c?2:c,...Qa(a||0)]}i32_store(e,a,c,f){let d,b,t;return Array.isArray(a)?(d=0,b=2,t=a):Array.isArray(c)?(d=a,b=2,t=c):Array.isArray(f)&&(d=a,b=c,t=f),[...e,...t,54,b,...Qa(d)]}i32_store16(e,a,c,f){let d,b,t;return Array.isArray(a)?(d=0,b=1,t=a):Array.isArray(c)?(d=a,b=1,t=c):Array.isArray(f)&&(d=a,b=c,t=f),[...e,...t,59,b,...Qa(d)]}i32_store8(e,a,c,f){let d,b,t;return Array.isArray(a)?(d=0,b=0,t=a):Array.isArray(c)?(d=a,b=0,t=c):Array.isArray(f)&&(d=a,b=c,t=f),[...e,...t,58,b,...Qa(d)]}call(e,...a){const c=this.module.functionIdxByName[e];if(void 0===c)throw new Error(`Function not defined: Function: ${e}`);return[...[].concat(...a),16,...Qa(c)]}call_indirect(e,...a){return[...[].concat(...a),...e,17,0,0]}if(e,a,c){return c?[...e,4,64,...a,5,...c,11]:[...e,4,64,...a,11]}block(e){return[2,64,...e,11]}loop(...e){return[3,64,...[].concat(...e),11]}br_if(e,a){return[...a,13,...Qa(e)]}br(e){return[12,...Qa(e)]}ret(e){return[...e,15]}drop(e){return[...e,26]}i64_const(e){return[66,...za(e)]}i32_const(e){return[65,...Da(e)]}i64_eqz(e){return[...e,80]}i64_eq(e,a){return[...e,...a,81]}i64_ne(e,a){return[...e,...a,82]}i64_lt_s(e,a){return[...e,...a,83]}i64_lt_u(e,a){return[...e,...a,84]}i64_gt_s(e,a){return[...e,...a,85]}i64_gt_u(e,a){return[...e,...a,86]}i64_le_s(e,a){return[...e,...a,87]}i64_le_u(e,a){return[...e,...a,88]}i64_ge_s(e,a){return[...e,...a,89]}i64_ge_u(e,a){return[...e,...a,90]}i64_add(e,a){return[...e,...a,124]}i64_sub(e,a){return[...e,...a,125]}i64_mul(e,a){return[...e,...a,126]}i64_div_s(e,a){return[...e,...a,127]}i64_div_u(e,a){return[...e,...a,128]}i64_rem_s(e,a){return[...e,...a,129]}i64_rem_u(e,a){return[...e,...a,130]}i64_and(e,a){return[...e,...a,131]}i64_or(e,a){return[...e,...a,132]}i64_xor(e,a){return[...e,...a,133]}i64_shl(e,a){return[...e,...a,134]}i64_shr_s(e,a){return[...e,...a,135]}i64_shr_u(e,a){return[...e,...a,136]}i64_extend_i32_s(e){return[...e,172]}i64_extend_i32_u(e){return[...e,173]}i64_clz(e){return[...e,121]}i64_ctz(e){return[...e,122]}i32_eqz(e){return[...e,69]}i32_eq(e,a){return[...e,...a,70]}i32_ne(e,a){return[...e,...a,71]}i32_lt_s(e,a){return[...e,...a,72]}i32_lt_u(e,a){return[...e,...a,73]}i32_gt_s(e,a){return[...e,...a,74]}i32_gt_u(e,a){return[...e,...a,75]}i32_le_s(e,a){return[...e,...a,76]}i32_le_u(e,a){return[...e,...a,77]}i32_ge_s(e,a){return[...e,...a,78]}i32_ge_u(e,a){return[...e,...a,79]}i32_add(e,a){return[...e,...a,106]}i32_sub(e,a){return[...e,...a,107]}i32_mul(e,a){return[...e,...a,108]}i32_div_s(e,a){return[...e,...a,109]}i32_div_u(e,a){return[...e,...a,110]}i32_rem_s(e,a){return[...e,...a,111]}i32_rem_u(e,a){return[...e,...a,112]}i32_and(e,a){return[...e,...a,113]}i32_or(e,a){return[...e,...a,114]}i32_xor(e,a){return[...e,...a,115]}i32_shl(e,a){return[...e,...a,116]}i32_shr_s(e,a){return[...e,...a,117]}i32_shr_u(e,a){return[...e,...a,118]}i32_rotl(e,a){return[...e,...a,119]}i32_rotr(e,a){return[...e,...a,120]}i32_wrap_i64(e){return[...e,167]}i32_clz(e){return[...e,103]}i32_ctz(e){return[...e,104]}unreachable(){return[0]}current_memory(){return[63,0]}comment(){return[]}}const Ha={i32:127,i64:126,f32:125,f64:124,anyfunc:112,func:96,emptyblock:64};class Va{constructor(e,a,c,f,d){if("import"==c)this.fnType="import",this.moduleName=f,this.fieldName=d;else{if("internal"!=c)throw new Error("Invalid function fnType: "+c);this.fnType="internal"}this.module=e,this.fnName=a,this.params=[],this.locals=[],this.localIdxByName={},this.code=[],this.returnType=null,this.nextLocal=0}addParam(e,a){if(this.localIdxByName[e])throw new Error(`param already exists. Function: ${this.fnName}, Param: ${e} `);const c=this.nextLocal++;this.localIdxByName[e]=c,this.params.push({type:a})}addLocal(e,a,c){const f=c||1;if(this.localIdxByName[e])throw new Error(`local already exists. Function: ${this.fnName}, Param: ${e} `);const d=this.nextLocal++;this.localIdxByName[e]=d,this.locals.push({type:a,length:f})}setReturnType(e){if(this.returnType)throw new Error(`returnType already defined. Function: ${this.fnName}`);this.returnType=e}getSignature(){return[96,...Qa(this.params.length),...this.params.map((e=>Ha[e.type])),...this.returnType?[1,Ha[this.returnType]]:[0]]}getBody(){const e=this.locals.map((e=>[...Qa(e.length),Ha[e.type]])),a=[...Qa(this.locals.length),...[].concat(...e),...this.code,11];return[...Qa(a.length),...a]}addCode(...e){this.code.push(...[].concat(...e))}getCodeBuilder(){return new Ka(this)}}class Za{constructor(){this.functions=[],this.functionIdxByName={},this.nImportFunctions=0,this.nInternalFunctions=0,this.memory={pagesSize:1,moduleName:"env",fieldName:"memory"},this.free=8,this.datas=[],this.modules={},this.exports=[],this.functionsTable=[]}build(){return this._setSignatures(),new Uint8Array([...Ua(1836278016),...Ua(1),...this._buildType(),...this._buildImport(),...this._buildFunctionDeclarations(),...this._buildFunctionsTable(),...this._buildExports(),...this._buildElements(),...this._buildCode(),...this._buildData()])}addFunction(e){if(void 0!==this.functionIdxByName[e])throw new Error(`Function already defined: ${e}`);const a=this.functions.length;return this.functionIdxByName[e]=a,this.functions.push(new Va(this,e,"internal")),this.nInternalFunctions++,this.functions[a]}addIimportFunction(e,a,c){if(void 0!==this.functionIdxByName[e])throw new Error(`Function already defined: ${e}`);if(this.functions.length>0&&"internal"==this.functions[this.functions.length-1].type)throw new Error(`Import functions must be declared before internal: ${e}`);let f=c||e;const d=this.functions.length;return this.functionIdxByName[e]=d,this.functions.push(new Va(this,e,"import",a,f)),this.nImportFunctions++,this.functions[d]}setMemory(e,a,c){this.memory={pagesSize:e,moduleName:a||"env",fieldName:c||"memory"}}exportFunction(e,a){const c=a||e;if(void 0===this.functionIdxByName[e])throw new Error(`Function not defined: ${e}`);const f=this.functionIdxByName[e];c!=e&&(this.functionIdxByName[c]=f),this.exports.push({exportName:c,idx:f})}addFunctionToTable(e){const a=this.functionIdxByName[e];this.functionsTable.push(a)}addData(e,a){this.datas.push({offset:e,bytes:a})}alloc(e,a){let c,f;(Array.isArray(e)||ArrayBuffer.isView(e))&&void 0===a?(c=e.length,f=e):(c=e,f=a),c=1+(c-1>>3)<<3;const d=this.free;return this.free+=c,f&&this.addData(d,f),d}allocString(e){const a=(new globalThis.TextEncoder).encode(e);return this.alloc([...a,0])}_setSignatures(){this.signatures=[];const e={};if(this.functionsTable.length>0){const a=this.functions[this.functionsTable[0]].getSignature();e["s_"+Ga(a)]=0,this.signatures.push(a)}for(let a=0;a{try{if("test"!=="test".normalize(a))throw new Error("bad normalize")}catch(c){e.push(a)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var bc,tc;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(bc||(bc={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(tc||(tc={}));const ic="0123456789abcdef";class rc{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,a){const c=e.toLowerCase();null==ac[c]&&this.throwArgumentError("invalid log level name","logLevel",e),cc>ac[c]||console.log.apply(console,a)}debug(...e){this._log(rc.levels.DEBUG,e)}info(...e){this._log(rc.levels.INFO,e)}warn(...e){this._log(rc.levels.WARNING,e)}makeError(e,a,c){if(ec)return this.makeError("censored error",a,{});a||(a=rc.errors.UNKNOWN_ERROR),c||(c={});const f=[];Object.keys(c).forEach((e=>{const a=c[e];try{if(a instanceof Uint8Array){let c="";for(let e=0;e>4],c+=ic[15&a[e]];f.push(e+"=Uint8Array(0x"+c+")")}else f.push(e+"="+JSON.stringify(a))}catch(a){f.push(e+"="+JSON.stringify(c[e].toString()))}})),f.push(`code=${a}`),f.push(`version=${this.version}`);const d=e;let b="";switch(a){case tc.NUMERIC_FAULT:{b="NUMERIC_FAULT";const a=e;switch(a){case"overflow":case"underflow":case"division-by-zero":b+="-"+a;break;case"negative-power":case"negative-width":b+="-unsupported";break;case"unbound-bitwise-result":b+="-unbound-result"}break}case tc.CALL_EXCEPTION:case tc.INSUFFICIENT_FUNDS:case tc.MISSING_NEW:case tc.NONCE_EXPIRED:case tc.REPLACEMENT_UNDERPRICED:case tc.TRANSACTION_REPLACED:case tc.UNPREDICTABLE_GAS_LIMIT:b=a}b&&(e+=" [ See: https://links.ethers.org/v5-errors-"+b+" ]"),f.length&&(e+=" ("+f.join(", ")+")");const t=new Error(e);return t.reason=d,t.code=a,Object.keys(c).forEach((function(e){t[e]=c[e]})),t}throwError(e,a,c){throw this.makeError(e,a,c)}throwArgumentError(e,a,c){return this.throwError(e,rc.errors.INVALID_ARGUMENT,{argument:a,value:c})}assert(e,a,c,f){e||this.throwError(a,c,f)}assertArgument(e,a,c,f){e||this.throwArgumentError(a,c,f)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),dc&&this.throwError("platform missing String.prototype.normalize",rc.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:dc})}checkSafeUint53(e,a){"number"==typeof e&&(null==a&&(a="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(a,rc.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(a,rc.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,a,c){c=c?": "+c:"",ea&&this.throwError("too many arguments"+c,rc.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:a})}checkNew(e,a){e!==Object&&null!=e||this.throwError("missing new",rc.errors.MISSING_NEW,{name:a.name})}checkAbstract(e,a){e===a?this.throwError("cannot instantiate abstract class "+JSON.stringify(a.name)+" directly; use a sub-class",rc.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",rc.errors.MISSING_NEW,{name:a.name})}static globalLogger(){return fc||(fc=new rc("logger/5.7.0")),fc}static setCensorship(e,a){if(!e&&a&&this.globalLogger().throwError("cannot permanently disable censorship",rc.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Xa){if(!e)return;this.globalLogger().throwError("error censorship permanent",rc.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}ec=!!e,Xa=!!a}static setLogLevel(e){const a=ac[e.toLowerCase()];null!=a?cc=a:rc.globalLogger().warn("invalid log level - "+e)}static from(e){return new rc(e)}}rc.errors=tc,rc.levels=bc;const nc=new rc("bytes/5.7.0");function oc(e){return e.slice||(e.slice=function(){const a=Array.prototype.slice.call(arguments);return oc(new Uint8Array(Array.prototype.slice.apply(e,a)))}),e}function sc(e){return"number"==typeof e&&e==e&&e%1==0}function lc(e,a){if(a||(a={}),"number"==typeof e){nc.checkSafeUint53(e,"invalid arrayify value");const a=[];for(;e;)a.unshift(255&e),e=parseInt(String(e/256));return 0===a.length&&a.push(0),oc(new Uint8Array(a))}if(a.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),function(e){return!!e.toHexString}(e)&&(e=e.toHexString()),function(e,a){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||a&&e.length!==2+2*a)}(e)){let c=e.substring(2);c.length%2&&("left"===a.hexPad?c="0"+c:"right"===a.hexPad?c+="0":nc.throwArgumentError("hex data is odd-length","value",e));const f=[];for(let e=0;e=256)return!1}return!0}(e)?oc(new Uint8Array(e)):nc.throwArgumentError("invalid arrayify value","value",e)}function hc(e){return"0x"+$a().keccak_256(lc(e))}const uc=new rc("strings/5.7.0");var xc,pc;function gc(e,a,c,f,d){if(e===pc.BAD_PREFIX||e===pc.UNEXPECTED_CONTINUE){let e=0;for(let f=a+1;f>6==2;f++)e++;return e}return e===pc.OVERRUN?c.length-a-1:0}function mc(e,a=xc.current){a!=xc.current&&(uc.checkNormalize(),e=e.normalize(a));let c=[];for(let a=0;a>6|192),c.push(63&f|128);else if(55296==(64512&f)){a++;const d=e.charCodeAt(a);if(a>=e.length||56320!=(64512&d))throw new Error("invalid utf-8 string");const b=65536+((1023&f)<<10)+(1023&d);c.push(b>>18|240),c.push(b>>12&63|128),c.push(b>>6&63|128),c.push(63&b|128)}else c.push(f>>12|224),c.push(f>>6&63|128),c.push(63&f|128)}return lc(c)}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(xc||(xc={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(pc||(pc={})),Object.freeze({error:function(e,a,c,f,d){return uc.throwArgumentError(`invalid codepoint at offset ${a}; ${e}`,"bytes",c)},ignore:gc,replace:function(e,a,c,f,d){return e===pc.OVERLONG?(f.push(d),0):(f.push(65533),gc(e,a,c))}});const yc="mimcsponge";async function _c(){const e=await async function(e,a,c){let f;const d=e.toUpperCase().match(/[A-Za-z0-9]+/g).join("");if(["BN128","BN254","ALTBN128"].indexOf(d)>=0)f=await async function(e,a){if(!e&&globalThis.curve_bn128)return globalThis.curve_bn128;const c=new Za;c.setMemory(25),ia(c),a&&a(c);const f={};f.code=c.build(),f.pq=c.modules.f1m.pq,f.pr=c.modules.frm.pq,f.pG1gen=c.modules.bn128.pG1gen,f.pG1zero=c.modules.bn128.pG1zero,f.pG1b=c.modules.bn128.pG1b,f.pG2gen=c.modules.bn128.pG2gen,f.pG2zero=c.modules.bn128.pG2zero,f.pG2b=c.modules.bn128.pG2b,f.pOneT=c.modules.bn128.pOneT,f.prePSize=c.modules.bn128.prePSize,f.preQSize=c.modules.bn128.preQSize,f.n8q=32,f.n8r=32,f.q=c.modules.bn128.q,f.r=c.modules.bn128.r;const d={name:"bn128",wasm:f,q:b("21888242871839275222246405745257275088696311157297823662689037894645226208583"),r:b("21888242871839275222246405745257275088548364400416034343698204186575808495617"),n8q:32,n8r:32,cofactorG2:b("30644e72e131a029b85045b68181585e06ceecda572a2489345f2299c0f9fa8d",16),singleThread:!!e},t=await Oa(d);return t.terminate=async function(){d.singleThread||(globalThis.curve_bn128=null,await this.tm.terminate())},e||(globalThis.curve_bn128=t),t}(a,c);else{if(!(["BLS12381"].indexOf(d)>=0))throw new Error(`Curve not supported: ${e}`);f=await async function(e,a){if(!e&&globalThis.curve_bls12381)return globalThis.curve_bls12381;const c=new Za;c.setMemory(25),ra(c),a&&a(c);const f={};f.code=c.build(),f.pq=c.modules.f1m.pq,f.pr=c.modules.frm.pq,f.pG1gen=c.modules.bls12381.pG1gen,f.pG1zero=c.modules.bls12381.pG1zero,f.pG1b=c.modules.bls12381.pG1b,f.pG2gen=c.modules.bls12381.pG2gen,f.pG2zero=c.modules.bls12381.pG2zero,f.pG2b=c.modules.bls12381.pG2b,f.pOneT=c.modules.bls12381.pOneT,f.prePSize=c.modules.bls12381.prePSize,f.preQSize=c.modules.bls12381.preQSize,f.n8q=48,f.n8r=32,f.q=c.modules.bls12381.q,f.r=c.modules.bls12381.r;const d={name:"bls12381",wasm:f,q:b("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab",16),r:b("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001",16),n8q:48,n8r:32,cofactorG1:b("0x396c8c005555e1568c00aaab0000aaab",16),cofactorG2:b("0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5",16),singleThread:!!e},t=await Oa(d);return t.terminate=async function(){d.singleThread||(globalThis.curve_bls12381=null,await this.tm.terminate())},e||(globalThis.curve_bls12381=t),t}(a,c)}return f}("bn128",!0);return new vc(e.Fr)}class vc{constructor(e){this.F=e,this.cts=this.getConstants(yc,220)}getIV(e){const a=this.F;void 0===e&&(e=yc);const c=hc(mc(e+"_iv"));return Wa.e(c).mod(a.p)}getConstants(e,a){const c=this.F;void 0===e&&(e=yc),void 0===a&&(a=220);const f=new Array(a);let d=hc(mc(yc));for(let e=1;ethis.sponge?.F.toString(this.sponge?.multiHash([BigInt(e),BigInt(a)]))}async getHash(){return await this.mimcPromise,{sponge:this.sponge,hash:this.hash}}};var Ic=__webpack_require__(1565);__webpack_require__(9404),__webpack_require__(1810),BigInt.prototype.toJSON=function(){return this.toString()};const kc=!process.browser&&void 0===globalThis.window;if(kc?Ic.webcrypto:globalThis.crypto,kc&&a())!async function(){const{hash:e}=await Lc.getHash(),{merkleTreeHeight:f,edge:d,elements:b,zeroElement:t}=a().workerData;if(d){const i=new c.PartialMerkleTree(f,d,b,{zeroElement:t,hashFunction:e});return void a().parentPort.postMessage(i.toString())}const i=new c.MerkleTree(f,b,{zeroElement:t,hashFunction:e});a().parentPort.postMessage(i.toString())}();else{if(kc||"function"!=typeof addEventListener||"function"!=typeof postMessage)throw new Error("This browser / environment does not support workers!");addEventListener("message",(async e=>{let a;a=e.data?e.data:e;const{hash:f}=await Lc.getHash(),{merkleTreeHeight:d,edge:b,elements:t,zeroElement:i}=a;if(b){const e=new c.PartialMerkleTree(d,b,t,{zeroElement:i,hashFunction:f});return void postMessage(e.toString())}const r=new c.MerkleTree(d,t,{zeroElement:i,hashFunction:f});postMessage(r.toString())}))}})(),__webpack_exports__})()));