btcpayserver/BTCPayServer/wwwroot/vendor/trezor/trezor.js-umd.min.js

64 lines
4.9 MiB
JavaScript
Raw Normal View History

Put Ledger Wallet pairing in a popup, prepare code for Trezor pairing (#836) * Allowing for POS to be displayed at website root * Switching to asp attributes for form post action * Applying default formatting rules on HTML * The destination pays mining fees => Subtract fees from amount * small cleanup (#851) * Part2: Openiddict: Init OpenIddict & Database Migration & Auth Policies (#567) * Part 1: OpenIddict - Minor Changes & Config prep * Part 1: OpenIddict - Minor Changes & Config prep * Part2: Openiddict: Init OpenIddict & Database Migration & Auth Policies * pr changes * pr changes * fix merge * pr fixes * remove config for openid -- no need for it for now * fix compile * fix compile #2 * remove extra ns using * Update Startup.cs * compile * adjust settings a bit * remove duplicate * remove external login provider placeholder html * remove unused directives * regenerate db snapshot model * Remove dynamic policy * Provide Pretty descriptions for payment methods from their handlers (#852) * small cleanup * Provide Pretty descriptions for payment methods from their handlers * remove PrettyMethod() * integration with trezor * rough load xpub from trezor * update deriv scheme trezor * move ledger import to dialog * add import from hw wallet dropdown * Support temporary links for local file system provider (#848) * wip * Support temporary links for local file system provider * pass base url to file services * fix test * do not crash on errors with local filesystem * remove console * fix paranthesis * work on trezor.net integration * pushed non compiling sign wallet code * comment out wallet code * abstract ledger ws in add deriv * Auto stash before merge of "trezor" and "btcpayserver/master" * final add changes * cleanup * improve connectivity and fix e2e tests * fix selenium * add experimental warning for trezor * move import button to right and convert to text link * switch to defer and async scripts in add deriv scheme * make defer not async * more elaborate import trezor dialog * Fix small issues * hide trezor for now
2019-05-25 02:45:36 +00:00
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("trezor.js-umd",[],t):"object"==typeof exports?exports["trezor.js-umd"]=t():e["trezor.js-umd"]=t()}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=113)}([function(e,t,r){var n=r(1),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";(function(e){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var n=r(116),i=r(117),o=r(57);function s(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=f.prototype:(null===e&&(e=new f(t)),e.length=t),e}function f(e,t,r){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return h(this,e)}return u(this,e,t,r)}function u(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);f.TYPED_ARRAY_SUPPORT?(e=t).__proto__=f.prototype:e=l(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!f.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(t,r),i=(e=a(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(f.isBuffer(t)){var r=0|p(t.length);return 0===(e=a(e,r)).length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?a(e,0):l(e,t);if("Buffer"===t.type&&o(t.data))return l(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function h(e,t){if(c(t),e=a(e,t<0?0:0|p(t)),!f.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function l(e,t){var r=t.length<0?0:0|p(t.length);e=a(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function p(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function d(e,t){if(f.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(n)return F(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=f.from(t,n)),f.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var o,s=1,a=e.length,f=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,f/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===f)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(r+f>a&&(r=a-f),o=r;o>=0;o--){for(var h=!0,l=0;l<f;l++)if(u(e,o+l)!==u(t,l)){h=!1;break}if(h)return o}return-1}function v(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function i(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var o=r(46),s=Object.prototype.hasOwnProperty,a=Array.prototype.slice,f="foo"===function(){}.name;function u(e){return Object.prototype.toString.call(e)}function c(e){return!i(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var h=e.exports=b,l=/\s*function\s+([^\(\s]*)\s*/;function p(e){if(o.isFunction(e)){if(f)return e.name;var t=e.toString().match(l);return t&&t[1]}}function d(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function g(e){if(f||!o.isFunction(e))return o.inspect(e);var t=p(e);return"[Function"+(t?": "+t:"")+"]"}function y(e,t,r,n,i){throw new h.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function b(e,t){e||y(e,!0,t,"==",h.ok)}function v(e,t,r,s){if(e===t)return!0;if(i(e)&&i(t))return 0===n(e,t);if(o.isDate(e)&&o.isDate(t))return e.getTime()===t.getTime();if(o.isRegExp(e)&&o.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(c(e)&&c(t)&&u(e)===u(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===n(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(i(e)!==i(t))return!1;var f=(s=s||{actual:[],expected:[]}).actual.indexOf(e);return-1!==f&&f===s.expected.indexOf(t)||(s.actual.push(e),s.expected.push(t),function(e,t,r,n){if(null==e||null==t)return!1;if(o.isPrimitive(e)||o.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=m(e),s=m(t);if(i&&!s||!i&&s)return!1;if(i)return e=a.call(e),t=a.call(t),v(e,t,r);var f,u,c=E(e),h=E(t);if(c.length!==h.length)return!1;for(c.sort(),h.sort(),u=c.length-1;u>=0;u--)if(c[u]!==h[u])return!1;for(u=c.length-1;u>=0;u--)if(f=c[u],!v(e[f],t[f],r,n))return!1;return!0}(e,t,r,s))}return r?e===t:e==t}function m(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&y(i,r,"Missing expected exception"+n);var s="string"==typeof n,a=!e&&i&&!r;if((!e&&o.isError(i)&&s&&w(i,r)||a)&&y(i,r,"Got unwanted exception"+n),e&&i&&r&&!w(i,r)||!e&&i)throw i}h.AssertionError=function(e){var t;this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=d(g((t=this).actual),128)+" "+t.operator+" "+d(g(t.expected),128),this.generatedMessage=!0);var r=e.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,o=p(r),s=i.indexOf("\n"+o);if(s>=0){var a=i.indexOf("\n",s+1);i=i.substring(a+1)}this.stack=i}}},o.inherits(h.AssertionError,Error),h.fail=y,h.ok=b,h.equal=function(e,t,r){e!=t&&y(e,t,r,"==",h.equal)},h.notEqual=function(e,t,r){e==t&&y(e,t,r,"!=",h.notEqual)},h.deepEqual=function(e,t,r){v(e,t,!1)||y(e,t,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,r){v(e,t,!0)||y(e,t,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,r){v(e,t,!1)&&y(e,t,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,r,n){v(t,r,!0)&&y(t,r,n,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,r){e!==t&&y(e,t,r,"===",h.strictEqual)},h.notStrictEqual=function(e,t,r){e===t&&y(e,t,r,"!==",h.notStrictEqua
/**
* @license
* https://github.com/bitcoincashjs/cashaddr
* Copyright (c) 2017-2018 Emilio Almansi
* Distributed under the MIT software license, see the accompanying
* file LICENSE or http://www.opensource.org/licenses/mit-license.php.
*/function n(e){var t=new Error;this.name=t.name="ValidationError",this.message=t.message=e,this.stack=t.stack}n.prototype=Object.create(Error.prototype),e.exports={ValidationError:n,validate:function(e,t){if(!e)throw new n(t)}}},function(e,t,r){"use strict";(function(n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=d(r(9)),o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=d(r(86)),f=r(18),u=r(19),c=d(r(56)),h=r(87),l=r(48),p=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(20));function d(e){return e&&e.__esModule?e:{default:e}}function g(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function y(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){return function n(i,o){try{var s=t[i](o),a=s.value}catch(e){return void r(e)}if(!s.done)return Promise.resolve(a).then(function(e){n("next",e)},function(e){n("throw",e)});e(a)}("next")})}}var b=function(e){function t(e,r,n,i,s){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));a.activityInProgress=!1,a.connected=!0,a.clearSession=!1,a.clearSessionTime=6e5,a.clearSessionTimeout=null,a.clearSessionFuture=0,a.rememberPlaintextPassphrase=!1,a.rememberedPlaintextPasshprase=null,a.passphraseState=null,a.integrityCheckingXpubPath=[(0,l.harden)(49),(0,l.harden)(0),(0,l.harden)(0)],a.integrityCheckingXpubNetwork=l.BITCOIN_COIN_INFO,a.disconnectEvent=new u.Event0("disconnect",a),a.buttonEvent=new u.Event1("button",a),a.errorEvent=new u.Event1("error",a),a.passphraseEvent=new u.Event1("passphrase",a),a.wordEvent=new u.Event1("word",a),a.changedSessionsEvent=new u.Event2("changedSessions",a),a.pinEvent=new u.Event2("pin",a),a.receiveEvent=new u.Event2("receive",a),a.sendEvent=new u.Event2("send",a),a._stolenEvent=new u.Event0("stolen",a);var f=n.major_version,c=n.minor_version,h=n.patch_version,p=n.bootloader_mode;return a.transport=e,a.originalDescriptor=r,a.deviceList=i,a.deviceList.options.clearSession&&(a.clearSession=!0,a.deviceList.options.clearSessionTime&&(a.clearSessionTime=a.deviceList.options.clearSessionTime)),a.deviceList.options.rememberDevicePassphrase&&(a.rememberPlaintextPassphrase=!0),a.features=o({},n,a.getVersions(f,c,h,p)),a.connected=!0,a.hasDebugLink=s,a._watch(),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,f.EventEmitter),s(t,[{key:"waitForSessionAndRun",value:function(e,t){var r=null==t?{}:t;return this.run(e,o({},r,{waiting:!0}))}},{key:"runAggressive",value:function(e,t){var r=null==t?{}:t;return this.run(e,o({},r,{aggressive:!0}))}},{key:"getVersions",value:function(e,t,r,n){return n?{bootloader_major_version:e,bootloader_minor_version:t,bootloader_patch_version:r,firmware_major_version:null,firmware_minor_version:null,firmware_patch_version:null}:{firmware_major_version:e,firmware_minor_version:t,firmware_patch_version:r,bootloader_major_version:null,bootloader_minor_version:null,bootloader_patch_version:null}}},{key:"run",value:function(e,r){var n=this;if(!this.connected)return Promise.reject(new Error("Device disconnected."));var i=null
/***
* @license
* https://github.com/bitcoincashjs/bchaddr
* Copyright (c) 2018 Emilio Almansi
* Distributed under the MIT software license, see the accompanying
* file LICENSE or http://www.opensource.org/licenses/mit-license.php.
*/
var n=r(29),i=r(175),o={Legacy:"legacy",Bitpay:"bitpay",Cashaddr:"cashaddr"},s={Mainnet:"mainnet",Testnet:"testnet"},a={};function f(e){return l(e).format}function u(e){return l(e).network}function c(e){return l(e).type}a.P2PKH="p2pkh",a.P2SH="p2sh";var h={};function l(e){try{return function(e){try{var t=n.decode(e);if(t.length!==p)throw new g;var r=t[0],i=Array.prototype.slice.call(t,1);switch(r){case h[o.Legacy][s.Mainnet][a.P2PKH]:return{hash:i,format:o.Legacy,network:s.Mainnet,type:a.P2PKH};case h[o.Legacy][s.Mainnet][a.P2SH]:return{hash:i,format:o.Legacy,network:s.Mainnet,type:a.P2SH};case h[o.Legacy][s.Testnet][a.P2PKH]:return{hash:i,format:o.Legacy,network:s.Testnet,type:a.P2PKH};case h[o.Legacy][s.Testnet][a.P2SH]:return{hash:i,format:o.Legacy,network:s.Testnet,type:a.P2SH};case h[o.Bitpay][s.Mainnet][a.P2PKH]:return{hash:i,format:o.Bitpay,network:s.Mainnet,type:a.P2PKH};case h[o.Bitpay][s.Mainnet][a.P2SH]:return{hash:i,format:o.Bitpay,network:s.Mainnet,type:a.P2SH}}}catch(e){}throw new g}(e)}catch(e){}try{return function(e){if(-1!==e.indexOf(":"))try{return d(e)}catch(e){}else for(var t=["bitcoincash","bchtest","regtest"],r=0;r<t.length;++r)try{var n=t[r];return d(n+":"+e)}catch(e){}throw new g}(e)}catch(e){}throw new g}h[o.Legacy]={},h[o.Legacy][s.Mainnet]={},h[o.Legacy][s.Mainnet][a.P2PKH]=0,h[o.Legacy][s.Mainnet][a.P2SH]=5,h[o.Legacy][s.Testnet]={},h[o.Legacy][s.Testnet][a.P2PKH]=111,h[o.Legacy][s.Testnet][a.P2SH]=196,h[o.Bitpay]={},h[o.Bitpay][s.Mainnet]={},h[o.Bitpay][s.Mainnet][a.P2PKH]=28,h[o.Bitpay][s.Mainnet][a.P2SH]=40,h[o.Bitpay][s.Testnet]={},h[o.Bitpay][s.Testnet][a.P2PKH]=111,h[o.Bitpay][s.Testnet][a.P2SH]=196;var p=21;function d(e){try{var t=i.decode(e),r=Array.prototype.slice.call(t.hash,0),n="P2PKH"===t.type?a.P2PKH:a.P2SH;switch(t.prefix){case"bitcoincash":return{hash:r,format:o.Cashaddr,network:s.Mainnet,type:n};case"bchtest":case"regtest":return{hash:r,format:o.Cashaddr,network:s.Testnet,type:n}}}catch(e){}throw new g}function g(){var e=new Error;this.name=e.name="InvalidAddressError",this.message=e.message="Received an invalid Bitcoin Cash address as input.",this.stack=e.stack}g.prototype=Object.create(Error.prototype),e.exports={Format:o,Network:s,Type:a,detectAddressFormat:f,detectAddressNetwork:u,detectAddressType:c,toLegacyAddress:function(e){var r=l(e);return r.format===o.Legacy?e:function(e){var r=h[o.Legacy][e.network][e.type],i=t.alloc(1+e.hash.length);return i[0]=r,i.set(e.hash,1),n.encode(i)}(r)},toBitpayAddress:function(e){var r=l(e);return r.format===o.Bitpay?e:function(e){var r=h[o.Bitpay][e.network][e.type],i=t.alloc(1+e.hash.length);return i[0]=r,i.set(e.hash,1),n.encode(i)}(r)},toCashAddress:function(e){return function(e){var t=e.network===s.Mainnet?"bitcoincash":"bchtest",r=e.type===a.P2PKH?"P2PKH":"P2SH",n=Uint8Array.from(e.hash);return i.encode(t,r,n)}(l(e))},isLegacyAddress:function(e){return f(e)===o.Legacy},isBitpayAddress:function(e){return f(e)===o.Bitpay},isCashAddress:function(e){return f(e)===o.Cashaddr},isMainnetAddress:function(e){return u(e)===s.Mainnet},isTestnetAddress:function(e){return u(e)===s.Testnet},isP2PKHAddress:function(e){return c(e)===a.P2PKH},isP2SHAddress:function(e){return c(e)===a.P2SH},InvalidAddressError:g}}).call(this,r(1).Buffer)},function(e,t,r){"use strict";
/**
* @license
* https://github.com/bitcoincashjs/cashaddr
* Copyright (c) 2017-2018 Emilio Almansi
* Distributed under the MIT software license, see the accompanying
* file LICENSE or http://www.opensource.org/licenses/mit-license.php.
*/var n=r(176),i=r(177),o=r(178),s=r(49),a=s.validate;var f=s.ValidationError,u=["bitcoincash","bchtest","bchreg"];function c(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;++r)t[r]=31&e[r].charCodeAt(0);return t}function h(e,t){var r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function l(e){for(var t=[656907472481,522768456162,0xf33e5fb3c4,748107326120,130178868336],r=i(1),n=0;n<e.length;++n){var o=e[n],s=r.shiftRight(35);r=r.and(34359738367).shiftLeft(5).xor(o);for(var a=0;a<t.length;++a)s.shiftRight(a).and(1).equals(1)&&(r=r.xor(t[a]))}return r.xor(1)}function p(e){return e===e.toLowerCase()||e===e.toUpperCase()}e.exports={encode:function(e,t,r){a("string"==typeof e&&function(e){return p(e)&&-1!==u.indexOf(e.toLowerCase())}(e),"Invalid prefix: "+e+"."),a("string"==typeof t,"Invalid type: "+t+"."),a(r instanceof Uint8Array,"Invalid hash: "+r+".");var i,s=h(c(e),new Uint8Array(1)),d=function(e){switch(e){case"P2PKH":return 0;case"P2SH":return 8;default:throw new f("Invalid type: "+e+".")}}(t)+function(e){switch(8*e.length){case 160:return 0;case 192:return 1;case 224:return 2;case 256:return 3;case 320:return 4;case 384:return 5;case 448:return 6;case 512:return 7;default:throw new f("Invalid hash size: "+e.length+".")}}(r),g=(i=h(Uint8Array.of(d),r),o(i,8,5)),y=h(h(s,g),new Uint8Array(8)),b=h(g,function(e){for(var t=new Uint8Array(8),r=0;r<8;++r)t[7-r]=e.and(31).toJSNumber(),e=e.shiftRight(5);return t}(l(y)));return e+":"+n.encode(b)},decode:function(e){a("string"==typeof e&&p(e),"Invalid address: "+e+".");var t=e.toLowerCase().split(":");a(2===t.length,"Missing prefix: "+e+".");var r=t[0],i=n.decode(t[1]);a(function(e,t){var r=h(c(e),new Uint8Array(1));return l(h(r,t)).equals(0)}(r,i),"Invalid checksum: "+e+".");var s,u=(s=i.slice(0,-8),o(s,5,8,!0)),d=u[0],g=u.slice(1);return a(function(e){switch(7&e){case 0:return 160;case 1:return 192;case 2:return 224;case 3:return 256;case 4:return 320;case 5:return 384;case 6:return 448;case 7:return 512}}(d)===8*g.length,"Invalid hash size: "+e+"."),{prefix:r,type:function(e){switch(120&e){case 0:return"P2PKH";case 8:return"P2SH";default:throw new f("Invalid address type in version byte: "+e+".")}}(d),hash:g}},ValidationError:f}},function(e,t,r){"use strict";
/**
* @license
* https://github.com/bitcoincashjs/cashaddr
* Copyright (c) 2017-2018 Emilio Almansi
* Distributed under the MIT software license, see the accompanying
* file LICENSE or http://www.opensource.org/licenses/mit-license.php.
*/var n=r(49).validate,i="qpzry9x8gf2tvdw0s3jn54khce6mua7l",o={q:0,p:1,z:2,r:3,y:4,9:5,x:6,8:7,g:8,f:9,2:10,t:11,v:12,d:13,w:14,0:15,s:16,3:17,j:18,n:19,5:20,4:21,k:22,h:23,c:24,e:25,6:26,m:27,u:28,a:29,7:30,l:31};e.exports={encode:function(e){n(e instanceof Uint8Array,"Invalid data: "+e+".");for(var t="",r=0;r<e.length;++r){var o=e[r];n(0<=o&&o<32,"Invalid value: "+o+"."),t+=i[o]}return t},decode:function(e){n("string"==typeof e,"Invalid base32-encoded string: "+e+".");for(var t=new Uint8Array(e.length),r=0;r<e.length;++r){var i=e[r];n(i in o,"Invalid value: "+i+"."),t[r]=o[i]}return t}}},function(e,t,r){(function(e){var r,n=function(e){"use strict";var t=1e7,r=7,i=9007199254740992,o=p(i),s="0123456789abcdefghijklmnopqrstuvwxyz",a="function"==typeof BigInt;function f(e,t,r,n){return void 0===e?f[0]:void 0!==t&&(10!=+t||r)?z(e,t,r,n):Z(e)}function u(e,t){this.value=e,this.sign=t,this.isSmall=!1}function c(e){this.value=e,this.sign=e<0,this.isSmall=!0}function h(e){this.value=e}function l(e){return-i<e&&e<i}function p(e){return e<1e7?[e]:e<1e14?[e%1e7,Math.floor(e/1e7)]:[e%1e7,Math.floor(e/1e7)%1e7,Math.floor(e/1e14)]}function d(e){g(e);var r=e.length;if(r<4&&k(e,o)<0)switch(r){case 0:return 0;case 1:return e[0];case 2:return e[0]+e[1]*t;default:return e[0]+(e[1]+e[2]*t)*t}return e}function g(e){for(var t=e.length;0===e[--t];);e.length=t+1}function y(e){for(var t=new Array(e),r=-1;++r<e;)t[r]=0;return t}function b(e){return e>0?Math.floor(e):Math.ceil(e)}function v(e,r){var n,i,o=e.length,s=r.length,a=new Array(o),f=0,u=t;for(i=0;i<s;i++)f=(n=e[i]+r[i]+f)>=u?1:0,a[i]=n-f*u;for(;i<o;)f=(n=e[i]+f)===u?1:0,a[i++]=n-f*u;return f>0&&a.push(f),a}function m(e,t){return e.length>=t.length?v(e,t):v(t,e)}function w(e,r){var n,i,o=e.length,s=new Array(o),a=t;for(i=0;i<o;i++)n=e[i]-a+r,r=Math.floor(n/a),s[i]=n-r*a,r+=1;for(;r>0;)s[i++]=r%a,r=Math.floor(r/a);return s}function _(e,r){var n,i,o=e.length,s=r.length,a=new Array(o),f=0,u=t;for(n=0;n<s;n++)(i=e[n]-f-r[n])<0?(i+=u,f=1):f=0,a[n]=i;for(n=s;n<o;n++){if(!((i=e[n]-f)<0)){a[n++]=i;break}i+=u,a[n]=i}for(;n<o;n++)a[n]=e[n];return g(a),a}function E(e,r,n){var i,o,s=e.length,a=new Array(s),f=-r,h=t;for(i=0;i<s;i++)o=e[i]+f,f=Math.floor(o/h),o%=h,a[i]=o<0?o+h:o;return"number"==typeof(a=d(a))?(n&&(a=-a),new c(a)):new u(a,n)}function A(e,r){var n,i,o,s,a=e.length,f=r.length,u=y(a+f),c=t;for(o=0;o<a;++o){s=e[o];for(var h=0;h<f;++h)n=s*r[h]+u[o+h],i=Math.floor(n/c),u[o+h]=n-i*c,u[o+h+1]+=i}return g(u),u}function I(e,r){var n,i,o=e.length,s=new Array(o),a=t,f=0;for(i=0;i<o;i++)n=e[i]*r+f,f=Math.floor(n/a),s[i]=n-f*a;for(;f>0;)s[i++]=f%a,f=Math.floor(f/a);return s}function S(e,t){for(var r=[];t-- >0;)r.push(0);return r.concat(e)}function T(e,r,n){return new u(e<t?I(r,e):A(r,p(e)),n)}function C(e){var r,n,i,o,s=e.length,a=y(s+s),f=t;for(i=0;i<s;i++){n=0-(o=e[i])*o;for(var u=i;u<s;u++)r=o*e[u]*2+a[i+u]+n,n=Math.floor(r/f),a[i+u]=r-n*f;a[i+s]=n}return g(a),a}function O(e,r){var n,i,o,s,a=e.length,f=y(a),u=t;for(o=0,n=a-1;n>=0;--n)o=(s=o*u+e[n])-(i=b(s/r))*r,f[n]=0|i;return[f,0|o]}function P(e,r){var n,i=Z(r);if(a)return[new h(e.value/i.value),new h(e.value%i.value)];var o,s=e.value,l=i.value;if(0===l)throw new Error("Cannot divide by zero");if(e.isSmall)return i.isSmall?[new c(b(s/l)),new c(s%l)]:[f[0],e];if(i.isSmall){if(1===l)return[e,f[0]];if(-1==l)return[e.negate(),f[0]];var v=Math.abs(l);if(v<t){o=d((n=O(s,v))[0]);var m=n[1];return e.sign&&(m=-m),"number"==typeof o?(e.sign!==i.sign&&(o=-o),[new c(o),new c(m)]):[new u(o,e.sign!==i.sign),new c(m)]}l=p(v)}var w=k(s,l);if(-1===w)return[f[0],e];if(0===w)return[f[e.sign===i.sign?1:-1],f[0]];o=(n=s.length+l.length<=200?function(e,r){var n,i,o,s,a,f,u,c=e.length,h=r.length,l=t,p=y(r.length),g=r[h-1],b=Math.ceil(l/(2*g)),v=I(e,b),m=I(r,b);for(v.length<=c&&v.push(0),m.push(0),g=m[h-1],i=c-h;i>=0;i--){for(n=l-1,v[i+h]!==g&&(n=Math.floor((v[i+h]*l+v[i+h-1])/g)),o=0,s=0,f=m.length,a=0;a<f;a++)o+=n*m[a],u=Math.floor(o/l),s+=v[i+a]-(o-u*l),o=u,s<0?(v[i+a]=s+l,s=-1):(v[i+a]=s,s=0);for(;0!==s;){for(n-=1,o=0,a=0;a<f;a++)(o+=v[i+a]-l+m[a])<0?(v[i+a]=o+l,o=
/**
* @license ProtoBuf.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
* Released under the Apache License, Version 2.0
* see: https://github.com/dcodeIO/ProtoBuf.js for details
*/
!function(t){"use strict";var n,i;e.exports=(n=r(189),(i={VERSION:"3.8.2",WIRE_TYPES:{}}).WIRE_TYPES.VARINT=0,i.WIRE_TYPES.BITS64=1,i.WIRE_TYPES.LDELIM=2,i.WIRE_TYPES.STARTGROUP=3,i.WIRE_TYPES.ENDGROUP=4,i.WIRE_TYPES.BITS32=5,i.PACKABLE_WIRE_TYPES=[i.WIRE_TYPES.VARINT,i.WIRE_TYPES.BITS64,i.WIRE_TYPES.BITS32],i.TYPES={int32:{name:"int32",wireType:i.WIRE_TYPES.VARINT},uint32:{name:"uint32",wireType:i.WIRE_TYPES.VARINT},sint32:{name:"sint32",wireType:i.WIRE_TYPES.VARINT},int64:{name:"int64",wireType:i.WIRE_TYPES.VARINT},uint64:{name:"uint64",wireType:i.WIRE_TYPES.VARINT},sint64:{name:"sint64",wireType:i.WIRE_TYPES.VARINT},bool:{name:"bool",wireType:i.WIRE_TYPES.VARINT},double:{name:"double",wireType:i.WIRE_TYPES.BITS64},string:{name:"string",wireType:i.WIRE_TYPES.LDELIM},bytes:{name:"bytes",wireType:i.WIRE_TYPES.LDELIM},fixed32:{name:"fixed32",wireType:i.WIRE_TYPES.BITS32},sfixed32:{name:"sfixed32",wireType:i.WIRE_TYPES.BITS32},fixed64:{name:"fixed64",wireType:i.WIRE_TYPES.BITS64},sfixed64:{name:"sfixed64",wireType:i.WIRE_TYPES.BITS64},float:{name:"float",wireType:i.WIRE_TYPES.BITS32},enum:{name:"enum",wireType:i.WIRE_TYPES.VARINT},message:{name:"message",wireType:i.WIRE_TYPES.LDELIM},group:{name:"group",wireType:i.WIRE_TYPES.STARTGROUP}},i.ID_MIN=1,i.ID_MAX=536870911,i.ByteBuffer=n,i.Long=n.Long||null,i.convertFieldsToCamelCase=!1,i.populateAccessors=!0,i.Util=function(){Object.create||(Object.create=function(e){if(arguments.length>1)throw Error("Object.create polyfill only accepts the first parameter.");function t(){}return t.prototype=e,new t});var e={IS_NODE:!1,XHR:function(){for(var e=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],t=null,r=0;r<e.length;r++){try{t=e[r]()}catch(e){continue}break}if(!t)throw Error("XMLHttpRequest is not supported");return t},fetch:function(t,r){if(r&&"function"!=typeof r&&(r=null),e.IS_NODE);else{var n=e.XHR();if(n.open("GET",t,!!r),n.setRequestHeader("Accept","text/plain"),"function"==typeof n.overrideMimeType&&n.overrideMimeType("text/plain"),!r)return n.send(null),200==n.status||0==n.status&&"string"==typeof n.responseText?n.responseText:null;if(n.onreadystatechange=function(){4==n.readyState&&(200==n.status||0==n.status&&"string"==typeof n.responseText?r(n.responseText):r(null))},4==n.readyState)return;n.send(null)}}};return e.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},e}(),i.Lang={OPEN:"{",CLOSE:"}",OPTOPEN:"[",OPTCLOSE:"]",OPTEND:",",EQUAL:"=",END:";",STRINGOPEN:'"',STRINGCLOSE:'"',STRINGOPEN_SQ:"'",STRINGCLOSE_SQ:"'",COPTOPEN:"(",COPTCLOSE:")",DELIM:/[\s\{\}=;\[\],'"\(\)]/g,RULE:/^(?:required|optional|repeated)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+|([0-9]*\.[0-9]+([Ee][+-]?[0-9]+)?))$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0x[0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^[0-9]*\.[0-9]+([Ee][+-]?[0-9]+)?$/,ID:/^(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,BOOL:/^(?:true|false)$/i},i.DotProto=function(e,t){var r={},n=function(e){this.source=""+e,this.index=0,this.line=1,this.stack=[],this.readingString=!1,this.stringEndsWith=t.STRINGCLOSE},i=n.prototype;i._readString=function(){var e;if(t.STRING.lastIndex=this.index-1,null!==(e=t.STRING.exec(this.source))){var r=void 0!==e[1]?e[1]:e[2];return this.index=t.STRING.lastIndex,this.stack.push(this.stringEndsWith),r}throw Error("Unterminated string at line "+this.line+", index "+this.index)},i.next=function(){if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return nul
/**
* @license ByteBuffer.js (c) 2013-2014 Daniel Wirtz <dcode@dcode.io>
* This version of ByteBuffer.js uses an ArrayBuffer as its backing buffer which is accessed through a DataView and is
* compatible with modern browsers.
* Released under the Apache License, Version 2.0
* see: https://github.com/dcodeIO/ByteBuffer.js for details
*/
!function(t){"use strict";e.exports=function(){var e;try{e=r(190)}catch(e){}return function(e){var t=function(e,r,i){if(void 0===e&&(e=t.DEFAULT_CAPACITY),void 0===r&&(r=t.DEFAULT_ENDIAN),void 0===i&&(i=t.DEFAULT_NOASSERT),!i){if((e|=0)<0)throw RangeError("Illegal capacity");r=!!r,i=!!i}this.buffer=0===e?n:new ArrayBuffer(e),this.view=0===e?null:new DataView(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=void 0!==r&&!!r,this.noAssert=!!i};t.VERSION="3.5.5",t.LITTLE_ENDIAN=!0,t.BIG_ENDIAN=!1,t.DEFAULT_CAPACITY=16,t.DEFAULT_ENDIAN=t.BIG_ENDIAN,t.DEFAULT_NOASSERT=!1,t.Long=e||null;var r=t.prototype,n=new ArrayBuffer(0),o=String.fromCharCode;function s(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function a(){var e=[],t=[];return function(){if(0===arguments.length)return t.join("")+o.apply(String,e);e.length+arguments.length>1024&&(t.push(o.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments)}}t.allocate=function(e,r,n){return new t(e,r,n)},t.concat=function(e,r,n,i){"boolean"!=typeof r&&"string"==typeof r||(i=n,n=r,r=void 0);for(var o,s=0,a=0,f=e.length;a<f;++a)t.isByteBuffer(e[a])||(e[a]=t.wrap(e[a],r)),(o=e[a].limit-e[a].offset)>0&&(s+=o);if(0===s)return new t(0,n,i);var u,c=new t(s,n,i),h=new Uint8Array(c.buffer);for(a=0;a<f;)(o=(u=e[a++]).limit-u.offset)<=0||(h.set(new Uint8Array(u.buffer).subarray(u.offset,u.limit),c.offset),c.offset+=o);return c.limit=c.offset,c.offset=0,c},t.isByteBuffer=function(e){return!0===(e&&e instanceof t)},t.type=function(){return ArrayBuffer},t.wrap=function(e,n,o,s){if("string"!=typeof n&&(s=o,o=n,n=void 0),"string"==typeof e)switch(void 0===n&&(n="utf8"),n){case"base64":return t.fromBase64(e,o);case"hex":return t.fromHex(e,o);case"binary":return t.fromBinary(e,o);case"utf8":return t.fromUTF8(e,o);case"debug":return t.fromDebug(e,o);default:throw Error("Unsupported encoding: "+n)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");var a;if(t.isByteBuffer(e))return(a=r.clone.call(e)).markedOffset=-1,a;if(e instanceof Uint8Array)a=new t(0,o,s),e.length>0&&(a.buffer=e.buffer,a.offset=e.byteOffset,a.limit=e.byteOffset+e.length,a.view=e.length>0?new DataView(e.buffer):null);else if(e instanceof ArrayBuffer)a=new t(0,o,s),e.byteLength>0&&(a.buffer=e,a.offset=0,a.limit=e.byteLength,a.view=e.byteLength>0?new DataView(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");for((a=new t(e.length,o,s)).limit=e.length,i=0;i<e.length;++i)a.view.setUint8(i,e[i])}return a},r.writeInt8=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=1,this.view.setInt8(t,e),r&&(this.offset+=1),this},r.writeByte=r.writeInt8,r.readInt8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r=this.view.getInt8(e);return t&&(this.offset+=1),r},r.readByte=r.readInt8,r.writeUint8=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=1,this.view.setUint8(t,e),r&&(this.offset+=1),this},r.readUint8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw Ty
/**
* @license Long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
* Released under the Apache License, Version 2.0
* see: https://github.com/dcodeIO/Long.js for details
*/i=[],void 0===(o="function"==typeof(n=function(){"use strict";function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}e.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=function(e){return!0===(e&&e.__isLong__)};var t={},r={};e.fromInt=function(n,i){var o,s;return i?0<=(n>>>=0)&&n<256&&(s=r[n])?s:(o=new e(n,(0|n)<0?-1:0,!0),0<=n&&n<256&&(r[n]=o),o):-128<=(n|=0)&&n<128&&(s=t[n])?s:(o=new e(n,n<0?-1:0,!1),-128<=n&&n<128&&(t[n]=o),o)},e.fromNumber=function(t,r){return r=!!r,isNaN(t)||!isFinite(t)?e.ZERO:!r&&t<=-o?e.MIN_VALUE:!r&&t+1>=o?e.MAX_VALUE:r&&t>=i?e.MAX_UNSIGNED_VALUE:t<0?e.fromNumber(-t,r).negate():new e(t%n|0,t/n|0,r)},e.fromBits=function(t,r,n){return new e(t,r,n)},e.fromString=function(t,r,n){if(0===t.length)throw Error("number format error: empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return e.ZERO;if("number"==typeof r&&(n=r,r=!1),(n=n||10)<2||36<n)throw Error("radix out of range: "+n);var i;if((i=t.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+t);if(0===i)return e.fromString(t.substring(1),r,n).negate();for(var o=e.fromNumber(Math.pow(n,8)),s=e.ZERO,a=0;a<t.length;a+=8){var f=Math.min(8,t.length-a),u=parseInt(t.substring(a,a+f),n);if(f<8){var c=e.fromNumber(Math.pow(n,f));s=s.multiply(c).add(e.fromNumber(u))}else s=(s=s.multiply(o)).add(e.fromNumber(u))}return s.unsigned=r,s},e.fromValue=function(t){return t instanceof e?t:"number"==typeof t?e.fromNumber(t):"string"==typeof t?e.fromString(t):new e(t.low,t.high,t.unsigned)};var n=4294967296,i=n*n,o=i/2,s=e.fromInt(1<<24);return e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*n+(this.low>>>0):this.high*n+(this.low>>>0)},e.prototype.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix out of range: "+t);if(this.isZero())return"0";var r;if(this.isNegative()){if(this.equals(e.MIN_VALUE)){var n=e.fromNumber(t),i=this.divide(n);return r=i.multiply(n).subtract(this),i.toString(t)+r.toInt().toString(t)}return"-"+this.negate().toString(t)}var o=e.fromNumber(Math.pow(t,6),this.unsigned);r=this;for(var s="";;){var a=r.divide(o),f=(r.subtract(a.multiply(o)).toInt()>>>0).toString(t);if((r=a).isZero())return f+s;for(;f.length<6;)f="0"+f;s=""+f+s}},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(e.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,r=31;r>0&&0==(t&1<<r);r--);return 0!=this.high?r+33:r+1},e.prototype.isZero=function(){return 0===this.high&&0===this.low},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isOdd=function(){return 1==(1&this.low)},e.prototype.isEven=function(){return 0==(1&this.low)},e.prototype.equals=function(t){return e.isLong(t)||(t=e.fromValue(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},e.eq=e.prototype.equals,e.prototype.notEquals=function(e){return!this.equals(e)},e.neq=e.prototype.notEquals,e.prototype.lessThan=function(e){return this.compare(e)<0},e.prototype.lt=e.prototype.lessThan,e.prototype.lessThanOrEqual=function(e){return this.compare(e)<=0},e.prototype.lte=e.prototype.lessThanOrEqual,e.prototype.greaterThan=function(e){return this.compare(e)>0},e.prototype.gt=e.prototype.greaterThan,e.prototype.greaterThanOrEqual=function(e){return this.compare(e)>=0},e.prototype.gte=e.prototype.greaterThanOrEqual,e.prototype.compar
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly90cmV6b3IuanMtdW1kL3dlYnBhY2svdW5pdmVyc2FsTW9kdWxlRGVmaW5pdGlvbiIsIndlYnBhY2s6Ly90cmV6b3IuanMtdW1kL3dlYnBhY2svYm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