-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathbitcoin.min.js
More file actions
1 lines (1 loc) · 377 KB
/
bitcoin.min.js
File metadata and controls
1 lines (1 loc) · 377 KB
1
!function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).bitcoin=t()}(function(){return function n(i,o,s){function a(e,t){if(!o[e]){if(!i[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(f)return f(e,!0);throw(r=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",r}r=o[e]={exports:{}},i[e][0].call(r.exports,function(t){return a(i[e][1][t]||t)},r,r.exports,n,i,o,s)}return o[e].exports}for(var f="function"==typeof require&&require,t=0;t<s.length;t++)a(s[t]);return a}({1:[function(t,e,r){"use strict";var g=t("safe-buffer").Buffer;e.exports=function(d){if(255<=d.length)throw new TypeError("Alphabet too long");for(var l=new Uint8Array(256),t=0;t<l.length;t++)l[t]=255;for(var e=0;e<d.length;e++){var r=d.charAt(e),n=r.charCodeAt(0);if(255!==l[n])throw new TypeError(r+" is ambiguous");l[n]=e}var p=d.length,b=d.charAt(0),y=Math.log(p)/Math.log(256),m=Math.log(256)/Math.log(p);function i(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return g.alloc(0);for(var e=0,r=0,n=0;t[e]===b;)r++,e++;for(var i=(t.length-e)*y+1>>>0,o=new Uint8Array(i);t[e];){var s=l[t.charCodeAt(e)];if(255===s)return;for(var a=0,f=i-1;(0!==s||a<n)&&-1!==f;f--,a++)s+=p*o[f]>>>0,o[f]=s%256>>>0,s=s/256>>>0;if(0!==s)throw new Error("Non-zero carry");n=a,e++}for(var u=i-n;u!==i&&0===o[u];)u++;var c=g.allocUnsafe(r+(i-u));c.fill(0,0,r);for(var h=r;u!==i;)c[h++]=o[u++];return c}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=g.from(t)),!g.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var e=0,r=0,n=0,i=t.length;n!==i&&0===t[n];)n++,e++;for(var o=(i-n)*m+1>>>0,s=new Uint8Array(o);n!==i;){for(var a=t[n],f=0,u=o-1;(0!==a||f<r)&&-1!==u;u--,f++)a+=256*s[u]>>>0,s[u]=a%p>>>0,a=a/p>>>0;if(0!==a)throw new Error("Non-zero carry");r=f,n++}for(var c=o-r;c!==o&&0===s[c];)c++;for(var h=b.repeat(e);c<o;++c)h+=d.charAt(s[c]);return h},decodeUnsafe:i,decode:function(t){if(t=i(t))return t;throw new Error("Non-base"+p+" character")}}}},{"safe-buffer":119}],2:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.bech32m=r.bech32=void 0;const a="qpzry9x8gf2tvdw0s3jn54khce6mua7l",u={};for(let t=0;t<a.length;t++){var n=a.charAt(t);u[n]=t}function c(t){var e=t>>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function h(e){let r=1;for(let t=0;t<e.length;++t){var n=e.charCodeAt(t);if(n<33||126<n)return"Invalid prefix ("+e+")";r=c(r)^n>>5}r=c(r);for(let t=0;t<e.length;++t){var i=e.charCodeAt(t);r=c(r)^31&i}return r}function i(e,r,n,t){let i=0,o=0;var s=(1<<n)-1;const a=[];for(let t=0;t<e.length;++t)for(i=i<<r|e[t],o+=r;o>=n;)o-=n,a.push(i>>o&s);if(t)0<o&&a.push(i<<n-o&s);else{if(o>=r)return"Excess padding";if(i<<n-o&s)return"Non-zero padding"}return a}function o(t){return i(t,8,5,!0)}function s(t){t=i(t,5,8,!1);if(Array.isArray(t))return t}function d(t){t=i(t,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}function f(t){let f;function r(t,e){if(t.length<8)return t+" too short";if(t.length>(e=e||90))return"Exceeds length limit";var r=t.toLowerCase(),e=t.toUpperCase();if(t!==r&&t!==e)return"Mixed-case string "+t;e=(t=r).lastIndexOf("1");if(-1===e)return"No separator character for "+t;if(0===e)return"Missing prefix for "+t;r=t.slice(0,e);const n=t.slice(e+1);if(n.length<6)return"Data too short";let i=h(r);if("string"==typeof i)return i;const o=[];for(let t=0;t<n.length;++t){var s=n.charAt(t),a=u[s];if(void 0===a)return"Unknown character "+s;i=c(i)^a,t+6>=n.length||o.push(a)}return i!==f?"Invalid checksum for "+t:{prefix:r,words:o}}return f="bech32"===t?1:734539939,{decodeUnsafe:function(t,e){if("object"==typeof(e=r(t,e)))return e},decode:function(t,e){if("object"==typeof(e=r(t,e)))return e;throw new Error(e)},encode:function(t,e,r){if(t.length+7+e.length>(r=r||90))throw new TypeError("Exceeds length limit");let n=h(t=t.toLowerCase());if("string"==typeof n)throw new Error(n);let i=t+"1";for(let t=0;t<e.length;++t){var o=e[t];if(o>>5!=0)throw new Error("Non 5-bit word");n=c(n)^o,i+=a.charAt(o)}for(let t=0;t<6;++t)n=c(n);n^=f;for(let t=0;t<6;++t){var s=n>>5*(5-t)&31;i+=a.charAt(s)}return i},toWords:o,fromWordsUnsafe:s,fromWords:d}}r.bech32=f("bech32"),r.bech32m=f("bech32m")},{}],3:[function(t,e,r){function BigInteger(t,e,r){if(!(this instanceof BigInteger))return new BigInteger(t,e,r);null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}var n=BigInteger.prototype;n.__bigi=t("../package.json").version,BigInteger.isBigInteger=function(t,e){return t&&t.__bigi&&(!e||t.__bigi===n.__bigi)},BigInteger.prototype.am=function(t,e,r,n,i,o){for(;0<=--o;){var s=e*this[t++]+r[n]+i;i=Math.floor(s/67108864),r[n++]=67108863&s}return i},BigInteger.prototype.DB=26,BigInteger.prototype.DM=67108863;BigInteger.prototype.DV=1<<26;BigInteger.prototype.FV=Math.pow(2,52),BigInteger.prototype.F1=26,BigInteger.prototype.F2=0;for(var i="0123456789abcdefghijklmnopqrstuvwxyz",o=new Array,s="0".charCodeAt(0),a=0;a<=9;++a)o[s++]=a;for(s="a".charCodeAt(0),a=10;a<36;++a)o[s++]=a;for(s="A".charCodeAt(0),a=10;a<36;++a)o[s++]=a;function u(t){return i.charAt(t)}function c(t,e){e=o[t.charCodeAt(e)];return null==e?-1:e}function y(t){var e=new BigInteger;return e.fromInt(t),e}function g(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function m(t){this.m=t}function w(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function f(t,e){return t&e}function h(t,e){return t|e}function d(t,e){return t^e}function l(t,e){return t&~e}function p(){}function b(t){return t}function v(t){this.r2=new BigInteger,this.q3=new BigInteger,BigInteger.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}m.prototype.convert=function(t){return t.s<0||0<=t.compareTo(this.m)?t.mod(this.m):t},m.prototype.revert=function(t){return t},m.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},m.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},m.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},w.prototype.convert=function(t){var e=new BigInteger;return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&0<e.compareTo(BigInteger.ZERO)&&this.m.subTo(e,e),e},w.prototype.revert=function(t){var e=new BigInteger;return t.copyTo(e),this.reduce(e),e},w.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),0<=t.compareTo(this.m)&&t.subTo(this.m,t)},w.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},w.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},n.copyTo=function(t){for(var e=this.t-1;0<=e;--e)t[e]=this[e];t.t=this.t,t.s=this.s},n.fromInt=function(t){this.t=1,this.s=t<0?-1:0,0<t?this[0]=t:t<-1?this[0]=t+67108864:this.t=0},n.fromString=function(t,e){var r,n=this;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void n.fromRadix(t,e);r=2}n.t=0,n.s=0;for(var i=t.length,o=!1,s=0;0<=--i;){var a=8==r?255&t[i]:c(t,i);a<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==s?n[n.t++]=a:s+r>n.DB?(n[n.t-1]|=(a&(1<<n.DB-s)-1)<<s,n[n.t++]=a>>n.DB-s):n[n.t-1]|=a<<s,(s+=r)>=n.DB&&(s-=n.DB))}8==r&&0!=(128&t[0])&&(n.s=-1,0<s&&(n[n.t-1]|=(1<<n.DB-s)-1<<s)),n.clamp(),o&&BigInteger.ZERO.subTo(n,n)},n.clamp=function(){for(var t=this.s&this.DM;0<this.t&&this[this.t-1]==t;)--this.t},n.dlShiftTo=function(t,e){for(var r=this.t-1;0<=r;--r)e[r+t]=this[r];for(r=t-1;0<=r;--r)e[r]=0;e.t=this.t+t,e.s=this.s},n.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s},n.lShiftTo=function(t,e){for(var r=this,n=t%r.DB,i=r.DB-n,o=(1<<i)-1,s=Math.floor(t/r.DB),a=r.s<<n&r.DM,f=r.t-1;0<=f;--f)e[f+s+1]=r[f]>>i|a,a=(r[f]&o)<<n;for(f=s-1;0<=f;--f)e[f]=0;e[s]=a,e.t=r.t+s+1,e.s=r.s,e.clamp()},n.rShiftTo=function(t,e){var r=this;e.s=r.s;var n=Math.floor(t/r.DB);if(n>=r.t)e.t=0;else{var i=t%r.DB,o=r.DB-i,s=(1<<i)-1;e[0]=r[n]>>i;for(var a=n+1;a<r.t;++a)e[a-n-1]|=(r[a]&s)<<o,e[a-n]=r[a]>>i;0<i&&(e[r.t-n-1]|=(r.s&s)<<o),e.t=r.t-n,e.clamp()}},n.subTo=function(t,e){for(var r=this,n=0,i=0,o=Math.min(t.t,r.t);n<o;)i+=r[n]-t[n],e[n++]=i&r.DM,i>>=r.DB;if(t.t<r.t){for(i-=t.s;n<r.t;)i+=r[n],e[n++]=i&r.DM,i>>=r.DB;i+=r.s}else{for(i+=r.s;n<t.t;)i-=t[n],e[n++]=i&r.DM,i>>=r.DB;i-=t.s}e.s=i<0?-1:0,i<-1?e[n++]=r.DV+i:0<i&&(e[n++]=i),e.t=n,e.clamp()},n.multiplyTo=function(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;0<=--i;)e[i]=0;for(i=0;i<n.t;++i)e[i+r.t]=r.am(0,n[i],e,i,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&BigInteger.ZERO.subTo(e,e)},n.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;0<=--r;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}0<t.t&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},n.divRemTo=function(t,e,r){var n=this,i=t.abs();if(!(i.t<=0)){var o=n.abs();if(o.t<i.t)return null!=e&&e.fromInt(0),void(null!=r&&n.copyTo(r));null==r&&(r=new BigInteger);var s=new BigInteger,a=n.s,f=t.s,t=n.DB-g(i[i.t-1]);0<t?(i.lShiftTo(t,s),o.lShiftTo(t,r)):(i.copyTo(s),o.copyTo(r));var u=s.t,c=s[u-1];if(0!=c){var o=c*(1<<n.F1)+(1<u?s[u-2]>>n.F2:0),h=n.FV/o,d=(1<<n.F1)/o,l=1<<n.F2,p=r.t,b=p-u,y=null==e?new BigInteger:e;for(s.dlShiftTo(b,y),0<=r.compareTo(y)&&(r[r.t++]=1,r.subTo(y,r)),BigInteger.ONE.dlShiftTo(u,y),y.subTo(s,s);s.t<u;)s[s.t++]=0;for(;0<=--b;){var m=r[--p]==c?n.DM:Math.floor(r[p]*h+(r[p-1]+l)*d);if((r[p]+=s.am(0,m,r,b,0,u))<m)for(s.dlShiftTo(b,y),r.subTo(y,r);r[p]<--m;)r.subTo(y,r)}null!=e&&(r.drShiftTo(u,e),a!=f&&BigInteger.ZERO.subTo(e,e)),r.t=u,r.clamp(),0<t&&r.rShiftTo(t,r),a<0&&BigInteger.ZERO.subTo(r,r)}}},n.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return 0<(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)?this.DV-e:-e},n.isEven=function(){return 0==(0<this.t?1&this[0]:this.s)},n.exp=function(t,e){if(4294967295<t||t<1)return BigInteger.ONE;var r,n=new BigInteger,i=new BigInteger,o=e.convert(this),s=g(t)-1;for(o.copyTo(n);0<=--s;)e.sqrTo(n,i),0<(t&1<<s)?e.mulTo(i,o,n):(r=n,n=i,i=r);return e.revert(n)},n.toString=function(t){var e,r=this;if(r.s<0)return"-"+r.negate().toString(t);if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return r.toRadix(t);e=2}var n,i=(1<<e)-1,o=!1,s="",a=r.t,f=r.DB-a*r.DB%e;if(0<a--)for(f<r.DB&&0<(n=r[a]>>f)&&(o=!0,s=u(n));0<=a;)f<e?(n=(r[a]&(1<<f)-1)<<e-f,n|=r[--a]>>(f+=r.DB-e)):(n=r[a]>>(f-=e)&i,f<=0&&(f+=r.DB,--a)),(o=0<n?!0:o)&&(s+=u(n));return o?s:"0"},n.negate=function(){var t=new BigInteger;return BigInteger.ZERO.subTo(this,t),t},n.abs=function(){return this.s<0?this.negate():this},n.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;0<=--r;)if(0!=(e=this[r]-t[r]))return e;return 0},n.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+g(this[this.t-1]^this.s&this.DM)},n.byteLength=function(){return this.bitLength()>>3},n.mod=function(t){var e=new BigInteger;return this.abs().divRemTo(t,null,e),this.s<0&&0<e.compareTo(BigInteger.ZERO)&&t.subTo(e,e),e},n.modPowInt=function(t,e){return e=new(t<256||e.isEven()?m:w)(e),this.exp(t,e)},p.prototype.convert=b,p.prototype.revert=b,p.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},p.prototype.sqrTo=function(t,e){t.squareTo(e)},v.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=new BigInteger;return t.copyTo(e),this.reduce(e),e},v.prototype.revert=function(t){return t},v.prototype.reduce=function(t){var e=this;for(t.drShiftTo(e.m.t-1,e.r2),t.t>e.m.t+1&&(t.t=e.m.t+1,t.clamp()),e.mu.multiplyUpperTo(e.r2,e.m.t+1,e.q3),e.m.multiplyLowerTo(e.q3,e.m.t+1,e.r2);t.compareTo(e.r2)<0;)t.dAddOffset(1,e.m.t+1);for(t.subTo(e.r2,t);0<=t.compareTo(e.m);)t.subTo(e.m,t)},v.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},v.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var _=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],S=(1<<26)/_[_.length-1];n.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},n.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||36<t)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=y(r),i=new BigInteger,o=new BigInteger,s="";for(this.divRemTo(n,i,o);0<i.signum();)s=(r+o.intValue()).toString(t).substr(1)+s,i.divRemTo(n,i,o);return o.intValue().toString(t)+s},n.fromRadix=function(t,e){var r=this;r.fromInt(0);for(var n=r.chunkSize(e=null==e?10:e),i=Math.pow(e,n),o=!1,s=0,a=0,f=0;f<t.length;++f){var u=c(t,f);u<0?"-"==t.charAt(f)&&0==r.signum()&&(o=!0):(a=e*a+u,++s>=n&&(r.dMultiply(i),r.dAddOffset(a,0),a=s=0))}0<s&&(r.dMultiply(Math.pow(e,s)),r.dAddOffset(a,0)),o&&BigInteger.ZERO.subTo(r,r)},n.fromNumber=function(t,e,r){var n=this;if("number"==typeof e)if(t<2)n.fromInt(1);else for(n.fromNumber(t,r),n.testBit(t-1)||n.bitwiseTo(BigInteger.ONE.shiftLeft(t-1),h,n),n.isEven()&&n.dAddOffset(1,0);!n.isProbablePrime(e);)n.dAddOffset(2,0),n.bitLength()>t&&n.subTo(BigInteger.ONE.shiftLeft(t-1),n);else{var i=new Array,r=7&t;i.length=1+(t>>3),e.nextBytes(i),0<r?i[0]&=(1<<r)-1:i[0]=0,n.fromString(i,256)}},n.bitwiseTo=function(t,e,r){for(var n,i=this,o=Math.min(t.t,i.t),s=0;s<o;++s)r[s]=e(i[s],t[s]);if(t.t<i.t){for(n=t.s&i.DM,s=o;s<i.t;++s)r[s]=e(i[s],n);r.t=i.t}else{for(n=i.s&i.DM,s=o;s<t.t;++s)r[s]=e(n,t[s]);r.t=t.t}r.s=e(i.s,t.s),r.clamp()},n.changeBit=function(t,e){return t=BigInteger.ONE.shiftLeft(t),this.bitwiseTo(t,e,t),t},n.addTo=function(t,e){for(var r=this,n=0,i=0,o=Math.min(t.t,r.t);n<o;)i+=r[n]+t[n],e[n++]=i&r.DM,i>>=r.DB;if(t.t<r.t){for(i+=t.s;n<r.t;)i+=r[n],e[n++]=i&r.DM,i>>=r.DB;i+=r.s}else{for(i+=r.s;n<t.t;)i+=t[n],e[n++]=i&r.DM,i>>=r.DB;i+=t.s}e.s=i<0?-1:0,0<i?e[n++]=i:i<-1&&(e[n++]=r.DV+i),e.t=n,e.clamp()},n.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},n.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},n.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;0<i;)r[--i]=0;for(n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,t[i],r,i,0,this.t);for(n=Math.min(t.t,e);i<n;++i)this.am(0,t[i],r,i,0,e-i);r.clamp()},n.multiplyUpperTo=function(t,e,r){var n=r.t=this.t+t.t- --e;for(r.s=0;0<=--n;)r[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r[this.t+n-e]=this.am(e-n,t[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)},n.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(0<this.t)if(0==e)r=this[0]%t;else for(var n=this.t-1;0<=n;--n)r=(e*r+this[n])%t;return r},n.millerRabin=function(t){var e=this.subtract(BigInteger.ONE),r=e.getLowestSetBit();if(r<=0)return!1;var n=e.shiftRight(r);_.length<(t=t+1>>1)&&(t=_.length);for(var i=new BigInteger(null),o=[],s=0;s<t;++s){for(;f=_[Math.floor(Math.random()*_.length)],-1!=o.indexOf(f););o.push(f),i.fromInt(f);var a=i.modPow(n,this);if(0!=a.compareTo(BigInteger.ONE)&&0!=a.compareTo(e)){for(var f=1;f++<r&&0!=a.compareTo(e);)if(0==(a=a.modPowInt(2,this)).compareTo(BigInteger.ONE))return!1;if(0!=a.compareTo(e))return!1}}return!0},n.clone=function(){var t=new BigInteger;return this.copyTo(t),t},n.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},n.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},n.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},n.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},n.toByteArray=function(){var t=this,e=t.t,r=new Array;r[0]=t.s;var n,i=t.DB-e*t.DB%8,o=0;if(0<e--)for(i<t.DB&&(n=t[e]>>i)!=(t.s&t.DM)>>i&&(r[o++]=n|t.s<<t.DB-i);0<=e;)i<8?(n=(t[e]&(1<<i)-1)<<8-i,n|=t[--e]>>(i+=t.DB-8)):(n=t[e]>>(i-=8)&255,i<=0&&(i+=t.DB,--e)),0!=(128&n)&&(n|=-256),0===o&&(128&t.s)!=(128&n)&&++o,(0<o||n!=t.s)&&(r[o++]=n);return r},n.equals=function(t){return 0==this.compareTo(t)},n.min=function(t){return this.compareTo(t)<0?this:t},n.max=function(t){return 0<this.compareTo(t)?this:t},n.and=function(t){var e=new BigInteger;return this.bitwiseTo(t,f,e),e},n.or=function(t){var e=new BigInteger;return this.bitwiseTo(t,h,e),e},n.xor=function(t){var e=new BigInteger;return this.bitwiseTo(t,d,e),e},n.andNot=function(t){var e=new BigInteger;return this.bitwiseTo(t,l,e),e},n.not=function(){for(var t=new BigInteger,e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},n.shiftLeft=function(t){var e=new BigInteger;return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},n.shiftRight=function(t){var e=new BigInteger;return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},n.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+function(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}(this[t]);return this.s<0?this.t*this.DB:-1},n.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=function(t){for(var e=0;0!=t;)t&=t-1,++e;return e}(this[r]^e);return t},n.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},n.setBit=function(t){return this.changeBit(t,h)},n.clearBit=function(t){return this.changeBit(t,l)},n.flipBit=function(t){return this.changeBit(t,d)},n.add=function(t){var e=new BigInteger;return this.addTo(t,e),e},n.subtract=function(t){var e=new BigInteger;return this.subTo(t,e),e},n.multiply=function(t){var e=new BigInteger;return this.multiplyTo(t,e),e},n.divide=function(t){var e=new BigInteger;return this.divRemTo(t,e,null),e},n.remainder=function(t){var e=new BigInteger;return this.divRemTo(t,null,e),e},n.divideAndRemainder=function(t){var e=new BigInteger,r=new BigInteger;return this.divRemTo(t,e,r),new Array(e,r)},n.modPow=function(t,e){var r=t.bitLength(),n=y(1);if(r<=0)return n;var i=r<18?1:r<48?3:r<144?4:r<768?5:6,o=new(r<8?m:e.isEven()?v:w)(e),s=new Array,a=3,f=i-1,u=(1<<i)-1;if(s[1]=o.convert(this),1<i){var c=new BigInteger;for(o.sqrTo(s[1],c);a<=u;)s[a]=new BigInteger,o.mulTo(c,s[a-2],s[a]),a+=2}for(var h,d,l=t.t-1,p=!0,b=new BigInteger,r=g(t[l])-1;0<=l;){for(f<=r?h=t[l]>>r-f&u:(h=(t[l]&(1<<r+1)-1)<<f-r,0<l&&(h|=t[l-1]>>this.DB+r-f)),a=i;0==(1&h);)h>>=1,--a;if((r-=a)<0&&(r+=this.DB,--l),p)s[h].copyTo(n),p=!1;else{for(;1<a;)o.sqrTo(n,b),o.sqrTo(b,n),a-=2;0<a?o.sqrTo(n,b):(d=n,n=b,b=d),o.mulTo(b,s[h],n)}for(;0<=l&&0==(t[l]&1<<r);)o.sqrTo(n,b),d=n,n=b,b=d,--r<0&&(r=this.DB-1,--l)}return o.revert(n)},n.modInverse=function(t){var e=t.isEven();if(0===this.signum())throw new Error("division by zero");if(this.isEven()&&e||0==t.signum())return BigInteger.ZERO;for(var r=t.clone(),n=this.clone(),i=y(1),o=y(0),s=y(0),a=y(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),e?(i.isEven()&&o.isEven()||(i.addTo(this,i),o.subTo(t,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),e?(s.isEven()&&a.isEven()||(s.addTo(this,s),a.subTo(t,a)),s.rShiftTo(1,s)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);0<=r.compareTo(n)?(r.subTo(n,r),e&&i.subTo(s,i),o.subTo(a,o)):(n.subTo(r,n),e&&s.subTo(i,s),a.subTo(o,a))}if(0!=n.compareTo(BigInteger.ONE))return BigInteger.ZERO;for(;0<=a.compareTo(t);)a.subTo(t,a);for(;a.signum()<0;)a.addTo(t,a);return a},n.pow=function(t){return this.exp(t,new p)},n.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();e.compareTo(r)<0&&(i=e,e=r,r=i);var n=e.getLowestSetBit(),i=r.getLowestSetBit();if(i<0)return e;for(0<(i=n<i?n:i)&&(e.rShiftTo(i,e),r.rShiftTo(i,r));0<e.signum();)0<(n=e.getLowestSetBit())&&e.rShiftTo(n,e),0<(n=r.getLowestSetBit())&&r.rShiftTo(n,r),0<=e.compareTo(r)?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return 0<i&&r.lShiftTo(i,r),r},n.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=_[_.length-1]){for(e=0;e<_.length;++e)if(r[0]==_[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<_.length;){for(var n=_[e],i=e+1;i<_.length&&n<S;)n*=_[i++];for(n=r.modInt(n);e<i;)if(n%_[e++]==0)return!1}return r.millerRabin(t)},n.square=function(){var t=new BigInteger;return this.squareTo(t),t},BigInteger.ZERO=y(0),BigInteger.ONE=y(1),BigInteger.valueOf=y,e.exports=BigInteger},{"../package.json":6}],4:[function(t,e,r){!function(i){!function(){var e=t("assert"),BigInteger=t("./bigi");BigInteger.fromByteArrayUnsigned=function(t){return 128&t[0]?new BigInteger([0].concat(t)):new BigInteger(t)},BigInteger.prototype.toByteArrayUnsigned=function(){var t=this.toByteArray();return 0===t[0]?t.slice(1):t},BigInteger.fromDERInteger=function(t){return new BigInteger(t)},BigInteger.prototype.toDERInteger=BigInteger.prototype.toByteArray,BigInteger.fromBuffer=function(t){if(128&t[0]){var e=Array.prototype.slice.call(t);return new BigInteger([0].concat(e))}return new BigInteger(t)},BigInteger.fromHex=function(t){return""===t?BigInteger.ZERO:(e.equal(t,t.match(/^[A-Fa-f0-9]+/),"Invalid hex string"),e.equal(t.length%2,0,"Incomplete hex"),new BigInteger(t,16))},BigInteger.prototype.toBuffer=function(t){for(var e=this.toByteArrayUnsigned(),r=[],n=t-e.length;r.length<n;)r.push(0);return new i(r.concat(e))},BigInteger.prototype.toHex=function(t){return this.toBuffer(t).toString("hex")}}.call(this)}.call(this,t("buffer").Buffer)},{"./bigi":3,assert:138,buffer:144}],5:[function(t,e,r){var BigInteger=t("./bigi");t("./convert"),e.exports=BigInteger},{"./bigi":3,"./convert":4}],6:[function(t,e,r){e.exports={name:"bigi",version:"1.4.2",description:"Big integers.",keywords:["cryptography","math","bitcoin","arbitrary","precision","arithmetic","big","integer","int","number","biginteger","bigint","bignumber","decimal","float"],devDependencies:{coveralls:"^2.11.2",istanbul:"^0.3.5",jshint:"^2.5.1",mocha:"^2.1.0",mochify:"^2.1.0"},repository:{url:"https://github.com/cryptocoinjs/bigi",type:"git"},main:"./lib/index.js",scripts:{"browser-test":"./node_modules/.bin/mochify --wd -R spec",test:"./node_modules/.bin/_mocha -- test/*.js",jshint:"./node_modules/.bin/jshint --config jshint.json lib/*.js ; true",unit:"./node_modules/.bin/mocha",coverage:"./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --reporter list test/*.js",coveralls:"npm run-script coverage && node ./node_modules/.bin/coveralls < coverage/lcov.info"},dependencies:{},testling:{files:"test/*.js",harness:"mocha",browsers:["ie/9..latest","firefox/latest","chrome/latest","safari/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]}}},{}],7:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const l=t("../parser");function p(r,n,i){return e=>{var t;r.has(e)||(t=i.filter(t=>t.key.toString("hex")===e)[0],n.push(t),r.add(e))}}function b(t){return t.globalMap.unsignedTx}function y(t){const e=new Set;return t.forEach(t=>{t=t.key.toString("hex");if(e.has(t))throw new Error("Combine: KeyValue Map keys should be unique");e.add(t)}),e}r.combine=function(t){var e=t[0];const r=l.psbtToKeyVals(e);if(0===(t=t.slice(1)).length)throw new Error("Combine: Nothing to combine");const n=b(e);if(void 0===n)throw new Error("Combine: Self missing transaction");var i=y(r.globalKeyVals);const o=r.inputKeyVals.map(y),s=r.outputKeyVals.map(y);for(const a of t){const f=b(a);if(void 0===f||!f.toBuffer().equals(n.toBuffer()))throw new Error("Combine: One of the Psbts does not have the same transaction.");const u=l.psbtToKeyVals(a),c=y(u.globalKeyVals);c.forEach(p(i,r.globalKeyVals,u.globalKeyVals));const h=u.inputKeyVals.map(y);h.forEach((t,e)=>t.forEach(p(o[e],r.inputKeyVals[e],u.inputKeyVals[e])));const d=u.outputKeyVals.map(y);d.forEach((t,e)=>t.forEach(p(s[e],r.outputKeyVals[e],u.outputKeyVals[e])))}return l.psbtFromKeyVals(n,{globalMapKeyVals:r.globalKeyVals,inputKeyVals:r.inputKeyVals,outputKeyVals:r.outputKeyVals})}},{"../parser":25}],8:[function(t,e,r){!function(o){!function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const a=t("../../typeFields");r.decode=function(t){if(t.key[0]!==a.GlobalTypes.GLOBAL_XPUB)throw new Error("Decode Error: could not decode globalXpub with key 0x"+t.key.toString("hex"));if(79!==t.key.length||![2,3].includes(t.key[46]))throw new Error("Decode Error: globalXpub has invalid extended pubkey in key 0x"+t.key.toString("hex"));if(t.value.length/4%1!=0)throw new Error("Decode Error: Global GLOBAL_XPUB value length should be multiple of 4");var e=t.key.slice(1);const r={masterFingerprint:t.value.slice(0,4),extendedPubkey:e,path:"m"};for(const o of(e=t.value.length/4-1,[...Array(e).keys()])){var n=t.value.readUInt32LE(4*o+4),i=!!(2147483648&n);const s=2147483647&n;r.path+="/"+s.toString(10)+(i?"'":"")}return r},r.encode=function(t){var e=o.from([a.GlobalTypes.GLOBAL_XPUB]),e=o.concat([e,t.extendedPubkey]);const r=t.path.split("/"),n=o.allocUnsafe(4*r.length);t.masterFingerprint.copy(n,0);let i=4;return r.slice(1).forEach(t=>{var e="'"===t.slice(-1);let r=2147483647&parseInt(e?t.slice(0,-1):t,10);e&&(r+=2147483648),n.writeUInt32LE(r,i),i+=4}),{key:e,value:n}},r.expected="{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }",r.check=function(t){var e=t.extendedPubkey,r=t.masterFingerprint;const n=t.path;return o.isBuffer(e)&&78===e.length&&-1<[2,3].indexOf(e[45])&&o.isBuffer(r)&&4===r.length&&"string"==typeof n&&!!n.match(/^m(\/\d+'?)+$/)},r.canAddToArray=function(t,e,r){var n=e.extendedPubkey.toString("hex");return!r.has(n)&&(r.add(n),0===t.filter(t=>t.extendedPubkey.equals(e.extendedPubkey)).length)}}.call(this)}.call(this,t("buffer").Buffer)},{"../../typeFields":28,buffer:144}],9:[function(t,e,n){!function(r){!function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0});const e=t("../../typeFields");n.encode=function(t){return{key:r.from([e.GlobalTypes.UNSIGNED_TX]),value:t.toBuffer()}}}.call(this)}.call(this,t("buffer").Buffer)},{"../../typeFields":28,buffer:144}],10:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("../typeFields"),i=t("./global/globalXpub"),o=t("./global/unsignedTx"),s=t("./input/finalScriptSig"),a=t("./input/finalScriptWitness"),f=t("./input/nonWitnessUtxo"),u=t("./input/partialSig"),c=t("./input/porCommitment"),h=t("./input/sighashType"),d=t("./input/witnessUtxo");const l=t("./shared/bip32Derivation"),p=t("./shared/checkPubkey"),b=t("./shared/redeemScript"),y=t("./shared/witnessScript");i={unsignedTx:o,globalXpub:i,checkPubkey:p.makeChecker([])};r.globals=i;d={nonWitnessUtxo:f,partialSig:u,sighashType:h,finalScriptSig:s,finalScriptWitness:a,porCommitment:c,witnessUtxo:d,bip32Derivation:l.makeConverter(n.InputTypes.BIP32_DERIVATION),redeemScript:b.makeConverter(n.InputTypes.REDEEM_SCRIPT),witnessScript:y.makeConverter(n.InputTypes.WITNESS_SCRIPT),checkPubkey:p.makeChecker([n.InputTypes.PARTIAL_SIG,n.InputTypes.BIP32_DERIVATION])};r.inputs=d;n={bip32Derivation:l.makeConverter(n.OutputTypes.BIP32_DERIVATION),redeemScript:b.makeConverter(n.OutputTypes.REDEEM_SCRIPT),witnessScript:y.makeConverter(n.OutputTypes.WITNESS_SCRIPT),checkPubkey:p.makeChecker([n.OutputTypes.BIP32_DERIVATION])};r.outputs=n},{"../typeFields":28,"./global/globalXpub":8,"./global/unsignedTx":9,"./input/finalScriptSig":11,"./input/finalScriptWitness":12,"./input/nonWitnessUtxo":13,"./input/partialSig":14,"./input/porCommitment":15,"./input/sighashType":16,"./input/witnessUtxo":17,"./shared/bip32Derivation":18,"./shared/checkPubkey":19,"./shared/redeemScript":20,"./shared/witnessScript":21}],11:[function(t,e,n){!function(r){!function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0});const e=t("../../typeFields");n.decode=function(t){if(t.key[0]!==e.InputTypes.FINAL_SCRIPTSIG)throw new Error("Decode Error: could not decode finalScriptSig with key 0x"+t.key.toString("hex"));return t.value},n.encode=function(t){return{key:r.from([e.InputTypes.FINAL_SCRIPTSIG]),value:t}},n.expected="Buffer",n.check=function(t){return r.isBuffer(t)},n.canAdd=function(t,e){return!!t&&!!e&&void 0===t.finalScriptSig}}.call(this)}.call(this,t("buffer").Buffer)},{"../../typeFields":28,buffer:144}],12:[function(t,e,n){!function(r){!function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0});const e=t("../../typeFields");n.decode=function(t){if(t.key[0]!==e.InputTypes.FINAL_SCRIPTWITNESS)throw new Error("Decode Error: could not decode finalScriptWitness with key 0x"+t.key.toString("hex"));return t.value},n.encode=function(t){return{key:r.from([e.InputTypes.FINAL_SCRIPTWITNESS]),value:t}},n.expected="Buffer",n.check=function(t){return r.isBuffer(t)},n.canAdd=function(t,e){return!!t&&!!e&&void 0===t.finalScriptWitness}}.call(this)}.call(this,t("buffer").Buffer)},{"../../typeFields":28,buffer:144}],13:[function(t,e,n){!function(r){!function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0});const e=t("../../typeFields");n.decode=function(t){if(t.key[0]!==e.InputTypes.NON_WITNESS_UTXO)throw new Error("Decode Error: could not decode nonWitnessUtxo with key 0x"+t.key.toString("hex"));return t.value},n.encode=function(t){return{key:r.from([e.InputTypes.NON_WITNESS_UTXO]),value:t}},n.expected="Buffer",n.check=function(t){return r.isBuffer(t)},n.canAdd=function(t,e){return!!t&&!!e&&void 0===t.nonWitnessUtxo}}.call(this)}.call(this,t("buffer").Buffer)},{"../../typeFields":28,buffer:144}],14:[function(t,e,i){!function(n){!function(){"use strict";Object.defineProperty(i,"__esModule",{value:!0});const r=t("../../typeFields");i.decode=function(t){if(t.key[0]!==r.InputTypes.PARTIAL_SIG)throw new Error("Decode Error: could not decode partialSig with key 0x"+t.key.toString("hex"));if(34!==t.key.length&&66!==t.key.length||![2,3,4].includes(t.key[1]))throw new Error("Decode Error: partialSig has invalid pubkey in key 0x"+t.key.toString("hex"));return{pubkey:t.key.slice(1),signature:t.value}},i.encode=function(t){var e=n.from([r.InputTypes.PARTIAL_SIG]);return{key:n.concat([e,t.pubkey]),value:t.signature}},i.expected="{ pubkey: Buffer; signature: Buffer; }",i.check=function(t){return n.isBuffer(t.pubkey)&&n.isBuffer(t.signature)&&[33,65].includes(t.pubkey.length)&&[2,3,4].includes(t.pubkey[0])&&function(t){if(!n.isBuffer(t)||t.length<9)return!1;if(48!==t[0])return!1;if(t.length!==t[1]+3)return!1;if(2!==t[2])return!1;var e=t[3];if(33<e||e<1)return!1;if(2!==t[3+e+1])return!1;var r=t[3+e+2];return!(33<r||r<1)&&t.length===3+e+2+r+2}(t.signature)},i.canAddToArray=function(t,e,r){var n=e.pubkey.toString("hex");return!r.has(n)&&(r.add(n),0===t.filter(t=>t.pubkey.equals(e.pubkey)).length)}}.call(this)}.call(this,t("buffer").Buffer)},{"../../typeFields":28,buffer:144}],15:[function(t,e,n){!function(r){!function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0});const e=t("../../typeFields");n.decode=function(t){if(t.key[0]!==e.InputTypes.POR_COMMITMENT)throw new Error("Decode Error: could not decode porCommitment with key 0x"+t.key.toString("hex"));return t.value.toString("utf8")},n.encode=function(t){return{key:r.from([e.InputTypes.POR_COMMITMENT]),value:r.from(t,"utf8")}},n.expected="string",n.check=function(t){return"string"==typeof t},n.canAdd=function(t,e){return!!t&&!!e&&void 0===t.porCommitment}}.call(this)}.call(this,t("buffer").Buffer)},{"../../typeFields":28,buffer:144}],16:[function(t,e,r){!function(i){!function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=t("../../typeFields");r.decode=function(t){if(t.key[0]!==n.InputTypes.SIGHASH_TYPE)throw new Error("Decode Error: could not decode sighashType with key 0x"+t.key.toString("hex"));return t.value.readUInt32LE(0)},r.encode=function(t){var e=i.from([n.InputTypes.SIGHASH_TYPE]);const r=i.allocUnsafe(4);return r.writeUInt32LE(t,0),{key:e,value:r}},r.expected="number",r.check=function(t){return"number"==typeof t},r.canAdd=function(t,e){return!!t&&!!e&&void 0===t.sighashType}}.call(this)}.call(this,t("buffer").Buffer)},{"../../typeFields":28,buffer:144}],17:[function(t,e,r){!function(a){!function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const i=t("../../typeFields"),o=t("../tools"),s=t("../varint");r.decode=function(t){if(t.key[0]!==i.InputTypes.WITNESS_UTXO)throw new Error("Decode Error: could not decode witnessUtxo with key 0x"+t.key.toString("hex"));var e=o.readUInt64LE(t.value,0),r=8,n=s.decode(t.value,8);if(r+=s.encodingLength(n),(r=t.value.slice(r)).length!==n)throw new Error("Decode Error: WITNESS_UTXO script is not proper length");return{script:r,value:e}},r.encode=function(t){const{script:e,value:r}=t;var n=s.encodingLength(e.length),t=a.allocUnsafe(8+n+e.length);return o.writeUInt64LE(t,r,0),s.encode(e.length,t,8),e.copy(t,8+n),{key:a.from([i.InputTypes.WITNESS_UTXO]),value:t}},r.expected="{ script: Buffer; value: number; }",r.check=function(t){return a.isBuffer(t.script)&&"number"==typeof t.value},r.canAdd=function(t,e){return!!t&&!!e&&void 0===t.witnessUtxo}}.call(this)}.call(this,t("buffer").Buffer)},{"../../typeFields":28,"../tools":22,"../varint":23,buffer:144}],18:[function(t,e,r){!function(o){!function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.makeConverter=function(a){return{decode:function(t){if(t.key[0]!==a)throw new Error("Decode Error: could not decode bip32Derivation with key 0x"+t.key.toString("hex"));if(34!==t.key.length&&66!==t.key.length||![2,3,4].includes(t.key[1]))throw new Error("Decode Error: bip32Derivation has invalid pubkey in key 0x"+t.key.toString("hex"));if(t.value.length/4%1!=0)throw new Error("Decode Error: Input BIP32_DERIVATION value length should be multiple of 4");var e=t.key.slice(1);const r={masterFingerprint:t.value.slice(0,4),pubkey:e,path:"m"};for(const o of(e=t.value.length/4-1,[...Array(e).keys()])){var n=t.value.readUInt32LE(4*o+4),i=!!(2147483648&n);const s=2147483647&n;r.path+="/"+s.toString(10)+(i?"'":"")}return r},encode:function(t){var e=o.from([a]),e=o.concat([e,t.pubkey]);const r=t.path.split("/"),n=o.allocUnsafe(4*r.length);t.masterFingerprint.copy(n,0);let i=4;return r.slice(1).forEach(t=>{var e="'"===t.slice(-1);let r=2147483647&parseInt(e?t.slice(0,-1):t,10);e&&(r+=2147483648),n.writeUInt32LE(r,i),i+=4}),{key:e,value:n}},check:function(t){return o.isBuffer(t.pubkey)&&o.isBuffer(t.masterFingerprint)&&"string"==typeof t.path&&[33,65].includes(t.pubkey.length)&&[2,3,4].includes(t.pubkey[0])&&4===t.masterFingerprint.length},expected:"{ masterFingerprint: Buffer; pubkey: Buffer; path: string; }",canAddToArray:function(t,e,r){var n=e.pubkey.toString("hex");return!r.has(n)&&(r.add(n),0===t.filter(t=>t.pubkey.equals(e.pubkey)).length)}}}}.call(this)}.call(this,t("buffer").Buffer)},{buffer:144}],19:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.makeChecker=function(r){return function(t){let e;if(r.includes(t.key[0])&&(e=t.key.slice(1),33!==e.length&&65!==e.length||![2,3,4].includes(e[0])))throw new Error("Format Error: invalid pubkey in key 0x"+t.key.toString("hex"));return e}}},{}],20:[function(t,e,n){!function(r){!function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode redeemScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(t){return{key:r.from([e]),value:t}},check:function(t){return r.isBuffer(t)},expected:"Buffer",canAdd:function(t,e){return!!t&&!!e&&void 0===t.redeemScript}}}}.call(this)}.call(this,t("buffer").Buffer)},{buffer:144}],21:[function(t,e,n){!function(r){!function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode witnessScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(t){return{key:r.from([e]),value:t}},check:function(t){return r.isBuffer(t)},expected:"Buffer",canAdd:function(t,e){return!!t&&!!e&&void 0===t.witnessScript}}}}.call(this)}.call(this,t("buffer").Buffer)},{buffer:144}],22:[function(t,e,i){!function(a){!function(){"use strict";Object.defineProperty(i,"__esModule",{value:!0});const s=t("./varint");function r(t){var e=t.key.length,r=t.value.length,n=s.encodingLength(e),i=s.encodingLength(r),o=a.allocUnsafe(n+e+i+r);return s.encode(e,o,0),t.key.copy(o,n),s.encode(r,o,n+e),t.value.copy(o,n+e+i),o}function n(t,e){if("number"!=typeof t)throw new Error("cannot write a non-number as a number");if(t<0)throw new Error("specified a negative value for writing an unsigned value");if(e<t)throw new Error("RangeError: value out of range");if(Math.floor(t)!==t)throw new Error("value has a fractional component")}i.range=t=>[...Array(t).keys()],i.reverseBuffer=function(e){if(e.length<1)return e;let r=e.length-1;var n;for(let t=0;t<e.length/2;t++)n=e[t],e[t]=e[r],e[r]=n,r--;return e},i.keyValsToBuffer=function(t){const e=t.map(r);return e.push(a.from([0])),a.concat(e)},i.keyValToBuffer=r,i.readUInt64LE=function(t,e){var r=t.readUInt32LE(e),e=t.readUInt32LE(e+4);return n((e*=4294967296)+r,9007199254740991),e+r},i.writeUInt64LE=function(t,e,r){return n(e,9007199254740991),t.writeInt32LE(-1&e,r),t.writeUInt32LE(Math.floor(e/4294967296),r+4),r+8}}.call(this)}.call(this,t("buffer").Buffer)},{"./varint":23,buffer:144}],23:[function(t,e,r){!function(s){!function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const e=9007199254740991;function i(t){if(t<0||t>e||t%1!=0)throw new RangeError("value out of range")}function o(t){return i(t),t<253?1:t<=65535?3:t<=4294967295?5:9}r.encode=function t(e,r,n){if(i(e),r=r||s.allocUnsafe(o(e)),!s.isBuffer(r))throw new TypeError("buffer must be a Buffer instance");return n=n||0,e<253?(r.writeUInt8(e,n),Object.assign(t,{bytes:1})):e<=65535?(r.writeUInt8(253,n),r.writeUInt16LE(e,n+1),Object.assign(t,{bytes:3})):e<=4294967295?(r.writeUInt8(254,n),r.writeUInt32LE(e,n+1),Object.assign(t,{bytes:5})):(r.writeUInt8(255,n),r.writeUInt32LE(e>>>0,n+1),r.writeUInt32LE(e/4294967296|0,n+5),Object.assign(t,{bytes:9})),r},r.decode=function t(e,r){if(!s.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");var n=e.readUInt8(r=r||0);if(n<253)return Object.assign(t,{bytes:1}),n;if(253===n)return Object.assign(t,{bytes:3}),e.readUInt16LE(r+1);if(254===n)return Object.assign(t,{bytes:5}),e.readUInt32LE(r+1);Object.assign(t,{bytes:9});n=e.readUInt32LE(r+1),n=4294967296*e.readUInt32LE(r+5)+n;return i(n),n},r.encodingLength=o}.call(this)}.call(this,t("buffer").Buffer)},{buffer:144}],24:[function(t,e,r){!function(n){!function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const b=t("../converter"),T=t("../converter/tools"),I=t("../converter/varint"),M=t("../typeFields");function y(t,e,r){if(!e.equals(n.from([r])))throw new Error(`Format Error: Invalid ${t} key: `+e.toString("hex"))}function k(t,{globalMapKeyVals:e,inputKeyVals:r,outputKeyVals:n}){const i={unsignedTx:t};let o=0;for(const f of e)switch(f.key[0]){case M.GlobalTypes.UNSIGNED_TX:if(y("global",f.key,M.GlobalTypes.UNSIGNED_TX),0<o)throw new Error("Format Error: GlobalMap has multiple UNSIGNED_TX");o++;break;case M.GlobalTypes.GLOBAL_XPUB:void 0===i.globalXpub&&(i.globalXpub=[]),i.globalXpub.push(b.globals.globalXpub.decode(f));break;default:i.unknownKeyVals||(i.unknownKeyVals=[]),i.unknownKeyVals.push(f)}t=r.length,e=n.length;const s=[],a=[];for(const u of T.range(t)){const c={};for(const h of r[u])switch(b.inputs.checkPubkey(h),h.key[0]){case M.InputTypes.NON_WITNESS_UTXO:if(y("input",h.key,M.InputTypes.NON_WITNESS_UTXO),void 0!==c.nonWitnessUtxo)throw new Error("Format Error: Input has multiple NON_WITNESS_UTXO");c.nonWitnessUtxo=b.inputs.nonWitnessUtxo.decode(h);break;case M.InputTypes.WITNESS_UTXO:if(y("input",h.key,M.InputTypes.WITNESS_UTXO),void 0!==c.witnessUtxo)throw new Error("Format Error: Input has multiple WITNESS_UTXO");c.witnessUtxo=b.inputs.witnessUtxo.decode(h);break;case M.InputTypes.PARTIAL_SIG:void 0===c.partialSig&&(c.partialSig=[]),c.partialSig.push(b.inputs.partialSig.decode(h));break;case M.InputTypes.SIGHASH_TYPE:if(y("input",h.key,M.InputTypes.SIGHASH_TYPE),void 0!==c.sighashType)throw new Error("Format Error: Input has multiple SIGHASH_TYPE");c.sighashType=b.inputs.sighashType.decode(h);break;case M.InputTypes.REDEEM_SCRIPT:if(y("input",h.key,M.InputTypes.REDEEM_SCRIPT),void 0!==c.redeemScript)throw new Error("Format Error: Input has multiple REDEEM_SCRIPT");c.redeemScript=b.inputs.redeemScript.decode(h);break;case M.InputTypes.WITNESS_SCRIPT:if(y("input",h.key,M.InputTypes.WITNESS_SCRIPT),void 0!==c.witnessScript)throw new Error("Format Error: Input has multiple WITNESS_SCRIPT");c.witnessScript=b.inputs.witnessScript.decode(h);break;case M.InputTypes.BIP32_DERIVATION:void 0===c.bip32Derivation&&(c.bip32Derivation=[]),c.bip32Derivation.push(b.inputs.bip32Derivation.decode(h));break;case M.InputTypes.FINAL_SCRIPTSIG:y("input",h.key,M.InputTypes.FINAL_SCRIPTSIG),c.finalScriptSig=b.inputs.finalScriptSig.decode(h);break;case M.InputTypes.FINAL_SCRIPTWITNESS:y("input",h.key,M.InputTypes.FINAL_SCRIPTWITNESS),c.finalScriptWitness=b.inputs.finalScriptWitness.decode(h);break;case M.InputTypes.POR_COMMITMENT:y("input",h.key,M.InputTypes.POR_COMMITMENT),c.porCommitment=b.inputs.porCommitment.decode(h);break;default:c.unknownKeyVals||(c.unknownKeyVals=[]),c.unknownKeyVals.push(h)}s.push(c)}for(const d of T.range(e)){const l={};for(const p of n[d])switch(b.outputs.checkPubkey(p),p.key[0]){case M.OutputTypes.REDEEM_SCRIPT:if(y("output",p.key,M.OutputTypes.REDEEM_SCRIPT),void 0!==l.redeemScript)throw new Error("Format Error: Output has multiple REDEEM_SCRIPT");l.redeemScript=b.outputs.redeemScript.decode(p);break;case M.OutputTypes.WITNESS_SCRIPT:if(y("output",p.key,M.OutputTypes.WITNESS_SCRIPT),void 0!==l.witnessScript)throw new Error("Format Error: Output has multiple WITNESS_SCRIPT");l.witnessScript=b.outputs.witnessScript.decode(p);break;case M.OutputTypes.BIP32_DERIVATION:void 0===l.bip32Derivation&&(l.bip32Derivation=[]),l.bip32Derivation.push(b.outputs.bip32Derivation.decode(p));break;default:l.unknownKeyVals||(l.unknownKeyVals=[]),l.unknownKeyVals.push(p)}a.push(l)}return{globalMap:i,inputs:s,outputs:a}}r.psbtFromBuffer=function(r,t){let n=0;function e(){var t=I.decode(r,n);n+=I.encodingLength(t);var e=r.slice(n,n+t);return n+=t,e}function i(){return{key:e(),value:e()}}function o(){if(n>=r.length)throw new Error("Format Error: Unexpected End of PSBT");var t=0===r.readUInt8(n);return t&&n++,t}if(1886610036!==(c=r.readUInt32BE(n),n+=4,c))throw new Error("Format Error: Invalid Magic Number");if(255!==(c=r.readUInt8(n),n+=1,c))throw new Error("Format Error: Magic Number must be followed by 0xff separator");const s=[],a={};for(;!o();){const b=i();var f=b.key.toString("hex");if(a[f])throw new Error("Format Error: Keys must be unique for global keymap: key "+f);a[f]=1,s.push(b)}if(1!==(c=s.filter(t=>t.key[0]===M.GlobalTypes.UNSIGNED_TX)).length)throw new Error("Format Error: Only one UNSIGNED_TX allowed");const u=t(c[0].value);var{inputCount:t,outputCount:c}=u.getInputOutputCounts();const h=[],d=[];for(const y of T.range(t)){const m={},g=[];for(;!o();){const w=i();var l=w.key.toString("hex");if(m[l])throw new Error("Format Error: Keys must be unique for each input: input index "+y+" key "+l);m[l]=1,g.push(w)}h.push(g)}for(const v of T.range(c)){const _={},S=[];for(;!o();){const E=i();var p=E.key.toString("hex");if(_[p])throw new Error("Format Error: Keys must be unique for each output: output index "+v+" key "+p);_[p]=1,S.push(E)}d.push(S)}return k(u,{globalMapKeyVals:s,inputKeyVals:h,outputKeyVals:d})},r.checkKeyBuffer=y,r.psbtFromKeyVals=k}.call(this)}.call(this,t("buffer").Buffer)},{"../converter":10,"../converter/tools":22,"../converter/varint":23,"../typeFields":28,buffer:144}],25:[function(t,e,r){"use strict";function n(t){for(var e in t)r.hasOwnProperty(e)||(r[e]=t[e])}Object.defineProperty(r,"__esModule",{value:!0}),n(t("./fromBuffer")),n(t("./toBuffer"))},{"./fromBuffer":24,"./toBuffer":26}],26:[function(t,e,f){!function(a){!function(){"use strict";Object.defineProperty(f,"__esModule",{value:!0});const n=t("../converter"),o=t("../converter/tools");f.psbtToBuffer=function({globalMap:t,inputs:e,outputs:r}){var{globalKeyVals:t,inputKeyVals:e,outputKeyVals:r}=s({globalMap:t,inputs:e,outputs:r});const n=o.keyValsToBuffer(t);e=(t=t=>0===t.length?[a.from([0])]:t.map(o.keyValsToBuffer))(e),r=t(r);const i=a.allocUnsafe(5);return i.writeUIntBE(482972169471,0,5),a.concat([i,n].concat(e,r))};const r=(t,e)=>t.key.compare(e.key);function i(t,o){const s=new Set,e=Object.entries(t).reduce((t,[e,r])=>{if("unknownKeyVals"===e)return t;e=o[e];if(void 0===e)return t;const n=(Array.isArray(r)?r:[r]).map(e.encode),i=n.map(t=>t.key.toString("hex"));return i.forEach(t=>{if(s.has(t))throw new Error("Serialize Error: Duplicate key: "+t);s.add(t)}),t.concat(n)},[]);t=t.unknownKeyVals?t.unknownKeyVals.filter(t=>!s.has(t.key.toString("hex"))):[];return e.concat(t).sort(r)}function s({globalMap:t,inputs:e,outputs:r}){return{globalKeyVals:i(t,n.globals),inputKeyVals:e.map(t=>i(t,n.inputs)),outputKeyVals:r.map(t=>i(t,n.outputs))}}f.psbtToKeyVals=s}.call(this)}.call(this,t("buffer").Buffer)},{"../converter":10,"../converter/tools":22,buffer:144}],27:[function(t,e,s){!function(o){!function(){"use strict";Object.defineProperty(s,"__esModule",{value:!0});const e=t("./combiner"),r=t("./parser"),n=t("./typeFields"),i=t("./utils");s.Psbt=class{constructor(t){this.inputs=[],this.outputs=[],this.globalMap={unsignedTx:t}}static fromBase64(t,e){t=o.from(t,"base64");return this.fromBuffer(t,e)}static fromHex(t,e){t=o.from(t,"hex");return this.fromBuffer(t,e)}static fromBuffer(t,e){t=r.psbtFromBuffer(t,e),e=new this(t.globalMap.unsignedTx);return Object.assign(e,t),e}toBase64(){const t=this.toBuffer();return t.toString("base64")}toHex(){const t=this.toBuffer();return t.toString("hex")}toBuffer(){return r.psbtToBuffer(this)}updateGlobal(t){return i.updateGlobal(t,this.globalMap),this}updateInput(t,e){t=i.checkForInput(this.inputs,t);return i.updateInput(e,t),this}updateOutput(t,e){t=i.checkForOutput(this.outputs,t);return i.updateOutput(e,t),this}addUnknownKeyValToGlobal(t){return i.checkHasKey(t,this.globalMap.unknownKeyVals,i.getEnumLength(n.GlobalTypes)),this.globalMap.unknownKeyVals||(this.globalMap.unknownKeyVals=[]),this.globalMap.unknownKeyVals.push(t),this}addUnknownKeyValToInput(t,e){const r=i.checkForInput(this.inputs,t);return i.checkHasKey(e,r.unknownKeyVals,i.getEnumLength(n.InputTypes)),r.unknownKeyVals||(r.unknownKeyVals=[]),r.unknownKeyVals.push(e),this}addUnknownKeyValToOutput(t,e){const r=i.checkForOutput(this.outputs,t);return i.checkHasKey(e,r.unknownKeyVals,i.getEnumLength(n.OutputTypes)),r.unknownKeyVals||(r.unknownKeyVals=[]),r.unknownKeyVals.push(e),this}addInput(t){this.globalMap.unsignedTx.addInput(t),this.inputs.push({unknownKeyVals:[]});const e=t.unknownKeyVals||[],r=this.inputs.length-1;if(!Array.isArray(e))throw new Error("unknownKeyVals must be an Array");return e.forEach(t=>this.addUnknownKeyValToInput(r,t)),i.addInputAttributes(this.inputs,t),this}addOutput(t){this.globalMap.unsignedTx.addOutput(t),this.outputs.push({unknownKeyVals:[]});const e=t.unknownKeyVals||[],r=this.outputs.length-1;if(!Array.isArray(e))throw new Error("unknownKeyVals must be an Array");return e.forEach(t=>this.addUnknownKeyValToInput(r,t)),i.addOutputAttributes(this.outputs,t),this}clearFinalizedInput(t){const e=i.checkForInput(this.inputs,t);i.inputCheckUncleanFinalized(t,e);for(const r of Object.keys(e))["witnessUtxo","nonWitnessUtxo","finalScriptSig","finalScriptWitness","unknownKeyVals"].includes(r)||delete e[r];return this}combine(...t){t=e.combine([this].concat(t));return Object.assign(this,t),this}getTransaction(){return this.globalMap.unsignedTx.toBuffer()}}}.call(this)}.call(this,t("buffer").Buffer)},{"./combiner":7,"./parser":25,"./typeFields":28,"./utils":29,buffer:144}],28:[function(t,e,r){"use strict";var n;Object.defineProperty(r,"__esModule",{value:!0}),(n=r.GlobalTypes||(r.GlobalTypes={}))[n.UNSIGNED_TX=0]="UNSIGNED_TX",n[n.GLOBAL_XPUB=1]="GLOBAL_XPUB",r.GLOBAL_TYPE_NAMES=["unsignedTx","globalXpub"],(n=r.InputTypes||(r.InputTypes={}))[n.NON_WITNESS_UTXO=0]="NON_WITNESS_UTXO",n[n.WITNESS_UTXO=1]="WITNESS_UTXO",n[n.PARTIAL_SIG=2]="PARTIAL_SIG",n[n.SIGHASH_TYPE=3]="SIGHASH_TYPE",n[n.REDEEM_SCRIPT=4]="REDEEM_SCRIPT",n[n.WITNESS_SCRIPT=5]="WITNESS_SCRIPT",n[n.BIP32_DERIVATION=6]="BIP32_DERIVATION",n[n.FINAL_SCRIPTSIG=7]="FINAL_SCRIPTSIG",n[n.FINAL_SCRIPTWITNESS=8]="FINAL_SCRIPTWITNESS",n[n.POR_COMMITMENT=9]="POR_COMMITMENT",r.INPUT_TYPE_NAMES=["nonWitnessUtxo","witnessUtxo","partialSig","sighashType","redeemScript","witnessScript","bip32Derivation","finalScriptSig","finalScriptWitness","porCommitment"],(n=r.OutputTypes||(r.OutputTypes={}))[n.REDEEM_SCRIPT=0]="REDEEM_SCRIPT",n[n.WITNESS_SCRIPT=1]="WITNESS_SCRIPT",n[n.BIP32_DERIVATION=2]="BIP32_DERIVATION",r.OUTPUT_TYPE_NAMES=["redeemScript","witnessScript","bip32Derivation"]},{}],29:[function(e,t,i){!function(n){!function(){"use strict";Object.defineProperty(i,"__esModule",{value:!0});const d=e("./converter");function r(t,e){t=t[e];if(void 0===t)throw new Error("No input #"+e);return t}function l(t,e,r,n){throw new Error(`Data for ${t} key ${e} is incorrect: Expected `+r+" and got "+JSON.stringify(n))}function t(h){return(t,e)=>{for(const n of Object.keys(t)){const i=t[n],{canAdd:o,canAddToArray:s,check:a,expected:f}=d[h+"s"][n]||{};var r=!!s;if(a)if(r){if(!Array.isArray(i)||e[n]&&!Array.isArray(e[n]))throw new Error(`Key type ${n} must be an array`);i.every(a)||l(h,n,f,i);const u=e[n]||[],c=new Set;if(!i.every(t=>s(u,t,c)))throw new Error("Can not add duplicate data to array");e[n]=u.concat(i)}else{if(a(i)||l(h,n,f,i),!o(e,i))throw new Error("Can not add duplicate data to "+h);e[n]=i}}}}i.checkForInput=r,i.checkForOutput=function(t,e){if(void 0===(t=t[e]))throw new Error("No output #"+e);return t},i.checkHasKey=function(e,t,r){if(e.key[0]<r)throw new Error("Use the method for your specific key instead of addUnknownKeyVal*");if(t&&0!==t.filter(t=>t.key.equals(e.key)).length)throw new Error("Duplicate Key: "+e.key.toString("hex"))},i.getEnumLength=function(t){let e=0;return Object.keys(t).forEach(t=>{Number(isNaN(Number(t)))&&e++}),e},i.inputCheckUncleanFinalized=function(t,e){let r=!1;var n,i;if((e.nonWitnessUtxo||e.witnessUtxo)&&(n=!!e.redeemScript,i=!!e.witnessScript,n=!n||!!e.finalScriptSig,i=!i||!!e.finalScriptWitness,e=!!e.finalScriptSig||!!e.finalScriptWitness,r=n&&i&&e),!1===r)throw new Error(`Input #${t} has too much or too little data to clean`)},i.updateGlobal=t("global"),i.updateInput=t("input"),i.updateOutput=t("output"),i.addInputAttributes=function(t,e){t=r(t,t.length-1),i.updateInput(e,t)},i.addOutputAttributes=function(t,e){t=r(t,t.length-1),i.updateOutput(e,t)},i.defaultVersionSetter=function(t,e){if(!n.isBuffer(e)||e.length<4)throw new Error("Set Version: Invalid Transaction");return e.writeUInt32LE(t,0),e},i.defaultLocktimeSetter=function(t,e){if(!n.isBuffer(e)||e.length<4)throw new Error("Set Locktime: Invalid Transaction");return e.writeUInt32LE(t,e.length-4),e}}.call(this)}.call(this,{isBuffer:e("../../../../../../../../opt/homebrew/lib/node_modules/browserify/node_modules/is-buffer/index.js")})},{"../../../../../../../../opt/homebrew/lib/node_modules/browserify/node_modules/is-buffer/index.js":148,"./converter":10}],30:[function(t,e,r){!function(w){!function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.toOutputScript=r.fromOutputScript=r.toBech32=r.toBase58Check=r.fromBech32=r.fromBase58Check=void 0;const i=t("./networks"),o=t("./payments"),s=t("./script"),n=t("./types"),a=t("bech32"),f=t("bs58check"),u=n["typeforce"],c=40,h=2,d=16,l=1,p=80,b="WARNING: Sending to a future segwit version address can lead to loss of funds. End users MUST be warned carefully in the GUI and asked if they wish to proceed with caution. Wallets should verify the segwit version from the output of fromBech32, then decide when it is safe to use which version of segwit.";function y(t){const e=f.decode(t);if(e.length<21)throw new TypeError(t+" is too short");if(21<e.length)throw new TypeError(t+" is too long");return{version:e.readUInt8(0),hash:e.slice(1)}}function m(t){let e,r;try{e=a.bech32.decode(t)}catch(t){}if(e){if(r=e.words[0],0!==r)throw new TypeError(t+" uses wrong encoding")}else if(e=a.bech32m.decode(t),r=e.words[0],0===r)throw new TypeError(t+" uses wrong encoding");t=a.bech32.fromWords(e.words.slice(1));return{version:r,prefix:e.prefix,data:w.from(t)}}function g(t,e,r){const n=a.bech32.toWords(t);return n.unshift(e),(0===e?a.bech32:a.bech32m).encode(r,n)}r.fromBase58Check=y,r.fromBech32=m,r.toBase58Check=function(t,e){u(n.tuple(n.Hash160bit,n.UInt8),arguments);const r=w.allocUnsafe(21);return r.writeUInt8(e,0),t.copy(r,1),f.encode(r)},r.toBech32=g,r.fromOutputScript=function(t,e){e=e||i.bitcoin;try{return o.p2pkh({output:t,network:e}).address}catch(t){}try{return o.p2sh({output:t,network:e}).address}catch(t){}try{return o.p2wpkh({output:t,network:e}).address}catch(t){}try{return o.p2wsh({output:t,network:e}).address}catch(t){}try{return function(t,e){var r=t.slice(2);if(r.length<h||r.length>c)throw new TypeError("Invalid program length for segwit address");var n=t[0]-p;if(n<l||n>d)throw new TypeError("Invalid version for segwit address");if(t[1]!==r.length)throw new TypeError("Invalid script for segwit address");return console.warn(b),g(r,n,e.bech32)}(t,e)}catch(t){}throw new Error(s.toASM(t)+" has no matching Address")},r.toOutputScript=function(t,e){e=e||i.bitcoin;let r,n;try{r=y(t)}catch(t){}if(r){if(r.version===e.pubKeyHash)return o.p2pkh({hash:r.hash}).output;if(r.version===e.scriptHash)return o.p2sh({hash:r.hash}).output}else{try{n=m(t)}catch(t){}if(n){if(n.prefix!==e.bech32)throw new Error(t+" has an invalid prefix");if(0===n.version){if(20===n.data.length)return o.p2wpkh({hash:n.data}).output;if(32===n.data.length)return o.p2wsh({hash:n.data}).output}else if(n.version>=l&&n.version<=d&&n.data.length>=h&&n.data.length<=c)return console.warn(b),s.compile([n.version+p,n.data])}}throw new Error(t+" has no matching Script")}}.call(this)}.call(this,t("buffer").Buffer)},{"./networks":37,"./payments":40,"./script":50,"./types":54,bech32:2,bs58check:59,buffer:144}],31:[function(t,e,r){!function(o){!function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.encode=r.decode=r.check=void 0,r.check=function(t){if(t.length<8)return!1;if(72<t.length)return!1;if(48!==t[0])return!1;if(t[1]!==t.length-2)return!1;if(2!==t[2])return!1;var e=t[3];if(0===e)return!1;if(5+e>=t.length)return!1;if(2!==t[4+e])return!1;var r=t[5+e];return 0!==r&&(6+e+r===t.length&&(!(128&t[4])&&(!(1<e&&0===t[4]&&!(128&t[5]))&&(!(128&t[e+6])&&!(1<r&&0===t[e+6]&&!(128&t[e+7]))))))},r.decode=function(t){if(t.length<8)throw new Error("DER sequence length is too short");if(72<t.length)throw new Error("DER sequence length is too long");if(48!==t[0])throw new Error("Expected DER sequence");if(t[1]!==t.length-2)throw new Error("DER sequence length is invalid");if(2!==t[2])throw new Error("Expected DER integer");var e=t[3];if(0===e)throw new Error("R length is zero");if(5+e>=t.length)throw new Error("R length is too long");if(2!==t[4+e])throw new Error("Expected DER integer (2)");var r=t[5+e];if(0===r)throw new Error("S length is zero");if(6+e+r!==t.length)throw new Error("S length is invalid");if(128&t[4])throw new Error("R value is negative");if(1<e&&0===t[4]&&!(128&t[5]))throw new Error("R value excessively padded");if(128&t[e+6])throw new Error("S value is negative");if(1<r&&0===t[e+6]&&!(128&t[e+7]))throw new Error("S value excessively padded");return{r:t.slice(4,4+e),s:t.slice(6+e)}},r.encode=function(t,e){var r=t.length,n=e.length;if(0===r)throw new Error("R length is zero");if(0===n)throw new Error("S length is zero");if(33<r)throw new Error("R length is too long");if(33<n)throw new Error("S length is too long");if(128&t[0])throw new Error("R value is negative");if(128&e[0])throw new Error("S value is negative");if(1<r&&0===t[0]&&!(128&t[1]))throw new Error("R value excessively padded");if(1<n&&0===e[0]&&!(128&e[1]))throw new Error("S value excessively padded");const i=o.allocUnsafe(6+r+n);return i[0]=48,i[1]=i.length-2,i[2]=2,i[3]=t.length,t.copy(i,4),i[4+r]=2,i[5+r]=e.length,e.copy(i,6+r),i}}.call(this)}.call(this,t("buffer").Buffer)},{buffer:144}],32:[function(t,e,r){!function(l){!function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Block=void 0;const o=t("./bufferutils"),n=t("./crypto"),i=t("./merkle"),s=t("./transaction"),a=t("./types"),f=a["typeforce"],u=new TypeError("Cannot compute merkle root for zero transactions"),c=new TypeError("Cannot compute witness commit for non-segwit block");class h{constructor(){this.version=1,this.prevHash=void 0,this.merkleRoot=void 0,this.timestamp=0,this.witnessCommit=void 0,this.bits=0,this.nonce=0,this.transactions=void 0}static fromBuffer(t){if(t.length<80)throw new Error("Buffer too small (< 80 bytes)");const e=new o.BufferReader(t),r=new h;if(r.version=e.readInt32(),r.prevHash=e.readSlice(32),r.merkleRoot=e.readSlice(32),r.timestamp=e.readUInt32(),r.bits=e.readUInt32(),r.nonce=e.readUInt32(),80===t.length)return r;var n=e.readVarInt();r.transactions=[];for(let t=0;t<n;++t){var i=(()=>{const t=s.Transaction.fromBuffer(e.buffer.slice(e.offset),!0);return e.offset+=t.byteLength(),t})();r.transactions.push(i)}t=r.getWitnessCommit();return t&&(r.witnessCommit=t),r}static fromHex(t){return h.fromBuffer(l.from(t,"hex"))}static calculateTarget(t){var e=((4278190080&t)>>24)-3,t=8388607&t;const r=l.alloc(32,0);return r.writeUIntBE(t,29-e,3),r}static calculateMerkleRoot(t,e){if(f([{getHash:a.Function}],t),0===t.length)throw u;if(e&&!d(t))throw c;var r=t.map(t=>t.getHash(e)),r=(0,i.fastMerkleRoot)(r,n.hash256);return e?n.hash256(l.concat([r,t[0].ins[0].witness[0]])):r}getWitnessCommit(){if(!d(this.transactions))return null;var t=this.transactions[0].outs.filter(t=>t.script.slice(0,6).equals(l.from("6a24aa21a9ed","hex"))).map(t=>t.script.slice(6,38));if(0===t.length)return null;t=t[t.length-1];return t instanceof l&&32===t.length?t:null}hasWitnessCommit(){return this.witnessCommit instanceof l&&32===this.witnessCommit.length||null!==this.getWitnessCommit()}hasWitness(){return(t=this.transactions)instanceof Array&&t.some(t=>"object"==typeof t&&t.ins instanceof Array&&t.ins.some(t=>"object"==typeof t&&t.witness instanceof Array&&0<t.witness.length));var t}weight(){return 3*this.byteLength(!1,!1)+this.byteLength(!1,!0)}byteLength(t,r=!0){return t||!this.transactions?80:80+o.varuint.encodingLength(this.transactions.length)+this.transactions.reduce((t,e)=>t+e.byteLength(r),0)}getHash(){return n.hash256(this.toBuffer(!0))}getId(){return(0,o.reverseBuffer)(this.getHash()).toString("hex")}getUTCDate(){const t=new Date(0);return t.setUTCSeconds(this.timestamp),t}toBuffer(t){const r=l.allocUnsafe(this.byteLength(t)),n=new o.BufferWriter(r);return n.writeInt32(this.version),n.writeSlice(this.prevHash),n.writeSlice(this.merkleRoot),n.writeUInt32(this.timestamp),n.writeUInt32(this.bits),n.writeUInt32(this.nonce),t||!this.transactions||(o.varuint.encode(this.transactions.length,r,n.offset),n.offset+=o.varuint.encode.bytes,this.transactions.forEach(t=>{var e=t.byteLength();t.toBuffer(r,n.offset),n.offset+=e})),r}toHex(t){return this.toBuffer(t).toString("hex")}checkTxRoots(){var t=this.hasWitnessCommit();return!(!t&&this.hasWitness())&&(this.__checkMerkleRoot()&&(!t||this.__checkWitnessCommit()))}checkProofOfWork(){const t=(0,o.reverseBuffer)(this.getHash());var e=h.calculateTarget(this.bits);return t.compare(e)<=0}__checkMerkleRoot(){if(!this.transactions)throw u;var t=h.calculateMerkleRoot(this.transactions);return 0===this.merkleRoot.compare(t)}__checkWitnessCommit(){if(!this.transactions)throw u;if(!this.hasWitnessCommit())throw c;var t=h.calculateMerkleRoot(this.transactions,!0);return 0===this.witnessCommit.compare(t)}}function d(t){return t instanceof Array&&t[0]&&t[0].ins&&t[0].ins instanceof Array&&t[0].ins[0]&&t[0].ins[0].witness&&t[0].ins[0].witness instanceof Array&&0<t[0].ins[0].witness.length}r.Block=h}.call(this)}.call(this,t("buffer").Buffer)},{"./bufferutils":33,"./crypto":34,"./merkle":36,"./transaction":53,"./types":54,buffer:144}],33:[function(t,e,u){!function(f){!function(){"use strict";Object.defineProperty(u,"__esModule",{value:!0}),u.BufferReader=u.BufferWriter=u.cloneBuffer=u.reverseBuffer=u.writeUInt64LE=u.readUInt64LE=u.varuint=void 0;const r=t("./types"),n=r["typeforce"],e=t("varuint-bitcoin");function i(t,e){if("number"!=typeof t)throw new Error("cannot write a non-number as a number");if(t<0)throw new Error("specified a negative value for writing an unsigned value");if(e<t)throw new Error("RangeError: value out of range");if(Math.floor(t)!==t)throw new Error("value has a fractional component")}function o(t,e){var r=t.readUInt32LE(e),e=t.readUInt32LE(e+4);return i((e*=4294967296)+r,9007199254740991),e+r}function s(t,e,r){return i(e,9007199254740991),t.writeInt32LE(-1&e,r),t.writeUInt32LE(Math.floor(e/4294967296),r+4),r+8}u.varuint=e,u.readUInt64LE=o,u.writeUInt64LE=s,u.reverseBuffer=function(e){if(e.length<1)return e;let r=e.length-1;var n;for(let t=0;t<e.length/2;t++)n=e[t],e[t]=e[r],e[r]=n,r--;return e},u.cloneBuffer=function(t){var e=f.allocUnsafe(t.length);return t.copy(e),e};u.BufferWriter=class a{constructor(t,e=0){this.buffer=t,this.offset=e,n(r.tuple(r.Buffer,r.UInt32),[t,e])}static withCapacity(t){return new a(f.alloc(t))}writeUInt8(t){this.offset=this.buffer.writeUInt8(t,this.offset)}writeInt32(t){this.offset=this.buffer.writeInt32LE(t,this.offset)}writeUInt32(t){this.offset=this.buffer.writeUInt32LE(t,this.offset)}writeUInt64(t){this.offset=s(this.buffer,t,this.offset)}writeVarInt(t){e.encode(t,this.buffer,this.offset),this.offset+=e.encode.bytes}writeSlice(t){if(this.buffer.length<this.offset+t.length)throw new Error("Cannot write slice out of bounds");this.offset+=t.copy(this.buffer,this.offset)}writeVarSlice(t){this.writeVarInt(t.length),this.writeSlice(t)}writeVector(t){this.writeVarInt(t.length),t.forEach(t=>this.writeVarSlice(t))}end(){if(this.buffer.length===this.offset)return this.buffer;throw new Error(`buffer size ${this.buffer.length}, offset `+this.offset)}};u.BufferReader=class{constructor(t,e=0){this.buffer=t,this.offset=e,n(r.tuple(r.Buffer,r.UInt32),[t,e])}readUInt8(){var t=this.buffer.readUInt8(this.offset);return this.offset++,t}readInt32(){var t=this.buffer.readInt32LE(this.offset);return this.offset+=4,t}readUInt32(){var t=this.buffer.readUInt32LE(this.offset);return this.offset+=4,t}readUInt64(){var t=o(this.buffer,this.offset);return this.offset+=8,t}readVarInt(){var t=e.decode(this.buffer,this.offset);return this.offset+=e.decode.bytes,t}readSlice(t){if(this.buffer.length<this.offset+t)throw new Error("Cannot read slice out of bounds");var e=this.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e}readVarSlice(){return this.readSlice(this.readVarInt())}readVector(){var e=this.readVarInt();const r=[];for(let t=0;t<e;t++)r.push(this.readVarSlice());return r}}}.call(this)}.call(this,t("buffer").Buffer)},{"./types":54,buffer:144,"varuint-bitcoin":136}],34:[function(t,e,s){!function(o){!function(){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.taggedHash=s.hash256=s.hash160=s.sha256=s.sha1=s.ripemd160=void 0;const r=t("create-hash");function e(e){try{return r("rmd160").update(e).digest()}catch(t){return r("ripemd160").update(e).digest()}}function n(t){return r("sha256").update(t).digest()}s.ripemd160=e,s.sha1=function(t){return r("sha1").update(t).digest()},s.sha256=n,s.hash160=function(t){return e(n(t))},s.hash256=function(t){return n(n(t))};const i=Object.fromEntries(["BIP0340/challenge","BIP0340/aux","BIP0340/nonce","TapLeaf","TapBranch","TapSighash","TapTweak","KeyAgg list","KeyAgg coefficient"].map(t=>{var e=n(o.from(t));return[t,o.concat([e,e])]}));s.taggedHash=function(t,e){return n(o.concat([i[t],e]))}}.call(this)}.call(this,t("buffer").Buffer)},{buffer:144,"create-hash":61}],35:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Transaction=r.opcodes=r.Psbt=r.Block=r.script=r.payments=r.networks=r.crypto=r.address=void 0;var n=t("./address");r.address=n;n=t("./crypto");r.crypto=n;n=t("./networks");r.networks=n;n=t("./payments");r.payments=n;n=t("./script");r.script=n;var i=t("./block");Object.defineProperty(r,"Block",{enumerable:!0,get:function(){return i.Block}});var o=t("./psbt");Object.defineProperty(r,"Psbt",{enumerable:!0,get:function(){return o.Psbt}});var s=t("./ops");Object.defineProperty(r,"opcodes",{enumerable:!0,get:function(){return s.OPS}});var a=t("./transaction");Object.defineProperty(r,"Transaction",{enumerable:!0,get:function(){return a.Transaction}})},{"./address":30,"./block":32,"./crypto":34,"./networks":37,"./ops":38,"./payments":40,"./psbt":48,"./script":50,"./transaction":53}],36:[function(t,e,r){!function(a){!function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.fastMerkleRoot=void 0,r.fastMerkleRoot=function(t,r){if(!Array.isArray(t))throw TypeError("Expected values Array");if("function"!=typeof r)throw TypeError("Expected digest Function");let n=t.length;const i=t.concat();for(;1<n;){let e=0;for(let t=0;t<n;t+=2,++e){var o=i[t],s=t+1===n?o:i[t+1],s=a.concat([o,s]);i[e]=r(s)}n=e}return i[0]}}.call(this)}.call(this,t("buffer").Buffer)},{buffer:144}],37:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.testnet=r.regtest=r.bitcoin=void 0,r.bitcoin={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},r.regtest={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},r.testnet={messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}},{}],38:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.REVERSE_OPS=r.OPS=void 0;var n={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};r.OPS=n;const i={};r.REVERSE_OPS=i;for(const s of Object.keys(n)){var o=n[s];i[o]=s}},{}],39:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.p2data=void 0;const o=t("../networks"),s=t("../script"),a=t("../types"),f=t("./lazy"),u=s.OPS;r.p2data=function(t,e){if(!t.data&&!t.output)throw new TypeError("Not enough data");e=Object.assign({validate:!0},e||{}),(0,a.typeforce)({network:a.typeforce.maybe(a.typeforce.Object),output:a.typeforce.maybe(a.typeforce.Buffer),data:a.typeforce.maybe(a.typeforce.arrayOf(a.typeforce.Buffer))},t);var r,n={name:"embed",network:t.network||o.bitcoin};if(f.prop(n,"output",()=>{if(t.data)return s.compile([u.OP_RETURN].concat(t.data))}),f.prop(n,"data",()=>{if(t.output)return s.decompile(t.output).slice(1)}),e.validate&&t.output){const i=s.decompile(t.output);if(i[0]!==u.OP_RETURN)throw new TypeError("Output is invalid");if(!i.slice(1).every(a.typeforce.Buffer))throw new TypeError("Output is invalid");if(t.data&&(e=t.data,r=n.data,e.length!==r.length||!e.every((t,e)=>t.equals(r[e]))))throw new TypeError("Data mismatch")}return Object.assign(n,t)}},{"../networks":37,"../script":50,"../types":54,"./lazy":41}],40:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.p2wsh=r.p2wpkh=r.p2sh=r.p2pkh=r.p2pk=r.p2ms=r.embed=void 0;const n=t("./embed");Object.defineProperty(r,"embed",{enumerable:!0,get:function(){return n.p2data}});const i=t("./p2ms");Object.defineProperty(r,"p2ms",{enumerable:!0,get:function(){return i.p2ms}});const o=t("./p2pk");Object.defineProperty(r,"p2pk",{enumerable:!0,get:function(){return o.p2pk}});const s=t("./p2pkh");Object.defineProperty(r,"p2pkh",{enumerable:!0,get:function(){return s.p2pkh}});const a=t("./p2sh");Object.defineProperty(r,"p2sh",{enumerable:!0,get:function(){return a.p2sh}});const f=t("./p2wpkh");Object.defineProperty(r,"p2wpkh",{enumerable:!0,get:function(){return f.p2wpkh}});const u=t("./p2wsh");Object.defineProperty(r,"p2wsh",{enumerable:!0,get:function(){return u.p2wsh}})},{"./embed":39,"./p2ms":42,"./p2pk":43,"./p2pkh":44,"./p2sh":45,"./p2wpkh":46,"./p2wsh":47}],41:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.value=r.prop=void 0,r.prop=function(t,e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){var t=r.call(this);return this[e]=t},set(t){Object.defineProperty(this,e,{configurable:!0,enumerable:!0,value:t,writable:!0})}})},r.value=function(t){let e;return()=>(void 0!==e||(e=t()),e)}},{}],42:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.p2ms=void 0;const a=t("../networks"),f=t("../script"),u=t("../types"),c=t("./lazy"),h=f.OPS,d=h.OP_RESERVED;function l(t,r){return t.length===r.length&&t.every((t,e)=>t.equals(r[e]))}r.p2ms=function(t,e){if(!(t.input||t.output||t.pubkeys&&void 0!==t.m||t.signatures))throw new TypeError("Not enough data");function r(t){return f.isCanonicalScriptSignature(t)||void 0!==(e.allowIncomplete&&t===h.OP_0)}e=Object.assign({validate:!0},e||{}),(0,u.typeforce)({network:u.typeforce.maybe(u.typeforce.Object),m:u.typeforce.maybe(u.typeforce.Number),n:u.typeforce.maybe(u.typeforce.Number),output:u.typeforce.maybe(u.typeforce.Buffer),pubkeys:u.typeforce.maybe(u.typeforce.arrayOf(u.isPoint)),signatures:u.typeforce.maybe(u.typeforce.arrayOf(r)),input:u.typeforce.maybe(u.typeforce.Buffer)},t);const n={network:t.network||a.bitcoin};let i=[],o=!1;function s(t){o||(o=!0,i=f.decompile(t),n.m=i[0]-d,n.n=i[i.length-2]-d,n.pubkeys=i.slice(1,-2))}if(c.prop(n,"output",()=>{if(t.m&&n.n&&t.pubkeys)return f.compile([].concat(d+t.m,t.pubkeys,d+n.n,h.OP_CHECKMULTISIG))}),c.prop(n,"m",()=>{if(n.output)return s(n.output),n.m}),c.prop(n,"n",()=>{if(n.pubkeys)return n.pubkeys.length}),c.prop(n,"pubkeys",()=>{if(t.output)return s(t.output),n.pubkeys}),c.prop(n,"signatures",()=>{if(t.input)return f.decompile(t.input).slice(1)}),c.prop(n,"input",()=>{if(t.signatures)return f.compile([h.OP_0].concat(t.signatures))}),c.prop(n,"witness",()=>{if(n.input)return[]}),c.prop(n,"name",()=>{if(n.m&&n.n)return`p2ms(${n.m} of ${n.n})`}),e.validate){if(t.output){if(s(t.output),!u.typeforce.Number(i[0]))throw new TypeError("Output is invalid");if(!u.typeforce.Number(i[i.length-2]))throw new TypeError("Output is invalid");if(i[i.length-1]!==h.OP_CHECKMULTISIG)throw new TypeError("Output is invalid");if(n.m<=0||16<n.n||n.m>n.n||n.n!==i.length-3)throw new TypeError("Output is invalid");if(!n.pubkeys.every(t=>(0,u.isPoint)(t)))throw new TypeError("Output is invalid");if(void 0!==t.m&&t.m!==n.m)throw new TypeError("m mismatch");if(void 0!==t.n&&t.n!==n.n)throw new TypeError("n mismatch");if(t.pubkeys&&!l(t.pubkeys,n.pubkeys))throw new TypeError("Pubkeys mismatch")}if(t.pubkeys){if(void 0!==t.n&&t.n!==t.pubkeys.length)throw new TypeError("Pubkey count mismatch");if(n.n=t.pubkeys.length,n.n<n.m)throw new TypeError("Pubkey count cannot be less than m")}if(t.signatures){if(t.signatures.length<n.m)throw new TypeError("Not enough signatures provided");if(t.signatures.length>n.m)throw new TypeError("Too many signatures provided")}if(t.input){if(t.input[0]!==h.OP_0)throw new TypeError("Input is invalid");if(0===n.signatures.length||!n.signatures.every(r))throw new TypeError("Input has invalid signature(s)");if(t.signatures&&!l(t.signatures,n.signatures))throw new TypeError("Signature mismatch");if(void 0!==t.m&&t.m!==t.signatures.length)throw new TypeError("Signature count mismatch")}}return Object.assign(n,t)}},{"../networks":37,"../script":50,"../types":54,"./lazy":41}],43:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.p2pk=void 0;const i=t("../networks"),o=t("../script"),s=t("../types"),a=t("./lazy"),f=o.OPS;r.p2pk=function(t,e){if(!(t.input||t.output||t.pubkey||t.input||t.signature))throw new TypeError("Not enough data");e=Object.assign({validate:!0},e||{}),(0,s.typeforce)({network:s.typeforce.maybe(s.typeforce.Object),output:s.typeforce.maybe(s.typeforce.Buffer),pubkey:s.typeforce.maybe(s.isPoint),signature:s.typeforce.maybe(o.isCanonicalScriptSignature),input:s.typeforce.maybe(s.typeforce.Buffer)},t);const r=a.value(()=>o.decompile(t.input)),n={name:"p2pk",network:t.network||i.bitcoin};if(a.prop(n,"output",()=>{if(t.pubkey)return o.compile([t.pubkey,f.OP_CHECKSIG])}),a.prop(n,"pubkey",()=>{if(t.output)return t.output.slice(1,-1)}),a.prop(n,"signature",()=>{if(t.input)return r()[0]}),a.prop(n,"input",()=>{if(t.signature)return o.compile([t.signature])}),a.prop(n,"witness",()=>{if(n.input)return[]}),e.validate){if(t.output){if(t.output[t.output.length-1]!==f.OP_CHECKSIG)throw new TypeError("Output is invalid");if(!(0,s.isPoint)(n.pubkey))throw new TypeError("Output pubkey is invalid");if(t.pubkey&&!t.pubkey.equals(n.pubkey))throw new TypeError("Pubkey mismatch")}if(t.signature&&t.input&&!t.input.equals(n.input))throw new TypeError("Signature mismatch");if(t.input){if(1!==r().length)throw new TypeError("Input is invalid");if(!o.isCanonicalScriptSignature(n.signature))throw new TypeError("Input has invalid signature")}}return Object.assign(n,t)}},{"../networks":37,"../script":50,"../types":54,"./lazy":41}],44:[function(e,t,r){!function(p){!function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.p2pkh=void 0;const f=e("../crypto"),t=e("../networks"),u=e("../script"),c=e("../types"),h=e("./lazy"),d=e("bs58check"),l=u.OPS;r.p2pkh=function(e,r){if(!(e.address||e.hash||e.output||e.pubkey||e.input))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),(0,c.typeforce)({network:c.typeforce.maybe(c.typeforce.Object),address:c.typeforce.maybe(c.typeforce.String),hash:c.typeforce.maybe(c.typeforce.BufferN(20)),output:c.typeforce.maybe(c.typeforce.BufferN(25)),pubkey:c.typeforce.maybe(c.isPoint),signature:c.typeforce.maybe(u.isCanonicalScriptSignature),input:c.typeforce.maybe(c.typeforce.Buffer)},e);const n=h.value(()=>{const t=d.decode(e.address);return{version:t.readUInt8(0),hash:t.slice(1)}}),i=h.value(()=>u.decompile(e.input)),o=e.network||t.bitcoin,s={name:"p2pkh",network:o};if(h.prop(s,"address",()=>{if(s.hash){const t=p.allocUnsafe(21);return t.writeUInt8(o.pubKeyHash,0),s.hash.copy(t,1),d.encode(t)}}),h.prop(s,"hash",()=>e.output?e.output.slice(3,23):e.address?n().hash:e.pubkey||s.pubkey?f.hash160(e.pubkey||s.pubkey):void 0),h.prop(s,"output",()=>{if(s.hash)return u.compile([l.OP_DUP,l.OP_HASH160,s.hash,l.OP_EQUALVERIFY,l.OP_CHECKSIG])}),h.prop(s,"pubkey",()=>{if(e.input)return i()[1]}),h.prop(s,"signature",()=>{if(e.input)return i()[0]}),h.prop(s,"input",()=>{if(e.pubkey&&e.signature)return u.compile([e.signature,e.pubkey])}),h.prop(s,"witness",()=>{if(s.input)return[]}),r.validate){let t=p.from([]);if(e.address){if(n().version!==o.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==n().hash.length)throw new TypeError("Invalid address");t=n().hash}if(e.hash){if(0<t.length&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(25!==e.output.length||e.output[0]!==l.OP_DUP||e.output[1]!==l.OP_HASH160||20!==e.output[2]||e.output[23]!==l.OP_EQUALVERIFY||e.output[24]!==l.OP_CHECKSIG)throw new TypeError("Output is invalid");r=e.output.slice(3,23);if(0<t.length&&!t.equals(r))throw new TypeError("Hash mismatch");t=r}if(e.pubkey){var a=f.hash160(e.pubkey);if(0<t.length&&!t.equals(a))throw new TypeError("Hash mismatch");t=a}if(e.input){a=i();if(2!==a.length)throw new TypeError("Input is invalid");if(!u.isCanonicalScriptSignature(a[0]))throw new TypeError("Input has invalid signature");if(!(0,c.isPoint)(a[1]))throw new TypeError("Input has invalid pubkey");if(e.signature&&!e.signature.equals(a[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(a[1]))throw new TypeError("Pubkey mismatch");a=f.hash160(a[1]);if(0<t.length&&!t.equals(a))throw new TypeError("Hash mismatch")}}return Object.assign(s,e)}}.call(this)}.call(this,e("buffer").Buffer)},{"../crypto":34,"../networks":37,"../script":50,"../types":54,"./lazy":41,bs58check:59,buffer:144}],45:[function(t,e,r){!function(m){!function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.p2sh=void 0;const c=t("../crypto"),h=t("../networks"),d=t("../script"),l=t("../types"),p=t("./lazy"),b=t("bs58check"),y=d.OPS;r.p2sh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,l.typeforce)({network:l.typeforce.maybe(l.typeforce.Object),address:l.typeforce.maybe(l.typeforce.String),hash:l.typeforce.maybe(l.typeforce.BufferN(20)),output:l.typeforce.maybe(l.typeforce.BufferN(23)),redeem:l.typeforce.maybe({network:l.typeforce.maybe(l.typeforce.Object),output:l.typeforce.maybe(l.typeforce.Buffer),input:l.typeforce.maybe(l.typeforce.Buffer),witness:l.typeforce.maybe(l.typeforce.arrayOf(l.typeforce.Buffer))}),input:l.typeforce.maybe(l.typeforce.Buffer),witness:l.typeforce.maybe(l.typeforce.arrayOf(l.typeforce.Buffer))},e);let r=e.network;r=r||(e.redeem&&e.redeem.network||h.bitcoin);const n={network:r},i=p.value(()=>{const t=b.decode(e.address);return{version:t.readUInt8(0),hash:t.slice(1)}}),o=p.value(()=>d.decompile(e.input)),s=p.value(()=>{const t=o();return{network:r,output:t[t.length-1],input:d.compile(t.slice(0,-1)),witness:e.witness||[]}});if(p.prop(n,"address",()=>{if(n.hash){const t=m.allocUnsafe(21);return t.writeUInt8(n.network.scriptHash,0),n.hash.copy(t,1),b.encode(t)}}),p.prop(n,"hash",()=>e.output?e.output.slice(2,22):e.address?i().hash:n.redeem&&n.redeem.output?c.hash160(n.redeem.output):void 0),p.prop(n,"output",()=>{if(n.hash)return d.compile([y.OP_HASH160,n.hash,y.OP_EQUAL])}),p.prop(n,"redeem",()=>{if(e.input)return s()}),p.prop(n,"input",()=>{if(e.redeem&&e.redeem.input&&e.redeem.output)return d.compile([].concat(d.decompile(e.redeem.input),e.redeem.output))}),p.prop(n,"witness",()=>n.redeem&&n.redeem.witness?n.redeem.witness:n.input?[]:void 0),p.prop(n,"name",()=>{const t=["p2sh"];return void 0!==n.redeem&&void 0!==n.redeem.name&&t.push(n.redeem.name),t.join("-")}),t.validate){let n=m.from([]);if(e.address){if(i().version!==r.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(20!==i().hash.length)throw new TypeError("Invalid address");n=i().hash}if(e.hash){if(0<n.length&&!n.equals(e.hash))throw new TypeError("Hash mismatch");n=e.hash}if(e.output){if(23!==e.output.length||e.output[0]!==y.OP_HASH160||20!==e.output[1]||e.output[22]!==y.OP_EQUAL)throw new TypeError("Output is invalid");var a=e.output.slice(2,22);if(0<n.length&&!n.equals(a))throw new TypeError("Hash mismatch");n=a}a=t=>{if(t.output){var e=d.decompile(t.output);if(!e||e.length<1)throw new TypeError("Redeem.output too short");var r=c.hash160(t.output);if(0<n.length&&!n.equals(r))throw new TypeError("Hash mismatch");n=r}if(t.input){e=0<t.input.length,r=t.witness&&0<t.witness.length;if(!e&&!r)throw new TypeError("Empty input");if(e&&r)throw new TypeError("Input and witness provided");if(e){t=d.decompile(t.input);if(!d.isPushOnly(t))throw new TypeError("Non push-only scriptSig")}}};if(e.input){var f=o();if(!f||f.length<1)throw new TypeError("Input too short");if(!m.isBuffer(s().output))throw new TypeError("Input is invalid");a(s())}if(e.redeem){if(e.redeem.network&&e.redeem.network!==r)throw new TypeError("Network mismatch");if(e.input){f=s();if(e.redeem.output&&!e.redeem.output.equals(f.output))throw new TypeError("Redeem.output mismatch");if(e.redeem.input&&!e.redeem.input.equals(f.input))throw new TypeError("Redeem.input mismatch")}a(e.redeem)}if(e.witness&&e.redeem&&e.redeem.witness&&(a=e.redeem.witness,u=e.witness,a.length!==u.length||!a.every((t,e)=>t.equals(u[e]))))throw new TypeError("Witness and redeem.witness mismatch")}var u;return Object.assign(n,e)}}.call(this)}.call(this,t("buffer").Buffer)},{"../crypto":34,"../networks":37,"../script":50,"../types":54,"./lazy":41,bs58check:59,buffer:144}],46:[function(t,e,r){!function(p){!function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.p2wpkh=void 0;const s=t("../crypto"),a=t("../networks"),f=t("../script"),u=t("../types"),c=t("./lazy"),h=t("bech32"),d=f.OPS,l=p.alloc(0);r.p2wpkh=function(n,t){if(!(n.address||n.hash||n.output||n.pubkey||n.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,u.typeforce)({address:u.typeforce.maybe(u.typeforce.String),hash:u.typeforce.maybe(u.typeforce.BufferN(20)),input:u.typeforce.maybe(u.typeforce.BufferN(0)),network:u.typeforce.maybe(u.typeforce.Object),output:u.typeforce.maybe(u.typeforce.BufferN(22)),pubkey:u.typeforce.maybe(u.isPoint),signature:u.typeforce.maybe(f.isCanonicalScriptSignature),witness:u.typeforce.maybe(u.typeforce.arrayOf(u.typeforce.Buffer))},n);const e=c.value(()=>{const t=h.bech32.decode(n.address);var e=t.words.shift(),r=h.bech32.fromWords(t.words);return{version:e,prefix:t.prefix,data:p.from(r)}}),r=n.network||a.bitcoin,i={name:"p2wpkh",network:r};if(c.prop(i,"address",()=>{if(i.hash){const t=h.bech32.toWords(i.hash);return t.unshift(0),h.bech32.encode(r.bech32,t)}}),c.prop(i,"hash",()=>n.output?n.output.slice(2,22):n.address?e().data:n.pubkey||i.pubkey?s.hash160(n.pubkey||i.pubkey):void 0),c.prop(i,"output",()=>{if(i.hash)return f.compile([d.OP_0,i.hash])}),c.prop(i,"pubkey",()=>n.pubkey||(n.witness?n.witness[1]:void 0)),c.prop(i,"signature",()=>{if(n.witness)return n.witness[0]}),c.prop(i,"input",()=>{if(i.witness)return l}),c.prop(i,"witness",()=>{if(n.pubkey&&n.signature)return[n.signature,n.pubkey]}),t.validate){let t=p.from([]);if(n.address){if(r&&r.bech32!==e().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(0!==e().version)throw new TypeError("Invalid address version");if(20!==e().data.length)throw new TypeError("Invalid address data");t=e().data}if(n.hash){if(0<t.length&&!t.equals(n.hash))throw new TypeError("Hash mismatch");t=n.hash}if(n.output){if(22!==n.output.length||n.output[0]!==d.OP_0||20!==n.output[1])throw new TypeError("Output is invalid");if(0<t.length&&!t.equals(n.output.slice(2)))throw new TypeError("Hash mismatch");t=n.output.slice(2)}if(n.pubkey){var o=s.hash160(n.pubkey);if(0<t.length&&!t.equals(o))throw new TypeError("Hash mismatch");if(t=o,!(0,u.isPoint)(n.pubkey)||33!==n.pubkey.length)throw new TypeError("Invalid pubkey for p2wpkh")}if(n.witness){if(2!==n.witness.length)throw new TypeError("Witness is invalid");if(!f.isCanonicalScriptSignature(n.witness[0]))throw new TypeError("Witness has invalid signature");if(!(0,u.isPoint)(n.witness[1])||33!==n.witness[1].length)throw new TypeError("Witness has invalid pubkey");if(n.signature&&!n.signature.equals(n.witness[0]))throw new TypeError("Signature mismatch");if(n.pubkey&&!n.pubkey.equals(n.witness[1]))throw new TypeError("Pubkey mismatch");o=s.hash160(n.witness[1]);if(0<t.length&&!t.equals(o))throw new TypeError("Hash mismatch")}}return Object.assign(i,n)}}.call(this)}.call(this,t("buffer").Buffer)},{"../crypto":34,"../networks":37,"../script":50,"../types":54,"./lazy":41,bech32:2,buffer:144}],47:[function(t,e,r){!function(g){!function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.p2wsh=void 0;const u=t("../crypto"),c=t("../networks"),h=t("../script"),d=t("../types"),l=t("./lazy"),p=t("bech32"),b=h.OPS,y=g.alloc(0);function m(t){return!(!g.isBuffer(t)||65!==t.length||4!==t[0]||!(0,d.isPoint)(t))}r.p2wsh=function(n,t){if(!(n.address||n.hash||n.output||n.redeem||n.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,d.typeforce)({network:d.typeforce.maybe(d.typeforce.Object),address:d.typeforce.maybe(d.typeforce.String),hash:d.typeforce.maybe(d.typeforce.BufferN(32)),output:d.typeforce.maybe(d.typeforce.BufferN(34)),redeem:d.typeforce.maybe({input:d.typeforce.maybe(d.typeforce.Buffer),network:d.typeforce.maybe(d.typeforce.Object),output:d.typeforce.maybe(d.typeforce.Buffer),witness:d.typeforce.maybe(d.typeforce.arrayOf(d.typeforce.Buffer))}),input:d.typeforce.maybe(d.typeforce.BufferN(0)),witness:d.typeforce.maybe(d.typeforce.arrayOf(d.typeforce.Buffer))},n);const e=l.value(()=>{const t=p.bech32.decode(n.address);var e=t.words.shift(),r=p.bech32.fromWords(t.words);return{version:e,prefix:t.prefix,data:g.from(r)}}),r=l.value(()=>h.decompile(n.redeem.input));let i=n.network;i=i||(n.redeem&&n.redeem.network||c.bitcoin);const o={network:i};if(l.prop(o,"address",()=>{if(o.hash){const t=p.bech32.toWords(o.hash);return t.unshift(0),p.bech32.encode(i.bech32,t)}}),l.prop(o,"hash",()=>n.output?n.output.slice(2):n.address?e().data:o.redeem&&o.redeem.output?u.sha256(o.redeem.output):void 0),l.prop(o,"output",()=>{if(o.hash)return h.compile([b.OP_0,o.hash])}),l.prop(o,"redeem",()=>{if(n.witness)return{output:n.witness[n.witness.length-1],input:y,witness:n.witness.slice(0,-1)}}),l.prop(o,"input",()=>{if(o.witness)return y}),l.prop(o,"witness",()=>{if(n.redeem&&n.redeem.input&&0<n.redeem.input.length&&n.redeem.output&&0<n.redeem.output.length){var t=h.toStack(r());return o.redeem=Object.assign({witness:t},n.redeem),o.redeem.input=y,[].concat(t,n.redeem.output)}if(n.redeem&&n.redeem.output&&n.redeem.witness)return[].concat(n.redeem.witness,n.redeem.output)}),l.prop(o,"name",()=>{const t=["p2wsh"];return void 0!==o.redeem&&void 0!==o.redeem.name&&t.push(o.redeem.name),t.join("-")}),t.validate){let t=g.from([]);if(n.address){if(e().prefix!==i.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(0!==e().version)throw new TypeError("Invalid address version");if(32!==e().data.length)throw new TypeError("Invalid address data");t=e().data}if(n.hash){if(0<t.length&&!t.equals(n.hash))throw new TypeError("Hash mismatch");t=n.hash}if(n.output){if(34!==n.output.length||n.output[0]!==b.OP_0||32!==n.output[1])throw new TypeError("Output is invalid");var s=n.output.slice(2);if(0<t.length&&!t.equals(s))throw new TypeError("Hash mismatch");t=s}if(n.redeem){if(n.redeem.network&&n.redeem.network!==i)throw new TypeError("Network mismatch");if(n.redeem.input&&0<n.redeem.input.length&&n.redeem.witness&&0<n.redeem.witness.length)throw new TypeError("Ambiguous witness source");if(n.redeem.output){if(0===h.decompile(n.redeem.output).length)throw new TypeError("Redeem.output is invalid");s=u.sha256(n.redeem.output);if(0<t.length&&!t.equals(s))throw new TypeError("Hash mismatch");t=s}if(n.redeem.input&&!h.isPushOnly(r()))throw new TypeError("Non push-only scriptSig");if(n.witness&&n.redeem.witness&&(a=n.witness,f=n.redeem.witness,a.length!==f.length||!a.every((t,e)=>t.equals(f[e]))))throw new TypeError("Witness and redeem.witness mismatch");if(n.redeem.input&&r().some(m)||n.redeem.output&&(h.decompile(n.redeem.output)||[]).some(m))throw new TypeError("redeem.input or redeem.output contains uncompressed pubkey")}if(n.witness&&0<n.witness.length){a=n.witness[n.witness.length-1];if(n.redeem&&n.redeem.output&&!n.redeem.output.equals(a))throw new TypeError("Witness and redeem.output mismatch");if(n.witness.some(m)||(h.decompile(a)||[]).some(m))throw new TypeError("Witness contains uncompressed pubkey")}}var a,f;return Object.assign(o,n)}}.call(this)}.call(this,t("buffer").Buffer)},{"../crypto":34,"../networks":37,"../script":50,"../types":54,"./lazy":41,bech32:2,buffer:144}],48:[function(Y,t,J){!function(X){!function(){"use strict";Object.defineProperty(J,"__esModule",{value:!0}),J.Psbt=void 0;const n=Y("bip174"),o=Y("bip174/src/lib/converter/varint"),a=Y("bip174/src/lib/utils"),i=Y("./address"),r=Y("./bufferutils"),s=Y("./crypto");var t=Y("./networks");const p=Y("./payments"),b=Y("./script"),y=Y("./transaction"),f={network:t.bitcoin,maximumFeeRate:5e3};class u{constructor(t={},e=new n.Psbt(new h)){this.data=e,this.opts=Object.assign({},f,t),this.__CACHE={__NON_WITNESS_UTXO_TX_CACHE:[],__NON_WITNESS_UTXO_BUF_CACHE:[],__TX_IN_CACHE:{},__TX:this.data.globalMap.unsignedTx.tx,__UNSAFE_SIGN_NONSEGWIT:!1},0===this.data.inputs.length&&this.setVersion(2);t=(t,e,r,n)=>Object.defineProperty(t,e,{enumerable:r,writable:n});t(this,"__CACHE",!1,!0),t(this,"opts",!1,!0)}static fromBase64(t,e={}){t=X.from(t,"base64");return this.fromBuffer(t,e)}static fromHex(t,e={}){t=X.from(t,"hex");return this.fromBuffer(t,e)}static fromBuffer(t,e={}){var r,t=n.Psbt.fromBuffer(t,c),e=new u(e,t);return t=e.__CACHE.__TX,r=e.__CACHE,t.ins.forEach(t=>{A(r,t)}),e}get inputCount(){return this.data.inputs.length}get version(){return this.__CACHE.__TX.version}set version(t){this.setVersion(t)}get locktime(){return this.__CACHE.__TX.locktime}set locktime(t){this.setLocktime(t)}get txInputs(){return this.__CACHE.__TX.ins.map(t=>({hash:(0,r.cloneBuffer)(t.hash),index:t.index,sequence:t.sequence}))}get txOutputs(){return this.__CACHE.__TX.outs.map(t=>{let e;try{e=(0,i.fromOutputScript)(t.script,this.opts.network)}catch(t){}return{script:(0,r.cloneBuffer)(t.script),value:t.value,address:e}})}combine(...t){return this.data.combine(...t.map(t=>t.data)),this}clone(){const t=u.fromBuffer(this.data.toBuffer());return t.opts=JSON.parse(JSON.stringify(this.opts)),t}setMaximumFeeRate(t){I(t),this.opts.maximumFeeRate=t}setVersion(t){I(t),M(this.data.inputs,"setVersion");const e=this.__CACHE;return e.__TX.version=t,e.__EXTRACTED_TX=void 0,this}setLocktime(t){I(t),M(this.data.inputs,"setLocktime");const e=this.__CACHE;return e.__TX.locktime=t,e.__EXTRACTED_TX=void 0,this}setInputSequence(t,e){I(e),M(this.data.inputs,"setInputSequence");const r=this.__CACHE;if(r.__TX.ins.length<=t)throw new Error("Input index too high");return r.__TX.ins[t].sequence=e,r.__EXTRACTED_TX=void 0,this}addInputs(t){return t.forEach(t=>this.addInput(t)),this}addInput(t){if(1<arguments.length||!t||void 0===t.hash||void 0===t.index)throw new Error("Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]");M(this.data.inputs,"addInput"),t.witnessScript&&V(t.witnessScript);const e=this.__CACHE;this.data.addInput(t);var r=e.__TX.ins[e.__TX.ins.length-1];A(e,r);t=this.data.inputs.length-1,r=this.data.inputs[t];return r.nonWitnessUtxo&&j(this.__CACHE,r,t),e.__FEE=void 0,e.__FEE_RATE=void 0,e.__EXTRACTED_TX=void 0,this}addOutputs(t){return t.forEach(t=>this.addOutput(t)),this}addOutput(t){if(1<arguments.length||!t||void 0===t.value||void 0===t.address&&void 0===t.script)throw new Error("Invalid arguments for Psbt.addOutput. Requires single object with at least [script or address] and [value]");M(this.data.inputs,"addOutput");var e,r=t["address"];"string"==typeof r&&(e=this.opts["network"],e=(0,i.toOutputScript)(r,e),t=Object.assign(t,{script:e}));const n=this.__CACHE;return this.data.addOutput(t),n.__FEE=void 0,n.__FEE_RATE=void 0,n.__EXTRACTED_TX=void 0,this}extractTransaction(t){if(!this.data.inputs.every(l))throw new Error("Not finalized");const e=this.__CACHE;if(t||function(t,e,r){var n=e.__FEE_RATE||t.getFeeRate(),t=e.__EXTRACTED_TX.virtualSize(),e=n*t;if(n>=r.maximumFeeRate)throw new Error(`Warning: You are paying around ${(e/1e8).toFixed(8)} in `+`fees, which is ${n} satoshi per byte for a transaction `+`with a VSize of ${t} bytes (segwit counted as 0.25 byte per `+"byte). Use setMaximumFeeRate method to raise your threshold, or pass true to the first arg of extractTransaction.")}(this,e,this.opts),e.__EXTRACTED_TX)return e.__EXTRACTED_TX;t=e.__TX.clone();return D(this.data.inputs,t,e,!0),t}getFeeRate(){return B("__FEE_RATE","fee rate",this.data.inputs,this.__CACHE)}getFee(){return B("__FEE","fee",this.data.inputs,this.__CACHE)}finalizeAllInputs(){return(0,a.checkForInput)(this.data.inputs,0),G(this.data.inputs.length).forEach(t=>this.finalizeInput(t)),this}finalizeInput(t,e=function(t,e,r,n,i,o){var s=K(r);if(!function(t,e,r){switch(r){case"pubkey":case"pubkeyhash":case"witnesspubkeyhash":return d(1,t.partialSig);case"multisig":var n=p.p2ms({output:e});return d(n.m,t.partialSig,n.pubkeys);default:return!1}}(e,r,s))throw new Error("Can not finalize input #"+t);return function(t,e,r,n,i,o){let s,a;r=function(t,e,r){let n;switch(e){case"multisig":var i=function(t,r){const e=p.p2ms({output:t});return e.pubkeys.map(e=>(r.filter(t=>t.pubkey.equals(e))[0]||{}).signature).filter(t=>!!t)}(t,r);n=p.p2ms({output:t,signatures:i});break;case"pubkey":n=p.p2pk({output:t,signature:r[0].signature});break;case"pubkeyhash":n=p.p2pkh({output:t,pubkey:r[0].pubkey,signature:r[0].signature});break;case"witnesspubkeyhash":n=p.p2wpkh({output:t,pubkey:r[0].pubkey,signature:r[0].signature})}return n}(t,e,r),o=o?p.p2wsh({redeem:r}):null,i=i?p.p2sh({redeem:o||r}):null;n?(a=C((o||r).witness),i&&(s=i.input)):s=(i||r).input;return{finalScriptSig:s,finalScriptWitness:a}}(r,s,e.partialSig,n,i,o)}){var r=(0,a.checkForInput)(this.data.inputs,t),{script:n,isP2SH:i,isP2WSH:o,isSegwit:s}=function(t,e,r){const n=r.__TX,i={script:null,isSegwit:!1,isP2SH:!1,isP2WSH:!1};i.isP2SH=!!e.redeemScript,i.isP2WSH=!!e.witnessScript,e.witnessScript?i.script=e.witnessScript:e.redeemScript?i.script=e.redeemScript:e.nonWitnessUtxo?(r=H(r,e,t),t=n.ins[t].index,i.script=r.outs[t].script):e.witnessUtxo&&(i.script=e.witnessUtxo.script);(e.witnessScript||_(i.script))&&(i.isSegwit=!0);return i}(t,r,this.__CACHE);if(!n)throw new Error("No script found for input #"+t);!function(t){if(t.sighashType&&t.partialSig){const{partialSig:e,sighashType:r}=t;e.forEach(t=>{t=b.signature.decode(t.signature).hashType;if(r!==t)throw new Error("Signature sighash does not match input sighash type")})}}(r);var{finalScriptSig:i,finalScriptWitness:o}=e(t,r,n,s,i,o);if(i&&this.data.updateInput(t,{finalScriptSig:i}),o&&this.data.updateInput(t,{finalScriptWitness:o}),!i&&!o)throw new Error("Unknown error finalizing input #"+t);return this.data.clearFinalizedInput(t),this}getInputType(t){var e=(0,a.checkForInput)(this.data.inputs,t),e=z(q(t,e,this.__CACHE),t,"input",e.redeemScript||function(t){if(t){t=b.decompile(t);if(t){t=t[t.length-1];if(X.isBuffer(t)&&!F(t)&&!function(t){return b.isCanonicalScriptSignature(t)}(t))if(b.decompile(t))return t}}}(e.finalScriptSig),e.witnessScript||function(t){if(t){t=L(t),t=t[t.length-1];if(!F(t))if(b.decompile(t))return t}}(e.finalScriptWitness));return("raw"===e.type?"":e.type+"-")+K(e.meaningfulScript)}inputHasPubkey(t,e){return function(t,e,r,n){n=q(r,e,n),e=z(n,r,"input",e.redeemScript,e.witnessScript).meaningfulScript;return W(t,e)}(e,(0,a.checkForInput)(this.data.inputs,t),t,this.__CACHE)}inputHasHDKey(t,e){const r=(0,a.checkForInput)(this.data.inputs,t);e=T(e);return!!r.bip32Derivation&&r.bip32Derivation.some(e)}outputHasPubkey(t,e){return function(t,e,r,n){n=n.__TX.outs[r].script,e=z(n,r,"output",e.redeemScript,e.witnessScript).meaningfulScript;return W(t,e)}(e,(0,a.checkForOutput)(this.data.outputs,t),t,this.__CACHE)}outputHasHDKey(t,e){const r=(0,a.checkForOutput)(this.data.outputs,t);e=T(e);return!!r.bip32Derivation&&r.bip32Derivation.some(e)}validateSignaturesOfAllInputs(e){(0,a.checkForInput)(this.data.inputs,0);const t=G(this.data.inputs.length).map(t=>this.validateSignaturesOfInput(t,e));return t.reduce((t,e)=>!0===e&&t,!0)}validateSignaturesOfInput(t,e,r){var n=this.data.inputs[t];const i=(n||{}).partialSig;if(!n||!i||i.length<1)throw new Error("No signatures to validate");if("function"!=typeof e)throw new Error("Need validator function to validate signatures");var o=r?i.filter(t=>t.pubkey.equals(r)):i;if(o.length<1)throw new Error("No signatures for this pubkey");const s=[];let a,f,u;for(const l of o){var c=b.signature.decode(l.signature),{hash:h,script:d}=u!==c.hashType?N(t,Object.assign({},n,{sighashType:c.hashType}),this.__CACHE,!0):{hash:a,script:f};u=c.hashType,a=h,f=d,k(l.pubkey,d,"verify"),s.push(e(l.pubkey,h,c.signature))}return s.every(t=>!0===t)}signAllInputsHD(t,e=[y.Transaction.SIGHASH_ALL]){if(!t||!t.publicKey||!t.fingerprint)throw new Error("Need HDSigner to sign input");const r=[];for(const n of G(this.data.inputs.length))try{this.signInputHD(n,t,e),r.push(!0)}catch(t){r.push(!1)}if(r.every(t=>!1===t))throw new Error("No inputs were signed");return this}signAllInputsHDAsync(o,s=[y.Transaction.SIGHASH_ALL]){return new Promise((t,e)=>{if(!o||!o.publicKey||!o.fingerprint)return e(new Error("Need HDSigner to sign input"));const r=[],n=[];for(const i of G(this.data.inputs.length))n.push(this.signInputHDAsync(i,o,s).then(()=>{r.push(!0)},()=>{r.push(!1)}));return Promise.all(n).then(()=>r.every(t=>!1===t)?e(new Error("No inputs were signed")):void t())})}signInputHD(e,t,r=[y.Transaction.SIGHASH_ALL]){if(!t||!t.publicKey||!t.fingerprint)throw new Error("Need HDSigner to sign input");const n=U(e,this.data.inputs,t);return n.forEach(t=>this.signInput(e,t,r)),this}signInputHDAsync(i,o,s=[y.Transaction.SIGHASH_ALL]){return new Promise((t,e)=>{if(!o||!o.publicKey||!o.fingerprint)return e(new Error("Need HDSigner to sign input"));const r=U(i,this.data.inputs,o);var n=r.map(t=>this.signInputAsync(i,t,s));return Promise.all(n).then(()=>{t()}).catch(e)})}signAllInputs(t,e=[y.Transaction.SIGHASH_ALL]){if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const r=[];for(const n of G(this.data.inputs.length))try{this.signInput(n,t,e),r.push(!0)}catch(t){r.push(!1)}if(r.every(t=>!1===t))throw new Error("No inputs were signed");return this}signAllInputsAsync(o,s=[y.Transaction.SIGHASH_ALL]){return new Promise((t,e)=>{if(!o||!o.publicKey)return e(new Error("Need Signer to sign input"));const r=[],n=[];for(var[i]of this.data.inputs.entries())n.push(this.signInputAsync(i,o,s).then(()=>{r.push(!0)},()=>{r.push(!1)}));return Promise.all(n).then(()=>r.every(t=>!1===t)?e(new Error("No inputs were signed")):void t())})}signInput(t,e,r=[y.Transaction.SIGHASH_ALL]){if(!e||!e.publicKey)throw new Error("Need Signer to sign input");var{hash:n,sighashType:r}=R(this.data.inputs,t,e.publicKey,this.__CACHE,r),r=[{pubkey:e.publicKey,signature:b.signature.encode(e.sign(n),r)}];return this.data.updateInput(t,{partialSig:r}),this}signInputAsync(r,n,i=[y.Transaction.SIGHASH_ALL]){return Promise.resolve().then(()=>{if(!n||!n.publicKey)throw new Error("Need Signer to sign input");const{hash:t,sighashType:e}=R(this.data.inputs,r,n.publicKey,this.__CACHE,i);return Promise.resolve(n.sign(t)).then(t=>{t=[{pubkey:n.publicKey,signature:b.signature.encode(t,e)}];this.data.updateInput(r,{partialSig:t})})})}toBuffer(){return e(this.__CACHE),this.data.toBuffer()}toHex(){return e(this.__CACHE),this.data.toHex()}toBase64(){return e(this.__CACHE),this.data.toBase64()}updateGlobal(t){return this.data.updateGlobal(t),this}updateInput(t,e){return e.witnessScript&&V(e.witnessScript),this.data.updateInput(t,e),e.nonWitnessUtxo&&j(this.__CACHE,this.data.inputs[t],t),this}updateOutput(t,e){return this.data.updateOutput(t,e),this}addUnknownKeyValToGlobal(t){return this.data.addUnknownKeyValToGlobal(t),this}addUnknownKeyValToInput(t,e){return this.data.addUnknownKeyValToInput(t,e),this}addUnknownKeyValToOutput(t,e){return this.data.addUnknownKeyValToOutput(t,e),this}clearFinalizedInput(t){return this.data.clearFinalizedInput(t),this}}J.Psbt=u;const c=t=>new h(t);class h{constructor(t=X.from([2,0,0,0,0,0,0,0,0,0])){this.tx=y.Transaction.fromBuffer(t),function(t){t=t.ins.every(t=>t.script&&0===t.script.length&&t.witness&&0===t.witness.length);if(!t)throw new Error("Format Error: Transaction ScriptSigs are not empty")}(this.tx),Object.defineProperty(this,"tx",{enumerable:!1,writable:!0})}getInputOutputCounts(){return{inputCount:this.tx.ins.length,outputCount:this.tx.outs.length}}addInput(t){if(void 0===t.hash||void 0===t.index||!X.isBuffer(t.hash)&&"string"!=typeof t.hash||"number"!=typeof t.index)throw new Error("Error adding input.");var e="string"==typeof t.hash?(0,r.reverseBuffer)(X.from(t.hash,"hex")):t.hash;this.tx.addInput(e,t.index,t.sequence)}addOutput(t){if(void 0===t.script||void 0===t.value||!X.isBuffer(t.script)||"number"!=typeof t.value)throw new Error("Error adding output.");this.tx.addOutput(t.script,t.value)}toBuffer(){return this.tx.toBuffer()}}function e(t){if(!1!==t.__UNSAFE_SIGN_NONSEGWIT)throw new Error("Not BIP174 compliant, can not export")}function d(t,r,e){if(!r)return!1;let n;if(n=e?e.map(t=>{const e=function(t){if(65!==t.length)return t.slice();{var e=1&t[64];const r=t.slice(0,33);return r[0]=2|e,r}}(t);return r.find(t=>t.pubkey.equals(e))}).filter(t=>!!t):r,n.length>t)throw new Error("Too many signatures");return n.length===t}function l(t){return!!t.finalScriptSig||!!t.finalScriptWitness}function m(e){return t=>{try{return e({output:t}),!0}catch(t){return!1}}}const g=m(p.p2ms),w=m(p.p2pk),v=m(p.p2pkh),_=m(p.p2wpkh),S=m(p.p2wsh),E=m(p.p2sh);function T(e){return t=>!!t.masterFingerprint.equals(e.fingerprint)&&!!e.derivePath(t.path).publicKey.equals(t.pubkey)}function I(t){if("number"!=typeof t||t!==Math.floor(t)||4294967295<t||t<0)throw new Error("Invalid 32 bit integer")}function M(t,n){t.forEach(t=>{let r=!1,e=[];if(0===(t.partialSig||[]).length){if(!t.finalScriptSig&&!t.finalScriptWitness)return;e=function(t){const e=t.finalScriptSig&&b.decompile(t.finalScriptSig)||[],r=t.finalScriptWitness&&b.decompile(t.finalScriptWitness)||[];return e.concat(r).filter(t=>X.isBuffer(t)&&b.isCanonicalScriptSignature(t)).map(t=>({signature:t}))}(t)}else e=t.partialSig;if(e.forEach(t=>{t=b.signature.decode(t.signature).hashType;const e=[];switch(t&y.Transaction.SIGHASH_ANYONECANPAY&&e.push("addInput"),31&t){case y.Transaction.SIGHASH_ALL:break;case y.Transaction.SIGHASH_SINGLE:case y.Transaction.SIGHASH_NONE:e.push("addOutput"),e.push("setInputSequence")}-1===e.indexOf(n)&&(r=!0)}),r)throw new Error("Can not modify transaction, signatures exist.")})}function k(t,e,r){if(!W(t,e))throw new Error(`Can not ${r} for this input with the key `+t.toString("hex"))}function A(t,e){e=(0,r.reverseBuffer)(X.from(e.hash)).toString("hex")+":"+e.index;if(t.__TX_IN_CACHE[e])throw new Error("Duplicate input detected.");t.__TX_IN_CACHE[e]=1}function O(i,o){return(t,e,r,n)=>{r=i({redeem:{output:r}}).output;if(!e.equals(r))throw new Error(o+` for ${n} #${t} doesn't match the scriptPubKey in the prevout`)}}const x=O(p.p2sh,"Redeem script"),P=O(p.p2wsh,"Witness script");function B(t,e,r,n){if(!r.every(l))throw new Error("PSBT must be finalized to calculate "+e);if("__FEE_RATE"===t&&n.__FEE_RATE)return n.__FEE_RATE;if("__FEE"===t&&n.__FEE)return n.__FEE;let i,o=!0;return n.__EXTRACTED_TX?(i=n.__EXTRACTED_TX,o=!1):i=n.__TX.clone(),D(r,i,n,o),"__FEE_RATE"===t?n.__FEE_RATE:"__FEE"===t?n.__FEE:void 0}function R(t,e,r,n,i){var{hash:e,sighashType:n,script:i}=N(e,(0,a.checkForInput)(t,e),n,!1,i);return k(r,i,"sign"),{hash:e,sighashType:n}}function N(t,e,r,n,i){const o=r.__TX;var s=e.sighashType||y.Transaction.SIGHASH_ALL;if(i&&i.indexOf(s)<0){i=function(t){let e=t&y.Transaction.SIGHASH_ANYONECANPAY?"SIGHASH_ANYONECANPAY | ":"";t&=31;switch(t){case y.Transaction.SIGHASH_ALL:e+="SIGHASH_ALL";break;case y.Transaction.SIGHASH_SINGLE:e+="SIGHASH_SINGLE";break;case y.Transaction.SIGHASH_NONE:e+="SIGHASH_NONE"}return e}(s);throw new Error("Sighash type is not allowed. Retry the sign method passing the sighashTypes array of whitelisted types. Sighash type: "+i)}let a,f;if(e.nonWitnessUtxo){const d=H(r,e,t),l=o.ins[t].hash;var u=d.getHash();if(!l.equals(u))throw new Error(`Non-witness UTXO hash for input #${t} doesn't match the hash specified in the prevout`);u=o.ins[t].index;f=d.outs[u]}else{if(!e.witnessUtxo)throw new Error("Need a Utxo input item for signing");f=e.witnessUtxo}const{meaningfulScript:c,type:h}=z(f.script,t,"input",e.redeemScript,e.witnessScript);if(0<=["p2sh-p2wsh","p2wsh"].indexOf(h))a=o.hashForWitnessV0(t,c,f.value,s);else if(_(c)){u=p.p2pkh({hash:c.slice(2)}).output;a=o.hashForWitnessV0(t,u,f.value,s)}else{if(void 0===e.nonWitnessUtxo&&!1===r.__UNSAFE_SIGN_NONSEGWIT)throw new Error(`Input #${t} has witnessUtxo but non-segwit script: `+c.toString("hex"));n||!1===r.__UNSAFE_SIGN_NONSEGWIT||console.warn("Warning: Signing non-segwit inputs without the full parent transaction means there is a chance that a miner could feed you incorrect information to trick you into paying large fees. This behavior is the same as Psbt's predecesor (TransactionBuilder - now removed) when signing non-segwit scripts. You are not able to export this Psbt with toBuffer|toBase64|toHex since it is not BIP174 compliant.\n*********************\nPROCEED WITH CAUTION!\n*********************"),a=o.hashForSignature(t,c,s)}return{script:c,sighashType:s,hash:a}}function U(t,e,r){const n=(0,a.checkForInput)(e,t);if(!n.bip32Derivation||0===n.bip32Derivation.length)throw new Error("Need bip32Derivation to sign with HD");const i=n.bip32Derivation.map(t=>{if(t.masterFingerprint.equals(r.fingerprint))return t}).filter(t=>!!t);if(0===i.length)throw new Error("Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint");return i.map(t=>{var e=r.derivePath(t.path);if(!t.pubkey.equals(e.publicKey))throw new Error("pubkey did not match bip32Derivation");return e})}function L(e){let r=0;function n(){var t=o.decode(e,r);return r+=o.decode.bytes,t}function i(){return t=n(),r+=t,e.slice(r-t,r);var t}return function(){var e=n();const r=[];for(let t=0;t<e;t++)r.push(i());return r}()}function C(t){let n=X.allocUnsafe(0);function e(t){var e=n.length,r=o.encodingLength(t);n=X.concat([n,X.allocUnsafe(r)]),o.encode(t,n,e)}function r(t){e(t.length),t=t,n=X.concat([n,X.from(t)])}return e((t=t).length),t.forEach(r),n}function j(t,e,r){t.__NON_WITNESS_UTXO_BUF_CACHE[r]=e.nonWitnessUtxo;var n=y.Transaction.fromBuffer(e.nonWitnessUtxo);t.__NON_WITNESS_UTXO_TX_CACHE[r]=n;const i=t,o=r;delete e.nonWitnessUtxo,Object.defineProperty(e,"nonWitnessUtxo",{enumerable:!0,get(){var t=i.__NON_WITNESS_UTXO_BUF_CACHE[o];const e=i.__NON_WITNESS_UTXO_TX_CACHE[o];if(void 0!==t)return t;t=e.toBuffer();return i.__NON_WITNESS_UTXO_BUF_CACHE[o]=t},set(t){i.__NON_WITNESS_UTXO_BUF_CACHE[o]=t}})}function D(t,r,n,i){let o=0;t.forEach((t,e)=>{i&&t.finalScriptSig&&(r.ins[e].script=t.finalScriptSig),i&&t.finalScriptWitness&&(r.ins[e].witness=L(t.finalScriptWitness)),t.witnessUtxo?o+=t.witnessUtxo.value:t.nonWitnessUtxo&&(t=H(n,t,e),e=r.ins[e].index,e=t.outs[e],o+=e.value)});var e=r.outs.reduce((t,e)=>t+e.value,0),t=o-e;if(t<0)throw new Error("Outputs are spending more than Inputs");e=r.virtualSize();n.__FEE=t,n.__EXTRACTED_TX=r,n.__FEE_RATE=Math.floor(t/e)}function H(t,e,r){var n=t.__NON_WITNESS_UTXO_TX_CACHE;return n[r]||j(t,e,r),n[r]}function q(t,e,r){if(void 0!==e.witnessUtxo)return e.witnessUtxo.script;if(void 0===e.nonWitnessUtxo)throw new Error("Can't find pubkey in input without Utxo data");return H(r,e,t).outs[r.__TX.ins[t].index].script}function F(t){return 33===t.length&&b.isCanonicalPubKey(t)}function z(t,e,r,n,i){var o=E(t),s=o&&n&&S(n),a=S(t);if(o&&void 0===n)throw new Error("scriptPubkey is P2SH but redeemScript missing");if((a||s)&&void 0===i)throw new Error("scriptPubkey or redeemScript is P2WSH but witnessScript missing");let f;return s?(f=i,x(e,t,n,r),P(e,n,i,r),V(f)):a?(f=i,P(e,t,i,r),V(f)):o?(f=n,x(e,t,n,r)):f=t,{meaningfulScript:f,type:s?"p2sh-p2wsh":o?"p2sh":a?"p2wsh":"raw"}}function V(t){if(_(t)||E(t))throw new Error("P2WPKH or P2SH can not be contained within P2WSH")}function W(e,t){const r=(0,s.hash160)(e),n=b.decompile(t);if(null===n)throw new Error("Unknown script error");return n.some(t=>"number"!=typeof t&&(t.equals(e)||t.equals(r)))}function K(t){return _(t)?"witnesspubkeyhash":v(t)?"pubkeyhash":g(t)?"multisig":w(t)?"pubkey":"nonstandard"}function G(t){return[...Array(t).keys()]}}.call(this)}.call(this,Y("buffer").Buffer)},{"./address":30,"./bufferutils":33,"./crypto":34,"./networks":37,"./payments":40,"./script":50,"./transaction":53,bip174:27,"bip174/src/lib/converter/varint":23,"bip174/src/lib/utils":29,buffer:144}],49:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.decode=r.encode=r.encodingLength=void 0;const o=t("./ops");function i(t){return t<o.OPS.OP_PUSHDATA1?1:t<=255?2:t<=65535?3:5}r.encodingLength=i,r.encode=function(t,e,r){var n=i(e);return 1===n?t.writeUInt8(e,r):2===n?(t.writeUInt8(o.OPS.OP_PUSHDATA1,r),t.writeUInt8(e,r+1)):3===n?(t.writeUInt8(o.OPS.OP_PUSHDATA2,r),t.writeUInt16LE(e,r+1)):(t.writeUInt8(o.OPS.OP_PUSHDATA4,r),t.writeUInt32LE(e,r+1)),n},r.decode=function(t,e){var r=t.readUInt8(e);let n,i;if(r<o.OPS.OP_PUSHDATA1)n=r,i=1;else if(r===o.OPS.OP_PUSHDATA1){if(e+2>t.length)return null;n=t.readUInt8(e+1),i=2}else if(r===o.OPS.OP_PUSHDATA2){if(e+3>t.length)return null;n=t.readUInt16LE(e+1),i=3}else{if(e+5>t.length)return null;if(r!==o.OPS.OP_PUSHDATA4)throw new Error("Unexpected opcode");n=t.readUInt32LE(e+1),i=5}return{opcode:r,number:n,size:i}}},{"./ops":38}],50:[function(m,t,g){!function(y){!function(){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.signature=g.number=g.isCanonicalScriptSignature=g.isDefinedHashType=g.isCanonicalPubKey=g.toStack=g.fromASM=g.toASM=g.decompile=g.compile=g.isPushOnly=g.OPS=void 0;const e=m("./bip66"),a=m("./ops");Object.defineProperty(g,"OPS",{enumerable:!0,get:function(){return a.OPS}});const f=m("./push_data"),r=m("./script_number");var t=m("./script_signature");const u=m("./types"),c=u["typeforce"],n=a.OPS.OP_RESERVED;function i(t){return u.Buffer(t)||(t=t,u.Number(t)&&(t===a.OPS.OP_0||t>=a.OPS.OP_1&&t<=a.OPS.OP_16||t===a.OPS.OP_1NEGATE))}function o(t){return u.Array(t)&&t.every(i)}function h(t){return 0===t.length?a.OPS.OP_0:1===t.length?1<=t[0]&&t[0]<=16?n+t[0]:129===t[0]?a.OPS.OP_1NEGATE:void 0:void 0}function s(t){return y.isBuffer(t)}function d(t){return y.isBuffer(t)}function l(t){if(s(t))return t;c(u.Array,t);var e=t.reduce((t,e)=>!d(e)||1===e.length&&void 0!==h(e)?t+1:t+f.encodingLength(e.length)+e.length,0);const r=y.allocUnsafe(e);let n=0;if(t.forEach(t=>{if(d(t)){var e=h(t);if(void 0!==e)return r.writeUInt8(e,n),void(n+=1);n+=f.encode(r,t.length,n),t.copy(r,n),n+=t.length}else r.writeUInt8(t,n),n+=1}),n!==r.length)throw new Error("Could not decode chunks");return r}function p(t){if(e=t,u.Array(e))return t;var e;c(u.Buffer,t);const r=[];let n=0;for(;n<t.length;){var i=t[n];if(i>a.OPS.OP_0&&i<=a.OPS.OP_PUSHDATA4){var o=f.decode(t,n);if(null===o)return null;if(n+=o.size,n+o.number>t.length)return null;var s=t.slice(n,n+o.number);n+=o.number;o=h(s);void 0!==o?r.push(o):r.push(s)}else r.push(i),n+=1}return r}function b(t){t&=-129;return 0<t&&t<4}g.isPushOnly=o,g.compile=l,g.decompile=p,g.toASM=function(t){return(t=s(t)?p(t):t).map(t=>{if(d(t)){var e=h(t);if(void 0===e)return t.toString("hex");t=e}return a.REVERSE_OPS[t]}).join(" ")},g.fromASM=function(t){return c(u.String,t),l(t.split(" ").map(t=>void 0!==a.OPS[t]?a.OPS[t]:(c(u.Hex,t),y.from(t,"hex"))))},g.toStack=function(t){return t=p(t),c(o,t),t.map(t=>d(t)?t:t===a.OPS.OP_0?y.allocUnsafe(0):r.encode(t-n))},g.isCanonicalPubKey=function(t){return u.isPoint(t)},g.isDefinedHashType=b,g.isCanonicalScriptSignature=function(t){return!!y.isBuffer(t)&&(!!b(t[t.length-1])&&e.check(t.slice(0,-1)))},g.number=r,g.signature=t}.call(this)}.call(this,m("buffer").Buffer)},{"./bip66":31,"./ops":38,"./push_data":49,"./script_number":51,"./script_signature":52,"./types":54,buffer:144}],51:[function(t,e,r){!function(o){!function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.encode=r.decode=void 0,r.decode=function(e,t,r){r=void 0===r||r;var n=e.length;if(0===n)return 0;if((t=t||4)<n)throw new TypeError("Script number overflow");if(r&&0==(127&e[n-1])&&(n<=1||0==(128&e[n-2])))throw new Error("Non-minimally encoded script number");if(5===n){t=e.readUInt32LE(0),r=e.readUInt8(4);return 128&r?-(4294967296*(-129&r)+t):4294967296*r+t}let i=0;for(let t=0;t<n;++t)i|=e[t]<<8*t;return 128&e[n-1]?-(i&~(128<<8*(n-1))):i},r.encode=function(t){let e=Math.abs(t);var r,n=2147483647<(r=e)?5:8388607<r?4:32767<r?3:127<r?2:0<r?1:0;const i=o.allocUnsafe(n);t=t<0;for(let t=0;t<n;++t)i.writeUInt8(255&e,t),e>>=8;return 128&i[n-1]?i.writeUInt8(t?128:0,n-1):t&&(i[n-1]|=128),i}}.call(this)}.call(this,t("buffer").Buffer)},{buffer:144}],52:[function(t,e,u){!function(f){!function(){"use strict";Object.defineProperty(u,"__esModule",{value:!0}),u.encode=u.decode=void 0;const i=t("./bip66"),o=t("./types"),s=o["typeforce"],r=f.alloc(1,0);function a(t){let e=0;for(;0===t[e];)++e;return e===t.length?r:128&(t=t.slice(e))[0]?f.concat([r,t],1+t.length):t}function n(t){0===t[0]&&(t=t.slice(1));var e=f.alloc(32,0),r=Math.max(0,32-t.length);return t.copy(e,r),e}u.decode=function(t){var e=t.readUInt8(t.length-1),r=-129&e;if(r<=0||4<=r)throw new Error("Invalid hashType "+e);return t=n((r=i.decode(t.slice(0,-1))).r),r=n(r.s),{signature:f.concat([t,r],64),hashType:e}},u.encode=function(t,e){s({signature:o.BufferN(64),hashType:o.UInt8},{signature:t,hashType:e});var r=-129&e;if(r<=0||4<=r)throw new Error("Invalid hashType "+e);const n=f.allocUnsafe(1);return n.writeUInt8(e,0),e=a(t.slice(0,32)),t=a(t.slice(32,64)),f.concat([i.encode(e,t),n])}}.call(this)}.call(this,t("buffer").Buffer)},{"./bip66":31,"./types":54,buffer:144}],53:[function(e,t,r){!function(k){!function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Transaction=void 0;const v=e("./bufferutils"),_=e("./crypto"),o=e("./script"),s=e("./script"),S=e("./types"),E=S["typeforce"];function T(t){t=t.length;return v.varuint.encodingLength(t)+t}const I=k.allocUnsafe(0),u=[],c=k.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),a=k.from("0000000000000000000000000000000000000000000000000000000000000001","hex");var t=k.from("ffffffffffffffff","hex");const f={script:I,valueBuffer:t};class M{constructor(){this.version=1,this.locktime=0,this.ins=[],this.outs=[]}static fromBuffer(t,e){const r=new v.BufferReader(t),n=new M;n.version=r.readInt32();var i=r.readUInt8(),o=r.readUInt8();let s=!1;i===M.ADVANCED_TRANSACTION_MARKER&&o===M.ADVANCED_TRANSACTION_FLAG?s=!0:r.offset-=2;var a=r.readVarInt();for(let t=0;t<a;++t)n.ins.push({hash:r.readSlice(32),index:r.readUInt32(),script:r.readVarSlice(),sequence:r.readUInt32(),witness:u});var f=r.readVarInt();for(let t=0;t<f;++t)n.outs.push({value:r.readUInt64(),script:r.readVarSlice()});if(s){for(let t=0;t<a;++t)n.ins[t].witness=r.readVector();if(!n.hasWitnesses())throw new Error("Transaction has superfluous witness data")}if(n.locktime=r.readUInt32(),e)return n;if(r.offset!==t.length)throw new Error("Transaction has unexpected data");return n}static fromHex(t){return M.fromBuffer(k.from(t,"hex"),!1)}static isCoinbaseHash(e){E(S.Hash256bit,e);for(let t=0;t<32;++t)if(0!==e[t])return!1;return!0}isCoinbase(){return 1===this.ins.length&&M.isCoinbaseHash(this.ins[0].hash)}addInput(t,e,r,n){return E(S.tuple(S.Hash256bit,S.UInt32,S.maybe(S.UInt32),S.maybe(S.Buffer)),arguments),S.Null(r)&&(r=M.DEFAULT_SEQUENCE),this.ins.push({hash:t,index:e,script:n||I,sequence:r,witness:u})-1}addOutput(t,e){return E(S.tuple(S.Buffer,S.Satoshi),arguments),this.outs.push({script:t,value:e})-1}hasWitnesses(){return this.ins.some(t=>0!==t.witness.length)}weight(){return 3*this.byteLength(!1)+this.byteLength(!0)}virtualSize(){return Math.ceil(this.weight()/4)}byteLength(t=!0){t=t&&this.hasWitnesses();return(t?10:8)+v.varuint.encodingLength(this.ins.length)+v.varuint.encodingLength(this.outs.length)+this.ins.reduce((t,e)=>t+40+T(e.script),0)+this.outs.reduce((t,e)=>t+8+T(e.script),0)+(t?this.ins.reduce((t,e)=>{return t+(t=e.witness,e=t.length,v.varuint.encodingLength(e)+t.reduce((t,e)=>t+T(e),0))},0):0)}clone(){const t=new M;return t.version=this.version,t.locktime=this.locktime,t.ins=this.ins.map(t=>({hash:t.hash,index:t.index,script:t.script,sequence:t.sequence,witness:t.witness})),t.outs=this.outs.map(t=>({script:t.script,value:t.value})),t}hashForSignature(r,t,e){if(E(S.tuple(S.UInt32,S.Buffer,S.Number),arguments),r>=this.ins.length)return a;t=o.compile(o.decompile(t).filter(t=>t!==s.OPS.OP_CODESEPARATOR));const n=this.clone();if((31&e)===M.SIGHASH_NONE)n.outs=[],n.ins.forEach((t,e)=>{e!==r&&(t.sequence=0)});else if((31&e)===M.SIGHASH_SINGLE){if(r>=this.outs.length)return a;n.outs.length=r+1;for(let t=0;t<r;t++)n.outs[t]=f;n.ins.forEach((t,e)=>{e!==r&&(t.sequence=0)})}e&M.SIGHASH_ANYONECANPAY?(n.ins=[n.ins[r]],n.ins[0].script=t):(n.ins.forEach(t=>{t.script=I}),n.ins[r].script=t);const i=k.allocUnsafe(n.byteLength(!1)+4);return i.writeInt32LE(e,i.length-4),n.__toBuffer(i,0,!1),_.hash256(i)}hashForWitnessV1(t,r,n,e,i,o){if(E(S.tuple(S.UInt32,E.arrayOf(S.Buffer),E.arrayOf(S.Satoshi),S.UInt32),arguments),n.length!==this.ins.length||r.length!==this.ins.length)throw new Error("Must supply prevout script and value for all inputs");var s=e===M.SIGHASH_DEFAULT?M.SIGHASH_ALL:e&M.SIGHASH_OUTPUT_MASK,a=(e&M.SIGHASH_INPUT_MASK)===M.SIGHASH_ANYONECANPAY,f=s===M.SIGHASH_NONE,s=s===M.SIGHASH_SINGLE;let u=I,c=I,h=I,d=I,l=I;if(!a){let e=v.BufferWriter.withCapacity(36*this.ins.length);this.ins.forEach(t=>{e.writeSlice(t.hash),e.writeUInt32(t.index)}),u=_.sha256(e.end()),e=v.BufferWriter.withCapacity(8*this.ins.length),n.forEach(t=>e.writeUInt64(t)),c=_.sha256(e.end()),e=v.BufferWriter.withCapacity(r.map(T).reduce((t,e)=>t+e)),r.forEach(t=>e.writeVarSlice(t)),h=_.sha256(e.end()),e=v.BufferWriter.withCapacity(4*this.ins.length),this.ins.forEach(t=>e.writeUInt32(t.sequence)),d=_.sha256(e.end())}if(f||s){if(s&&t<this.outs.length){var p=this.outs[t];const m=v.BufferWriter.withCapacity(8+T(p.script));m.writeUInt64(p.value),m.writeVarSlice(p.script),l=_.sha256(m.end())}}else{var b=this.outs.map(t=>8+T(t.script)).reduce((t,e)=>t+e);const g=v.BufferWriter.withCapacity(b);this.outs.forEach(t=>{g.writeUInt64(t.value),g.writeVarSlice(t.script)}),l=_.sha256(g.end())}p=(i?2:0)+(o?1:0),b=174-(a?49:0)-(f?32:0)+(o?32:0)+(i?37:0);const y=v.BufferWriter.withCapacity(b);if(y.writeUInt8(e),y.writeInt32(this.version),y.writeUInt32(this.locktime),y.writeSlice(u),y.writeSlice(c),y.writeSlice(h),y.writeSlice(d),f||s||y.writeSlice(l),y.writeUInt8(p),a?(a=this.ins[t],y.writeSlice(a.hash),y.writeUInt32(a.index),y.writeUInt64(n[t]),y.writeVarSlice(r[t]),y.writeUInt32(a.sequence)):y.writeUInt32(t),o){const w=v.BufferWriter.withCapacity(T(o));w.writeVarSlice(o),y.writeSlice(_.sha256(w.end()))}return s&&y.writeSlice(l),i&&(y.writeSlice(i),y.writeUInt8(0),y.writeUInt32(4294967295)),_.taggedHash("TapSighash",k.concat([k.of(0),y.end()]))}hashForWitnessV0(t,e,r,n){E(S.tuple(S.UInt32,S.Buffer,S.Satoshi,S.UInt32),arguments);let i=k.from([]),o,s=c,a=c,f=c;var u;n&M.SIGHASH_ANYONECANPAY||(i=k.allocUnsafe(36*this.ins.length),o=new v.BufferWriter(i,0),this.ins.forEach(t=>{o.writeSlice(t.hash),o.writeUInt32(t.index)}),a=_.hash256(i)),n&M.SIGHASH_ANYONECANPAY||(31&n)===M.SIGHASH_SINGLE||(31&n)===M.SIGHASH_NONE||(i=k.allocUnsafe(4*this.ins.length),o=new v.BufferWriter(i,0),this.ins.forEach(t=>{o.writeUInt32(t.sequence)}),f=_.hash256(i)),(31&n)!==M.SIGHASH_SINGLE&&(31&n)!==M.SIGHASH_NONE?(u=this.outs.reduce((t,e)=>t+8+T(e.script),0),i=k.allocUnsafe(u),o=new v.BufferWriter(i,0),this.outs.forEach(t=>{o.writeUInt64(t.value),o.writeVarSlice(t.script)}),s=_.hash256(i)):(31&n)===M.SIGHASH_SINGLE&&t<this.outs.length&&(u=this.outs[t],i=k.allocUnsafe(8+T(u.script)),o=new v.BufferWriter(i,0),o.writeUInt64(u.value),o.writeVarSlice(u.script),s=_.hash256(i)),i=k.allocUnsafe(156+T(e)),o=new v.BufferWriter(i,0);t=this.ins[t];return o.writeInt32(this.version),o.writeSlice(a),o.writeSlice(f),o.writeSlice(t.hash),o.writeUInt32(t.index),o.writeVarSlice(e),o.writeUInt64(r),o.writeUInt32(t.sequence),o.writeSlice(s),o.writeUInt32(this.locktime),o.writeUInt32(n),_.hash256(i)}getHash(t){return t&&this.isCoinbase()?k.alloc(32,0):_.hash256(this.__toBuffer(void 0,void 0,t))}getId(){return(0,v.reverseBuffer)(this.getHash(!1)).toString("hex")}toBuffer(t,e){return this.__toBuffer(t,e,!0)}toHex(){return this.toBuffer(void 0,void 0).toString("hex")}setInputScript(t,e){E(S.tuple(S.Number,S.Buffer),arguments),this.ins[t].script=e}setWitness(t,e){E(S.tuple(S.Number,[S.Buffer]),arguments),this.ins[t].witness=e}__toBuffer(t,e,r=!1){t=t||k.allocUnsafe(this.byteLength(r));const n=new v.BufferWriter(t,e||0);n.writeInt32(this.version);r=r&&this.hasWitnesses();return r&&(n.writeUInt8(M.ADVANCED_TRANSACTION_MARKER),n.writeUInt8(M.ADVANCED_TRANSACTION_FLAG)),n.writeVarInt(this.ins.length),this.ins.forEach(t=>{n.writeSlice(t.hash),n.writeUInt32(t.index),n.writeVarSlice(t.script),n.writeUInt32(t.sequence)}),n.writeVarInt(this.outs.length),this.outs.forEach(t=>{void 0!==t.value?n.writeUInt64(t.value):n.writeSlice(t.valueBuffer),n.writeVarSlice(t.script)}),r&&this.ins.forEach(t=>{n.writeVector(t.witness)}),n.writeUInt32(this.locktime),void 0!==e?t.slice(e,n.offset):t}}r.Transaction=M,M.DEFAULT_SEQUENCE=4294967295,M.SIGHASH_DEFAULT=0,M.SIGHASH_ALL=1,M.SIGHASH_NONE=2,M.SIGHASH_SINGLE=3,M.SIGHASH_ANYONECANPAY=128,M.SIGHASH_OUTPUT_MASK=3,M.SIGHASH_INPUT_MASK=128,M.ADVANCED_TRANSACTION_MARKER=0,M.ADVANCED_TRANSACTION_FLAG=1}.call(this)}.call(this,e("buffer").Buffer)},{"./bufferutils":33,"./crypto":34,"./script":50,"./types":54,buffer:144}],54:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.oneOf=r.Null=r.BufferN=r.Function=r.UInt32=r.UInt8=r.tuple=r.maybe=r.Hex=r.Buffer=r.String=r.Boolean=r.Array=r.Number=r.Hash256bit=r.Hash160bit=r.Buffer256bit=r.Network=r.ECPoint=r.Satoshi=r.Signer=r.BIP32Path=r.UInt31=r.isPoint=r.typeforce=void 0;const i=t("buffer");r.typeforce=t("typeforce");const o=i.Buffer.alloc(32,0),s=i.Buffer.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex");r.isPoint=function(t){if(!i.Buffer.isBuffer(t))return!1;if(t.length<33)return!1;var e=t[0];const r=t.slice(1,33);if(0===r.compare(o))return!1;if(0<=r.compare(s))return!1;if((2===e||3===e)&&33===t.length)return!0;const n=t.slice(33);return 0!==n.compare(o)&&(!(0<=n.compare(s))&&(4===e&&65===t.length))};const n=Math.pow(2,31)-1;function a(t){return r.typeforce.String(t)&&!!t.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}r.UInt31=function(t){return r.typeforce.UInt32(t)&&t<=n},(r.BIP32Path=a).toJSON=()=>"BIP32 derivation path",r.Signer=function(t){return(r.typeforce.Buffer(t.publicKey)||"function"==typeof t.getPublicKey)&&"function"==typeof t.sign};r.Satoshi=function(t){return r.typeforce.UInt53(t)&&t<=21e14},r.ECPoint=r.typeforce.quacksLike("Point"),r.Network=r.typeforce.compile({messagePrefix:r.typeforce.oneOf(r.typeforce.Buffer,r.typeforce.String),bip32:{public:r.typeforce.UInt32,private:r.typeforce.UInt32},pubKeyHash:r.typeforce.UInt8,scriptHash:r.typeforce.UInt8,wif:r.typeforce.UInt8}),r.Buffer256bit=r.typeforce.BufferN(32),r.Hash160bit=r.typeforce.BufferN(20),r.Hash256bit=r.typeforce.BufferN(32),r.Number=r.typeforce.Number,r.Array=r.typeforce.Array,r.Boolean=r.typeforce.Boolean,r.String=r.typeforce.String,r.Buffer=r.typeforce.Buffer,r.Hex=r.typeforce.Hex,r.maybe=r.typeforce.maybe,r.tuple=r.typeforce.tuple,r.UInt8=r.typeforce.UInt8,r.UInt32=r.typeforce.UInt32,r.Function=r.typeforce.Function,r.BufferN=r.typeforce.BufferN,r.Null=r.typeforce.Null,r.oneOf=r.typeforce.oneOf},{buffer:144,typeforce:133}],55:[function(T,t,e){!function(t,e){"use strict";function b(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;function r(){}r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function y(t,e,r){if(y.isBN(t))return t;this.negative=0,this.words=null,this.length=0,(this.red=null)!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var n;"object"==typeof t?t.exports=y:e.BN=y,(y.BN=y).wordSize=26;try{n=("undefined"!=typeof window&&void 0!==window.Buffer?window:T("buffer")).Buffer}catch(t){}function i(t,e){e=t.charCodeAt(e);return 65<=e&&e<=70?e-55:97<=e&&e<=102?e-87:e-48&15}function a(t,e,r){var n=i(t,r);return e<=r-1&&(n|=i(t,r-1)<<4),n}function h(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=49<=a?a-49+10:17<=a?a-17+10:a}return i}y.isBN=function(t){return t instanceof y||null!==t&&"object"==typeof t&&t.constructor.wordSize===y.wordSize&&Array.isArray(t.words)},y.max=function(t,e){return 0<t.cmp(e)?t:e},y.min=function(t,e){return t.cmp(e)<0?t:e},y.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);b((e="hex"===e?16:e)===(0|e)&&2<=e&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,r):(this._parseBase(t,e,n),"le"===r&&this._initArray(this.toArray(),e,r)))},y.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(b(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},y.prototype._initArray=function(t,e,r){if(b("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n,i,o=0;o<this.length;o++)this.words[o]=0;var s=0;if("be"===r)for(o=t.length-1,n=0;0<=o;o-=3)i=t[o]|t[o-1]<<8|t[o-2]<<16,this.words[n]|=i<<s&67108863,this.words[n+1]=i>>>26-s&67108863,26<=(s+=24)&&(s-=26,n++);else if("le"===r)for(n=o=0;o<t.length;o+=3)i=t[o]|t[o+1]<<8|t[o+2]<<16,this.words[n]|=i<<s&67108863,this.words[n+1]=i>>>26-s&67108863,26<=(s+=24)&&(s-=26,n++);return this.strip()},y.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;e<=n;n-=2)i=a(t,e,n)<<o,this.words[s]|=67108863&i,18<=o?(o-=18,this.words[s+=1]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=a(t,e,n)<<o,this.words[s]|=67108863&i,18<=o?(o-=18,this.words[s+=1]|=i>>>26):o+=8;this.strip()},y.prototype._parseBase=function(t,e,r){this.words=[0];for(var n=0,i=this.length=1;i<=67108863;i*=e)n++;for(var i=i/e|0,o=t.length-r,s=o%--n,a=Math.min(o,o-s)+r,f=0,u=r;u<a;u+=n)f=h(t,u,u+n,e),this.imuln(i),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!=s){for(var c=1,f=h(t,u,t.length,e),u=0;u<s;u++)c*=e;this.imuln(c),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}this.strip()},y.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},y.prototype.clone=function(){var t=new y(null);return this.copy(t),t},y.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},y.prototype.strip=function(){for(;1<this.length&&0===this.words[this.length-1];)this.length--;return this._normSign()},y.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},y.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var d=["","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"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,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 o(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0,n=(r.length=n)-1|0,i=(s=(0|t.words[0])*(0|e.words[0]))/67108864|0;r.words[0]=67108863&s;for(var o=1;o<n;o++){for(var s,a=i>>>26,f=67108863&i,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++)a+=(s=(0|t.words[o-c|0])*(0|e.words[c])+f)/67108864|0,f=67108863&s;r.words[o]=0|f,i=0|a}return 0!==i?r.words[o]=0|i:r.length--,r.strip()}y.prototype.toString=function(t,e){if(e=0|e||1,16===(t=t||10)||"hex"===t){a="";for(var r=0,n=0,i=0;i<this.length;i++){var o=this.words[i],s=(16777215&(o<<r|n)).toString(16),a=0!==(n=o>>>24-r&16777215)||i!==this.length-1?d[6-s.length]+s+a:s+a;26<=(r+=2)&&(r-=26,i--)}for(0!==n&&(a=n.toString(16)+a);a.length%e!=0;)a="0"+a;return a=0!==this.negative?"-"+a:a}if(t===(0|t)&&2<=t&&t<=36){var f=l[t],u=p[t];for(a="",(c=this.clone()).negative=0;!c.isZero();){var c,h=c.modn(u).toString(t);a=(c=c.idivn(u)).isZero()?h+a:d[f-h.length]+h+a}for(this.isZero()&&(a="0"+a);a.length%e!=0;)a="0"+a;return a=0!==this.negative?"-"+a:a}b(!1,"Base should be between 2 and 36")},y.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:2<this.length&&b(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},y.prototype.toJSON=function(){return this.toString(16)},y.prototype.toBuffer=function(t,e){return b(void 0!==n),this.toArrayLike(n,t,e)},y.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},y.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),i=r||Math.max(1,n);b(n<=i,"byte array longer than desired length"),b(0<i,"Requested array length <= 0"),this.strip();var o,s,e="le"===e,a=new t(i),f=this.clone();if(e){for(s=0;!f.isZero();s++)o=f.andln(255),f.iushrn(8),a[s]=o;for(;s<i;s++)a[s]=0}else{for(s=0;s<i-n;s++)a[s]=0;for(s=0;!f.isZero();s++)o=f.andln(255),f.iushrn(8),a[i-s-1]=o}return a},Math.clz32?y.prototype._countBits=function(t){return 32-Math.clz32(t)}:y.prototype._countBits=function(t){var e=t,t=0;return 4096<=e&&(t+=13,e>>>=13),64<=e&&(t+=7,e>>>=7),8<=e&&(t+=4,e>>>=4),2<=e&&(t+=2,e>>>=2),t+e},y.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,t=0;return 0==(8191&e)&&(t+=13,e>>>=13),0==(127&e)&&(t+=7,e>>>=7),0==(15&e)&&(t+=4,e>>>=4),0==(3&e)&&(t+=2,e>>>=2),0==(1&e)&&t++,t},y.prototype.bitLength=function(){var t=this.words[this.length-1],t=this._countBits(t);return 26*(this.length-1)+t},y.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},y.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},y.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},y.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},y.prototype.isNeg=function(){return 0!==this.negative},y.prototype.neg=function(){return this.clone().ineg()},y.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},y.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},y.prototype.ior=function(t){return b(0==(this.negative|t.negative)),this.iuor(t)},y.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},y.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},y.prototype.iuand=function(t){for(var e=this.length>t.length?t:this,r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},y.prototype.iand=function(t){return b(0==(this.negative|t.negative)),this.iuand(t)},y.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},y.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},y.prototype.iuxor=function(t){for(var e,r=this.length>t.length?(e=this,t):(e=t,this),n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},y.prototype.ixor=function(t){return b(0==(this.negative|t.negative)),this.iuxor(t)},y.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},y.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},y.prototype.inotn=function(t){b("number"==typeof t&&0<=t);var e=0|Math.ceil(t/26),t=t%26;this._expand(e),0<t&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return 0<t&&(this.words[r]=~this.words[r]&67108863>>26-t),this.strip()},y.prototype.notn=function(t){return this.clone().inotn(t)},y.prototype.setn=function(t,e){b("number"==typeof t&&0<=t);var r=t/26|0,t=t%26;return this._expand(1+r),this.words[r]=e?this.words[r]|1<<t:this.words[r]&~(1<<t),this.strip()},y.prototype.iadd=function(t){var e,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();for(var n=this.length>t.length?(r=this,t):(r=t,this),i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},y.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},y.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;for(var i=0<n?(r=this,t):(r=t,this),o=0,s=0;s<i.length;s++)o=(e=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},y.prototype.sub=function(t){return this.clone().isub(t)};var s=function(t,e,r){var n=t.words,i=e.words,o=r.words,s=0|n[0],a=8191&s,f=s>>>13,u=0|n[1],c=8191&u,h=u>>>13,d=0|n[2],l=8191&d,p=d>>>13,b=0|n[3],y=8191&b,m=b>>>13,g=0|n[4],w=8191&g,v=g>>>13,_=0|n[5],S=8191&_,E=_>>>13,T=0|n[6],I=8191&T,M=T>>>13,k=0|n[7],A=8191&k,O=k>>>13,x=0|n[8],P=8191&x,B=x>>>13,R=0|n[9],N=8191&R,U=R>>>13,L=0|i[0],C=8191&L,j=L>>>13,D=0|i[1],H=8191&D,q=D>>>13,F=0|i[2],z=8191&F,V=F>>>13,W=0|i[3],K=8191&W,G=W>>>13,X=0|i[4],Y=8191&X,J=X>>>13,Z=0|i[5],$=8191&Z,Q=Z>>>13,tt=0|i[6],s=8191&tt,u=tt>>>13,d=0|i[7],b=8191&d,g=d>>>13,_=0|i[8],T=8191&_,k=_>>>13,x=0|i[9],n=8191&x,R=x>>>13;r.negative=t.negative^e.negative,r.length=19;D=(0+Math.imul(a,C)|0)+((8191&(L=(L=Math.imul(a,j))+Math.imul(f,C)|0))<<13)|0,W=((F=Math.imul(f,j))+(L>>>13)|0)+(D>>>26)|0;D&=67108863,X=Math.imul(c,C),L=(L=Math.imul(c,j))+Math.imul(h,C)|0,F=Math.imul(h,j);Z=(W+(X+Math.imul(a,H)|0)|0)+((8191&(L=(L=L+Math.imul(a,q)|0)+Math.imul(f,H)|0))<<13)|0;W=((F=F+Math.imul(f,q)|0)+(L>>>13)|0)+(Z>>>26)|0,Z&=67108863,X=Math.imul(l,C),L=(L=Math.imul(l,j))+Math.imul(p,C)|0,F=Math.imul(p,j),X=X+Math.imul(c,H)|0,L=(L=L+Math.imul(c,q)|0)+Math.imul(h,H)|0,F=F+Math.imul(h,q)|0;tt=(W+(X+Math.imul(a,z)|0)|0)+((8191&(L=(L=L+Math.imul(a,V)|0)+Math.imul(f,z)|0))<<13)|0;W=((F=F+Math.imul(f,V)|0)+(L>>>13)|0)+(tt>>>26)|0,tt&=67108863,X=Math.imul(y,C),L=(L=Math.imul(y,j))+Math.imul(m,C)|0,F=Math.imul(m,j),X=X+Math.imul(l,H)|0,L=(L=L+Math.imul(l,q)|0)+Math.imul(p,H)|0,F=F+Math.imul(p,q)|0,X=X+Math.imul(c,z)|0,L=(L=L+Math.imul(c,V)|0)+Math.imul(h,z)|0,F=F+Math.imul(h,V)|0;d=(W+(X+Math.imul(a,K)|0)|0)+((8191&(L=(L=L+Math.imul(a,G)|0)+Math.imul(f,K)|0))<<13)|0;W=((F=F+Math.imul(f,G)|0)+(L>>>13)|0)+(d>>>26)|0,d&=67108863,X=Math.imul(w,C),L=(L=Math.imul(w,j))+Math.imul(v,C)|0,F=Math.imul(v,j),X=X+Math.imul(y,H)|0,L=(L=L+Math.imul(y,q)|0)+Math.imul(m,H)|0,F=F+Math.imul(m,q)|0,X=X+Math.imul(l,z)|0,L=(L=L+Math.imul(l,V)|0)+Math.imul(p,z)|0,F=F+Math.imul(p,V)|0,X=X+Math.imul(c,K)|0,L=(L=L+Math.imul(c,G)|0)+Math.imul(h,K)|0,F=F+Math.imul(h,G)|0;_=(W+(X+Math.imul(a,Y)|0)|0)+((8191&(L=(L=L+Math.imul(a,J)|0)+Math.imul(f,Y)|0))<<13)|0;W=((F=F+Math.imul(f,J)|0)+(L>>>13)|0)+(_>>>26)|0,_&=67108863,X=Math.imul(S,C),L=(L=Math.imul(S,j))+Math.imul(E,C)|0,F=Math.imul(E,j),X=X+Math.imul(w,H)|0,L=(L=L+Math.imul(w,q)|0)+Math.imul(v,H)|0,F=F+Math.imul(v,q)|0,X=X+Math.imul(y,z)|0,L=(L=L+Math.imul(y,V)|0)+Math.imul(m,z)|0,F=F+Math.imul(m,V)|0,X=X+Math.imul(l,K)|0,L=(L=L+Math.imul(l,G)|0)+Math.imul(p,K)|0,F=F+Math.imul(p,G)|0,X=X+Math.imul(c,Y)|0,L=(L=L+Math.imul(c,J)|0)+Math.imul(h,Y)|0,F=F+Math.imul(h,J)|0;i=(W+(X+Math.imul(a,$)|0)|0)+((8191&(L=(L=L+Math.imul(a,Q)|0)+Math.imul(f,$)|0))<<13)|0;W=((F=F+Math.imul(f,Q)|0)+(L>>>13)|0)+(i>>>26)|0,i&=67108863,X=Math.imul(I,C),L=(L=Math.imul(I,j))+Math.imul(M,C)|0,F=Math.imul(M,j),X=X+Math.imul(S,H)|0,L=(L=L+Math.imul(S,q)|0)+Math.imul(E,H)|0,F=F+Math.imul(E,q)|0,X=X+Math.imul(w,z)|0,L=(L=L+Math.imul(w,V)|0)+Math.imul(v,z)|0,F=F+Math.imul(v,V)|0,X=X+Math.imul(y,K)|0,L=(L=L+Math.imul(y,G)|0)+Math.imul(m,K)|0,F=F+Math.imul(m,G)|0,X=X+Math.imul(l,Y)|0,L=(L=L+Math.imul(l,J)|0)+Math.imul(p,Y)|0,F=F+Math.imul(p,J)|0,X=X+Math.imul(c,$)|0,L=(L=L+Math.imul(c,Q)|0)+Math.imul(h,$)|0,F=F+Math.imul(h,Q)|0;x=(W+(X+Math.imul(a,s)|0)|0)+((8191&(L=(L=L+Math.imul(a,u)|0)+Math.imul(f,s)|0))<<13)|0;W=((F=F+Math.imul(f,u)|0)+(L>>>13)|0)+(x>>>26)|0,x&=67108863,X=Math.imul(A,C),L=(L=Math.imul(A,j))+Math.imul(O,C)|0,F=Math.imul(O,j),X=X+Math.imul(I,H)|0,L=(L=L+Math.imul(I,q)|0)+Math.imul(M,H)|0,F=F+Math.imul(M,q)|0,X=X+Math.imul(S,z)|0,L=(L=L+Math.imul(S,V)|0)+Math.imul(E,z)|0,F=F+Math.imul(E,V)|0,X=X+Math.imul(w,K)|0,L=(L=L+Math.imul(w,G)|0)+Math.imul(v,K)|0,F=F+Math.imul(v,G)|0,X=X+Math.imul(y,Y)|0,L=(L=L+Math.imul(y,J)|0)+Math.imul(m,Y)|0,F=F+Math.imul(m,J)|0,X=X+Math.imul(l,$)|0,L=(L=L+Math.imul(l,Q)|0)+Math.imul(p,$)|0,F=F+Math.imul(p,Q)|0,X=X+Math.imul(c,s)|0,L=(L=L+Math.imul(c,u)|0)+Math.imul(h,s)|0,F=F+Math.imul(h,u)|0;t=(W+(X+Math.imul(a,b)|0)|0)+((8191&(L=(L=L+Math.imul(a,g)|0)+Math.imul(f,b)|0))<<13)|0;W=((F=F+Math.imul(f,g)|0)+(L>>>13)|0)+(t>>>26)|0,t&=67108863,X=Math.imul(P,C),L=(L=Math.imul(P,j))+Math.imul(B,C)|0,F=Math.imul(B,j),X=X+Math.imul(A,H)|0,L=(L=L+Math.imul(A,q)|0)+Math.imul(O,H)|0,F=F+Math.imul(O,q)|0,X=X+Math.imul(I,z)|0,L=(L=L+Math.imul(I,V)|0)+Math.imul(M,z)|0,F=F+Math.imul(M,V)|0,X=X+Math.imul(S,K)|0,L=(L=L+Math.imul(S,G)|0)+Math.imul(E,K)|0,F=F+Math.imul(E,G)|0,X=X+Math.imul(w,Y)|0,L=(L=L+Math.imul(w,J)|0)+Math.imul(v,Y)|0,F=F+Math.imul(v,J)|0,X=X+Math.imul(y,$)|0,L=(L=L+Math.imul(y,Q)|0)+Math.imul(m,$)|0,F=F+Math.imul(m,Q)|0,X=X+Math.imul(l,s)|0,L=(L=L+Math.imul(l,u)|0)+Math.imul(p,s)|0,F=F+Math.imul(p,u)|0,X=X+Math.imul(c,b)|0,L=(L=L+Math.imul(c,g)|0)+Math.imul(h,b)|0,F=F+Math.imul(h,g)|0;e=(W+(X+Math.imul(a,T)|0)|0)+((8191&(L=(L=L+Math.imul(a,k)|0)+Math.imul(f,T)|0))<<13)|0;W=((F=F+Math.imul(f,k)|0)+(L>>>13)|0)+(e>>>26)|0,e&=67108863,X=Math.imul(N,C),L=(L=Math.imul(N,j))+Math.imul(U,C)|0,F=Math.imul(U,j),X=X+Math.imul(P,H)|0,L=(L=L+Math.imul(P,q)|0)+Math.imul(B,H)|0,F=F+Math.imul(B,q)|0,X=X+Math.imul(A,z)|0,L=(L=L+Math.imul(A,V)|0)+Math.imul(O,z)|0,F=F+Math.imul(O,V)|0,X=X+Math.imul(I,K)|0,L=(L=L+Math.imul(I,G)|0)+Math.imul(M,K)|0,F=F+Math.imul(M,G)|0,X=X+Math.imul(S,Y)|0,L=(L=L+Math.imul(S,J)|0)+Math.imul(E,Y)|0,F=F+Math.imul(E,J)|0,X=X+Math.imul(w,$)|0,L=(L=L+Math.imul(w,Q)|0)+Math.imul(v,$)|0,F=F+Math.imul(v,Q)|0,X=X+Math.imul(y,s)|0,L=(L=L+Math.imul(y,u)|0)+Math.imul(m,s)|0,F=F+Math.imul(m,u)|0,X=X+Math.imul(l,b)|0,L=(L=L+Math.imul(l,g)|0)+Math.imul(p,b)|0,F=F+Math.imul(p,g)|0,X=X+Math.imul(c,T)|0,L=(L=L+Math.imul(c,k)|0)+Math.imul(h,T)|0,F=F+Math.imul(h,k)|0;a=(W+(X+Math.imul(a,n)|0)|0)+((8191&(L=(L=L+Math.imul(a,R)|0)+Math.imul(f,n)|0))<<13)|0;W=((F=F+Math.imul(f,R)|0)+(L>>>13)|0)+(a>>>26)|0,a&=67108863,X=Math.imul(N,H),L=(L=Math.imul(N,q))+Math.imul(U,H)|0,F=Math.imul(U,q),X=X+Math.imul(P,z)|0,L=(L=L+Math.imul(P,V)|0)+Math.imul(B,z)|0,F=F+Math.imul(B,V)|0,X=X+Math.imul(A,K)|0,L=(L=L+Math.imul(A,G)|0)+Math.imul(O,K)|0,F=F+Math.imul(O,G)|0,X=X+Math.imul(I,Y)|0,L=(L=L+Math.imul(I,J)|0)+Math.imul(M,Y)|0,F=F+Math.imul(M,J)|0,X=X+Math.imul(S,$)|0,L=(L=L+Math.imul(S,Q)|0)+Math.imul(E,$)|0,F=F+Math.imul(E,Q)|0,X=X+Math.imul(w,s)|0,L=(L=L+Math.imul(w,u)|0)+Math.imul(v,s)|0,F=F+Math.imul(v,u)|0,X=X+Math.imul(y,b)|0,L=(L=L+Math.imul(y,g)|0)+Math.imul(m,b)|0,F=F+Math.imul(m,g)|0,X=X+Math.imul(l,T)|0,L=(L=L+Math.imul(l,k)|0)+Math.imul(p,T)|0,F=F+Math.imul(p,k)|0;c=(W+(X+Math.imul(c,n)|0)|0)+((8191&(L=(L=L+Math.imul(c,R)|0)+Math.imul(h,n)|0))<<13)|0;W=((F=F+Math.imul(h,R)|0)+(L>>>13)|0)+(c>>>26)|0,c&=67108863,X=Math.imul(N,z),L=(L=Math.imul(N,V))+Math.imul(U,z)|0,F=Math.imul(U,V),X=X+Math.imul(P,K)|0,L=(L=L+Math.imul(P,G)|0)+Math.imul(B,K)|0,F=F+Math.imul(B,G)|0,X=X+Math.imul(A,Y)|0,L=(L=L+Math.imul(A,J)|0)+Math.imul(O,Y)|0,F=F+Math.imul(O,J)|0,X=X+Math.imul(I,$)|0,L=(L=L+Math.imul(I,Q)|0)+Math.imul(M,$)|0,F=F+Math.imul(M,Q)|0,X=X+Math.imul(S,s)|0,L=(L=L+Math.imul(S,u)|0)+Math.imul(E,s)|0,F=F+Math.imul(E,u)|0,X=X+Math.imul(w,b)|0,L=(L=L+Math.imul(w,g)|0)+Math.imul(v,b)|0,F=F+Math.imul(v,g)|0,X=X+Math.imul(y,T)|0,L=(L=L+Math.imul(y,k)|0)+Math.imul(m,T)|0,F=F+Math.imul(m,k)|0;l=(W+(X+Math.imul(l,n)|0)|0)+((8191&(L=(L=L+Math.imul(l,R)|0)+Math.imul(p,n)|0))<<13)|0;W=((F=F+Math.imul(p,R)|0)+(L>>>13)|0)+(l>>>26)|0,l&=67108863,X=Math.imul(N,K),L=(L=Math.imul(N,G))+Math.imul(U,K)|0,F=Math.imul(U,G),X=X+Math.imul(P,Y)|0,L=(L=L+Math.imul(P,J)|0)+Math.imul(B,Y)|0,F=F+Math.imul(B,J)|0,X=X+Math.imul(A,$)|0,L=(L=L+Math.imul(A,Q)|0)+Math.imul(O,$)|0,F=F+Math.imul(O,Q)|0,X=X+Math.imul(I,s)|0,L=(L=L+Math.imul(I,u)|0)+Math.imul(M,s)|0,F=F+Math.imul(M,u)|0,X=X+Math.imul(S,b)|0,L=(L=L+Math.imul(S,g)|0)+Math.imul(E,b)|0,F=F+Math.imul(E,g)|0,X=X+Math.imul(w,T)|0,L=(L=L+Math.imul(w,k)|0)+Math.imul(v,T)|0,F=F+Math.imul(v,k)|0;y=(W+(X+Math.imul(y,n)|0)|0)+((8191&(L=(L=L+Math.imul(y,R)|0)+Math.imul(m,n)|0))<<13)|0;W=((F=F+Math.imul(m,R)|0)+(L>>>13)|0)+(y>>>26)|0,y&=67108863,X=Math.imul(N,Y),L=(L=Math.imul(N,J))+Math.imul(U,Y)|0,F=Math.imul(U,J),X=X+Math.imul(P,$)|0,L=(L=L+Math.imul(P,Q)|0)+Math.imul(B,$)|0,F=F+Math.imul(B,Q)|0,X=X+Math.imul(A,s)|0,L=(L=L+Math.imul(A,u)|0)+Math.imul(O,s)|0,F=F+Math.imul(O,u)|0,X=X+Math.imul(I,b)|0,L=(L=L+Math.imul(I,g)|0)+Math.imul(M,b)|0,F=F+Math.imul(M,g)|0,X=X+Math.imul(S,T)|0,L=(L=L+Math.imul(S,k)|0)+Math.imul(E,T)|0,F=F+Math.imul(E,k)|0;w=(W+(X+Math.imul(w,n)|0)|0)+((8191&(L=(L=L+Math.imul(w,R)|0)+Math.imul(v,n)|0))<<13)|0;W=((F=F+Math.imul(v,R)|0)+(L>>>13)|0)+(w>>>26)|0,w&=67108863,X=Math.imul(N,$),L=(L=Math.imul(N,Q))+Math.imul(U,$)|0,F=Math.imul(U,Q),X=X+Math.imul(P,s)|0,L=(L=L+Math.imul(P,u)|0)+Math.imul(B,s)|0,F=F+Math.imul(B,u)|0,X=X+Math.imul(A,b)|0,L=(L=L+Math.imul(A,g)|0)+Math.imul(O,b)|0,F=F+Math.imul(O,g)|0,X=X+Math.imul(I,T)|0,L=(L=L+Math.imul(I,k)|0)+Math.imul(M,T)|0,F=F+Math.imul(M,k)|0;S=(W+(X+Math.imul(S,n)|0)|0)+((8191&(L=(L=L+Math.imul(S,R)|0)+Math.imul(E,n)|0))<<13)|0;W=((F=F+Math.imul(E,R)|0)+(L>>>13)|0)+(S>>>26)|0,S&=67108863,X=Math.imul(N,s),L=(L=Math.imul(N,u))+Math.imul(U,s)|0,F=Math.imul(U,u),X=X+Math.imul(P,b)|0,L=(L=L+Math.imul(P,g)|0)+Math.imul(B,b)|0,F=F+Math.imul(B,g)|0,X=X+Math.imul(A,T)|0,L=(L=L+Math.imul(A,k)|0)+Math.imul(O,T)|0,F=F+Math.imul(O,k)|0;I=(W+(X+Math.imul(I,n)|0)|0)+((8191&(L=(L=L+Math.imul(I,R)|0)+Math.imul(M,n)|0))<<13)|0;W=((F=F+Math.imul(M,R)|0)+(L>>>13)|0)+(I>>>26)|0,I&=67108863,X=Math.imul(N,b),L=(L=Math.imul(N,g))+Math.imul(U,b)|0,F=Math.imul(U,g),X=X+Math.imul(P,T)|0,L=(L=L+Math.imul(P,k)|0)+Math.imul(B,T)|0,F=F+Math.imul(B,k)|0;A=(W+(X+Math.imul(A,n)|0)|0)+((8191&(L=(L=L+Math.imul(A,R)|0)+Math.imul(O,n)|0))<<13)|0;W=((F=F+Math.imul(O,R)|0)+(L>>>13)|0)+(A>>>26)|0,A&=67108863,X=Math.imul(N,T),L=(L=Math.imul(N,k))+Math.imul(U,T)|0,F=Math.imul(U,k);P=(W+(X+Math.imul(P,n)|0)|0)+((8191&(L=(L=L+Math.imul(P,R)|0)+Math.imul(B,n)|0))<<13)|0;W=((F=F+Math.imul(B,R)|0)+(L>>>13)|0)+(P>>>26)|0,P&=67108863;n=(W+Math.imul(N,n)|0)+((8191&(L=(L=Math.imul(N,R))+Math.imul(U,n)|0))<<13)|0;return W=((F=Math.imul(U,R))+(L>>>13)|0)+(n>>>26)|0,n&=67108863,o[0]=D,o[1]=Z,o[2]=tt,o[3]=d,o[4]=_,o[5]=i,o[6]=x,o[7]=t,o[8]=e,o[9]=a,o[10]=c,o[11]=l,o[12]=y,o[13]=w,o[14]=S,o[15]=I,o[16]=A,o[17]=P,o[18]=n,0!=W&&(o[19]=W,r.length++),r};function f(t,e,r){return(new u).mulp(t,e,r)}function u(t,e){this.x=t,this.y=e}Math.imul||(s=o),y.prototype.mulTo=function(t,e){var r=this.length+t.length,e=(10===this.length&&10===t.length?s:r<63?o:r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){for(var s=i,i=0,a=67108863&n,f=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=f;u++){var c,h=(0|t.words[o-u])*(0|e.words[u]),a=67108863&(c=(c=67108863&h)+a|0);i+=(s=(s=s+(h/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}:f)(this,t,e);return e},u.prototype.makeRBT=function(t){for(var e=new Array(t),r=y.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},u.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},u.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},u.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,f=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var h=f,d=u,l=0;l<s;l++){var p=r[c+l],b=n[c+l],y=r[c+l+s],m=h*y-d*(g=n[c+l+s]),g=h*g+d*y;r[c+l]=p+(y=m),n[c+l]=b+g,r[c+l+s]=p-y,n[c+l+s]=b-g,l!==a&&(m=f*h-u*d,d=f*d+u*h,h=m)}},u.prototype.guessLen13b=function(t,e){for(var t=1&(n=1|Math.max(e,t)),r=0,n=n/2|0;n;n>>>=1)r++;return 1<<r+1+t},u.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},u.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},u.prototype.convert13b=function(t,e,r,n){for(var i=0,o=0;o<e;o++)i+=0|t[o],r[2*o]=8191&i,r[2*o+1]=8191&(i>>>=13),i>>>=13;for(o=2*e;o<n;++o)r[o]=0;b(0===i),b(0==(-8192&i))},u.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},u.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),f=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,u,n),this.transform(s,o,a,f,n,i),this.transform(u,o,c,h,n,i);for(var l=0;l<n;l++){var p=a[l]*c[l]-f[l]*h[l];f[l]=a[l]*h[l]+f[l]*c[l],a[l]=p}return this.conjugate(a,f,n),this.transform(a,f,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},y.prototype.mul=function(t){var e=new y(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},y.prototype.mulf=function(t){var e=new y(null);return e.words=new Array(this.length+t.length),f(this,t,e)},y.prototype.imul=function(t){return this.clone().mulTo(t,this)},y.prototype.imuln=function(t){b("number"==typeof t),b(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,i=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=i>>>26,this.words[r]=67108863&i}return 0!==e&&(this.words[r]=e,this.length++),this},y.prototype.muln=function(t){return this.clone().imuln(t)},y.prototype.sqr=function(){return this.mul(this)},y.prototype.isqr=function(){return this.imul(this.clone())},y.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r%26;e[r]=(t.words[r/26|0]&1<<n)>>>n}return e}(t);if(0===e.length)return new y(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},y.prototype.iushln=function(t){b("number"==typeof t&&0<=t);var e=t%26,r=(t-e)/26,n=67108863>>>26-e<<26-e;if(0!=e){for(var i=0,o=0;o<this.length;o++){var s=this.words[o]&n,a=(0|this.words[o])-s<<e;this.words[o]=a|i,i=s>>>26-e}i&&(this.words[o]=i,this.length++)}if(0!=r){for(o=this.length-1;0<=o;o--)this.words[o+r]=this.words[o];for(o=0;o<r;o++)this.words[o]=0;this.length+=r}return this.strip()},y.prototype.ishln=function(t){return b(0===this.negative),this.iushln(t)},y.prototype.iushrn=function(t,e,r){b("number"==typeof t&&0<=t);var n=e?(e-e%26)/26:0,i=t%26,o=Math.min((t-i)/26,this.length),s=67108863^67108863>>>i<<i,a=r;if(n-=o,n=Math.max(0,n),a){for(var f=0;f<o;f++)a.words[f]=this.words[f];a.length=o}if(0!==o)if(this.length>o)for(this.length-=o,f=0;f<this.length;f++)this.words[f]=this.words[f+o];else this.words[0]=0,this.length=1;for(var u=0,f=this.length-1;0<=f&&(0!==u||n<=f);f--){var c=0|this.words[f];this.words[f]=u<<26-i|c>>>i,u=c&s}return a&&0!==u&&(a.words[a.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},y.prototype.ishrn=function(t,e,r){return b(0===this.negative),this.iushrn(t,e,r)},y.prototype.shln=function(t){return this.clone().ishln(t)},y.prototype.ushln=function(t){return this.clone().iushln(t)},y.prototype.shrn=function(t){return this.clone().ishrn(t)},y.prototype.ushrn=function(t){return this.clone().iushrn(t)},y.prototype.testn=function(t){b("number"==typeof t&&0<=t);var e=t%26,t=(t-e)/26;return!(this.length<=t)&&!!(this.words[t]&1<<e)},y.prototype.imaskn=function(t){b("number"==typeof t&&0<=t);var e=t%26,t=(t-e)/26;return b(0===this.negative,"imaskn works only with positive numbers"),this.length<=t?this:(0!=e&&t++,this.length=Math.min(t,this.length),0!=e&&(this.words[this.length-1]&=67108863^67108863>>>e<<e),this.strip())},y.prototype.maskn=function(t){return this.clone().imaskn(t)},y.prototype.iaddn=function(t){return b("number"==typeof t),b(t<67108864),t<0?this.isubn(-t):0!==this.negative?(1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(t),this.negative=1),this):this._iaddn(t)},y.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&67108864<=this.words[e];e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},y.prototype.isubn=function(t){if(b("number"==typeof t),b(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,--this.words[e+1];return this.strip()},y.prototype.addn=function(t){return this.clone().iaddn(t)},y.prototype.subn=function(t){return this.clone().isubn(t)},y.prototype.iabs=function(){return this.negative=0,this},y.prototype.abs=function(){return this.clone().iabs()},y.prototype._ishlnsubmul=function(t,e,r){var n=t.length+r;this._expand(n);for(var i=0,o=0;o<t.length;o++){var s=(0|this.words[o+r])+i,a=(0|t.words[o])*e,i=((s-=67108863&a)>>26)-(a/67108864|0);this.words[o+r]=67108863&s}for(;o<this.length-r;o++)i=(s=(0|this.words[o+r])+i)>>26,this.words[o+r]=67108863&s;if(0===i)return this.strip();for(b(-1===i),o=i=0;o<this.length;o++)i=(s=-(0|this.words[o])+i)>>26,this.words[o]=67108863&s;return this.negative=1,this.strip()},y.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),i=t,o=0|i.words[i.length-1];0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,a=n.length-i.length;if("mod"!==e){(s=new y(null)).length=1+a,s.words=new Array(s.length);for(var f=0;f<s.length;f++)s.words[f]=0}t=n.clone()._ishlnsubmul(i,1,a);0===t.negative&&(n=t,s&&(s.words[a]=1));for(var u=a-1;0<=u;u--){var c=67108864*(0|n.words[i.length+u])+(0|n.words[i.length+u-1]),c=Math.min(c/o|0,67108863);for(n._ishlnsubmul(i,c,u);0!==n.negative;)c--,n.negative=0,n._ishlnsubmul(i,1,u),n.isZero()||(n.negative^=1);s&&(s.words[u]=c)}return s&&s.strip(),n.strip(),"div"!==e&&0!=r&&n.iushrn(r),{div:s||null,mod:n}},y.prototype.divmod=function(t,e,r){return b(!t.isZero()),this.isZero()?{div:new y(0),mod:new y(0)}:0!==this.negative&&0===t.negative?(o=this.neg().divmod(t,e),"mod"!==e&&(n=o.div.neg()),"div"!==e&&(i=o.mod.neg(),r&&0!==i.negative&&i.iadd(t)),{div:n,mod:i}):0===this.negative&&0!==t.negative?(o=this.divmod(t.neg(),e),{div:n="mod"!==e?o.div.neg():n,mod:o.mod}):0!=(this.negative&t.negative)?(o=this.neg().divmod(t.neg(),e),"div"!==e&&(i=o.mod.neg(),r&&0!==i.negative&&i.isub(t)),{div:o.div,mod:i}):t.length>this.length||this.cmp(t)<0?{div:new y(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new y(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new y(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,i,o},y.prototype.div=function(t){return this.divmod(t,"div",!1).div},y.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},y.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},y.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),t=t.andln(1),n=r.cmp(n);return n<0||1===t&&0===n?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},y.prototype.modn=function(t){b(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;0<=n;n--)r=(e*r+(0|this.words[n]))%t;return r},y.prototype.idivn=function(t){b(t<=67108863);for(var e=0,r=this.length-1;0<=r;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},y.prototype.divn=function(t){return this.clone().idivn(t)},y.prototype.egcd=function(t){b(0===t.negative),b(!t.isZero());for(var e=this,r=t.clone(),e=0!==e.negative?e.umod(t):e.clone(),n=new y(1),i=new y(0),o=new y(0),s=new y(1),a=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++a;for(var f=r.clone(),u=e.clone();!e.isZero();){for(var c=0,h=1;0==(e.words[0]&h)&&c<26;++c,h<<=1);if(0<c)for(e.iushrn(c);0<c--;)(n.isOdd()||i.isOdd())&&(n.iadd(f),i.isub(u)),n.iushrn(1),i.iushrn(1);for(var d=0,l=1;0==(r.words[0]&l)&&d<26;++d,l<<=1);if(0<d)for(r.iushrn(d);0<d--;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(u)),o.iushrn(1),s.iushrn(1);0<=e.cmp(r)?(e.isub(r),n.isub(o),i.isub(s)):(r.isub(e),o.isub(n),s.isub(i))}return{a:o,b:s,gcd:r.iushln(a)}},y.prototype._invmp=function(t){b(0===t.negative),b(!t.isZero());for(var e,r=this,n=t.clone(),r=0!==r.negative?r.umod(t):r.clone(),i=new y(1),o=new y(0),s=n.clone();0<r.cmpn(1)&&0<n.cmpn(1);){for(var a=0,f=1;0==(r.words[0]&f)&&a<26;++a,f<<=1);if(0<a)for(r.iushrn(a);0<a--;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var u=0,c=1;0==(n.words[0]&c)&&u<26;++u,c<<=1);if(0<u)for(n.iushrn(u);0<u--;)o.isOdd()&&o.iadd(s),o.iushrn(1);0<=r.cmp(n)?(r.isub(n),i.isub(o)):(n.isub(r),o.isub(i))}return(e=0===r.cmpn(1)?i:o).cmpn(0)<0&&e.iadd(t),e},y.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0;for(var n=r.negative=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0)var o=e,e=r,r=o;else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},y.prototype.invm=function(t){return this.egcd(t).a.umod(t)},y.prototype.isEven=function(){return 0==(1&this.words[0])},y.prototype.isOdd=function(){return 1==(1&this.words[0])},y.prototype.andln=function(t){return this.words[0]&t},y.prototype.bincn=function(t){b("number"==typeof t);var e=t%26,t=(t-e)/26,e=1<<e;if(this.length<=t)return this._expand(1+t),this.words[t]|=e,this;for(var r=e,n=t;0!==r&&n<this.length;n++){var i=0|this.words[n],r=(i+=r)>>>26;i&=67108863,this.words[n]=i}return 0!==r&&(this.words[n]=r,this.length++),this},y.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},y.prototype.cmpn=function(t){var e=t<0;return 0===this.negative||e?0===this.negative&&e?1:(this.strip(),t=1<this.length?1:(b((t=e?-t:t)<=67108863,"Number is too big"),(e=0|this.words[0])===t?0:e<t?-1:1),0!==this.negative?0|-t:t):-1},y.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;t=this.ucmp(t);return 0!==this.negative?0|-t:t},y.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;0<=r;r--){var n=0|this.words[r],i=0|t.words[r];if(n!=i){n<i?e=-1:i<n&&(e=1);break}}return e},y.prototype.gtn=function(t){return 1===this.cmpn(t)},y.prototype.gt=function(t){return 1===this.cmp(t)},y.prototype.gten=function(t){return 0<=this.cmpn(t)},y.prototype.gte=function(t){return 0<=this.cmp(t)},y.prototype.ltn=function(t){return-1===this.cmpn(t)},y.prototype.lt=function(t){return-1===this.cmp(t)},y.prototype.lten=function(t){return this.cmpn(t)<=0},y.prototype.lte=function(t){return this.cmp(t)<=0},y.prototype.eqn=function(t){return 0===this.cmpn(t)},y.prototype.eq=function(t){return 0===this.cmp(t)},y.red=function(t){return new S(t)},y.prototype.toRed=function(t){return b(!this.red,"Already a number in reduction context"),b(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},y.prototype.fromRed=function(){return b(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},y.prototype._forceRed=function(t){return this.red=t,this},y.prototype.forceRed=function(t){return b(!this.red,"Already a number in reduction context"),this._forceRed(t)},y.prototype.redAdd=function(t){return b(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},y.prototype.redIAdd=function(t){return b(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},y.prototype.redSub=function(t){return b(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},y.prototype.redISub=function(t){return b(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},y.prototype.redShl=function(t){return b(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},y.prototype.redMul=function(t){return b(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},y.prototype.redIMul=function(t){return b(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},y.prototype.redSqr=function(){return b(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},y.prototype.redISqr=function(){return b(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},y.prototype.redSqrt=function(){return b(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},y.prototype.redInvm=function(){return b(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},y.prototype.redNeg=function(){return b(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},y.prototype.redPow=function(t){return b(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var c={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new y(e,16),this.n=this.p.bitLength(),this.k=new y(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){var e;"string"==typeof t?(e=y._prime(t),this.m=e.p,this.prime=e):(b(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null)}function E(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new y(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 t=new y(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){for(var e,r=t;this.split(r,this.tmp),(e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength())>this.n;);t=e<this.n?-1:r.ucmp(this.p);return 0===t?(r.words[0]=0,r.length=1):0<t?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},r(g,m),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}0===(t.words[n-10]=i>>>=22)&&10<t.length?t.length-=10:t.length-=9},g.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},r(w,m),r(v,m),r(_,m),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},y._prime=function(t){if(c[t])return c[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new w;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return c[t]=e},S.prototype._verify1=function(t){b(0===t.negative,"red works only with positives"),b(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){b(0==(t.negative|e.negative),"red works only with positives"),b(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return(this.prime?this.prime.ireduce(t):t.umod(this.m))._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);e=t.add(e);return 0<=e.cmp(this.m)&&e.isub(this.m),e._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);e=t.iadd(e);return 0<=e.cmp(this.m)&&e.isub(this.m),e},S.prototype.sub=function(t,e){this._verify2(t,e);e=t.sub(e);return e.cmpn(0)<0&&e.iadd(this.m),e._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);e=t.isub(e);return e.cmpn(0)<0&&e.iadd(this.m),e},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(b(e%2==1),3===e){e=this.m.add(new y(1)).iushrn(2);return this.pow(t,e)}for(var r=this.m.subn(1),n=0;!r.isZero()&&0===r.andln(1);)n++,r.iushrn(1);b(!r.isZero());for(var i=new y(1).toRed(this),o=i.redNeg(),s=this.m.subn(1).iushrn(1),a=new y(2*(a=this.m.bitLength())*a).toRed(this);0!==this.pow(a,s).cmp(o);)a.redIAdd(o);for(var f=this.pow(a,r),u=this.pow(t,r.addn(1).iushrn(1)),c=this.pow(t,r),h=n;0!==c.cmp(i);){for(var d=c,l=0;0!==d.cmp(i);l++)d=d.redSqr();b(l<h);var p=this.pow(f,new y(1).iushln(h-l-1)),u=u.redMul(p),f=p.redSqr(),c=c.redMul(f),h=l}return u},S.prototype.invm=function(t){t=t._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(t,e){if(e.isZero())return new y(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new y(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,s=0,a=e.bitLength()%26;for(0===a&&(a=26),n=e.length-1;0<=n;n--){for(var f=e.words[n],u=a-1;0<=u;u--){var c=f>>u&1;i!==r[0]&&(i=this.sqr(i)),0!=c||0!==o?(o<<=1,o|=c,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),o=s=0)):s=0}a=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){t=t.clone();return t.red=null,t},y.mont=function(t){return new E(t)},r(E,S),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){t=this.imod(t.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;t=t.imul(e),e=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),t=t.isub(e).iushrn(this.shift),e=t;return 0<=t.cmp(this.m)?e=t.isub(this.m):t.cmpn(0)<0&&(e=t.iadd(this.m)),e._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new y(0)._forceRed(this);t=t.mul(e),e=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),t=t.isub(e).iushrn(this.shift),e=t;return 0<=t.cmp(this.m)?e=t.isub(this.m):t.cmpn(0)<0&&(e=t.iadd(this.m)),e._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:143}],56:[function(t,e,r){var n;function i(t){this.rand=t}if(e.exports=function(t){return(n=n||new i(null)).generate(t)},(e.exports.Rand=i).prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(t){t=new Uint8Array(t);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(t){t=new Uint8Array(t);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=t("crypto");if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(t){return o.randomBytes(t)}}catch(t){}},{crypto:143}],57:[function(t,e,r){t=t("base-x");e.exports=t("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},{"base-x":1}],58:[function(t,e,r){"use strict";var i=t("bs58"),o=t("safe-buffer").Buffer;e.exports=function(n){function e(t){var e=t.slice(0,-4),r=t.slice(-4),t=n(e);if(!(r[0]^t[0]|r[1]^t[1]|r[2]^t[2]|r[3]^t[3]))return e}return{encode:function(t){var e=n(t);return i.encode(o.concat([t,e],t.length+4))},decode:function(t){if(!(t=e(i.decode(t))))throw new Error("Invalid checksum");return t},decodeUnsafe:function(t){if(t=i.decodeUnsafe(t))return e(t)}}}},{bs58:57,"safe-buffer":119}],59:[function(t,e,r){"use strict";var n=t("create-hash"),t=t("./base");e.exports=t(function(t){return t=n("sha256").update(t).digest(),n("sha256").update(t).digest()})},{"./base":58,"create-hash":61}],60:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("stream").Transform,o=t("string_decoder").StringDecoder;function s(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}t("inherits")(s,i),s.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));t=this._update(t);return this.hashMode?this:r?this._toString(t,r):t},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return e=t?this._toString(e,t,!0):e},s.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");t=this._decoder.write(t);return r&&(t+=this._decoder.end()),t},e.exports=s},{inherits:98,"safe-buffer":119,stream:152,string_decoder:167}],61:[function(t,e,r){"use strict";var n=t("inherits"),i=t("md5.js"),o=t("ripemd160"),s=t("sha.js"),a=t("cipher-base");function f(t){a.call(this,"digest"),this._hash=t}n(f,a),f.prototype._update=function(t){this._hash.update(t)},f.prototype._final=function(){return this._hash.digest()},e.exports=function(t){return"md5"===(t=t.toLowerCase())?new i:"rmd160"===t||"ripemd160"===t?new o:new f(s(t))}},{"cipher-base":60,inherits:98,"md5.js":99,ripemd160:118,"sha.js":121}],62:[function(t,e,r){var n=t("md5.js");e.exports=function(t){return(new n).update(t).digest()}},{"md5.js":99}],63:[function(t,e,r){"use strict";var n=t("inherits"),i=t("./legacy"),s=t("cipher-base"),a=t("safe-buffer").Buffer,o=t("create-hash/md5"),f=t("ripemd160"),u=t("sha.js"),c=a.alloc(128);function h(t,e){s.call(this,"digest"),"string"==typeof e&&(e=a.from(e));var r="sha512"===t||"sha384"===t?128:64;this._alg=t,(this._key=e).length>r?e=("rmd160"===t?new f:u(t)).update(e).digest():e.length<r&&(e=a.concat([e,c],r));for(var n=this._ipad=a.allocUnsafe(r),i=this._opad=a.allocUnsafe(r),o=0;o<r;o++)n[o]=54^e[o],i[o]=92^e[o];this._hash="rmd160"===t?new f:u(t),this._hash.update(n)}n(h,s),h.prototype._update=function(t){this._hash.update(t)},h.prototype._final=function(){var t=this._hash.digest();return("rmd160"===this._alg?new f:u(this._alg)).update(this._opad).update(t).digest()},e.exports=function(t,e){return"rmd160"===(t=t.toLowerCase())||"ripemd160"===t?new h("rmd160",e):"md5"===t?new i(o,e):new h(t,e)}},{"./legacy":64,"cipher-base":60,"create-hash/md5":62,inherits:98,ripemd160:118,"safe-buffer":119,"sha.js":121}],64:[function(t,e,r){"use strict";var n=t("inherits"),o=t("safe-buffer").Buffer,s=t("cipher-base"),a=o.alloc(128);function i(t,e){s.call(this,"digest"),"string"==typeof e&&(e=o.from(e)),this._alg=t,64<(this._key=e).length?e=t(e):e.length<64&&(e=o.concat([e,a],64));for(var r=this._ipad=o.allocUnsafe(64),n=this._opad=o.allocUnsafe(64),i=0;i<64;i++)r[i]=54^e[i],n[i]=92^e[i];this._hash=[r]}n(i,s),i.prototype._update=function(t){this._hash.push(t)},i.prototype._final=function(){var t=this._alg(o.concat(this._hash));return this._alg(o.concat([this._opad,t]))},e.exports=i},{"cipher-base":60,inherits:98,"safe-buffer":119}],65:[function(t,e,r){!function(u){!function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ECPair=r.networks=void 0;const n=t("./networks");r.networks=n;const i=t("./types"),o=t("randombytes"),s=t("wif"),a=t("tiny-secp256k1"),f=i.typeforce.maybe(i.typeforce.compile({compressed:i.maybe(i.Boolean),network:i.maybe(i.Network)}));r.ECPair=class ECPair{__D;__Q;static isPoint(t){return a.isPoint(t)}static fromPrivateKey(t,e){if(i.typeforce(i.Buffer256bit,t),!a.isPrivate(t))throw new TypeError("Private key not in range [1, n)");return i.typeforce(f,e),new ECPair(t,void 0,e)}static fromPublicKey(t,e){return i.typeforce(a.isPoint,t),i.typeforce(f,e),new ECPair(void 0,t,e)}static fromWIF(t,e){const r=(t=s.decode(t)).version;if(i.Array(e)){if(!(e=e.filter(t=>r===t.wif).pop()))throw new Error("Unknown network version")}else if(e=e||n.bitcoin,r!==e.wif)throw new Error("Invalid network version");return this.fromPrivateKey(t.privateKey,{compressed:t.compressed,network:e})}static makeRandom(t){i.typeforce(f,t);const e=(t=void 0===t?{}:t).rng||o;let r;for(;r=e(32),i.typeforce(i.Buffer256bit,r),!a.isPrivate(r););return this.fromPrivateKey(r,t)}compressed;network;lowR;constructor(t,e,r){this.__D=t,this.__Q=e,this.lowR=!1,this.compressed=void 0===(r=void 0===r?{}:r).compressed||r.compressed,this.network=r.network||n.bitcoin,void 0!==e&&(this.__Q=a.pointCompress(e,this.compressed))}get privateKey(){return this.__D}get publicKey(){return this.__Q||(this.__Q=a.pointFromScalar(this.__D,this.compressed)),this.__Q}toWIF(){if(!this.__D)throw new Error("Missing private key");return s.encode(this.network.wif,this.__D,this.compressed)}sign(r,t){if(!this.__D)throw new Error("Missing private key");if(!1===(t=void 0===t?this.lowR:t))return a.sign(r,this.__D);{let t=a.sign(r,this.__D);const n=u.alloc(32,0);let e=0;for(;127<t[0];)e++,n.writeUIntLE(e,0,6),t=a.signWithEntropy(r,this.__D,n);return t}}verify(t,e){return a.verify(t,this.publicKey,e)}}}.call(this)}.call(this,t("buffer").Buffer)},{"./networks":66,"./types":67,buffer:144,randombytes:102,"tiny-secp256k1":129,wif:137}],66:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.testnet=r.bitcoin=void 0,r.bitcoin={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},r.testnet={messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}},{}],67:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.maybe=r.Boolean=r.Array=r.Buffer256bit=r.Network=r.typeforce=void 0,r.typeforce=t("typeforce"),r.Network=r.typeforce.compile({messagePrefix:r.typeforce.oneOf(r.typeforce.Buffer,r.typeforce.String),bip32:{public:r.typeforce.UInt32,private:r.typeforce.UInt32},pubKeyHash:r.typeforce.UInt8,scriptHash:r.typeforce.UInt8,wif:r.typeforce.UInt8}),r.Buffer256bit=r.typeforce.BufferN(32),r.Array=r.typeforce.Array,r.Boolean=r.typeforce.Boolean,r.maybe=r.typeforce.maybe},{typeforce:133}],68:[function(t,e,r){"use strict";r.version=t("../package.json").version,r.utils=t("./elliptic/utils"),r.rand=t("brorand"),r.curve=t("./elliptic/curve"),r.curves=t("./elliptic/curves"),r.ec=t("./elliptic/ec"),r.eddsa=t("./elliptic/eddsa")},{"../package.json":83,"./elliptic/curve":71,"./elliptic/curves":74,"./elliptic/ec":75,"./elliptic/eddsa":78,"./elliptic/utils":82,brorand:56}],69:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils"),I=i.getNAF,M=i.getJSF,h=i.assert;function o(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;e=this.n&&this.p.div(this.n);!e||0<e.cmpn(100)?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function s(t,e){this.curve=t,this.type=e,this.precomputed=null}(e.exports=o).prototype.point=function(){throw new Error("Not implemented")},o.prototype.validate=function(){throw new Error("Not implemented")},o.prototype._fixedNafMul=function(t,e){h(t.precomputed);var r=t._getDoubles(),n=I(e,1,this._bitLength),e=(1<<r.step+1)-(r.step%2==0?2:1);e/=3;for(var i=[],o=0;o<n.length;o+=r.step){for(var s=0,a=o+r.step-1;o<=a;a--)s=(s<<1)+n[a];i.push(s)}for(var f=this.jpoint(null,null,null),u=this.jpoint(null,null,null),c=e;0<c;c--){for(o=0;o<i.length;o++)(s=i[o])===c?u=u.mixedAdd(r.points[o]):s===-c&&(u=u.mixedAdd(r.points[o].neg()));f=f.add(u)}return f.toP()},o.prototype._wnafMul=function(t,e){for(var r=t._getNAFPoints(4),n=r.wnd,i=r.points,o=I(e,n,this._bitLength),s=this.jpoint(null,null,null),a=o.length-1;0<=a;a--){for(var f=0;0<=a&&0===o[a];a--)f++;if(0<=a&&f++,s=s.dblp(f),a<0)break;var u=o[a];h(0!==u),s="affine"===t.type?0<u?s.mixedAdd(i[u-1>>1]):s.mixedAdd(i[-u-1>>1].neg()):0<u?s.add(i[u-1>>1]):s.add(i[-u-1>>1].neg())}return"affine"===t.type?s.toP():s},o.prototype._wnafMulAdd=function(t,e,r,n,i){for(var o=this._wnafT1,s=this._wnafT2,a=this._wnafT3,f=0,u=0;u<n;u++){var c,h=(c=e[u])._getNAFPoints(t);o[u]=h.wnd,s[u]=h.points}for(u=n-1;1<=u;u-=2){var d=u-1,l=u;if(1===o[d]&&1===o[l]){var p=[e[d],null,null,e[l]];0===e[d].y.cmp(e[l].y)?(p[1]=e[d].add(e[l]),p[2]=e[d].toJ().mixedAdd(e[l].neg())):0===e[d].y.cmp(e[l].y.redNeg())?(p[1]=e[d].toJ().mixedAdd(e[l]),p[2]=e[d].add(e[l].neg())):(p[1]=e[d].toJ().mixedAdd(e[l]),p[2]=e[d].toJ().mixedAdd(e[l].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],y=M(r[d],r[l]),f=Math.max(y[0].length,f);for(a[d]=new Array(f),a[l]=new Array(f),E=0;E<f;E++){var m=0|y[0][E],g=0|y[1][E];a[d][E]=b[3*(1+m)+(1+g)],a[l][E]=0,s[d]=p}}else a[d]=I(r[d],o[d],this._bitLength),a[l]=I(r[l],o[l],this._bitLength),f=Math.max(a[d].length,f),f=Math.max(a[l].length,f)}var w=this.jpoint(null,null,null),v=this._wnafT4;for(u=f;0<=u;u--){for(var _=0;0<=u;){for(var S=!0,E=0;E<n;E++)v[E]=0|a[E][u],0!==v[E]&&(S=!1);if(!S)break;_++,u--}if(0<=u&&_++,w=w.dblp(_),u<0)break;for(E=0;E<n;E++){var T=v[E];0!==T&&(0<T?c=s[E][T-1>>1]:T<0&&(c=s[E][-T-1>>1].neg()),w="affine"===c.type?w.mixedAdd(c):w.add(c))}}for(u=0;u<n;u++)s[u]=null;return i?w:w.toP()},(o.BasePoint=s).prototype.eq=function(){throw new Error("Not implemented")},s.prototype.validate=function(){return this.curve.validate(this)},o.prototype.decodePoint=function(t,e){t=i.toArray(t,e);e=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*e)return 6===t[0]?h(t[t.length-1]%2==0):7===t[0]&&h(t[t.length-1]%2==1),this.point(t.slice(1,1+e),t.slice(1+e,1+2*e));if((2===t[0]||3===t[0])&&t.length-1===e)return this.pointFromX(t.slice(1,1+e),3===t[0]);throw new Error("Unknown point format")},s.prototype.encodeCompressed=function(t){return this.encode(t,!0)},s.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},s.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},s.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},s.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},s.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},s.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1==r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},s.prototype._getBeta=function(){return null},s.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},{"../utils":82,"bn.js":55}],70:[function(t,e,r){"use strict";var n=t("../utils"),o=t("bn.js"),i=t("inherits"),s=t("./base"),a=n.assert;function f(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new o(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new o(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function Point(t,e,r,n,i){s.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(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 o(e,16),this.y=new o(r,16),this.z=n?new o(n,16):this.curve.one,this.t=i&&new o(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.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()))))}i(f,s),(e.exports=f).prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},f.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},f.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},f.prototype.pointFromX=function(t,e){var r=(t=!(t=new o(t,16)).red?t.toRed(this.red):t).redSqr(),n=this.c2.redSub(this.a.redMul(r)),r=this.one.redSub(this.c2.redMul(this.d).redMul(r)),n=n.redMul(r.redInvm()),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");n=r.fromRed().isOdd();return(e&&!n||!e&&n)&&(r=r.redNeg()),this.point(t,r)},f.prototype.pointFromY=function(t,e){var r=(t=!(t=new o(t,16)).red?t.toRed(this.red):t).redSqr(),n=r.redSub(this.c2),r=r.redMul(this.d).redMul(this.c2).redSub(this.a),n=n.redMul(r.redInvm());if(0===n.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");return r.fromRed().isOdd()!==e&&(r=r.redNeg()),this.point(r,t)},f.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),t=e.redMul(this.a).redAdd(r),r=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===t.cmp(r)},i(Point,s.BasePoint),f.prototype.pointFromJSON=function(t){return Point.fromJSON(this,t)},f.prototype.point=function(t,e,r,n){return new Point(this,t,e,r,n)},Point.fromJSON=function(t,e){return new Point(t,e[0],e[1],e[2])},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},Point.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=(r=this.z.redSqr()).redIAdd(r),n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),t=o.redSub(r),r=n.redSub(e),n=i.redMul(t),e=o.redMul(r),r=i.redMul(r),o=t.redMul(o);return this.curve.point(n,e,o,r)},Point.prototype._projDbl=function(){var t,e,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),f=this.y.redSqr();return o=this.curve.twisted?(i=(n=this.curve._mulA(a)).redAdd(f),this.zOne?(t=s.redSub(a).redSub(f).redMul(i.redSub(this.curve.two)),e=i.redMul(n.redSub(f)),i.redSqr().redSub(i).redSub(i)):(r=this.z.redSqr(),o=i.redSub(r).redISub(r),t=s.redSub(a).redISub(f).redMul(o),e=i.redMul(n.redSub(f)),i.redMul(o))):(n=a.redAdd(f),r=this.curve._mulC(this.z).redSqr(),o=n.redSub(r).redSub(r),t=this.curve._mulC(s.redISub(n)).redMul(o),e=this.curve._mulC(n).redMul(a.redISub(f)),n.redMul(o)),this.curve.point(t,e,o)},Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),t=i.redSub(n),i=i.redAdd(n),n=r.redAdd(e),r=o.redMul(t),e=i.redMul(n),n=o.redMul(n),i=t.redMul(i);return this.curve.point(r,e,i,n)},Point.prototype._projAdd=function(t){var e,r=this.z.redMul(t.z),n=r.redSqr(),i=this.x.redMul(t.x),o=this.y.redMul(t.y),s=this.curve.d.redMul(i).redMul(o),a=n.redSub(s),s=n.redAdd(s),t=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(i).redISub(o),t=r.redMul(a).redMul(t),s=this.curve.twisted?(e=r.redMul(s).redMul(o.redSub(this.curve._mulA(i))),a.redMul(s)):(e=r.redMul(s).redMul(o.redSub(i)),this.curve._mulC(a).redMul(s));return this.curve.point(t,e,s)},Point.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},Point.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},Point.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},Point.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},Point.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},Point.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),0<=r.cmp(this.curve.p))return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add},{"../utils":82,"./base":69,"bn.js":55,inherits:98}],71:[function(t,e,r){"use strict";r.base=t("./base"),r.short=t("./short"),r.mont=t("./mont"),r.edwards=t("./edwards")},{"./base":69,"./edwards":70,"./mont":72,"./short":73}],72:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("inherits"),o=t("./base"),s=t("../utils");function a(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function Point(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),(e.exports=a).prototype.validate=function(t){var e=t.normalize().x,t=e.redSqr(),e=t.redMul(e).redAdd(t.redMul(this.a)).redAdd(e);return 0===e.redSqrt().redSqr().cmp(e)},i(Point,o.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},a.prototype.point=function(t,e){return new Point(this,t,e)},a.prototype.pointFromJSON=function(t){return Point.fromJSON(this,t)},Point.prototype.precompute=function(){},Point.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Point.fromJSON=function(t,e){return new Point(t,e[0],e[1]||t.one)},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Point.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),t=t.redMul(e),r=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(t,r)},Point.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),r=t.x.redSub(t.z).redMul(r),i=i.redMul(n),n=e.z.redMul(r.redAdd(i).redSqr()),i=e.x.redMul(r.redISub(i).redSqr());return this.curve.point(n,i)},Point.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;0<=o;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},Point.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},Point.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../utils":82,"./base":69,"bn.js":55,inherits:98}],73:[function(t,e,r){"use strict";var n=t("../utils"),w=t("bn.js"),i=t("inherits"),o=t("./base"),s=n.assert;function a(t){o.call(this,"short",t),this.a=new w(t.a,16).toRed(this.red),this.b=new w(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function Point(t,e,r,n){o.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new w(e,16),this.y=new w(r,16),n&&(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 f(t,e,r,n){o.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new w(0)):(this.x=new w(e,16),this.y=new w(r,16),this.z=new w(n,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}i(a,o),(e.exports=a).prototype._getEndomorphism=function(t){var e,r,n;if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3))return r=(t.beta?new w(t.beta,16):r=(n=this._getEndoRoots(this.p))[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red),t.lambda?e=new w(t.lambda,16):(n=this._getEndoRoots(this.n),0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(r))?e=n[0]:(e=n[1],s(0===this.g.mul(e).x.cmp(this.g.x.redMul(r))))),{beta:r,lambda:e,basis:t.basis?t.basis.map(function(t){return{a:new w(t.a,16),b:new w(t.b,16)}}):this._getEndoBasis(e)}},a.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:w.mont(t),r=new w(2).toRed(e).redInvm(),t=r.redNeg(),r=new w(3).toRed(e).redNeg().redSqrt().redMul(r);return[t.redAdd(r).fromRed(),t.redSub(r).fromRed()]},a.prototype._getEndoBasis=function(t){for(var e,r,n,i,o,s=this.n.ushrn(Math.floor(this.n.bitLength()/2)),a=t,f=this.n.clone(),u=new w(1),c=new w(0),h=new w(0),d=new w(1),l=0;0!==a.cmpn(0);){var p=f.div(a),b=f.sub(p.mul(a)),y=h.sub(p.mul(u)),p=d.sub(p.mul(c));if(!n&&b.cmp(s)<0)e=o.neg(),r=u,n=b.neg(),i=y;else if(n&&2==++l)break;f=a,a=o=b,h=u,u=y,d=c,c=p}var m=b.neg(),g=y,t=n.sqr().add(i.sqr());return 0<=m.sqr().add(g.sqr()).cmp(t)&&(m=e,g=r),n.negative&&(n=n.neg(),i=i.neg()),m.negative&&(m=m.neg(),g=g.neg()),[{a:n,b:i},{a:m,b:g}]},a.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),e=o.mul(n.a),r=i.mul(r.b),n=o.mul(n.b);return{k1:t.sub(s).sub(e),k2:r.add(n).neg()}},a.prototype.pointFromX=function(t,e){var r=(t=!(t=new w(t,16)).red?t.toRed(this.red):t).redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");r=n.fromRed().isOdd();return(e&&!r||!e&&r)&&(n=n.redNeg()),this.point(t,n)},a.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,t=this.a.redMul(e),t=e.redSqr().redMul(e).redIAdd(t).redIAdd(this.b);return 0===r.redSqr().redISub(t).cmpn(0)},a.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var s=this._endoSplit(e[o]),a=t[o],f=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),f=f.neg(!0)),n[2*o]=a,n[2*o+1]=f,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var r=this._wnafMulAdd(1,n,i,2*o,r),u=0;u<2*o;u++)n[u]=null,i[u]=null;return r},i(Point,o.BasePoint),a.prototype.point=function(t,e,r){return new Point(this,t,e,r)},a.prototype.pointFromJSON=function(t,e){return Point.fromJSON(this,t,e)},Point.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e,r,n=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);return t&&(e=this.curve,r=function(t){return e.point(t.x.redMul(e.endo.beta),t.y)},(t.beta=n).precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(r)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(r)}}),n}},Point.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Point.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}t=t[2];return n.precomputed={beta:null,doubles:t.doubles&&{step:t.doubles.step,points:[n].concat(t.doubles.points.map(i))},naf:t.naf&&{wnd:t.naf.wnd,points:[n].concat(t.naf.points.map(i))}},n},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return this.inf},Point.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y),t=(e=0!==e.cmpn(0)?e.redMul(this.x.redSub(t.x).redInvm()):e).redSqr().redISub(this.x).redISub(t.x),e=e.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,e)},Point.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),t=t.redInvm(),e=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(t),t=e.redSqr().redISub(this.x.redAdd(this.x)),e=e.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,e)},Point.prototype.getX=function(){return this.x.fromRed()},Point.prototype.getY=function(){return this.y.fromRed()},Point.prototype.mul=function(t){return t=new w(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},Point.prototype.mulAdd=function(t,e,r){e=[this,e],r=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(e,r):this.curve._wnafMulAdd(1,e,r,2)},Point.prototype.jmulAdd=function(t,e,r){e=[this,e],r=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(e,r,!0):this.curve._wnafMulAdd(1,e,r,2,!0)},Point.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},Point.prototype.neg=function(t){if(this.inf)return this;var e,r=this.curve.point(this.x,this.y.redNeg());return t&&this.precomputed&&(e=this.precomputed,t=function(t){return t.neg()},r.precomputed={naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(t)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(t)}}),r},Point.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},i(f,o.BasePoint),a.prototype.jpoint=function(t,e,r){return new f(this,t,e,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),t=this.y.redMul(e).redMul(t);return this.curve.point(r,t)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),e=n.redSub(i),r=o.redSub(s);if(0===e.cmpn(0))return 0!==r.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();i=e.redSqr(),s=i.redMul(e),n=n.redMul(i),i=r.redSqr().redIAdd(s).redISub(n).redISub(n),s=r.redMul(n.redISub(i)).redISub(o.redMul(s)),e=this.z.redMul(t.z).redMul(e);return this.curve.jpoint(i,s,e)},f.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),t=r.redSub(n),e=i.redSub(o);if(0===t.cmpn(0))return 0!==e.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();n=t.redSqr(),o=n.redMul(t),r=r.redMul(n),n=e.redSqr().redIAdd(o).redISub(r).redISub(r),o=e.redMul(r.redISub(n)).redISub(i.redMul(o)),t=this.z.redMul(t);return this.curve.jpoint(n,o,t)},f.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,f=a.redSqr().redSqr(),u=s.redAdd(s);for(r=0;r<t;r++){var c=o.redSqr(),h=u.redSqr(),d=h.redSqr(),l=c.redAdd(c).redIAdd(c).redIAdd(n.redMul(f)),c=o.redMul(h),h=l.redSqr().redISub(c.redAdd(c)),c=c.redISub(h),l=(l=l.redMul(c)).redIAdd(l).redISub(d),c=u.redMul(a);r+1<t&&(f=f.redMul(d)),o=h,a=c,u=l}return this.curve.jpoint(o,u.redMul(i),a)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},f.prototype._zeroDbl=function(){var t,e,r,n,i,o=this.zOne?(r=this.x.redSqr(),t=(n=this.y.redSqr()).redSqr(),i=(i=this.x.redAdd(n).redSqr().redISub(r).redISub(t)).redIAdd(i),n=(e=r.redAdd(r).redIAdd(r)).redSqr().redISub(i).redISub(i),r=(r=(r=t.redIAdd(t)).redIAdd(r)).redIAdd(r),e=e.redMul(i.redISub(t=n)).redISub(r),this.y.redAdd(this.y)):(i=this.x.redSqr(),o=(n=this.y.redSqr()).redSqr(),r=(r=this.x.redAdd(n).redSqr().redISub(i).redISub(o)).redIAdd(r),i=(n=i.redAdd(i).redIAdd(i)).redSqr(),o=(o=(o=o.redIAdd(o)).redIAdd(o)).redIAdd(o),t=i.redISub(r).redISub(r),e=n.redMul(r.redISub(t)).redISub(o),(o=this.y.redMul(this.z)).redIAdd(o));return this.curve.jpoint(t,e,o)},f.prototype._threeDbl=function(){var t,e,r,n,i,o,s,a;return this.zOne?(s=this.x.redSqr(),r=(t=this.y.redSqr()).redSqr(),o=(o=this.x.redAdd(t).redSqr().redISub(s).redISub(r)).redIAdd(o),e=n=(a=s.redAdd(s).redIAdd(s).redIAdd(this.curve.a)).redSqr().redISub(o).redISub(o),i=(i=(i=r.redIAdd(r)).redIAdd(i)).redIAdd(i),t=a.redMul(o.redISub(n)).redISub(i),s=this.y.redAdd(this.y)):(r=this.z.redSqr(),a=this.y.redSqr(),o=this.x.redMul(a),n=(n=this.x.redSub(r).redMul(this.x.redAdd(r))).redAdd(n).redIAdd(n),o=(i=(i=o.redIAdd(o)).redIAdd(i)).redAdd(i),e=n.redSqr().redISub(o),s=this.y.redAdd(this.z).redSqr().redISub(a).redISub(r),a=(a=(a=(a=a.redSqr()).redIAdd(a)).redIAdd(a)).redIAdd(a),t=n.redMul(i.redISub(e)).redISub(a)),this.curve.jpoint(e,t,s)},f.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),s=r.redSqr(),t=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),i=e.redAdd(e),e=(i=i.redIAdd(i)).redMul(s),i=t.redSqr().redISub(e.redAdd(e)),e=e.redISub(i),s=s.redSqr();s=(s=(s=s.redIAdd(s)).redIAdd(s)).redIAdd(s);s=t.redMul(e).redISub(s),n=r.redAdd(r).redMul(n);return this.curve.jpoint(i,s,n)},f.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(n),t=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),n=n.redIAdd(n);n=(n=(n=n.redIAdd(n)).redIAdd(n)).redIAdd(n);var o=i.redIAdd(s).redSqr().redISub(o).redISub(t).redISub(n),e=e.redMul(o);e=(e=e.redIAdd(e)).redIAdd(e);e=this.x.redMul(t).redISub(e);e=(e=e.redIAdd(e)).redIAdd(e);o=this.y.redMul(o.redMul(n.redISub(o)).redISub(s.redMul(t)));o=(o=(o=o.redIAdd(o)).redIAdd(o)).redIAdd(o);t=this.z.redAdd(s).redSqr().redISub(r).redISub(t);return this.curve.jpoint(e,o,t)},f.prototype.mul=function(t,e){return t=new w(t,e),this.curve._wnafMul(this,t)},f.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;e=e.redMul(this.z),r=r.redMul(t.z);return 0===this.y.redMul(r).redISub(t.y.redMul(e)).cmpn(0)},f.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),0<=n.cmp(this.curve.p))return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":82,"./base":69,"bn.js":55,inherits:98}],74:[function(t,e,r){"use strict";var n,i=r,r=t("hash.js"),o=t("./curve"),s=t("./utils").assert;function a(t){"short"===t.type?this.curve=new o.short(t):"edwards"===t.type?this.curve=new o.edwards(t):this.curve=new o.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function f(e,r){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var t=new a(r);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:t}),t}})}i.PresetCurve=a,f("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:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),f("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:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),f("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:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),f("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:r.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"]}),f("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:r.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"]}),f("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),f("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:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=t("./precomputed/secp256k1")}catch(t){n=void 0}f("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:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},{"./curve":71,"./precomputed/secp256k1":81,"./utils":82,"hash.js":85}],75:[function(t,e,r){"use strict";var d=t("bn.js"),l=t("hmac-drbg"),n=t("../utils"),i=t("../curves"),o=t("brorand"),a=n.assert,s=t("./key"),p=t("./signature");function f(t){if(!(this instanceof f))return new f(t);"string"==typeof t&&(a(Object.prototype.hasOwnProperty.call(i,t),"Unknown curve "+t),t=i[t]),t instanceof i.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}(e.exports=f).prototype.keyPair=function(t){return new s(this,t)},f.prototype.keyFromPrivate=function(t,e){return s.fromPrivate(this,t,e)},f.prototype.keyFromPublic=function(t,e){return s.fromPublic(this,t,e)},f.prototype.genKeyPair=function(t){for(var e=new l({hash:this.hash,pers:(t=t||{}).pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||o(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new d(2));;){var i=new d(e.generate(r));if(!(0<i.cmp(n)))return i.iaddn(1),this.keyFromPrivate(i)}},f.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return 0<r&&(t=t.ushrn(r)),!e&&0<=t.cmp(this.n)?t.sub(this.n):t},f.prototype.sign=function(t,e,r,n){"object"==typeof r&&(n=r,r=null),n=n||{},e=this.keyFromPrivate(e,r),t=this._truncateToN(new d(t,16));for(var i=this.n.byteLength(),r=e.getPrivate().toArray("be",i),i=t.toArray("be",i),o=new l({hash:this.hash,entropy:r,nonce:i,pers:n.pers,persEnc:n.persEnc||"utf8"}),s=this.n.sub(new d(1)),a=0;;a++){var f=n.k?n.k(a):new d(o.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||0<=f.cmp(s))){var u=this.g.mul(f);if(!u.isInfinity()){var c=u.getX(),h=c.umod(this.n);if(0!==h.cmpn(0)){var f=f.invm(this.n).mul(h.mul(e.getPrivate()).iadd(t));if(0!==(f=f.umod(this.n)).cmpn(0)){c=(u.getY().isOdd()?1:0)|(0!==c.cmp(h)?2:0);return n.canonical&&0<f.cmp(this.nh)&&(f=this.n.sub(f),c^=1),new p({r:h,s:f,recoveryParam:c})}}}}}},f.prototype.verify=function(t,e,r,n){t=this._truncateToN(new d(t,16)),r=this.keyFromPublic(r,n);n=(e=new p(e,"hex")).r,e=e.s;if(n.cmpn(1)<0||0<=n.cmp(this.n))return!1;if(e.cmpn(1)<0||0<=e.cmp(this.n))return!1;var i,e=e.invm(this.n),t=e.mul(t).umod(this.n),e=e.mul(n).umod(this.n);return this.curve._maxwellTrick?!(i=this.g.jmulAdd(t,r.getPublic(),e)).isInfinity()&&i.eqXToP(n):!(i=this.g.mulAdd(t,r.getPublic(),e)).isInfinity()&&0===i.getX().umod(this.n).cmp(n)},f.prototype.recoverPubKey=function(t,e,r,n){a((3&r)===r,"The recovery param is more than two bits"),e=new p(e,n);var i=this.n,o=new d(t),s=e.r,n=e.s,t=1&r,r=r>>1;if(0<=s.cmp(this.curve.p.umod(this.curve.n))&&r)throw new Error("Unable to find sencond key candinate");s=r?this.curve.pointFromX(s.add(this.curve.n),t):this.curve.pointFromX(s,t),e=e.r.invm(i),o=i.sub(o).mul(e).umod(i),i=n.mul(e).umod(i);return this.g.mulAdd(o,s,i)},f.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new p(e,n)).recoveryParam)return e.recoveryParam;for(var i,o=0;o<4;o++){try{i=this.recoverPubKey(t,e,o)}catch(t){continue}if(i.eq(r))return o}throw new Error("Unable to find valid recovery factor")}},{"../curves":74,"../utils":82,"./key":76,"./signature":77,"bn.js":55,brorand:56,"hmac-drbg":97}],76:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils").assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}(e.exports=o).fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.validate()||i(t.validate(),"public point not validated"),t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../utils":82,"bn.js":55}],77:[function(t,e,r){"use strict";var i=t("bn.js"),o=t("../utils"),n=o.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(n(t.r&&t.s,"Signature without r or s"),this.r=new i(t.r,16),this.s=new i(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function f(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0==n||4<n)return!1;for(var i=0,o=0,s=e.place;o<n;o++,s++)i<<=8,i|=t[s],i>>>=0;return!(i<=127)&&(e.place=s,i)}function u(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function c(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}(e.exports=s).prototype._importDER=function(t,e){t=o.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;var n=f(t,r);if(!1===n)return!1;if(n+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;e=f(t,r);if(!1===e)return!1;n=t.slice(r.place,e+r.place);if(r.place+=e,2!==t[r.place++])return!1;e=f(t,r);if(!1===e)return!1;if(t.length!==e+r.place)return!1;r=t.slice(r.place,e+r.place);if(0===n[0]){if(!(128&n[1]))return!1;n=n.slice(1)}if(0===r[0]){if(!(128&r[1]))return!1;r=r.slice(1)}return this.r=new i(n),this.s=new i(r),!(this.recoveryParam=null)},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];c(n,e.length),(n=n.concat(e)).push(2),c(n,r.length);e=n.concat(r),n=[48];return c(n,e.length),n=n.concat(e),o.encode(n,t)}},{"../utils":82,"bn.js":55}],78:[function(t,e,r){"use strict";var n=t("hash.js"),i=t("../curves"),o=t("../utils"),s=o.assert,a=o.parseBytes,f=t("./key"),u=t("./signature");function c(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof c))return new c(t);t=i[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}(e.exports=c).prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),e=this.encodePoint(i),r=this.hashInt(e,r.pubBytes(),t).mul(r.priv()),r=n.add(r).umod(this.curve.n);return this.makeSignature({R:i,S:r,Rencoded:e})},c.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),r=this.hashInt(e.Rencoded(),n.pubBytes(),t),t=this.g.mul(e.S());return e.R().add(n.pub().mul(r)).eq(t)},c.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},c.prototype.keyFromPublic=function(t){return f.fromPublic(this,t)},c.prototype.keyFromSecret=function(t){return f.fromSecret(this,t)},c.prototype.makeSignature=function(t){return t instanceof u?t:new u(this,t)},c.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},c.prototype.decodePoint=function(t){var e=(t=o.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),e=0!=(128&t[e]),r=o.intFromLE(r);return this.curve.pointFromY(r,e)},c.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(t){return o.intFromLE(t)},c.prototype.isPoint=function(t){return t instanceof this.pointClass}},{"../curves":74,"../utils":82,"./key":79,"./signature":80,"hash.js":85}],79:[function(t,e,r){"use strict";var n=t("../utils"),i=n.assert,o=n.parseBytes,t=n.cachedProperty;function s(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}s.fromPublic=function(t,e){return e instanceof s?e:new s(t,{pub:e})},s.fromSecret=function(t,e){return e instanceof s?e:new s(t,{secret:e})},s.prototype.secret=function(){return this._secret},t(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),t(s,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),t(s,"privBytes",function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,t=e.slice(0,t.encodingLength);return t[0]&=248,t[r]&=127,t[r]|=64,t}),t(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),t(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),t(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},s.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},s.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},s.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},e.exports=s},{"../utils":82}],80:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils"),o=i.assert,t=i.cachedProperty,s=i.parseBytes;function a(t,e){this.eddsa=t,"object"!=typeof e&&(e=s(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),o(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof n&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}t(a,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),t(a,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),t(a,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),t(a,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),a.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},a.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=a},{"../utils":82,"bn.js":55}],81:[function(t,e,r){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"]]}}},{}],82:[function(t,e,r){"use strict";var n=r,i=t("bn.js"),r=t("minimalistic-assert"),t=t("minimalistic-crypto-utils");n.assert=r,n.toArray=t.toArray,n.zero2=t.zero2,n.toHex=t.toHex,n.encode=t.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,o=t.clone(),s=0;s<n.length;s++){var a,f=o.andln(i-1);o.isOdd()?o.isubn(a=(i>>1)-1<f?(i>>1)-f:f):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;0<t.cmpn(-i)||0<e.cmpn(-o);){var s,a=t.andln(3)+i&3,f=e.andln(3)+o&3;3===f&&(f=-1),s=0==(1&(a=3===a?-1:a))?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==f?a:-a,r[0].push(s),f=0==(1&f)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==a?f:-f,r[1].push(f),2*i===s+1&&(i=1-i),2*o===f+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},{"bn.js":55,"minimalistic-assert":100,"minimalistic-crypto-utils":101}],83:[function(t,e,r){e.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}},{}],84:[function(t,e,r){"use strict";var a=t("safe-buffer").Buffer,n=t("readable-stream").Transform;function i(t){n.call(this),this._block=a.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t("inherits")(i,n),i.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},i.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},i.prototype.update=function(t,e){if(!function(t,e){if(!a.isBuffer(t)&&"string"!=typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");a.isBuffer(t)||(t=a.from(t,e));for(var r=this._block,n=0;this._blockOffset+t.length-n>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)r[i++]=t[n++];this._update(),this._blockOffset=0}for(;n<t.length;)r[this._blockOffset++]=t[n++];for(var o=0,s=8*t.length;0<s;++o)this._length[o]+=s,0<(s=this._length[o]/4294967296|0)&&(this._length[o]-=4294967296*s);return this},i.prototype._update=function(){throw new Error("_update is not implemented")},i.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0);for(var r=this._blockOffset=0;r<4;++r)this._length[r]=0;return e},i.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=i},{inherits:98,"readable-stream":117,"safe-buffer":119}],85:[function(t,e,r){r.utils=t("./hash/utils"),r.common=t("./hash/common"),r.sha=t("./hash/sha"),r.ripemd=t("./hash/ripemd"),r.hmac=t("./hash/hmac"),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},{"./hash/common":86,"./hash/hmac":87,"./hash/ripemd":88,"./hash/sha":89,"./hash/utils":96}],86:[function(t,e,r){"use strict";var n=t("./utils"),i=t("minimalistic-assert");function o(){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}(r.BlockHash=o).prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){e=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-e,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-e,this.endian);for(var r=0;r<t.length;r+=this._delta32)this._update(t,r,r+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},{"./utils":96,"minimalistic-assert":100}],87:[function(t,e,r){"use strict";var n=t("./utils"),i=t("minimalistic-assert");function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}(e.exports=o).prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},{"./utils":96,"minimalistic-assert":100}],88:[function(t,e,r){"use strict";var n=t("./utils"),t=t("./common"),b=n.rotl32,y=n.sum32,m=n.sum32_3,g=n.sum32_4,i=t.BlockHash;function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function w(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}n.inherits(o,i),(r.ripemd160=o).blockSize=512,o.outSize=160,o.hmacStrength=192,o.padLength=64,o.prototype._update=function(t,e){for(var r,n=c=this.h[0],i=p=this.h[1],o=l=this.h[2],s=d=this.h[3],a=h=this.h[4],f=0;f<80;f++)var u=y(b(g(c,w(f,p,l,d),t[v[f]+e],(r=f)<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838),S[f]),h),c=h,h=d,d=b(l,10),l=p,p=u,u=y(b(g(n,w(79-f,i,o,s),t[_[f]+e],(r=f)<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0),E[f]),a),n=a,a=s,s=b(o,10),o=i,i=u;u=m(this.h[1],l,s),this.h[1]=m(this.h[2],d,a),this.h[2]=m(this.h[3],h,n),this.h[3]=m(this.h[4],c,i),this.h[4]=m(this.h[0],p,o),this.h[0]=u},o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var v=[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],_=[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],S=[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],E=[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]},{"./common":86,"./utils":96}],89:[function(t,e,r){"use strict";r.sha1=t("./sha/1"),r.sha224=t("./sha/224"),r.sha256=t("./sha/256"),r.sha384=t("./sha/384"),r.sha512=t("./sha/512")},{"./sha/1":90,"./sha/224":91,"./sha/256":92,"./sha/384":93,"./sha/512":94}],90:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),t=t("./common"),c=n.rotl32,h=n.sum32,d=n.sum32_5,l=t.ft_1,o=i.BlockHash,p=[1518500249,1859775393,2400959708,3395469782];function s(){if(!(this instanceof s))return new s;o.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(s,o),(e.exports=s).blockSize=512,s.outSize=160,s.hmacStrength=80,s.padLength=64,s.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=c(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);for(var i=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],f=this.h[4],n=0;n<r.length;n++)var u=~~(n/20),u=d(c(i,5),l(u,o,s,a),f,r[n],p[u]),f=a,a=s,s=c(o,30),o=i,i=u;this.h[0]=h(this.h[0],i),this.h[1]=h(this.h[1],o),this.h[2]=h(this.h[2],s),this.h[3]=h(this.h[3],a),this.h[4]=h(this.h[4],f)},s.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":86,"../utils":96,"./common":95}],91:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./256");function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),(e.exports=o).blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},{"../utils":96,"./256":92}],92:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),o=t("./common"),p=t("minimalistic-assert"),b=n.sum32,y=n.sum32_4,m=n.sum32_5,g=o.ch32,w=o.maj32,v=o.s0_256,_=o.s1_256,S=o.g0_256,E=o.g1_256,s=i.BlockHash,a=[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 f(){if(!(this instanceof f))return new f;s.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=a,this.W=new Array(64)}n.inherits(f,s),(e.exports=f).blockSize=512,f.outSize=256,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=y(E(r[n-2]),r[n-7],S(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],f=this.h[4],u=this.h[5],c=this.h[6],h=this.h[7];for(p(this.k.length===r.length),n=0;n<r.length;n++)var d=m(h,_(f),g(f,u,c),this.k[n],r[n]),l=b(v(i),w(i,o,s)),h=c,c=u,u=f,f=b(a,d),a=s,s=o,o=i,i=b(d,l);this.h[0]=b(this.h[0],i),this.h[1]=b(this.h[1],o),this.h[2]=b(this.h[2],s),this.h[3]=b(this.h[3],a),this.h[4]=b(this.h[4],f),this.h[5]=b(this.h[5],u),this.h[6]=b(this.h[6],c),this.h[7]=b(this.h[7],h)},f.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":86,"../utils":96,"./common":95,"minimalistic-assert":100}],93:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./512");function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),(e.exports=o).blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},{"../utils":96,"./512":94}],94:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),P=t("minimalistic-assert"),B=n.rotr64_hi,R=n.rotr64_lo,d=n.shr64_hi,l=n.shr64_lo,N=n.sum64,U=n.sum64_hi,L=n.sum64_lo,p=n.sum64_4_hi,b=n.sum64_4_lo,C=n.sum64_5_hi,j=n.sum64_5_lo,o=i.BlockHash,s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function a(){if(!(this instanceof a))return new a;o.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=s,this.W=new Array(160)}n.inherits(a,o),(e.exports=a).blockSize=1024,a.outSize=512,a.hmacStrength=192,a.padLength=128,a.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=function(t,e){var r=B(t,e,19),n=B(e,t,29),e=d(t,e,6),e=r^n^e;e<0&&(e+=4294967296);return e}(r[n-4],r[n-3]),o=function(t,e){var r=R(t,e,19),n=R(e,t,29),e=l(t,e,6),e=r^n^e;e<0&&(e+=4294967296);return e}(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],f=function(t,e){var r=B(t,e,1),n=B(t,e,8),e=d(t,e,7),e=r^n^e;e<0&&(e+=4294967296);return e}(r[n-30],r[n-29]),u=function(t,e){var r=R(t,e,1),n=R(t,e,8),e=l(t,e,7),e=r^n^e;e<0&&(e+=4294967296);return e}(r[n-30],r[n-29]),c=r[n-32],h=r[n-31];r[n]=p(i,o,s,a,f,u,c,h),r[n+1]=b(i,o,s,a,f,u,c,h)}},a.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],s=this.h[3],a=this.h[4],f=this.h[5],u=this.h[6],c=this.h[7],h=this.h[8],d=this.h[9],l=this.h[10],p=this.h[11],b=this.h[12],y=this.h[13],m=this.h[14],g=this.h[15];P(this.k.length===r.length);for(var w=0;w<r.length;w+=2)var v=m,_=g,S=function(t,e){var r=B(t,e,14),n=B(t,e,18),t=B(e,t,9),t=r^n^t;t<0&&(t+=4294967296);return t}(h,d),E=function(t,e){var r=R(t,e,14),n=R(t,e,18),t=R(e,t,9),t=r^n^t;t<0&&(t+=4294967296);return t}(h,d),T=function(t,e,r){r=t&e^~t&r;r<0&&(r+=4294967296);return r}(h,l,b),I=function(t,e,r){r=t&e^~t&r;r<0&&(r+=4294967296);return r}(d,p,y),M=this.k[w],k=this.k[w+1],A=r[w],O=r[w+1],x=C(v,_,S,E,T,I,M,k,A,O),A=j(v,_,S,E,T,I,M,k,A,O),v=function(t,e){var r=B(t,e,28),n=B(e,t,2),t=B(e,t,7),t=r^n^t;t<0&&(t+=4294967296);return t}(n,i),_=function(t,e){var r=R(t,e,28),n=R(e,t,2),t=R(e,t,7),t=r^n^t;t<0&&(t+=4294967296);return t}(n,i),S=function(t,e,r){r=t&e^t&r^e&r;r<0&&(r+=4294967296);return r}(n,o,a),E=function(t,e,r){r=t&e^t&r^e&r;r<0&&(r+=4294967296);return r}(i,s,f),O=U(v,_,S,E),E=L(v,_,S,E),m=b,g=y,b=l,y=p,l=h,p=d,h=U(u,c,x,A),d=L(c,c,x,A),u=a,c=f,a=o,f=s,o=n,s=i,n=U(x,A,O,E),i=L(x,A,O,E);N(this.h,0,n,i),N(this.h,2,o,s),N(this.h,4,a,f),N(this.h,6,u,c),N(this.h,8,h,d),N(this.h,10,l,p),N(this.h,12,b,y),N(this.h,14,m,g)},a.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":86,"../utils":96,"minimalistic-assert":100}],95:[function(t,e,r){"use strict";var n=t("../utils").rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}r.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?e^r^n:2===t?o(e,r,n):void 0},r.ch32=i,r.maj32=o,r.p32=s,r.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},r.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},r.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},r.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},{"../utils":96}],96:[function(t,e,r){"use strict";var f=t("minimalistic-assert"),t=t("inherits");function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function n(t){return 1===t.length?"0"+t:t}function s(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}r.inherits=t,r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r,n,i=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),s=0;s<t.length;s+=2)i.push(parseInt(t[s]+t[s+1],16))}else for(var o=0,s=0;s<t.length;s++){var a=t.charCodeAt(s);a<128?i[o++]=a:a<2048?(i[o++]=a>>6|192,i[o++]=63&a|128):(n=s,55296!=(64512&(r=t).charCodeAt(n))||n<0||n+1>=r.length||56320!=(64512&r.charCodeAt(n+1))?i[o++]=a>>12|224:(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++s)),i[o++]=a>>18|240,i[o++]=a>>12&63|128),i[o++]=a>>6&63|128,i[o++]=63&a|128)}else for(s=0;s<t.length;s++)i[s]=0|t[s];return i},r.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=n(t[r].toString(16));return e},r.htonl=o,r.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];r+=s((i="little"===e?o(i):i).toString(16))}return r},r.zero2=n,r.zero8=s,r.join32=function(t,e,r,n){f((r-=e)%4==0);for(var i=new Array(r/4),o=0,s=e;o<i.length;o++,s+=4){var a="big"===n?t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3]:t[s+3]<<24|t[s+2]<<16|t[s+1]<<8|t[s];i[o]=a>>>0}return i},r.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},r.rotr32=function(t,e){return t>>>e|t<<32-e},r.rotl32=function(t,e){return t<<e|t>>>32-e},r.sum32=function(t,e){return t+e>>>0},r.sum32_3=function(t,e,r){return t+e+r>>>0},r.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},r.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},r.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0;t[e]=(o<n?1:0)+r+i>>>0,t[e+1]=o},r.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},r.sum64_lo=function(t,e,r,n){return e+n>>>0},r.sum64_4_hi=function(t,e,r,n,i,o,s,a){var f=0,u=e;return f+=(u=e+n>>>0)<e?1:0,f+=(u=u+o>>>0)<o?1:0,t+r+i+s+(f+=(u=u+a>>>0)<a?1:0)>>>0},r.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},r.sum64_5_hi=function(t,e,r,n,i,o,s,a,f,u){var c=0,h=e;return c+=(h=e+n>>>0)<e?1:0,c+=(h=h+o>>>0)<o?1:0,c+=(h=h+a>>>0)<a?1:0,t+r+i+s+f+(c+=(h=h+u>>>0)<u?1:0)>>>0},r.sum64_5_lo=function(t,e,r,n,i,o,s,a,f,u){return e+n+o+a+u>>>0},r.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},r.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},r.shr64_hi=function(t,e,r){return t>>>r},r.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},{inherits:98,"minimalistic-assert":100}],97:[function(t,e,r){"use strict";var n=t("hash.js"),o=t("minimalistic-crypto-utils"),i=t("minimalistic-assert");function s(t){if(!(this instanceof s))return new s(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=o.toArray(t.entropy,t.entropyEnc||"hex"),r=o.toArray(t.nonce,t.nonceEnc||"hex"),t=o.toArray(t.pers,t.persEnc||"hex");i(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,t)}(e.exports=s).prototype._init=function(t,e,r){r=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(r),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=o.toArray(t,e),r=o.toArray(r,n),i(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},s.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=o.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<t;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);n=i.slice(0,t);return this._update(r),this._reseed++,o.encode(n,e)}},{"hash.js":85,"minimalistic-assert":100,"minimalistic-crypto-utils":101}],98:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){var r;e&&(t.super_=e,(r=function(){}).prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t)}},{}],99:[function(t,e,r){"use strict";var n=t("inherits"),i=t("hash-base"),o=t("safe-buffer").Buffer,s=new Array(16);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function f(t,e){return t<<e|t>>>32-e}function u(t,e,r,n,i,o,s){return f(t+(e&r|~e&n)+i+o|0,s)+e|0}function c(t,e,r,n,i,o,s){return f(t+(e&n|r&~n)+i+o|0,s)+e|0}function h(t,e,r,n,i,o,s){return f(t+(e^r^n)+i+o|0,s)+e|0}function d(t,e,r,n,i,o,s){return f(t+(r^(e|~n))+i+o|0,s)+e|0}n(a,i),a.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=u(r=this._a,o=this._b,i=this._c,n=this._d,t[0],3614090360,7),n=u(n,r,o,i,t[1],3905402710,12),i=u(i,n,r,o,t[2],606105819,17),o=u(o,i,n,r,t[3],3250441966,22);r=u(r,o,i,n,t[4],4118548399,7),n=u(n,r,o,i,t[5],1200080426,12),i=u(i,n,r,o,t[6],2821735955,17),o=u(o,i,n,r,t[7],4249261313,22),r=u(r,o,i,n,t[8],1770035416,7),n=u(n,r,o,i,t[9],2336552879,12),i=u(i,n,r,o,t[10],4294925233,17),o=u(o,i,n,r,t[11],2304563134,22),r=u(r,o,i,n,t[12],1804603682,7),n=u(n,r,o,i,t[13],4254626195,12),i=u(i,n,r,o,t[14],2792965006,17),r=c(r,o=u(o,i,n,r,t[15],1236535329,22),i,n,t[1],4129170786,5),n=c(n,r,o,i,t[6],3225465664,9),i=c(i,n,r,o,t[11],643717713,14),o=c(o,i,n,r,t[0],3921069994,20),r=c(r,o,i,n,t[5],3593408605,5),n=c(n,r,o,i,t[10],38016083,9),i=c(i,n,r,o,t[15],3634488961,14),o=c(o,i,n,r,t[4],3889429448,20),r=c(r,o,i,n,t[9],568446438,5),n=c(n,r,o,i,t[14],3275163606,9),i=c(i,n,r,o,t[3],4107603335,14),o=c(o,i,n,r,t[8],1163531501,20),r=c(r,o,i,n,t[13],2850285829,5),n=c(n,r,o,i,t[2],4243563512,9),i=c(i,n,r,o,t[7],1735328473,14),r=h(r,o=c(o,i,n,r,t[12],2368359562,20),i,n,t[5],4294588738,4),n=h(n,r,o,i,t[8],2272392833,11),i=h(i,n,r,o,t[11],1839030562,16),o=h(o,i,n,r,t[14],4259657740,23),r=h(r,o,i,n,t[1],2763975236,4),n=h(n,r,o,i,t[4],1272893353,11),i=h(i,n,r,o,t[7],4139469664,16),o=h(o,i,n,r,t[10],3200236656,23),r=h(r,o,i,n,t[13],681279174,4),n=h(n,r,o,i,t[0],3936430074,11),i=h(i,n,r,o,t[3],3572445317,16),o=h(o,i,n,r,t[6],76029189,23),r=h(r,o,i,n,t[9],3654602809,4),n=h(n,r,o,i,t[12],3873151461,11),i=h(i,n,r,o,t[15],530742520,16),r=d(r,o=h(o,i,n,r,t[2],3299628645,23),i,n,t[0],4096336452,6),n=d(n,r,o,i,t[7],1126891415,10),i=d(i,n,r,o,t[14],2878612391,15),o=d(o,i,n,r,t[5],4237533241,21),r=d(r,o,i,n,t[12],1700485571,6),n=d(n,r,o,i,t[3],2399980690,10),i=d(i,n,r,o,t[10],4293915773,15),o=d(o,i,n,r,t[1],2240044497,21),r=d(r,o,i,n,t[8],1873313359,6),n=d(n,r,o,i,t[15],4264355552,10),i=d(i,n,r,o,t[6],2734768916,15),o=d(o,i,n,r,t[13],1309151649,21),r=d(r,o,i,n,t[4],4149444226,6),n=d(n,r,o,i,t[11],3174756917,10),i=d(i,n,r,o,t[2],718787259,15),o=d(o,i,n,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+o|0,this._c=this._c+i|0,this._d=this._d+n|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,56<this._blockOffset&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},e.exports=a},{"hash-base":84,inherits:98,"safe-buffer":119}],100:[function(t,e,r){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}(e.exports=n).equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},{}],101:[function(t,e,r){"use strict";function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r<t.length;r++)e+=n(t[r].toString(16));return e}r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,i=255&i;o?r.push(o,i):r.push(i)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}},{}],102:[function(e,r,t){!function(s,t){!function(){"use strict";var i=e("safe-buffer").Buffer,o=t.crypto||t.msCrypto;o&&o.getRandomValues?r.exports=function(t,e){if(4294967295<t)throw new RangeError("requested too many random bytes");var r=i.allocUnsafe(t);if(0<t)if(65536<t)for(var n=0;n<t;n+=65536)o.getRandomValues(r.slice(n,n+65536));else o.getRandomValues(r);return"function"!=typeof e?r:s.nextTick(function(){e(null,r)})}:r.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}.call(this)}.call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:150,"safe-buffer":119}],103:[function(t,e,r){"use strict";var n={};function i(t,i,e){var r=function(n){var t,e;function r(t,e,r){return n.call(this,(t=t,e=e,r=r,"string"==typeof i?i:i(t,e,r)))||this}return e=n,(t=r).prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e,r}(e=e||Error);r.prototype.name=e.name,r.prototype.code=t,n[t]=r}function f(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(t){return String(t)}),2<r?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(t,e,r){var n,i,o,s,a;return"string"==typeof e&&(s="not ",e.substr(!o||o<0?0:+o,s.length)===s)?(n="must not be",e=e.replace(/^not /,"")):n="must be",o=t,s=" argument",(void 0===a||a>o.length)&&(a=o.length),e=o.substring(a-s.length,a)===s?"The ".concat(t," ").concat(n," ").concat(f(e,"type")):(i=(i="number"!=typeof i?0:i)+(a=".").length>(s=t).length||-1===s.indexOf(a,i)?"argument":"property",'The "'.concat(t,'" ').concat(i," ").concat(n," ").concat(f(e,"type"))),e+=". Received type ".concat(typeof r)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},{}],104:[function(c,h,t){!function(u){!function(){"use strict";var t=Object.keys||function(t){var e,r=[];for(e in t)r.push(e);return r};h.exports=s;var e=c("./_stream_readable"),r=c("./_stream_writable");c("inherits")(s,e);for(var n=t(r.prototype),i=0;i<n.length;i++){var o=n[i];s.prototype[o]||(s.prototype[o]=r.prototype[o])}function s(t){if(!(this instanceof s))return new s(t);e.call(this,t),r.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",a)))}function a(){this._writableState.ended||u.nextTick(f,this)}function f(t){t.end()}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}.call(this)}.call(this,c("_process"))},{"./_stream_readable":106,"./_stream_writable":108,_process:150,inherits:98}],105:[function(t,e,r){"use strict";e.exports=i;var n=t("./_stream_transform");function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}t("inherits")(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},{"./_stream_transform":107,inherits:98}],106:[function(D,H,t){!function(C,j){!function(){"use strict";var n;(H.exports=v).ReadableState=w;function p(t,e){return t.listeners(e).length}D("events").EventEmitter;var i=D("./internal/streams/stream"),c=D("buffer").Buffer,h=j.Uint8Array||function(){};var o,t,r,e=D("util"),b=e&&e.debuglog?e.debuglog("stream"):function(){},s=D("./internal/streams/buffer_list"),a=D("./internal/streams/destroy"),f=D("./internal/streams/state").getHighWaterMark,e=D("../errors").codes,d=e.ERR_INVALID_ARG_TYPE,l=e.ERR_STREAM_PUSH_AFTER_EOF,u=e.ERR_METHOD_NOT_IMPLEMENTED,y=e.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;D("inherits")(v,i);var m=a.errorOrDestroy,g=["error","close","destroy","pause","resume"];function w(t,e,r){n=n||D("./_stream_duplex"),"boolean"!=typeof r&&(r=e instanceof n),this.objectMode=!!(t=t||{}).objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=f(this,t,"readableHighWaterMark",r),this.buffer=new s,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(o=o||D("string_decoder/").StringDecoder,this.decoder=new o(t.encoding),this.encoding=t.encoding)}function v(t){if(n=n||D("./_stream_duplex"),!(this instanceof v))return new v(t);var e=this instanceof n;this._readableState=new w(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),i.call(this)}function _(t,e,r,n,i){b("readableAddChunk",e);var o,s,a,f,u=t._readableState;if(null===e)u.reading=!1,s=t,a=u,b("onEofChunk"),a.ended||(!a.decoder||(f=a.decoder.end())&&f.length&&(a.buffer.push(f),a.length+=a.objectMode?1:f.length),a.ended=!0,a.sync?I(s):(a.needReadable=!1,a.emittedReadable||(a.emittedReadable=!0,M(s))));else if(o=!i?function(t,e){var r;(function(t){return c.isBuffer(t)||t instanceof h})(e)||"string"==typeof e||void 0===e||t.objectMode||(r=new d("chunk",["string","Buffer","Uint8Array"],e));return r}(u,e):o)m(t,o);else if(u.objectMode||e&&0<e.length)if("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===c.prototype||(o=e,e=c.from(o)),n)u.endEmitted?m(t,new y):S(t,u,e,!0);else if(u.ended)m(t,new l);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(e=u.decoder.write(e),u.objectMode||0!==e.length?S(t,u,e,!1):k(t,u)):S(t,u,e,!1)}else n||(u.reading=!1,k(t,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function S(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&I(t)),k(t,e)}Object.defineProperty(v.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),v.prototype.destroy=a.destroy,v.prototype._undestroy=a.undestroy,v.prototype._destroy=function(t,e){e(t)},v.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=c.from(t,e),e=""),r=!0),_(this,t,e,!1,r)},v.prototype.unshift=function(t){return _(this,t,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(t){var e=new(o=o||D("string_decoder/").StringDecoder)(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var E=1073741824;function T(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?(e.flowing&&e.length?e.buffer.head.data:e).length:(t>e.highWaterMark&&(e.highWaterMark=(E<=(r=t)?r=E:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0));var r}function I(t){var e=t._readableState;b("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(b("emitReadable",e.flowing),e.emittedReadable=!0,C.nextTick(M,t))}function M(t){var e=t._readableState;b("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,B(t)}function k(t,e){e.readingMore||(e.readingMore=!0,C.nextTick(A,t,e))}function A(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(b("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function O(t){var e=t._readableState;e.readableListening=0<t.listenerCount("readable"),e.resumeScheduled&&!e.paused?e.flowing=!0:0<t.listenerCount("data")&&t.resume()}function x(t){b("readable nexttick read 0"),t.read(0)}function P(t,e){b("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),B(t),e.flowing&&!e.reading&&t.read(0)}function B(t){var e=t._readableState;for(b("flow",e.flowing);e.flowing&&null!==t.read(););}function R(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function N(t){var e=t._readableState;b("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,C.nextTick(U,e,t))}function U(t,e){b("endReadableNT",t.endEmitted,t.length),t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"),!t.autoDestroy||(!(t=e._writableState)||t.autoDestroy&&t.finished)&&e.destroy())}function L(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}v.prototype.read=function(t){b("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:0<e.length)||e.ended))return b("read: emitReadable",e.length,e.ended),(0===e.length&&e.ended?N:I)(this),null;if(0===(t=T(t,e))&&e.ended)return 0===e.length&&N(this),null;var n=e.needReadable;return b("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&b("length less than watermark",n=!0),e.ended||e.reading?b("reading or ended",n=!1):n&&(b("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=T(r,e))),null===(n=0<t?R(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&N(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(t){m(this,new u("_read()"))},v.prototype.pipe=function(r,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=r;break;case 1:i.pipes=[i.pipes,r];break;default:i.pipes.push(r)}i.pipesCount+=1,b("pipe count=%d opts=%j",i.pipesCount,t);t=(!t||!1!==t.end)&&r!==C.stdout&&r!==C.stderr?s:l;function o(t,e){b("onunpipe"),t===n&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,b("cleanup"),r.removeListener("close",h),r.removeListener("finish",d),r.removeListener("drain",a),r.removeListener("error",c),r.removeListener("unpipe",o),n.removeListener("end",s),n.removeListener("end",l),n.removeListener("data",u),f=!0,!i.awaitDrain||r._writableState&&!r._writableState.needDrain||a())}function s(){b("onend"),r.end()}i.endEmitted?C.nextTick(t):n.once("end",t),r.on("unpipe",o);var e,a=(e=n,function(){var t=e._readableState;b("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&p(e,"data")&&(t.flowing=!0,B(e))});r.on("drain",a);var f=!1;function u(t){b("ondata");t=r.write(t);b("dest.write",t),!1===t&&((1===i.pipesCount&&i.pipes===r||1<i.pipesCount&&-1!==L(i.pipes,r))&&!f&&(b("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function c(t){b("onerror",t),l(),r.removeListener("error",c),0===p(r,"error")&&m(r,t)}function h(){r.removeListener("finish",d),l()}function d(){b("onfinish"),r.removeListener("close",h),l()}function l(){b("unpipe"),n.unpipe(r)}return n.on("data",u),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(r,"error",c),r.once("close",h),r.once("finish",d),r.emit("pipe",n),i.flowing||(b("pipe resume"),n.resume()),r},v.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t=t||e.pipes,e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=L(e.pipes,t);return-1===s||(e.pipes.splice(s,1),--e.pipesCount,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},v.prototype.addListener=v.prototype.on=function(t,e){var r=i.prototype.on.call(this,t,e),e=this._readableState;return"data"===t?(e.readableListening=0<this.listenerCount("readable"),!1!==e.flowing&&this.resume()):"readable"===t&&(e.endEmitted||e.readableListening||(e.readableListening=e.needReadable=!0,e.flowing=!1,e.emittedReadable=!1,b("on readable",e.length,e.reading),e.length?I(this):e.reading||C.nextTick(x,this))),r},v.prototype.removeListener=function(t,e){e=i.prototype.removeListener.call(this,t,e);return"readable"===t&&C.nextTick(O,this),e},v.prototype.removeAllListeners=function(t){var e=i.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||C.nextTick(O,this),e},v.prototype.resume=function(){var t,e,r=this._readableState;return r.flowing||(b("resume"),r.flowing=!r.readableListening,t=this,(e=r).resumeScheduled||(e.resumeScheduled=!0,C.nextTick(P,t,e))),r.paused=!1,this},v.prototype.pause=function(){return b("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(b("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},v.prototype.wrap=function(e){var t,r=this,n=this._readableState,i=!1;for(t in e.on("end",function(){var t;b("wrapped end"),!n.decoder||n.ended||(t=n.decoder.end())&&t.length&&r.push(t),r.push(null)}),e.on("data",function(t){b("wrapped data"),n.decoder&&(t=n.decoder.write(t)),n.objectMode&&null==t||(n.objectMode||t&&t.length)&&(r.push(t)||(i=!0,e.pause()))}),e)void 0===this[t]&&"function"==typeof e[t]&&(this[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t));for(var o=0;o<g.length;o++)e.on(g[o],this.emit.bind(this,g[o]));return this._read=function(t){b("wrapped _read",t),i&&(i=!1,e.resume())},this},"function"==typeof Symbol&&(v.prototype[Symbol.asyncIterator]=function(){return(t=void 0===t?D("./internal/streams/async_iterator"):t)(this)}),Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(v.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(v.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),v._fromList=R,Object.defineProperty(v.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(v.from=function(t,e){return(r=void 0===r?D("./internal/streams/from"):r)(v,t,e)})}.call(this)}.call(this,D("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":103,"./_stream_duplex":104,"./internal/streams/async_iterator":109,"./internal/streams/buffer_list":110,"./internal/streams/destroy":111,"./internal/streams/from":113,"./internal/streams/state":115,"./internal/streams/stream":116,_process:150,buffer:144,events:145,inherits:98,"string_decoder/":128,util:143}],107:[function(t,e,r){"use strict";e.exports=f;var e=t("../errors").codes,n=e.ERR_METHOD_NOT_IMPLEMENTED,i=e.ERR_MULTIPLE_CALLBACK,o=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=e.ERR_TRANSFORM_WITH_LENGTH_0,a=t("./_stream_duplex");function f(t){if(!(this instanceof f))return new f(t);a.call(this,t),this._transformState={afterTransform:function(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new i);r.writechunk=null,(r.writecb=null)!=e&&this.push(e),n(t),(t=this._readableState).reading=!1,(t.needReadable||t.length<t.highWaterMark)&&this._read(t.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",u)}function u(){var r=this;"function"!=typeof this._flush||this._readableState.destroyed?c(this,null,null):this._flush(function(t,e){c(r,t,e)})}function c(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new s;if(t._transformState.transforming)throw new o;return t.push(null)}t("inherits")(f,a),f.prototype.push=function(t,e){return this._transformState.needTransform=!1,a.prototype.push.call(this,t,e)},f.prototype._transform=function(t,e,r){r(new n("_transform()"))},f.prototype._write=function(t,e,r){var n=this._transformState;n.writecb=r,n.writechunk=t,n.writeencoding=e,n.transforming||(e=this._readableState,(n.needTransform||e.needReadable||e.length<e.highWaterMark)&&this._read(e.highWaterMark))},f.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},f.prototype._destroy=function(t,e){a.prototype._destroy.call(this,t,function(t){e(t)})}},{"../errors":103,"./_stream_duplex":104,inherits:98}],108:[function(x,P,t){!function(A,O){!function(){"use strict";function c(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var n;(P.exports=_).WritableState=v;var t={deprecate:x("util-deprecate")},r=x("./internal/streams/stream"),h=x("buffer").Buffer,d=O.Uint8Array||function(){};var i,e=x("./internal/streams/destroy"),o=x("./internal/streams/state").getHighWaterMark,s=x("../errors").codes,l=s.ERR_INVALID_ARG_TYPE,a=s.ERR_METHOD_NOT_IMPLEMENTED,f=s.ERR_MULTIPLE_CALLBACK,u=s.ERR_STREAM_CANNOT_PIPE,p=s.ERR_STREAM_DESTROYED,b=s.ERR_STREAM_NULL_VALUES,y=s.ERR_STREAM_WRITE_AFTER_END,m=s.ERR_UNKNOWN_ENCODING,g=e.errorOrDestroy;function w(){}function v(t,e,r){n=n||x("./_stream_duplex"),"boolean"!=typeof r&&(r=e instanceof n),this.objectMode=!!(t=t||{}).objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=o(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;r=(this.destroyed=!1)===t.decodeStrings;this.decodeStrings=!r,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new f;(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0})(r),e?function(t,e,r,n,i){--e.pendingcb,r?(A.nextTick(i,n),A.nextTick(k,t,e),t._writableState.errorEmitted=!0,g(t,n)):(i(n),t._writableState.errorEmitted=!0,g(t,n),k(t,e))}(t,r,n,e,i):((e=I(r)||t.destroyed)||r.corked||r.bufferProcessing||!r.bufferedRequest||T(t,r),n?A.nextTick(E,t,r,e,i):E(t,r,e,i))}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new c(this)}function _(t){var e=this instanceof(n=n||x("./_stream_duplex"));if(!e&&!i.call(_,this))return new _(t);this._writableState=new v(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),r.call(this)}function S(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new p("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function E(t,e,r,n){var i;r||(i=t,0===(r=e).length&&r.needDrain&&(r.needDrain=!1,i.emit("drain"))),e.pendingcb--,n(),k(t,e)}function T(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),n=e.corkedRequestsFree;n.entry=r;for(var o=0,s=!0;r;)(i[o]=r).isBuf||(s=!1),r=r.next,o+=1;i.allBuffers=s,S(t,e,!0,e.length,i,"",n.finish),e.pendingcb++,e.lastBufferedRequest=null,n.next?(e.corkedRequestsFree=n.next,n.next=null):e.corkedRequestsFree=new c(e),e.bufferedRequestCount=0}else{for(;r;){var a=r.chunk,f=r.encoding,u=r.callback;if(S(t,e,!1,e.objectMode?1:a.length,a,f,u),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function I(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function M(e,r){e._final(function(t){r.pendingcb--,t&&g(e,t),r.prefinished=!0,e.emit("prefinish"),k(e,r)})}function k(t,e){var r,n,i=I(e);return i&&(r=t,(n=e).prefinished||n.finalCalled||("function"!=typeof r._final||n.destroyed?(n.prefinished=!0,r.emit("prefinish")):(n.pendingcb++,n.finalCalled=!0,A.nextTick(M,r,n))),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),!e.autoDestroy||(!(e=t._readableState)||e.autoDestroy&&e.endEmitted)&&t.destroy())),i}x("inherits")(_,r),v.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(v.prototype,"buffer",{get:t.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(_,Symbol.hasInstance,{value:function(t){return!!i.call(this,t)||this===_&&(t&&t._writableState instanceof v)}})):i=function(t){return t instanceof this},_.prototype.pipe=function(){g(this,new u)},_.prototype.write=function(t,e,r){var n,i,o,s,a,f=this._writableState,u=!1,c=!f.objectMode&&(c=t,h.isBuffer(c)||c instanceof d);return c&&!h.isBuffer(t)&&(n=t,t=h.from(n)),"function"==typeof e&&(r=e,e=null),e=c?"buffer":e||f.defaultEncoding,"function"!=typeof r&&(r=w),f.ending?(o=this,s=r,a=new y,g(o,a),A.nextTick(s,a)):!c&&(n=this,o=f,s=r,null===(a=t)?i=new b:"string"==typeof a||o.objectMode||(i=new l("chunk",["string","Buffer"],a)),i&&(g(n,i),!void A.nextTick(s,i)))||(f.pendingcb++,u=function(t,e,r,n,i,o){r||(f=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=h.from(e,r));return e}(e,n,i),n!==f&&(r=!0,i="buffer",n=f));var s=e.objectMode?1:n.length;e.length+=s;var a=e.length<e.highWaterMark;a||(e.needDrain=!0);{var f;e.writing||e.corked?(f=e.lastBufferedRequest,e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},f?f.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1):S(t,e,!1,s,n,i,o)}return a}(this,f,c,t,e,r)),u},_.prototype.cork=function(){this._writableState.corked++},_.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||T(this,t))},_.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())))throw new m(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(_.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),_.prototype._write=function(t,e,r){r(new a("_write()"))},_.prototype._writev=null,_.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,e=t=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,k(t,e),r&&(e.finished?A.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(_.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),_.prototype.destroy=e.destroy,_.prototype._undestroy=e.undestroy,_.prototype._destroy=function(t,e){e(t)}}.call(this)}.call(this,x("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":103,"./_stream_duplex":104,"./internal/streams/destroy":111,"./internal/streams/state":115,"./internal/streams/stream":116,_process:150,buffer:144,inherits:98,"util-deprecate":135}],109:[function(n,y,t){!function(b){!function(){"use strict";var t;function r(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var i=n("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),f=Symbol("ended"),u=Symbol("lastPromise"),c=Symbol("handlePromise"),h=Symbol("stream");function d(t,e){return{value:t,done:e}}function l(t){var e,r=t[o];null===r||null!==(e=t[h].read())&&(t[u]=null,t[o]=null,t[s]=null,r(d(e,!1)))}var e=Object.getPrototypeOf(function(){}),p=Object.setPrototypeOf((r(t={get stream(){return this[h]},next:function(){var r=this,t=this[a];if(null!==t)return Promise.reject(t);if(this[f])return Promise.resolve(d(void 0,!0));if(this[h].destroyed)return new Promise(function(t,e){b.nextTick(function(){r[a]?e(r[a]):t(d(void 0,!0))})});var e,n,i,t=this[u];if(t)e=new Promise((n=t,i=this,function(t,e){n.then(function(){i[f]?t(d(void 0,!0)):i[c](t,e)},e)}));else{t=this[h].read();if(null!==t)return Promise.resolve(d(t,!1));e=new Promise(this[c])}return this[u]=e}},Symbol.asyncIterator,function(){return this}),r(t,"return",function(){var t=this;return new Promise(function(e,r){t[h].destroy(null,function(t){t?r(t):e(d(void 0,!0))})})}),t),e);y.exports=function(t){var e,n=Object.create(p,(r(e={},h,{value:t,writable:!0}),r(e,o,{value:null,writable:!0}),r(e,s,{value:null,writable:!0}),r(e,a,{value:null,writable:!0}),r(e,f,{value:t._readableState.endEmitted,writable:!0}),r(e,c,{value:function(t,e){var r=n[h].read();r?(n[u]=null,n[o]=null,n[s]=null,t(d(r,!1))):(n[o]=t,n[s]=e)},writable:!0}),e));return n[u]=null,i(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=n[s];return null!==e&&(n[u]=null,n[o]=null,n[s]=null,e(t)),void(n[a]=t)}t=n[o];null!==t&&(n[u]=null,n[o]=null,t(d(void 0,!(n[s]=null)))),n[f]=!0}),t.on("readable",function(t){b.nextTick(l,t)}.bind(null,n)),n}}.call(this)}.call(this,n("_process"))},{"./end-of-stream":112,_process:150}],110:[function(t,e,r){"use strict";function o(e,t){var r,n=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)),n}function i(n){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?o(Object(i),!0).forEach(function(t){var e,r;e=n,t=i[r=t],r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(i,t))})}return n}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=t("buffer").Buffer,f=t("util").inspect,u=f&&f.custom||"inspect";e.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r,n;return e=t,(r=[{key:"push",value:function(t){t={data:t,next:null};0<this.length?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(t){t={data:t,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e,r,n=a.allocUnsafe(t>>>0),i=this.head,o=0;i;)e=i.data,r=o,a.prototype.copy.call(e,n,r),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,o=t>i.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0===(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e).data=i.slice(o);break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0===(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r).data=i.slice(o);break}++n}return this.length-=n,e}},{key:u,value:function(t,e){return f(this,i({},e,{depth:0,customInspect:!1}))}}])&&s(e.prototype,r),n&&s(e,n),t}()},{buffer:144,util:143}],111:[function(t,e,r){!function(f){!function(){"use strict";function o(t,e){a(t,e),s(t)}function s(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function a(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,f.nextTick(a,this,t)):f.nextTick(a,this,t)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?r._writableState?r._writableState.errorEmitted?f.nextTick(s,r):(r._writableState.errorEmitted=!0,f.nextTick(o,r,t)):f.nextTick(o,r,t):e?(f.nextTick(s,r),e(t)):f.nextTick(s,r)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}}.call(this)}.call(this,t("_process"))},{_process:150}],112:[function(t,e,r){"use strict";var m=t("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function g(){}e.exports=function t(e,r,n){if("function"==typeof r)return t(e,null,r);var i,o;i=n||g,o=!1,n=function(){if(!o){o=!0;for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.apply(this,e)}};function s(){e.writable||a()}function a(){b=!(p=!1),l||n.call(e)}function f(){y=!(l=!1),p||n.call(e)}function u(t){n.call(e,t)}function c(){var t;return l&&!y?(e._readableState&&e._readableState.ended||(t=new m),n.call(e,t)):p&&!b?(e._writableState&&e._writableState.ended||(t=new m),n.call(e,t)):void 0}function h(){e.req.on("finish",a)}var d,l=(r=r||{}).readable||!1!==r.readable&&e.readable,p=r.writable||!1!==r.writable&&e.writable,b=e._writableState&&e._writableState.finished,y=e._readableState&&e._readableState.endEmitted;return(d=e).setHeader&&"function"==typeof d.abort?(e.on("complete",a),e.on("abort",c),e.req?h():e.on("request",h)):p&&!e._writableState&&(e.on("end",s),e.on("close",s)),e.on("end",f),e.on("finish",a),!1!==r.error&&e.on("error",u),e.on("close",c),function(){e.removeListener("complete",a),e.removeListener("abort",c),e.removeListener("request",h),e.req&&e.req.removeListener("finish",a),e.removeListener("end",s),e.removeListener("close",s),e.removeListener("finish",a),e.removeListener("end",f),e.removeListener("error",u),e.removeListener("close",c)}}},{"../../../errors":103}],113:[function(t,e,r){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],114:[function(f,t,e){"use strict";var u;var r=f("../../../errors").codes,a=r.ERR_MISSING_ARGS,c=r.ERR_STREAM_DESTROYED;function h(t){if(t)throw t}function d(r,t,e,n){var i,o;i=n,o=!1;var s=!(n=function(){o||(o=!0,i.apply(void 0,arguments))});r.on("close",function(){s=!0}),(u=void 0===u?f("./end-of-stream"):u)(r,{readable:t,writable:e},function(t){return t?n(t):(s=!0,void n())});var a=!1;return function(t){var e;if(!s&&!a)return a=!0,(e=r).setHeader&&"function"==typeof e.abort?r.abort():"function"==typeof r.destroy?r.destroy():void n(t||new c("pipe"))}}function l(t){t()}function p(t,e){return t.pipe(e)}t.exports=function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];var r,i,o=!(r=n).length||"function"!=typeof r[r.length-1]?h:r.pop();if((n=Array.isArray(n[0])?n[0]:n).length<2)throw new a("streams");var s=n.map(function(t,e){var r=e<n.length-1;return d(t,r,0<e,function(t){i=i||t,t&&s.forEach(l),r||(s.forEach(l),o(i))})});return n.reduce(p)}},{"../../../errors":103,"./end-of-stream":112}],115:[function(t,e,r){"use strict";var s=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,r,n){var i,o=(i=n,o=r,null!=(e=e).highWaterMark?e.highWaterMark:i?e[o]:null);if(null==o)return t.objectMode?16:16384;if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new s(n?r:"highWaterMark",o);return Math.floor(o)}}},{"../../../errors":103}],116:[function(t,e,r){e.exports=t("events").EventEmitter},{events:145}],117:[function(t,e,r){(((r=e.exports=t("./lib/_stream_readable.js")).Stream=r).Readable=r).Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js"),r.finished=t("./lib/internal/streams/end-of-stream.js"),r.pipeline=t("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":104,"./lib/_stream_passthrough.js":105,"./lib/_stream_readable.js":106,"./lib/_stream_transform.js":107,"./lib/_stream_writable.js":108,"./lib/internal/streams/end-of-stream.js":112,"./lib/internal/streams/pipeline.js":114}],118:[function(t,e,r){"use strict";var n=t("buffer").Buffer,i=t("inherits"),o=t("hash-base"),y=new Array(16),m=[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],g=[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],w=[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],v=[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],_=[0,1518500249,1859775393,2400959708,2840853838],S=[1352829926,1548603684,1836072691,2053994217,0];function s(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function E(t,e){return t<<e|t>>>32-e}function T(t,e,r,n,i,o,s,a){return E(t+(e^r^n)+o+s|0,a)+i|0}function I(t,e,r,n,i,o,s,a){return E(t+(e&r|~e&n)+o+s|0,a)+i|0}function M(t,e,r,n,i,o,s,a){return E(t+((e|~r)^n)+o+s|0,a)+i|0}function k(t,e,r,n,i,o,s,a){return E(t+(e&n|r&~n)+o+s|0,a)+i|0}function A(t,e,r,n,i,o,s,a){return E(t+(e^(r|~n))+o+s|0,a)+i|0}i(s,o),s.prototype._update=function(){for(var t=y,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,a=0|this._a,f=0|this._b,u=0|this._c,c=0|this._d,h=0|this._e,d=0;d<80;d+=1)var l,p=d<16?(l=T(r,n,i,o,s,t[m[d]],_[0],w[d]),A(a,f,u,c,h,t[g[d]],S[0],v[d])):d<32?(l=I(r,n,i,o,s,t[m[d]],_[1],w[d]),k(a,f,u,c,h,t[g[d]],S[1],v[d])):d<48?(l=M(r,n,i,o,s,t[m[d]],_[2],w[d]),M(a,f,u,c,h,t[g[d]],S[2],v[d])):d<64?(l=k(r,n,i,o,s,t[m[d]],_[3],w[d]),I(a,f,u,c,h,t[g[d]],S[3],v[d])):(l=A(r,n,i,o,s,t[m[d]],_[4],w[d]),T(a,f,u,c,h,t[g[d]],S[4],v[d])),r=s,s=o,o=E(i,10),i=n,n=l,a=h,h=c,c=E(u,10),u=f,f=p;var b=this._b+i+c|0;this._b=this._c+o+h|0,this._c=this._d+s+a|0,this._d=this._e+r+f|0,this._e=this._a+n+u|0,this._a=b},s.prototype._digest=function(){this._block[this._blockOffset++]=128,56<this._blockOffset&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=n.alloc?n.alloc(20):new n(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},e.exports=s},{buffer:144,"hash-base":84,inherits:98}],119:[function(t,e,r){var n=t("buffer"),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,r),r.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");t=i(t);return void 0!==e?"string"==typeof r?t.fill(e,r):t.fill(e):t.fill(0),t},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:144}],120:[function(t,e,r){var c=t("safe-buffer").Buffer;function n(t,e){this._block=c.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}n.prototype.update=function(t,e){"string"==typeof t&&(t=c.from(t,e=e||"utf8"));for(var r=this._block,n=this._blockSize,i=t.length,o=this._len,s=0;s<i;){for(var a=o%n,f=Math.min(i-s,n-a),u=0;u<f;u++)r[a+u]=t[s+u];s+=f,(o+=f)%n==0&&this._update(r)}return this._len+=i,this},n.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,1+e),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));e=8*this._len;e<=4294967295?this._block.writeUInt32BE(e,this._blockSize-4):(this._block.writeUInt32BE((e-(r=(4294967295&e)>>>0))/4294967296,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)),this._update(this._block);var r=this._hash();return t?r.toString(t):r},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=n},{"safe-buffer":119}],121:[function(t,e,r){(r=e.exports=function(t){t=t.toLowerCase();var e=r[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e}).sha=t("./sha"),r.sha1=t("./sha1"),r.sha224=t("./sha224"),r.sha256=t("./sha256"),r.sha384=t("./sha384"),r.sha512=t("./sha512")},{"./sha":122,"./sha1":123,"./sha224":124,"./sha256":125,"./sha384":126,"./sha512":127}],122:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,p=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function a(){this.init(),this._w=s,i.call(this,64,56)}n(a,i),a.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},a.prototype._update=function(t){for(var e=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,a=0;a<16;++a)e[a]=t.readInt32BE(4*a);for(;a<80;++a)e[a]=e[a-3]^e[a-8]^e[a-14]^e[a-16];for(var f,u,c,h,d=0;d<80;++d)var l=~~(d/20),l=0|(r<<5|r>>>27)+(u=n,c=i,h=o,0===(f=l)?u&c|~u&h:2===f?u&c|u&h|c&h:u^c^h)+s+e[d]+p[l],s=o,o=i,i=n<<30|n>>>2,n=r,r=l;this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0},a.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=a},{"./hash":120,inherits:98,"safe-buffer":119}],123:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function a(){this.init(),this._w=s,i.call(this,64,56)}n(a,i),a.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},a.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,f=0;f<16;++f)r[f]=t.readInt32BE(4*f);for(;f<80;++f)r[f]=(e=r[f-3]^r[f-8]^r[f-14]^r[f-16])<<1|e>>>31;for(var u,c,h,d,l=0;l<80;++l)var p=~~(l/20),p=0|(n<<5|n>>>27)+(c=i,h=o,d=s,0===(u=p)?c&h|~c&d:2===u?c&h|c&d|h&d:c^h^d)+a+r[l]+b[p],a=s,s=o,o=i<<30|i>>>2,i=n,n=p;this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},a.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=a},{"./hash":120,inherits:98,"safe-buffer":119}],124:[function(t,e,r){var n=t("inherits"),i=t("./sha256"),o=t("./hash"),s=t("safe-buffer").Buffer,a=new Array(64);function f(){this.init(),this._w=a,o.call(this,64,56)}n(f,i),f.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},f.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},e.exports=f},{"./hash":120,"./sha256":125,inherits:98,"safe-buffer":119}],125:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,b=[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],s=new Array(64);function a(){this.init(),this._w=s,i.call(this,64,56)}n(a,i),a.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},a.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,f=0|this._f,u=0|this._g,c=0|this._h,h=0;h<16;++h)r[h]=t.readInt32BE(4*h);for(;h<64;++h)r[h]=0|(((e=r[h-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[h-7]+(((e=r[h-15])>>>7|e<<25)^(e>>>18|e<<14)^e>>>3)+r[h-16];for(var d=0;d<64;++d)var l=c+((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(u^a&(f^u))+b[d]+r[d]|0,p=0|((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&i|o&(n|i)),c=u,u=f,f=a,a=s+l|0,s=o,o=i,i=n,n=l+p|0;this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0,this._f=f+this._f|0,this._g=u+this._g|0,this._h=c+this._h|0},a.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},e.exports=a},{"./hash":120,inherits:98,"safe-buffer":119}],126:[function(t,e,r){var n=t("inherits"),i=t("./sha512"),o=t("./hash"),s=t("safe-buffer").Buffer,a=new Array(160);function f(){this.init(),this._w=a,o.call(this,128,112)}n(f,i),f.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},f.prototype._hash=function(){var n=s.allocUnsafe(48);function t(t,e,r){n.writeInt32BE(t,r),n.writeInt32BE(e,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),n},e.exports=f},{"./hash":120,"./sha512":127,inherits:98,"safe-buffer":119}],127:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,H=[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],s=new Array(160);function a(){this.init(),this._w=s,i.call(this,128,112)}function q(t,e,r){return r^t&(e^r)}function F(t,e,r){return t&e|r&(t|e)}function z(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function V(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function W(t,e){return t>>>0<e>>>0?1:0}n(a,i),a.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},a.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,a=0|this._fh,f=0|this._gh,u=0|this._hh,c=0|this._al,h=0|this._bl,d=0|this._cl,l=0|this._dl,p=0|this._el,b=0|this._fl,y=0|this._gl,m=0|this._hl,g=0;g<32;g+=2)e[g]=t.readInt32BE(4*g),e[g+1]=t.readInt32BE(4*g+4);for(;g<160;g+=2){var w=e[g-30],v=e[g-30+1],_=(w>>>1|v<<31)^(w>>>8|v<<24)^w>>>7,S=(v>>>1|w<<31)^(v>>>8|w<<24)^(v>>>7|w<<25),w=e[g-4],E=((v=e[g-4+1])>>>19|w<<13)^(w>>>29|v<<3)^(v>>>6|w<<26),T=e[g-14],I=e[g-14+1],M=e[g-32],k=e[g-32+1],A=S+I|0,O=_+T+W(A,S)|0;O=(O=O+((w>>>19|v<<13)^(v>>>29|w<<3)^w>>>6)+W(A=A+E|0,E)|0)+M+W(A=A+k|0,k)|0,e[g]=O,e[g+1]=A}for(var x=0;x<160;x+=2){O=e[x],A=e[x+1];var P=F(r,n,i),B=F(c,h,d),R=z(r,c),N=z(c,r),U=V(s,p),L=V(p,s),C=H[x+1],j=q(s,a,f),D=q(p,b,y),L=m+L|0;U=(U=(U=(U=u+U+W(L,m)|0)+j+W(L=L+D|0,D)|0)+H[x]+W(L=L+C|0,C)|0)+O+W(L=L+A|0,A)|0;B=N+B|0,N=R+P+W(B,N)|0,u=f,m=y,f=a,y=b,a=s,b=p,s=o+U+W(p=l+L|0,l)|0,o=i,l=d,i=n,d=h,n=r,h=c,r=U+N+W(c=L+B|0,L)|0}this._al=this._al+c|0,this._bl=this._bl+h|0,this._cl=this._cl+d|0,this._dl=this._dl+l|0,this._el=this._el+p|0,this._fl=this._fl+b|0,this._gl=this._gl+y|0,this._hl=this._hl+m|0,this._ah=this._ah+r+W(this._al,c)|0,this._bh=this._bh+n+W(this._bl,h)|0,this._ch=this._ch+i+W(this._cl,d)|0,this._dh=this._dh+o+W(this._dl,l)|0,this._eh=this._eh+s+W(this._el,p)|0,this._fh=this._fh+a+W(this._fl,b)|0,this._gh=this._gh+f+W(this._gl,y)|0,this._hh=this._hh+u+W(this._hl,m)|0},a.prototype._hash=function(){var n=o.allocUnsafe(64);function t(t,e,r){n.writeInt32BE(t,r),n.writeInt32BE(e,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),n},e.exports=a},{"./hash":120,inherits:98,"safe-buffer":119}],128:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}function s(t){var e;switch(this.encoding=o(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=f,e=4;break;case"base64":this.text=h,this.end=d,e=3;break;default:return this.write=l,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function f(t){var e,r=this.lastTotal-this.lastNeed,n=(n=this,128!=(192&(e=t)[0])?(n.lastNeed=0,"�"):1<n.lastNeed&&1<e.length?128!=(192&e[1])?(n.lastNeed=1,"�"):2<n.lastNeed&&2<e.length&&128!=(192&e[2])?(n.lastNeed=2,"�"):void 0:void 0);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,r,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,r,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2!=0)return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1);var r=t.toString("utf16le",e);if(r){e=r.charCodeAt(r.length-1);if(55296<=e&&e<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){t=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,t)}return e}function h(t,e){var r=(t.length-e)%3;return 0==r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1==r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function d(t){t=t&&t.length?this.write(t):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function l(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}(r.StringDecoder=s).prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},s.prototype.end=function(t){t=t&&t.length?this.write(t):"";return this.lastNeed?t+"�":t},s.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=a(e[n]);if(0<=i)return 0<i&&(t.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if(0<=(i=a(e[n])))return 0<i&&(t.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if(0<=(i=a(e[n])))return 0<i&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;r=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},s.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":119}],129:[function(k,A,t){!function(M){!function(){const e=k("bn.js"),t=k("elliptic").ec,r=new t("secp256k1"),a=k("./rfc6979"),o=M.alloc(32,0),c=M.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),i=M.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex"),h=r.curve.n,d=h.shrn(1),l=r.curve.g,f="Expected Private",p="Expected Point",s="Expected Tweak",b="Expected Hash",u="Expected Extra Data (32 bytes)";function y(t){return M.isBuffer(t)&&32===t.length}function m(t){return y(t)&&t.compare(c)<0}function g(t){if(!M.isBuffer(t))return!1;if(t.length<33)return!1;var e=t[0];const r=t.slice(1,33);if(0===r.compare(o))return!1;if(0<=r.compare(i))return!1;if((2===e||3===e)&&33===t.length){try{E(t)}catch(t){return!1}return!0}const n=t.slice(33);return 0!==n.compare(o)&&(!(0<=n.compare(i))&&(4===e&&65===t.length))}function n(t){return 4!==t[0]}function w(t){return!!y(t)&&(0<t.compare(o)&&t.compare(c)<0)}function v(t,e){return void 0===t&&void 0!==e?n(e):void 0===t||t}function _(t){return new e(t)}function S(t){return t.toArrayLike(M,"be",32)}function E(t){return r.curve.decodePoint(t)}function T(t,e){return M.from(t._encode(e))}function I(t,e,r){if(!y(t))throw new TypeError(b);if(!w(e))throw new TypeError(f);if(void 0!==r&&!y(r))throw new TypeError(u);const n=_(e),i=_(t);let o,s;a(t,e,function(t){const e=_(t),r=l.mul(e);return!r.isInfinity()&&(o=r.x.umod(h),0!==o.isZero()&&(s=e.invm(h).mul(i.add(n.mul(o))).umod(h),0!==s.isZero()))},w,r),0<s.cmp(d)&&(s=h.sub(s));r=M.allocUnsafe(64);return S(o).copy(r,0),S(s).copy(r,32),r}A.exports={isPoint:g,isPointCompressed:function(t){return!!g(t)&&n(t)},isPrivate:w,pointAdd:function(t,e,r){if(!g(t))throw new TypeError(p);if(!g(e))throw new TypeError(p);const n=E(t);e=E(e);const i=n.add(e);return i.isInfinity()?null:(t=v(r,t),T(i,t))},pointAddScalar:function(t,e,r){if(!g(t))throw new TypeError(p);if(!m(e))throw new TypeError(s);r=v(r,t);const n=E(t);if(0===e.compare(o))return T(n,r);e=_(e),e=l.mul(e);const i=n.add(e);return i.isInfinity()?null:T(i,r)},pointCompress:function(t,e){if(!g(t))throw new TypeError(p);const r=E(t);if(r.isInfinity())throw new TypeError(p);return t=v(e,t),T(r,t)},pointFromScalar:function(t,e){if(!w(t))throw new TypeError(f);t=_(t);const r=l.mul(t);return r.isInfinity()?null:(e=v(e),T(r,e))},pointMultiply:function(t,e,r){if(!g(t))throw new TypeError(p);if(!m(e))throw new TypeError(s);r=v(r,t);const n=E(t);e=_(e);const i=n.mul(e);return i.isInfinity()?null:T(i,r)},privateAdd:function(t,e){if(!w(t))throw new TypeError(f);if(!m(e))throw new TypeError(s);const r=_(t);return e=_(e),w(e=S(r.add(e).umod(h)))?e:null},privateSub:function(t,e){if(!w(t))throw new TypeError(f);if(!m(e))throw new TypeError(s);const r=_(t);return e=_(e),w(e=S(r.sub(e).umod(h)))?e:null},sign:function(t,e){return I(t,e)},signWithEntropy:I,verify:function(t,e,r,n){if(!y(t))throw new TypeError(b);if(!g(e))throw new TypeError(p);if(!function(t){const e=t.slice(0,32),r=t.slice(32,64);return M.isBuffer(t)&&64===t.length&&e.compare(c)<0&&r.compare(c)<0}(r))throw new TypeError("Expected Signature");e=E(e);const i=_(r.slice(0,32)),o=_(r.slice(32,64));if(n&&0<o.cmp(d))return!1;if(i.gtn(0)<=0)return!1;if(o.gtn(0)<=0)return!1;const s=_(t);n=o.invm(h),t=s.mul(n).umod(h),n=i.mul(n).umod(h);const a=l.mulAdd(t,e,n);if(a.isInfinity())return!1;const f=a.x,u=f.umod(h);return u.eq(i)}}}.call(this)}.call(this,k("buffer").Buffer)},{"./rfc6979":130,"bn.js":55,buffer:144,elliptic:68}],130:[function(t,e,r){!function(h){!function(){const f=t("create-hmac"),u=h.alloc(1,1),c=h.alloc(1,0);e.exports=function(t,e,r,n,i){let o=h.alloc(32,0),s=h.alloc(32,1);o=f("sha256",o).update(s).update(c).update(e).update(t).update(i||"").digest(),s=f("sha256",o).update(s).digest(),o=f("sha256",o).update(s).update(u).update(e).update(t).update(i||"").digest(),s=f("sha256",o).update(s).digest(),s=f("sha256",o).update(s).digest();let a=s;for(;!n(a)||!r(a);)o=f("sha256",o).update(s).update(c).digest(),s=f("sha256",o).update(s).digest(),s=f("sha256",o).update(s).digest(),a=s;return a}}.call(this)}.call(this,t("buffer").Buffer)},{buffer:144,"create-hmac":63}],131:[function(t,e,r){var n=t("./native");function i(t){return t.name||t.toString().match(/function (.*?)\s*\(/)[1]}function u(t){return n.Nil(t)?"":i(t.constructor)}function c(t,e){Error.captureStackTrace&&Error.captureStackTrace(t,e)}function h(t){return n.Function(t)?t.toJSON?t.toJSON():i(t):n.Array(t)?"Array":t&&n.Object(t)?"Object":void 0!==t?t:""}function d(t,e,r){e=e,e=n.Function(e)?"":n.String(e)?JSON.stringify(e):e&&n.Object(e)?"":e;return"Expected "+h(t)+", got"+(""!==r?" "+r:"")+(""!==e?" "+e:"")}function l(t,e,r){r=r||u(e),this.message=d(t,e,r),c(this,l),this.__type=t,this.__value=e,this.__valueTypeName=r}function o(t,e,r,n,i){var o,s,a,f;t?(i=i||u(n),this.message=(o=t,a=n,f=i,s="key"===(s=r)?'" with key type ':'" of type ',d('property "'+h(e)+s+h(o),a,f))):this.message='Unexpected property "'+e+'"',c(this,l),this.__label=r,this.__property=e,this.__type=t,this.__value=n,this.__valueTypeName=i}(l.prototype=Object.create(Error.prototype)).constructor=l,o.prototype=Object.create(Error.prototype),e.exports={TfTypeError:o.prototype.constructor=l,TfPropertyTypeError:o,tfCustomError:function(t,e){return new l(t,{},e)},tfSubError:function(t,e,r){return t instanceof o?(e=e+"."+t.__property,t=new o(t.__type,e,t.__label,t.__value,t.__valueTypeName)):t instanceof l&&(t=new o(t.__type,e,r,t.__value,t.__valueTypeName)),c(t),t},tfJSON:h,getValueTypeName:u}},{"./native":134}],132:[function(l,p,t){!function(d){!function(){var e=l("./native"),i=l("./errors");function t(t){return d.isBuffer(t)}function r(t){return"string"==typeof t&&/^([0-9a-f]{2})+$/i.test(t)}function n(e,r){var n=e.toJSON();function t(t){if(!e(t))return!1;if(t.length===r)return!0;throw i.tfCustomError(n+"(Length: "+r+")",n+"(Length: "+t.length+")")}return t.toJSON=function(){return n},t}var o=n.bind(null,e.Array),s=n.bind(null,t),a=n.bind(null,r),f=n.bind(null,e.String);var u=Math.pow(2,53)-1;var c,h={ArrayN:o,Buffer:t,BufferN:s,Finite:function(t){return"number"==typeof t&&isFinite(t)},Hex:r,HexN:a,Int8:function(t){return t<<24>>24===t},Int16:function(t){return t<<16>>16===t},Int32:function(t){return(0|t)===t},Int53:function(t){return"number"==typeof t&&-u<=t&&t<=u&&Math.floor(t)===t},Range:function(r,n,i){function t(t,e){return i(t,e)&&r<t&&t<n}return i=i||e.Number,t.toJSON=function(){return i.toJSON()+` between [${r}, ${n}]`},t},StringN:f,UInt8:function(t){return(255&t)===t},UInt16:function(t){return(65535&t)===t},UInt32:function(t){return t>>>0===t},UInt53:function(t){return"number"==typeof t&&0<=t&&t<=u&&Math.floor(t)===t}};for(c in h)h[c].toJSON=function(t){return t}.bind(null,c);p.exports=h}.call(this)}.call(this,{isBuffer:l("../../../../../../opt/homebrew/lib/node_modules/browserify/node_modules/is-buffer/index.js")})},{"../../../../../../opt/homebrew/lib/node_modules/browserify/node_modules/is-buffer/index.js":148,"./errors":131,"./native":134}],133:[function(t,e,r){var n,i=t("./errors"),s=t("./native"),a=i.tfJSON,o=i.TfTypeError,f=i.TfPropertyTypeError,u=i.tfSubError,c=i.getValueTypeName,h={arrayOf:function(n,e){function t(t,r){return!!s.Array(t)&&(!s.Nil(t)&&(!(void 0!==e.minLength&&t.length<e.minLength)&&(!(void 0!==e.maxLength&&t.length>e.maxLength)&&((void 0===e.length||t.length===e.length)&&t.every(function(t,e){try{return l(n,t,r)}catch(t){throw u(t,e)}})))))}return n=d(n),e=e||{},t.toJSON=function(){var t="["+a(n)+"]";return void 0!==e.length?t+="{"+e.length+"}":void 0===e.minLength&&void 0===e.maxLength||(t+="{"+(void 0===e.minLength?0:e.minLength)+","+(void 0===e.maxLength?1/0:e.maxLength)+"}"),t},t},maybe:function r(n){function t(t,e){return s.Nil(t)||n(t,e,r)}return n=d(n),t.toJSON=function(){return"?"+a(n)},t},map:function(i,o){function t(t,e){if(!s.Object(t))return!1;if(s.Nil(t))return!1;for(var r in t){try{o&&l(o,r,e)}catch(t){throw u(t,r,"key")}try{var n=t[r];l(i,n,e)}catch(t){throw u(t,r)}}return!0}return i=d(i),o=o&&d(o),t.toJSON=o?function(){return"{"+a(o)+": "+a(i)+"}"}:function(){return"{"+a(i)+"}"},t},object:function(t){var e,n={};for(e in t)n[e]=d(t[e]);function r(t,e){if(!s.Object(t))return!1;if(s.Nil(t))return!1;try{for(var r in n)l(n[r],t[r],e)}catch(t){throw u(t,r)}if(e)for(r in t)if(!n[r])throw new f(void 0,r);return!0}return r.toJSON=function(){return a(n)},r},anyOf:function(){var t=[].slice.call(arguments).map(d);function e(e,r){return t.some(function(t){try{return l(t,e,r)}catch(t){return!1}})}return e.toJSON=function(){return t.map(a).join("|")},e},allOf:function(){var t=[].slice.call(arguments).map(d);function e(e,r){return t.every(function(t){try{return l(t,e,r)}catch(t){return!1}})}return e.toJSON=function(){return t.map(a).join(" & ")},e},quacksLike:function(e){function t(t){return e===c(t)}return t.toJSON=function(){return e},t},tuple:function(){var t=[].slice.call(arguments).map(d);function e(r,n){return!s.Nil(r)&&(!s.Nil(r.length)&&((!n||r.length===t.length)&&t.every(function(t,e){try{return l(t,r[e],n)}catch(t){throw u(t,e)}})))}return e.toJSON=function(){return"("+t.map(a).join(", ")+")"},e},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};function d(t){if(s.String(t))return"?"===t[0]?h.maybe(t.slice(1)):s[t]||h.quacksLike(t);if(t&&s.Object(t)){if(s.Array(t)){if(1!==t.length)throw new TypeError("Expected compile() parameter of type Array of length 1");return h.arrayOf(t[0])}return h.object(t)}return s.Function(t)?t:h.value(t)}function l(t,e,r,n){if(s.Function(t)){if(t(e,r))return!0;throw new o(n||t,e)}return l(d(t),e,r)}for(n in h.oneOf=h.anyOf,s)l[n]=s[n];for(n in h)l[n]=h[n];var p=t("./extra");for(n in p)l[n]=p[n];l.compile=d,l.TfTypeError=o,l.TfPropertyTypeError=f,e.exports=l},{"./errors":131,"./extra":132,"./native":134}],134:[function(t,e,r){var n,i={Array:function(t){return null!=t&&t.constructor===Array},Boolean:function(t){return"boolean"==typeof t},Function:function(t){return"function"==typeof t},Nil:function(t){return null==t},Number:function(t){return"number"==typeof t},Object:function(t){return"object"==typeof t},String:function(t){return"string"==typeof t},"":function(){return!0}};for(n in i.Null=i.Nil,i)i[n].toJSON=function(t){return t}.bind(null,n);e.exports=i},{}],135:[function(t,r,e){!function(e){!function(){function n(t){try{if(!e.localStorage)return}catch(t){return}t=e.localStorage[t];return null!=t&&"true"===String(t).toLowerCase()}r.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],136:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=9007199254740991;function o(t){if(t<0||i<t||t%1!=0)throw new RangeError("value out of range")}function s(t,e,r){if(o(t),e=e||n.allocUnsafe(f(t)),!n.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");return r=r||0,t<253?(e.writeUInt8(t,r),s.bytes=1):t<=65535?(e.writeUInt8(253,r),e.writeUInt16LE(t,r+1),s.bytes=3):t<=4294967295?(e.writeUInt8(254,r),e.writeUInt32LE(t,r+1),s.bytes=5):(e.writeUInt8(255,r),e.writeUInt32LE(t>>>0,r+1),e.writeUInt32LE(t/4294967296|0,r+5),s.bytes=9),e}function a(t,e){if(!n.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");var r=t.readUInt8(e=e||0);if(r<253)return a.bytes=1,r;if(253===r)return a.bytes=3,t.readUInt16LE(e+1);if(254===r)return a.bytes=5,t.readUInt32LE(e+1);a.bytes=9;r=t.readUInt32LE(e+1),r=4294967296*t.readUInt32LE(e+5)+r;return o(r),r}function f(t){return o(t),t<253?1:t<=65535?3:t<=4294967295?5:9}e.exports={encode:s,decode:a,encodingLength:f}},{"safe-buffer":119}],137:[function(t,e,r){!function(o){!function(){var n=t("bs58check");function r(t,e){if(void 0!==e&&t[0]!==e)throw new Error("Invalid network version");if(33===t.length)return{version:t[0],privateKey:t.slice(1,33),compressed:!1};if(34!==t.length)throw new Error("Invalid WIF length");if(1!==t[33])throw new Error("Invalid compression flag");return{version:t[0],privateKey:t.slice(1,33),compressed:!0}}function i(t,e,r){var n=new o(r?34:33);return n.writeUInt8(t,0),e.copy(n,1),r&&(n[33]=1),n}e.exports={decode:function(t,e){return r(n.decode(t),e)},decodeRaw:r,encode:function(t,e,r){return"number"==typeof t?n.encode(i(t,e,r)):n.encode(i(t.version,t.privateKey,t.compressed))},encodeRaw:i}}.call(this)}.call(this,t("buffer").Buffer)},{bs58check:59,buffer:144}],138:[function(S,E,t){!function(_){!function(){"use strict";var t=S("object-assign");function o(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function s(t){return _.Buffer&&"function"==typeof _.Buffer.isBuffer?_.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var c=S("util/"),n=Object.prototype.hasOwnProperty,h=Array.prototype.slice,e="foo"===function(){}.name;function a(t){return Object.prototype.toString.call(t)}function f(t){return!s(t)&&("function"==typeof _.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}var u=E.exports=b,r=/\s*function\s+([^\(\s]*)\s*/;function i(t){if(c.isFunction(t)){if(e)return t.name;t=t.toString().match(r);return t&&t[1]}}function d(t,e){return"string"!=typeof t||t.length<e?t:t.slice(0,e)}function l(t){if(e||!c.isFunction(t))return c.inspect(t);t=i(t);return"[Function"+(t?": "+t:"")+"]"}function p(t,e,r,n,i){throw new u.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function b(t,e){t||p(t,!0,e,"==",u.ok)}function y(t,e,r,n){if(t===e)return!0;if(s(t)&&s(e))return 0===o(t,e);if(c.isDate(t)&&c.isDate(e))return t.getTime()===e.getTime();if(c.isRegExp(t)&&c.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(f(t)&&f(e)&&a(t)===a(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===o(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(s(t)!==s(e))return!1;var i=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==i&&i===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(c.isPrimitive(t)||c.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=m(t),o=m(e);if(i&&!o||!i&&o)return!1;if(i)return t=h.call(t),e=h.call(e),y(t,e,r);var s,a,f=v(t),u=v(e);if(f.length!==u.length)return!1;for(f.sort(),u.sort(),a=f.length-1;0<=a;a--)if(f[a]!==u[a])return!1;for(a=f.length-1;0<=a;a--)if(s=f[a],!y(t[s],e[s],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function m(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function g(t,e){if(t&&e){if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return 1}catch(t){}return Error.isPrototypeOf(e)?void 0:!0===e.call({},t)}}function w(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&p(i,r,"Missing expected exception"+n);var o="string"==typeof n,e=!t&&i&&!r;if((!t&&c.isError(i)&&o&&g(i,r)||e)&&p(i,r,"Got unwanted exception"+n),t&&i&&r&&!g(i,r)||!t&&i)throw i}u.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=d(l((e=this).actual),128)+" "+e.operator+" "+d(l(e.expected),128),this.generatedMessage=!0);var e=t.stackStartFunction||p;Error.captureStackTrace?Error.captureStackTrace(this,e):(t=new Error).stack&&(t=t.stack,e=i(e),0<=(e=t.indexOf("\n"+e))&&(e=t.indexOf("\n",e+1),t=t.substring(e+1)),this.stack=t)},c.inherits(u.AssertionError,Error),u.fail=p,u.ok=b,u.equal=function(t,e,r){t!=e&&p(t,e,r,"==",u.equal)},u.notEqual=function(t,e,r){t==e&&p(t,e,r,"!=",u.notEqual)},u.deepEqual=function(t,e,r){y(t,e,!1)||p(t,e,r,"deepEqual",u.deepEqual)},u.deepStrictEqual=function(t,e,r){y(t,e,!0)||p(t,e,r,"deepStrictEqual",u.deepStrictEqual)},u.notDeepEqual=function(t,e,r){y(t,e,!1)&&p(t,e,r,"notDeepEqual",u.notDeepEqual)},u.notDeepStrictEqual=function t(e,r,n){y(e,r,!0)&&p(e,r,n,"notDeepStrictEqual",t)},u.strictEqual=function(t,e,r){t!==e&&p(t,e,r,"===",u.strictEqual)},u.notStrictEqual=function(t,e,r){t===e&&p(t,e,r,"!==",u.notStrictEqual)},u.throws=function(t,e,r){w(!0,t,e,r)},u.doesNotThrow=function(t,e,r){w(!1,t,e,r)},u.ifError=function(t){if(t)throw t},u.strict=t(function t(e,r){e||p(e,!0,r,"==",t)},u,{equal:u.strictEqual,deepEqual:u.deepStrictEqual,notEqual:u.notStrictEqual,notDeepEqual:u.notDeepStrictEqual}),u.strict.strict=u.strict;var v=Object.keys||function(t){var e,r=[];for(e in t)n.call(t,e)&&r.push(e);return r}}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":149,"util/":141}],139:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;function r(){}r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],140:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],141:[function(M,t,k){!function(T,I){!function(){var a=/%[sdj%]/g;k.format=function(t){if(!y(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(f(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,i=n.length,o=String(t).replace(a,function(t){if("%%"===t)return"%";if(i<=r)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r<i;s=n[++r])p(s)||!w(s)?o+=" "+s:o+=" "+f(s);return o},k.deprecate=function(t,e){if(m(I.process))return function(){return k.deprecate(t,e).apply(this,arguments)};if(!0===T.noDeprecation)return t;var r=!1;return function(){if(!r){if(T.throwDeprecation)throw new Error(e);T.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}};var t,n={};function f(t,e){var r={seen:[],stylize:o};return 3<=arguments.length&&(r.depth=arguments[2]),4<=arguments.length&&(r.colors=arguments[3]),l(e)?r.showHidden=e:e&&k._extend(r,e),m(r.showHidden)&&(r.showHidden=!1),m(r.depth)&&(r.depth=2),m(r.colors)&&(r.colors=!1),m(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=i),u(r,t,r.depth)}function i(t,e){e=f.styles[e];return e?"["+f.colors[e][0]+"m"+t+"["+f.colors[e][1]+"m":t}function o(t,e){return t}function u(e,r,n){if(e.customInspect&&r&&S(r.inspect)&&r.inspect!==k.inspect&&(!r.constructor||r.constructor.prototype!==r)){var t=r.inspect(n,e);return t=!y(t)?u(e,t,n):t}var i=function(t,e){if(m(e))return t.stylize("undefined","undefined");if(y(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return b(e)?t.stylize(""+e,"number"):l(e)?t.stylize(""+e,"boolean"):p(e)?t.stylize("null","null"):void 0}(e,r);if(i)return i;var o,t=Object.keys(r),s=(o={},t.forEach(function(t,e){o[t]=!0}),o);if(e.showHidden&&(t=Object.getOwnPropertyNames(r)),_(r)&&(0<=t.indexOf("message")||0<=t.indexOf("description")))return c(r);if(0===t.length){if(S(r)){var a=r.name?": "+r.name:"";return e.stylize("[Function"+a+"]","special")}if(g(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(v(r))return e.stylize(Date.prototype.toString.call(r),"date");if(_(r))return c(r)}var i="",f=!1,a=["{","}"];return d(r)&&(f=!0,a=["[","]"]),S(r)&&(i=" [Function"+(r.name?": "+r.name:"")+"]"),g(r)&&(i=" "+RegExp.prototype.toString.call(r)),v(r)&&(i=" "+Date.prototype.toUTCString.call(r)),_(r)&&(i=" "+c(r)),0!==t.length||f&&0!=r.length?n<0?g(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),t=f?function(e,r,n,i,t){for(var o=[],s=0,a=r.length;s<a;++s)E(r,String(s))?o.push(h(e,r,n,i,String(s),!0)):o.push("");return t.forEach(function(t){t.match(/^\d+$/)||o.push(h(e,r,n,i,t,!0))}),o}(e,r,n,s,t):t.map(function(t){return h(e,r,n,s,t,f)}),e.seen.pop(),function(t,e,r){if(60<t.reduce(function(t,e){return 0<=e.indexOf("\n")&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0))return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(t,i,a)):a[0]+i+a[1]}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i,o){var s,a,e=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]};if(e.get?a=e.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):e.set&&(a=t.stylize("[Setter]","special")),E(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(e.value)<0?-1<(a=p(r)?u(t,e.value,null):u(t,e.value,r-1)).indexOf("\n")&&(a=o?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n")):a=t.stylize("[Circular]","special")),m(s)){if(o&&i.match(/^\d+$/))return a;s=(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),t.stylize(s,"string"))}return s+": "+a}function d(t){return Array.isArray(t)}function l(t){return"boolean"==typeof t}function p(t){return null===t}function b(t){return"number"==typeof t}function y(t){return"string"==typeof t}function m(t){return void 0===t}function g(t){return w(t)&&"[object RegExp]"===e(t)}function w(t){return"object"==typeof t&&null!==t}function v(t){return w(t)&&"[object Date]"===e(t)}function _(t){return w(t)&&("[object Error]"===e(t)||t instanceof Error)}function S(t){return"function"==typeof t}function e(t){return Object.prototype.toString.call(t)}function r(t){return t<10?"0"+t.toString(10):t.toString(10)}k.debuglog=function(e){var r;return m(t)&&(t=T.env.NODE_DEBUG||""),e=e.toUpperCase(),n[e]||(new RegExp("\\b"+e+"\\b","i").test(t)?(r=T.pid,n[e]=function(){var t=k.format.apply(k,arguments);console.error("%s %d: %s",e,r,t)}):n[e]=function(){}),n[e]},(k.inspect=f).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]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},k.isArray=d,k.isBoolean=l,k.isNull=p,k.isNullOrUndefined=function(t){return null==t},k.isNumber=b,k.isString=y,k.isSymbol=function(t){return"symbol"==typeof t},k.isUndefined=m,k.isRegExp=g,k.isObject=w,k.isDate=v,k.isError=_,k.isFunction=S,k.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},k.isBuffer=M("./support/isBuffer");var s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(t,e){return Object.prototype.hasOwnProperty.call(t,e)}k.log=function(){var t,e;console.log("%s - %s",(t=new Date,e=[r(t.getHours()),r(t.getMinutes()),r(t.getSeconds())].join(":"),[t.getDate(),s[t.getMonth()],e].join(" ")),k.format.apply(k,arguments))},k.inherits=M("inherits"),k._extend=function(t,e){if(!e||!w(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}.call(this)}.call(this,M("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":140,_process:150,inherits:139}],142:[function(t,e,r){"use strict";r.byteLength=function(t){var e=c(t),t=e[0],e=e[1];return 3*(t+e)/4-e},r.toByteArray=function(t){var e,r,n=c(t),i=n[0],n=n[1],o=new u(function(t,e){return 3*(t+e)/4-e}(i,n)),s=0,a=0<n?i-4:i;for(r=0;r<a;r+=4)e=f[t.charCodeAt(r)]<<18|f[t.charCodeAt(r+1)]<<12|f[t.charCodeAt(r+2)]<<6|f[t.charCodeAt(r+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=255&e;2===n&&(e=f[t.charCodeAt(r)]<<2|f[t.charCodeAt(r+1)]>>4,o[s++]=255&e);1===n&&(e=f[t.charCodeAt(r)]<<10|f[t.charCodeAt(r+1)]<<4|f[t.charCodeAt(r+2)]>>2,o[s++]=e>>8&255,o[s++]=255&e);return o},r.fromByteArray=function(t){for(var e,r=t.length,n=r%3,i=[],o=0,s=r-n;o<s;o+=16383)i.push(function(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),i.push(function(t){return a[t>>18&63]+a[t>>12&63]+a[t>>6&63]+a[63&t]}(n));return i.join("")}(t,o,s<o+16383?s:o+16383));1==n?(e=t[r-1],i.push(a[e>>2]+a[e<<4&63]+"==")):2==n&&(e=(t[r-2]<<8)+t[r-1],i.push(a[e>>10]+a[e>>4&63]+a[e<<2&63]+"="));return i.join("")};for(var a=[],f=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;i<o;++i)a[i]=n[i],f[n.charCodeAt(i)]=i;function c(t){var e=t.length;if(0<e%4)throw new Error("Invalid string. Length must be a multiple of 4");t=t.indexOf("=");return[t=-1===t?e:t,t===e?0:4-t%4]}f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63},{}],143:[function(t,e,r){},{}],144:[function(P,t,B){!function(t){!function(){"use strict";var a=P("base64-js"),o=P("ieee754");B.Buffer=h,B.SlowBuffer=function(t){+t!=t&&(t=0);return h.alloc(+t)},B.INSPECT_MAX_BYTES=50;var e=2147483647;function i(t){if(e<t)throw new RangeError('The value "'+t+'" is invalid for option "size"');t=new Uint8Array(t);return t.__proto__=h.prototype,t}function h(t,e,r){if("number"!=typeof t)return n(t,e,r);if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}function n(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!h.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|d(t,e),n=i(r),e=n.write(t,e);e!==r&&(n=n.slice(0,e));return n}(t,e);if(ArrayBuffer.isView(t))return u(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(O(t,ArrayBuffer)||t&&O(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');r=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r);return r.__proto__=h.prototype,r}(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return h.from(n,e,r);n=function(t){if(h.isBuffer(t)){var e=0|c(t.length),r=i(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}if(void 0!==t.length)return"number"!=typeof t.length||x(t.length)?i(0):u(t);if("Buffer"===t.type&&Array.isArray(t.data))return u(t.data)}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return h.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return s(t),i(t<0?0:0|c(t))}function u(t){for(var e=t.length<0?0:0|c(t.length),r=i(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function c(t){if(e<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+e.toString(16)+" bytes");return 0|t}function d(t,e){if(h.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||O(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=2<arguments.length&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return k(t).length;default:if(i)return n?-1:M(t).length;e=(""+e).toLowerCase(),i=!0}}function r(t,e,r){var n,i,o,s=!1;if((e=void 0===e||e<0?0:e)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0);(!r||r<0||n<r)&&(r=n);for(var i="",o=e;o<r;++o)i+=function(t){return t<16?"0"+t.toString(16):t.toString(16)}(t[o]);return i}(this,e,r);case"utf8":case"utf-8":return g(this,e,r);case"ascii":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}(this,e,r);case"base64":return n=this,o=r,0===(i=e)&&o===n.length?a.fromByteArray(n):a.fromByteArray(n.slice(i,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}(this,e,r);default:if(s)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),s=!0}}function l(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function p(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),(r=(r=x(r=+r)?i?0:t.length-1:r)<0?t.length+r:r)>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=h.from(e,n)),h.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?(i?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){var o=1,s=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s/=o=2,a/=2,r/=2}function f(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i)for(var u=-1,c=r;c<s;c++)if(f(t,c)===f(e,-1===u?0:c-u)){if(c-(u=-1===u?c:u)+1===a)return u*o}else-1!==u&&(c-=c-u),u=-1;else for(c=r=s<r+a?s-a:r;0<=c;c--){for(var h=!0,d=0;d<a;d++)if(f(t,c+d)!==f(e,d)){h=!1;break}if(h)return c}return-1}function y(t,e,r,n){return A(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function m(t,e,r,n){return A(function(t,e){for(var r,n,i=[],o=0;o<t.length&&!((e-=2)<0);++o)n=t.charCodeAt(o),r=n>>8,n=n%256,i.push(n),i.push(r);return i}(e,t.length-r),t,r,n)}function g(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,f,u=t[i],c=null,h=239<u?4:223<u?3:191<u?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=t[i+1]))&&127<(f=(31&u)<<6|63&o)&&(c=f);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&2047<(f=(15&u)<<12|(63&o)<<6|63&s)&&(f<55296||57343<f)&&(c=f);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&65535<(f=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)&&f<1114112&&(c=f)}null===c?(c=65533,h=1):65535<c&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(t){var e=t.length;if(e<=w)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=w));return r}(n)}B.kMaxLength=e,(h.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}}),Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),h.poolSize=8192,h.from=n,h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,h.alloc=function(t,e,r){return e=e,r=r,s(t=t),!(t<=0)&&void 0!==e?"string"==typeof r?i(t).fill(e,r):i(t).fill(e):i(t)},h.allocUnsafe=f,h.allocUnsafeSlow=f,h.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==h.prototype},h.compare=function(t,e){if(O(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),O(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},h.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return h.alloc(0);if(void 0===e)for(i=e=0;i<t.length;++i)e+=t[i].length;for(var r=h.allocUnsafe(e),n=0,i=0;i<t.length;++i){var o=t[i];if(O(o,Uint8Array)&&(o=h.from(o)),!h.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,n),n+=o.length}return r},h.byteLength=d,h.prototype._isBuffer=!0,h.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)l(this,e,e+1);return this},h.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)l(this,e,e+3),l(this,e+1,e+2);return this},h.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)l(this,e,e+7),l(this,e+1,e+6),l(this,e+2,e+5),l(this,e+3,e+4);return this},h.prototype.toLocaleString=h.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?g(this,0,t):r.apply(this,arguments)},h.prototype.equals=function(t){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===h.compare(this,t)},h.prototype.inspect=function(){var t="",e=B.INSPECT_MAX_BYTES,t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim();return this.length>e&&(t+=" ... "),"<Buffer "+t+">"},h.prototype.compare=function(t,e,r,n,i){if(O(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),!h.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),(e=void 0===e?0:e)<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&r<=e)return 0;if(i<=n)return-1;if(r<=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),f=this.slice(n,i),u=t.slice(e,r),c=0;c<a;++c)if(f[c]!==u[c]){o=f[c],s=u[c];break}return o<s?-1:s<o?1:0},h.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},h.prototype.indexOf=function(t,e,r){return p(this,t,e,r,!0)},h.prototype.lastIndexOf=function(t,e,r){return p(this,t,e,r,!1)},h.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||i<r)&&(r=i),0<t.length&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var o,s,a,f=!1;;)switch(n){case"hex":return function(t,e,r,n){r=Number(r)||0;var i=t.length-r;(!n||i<(n=Number(n)))&&(n=i),(i=e.length)/2<n&&(n=i/2);for(var o=0;o<n;++o){var s=parseInt(e.substr(2*o,2),16);if(x(s))return o;t[r+o]=s}return o}(this,t,e,r);case"utf8":case"utf-8":return s=e,a=r,A(M(t,(o=this).length-s),o,s,a);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return y(this,t,e,r);case"base64":return o=this,s=e,a=r,A(k(t),o,s,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,t,e,r);default:if(f)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),f=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function v(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(r<t+e)throw new RangeError("Trying to access beyond buffer length")}function _(t,e,r,n,i,o){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<e||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function S(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function E(t,e,r,n,i){return e=+e,r>>>=0,i||S(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function T(t,e,r,n,i){return e=+e,r>>>=0,i||S(t,0,r,8),o.write(t,e,r,n,52,8),r+8}h.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),e<t&&(e=t);e=this.subarray(t,e);return e.__proto__=h.prototype,e},h.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},h.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=this[t+--e],i=1;0<e&&(i*=256);)n+=this[t+--e]*i;return n},h.prototype.readUInt8=function(t,e){return t>>>=0,e||v(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return(i*=128)<=n&&(n-=Math.pow(2,8*e)),n},h.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);for(var n=e,i=1,o=this[t+--n];0<n&&(i*=256);)o+=this[t+--n]*i;return(i*=128)<=o&&(o-=Math.pow(2,8*e)),o},h.prototype.readInt8=function(t,e){return t>>>=0,e||v(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){t>>>=0,e||v(t,2,this.length);t=this[t]|this[t+1]<<8;return 32768&t?4294901760|t:t},h.prototype.readInt16BE=function(t,e){t>>>=0,e||v(t,2,this.length);t=this[t+1]|this[t]<<8;return 32768&t?4294901760|t:t},h.prototype.readInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return t>>>=0,e||v(t,4,this.length),o.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return t>>>=0,e||v(t,4,this.length),o.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return t>>>=0,e||v(t,8,this.length),o.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return t>>>=0,e||v(t,8,this.length),o.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||_(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},h.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||_(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;0<=--i&&(o*=256);)this[e+i]=t/o&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,1,255,0),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},h.prototype.writeIntLE=function(t,e,r,n){t=+t,e>>>=0,n||_(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},h.prototype.writeIntBE=function(t,e,r,n){t=+t,e>>>=0,n||_(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var i=r-1,o=1,s=0;for(this[e+i]=255&t;0<=--i&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,1,127,-128),this[e]=255&(t=t<0?255+t+1:t),e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,2147483647,-2147483648),this[e]=(t=t<0?4294967295+t+1:t)>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},h.prototype.writeFloatLE=function(t,e,r){return E(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return E(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return T(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return T(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,n){if(!h.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r=r||0,n||0===n||(n=this.length),e>=t.length&&(e=t.length),(n=0<n&&n<r?r:n)===r)return 0;if(0===t.length||0===this.length)return 0;if((e=e||0)<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var i=(n=t.length-e<n-r?t.length-e+r:n)-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var o=i-1;0<=o;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},h.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!h.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var i;1===t.length&&(i=t.charCodeAt(0),("utf8"===n&&i<128||"latin1"===n)&&(t=i))}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(t=t||0))for(o=e;o<r;++o)this[o]=t;else{var s=h.isBuffer(t)?t:h.from(t,n),a=s.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var I=/[^+/0-9A-Za-z-_]/g;function M(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if(55295<(r=t.charCodeAt(s))&&r<57344){if(!i){if(56319<r){-1<(e-=3)&&o.push(239,191,189);continue}if(s+1===n){-1<(e-=3)&&o.push(239,191,189);continue}i=r;continue}if(r<56320){-1<(e-=3)&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&-1<(e-=3)&&o.push(239,191,189);if(i=null,r<128){if(--e<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function k(t){return a.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(I,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function A(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function O(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function x(t){return t!=t}}.call(this)}.call(this,P("buffer").Buffer)},{"base64-js":142,buffer:144,ieee754:146}],145:[function(t,e,r){"use strict";var n="object"==typeof Reflect?Reflect:null,f=n&&"function"==typeof n.apply?n.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};var i=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)},o=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(a,f){return new Promise(function(t,e){function r(t){a.removeListener(f,n),e(t)}function n(){"function"==typeof a.removeListener&&a.removeListener("error",r),t([].slice.call(arguments))}var i,o,s;y(a,f,n,{once:!0}),"error"!==f&&(o=r,s={once:!0},"function"==typeof(i=a).on&&y(i,"error",o,s))})},(s.EventEmitter=s).prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function u(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function h(t,e,r,n){var i,o;return u(r),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,r.listener||r),i=t._events),o=i[e]),void 0===o?(o=i[e]=r,++t._eventsCount):("function"==typeof o?o=i[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),0<(r=c(t))&&o.length>r&&!o.warned&&(o.warned=!0,(r=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",r.emitter=t,r.type=e,r.count=o.length,r=r,console&&console.warn&&console.warn(r))),t}function d(t,e,r){t={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},e=function(){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)}.bind(t);return e.listener=r,t.wrapFn=e}function l(t,e,r){t=t._events;if(void 0===t)return[];e=t[e];return void 0===e?[]:"function"==typeof e?r?[e.listener||e]:[e]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(e):b(e,e.length)}function p(t){var e=this._events;if(void 0!==e){t=e[t];if("function"==typeof t)return 1;if(void 0!==t)return t.length}return 0}function b(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function y(r,n,i,o){if("function"==typeof r.on)o.once?r.once(n,i):r.on(n,i);else{if("function"!=typeof r.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r);r.addEventListener(n,function t(e){o.once&&r.removeEventListener(n,t),i(e)})}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n,i="error"===t,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){if((n=0<e.length?e[0]:n)instanceof Error)throw n;i=new Error("Unhandled error."+(n?" ("+n.message+")":""));throw i.context=n,i}t=o[t];if(void 0===t)return!1;if("function"==typeof t)f(t,this,e);else for(var s=t.length,a=b(t,s),r=0;r<s;++r)f(a[r],this,e);return!0},s.prototype.on=s.prototype.addListener=function(t,e){return h(this,t,e,!1)},s.prototype.prependListener=function(t,e){return h(this,t,e,!0)},s.prototype.once=function(t,e){return u(e),this.on(t,d(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return u(e),this.prependListener(t,d(this,t,e)),this},s.prototype.off=s.prototype.removeListener=function(t,e){var r,n,i,o,s;if(u(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;0<=o;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},s.prototype.removeAllListeners=function(t){var e,r=this._events;if(void 0===r)return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){for(var n,i=Object.keys(r),o=0;o<i.length;++o)"removeListener"!==(n=i[o])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(o=e.length-1;0<=o;o--)this.removeListener(t,e[o]);return this},s.prototype.listeners=function(t){return l(this,t,!0)},s.prototype.rawListeners=function(t){return l(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return 0<this._eventsCount?i(this._events):[]}},{}],146:[function(t,e,r){r.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,f=(1<<a)-1,u=f>>1,c=-7,h=r?i-1:0,d=r?-1:1,r=t[e+h];for(h+=d,o=r&(1<<-c)-1,r>>=-c,c+=a;0<c;o=256*o+t[e+h],h+=d,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;0<c;s=256*s+t[e+h],h+=d,c-=8);if(0===o)o=1-u;else{if(o===f)return s?NaN:1/0*(r?-1:1);s+=Math.pow(2,n),o-=u}return(r?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var s,a,f=8*o-i-1,u=(1<<f)-1,c=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,l=n?1:-1,o=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(n=Math.pow(2,-s))<1&&(s--,n*=2),2<=(e+=1<=s+c?h/n:h*Math.pow(2,1-c))*n&&(s++,n/=2),u<=s+c?(a=0,s=u):1<=s+c?(a=(e*n-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));8<=i;t[r+d]=255&a,d+=l,a/=256,i-=8);for(s=s<<i|a,f+=i;0<f;t[r+d]=255&s,d+=l,s/=256,f-=8);t[r+d-l]|=128*o}},{}],147:[function(t,e,r){arguments[4][98][0].apply(r,arguments)},{dup:98}],148:[function(t,e,r){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}e.exports=function(t){return null!=t&&(n(t)||"function"==typeof(e=t).readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))||!!t._isBuffer);var e}},{}],149:[function(t,e,r){"use strict";var f=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},n)).join("")?void 0:1}catch(t){return}}()?Object.assign:function(t,e){for(var r,n=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),i=1;i<arguments.length;i++){for(var o in r=Object(arguments[i]))u.call(r,o)&&(n[o]=r[o]);if(f)for(var s=f(r),a=0;a<s.length;a++)c.call(r,s[a])&&(n[s[a]]=r[s[a]])}return n}},{}],150:[function(t,e,r){var n,i,e=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var f,u=[],c=!1,h=-1;function d(){c&&f&&(c=!1,f.length?u=f.concat(u):h=-1,u.length&&l())}function l(){if(!c){var t=a(d);c=!0;for(var e=u.length;e;){for(f=u,u=[];++h<e;)f&&f[h].run();h=-1,e=u.length}f=null,c=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function b(){}e.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new p(t,e)),1!==u.length||c||a(l)},p.prototype.run=function(){this.fun.apply(null,this.array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={},e.on=b,e.addListener=b,e.once=b,e.off=b,e.removeListener=b,e.removeAllListeners=b,e.emit=b,e.prependListener=b,e.prependOnceListener=b,e.listeners=function(t){return[]},e.binding=function(t){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(t){throw new Error("process.chdir is not supported")},e.umask=function(){return 0}},{}],151:[function(t,e,r){arguments[4][119][0].apply(r,arguments)},{buffer:144,dup:119}],152:[function(t,e,r){e.exports=n;var c=t("events").EventEmitter;function n(){c.call(this)}t("inherits")(n,c),n.Readable=t("readable-stream/lib/_stream_readable.js"),n.Writable=t("readable-stream/lib/_stream_writable.js"),n.Duplex=t("readable-stream/lib/_stream_duplex.js"),n.Transform=t("readable-stream/lib/_stream_transform.js"),n.PassThrough=t("readable-stream/lib/_stream_passthrough.js"),n.finished=t("readable-stream/lib/internal/streams/end-of-stream.js"),n.pipeline=t("readable-stream/lib/internal/streams/pipeline.js"),(n.Stream=n).prototype.pipe=function(e,t){var r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",a));var o=!1;function s(){o||(o=!0,e.end())}function a(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function f(t){if(u(),0===c.listenerCount(this,"error"))throw t}function u(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",a),r.removeListener("error",f),e.removeListener("error",f),r.removeListener("end",u),r.removeListener("close",u),e.removeListener("close",u)}return r.on("error",f),e.on("error",f),r.on("end",u),r.on("close",u),e.on("close",u),e.emit("pipe",r),e}},{events:145,inherits:147,"readable-stream/lib/_stream_duplex.js":154,"readable-stream/lib/_stream_passthrough.js":155,"readable-stream/lib/_stream_readable.js":156,"readable-stream/lib/_stream_transform.js":157,"readable-stream/lib/_stream_writable.js":158,"readable-stream/lib/internal/streams/end-of-stream.js":162,"readable-stream/lib/internal/streams/pipeline.js":164}],153:[function(t,e,r){arguments[4][103][0].apply(r,arguments)},{dup:103}],154:[function(t,e,r){arguments[4][104][0].apply(r,arguments)},{"./_stream_readable":156,"./_stream_writable":158,_process:150,dup:104,inherits:147}],155:[function(t,e,r){arguments[4][105][0].apply(r,arguments)},{"./_stream_transform":157,dup:105,inherits:147}],156:[function(t,e,r){arguments[4][106][0].apply(r,arguments)},{"../errors":153,"./_stream_duplex":154,"./internal/streams/async_iterator":159,"./internal/streams/buffer_list":160,"./internal/streams/destroy":161,"./internal/streams/from":163,"./internal/streams/state":165,"./internal/streams/stream":166,_process:150,buffer:144,dup:106,events:145,inherits:147,"string_decoder/":167,util:143}],157:[function(t,e,r){arguments[4][107][0].apply(r,arguments)},{"../errors":153,"./_stream_duplex":154,dup:107,inherits:147}],158:[function(t,e,r){arguments[4][108][0].apply(r,arguments)},{"../errors":153,"./_stream_duplex":154,"./internal/streams/destroy":161,"./internal/streams/state":165,"./internal/streams/stream":166,_process:150,buffer:144,dup:108,inherits:147,"util-deprecate":168}],159:[function(t,e,r){arguments[4][109][0].apply(r,arguments)},{"./end-of-stream":162,_process:150,dup:109}],160:[function(t,e,r){arguments[4][110][0].apply(r,arguments)},{buffer:144,dup:110,util:143}],161:[function(t,e,r){arguments[4][111][0].apply(r,arguments)},{_process:150,dup:111}],162:[function(t,e,r){arguments[4][112][0].apply(r,arguments)},{"../../../errors":153,dup:112}],163:[function(t,e,r){arguments[4][113][0].apply(r,arguments)},{dup:113}],164:[function(t,e,r){arguments[4][114][0].apply(r,arguments)},{"../../../errors":153,"./end-of-stream":162,dup:114}],165:[function(t,e,r){arguments[4][115][0].apply(r,arguments)},{"../../../errors":153,dup:115}],166:[function(t,e,r){arguments[4][116][0].apply(r,arguments)},{dup:116,events:145}],167:[function(t,e,r){arguments[4][128][0].apply(r,arguments)},{dup:128,"safe-buffer":151}],168:[function(t,e,r){arguments[4][135][0].apply(r,arguments)},{dup:135}],"/":[function(t,e,r){var n=t("bitcoinjs-lib");n.bigi=t("bigi"),n.Buffer=t("safe-buffer").Buffer,n.ECPair=t("ecpair").ECPair,e.exports=n},{bigi:5,"bitcoinjs-lib":35,ecpair:65,"safe-buffer":119}]},{},[])("/")});