From c4c8cbd03434003202494ee7475e57f259fd082f Mon Sep 17 00:00:00 2001 From: Peter Hu Date: Thu, 18 Apr 2019 06:48:08 +0800 Subject: [PATCH 1/8] change testing --- example/account.js | 5 ++++- example/index.html | 2 +- example/many2many.js | 3 ++- example/one2many.js | 3 ++- package.json | 7 ++++--- test/config.js | 4 ++++ test/qosweb.spec.js | 43 +++++++++++++++++++++++++++++++++---------- 7 files changed, 50 insertions(+), 17 deletions(-) create mode 100644 test/config.js diff --git a/example/account.js b/example/account.js index 9daef2a..38fedfe 100644 --- a/example/account.js +++ b/example/account.js @@ -1,5 +1,8 @@ -const qweb = new QWeb({ chainId: 'qos-test', baseUrl: 'http://192.168.1.223:1317' }) +const baseUrl = "http://qmoonapi.qoschain.info" +const qweb = new QWeb({ chainId: "capricorn-2000", baseUrl: baseUrl }) + +//const qweb = new QWeb({ chainId: 'qos-test', baseUrl: 'http://192.168.1.223:1317' }) const newAccount = qweb.newAccount() console.log('--------------------------------------') diff --git a/example/index.html b/example/index.html index c5bd06c..3da35b2 100644 --- a/example/index.html +++ b/example/index.html @@ -11,7 +11,7 @@ - + \ No newline at end of file diff --git a/example/many2many.js b/example/many2many.js index 2d61c49..7e96c55 100644 --- a/example/many2many.js +++ b/example/many2many.js @@ -1,6 +1,7 @@ // import QWeb from '../src/qweb' -const qweb = new QWeb({ chainId: 'qos-test', baseUrl: 'http://192.168.1.223:1317' }) +const baseUrl = "http://qmoonapi.qoschain.info" +const qweb = new QWeb({ chainId: "capricorn-2000", baseUrl: baseUrl }) qweb.account.get('addr1').then(res=>{ diff --git a/example/one2many.js b/example/one2many.js index 5d02325..c323513 100644 --- a/example/one2many.js +++ b/example/one2many.js @@ -1,6 +1,7 @@ // import QWeb from '../src/qweb' -const qweb = new QWeb({ chainId: 'capricorn-1000', baseUrl: 'http://106.14.178.99:1317' }) +const baseUrl = "http://qmoonapi.qoschain.info" +const qweb = new QWeb({ chainId: "capricorn-2000", baseUrl: baseUrl }) const promise = qweb.tx.from([ { diff --git a/package.json b/package.json index f07e191..d7dfeb6 100644 --- a/package.json +++ b/package.json @@ -48,18 +48,19 @@ }, "dependencies": { "axios": "^0.18.0", + "babel-runtime": "^6.26.0", "bech32": "^1.1.3", "bip39": "^2.5.0", "ed25519-hd-key": "^0.5.0", "exports-loader": "^0.7.0", "imports-loader": "^0.8.0", "int53": "^0.2.4", + "js-amino": "^1.0.0", "js-sha256": "^0.9.0", + "nanoseconds": "^1.0.1", "signed-varint": "^2.0.1", "tweetnacl": "^1.0.0", "tweetnacl-util": "^0.15.0", - "varint": "^5.0.0", - "nanoseconds": "^1.0.1", - "babel-runtime": "^6.26.0" + "varint": "^5.0.0" } } diff --git a/test/config.js b/test/config.js new file mode 100644 index 0000000..f25086b --- /dev/null +++ b/test/config.js @@ -0,0 +1,4 @@ +export default { + chainId:'capricorn-2000', + APINode: 'http://qmoonapi.qoschain.info' +} \ No newline at end of file diff --git a/test/qosweb.spec.js b/test/qosweb.spec.js index 48c0969..3881c5e 100644 --- a/test/qosweb.spec.js +++ b/test/qosweb.spec.js @@ -1,20 +1,43 @@ -import QOSWeb from '../src' -import defaultConfig from '../src/config' +import QWeb from '../src/qweb' +import testConfig from './config' const expect = chai.expect describe('[create the qosweb]', ()=>{ it('create with default config', ()=>{ - const qosweb = new QOSWeb() - expect(qosweb).not.null - expect(qosweb.config.chainId).to.equal(defaultConfig.chainId) - expect(qosweb.config.HTTPAPINode).to.equal(defaultConfig.HTTPAPINode) + const qweb = new QWeb({ chainId: testConfig.chainId, baseUrl: testConfig.APINode }) + expect(qweb).not.null + expect(qweb.chainId).to.equal(testConfig.chainId) + expect(qweb.baseUrl).to.equal(testConfig.APINode) }) }) -describe('[validation for account]', ()=>{ - it('is valid account?', ()=>{ - const qosweb = new QOSWeb() - expect(qosweb.isValidAccount('adress0000')).to.equal(true) +describe('[account]', ()=>{ + it('create the new account', ()=>{ + const qweb = new QWeb({ chainId: testConfig.chainId, baseUrl: testConfig.APINode }) + const newAccount = qweb.newAccount() + expect(newAccount).not.null + expect(newAccount.address).not.null + expect(newAccount.privateKey).not.null + expect(newAccount.publicKey).not.null + expect(newAccount.mnemonic).not.null + console.log('----- New Account -----') + console.log(`Account Address:\t${newAccount.address}`) + console.log(`Private Key:\t${newAccount.privateKey}`) + console.log(`Public Key:\t${newAccount.publicKey}`) + console.log(`Mnemonic Words:\t${newAccount.mnemonic}`) }) + + it('get the account by private key', ()=>{ + const qweb = new QWeb({ chainId: testConfig.chainId, baseUrl: testConfig.APINode }) + const newAccount = qweb.newAccount() + + const targetAccount = qweb.recoveryAccountByPrivateKey(newAccount.privateKey) + expect(targetAccount.address).to.equal(newAccount.address) + expect(targetAccount.privateKey).to.equal(newAccount.privateKey) + expect(targetAccount.publicKey).to.equal(newAccount.publicKey) + expect(targetAccount.mnemonic).to.equal(newAccount.mnemonic) + }) + + }) \ No newline at end of file From 0bcb36457eed3aa0845a3b5ef7ab04247984098e Mon Sep 17 00:00:00 2001 From: Peter Hu Date: Tue, 14 May 2019 11:43:31 +0800 Subject: [PATCH 2/8] add amino add amino --- build/webpack.base.conf.js | 2 +- dist/cmjs/model/tx.js | 2 +- dist/cmjs/model/types.js | 2 +- dist/qweb.js | 19 +- src/lib/Js-Amino/.gitignore | 1 - src/lib/Js-Amino/package.json | 27 --- src/lib/Js-Amino/readme.md | 19 -- src/lib/Js-Amino/src/binaryDecoder.js | 83 ------- src/lib/Js-Amino/src/binaryEncoder.js | 202 ------------------ src/lib/Js-Amino/src/codec.js | 140 ------------ src/lib/Js-Amino/src/decoder.js | 108 ---------- src/lib/Js-Amino/src/encoder.js | 118 ---------- src/lib/Js-Amino/src/examples/byteSlice.js | 99 --------- .../Js-Amino/src/examples/interfaceTest.go | 188 ---------------- .../Js-Amino/src/examples/interfaceTest.js | 48 ----- .../Js-Amino/src/examples/recursive_obj.go | 53 ----- .../Js-Amino/src/examples/recursive_obj.js | 107 ---------- src/lib/Js-Amino/src/examples/slice_bugs.go | 91 -------- src/lib/Js-Amino/src/examples/slice_bugs.js | 162 -------------- src/lib/Js-Amino/src/examples/string.go | 38 ---- src/lib/Js-Amino/src/examples/string.js | 46 ---- src/lib/Js-Amino/src/examples/time.go | 45 ---- src/lib/Js-Amino/src/examples/time.js | 27 --- src/lib/Js-Amino/src/index.js | 18 -- src/lib/Js-Amino/src/jsonDecoder.js | 101 --------- src/lib/Js-Amino/src/jsonEncoder.js | 133 ------------ src/lib/Js-Amino/src/reflect.js | 70 ------ src/lib/Js-Amino/src/registeredType.js | 87 -------- src/lib/Js-Amino/src/typeFactory.js | 168 --------------- src/lib/Js-Amino/src/types.js | 63 ------ src/lib/Js-Amino/src/utils.js | 100 --------- src/lib/Js-Amino/test/go.mod | 6 - src/lib/Js-Amino/test/go.sum | 4 - src/lib/Js-Amino/test/main/main.go | 10 - src/lib/Js-Amino/test/primitive.go | 41 ---- src/lib/Js-Amino/test/primitive.js | 105 --------- src/lib/Js-Amino/test/readme.md | 3 - src/lib/Js-Amino/test/struct.go | 72 ------- src/lib/Js-Amino/test/struct.js | 88 -------- src/lib/Js-Amino/test/util.js | 15 -- src/model/tx.js | 2 +- src/model/types.js | 2 +- test/qosweb.spec.js | 6 +- 43 files changed, 22 insertions(+), 2699 deletions(-) delete mode 100644 src/lib/Js-Amino/.gitignore delete mode 100644 src/lib/Js-Amino/package.json delete mode 100644 src/lib/Js-Amino/readme.md delete mode 100644 src/lib/Js-Amino/src/binaryDecoder.js delete mode 100644 src/lib/Js-Amino/src/binaryEncoder.js delete mode 100644 src/lib/Js-Amino/src/codec.js delete mode 100644 src/lib/Js-Amino/src/decoder.js delete mode 100644 src/lib/Js-Amino/src/encoder.js delete mode 100644 src/lib/Js-Amino/src/examples/byteSlice.js delete mode 100644 src/lib/Js-Amino/src/examples/interfaceTest.go delete mode 100644 src/lib/Js-Amino/src/examples/interfaceTest.js delete mode 100644 src/lib/Js-Amino/src/examples/recursive_obj.go delete mode 100644 src/lib/Js-Amino/src/examples/recursive_obj.js delete mode 100644 src/lib/Js-Amino/src/examples/slice_bugs.go delete mode 100644 src/lib/Js-Amino/src/examples/slice_bugs.js delete mode 100644 src/lib/Js-Amino/src/examples/string.go delete mode 100644 src/lib/Js-Amino/src/examples/string.js delete mode 100644 src/lib/Js-Amino/src/examples/time.go delete mode 100644 src/lib/Js-Amino/src/examples/time.js delete mode 100644 src/lib/Js-Amino/src/index.js delete mode 100644 src/lib/Js-Amino/src/jsonDecoder.js delete mode 100644 src/lib/Js-Amino/src/jsonEncoder.js delete mode 100644 src/lib/Js-Amino/src/reflect.js delete mode 100755 src/lib/Js-Amino/src/registeredType.js delete mode 100644 src/lib/Js-Amino/src/typeFactory.js delete mode 100644 src/lib/Js-Amino/src/types.js delete mode 100644 src/lib/Js-Amino/src/utils.js delete mode 100644 src/lib/Js-Amino/test/go.mod delete mode 100644 src/lib/Js-Amino/test/go.sum delete mode 100644 src/lib/Js-Amino/test/main/main.go delete mode 100644 src/lib/Js-Amino/test/primitive.go delete mode 100644 src/lib/Js-Amino/test/primitive.js delete mode 100644 src/lib/Js-Amino/test/readme.md delete mode 100644 src/lib/Js-Amino/test/struct.go delete mode 100644 src/lib/Js-Amino/test/struct.js delete mode 100644 src/lib/Js-Amino/test/util.js diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js index 1d85daa..7245ce9 100644 --- a/build/webpack.base.conf.js +++ b/build/webpack.base.conf.js @@ -22,7 +22,7 @@ module.exports = { // ['es2015', { modules: false }] // ], // }, - include: [resolve('src'), resolve('test')], + include: [resolve('src'), resolve('test'), resolve('node_modules/js-amino'),], // exclude: [ // resolve('src/lib/Js-Amino') // ] diff --git a/dist/cmjs/model/tx.js b/dist/cmjs/model/tx.js index 5d712da..a88cc66 100644 --- a/dist/cmjs/model/tx.js +++ b/dist/cmjs/model/tx.js @@ -34,7 +34,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons var bech32 = require('bech32'); -var _require = require('../lib/Js-Amino/src/index'), +var _require = require('js-amino'), Codec = _require.Codec; var PubKeyEd25519 = _types2.default.PubKeyEd25519, diff --git a/dist/cmjs/model/types.js b/dist/cmjs/model/types.js index 9e315fe..7624a19 100644 --- a/dist/cmjs/model/types.js +++ b/dist/cmjs/model/types.js @@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _require = require('../lib/Js-Amino/src'), +var _require = require('js-amino'), TypeFactory = _require.TypeFactory, Types = _require.Types; diff --git a/dist/qweb.js b/dist/qweb.js index 6bc6eaa..7dbf363 100644 --- a/dist/qweb.js +++ b/dist/qweb.js @@ -1,11 +1,11 @@ -!function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}__webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{enumerable:!0,get:getter})},__webpack_require__.r=function(exports){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.t=function(value,mode){if(1&mode&&(value=__webpack_require__(value)),8&mode)return value;if(4&mode&&"object"==typeof value&&value&&value.__esModule)return value;var ns=Object.create(null);if(__webpack_require__.r(ns),Object.defineProperty(ns,"default",{enumerable:!0,value:value}),2&mode&&"string"!=typeof value)for(var key in value)__webpack_require__.d(ns,key,function(key){return value[key]}.bind(null,key));return ns},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module.default}:function getModuleExports(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=50)}([function(module,exports,__webpack_require__){var buffer=__webpack_require__(5),Buffer=buffer.Buffer;function copyProps(src,dst){for(var key in src)dst[key]=src[key]}function SafeBuffer(arg,encodingOrOffset,length){return Buffer(arg,encodingOrOffset,length)}Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow?module.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer),copyProps(Buffer,SafeBuffer),SafeBuffer.from=function(arg,encodingOrOffset,length){if("number"==typeof arg)throw new TypeError("Argument must not be a number");return Buffer(arg,encodingOrOffset,length)},SafeBuffer.alloc=function(size,fill,encoding){if("number"!=typeof size)throw new TypeError("Argument must be a number");var buf=Buffer(size);return void 0!==fill?"string"==typeof encoding?buf.fill(fill,encoding):buf.fill(fill):buf.fill(0),buf},SafeBuffer.allocUnsafe=function(size){if("number"!=typeof size)throw new TypeError("Argument must be a number");return Buffer(size)},SafeBuffer.allocUnsafeSlow=function(size){if("number"!=typeof size)throw new TypeError("Argument must be a number");return buffer.SlowBuffer(size)}},function(module,exports){"function"==typeof Object.create?module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}},function(module,exports,__webpack_require__){"use strict";var bind=__webpack_require__(41),isBuffer=__webpack_require__(88),toString=Object.prototype.toString;function isArray(val){return"[object Array]"===toString.call(val)}function isObject(val){return null!==val&&"object"==typeof val}function isFunction(val){return"[object Function]"===toString.call(val)}function forEach(obj,fn){if(null!=obj)if("object"!=typeof obj&&(obj=[obj]),isArray(obj))for(var i=0,l=obj.length;i * @license MIT */ -var base64=__webpack_require__(53),ieee754=__webpack_require__(54),isArray=__webpack_require__(22);function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(that,length){if(kMaxLength()=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|length}function byteLength(string,encoding){if(Buffer.isBuffer(string))return string.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer))return string.byteLength;"string"!=typeof string&&(string=""+string);var len=string.length;if(0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case void 0:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*len;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase(),loweredCase=!0}}function swap(b,n,m){var i=b[n];b[n]=b[m],b[m]=i}function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;if("string"==typeof byteOffset?(encoding=byteOffset,byteOffset=0):2147483647=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(byteOffset<0){if(!dir)return-1;byteOffset=0}if("string"==typeof val&&(val=Buffer.from(val,encoding)),Buffer.isBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"==typeof val)return val&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?dir?Uint8Array.prototype.indexOf.call(buffer,val,byteOffset):Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset):arrayIndexOf(buffer,[val],byteOffset,encoding,dir);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){var i,indexSize=1,arrLength=arr.length,valLength=val.length;if(void 0!==encoding&&("ucs2"===(encoding=String(encoding).toLowerCase())||"ucs-2"===encoding||"utf16le"===encoding||"utf-16le"===encoding)){if(arr.length<2||val.length<2)return-1;arrLength/=indexSize=2,valLength/=2,byteOffset/=2}function read(buf,i){return 1===indexSize?buf[i]:buf.readUInt16BE(i*indexSize)}if(dir){var foundIndex=-1;for(i=byteOffset;i>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}(string,buf.length-offset),buf,offset,length)}function base64Slice(buf,start,end){return 0===start&&end===buf.length?base64.fromByteArray(buf):base64.fromByteArray(buf.slice(start,end))}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);for(var res=[],i=start;i>>10&1023|55296),codePoint=56320|1023&codePoint),res.push(codePoint),i+=bytesPerSequence}return function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,codePoints);var res="",i=0;for(;ithis.length)return"";if((void 0===end||end>this.length)&&(end=this.length),end<=0)return"";if((end>>>=0)<=(start>>>=0))return"";for(encoding||(encoding="utf8");;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0}}.apply(this,arguments)},Buffer.prototype.equals=function equals(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b||0===Buffer.compare(this,b)},Buffer.prototype.inspect=function inspect(){var str="",max=exports.INSPECT_MAX_BYTES;return 0max&&(str+=" ... ")),""},Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target))throw new TypeError("Argument must be a Buffer");if(void 0===start&&(start=0),void 0===end&&(end=target?target.length:0),void 0===thisStart&&(thisStart=0),void 0===thisEnd&&(thisEnd=this.length),start<0||end>target.length||thisStart<0||thisEnd>this.length)throw new RangeError("out of range index");if(thisEnd<=thisStart&&end<=start)return 0;if(thisEnd<=thisStart)return-1;if(end<=start)return 1;if(this===target)return 0;for(var x=(thisEnd>>>=0)-(thisStart>>>=0),y=(end>>>=0)-(start>>>=0),len=Math.min(x,y),thisCopy=this.slice(thisStart,thisEnd),targetCopy=target.slice(start,end),i=0;ithis.length)throw new RangeError("Attempt to write outside buffer bounds");encoding||(encoding="utf8");for(var loweredCase=!1;;)switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase(),loweredCase=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;ibuf.length)throw new RangeError("Index out of range")}function objectWriteUInt16(buf,value,offset,littleEndian){value<0&&(value=65535+value+1);for(var i=0,j=Math.min(buf.length-offset,2);i>>8*(littleEndian?i:1-i)}function objectWriteUInt32(buf,value,offset,littleEndian){value<0&&(value=4294967295+value+1);for(var i=0,j=Math.min(buf.length-offset,4);i>>8*(littleEndian?i:3-i)&255}function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,0,offset,4),ieee754.write(buf,value,offset,littleEndian,23,4),offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,0,offset,8),ieee754.write(buf,value,offset,littleEndian,52,8),offset+8}Buffer.prototype.slice=function slice(start,end){var newBuf,len=this.length;if((start=~~start)<0?(start+=len)<0&&(start=0):len>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=255&value):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0,mul=1,sub=0;for(this[offset]=255&value;++i>0)-sub&255;return offset+byteLength},Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1,mul=1,sub=0;for(this[offset+i]=255&value;0<=--i&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i+1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),value<0&&(value=255+value+1),this[offset]=255&value,offset+1},Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),value<0&&(value=4294967295+value+1),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function copy(target,targetStart,start,end){if(start||(start=0),end||0===end||(end=this.length),targetStart>=target.length&&(targetStart=target.length),targetStart||(targetStart=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-targetStart>>=0,end=void 0===end?this.length:end>>>0,val||(val=0),"number"==typeof val)for(i=start;i>6|192,63&codePoint|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,63&codePoint|128)}else{if(!(codePoint<1114112))throw new Error("Invalid code point");if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,63&codePoint|128)}}return bytes}function base64ToBytes(str){return base64.toByteArray(function base64clean(str){if((str=function stringtrim(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}(str).replace(INVALID_BASE64_RE,"")).length<2)return"";for(;str.length%4!=0;)str+="=";return str}(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}}).call(this,__webpack_require__(6))},function(module,exports){var g;g=function(){return this}();try{g=g||Function("return this")()||eval("this")}catch(e){"object"==typeof window&&(g=window)}module.exports=g},function(module,exports,__webpack_require__){"use strict";var pna=__webpack_require__(12),objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys};module.exports=Duplex;var util=__webpack_require__(10);util.inherits=__webpack_require__(1);var Readable=__webpack_require__(30),Writable=__webpack_require__(16);util.inherits(Duplex,Readable);for(var keys=objectKeys(Writable.prototype),v=0;v=this._finalSize&&(this._update(this._block),this._block.fill(0));var bits=8*this._len;if(bits<=4294967295)this._block.writeUInt32BE(bits,this._blockSize-4);else{var lowBits=(4294967295&bits)>>>0,highBits=(bits-lowBits)/4294967296;this._block.writeUInt32BE(highBits,this._blockSize-8),this._block.writeUInt32BE(lowBits,this._blockSize-4)}this._update(this._block);var hash=this._hash();return enc?hash.toString(enc):hash},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},module.exports=Hash},function(module,exports,__webpack_require__){"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_require=__webpack_require__(3),Types=_require.Types,WireType=_require.WireType,Factory=__webpack_require__(19),typeOf=function typeOf(instance){if(void 0===instance)throw new Error("Undefined Type");return instance in Types?Types[instane]:"object"==(void 0===instance?"undefined":_typeof(instance))?"AminoType"==instance.constructor.name?instance.typeName():instance.constructor.name:void 0===instance?"undefined":_typeof(instance)};module.exports={typeOf:typeOf,ownKeys:function ownKeys(instance){return Factory.isExisted(typeOf(instance))?Reflect.ownKeys(instance).filter(function(key){var val=instance.lookup(key);return null!=val||null!=val}):[]},typeToTyp3:function typeToTyp3(type,opts){switch(type){case Types.Interface:return WireType.ByteLength;case Types.ArrayInterface:case Types.ArrayStruct:case Types.String:case Types.Struct:return WireType.ByteLength;case Types.Int64:return opts.binFixed64?WireType.Type8Byte:WireType.Varint;case Types.Int32:return opts.binFixed32?WireType.Type4Byte:WireType.Varint;case Types.Int8:case Types.Int16:return WireType.Varint;default:throw new Error('"unsupported field type '+type)}}}},function(module,exports,__webpack_require__){(function(Buffer){function objectToString(o){return Object.prototype.toString.call(o)}exports.isArray=function isArray(arg){return Array.isArray?Array.isArray(arg):"[object Array]"===objectToString(arg)},exports.isBoolean=function isBoolean(arg){return"boolean"==typeof arg},exports.isNull=function isNull(arg){return null===arg},exports.isNullOrUndefined=function isNullOrUndefined(arg){return null==arg},exports.isNumber=function isNumber(arg){return"number"==typeof arg},exports.isString=function isString(arg){return"string"==typeof arg},exports.isSymbol=function isSymbol(arg){return"symbol"==typeof arg},exports.isUndefined=function isUndefined(arg){return void 0===arg},exports.isRegExp=function isRegExp(re){return"[object RegExp]"===objectToString(re)},exports.isObject=function isObject(arg){return"object"==typeof arg&&null!==arg},exports.isDate=function isDate(d){return"[object Date]"===objectToString(d)},exports.isError=function isError(e){return"[object Error]"===objectToString(e)||e instanceof Error},exports.isFunction=function isFunction(arg){return"function"==typeof arg},exports.isPrimitive=function isPrimitive(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||void 0===arg},exports.isBuffer=Buffer.isBuffer}).call(this,__webpack_require__(5).Buffer)},function(module,exports,__webpack_require__){"use strict";Number.MaxInt8=64,Number.MaxInt16=16384;String.prototype.toBytes=function(str){for(var bytes=[],i=0,n=str.length;i>>8,255&char)}return bytes},String.fromBytes=function(bytes){for(var chars=[],i=0,n=bytes.length;im&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),"function"==typeof console.trace&&console.trace()),this},EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=!1;function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;if(length=(list=this._events[type]).length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit("removeListener",type,listener);else if(isObject(list)){for(i=length;0>5==6?2:byte>>4==14?3:byte>>3==30?4:byte>>6==2?-1:-2}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed,r=function utf8CheckExtraBytes(self,buf,p){if(128!=(192&buf[0]))return self.lastNeed=0,"�";if(1>24&255,x[i+1]=h>>16&255,x[i+2]=h>>8&255,x[i+3]=255&h,x[i+4]=l>>24&255,x[i+5]=l>>16&255,x[i+6]=l>>8&255,x[i+7]=255&l}function vn(x,xi,y,yi,n){var i,d=0;for(i=0;i>>8)-1}function crypto_verify_16(x,xi,y,yi){return vn(x,xi,y,yi,16)}function crypto_verify_32(x,xi,y,yi){return vn(x,xi,y,yi,32)}function crypto_core_salsa20(out,inp,k,c){!function core_salsa20(o,p,k,c){for(var u,j0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,j1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,j2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,j3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,j4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,j5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,j6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,j7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,j8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,j9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,j10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,j11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,j12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,j13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,j14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,j15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,x0=j0,x1=j1,x2=j2,x3=j3,x4=j4,x5=j5,x6=j6,x7=j7,x8=j8,x9=j9,x10=j10,x11=j11,x12=j12,x13=j13,x14=j14,x15=j15,i=0;i<20;i+=2)x0^=(u=(x12^=(u=(x8^=(u=(x4^=(u=x0+x12|0)<<7|u>>>25)+x0|0)<<9|u>>>23)+x4|0)<<13|u>>>19)+x8|0)<<18|u>>>14,x5^=(u=(x1^=(u=(x13^=(u=(x9^=(u=x5+x1|0)<<7|u>>>25)+x5|0)<<9|u>>>23)+x9|0)<<13|u>>>19)+x13|0)<<18|u>>>14,x10^=(u=(x6^=(u=(x2^=(u=(x14^=(u=x10+x6|0)<<7|u>>>25)+x10|0)<<9|u>>>23)+x14|0)<<13|u>>>19)+x2|0)<<18|u>>>14,x15^=(u=(x11^=(u=(x7^=(u=(x3^=(u=x15+x11|0)<<7|u>>>25)+x15|0)<<9|u>>>23)+x3|0)<<13|u>>>19)+x7|0)<<18|u>>>14,x0^=(u=(x3^=(u=(x2^=(u=(x1^=(u=x0+x3|0)<<7|u>>>25)+x0|0)<<9|u>>>23)+x1|0)<<13|u>>>19)+x2|0)<<18|u>>>14,x5^=(u=(x4^=(u=(x7^=(u=(x6^=(u=x5+x4|0)<<7|u>>>25)+x5|0)<<9|u>>>23)+x6|0)<<13|u>>>19)+x7|0)<<18|u>>>14,x10^=(u=(x9^=(u=(x8^=(u=(x11^=(u=x10+x9|0)<<7|u>>>25)+x10|0)<<9|u>>>23)+x11|0)<<13|u>>>19)+x8|0)<<18|u>>>14,x15^=(u=(x14^=(u=(x13^=(u=(x12^=(u=x15+x14|0)<<7|u>>>25)+x15|0)<<9|u>>>23)+x12|0)<<13|u>>>19)+x13|0)<<18|u>>>14;x0=x0+j0|0,x1=x1+j1|0,x2=x2+j2|0,x3=x3+j3|0,x4=x4+j4|0,x5=x5+j5|0,x6=x6+j6|0,x7=x7+j7|0,x8=x8+j8|0,x9=x9+j9|0,x10=x10+j10|0,x11=x11+j11|0,x12=x12+j12|0,x13=x13+j13|0,x14=x14+j14|0,x15=x15+j15|0,o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x1>>>0&255,o[5]=x1>>>8&255,o[6]=x1>>>16&255,o[7]=x1>>>24&255,o[8]=x2>>>0&255,o[9]=x2>>>8&255,o[10]=x2>>>16&255,o[11]=x2>>>24&255,o[12]=x3>>>0&255,o[13]=x3>>>8&255,o[14]=x3>>>16&255,o[15]=x3>>>24&255,o[16]=x4>>>0&255,o[17]=x4>>>8&255,o[18]=x4>>>16&255,o[19]=x4>>>24&255,o[20]=x5>>>0&255,o[21]=x5>>>8&255,o[22]=x5>>>16&255,o[23]=x5>>>24&255,o[24]=x6>>>0&255,o[25]=x6>>>8&255,o[26]=x6>>>16&255,o[27]=x6>>>24&255,o[28]=x7>>>0&255,o[29]=x7>>>8&255,o[30]=x7>>>16&255,o[31]=x7>>>24&255,o[32]=x8>>>0&255,o[33]=x8>>>8&255,o[34]=x8>>>16&255,o[35]=x8>>>24&255,o[36]=x9>>>0&255,o[37]=x9>>>8&255,o[38]=x9>>>16&255,o[39]=x9>>>24&255,o[40]=x10>>>0&255,o[41]=x10>>>8&255,o[42]=x10>>>16&255,o[43]=x10>>>24&255,o[44]=x11>>>0&255,o[45]=x11>>>8&255,o[46]=x11>>>16&255,o[47]=x11>>>24&255,o[48]=x12>>>0&255,o[49]=x12>>>8&255,o[50]=x12>>>16&255,o[51]=x12>>>24&255,o[52]=x13>>>0&255,o[53]=x13>>>8&255,o[54]=x13>>>16&255,o[55]=x13>>>24&255,o[56]=x14>>>0&255,o[57]=x14>>>8&255,o[58]=x14>>>16&255,o[59]=x14>>>24&255,o[60]=x15>>>0&255,o[61]=x15>>>8&255,o[62]=x15>>>16&255,o[63]=x15>>>24&255}(out,inp,k,c)}function crypto_core_hsalsa20(out,inp,k,c){!function core_hsalsa20(o,p,k,c){for(var u,x0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,x1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,x2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,x3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,x4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,x5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,x6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,x7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,x8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,x9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,x10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,x11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,x12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,x13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,x14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,x15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,i=0;i<20;i+=2)x0^=(u=(x12^=(u=(x8^=(u=(x4^=(u=x0+x12|0)<<7|u>>>25)+x0|0)<<9|u>>>23)+x4|0)<<13|u>>>19)+x8|0)<<18|u>>>14,x5^=(u=(x1^=(u=(x13^=(u=(x9^=(u=x5+x1|0)<<7|u>>>25)+x5|0)<<9|u>>>23)+x9|0)<<13|u>>>19)+x13|0)<<18|u>>>14,x10^=(u=(x6^=(u=(x2^=(u=(x14^=(u=x10+x6|0)<<7|u>>>25)+x10|0)<<9|u>>>23)+x14|0)<<13|u>>>19)+x2|0)<<18|u>>>14,x15^=(u=(x11^=(u=(x7^=(u=(x3^=(u=x15+x11|0)<<7|u>>>25)+x15|0)<<9|u>>>23)+x3|0)<<13|u>>>19)+x7|0)<<18|u>>>14,x0^=(u=(x3^=(u=(x2^=(u=(x1^=(u=x0+x3|0)<<7|u>>>25)+x0|0)<<9|u>>>23)+x1|0)<<13|u>>>19)+x2|0)<<18|u>>>14,x5^=(u=(x4^=(u=(x7^=(u=(x6^=(u=x5+x4|0)<<7|u>>>25)+x5|0)<<9|u>>>23)+x6|0)<<13|u>>>19)+x7|0)<<18|u>>>14,x10^=(u=(x9^=(u=(x8^=(u=(x11^=(u=x10+x9|0)<<7|u>>>25)+x10|0)<<9|u>>>23)+x11|0)<<13|u>>>19)+x8|0)<<18|u>>>14,x15^=(u=(x14^=(u=(x13^=(u=(x12^=(u=x15+x14|0)<<7|u>>>25)+x15|0)<<9|u>>>23)+x12|0)<<13|u>>>19)+x13|0)<<18|u>>>14;o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x5>>>0&255,o[5]=x5>>>8&255,o[6]=x5>>>16&255,o[7]=x5>>>24&255,o[8]=x10>>>0&255,o[9]=x10>>>8&255,o[10]=x10>>>16&255,o[11]=x10>>>24&255,o[12]=x15>>>0&255,o[13]=x15>>>8&255,o[14]=x15>>>16&255,o[15]=x15>>>24&255,o[16]=x6>>>0&255,o[17]=x6>>>8&255,o[18]=x6>>>16&255,o[19]=x6>>>24&255,o[20]=x7>>>0&255,o[21]=x7>>>8&255,o[22]=x7>>>16&255,o[23]=x7>>>24&255,o[24]=x8>>>0&255,o[25]=x8>>>8&255,o[26]=x8>>>16&255,o[27]=x8>>>24&255,o[28]=x9>>>0&255,o[29]=x9>>>8&255,o[30]=x9>>>16&255,o[31]=x9>>>24&255}(out,inp,k,c)}var sigma=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k){var u,i,z=new Uint8Array(16),x=new Uint8Array(64);for(i=0;i<16;i++)z[i]=0;for(i=0;i<8;i++)z[i]=n[i];for(;64<=b;){for(crypto_core_salsa20(x,z,k,sigma),i=0;i<64;i++)c[cpos+i]=m[mpos+i]^x[i];for(u=1,i=8;i<16;i++)u=u+(255&z[i])|0,z[i]=255&u,u>>>=8;b-=64,cpos+=64,mpos+=64}if(0>>=8;b-=64,cpos+=64}if(0>>13|t1<<3),t2=255&key[4]|(255&key[5])<<8,this.r[2]=7939&(t1>>>10|t2<<6),t3=255&key[6]|(255&key[7])<<8,this.r[3]=8191&(t2>>>7|t3<<9),t4=255&key[8]|(255&key[9])<<8,this.r[4]=255&(t3>>>4|t4<<12),this.r[5]=t4>>>1&8190,t5=255&key[10]|(255&key[11])<<8,this.r[6]=8191&(t4>>>14|t5<<2),t6=255&key[12]|(255&key[13])<<8,this.r[7]=8065&(t5>>>11|t6<<5),t7=255&key[14]|(255&key[15])<<8,this.r[8]=8191&(t6>>>8|t7<<8),this.r[9]=t7>>>5&127,this.pad[0]=255&key[16]|(255&key[17])<<8,this.pad[1]=255&key[18]|(255&key[19])<<8,this.pad[2]=255&key[20]|(255&key[21])<<8,this.pad[3]=255&key[22]|(255&key[23])<<8,this.pad[4]=255&key[24]|(255&key[25])<<8,this.pad[5]=255&key[26]|(255&key[27])<<8,this.pad[6]=255&key[28]|(255&key[29])<<8,this.pad[7]=255&key[30]|(255&key[31])<<8};function crypto_onetimeauth(out,outpos,m,mpos,n,k){var s=new poly1305(k);return s.update(m,mpos,n),s.finish(out,outpos),0}function crypto_onetimeauth_verify(h,hpos,m,mpos,n,k){var x=new Uint8Array(16);return crypto_onetimeauth(x,0,m,mpos,n,k),crypto_verify_16(h,hpos,x,0)}function crypto_secretbox(c,m,d,n,k){var i;if(d<32)return-1;for(crypto_stream_xor(c,0,m,0,d,n,k),crypto_onetimeauth(c,16,c,32,d-32,c),i=0;i<16;i++)c[i]=0;return 0}function crypto_secretbox_open(m,c,d,n,k){var i,x=new Uint8Array(32);if(d<32)return-1;if(crypto_stream(x,0,32,n,k),0!==crypto_onetimeauth_verify(c,16,c,32,d-32,x))return-1;for(crypto_stream_xor(m,0,c,0,d,n,k),i=0;i<32;i++)m[i]=0;return 0}function set25519(r,a){var i;for(i=0;i<16;i++)r[i]=0|a[i]}function car25519(o){var i,v,c=1;for(i=0;i<16;i++)v=o[i]+c+65535,c=Math.floor(v/65536),o[i]=v-65536*c;o[0]+=c-1+37*(c-1)}function sel25519(p,q,b){for(var t,c=~(b-1),i=0;i<16;i++)t=c&(p[i]^q[i]),p[i]^=t,q[i]^=t}function pack25519(o,n){var i,j,b,m=gf(),t=gf();for(i=0;i<16;i++)t[i]=n[i];for(car25519(t),car25519(t),car25519(t),j=0;j<2;j++){for(m[0]=t[0]-65517,i=1;i<15;i++)m[i]=t[i]-65535-(m[i-1]>>16&1),m[i-1]&=65535;m[15]=t[15]-32767-(m[14]>>16&1),b=m[15]>>16&1,m[14]&=65535,sel25519(t,m,1-b)}for(i=0;i<16;i++)o[2*i]=255&t[i],o[2*i+1]=t[i]>>8}function neq25519(a,b){var c=new Uint8Array(32),d=new Uint8Array(32);return pack25519(c,a),pack25519(d,b),crypto_verify_32(c,0,d,0)}function par25519(a){var d=new Uint8Array(32);return pack25519(d,a),1&d[0]}function unpack25519(o,n){var i;for(i=0;i<16;i++)o[i]=n[2*i]+(n[2*i+1]<<8);o[15]&=32767}function A(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]+b[i]}function Z(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]-b[i]}function M(o,a,b){var v,c,t0=0,t1=0,t2=0,t3=0,t4=0,t5=0,t6=0,t7=0,t8=0,t9=0,t10=0,t11=0,t12=0,t13=0,t14=0,t15=0,t16=0,t17=0,t18=0,t19=0,t20=0,t21=0,t22=0,t23=0,t24=0,t25=0,t26=0,t27=0,t28=0,t29=0,t30=0,b0=b[0],b1=b[1],b2=b[2],b3=b[3],b4=b[4],b5=b[5],b6=b[6],b7=b[7],b8=b[8],b9=b[9],b10=b[10],b11=b[11],b12=b[12],b13=b[13],b14=b[14],b15=b[15];t0+=(v=a[0])*b0,t1+=v*b1,t2+=v*b2,t3+=v*b3,t4+=v*b4,t5+=v*b5,t6+=v*b6,t7+=v*b7,t8+=v*b8,t9+=v*b9,t10+=v*b10,t11+=v*b11,t12+=v*b12,t13+=v*b13,t14+=v*b14,t15+=v*b15,t1+=(v=a[1])*b0,t2+=v*b1,t3+=v*b2,t4+=v*b3,t5+=v*b4,t6+=v*b5,t7+=v*b6,t8+=v*b7,t9+=v*b8,t10+=v*b9,t11+=v*b10,t12+=v*b11,t13+=v*b12,t14+=v*b13,t15+=v*b14,t16+=v*b15,t2+=(v=a[2])*b0,t3+=v*b1,t4+=v*b2,t5+=v*b3,t6+=v*b4,t7+=v*b5,t8+=v*b6,t9+=v*b7,t10+=v*b8,t11+=v*b9,t12+=v*b10,t13+=v*b11,t14+=v*b12,t15+=v*b13,t16+=v*b14,t17+=v*b15,t3+=(v=a[3])*b0,t4+=v*b1,t5+=v*b2,t6+=v*b3,t7+=v*b4,t8+=v*b5,t9+=v*b6,t10+=v*b7,t11+=v*b8,t12+=v*b9,t13+=v*b10,t14+=v*b11,t15+=v*b12,t16+=v*b13,t17+=v*b14,t18+=v*b15,t4+=(v=a[4])*b0,t5+=v*b1,t6+=v*b2,t7+=v*b3,t8+=v*b4,t9+=v*b5,t10+=v*b6,t11+=v*b7,t12+=v*b8,t13+=v*b9,t14+=v*b10,t15+=v*b11,t16+=v*b12,t17+=v*b13,t18+=v*b14,t19+=v*b15,t5+=(v=a[5])*b0,t6+=v*b1,t7+=v*b2,t8+=v*b3,t9+=v*b4,t10+=v*b5,t11+=v*b6,t12+=v*b7,t13+=v*b8,t14+=v*b9,t15+=v*b10,t16+=v*b11,t17+=v*b12,t18+=v*b13,t19+=v*b14,t20+=v*b15,t6+=(v=a[6])*b0,t7+=v*b1,t8+=v*b2,t9+=v*b3,t10+=v*b4,t11+=v*b5,t12+=v*b6,t13+=v*b7,t14+=v*b8,t15+=v*b9,t16+=v*b10,t17+=v*b11,t18+=v*b12,t19+=v*b13,t20+=v*b14,t21+=v*b15,t7+=(v=a[7])*b0,t8+=v*b1,t9+=v*b2,t10+=v*b3,t11+=v*b4,t12+=v*b5,t13+=v*b6,t14+=v*b7,t15+=v*b8,t16+=v*b9,t17+=v*b10,t18+=v*b11,t19+=v*b12,t20+=v*b13,t21+=v*b14,t22+=v*b15,t8+=(v=a[8])*b0,t9+=v*b1,t10+=v*b2,t11+=v*b3,t12+=v*b4,t13+=v*b5,t14+=v*b6,t15+=v*b7,t16+=v*b8,t17+=v*b9,t18+=v*b10,t19+=v*b11,t20+=v*b12,t21+=v*b13,t22+=v*b14,t23+=v*b15,t9+=(v=a[9])*b0,t10+=v*b1,t11+=v*b2,t12+=v*b3,t13+=v*b4,t14+=v*b5,t15+=v*b6,t16+=v*b7,t17+=v*b8,t18+=v*b9,t19+=v*b10,t20+=v*b11,t21+=v*b12,t22+=v*b13,t23+=v*b14,t24+=v*b15,t10+=(v=a[10])*b0,t11+=v*b1,t12+=v*b2,t13+=v*b3,t14+=v*b4,t15+=v*b5,t16+=v*b6,t17+=v*b7,t18+=v*b8,t19+=v*b9,t20+=v*b10,t21+=v*b11,t22+=v*b12,t23+=v*b13,t24+=v*b14,t25+=v*b15,t11+=(v=a[11])*b0,t12+=v*b1,t13+=v*b2,t14+=v*b3,t15+=v*b4,t16+=v*b5,t17+=v*b6,t18+=v*b7,t19+=v*b8,t20+=v*b9,t21+=v*b10,t22+=v*b11,t23+=v*b12,t24+=v*b13,t25+=v*b14,t26+=v*b15,t12+=(v=a[12])*b0,t13+=v*b1,t14+=v*b2,t15+=v*b3,t16+=v*b4,t17+=v*b5,t18+=v*b6,t19+=v*b7,t20+=v*b8,t21+=v*b9,t22+=v*b10,t23+=v*b11,t24+=v*b12,t25+=v*b13,t26+=v*b14,t27+=v*b15,t13+=(v=a[13])*b0,t14+=v*b1,t15+=v*b2,t16+=v*b3,t17+=v*b4,t18+=v*b5,t19+=v*b6,t20+=v*b7,t21+=v*b8,t22+=v*b9,t23+=v*b10,t24+=v*b11,t25+=v*b12,t26+=v*b13,t27+=v*b14,t28+=v*b15,t14+=(v=a[14])*b0,t15+=v*b1,t16+=v*b2,t17+=v*b3,t18+=v*b4,t19+=v*b5,t20+=v*b6,t21+=v*b7,t22+=v*b8,t23+=v*b9,t24+=v*b10,t25+=v*b11,t26+=v*b12,t27+=v*b13,t28+=v*b14,t29+=v*b15,t15+=(v=a[15])*b0,t1+=38*(t17+=v*b2),t2+=38*(t18+=v*b3),t3+=38*(t19+=v*b4),t4+=38*(t20+=v*b5),t5+=38*(t21+=v*b6),t6+=38*(t22+=v*b7),t7+=38*(t23+=v*b8),t8+=38*(t24+=v*b9),t9+=38*(t25+=v*b10),t10+=38*(t26+=v*b11),t11+=38*(t27+=v*b12),t12+=38*(t28+=v*b13),t13+=38*(t29+=v*b14),t14+=38*(t30+=v*b15),t0=(v=(t0+=38*(t16+=v*b1))+(c=1)+65535)-65536*(c=Math.floor(v/65536)),t1=(v=t1+c+65535)-65536*(c=Math.floor(v/65536)),t2=(v=t2+c+65535)-65536*(c=Math.floor(v/65536)),t3=(v=t3+c+65535)-65536*(c=Math.floor(v/65536)),t4=(v=t4+c+65535)-65536*(c=Math.floor(v/65536)),t5=(v=t5+c+65535)-65536*(c=Math.floor(v/65536)),t6=(v=t6+c+65535)-65536*(c=Math.floor(v/65536)),t7=(v=t7+c+65535)-65536*(c=Math.floor(v/65536)),t8=(v=t8+c+65535)-65536*(c=Math.floor(v/65536)),t9=(v=t9+c+65535)-65536*(c=Math.floor(v/65536)),t10=(v=t10+c+65535)-65536*(c=Math.floor(v/65536)),t11=(v=t11+c+65535)-65536*(c=Math.floor(v/65536)),t12=(v=t12+c+65535)-65536*(c=Math.floor(v/65536)),t13=(v=t13+c+65535)-65536*(c=Math.floor(v/65536)),t14=(v=t14+c+65535)-65536*(c=Math.floor(v/65536)),t15=(v=t15+c+65535)-65536*(c=Math.floor(v/65536)),t0=(v=(t0+=c-1+37*(c-1))+(c=1)+65535)-65536*(c=Math.floor(v/65536)),t1=(v=t1+c+65535)-65536*(c=Math.floor(v/65536)),t2=(v=t2+c+65535)-65536*(c=Math.floor(v/65536)),t3=(v=t3+c+65535)-65536*(c=Math.floor(v/65536)),t4=(v=t4+c+65535)-65536*(c=Math.floor(v/65536)),t5=(v=t5+c+65535)-65536*(c=Math.floor(v/65536)),t6=(v=t6+c+65535)-65536*(c=Math.floor(v/65536)),t7=(v=t7+c+65535)-65536*(c=Math.floor(v/65536)),t8=(v=t8+c+65535)-65536*(c=Math.floor(v/65536)),t9=(v=t9+c+65535)-65536*(c=Math.floor(v/65536)),t10=(v=t10+c+65535)-65536*(c=Math.floor(v/65536)),t11=(v=t11+c+65535)-65536*(c=Math.floor(v/65536)),t12=(v=t12+c+65535)-65536*(c=Math.floor(v/65536)),t13=(v=t13+c+65535)-65536*(c=Math.floor(v/65536)),t14=(v=t14+c+65535)-65536*(c=Math.floor(v/65536)),t15=(v=t15+c+65535)-65536*(c=Math.floor(v/65536)),t0+=c-1+37*(c-1),o[0]=t0,o[1]=t1,o[2]=t2,o[3]=t3,o[4]=t4,o[5]=t5,o[6]=t6,o[7]=t7,o[8]=t8,o[9]=t9,o[10]=t10,o[11]=t11,o[12]=t12,o[13]=t13,o[14]=t14,o[15]=t15}function S(o,a){M(o,a,a)}function inv25519(o,i){var a,c=gf();for(a=0;a<16;a++)c[a]=i[a];for(a=253;0<=a;a--)S(c,c),2!==a&&4!==a&&M(c,c,i);for(a=0;a<16;a++)o[a]=c[a]}function crypto_scalarmult(q,n,p){var r,i,z=new Uint8Array(32),x=new Float64Array(80),a=gf(),b=gf(),c=gf(),d=gf(),e=gf(),f=gf();for(i=0;i<31;i++)z[i]=n[i];for(z[31]=127&n[31]|64,z[0]&=248,unpack25519(x,p),i=0;i<16;i++)b[i]=x[i],d[i]=a[i]=c[i]=0;for(a[0]=d[0]=1,i=254;0<=i;--i)sel25519(a,b,r=z[i>>>3]>>>(7&i)&1),sel25519(c,d,r),A(e,a,c),Z(a,a,c),A(c,b,d),Z(b,b,d),S(d,e),S(f,a),M(a,c,a),M(c,b,e),A(e,a,c),Z(a,a,c),S(b,a),Z(c,d,f),M(a,c,_121665),A(a,a,d),M(c,c,a),M(a,d,f),M(d,b,x),S(b,e),sel25519(a,b,r),sel25519(c,d,r);for(i=0;i<16;i++)x[i+16]=a[i],x[i+32]=c[i],x[i+48]=b[i],x[i+64]=d[i];var x32=x.subarray(32),x16=x.subarray(16);return inv25519(x32,x32),M(x16,x16,x32),pack25519(q,x16),0}function crypto_scalarmult_base(q,n){return crypto_scalarmult(q,n,_9)}function crypto_box_keypair(y,x){return randombytes(x,32),crypto_scalarmult_base(y,x)}function crypto_box_beforenm(k,y,x){var s=new Uint8Array(32);return crypto_scalarmult(s,x,y),crypto_core_hsalsa20(k,_0,s,sigma)}poly1305.prototype.blocks=function(m,mpos,bytes){for(var t0,t1,t2,t3,t4,t5,t6,t7,c,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,hibit=this.fin?0:2048,h0=this.h[0],h1=this.h[1],h2=this.h[2],h3=this.h[3],h4=this.h[4],h5=this.h[5],h6=this.h[6],h7=this.h[7],h8=this.h[8],h9=this.h[9],r0=this.r[0],r1=this.r[1],r2=this.r[2],r3=this.r[3],r4=this.r[4],r5=this.r[5],r6=this.r[6],r7=this.r[7],r8=this.r[8],r9=this.r[9];16<=bytes;)d0=c=0,d0+=(h0+=8191&(t0=255&m[mpos+0]|(255&m[mpos+1])<<8))*r0,d0+=(h1+=8191&(t0>>>13|(t1=255&m[mpos+2]|(255&m[mpos+3])<<8)<<3))*(5*r9),d0+=(h2+=8191&(t1>>>10|(t2=255&m[mpos+4]|(255&m[mpos+5])<<8)<<6))*(5*r8),d0+=(h3+=8191&(t2>>>7|(t3=255&m[mpos+6]|(255&m[mpos+7])<<8)<<9))*(5*r7),c=(d0+=(h4+=8191&(t3>>>4|(t4=255&m[mpos+8]|(255&m[mpos+9])<<8)<<12))*(5*r6))>>>13,d0&=8191,d0+=(h5+=t4>>>1&8191)*(5*r5),d0+=(h6+=8191&(t4>>>14|(t5=255&m[mpos+10]|(255&m[mpos+11])<<8)<<2))*(5*r4),d0+=(h7+=8191&(t5>>>11|(t6=255&m[mpos+12]|(255&m[mpos+13])<<8)<<5))*(5*r3),d0+=(h8+=8191&(t6>>>8|(t7=255&m[mpos+14]|(255&m[mpos+15])<<8)<<8))*(5*r2),d1=c+=(d0+=(h9+=t7>>>5|hibit)*(5*r1))>>>13,d1+=h0*r1,d1+=h1*r0,d1+=h2*(5*r9),d1+=h3*(5*r8),c=(d1+=h4*(5*r7))>>>13,d1&=8191,d1+=h5*(5*r6),d1+=h6*(5*r5),d1+=h7*(5*r4),d1+=h8*(5*r3),c+=(d1+=h9*(5*r2))>>>13,d1&=8191,d2=c,d2+=h0*r2,d2+=h1*r1,d2+=h2*r0,d2+=h3*(5*r9),c=(d2+=h4*(5*r8))>>>13,d2&=8191,d2+=h5*(5*r7),d2+=h6*(5*r6),d2+=h7*(5*r5),d2+=h8*(5*r4),d3=c+=(d2+=h9*(5*r3))>>>13,d3+=h0*r3,d3+=h1*r2,d3+=h2*r1,d3+=h3*r0,c=(d3+=h4*(5*r9))>>>13,d3&=8191,d3+=h5*(5*r8),d3+=h6*(5*r7),d3+=h7*(5*r6),d3+=h8*(5*r5),d4=c+=(d3+=h9*(5*r4))>>>13,d4+=h0*r4,d4+=h1*r3,d4+=h2*r2,d4+=h3*r1,c=(d4+=h4*r0)>>>13,d4&=8191,d4+=h5*(5*r9),d4+=h6*(5*r8),d4+=h7*(5*r7),d4+=h8*(5*r6),d5=c+=(d4+=h9*(5*r5))>>>13,d5+=h0*r5,d5+=h1*r4,d5+=h2*r3,d5+=h3*r2,c=(d5+=h4*r1)>>>13,d5&=8191,d5+=h5*r0,d5+=h6*(5*r9),d5+=h7*(5*r8),d5+=h8*(5*r7),d6=c+=(d5+=h9*(5*r6))>>>13,d6+=h0*r6,d6+=h1*r5,d6+=h2*r4,d6+=h3*r3,c=(d6+=h4*r2)>>>13,d6&=8191,d6+=h5*r1,d6+=h6*r0,d6+=h7*(5*r9),d6+=h8*(5*r8),d7=c+=(d6+=h9*(5*r7))>>>13,d7+=h0*r7,d7+=h1*r6,d7+=h2*r5,d7+=h3*r4,c=(d7+=h4*r3)>>>13,d7&=8191,d7+=h5*r2,d7+=h6*r1,d7+=h7*r0,d7+=h8*(5*r9),d8=c+=(d7+=h9*(5*r8))>>>13,d8+=h0*r8,d8+=h1*r7,d8+=h2*r6,d8+=h3*r5,c=(d8+=h4*r4)>>>13,d8&=8191,d8+=h5*r3,d8+=h6*r2,d8+=h7*r1,d8+=h8*r0,d9=c+=(d8+=h9*(5*r9))>>>13,d9+=h0*r9,d9+=h1*r8,d9+=h2*r7,d9+=h3*r6,c=(d9+=h4*r5)>>>13,d9&=8191,d9+=h5*r4,d9+=h6*r3,d9+=h7*r2,d9+=h8*r1,h0=d0=8191&(c=(c=((c+=(d9+=h9*r0)>>>13)<<2)+c|0)+(d0&=8191)|0),h1=d1+=c>>>=13,h2=d2&=8191,h3=d3&=8191,h4=d4&=8191,h5=d5&=8191,h6=d6&=8191,h7=d7&=8191,h8=d8&=8191,h9=d9&=8191,mpos+=16,bytes-=16;this.h[0]=h0,this.h[1]=h1,this.h[2]=h2,this.h[3]=h3,this.h[4]=h4,this.h[5]=h5,this.h[6]=h6,this.h[7]=h7,this.h[8]=h8,this.h[9]=h9},poly1305.prototype.finish=function(mac,macpos){var c,mask,f,i,g=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(c=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=c,c=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*c,c=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=c,c=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=c,g[0]=this.h[0]+5,c=g[0]>>>13,g[0]&=8191,i=1;i<10;i++)g[i]=this.h[i]+c,c=g[i]>>>13,g[i]&=8191;for(g[9]-=8192,mask=(1^c)-1,i=0;i<10;i++)g[i]&=mask;for(mask=~mask,i=0;i<10;i++)this.h[i]=this.h[i]&mask|g[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),f=this.h[0]+this.pad[0],this.h[0]=65535&f,i=1;i<8;i++)f=(this.h[i]+this.pad[i]|0)+(f>>>16)|0,this.h[i]=65535&f;mac[macpos+0]=this.h[0]>>>0&255,mac[macpos+1]=this.h[0]>>>8&255,mac[macpos+2]=this.h[1]>>>0&255,mac[macpos+3]=this.h[1]>>>8&255,mac[macpos+4]=this.h[2]>>>0&255,mac[macpos+5]=this.h[2]>>>8&255,mac[macpos+6]=this.h[3]>>>0&255,mac[macpos+7]=this.h[3]>>>8&255,mac[macpos+8]=this.h[4]>>>0&255,mac[macpos+9]=this.h[4]>>>8&255,mac[macpos+10]=this.h[5]>>>0&255,mac[macpos+11]=this.h[5]>>>8&255,mac[macpos+12]=this.h[6]>>>0&255,mac[macpos+13]=this.h[6]>>>8&255,mac[macpos+14]=this.h[7]>>>0&255,mac[macpos+15]=this.h[7]>>>8&255},poly1305.prototype.update=function(m,mpos,bytes){var i,want;if(this.leftover){for(bytes<(want=16-this.leftover)&&(want=bytes),i=0;i>>16,c=65535&(h=ah7),d=h>>>16,a+=65535&(l=((bl4=al4)>>>14|(bh4=ah4)<<18)^(al4>>>18|ah4<<14)^(ah4>>>9|al4<<23)),b+=l>>>16,c+=65535&(h=(ah4>>>14|al4<<18)^(ah4>>>18|al4<<14)^(al4>>>9|ah4<<23)),d+=h>>>16,a+=65535&(l=al4&(bl5=al5)^~al4&(bl6=al6)),b+=l>>>16,c+=65535&(h=ah4&(bh5=ah5)^~ah4&(bh6=ah6)),d+=h>>>16,h=K[2*i],a+=65535&(l=K[2*i+1]),b+=l>>>16,c+=65535&h,d+=h>>>16,h=wh[i%16],b+=(l=wl[i%16])>>>16,c+=65535&h,d+=h>>>16,c+=(b+=(a+=65535&l)>>>16)>>>16,a=65535&(l=tl=65535&a|b<<16),b=l>>>16,c=65535&(h=th=65535&c|(d+=c>>>16)<<16),d=h>>>16,a+=65535&(l=(al0>>>28|ah0<<4)^(ah0>>>2|al0<<30)^(ah0>>>7|al0<<25)),b+=l>>>16,c+=65535&(h=(ah0>>>28|al0<<4)^(al0>>>2|ah0<<30)^(al0>>>7|ah0<<25)),d+=h>>>16,b+=(l=al0&al1^al0&al2^al1&al2)>>>16,c+=65535&(h=ah0&ah1^ah0&ah2^ah1&ah2),d+=h>>>16,bh7=65535&(c+=(b+=(a+=65535&l)>>>16)>>>16)|(d+=c>>>16)<<16,bl7=65535&a|b<<16,a=65535&(l=bl3),b=l>>>16,c=65535&(h=bh3),d=h>>>16,b+=(l=tl)>>>16,c+=65535&(h=th),d+=h>>>16,ah1=bh0,ah2=bh1,ah3=bh2,ah4=bh3=65535&(c+=(b+=(a+=65535&l)>>>16)>>>16)|(d+=c>>>16)<<16,ah5=bh4,ah6=bh5,ah7=bh6,ah0=bh7,al1=bl0,al2=bl1,al3=bl2,al4=bl3=65535&a|b<<16,al5=bl4,al6=bl5,al7=bl6,al0=bl7,i%16==15)for(j=0;j<16;j++)h=wh[j],a=65535&(l=wl[j]),b=l>>>16,c=65535&h,d=h>>>16,h=wh[(j+9)%16],a+=65535&(l=wl[(j+9)%16]),b+=l>>>16,c+=65535&h,d+=h>>>16,th=wh[(j+1)%16],a+=65535&(l=((tl=wl[(j+1)%16])>>>1|th<<31)^(tl>>>8|th<<24)^(tl>>>7|th<<25)),b+=l>>>16,c+=65535&(h=(th>>>1|tl<<31)^(th>>>8|tl<<24)^th>>>7),d+=h>>>16,th=wh[(j+14)%16],b+=(l=((tl=wl[(j+14)%16])>>>19|th<<13)^(th>>>29|tl<<3)^(tl>>>6|th<<26))>>>16,c+=65535&(h=(th>>>19|tl<<13)^(tl>>>29|th<<3)^th>>>6),d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,wh[j]=65535&c|d<<16,wl[j]=65535&a|b<<16;a=65535&(l=al0),b=l>>>16,c=65535&(h=ah0),d=h>>>16,h=hh[0],b+=(l=hl[0])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[0]=ah0=65535&c|d<<16,hl[0]=al0=65535&a|b<<16,a=65535&(l=al1),b=l>>>16,c=65535&(h=ah1),d=h>>>16,h=hh[1],b+=(l=hl[1])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[1]=ah1=65535&c|d<<16,hl[1]=al1=65535&a|b<<16,a=65535&(l=al2),b=l>>>16,c=65535&(h=ah2),d=h>>>16,h=hh[2],b+=(l=hl[2])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[2]=ah2=65535&c|d<<16,hl[2]=al2=65535&a|b<<16,a=65535&(l=al3),b=l>>>16,c=65535&(h=ah3),d=h>>>16,h=hh[3],b+=(l=hl[3])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[3]=ah3=65535&c|d<<16,hl[3]=al3=65535&a|b<<16,a=65535&(l=al4),b=l>>>16,c=65535&(h=ah4),d=h>>>16,h=hh[4],b+=(l=hl[4])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[4]=ah4=65535&c|d<<16,hl[4]=al4=65535&a|b<<16,a=65535&(l=al5),b=l>>>16,c=65535&(h=ah5),d=h>>>16,h=hh[5],b+=(l=hl[5])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[5]=ah5=65535&c|d<<16,hl[5]=al5=65535&a|b<<16,a=65535&(l=al6),b=l>>>16,c=65535&(h=ah6),d=h>>>16,h=hh[6],b+=(l=hl[6])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[6]=ah6=65535&c|d<<16,hl[6]=al6=65535&a|b<<16,a=65535&(l=al7),b=l>>>16,c=65535&(h=ah7),d=h>>>16,h=hh[7],b+=(l=hl[7])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[7]=ah7=65535&c|d<<16,hl[7]=al7=65535&a|b<<16,pos+=128,n-=128}return n}function crypto_hash(out,m,n){var i,hh=new Int32Array(8),hl=new Int32Array(8),x=new Uint8Array(256),b=n;for(hh[0]=1779033703,hh[1]=3144134277,hh[2]=1013904242,hh[3]=2773480762,hh[4]=1359893119,hh[5]=2600822924,hh[6]=528734635,hh[7]=1541459225,hl[0]=4089235720,hl[1]=2227873595,hl[2]=4271175723,hl[3]=1595750129,hl[4]=2917565137,hl[5]=725511199,hl[6]=4215389547,hl[7]=327033209,crypto_hashblocks_hl(hh,hl,m,n),n%=128,i=0;i>(7&i)&1),add(q,p),add(p,p),cswap(p,q,b)}function scalarbase(p,s){var q=[gf(),gf(),gf(),gf()];set25519(q[0],X),set25519(q[1],Y),set25519(q[2],gf1),M(q[3],X,Y),scalarmult(p,q,s)}function crypto_sign_keypair(pk,sk,seeded){var i,d=new Uint8Array(64),p=[gf(),gf(),gf(),gf()];for(seeded||randombytes(sk,32),crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64,scalarbase(p,d),pack(pk,p),i=0;i<32;i++)sk[i+32]=pk[i];return 0}var L=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function modL(r,x){var carry,i,j,k;for(i=63;32<=i;--i){for(carry=0,j=i-32,k=i-12;j>8,x[j]-=256*carry;x[j]+=carry,x[i]=0}for(j=carry=0;j<32;j++)x[j]+=carry-(x[31]>>4)*L[j],carry=x[j]>>8,x[j]&=255;for(j=0;j<32;j++)x[j]-=carry*L[j];for(i=0;i<32;i++)x[i+1]+=x[i]>>8,r[i]=255&x[i]}function reduce(r){var i,x=new Float64Array(64);for(i=0;i<64;i++)x[i]=r[i];for(i=0;i<64;i++)r[i]=0;modL(r,x)}function crypto_sign(sm,m,n,sk){var i,j,d=new Uint8Array(64),h=new Uint8Array(64),r=new Uint8Array(64),x=new Float64Array(64),p=[gf(),gf(),gf(),gf()];crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64;var smlen=n+64;for(i=0;i>7&&Z(r[0],gf0,r[0]),M(r[3],r[0],r[1]),0)}function crypto_sign_open(m,sm,n,pk){var i,t=new Uint8Array(32),h=new Uint8Array(64),p=[gf(),gf(),gf(),gf()],q=[gf(),gf(),gf(),gf()];if(-1,n<64)return-1;if(unpackneg(q,pk))return-1;for(i=0;i=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|length}function byteLength(string,encoding){if(Buffer.isBuffer(string))return string.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer))return string.byteLength;"string"!=typeof string&&(string=""+string);var len=string.length;if(0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case void 0:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*len;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase(),loweredCase=!0}}function swap(b,n,m){var i=b[n];b[n]=b[m],b[m]=i}function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;if("string"==typeof byteOffset?(encoding=byteOffset,byteOffset=0):2147483647=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(byteOffset<0){if(!dir)return-1;byteOffset=0}if("string"==typeof val&&(val=Buffer.from(val,encoding)),Buffer.isBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"==typeof val)return val&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?dir?Uint8Array.prototype.indexOf.call(buffer,val,byteOffset):Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset):arrayIndexOf(buffer,[val],byteOffset,encoding,dir);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){var i,indexSize=1,arrLength=arr.length,valLength=val.length;if(void 0!==encoding&&("ucs2"===(encoding=String(encoding).toLowerCase())||"ucs-2"===encoding||"utf16le"===encoding||"utf-16le"===encoding)){if(arr.length<2||val.length<2)return-1;arrLength/=indexSize=2,valLength/=2,byteOffset/=2}function read(buf,i){return 1===indexSize?buf[i]:buf.readUInt16BE(i*indexSize)}if(dir){var foundIndex=-1;for(i=byteOffset;i>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}(string,buf.length-offset),buf,offset,length)}function base64Slice(buf,start,end){return 0===start&&end===buf.length?base64.fromByteArray(buf):base64.fromByteArray(buf.slice(start,end))}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);for(var res=[],i=start;i>>10&1023|55296),codePoint=56320|1023&codePoint),res.push(codePoint),i+=bytesPerSequence}return function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,codePoints);var res="",i=0;for(;ithis.length)return"";if((void 0===end||end>this.length)&&(end=this.length),end<=0)return"";if((end>>>=0)<=(start>>>=0))return"";for(encoding||(encoding="utf8");;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0}}.apply(this,arguments)},Buffer.prototype.equals=function equals(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b||0===Buffer.compare(this,b)},Buffer.prototype.inspect=function inspect(){var str="",max=exports.INSPECT_MAX_BYTES;return 0max&&(str+=" ... ")),""},Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target))throw new TypeError("Argument must be a Buffer");if(void 0===start&&(start=0),void 0===end&&(end=target?target.length:0),void 0===thisStart&&(thisStart=0),void 0===thisEnd&&(thisEnd=this.length),start<0||end>target.length||thisStart<0||thisEnd>this.length)throw new RangeError("out of range index");if(thisEnd<=thisStart&&end<=start)return 0;if(thisEnd<=thisStart)return-1;if(end<=start)return 1;if(this===target)return 0;for(var x=(thisEnd>>>=0)-(thisStart>>>=0),y=(end>>>=0)-(start>>>=0),len=Math.min(x,y),thisCopy=this.slice(thisStart,thisEnd),targetCopy=target.slice(start,end),i=0;ithis.length)throw new RangeError("Attempt to write outside buffer bounds");encoding||(encoding="utf8");for(var loweredCase=!1;;)switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase(),loweredCase=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;ibuf.length)throw new RangeError("Index out of range")}function objectWriteUInt16(buf,value,offset,littleEndian){value<0&&(value=65535+value+1);for(var i=0,j=Math.min(buf.length-offset,2);i>>8*(littleEndian?i:1-i)}function objectWriteUInt32(buf,value,offset,littleEndian){value<0&&(value=4294967295+value+1);for(var i=0,j=Math.min(buf.length-offset,4);i>>8*(littleEndian?i:3-i)&255}function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,0,offset,4),ieee754.write(buf,value,offset,littleEndian,23,4),offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,0,offset,8),ieee754.write(buf,value,offset,littleEndian,52,8),offset+8}Buffer.prototype.slice=function slice(start,end){var newBuf,len=this.length;if((start=~~start)<0?(start+=len)<0&&(start=0):len>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=255&value):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0,mul=1,sub=0;for(this[offset]=255&value;++i>0)-sub&255;return offset+byteLength},Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1,mul=1,sub=0;for(this[offset+i]=255&value;0<=--i&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i+1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),value<0&&(value=255+value+1),this[offset]=255&value,offset+1},Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),value<0&&(value=4294967295+value+1),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function copy(target,targetStart,start,end){if(start||(start=0),end||0===end||(end=this.length),targetStart>=target.length&&(targetStart=target.length),targetStart||(targetStart=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-targetStart>>=0,end=void 0===end?this.length:end>>>0,val||(val=0),"number"==typeof val)for(i=start;i>6|192,63&codePoint|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,63&codePoint|128)}else{if(!(codePoint<1114112))throw new Error("Invalid code point");if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,63&codePoint|128)}}return bytes}function base64ToBytes(str){return base64.toByteArray(function base64clean(str){if((str=function stringtrim(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}(str).replace(INVALID_BASE64_RE,"")).length<2)return"";for(;str.length%4!=0;)str+="=";return str}(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}}).call(this,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";var pna=__webpack_require__(13),objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys};module.exports=Duplex;var util=__webpack_require__(11);util.inherits=__webpack_require__(1);var Readable=__webpack_require__(30),Writable=__webpack_require__(16);util.inherits(Duplex,Readable);for(var keys=objectKeys(Writable.prototype),v=0;v=this._finalSize&&(this._update(this._block),this._block.fill(0));var bits=8*this._len;if(bits<=4294967295)this._block.writeUInt32BE(bits,this._blockSize-4);else{var lowBits=(4294967295&bits)>>>0,highBits=(bits-lowBits)/4294967296;this._block.writeUInt32BE(highBits,this._blockSize-8),this._block.writeUInt32BE(lowBits,this._blockSize-4)}this._update(this._block);var hash=this._hash();return enc?hash.toString(enc):hash},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},module.exports=Hash},function(module,exports,__webpack_require__){"use strict";Number.MaxInt8=127,Number.MaxInt16=32767;module.exports={getHash256:function getHash256(input){return __webpack_require__(114).update(input).array()},fromHex:function fromHex(str){for(var buffer=[],i=0;im&&!existing.warned){existing.warned=!0;var w=new Error("Possible EventEmitter memory leak detected. "+existing.length+" "+String(type)+" listeners added. Use emitter.setMaxListeners() to increase limit");w.name="MaxListenersExceededWarning",w.emitter=target,w.type=type,w.count=existing.length,function ProcessEmitWarning(warning){console&&console.warn&&console.warn(warning)}(w)}return target}function _onceWrap(target,type,listener){var state={fired:!1,wrapFn:void 0,target:target,type:type,listener:listener},wrapped=function onceWrapper(){for(var args=[],i=0;i>5==6?2:byte>>4==14?3:byte>>3==30?4:byte>>6==2?-1:-2}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed,r=function utf8CheckExtraBytes(self,buf,p){if(128!=(192&buf[0]))return self.lastNeed=0,"�";if(1>24&255,x[i+1]=h>>16&255,x[i+2]=h>>8&255,x[i+3]=255&h,x[i+4]=l>>24&255,x[i+5]=l>>16&255,x[i+6]=l>>8&255,x[i+7]=255&l}function vn(x,xi,y,yi,n){var i,d=0;for(i=0;i>>8)-1}function crypto_verify_16(x,xi,y,yi){return vn(x,xi,y,yi,16)}function crypto_verify_32(x,xi,y,yi){return vn(x,xi,y,yi,32)}function crypto_core_salsa20(out,inp,k,c){!function core_salsa20(o,p,k,c){for(var u,j0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,j1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,j2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,j3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,j4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,j5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,j6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,j7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,j8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,j9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,j10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,j11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,j12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,j13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,j14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,j15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,x0=j0,x1=j1,x2=j2,x3=j3,x4=j4,x5=j5,x6=j6,x7=j7,x8=j8,x9=j9,x10=j10,x11=j11,x12=j12,x13=j13,x14=j14,x15=j15,i=0;i<20;i+=2)x0^=(u=(x12^=(u=(x8^=(u=(x4^=(u=x0+x12|0)<<7|u>>>25)+x0|0)<<9|u>>>23)+x4|0)<<13|u>>>19)+x8|0)<<18|u>>>14,x5^=(u=(x1^=(u=(x13^=(u=(x9^=(u=x5+x1|0)<<7|u>>>25)+x5|0)<<9|u>>>23)+x9|0)<<13|u>>>19)+x13|0)<<18|u>>>14,x10^=(u=(x6^=(u=(x2^=(u=(x14^=(u=x10+x6|0)<<7|u>>>25)+x10|0)<<9|u>>>23)+x14|0)<<13|u>>>19)+x2|0)<<18|u>>>14,x15^=(u=(x11^=(u=(x7^=(u=(x3^=(u=x15+x11|0)<<7|u>>>25)+x15|0)<<9|u>>>23)+x3|0)<<13|u>>>19)+x7|0)<<18|u>>>14,x0^=(u=(x3^=(u=(x2^=(u=(x1^=(u=x0+x3|0)<<7|u>>>25)+x0|0)<<9|u>>>23)+x1|0)<<13|u>>>19)+x2|0)<<18|u>>>14,x5^=(u=(x4^=(u=(x7^=(u=(x6^=(u=x5+x4|0)<<7|u>>>25)+x5|0)<<9|u>>>23)+x6|0)<<13|u>>>19)+x7|0)<<18|u>>>14,x10^=(u=(x9^=(u=(x8^=(u=(x11^=(u=x10+x9|0)<<7|u>>>25)+x10|0)<<9|u>>>23)+x11|0)<<13|u>>>19)+x8|0)<<18|u>>>14,x15^=(u=(x14^=(u=(x13^=(u=(x12^=(u=x15+x14|0)<<7|u>>>25)+x15|0)<<9|u>>>23)+x12|0)<<13|u>>>19)+x13|0)<<18|u>>>14;x0=x0+j0|0,x1=x1+j1|0,x2=x2+j2|0,x3=x3+j3|0,x4=x4+j4|0,x5=x5+j5|0,x6=x6+j6|0,x7=x7+j7|0,x8=x8+j8|0,x9=x9+j9|0,x10=x10+j10|0,x11=x11+j11|0,x12=x12+j12|0,x13=x13+j13|0,x14=x14+j14|0,x15=x15+j15|0,o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x1>>>0&255,o[5]=x1>>>8&255,o[6]=x1>>>16&255,o[7]=x1>>>24&255,o[8]=x2>>>0&255,o[9]=x2>>>8&255,o[10]=x2>>>16&255,o[11]=x2>>>24&255,o[12]=x3>>>0&255,o[13]=x3>>>8&255,o[14]=x3>>>16&255,o[15]=x3>>>24&255,o[16]=x4>>>0&255,o[17]=x4>>>8&255,o[18]=x4>>>16&255,o[19]=x4>>>24&255,o[20]=x5>>>0&255,o[21]=x5>>>8&255,o[22]=x5>>>16&255,o[23]=x5>>>24&255,o[24]=x6>>>0&255,o[25]=x6>>>8&255,o[26]=x6>>>16&255,o[27]=x6>>>24&255,o[28]=x7>>>0&255,o[29]=x7>>>8&255,o[30]=x7>>>16&255,o[31]=x7>>>24&255,o[32]=x8>>>0&255,o[33]=x8>>>8&255,o[34]=x8>>>16&255,o[35]=x8>>>24&255,o[36]=x9>>>0&255,o[37]=x9>>>8&255,o[38]=x9>>>16&255,o[39]=x9>>>24&255,o[40]=x10>>>0&255,o[41]=x10>>>8&255,o[42]=x10>>>16&255,o[43]=x10>>>24&255,o[44]=x11>>>0&255,o[45]=x11>>>8&255,o[46]=x11>>>16&255,o[47]=x11>>>24&255,o[48]=x12>>>0&255,o[49]=x12>>>8&255,o[50]=x12>>>16&255,o[51]=x12>>>24&255,o[52]=x13>>>0&255,o[53]=x13>>>8&255,o[54]=x13>>>16&255,o[55]=x13>>>24&255,o[56]=x14>>>0&255,o[57]=x14>>>8&255,o[58]=x14>>>16&255,o[59]=x14>>>24&255,o[60]=x15>>>0&255,o[61]=x15>>>8&255,o[62]=x15>>>16&255,o[63]=x15>>>24&255}(out,inp,k,c)}function crypto_core_hsalsa20(out,inp,k,c){!function core_hsalsa20(o,p,k,c){for(var u,x0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,x1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,x2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,x3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,x4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,x5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,x6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,x7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,x8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,x9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,x10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,x11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,x12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,x13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,x14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,x15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,i=0;i<20;i+=2)x0^=(u=(x12^=(u=(x8^=(u=(x4^=(u=x0+x12|0)<<7|u>>>25)+x0|0)<<9|u>>>23)+x4|0)<<13|u>>>19)+x8|0)<<18|u>>>14,x5^=(u=(x1^=(u=(x13^=(u=(x9^=(u=x5+x1|0)<<7|u>>>25)+x5|0)<<9|u>>>23)+x9|0)<<13|u>>>19)+x13|0)<<18|u>>>14,x10^=(u=(x6^=(u=(x2^=(u=(x14^=(u=x10+x6|0)<<7|u>>>25)+x10|0)<<9|u>>>23)+x14|0)<<13|u>>>19)+x2|0)<<18|u>>>14,x15^=(u=(x11^=(u=(x7^=(u=(x3^=(u=x15+x11|0)<<7|u>>>25)+x15|0)<<9|u>>>23)+x3|0)<<13|u>>>19)+x7|0)<<18|u>>>14,x0^=(u=(x3^=(u=(x2^=(u=(x1^=(u=x0+x3|0)<<7|u>>>25)+x0|0)<<9|u>>>23)+x1|0)<<13|u>>>19)+x2|0)<<18|u>>>14,x5^=(u=(x4^=(u=(x7^=(u=(x6^=(u=x5+x4|0)<<7|u>>>25)+x5|0)<<9|u>>>23)+x6|0)<<13|u>>>19)+x7|0)<<18|u>>>14,x10^=(u=(x9^=(u=(x8^=(u=(x11^=(u=x10+x9|0)<<7|u>>>25)+x10|0)<<9|u>>>23)+x11|0)<<13|u>>>19)+x8|0)<<18|u>>>14,x15^=(u=(x14^=(u=(x13^=(u=(x12^=(u=x15+x14|0)<<7|u>>>25)+x15|0)<<9|u>>>23)+x12|0)<<13|u>>>19)+x13|0)<<18|u>>>14;o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x5>>>0&255,o[5]=x5>>>8&255,o[6]=x5>>>16&255,o[7]=x5>>>24&255,o[8]=x10>>>0&255,o[9]=x10>>>8&255,o[10]=x10>>>16&255,o[11]=x10>>>24&255,o[12]=x15>>>0&255,o[13]=x15>>>8&255,o[14]=x15>>>16&255,o[15]=x15>>>24&255,o[16]=x6>>>0&255,o[17]=x6>>>8&255,o[18]=x6>>>16&255,o[19]=x6>>>24&255,o[20]=x7>>>0&255,o[21]=x7>>>8&255,o[22]=x7>>>16&255,o[23]=x7>>>24&255,o[24]=x8>>>0&255,o[25]=x8>>>8&255,o[26]=x8>>>16&255,o[27]=x8>>>24&255,o[28]=x9>>>0&255,o[29]=x9>>>8&255,o[30]=x9>>>16&255,o[31]=x9>>>24&255}(out,inp,k,c)}var sigma=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k){var u,i,z=new Uint8Array(16),x=new Uint8Array(64);for(i=0;i<16;i++)z[i]=0;for(i=0;i<8;i++)z[i]=n[i];for(;64<=b;){for(crypto_core_salsa20(x,z,k,sigma),i=0;i<64;i++)c[cpos+i]=m[mpos+i]^x[i];for(u=1,i=8;i<16;i++)u=u+(255&z[i])|0,z[i]=255&u,u>>>=8;b-=64,cpos+=64,mpos+=64}if(0>>=8;b-=64,cpos+=64}if(0>>13|t1<<3),t2=255&key[4]|(255&key[5])<<8,this.r[2]=7939&(t1>>>10|t2<<6),t3=255&key[6]|(255&key[7])<<8,this.r[3]=8191&(t2>>>7|t3<<9),t4=255&key[8]|(255&key[9])<<8,this.r[4]=255&(t3>>>4|t4<<12),this.r[5]=t4>>>1&8190,t5=255&key[10]|(255&key[11])<<8,this.r[6]=8191&(t4>>>14|t5<<2),t6=255&key[12]|(255&key[13])<<8,this.r[7]=8065&(t5>>>11|t6<<5),t7=255&key[14]|(255&key[15])<<8,this.r[8]=8191&(t6>>>8|t7<<8),this.r[9]=t7>>>5&127,this.pad[0]=255&key[16]|(255&key[17])<<8,this.pad[1]=255&key[18]|(255&key[19])<<8,this.pad[2]=255&key[20]|(255&key[21])<<8,this.pad[3]=255&key[22]|(255&key[23])<<8,this.pad[4]=255&key[24]|(255&key[25])<<8,this.pad[5]=255&key[26]|(255&key[27])<<8,this.pad[6]=255&key[28]|(255&key[29])<<8,this.pad[7]=255&key[30]|(255&key[31])<<8};function crypto_onetimeauth(out,outpos,m,mpos,n,k){var s=new poly1305(k);return s.update(m,mpos,n),s.finish(out,outpos),0}function crypto_onetimeauth_verify(h,hpos,m,mpos,n,k){var x=new Uint8Array(16);return crypto_onetimeauth(x,0,m,mpos,n,k),crypto_verify_16(h,hpos,x,0)}function crypto_secretbox(c,m,d,n,k){var i;if(d<32)return-1;for(crypto_stream_xor(c,0,m,0,d,n,k),crypto_onetimeauth(c,16,c,32,d-32,c),i=0;i<16;i++)c[i]=0;return 0}function crypto_secretbox_open(m,c,d,n,k){var i,x=new Uint8Array(32);if(d<32)return-1;if(crypto_stream(x,0,32,n,k),0!==crypto_onetimeauth_verify(c,16,c,32,d-32,x))return-1;for(crypto_stream_xor(m,0,c,0,d,n,k),i=0;i<32;i++)m[i]=0;return 0}function set25519(r,a){var i;for(i=0;i<16;i++)r[i]=0|a[i]}function car25519(o){var i,v,c=1;for(i=0;i<16;i++)v=o[i]+c+65535,c=Math.floor(v/65536),o[i]=v-65536*c;o[0]+=c-1+37*(c-1)}function sel25519(p,q,b){for(var t,c=~(b-1),i=0;i<16;i++)t=c&(p[i]^q[i]),p[i]^=t,q[i]^=t}function pack25519(o,n){var i,j,b,m=gf(),t=gf();for(i=0;i<16;i++)t[i]=n[i];for(car25519(t),car25519(t),car25519(t),j=0;j<2;j++){for(m[0]=t[0]-65517,i=1;i<15;i++)m[i]=t[i]-65535-(m[i-1]>>16&1),m[i-1]&=65535;m[15]=t[15]-32767-(m[14]>>16&1),b=m[15]>>16&1,m[14]&=65535,sel25519(t,m,1-b)}for(i=0;i<16;i++)o[2*i]=255&t[i],o[2*i+1]=t[i]>>8}function neq25519(a,b){var c=new Uint8Array(32),d=new Uint8Array(32);return pack25519(c,a),pack25519(d,b),crypto_verify_32(c,0,d,0)}function par25519(a){var d=new Uint8Array(32);return pack25519(d,a),1&d[0]}function unpack25519(o,n){var i;for(i=0;i<16;i++)o[i]=n[2*i]+(n[2*i+1]<<8);o[15]&=32767}function A(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]+b[i]}function Z(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]-b[i]}function M(o,a,b){var v,c,t0=0,t1=0,t2=0,t3=0,t4=0,t5=0,t6=0,t7=0,t8=0,t9=0,t10=0,t11=0,t12=0,t13=0,t14=0,t15=0,t16=0,t17=0,t18=0,t19=0,t20=0,t21=0,t22=0,t23=0,t24=0,t25=0,t26=0,t27=0,t28=0,t29=0,t30=0,b0=b[0],b1=b[1],b2=b[2],b3=b[3],b4=b[4],b5=b[5],b6=b[6],b7=b[7],b8=b[8],b9=b[9],b10=b[10],b11=b[11],b12=b[12],b13=b[13],b14=b[14],b15=b[15];t0+=(v=a[0])*b0,t1+=v*b1,t2+=v*b2,t3+=v*b3,t4+=v*b4,t5+=v*b5,t6+=v*b6,t7+=v*b7,t8+=v*b8,t9+=v*b9,t10+=v*b10,t11+=v*b11,t12+=v*b12,t13+=v*b13,t14+=v*b14,t15+=v*b15,t1+=(v=a[1])*b0,t2+=v*b1,t3+=v*b2,t4+=v*b3,t5+=v*b4,t6+=v*b5,t7+=v*b6,t8+=v*b7,t9+=v*b8,t10+=v*b9,t11+=v*b10,t12+=v*b11,t13+=v*b12,t14+=v*b13,t15+=v*b14,t16+=v*b15,t2+=(v=a[2])*b0,t3+=v*b1,t4+=v*b2,t5+=v*b3,t6+=v*b4,t7+=v*b5,t8+=v*b6,t9+=v*b7,t10+=v*b8,t11+=v*b9,t12+=v*b10,t13+=v*b11,t14+=v*b12,t15+=v*b13,t16+=v*b14,t17+=v*b15,t3+=(v=a[3])*b0,t4+=v*b1,t5+=v*b2,t6+=v*b3,t7+=v*b4,t8+=v*b5,t9+=v*b6,t10+=v*b7,t11+=v*b8,t12+=v*b9,t13+=v*b10,t14+=v*b11,t15+=v*b12,t16+=v*b13,t17+=v*b14,t18+=v*b15,t4+=(v=a[4])*b0,t5+=v*b1,t6+=v*b2,t7+=v*b3,t8+=v*b4,t9+=v*b5,t10+=v*b6,t11+=v*b7,t12+=v*b8,t13+=v*b9,t14+=v*b10,t15+=v*b11,t16+=v*b12,t17+=v*b13,t18+=v*b14,t19+=v*b15,t5+=(v=a[5])*b0,t6+=v*b1,t7+=v*b2,t8+=v*b3,t9+=v*b4,t10+=v*b5,t11+=v*b6,t12+=v*b7,t13+=v*b8,t14+=v*b9,t15+=v*b10,t16+=v*b11,t17+=v*b12,t18+=v*b13,t19+=v*b14,t20+=v*b15,t6+=(v=a[6])*b0,t7+=v*b1,t8+=v*b2,t9+=v*b3,t10+=v*b4,t11+=v*b5,t12+=v*b6,t13+=v*b7,t14+=v*b8,t15+=v*b9,t16+=v*b10,t17+=v*b11,t18+=v*b12,t19+=v*b13,t20+=v*b14,t21+=v*b15,t7+=(v=a[7])*b0,t8+=v*b1,t9+=v*b2,t10+=v*b3,t11+=v*b4,t12+=v*b5,t13+=v*b6,t14+=v*b7,t15+=v*b8,t16+=v*b9,t17+=v*b10,t18+=v*b11,t19+=v*b12,t20+=v*b13,t21+=v*b14,t22+=v*b15,t8+=(v=a[8])*b0,t9+=v*b1,t10+=v*b2,t11+=v*b3,t12+=v*b4,t13+=v*b5,t14+=v*b6,t15+=v*b7,t16+=v*b8,t17+=v*b9,t18+=v*b10,t19+=v*b11,t20+=v*b12,t21+=v*b13,t22+=v*b14,t23+=v*b15,t9+=(v=a[9])*b0,t10+=v*b1,t11+=v*b2,t12+=v*b3,t13+=v*b4,t14+=v*b5,t15+=v*b6,t16+=v*b7,t17+=v*b8,t18+=v*b9,t19+=v*b10,t20+=v*b11,t21+=v*b12,t22+=v*b13,t23+=v*b14,t24+=v*b15,t10+=(v=a[10])*b0,t11+=v*b1,t12+=v*b2,t13+=v*b3,t14+=v*b4,t15+=v*b5,t16+=v*b6,t17+=v*b7,t18+=v*b8,t19+=v*b9,t20+=v*b10,t21+=v*b11,t22+=v*b12,t23+=v*b13,t24+=v*b14,t25+=v*b15,t11+=(v=a[11])*b0,t12+=v*b1,t13+=v*b2,t14+=v*b3,t15+=v*b4,t16+=v*b5,t17+=v*b6,t18+=v*b7,t19+=v*b8,t20+=v*b9,t21+=v*b10,t22+=v*b11,t23+=v*b12,t24+=v*b13,t25+=v*b14,t26+=v*b15,t12+=(v=a[12])*b0,t13+=v*b1,t14+=v*b2,t15+=v*b3,t16+=v*b4,t17+=v*b5,t18+=v*b6,t19+=v*b7,t20+=v*b8,t21+=v*b9,t22+=v*b10,t23+=v*b11,t24+=v*b12,t25+=v*b13,t26+=v*b14,t27+=v*b15,t13+=(v=a[13])*b0,t14+=v*b1,t15+=v*b2,t16+=v*b3,t17+=v*b4,t18+=v*b5,t19+=v*b6,t20+=v*b7,t21+=v*b8,t22+=v*b9,t23+=v*b10,t24+=v*b11,t25+=v*b12,t26+=v*b13,t27+=v*b14,t28+=v*b15,t14+=(v=a[14])*b0,t15+=v*b1,t16+=v*b2,t17+=v*b3,t18+=v*b4,t19+=v*b5,t20+=v*b6,t21+=v*b7,t22+=v*b8,t23+=v*b9,t24+=v*b10,t25+=v*b11,t26+=v*b12,t27+=v*b13,t28+=v*b14,t29+=v*b15,t15+=(v=a[15])*b0,t1+=38*(t17+=v*b2),t2+=38*(t18+=v*b3),t3+=38*(t19+=v*b4),t4+=38*(t20+=v*b5),t5+=38*(t21+=v*b6),t6+=38*(t22+=v*b7),t7+=38*(t23+=v*b8),t8+=38*(t24+=v*b9),t9+=38*(t25+=v*b10),t10+=38*(t26+=v*b11),t11+=38*(t27+=v*b12),t12+=38*(t28+=v*b13),t13+=38*(t29+=v*b14),t14+=38*(t30+=v*b15),t0=(v=(t0+=38*(t16+=v*b1))+(c=1)+65535)-65536*(c=Math.floor(v/65536)),t1=(v=t1+c+65535)-65536*(c=Math.floor(v/65536)),t2=(v=t2+c+65535)-65536*(c=Math.floor(v/65536)),t3=(v=t3+c+65535)-65536*(c=Math.floor(v/65536)),t4=(v=t4+c+65535)-65536*(c=Math.floor(v/65536)),t5=(v=t5+c+65535)-65536*(c=Math.floor(v/65536)),t6=(v=t6+c+65535)-65536*(c=Math.floor(v/65536)),t7=(v=t7+c+65535)-65536*(c=Math.floor(v/65536)),t8=(v=t8+c+65535)-65536*(c=Math.floor(v/65536)),t9=(v=t9+c+65535)-65536*(c=Math.floor(v/65536)),t10=(v=t10+c+65535)-65536*(c=Math.floor(v/65536)),t11=(v=t11+c+65535)-65536*(c=Math.floor(v/65536)),t12=(v=t12+c+65535)-65536*(c=Math.floor(v/65536)),t13=(v=t13+c+65535)-65536*(c=Math.floor(v/65536)),t14=(v=t14+c+65535)-65536*(c=Math.floor(v/65536)),t15=(v=t15+c+65535)-65536*(c=Math.floor(v/65536)),t0=(v=(t0+=c-1+37*(c-1))+(c=1)+65535)-65536*(c=Math.floor(v/65536)),t1=(v=t1+c+65535)-65536*(c=Math.floor(v/65536)),t2=(v=t2+c+65535)-65536*(c=Math.floor(v/65536)),t3=(v=t3+c+65535)-65536*(c=Math.floor(v/65536)),t4=(v=t4+c+65535)-65536*(c=Math.floor(v/65536)),t5=(v=t5+c+65535)-65536*(c=Math.floor(v/65536)),t6=(v=t6+c+65535)-65536*(c=Math.floor(v/65536)),t7=(v=t7+c+65535)-65536*(c=Math.floor(v/65536)),t8=(v=t8+c+65535)-65536*(c=Math.floor(v/65536)),t9=(v=t9+c+65535)-65536*(c=Math.floor(v/65536)),t10=(v=t10+c+65535)-65536*(c=Math.floor(v/65536)),t11=(v=t11+c+65535)-65536*(c=Math.floor(v/65536)),t12=(v=t12+c+65535)-65536*(c=Math.floor(v/65536)),t13=(v=t13+c+65535)-65536*(c=Math.floor(v/65536)),t14=(v=t14+c+65535)-65536*(c=Math.floor(v/65536)),t15=(v=t15+c+65535)-65536*(c=Math.floor(v/65536)),t0+=c-1+37*(c-1),o[0]=t0,o[1]=t1,o[2]=t2,o[3]=t3,o[4]=t4,o[5]=t5,o[6]=t6,o[7]=t7,o[8]=t8,o[9]=t9,o[10]=t10,o[11]=t11,o[12]=t12,o[13]=t13,o[14]=t14,o[15]=t15}function S(o,a){M(o,a,a)}function inv25519(o,i){var a,c=gf();for(a=0;a<16;a++)c[a]=i[a];for(a=253;0<=a;a--)S(c,c),2!==a&&4!==a&&M(c,c,i);for(a=0;a<16;a++)o[a]=c[a]}function crypto_scalarmult(q,n,p){var r,i,z=new Uint8Array(32),x=new Float64Array(80),a=gf(),b=gf(),c=gf(),d=gf(),e=gf(),f=gf();for(i=0;i<31;i++)z[i]=n[i];for(z[31]=127&n[31]|64,z[0]&=248,unpack25519(x,p),i=0;i<16;i++)b[i]=x[i],d[i]=a[i]=c[i]=0;for(a[0]=d[0]=1,i=254;0<=i;--i)sel25519(a,b,r=z[i>>>3]>>>(7&i)&1),sel25519(c,d,r),A(e,a,c),Z(a,a,c),A(c,b,d),Z(b,b,d),S(d,e),S(f,a),M(a,c,a),M(c,b,e),A(e,a,c),Z(a,a,c),S(b,a),Z(c,d,f),M(a,c,_121665),A(a,a,d),M(c,c,a),M(a,d,f),M(d,b,x),S(b,e),sel25519(a,b,r),sel25519(c,d,r);for(i=0;i<16;i++)x[i+16]=a[i],x[i+32]=c[i],x[i+48]=b[i],x[i+64]=d[i];var x32=x.subarray(32),x16=x.subarray(16);return inv25519(x32,x32),M(x16,x16,x32),pack25519(q,x16),0}function crypto_scalarmult_base(q,n){return crypto_scalarmult(q,n,_9)}function crypto_box_keypair(y,x){return randombytes(x,32),crypto_scalarmult_base(y,x)}function crypto_box_beforenm(k,y,x){var s=new Uint8Array(32);return crypto_scalarmult(s,x,y),crypto_core_hsalsa20(k,_0,s,sigma)}poly1305.prototype.blocks=function(m,mpos,bytes){for(var t0,t1,t2,t3,t4,t5,t6,t7,c,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,hibit=this.fin?0:2048,h0=this.h[0],h1=this.h[1],h2=this.h[2],h3=this.h[3],h4=this.h[4],h5=this.h[5],h6=this.h[6],h7=this.h[7],h8=this.h[8],h9=this.h[9],r0=this.r[0],r1=this.r[1],r2=this.r[2],r3=this.r[3],r4=this.r[4],r5=this.r[5],r6=this.r[6],r7=this.r[7],r8=this.r[8],r9=this.r[9];16<=bytes;)d0=c=0,d0+=(h0+=8191&(t0=255&m[mpos+0]|(255&m[mpos+1])<<8))*r0,d0+=(h1+=8191&(t0>>>13|(t1=255&m[mpos+2]|(255&m[mpos+3])<<8)<<3))*(5*r9),d0+=(h2+=8191&(t1>>>10|(t2=255&m[mpos+4]|(255&m[mpos+5])<<8)<<6))*(5*r8),d0+=(h3+=8191&(t2>>>7|(t3=255&m[mpos+6]|(255&m[mpos+7])<<8)<<9))*(5*r7),c=(d0+=(h4+=8191&(t3>>>4|(t4=255&m[mpos+8]|(255&m[mpos+9])<<8)<<12))*(5*r6))>>>13,d0&=8191,d0+=(h5+=t4>>>1&8191)*(5*r5),d0+=(h6+=8191&(t4>>>14|(t5=255&m[mpos+10]|(255&m[mpos+11])<<8)<<2))*(5*r4),d0+=(h7+=8191&(t5>>>11|(t6=255&m[mpos+12]|(255&m[mpos+13])<<8)<<5))*(5*r3),d0+=(h8+=8191&(t6>>>8|(t7=255&m[mpos+14]|(255&m[mpos+15])<<8)<<8))*(5*r2),d1=c+=(d0+=(h9+=t7>>>5|hibit)*(5*r1))>>>13,d1+=h0*r1,d1+=h1*r0,d1+=h2*(5*r9),d1+=h3*(5*r8),c=(d1+=h4*(5*r7))>>>13,d1&=8191,d1+=h5*(5*r6),d1+=h6*(5*r5),d1+=h7*(5*r4),d1+=h8*(5*r3),c+=(d1+=h9*(5*r2))>>>13,d1&=8191,d2=c,d2+=h0*r2,d2+=h1*r1,d2+=h2*r0,d2+=h3*(5*r9),c=(d2+=h4*(5*r8))>>>13,d2&=8191,d2+=h5*(5*r7),d2+=h6*(5*r6),d2+=h7*(5*r5),d2+=h8*(5*r4),d3=c+=(d2+=h9*(5*r3))>>>13,d3+=h0*r3,d3+=h1*r2,d3+=h2*r1,d3+=h3*r0,c=(d3+=h4*(5*r9))>>>13,d3&=8191,d3+=h5*(5*r8),d3+=h6*(5*r7),d3+=h7*(5*r6),d3+=h8*(5*r5),d4=c+=(d3+=h9*(5*r4))>>>13,d4+=h0*r4,d4+=h1*r3,d4+=h2*r2,d4+=h3*r1,c=(d4+=h4*r0)>>>13,d4&=8191,d4+=h5*(5*r9),d4+=h6*(5*r8),d4+=h7*(5*r7),d4+=h8*(5*r6),d5=c+=(d4+=h9*(5*r5))>>>13,d5+=h0*r5,d5+=h1*r4,d5+=h2*r3,d5+=h3*r2,c=(d5+=h4*r1)>>>13,d5&=8191,d5+=h5*r0,d5+=h6*(5*r9),d5+=h7*(5*r8),d5+=h8*(5*r7),d6=c+=(d5+=h9*(5*r6))>>>13,d6+=h0*r6,d6+=h1*r5,d6+=h2*r4,d6+=h3*r3,c=(d6+=h4*r2)>>>13,d6&=8191,d6+=h5*r1,d6+=h6*r0,d6+=h7*(5*r9),d6+=h8*(5*r8),d7=c+=(d6+=h9*(5*r7))>>>13,d7+=h0*r7,d7+=h1*r6,d7+=h2*r5,d7+=h3*r4,c=(d7+=h4*r3)>>>13,d7&=8191,d7+=h5*r2,d7+=h6*r1,d7+=h7*r0,d7+=h8*(5*r9),d8=c+=(d7+=h9*(5*r8))>>>13,d8+=h0*r8,d8+=h1*r7,d8+=h2*r6,d8+=h3*r5,c=(d8+=h4*r4)>>>13,d8&=8191,d8+=h5*r3,d8+=h6*r2,d8+=h7*r1,d8+=h8*r0,d9=c+=(d8+=h9*(5*r9))>>>13,d9+=h0*r9,d9+=h1*r8,d9+=h2*r7,d9+=h3*r6,c=(d9+=h4*r5)>>>13,d9&=8191,d9+=h5*r4,d9+=h6*r3,d9+=h7*r2,d9+=h8*r1,h0=d0=8191&(c=(c=((c+=(d9+=h9*r0)>>>13)<<2)+c|0)+(d0&=8191)|0),h1=d1+=c>>>=13,h2=d2&=8191,h3=d3&=8191,h4=d4&=8191,h5=d5&=8191,h6=d6&=8191,h7=d7&=8191,h8=d8&=8191,h9=d9&=8191,mpos+=16,bytes-=16;this.h[0]=h0,this.h[1]=h1,this.h[2]=h2,this.h[3]=h3,this.h[4]=h4,this.h[5]=h5,this.h[6]=h6,this.h[7]=h7,this.h[8]=h8,this.h[9]=h9},poly1305.prototype.finish=function(mac,macpos){var c,mask,f,i,g=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(c=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=c,c=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*c,c=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=c,c=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=c,g[0]=this.h[0]+5,c=g[0]>>>13,g[0]&=8191,i=1;i<10;i++)g[i]=this.h[i]+c,c=g[i]>>>13,g[i]&=8191;for(g[9]-=8192,mask=(1^c)-1,i=0;i<10;i++)g[i]&=mask;for(mask=~mask,i=0;i<10;i++)this.h[i]=this.h[i]&mask|g[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),f=this.h[0]+this.pad[0],this.h[0]=65535&f,i=1;i<8;i++)f=(this.h[i]+this.pad[i]|0)+(f>>>16)|0,this.h[i]=65535&f;mac[macpos+0]=this.h[0]>>>0&255,mac[macpos+1]=this.h[0]>>>8&255,mac[macpos+2]=this.h[1]>>>0&255,mac[macpos+3]=this.h[1]>>>8&255,mac[macpos+4]=this.h[2]>>>0&255,mac[macpos+5]=this.h[2]>>>8&255,mac[macpos+6]=this.h[3]>>>0&255,mac[macpos+7]=this.h[3]>>>8&255,mac[macpos+8]=this.h[4]>>>0&255,mac[macpos+9]=this.h[4]>>>8&255,mac[macpos+10]=this.h[5]>>>0&255,mac[macpos+11]=this.h[5]>>>8&255,mac[macpos+12]=this.h[6]>>>0&255,mac[macpos+13]=this.h[6]>>>8&255,mac[macpos+14]=this.h[7]>>>0&255,mac[macpos+15]=this.h[7]>>>8&255},poly1305.prototype.update=function(m,mpos,bytes){var i,want;if(this.leftover){for(bytes<(want=16-this.leftover)&&(want=bytes),i=0;i>>16,c=65535&(h=ah7),d=h>>>16,a+=65535&(l=((bl4=al4)>>>14|(bh4=ah4)<<18)^(al4>>>18|ah4<<14)^(ah4>>>9|al4<<23)),b+=l>>>16,c+=65535&(h=(ah4>>>14|al4<<18)^(ah4>>>18|al4<<14)^(al4>>>9|ah4<<23)),d+=h>>>16,a+=65535&(l=al4&(bl5=al5)^~al4&(bl6=al6)),b+=l>>>16,c+=65535&(h=ah4&(bh5=ah5)^~ah4&(bh6=ah6)),d+=h>>>16,h=K[2*i],a+=65535&(l=K[2*i+1]),b+=l>>>16,c+=65535&h,d+=h>>>16,h=wh[i%16],b+=(l=wl[i%16])>>>16,c+=65535&h,d+=h>>>16,c+=(b+=(a+=65535&l)>>>16)>>>16,a=65535&(l=tl=65535&a|b<<16),b=l>>>16,c=65535&(h=th=65535&c|(d+=c>>>16)<<16),d=h>>>16,a+=65535&(l=(al0>>>28|ah0<<4)^(ah0>>>2|al0<<30)^(ah0>>>7|al0<<25)),b+=l>>>16,c+=65535&(h=(ah0>>>28|al0<<4)^(al0>>>2|ah0<<30)^(al0>>>7|ah0<<25)),d+=h>>>16,b+=(l=al0&al1^al0&al2^al1&al2)>>>16,c+=65535&(h=ah0&ah1^ah0&ah2^ah1&ah2),d+=h>>>16,bh7=65535&(c+=(b+=(a+=65535&l)>>>16)>>>16)|(d+=c>>>16)<<16,bl7=65535&a|b<<16,a=65535&(l=bl3),b=l>>>16,c=65535&(h=bh3),d=h>>>16,b+=(l=tl)>>>16,c+=65535&(h=th),d+=h>>>16,ah1=bh0,ah2=bh1,ah3=bh2,ah4=bh3=65535&(c+=(b+=(a+=65535&l)>>>16)>>>16)|(d+=c>>>16)<<16,ah5=bh4,ah6=bh5,ah7=bh6,ah0=bh7,al1=bl0,al2=bl1,al3=bl2,al4=bl3=65535&a|b<<16,al5=bl4,al6=bl5,al7=bl6,al0=bl7,i%16==15)for(j=0;j<16;j++)h=wh[j],a=65535&(l=wl[j]),b=l>>>16,c=65535&h,d=h>>>16,h=wh[(j+9)%16],a+=65535&(l=wl[(j+9)%16]),b+=l>>>16,c+=65535&h,d+=h>>>16,th=wh[(j+1)%16],a+=65535&(l=((tl=wl[(j+1)%16])>>>1|th<<31)^(tl>>>8|th<<24)^(tl>>>7|th<<25)),b+=l>>>16,c+=65535&(h=(th>>>1|tl<<31)^(th>>>8|tl<<24)^th>>>7),d+=h>>>16,th=wh[(j+14)%16],b+=(l=((tl=wl[(j+14)%16])>>>19|th<<13)^(th>>>29|tl<<3)^(tl>>>6|th<<26))>>>16,c+=65535&(h=(th>>>19|tl<<13)^(tl>>>29|th<<3)^th>>>6),d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,wh[j]=65535&c|d<<16,wl[j]=65535&a|b<<16;a=65535&(l=al0),b=l>>>16,c=65535&(h=ah0),d=h>>>16,h=hh[0],b+=(l=hl[0])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[0]=ah0=65535&c|d<<16,hl[0]=al0=65535&a|b<<16,a=65535&(l=al1),b=l>>>16,c=65535&(h=ah1),d=h>>>16,h=hh[1],b+=(l=hl[1])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[1]=ah1=65535&c|d<<16,hl[1]=al1=65535&a|b<<16,a=65535&(l=al2),b=l>>>16,c=65535&(h=ah2),d=h>>>16,h=hh[2],b+=(l=hl[2])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[2]=ah2=65535&c|d<<16,hl[2]=al2=65535&a|b<<16,a=65535&(l=al3),b=l>>>16,c=65535&(h=ah3),d=h>>>16,h=hh[3],b+=(l=hl[3])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[3]=ah3=65535&c|d<<16,hl[3]=al3=65535&a|b<<16,a=65535&(l=al4),b=l>>>16,c=65535&(h=ah4),d=h>>>16,h=hh[4],b+=(l=hl[4])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[4]=ah4=65535&c|d<<16,hl[4]=al4=65535&a|b<<16,a=65535&(l=al5),b=l>>>16,c=65535&(h=ah5),d=h>>>16,h=hh[5],b+=(l=hl[5])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[5]=ah5=65535&c|d<<16,hl[5]=al5=65535&a|b<<16,a=65535&(l=al6),b=l>>>16,c=65535&(h=ah6),d=h>>>16,h=hh[6],b+=(l=hl[6])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[6]=ah6=65535&c|d<<16,hl[6]=al6=65535&a|b<<16,a=65535&(l=al7),b=l>>>16,c=65535&(h=ah7),d=h>>>16,h=hh[7],b+=(l=hl[7])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[7]=ah7=65535&c|d<<16,hl[7]=al7=65535&a|b<<16,pos+=128,n-=128}return n}function crypto_hash(out,m,n){var i,hh=new Int32Array(8),hl=new Int32Array(8),x=new Uint8Array(256),b=n;for(hh[0]=1779033703,hh[1]=3144134277,hh[2]=1013904242,hh[3]=2773480762,hh[4]=1359893119,hh[5]=2600822924,hh[6]=528734635,hh[7]=1541459225,hl[0]=4089235720,hl[1]=2227873595,hl[2]=4271175723,hl[3]=1595750129,hl[4]=2917565137,hl[5]=725511199,hl[6]=4215389547,hl[7]=327033209,crypto_hashblocks_hl(hh,hl,m,n),n%=128,i=0;i>(7&i)&1),add(q,p),add(p,p),cswap(p,q,b)}function scalarbase(p,s){var q=[gf(),gf(),gf(),gf()];set25519(q[0],X),set25519(q[1],Y),set25519(q[2],gf1),M(q[3],X,Y),scalarmult(p,q,s)}function crypto_sign_keypair(pk,sk,seeded){var i,d=new Uint8Array(64),p=[gf(),gf(),gf(),gf()];for(seeded||randombytes(sk,32),crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64,scalarbase(p,d),pack(pk,p),i=0;i<32;i++)sk[i+32]=pk[i];return 0}var L=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function modL(r,x){var carry,i,j,k;for(i=63;32<=i;--i){for(carry=0,j=i-32,k=i-12;j>8,x[j]-=256*carry;x[j]+=carry,x[i]=0}for(j=carry=0;j<32;j++)x[j]+=carry-(x[31]>>4)*L[j],carry=x[j]>>8,x[j]&=255;for(j=0;j<32;j++)x[j]-=carry*L[j];for(i=0;i<32;i++)x[i+1]+=x[i]>>8,r[i]=255&x[i]}function reduce(r){var i,x=new Float64Array(64);for(i=0;i<64;i++)x[i]=r[i];for(i=0;i<64;i++)r[i]=0;modL(r,x)}function crypto_sign(sm,m,n,sk){var i,j,d=new Uint8Array(64),h=new Uint8Array(64),r=new Uint8Array(64),x=new Float64Array(64),p=[gf(),gf(),gf(),gf()];crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64;var smlen=n+64;for(i=0;i>7&&Z(r[0],gf0,r[0]),M(r[3],r[0],r[1]),0)}function crypto_sign_open(m,sm,n,pk){var i,t=new Uint8Array(32),h=new Uint8Array(64),p=[gf(),gf(),gf(),gf()],q=[gf(),gf(),gf(),gf()];if(-1,n<64)return-1;if(unpackneg(q,pk))return-1;for(i=0;i>>32-n}function fnF(a,b,c,d,m,k,s){return rotl(a+(b&c|~b&d)+m+k|0,s)+b|0}function fnG(a,b,c,d,m,k,s){return rotl(a+(b&d|c&~d)+m+k|0,s)+b|0}function fnH(a,b,c,d,m,k,s){return rotl(a+(b^c^d)+m+k|0,s)+b|0}function fnI(a,b,c,d,m,k,s){return rotl(a+(c^(b|~d))+m+k|0,s)+b|0}inherits(MD5,HashBase),MD5.prototype._update=function(){for(var M=ARRAY16,i=0;i<16;++i)M[i]=this._block.readInt32LE(4*i);var a=this._a,b=this._b,c=this._c,d=this._d;b=fnI(b=fnI(b=fnI(b=fnI(b=fnH(b=fnH(b=fnH(b=fnH(b=fnG(b=fnG(b=fnG(b=fnG(b=fnF(b=fnF(b=fnF(b=fnF(b,c=fnF(c,d=fnF(d,a=fnF(a,b,c,d,M[0],3614090360,7),b,c,M[1],3905402710,12),a,b,M[2],606105819,17),d,a,M[3],3250441966,22),c=fnF(c,d=fnF(d,a=fnF(a,b,c,d,M[4],4118548399,7),b,c,M[5],1200080426,12),a,b,M[6],2821735955,17),d,a,M[7],4249261313,22),c=fnF(c,d=fnF(d,a=fnF(a,b,c,d,M[8],1770035416,7),b,c,M[9],2336552879,12),a,b,M[10],4294925233,17),d,a,M[11],2304563134,22),c=fnF(c,d=fnF(d,a=fnF(a,b,c,d,M[12],1804603682,7),b,c,M[13],4254626195,12),a,b,M[14],2792965006,17),d,a,M[15],1236535329,22),c=fnG(c,d=fnG(d,a=fnG(a,b,c,d,M[1],4129170786,5),b,c,M[6],3225465664,9),a,b,M[11],643717713,14),d,a,M[0],3921069994,20),c=fnG(c,d=fnG(d,a=fnG(a,b,c,d,M[5],3593408605,5),b,c,M[10],38016083,9),a,b,M[15],3634488961,14),d,a,M[4],3889429448,20),c=fnG(c,d=fnG(d,a=fnG(a,b,c,d,M[9],568446438,5),b,c,M[14],3275163606,9),a,b,M[3],4107603335,14),d,a,M[8],1163531501,20),c=fnG(c,d=fnG(d,a=fnG(a,b,c,d,M[13],2850285829,5),b,c,M[2],4243563512,9),a,b,M[7],1735328473,14),d,a,M[12],2368359562,20),c=fnH(c,d=fnH(d,a=fnH(a,b,c,d,M[5],4294588738,4),b,c,M[8],2272392833,11),a,b,M[11],1839030562,16),d,a,M[14],4259657740,23),c=fnH(c,d=fnH(d,a=fnH(a,b,c,d,M[1],2763975236,4),b,c,M[4],1272893353,11),a,b,M[7],4139469664,16),d,a,M[10],3200236656,23),c=fnH(c,d=fnH(d,a=fnH(a,b,c,d,M[13],681279174,4),b,c,M[0],3936430074,11),a,b,M[3],3572445317,16),d,a,M[6],76029189,23),c=fnH(c,d=fnH(d,a=fnH(a,b,c,d,M[9],3654602809,4),b,c,M[12],3873151461,11),a,b,M[15],530742520,16),d,a,M[2],3299628645,23),c=fnI(c,d=fnI(d,a=fnI(a,b,c,d,M[0],4096336452,6),b,c,M[7],1126891415,10),a,b,M[14],2878612391,15),d,a,M[5],4237533241,21),c=fnI(c,d=fnI(d,a=fnI(a,b,c,d,M[12],1700485571,6),b,c,M[3],2399980690,10),a,b,M[10],4293915773,15),d,a,M[1],2240044497,21),c=fnI(c,d=fnI(d,a=fnI(a,b,c,d,M[8],1873313359,6),b,c,M[15],4264355552,10),a,b,M[6],2734768916,15),d,a,M[13],1309151649,21),c=fnI(c,d=fnI(d,a=fnI(a,b,c,d,M[4],4149444226,6),b,c,M[11],3174756917,10),a,b,M[2],718787259,15),d,a,M[9],3951481745,21),this._a=this._a+a|0,this._b=this._b+b|0,this._c=this._c+c|0,this._d=this._d+d|0},MD5.prototype._digest=function(){this._block[this._blockOffset++]=128,56=this._blockSize;){for(var i=this._blockOffset;istate.highWaterMark&&(state.highWaterMark=function computeNewHighWaterMark(n){return MAX_HWM<=n?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?pna.nextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,pna.nextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=function fromListPartial(n,list,hasStrings){var ret;nstr.length?str.length:n;if(nb===str.length?ret+=str:ret+=str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p).data=str.slice(nb);break}++c}return list.length-=c,ret}(n,list):function copyFromBuffer(n,list){var ret=Buffer.allocUnsafe(n),p=list.head,c=1;p.data.copy(ret),n-=p.data.length;for(;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p).data=buf.slice(nb);break}++c}return list.length-=c,ret}(n,list);return ret}(n,state.buffer,state.decoder),ret);var ret}function endReadable(stream){var state=stream._readableState;if(0=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var ret,doRead=state.needReadable;return debug("need readable",doRead),(0===state.length||state.length-n>>32-n}function fn1(a,b,c,d,e,m,k,s){return rotl(a+(b^c^d)+m+k|0,s)+e|0}function fn2(a,b,c,d,e,m,k,s){return rotl(a+(b&c|~b&d)+m+k|0,s)+e|0}function fn3(a,b,c,d,e,m,k,s){return rotl(a+((b|~c)^d)+m+k|0,s)+e|0}function fn4(a,b,c,d,e,m,k,s){return rotl(a+(b&d|c&~d)+m+k|0,s)+e|0}function fn5(a,b,c,d,e,m,k,s){return rotl(a+(b^(c|~d))+m+k|0,s)+e|0}inherits(RIPEMD160,HashBase),RIPEMD160.prototype._update=function(){for(var words=ARRAY16,j=0;j<16;++j)words[j]=this._block.readInt32LE(4*j);for(var al=0|this._a,bl=0|this._b,cl=0|this._c,dl=0|this._d,el=0|this._e,ar=0|this._a,br=0|this._b,cr=0|this._c,dr=0|this._d,er=0|this._e,i=0;i<80;i+=1){var tl,tr;tr=i<16?(tl=fn1(al,bl,cl,dl,el,words[zl[i]],hl[0],sl[i]),fn5(ar,br,cr,dr,er,words[zr[i]],hr[0],sr[i])):i<32?(tl=fn2(al,bl,cl,dl,el,words[zl[i]],hl[1],sl[i]),fn4(ar,br,cr,dr,er,words[zr[i]],hr[1],sr[i])):i<48?(tl=fn3(al,bl,cl,dl,el,words[zl[i]],hl[2],sl[i]),fn3(ar,br,cr,dr,er,words[zr[i]],hr[2],sr[i])):i<64?(tl=fn4(al,bl,cl,dl,el,words[zl[i]],hl[3],sl[i]),fn2(ar,br,cr,dr,er,words[zr[i]],hr[3],sr[i])):(tl=fn5(al,bl,cl,dl,el,words[zl[i]],hl[4],sl[i]),fn1(ar,br,cr,dr,er,words[zr[i]],hr[4],sr[i])),al=el,el=dl,dl=rotl(cl,10),cl=bl,bl=tl,ar=er,er=dr,dr=rotl(cr,10),cr=br,br=tr}var t=this._b+cl+dr|0;this._b=this._c+dl+er|0,this._c=this._d+el+ar|0,this._d=this._e+al+br|0,this._e=this._a+bl+cr|0,this._a=t},RIPEMD160.prototype._digest=function(){this._block[this._blockOffset++]=128,56>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10)}function sigma1(x){return(x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7)}function gamma0(x){return(x>>>7|x<<25)^(x>>>18|x<<14)^x>>>3}inherits(Sha256,Hash),Sha256.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},Sha256.prototype._update=function(M){for(var x,W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,f=0|this._f,g=0|this._g,h=0|this._h,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<64;++i)W[i]=0|(((x=W[i-2])>>>17|x<<15)^(x>>>19|x<<13)^x>>>10)+W[i-7]+gamma0(W[i-15])+W[i-16];for(var j=0;j<64;++j){var T1=h+sigma1(e)+ch(e,f,g)+K[j]+W[j]|0,T2=sigma0(a)+maj(a,b,c)|0;h=g,g=f,f=e,e=d+T1|0,d=c,c=b,b=a,a=T1+T2|0}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0,this._f=f+this._f|0,this._g=g+this._g|0,this._h=h+this._h|0},Sha256.prototype._hash=function(){var H=Buffer.allocUnsafe(32);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H.writeInt32BE(this._h,28),H},module.exports=Sha256},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,K=[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],W=new Array(160);function Sha512(){this.init(),this._w=W,Hash.call(this,128,112)}function Ch(x,y,z){return z^x&(y^z)}function maj(x,y,z){return x&y|z&(x|y)}function sigma0(x,xl){return(x>>>28|xl<<4)^(xl>>>2|x<<30)^(xl>>>7|x<<25)}function sigma1(x,xl){return(x>>>14|xl<<18)^(x>>>18|xl<<14)^(xl>>>9|x<<23)}function Gamma0(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^x>>>7}function Gamma0l(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^(x>>>7|xl<<25)}function Gamma1(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^x>>>6}function Gamma1l(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^(x>>>6|xl<<26)}function getCarry(a,b){return a>>>0>>0?1:0}inherits(Sha512,Hash),Sha512.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},Sha512.prototype._update=function(M){for(var W=this._w,ah=0|this._ah,bh=0|this._bh,ch=0|this._ch,dh=0|this._dh,eh=0|this._eh,fh=0|this._fh,gh=0|this._gh,hh=0|this._hh,al=0|this._al,bl=0|this._bl,cl=0|this._cl,dl=0|this._dl,el=0|this._el,fl=0|this._fl,gl=0|this._gl,hl=0|this._hl,i=0;i<32;i+=2)W[i]=M.readInt32BE(4*i),W[i+1]=M.readInt32BE(4*i+4);for(;i<160;i+=2){var xh=W[i-30],xl=W[i-30+1],gamma0=Gamma0(xh,xl),gamma0l=Gamma0l(xl,xh),gamma1=Gamma1(xh=W[i-4],xl=W[i-4+1]),gamma1l=Gamma1l(xl,xh),Wi7h=W[i-14],Wi7l=W[i-14+1],Wi16h=W[i-32],Wi16l=W[i-32+1],Wil=gamma0l+Wi7l|0,Wih=gamma0+Wi7h+getCarry(Wil,gamma0l)|0;Wih=(Wih=Wih+gamma1+getCarry(Wil=Wil+gamma1l|0,gamma1l)|0)+Wi16h+getCarry(Wil=Wil+Wi16l|0,Wi16l)|0,W[i]=Wih,W[i+1]=Wil}for(var j=0;j<160;j+=2){Wih=W[j],Wil=W[j+1];var majh=maj(ah,bh,ch),majl=maj(al,bl,cl),sigma0h=sigma0(ah,al),sigma0l=sigma0(al,ah),sigma1h=sigma1(eh,el),sigma1l=sigma1(el,eh),Kih=K[j],Kil=K[j+1],chh=Ch(eh,fh,gh),chl=Ch(el,fl,gl),t1l=hl+sigma1l|0,t1h=hh+sigma1h+getCarry(t1l,hl)|0;t1h=(t1h=(t1h=t1h+chh+getCarry(t1l=t1l+chl|0,chl)|0)+Kih+getCarry(t1l=t1l+Kil|0,Kil)|0)+Wih+getCarry(t1l=t1l+Wil|0,Wil)|0;var t2l=sigma0l+majl|0,t2h=sigma0h+majh+getCarry(t2l,sigma0l)|0;hh=gh,hl=gl,gh=fh,gl=fl,fh=eh,fl=el,eh=dh+t1h+getCarry(el=dl+t1l|0,dl)|0,dh=ch,dl=cl,ch=bh,cl=bl,bh=ah,bl=al,ah=t1h+t2h+getCarry(al=t1l+t2l|0,t1l)|0}this._al=this._al+al|0,this._bl=this._bl+bl|0,this._cl=this._cl+cl|0,this._dl=this._dl+dl|0,this._el=this._el+el|0,this._fl=this._fl+fl|0,this._gl=this._gl+gl|0,this._hl=this._hl+hl|0,this._ah=this._ah+ah+getCarry(this._al,al)|0,this._bh=this._bh+bh+getCarry(this._bl,bl)|0,this._ch=this._ch+ch+getCarry(this._cl,cl)|0,this._dh=this._dh+dh+getCarry(this._dl,dl)|0,this._eh=this._eh+eh+getCarry(this._el,el)|0,this._fh=this._fh+fh+getCarry(this._fl,fl)|0,this._gh=this._gh+gh+getCarry(this._gl,gl)|0,this._hh=this._hh+hh+getCarry(this._hl,hl)|0},Sha512.prototype._hash=function(){var H=Buffer.allocUnsafe(64);function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),writeInt64BE(this._gh,this._gl,48),writeInt64BE(this._hh,this._hl,56),H},module.exports=Sha512},function(module,exports,__webpack_require__){(function(Buffer){var MAX_ALLOC=Math.pow(2,30)-1;function checkBuffer(buf,name){if("string"!=typeof buf&&!Buffer.isBuffer(buf))throw new TypeError(name+" must be a buffer or string")}module.exports=function(password,salt,iterations,keylen){if(checkBuffer(password,"Password"),checkBuffer(salt,"Salt"),"number"!=typeof iterations)throw new TypeError("Iterations not a number");if(iterations<0)throw new TypeError("Bad iterations");if("number"!=typeof keylen)throw new TypeError("Key length not a number");if(keylen<0||MAX_ALLOCblocksize?key=hash(key):key.length=Utils.MaxSecond)throw new RangeError("Second have to be >= "+Utils.MinSecond+", and <: "+Utils.MaxSecond);data=encodeFieldNumberAndType(1,WireMap[Types.Time]).concat(encodeUVarint(s))}return data},encodeFieldNumberAndType=function encodeFieldNumberAndType(num,type){var encodedVal=num<<3|type;return varint.encode(encodedVal)};if(module.exports={encodeSignedVarint:encodeSignedVarint,encodeFieldNumberAndType:encodeFieldNumberAndType,encodeString:function encodeString(input){return encodeSlice(Array.from(Buffer.from(input)))},encodeInt8:function encodeInt8(input){return encodeSignedVarint(input)},encodeInt16:function encodeInt16(input){return encodeSignedVarint(input)},encodeInt32:function encodeInt32(input){var buffer=new ArrayBuffer(4);return new DataView(buffer).setUint32(0,input,!0),Array.from(new Uint8Array(buffer))},encodeInt64:function encodeInt64(input){var buff=Buffer(8);return Int53.writeInt64LE(input,buff,0),Array.from(new Int32Array(buff))},encodeSlice:encodeSlice,encodeBoolean:function encodeBoolean(input){return encodeUint8(input?1:0)},encodeUVarint:encodeUVarint,encodeTime:encodeTime},__webpack_require__.c[__webpack_require__.s]==module){var result=encodeTime(new Date("01 Dec 2018 00:12:00 GMT"));console.log(result)}}).call(this,__webpack_require__(12)(module))},function(module,exports,__webpack_require__){"use strict";var varint=__webpack_require__(20);exports.encode=function encode(v,b,o){v=0<=v?2*v:-2*v-1;var r=varint.encode(v,b,o);return encode.bytes=varint.encode.bytes,r},exports.decode=function decode(b,o){var v=varint.decode(b,o);return decode.bytes=varint.decode.bytes,1&v?(v+1)/-2:v/2},exports.encodingLength=function(v){return varint.encodingLength(0<=v?2*v:-2*v-1)}},function(module,exports,__webpack_require__){"use strict";var int53={},MAX_UINT32=4294967295,MAX_INT53=9007199254740991;function onesComplement(number){return(number=~number)<0&&(number=2147483648+(2147483647&number)),number}function uintHighLow(number){console.assert(-1Number.MaxInt8)throw new TypeError("EOF decoding int8");return{data:Int8Array.from([result.data])[0],byteLength:result.byteLength}},decodeInt16:function decodeInt16(input){var result=decodeSignedVarint(input);if(result.data>Number.MaxInt16)throw new TypeError("EOF decoding int8");return{data:new Int16Array.from([result])[0],byteLength:result.byteLength}},decodeInt64:function decodeInt64(input){var buf=Buffer.from(input.slice(0,8));return{data:Int53.readInt64LE(buf,0),byteLength:8}},decodeString:function decodeString(input){var decodedSlice=decodeSlice(input);return{data:Buffer.from(decodedSlice.data).toString("utf8"),byteLength:decodedSlice.byteLength}},decodeFieldNumberAndType:function decodeFieldNumberAndType(bz){var decodedData=decodeUVarint(bz),wiretypeNumber=7&decodedData.data,idx=decodedData.data>>3;if(536870911>25;return(33554431&pre)<<5^996825010&-(b>>0&1)^642813549&-(b>>1&1)^513874426&-(b>>2&1)^1027748829&-(b>>3&1)^705979059&-(b>>4&1)}function prefixChk(prefix){for(var chk=1,i=0;i>5}for(chk=polymodStep(chk),i=0;i>bits&maxV);if(pad)0LIMIT)throw new TypeError("Exceeds length limit");var lowered=str.toLowerCase(),uppered=str.toUpperCase();if(str!==lowered&&str!==uppered)throw new Error("Mixed-case string "+str);var split=(str=lowered).lastIndexOf("1");if(-1===split)throw new Error("No separator character for "+str);if(0===split)throw new Error("Missing prefix for "+str);var prefix=str.slice(0,split),wordChars=str.slice(split+1);if(wordChars.length<6)throw new Error("Data too short");for(var chk=prefixChk(prefix),words=[],i=0;i=wordChars.length||words.push(v)}if(1!==chk)throw new Error("Invalid checksum for "+str);return{prefix:prefix,words:words}},encode:function encode(prefix,words,LIMIT){if(LIMIT=LIMIT||90,prefix.length+7+words.length>LIMIT)throw new TypeError("Exceeds length limit");for(var chk=prefixChk(prefix=prefix.toLowerCase()),result=prefix+"1",i=0;i>5!=0)throw new Error("Non 5-bit word");chk=polymodStep(chk)^x,result+=ALPHABET.charAt(x)}for(i=0;i<6;++i)chk=polymodStep(chk);for(chk^=1,i=0;i<6;++i)result+=ALPHABET.charAt(chk>>5*(5-i)&31);return result},toWords:function toWords(bytes){return convert(bytes,8,5,!0)},fromWords:function fromWords(words){return convert(words,5,8,!1)}}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),function(module){var global,_src_index__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(21),_src_index__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_src_index__WEBPACK_IMPORTED_MODULE_0__);global="undefined"!=typeof window?window:void 0,"object"==typeof module.exports?module.exports=_src_index__WEBPACK_IMPORTED_MODULE_0___default.a:global.QWeb=_src_index__WEBPACK_IMPORTED_MODULE_0___default.a}.call(this,__webpack_require__(53)(module))},function(module,exports){module.exports=function(originalModule){if(!originalModule.webpackPolyfill){var module=Object.create(originalModule);module.children||(module.children=[]),Object.defineProperty(module,"loaded",{enumerable:!0,get:function(){return module.l}}),Object.defineProperty(module,"id",{enumerable:!0,get:function(){return module.i}}),Object.defineProperty(module,"exports",{enumerable:!0}),module.webpackPolyfill=1}return module}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i>16&255,arr[curByte++]=tmp>>8&255,arr[curByte++]=255&tmp;2===placeHoldersLen&&(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[curByte++]=255&tmp);1===placeHoldersLen&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[curByte++]=tmp>>8&255,arr[curByte++]=255&tmp);return arr},exports.fromByteArray=function fromByteArray(uint8){for(var tmp,len=uint8.length,extraBytes=len%3,parts=[],i=0,len2=len-extraBytes;i>2]+lookup[tmp<<4&63]+"==")):2==extraBytes&&(tmp=(uint8[len-2]<<8)+uint8[len-1],parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"="));return parts.join("")};for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[63&num]);return output.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63},function(module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=8*nBytes-mLen-1,eMax=(1<>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;0>=-nBits,nBits+=mLen;0>1,rt=23===mLen?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||0===value&&1/value<0?1:0;for(value=Math.abs(value),isNaN(value)||value===1/0?(m=isNaN(value)?1:0,e=eMax):(e=Math.floor(Math.log(value)/Math.LN2),value*(c=Math.pow(2,-e))<1&&(e--,c*=2),2<=(value+=1<=e+eBias?rt/c:rt*Math.pow(2,1-eBias))*c&&(e++,c/=2),eMax<=e+eBias?(m=0,e=eMax):1<=e+eBias?(m=(value*c-1)*Math.pow(2,mLen),e+=eBias):(m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen),e=0));8<=mLen;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<>6:(bytes[index++]=code<55296||57344<=code?224|code>>12:(code=65536+((1023&code)<<10|1023&key.charCodeAt(++i)),bytes[index++]=240|code>>18,128|code>>12&63),128|code>>6&63),128|63&code);key=bytes}else{if("object"!==type)throw new Error(ERROR);if(null===key)throw new Error(ERROR);if(ARRAY_BUFFER&&key.constructor===ArrayBuffer)key=new Uint8Array(key);else if(!(Array.isArray(key)||ARRAY_BUFFER&&ArrayBuffer.isView(key)))throw new Error(ERROR)}64>2]|=message[index]<>2]|=code<>2]|=(192|code>>6)<>2]|=(224|code>>12)<>2]|=(240|code>>18)<>2]|=(128|code>>12&63)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=EXTRA[3&i],this.block=blocks[16],56<=i&&(this.hashed||this.hash(),blocks[0]=this.block,blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0),blocks[14]=this.hBytes<<3|this.bytes>>>29,blocks[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var j,s0,s1,maj,t1,ab,da,cd,bc,a=this.h0,b=this.h1,c=this.h2,d=this.h3,e=this.h4,f=this.h5,g=this.h6,h=this.h7,blocks=this.blocks;for(j=16;j<64;++j)s0=((t1=blocks[j-15])>>>7|t1<<25)^(t1>>>18|t1<<14)^t1>>>3,s1=((t1=blocks[j-2])>>>17|t1<<15)^(t1>>>19|t1<<13)^t1>>>10,blocks[j]=blocks[j-16]+s0+blocks[j-7]+s1<<0;for(bc=b&c,j=0;j<64;j+=4)this.first?(d=this.is224?(ab=300032,h=(t1=blocks[0]-1413257819)-150054599<<0,t1+24177077<<0):(ab=704751109,h=(t1=blocks[0]-210244248)-1521486534<<0,t1+143694565<<0),this.first=!1):(s0=(a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10),maj=(ab=a&b)^a&c^bc,h=d+(t1=h+(s1=(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7))+(e&f^~e&g)+K[j]+blocks[j])<<0,d=t1+(s0+maj)<<0),s0=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),maj=(da=d&a)^d&b^ab,g=c+(t1=g+(s1=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&e^~h&f)+K[j+1]+blocks[j+1])<<0,s0=((c=t1+(s0+maj)<<0)>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),maj=(cd=c&d)^c&a^da,f=b+(t1=f+(s1=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&h^~g&e)+K[j+2]+blocks[j+2])<<0,s0=((b=t1+(s0+maj)<<0)>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10),maj=(bc=b&c)^b&d^cd,e=a+(t1=e+(s1=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&g^~f&h)+K[j+3]+blocks[j+3])<<0,a=t1+(s0+maj)<<0;this.h0=this.h0+a<<0,this.h1=this.h1+b<<0,this.h2=this.h2+c<<0,this.h3=this.h3+d<<0,this.h4=this.h4+e<<0,this.h5=this.h5+f<<0,this.h6=this.h6+g<<0,this.h7=this.h7+h<<0},Sha256.prototype.hex=function(){this.finalize();var h0=this.h0,h1=this.h1,h2=this.h2,h3=this.h3,h4=this.h4,h5=this.h5,h6=this.h6,h7=this.h7,hex=HEX_CHARS[h0>>28&15]+HEX_CHARS[h0>>24&15]+HEX_CHARS[h0>>20&15]+HEX_CHARS[h0>>16&15]+HEX_CHARS[h0>>12&15]+HEX_CHARS[h0>>8&15]+HEX_CHARS[h0>>4&15]+HEX_CHARS[15&h0]+HEX_CHARS[h1>>28&15]+HEX_CHARS[h1>>24&15]+HEX_CHARS[h1>>20&15]+HEX_CHARS[h1>>16&15]+HEX_CHARS[h1>>12&15]+HEX_CHARS[h1>>8&15]+HEX_CHARS[h1>>4&15]+HEX_CHARS[15&h1]+HEX_CHARS[h2>>28&15]+HEX_CHARS[h2>>24&15]+HEX_CHARS[h2>>20&15]+HEX_CHARS[h2>>16&15]+HEX_CHARS[h2>>12&15]+HEX_CHARS[h2>>8&15]+HEX_CHARS[h2>>4&15]+HEX_CHARS[15&h2]+HEX_CHARS[h3>>28&15]+HEX_CHARS[h3>>24&15]+HEX_CHARS[h3>>20&15]+HEX_CHARS[h3>>16&15]+HEX_CHARS[h3>>12&15]+HEX_CHARS[h3>>8&15]+HEX_CHARS[h3>>4&15]+HEX_CHARS[15&h3]+HEX_CHARS[h4>>28&15]+HEX_CHARS[h4>>24&15]+HEX_CHARS[h4>>20&15]+HEX_CHARS[h4>>16&15]+HEX_CHARS[h4>>12&15]+HEX_CHARS[h4>>8&15]+HEX_CHARS[h4>>4&15]+HEX_CHARS[15&h4]+HEX_CHARS[h5>>28&15]+HEX_CHARS[h5>>24&15]+HEX_CHARS[h5>>20&15]+HEX_CHARS[h5>>16&15]+HEX_CHARS[h5>>12&15]+HEX_CHARS[h5>>8&15]+HEX_CHARS[h5>>4&15]+HEX_CHARS[15&h5]+HEX_CHARS[h6>>28&15]+HEX_CHARS[h6>>24&15]+HEX_CHARS[h6>>20&15]+HEX_CHARS[h6>>16&15]+HEX_CHARS[h6>>12&15]+HEX_CHARS[h6>>8&15]+HEX_CHARS[h6>>4&15]+HEX_CHARS[15&h6];return this.is224||(hex+=HEX_CHARS[h7>>28&15]+HEX_CHARS[h7>>24&15]+HEX_CHARS[h7>>20&15]+HEX_CHARS[h7>>16&15]+HEX_CHARS[h7>>12&15]+HEX_CHARS[h7>>8&15]+HEX_CHARS[h7>>4&15]+HEX_CHARS[15&h7]),hex},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var h0=this.h0,h1=this.h1,h2=this.h2,h3=this.h3,h4=this.h4,h5=this.h5,h6=this.h6,h7=this.h7,arr=[h0>>24&255,h0>>16&255,h0>>8&255,255&h0,h1>>24&255,h1>>16&255,h1>>8&255,255&h1,h2>>24&255,h2>>16&255,h2>>8&255,255&h2,h3>>24&255,h3>>16&255,h3>>8&255,255&h3,h4>>24&255,h4>>16&255,h4>>8&255,255&h4,h5>>24&255,h5>>16&255,h5>>8&255,255&h5,h6>>24&255,h6>>16&255,h6>>8&255,255&h6];return this.is224||arr.push(h7>>24&255,h7>>16&255,h7>>8&255,255&h7),arr},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var buffer=new ArrayBuffer(this.is224?28:32),dataView=new DataView(buffer);return dataView.setUint32(0,this.h0),dataView.setUint32(4,this.h1),dataView.setUint32(8,this.h2),dataView.setUint32(12,this.h3),dataView.setUint32(16,this.h4),dataView.setUint32(20,this.h5),dataView.setUint32(24,this.h6),this.is224||dataView.setUint32(28,this.h7),buffer},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var innerHash=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(innerHash),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}()}).call(this,__webpack_require__(4),__webpack_require__(6))},function(module,exports,__webpack_require__){"use strict";var inherits=__webpack_require__(1),HashBase=__webpack_require__(28),Buffer=__webpack_require__(0).Buffer,ARRAY16=new Array(16);function MD5(){HashBase.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function rotl(x,n){return x<>>32-n}function fnF(a,b,c,d,m,k,s){return rotl(a+(b&c|~b&d)+m+k|0,s)+b|0}function fnG(a,b,c,d,m,k,s){return rotl(a+(b&d|c&~d)+m+k|0,s)+b|0}function fnH(a,b,c,d,m,k,s){return rotl(a+(b^c^d)+m+k|0,s)+b|0}function fnI(a,b,c,d,m,k,s){return rotl(a+(c^(b|~d))+m+k|0,s)+b|0}inherits(MD5,HashBase),MD5.prototype._update=function(){for(var M=ARRAY16,i=0;i<16;++i)M[i]=this._block.readInt32LE(4*i);var a=this._a,b=this._b,c=this._c,d=this._d;b=fnI(b=fnI(b=fnI(b=fnI(b=fnH(b=fnH(b=fnH(b=fnH(b=fnG(b=fnG(b=fnG(b=fnG(b=fnF(b=fnF(b=fnF(b=fnF(b,c=fnF(c,d=fnF(d,a=fnF(a,b,c,d,M[0],3614090360,7),b,c,M[1],3905402710,12),a,b,M[2],606105819,17),d,a,M[3],3250441966,22),c=fnF(c,d=fnF(d,a=fnF(a,b,c,d,M[4],4118548399,7),b,c,M[5],1200080426,12),a,b,M[6],2821735955,17),d,a,M[7],4249261313,22),c=fnF(c,d=fnF(d,a=fnF(a,b,c,d,M[8],1770035416,7),b,c,M[9],2336552879,12),a,b,M[10],4294925233,17),d,a,M[11],2304563134,22),c=fnF(c,d=fnF(d,a=fnF(a,b,c,d,M[12],1804603682,7),b,c,M[13],4254626195,12),a,b,M[14],2792965006,17),d,a,M[15],1236535329,22),c=fnG(c,d=fnG(d,a=fnG(a,b,c,d,M[1],4129170786,5),b,c,M[6],3225465664,9),a,b,M[11],643717713,14),d,a,M[0],3921069994,20),c=fnG(c,d=fnG(d,a=fnG(a,b,c,d,M[5],3593408605,5),b,c,M[10],38016083,9),a,b,M[15],3634488961,14),d,a,M[4],3889429448,20),c=fnG(c,d=fnG(d,a=fnG(a,b,c,d,M[9],568446438,5),b,c,M[14],3275163606,9),a,b,M[3],4107603335,14),d,a,M[8],1163531501,20),c=fnG(c,d=fnG(d,a=fnG(a,b,c,d,M[13],2850285829,5),b,c,M[2],4243563512,9),a,b,M[7],1735328473,14),d,a,M[12],2368359562,20),c=fnH(c,d=fnH(d,a=fnH(a,b,c,d,M[5],4294588738,4),b,c,M[8],2272392833,11),a,b,M[11],1839030562,16),d,a,M[14],4259657740,23),c=fnH(c,d=fnH(d,a=fnH(a,b,c,d,M[1],2763975236,4),b,c,M[4],1272893353,11),a,b,M[7],4139469664,16),d,a,M[10],3200236656,23),c=fnH(c,d=fnH(d,a=fnH(a,b,c,d,M[13],681279174,4),b,c,M[0],3936430074,11),a,b,M[3],3572445317,16),d,a,M[6],76029189,23),c=fnH(c,d=fnH(d,a=fnH(a,b,c,d,M[9],3654602809,4),b,c,M[12],3873151461,11),a,b,M[15],530742520,16),d,a,M[2],3299628645,23),c=fnI(c,d=fnI(d,a=fnI(a,b,c,d,M[0],4096336452,6),b,c,M[7],1126891415,10),a,b,M[14],2878612391,15),d,a,M[5],4237533241,21),c=fnI(c,d=fnI(d,a=fnI(a,b,c,d,M[12],1700485571,6),b,c,M[3],2399980690,10),a,b,M[10],4293915773,15),d,a,M[1],2240044497,21),c=fnI(c,d=fnI(d,a=fnI(a,b,c,d,M[8],1873313359,6),b,c,M[15],4264355552,10),a,b,M[6],2734768916,15),d,a,M[13],1309151649,21),c=fnI(c,d=fnI(d,a=fnI(a,b,c,d,M[4],4149444226,6),b,c,M[11],3174756917,10),a,b,M[2],718787259,15),d,a,M[9],3951481745,21),this._a=this._a+a|0,this._b=this._b+b|0,this._c=this._c+c|0,this._d=this._d+d|0},MD5.prototype._digest=function(){this._block[this._blockOffset++]=128,56=this._blockSize;){for(var i=this._blockOffset;istate.highWaterMark&&(state.highWaterMark=function computeNewHighWaterMark(n){return MAX_HWM<=n?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?pna.nextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,pna.nextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=function fromListPartial(n,list,hasStrings){var ret;nstr.length?str.length:n;if(nb===str.length?ret+=str:ret+=str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p).data=str.slice(nb);break}++c}return list.length-=c,ret}(n,list):function copyFromBuffer(n,list){var ret=Buffer.allocUnsafe(n),p=list.head,c=1;p.data.copy(ret),n-=p.data.length;for(;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p).data=buf.slice(nb);break}++c}return list.length-=c,ret}(n,list);return ret}(n,state.buffer,state.decoder),ret);var ret}function endReadable(stream){var state=stream._readableState;if(0=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var ret,doRead=state.needReadable;return debug("need readable",doRead),(0===state.length||state.length-n>>32-n}function fn1(a,b,c,d,e,m,k,s){return rotl(a+(b^c^d)+m+k|0,s)+e|0}function fn2(a,b,c,d,e,m,k,s){return rotl(a+(b&c|~b&d)+m+k|0,s)+e|0}function fn3(a,b,c,d,e,m,k,s){return rotl(a+((b|~c)^d)+m+k|0,s)+e|0}function fn4(a,b,c,d,e,m,k,s){return rotl(a+(b&d|c&~d)+m+k|0,s)+e|0}function fn5(a,b,c,d,e,m,k,s){return rotl(a+(b^(c|~d))+m+k|0,s)+e|0}inherits(RIPEMD160,HashBase),RIPEMD160.prototype._update=function(){for(var words=ARRAY16,j=0;j<16;++j)words[j]=this._block.readInt32LE(4*j);for(var al=0|this._a,bl=0|this._b,cl=0|this._c,dl=0|this._d,el=0|this._e,ar=0|this._a,br=0|this._b,cr=0|this._c,dr=0|this._d,er=0|this._e,i=0;i<80;i+=1){var tl,tr;tr=i<16?(tl=fn1(al,bl,cl,dl,el,words[zl[i]],hl[0],sl[i]),fn5(ar,br,cr,dr,er,words[zr[i]],hr[0],sr[i])):i<32?(tl=fn2(al,bl,cl,dl,el,words[zl[i]],hl[1],sl[i]),fn4(ar,br,cr,dr,er,words[zr[i]],hr[1],sr[i])):i<48?(tl=fn3(al,bl,cl,dl,el,words[zl[i]],hl[2],sl[i]),fn3(ar,br,cr,dr,er,words[zr[i]],hr[2],sr[i])):i<64?(tl=fn4(al,bl,cl,dl,el,words[zl[i]],hl[3],sl[i]),fn2(ar,br,cr,dr,er,words[zr[i]],hr[3],sr[i])):(tl=fn5(al,bl,cl,dl,el,words[zl[i]],hl[4],sl[i]),fn1(ar,br,cr,dr,er,words[zr[i]],hr[4],sr[i])),al=el,el=dl,dl=rotl(cl,10),cl=bl,bl=tl,ar=er,er=dr,dr=rotl(cr,10),cr=br,br=tr}var t=this._b+cl+dr|0;this._b=this._c+dl+er|0,this._c=this._d+el+ar|0,this._d=this._e+al+br|0,this._e=this._a+bl+cr|0,this._a=t},RIPEMD160.prototype._digest=function(){this._block[this._blockOffset++]=128,56>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10)}function sigma1(x){return(x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7)}function gamma0(x){return(x>>>7|x<<25)^(x>>>18|x<<14)^x>>>3}inherits(Sha256,Hash),Sha256.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},Sha256.prototype._update=function(M){for(var x,W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,f=0|this._f,g=0|this._g,h=0|this._h,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<64;++i)W[i]=0|(((x=W[i-2])>>>17|x<<15)^(x>>>19|x<<13)^x>>>10)+W[i-7]+gamma0(W[i-15])+W[i-16];for(var j=0;j<64;++j){var T1=h+sigma1(e)+ch(e,f,g)+K[j]+W[j]|0,T2=sigma0(a)+maj(a,b,c)|0;h=g,g=f,f=e,e=d+T1|0,d=c,c=b,b=a,a=T1+T2|0}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0,this._f=f+this._f|0,this._g=g+this._g|0,this._h=h+this._h|0},Sha256.prototype._hash=function(){var H=Buffer.allocUnsafe(32);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H.writeInt32BE(this._h,28),H},module.exports=Sha256},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,K=[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],W=new Array(160);function Sha512(){this.init(),this._w=W,Hash.call(this,128,112)}function Ch(x,y,z){return z^x&(y^z)}function maj(x,y,z){return x&y|z&(x|y)}function sigma0(x,xl){return(x>>>28|xl<<4)^(xl>>>2|x<<30)^(xl>>>7|x<<25)}function sigma1(x,xl){return(x>>>14|xl<<18)^(x>>>18|xl<<14)^(xl>>>9|x<<23)}function Gamma0(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^x>>>7}function Gamma0l(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^(x>>>7|xl<<25)}function Gamma1(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^x>>>6}function Gamma1l(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^(x>>>6|xl<<26)}function getCarry(a,b){return a>>>0>>0?1:0}inherits(Sha512,Hash),Sha512.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},Sha512.prototype._update=function(M){for(var W=this._w,ah=0|this._ah,bh=0|this._bh,ch=0|this._ch,dh=0|this._dh,eh=0|this._eh,fh=0|this._fh,gh=0|this._gh,hh=0|this._hh,al=0|this._al,bl=0|this._bl,cl=0|this._cl,dl=0|this._dl,el=0|this._el,fl=0|this._fl,gl=0|this._gl,hl=0|this._hl,i=0;i<32;i+=2)W[i]=M.readInt32BE(4*i),W[i+1]=M.readInt32BE(4*i+4);for(;i<160;i+=2){var xh=W[i-30],xl=W[i-30+1],gamma0=Gamma0(xh,xl),gamma0l=Gamma0l(xl,xh),gamma1=Gamma1(xh=W[i-4],xl=W[i-4+1]),gamma1l=Gamma1l(xl,xh),Wi7h=W[i-14],Wi7l=W[i-14+1],Wi16h=W[i-32],Wi16l=W[i-32+1],Wil=gamma0l+Wi7l|0,Wih=gamma0+Wi7h+getCarry(Wil,gamma0l)|0;Wih=(Wih=Wih+gamma1+getCarry(Wil=Wil+gamma1l|0,gamma1l)|0)+Wi16h+getCarry(Wil=Wil+Wi16l|0,Wi16l)|0,W[i]=Wih,W[i+1]=Wil}for(var j=0;j<160;j+=2){Wih=W[j],Wil=W[j+1];var majh=maj(ah,bh,ch),majl=maj(al,bl,cl),sigma0h=sigma0(ah,al),sigma0l=sigma0(al,ah),sigma1h=sigma1(eh,el),sigma1l=sigma1(el,eh),Kih=K[j],Kil=K[j+1],chh=Ch(eh,fh,gh),chl=Ch(el,fl,gl),t1l=hl+sigma1l|0,t1h=hh+sigma1h+getCarry(t1l,hl)|0;t1h=(t1h=(t1h=t1h+chh+getCarry(t1l=t1l+chl|0,chl)|0)+Kih+getCarry(t1l=t1l+Kil|0,Kil)|0)+Wih+getCarry(t1l=t1l+Wil|0,Wil)|0;var t2l=sigma0l+majl|0,t2h=sigma0h+majh+getCarry(t2l,sigma0l)|0;hh=gh,hl=gl,gh=fh,gl=fl,fh=eh,fl=el,eh=dh+t1h+getCarry(el=dl+t1l|0,dl)|0,dh=ch,dl=cl,ch=bh,cl=bl,bh=ah,bl=al,ah=t1h+t2h+getCarry(al=t1l+t2l|0,t1l)|0}this._al=this._al+al|0,this._bl=this._bl+bl|0,this._cl=this._cl+cl|0,this._dl=this._dl+dl|0,this._el=this._el+el|0,this._fl=this._fl+fl|0,this._gl=this._gl+gl|0,this._hl=this._hl+hl|0,this._ah=this._ah+ah+getCarry(this._al,al)|0,this._bh=this._bh+bh+getCarry(this._bl,bl)|0,this._ch=this._ch+ch+getCarry(this._cl,cl)|0,this._dh=this._dh+dh+getCarry(this._dl,dl)|0,this._eh=this._eh+eh+getCarry(this._el,el)|0,this._fh=this._fh+fh+getCarry(this._fl,fl)|0,this._gh=this._gh+gh+getCarry(this._gl,gl)|0,this._hh=this._hh+hh+getCarry(this._hl,hl)|0},Sha512.prototype._hash=function(){var H=Buffer.allocUnsafe(64);function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),writeInt64BE(this._gh,this._gl,48),writeInt64BE(this._hh,this._hl,56),H},module.exports=Sha512},function(module,exports,__webpack_require__){(function(Buffer){var MAX_ALLOC=Math.pow(2,30)-1;function checkBuffer(buf,name){if("string"!=typeof buf&&!Buffer.isBuffer(buf))throw new TypeError(name+" must be a buffer or string")}module.exports=function(password,salt,iterations,keylen){if(checkBuffer(password,"Password"),checkBuffer(salt,"Salt"),"number"!=typeof iterations)throw new TypeError("Iterations not a number");if(iterations<0)throw new TypeError("Bad iterations");if("number"!=typeof keylen)throw new TypeError("Key length not a number");if(keylen<0||MAX_ALLOCblocksize?key=hash(key):key.length=Utils.MaxSecond)throw new RangeError("Second have to be >= "+Utils.MinSecond+", and <: "+Utils.MaxSecond);data=encodeFieldNumberAndType(1,WireMap[Types.Time]).concat(encodeUVarint(s))}return data},encodeFieldNumberAndType=function encodeFieldNumberAndType(num,type){var encodedVal=num<<3|type;return varint.encode(encodedVal)};if(module.exports={encodeSignedVarint:encodeSignedVarint,encodeFieldNumberAndType:encodeFieldNumberAndType,encodeString:function encodeString(input){return encodeSlice(Array.from(Buffer.from(input)))},encodeInt8:function encodeInt8(input){return encodeSignedVarint(input)},encodeInt16:function encodeInt16(input){return encodeSignedVarint(input)},encodeInt32:function encodeInt32(input){var buffer=new ArrayBuffer(4);return new DataView(buffer).setUint32(0,input,!0),Array.from(new Uint8Array(buffer))},encodeInt64:function encodeInt64(input){var buff=Buffer(8);return Int53.writeInt64LE(input,buff,0),Array.from(new Int32Array(buff))},encodeSlice:encodeSlice,encodeBoolean:function encodeBoolean(input){return encodeUint8(input?1:0)},encodeUVarint:encodeUVarint,encodeTime:encodeTime},__webpack_require__.c[__webpack_require__.s]==module){var result=encodeTime(new Date("01 Dec 2018 00:12:00 GMT"));console.log(result)}}).call(this,__webpack_require__(13)(module))},function(module,exports,__webpack_require__){var varint=__webpack_require__(20);exports.encode=function encode(v,b,o){v=0<=v?2*v:-2*v-1;var r=varint.encode(v,b,o);return encode.bytes=varint.encode.bytes,r},exports.decode=function decode(b,o){var v=varint.decode(b,o);return decode.bytes=varint.decode.bytes,1&v?(v+1)/-2:v/2},exports.encodingLength=function(v){return varint.encodingLength(0<=v?2*v:-2*v-1)}},function(module,exports,__webpack_require__){"use strict";for(var ALPHABET="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ALPHABET_MAP={},z=0;z>25;return(33554431&pre)<<5^996825010&-(b>>0&1)^642813549&-(b>>1&1)^513874426&-(b>>2&1)^1027748829&-(b>>3&1)^705979059&-(b>>4&1)}function prefixChk(prefix){for(var chk=1,i=0;i>5}for(chk=polymodStep(chk),i=0;i>bits&maxV);if(pad)0LIMIT)throw new TypeError("Exceeds length limit");var lowered=str.toLowerCase(),uppered=str.toUpperCase();if(str!==lowered&&str!==uppered)throw new Error("Mixed-case string "+str);var split=(str=lowered).lastIndexOf("1");if(-1===split)throw new Error("No separator character for "+str);if(0===split)throw new Error("Missing prefix for "+str);var prefix=str.slice(0,split),wordChars=str.slice(split+1);if(wordChars.length<6)throw new Error("Data too short");for(var chk=prefixChk(prefix),words=[],i=0;i=wordChars.length||words.push(v)}if(1!==chk)throw new Error("Invalid checksum for "+str);return{prefix:prefix,words:words}},encode:function encode(prefix,words,LIMIT){if(LIMIT=LIMIT||90,prefix.length+7+words.length>LIMIT)throw new TypeError("Exceeds length limit");for(var chk=prefixChk(prefix=prefix.toLowerCase()),result=prefix+"1",i=0;i>5!=0)throw new Error("Non 5-bit word");chk=polymodStep(chk)^x,result+=ALPHABET.charAt(x)}for(i=0;i<6;++i)chk=polymodStep(chk);for(chk^=1,i=0;i<6;++i)result+=ALPHABET.charAt(chk>>5*(5-i)&31);return result},toWords:function toWords(bytes){return convert(bytes,8,5,!0)},fromWords:function fromWords(words){return convert(words,5,8,!1)}}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),function(module){var global,_src_index__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(21),_src_index__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_src_index__WEBPACK_IMPORTED_MODULE_0__);global="undefined"!=typeof window?window:void 0,"object"==typeof module.exports?module.exports=_src_index__WEBPACK_IMPORTED_MODULE_0___default.a:global.QWeb=_src_index__WEBPACK_IMPORTED_MODULE_0___default.a}.call(this,__webpack_require__(51)(module))},function(module,exports){module.exports=function(originalModule){if(!originalModule.webpackPolyfill){var module=Object.create(originalModule);module.children||(module.children=[]),Object.defineProperty(module,"loaded",{enumerable:!0,get:function(){return module.l}}),Object.defineProperty(module,"id",{enumerable:!0,get:function(){return module.i}}),Object.defineProperty(module,"exports",{enumerable:!0}),module.webpackPolyfill=1}return module}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i>16&255,arr[curByte++]=tmp>>8&255,arr[curByte++]=255&tmp;2===placeHoldersLen&&(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[curByte++]=255&tmp);1===placeHoldersLen&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[curByte++]=tmp>>8&255,arr[curByte++]=255&tmp);return arr},exports.fromByteArray=function fromByteArray(uint8){for(var tmp,len=uint8.length,extraBytes=len%3,parts=[],i=0,len2=len-extraBytes;i>2]+lookup[tmp<<4&63]+"==")):2===extraBytes&&(tmp=(uint8[len-2]<<8)+uint8[len-1],parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"="));return parts.join("")};for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[63&num]);return output.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63},function(module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=8*nBytes-mLen-1,eMax=(1<>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;0>=-nBits,nBits+=mLen;0>1,rt=23===mLen?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||0===value&&1/value<0?1:0;for(value=Math.abs(value),isNaN(value)||value===1/0?(m=isNaN(value)?1:0,e=eMax):(e=Math.floor(Math.log(value)/Math.LN2),value*(c=Math.pow(2,-e))<1&&(e--,c*=2),2<=(value+=1<=e+eBias?rt/c:rt*Math.pow(2,1-eBias))*c&&(e++,c/=2),eMax<=e+eBias?(m=0,e=eMax):1<=e+eBias?(m=(value*c-1)*Math.pow(2,mLen),e+=eBias):(m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen),e=0));8<=mLen;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<>>0),p=this.head,i=0;p;)src=p.data,target=ret,offset=i,src.copy(target,offset),i+=p.data.length,p=p.next;return ret},BufferList}(),util&&util.inspect&&util.inspect.custom&&(module.exports.prototype[util.inspect.custom]=function(){var obj=util.inspect({length:this.length});return this.constructor.name+" "+obj})},function(module,exports){},function(module,exports,__webpack_require__){(function(global){function config(name){try{if(!global.localStorage)return!1}catch(_){return!1}var val=global.localStorage[name];return null!=val&&"true"===String(val).toLowerCase()}module.exports=function deprecate(fn,msg){if(config("noDeprecation"))return fn;var warned=!1;return function deprecated(){if(!warned){if(config("throwDeprecation"))throw new Error(msg);config("traceDeprecation")?console.trace(msg):console.warn(msg),warned=!0}return fn.apply(this,arguments)}}}).call(this,__webpack_require__(6))},function(module,exports,__webpack_require__){"use strict";module.exports=PassThrough;var Transform=__webpack_require__(33),util=__webpack_require__(10);function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}util.inherits=__webpack_require__(1),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){module.exports=__webpack_require__(16)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(7)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(15).Transform},function(module,exports,__webpack_require__){module.exports=__webpack_require__(15).PassThrough},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);function Sha(){this.init(),this._w=W,Hash.call(this,64,56)}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}inherits(Sha,Hash),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha.prototype._update=function(M){for(var num,W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=W[i-3]^W[i-8]^W[i-14]^W[i-16];for(var j=0;j<80;++j){var s=~~(j/20),t=0|((num=a)<<5|num>>>27)+ft(s,b,c,d)+e+W[j]+K[s];e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha.prototype._hash=function(){var H=Buffer.allocUnsafe(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);function Sha1(){this.init(),this._w=W,Hash.call(this,64,56)}function rotl5(num){return num<<5|num>>>27}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}inherits(Sha1,Hash),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha1.prototype._update=function(M){for(var num,W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=(num=W[i-3]^W[i-8]^W[i-14]^W[i-16])<<1|num>>>31;for(var j=0;j<80;++j){var s=~~(j/20),t=rotl5(a)+ft(s,b,c,d)+e+W[j]+K[s]|0;e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha1.prototype._hash=function(){var H=Buffer.allocUnsafe(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha1},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),Sha256=__webpack_require__(36),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,W=new Array(64);function Sha224(){this.init(),this._w=W,Hash.call(this,64,56)}inherits(Sha224,Sha256),Sha224.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},Sha224.prototype._hash=function(){var H=Buffer.allocUnsafe(28);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H},module.exports=Sha224},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),SHA512=__webpack_require__(37),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,W=new Array(160);function Sha384(){this.init(),this._w=W,Hash.call(this,128,112)}inherits(Sha384,SHA512),Sha384.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},Sha384.prototype._hash=function(){var H=Buffer.allocUnsafe(48);function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),H},module.exports=Sha384},function(module,exports,__webpack_require__){var Buffer=__webpack_require__(0).Buffer,Transform=__webpack_require__(29).Transform,StringDecoder=__webpack_require__(17).StringDecoder;function CipherBase(hashMode){Transform.call(this),this.hashMode="string"==typeof hashMode,this.hashMode?this[hashMode]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}__webpack_require__(1)(CipherBase,Transform),CipherBase.prototype.update=function(data,inputEnc,outputEnc){"string"==typeof data&&(data=Buffer.from(data,inputEnc));var outData=this._update(data);return this.hashMode?this:(outputEnc&&(outData=this._toString(outData,outputEnc)),outData)},CipherBase.prototype.setAutoPadding=function(){},CipherBase.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},CipherBase.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},CipherBase.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},CipherBase.prototype._transform=function(data,_,next){var err;try{this.hashMode?this._update(data):this.push(this._update(data))}catch(e){err=e}finally{next(err)}},CipherBase.prototype._flush=function(done){var err;try{this.push(this.__final())}catch(e){err=e}done(err)},CipherBase.prototype._finalOrDigest=function(outputEnc){var outData=this.__final()||Buffer.alloc(0);return outputEnc&&(outData=this._toString(outData,outputEnc,!0)),outData},CipherBase.prototype._toString=function(value,enc,fin){if(this._decoder||(this._decoder=new StringDecoder(enc),this._encoding=enc),this._encoding!==enc)throw new Error("can't switch encodings");var out=this._decoder.write(value);return fin&&(out+=this._decoder.end()),out},module.exports=CipherBase},function(module,exports,__webpack_require__){exports.pbkdf2=__webpack_require__(73),exports.pbkdf2Sync=__webpack_require__(40)},function(module,exports,__webpack_require__){(function(global,process){var ZERO_BUF,checkParameters=__webpack_require__(38),defaultEncoding=__webpack_require__(39),sync=__webpack_require__(40),Buffer=__webpack_require__(0).Buffer,subtle=global.crypto&&global.crypto.subtle,toBrowser={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},checks=[];function browserPbkdf2(password,salt,iterations,length,algo){return subtle.importKey("raw",password,{name:"PBKDF2"},!1,["deriveBits"]).then(function(key){return subtle.deriveBits({name:"PBKDF2",salt:salt,iterations:iterations,hash:{name:algo}},key,length<<3)}).then(function(res){return Buffer.from(res)})}module.exports=function(password,salt,iterations,keylen,digest,callback){"function"==typeof digest&&(callback=digest,digest=void 0);var algo=toBrowser[(digest=digest||"sha1").toLowerCase()];if(!algo||"function"!=typeof global.Promise)return process.nextTick(function(){var out;try{out=sync(password,salt,iterations,keylen,digest)}catch(e){return callback(e)}callback(null,out)});if(checkParameters(password,salt,iterations,keylen),"function"!=typeof callback)throw new Error("No callback provided to pbkdf2");Buffer.isBuffer(password)||(password=Buffer.from(password,defaultEncoding)),Buffer.isBuffer(salt)||(salt=Buffer.from(salt,defaultEncoding)),function resolvePromise(promise,callback){promise.then(function(out){process.nextTick(function(){callback(null,out)})},function(e){process.nextTick(function(){callback(e)})})}(function checkNative(algo){if(global.process&&!global.process.browser)return Promise.resolve(!1);if(!subtle||!subtle.importKey||!subtle.deriveBits)return Promise.resolve(!1);if(void 0!==checks[algo])return checks[algo];var prom=browserPbkdf2(ZERO_BUF=ZERO_BUF||Buffer.alloc(8),ZERO_BUF,10,128,algo).then(function(){return!0}).catch(function(){return!1});return checks[algo]=prom}(algo).then(function(resp){return resp?browserPbkdf2(password,salt,iterations,keylen,algo):sync(password,salt,iterations,keylen,digest)}),callback)}}).call(this,__webpack_require__(6),__webpack_require__(4))},function(module,exports,__webpack_require__){var MD5=__webpack_require__(27);module.exports=function(buffer){return(new MD5).update(buffer).digest()}},function(module,exports,__webpack_require__){"use strict";(function(global,process){var Buffer=__webpack_require__(0).Buffer,crypto=global.crypto||global.msCrypto;crypto&&crypto.getRandomValues?module.exports=function randomBytes(size,cb){if(65536>8&255]&&(cache[cp]=ret),ret},function fromCpOnly(next,cp,needFeature){return needFeature?next(cp,needFeature):new UChar(cp,null)},function fromRuleBasedJamo(next,cp,needFeature){var j;if(cp<4352||4371<=cp&&cp<44032||55204>6:(code<55296||57344<=code?bytes[index++]=224|code>>12:(code=65536+((1023&code)<<10|1023&key.charCodeAt(++i)),bytes[index++]=240|code>>18,bytes[index++]=128|code>>12&63),bytes[index++]=128|code>>6&63),bytes[index++]=128|63&code);key=bytes}else{if("object"!=type)throw new Error(ERROR);if(null===key)throw new Error(ERROR);if(ARRAY_BUFFER&&key.constructor===ArrayBuffer)key=new Uint8Array(key);else if(!(Array.isArray(key)||ARRAY_BUFFER&&ArrayBuffer.isView(key)))throw new Error(ERROR)}64>2]|=message[index]<>2]|=code<>2]|=(192|code>>6)<>2]|=(224|code>>12)<>2]|=(240|code>>18)<>2]|=(128|code>>12&63)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=EXTRA[3&i],this.block=blocks[16],56<=i&&(this.hashed||this.hash(),blocks[0]=this.block,blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0),blocks[14]=this.hBytes<<3|this.bytes>>>29,blocks[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var j,s0,s1,maj,t1,ab,da,cd,bc,a=this.h0,b=this.h1,c=this.h2,d=this.h3,e=this.h4,f=this.h5,g=this.h6,h=this.h7,blocks=this.blocks;for(j=16;j<64;++j)s0=((t1=blocks[j-15])>>>7|t1<<25)^(t1>>>18|t1<<14)^t1>>>3,s1=((t1=blocks[j-2])>>>17|t1<<15)^(t1>>>19|t1<<13)^t1>>>10,blocks[j]=blocks[j-16]+s0+blocks[j-7]+s1<<0;for(bc=b&c,j=0;j<64;j+=4)this.first?(d=this.is224?(ab=300032,h=(t1=blocks[0]-1413257819)-150054599<<0,t1+24177077<<0):(ab=704751109,h=(t1=blocks[0]-210244248)-1521486534<<0,t1+143694565<<0),this.first=!1):(s0=(a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10),maj=(ab=a&b)^a&c^bc,h=d+(t1=h+(s1=(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7))+(e&f^~e&g)+K[j]+blocks[j])<<0,d=t1+(s0+maj)<<0),s0=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),maj=(da=d&a)^d&b^ab,g=c+(t1=g+(s1=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&e^~h&f)+K[j+1]+blocks[j+1])<<0,s0=((c=t1+(s0+maj)<<0)>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),maj=(cd=c&d)^c&a^da,f=b+(t1=f+(s1=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&h^~g&e)+K[j+2]+blocks[j+2])<<0,s0=((b=t1+(s0+maj)<<0)>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10),maj=(bc=b&c)^b&d^cd,e=a+(t1=e+(s1=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&g^~f&h)+K[j+3]+blocks[j+3])<<0,a=t1+(s0+maj)<<0;this.h0=this.h0+a<<0,this.h1=this.h1+b<<0,this.h2=this.h2+c<<0,this.h3=this.h3+d<<0,this.h4=this.h4+e<<0,this.h5=this.h5+f<<0,this.h6=this.h6+g<<0,this.h7=this.h7+h<<0},Sha256.prototype.hex=function(){this.finalize();var h0=this.h0,h1=this.h1,h2=this.h2,h3=this.h3,h4=this.h4,h5=this.h5,h6=this.h6,h7=this.h7,hex=HEX_CHARS[h0>>28&15]+HEX_CHARS[h0>>24&15]+HEX_CHARS[h0>>20&15]+HEX_CHARS[h0>>16&15]+HEX_CHARS[h0>>12&15]+HEX_CHARS[h0>>8&15]+HEX_CHARS[h0>>4&15]+HEX_CHARS[15&h0]+HEX_CHARS[h1>>28&15]+HEX_CHARS[h1>>24&15]+HEX_CHARS[h1>>20&15]+HEX_CHARS[h1>>16&15]+HEX_CHARS[h1>>12&15]+HEX_CHARS[h1>>8&15]+HEX_CHARS[h1>>4&15]+HEX_CHARS[15&h1]+HEX_CHARS[h2>>28&15]+HEX_CHARS[h2>>24&15]+HEX_CHARS[h2>>20&15]+HEX_CHARS[h2>>16&15]+HEX_CHARS[h2>>12&15]+HEX_CHARS[h2>>8&15]+HEX_CHARS[h2>>4&15]+HEX_CHARS[15&h2]+HEX_CHARS[h3>>28&15]+HEX_CHARS[h3>>24&15]+HEX_CHARS[h3>>20&15]+HEX_CHARS[h3>>16&15]+HEX_CHARS[h3>>12&15]+HEX_CHARS[h3>>8&15]+HEX_CHARS[h3>>4&15]+HEX_CHARS[15&h3]+HEX_CHARS[h4>>28&15]+HEX_CHARS[h4>>24&15]+HEX_CHARS[h4>>20&15]+HEX_CHARS[h4>>16&15]+HEX_CHARS[h4>>12&15]+HEX_CHARS[h4>>8&15]+HEX_CHARS[h4>>4&15]+HEX_CHARS[15&h4]+HEX_CHARS[h5>>28&15]+HEX_CHARS[h5>>24&15]+HEX_CHARS[h5>>20&15]+HEX_CHARS[h5>>16&15]+HEX_CHARS[h5>>12&15]+HEX_CHARS[h5>>8&15]+HEX_CHARS[h5>>4&15]+HEX_CHARS[15&h5]+HEX_CHARS[h6>>28&15]+HEX_CHARS[h6>>24&15]+HEX_CHARS[h6>>20&15]+HEX_CHARS[h6>>16&15]+HEX_CHARS[h6>>12&15]+HEX_CHARS[h6>>8&15]+HEX_CHARS[h6>>4&15]+HEX_CHARS[15&h6];return this.is224||(hex+=HEX_CHARS[h7>>28&15]+HEX_CHARS[h7>>24&15]+HEX_CHARS[h7>>20&15]+HEX_CHARS[h7>>16&15]+HEX_CHARS[h7>>12&15]+HEX_CHARS[h7>>8&15]+HEX_CHARS[h7>>4&15]+HEX_CHARS[15&h7]),hex},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var h0=this.h0,h1=this.h1,h2=this.h2,h3=this.h3,h4=this.h4,h5=this.h5,h6=this.h6,h7=this.h7,arr=[h0>>24&255,h0>>16&255,h0>>8&255,255&h0,h1>>24&255,h1>>16&255,h1>>8&255,255&h1,h2>>24&255,h2>>16&255,h2>>8&255,255&h2,h3>>24&255,h3>>16&255,h3>>8&255,255&h3,h4>>24&255,h4>>16&255,h4>>8&255,255&h4,h5>>24&255,h5>>16&255,h5>>8&255,255&h5,h6>>24&255,h6>>16&255,h6>>8&255,255&h6];return this.is224||arr.push(h7>>24&255,h7>>16&255,h7>>8&255,255&h7),arr},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var buffer=new ArrayBuffer(this.is224?28:32),dataView=new DataView(buffer);return dataView.setUint32(0,this.h0),dataView.setUint32(4,this.h1),dataView.setUint32(8,this.h2),dataView.setUint32(12,this.h3),dataView.setUint32(16,this.h4),dataView.setUint32(20,this.h5),dataView.setUint32(24,this.h6),this.is224||dataView.setUint32(28,this.h7),buffer},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var innerHash=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(innerHash),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}()}).call(this,__webpack_require__(4),__webpack_require__(5))},function(module,exports,__webpack_require__){var Buffer=__webpack_require__(0).Buffer,createHash=__webpack_require__(59),_pbkdf2=__webpack_require__(74),pbkdf2=_pbkdf2.pbkdf2Sync,pbkdf2Async=_pbkdf2.pbkdf2,randomBytes=__webpack_require__(77),unorm=__webpack_require__(78),CHINESE_SIMPLIFIED_WORDLIST=__webpack_require__(79),CHINESE_TRADITIONAL_WORDLIST=__webpack_require__(80),ENGLISH_WORDLIST=__webpack_require__(81),FRENCH_WORDLIST=__webpack_require__(82),ITALIAN_WORDLIST=__webpack_require__(83),JAPANESE_WORDLIST=__webpack_require__(84),KOREAN_WORDLIST=__webpack_require__(85),SPANISH_WORDLIST=__webpack_require__(86),DEFAULT_WORDLIST=ENGLISH_WORDLIST,INVALID_MNEMONIC="Invalid mnemonic",INVALID_ENTROPY="Invalid entropy",INVALID_CHECKSUM="Invalid mnemonic checksum";function lpad(str,padString,length){for(;str.length>>0),p=this.head,i=0;p;)src=p.data,target=ret,offset=i,src.copy(target,offset),i+=p.data.length,p=p.next;return ret},BufferList}(),util&&util.inspect&&util.inspect.custom&&(module.exports.prototype[util.inspect.custom]=function(){var obj=util.inspect({length:this.length});return this.constructor.name+" "+obj})},function(module,exports){},function(module,exports,__webpack_require__){(function(global){function config(name){try{if(!global.localStorage)return!1}catch(_){return!1}var val=global.localStorage[name];return null!=val&&"true"===String(val).toLowerCase()}module.exports=function deprecate(fn,msg){if(config("noDeprecation"))return fn;var warned=!1;return function deprecated(){if(!warned){if(config("throwDeprecation"))throw new Error(msg);config("traceDeprecation")?console.trace(msg):console.warn(msg),warned=!0}return fn.apply(this,arguments)}}}).call(this,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";module.exports=PassThrough;var Transform=__webpack_require__(33),util=__webpack_require__(11);function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}util.inherits=__webpack_require__(1),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){module.exports=__webpack_require__(16)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(7)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(15).Transform},function(module,exports,__webpack_require__){module.exports=__webpack_require__(15).PassThrough},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);function Sha(){this.init(),this._w=W,Hash.call(this,64,56)}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}inherits(Sha,Hash),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha.prototype._update=function(M){for(var num,W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=W[i-3]^W[i-8]^W[i-14]^W[i-16];for(var j=0;j<80;++j){var s=~~(j/20),t=0|((num=a)<<5|num>>>27)+ft(s,b,c,d)+e+W[j]+K[s];e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha.prototype._hash=function(){var H=Buffer.allocUnsafe(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);function Sha1(){this.init(),this._w=W,Hash.call(this,64,56)}function rotl5(num){return num<<5|num>>>27}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}inherits(Sha1,Hash),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha1.prototype._update=function(M){for(var num,W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=(num=W[i-3]^W[i-8]^W[i-14]^W[i-16])<<1|num>>>31;for(var j=0;j<80;++j){var s=~~(j/20),t=rotl5(a)+ft(s,b,c,d)+e+W[j]+K[s]|0;e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha1.prototype._hash=function(){var H=Buffer.allocUnsafe(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha1},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),Sha256=__webpack_require__(36),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,W=new Array(64);function Sha224(){this.init(),this._w=W,Hash.call(this,64,56)}inherits(Sha224,Sha256),Sha224.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},Sha224.prototype._hash=function(){var H=Buffer.allocUnsafe(28);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H},module.exports=Sha224},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),SHA512=__webpack_require__(37),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,W=new Array(160);function Sha384(){this.init(),this._w=W,Hash.call(this,128,112)}inherits(Sha384,SHA512),Sha384.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},Sha384.prototype._hash=function(){var H=Buffer.allocUnsafe(48);function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),H},module.exports=Sha384},function(module,exports,__webpack_require__){var Buffer=__webpack_require__(0).Buffer,Transform=__webpack_require__(29).Transform,StringDecoder=__webpack_require__(17).StringDecoder;function CipherBase(hashMode){Transform.call(this),this.hashMode="string"==typeof hashMode,this.hashMode?this[hashMode]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}__webpack_require__(1)(CipherBase,Transform),CipherBase.prototype.update=function(data,inputEnc,outputEnc){"string"==typeof data&&(data=Buffer.from(data,inputEnc));var outData=this._update(data);return this.hashMode?this:(outputEnc&&(outData=this._toString(outData,outputEnc)),outData)},CipherBase.prototype.setAutoPadding=function(){},CipherBase.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},CipherBase.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},CipherBase.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},CipherBase.prototype._transform=function(data,_,next){var err;try{this.hashMode?this._update(data):this.push(this._update(data))}catch(e){err=e}finally{next(err)}},CipherBase.prototype._flush=function(done){var err;try{this.push(this.__final())}catch(e){err=e}done(err)},CipherBase.prototype._finalOrDigest=function(outputEnc){var outData=this.__final()||Buffer.alloc(0);return outputEnc&&(outData=this._toString(outData,outputEnc,!0)),outData},CipherBase.prototype._toString=function(value,enc,fin){if(this._decoder||(this._decoder=new StringDecoder(enc),this._encoding=enc),this._encoding!==enc)throw new Error("can't switch encodings");var out=this._decoder.write(value);return fin&&(out+=this._decoder.end()),out},module.exports=CipherBase},function(module,exports,__webpack_require__){exports.pbkdf2=__webpack_require__(75),exports.pbkdf2Sync=__webpack_require__(40)},function(module,exports,__webpack_require__){(function(global,process){var ZERO_BUF,checkParameters=__webpack_require__(38),defaultEncoding=__webpack_require__(39),sync=__webpack_require__(40),Buffer=__webpack_require__(0).Buffer,subtle=global.crypto&&global.crypto.subtle,toBrowser={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},checks=[];function browserPbkdf2(password,salt,iterations,length,algo){return subtle.importKey("raw",password,{name:"PBKDF2"},!1,["deriveBits"]).then(function(key){return subtle.deriveBits({name:"PBKDF2",salt:salt,iterations:iterations,hash:{name:algo}},key,length<<3)}).then(function(res){return Buffer.from(res)})}module.exports=function(password,salt,iterations,keylen,digest,callback){"function"==typeof digest&&(callback=digest,digest=void 0);var algo=toBrowser[(digest=digest||"sha1").toLowerCase()];if(!algo||"function"!=typeof global.Promise)return process.nextTick(function(){var out;try{out=sync(password,salt,iterations,keylen,digest)}catch(e){return callback(e)}callback(null,out)});if(checkParameters(password,salt,iterations,keylen),"function"!=typeof callback)throw new Error("No callback provided to pbkdf2");Buffer.isBuffer(password)||(password=Buffer.from(password,defaultEncoding)),Buffer.isBuffer(salt)||(salt=Buffer.from(salt,defaultEncoding)),function resolvePromise(promise,callback){promise.then(function(out){process.nextTick(function(){callback(null,out)})},function(e){process.nextTick(function(){callback(e)})})}(function checkNative(algo){if(global.process&&!global.process.browser)return Promise.resolve(!1);if(!subtle||!subtle.importKey||!subtle.deriveBits)return Promise.resolve(!1);if(void 0!==checks[algo])return checks[algo];var prom=browserPbkdf2(ZERO_BUF=ZERO_BUF||Buffer.alloc(8),ZERO_BUF,10,128,algo).then(function(){return!0}).catch(function(){return!1});return checks[algo]=prom}(algo).then(function(resp){return resp?browserPbkdf2(password,salt,iterations,keylen,algo):sync(password,salt,iterations,keylen,digest)}),callback)}}).call(this,__webpack_require__(5),__webpack_require__(4))},function(module,exports,__webpack_require__){var MD5=__webpack_require__(27);module.exports=function(buffer){return(new MD5).update(buffer).digest()}},function(module,exports,__webpack_require__){"use strict";(function(global,process){var Buffer=__webpack_require__(0).Buffer,crypto=global.crypto||global.msCrypto;crypto&&crypto.getRandomValues?module.exports=function randomBytes(size,cb){if(4294967295>8&255]&&(cache[cp]=ret),ret},function fromCpOnly(next,cp,needFeature){return needFeature?next(cp,needFeature):new UChar(cp,null)},function fromRuleBasedJamo(next,cp,needFeature){var j;if(cp<4352||4371<=cp&&cp<44032||55204 * @license MIT */ -module.exports=function(obj){return null!=obj&&(isBuffer(obj)||function isSlowBuffer(obj){return"function"==typeof obj.readFloatLE&&"function"==typeof obj.slice&&isBuffer(obj.slice(0,0))}(obj)||!!obj._isBuffer)}},function(module,exports,__webpack_require__){"use strict";var defaults=__webpack_require__(18),utils=__webpack_require__(2),InterceptorManager=__webpack_require__(98),dispatchRequest=__webpack_require__(99);function Axios(instanceConfig){this.defaults=instanceConfig,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}Axios.prototype.request=function request(config){"string"==typeof config&&(config=utils.merge({url:arguments[0]},arguments[1])),(config=utils.merge(defaults,{method:"get"},this.defaults,config)).method=config.method.toLowerCase();var chain=[dispatchRequest,void 0],promise=Promise.resolve(config);for(this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor){chain.unshift(interceptor.fulfilled,interceptor.rejected)}),this.interceptors.response.forEach(function pushResponseInterceptors(interceptor){chain.push(interceptor.fulfilled,interceptor.rejected)});chain.length;)promise=promise.then(chain.shift(),chain.shift());return promise},utils.forEach(["delete","get","head","options"],function forEachMethodNoData(method){Axios.prototype[method]=function(url,config){return this.request(utils.merge(config||{},{method:method,url:url}))}}),utils.forEach(["post","put","patch"],function forEachMethodWithData(method){Axios.prototype[method]=function(url,data,config){return this.request(utils.merge(config||{},{method:method,url:url,data:data}))}}),module.exports=Axios},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2);module.exports=function normalizeHeaderName(headers,normalizedName){utils.forEach(headers,function processHeader(value,name){name!==normalizedName&&name.toUpperCase()===normalizedName.toUpperCase()&&(headers[normalizedName]=value,delete headers[name])})}},function(module,exports,__webpack_require__){"use strict";var createError=__webpack_require__(43);module.exports=function settle(resolve,reject,response){var validateStatus=response.config.validateStatus;response.status&&validateStatus&&!validateStatus(response.status)?reject(createError("Request failed with status code "+response.status,response.config,null,response.request,response)):resolve(response)}},function(module,exports,__webpack_require__){"use strict";module.exports=function enhanceError(error,config,code,request,response){return error.config=config,code&&(error.code=code),error.request=request,error.response=response,error}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2);function encode(val){return encodeURIComponent(val).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}module.exports=function buildURL(url,params,paramsSerializer){if(!params)return url;var serializedParams;if(paramsSerializer)serializedParams=paramsSerializer(params);else if(utils.isURLSearchParams(params))serializedParams=params.toString();else{var parts=[];utils.forEach(params,function serialize(val,key){null!=val&&(utils.isArray(val)?key+="[]":val=[val],utils.forEach(val,function parseValue(v){utils.isDate(v)?v=v.toISOString():utils.isObject(v)&&(v=JSON.stringify(v)),parts.push(encode(key)+"="+encode(v))}))}),serializedParams=parts.join("&")}return serializedParams&&(url+=(-1===url.indexOf("?")?"?":"&")+serializedParams),url}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2),ignoreDuplicateOf=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];module.exports=function parseHeaders(headers){var key,val,i,parsed={};return headers&&utils.forEach(headers.split("\n"),function parser(line){if(i=line.indexOf(":"),key=utils.trim(line.substr(0,i)).toLowerCase(),val=utils.trim(line.substr(i+1)),key){if(parsed[key]&&0<=ignoreDuplicateOf.indexOf(key))return;parsed[key]="set-cookie"===key?(parsed[key]?parsed[key]:[]).concat([val]):parsed[key]?parsed[key]+", "+val:val}}),parsed}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2);module.exports=utils.isStandardBrowserEnv()?function standardBrowserEnv(){var originURL,msie=/(msie|trident)/i.test(navigator.userAgent),urlParsingNode=document.createElement("a");function resolveURL(url){var href=url;return msie&&(urlParsingNode.setAttribute("href",href),href=urlParsingNode.href),urlParsingNode.setAttribute("href",href),{href:urlParsingNode.href,protocol:urlParsingNode.protocol?urlParsingNode.protocol.replace(/:$/,""):"",host:urlParsingNode.host,search:urlParsingNode.search?urlParsingNode.search.replace(/^\?/,""):"",hash:urlParsingNode.hash?urlParsingNode.hash.replace(/^#/,""):"",hostname:urlParsingNode.hostname,port:urlParsingNode.port,pathname:"/"===urlParsingNode.pathname.charAt(0)?urlParsingNode.pathname:"/"+urlParsingNode.pathname}}return originURL=resolveURL(window.location.href),function isURLSameOrigin(requestURL){var parsed=utils.isString(requestURL)?resolveURL(requestURL):requestURL;return parsed.protocol===originURL.protocol&&parsed.host===originURL.host}}():function isURLSameOrigin(){return!0}},function(module,exports,__webpack_require__){"use strict";function E(){this.message="String contains an invalid character"}(E.prototype=new Error).code=5,E.prototype.name="InvalidCharacterError",module.exports=function btoa(input){for(var block,charCode,str=String(input),output="",idx=0,map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";str.charAt(0|idx)||(map="=",idx%1);output+=map.charAt(63&block>>8-idx%1*8)){if(255<(charCode=str.charCodeAt(idx+=.75)))throw new E;block=block<<8|charCode}return output}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2);module.exports=utils.isStandardBrowserEnv()?function standardBrowserEnv(){return{write:function write(name,value,expires,path,domain,secure){var cookie=[];cookie.push(name+"="+encodeURIComponent(value)),utils.isNumber(expires)&&cookie.push("expires="+new Date(expires).toGMTString()),utils.isString(path)&&cookie.push("path="+path),utils.isString(domain)&&cookie.push("domain="+domain),!0===secure&&cookie.push("secure"),document.cookie=cookie.join("; ")},read:function read(name){var match=document.cookie.match(new RegExp("(^|;\\s*)("+name+")=([^;]*)"));return match?decodeURIComponent(match[3]):null},remove:function remove(name){this.write(name,"",Date.now()-864e5)}}}():{write:function write(){},read:function read(){return null},remove:function remove(){}}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2);function InterceptorManager(){this.handlers=[]}InterceptorManager.prototype.use=function use(fulfilled,rejected){return this.handlers.push({fulfilled:fulfilled,rejected:rejected}),this.handlers.length-1},InterceptorManager.prototype.eject=function eject(id){this.handlers[id]&&(this.handlers[id]=null)},InterceptorManager.prototype.forEach=function forEach(fn){utils.forEach(this.handlers,function forEachHandler(h){null!==h&&fn(h)})},module.exports=InterceptorManager},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2),transformData=__webpack_require__(100),isCancel=__webpack_require__(44),defaults=__webpack_require__(18),isAbsoluteURL=__webpack_require__(101),combineURLs=__webpack_require__(102);function throwIfCancellationRequested(config){config.cancelToken&&config.cancelToken.throwIfRequested()}module.exports=function dispatchRequest(config){return throwIfCancellationRequested(config),config.baseURL&&!isAbsoluteURL(config.url)&&(config.url=combineURLs(config.baseURL,config.url)),config.headers=config.headers||{},config.data=transformData(config.data,config.headers,config.transformRequest),config.headers=utils.merge(config.headers.common||{},config.headers[config.method]||{},config.headers||{}),utils.forEach(["delete","get","head","post","put","patch","common"],function cleanHeaderConfig(method){delete config.headers[method]}),(config.adapter||defaults.adapter)(config).then(function onAdapterResolution(response){return throwIfCancellationRequested(config),response.data=transformData(response.data,response.headers,config.transformResponse),response},function onAdapterRejection(reason){return isCancel(reason)||(throwIfCancellationRequested(config),reason&&reason.response&&(reason.response.data=transformData(reason.response.data,reason.response.headers,config.transformResponse))),Promise.reject(reason)})}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2);module.exports=function transformData(data,headers,fns){return utils.forEach(fns,function transform(fn){data=fn(data,headers)}),data}},function(module,exports,__webpack_require__){"use strict";module.exports=function isAbsoluteURL(url){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url)}},function(module,exports,__webpack_require__){"use strict";module.exports=function combineURLs(baseURL,relativeURL){return relativeURL?baseURL.replace(/\/+$/,"")+"/"+relativeURL.replace(/^\/+/,""):baseURL}},function(module,exports,__webpack_require__){"use strict";var Cancel=__webpack_require__(45);function CancelToken(executor){if("function"!=typeof executor)throw new TypeError("executor must be a function.");var resolvePromise;this.promise=new Promise(function promiseExecutor(resolve){resolvePromise=resolve});var token=this;executor(function cancel(message){token.reason||(token.reason=new Cancel(message),resolvePromise(token.reason))})}CancelToken.prototype.throwIfRequested=function throwIfRequested(){if(this.reason)throw this.reason},CancelToken.source=function source(){var cancel;return{token:new CancelToken(function executor(c){cancel=c}),cancel:cancel}},module.exports=CancelToken},function(module,exports,__webpack_require__){"use strict";module.exports=function spread(callback){return function wrap(arr){return callback.apply(null,arr)}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){Object.defineProperty(exports,"__esModule",{value:!0});var _regenerator2=_interopRequireDefault(__webpack_require__(106)),_createClass=function(){function defineProperties(target,props){for(var i=0;i>>=7;out[offset]=0|num;encode.bytes=offset-oldOffset+1;return out};var MSB=128,MSBALL=-128,INT=Math.pow(2,31)},function(module,exports){module.exports=function read(buf,offset){var b,res=0,offset=offset||0,shift=0,counter=offset,l=buf.length;do{if(l<=counter)throw read.bytes=0,new RangeError("Could not decode varint");b=buf[counter++],res+=shift<28?(b&REST)<>8-idx%1*8)){if(255<(charCode=str.charCodeAt(idx+=.75)))throw new E;block=block<<8|charCode}return output}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2);module.exports=utils.isStandardBrowserEnv()?function standardBrowserEnv(){return{write:function write(name,value,expires,path,domain,secure){var cookie=[];cookie.push(name+"="+encodeURIComponent(value)),utils.isNumber(expires)&&cookie.push("expires="+new Date(expires).toGMTString()),utils.isString(path)&&cookie.push("path="+path),utils.isString(domain)&&cookie.push("domain="+domain),!0===secure&&cookie.push("secure"),document.cookie=cookie.join("; ")},read:function read(name){var match=document.cookie.match(new RegExp("(^|;\\s*)("+name+")=([^;]*)"));return match?decodeURIComponent(match[3]):null},remove:function remove(name){this.write(name,"",Date.now()-864e5)}}}():{write:function write(){},read:function read(){return null},remove:function remove(){}}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2);function InterceptorManager(){this.handlers=[]}InterceptorManager.prototype.use=function use(fulfilled,rejected){return this.handlers.push({fulfilled:fulfilled,rejected:rejected}),this.handlers.length-1},InterceptorManager.prototype.eject=function eject(id){this.handlers[id]&&(this.handlers[id]=null)},InterceptorManager.prototype.forEach=function forEach(fn){utils.forEach(this.handlers,function forEachHandler(h){null!==h&&fn(h)})},module.exports=InterceptorManager},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2),transformData=__webpack_require__(102),isCancel=__webpack_require__(44),defaults=__webpack_require__(18),isAbsoluteURL=__webpack_require__(103),combineURLs=__webpack_require__(104);function throwIfCancellationRequested(config){config.cancelToken&&config.cancelToken.throwIfRequested()}module.exports=function dispatchRequest(config){return throwIfCancellationRequested(config),config.baseURL&&!isAbsoluteURL(config.url)&&(config.url=combineURLs(config.baseURL,config.url)),config.headers=config.headers||{},config.data=transformData(config.data,config.headers,config.transformRequest),config.headers=utils.merge(config.headers.common||{},config.headers[config.method]||{},config.headers||{}),utils.forEach(["delete","get","head","post","put","patch","common"],function cleanHeaderConfig(method){delete config.headers[method]}),(config.adapter||defaults.adapter)(config).then(function onAdapterResolution(response){return throwIfCancellationRequested(config),response.data=transformData(response.data,response.headers,config.transformResponse),response},function onAdapterRejection(reason){return isCancel(reason)||(throwIfCancellationRequested(config),reason&&reason.response&&(reason.response.data=transformData(reason.response.data,reason.response.headers,config.transformResponse))),Promise.reject(reason)})}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2);module.exports=function transformData(data,headers,fns){return utils.forEach(fns,function transform(fn){data=fn(data,headers)}),data}},function(module,exports,__webpack_require__){"use strict";module.exports=function isAbsoluteURL(url){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url)}},function(module,exports,__webpack_require__){"use strict";module.exports=function combineURLs(baseURL,relativeURL){return relativeURL?baseURL.replace(/\/+$/,"")+"/"+relativeURL.replace(/^\/+/,""):baseURL}},function(module,exports,__webpack_require__){"use strict";var Cancel=__webpack_require__(45);function CancelToken(executor){if("function"!=typeof executor)throw new TypeError("executor must be a function.");var resolvePromise;this.promise=new Promise(function promiseExecutor(resolve){resolvePromise=resolve});var token=this;executor(function cancel(message){token.reason||(token.reason=new Cancel(message),resolvePromise(token.reason))})}CancelToken.prototype.throwIfRequested=function throwIfRequested(){if(this.reason)throw this.reason},CancelToken.source=function source(){var cancel;return{token:new CancelToken(function executor(c){cancel=c}),cancel:cancel}},module.exports=CancelToken},function(module,exports,__webpack_require__){"use strict";module.exports=function spread(callback){return function wrap(arr){return callback.apply(null,arr)}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){Object.defineProperty(exports,"__esModule",{value:!0});var _regenerator2=_interopRequireDefault(__webpack_require__(108)),_createClass=function(){function defineProperties(target,props){for(var i=0;i>6:(code<55296||57344<=code?bytes[index++]=224|code>>12:(code=65536+((1023&code)<<10|1023&key.charCodeAt(++i)),bytes[index++]=240|code>>18,bytes[index++]=128|code>>12&63),bytes[index++]=128|code>>6&63),bytes[index++]=128|63&code);key=bytes}else{if("object"!==type)throw new Error(ERROR);if(null===key)throw new Error(ERROR);if(ARRAY_BUFFER&&key.constructor===ArrayBuffer)key=new Uint8Array(key);else if(!(Array.isArray(key)||ARRAY_BUFFER&&ArrayBuffer.isView(key)))throw new Error(ERROR)}64>2]|=message[index]<>2]|=code<>2]|=(192|code>>6)<>2]|=(224|code>>12)<>2]|=(240|code>>18)<>2]|=(128|code>>12&63)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=EXTRA[3&i],this.block=blocks[16],56<=i&&(this.hashed||this.hash(),blocks[0]=this.block,blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0),blocks[14]=this.hBytes<<3|this.bytes>>>29,blocks[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var j,s0,s1,maj,t1,ab,da,cd,bc,a=this.h0,b=this.h1,c=this.h2,d=this.h3,e=this.h4,f=this.h5,g=this.h6,h=this.h7,blocks=this.blocks;for(j=16;j<64;++j)s0=((t1=blocks[j-15])>>>7|t1<<25)^(t1>>>18|t1<<14)^t1>>>3,s1=((t1=blocks[j-2])>>>17|t1<<15)^(t1>>>19|t1<<13)^t1>>>10,blocks[j]=blocks[j-16]+s0+blocks[j-7]+s1<<0;for(bc=b&c,j=0;j<64;j+=4)this.first?(d=this.is224?(ab=300032,h=(t1=blocks[0]-1413257819)-150054599<<0,t1+24177077<<0):(ab=704751109,h=(t1=blocks[0]-210244248)-1521486534<<0,t1+143694565<<0),this.first=!1):(s0=(a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10),maj=(ab=a&b)^a&c^bc,h=d+(t1=h+(s1=(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7))+(e&f^~e&g)+K[j]+blocks[j])<<0,d=t1+(s0+maj)<<0),s0=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),maj=(da=d&a)^d&b^ab,g=c+(t1=g+(s1=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&e^~h&f)+K[j+1]+blocks[j+1])<<0,s0=((c=t1+(s0+maj)<<0)>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),maj=(cd=c&d)^c&a^da,f=b+(t1=f+(s1=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&h^~g&e)+K[j+2]+blocks[j+2])<<0,s0=((b=t1+(s0+maj)<<0)>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10),maj=(bc=b&c)^b&d^cd,e=a+(t1=e+(s1=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&g^~f&h)+K[j+3]+blocks[j+3])<<0,a=t1+(s0+maj)<<0;this.h0=this.h0+a<<0,this.h1=this.h1+b<<0,this.h2=this.h2+c<<0,this.h3=this.h3+d<<0,this.h4=this.h4+e<<0,this.h5=this.h5+f<<0,this.h6=this.h6+g<<0,this.h7=this.h7+h<<0},Sha256.prototype.hex=function(){this.finalize();var h0=this.h0,h1=this.h1,h2=this.h2,h3=this.h3,h4=this.h4,h5=this.h5,h6=this.h6,h7=this.h7,hex=HEX_CHARS[h0>>28&15]+HEX_CHARS[h0>>24&15]+HEX_CHARS[h0>>20&15]+HEX_CHARS[h0>>16&15]+HEX_CHARS[h0>>12&15]+HEX_CHARS[h0>>8&15]+HEX_CHARS[h0>>4&15]+HEX_CHARS[15&h0]+HEX_CHARS[h1>>28&15]+HEX_CHARS[h1>>24&15]+HEX_CHARS[h1>>20&15]+HEX_CHARS[h1>>16&15]+HEX_CHARS[h1>>12&15]+HEX_CHARS[h1>>8&15]+HEX_CHARS[h1>>4&15]+HEX_CHARS[15&h1]+HEX_CHARS[h2>>28&15]+HEX_CHARS[h2>>24&15]+HEX_CHARS[h2>>20&15]+HEX_CHARS[h2>>16&15]+HEX_CHARS[h2>>12&15]+HEX_CHARS[h2>>8&15]+HEX_CHARS[h2>>4&15]+HEX_CHARS[15&h2]+HEX_CHARS[h3>>28&15]+HEX_CHARS[h3>>24&15]+HEX_CHARS[h3>>20&15]+HEX_CHARS[h3>>16&15]+HEX_CHARS[h3>>12&15]+HEX_CHARS[h3>>8&15]+HEX_CHARS[h3>>4&15]+HEX_CHARS[15&h3]+HEX_CHARS[h4>>28&15]+HEX_CHARS[h4>>24&15]+HEX_CHARS[h4>>20&15]+HEX_CHARS[h4>>16&15]+HEX_CHARS[h4>>12&15]+HEX_CHARS[h4>>8&15]+HEX_CHARS[h4>>4&15]+HEX_CHARS[15&h4]+HEX_CHARS[h5>>28&15]+HEX_CHARS[h5>>24&15]+HEX_CHARS[h5>>20&15]+HEX_CHARS[h5>>16&15]+HEX_CHARS[h5>>12&15]+HEX_CHARS[h5>>8&15]+HEX_CHARS[h5>>4&15]+HEX_CHARS[15&h5]+HEX_CHARS[h6>>28&15]+HEX_CHARS[h6>>24&15]+HEX_CHARS[h6>>20&15]+HEX_CHARS[h6>>16&15]+HEX_CHARS[h6>>12&15]+HEX_CHARS[h6>>8&15]+HEX_CHARS[h6>>4&15]+HEX_CHARS[15&h6];return this.is224||(hex+=HEX_CHARS[h7>>28&15]+HEX_CHARS[h7>>24&15]+HEX_CHARS[h7>>20&15]+HEX_CHARS[h7>>16&15]+HEX_CHARS[h7>>12&15]+HEX_CHARS[h7>>8&15]+HEX_CHARS[h7>>4&15]+HEX_CHARS[15&h7]),hex},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var h0=this.h0,h1=this.h1,h2=this.h2,h3=this.h3,h4=this.h4,h5=this.h5,h6=this.h6,h7=this.h7,arr=[h0>>24&255,h0>>16&255,h0>>8&255,255&h0,h1>>24&255,h1>>16&255,h1>>8&255,255&h1,h2>>24&255,h2>>16&255,h2>>8&255,255&h2,h3>>24&255,h3>>16&255,h3>>8&255,255&h3,h4>>24&255,h4>>16&255,h4>>8&255,255&h4,h5>>24&255,h5>>16&255,h5>>8&255,255&h5,h6>>24&255,h6>>16&255,h6>>8&255,255&h6];return this.is224||arr.push(h7>>24&255,h7>>16&255,h7>>8&255,255&h7),arr},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var buffer=new ArrayBuffer(this.is224?28:32),dataView=new DataView(buffer);return dataView.setUint32(0,this.h0),dataView.setUint32(4,this.h1),dataView.setUint32(8,this.h2),dataView.setUint32(12,this.h3),dataView.setUint32(16,this.h4),dataView.setUint32(20,this.h5),dataView.setUint32(24,this.h6),this.is224||dataView.setUint32(28,this.h7),buffer},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var innerHash=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(innerHash),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}()}).call(this,__webpack_require__(4),__webpack_require__(5),__webpack_require__(12)(module))},function(module,exports,__webpack_require__){"use strict";var Reflection=__webpack_require__(10),Encoder=__webpack_require__(47),Types=__webpack_require__(3).Types,compositionTypes=[Types.Struct,Types.Interface,Types.ArrayStruct,Types.Interface],encodeBinary=function encodeBinary(instance,type,opts){var isBare=!(3>>=7;out[offset]=0|num;encode.bytes=offset-oldOffset+1;return out};var MSB=128,MSBALL=-128,INT=Math.pow(2,31)},function(module,exports,__webpack_require__){"use strict";module.exports=function read(buf,offset){var b,res=0,offset=offset||0,shift=0,counter=offset,l=buf.length;do{if(l<=counter)throw read.bytes=0,new RangeError("Could not decode varint");b=buf[counter++],res+=shift<28?(b&REST)< * * Copyright (c) 2015-2018, Jon Schlinkert. * Released under the MIT License. - */module.exports=function(time){if(!Array.isArray(time)||2!==time.length)throw new TypeError("expected an array from process.hrtime()");return 1e9*+time[0]+ +time[1]}},function(module,exports,__webpack_require__){"use strict";var Reflection=__webpack_require__(9),Decoder=__webpack_require__(119),_require=__webpack_require__(3),Types=_require.Types,WireMap=(_require.WireType,_require.WireMap),decodeBinary=function decodeBinary(bz,instance){var isBare=!(2Number.MaxInt8)throw new TypeError("EOF decoding int8");return{data:Int8Array.from([result.data])[0],byteLength:result.byteLength}},decodeInt16:function decodeInt16(input){var result=decodeSignedVarint(input);if(result.data>Number.MaxInt16)throw new TypeError("EOF decoding int8");return{data:new Int16Array.from([result])[0],byteLength:result.byteLength}},decodeString:function decodeString(input){var decodedSlice=decodeSlice(input);return{data:Buffer.from(decodedSlice.data).toString("utf8"),byteLength:decodedSlice.byteLength}},decodeFieldNumberAndType:function decodeFieldNumberAndType(bz){var decodedData=decodeUVarint(bz),wiretypeNumber=7&decodedData.data,type=WireMap.keysOf(wiretypeNumber),idx=decodedData.data>>3;return{type:type,byteLength:decodedData.byteLength,idx:idx}},decodeSlice:decodeSlice},__webpack_require__.c[__webpack_require__.s]===module){var typeArr=new Int8Array([150,160,10]);console.log(typeArr)}}).call(this,__webpack_require__(13)(module))},function(module,exports,__webpack_require__){"use strict";var Reflection=__webpack_require__(9),Types=__webpack_require__(3).Types,Buffer=__webpack_require__(0).Buffer,encodeJson=function encodeJson(instance,type){var tmpInstance=instance;if(type!=Types.Struct&&type!=Types.Interface&&type!=Types.Array){var keys=Reflection.ownKeys(instance);0 { - - Reflection.ownKeys(instance).forEach((key, idx) => { - - let type = instance.lookup(key) //only valid with BaseTypeAmino.todo: checking - - let {data, newBz} = decodeBinaryField(bz, idx, type,instance[key]) - instance[key] = data - bz = newBz - }) - if(!isBare) { - // console.log("data=",instance) - return { - data: instance, - newBz:bz - } - } - else return; - -} - -const decodeBinaryField = (bz, idx, type,instance) => { - let decodedFieldtype = Decoder.decodeFieldNumberAndType(bz) - //if (type.toString() != decodedFieldtype.type.toString()) throw new TypeError("Type does not match in decoding") - if (WireMap[type] != WireMap[decodedFieldtype.type]) throw new TypeError("Type does not match in decoding") - - if (idx + 1 != decodedFieldtype.idx) throw new RangeError("Index of Field is not match while decoding") - bz = bz.slice(decodedFieldtype.byteLength) - let decodedData = null; - switch (type) { - - case Types.Int64: - { - //todo - break; - } - case Types.String: - { - decodedData = Decoder.decodeString(bz) - break; - } - case Types.Int8: - { - decodedData = Decoder.decodeInt8(bz) - - break; - } - case Types.Struct: - { let firstField = Decoder.decodeSlice(bz) - bz = bz.slice(1) - decodedData = decodeBinary(bz, instance, false) - break; - } - default: - { - console.log("There is no data type to decode") - break; - } - } - if (decodedData) { - bz = bz.slice(decodedData.byteLength) - } - return { - data: decodedData.data, - newBz: bz - } - -} - - - -module.exports = { - decodeBinary -} \ No newline at end of file diff --git a/src/lib/Js-Amino/src/binaryEncoder.js b/src/lib/Js-Amino/src/binaryEncoder.js deleted file mode 100644 index b13d71c..0000000 --- a/src/lib/Js-Amino/src/binaryEncoder.js +++ /dev/null @@ -1,202 +0,0 @@ -const Reflection = require("./reflect") -const Encoder = require("./encoder") -let { - Types, -} = require('./types') - -const encodeBinary = (instance, type, opts, isBare = true) => { - - let tmpInstance = instance; - - //retrieve the single property of the Registered AminoType - if (type != Types.Struct && type != Types.Interface && type != Types.ArrayStruct && type != Types.Interface) { //only get the first property with type != Struct - let keys = Reflection.ownKeys(instance); - if (keys.length > 0) { //type of AminoType class with single property - keys.forEach(key => { - let aminoType = instance.lookup(key) - if (type != aminoType) throw new TypeError("Amino type does not match") - tmpInstance = instance[key] - return; - }) - } - } - - let data = null; - switch (type) { - - case Types.Int8: - { - data = Encoder.encodeSignedVarint(tmpInstance) - break; - } - - case Types.Int16: - { - data = Encoder.encodeSignedVarint(tmpInstance) - break; - } - - case Types.Int32: - { - if (opts.binFixed32) { - data = Encoder.encodeInt32(tmpInstance) - } else { - data = Encoder.encodeUVarint(tmpInstance) - } - - break; - } - - case Types.Int64: - { - if (opts.binFixed64) { - data = Encoder.encodeInt64(tmpInstance) - } else { - data = Encoder.encodeUVarint(tmpInstance) - } - break; - } - /* case Types.Time: - { - data = encodeTime(tmpInstance, isBare) //Encoder.encodeTime(tmpInstance) - break; - }*/ - case Types.Boolean: - { - data = Encoder.encodeBoolean(tmpInstance) - break; - } - case Types.String: - { - let encodedString = Encoder.encodeString(tmpInstance) - data = encodedString - break; - } - - case Types.Struct: - { - data = encodeBinaryStruct(tmpInstance, opts, isBare) - break; - } - case Types.ByteSlice: - { - data = Encoder.encodeSlice(tmpInstance) - break; - } - - case Types.ArrayStruct: - { - data = encodeBinaryArray(tmpInstance, Types.ArrayStruct, opts, isBare) - break; - } - - case Types.ArrayInterface: - { - data = encodeBinaryArray(tmpInstance, Types.ArrayInterface, opts, isBare) - break; - } - - case Types.Interface: - { - let data = encodeBinaryInterface(tmpInstance, opts, isBare) - return data; //dirty hack - } - default: - { - console.log("There is no data type to encode:", type) - break; - } - } - - return data; - -} - -const encodeBinaryInterface = (instance, opts, isBare) => { - let data = encodeBinary(instance, instance.type, opts, true) //dirty-hack - data = instance.info.prefix.concat(data) - if (!isBare) { - data = Encoder.encodeUVarint(data.length).concat(data) - } - return data; - -} - - -const encodeBinaryStruct = (instance, opts, isBare = true) => { - let result = [] - Reflection.ownKeys(instance).forEach((key, idx) => { - let type = instance.lookup(key) //only valid with BaseTypeAmino.todo: checking - let encodeData = null; - encodeData = encodeBinaryField(instance[key], idx, type, opts) - if (encodeData) { - result = result.concat(encodeData) - } - - }) - if (!isBare) { - result = Encoder.encodeUVarint(result.length).concat(result) - } - - return result; - -} - - - -const encodeBinaryField = (typeInstance, idx, type, opts) => { - let encodeData = null - if (type == Types.ArrayStruct || type == Types.ArrayInterface) { - encodeData = encodeBinaryArray(typeInstance, type, opts, true, idx) - } else if (type == Types.Time) { - encodeData = encodeTime(typeInstance, idx,false) - } else { - encodeData = encodeBinary(typeInstance, type, opts, false) - let encodeField = Encoder.encodeFieldNumberAndType(idx + 1, Reflection.typeToTyp3(type, opts)) - encodeData = encodeField.concat(encodeData) - } - - return encodeData -} - -const encodeBinaryArray = (instance, arrayType, opts, isBare = true, idx = 0) => { - let result = [] - - for (let i = 0; i < instance.length; ++i) { - let item = instance[i] - - let encodeField = Encoder.encodeFieldNumberAndType(idx + 1, Reflection.typeToTyp3(Types.ArrayStruct, opts)) - let itemType = arrayType == Types.ArrayInterface ? Types.Interface : Types.Struct - let data = encodeBinary(item, itemType, opts, false) - if (data) { - data = encodeField.concat(data) - result = result.concat(data) - } - } - if (!isBare) { - result = Encoder.encodeUVarint(result.length).concat(result) - } - - return result; -} - -const encodeTime = (time, idx, isBare) => { - let result = [] - let encodeData = null; - encodeData = Encoder.encodeTime(time); - result = result.concat(encodeData); - - if (!isBare) { - result = Encoder.encodeUVarint(result.length).concat(result) - } - let encodeField = Encoder.encodeFieldNumberAndType(idx + 1, Reflection.typeToTyp3(Types.Struct, opts)) //notice: use Types.Struct -> Time is a special of Struct - result = encodeField.concat(result) - return result - -} - - - -module.exports = { - encodeBinary -} \ No newline at end of file diff --git a/src/lib/Js-Amino/src/codec.js b/src/lib/Js-Amino/src/codec.js deleted file mode 100644 index 816bd15..0000000 --- a/src/lib/Js-Amino/src/codec.js +++ /dev/null @@ -1,140 +0,0 @@ -const RegisteredType = require("./registeredType").RegisteredType -const Reflection = require("./reflect") -const BinaryEncoder = require("./binaryEncoder") -const BinaryDecoder = require("./binaryDecoder") -const JsonEncoder = require("./jsonEncoder") -const JsonDecoder = require("./jsonDecoder") -const Encoder = require("./encoder") -const TypeFactory = require("./typeFactory") -const Utils = require("./utils") - -let { - Types, - WireType -} = require('./types') - - -let instance = null; - -let privObj = { - typeMap: null -} - -class FieldOtions { - - constructor(opts = {}) { - this.jsonName = opts.jsonName || ""; - this.jsonOmitEmpty = opts.jsonOmitEmpty || ""; - this.binFixed64 = opts.binFixed64 || false; // (Binary) Encode as fixed64 - this.binFixed32 = opts.binFixed32 || false; // (Binary) Encode as fixed32 - this.unsafe = opts.unsafe || false; // e.g. if this field is a float. - this.writeEmpty = opts.writeEmpty || false; // write empty structs and lists (default false except for pointers) - this.emptyElements = opts.emptyElements || false; // Slice and Array elements are never nil, decode 0x00 as empty struct. - - } -} - -class Codec { - - constructor() { - if (!instance) { - instance = this; //singleton-design pattern - } - privObj.typeMap = new Map() - return instance; - } - - lookup(typeName) { - return this.typeMap.get(typeName); - } - - set(typeName, registeredType) { - privObj.typeMap.set(typeName, registeredType) - } - - registerConcrete(instance, name, opt) { - let typeName = Reflection.typeOf(instance); - if (this.lookup(typeName)) { - throw new Error(`${typeName} was registered`) - } - let type = new RegisteredType(name, typeName) - type.registered = true - instance.info = type - this.set(typeName, type) - - } - - marshalJson(obj) { - if (!obj) return null; - let typeInfo = this.lookup(Reflection.typeOf(obj)) - let value = JsonEncoder.encodeJson(obj, obj.type) - // if this object was not registered with prefix - let serializedObj = value - // if this object was registered with prefix - if (typeInfo && typeInfo.name) { - serializedObj = { - type: typeInfo.name, - value: value, - } - } - return JSON.stringify(serializedObj) - } - - unMarshalJson(json, instance) { - let deserializedObj = JSON.parse(json) - let typeName = Reflection.typeOf(instance); - if (!this.lookup(typeName)) { - throw new Error(`No ${typeName} was registered`) - } - let value = deserializedObj - let typeInfo = this.lookup(Reflection.typeOf(instance)) - if (typeInfo && typeInfo.name) { - if (deserializedObj.type !== typeInfo.name) { - throw new Error(`Type not match. expected: ${typeInfo.name}, but: ${deserializedObj.type}`) - } - value = deserializedObj.value - } - JsonDecoder.decodeJson(value, instance) - } - - marshalBinary(obj, fieldOpts = new FieldOtions()) { - if (!obj) return null - // let typeInfo = this.lookup(Reflection.typeOf(obj)) - // if (!typeInfo) return null; - let encodedData = BinaryEncoder.encodeBinary(obj, obj.type, fieldOpts) - if (obj.info) { //if this object was registered with prefix - if (obj.info.registered) { - encodedData = obj.info.prefix.concat(encodedData) - } - } - - let lenBz = Encoder.encodeUVarint(encodedData.length) - - return lenBz.concat(encodedData) - } - - unMarshalBinary(bz, instance) { - if (bz.length == 0) throw new RangeError("UnmarshalBinary cannot decode empty bytes") - if (!instance) throw new TypeError("UnmarshalBinary cannot decode to Null instance") - let typeName = Reflection.typeOf(instance) - let typeInfo = this.lookup(typeName) - if (!typeInfo) throw new TypeError(`No ${typeName} was registered`) - let length = bz[0] - let realbz = bz.slice(1); - if (length != realbz.length) throw new RangeError("Wrong length") - if (!Utils.isEqual(realbz.slice(0, 4), typeInfo.prefix)) { - throw new TypeError("prefix not match") - } - realbz = bz.slice(5) - BinaryDecoder.decodeBinary(realbz, instance) - - } - get typeMap() { - return privObj.typeMap; - } -} - -module.exports = { - Codec, - FieldOtions -} \ No newline at end of file diff --git a/src/lib/Js-Amino/src/decoder.js b/src/lib/Js-Amino/src/decoder.js deleted file mode 100644 index 6227cb0..0000000 --- a/src/lib/Js-Amino/src/decoder.js +++ /dev/null @@ -1,108 +0,0 @@ -let uVarint = require('varint') -var sVarint = require('signed-varint') -let Utils = require('./utils') -let { - Types, - WireType, - WireMap -} = require('./types') -let { Buffer } = require('safe-buffer') - -const decodeSignedVarint = input => { - if( !input ) throw new TypeError("Can not decodeSignedVarint invalid input") - if( !input.length ) throw new TypeError("Can not decodeSignedVarint invalid input length") - let buf = sVarint.decode(input) - - return { - data: buf, - byteLength: sVarint.decode.bytes - }; -} - -const decodeUVarint = input => { - if( !input || !Array.isArray(input) ) throw new TypeError("Can not decodeSignedVarint invalid input") - if( !input.length ) throw new TypeError("Can not decodeSignedVarint invalid input length") - let buf = uVarint.decode(input) - - return { - data: buf, - byteLength: uVarint.decode.bytes - }; -} - -const decodeInt8 = input => { - let result = decodeSignedVarint(input) - if( result.data > Number.MaxInt8) throw new TypeError("EOF decoding int8") - let int8Buffer = Int8Array.from([result.data]); - - return { - data: int8Buffer[0], - byteLength: result.byteLength - }; -} - -const decodeInt16 = input => { - let result = decodeSignedVarint(input) - if( result.data > Number.MaxInt16) throw new TypeError("EOF decoding int8") - let int16Buffer = new Int16Array.from([result]); - - return { - data: int16Buffer[0], - byteLength: result.byteLength - }; -} - -const decodeString = input => { - /* let {data,byteLength} = decodeUVarint(input) - let strLength = data - if(input.length < strLength) throw new RangeError(`insufficient bytes decoding string of length ${strLength}`) - - let str = input.slice(byteLength,strLength+1); */ - let decodedSlice = decodeSlice(input) - let str = Buffer.from(decodedSlice.data).toString('utf8') - - return { - data:str, - byteLength: decodedSlice.byteLength - } -} - -const decodeSlice = input =>{ - let {data,byteLength} = decodeUVarint(input) - let length = data - if(input.length < length) throw new RangeError(`insufficient bytes decoding string of length ${strLength}`) - - let slicedData = input.slice(byteLength,length+1); - - return { - data:slicedData, - byteLength: byteLength + length - } -} - -const decodeFieldNumberAndType = bz => { - let decodedData = decodeUVarint(bz) - let wiretypeNumber = decodedData.data & 0x07 - let type = WireMap.keysOf(wiretypeNumber) - let idx = decodedData.data >> 3 - - return { - type: type, - byteLength: decodedData.byteLength, - idx: idx - } -} - -module.exports = { - decodeInt8, - decodeInt16, - decodeString, - decodeFieldNumberAndType, - decodeSlice -} - -if (require.main === module) { - const typeArr = new Int8Array([150,160,10]) - console.log(typeArr) - -} \ No newline at end of file diff --git a/src/lib/Js-Amino/src/encoder.js b/src/lib/Js-Amino/src/encoder.js deleted file mode 100644 index 17d427b..0000000 --- a/src/lib/Js-Amino/src/encoder.js +++ /dev/null @@ -1,118 +0,0 @@ -let varint = require('varint') -var svarint = require('signed-varint') -let Int53 = require('int53') -const nano = require('nanoseconds'); -let { - Buffer -} = require('safe-buffer') -const Utils = require("./utils") -let { - Types, - WireType, - WireMap -} = require('./types') - -const encodeSignedVarint = input => { - let buf = svarint.encode(input) - return buf; -} - -const encodeUVarint = input => { - let buf = varint.encode(input) - return buf; -} -//encode sign functions -const encodeInt8 = input => { - return encodeSignedVarint(input) -} - -const encodeInt16 = input => { - return encodeSignedVarint(input) //todo: add Int16Array ? -} - -const encodeInt32 = input => { - let buffer = new ArrayBuffer(4); //4 byte - let view = new DataView(buffer); - view.setUint32(0, input, true); // little endiant - return Array.from(new Uint8Array(buffer)); -} - -//todo: using TypeArray for compatibility with React and Web -const encodeInt64 = input => { - let buff = Buffer(8) - Int53.writeInt64LE(input, buff, 0) - return Array.from(new Int32Array(buff)) -} - -const encodeSlice = input => { - let encodedData = input.slice(); - - return encodeUVarint(input.length).concat(encodedData) -} - -const encodeString = input => { - return encodeSlice(Array.from(Buffer.from(input))) -} - -const encodeUint8 = input => { - return encodeUVarint(input) //todo: add Uint8Array -} - -const encodeBoolean = input => { - if (input) return encodeUint8(1) - return encodeUint8(0) -} - -const encodeTime = time => { - let data = [] - let s = time.getTime() / 1000 //get the second - - if (s != 0) { - if (s < Utils.MinSecond && s >= Utils.MaxSecond) { - throw new RangeError(`Second have to be >= ${Utils.MinSecond}, and <: ${Utils.MaxSecond}`) - } - let encodeField = encodeFieldNumberAndType(1, WireMap[Types.Time]) - data = encodeField.concat(encodeUVarint(s)) - } - - /*let ns = nano([0, s*1000000]); - ns = 0 - if (ns != 0) { - if (ns < 0 && ns > Utils.MaxNano) { - throw new RangeError(`NanoSecond have to be >= 0, and <=: ${Utils.MaxNano}`) - } - let encodeField = encodeFieldNumberAndType(2, WireMap[Types.Time]) - data = data.concat(encodeField.concat(encodeUVarint(ns))) - } - */ - return data; - -} - -const encodeFieldNumberAndType = (num, type) => { //reference:https://developers.google.com/protocol-buffers/docs/encoding - let encodedVal = (num << 3 | type) - return varint.encode(encodedVal) -} - - -module.exports = { - encodeSignedVarint, - encodeFieldNumberAndType, - encodeString, - encodeInt8, - encodeInt16, - encodeInt32, - encodeInt64, - encodeSlice, - encodeBoolean, - encodeUVarint, - encodeTime -} - -if (require.main == module) { - let time = new Date('01 Dec 2018 00:12:00 GMT'); - - - let result = encodeTime(time) - console.log(result) -} \ No newline at end of file diff --git a/src/lib/Js-Amino/src/examples/byteSlice.js b/src/lib/Js-Amino/src/examples/byteSlice.js deleted file mode 100644 index 8767f66..0000000 --- a/src/lib/Js-Amino/src/examples/byteSlice.js +++ /dev/null @@ -1,99 +0,0 @@ -let { - Codec, - TypeFactory, - Utils, - Types, - WireTypes -} = require('../index') -let PubSecp256k1 = TypeFactory.create('PubSecp256k1', [{ - name: "a", - type: Types.ByteSlice -}], Types.ByteSlice) - -let Signature = TypeFactory.create('Signature', [{ - name: "a", - type: Types.ByteSlice -}], Types.ByteSlice) - -let MsgSend = TypeFactory.create('MsgSend', [{ - name: "nonce", - type: Types.Int8 -}, -{ - name: "from", - type: Types.String -}, -{ - name: "to", - type: Types.String -}, -{ - name: "amount", - type: Types.Struct -} -]) - -let Coin = TypeFactory.create('Coin', [{ - name: "denom", - type: Types.String -}, -{ - name: "amount", - type: Types.Int8 -} -]) - -let AuthSignature = TypeFactory.create('AuthSignature', [{ - name: "pubKey", - type: Types.Interface -}, -{ - name: "signature", - type: Types.Interface -}, -{ - name: "nonce", - type: Types.Int8 -} -]) - -let AuthTx = TypeFactory.create('AuthTx', [{ - name: "msg", - type: Types.Interface -}, -{ - name: "signature", - type: Types.Struct -} -]) - -let codec = new Codec() -codec.registerConcrete(new PubSecp256k1(), "shareledger/PubSecp256k1", {}) -codec.registerConcrete(new Signature(), "shareledger/SigSecp256k1", {}) -codec.registerConcrete(new MsgSend(), "shareledger/bank/MsgSend", {}) -codec.registerConcrete(new AuthSignature(), "shareledger/AuthSig", {}) -codec.registerConcrete(new AuthTx(), "shareledger/AuthTx", {}) - -let pubKey = [4,66,153,172,244,182,160,156,54,242,103,168,146,69,89,181,159,160,108,93,62,42,93,252,4, - 232,56,176,21,70,198,18,48,42,124,225,1,52,30,72,142,47,87,44,217,113,131,20,117,155,23,226,47,118, - 11,140,178,199,13,157,229,105,196,193,161 -] - -let sig = [48,68,2,32,101,18,119,62,51,82,180,164,154,248,72,19,153,166,116,53,130,231,180,222,146,201, - 186,161,93,216,194,52,71,171,218,0,2,32,98,57,131,172,45,35,92,168,70,177,10,180,179,33,11,134,40, - 229,60,88,37,11,117,116,155,131,146,103,236,176,53,106 -] -let nonce = 10 -let pubSecp256k1 = new PubSecp256k1(pubKey) -let signature = new Signature(sig) -let coin = new Coin('SHR',10) -let msgSend = new MsgSend(nonce,"1234567","2345678",coin) -let authSig = new AuthSignature(pubSecp256k1,signature,nonce) -let authTx = new AuthTx(msgSend,authSig) - -let binary = codec.marshalBinary(authTx) -//console.log("length=",binary.length) - - - -console.log(binary.toString()) \ No newline at end of file diff --git a/src/lib/Js-Amino/src/examples/interfaceTest.go b/src/lib/Js-Amino/src/examples/interfaceTest.go deleted file mode 100644 index b7e4d6f..0000000 --- a/src/lib/Js-Amino/src/examples/interfaceTest.go +++ /dev/null @@ -1,188 +0,0 @@ -package main - -import ( - "fmt" - "strconv" - - "encoding/hex" - "encoding/json" - - "github.com/btcsuite/btcd/btcec" - amino "github.com/tendermint/go-amino" - crypto "github.com/tendermint/go-crypto" - cmn "github.com/tendermint/tmlibs/common" -) - -type PubKeySecp256k1 [65]byte -type SignatureSecp256k1 []byte -type Address = cmn.HexBytes - -//Msg Zone -type MsgSend struct { - Nonce int8 `json:"nonce"` - From Address `json:"from"` - To Address `json:"to"` - Amount Coin `json:"amount"` -} -type Msg interface { - GetSignBytes() []byte -} - -// NewMsgSend -func NewMsgSend(nonce int8, from, to Address, amt Coin) MsgSend { - return MsgSend{nonce, from, to, amt} -} - -func (msg MsgSend) GetSignBytes() []byte { - bz, err := json.Marshal(msg) - if err != nil { - panic(err) - } - return bz -} - -var _Msg = MsgSend{} - -//Coin Zone -type Coin struct { - Denom string `json:"denom"` - Amount int8 `json:"amount"` -} - -func NewCoin(denom string, amount int8) Coin { - return Coin{ - Denom: denom, - Amount: amount, - } -} - -//signature zone -type Signature interface { -} - -type AuthSig struct { - PubKey `json:"pub_key"` - Signature `json:"signature"` - Nonce int8 `json:"nonce"` -} - -var _Signature = SignatureSecp256k1{} - -func NewAuthSig(key PubKeySecp256k1, sig SignatureSecp256k1, nonce int8) AuthSig { - return AuthSig{ - PubKey: key, - Signature: sig, - Nonce: nonce, - } -} - -//Transaction Zone -type AuthTx struct { - Msg `json:"message"` - Signature AuthSig `json:"signature"` -} - -func NewAuthTx(msg MsgSend, sig AuthSig) AuthTx { - return AuthTx{ - Msg: msg, - Signature: sig, - } -} - -//public Key zone: -type PubKey interface { -} - -var _ PubKey = PubKeySecp256k1{} - -func main() { - - var cdc = amino.NewCodec() - - cdc.RegisterInterface((*Msg)(nil), nil) //need to register this interface - cdc.RegisterConcrete(MsgSend{}, "shareledger/bank/MsgSend", nil) //MsgSend appear as an interface in bz - - //public key - cdc.RegisterInterface((*PubKey)(nil), nil) - cdc.RegisterConcrete(PubKeySecp256k1{}, "shareledger/PubSecp256k1", nil) - - cdc.RegisterConcrete(AuthTx{}, "shareledger/AuthTx", nil) - - cdc.RegisterInterface((*Signature)(nil), nil) - cdc.RegisterConcrete(SignatureSecp256k1{}, "shareledger/SigSecp256k1", nil) - cdc.RegisterConcrete(AuthSig{}, "shareledger/AuthSig", nil) - - pkBytes, _ := hex.DecodeString("ab83994cf95abe45b9d8610524b3f8f8fd023d69f79449011cb5320d2ca180c5") - - privKey_, pubKey_ := btcec.PrivKeyFromBytes(btcec.S256(), pkBytes) - - serPubKey := pubKey_.SerializeUncompressed() - var pubKey PubKeySecp256k1 - - copy(pubKey[:], serPubKey[:65]) - for i := 0; i < len(pubKey); i++ { - fmt.Printf("%d,", pubKey[i]) - } - - fmt.Println("========================") - - msgSend := MsgSend{ - Nonce: 10, - From: Address([]byte("1234567")), - To: Address([]byte("2345678")), - Amount: Coin{ - Denom: "SHR", - Amount: 10, - }, - } - - nonce := 10 - - // Signing - signBytes := msgSend.GetSignBytes() - - signBytesWithNonce := append([]byte(strconv.Itoa(nonce)), signBytes...) - //fmt.Println("signBytesWithNonce=", signBytesWithNonce) - - messageHash := crypto.Sha256(signBytesWithNonce) - - signature, _ := privKey_.Sign(messageHash) - - serSig := signature.Serialize() - - //fmt.Println("serSig=", serSig) - - var ecSig SignatureSecp256k1 - ecSig = append(ecSig, serSig...) - for i := 0; i < len(ecSig); i++ { - fmt.Printf("%d,", ecSig[i]) - } - - fmt.Println("========================") - //fmt.Println("ecSig=", ecSig) - - shrSig := NewAuthSig(pubKey, ecSig, int8(nonce)) - //bzSig, _ := cdc.MarshalBinary(shrSig) - //fmt.Println("bzSig=", bzSig) - - tx := NewAuthTx(msgSend, shrSig) - bz, _ := cdc.MarshalBinaryLengthPrefixed(tx) - fmt.Println("bz=", bz) - - bzJs := []byte{193, 1, 173, 15, 17, 189, 10, 33, 132, 82, 52, 230, 8, 20, 18, 7, 49, 50, 51, 52, 53, 54, 55, 26, 7, 50, 51, 52, 53, 54, 55, 56, 34, 7, 10, 3, 83, 72, 82, 16, 20, 18, 151, 1, 10, 70, 215, 60, 88, 212, 65, 4, 66, 153, 172, 244, 182, 160, 156, 54, 242, 103, 168, 146, 69, 89, 181, 159, 160, 108, 93, 62, 42, 93, 252, 4, 232, 56, 176, 21, 70, 198, 18, 48, 42, 124, 225, 1, 52, 30, 72, 142, 47, 87, 44, 217, 113, 131, 20, 117, 155, 23, 226, 47, 118, 11, 140, 178, 199, 13, 157, 229, 105, 196, 193, 161, 18, 75, 169, 50, 230, 39, 70, 48, 68, 2, 32, 101, 18, 119, 62, 51, 82, 180, 164, 154, 248, 72, 19, 153, 166, 116, 53, 130, 231, 180, 222, 146, 201, 186, 161, 93, 216, 194, 52, 71, 171, 218, 0, 2, 32, 98, 57, 131, 172, 45, 35, 92, 168, 70, 177, 10, 180, 179, 33, 11, 134, 40, 229, 60, 88, 37, 11, 117, 116, 155, 131, 146, 103, 236, 176, 53, 106, 24, 20} - //fmt.Println(bytes.Equal(bz, bzJs)) - /* bzPub, _ := cdc.MarshalBinaryLengthPrefixed(pubKey) - fmt.Println("BzpubKey=", bzPub) - pubKey2 := []byte{70, 215, 60, 88, 210, 65, 4, 66, 153, 172, 244, 182, 160, 156, 54, 242, 103, 168, 146, 69, 89, 181, 159, 160, 108, 93, 62, 42, 93, 252, 4, 232, 56, 176, 21, 70, - 198, 18, 48, 42, 124, 225, 1, 52, 30, 72, 142, 47, 87, 44, 217, 113, 131, 20, 117, 155, 23, 226, 47, 118, 11, 140, 178, 199, 13, 157, 229, 105, 196, 193, 161} - fmt.Println(string(bzPub) == string(pubKey2)) */ - - var newTx AuthTx - err := cdc.UnmarshalBinaryLengthPrefixed(bzJs, &newTx) - if err == nil { - fmt.Println("newTx=", newTx) - } else { - fmt.Println(err.Error()) - } - -} diff --git a/src/lib/Js-Amino/src/examples/interfaceTest.js b/src/lib/Js-Amino/src/examples/interfaceTest.js deleted file mode 100644 index 624ca52..0000000 --- a/src/lib/Js-Amino/src/examples/interfaceTest.js +++ /dev/null @@ -1,48 +0,0 @@ -let {Codec,TypeFactory,Utils, Types, WireTypes} = require('../index') - -//let codec1 = new Codec(); - -let Tx = TypeFactory.create('Tx', [{ - name: "msg", - type: Types.Interface -}]) - -let MsgSend = TypeFactory.create('MsgSend', [{ - name: "nonce", - type: Types.Int8 -}]) - -//interface 2 with byte-slice array -let Tx2 = TypeFactory.create('Tx2', [{ - name: "pubKey", - type: Types.Interface -}]) - -let PubSecp256k1 = TypeFactory.create('PubSecp256k1', [{ - name: "bytes", - type: Types.ByteSlice -}],Types.ByteSlice) - - - - -let codec = new Codec() -codec.registerConcrete(new Tx(), "shareledger/bank/Tx", {}) -codec.registerConcrete(new MsgSend(), "shareledger/bank/MsgSend", {}) - -codec.registerConcrete(new Tx2(), "shareledger/bank/Tx2", {}) -codec.registerConcrete(new PubSecp256k1(), "shareledger/PubSecp256k1", {}) - -let msgSend = new MsgSend(3) -let tx = new Tx(msgSend) - -let binary = codec.marshalBinary(tx) - -let pubKey = new PubSecp256k1([1,2,3]) -let tx2 = new Tx2(pubKey) -let binary2 = codec.marshalBinary(tx2) - -console.log(binary.toString()) -console.log(binary2.toString()) - -//console.log(bObj) diff --git a/src/lib/Js-Amino/src/examples/recursive_obj.go b/src/lib/Js-Amino/src/examples/recursive_obj.go deleted file mode 100644 index fcebc44..0000000 --- a/src/lib/Js-Amino/src/examples/recursive_obj.go +++ /dev/null @@ -1,53 +0,0 @@ -package main - -import ( - "fmt" - - amino "github.com/tendermint/go-amino" -) - -type PubKeySecp256k1 [5]byte - -func main() { - - type SubStruct struct { - E []byte - } - - type SubStruct3 struct { - A string - B int8 - } - - type SubStruct2 struct { - A string - B int8 - C SubStruct3 - } - - type SimpleStruct struct { - A int8 - B []SubStruct - C int8 - D string - E SubStruct2 - //E PubKeySecp256k1 - } - - var cdc = amino.NewCodec() - - cdc.RegisterConcrete(SimpleStruct{}, "SimpleStruct", nil) - cdc.RegisterConcrete(SubStruct{}, "SubStruct", nil) - - b2 := []byte{66, 74, 137, 196, 188, 8, 200, 1, 18, 5, 10, 3, 1, 2, 3, 18, 5, 10, 3, 2, 3, 4, 18, 5, 10, 3, 3, 4, 5, 24, 2, 34, 11, 74, 101, 32, 83, 117, 105, 115, 32, 84, 97, 110, 42, 21, 10, 5, 72, 101, 108, 108, 111, 16, 64, 26, 10, 10, 5, 87, 111, 114, 108, 100, 16, 160, 1} - - var s SimpleStruct - err := cdc.UnmarshalBinaryLengthPrefixed(b2, &s) - if err == nil { - fmt.Println("s=", s) - //fmt.Println(string(s.D.E)) - } else { - fmt.Println("decode error") - } - -} diff --git a/src/lib/Js-Amino/src/examples/recursive_obj.js b/src/lib/Js-Amino/src/examples/recursive_obj.js deleted file mode 100644 index 316cfcd..0000000 --- a/src/lib/Js-Amino/src/examples/recursive_obj.js +++ /dev/null @@ -1,107 +0,0 @@ -let { - Codec, - TypeFactory, - Utils, - Types, - WireTypes -} = require('../index') - -let codec1 = new Codec(); - -let SubA = TypeFactory.create('SubA', [{ - name: "a", - type: Types.String - }, - { - name: "b", - type: Types.Int8 - }, - { - name: "sub2", - type: Types.Struct - } -]) - -let SubA2 = TypeFactory.create('SubA2', [{ - name: "a", - type: Types.String - }, - { - name: "b", - type: Types.Int8 - } -]) - - - -let SimpleStruct = TypeFactory.create('SimpleStruct', [{ - name: "a", - type: Types.Int8 - }, - { - name: "b", - type: Types.ArrayStruct - }, - { - name: "c", - type: Types.Int8 - }, - { - name: "d", - type: Types.String - }, - { - name: "e", - type: Types.Struct - } -]) - - - -let SubStruct = TypeFactory.create('SubStruct', [{ - name: "a", - type: Types.ByteSlice -}]) - - - -codec1.registerConcrete(new SimpleStruct(), "SimpleStruct", {}) -codec1.registerConcrete(new SubStruct(), "SubStruct", {}) -let subStructs = [] -for (let i = 0; i < 3; ++i) { - let subStruct = new SubStruct([i + 1, i + 2, i + 3]); - subStructs.push(subStruct) -} -let obj = new SimpleStruct(100, subStructs, 1, "Je Suis Tan", new SubA('Hello', 32, new SubA2('World', 80))) -/*let subObj = new SubA(10) -let subObj2 = new SubA2("Do Ngoc Tan",21) -let aObj = new A(23,"Sanh la tin", new SubA("Toi la Tan",12,subObj2)) -let bObj = new A() -*/ -let binary = codec1.marshalBinary(obj) -console.log(binary.toString()) - -/* -codec1.unMarshalBinary(binary,bObj) -if( Utils.isEqual(aObj,bObj)) { - console.log("equal") -} -else console.log("Not equal") - -//console.log(bObj) -*/ - - -/* -codec1.registerConcrete(new B(), "SimpleStruct", {}) -let obj = new B("Tan",1,2,new SubA2("sanh la tin",21)); -let obj2 = new B(); -let obj3 = new B() -let binary = codec1.marshalBinary(obj) -//console.log(binary) -console.log(obj) -codec1.unMarshalBinary(binary,obj2) -console.log("obj2=",obj2) -console.log(Utils.isEqual(obj,obj2)) - -*/ \ No newline at end of file diff --git a/src/lib/Js-Amino/src/examples/slice_bugs.go b/src/lib/Js-Amino/src/examples/slice_bugs.go deleted file mode 100644 index faf867c..0000000 --- a/src/lib/Js-Amino/src/examples/slice_bugs.go +++ /dev/null @@ -1,91 +0,0 @@ -package main - -import ( - "encoding/hex" - "fmt" - - // codec "github.com/cosmos/cosmos-sdk/codec" - - codec "github.com/tendermint/go-amino" - - // "github.com/cosmos/cosmos-sdk/x/auth" - // "github.com/cosmos/cosmos-sdk/x/bank" - crypto "github.com/tendermint/tendermint/crypto" - "github.com/tendermint/tendermint/crypto/secp256k1" -) - -//Msg Zone -type MsgSend struct { - Nonce int8 `json:"nonce"` -} -type Msg interface { - GetSignBytes() []byte -} - -var _Msg = MsgSend{} - -// NewMsgSend -func NewMsgSend(nonce int8) MsgSend { - return MsgSend{nonce} -} - -func (msg MsgSend) GetSignBytes() []byte { - /* bz, err := json.Marshal(msg) - if err != nil { - panic(err) - } */ - return []byte{} -} - -// Standard Signature -type StdSignature struct { - crypto.PubKey `json:"pub_key"` // optional - Signature []byte `json:"signature"` - AccountNumber int8 `json:"account_number"` - Sequence int64 `json:"sequence"` -} - -type StdTx struct { - Msgs []Msg `json:"msg"` - //Fee StdFee `json:"fee"` - Signatures []StdSignature `json:"signatures"` - Memo string `json:"memo"` -} - -func main() { - var cdc = codec.NewCodec() - - cdc.RegisterInterface((*crypto.PubKey)(nil), nil) - cdc.RegisterInterface((*Msg)(nil), nil) - cdc.RegisterConcrete(secp256k1.PubKeySecp256k1{}, - "tendermint/PubKeySecp256k1", nil) - cdc.RegisterConcrete(MsgSend{}, - "bank/MsgSend", nil) - - cdc.RegisterConcrete(StdTx{}, "auth/StdTx", nil) - - //sdk.RegisterCodec(cdc) - //bank.RegisterCodec(cdc) - //auth.RegisterCodec(cdc) - /* - txEncoding := StdTx{Msgs: []Msg{MsgSend{Nonce: 1}}} - - bz, err := cdc.MarshalBinaryLengthPrefixed(txEncoding) - if err == nil { - fmt.Println("encode:", hex.EncodeToString(bz)) - } else { - fmt.Println(err.Error()) - }*/ - - //json, _ := cdc.MarshalJSON(stdTx) - //fmt.Println(string(json)) - - encodedBz, _ := hex.DecodeString("45f0625dee0a06c47602bf080212310a26eb5ae9872102745e346835ef675e880413ed29303e9e41cff37079525868ae986ee613b3f5421203010203180020001a0474657374") - var tx StdTx - err2 := cdc.UnmarshalBinaryLengthPrefixed(encodedBz, &tx) - if err2 == nil { - fmt.Println("newTx=", tx) - } else { - fmt.Println(err2.Error()) - } -} diff --git a/src/lib/Js-Amino/src/examples/slice_bugs.js b/src/lib/Js-Amino/src/examples/slice_bugs.js deleted file mode 100644 index 8a99fdd..0000000 --- a/src/lib/Js-Amino/src/examples/slice_bugs.js +++ /dev/null @@ -1,162 +0,0 @@ - -const { - Codec, - FieldOtions, - TypeFactory, - Utils, - Types, - WireTypes, - } = require('../index') - - - - const toHex = (buffer) => { - let s = '' - buffer.forEach((b) => { - b = b.toString(16) - if (b.length == 1) { - b = '0' + b - } - s += b - }) - return s - } - - const fromHex = (str) => { - let buffer = [] - for (let i = 0; i < str.length; i += 2) { - let hex = str.slice(i, i+2) - buffer.push(parseInt(hex, 16)) - } - return buffer - } - - let codec = new Codec() - - /* - type StdTx struct { - Msgs []sdk.Msg `json:"msg"` - Fee StdFee `json:"fee"` - Signatures []StdSignature `json:"signatures"` - Memo string `json:"memo"` - } - cdc.RegisterConcrete(StdTx{}, "auth/StdTx", nil) - */ - - let StdTx = TypeFactory.create('StdTx', [ - { - name: 'msg', - type: Types.ArrayInterface, - },/*, - { - name: 'fee', - type: Types.Struct, - },*/ - { - name: 'signatures', - type: Types.ArrayStruct, - }, - { - name: 'memo', - type: Types.String, - }, - ]) - - let MsgSend = TypeFactory.create('MsgSend', [{ - name: "nonce", - type: Types.Int8 -}]) - - let PubKeySecp256k1 = TypeFactory.create('PubKeySecp256k1', [ - { - name: 's', - type: Types.ByteSlice, - } - ], Types.ByteSlice) - - let Signature = TypeFactory.create('signature', [ - { - name: 'pub_key', - type: Types.Interface, - }, - { - name: 'signature', - type: Types.ByteSlice, - }, - { - name: 'account_number', - type: Types.Int8, - }, - { - name: 'sequence', - type: Types.Int64, - } - ]) - - let Coin = TypeFactory.create('coin', [ - { - name: 'denom', - type: Types.String, - }, - { - name: 'amount', - type: Types.Int8, - } - ]) - - let Fee = TypeFactory.create('fee', [ - { - name: 'amount', - type: Types.ArrayStruct, - }, - { - name: 'gas', - type: Types.Int8, - } - ]) - - let Output = TypeFactory.create('output', [ - { - name: 'address', - type: Types.ByteSlice, - }, - { - name: 'coins', - type: Types.ArrayStruct, - } - ]) - - let IssueMsg = TypeFactory.create('cosmos-sdk/Issue', [ - { - name: 'banker', - type: Types.ByteSlice, - }, - { - name: 'outputs', - type: Types.ArrayStruct, - } - ]) - - codec.registerConcrete(new StdTx(), 'auth/StdTx', {}) - codec.registerConcrete(new MsgSend(), 'bank/MsgSend', {}) - codec.registerConcrete(new IssueMsg(), 'cosmos-sdk/Issue', {}) //c06abad6 - codec.registerConcrete(new PubKeySecp256k1(), 'tendermint/PubKeySecp256k1', {}) //eb5ae987 - let issueMsg = new IssueMsg([0], [new Output([0], [new Coin('test', 10000)])]) - let sendMsg = new MsgSend(1) - let fee = new Fee(new Coin('test', 0), 200000) - let sig = new Signature( - new PubKeySecp256k1(fromHex('02745e346835ef675e880413ed29303e9e41cff37079525868ae986ee613b3f542')), - [1,2,3], - 0, - 0) - - let stdTx = new StdTx([sendMsg], /*fee,*/ [sig], 'test') - let binary = codec.marshalBinary(stdTx) - console.log(toHex(binary)) - let json = codec.marshalJson(stdTx) - console.log(json) - - let stdTx2 = new StdTx() - codec.unMarshalJson(json, stdTx2) - console.log(stdTx2) - \ No newline at end of file diff --git a/src/lib/Js-Amino/src/examples/string.go b/src/lib/Js-Amino/src/examples/string.go deleted file mode 100644 index 953ef63..0000000 --- a/src/lib/Js-Amino/src/examples/string.go +++ /dev/null @@ -1,38 +0,0 @@ -package main - -import ( - "fmt" - - amino "github.com/tendermint/go-amino" -) - -type StrStruct struct { - Str1 string `json:"str1"` - Str2 string `json:"str2"` - Int int8 `json:"int"` -} - -func main() { - var cdc = amino.NewCodec() - - cdc.RegisterConcrete(StrStruct{}, "test/StrStruct", nil) - - strStruct := StrStruct{ - Str1: "ascii", - Str2: "안녕", - Int: 10, - } - - bz, err := cdc.MarshalBinaryLengthPrefixed(strStruct) - if err != nil { - panic(err) - } - fmt.Println(bz) - - strStruct2 := StrStruct{} - err = cdc.UnmarshalBinaryLengthPrefixed([]byte{21, 56, 46, 110, 101, 10, 5, 97, 115, 99, 105, 105, 18, 6, 236, 149, 136, 235, 133, 149, 24, 20}, &strStruct2) - if err != nil { - panic(err) - } - fmt.Println(strStruct.Str1 == strStruct2.Str1 && strStruct.Str2 == strStruct2.Str2 && strStruct.Int == strStruct2.Int) -} diff --git a/src/lib/Js-Amino/src/examples/string.js b/src/lib/Js-Amino/src/examples/string.js deleted file mode 100644 index 3182175..0000000 --- a/src/lib/Js-Amino/src/examples/string.js +++ /dev/null @@ -1,46 +0,0 @@ -let { - Codec, - TypeFactory, - Utils, - Types, - WireTypes -} = require('../index') - -let StrStruct = TypeFactory.create('StrStruct', [{ - name: 'str1', - type: Types.String, -}, { - name: 'str2', - type: Types.String, -}, { - name: 'int', - type: Types.Int8, -}]) - -let codec = new Codec() -codec.registerConcrete(new StrStruct(), 'test/StrStruct') - -let strStruct = new StrStruct('ascii', '안녕', 10) - -let binary = codec.marshalBinary(strStruct) -console.log(binary.toString()) - -let strStruct2 = new StrStruct() -codec.unMarshalBinary(binary, strStruct2) -console.log(strStruct2) -console.log(strStruct.str1 === strStruct2.str1 && strStruct.str2 === strStruct2.str2 && strStruct.int === strStruct2.int) - -/* -21,56,46,110,101,10,5,97,115,99,105,105,18,6,236,149,136,235,133,149,24,20 -AminoType { - idx: 2, - str1: 'ascii', - str2: '안녕', - int: 10, - [Symbol(privateTypeMap)]: - Map { - 'str1' => Symbol(String), - 'str2' => Symbol(String), - 'int' => Symbol(Int8) } } -true -*/ diff --git a/src/lib/Js-Amino/src/examples/time.go b/src/lib/Js-Amino/src/examples/time.go deleted file mode 100644 index 8957e8d..0000000 --- a/src/lib/Js-Amino/src/examples/time.go +++ /dev/null @@ -1,45 +0,0 @@ -package main - -import ( - "fmt" - "time" - - amino "github.com/tendermint/go-amino" -) - -type TimeStruct struct { - Time time.Time - Str2 string `json:"str2"` - Int int64 `json:"int"` -} - -func main() { - var cdc = amino.NewCodec() - - cdc.RegisterConcrete(TimeStruct{}, "test/TimeStruct", nil) - // t1, _ := time.Parse("01 Dec 2018 00:12:00 GMT", "1970-01-01 00:00:00 +0000 GMT") - //t1, _ := time.Parse("2006-01-02 15:04:05 +0000 UTC", "1970-01-01 00:00:01.978131102 +0000 UTC") - /*t1 := time.Date(2018, time.December, 1, 0, 0, 0, 0, time.UTC) - fmt.Printf("t=%v", t1) - timeStruct1 := TimeStruct{ - Time: t1, - //Str2: "안녕", - //Int: 10, - } - println("second=", t1.Unix()) - //println("Msecond=", int32(t1.UnixNano())) - - bz, err := cdc.MarshalBinaryLengthPrefixed(timeStruct1) - if err != nil { - panic(err) - } - fmt.Println(bz) - */ - timeStruct2 := TimeStruct{} - err := cdc.UnmarshalBinaryLengthPrefixed([]byte{28, 23, 189, 208, 16, 10, 6, 8, 181, 142, 230, 157, 4, 18, 11, 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 24, 244, 3}, &timeStruct2) - if err != nil { - panic(err) - } - fmt.Println(timeStruct2) - //right value: 12 23 189 208 16 10 6 8 128 158 135 224 5 -} diff --git a/src/lib/Js-Amino/src/examples/time.js b/src/lib/Js-Amino/src/examples/time.js deleted file mode 100644 index e9a9fd6..0000000 --- a/src/lib/Js-Amino/src/examples/time.js +++ /dev/null @@ -1,27 +0,0 @@ -let { - Codec, - TypeFactory, - Utils, - Types, - WireTypes - } = require('../index') - - let TimeStruct = TypeFactory.create('TimeStruct', [{ - name: 'time', - type: Types.Time, - }, { - name: 'str2', - type: Types.String, - }, { - name: 'int', - type: Types.Int64, - }]) - - let codec = new Codec() - codec.registerConcrete(new TimeStruct(), 'test/TimeStruct') - - let timeStruct = new TimeStruct(new Date('2006-01-02 20:04:05 +0000 UTC'), "Hello World",500) //01 Dec 2018 00:00:00 UTC - - let binary = codec.marshalBinary(timeStruct) - console.log(binary.toString()) - diff --git a/src/lib/Js-Amino/src/index.js b/src/lib/Js-Amino/src/index.js deleted file mode 100644 index 01db07d..0000000 --- a/src/lib/Js-Amino/src/index.js +++ /dev/null @@ -1,18 +0,0 @@ -let {Codec, FieldOtions} = require("./codec") -const TypeFactory = require("./typeFactory") - -let {Types,WireType} = require('./types') -const Utils = require("./utils") - - - -//let codec = new Codec(); - -module.exports = { - Codec, - FieldOtions, - TypeFactory, - Utils, - Types, - WireType -} \ No newline at end of file diff --git a/src/lib/Js-Amino/src/jsonDecoder.js b/src/lib/Js-Amino/src/jsonDecoder.js deleted file mode 100644 index d4ce355..0000000 --- a/src/lib/Js-Amino/src/jsonDecoder.js +++ /dev/null @@ -1,101 +0,0 @@ -const Reflection = require("./reflect") -let { - Types, -} = require('./types') -let { Buffer } = require('safe-buffer') - -const decodeJson = (value, instance) => { - Reflection.ownKeys(instance).forEach((key, idx) => { - let type = instance.lookup(key) //only valid with BaseTypeAmino.todo: checking - let data = decodeJsonField(value[key], idx, type, instance[key]) - instance[key] = data - }) -} - -const decodeJsonField = (value, idx, type,instance) => { - switch (type) { - // fall-through - case Types.Int8: - case Types.Int16: - case Types.Int32: - return parseInt(value) - case Types.Int64: - return parseInt(value) - case Types.String: - return value - case Types.Struct: - { - return decodeJsonStruct(value, instance) - } - case Types.ByteSlice: - { - return decodeJsonSlice(value) - } - case Types.ArrayInterface: - { - return decodeJsonArray(value, instance, Types.ArrayInterface) - } - case Types.ArrayStruct: - { - return decodeJsonArray(value, instance, Types.ArrayStruct) - } - case Types.Interface: - { - return decodeJsonInterface(value, instance) - } - default: - { - throw new Error("There is no data type to decode:", type) - } - } -} - -const decodeJsonStruct = (value, instance) => { - Reflection.ownKeys(instance).forEach((key, idx) => { - let type = instance.lookup(key) //only valid with BaseTypeAmino.todo: checking - let data = decodeJsonField(value, idx, type, instance[key]) - instance[key] = data - }) - return instance -} - -const decodeJsonSlice = (value) => { - return Array.from(Buffer.from(value, 'base64')) -} - -const decodeJsonInterface = (value, instance) => { - let typeName = Reflection.typeOf(instance); - if (!this.lookup(typeName)) { - throw new Error(`No ${typeName} was registered`) - } - let typeInfo = this.lookup(Reflection.typeOf(instance)) - if (typeInfo && typeInfo.name) { - if (value.type !== typeInfo.name) { - throw new Error(`Type not match. expected: ${typeInfo.name}, but: ${value.type}`) - } - } - - return decodeJson(value.value, instance.type) //dirty-hack -} - -const decodeJsonArray = (value, instance, arrayType) => { - let result = [] - let withPrefix = arrayType === Types.ArrayInterface ? true : false - - for (let i = 0; i < value.length; i++) { - let type = Types.Struct - if (withPrefix) { - type = Types.Interface - } - let data = decodeJson(value[i], type) - if (data) { - result = result.concat(data) - } - } - - return result; -} - -module.exports = { - decodeJson -} diff --git a/src/lib/Js-Amino/src/jsonEncoder.js b/src/lib/Js-Amino/src/jsonEncoder.js deleted file mode 100644 index 1277efa..0000000 --- a/src/lib/Js-Amino/src/jsonEncoder.js +++ /dev/null @@ -1,133 +0,0 @@ -const Reflection = require("./reflect") -let { - Types, -} = require('./types') -let { Buffer } = require('safe-buffer') - -const encodeJson = (instance, type) => { - - let tmpInstance = instance; - - //retrieve the single property of the Registered AminoType - if (type != Types.Struct && type != Types.Interface && type != Types.Array) { //only get the first property with type != Struct - let keys = Reflection.ownKeys(instance); - if (keys.length > 0) { //type of AminoType class with single property - keys.forEach(key => { - let aminoType = instance.lookup(key) - if (type != aminoType) throw new TypeError("Amino type does not match") - tmpInstance = instance[key] - return; - }) - } - } - - switch (type) { - // fall-through - case Types.Int8: - case Types.Int16: - case Types.Int32: - { - return tmpInstance - } - case Types.Int64: - { - // https://github.com/tendermint/go-amino/blob/v0.14.1/json-encode.go#L99 - // TODO: In go-amino, (u)int64 is encoded by string, because some languages like JS can't handle (u)int64 - // So, It seemed that it is necessary to decode (u)int64 to library like bignumber.js? - return tmpInstance.toString() - } - case Types.String: - { - return tmpInstance - } - - case Types.Struct: - { - return encodeJsonStruct(tmpInstance) - } - case Types.ByteSlice: - { - return encodeJsonSlice(tmpInstance) - } - - case Types.ArrayStruct: - { - return encodeJsonArray(tmpInstance, Types.ArrayStruct) - } - case Types.ArrayInterface: - { - return encodeJsonArray(tmpInstance, Types.ArrayInterface) - } - case Types.Interface: - { - return encodeJsonInterface(tmpInstance) - } - default: - { - console.log("There is no data type to encode:", type) - break; - } - } -} - -const encodeJsonInterface = (instance) => { - let value = encodeJson(instance, instance.type) //dirty-hack - let type = instance.info.name - return {type:type, value: value} - -} - - -const encodeJsonStruct = (instance) => { - let result = {} - Reflection.ownKeys(instance).forEach((key) => { - let type = instance.lookup(key) //only valid with BaseTypeAmino.todo: checking - let value = encodeJsonField(instance[key], type) - result[key] = value - }) - - return result; - -} - - - -const encodeJsonField = (typeInstance, type) => { - let value = null - if (type == Types.Array) { - value = encodeJsonArray(typeInstance) - } else { - value = encodeJson(typeInstance, type) - } - - return value -} - -const encodeJsonArray = (instance, arrayType) => { - let result = [] - let withPrefix = arrayType === Types.ArrayInterface ? true : false - - for (let i = 0; i < instance.length; ++i) { - let item = instance[i] - - let type = item.type - if (withPrefix) { - type = Types.Interface - } - let data = encodeJson(item, type) - if (data) { - result = result.concat(data) - } - } - - return result; -} - -const encodeJsonSlice = (tmpInstance) => { - // In go-amino, bytes are encoded by base64 when json-encoding - return Buffer.from(tmpInstance).toString('base64') -} - -module.exports = { - encodeJson -} diff --git a/src/lib/Js-Amino/src/reflect.js b/src/lib/Js-Amino/src/reflect.js deleted file mode 100644 index 8057c30..0000000 --- a/src/lib/Js-Amino/src/reflect.js +++ /dev/null @@ -1,70 +0,0 @@ -let { - Types, - WireType, -} = require('./types') -let Factory = require('./typeFactory') - -const typeOf = instance => { - if ((typeof instance) === "undefined") { - throw new Error("Undefined Type"); - } - if( instance in Types ) return Types[instane] - - if (typeof instance == 'object') { - if( instance.constructor.name == 'AminoType' ) return instance.typeName() - return instance.constructor.name; - - } - - return typeof instance; -} - -const ownKeys = instance => { - if( !Factory.isExisted(typeOf(instance)) ) return []//throw new TypeError("instance must be amino type") //remember to check it again - return Reflect.ownKeys(instance).filter(key => { - let val = instance.lookup(key) - return val != null || val != undefined - }) -} - -const typeToTyp3 = (type, opts) => { - switch (type) { - case Types.Interface: - return WireType.ByteLength - case Types.ArrayInterface: - case Types.ArrayStruct: - return WireType.ByteLength - case Types.String: - return WireType.ByteLength - case Types.Struct: - // case Types.Map: - return WireType.ByteLength - case Types.Int64: - if (opts.binFixed64) { - return WireType.Type8Byte - } else { - return WireType.Varint - } - case Types.Int32: - if (opts.binFixed32) { - return WireType.Type4Byte - } else { - return WireType.Varint - } - case Types.Int8: - case Types.Int16: - return WireType.Varint - // case Types.Float64: - // return WireType.Type8Byte - // case Types.Float32: - // return WireType.Type4Byte - default: - throw new Error('"unsupported field type ' + type) - } -} - -module.exports = { - typeOf, - ownKeys, - typeToTyp3, -} \ No newline at end of file diff --git a/src/lib/Js-Amino/src/registeredType.js b/src/lib/Js-Amino/src/registeredType.js deleted file mode 100755 index 0bf762b..0000000 --- a/src/lib/Js-Amino/src/registeredType.js +++ /dev/null @@ -1,87 +0,0 @@ -let Utils = require('./utils') - - -const PrefixBytesLen = 4; -const DisambBytesLen = 3; -const DisfixBytesLen = PrefixBytesLen + DisambBytesLen; -const DelimiterValue = 0x00; - - -let privObject = Symbol("privateObj") - - class RegisteredType { - - constructor(name, rtype) { - this.name = name; - - this[privObject] = this.calculateDisambAndPrefix(); - this[privObject].reflectType = rtype - this[privObject].isRegistered = false; - } - - get prefix() { - return this[privObject].prefix - } - - get disfix() { - return this.disamb.concat(this.prefix) - } - - get disamb() { - return this[privObject].disamb - } - - get reflectType() { - return this[privObject].rtype; - } - - get registered() { - return this[privObject].isRegistered - } - - set registered(status) { - this[privObject].isRegistered = status; - } - - - /** - * save Disamb and prefix. - * refer the calculation: https://github.com/tendermint/go-amino - * @param {None} * - * @return {Object} : 2 properties :disAmb and prefix - */ - - calculateDisambAndPrefix() { - let nameHash = Utils.getHash256(this.name) - nameHash = this.dropLeadingZeroByte(nameHash) - let disamb = nameHash.slice(0, DisambBytesLen) - nameHash = this.dropLeadingZeroByte(nameHash.slice(3)) - let prefix = nameHash.slice(0,PrefixBytesLen) - - return {disamb, prefix}; - } - - /** - * remove the first item in hash until there is no DelimiterValue at 1st element . - * refer the calculation: https://github.com/tendermint/go-amino - * @param {array} * hash input - * @return {array} : array that contains no DelimiterValue at 1st position - */ - dropLeadingZeroByte(hash) { - while(hash[0] == DelimiterValue) { - hash = hash.slice(1) - } - return hash; - } -} - -module.exports = { - RegisteredType -} -if (require.main === module) { - let type = new RegisteredType("shareledger/AuthTx"); - console.log("disAmb=",type.disamb) - console.log("prefix=",type.prefix) - console.log("disfix=", type.disfix) - -} \ No newline at end of file diff --git a/src/lib/Js-Amino/src/typeFactory.js b/src/lib/Js-Amino/src/typeFactory.js deleted file mode 100644 index 93d6ceb..0000000 --- a/src/lib/Js-Amino/src/typeFactory.js +++ /dev/null @@ -1,168 +0,0 @@ -//let privTypeMap = undefined -let { - Types -} = require('./types') - -const Reflection = require("./reflect") - - -let privTypeMap = Symbol("privateTypeMap") - -let aminoTypes = new Array() - -const isExisted = name => { - return aminoTypes.includes(name) -} - - -class BaseAminoType { - - constructor() { - this[privTypeMap] = new Map(); - - } - - set(name, type) { - if( this[privTypeMap].has(name) ) throw new RangeError(`property '${name}' existed`) - this[privTypeMap].set(name, type) - } - - lookup(name) { - return this[privTypeMap].get(name) - } - -} - - -let create = (className, properties,type = Types.Struct) => { - - if (!properties) { - throw new Error("Type List can not be empty") - } - if (!properties.length) { - throw new Error("Need to provide TypeList") - } - - /*AminoType*/ - class AminoType extends BaseAminoType { - - constructor(...args) { - super() - let idx = 0; - properties.forEach(prop => { - Reflect.ownKeys(prop).forEach(key => { - - if (key == 'name') { - this.idx = idx; - this[prop[key]] = args[idx++] - } else if (key == 'type') { - this.set(prop['name'], prop['type']) - if (prop['type'] == Types.Struct) { //set up the default value for Type.Struct field - if (this[prop['name']]) { - let defaultAminotye = Object.assign({}, this[prop['name']]) - Object.setPrototypeOf(defaultAminotye, AminoType.prototype); - AminoType.defaultMap.set(prop['name'], defaultAminotye) - } - } - } - }) - }) - if (args.length == 0) { - this[privTypeMap].forEach((value, key, map) => { - if (value == Types.Struct) { - this[key] = AminoType.defaultMap.get(key) - } - }) - } - - } - - typeName() { - return className; - } - - get info() { - return AminoType.info - } - - set info(_info) { - AminoType.info = _info; - } - - /* get index() { - return this.idx - } - - set index(_idx) { - console.log('set index=',_idx) - this.idx = _idx - } */ - - get type() { - return AminoType.type - } - - JsObject() { - let obj = {} - Reflect.ownKeys(this).forEach((key) => { - if( typeof key != 'symbol' && this.lookup(key) != Types.Struct) { - if( this[key] ) { - obj[key] = this[key] - } - } - else if( this.lookup(key) == Types.Struct ) { - obj[key] = this[key].JsObject() - } - }) - return obj; - } - - - } - aminoTypes.push(className) - AminoType.defaultMap = new Map(); //static map for default value-dirty hack - AminoType.info = null //static registered type info - AminoType.type = type //describe the type(Struct,Array) for encode/decode - - return AminoType; - -} - -module.exports = { - create, - isExisted -} - - -if (require.main === module) { - let A = create('TestAmino', [{ - name: "a", - type: Types.Int32 - }, - { - name: "b", - type: Types.Int64 - } - ]) - - let B = create('B', [{ - name: "a", - type: Types.Int32 - }, - { - name: "b", - type: Types.Int16 - } - ]) - - - - let aObj = new A(100, 200); - let obj = new B(100, 200); - - - console.log(Reflection.typeOf(obj)) - - - -} \ No newline at end of file diff --git a/src/lib/Js-Amino/src/types.js b/src/lib/Js-Amino/src/types.js deleted file mode 100644 index 4452707..0000000 --- a/src/lib/Js-Amino/src/types.js +++ /dev/null @@ -1,63 +0,0 @@ -const Types = { - Int64: Symbol('Int64'), - Int32: Symbol('Int32'), - Int16: Symbol('Int16'), - Int8: Symbol('Int8'), - String: Symbol('String'), - Struct: Symbol('Struct'), - Time: Symbol('Time'), - ByteSlice: Symbol('ByteSlice'), - ArrayStruct: Symbol('ArrayStruct'), - ArrayInterface: Symbol('ArrayInterface'), - Interface: Symbol('Interface') -} - -//reference : https://developers.google.com/protocol-buffers/docs/encoding -let WireType = { - Varint: 0, //int32, int64, uint32, uint64, sint32, sint64, bool, enum - Type8Byte: 1, //fixed64, sfixed64, double - ByteLength: 2, //string, bytes, embedded messages, packed repeated fields - Type4Byte: 5 //fixed32, sfixed32, float -} - -const WireMap = { - [Types.Int64]: WireType.Varint, - [Types.Int32]: WireType.Type4Byte, - [Types.Int16]: WireType.Varint, - [Types.Int8]: WireType.Varint, - [Types.Time]: WireType.Varint, - [Types.String]: WireType.ByteLength, - [Types.Struct]: WireType.ByteLength, - [Types.ByteSlice]: WireType.ByteLength, - [Types.ArrayStruct]: WireType.ByteLength, - [Types.ArrayInterface]: WireType.ByteLength, - [Types.Interface]: WireType.ByteLength, -} - -WireType.keysOf = number => { - let resultKey = null - Reflect.ownKeys(WireType).forEach(key => { - if(WireType[key] == number ) { - resultKey = key - return; - } - }) - return resultKey -} - -WireMap.keysOf = wireType => { - let resultKey = null - Reflect.ownKeys(WireMap).forEach(key => { - if(WireMap[key] == wireType ) { - resultKey = key - return; - } - }) - return resultKey -} - -module.exports = { - Types, - WireType, - WireMap -} \ No newline at end of file diff --git a/src/lib/Js-Amino/src/utils.js b/src/lib/Js-Amino/src/utils.js deleted file mode 100644 index 151c1c6..0000000 --- a/src/lib/Js-Amino/src/utils.js +++ /dev/null @@ -1,100 +0,0 @@ -const getHash256 = input => { - let sha256 = require('js-sha256'); - let hash2 = sha256.update(input); - return hash2.array(); -} - -const isEqual = (value, other) => { - - // Get the value type - var type = Object.prototype.toString.call(value); - - // If the two objects are not the same type, return false - if (type !== Object.prototype.toString.call(other)) return false; - - // If items are not an object or array, return false - if (['[object Array]', '[object Object]'].indexOf(type) < 0) return false; - - // Compare the length of the length of the two items - var valueLen = type === '[object Array]' ? value.length : Object.keys(value).length; - var otherLen = type === '[object Array]' ? other.length : Object.keys(other).length; - if (valueLen !== otherLen) return false; - - // Compare two items - var compare = function (item1, item2) { - - // Get the object type - var itemType = Object.prototype.toString.call(item1); - - // If an object or array, compare recursively - if (['[object Array]', '[object Object]'].indexOf(itemType) >= 0) { - if (!isEqual(item1, item2)) return false; - } - - // Otherwise, do a simple comparison - else { - - // If the two items are not the same type, return false - if (itemType !== Object.prototype.toString.call(item2)) return false; - - // Else if it's a function, convert to a string and compare - // Otherwise, just compare - if (itemType === '[object Function]') { - if (item1.toString() !== item2.toString()) return false; - } else { - if (item1 !== item2) return false; - } - - } - }; - - // Compare properties - if (type === '[object Array]') { - for (var i = 0; i < valueLen; i++) { - if (compare(value[i], other[i]) === false) return false; - } - } else { - for (var key in value) { - if (value.hasOwnProperty(key)) { - if (compare(value[key], other[key]) === false) return false; - } - } - } - - // If nothing failed, return true - return true; - -}; -//extension for Number global type -Number.MaxInt8 = 1 << 7 - 1; -Number.MaxInt16 = 1 << 15 - 1; - -const MinSecond = -62135596800; // seconds of 01-01-0001 -const MaxSecond = 253402300800; // seconds of 10000-01-01 -const MaxNano = 999999999 //nanos have to be in interval: [0, 999999999] - -//extension for String -String.prototype.toBytes = str => { - let bytes = []; - for (let i = 0, n = str.length; i < n; i++) { - let char = str.charCodeAt(i); - bytes.push(char >>> 8, char & 0xFF); - } - return bytes; -} - -String.fromBytes = bytes => { - let chars = []; - for(var i = 0, n = bytes.length; i < n;) { - chars.push(((bytes[i++] & 0xff) << 8) | (bytes[i++] & 0xff)); - } - return String.fromCharCode.apply(null, chars); -} - -module.exports = { - getHash256, - isEqual, - MinSecond, - MaxSecond, - MaxNano -} \ No newline at end of file diff --git a/src/lib/Js-Amino/test/go.mod b/src/lib/Js-Amino/test/go.mod deleted file mode 100644 index c86e8bb..0000000 --- a/src/lib/Js-Amino/test/go.mod +++ /dev/null @@ -1,6 +0,0 @@ -module github.com/TanNgocDo/Js-Amino/test - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/tendermint/go-amino v0.14.1 -) diff --git a/src/lib/Js-Amino/test/go.sum b/src/lib/Js-Amino/test/go.sum deleted file mode 100644 index 4f27448..0000000 --- a/src/lib/Js-Amino/test/go.sum +++ /dev/null @@ -1,4 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/tendermint/go-amino v0.14.1 h1:o2WudxNfdLNBwMyl2dqOJxiro5rfrEaU0Ugs6offJMk= -github.com/tendermint/go-amino v0.14.1/go.mod h1:i/UKE5Uocn+argJJBb12qTZsCDBcAYMbR92AaJVmKso= diff --git a/src/lib/Js-Amino/test/main/main.go b/src/lib/Js-Amino/test/main/main.go deleted file mode 100644 index c556e37..0000000 --- a/src/lib/Js-Amino/test/main/main.go +++ /dev/null @@ -1,10 +0,0 @@ -package main - -import ( - "github.com/TanNgocDo/Js-Amino/test" -) - -func main() { - test.PrintPrimitive() - test.PrintStruct() -} diff --git a/src/lib/Js-Amino/test/primitive.go b/src/lib/Js-Amino/test/primitive.go deleted file mode 100644 index 1be01e7..0000000 --- a/src/lib/Js-Amino/test/primitive.go +++ /dev/null @@ -1,41 +0,0 @@ -package test - -import ( - "encoding/hex" - "fmt" - - "github.com/tendermint/go-amino" -) - -type FixedInt struct { - Int32 int32 `binary:"fixed32"` - Int64 int64 `binary:"fixed64"` -} - -func PrintPrimitive() { - cdc := amino.NewCodec() - - bz := cdc.MustMarshalBinaryLengthPrefixed(int8(123)) - fmt.Println("Encode int8(123)", hex.EncodeToString(bz)) - - bz = cdc.MustMarshalBinaryLengthPrefixed(int16(12345)) - fmt.Println("Encode int16(12345)", hex.EncodeToString(bz)) - - bz = cdc.MustMarshalBinaryLengthPrefixed(int32(1234567)) - fmt.Println("Encode int32(1234567)", hex.EncodeToString(bz)) - - bz = cdc.MustMarshalBinaryLengthPrefixed(int64(123456789)) - fmt.Println("Encode int64(123456789)", hex.EncodeToString(bz)) - - bz = cdc.MustMarshalBinaryLengthPrefixed("teststring유니코드") - fmt.Println("Encode string(teststring유니코드)", hex.EncodeToString(bz)) - - bz = cdc.MustMarshalBinaryLengthPrefixed(FixedInt{ - Int32: 1234567, - Int64: 123456789, - }) - fmt.Println(`FixedInt{ - Int32(fixed32): 1234567, - Int64(fixed64):123456789, -}`, hex.EncodeToString(bz)) -} diff --git a/src/lib/Js-Amino/test/primitive.js b/src/lib/Js-Amino/test/primitive.js deleted file mode 100644 index 579d5d1..0000000 --- a/src/lib/Js-Amino/test/primitive.js +++ /dev/null @@ -1,105 +0,0 @@ -const { - Codec, - TypeFactory, - Types, - FieldOtions, -} = require('../src/index') -const { toHex } = require('./util') -const assert = require('assert') - -describe('Test encode primitive type int', () => { - let codec = new Codec() - const Int8 = TypeFactory.create('Int8', [ - { - name: 'int8', - type: Types.Int8, - } - ], Types.Int8) - - const Int16 = TypeFactory.create('Int16', [ - { - name: 'int16', - type: Types.Int16, - } - ], Types.Int16) - - const Int32 = TypeFactory.create('Int32', [ - { - name: 'int32', - type: Types.Int32, - } - ], Types.Int32) - - const Int64 = TypeFactory.create('Int64', [ - { - name: 'int64', - type: Types.Int64, - } - ], Types.Int64) - - /* - Encode int8(123) 02f601 - Encode int16(12345) 03f2c001 - Encode int32(1234567) 0387ad4b - Encode int64(123456789) 04959aef3a - */ - it('result of int8 should match', () => { - let int8 = new Int8(123) - assert.equal(toHex(codec.marshalBinary(int8)), '02f601') - }) - - it('result of int16 should match', () => { - let int16 = new Int16(12345) - assert.equal(toHex(codec.marshalBinary(int16)), '03f2c001') - }) - - it('result of int32 should match', () => { - let int32 = new Int32(1234567) - assert.equal(toHex(codec.marshalBinary(int32)), '0387ad4b') - }) - - it('result of int64 should match', () => { - let int64 = new Int64(123456789) - assert.equal(toHex(codec.marshalBinary(int64)), '04959aef3a') - }) - - /* - FixedInt{ - Int32(fixed32): 1234567, - Int64(fixed64):123456789, - } 0e0d87d612001115cd5b0700000000 - */ - it('result of fixed int32 and int64 should match', () => { - const FixedInt = TypeFactory.create('FixedInt', [ - { - name: 'int32', - type: Types.Int32, - }, - { - name: 'int64', - type: Types.Int64, - } - ]) - let fixedInt = new FixedInt(1234567, 123456789) - assert.equal(toHex(codec.marshalBinary(fixedInt, new FieldOtions({binFixed64: true, binFixed32: true}))), '0e0d87d612001115cd5b0700000000') - }) -}) - - -describe('Test encode primitive type string', () => { - let codec = new Codec() - const Str = TypeFactory.create('Str', [ - { - name: 'str', - type: Types.String, - } - ], Types.String) - - /* - Encode string(teststring유니코드) 171674657374737472696e67ec9ca0eb8b88ecbd94eb939c - */ - it('result of string should match', () => { - let str = new Str('teststring유니코드') - assert.equal(toHex(codec.marshalBinary(str)), '171674657374737472696e67ec9ca0eb8b88ecbd94eb939c') - }) -}) diff --git a/src/lib/Js-Amino/test/readme.md b/src/lib/Js-Amino/test/readme.md deleted file mode 100644 index 2714c76..0000000 --- a/src/lib/Js-Amino/test/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -To make examples for test in go-amino, we use [go modules](https://github.com/golang/go/wiki/Modules), so you need golang above v1.11 - -To show examples in go-amino, type go run .\main\main.go diff --git a/src/lib/Js-Amino/test/struct.go b/src/lib/Js-Amino/test/struct.go deleted file mode 100644 index 21b61d0..0000000 --- a/src/lib/Js-Amino/test/struct.go +++ /dev/null @@ -1,72 +0,0 @@ -package test - -import ( - "encoding/hex" - "fmt" - - "github.com/tendermint/go-amino" -) - -type Struct interface { - A() -} - -type SimpleStruct struct { - Int8 int8 - Int16 int16 - Int32 int32 - Int64 int64 - Str string -} - -func (s SimpleStruct) A() {} - -type SimpleStruct2 struct { - Str string -} - -func (s SimpleStruct2) A() {} - -func PrintStruct() { - cdc := amino.NewCodec() - - simpleStruct := SimpleStruct{ - Int8: 123, - Int16: 12345, - Int32: 1234567, - Int64: 123456789, - Str: "teststring유니코드", - } - cdc.RegisterInterface((*Struct)(nil), nil) - cdc.RegisterConcrete(SimpleStruct{}, "SimpleStruct", nil) - cdc.RegisterConcrete(SimpleStruct2{}, "SimpleStruct2", nil) - - bz := cdc.MustMarshalBinaryLengthPrefixed(simpleStruct) - fmt.Println(`SimpleStruct{ - Int8: 123, - Int16: 12345, - Int32: 1234567, - Int64: 123456789, - Str: "teststring유니코드", -}`, hex.EncodeToString(bz)) - - simpleStruct2 := SimpleStruct2{ - Str: "test", - } - simpleStruct2.Str = "test" - arrayInterface := make([]Struct, 0) - arrayInterface = append(arrayInterface, simpleStruct, simpleStruct2) - bz = cdc.MustMarshalBinaryLengthPrefixed(arrayInterface) - fmt.Println(`[]Struct{ - SimpleStruct{ - Int8: 123, - Int16: 12345, - Int32: 1234567, - Int64: 123456789, - Str: "teststring유니코드", - }, - SimpleStruct2{ - Str: "test", - } -}`, hex.EncodeToString(bz)) -} diff --git a/src/lib/Js-Amino/test/struct.js b/src/lib/Js-Amino/test/struct.js deleted file mode 100644 index 3a75b1f..0000000 --- a/src/lib/Js-Amino/test/struct.js +++ /dev/null @@ -1,88 +0,0 @@ -const { - Codec, - TypeFactory, - Types, -} = require('../src/index') -const { toHex } = require('./util') -const assert = require('assert') - -let codec = new Codec() -const SimpleStruct = TypeFactory.create('SimpleStruct', [ - { - name: 'int8', - type: Types.Int8, - }, - { - name: 'int16', - type: Types.Int16, - }, - { - name: 'int32', - type: Types.Int32, - }, - { - name: 'int64', - type: Types.Int64, - }, - { - name: 'str', - type: Types.String, - }, -]) -const SimpleStruct2 = TypeFactory.create('SimpleStruct2', [ - { - name: 'str', - type: Types.String, - } -]) -codec.registerConcrete(new SimpleStruct(), 'SimpleStruct') -codec.registerConcrete(new SimpleStruct2(), 'SimpleStruct2') - -describe('Test encode simple struct', () => { - /* - cdc.RegisterConcrete(SimpleStruct{}, "SimpleStruct", nil) - SimpleStruct{ - Int8: 123, - Int16: 12345, - Int32: 1234567, - Int64: 123456789, - Str: "teststring유니코드", - } 2c4a89c4bc08f60110f2c0011887ad4b20959aef3a2a1674657374737472696e67ec9ca0eb8b88ecbd94eb939c - */ - it('result of simple struct should match', () => { - let simpleStruct = new SimpleStruct(123, 12345, 1234567, 123456789, 'teststring유니코드') - assert.equal(toHex(codec.marshalBinary(simpleStruct)), '2c4a89c4bc08f60110f2c0011887ad4b20959aef3a2a1674657374737472696e67ec9ca0eb8b88ecbd94eb939c') - }) -}) - -describe('Test encode array interface', () => { - const StructArray = TypeFactory.create('StructArray', [ - { - name: 'array', - type: Types.ArrayInterface, - } - ], Types.ArrayInterface) - - /* - []Struct{ - SimpleStruct{ - Int8: 123, - Int16: 12345, - Int32: 1234567, - Int64: 123456789, - Str: "teststring유니코드", - }, - SimpleStruct2{ - Str: "test", - } - } 3a0a2c4a89c4bc08f60110f2c0011887ad4b20959aef3a2a1674657374737472696e67ec9ca0eb8b88ecbd94eb939c0a0ad7618abe0a0474657374 - */ - it('result of array interface should match', () => { - let structArray = new StructArray([ - new SimpleStruct(123, 12345, 1234567, 123456789, 'teststring유니코드'), - new SimpleStruct2('test') - ]) - assert.equal(toHex(codec.marshalBinary(structArray)), '3a0a2c4a89c4bc08f60110f2c0011887ad4b20959aef3a2a1674657374737472696e67ec9ca0eb8b88ecbd94eb939c0a0ad7618abe0a0474657374') - }) -}) - diff --git a/src/lib/Js-Amino/test/util.js b/src/lib/Js-Amino/test/util.js deleted file mode 100644 index da7732b..0000000 --- a/src/lib/Js-Amino/test/util.js +++ /dev/null @@ -1,15 +0,0 @@ -const toHex = (buffer) => { - let s = '' - buffer.forEach((b) => { - b = b.toString(16) - if (b.length == 1) { - b = '0' + b - } - s += b - }) - return s -} - -module.exports = { - toHex -} diff --git a/src/model/tx.js b/src/model/tx.js index ecd82d1..23d1bfd 100644 --- a/src/model/tx.js +++ b/src/model/tx.js @@ -1,6 +1,6 @@ import nacl from 'tweetnacl' const bech32 = require('bech32') -let { Codec } = require('../lib/Js-Amino/src/index') +let { Codec } = require('js-amino') import trxType from './types' import { ClientType } from './enums' import { default as tool } from '../util/tool' diff --git a/src/model/types.js b/src/model/types.js index 5ff61a5..be69ad7 100644 --- a/src/model/types.js +++ b/src/model/types.js @@ -1,4 +1,4 @@ -let { TypeFactory, Types } = require('../lib/Js-Amino/src') +let { TypeFactory, Types } = require('js-amino') export default { AuthTx: TypeFactory.create('AuthTx', [ diff --git a/test/qosweb.spec.js b/test/qosweb.spec.js index 3881c5e..ebbae9a 100644 --- a/test/qosweb.spec.js +++ b/test/qosweb.spec.js @@ -4,7 +4,7 @@ import testConfig from './config' const expect = chai.expect describe('[create the qosweb]', ()=>{ - it('create with default config', ()=>{ + it('#1 create with default config', ()=>{ const qweb = new QWeb({ chainId: testConfig.chainId, baseUrl: testConfig.APINode }) expect(qweb).not.null expect(qweb.chainId).to.equal(testConfig.chainId) @@ -13,7 +13,7 @@ describe('[create the qosweb]', ()=>{ }) describe('[account]', ()=>{ - it('create the new account', ()=>{ + it('#1 create the new account', ()=>{ const qweb = new QWeb({ chainId: testConfig.chainId, baseUrl: testConfig.APINode }) const newAccount = qweb.newAccount() expect(newAccount).not.null @@ -28,7 +28,7 @@ describe('[account]', ()=>{ console.log(`Mnemonic Words:\t${newAccount.mnemonic}`) }) - it('get the account by private key', ()=>{ + it('#2 get the account by private key', ()=>{ const qweb = new QWeb({ chainId: testConfig.chainId, baseUrl: testConfig.APINode }) const newAccount = qweb.newAccount() From 781094d3c0d77c7f9e7033c9b3491ef3748db097 Mon Sep 17 00:00:00 2001 From: huming0618 Date: Tue, 14 May 2019 16:18:21 +0800 Subject: [PATCH 3/8] accountt url --- build/webpack.prod.conf.js | 10 +- dist/cmjs/util/factory.js | 328 ++++++++++++++++++------------------- dist/qweb.js | 19 +-- src/model/account.js | 2 +- test/config.js | 18 +- test/qosweb.spec.js | 31 +++- 6 files changed, 219 insertions(+), 189 deletions(-) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index 28e1be9..93ea6e2 100644 --- a/build/webpack.prod.conf.js +++ b/build/webpack.prod.conf.js @@ -9,10 +9,10 @@ const webpackConfig = merge(baseWebpackConfig, { minimizer: [ new UglifyJsPlugin({ uglifyOptions: { - compress: { - warnings: false, - }, - warning: 'verbose', + // compress: { + // warnings: false, + // }, + // warning: 'verbose', ecma: 6, beautify: false, comments: false, @@ -48,4 +48,4 @@ const webpackConfig = merge(baseWebpackConfig, { // ], }) -module.exports = webpackConfig \ No newline at end of file +module.exports = webpackConfig diff --git a/dist/cmjs/util/factory.js b/dist/cmjs/util/factory.js index 56ed29e..cc236e1 100644 --- a/dist/cmjs/util/factory.js +++ b/dist/cmjs/util/factory.js @@ -1,7 +1,7 @@ 'use strict'; Object.defineProperty(exports, "__esModule", { - value: true + value: true }); var _tweetnacl = require('tweetnacl'); @@ -30,171 +30,171 @@ var _require = require('../lib/Js-Amino/src/index'), Codec = _require.Codec; var getHash256 = function getHash256(input) { - var sha256 = require('js-sha256'); - var hash2 = sha256.update(input); - return hash2.array(); + var sha256 = require('js-sha256'); + var hash2 = sha256.update(input); + return hash2.array(); }; exports.default = { - /** - * 生成助记符 - */ - genarateSeed: function genarateSeed() { - // 商 256,生成24个助记单词 - var mnemonic = _bip2.default.generateMnemonic(256); - return mnemonic; - }, - - /** - * 生成公私钥对 - * @param {string} mnemonic 助记符 - * @returns {object} 公私钥对 - */ - genarateKeyPair: function genarateKeyPair(mnemonic) { - console.log('mnemonic', mnemonic); - var hexSeed = _bip2.default.mnemonicToSeedHex(mnemonic); - var secret = (0, _ed25519HdKey.derivePath)("m/44'/148'/0'", hexSeed).key; - var keyPair = _tweetnacl2.default.sign.keyPair.fromSeed(secret); - // let secretKeyUint8 = keyPair.secretKey - // let naclKeys = nacl.sign.keyPair.fromSeed(secretKeyUint8) - - // console.log('naclKeys', naclKeys) - - return keyPair; - }, - - /** - * 获取链上地址 - * @param {Uint8Array} publicKey 公钥 - */ - getAddress: function getAddress(publicKey) { - var bech32 = require('bech32'); - var publicKey_hash256 = getHash256(publicKey); - var addr_suffix = bech32.toWords(Buffer.from(publicKey_hash256.slice(0, 20))); - - var addr = bech32.encode('address', addr_suffix); - return addr; - }, - - /** - * 签名 - * @param {Uint8Array} msg - * @param {Uint8Array} secretKey - */ - sign: function sign(msg, secretKey) { - return _tweetnacl2.default.sign(msg, secretKey); - }, - genarateTxMsg: function genarateTxMsg() { - var codec = new Codec(); - var PubKeyEd25519 = _types2.default.PubKeyEd25519, - ITX = _types2.default.ITX, - AuthTx = _types2.default.AuthTx, - QSC = _types2.default.QSC, - Sender = _types2.default.Sender, - Receiver = _types2.default.Receiver, - Signature = _types2.default.Signature; - - codec.registerConcrete(new PubKeyEd25519(), 'tendermint/PubKeyEd25519', {}); - codec.registerConcrete(new ITX(), 'qos/txs/TransferTx', {}); - codec.registerConcrete(new AuthTx(), 'qbase/txs/stdtx', {}); - codec.registerConcrete(new Sender(), 'Sender', {}); - codec.registerConcrete(new Receiver(), 'Sender', {}); - codec.registerConcrete(new Signature(), 'Signature', {}); - - var seed = this.genarateSeed(); - console.log('seed', seed); - var keyPair = this.genarateKeyPair(seed); - console.log('keyPair', keyPair); - - console.log('publicKey hex', this.buf2hex(keyPair.publicKey)); - - var addr = this.getAddress(keyPair.publicKey); - console.log('addr', addr); - - var pubKeyEd25519 = new PubKeyEd25519(keyPair.publicKey); - - var qsc = new QSC('AOE', 5); - var sender = new Sender('address1k0m8ucnqug974maa6g36zw7g2wvfd4sug6uxay', 2, [qsc]); - - console.log('sender: ', sender); - - var receiver = new Receiver('address12as5uhdpf2y9zjkurx2l6dz8g98qkgryc4x355', 2, [qsc]); - - var itx = new ITX([sender], [receiver]); - - var privateKeyBuffers = _tool2.default.base64ToByteArray('k0m8ucnqug974maa6g36zw7g2wvfd4sug6uxay'); - console.log('privateKeyBuffers', privateKeyBuffers); - console.log('privateKeyBuffers', privateKeyBuffers[0].buffer); - var tmpBy = this.buf2hex1(privateKeyBuffers[0]); - console.log('tmpBy:', tmpBy); - - var signature = new Signature(pubKeyEd25519, 'JUTk/5Itlqv7VfjFwvARaEeJiAxfPhT4mCbbMVcF+MzYKkxXuz8f+PYTZeDIQ0W89/uTzBvQpn6Y1J8cyaCeBg==', 10); - - var authTx = new AuthTx(itx, [signature], 'qos-test', 0); - - // 最终生成的输出的JSON - var str = codec.marshalJson(authTx); - - console.log('str', str); - - //测试签名后数据是否正确 - var privateKey = 'rpt3O80wAFI1+ZqNYt8DqJ5PaQ+foDq7G/InFfycoFYT8tgGFJLp+BSVELW2fTQNGZ/yTzTIXbu9fg33gOmmzA=='; - var singdata = 'b3f67e6260e20beaefbdd223a13bc8539896d61c3257614e5da14a88514adc1995fd3447414e0b206432716f732d7465737400000000000000000000000000000007'; - - var by = Buffer.from(singdata, 'hex'); - console.log(by); - - var pk = (0, _tweetnaclUtil.decodeBase64)(privateKey); - console.log('pk', pk); - - var pubkey = (0, _tweetnaclUtil.decodeBase64)('E/LYBhSS6fgUlRC1tn00DRmf8k80yF27vX4N94Dppsw='); - console.log('pubkey', pubkey); - - console.log('Array.from(pk).slice(0,32)', Array.from(pk).slice(0, 32)); - var publicKey = (0, _ed25519HdKey.getPublicKey)(Array.from(pk).slice(0, 32)).slice(1); - console.log('publicKey', publicKey); - - /**快捷获取签名的from Hex或者 to Hex 值 --start*/ - var bech32 = require('bech32'); - var addr_decode = bech32.decode('address1k0m8ucnqug974maa6g36zw7g2wvfd4sug6uxay'); - console.log('addr_decode', addr_decode); - var fromwords = bech32.fromWords(addr_decode.words); - console.log('fromwords', fromwords); - var fromHex = this.buf2hex(fromwords); - console.log('fromHex', fromHex); - - /**快捷获取签名的from Hex或者 to Hex 值 --end*/ - - var publicKey_hash256 = getHash256(publicKey); - var publicKey_hash256_slice20 = Buffer.from(publicKey_hash256.slice(0, 20)); - - var publickeyHex = this.buf2hex1(publicKey_hash256_slice20); - console.log('pucpublickeyHex', publickeyHex); - - var sd = _tweetnacl2.default.sign.detached(by, pk); - console.log(sd.buffer); - console.log(this.buf2hex(sd.buffer)); - console.log((0, _tweetnaclUtil.encodeBase64)(sd)); - }, - - /** - * buffer to hex - * @param {*} buffer buffer 数组 - */ - buf2hex: function buf2hex(buffer) { - return Array.prototype.map.call(new Uint8Array(buffer), function (x) { - return ('00' + x.toString(16)).slice(-2); - }).join(''); - }, - - /** - * buffer to hex - * @param {*} buffer buffer 数组 - */ - buf2hex1: function buf2hex1(uint8Array) { - return Array.prototype.map.call(uint8Array, function (x) { - return ('00' + x.toString(16)).slice(-2); - }).join(''); - } + /** + * 生成助记符 + */ + genarateSeed: function genarateSeed() { + // 商 256,生成24个助记单词 + var mnemonic = _bip2.default.generateMnemonic(256); + return mnemonic; + }, + + /** + * 生成公私钥对 + * @param {string} mnemonic 助记符 + * @returns {object} 公私钥对 + */ + genarateKeyPair: function genarateKeyPair(mnemonic) { + console.log('mnemonic', mnemonic); + var hexSeed = _bip2.default.mnemonicToSeedHex(mnemonic); + var secret = (0, _ed25519HdKey.derivePath)("m/44'/148'/0'", hexSeed).key; + var keyPair = _tweetnacl2.default.sign.keyPair.fromSeed(secret); + // let secretKeyUint8 = keyPair.secretKey + // let naclKeys = nacl.sign.keyPair.fromSeed(secretKeyUint8) + + // console.log('naclKeys', naclKeys) + + return keyPair; + }, + + /** + * 获取链上地址 + * @param {Uint8Array} publicKey 公钥 + */ + getAddress: function getAddress(publicKey) { + var bech32 = require('bech32'); + var publicKey_hash256 = getHash256(publicKey); + var addr_suffix = bech32.toWords(Buffer.from(publicKey_hash256.slice(0, 20))); + + var addr = bech32.encode('address', addr_suffix); + return addr; + }, + + /** + * 签名 + * @param {Uint8Array} msg + * @param {Uint8Array} secretKey + */ + sign: function sign(msg, secretKey) { + return _tweetnacl2.default.sign(msg, secretKey); + }, + genarateTxMsg: function genarateTxMsg() { + var codec = new Codec(); + var PubKeyEd25519 = _types2.default.PubKeyEd25519, + ITX = _types2.default.ITX, + AuthTx = _types2.default.AuthTx, + QSC = _types2.default.QSC, + Sender = _types2.default.Sender, + Receiver = _types2.default.Receiver, + Signature = _types2.default.Signature; + + codec.registerConcrete(new PubKeyEd25519(), 'tendermint/PubKeyEd25519', {}); + codec.registerConcrete(new ITX(), 'qos/txs/TransferTx', {}); + codec.registerConcrete(new AuthTx(), 'qbase/txs/stdtx', {}); + codec.registerConcrete(new Sender(), 'Sender', {}); + codec.registerConcrete(new Receiver(), 'Sender', {}); + codec.registerConcrete(new Signature(), 'Signature', {}); + + var seed = this.genarateSeed(); + console.log('seed', seed); + var keyPair = this.genarateKeyPair(seed); + console.log('keyPair', keyPair); + + console.log('publicKey hex', this.buf2hex(keyPair.publicKey)); + + var addr = this.getAddress(keyPair.publicKey); + console.log('addr', addr); + + var pubKeyEd25519 = new PubKeyEd25519(keyPair.publicKey); + + var qsc = new QSC('AOE', 5); + var sender = new Sender('address1k0m8ucnqug974maa6g36zw7g2wvfd4sug6uxay', 2, [qsc]); + + console.log('sender: ', sender); + + var receiver = new Receiver('address12as5uhdpf2y9zjkurx2l6dz8g98qkgryc4x355', 2, [qsc]); + + var itx = new ITX([sender], [receiver]); + + var privateKeyBuffers = _tool2.default.base64ToByteArray('k0m8ucnqug974maa6g36zw7g2wvfd4sug6uxay'); + console.log('privateKeyBuffers', privateKeyBuffers); + console.log('privateKeyBuffers', privateKeyBuffers[0].buffer); + var tmpBy = this.buf2hex1(privateKeyBuffers[0]); + console.log('tmpBy:', tmpBy); + + var signature = new Signature(pubKeyEd25519, 'JUTk/5Itlqv7VfjFwvARaEeJiAxfPhT4mCbbMVcF+MzYKkxXuz8f+PYTZeDIQ0W89/uTzBvQpn6Y1J8cyaCeBg==', 10); + + var authTx = new AuthTx(itx, [signature], 'qos-test', 0); + + // 最终生成的输出的JSON + var str = codec.marshalJson(authTx); + + console.log('str', str); + + //测试签名后数据是否正确 + var privateKey = 'rpt3O80wAFI1+ZqNYt8DqJ5PaQ+foDq7G/InFfycoFYT8tgGFJLp+BSVELW2fTQNGZ/yTzTIXbu9fg33gOmmzA=='; + var singdata = 'b3f67e6260e20beaefbdd223a13bc8539896d61c3257614e5da14a88514adc1995fd3447414e0b206432716f732d7465737400000000000000000000000000000007'; + + var by = Buffer.from(singdata, 'hex'); + console.log(by); + + var pk = (0, _tweetnaclUtil.decodeBase64)(privateKey); + console.log('pk', pk); + + var pubkey = (0, _tweetnaclUtil.decodeBase64)('E/LYBhSS6fgUlRC1tn00DRmf8k80yF27vX4N94Dppsw='); + console.log('pubkey', pubkey); + + console.log('Array.from(pk).slice(0,32)', Array.from(pk).slice(0, 32)); + var publicKey = (0, _ed25519HdKey.getPublicKey)(Array.from(pk).slice(0, 32)).slice(1); + console.log('publicKey', publicKey); + + /**快捷获取签名的from Hex或者 to Hex 值 --start*/ + var bech32 = require('bech32'); + var addr_decode = bech32.decode('address1k0m8ucnqug974maa6g36zw7g2wvfd4sug6uxay'); + console.log('addr_decode', addr_decode); + var fromwords = bech32.fromWords(addr_decode.words); + console.log('fromwords', fromwords); + var fromHex = this.buf2hex(fromwords); + console.log('fromHex', fromHex); + + /**快捷获取签名的from Hex或者 to Hex 值 --end*/ + + var publicKey_hash256 = getHash256(publicKey); + var publicKey_hash256_slice20 = Buffer.from(publicKey_hash256.slice(0, 20)); + + var publickeyHex = this.buf2hex1(publicKey_hash256_slice20); + console.log('pucpublickeyHex', publickeyHex); + + var sd = _tweetnacl2.default.sign.detached(by, pk); + console.log(sd.buffer); + console.log(this.buf2hex(sd.buffer)); + console.log((0, _tweetnaclUtil.encodeBase64)(sd)); + }, + + /** + * buffer to hex + * @param {*} buffer buffer 数组 + */ + buf2hex: function buf2hex(buffer) { + return Array.prototype.map.call(new Uint8Array(buffer), function (x) { + return ('00' + x.toString(16)).slice(-2); + }).join(''); + }, + + /** + * buffer to hex + * @param {*} buffer buffer 数组 + */ + buf2hex1: function buf2hex1(uint8Array) { + return Array.prototype.map.call(uint8Array, function (x) { + return ('00' + x.toString(16)).slice(-2); + }).join(''); + } }; // function buf2hex(buffer) { // buffer is an ArrayBuffer diff --git a/dist/qweb.js b/dist/qweb.js index 7dbf363..6f7a9db 100644 --- a/dist/qweb.js +++ b/dist/qweb.js @@ -1,11 +1,11 @@ -!function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}__webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{enumerable:!0,get:getter})},__webpack_require__.r=function(exports){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.t=function(value,mode){if(1&mode&&(value=__webpack_require__(value)),8&mode)return value;if(4&mode&&"object"==typeof value&&value&&value.__esModule)return value;var ns=Object.create(null);if(__webpack_require__.r(ns),Object.defineProperty(ns,"default",{enumerable:!0,value:value}),2&mode&&"string"!=typeof value)for(var key in value)__webpack_require__.d(ns,key,function(key){return value[key]}.bind(null,key));return ns},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module.default}:function getModuleExports(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=52)}([function(module,exports,__webpack_require__){var buffer=__webpack_require__(6),Buffer=buffer.Buffer;function copyProps(src,dst){for(var key in src)dst[key]=src[key]}function SafeBuffer(arg,encodingOrOffset,length){return Buffer(arg,encodingOrOffset,length)}Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow?module.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer),copyProps(Buffer,SafeBuffer),SafeBuffer.from=function(arg,encodingOrOffset,length){if("number"==typeof arg)throw new TypeError("Argument must not be a number");return Buffer(arg,encodingOrOffset,length)},SafeBuffer.alloc=function(size,fill,encoding){if("number"!=typeof size)throw new TypeError("Argument must be a number");var buf=Buffer(size);return void 0!==fill?"string"==typeof encoding?buf.fill(fill,encoding):buf.fill(fill):buf.fill(0),buf},SafeBuffer.allocUnsafe=function(size){if("number"!=typeof size)throw new TypeError("Argument must be a number");return Buffer(size)},SafeBuffer.allocUnsafeSlow=function(size){if("number"!=typeof size)throw new TypeError("Argument must be a number");return buffer.SlowBuffer(size)}},function(module,exports){"function"==typeof Object.create?module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}},function(module,exports,__webpack_require__){"use strict";var bind=__webpack_require__(41),isBuffer=__webpack_require__(90),toString=Object.prototype.toString;function isArray(val){return"[object Array]"===toString.call(val)}function isObject(val){return null!==val&&"object"==typeof val}function isFunction(val){return"[object Function]"===toString.call(val)}function forEach(obj,fn){if(null!=obj)if("object"!=typeof obj&&(obj=[obj]),isArray(obj))for(var i=0,l=obj.length;i * @license MIT */ -var base64=__webpack_require__(55),ieee754=__webpack_require__(56),isArray=__webpack_require__(22);function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(that,length){if(kMaxLength()=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|length}function byteLength(string,encoding){if(Buffer.isBuffer(string))return string.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer))return string.byteLength;"string"!=typeof string&&(string=""+string);var len=string.length;if(0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case void 0:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*len;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase(),loweredCase=!0}}function swap(b,n,m){var i=b[n];b[n]=b[m],b[m]=i}function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;if("string"==typeof byteOffset?(encoding=byteOffset,byteOffset=0):2147483647=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(byteOffset<0){if(!dir)return-1;byteOffset=0}if("string"==typeof val&&(val=Buffer.from(val,encoding)),Buffer.isBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"==typeof val)return val&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?dir?Uint8Array.prototype.indexOf.call(buffer,val,byteOffset):Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset):arrayIndexOf(buffer,[val],byteOffset,encoding,dir);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){var i,indexSize=1,arrLength=arr.length,valLength=val.length;if(void 0!==encoding&&("ucs2"===(encoding=String(encoding).toLowerCase())||"ucs-2"===encoding||"utf16le"===encoding||"utf-16le"===encoding)){if(arr.length<2||val.length<2)return-1;arrLength/=indexSize=2,valLength/=2,byteOffset/=2}function read(buf,i){return 1===indexSize?buf[i]:buf.readUInt16BE(i*indexSize)}if(dir){var foundIndex=-1;for(i=byteOffset;i>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}(string,buf.length-offset),buf,offset,length)}function base64Slice(buf,start,end){return 0===start&&end===buf.length?base64.fromByteArray(buf):base64.fromByteArray(buf.slice(start,end))}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);for(var res=[],i=start;i>>10&1023|55296),codePoint=56320|1023&codePoint),res.push(codePoint),i+=bytesPerSequence}return function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,codePoints);var res="",i=0;for(;ithis.length)return"";if((void 0===end||end>this.length)&&(end=this.length),end<=0)return"";if((end>>>=0)<=(start>>>=0))return"";for(encoding||(encoding="utf8");;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0}}.apply(this,arguments)},Buffer.prototype.equals=function equals(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b||0===Buffer.compare(this,b)},Buffer.prototype.inspect=function inspect(){var str="",max=exports.INSPECT_MAX_BYTES;return 0max&&(str+=" ... ")),""},Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target))throw new TypeError("Argument must be a Buffer");if(void 0===start&&(start=0),void 0===end&&(end=target?target.length:0),void 0===thisStart&&(thisStart=0),void 0===thisEnd&&(thisEnd=this.length),start<0||end>target.length||thisStart<0||thisEnd>this.length)throw new RangeError("out of range index");if(thisEnd<=thisStart&&end<=start)return 0;if(thisEnd<=thisStart)return-1;if(end<=start)return 1;if(this===target)return 0;for(var x=(thisEnd>>>=0)-(thisStart>>>=0),y=(end>>>=0)-(start>>>=0),len=Math.min(x,y),thisCopy=this.slice(thisStart,thisEnd),targetCopy=target.slice(start,end),i=0;ithis.length)throw new RangeError("Attempt to write outside buffer bounds");encoding||(encoding="utf8");for(var loweredCase=!1;;)switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase(),loweredCase=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;ibuf.length)throw new RangeError("Index out of range")}function objectWriteUInt16(buf,value,offset,littleEndian){value<0&&(value=65535+value+1);for(var i=0,j=Math.min(buf.length-offset,2);i>>8*(littleEndian?i:1-i)}function objectWriteUInt32(buf,value,offset,littleEndian){value<0&&(value=4294967295+value+1);for(var i=0,j=Math.min(buf.length-offset,4);i>>8*(littleEndian?i:3-i)&255}function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,0,offset,4),ieee754.write(buf,value,offset,littleEndian,23,4),offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,0,offset,8),ieee754.write(buf,value,offset,littleEndian,52,8),offset+8}Buffer.prototype.slice=function slice(start,end){var newBuf,len=this.length;if((start=~~start)<0?(start+=len)<0&&(start=0):len>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=255&value):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0,mul=1,sub=0;for(this[offset]=255&value;++i>0)-sub&255;return offset+byteLength},Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1,mul=1,sub=0;for(this[offset+i]=255&value;0<=--i&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i+1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),value<0&&(value=255+value+1),this[offset]=255&value,offset+1},Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),value<0&&(value=4294967295+value+1),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function copy(target,targetStart,start,end){if(start||(start=0),end||0===end||(end=this.length),targetStart>=target.length&&(targetStart=target.length),targetStart||(targetStart=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-targetStart>>=0,end=void 0===end?this.length:end>>>0,val||(val=0),"number"==typeof val)for(i=start;i>6|192,63&codePoint|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,63&codePoint|128)}else{if(!(codePoint<1114112))throw new Error("Invalid code point");if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,63&codePoint|128)}}return bytes}function base64ToBytes(str){return base64.toByteArray(function base64clean(str){if((str=function stringtrim(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}(str).replace(INVALID_BASE64_RE,"")).length<2)return"";for(;str.length%4!=0;)str+="=";return str}(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}}).call(this,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";var pna=__webpack_require__(13),objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys};module.exports=Duplex;var util=__webpack_require__(11);util.inherits=__webpack_require__(1);var Readable=__webpack_require__(30),Writable=__webpack_require__(16);util.inherits(Duplex,Readable);for(var keys=objectKeys(Writable.prototype),v=0;v=this._finalSize&&(this._update(this._block),this._block.fill(0));var bits=8*this._len;if(bits<=4294967295)this._block.writeUInt32BE(bits,this._blockSize-4);else{var lowBits=(4294967295&bits)>>>0,highBits=(bits-lowBits)/4294967296;this._block.writeUInt32BE(highBits,this._blockSize-8),this._block.writeUInt32BE(lowBits,this._blockSize-4)}this._update(this._block);var hash=this._hash();return enc?hash.toString(enc):hash},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},module.exports=Hash},function(module,exports,__webpack_require__){"use strict";Number.MaxInt8=127,Number.MaxInt16=32767;module.exports={getHash256:function getHash256(input){return __webpack_require__(114).update(input).array()},fromHex:function fromHex(str){for(var buffer=[],i=0;im&&!existing.warned){existing.warned=!0;var w=new Error("Possible EventEmitter memory leak detected. "+existing.length+" "+String(type)+" listeners added. Use emitter.setMaxListeners() to increase limit");w.name="MaxListenersExceededWarning",w.emitter=target,w.type=type,w.count=existing.length,function ProcessEmitWarning(warning){console&&console.warn&&console.warn(warning)}(w)}return target}function _onceWrap(target,type,listener){var state={fired:!1,wrapFn:void 0,target:target,type:type,listener:listener},wrapped=function onceWrapper(){for(var args=[],i=0;i>5==6?2:byte>>4==14?3:byte>>3==30?4:byte>>6==2?-1:-2}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed,r=function utf8CheckExtraBytes(self,buf,p){if(128!=(192&buf[0]))return self.lastNeed=0,"�";if(1>24&255,x[i+1]=h>>16&255,x[i+2]=h>>8&255,x[i+3]=255&h,x[i+4]=l>>24&255,x[i+5]=l>>16&255,x[i+6]=l>>8&255,x[i+7]=255&l}function vn(x,xi,y,yi,n){var i,d=0;for(i=0;i>>8)-1}function crypto_verify_16(x,xi,y,yi){return vn(x,xi,y,yi,16)}function crypto_verify_32(x,xi,y,yi){return vn(x,xi,y,yi,32)}function crypto_core_salsa20(out,inp,k,c){!function core_salsa20(o,p,k,c){for(var u,j0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,j1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,j2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,j3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,j4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,j5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,j6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,j7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,j8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,j9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,j10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,j11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,j12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,j13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,j14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,j15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,x0=j0,x1=j1,x2=j2,x3=j3,x4=j4,x5=j5,x6=j6,x7=j7,x8=j8,x9=j9,x10=j10,x11=j11,x12=j12,x13=j13,x14=j14,x15=j15,i=0;i<20;i+=2)x0^=(u=(x12^=(u=(x8^=(u=(x4^=(u=x0+x12|0)<<7|u>>>25)+x0|0)<<9|u>>>23)+x4|0)<<13|u>>>19)+x8|0)<<18|u>>>14,x5^=(u=(x1^=(u=(x13^=(u=(x9^=(u=x5+x1|0)<<7|u>>>25)+x5|0)<<9|u>>>23)+x9|0)<<13|u>>>19)+x13|0)<<18|u>>>14,x10^=(u=(x6^=(u=(x2^=(u=(x14^=(u=x10+x6|0)<<7|u>>>25)+x10|0)<<9|u>>>23)+x14|0)<<13|u>>>19)+x2|0)<<18|u>>>14,x15^=(u=(x11^=(u=(x7^=(u=(x3^=(u=x15+x11|0)<<7|u>>>25)+x15|0)<<9|u>>>23)+x3|0)<<13|u>>>19)+x7|0)<<18|u>>>14,x0^=(u=(x3^=(u=(x2^=(u=(x1^=(u=x0+x3|0)<<7|u>>>25)+x0|0)<<9|u>>>23)+x1|0)<<13|u>>>19)+x2|0)<<18|u>>>14,x5^=(u=(x4^=(u=(x7^=(u=(x6^=(u=x5+x4|0)<<7|u>>>25)+x5|0)<<9|u>>>23)+x6|0)<<13|u>>>19)+x7|0)<<18|u>>>14,x10^=(u=(x9^=(u=(x8^=(u=(x11^=(u=x10+x9|0)<<7|u>>>25)+x10|0)<<9|u>>>23)+x11|0)<<13|u>>>19)+x8|0)<<18|u>>>14,x15^=(u=(x14^=(u=(x13^=(u=(x12^=(u=x15+x14|0)<<7|u>>>25)+x15|0)<<9|u>>>23)+x12|0)<<13|u>>>19)+x13|0)<<18|u>>>14;x0=x0+j0|0,x1=x1+j1|0,x2=x2+j2|0,x3=x3+j3|0,x4=x4+j4|0,x5=x5+j5|0,x6=x6+j6|0,x7=x7+j7|0,x8=x8+j8|0,x9=x9+j9|0,x10=x10+j10|0,x11=x11+j11|0,x12=x12+j12|0,x13=x13+j13|0,x14=x14+j14|0,x15=x15+j15|0,o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x1>>>0&255,o[5]=x1>>>8&255,o[6]=x1>>>16&255,o[7]=x1>>>24&255,o[8]=x2>>>0&255,o[9]=x2>>>8&255,o[10]=x2>>>16&255,o[11]=x2>>>24&255,o[12]=x3>>>0&255,o[13]=x3>>>8&255,o[14]=x3>>>16&255,o[15]=x3>>>24&255,o[16]=x4>>>0&255,o[17]=x4>>>8&255,o[18]=x4>>>16&255,o[19]=x4>>>24&255,o[20]=x5>>>0&255,o[21]=x5>>>8&255,o[22]=x5>>>16&255,o[23]=x5>>>24&255,o[24]=x6>>>0&255,o[25]=x6>>>8&255,o[26]=x6>>>16&255,o[27]=x6>>>24&255,o[28]=x7>>>0&255,o[29]=x7>>>8&255,o[30]=x7>>>16&255,o[31]=x7>>>24&255,o[32]=x8>>>0&255,o[33]=x8>>>8&255,o[34]=x8>>>16&255,o[35]=x8>>>24&255,o[36]=x9>>>0&255,o[37]=x9>>>8&255,o[38]=x9>>>16&255,o[39]=x9>>>24&255,o[40]=x10>>>0&255,o[41]=x10>>>8&255,o[42]=x10>>>16&255,o[43]=x10>>>24&255,o[44]=x11>>>0&255,o[45]=x11>>>8&255,o[46]=x11>>>16&255,o[47]=x11>>>24&255,o[48]=x12>>>0&255,o[49]=x12>>>8&255,o[50]=x12>>>16&255,o[51]=x12>>>24&255,o[52]=x13>>>0&255,o[53]=x13>>>8&255,o[54]=x13>>>16&255,o[55]=x13>>>24&255,o[56]=x14>>>0&255,o[57]=x14>>>8&255,o[58]=x14>>>16&255,o[59]=x14>>>24&255,o[60]=x15>>>0&255,o[61]=x15>>>8&255,o[62]=x15>>>16&255,o[63]=x15>>>24&255}(out,inp,k,c)}function crypto_core_hsalsa20(out,inp,k,c){!function core_hsalsa20(o,p,k,c){for(var u,x0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,x1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,x2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,x3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,x4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,x5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,x6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,x7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,x8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,x9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,x10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,x11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,x12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,x13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,x14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,x15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,i=0;i<20;i+=2)x0^=(u=(x12^=(u=(x8^=(u=(x4^=(u=x0+x12|0)<<7|u>>>25)+x0|0)<<9|u>>>23)+x4|0)<<13|u>>>19)+x8|0)<<18|u>>>14,x5^=(u=(x1^=(u=(x13^=(u=(x9^=(u=x5+x1|0)<<7|u>>>25)+x5|0)<<9|u>>>23)+x9|0)<<13|u>>>19)+x13|0)<<18|u>>>14,x10^=(u=(x6^=(u=(x2^=(u=(x14^=(u=x10+x6|0)<<7|u>>>25)+x10|0)<<9|u>>>23)+x14|0)<<13|u>>>19)+x2|0)<<18|u>>>14,x15^=(u=(x11^=(u=(x7^=(u=(x3^=(u=x15+x11|0)<<7|u>>>25)+x15|0)<<9|u>>>23)+x3|0)<<13|u>>>19)+x7|0)<<18|u>>>14,x0^=(u=(x3^=(u=(x2^=(u=(x1^=(u=x0+x3|0)<<7|u>>>25)+x0|0)<<9|u>>>23)+x1|0)<<13|u>>>19)+x2|0)<<18|u>>>14,x5^=(u=(x4^=(u=(x7^=(u=(x6^=(u=x5+x4|0)<<7|u>>>25)+x5|0)<<9|u>>>23)+x6|0)<<13|u>>>19)+x7|0)<<18|u>>>14,x10^=(u=(x9^=(u=(x8^=(u=(x11^=(u=x10+x9|0)<<7|u>>>25)+x10|0)<<9|u>>>23)+x11|0)<<13|u>>>19)+x8|0)<<18|u>>>14,x15^=(u=(x14^=(u=(x13^=(u=(x12^=(u=x15+x14|0)<<7|u>>>25)+x15|0)<<9|u>>>23)+x12|0)<<13|u>>>19)+x13|0)<<18|u>>>14;o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x5>>>0&255,o[5]=x5>>>8&255,o[6]=x5>>>16&255,o[7]=x5>>>24&255,o[8]=x10>>>0&255,o[9]=x10>>>8&255,o[10]=x10>>>16&255,o[11]=x10>>>24&255,o[12]=x15>>>0&255,o[13]=x15>>>8&255,o[14]=x15>>>16&255,o[15]=x15>>>24&255,o[16]=x6>>>0&255,o[17]=x6>>>8&255,o[18]=x6>>>16&255,o[19]=x6>>>24&255,o[20]=x7>>>0&255,o[21]=x7>>>8&255,o[22]=x7>>>16&255,o[23]=x7>>>24&255,o[24]=x8>>>0&255,o[25]=x8>>>8&255,o[26]=x8>>>16&255,o[27]=x8>>>24&255,o[28]=x9>>>0&255,o[29]=x9>>>8&255,o[30]=x9>>>16&255,o[31]=x9>>>24&255}(out,inp,k,c)}var sigma=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k){var u,i,z=new Uint8Array(16),x=new Uint8Array(64);for(i=0;i<16;i++)z[i]=0;for(i=0;i<8;i++)z[i]=n[i];for(;64<=b;){for(crypto_core_salsa20(x,z,k,sigma),i=0;i<64;i++)c[cpos+i]=m[mpos+i]^x[i];for(u=1,i=8;i<16;i++)u=u+(255&z[i])|0,z[i]=255&u,u>>>=8;b-=64,cpos+=64,mpos+=64}if(0>>=8;b-=64,cpos+=64}if(0>>13|t1<<3),t2=255&key[4]|(255&key[5])<<8,this.r[2]=7939&(t1>>>10|t2<<6),t3=255&key[6]|(255&key[7])<<8,this.r[3]=8191&(t2>>>7|t3<<9),t4=255&key[8]|(255&key[9])<<8,this.r[4]=255&(t3>>>4|t4<<12),this.r[5]=t4>>>1&8190,t5=255&key[10]|(255&key[11])<<8,this.r[6]=8191&(t4>>>14|t5<<2),t6=255&key[12]|(255&key[13])<<8,this.r[7]=8065&(t5>>>11|t6<<5),t7=255&key[14]|(255&key[15])<<8,this.r[8]=8191&(t6>>>8|t7<<8),this.r[9]=t7>>>5&127,this.pad[0]=255&key[16]|(255&key[17])<<8,this.pad[1]=255&key[18]|(255&key[19])<<8,this.pad[2]=255&key[20]|(255&key[21])<<8,this.pad[3]=255&key[22]|(255&key[23])<<8,this.pad[4]=255&key[24]|(255&key[25])<<8,this.pad[5]=255&key[26]|(255&key[27])<<8,this.pad[6]=255&key[28]|(255&key[29])<<8,this.pad[7]=255&key[30]|(255&key[31])<<8};function crypto_onetimeauth(out,outpos,m,mpos,n,k){var s=new poly1305(k);return s.update(m,mpos,n),s.finish(out,outpos),0}function crypto_onetimeauth_verify(h,hpos,m,mpos,n,k){var x=new Uint8Array(16);return crypto_onetimeauth(x,0,m,mpos,n,k),crypto_verify_16(h,hpos,x,0)}function crypto_secretbox(c,m,d,n,k){var i;if(d<32)return-1;for(crypto_stream_xor(c,0,m,0,d,n,k),crypto_onetimeauth(c,16,c,32,d-32,c),i=0;i<16;i++)c[i]=0;return 0}function crypto_secretbox_open(m,c,d,n,k){var i,x=new Uint8Array(32);if(d<32)return-1;if(crypto_stream(x,0,32,n,k),0!==crypto_onetimeauth_verify(c,16,c,32,d-32,x))return-1;for(crypto_stream_xor(m,0,c,0,d,n,k),i=0;i<32;i++)m[i]=0;return 0}function set25519(r,a){var i;for(i=0;i<16;i++)r[i]=0|a[i]}function car25519(o){var i,v,c=1;for(i=0;i<16;i++)v=o[i]+c+65535,c=Math.floor(v/65536),o[i]=v-65536*c;o[0]+=c-1+37*(c-1)}function sel25519(p,q,b){for(var t,c=~(b-1),i=0;i<16;i++)t=c&(p[i]^q[i]),p[i]^=t,q[i]^=t}function pack25519(o,n){var i,j,b,m=gf(),t=gf();for(i=0;i<16;i++)t[i]=n[i];for(car25519(t),car25519(t),car25519(t),j=0;j<2;j++){for(m[0]=t[0]-65517,i=1;i<15;i++)m[i]=t[i]-65535-(m[i-1]>>16&1),m[i-1]&=65535;m[15]=t[15]-32767-(m[14]>>16&1),b=m[15]>>16&1,m[14]&=65535,sel25519(t,m,1-b)}for(i=0;i<16;i++)o[2*i]=255&t[i],o[2*i+1]=t[i]>>8}function neq25519(a,b){var c=new Uint8Array(32),d=new Uint8Array(32);return pack25519(c,a),pack25519(d,b),crypto_verify_32(c,0,d,0)}function par25519(a){var d=new Uint8Array(32);return pack25519(d,a),1&d[0]}function unpack25519(o,n){var i;for(i=0;i<16;i++)o[i]=n[2*i]+(n[2*i+1]<<8);o[15]&=32767}function A(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]+b[i]}function Z(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]-b[i]}function M(o,a,b){var v,c,t0=0,t1=0,t2=0,t3=0,t4=0,t5=0,t6=0,t7=0,t8=0,t9=0,t10=0,t11=0,t12=0,t13=0,t14=0,t15=0,t16=0,t17=0,t18=0,t19=0,t20=0,t21=0,t22=0,t23=0,t24=0,t25=0,t26=0,t27=0,t28=0,t29=0,t30=0,b0=b[0],b1=b[1],b2=b[2],b3=b[3],b4=b[4],b5=b[5],b6=b[6],b7=b[7],b8=b[8],b9=b[9],b10=b[10],b11=b[11],b12=b[12],b13=b[13],b14=b[14],b15=b[15];t0+=(v=a[0])*b0,t1+=v*b1,t2+=v*b2,t3+=v*b3,t4+=v*b4,t5+=v*b5,t6+=v*b6,t7+=v*b7,t8+=v*b8,t9+=v*b9,t10+=v*b10,t11+=v*b11,t12+=v*b12,t13+=v*b13,t14+=v*b14,t15+=v*b15,t1+=(v=a[1])*b0,t2+=v*b1,t3+=v*b2,t4+=v*b3,t5+=v*b4,t6+=v*b5,t7+=v*b6,t8+=v*b7,t9+=v*b8,t10+=v*b9,t11+=v*b10,t12+=v*b11,t13+=v*b12,t14+=v*b13,t15+=v*b14,t16+=v*b15,t2+=(v=a[2])*b0,t3+=v*b1,t4+=v*b2,t5+=v*b3,t6+=v*b4,t7+=v*b5,t8+=v*b6,t9+=v*b7,t10+=v*b8,t11+=v*b9,t12+=v*b10,t13+=v*b11,t14+=v*b12,t15+=v*b13,t16+=v*b14,t17+=v*b15,t3+=(v=a[3])*b0,t4+=v*b1,t5+=v*b2,t6+=v*b3,t7+=v*b4,t8+=v*b5,t9+=v*b6,t10+=v*b7,t11+=v*b8,t12+=v*b9,t13+=v*b10,t14+=v*b11,t15+=v*b12,t16+=v*b13,t17+=v*b14,t18+=v*b15,t4+=(v=a[4])*b0,t5+=v*b1,t6+=v*b2,t7+=v*b3,t8+=v*b4,t9+=v*b5,t10+=v*b6,t11+=v*b7,t12+=v*b8,t13+=v*b9,t14+=v*b10,t15+=v*b11,t16+=v*b12,t17+=v*b13,t18+=v*b14,t19+=v*b15,t5+=(v=a[5])*b0,t6+=v*b1,t7+=v*b2,t8+=v*b3,t9+=v*b4,t10+=v*b5,t11+=v*b6,t12+=v*b7,t13+=v*b8,t14+=v*b9,t15+=v*b10,t16+=v*b11,t17+=v*b12,t18+=v*b13,t19+=v*b14,t20+=v*b15,t6+=(v=a[6])*b0,t7+=v*b1,t8+=v*b2,t9+=v*b3,t10+=v*b4,t11+=v*b5,t12+=v*b6,t13+=v*b7,t14+=v*b8,t15+=v*b9,t16+=v*b10,t17+=v*b11,t18+=v*b12,t19+=v*b13,t20+=v*b14,t21+=v*b15,t7+=(v=a[7])*b0,t8+=v*b1,t9+=v*b2,t10+=v*b3,t11+=v*b4,t12+=v*b5,t13+=v*b6,t14+=v*b7,t15+=v*b8,t16+=v*b9,t17+=v*b10,t18+=v*b11,t19+=v*b12,t20+=v*b13,t21+=v*b14,t22+=v*b15,t8+=(v=a[8])*b0,t9+=v*b1,t10+=v*b2,t11+=v*b3,t12+=v*b4,t13+=v*b5,t14+=v*b6,t15+=v*b7,t16+=v*b8,t17+=v*b9,t18+=v*b10,t19+=v*b11,t20+=v*b12,t21+=v*b13,t22+=v*b14,t23+=v*b15,t9+=(v=a[9])*b0,t10+=v*b1,t11+=v*b2,t12+=v*b3,t13+=v*b4,t14+=v*b5,t15+=v*b6,t16+=v*b7,t17+=v*b8,t18+=v*b9,t19+=v*b10,t20+=v*b11,t21+=v*b12,t22+=v*b13,t23+=v*b14,t24+=v*b15,t10+=(v=a[10])*b0,t11+=v*b1,t12+=v*b2,t13+=v*b3,t14+=v*b4,t15+=v*b5,t16+=v*b6,t17+=v*b7,t18+=v*b8,t19+=v*b9,t20+=v*b10,t21+=v*b11,t22+=v*b12,t23+=v*b13,t24+=v*b14,t25+=v*b15,t11+=(v=a[11])*b0,t12+=v*b1,t13+=v*b2,t14+=v*b3,t15+=v*b4,t16+=v*b5,t17+=v*b6,t18+=v*b7,t19+=v*b8,t20+=v*b9,t21+=v*b10,t22+=v*b11,t23+=v*b12,t24+=v*b13,t25+=v*b14,t26+=v*b15,t12+=(v=a[12])*b0,t13+=v*b1,t14+=v*b2,t15+=v*b3,t16+=v*b4,t17+=v*b5,t18+=v*b6,t19+=v*b7,t20+=v*b8,t21+=v*b9,t22+=v*b10,t23+=v*b11,t24+=v*b12,t25+=v*b13,t26+=v*b14,t27+=v*b15,t13+=(v=a[13])*b0,t14+=v*b1,t15+=v*b2,t16+=v*b3,t17+=v*b4,t18+=v*b5,t19+=v*b6,t20+=v*b7,t21+=v*b8,t22+=v*b9,t23+=v*b10,t24+=v*b11,t25+=v*b12,t26+=v*b13,t27+=v*b14,t28+=v*b15,t14+=(v=a[14])*b0,t15+=v*b1,t16+=v*b2,t17+=v*b3,t18+=v*b4,t19+=v*b5,t20+=v*b6,t21+=v*b7,t22+=v*b8,t23+=v*b9,t24+=v*b10,t25+=v*b11,t26+=v*b12,t27+=v*b13,t28+=v*b14,t29+=v*b15,t15+=(v=a[15])*b0,t1+=38*(t17+=v*b2),t2+=38*(t18+=v*b3),t3+=38*(t19+=v*b4),t4+=38*(t20+=v*b5),t5+=38*(t21+=v*b6),t6+=38*(t22+=v*b7),t7+=38*(t23+=v*b8),t8+=38*(t24+=v*b9),t9+=38*(t25+=v*b10),t10+=38*(t26+=v*b11),t11+=38*(t27+=v*b12),t12+=38*(t28+=v*b13),t13+=38*(t29+=v*b14),t14+=38*(t30+=v*b15),t0=(v=(t0+=38*(t16+=v*b1))+(c=1)+65535)-65536*(c=Math.floor(v/65536)),t1=(v=t1+c+65535)-65536*(c=Math.floor(v/65536)),t2=(v=t2+c+65535)-65536*(c=Math.floor(v/65536)),t3=(v=t3+c+65535)-65536*(c=Math.floor(v/65536)),t4=(v=t4+c+65535)-65536*(c=Math.floor(v/65536)),t5=(v=t5+c+65535)-65536*(c=Math.floor(v/65536)),t6=(v=t6+c+65535)-65536*(c=Math.floor(v/65536)),t7=(v=t7+c+65535)-65536*(c=Math.floor(v/65536)),t8=(v=t8+c+65535)-65536*(c=Math.floor(v/65536)),t9=(v=t9+c+65535)-65536*(c=Math.floor(v/65536)),t10=(v=t10+c+65535)-65536*(c=Math.floor(v/65536)),t11=(v=t11+c+65535)-65536*(c=Math.floor(v/65536)),t12=(v=t12+c+65535)-65536*(c=Math.floor(v/65536)),t13=(v=t13+c+65535)-65536*(c=Math.floor(v/65536)),t14=(v=t14+c+65535)-65536*(c=Math.floor(v/65536)),t15=(v=t15+c+65535)-65536*(c=Math.floor(v/65536)),t0=(v=(t0+=c-1+37*(c-1))+(c=1)+65535)-65536*(c=Math.floor(v/65536)),t1=(v=t1+c+65535)-65536*(c=Math.floor(v/65536)),t2=(v=t2+c+65535)-65536*(c=Math.floor(v/65536)),t3=(v=t3+c+65535)-65536*(c=Math.floor(v/65536)),t4=(v=t4+c+65535)-65536*(c=Math.floor(v/65536)),t5=(v=t5+c+65535)-65536*(c=Math.floor(v/65536)),t6=(v=t6+c+65535)-65536*(c=Math.floor(v/65536)),t7=(v=t7+c+65535)-65536*(c=Math.floor(v/65536)),t8=(v=t8+c+65535)-65536*(c=Math.floor(v/65536)),t9=(v=t9+c+65535)-65536*(c=Math.floor(v/65536)),t10=(v=t10+c+65535)-65536*(c=Math.floor(v/65536)),t11=(v=t11+c+65535)-65536*(c=Math.floor(v/65536)),t12=(v=t12+c+65535)-65536*(c=Math.floor(v/65536)),t13=(v=t13+c+65535)-65536*(c=Math.floor(v/65536)),t14=(v=t14+c+65535)-65536*(c=Math.floor(v/65536)),t15=(v=t15+c+65535)-65536*(c=Math.floor(v/65536)),t0+=c-1+37*(c-1),o[0]=t0,o[1]=t1,o[2]=t2,o[3]=t3,o[4]=t4,o[5]=t5,o[6]=t6,o[7]=t7,o[8]=t8,o[9]=t9,o[10]=t10,o[11]=t11,o[12]=t12,o[13]=t13,o[14]=t14,o[15]=t15}function S(o,a){M(o,a,a)}function inv25519(o,i){var a,c=gf();for(a=0;a<16;a++)c[a]=i[a];for(a=253;0<=a;a--)S(c,c),2!==a&&4!==a&&M(c,c,i);for(a=0;a<16;a++)o[a]=c[a]}function crypto_scalarmult(q,n,p){var r,i,z=new Uint8Array(32),x=new Float64Array(80),a=gf(),b=gf(),c=gf(),d=gf(),e=gf(),f=gf();for(i=0;i<31;i++)z[i]=n[i];for(z[31]=127&n[31]|64,z[0]&=248,unpack25519(x,p),i=0;i<16;i++)b[i]=x[i],d[i]=a[i]=c[i]=0;for(a[0]=d[0]=1,i=254;0<=i;--i)sel25519(a,b,r=z[i>>>3]>>>(7&i)&1),sel25519(c,d,r),A(e,a,c),Z(a,a,c),A(c,b,d),Z(b,b,d),S(d,e),S(f,a),M(a,c,a),M(c,b,e),A(e,a,c),Z(a,a,c),S(b,a),Z(c,d,f),M(a,c,_121665),A(a,a,d),M(c,c,a),M(a,d,f),M(d,b,x),S(b,e),sel25519(a,b,r),sel25519(c,d,r);for(i=0;i<16;i++)x[i+16]=a[i],x[i+32]=c[i],x[i+48]=b[i],x[i+64]=d[i];var x32=x.subarray(32),x16=x.subarray(16);return inv25519(x32,x32),M(x16,x16,x32),pack25519(q,x16),0}function crypto_scalarmult_base(q,n){return crypto_scalarmult(q,n,_9)}function crypto_box_keypair(y,x){return randombytes(x,32),crypto_scalarmult_base(y,x)}function crypto_box_beforenm(k,y,x){var s=new Uint8Array(32);return crypto_scalarmult(s,x,y),crypto_core_hsalsa20(k,_0,s,sigma)}poly1305.prototype.blocks=function(m,mpos,bytes){for(var t0,t1,t2,t3,t4,t5,t6,t7,c,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,hibit=this.fin?0:2048,h0=this.h[0],h1=this.h[1],h2=this.h[2],h3=this.h[3],h4=this.h[4],h5=this.h[5],h6=this.h[6],h7=this.h[7],h8=this.h[8],h9=this.h[9],r0=this.r[0],r1=this.r[1],r2=this.r[2],r3=this.r[3],r4=this.r[4],r5=this.r[5],r6=this.r[6],r7=this.r[7],r8=this.r[8],r9=this.r[9];16<=bytes;)d0=c=0,d0+=(h0+=8191&(t0=255&m[mpos+0]|(255&m[mpos+1])<<8))*r0,d0+=(h1+=8191&(t0>>>13|(t1=255&m[mpos+2]|(255&m[mpos+3])<<8)<<3))*(5*r9),d0+=(h2+=8191&(t1>>>10|(t2=255&m[mpos+4]|(255&m[mpos+5])<<8)<<6))*(5*r8),d0+=(h3+=8191&(t2>>>7|(t3=255&m[mpos+6]|(255&m[mpos+7])<<8)<<9))*(5*r7),c=(d0+=(h4+=8191&(t3>>>4|(t4=255&m[mpos+8]|(255&m[mpos+9])<<8)<<12))*(5*r6))>>>13,d0&=8191,d0+=(h5+=t4>>>1&8191)*(5*r5),d0+=(h6+=8191&(t4>>>14|(t5=255&m[mpos+10]|(255&m[mpos+11])<<8)<<2))*(5*r4),d0+=(h7+=8191&(t5>>>11|(t6=255&m[mpos+12]|(255&m[mpos+13])<<8)<<5))*(5*r3),d0+=(h8+=8191&(t6>>>8|(t7=255&m[mpos+14]|(255&m[mpos+15])<<8)<<8))*(5*r2),d1=c+=(d0+=(h9+=t7>>>5|hibit)*(5*r1))>>>13,d1+=h0*r1,d1+=h1*r0,d1+=h2*(5*r9),d1+=h3*(5*r8),c=(d1+=h4*(5*r7))>>>13,d1&=8191,d1+=h5*(5*r6),d1+=h6*(5*r5),d1+=h7*(5*r4),d1+=h8*(5*r3),c+=(d1+=h9*(5*r2))>>>13,d1&=8191,d2=c,d2+=h0*r2,d2+=h1*r1,d2+=h2*r0,d2+=h3*(5*r9),c=(d2+=h4*(5*r8))>>>13,d2&=8191,d2+=h5*(5*r7),d2+=h6*(5*r6),d2+=h7*(5*r5),d2+=h8*(5*r4),d3=c+=(d2+=h9*(5*r3))>>>13,d3+=h0*r3,d3+=h1*r2,d3+=h2*r1,d3+=h3*r0,c=(d3+=h4*(5*r9))>>>13,d3&=8191,d3+=h5*(5*r8),d3+=h6*(5*r7),d3+=h7*(5*r6),d3+=h8*(5*r5),d4=c+=(d3+=h9*(5*r4))>>>13,d4+=h0*r4,d4+=h1*r3,d4+=h2*r2,d4+=h3*r1,c=(d4+=h4*r0)>>>13,d4&=8191,d4+=h5*(5*r9),d4+=h6*(5*r8),d4+=h7*(5*r7),d4+=h8*(5*r6),d5=c+=(d4+=h9*(5*r5))>>>13,d5+=h0*r5,d5+=h1*r4,d5+=h2*r3,d5+=h3*r2,c=(d5+=h4*r1)>>>13,d5&=8191,d5+=h5*r0,d5+=h6*(5*r9),d5+=h7*(5*r8),d5+=h8*(5*r7),d6=c+=(d5+=h9*(5*r6))>>>13,d6+=h0*r6,d6+=h1*r5,d6+=h2*r4,d6+=h3*r3,c=(d6+=h4*r2)>>>13,d6&=8191,d6+=h5*r1,d6+=h6*r0,d6+=h7*(5*r9),d6+=h8*(5*r8),d7=c+=(d6+=h9*(5*r7))>>>13,d7+=h0*r7,d7+=h1*r6,d7+=h2*r5,d7+=h3*r4,c=(d7+=h4*r3)>>>13,d7&=8191,d7+=h5*r2,d7+=h6*r1,d7+=h7*r0,d7+=h8*(5*r9),d8=c+=(d7+=h9*(5*r8))>>>13,d8+=h0*r8,d8+=h1*r7,d8+=h2*r6,d8+=h3*r5,c=(d8+=h4*r4)>>>13,d8&=8191,d8+=h5*r3,d8+=h6*r2,d8+=h7*r1,d8+=h8*r0,d9=c+=(d8+=h9*(5*r9))>>>13,d9+=h0*r9,d9+=h1*r8,d9+=h2*r7,d9+=h3*r6,c=(d9+=h4*r5)>>>13,d9&=8191,d9+=h5*r4,d9+=h6*r3,d9+=h7*r2,d9+=h8*r1,h0=d0=8191&(c=(c=((c+=(d9+=h9*r0)>>>13)<<2)+c|0)+(d0&=8191)|0),h1=d1+=c>>>=13,h2=d2&=8191,h3=d3&=8191,h4=d4&=8191,h5=d5&=8191,h6=d6&=8191,h7=d7&=8191,h8=d8&=8191,h9=d9&=8191,mpos+=16,bytes-=16;this.h[0]=h0,this.h[1]=h1,this.h[2]=h2,this.h[3]=h3,this.h[4]=h4,this.h[5]=h5,this.h[6]=h6,this.h[7]=h7,this.h[8]=h8,this.h[9]=h9},poly1305.prototype.finish=function(mac,macpos){var c,mask,f,i,g=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(c=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=c,c=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*c,c=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=c,c=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=c,g[0]=this.h[0]+5,c=g[0]>>>13,g[0]&=8191,i=1;i<10;i++)g[i]=this.h[i]+c,c=g[i]>>>13,g[i]&=8191;for(g[9]-=8192,mask=(1^c)-1,i=0;i<10;i++)g[i]&=mask;for(mask=~mask,i=0;i<10;i++)this.h[i]=this.h[i]&mask|g[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),f=this.h[0]+this.pad[0],this.h[0]=65535&f,i=1;i<8;i++)f=(this.h[i]+this.pad[i]|0)+(f>>>16)|0,this.h[i]=65535&f;mac[macpos+0]=this.h[0]>>>0&255,mac[macpos+1]=this.h[0]>>>8&255,mac[macpos+2]=this.h[1]>>>0&255,mac[macpos+3]=this.h[1]>>>8&255,mac[macpos+4]=this.h[2]>>>0&255,mac[macpos+5]=this.h[2]>>>8&255,mac[macpos+6]=this.h[3]>>>0&255,mac[macpos+7]=this.h[3]>>>8&255,mac[macpos+8]=this.h[4]>>>0&255,mac[macpos+9]=this.h[4]>>>8&255,mac[macpos+10]=this.h[5]>>>0&255,mac[macpos+11]=this.h[5]>>>8&255,mac[macpos+12]=this.h[6]>>>0&255,mac[macpos+13]=this.h[6]>>>8&255,mac[macpos+14]=this.h[7]>>>0&255,mac[macpos+15]=this.h[7]>>>8&255},poly1305.prototype.update=function(m,mpos,bytes){var i,want;if(this.leftover){for(bytes<(want=16-this.leftover)&&(want=bytes),i=0;i>>16,c=65535&(h=ah7),d=h>>>16,a+=65535&(l=((bl4=al4)>>>14|(bh4=ah4)<<18)^(al4>>>18|ah4<<14)^(ah4>>>9|al4<<23)),b+=l>>>16,c+=65535&(h=(ah4>>>14|al4<<18)^(ah4>>>18|al4<<14)^(al4>>>9|ah4<<23)),d+=h>>>16,a+=65535&(l=al4&(bl5=al5)^~al4&(bl6=al6)),b+=l>>>16,c+=65535&(h=ah4&(bh5=ah5)^~ah4&(bh6=ah6)),d+=h>>>16,h=K[2*i],a+=65535&(l=K[2*i+1]),b+=l>>>16,c+=65535&h,d+=h>>>16,h=wh[i%16],b+=(l=wl[i%16])>>>16,c+=65535&h,d+=h>>>16,c+=(b+=(a+=65535&l)>>>16)>>>16,a=65535&(l=tl=65535&a|b<<16),b=l>>>16,c=65535&(h=th=65535&c|(d+=c>>>16)<<16),d=h>>>16,a+=65535&(l=(al0>>>28|ah0<<4)^(ah0>>>2|al0<<30)^(ah0>>>7|al0<<25)),b+=l>>>16,c+=65535&(h=(ah0>>>28|al0<<4)^(al0>>>2|ah0<<30)^(al0>>>7|ah0<<25)),d+=h>>>16,b+=(l=al0&al1^al0&al2^al1&al2)>>>16,c+=65535&(h=ah0&ah1^ah0&ah2^ah1&ah2),d+=h>>>16,bh7=65535&(c+=(b+=(a+=65535&l)>>>16)>>>16)|(d+=c>>>16)<<16,bl7=65535&a|b<<16,a=65535&(l=bl3),b=l>>>16,c=65535&(h=bh3),d=h>>>16,b+=(l=tl)>>>16,c+=65535&(h=th),d+=h>>>16,ah1=bh0,ah2=bh1,ah3=bh2,ah4=bh3=65535&(c+=(b+=(a+=65535&l)>>>16)>>>16)|(d+=c>>>16)<<16,ah5=bh4,ah6=bh5,ah7=bh6,ah0=bh7,al1=bl0,al2=bl1,al3=bl2,al4=bl3=65535&a|b<<16,al5=bl4,al6=bl5,al7=bl6,al0=bl7,i%16==15)for(j=0;j<16;j++)h=wh[j],a=65535&(l=wl[j]),b=l>>>16,c=65535&h,d=h>>>16,h=wh[(j+9)%16],a+=65535&(l=wl[(j+9)%16]),b+=l>>>16,c+=65535&h,d+=h>>>16,th=wh[(j+1)%16],a+=65535&(l=((tl=wl[(j+1)%16])>>>1|th<<31)^(tl>>>8|th<<24)^(tl>>>7|th<<25)),b+=l>>>16,c+=65535&(h=(th>>>1|tl<<31)^(th>>>8|tl<<24)^th>>>7),d+=h>>>16,th=wh[(j+14)%16],b+=(l=((tl=wl[(j+14)%16])>>>19|th<<13)^(th>>>29|tl<<3)^(tl>>>6|th<<26))>>>16,c+=65535&(h=(th>>>19|tl<<13)^(tl>>>29|th<<3)^th>>>6),d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,wh[j]=65535&c|d<<16,wl[j]=65535&a|b<<16;a=65535&(l=al0),b=l>>>16,c=65535&(h=ah0),d=h>>>16,h=hh[0],b+=(l=hl[0])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[0]=ah0=65535&c|d<<16,hl[0]=al0=65535&a|b<<16,a=65535&(l=al1),b=l>>>16,c=65535&(h=ah1),d=h>>>16,h=hh[1],b+=(l=hl[1])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[1]=ah1=65535&c|d<<16,hl[1]=al1=65535&a|b<<16,a=65535&(l=al2),b=l>>>16,c=65535&(h=ah2),d=h>>>16,h=hh[2],b+=(l=hl[2])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[2]=ah2=65535&c|d<<16,hl[2]=al2=65535&a|b<<16,a=65535&(l=al3),b=l>>>16,c=65535&(h=ah3),d=h>>>16,h=hh[3],b+=(l=hl[3])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[3]=ah3=65535&c|d<<16,hl[3]=al3=65535&a|b<<16,a=65535&(l=al4),b=l>>>16,c=65535&(h=ah4),d=h>>>16,h=hh[4],b+=(l=hl[4])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[4]=ah4=65535&c|d<<16,hl[4]=al4=65535&a|b<<16,a=65535&(l=al5),b=l>>>16,c=65535&(h=ah5),d=h>>>16,h=hh[5],b+=(l=hl[5])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[5]=ah5=65535&c|d<<16,hl[5]=al5=65535&a|b<<16,a=65535&(l=al6),b=l>>>16,c=65535&(h=ah6),d=h>>>16,h=hh[6],b+=(l=hl[6])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[6]=ah6=65535&c|d<<16,hl[6]=al6=65535&a|b<<16,a=65535&(l=al7),b=l>>>16,c=65535&(h=ah7),d=h>>>16,h=hh[7],b+=(l=hl[7])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[7]=ah7=65535&c|d<<16,hl[7]=al7=65535&a|b<<16,pos+=128,n-=128}return n}function crypto_hash(out,m,n){var i,hh=new Int32Array(8),hl=new Int32Array(8),x=new Uint8Array(256),b=n;for(hh[0]=1779033703,hh[1]=3144134277,hh[2]=1013904242,hh[3]=2773480762,hh[4]=1359893119,hh[5]=2600822924,hh[6]=528734635,hh[7]=1541459225,hl[0]=4089235720,hl[1]=2227873595,hl[2]=4271175723,hl[3]=1595750129,hl[4]=2917565137,hl[5]=725511199,hl[6]=4215389547,hl[7]=327033209,crypto_hashblocks_hl(hh,hl,m,n),n%=128,i=0;i>(7&i)&1),add(q,p),add(p,p),cswap(p,q,b)}function scalarbase(p,s){var q=[gf(),gf(),gf(),gf()];set25519(q[0],X),set25519(q[1],Y),set25519(q[2],gf1),M(q[3],X,Y),scalarmult(p,q,s)}function crypto_sign_keypair(pk,sk,seeded){var i,d=new Uint8Array(64),p=[gf(),gf(),gf(),gf()];for(seeded||randombytes(sk,32),crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64,scalarbase(p,d),pack(pk,p),i=0;i<32;i++)sk[i+32]=pk[i];return 0}var L=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function modL(r,x){var carry,i,j,k;for(i=63;32<=i;--i){for(carry=0,j=i-32,k=i-12;j>8,x[j]-=256*carry;x[j]+=carry,x[i]=0}for(j=carry=0;j<32;j++)x[j]+=carry-(x[31]>>4)*L[j],carry=x[j]>>8,x[j]&=255;for(j=0;j<32;j++)x[j]-=carry*L[j];for(i=0;i<32;i++)x[i+1]+=x[i]>>8,r[i]=255&x[i]}function reduce(r){var i,x=new Float64Array(64);for(i=0;i<64;i++)x[i]=r[i];for(i=0;i<64;i++)r[i]=0;modL(r,x)}function crypto_sign(sm,m,n,sk){var i,j,d=new Uint8Array(64),h=new Uint8Array(64),r=new Uint8Array(64),x=new Float64Array(64),p=[gf(),gf(),gf(),gf()];crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64;var smlen=n+64;for(i=0;i>7&&Z(r[0],gf0,r[0]),M(r[3],r[0],r[1]),0)}function crypto_sign_open(m,sm,n,pk){var i,t=new Uint8Array(32),h=new Uint8Array(64),p=[gf(),gf(),gf(),gf()],q=[gf(),gf(),gf(),gf()];if(-1,n<64)return-1;if(unpackneg(q,pk))return-1;for(i=0;i>>32-n}function fnF(a,b,c,d,m,k,s){return rotl(a+(b&c|~b&d)+m+k|0,s)+b|0}function fnG(a,b,c,d,m,k,s){return rotl(a+(b&d|c&~d)+m+k|0,s)+b|0}function fnH(a,b,c,d,m,k,s){return rotl(a+(b^c^d)+m+k|0,s)+b|0}function fnI(a,b,c,d,m,k,s){return rotl(a+(c^(b|~d))+m+k|0,s)+b|0}inherits(MD5,HashBase),MD5.prototype._update=function(){for(var M=ARRAY16,i=0;i<16;++i)M[i]=this._block.readInt32LE(4*i);var a=this._a,b=this._b,c=this._c,d=this._d;b=fnI(b=fnI(b=fnI(b=fnI(b=fnH(b=fnH(b=fnH(b=fnH(b=fnG(b=fnG(b=fnG(b=fnG(b=fnF(b=fnF(b=fnF(b=fnF(b,c=fnF(c,d=fnF(d,a=fnF(a,b,c,d,M[0],3614090360,7),b,c,M[1],3905402710,12),a,b,M[2],606105819,17),d,a,M[3],3250441966,22),c=fnF(c,d=fnF(d,a=fnF(a,b,c,d,M[4],4118548399,7),b,c,M[5],1200080426,12),a,b,M[6],2821735955,17),d,a,M[7],4249261313,22),c=fnF(c,d=fnF(d,a=fnF(a,b,c,d,M[8],1770035416,7),b,c,M[9],2336552879,12),a,b,M[10],4294925233,17),d,a,M[11],2304563134,22),c=fnF(c,d=fnF(d,a=fnF(a,b,c,d,M[12],1804603682,7),b,c,M[13],4254626195,12),a,b,M[14],2792965006,17),d,a,M[15],1236535329,22),c=fnG(c,d=fnG(d,a=fnG(a,b,c,d,M[1],4129170786,5),b,c,M[6],3225465664,9),a,b,M[11],643717713,14),d,a,M[0],3921069994,20),c=fnG(c,d=fnG(d,a=fnG(a,b,c,d,M[5],3593408605,5),b,c,M[10],38016083,9),a,b,M[15],3634488961,14),d,a,M[4],3889429448,20),c=fnG(c,d=fnG(d,a=fnG(a,b,c,d,M[9],568446438,5),b,c,M[14],3275163606,9),a,b,M[3],4107603335,14),d,a,M[8],1163531501,20),c=fnG(c,d=fnG(d,a=fnG(a,b,c,d,M[13],2850285829,5),b,c,M[2],4243563512,9),a,b,M[7],1735328473,14),d,a,M[12],2368359562,20),c=fnH(c,d=fnH(d,a=fnH(a,b,c,d,M[5],4294588738,4),b,c,M[8],2272392833,11),a,b,M[11],1839030562,16),d,a,M[14],4259657740,23),c=fnH(c,d=fnH(d,a=fnH(a,b,c,d,M[1],2763975236,4),b,c,M[4],1272893353,11),a,b,M[7],4139469664,16),d,a,M[10],3200236656,23),c=fnH(c,d=fnH(d,a=fnH(a,b,c,d,M[13],681279174,4),b,c,M[0],3936430074,11),a,b,M[3],3572445317,16),d,a,M[6],76029189,23),c=fnH(c,d=fnH(d,a=fnH(a,b,c,d,M[9],3654602809,4),b,c,M[12],3873151461,11),a,b,M[15],530742520,16),d,a,M[2],3299628645,23),c=fnI(c,d=fnI(d,a=fnI(a,b,c,d,M[0],4096336452,6),b,c,M[7],1126891415,10),a,b,M[14],2878612391,15),d,a,M[5],4237533241,21),c=fnI(c,d=fnI(d,a=fnI(a,b,c,d,M[12],1700485571,6),b,c,M[3],2399980690,10),a,b,M[10],4293915773,15),d,a,M[1],2240044497,21),c=fnI(c,d=fnI(d,a=fnI(a,b,c,d,M[8],1873313359,6),b,c,M[15],4264355552,10),a,b,M[6],2734768916,15),d,a,M[13],1309151649,21),c=fnI(c,d=fnI(d,a=fnI(a,b,c,d,M[4],4149444226,6),b,c,M[11],3174756917,10),a,b,M[2],718787259,15),d,a,M[9],3951481745,21),this._a=this._a+a|0,this._b=this._b+b|0,this._c=this._c+c|0,this._d=this._d+d|0},MD5.prototype._digest=function(){this._block[this._blockOffset++]=128,56=this._blockSize;){for(var i=this._blockOffset;istate.highWaterMark&&(state.highWaterMark=function computeNewHighWaterMark(n){return MAX_HWM<=n?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?pna.nextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,pna.nextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=function fromListPartial(n,list,hasStrings){var ret;nstr.length?str.length:n;if(nb===str.length?ret+=str:ret+=str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p).data=str.slice(nb);break}++c}return list.length-=c,ret}(n,list):function copyFromBuffer(n,list){var ret=Buffer.allocUnsafe(n),p=list.head,c=1;p.data.copy(ret),n-=p.data.length;for(;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p).data=buf.slice(nb);break}++c}return list.length-=c,ret}(n,list);return ret}(n,state.buffer,state.decoder),ret);var ret}function endReadable(stream){var state=stream._readableState;if(0=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var ret,doRead=state.needReadable;return debug("need readable",doRead),(0===state.length||state.length-n>>32-n}function fn1(a,b,c,d,e,m,k,s){return rotl(a+(b^c^d)+m+k|0,s)+e|0}function fn2(a,b,c,d,e,m,k,s){return rotl(a+(b&c|~b&d)+m+k|0,s)+e|0}function fn3(a,b,c,d,e,m,k,s){return rotl(a+((b|~c)^d)+m+k|0,s)+e|0}function fn4(a,b,c,d,e,m,k,s){return rotl(a+(b&d|c&~d)+m+k|0,s)+e|0}function fn5(a,b,c,d,e,m,k,s){return rotl(a+(b^(c|~d))+m+k|0,s)+e|0}inherits(RIPEMD160,HashBase),RIPEMD160.prototype._update=function(){for(var words=ARRAY16,j=0;j<16;++j)words[j]=this._block.readInt32LE(4*j);for(var al=0|this._a,bl=0|this._b,cl=0|this._c,dl=0|this._d,el=0|this._e,ar=0|this._a,br=0|this._b,cr=0|this._c,dr=0|this._d,er=0|this._e,i=0;i<80;i+=1){var tl,tr;tr=i<16?(tl=fn1(al,bl,cl,dl,el,words[zl[i]],hl[0],sl[i]),fn5(ar,br,cr,dr,er,words[zr[i]],hr[0],sr[i])):i<32?(tl=fn2(al,bl,cl,dl,el,words[zl[i]],hl[1],sl[i]),fn4(ar,br,cr,dr,er,words[zr[i]],hr[1],sr[i])):i<48?(tl=fn3(al,bl,cl,dl,el,words[zl[i]],hl[2],sl[i]),fn3(ar,br,cr,dr,er,words[zr[i]],hr[2],sr[i])):i<64?(tl=fn4(al,bl,cl,dl,el,words[zl[i]],hl[3],sl[i]),fn2(ar,br,cr,dr,er,words[zr[i]],hr[3],sr[i])):(tl=fn5(al,bl,cl,dl,el,words[zl[i]],hl[4],sl[i]),fn1(ar,br,cr,dr,er,words[zr[i]],hr[4],sr[i])),al=el,el=dl,dl=rotl(cl,10),cl=bl,bl=tl,ar=er,er=dr,dr=rotl(cr,10),cr=br,br=tr}var t=this._b+cl+dr|0;this._b=this._c+dl+er|0,this._c=this._d+el+ar|0,this._d=this._e+al+br|0,this._e=this._a+bl+cr|0,this._a=t},RIPEMD160.prototype._digest=function(){this._block[this._blockOffset++]=128,56>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10)}function sigma1(x){return(x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7)}function gamma0(x){return(x>>>7|x<<25)^(x>>>18|x<<14)^x>>>3}inherits(Sha256,Hash),Sha256.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},Sha256.prototype._update=function(M){for(var x,W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,f=0|this._f,g=0|this._g,h=0|this._h,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<64;++i)W[i]=0|(((x=W[i-2])>>>17|x<<15)^(x>>>19|x<<13)^x>>>10)+W[i-7]+gamma0(W[i-15])+W[i-16];for(var j=0;j<64;++j){var T1=h+sigma1(e)+ch(e,f,g)+K[j]+W[j]|0,T2=sigma0(a)+maj(a,b,c)|0;h=g,g=f,f=e,e=d+T1|0,d=c,c=b,b=a,a=T1+T2|0}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0,this._f=f+this._f|0,this._g=g+this._g|0,this._h=h+this._h|0},Sha256.prototype._hash=function(){var H=Buffer.allocUnsafe(32);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H.writeInt32BE(this._h,28),H},module.exports=Sha256},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,K=[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],W=new Array(160);function Sha512(){this.init(),this._w=W,Hash.call(this,128,112)}function Ch(x,y,z){return z^x&(y^z)}function maj(x,y,z){return x&y|z&(x|y)}function sigma0(x,xl){return(x>>>28|xl<<4)^(xl>>>2|x<<30)^(xl>>>7|x<<25)}function sigma1(x,xl){return(x>>>14|xl<<18)^(x>>>18|xl<<14)^(xl>>>9|x<<23)}function Gamma0(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^x>>>7}function Gamma0l(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^(x>>>7|xl<<25)}function Gamma1(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^x>>>6}function Gamma1l(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^(x>>>6|xl<<26)}function getCarry(a,b){return a>>>0>>0?1:0}inherits(Sha512,Hash),Sha512.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},Sha512.prototype._update=function(M){for(var W=this._w,ah=0|this._ah,bh=0|this._bh,ch=0|this._ch,dh=0|this._dh,eh=0|this._eh,fh=0|this._fh,gh=0|this._gh,hh=0|this._hh,al=0|this._al,bl=0|this._bl,cl=0|this._cl,dl=0|this._dl,el=0|this._el,fl=0|this._fl,gl=0|this._gl,hl=0|this._hl,i=0;i<32;i+=2)W[i]=M.readInt32BE(4*i),W[i+1]=M.readInt32BE(4*i+4);for(;i<160;i+=2){var xh=W[i-30],xl=W[i-30+1],gamma0=Gamma0(xh,xl),gamma0l=Gamma0l(xl,xh),gamma1=Gamma1(xh=W[i-4],xl=W[i-4+1]),gamma1l=Gamma1l(xl,xh),Wi7h=W[i-14],Wi7l=W[i-14+1],Wi16h=W[i-32],Wi16l=W[i-32+1],Wil=gamma0l+Wi7l|0,Wih=gamma0+Wi7h+getCarry(Wil,gamma0l)|0;Wih=(Wih=Wih+gamma1+getCarry(Wil=Wil+gamma1l|0,gamma1l)|0)+Wi16h+getCarry(Wil=Wil+Wi16l|0,Wi16l)|0,W[i]=Wih,W[i+1]=Wil}for(var j=0;j<160;j+=2){Wih=W[j],Wil=W[j+1];var majh=maj(ah,bh,ch),majl=maj(al,bl,cl),sigma0h=sigma0(ah,al),sigma0l=sigma0(al,ah),sigma1h=sigma1(eh,el),sigma1l=sigma1(el,eh),Kih=K[j],Kil=K[j+1],chh=Ch(eh,fh,gh),chl=Ch(el,fl,gl),t1l=hl+sigma1l|0,t1h=hh+sigma1h+getCarry(t1l,hl)|0;t1h=(t1h=(t1h=t1h+chh+getCarry(t1l=t1l+chl|0,chl)|0)+Kih+getCarry(t1l=t1l+Kil|0,Kil)|0)+Wih+getCarry(t1l=t1l+Wil|0,Wil)|0;var t2l=sigma0l+majl|0,t2h=sigma0h+majh+getCarry(t2l,sigma0l)|0;hh=gh,hl=gl,gh=fh,gl=fl,fh=eh,fl=el,eh=dh+t1h+getCarry(el=dl+t1l|0,dl)|0,dh=ch,dl=cl,ch=bh,cl=bl,bh=ah,bl=al,ah=t1h+t2h+getCarry(al=t1l+t2l|0,t1l)|0}this._al=this._al+al|0,this._bl=this._bl+bl|0,this._cl=this._cl+cl|0,this._dl=this._dl+dl|0,this._el=this._el+el|0,this._fl=this._fl+fl|0,this._gl=this._gl+gl|0,this._hl=this._hl+hl|0,this._ah=this._ah+ah+getCarry(this._al,al)|0,this._bh=this._bh+bh+getCarry(this._bl,bl)|0,this._ch=this._ch+ch+getCarry(this._cl,cl)|0,this._dh=this._dh+dh+getCarry(this._dl,dl)|0,this._eh=this._eh+eh+getCarry(this._el,el)|0,this._fh=this._fh+fh+getCarry(this._fl,fl)|0,this._gh=this._gh+gh+getCarry(this._gl,gl)|0,this._hh=this._hh+hh+getCarry(this._hl,hl)|0},Sha512.prototype._hash=function(){var H=Buffer.allocUnsafe(64);function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),writeInt64BE(this._gh,this._gl,48),writeInt64BE(this._hh,this._hl,56),H},module.exports=Sha512},function(module,exports,__webpack_require__){(function(Buffer){var MAX_ALLOC=Math.pow(2,30)-1;function checkBuffer(buf,name){if("string"!=typeof buf&&!Buffer.isBuffer(buf))throw new TypeError(name+" must be a buffer or string")}module.exports=function(password,salt,iterations,keylen){if(checkBuffer(password,"Password"),checkBuffer(salt,"Salt"),"number"!=typeof iterations)throw new TypeError("Iterations not a number");if(iterations<0)throw new TypeError("Bad iterations");if("number"!=typeof keylen)throw new TypeError("Key length not a number");if(keylen<0||MAX_ALLOCblocksize?key=hash(key):key.length=Utils.MaxSecond)throw new RangeError("Second have to be >= "+Utils.MinSecond+", and <: "+Utils.MaxSecond);data=encodeFieldNumberAndType(1,WireMap[Types.Time]).concat(encodeUVarint(s))}return data},encodeFieldNumberAndType=function encodeFieldNumberAndType(num,type){var encodedVal=num<<3|type;return varint.encode(encodedVal)};if(module.exports={encodeSignedVarint:encodeSignedVarint,encodeFieldNumberAndType:encodeFieldNumberAndType,encodeString:function encodeString(input){return encodeSlice(Array.from(Buffer.from(input)))},encodeInt8:function encodeInt8(input){return encodeSignedVarint(input)},encodeInt16:function encodeInt16(input){return encodeSignedVarint(input)},encodeInt32:function encodeInt32(input){var buffer=new ArrayBuffer(4);return new DataView(buffer).setUint32(0,input,!0),Array.from(new Uint8Array(buffer))},encodeInt64:function encodeInt64(input){var buff=Buffer(8);return Int53.writeInt64LE(input,buff,0),Array.from(new Int32Array(buff))},encodeSlice:encodeSlice,encodeBoolean:function encodeBoolean(input){return encodeUint8(input?1:0)},encodeUVarint:encodeUVarint,encodeTime:encodeTime},__webpack_require__.c[__webpack_require__.s]==module){var result=encodeTime(new Date("01 Dec 2018 00:12:00 GMT"));console.log(result)}}).call(this,__webpack_require__(12)(module))},function(module,exports,__webpack_require__){"use strict";var varint=__webpack_require__(20);exports.encode=function encode(v,b,o){v=0<=v?2*v:-2*v-1;var r=varint.encode(v,b,o);return encode.bytes=varint.encode.bytes,r},exports.decode=function decode(b,o){var v=varint.decode(b,o);return decode.bytes=varint.decode.bytes,1&v?(v+1)/-2:v/2},exports.encodingLength=function(v){return varint.encodingLength(0<=v?2*v:-2*v-1)}},function(module,exports,__webpack_require__){"use strict";var int53={},MAX_UINT32=4294967295,MAX_INT53=9007199254740991;function onesComplement(number){return(number=~number)<0&&(number=2147483648+(2147483647&number)),number}function uintHighLow(number){console.assert(-1Number.MaxInt8)throw new TypeError("EOF decoding int8");return{data:Int8Array.from([result.data])[0],byteLength:result.byteLength}},decodeInt16:function decodeInt16(input){var result=decodeSignedVarint(input);if(result.data>Number.MaxInt16)throw new TypeError("EOF decoding int8");return{data:new Int16Array.from([result])[0],byteLength:result.byteLength}},decodeInt64:function decodeInt64(input){var buf=Buffer.from(input.slice(0,8));return{data:Int53.readInt64LE(buf,0),byteLength:8}},decodeString:function decodeString(input){var decodedSlice=decodeSlice(input);return{data:Buffer.from(decodedSlice.data).toString("utf8"),byteLength:decodedSlice.byteLength}},decodeFieldNumberAndType:function decodeFieldNumberAndType(bz){var decodedData=decodeUVarint(bz),wiretypeNumber=7&decodedData.data,idx=decodedData.data>>3;if(536870911>25;return(33554431&pre)<<5^996825010&-(b>>0&1)^642813549&-(b>>1&1)^513874426&-(b>>2&1)^1027748829&-(b>>3&1)^705979059&-(b>>4&1)}function prefixChk(prefix){for(var chk=1,i=0;i>5}for(chk=polymodStep(chk),i=0;i>bits&maxV);if(pad)0LIMIT)throw new TypeError("Exceeds length limit");var lowered=str.toLowerCase(),uppered=str.toUpperCase();if(str!==lowered&&str!==uppered)throw new Error("Mixed-case string "+str);var split=(str=lowered).lastIndexOf("1");if(-1===split)throw new Error("No separator character for "+str);if(0===split)throw new Error("Missing prefix for "+str);var prefix=str.slice(0,split),wordChars=str.slice(split+1);if(wordChars.length<6)throw new Error("Data too short");for(var chk=prefixChk(prefix),words=[],i=0;i=wordChars.length||words.push(v)}if(1!==chk)throw new Error("Invalid checksum for "+str);return{prefix:prefix,words:words}},encode:function encode(prefix,words,LIMIT){if(LIMIT=LIMIT||90,prefix.length+7+words.length>LIMIT)throw new TypeError("Exceeds length limit");for(var chk=prefixChk(prefix=prefix.toLowerCase()),result=prefix+"1",i=0;i>5!=0)throw new Error("Non 5-bit word");chk=polymodStep(chk)^x,result+=ALPHABET.charAt(x)}for(i=0;i<6;++i)chk=polymodStep(chk);for(chk^=1,i=0;i<6;++i)result+=ALPHABET.charAt(chk>>5*(5-i)&31);return result},toWords:function toWords(bytes){return convert(bytes,8,5,!0)},fromWords:function fromWords(words){return convert(words,5,8,!1)}}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),function(module){var global,_src_index__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(21),_src_index__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_src_index__WEBPACK_IMPORTED_MODULE_0__);global="undefined"!=typeof window?window:void 0,"object"==typeof module.exports?module.exports=_src_index__WEBPACK_IMPORTED_MODULE_0___default.a:global.QWeb=_src_index__WEBPACK_IMPORTED_MODULE_0___default.a}.call(this,__webpack_require__(53)(module))},function(module,exports){module.exports=function(originalModule){if(!originalModule.webpackPolyfill){var module=Object.create(originalModule);module.children||(module.children=[]),Object.defineProperty(module,"loaded",{enumerable:!0,get:function(){return module.l}}),Object.defineProperty(module,"id",{enumerable:!0,get:function(){return module.i}}),Object.defineProperty(module,"exports",{enumerable:!0}),module.webpackPolyfill=1}return module}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i>16&255,arr[curByte++]=tmp>>8&255,arr[curByte++]=255&tmp;2===placeHoldersLen&&(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[curByte++]=255&tmp);1===placeHoldersLen&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[curByte++]=tmp>>8&255,arr[curByte++]=255&tmp);return arr},exports.fromByteArray=function fromByteArray(uint8){for(var tmp,len=uint8.length,extraBytes=len%3,parts=[],i=0,len2=len-extraBytes;i>2]+lookup[tmp<<4&63]+"==")):2==extraBytes&&(tmp=(uint8[len-2]<<8)+uint8[len-1],parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"="));return parts.join("")};for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[63&num]);return output.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63},function(module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=8*nBytes-mLen-1,eMax=(1<>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;0>=-nBits,nBits+=mLen;0>1,rt=23===mLen?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||0===value&&1/value<0?1:0;for(value=Math.abs(value),isNaN(value)||value===1/0?(m=isNaN(value)?1:0,e=eMax):(e=Math.floor(Math.log(value)/Math.LN2),value*(c=Math.pow(2,-e))<1&&(e--,c*=2),2<=(value+=1<=e+eBias?rt/c:rt*Math.pow(2,1-eBias))*c&&(e++,c/=2),eMax<=e+eBias?(m=0,e=eMax):1<=e+eBias?(m=(value*c-1)*Math.pow(2,mLen),e+=eBias):(m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen),e=0));8<=mLen;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|length}function byteLength(string,encoding){if(Buffer.isBuffer(string))return string.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer))return string.byteLength;"string"!=typeof string&&(string=""+string);var len=string.length;if(0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case void 0:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*len;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase(),loweredCase=!0}}function swap(b,n,m){var i=b[n];b[n]=b[m],b[m]=i}function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;if("string"==typeof byteOffset?(encoding=byteOffset,byteOffset=0):2147483647=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(byteOffset<0){if(!dir)return-1;byteOffset=0}if("string"==typeof val&&(val=Buffer.from(val,encoding)),Buffer.isBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"==typeof val)return val&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?dir?Uint8Array.prototype.indexOf.call(buffer,val,byteOffset):Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset):arrayIndexOf(buffer,[val],byteOffset,encoding,dir);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){var i,indexSize=1,arrLength=arr.length,valLength=val.length;if(void 0!==encoding&&("ucs2"===(encoding=String(encoding).toLowerCase())||"ucs-2"===encoding||"utf16le"===encoding||"utf-16le"===encoding)){if(arr.length<2||val.length<2)return-1;arrLength/=indexSize=2,valLength/=2,byteOffset/=2}function read(buf,i){return 1===indexSize?buf[i]:buf.readUInt16BE(i*indexSize)}if(dir){var foundIndex=-1;for(i=byteOffset;i>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}(string,buf.length-offset),buf,offset,length)}function base64Slice(buf,start,end){return 0===start&&end===buf.length?base64.fromByteArray(buf):base64.fromByteArray(buf.slice(start,end))}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);for(var res=[],i=start;i>>10&1023|55296),codePoint=56320|1023&codePoint),res.push(codePoint),i+=bytesPerSequence}return function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,codePoints);var res="",i=0;for(;ithis.length)return"";if((void 0===end||end>this.length)&&(end=this.length),end<=0)return"";if((end>>>=0)<=(start>>>=0))return"";for(encoding||(encoding="utf8");;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0}}.apply(this,arguments)},Buffer.prototype.equals=function equals(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b||0===Buffer.compare(this,b)},Buffer.prototype.inspect=function inspect(){var str="",max=exports.INSPECT_MAX_BYTES;return 0max&&(str+=" ... ")),""},Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target))throw new TypeError("Argument must be a Buffer");if(void 0===start&&(start=0),void 0===end&&(end=target?target.length:0),void 0===thisStart&&(thisStart=0),void 0===thisEnd&&(thisEnd=this.length),start<0||end>target.length||thisStart<0||thisEnd>this.length)throw new RangeError("out of range index");if(thisEnd<=thisStart&&end<=start)return 0;if(thisEnd<=thisStart)return-1;if(end<=start)return 1;if(this===target)return 0;for(var x=(thisEnd>>>=0)-(thisStart>>>=0),y=(end>>>=0)-(start>>>=0),len=Math.min(x,y),thisCopy=this.slice(thisStart,thisEnd),targetCopy=target.slice(start,end),i=0;ithis.length)throw new RangeError("Attempt to write outside buffer bounds");encoding||(encoding="utf8");for(var loweredCase=!1;;)switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase(),loweredCase=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;ibuf.length)throw new RangeError("Index out of range")}function objectWriteUInt16(buf,value,offset,littleEndian){value<0&&(value=65535+value+1);for(var i=0,j=Math.min(buf.length-offset,2);i>>8*(littleEndian?i:1-i)}function objectWriteUInt32(buf,value,offset,littleEndian){value<0&&(value=4294967295+value+1);for(var i=0,j=Math.min(buf.length-offset,4);i>>8*(littleEndian?i:3-i)&255}function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,0,offset,4),ieee754.write(buf,value,offset,littleEndian,23,4),offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,0,offset,8),ieee754.write(buf,value,offset,littleEndian,52,8),offset+8}Buffer.prototype.slice=function slice(start,end){var newBuf,len=this.length;if((start=~~start)<0?(start+=len)<0&&(start=0):len>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=255&value):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0,mul=1,sub=0;for(this[offset]=255&value;++i>0)-sub&255;return offset+byteLength},Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1,mul=1,sub=0;for(this[offset+i]=255&value;0<=--i&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i+1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),value<0&&(value=255+value+1),this[offset]=255&value,offset+1},Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),value<0&&(value=4294967295+value+1),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function copy(target,targetStart,start,end){if(start||(start=0),end||0===end||(end=this.length),targetStart>=target.length&&(targetStart=target.length),targetStart||(targetStart=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-targetStart>>=0,end=void 0===end?this.length:end>>>0,val||(val=0),"number"==typeof val)for(i=start;i>6|192,63&codePoint|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,63&codePoint|128)}else{if(!(codePoint<1114112))throw new Error("Invalid code point");if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,63&codePoint|128)}}return bytes}function base64ToBytes(str){return base64.toByteArray(function base64clean(str){if((str=function stringtrim(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}(str).replace(INVALID_BASE64_RE,"")).length<2)return"";for(;str.length%4!=0;)str+="=";return str}(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}}).call(this,__webpack_require__(6))},function(module,exports){var g;g=function(){return this}();try{g=g||new Function("return this")()}catch(e){"object"==typeof window&&(g=window)}module.exports=g},function(module,exports,__webpack_require__){"use strict";var pna=__webpack_require__(12),objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys};module.exports=Duplex;var util=__webpack_require__(11);util.inherits=__webpack_require__(1);var Readable=__webpack_require__(30),Writable=__webpack_require__(16);util.inherits(Duplex,Readable);for(var keys=objectKeys(Writable.prototype),v=0;v=this._finalSize&&(this._update(this._block),this._block.fill(0));var bits=8*this._len;if(bits<=4294967295)this._block.writeUInt32BE(bits,this._blockSize-4);else{var lowBits=(4294967295&bits)>>>0,highBits=(bits-lowBits)/4294967296;this._block.writeUInt32BE(highBits,this._blockSize-8),this._block.writeUInt32BE(lowBits,this._blockSize-4)}this._update(this._block);var hash=this._hash();return enc?hash.toString(enc):hash},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},module.exports=Hash},function(module,exports,__webpack_require__){"use strict";Number.MaxInt8=127,Number.MaxInt16=32767;module.exports={getHash256:function getHash256(input){return __webpack_require__(26).update(input).array()},fromHex:function fromHex(str){for(var buffer=[],i=0;im&&!existing.warned){existing.warned=!0;var w=new Error("Possible EventEmitter memory leak detected. "+existing.length+" "+String(type)+" listeners added. Use emitter.setMaxListeners() to increase limit");w.name="MaxListenersExceededWarning",w.emitter=target,w.type=type,w.count=existing.length,function ProcessEmitWarning(warning){console&&console.warn&&console.warn(warning)}(w)}return target}function _onceWrap(target,type,listener){var state={fired:!1,wrapFn:void 0,target:target,type:type,listener:listener},wrapped=function onceWrapper(){for(var args=[],i=0;i>5==6?2:byte>>4==14?3:byte>>3==30?4:byte>>6==2?-1:-2}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed,r=function utf8CheckExtraBytes(self,buf,p){if(128!=(192&buf[0]))return self.lastNeed=0,"�";if(1>24&255,x[i+1]=h>>16&255,x[i+2]=h>>8&255,x[i+3]=255&h,x[i+4]=l>>24&255,x[i+5]=l>>16&255,x[i+6]=l>>8&255,x[i+7]=255&l}function vn(x,xi,y,yi,n){var i,d=0;for(i=0;i>>8)-1}function crypto_verify_16(x,xi,y,yi){return vn(x,xi,y,yi,16)}function crypto_verify_32(x,xi,y,yi){return vn(x,xi,y,yi,32)}function crypto_core_salsa20(out,inp,k,c){!function core_salsa20(o,p,k,c){for(var u,j0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,j1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,j2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,j3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,j4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,j5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,j6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,j7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,j8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,j9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,j10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,j11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,j12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,j13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,j14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,j15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,x0=j0,x1=j1,x2=j2,x3=j3,x4=j4,x5=j5,x6=j6,x7=j7,x8=j8,x9=j9,x10=j10,x11=j11,x12=j12,x13=j13,x14=j14,x15=j15,i=0;i<20;i+=2)x0^=(u=(x12^=(u=(x8^=(u=(x4^=(u=x0+x12|0)<<7|u>>>25)+x0|0)<<9|u>>>23)+x4|0)<<13|u>>>19)+x8|0)<<18|u>>>14,x5^=(u=(x1^=(u=(x13^=(u=(x9^=(u=x5+x1|0)<<7|u>>>25)+x5|0)<<9|u>>>23)+x9|0)<<13|u>>>19)+x13|0)<<18|u>>>14,x10^=(u=(x6^=(u=(x2^=(u=(x14^=(u=x10+x6|0)<<7|u>>>25)+x10|0)<<9|u>>>23)+x14|0)<<13|u>>>19)+x2|0)<<18|u>>>14,x15^=(u=(x11^=(u=(x7^=(u=(x3^=(u=x15+x11|0)<<7|u>>>25)+x15|0)<<9|u>>>23)+x3|0)<<13|u>>>19)+x7|0)<<18|u>>>14,x0^=(u=(x3^=(u=(x2^=(u=(x1^=(u=x0+x3|0)<<7|u>>>25)+x0|0)<<9|u>>>23)+x1|0)<<13|u>>>19)+x2|0)<<18|u>>>14,x5^=(u=(x4^=(u=(x7^=(u=(x6^=(u=x5+x4|0)<<7|u>>>25)+x5|0)<<9|u>>>23)+x6|0)<<13|u>>>19)+x7|0)<<18|u>>>14,x10^=(u=(x9^=(u=(x8^=(u=(x11^=(u=x10+x9|0)<<7|u>>>25)+x10|0)<<9|u>>>23)+x11|0)<<13|u>>>19)+x8|0)<<18|u>>>14,x15^=(u=(x14^=(u=(x13^=(u=(x12^=(u=x15+x14|0)<<7|u>>>25)+x15|0)<<9|u>>>23)+x12|0)<<13|u>>>19)+x13|0)<<18|u>>>14;x0=x0+j0|0,x1=x1+j1|0,x2=x2+j2|0,x3=x3+j3|0,x4=x4+j4|0,x5=x5+j5|0,x6=x6+j6|0,x7=x7+j7|0,x8=x8+j8|0,x9=x9+j9|0,x10=x10+j10|0,x11=x11+j11|0,x12=x12+j12|0,x13=x13+j13|0,x14=x14+j14|0,x15=x15+j15|0,o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x1>>>0&255,o[5]=x1>>>8&255,o[6]=x1>>>16&255,o[7]=x1>>>24&255,o[8]=x2>>>0&255,o[9]=x2>>>8&255,o[10]=x2>>>16&255,o[11]=x2>>>24&255,o[12]=x3>>>0&255,o[13]=x3>>>8&255,o[14]=x3>>>16&255,o[15]=x3>>>24&255,o[16]=x4>>>0&255,o[17]=x4>>>8&255,o[18]=x4>>>16&255,o[19]=x4>>>24&255,o[20]=x5>>>0&255,o[21]=x5>>>8&255,o[22]=x5>>>16&255,o[23]=x5>>>24&255,o[24]=x6>>>0&255,o[25]=x6>>>8&255,o[26]=x6>>>16&255,o[27]=x6>>>24&255,o[28]=x7>>>0&255,o[29]=x7>>>8&255,o[30]=x7>>>16&255,o[31]=x7>>>24&255,o[32]=x8>>>0&255,o[33]=x8>>>8&255,o[34]=x8>>>16&255,o[35]=x8>>>24&255,o[36]=x9>>>0&255,o[37]=x9>>>8&255,o[38]=x9>>>16&255,o[39]=x9>>>24&255,o[40]=x10>>>0&255,o[41]=x10>>>8&255,o[42]=x10>>>16&255,o[43]=x10>>>24&255,o[44]=x11>>>0&255,o[45]=x11>>>8&255,o[46]=x11>>>16&255,o[47]=x11>>>24&255,o[48]=x12>>>0&255,o[49]=x12>>>8&255,o[50]=x12>>>16&255,o[51]=x12>>>24&255,o[52]=x13>>>0&255,o[53]=x13>>>8&255,o[54]=x13>>>16&255,o[55]=x13>>>24&255,o[56]=x14>>>0&255,o[57]=x14>>>8&255,o[58]=x14>>>16&255,o[59]=x14>>>24&255,o[60]=x15>>>0&255,o[61]=x15>>>8&255,o[62]=x15>>>16&255,o[63]=x15>>>24&255}(out,inp,k,c)}function crypto_core_hsalsa20(out,inp,k,c){!function core_hsalsa20(o,p,k,c){for(var u,x0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,x1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,x2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,x3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,x4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,x5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,x6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,x7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,x8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,x9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,x10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,x11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,x12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,x13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,x14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,x15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,i=0;i<20;i+=2)x0^=(u=(x12^=(u=(x8^=(u=(x4^=(u=x0+x12|0)<<7|u>>>25)+x0|0)<<9|u>>>23)+x4|0)<<13|u>>>19)+x8|0)<<18|u>>>14,x5^=(u=(x1^=(u=(x13^=(u=(x9^=(u=x5+x1|0)<<7|u>>>25)+x5|0)<<9|u>>>23)+x9|0)<<13|u>>>19)+x13|0)<<18|u>>>14,x10^=(u=(x6^=(u=(x2^=(u=(x14^=(u=x10+x6|0)<<7|u>>>25)+x10|0)<<9|u>>>23)+x14|0)<<13|u>>>19)+x2|0)<<18|u>>>14,x15^=(u=(x11^=(u=(x7^=(u=(x3^=(u=x15+x11|0)<<7|u>>>25)+x15|0)<<9|u>>>23)+x3|0)<<13|u>>>19)+x7|0)<<18|u>>>14,x0^=(u=(x3^=(u=(x2^=(u=(x1^=(u=x0+x3|0)<<7|u>>>25)+x0|0)<<9|u>>>23)+x1|0)<<13|u>>>19)+x2|0)<<18|u>>>14,x5^=(u=(x4^=(u=(x7^=(u=(x6^=(u=x5+x4|0)<<7|u>>>25)+x5|0)<<9|u>>>23)+x6|0)<<13|u>>>19)+x7|0)<<18|u>>>14,x10^=(u=(x9^=(u=(x8^=(u=(x11^=(u=x10+x9|0)<<7|u>>>25)+x10|0)<<9|u>>>23)+x11|0)<<13|u>>>19)+x8|0)<<18|u>>>14,x15^=(u=(x14^=(u=(x13^=(u=(x12^=(u=x15+x14|0)<<7|u>>>25)+x15|0)<<9|u>>>23)+x12|0)<<13|u>>>19)+x13|0)<<18|u>>>14;o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x5>>>0&255,o[5]=x5>>>8&255,o[6]=x5>>>16&255,o[7]=x5>>>24&255,o[8]=x10>>>0&255,o[9]=x10>>>8&255,o[10]=x10>>>16&255,o[11]=x10>>>24&255,o[12]=x15>>>0&255,o[13]=x15>>>8&255,o[14]=x15>>>16&255,o[15]=x15>>>24&255,o[16]=x6>>>0&255,o[17]=x6>>>8&255,o[18]=x6>>>16&255,o[19]=x6>>>24&255,o[20]=x7>>>0&255,o[21]=x7>>>8&255,o[22]=x7>>>16&255,o[23]=x7>>>24&255,o[24]=x8>>>0&255,o[25]=x8>>>8&255,o[26]=x8>>>16&255,o[27]=x8>>>24&255,o[28]=x9>>>0&255,o[29]=x9>>>8&255,o[30]=x9>>>16&255,o[31]=x9>>>24&255}(out,inp,k,c)}var sigma=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k){var u,i,z=new Uint8Array(16),x=new Uint8Array(64);for(i=0;i<16;i++)z[i]=0;for(i=0;i<8;i++)z[i]=n[i];for(;64<=b;){for(crypto_core_salsa20(x,z,k,sigma),i=0;i<64;i++)c[cpos+i]=m[mpos+i]^x[i];for(u=1,i=8;i<16;i++)u=u+(255&z[i])|0,z[i]=255&u,u>>>=8;b-=64,cpos+=64,mpos+=64}if(0>>=8;b-=64,cpos+=64}if(0>>13|t1<<3),t2=255&key[4]|(255&key[5])<<8,this.r[2]=7939&(t1>>>10|t2<<6),t3=255&key[6]|(255&key[7])<<8,this.r[3]=8191&(t2>>>7|t3<<9),t4=255&key[8]|(255&key[9])<<8,this.r[4]=255&(t3>>>4|t4<<12),this.r[5]=t4>>>1&8190,t5=255&key[10]|(255&key[11])<<8,this.r[6]=8191&(t4>>>14|t5<<2),t6=255&key[12]|(255&key[13])<<8,this.r[7]=8065&(t5>>>11|t6<<5),t7=255&key[14]|(255&key[15])<<8,this.r[8]=8191&(t6>>>8|t7<<8),this.r[9]=t7>>>5&127,this.pad[0]=255&key[16]|(255&key[17])<<8,this.pad[1]=255&key[18]|(255&key[19])<<8,this.pad[2]=255&key[20]|(255&key[21])<<8,this.pad[3]=255&key[22]|(255&key[23])<<8,this.pad[4]=255&key[24]|(255&key[25])<<8,this.pad[5]=255&key[26]|(255&key[27])<<8,this.pad[6]=255&key[28]|(255&key[29])<<8,this.pad[7]=255&key[30]|(255&key[31])<<8};function crypto_onetimeauth(out,outpos,m,mpos,n,k){var s=new poly1305(k);return s.update(m,mpos,n),s.finish(out,outpos),0}function crypto_onetimeauth_verify(h,hpos,m,mpos,n,k){var x=new Uint8Array(16);return crypto_onetimeauth(x,0,m,mpos,n,k),crypto_verify_16(h,hpos,x,0)}function crypto_secretbox(c,m,d,n,k){var i;if(d<32)return-1;for(crypto_stream_xor(c,0,m,0,d,n,k),crypto_onetimeauth(c,16,c,32,d-32,c),i=0;i<16;i++)c[i]=0;return 0}function crypto_secretbox_open(m,c,d,n,k){var i,x=new Uint8Array(32);if(d<32)return-1;if(crypto_stream(x,0,32,n,k),0!==crypto_onetimeauth_verify(c,16,c,32,d-32,x))return-1;for(crypto_stream_xor(m,0,c,0,d,n,k),i=0;i<32;i++)m[i]=0;return 0}function set25519(r,a){var i;for(i=0;i<16;i++)r[i]=0|a[i]}function car25519(o){var i,v,c=1;for(i=0;i<16;i++)v=o[i]+c+65535,c=Math.floor(v/65536),o[i]=v-65536*c;o[0]+=c-1+37*(c-1)}function sel25519(p,q,b){for(var t,c=~(b-1),i=0;i<16;i++)t=c&(p[i]^q[i]),p[i]^=t,q[i]^=t}function pack25519(o,n){var i,j,b,m=gf(),t=gf();for(i=0;i<16;i++)t[i]=n[i];for(car25519(t),car25519(t),car25519(t),j=0;j<2;j++){for(m[0]=t[0]-65517,i=1;i<15;i++)m[i]=t[i]-65535-(m[i-1]>>16&1),m[i-1]&=65535;m[15]=t[15]-32767-(m[14]>>16&1),b=m[15]>>16&1,m[14]&=65535,sel25519(t,m,1-b)}for(i=0;i<16;i++)o[2*i]=255&t[i],o[2*i+1]=t[i]>>8}function neq25519(a,b){var c=new Uint8Array(32),d=new Uint8Array(32);return pack25519(c,a),pack25519(d,b),crypto_verify_32(c,0,d,0)}function par25519(a){var d=new Uint8Array(32);return pack25519(d,a),1&d[0]}function unpack25519(o,n){var i;for(i=0;i<16;i++)o[i]=n[2*i]+(n[2*i+1]<<8);o[15]&=32767}function A(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]+b[i]}function Z(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]-b[i]}function M(o,a,b){var v,c,t0=0,t1=0,t2=0,t3=0,t4=0,t5=0,t6=0,t7=0,t8=0,t9=0,t10=0,t11=0,t12=0,t13=0,t14=0,t15=0,t16=0,t17=0,t18=0,t19=0,t20=0,t21=0,t22=0,t23=0,t24=0,t25=0,t26=0,t27=0,t28=0,t29=0,t30=0,b0=b[0],b1=b[1],b2=b[2],b3=b[3],b4=b[4],b5=b[5],b6=b[6],b7=b[7],b8=b[8],b9=b[9],b10=b[10],b11=b[11],b12=b[12],b13=b[13],b14=b[14],b15=b[15];t0+=(v=a[0])*b0,t1+=v*b1,t2+=v*b2,t3+=v*b3,t4+=v*b4,t5+=v*b5,t6+=v*b6,t7+=v*b7,t8+=v*b8,t9+=v*b9,t10+=v*b10,t11+=v*b11,t12+=v*b12,t13+=v*b13,t14+=v*b14,t15+=v*b15,t1+=(v=a[1])*b0,t2+=v*b1,t3+=v*b2,t4+=v*b3,t5+=v*b4,t6+=v*b5,t7+=v*b6,t8+=v*b7,t9+=v*b8,t10+=v*b9,t11+=v*b10,t12+=v*b11,t13+=v*b12,t14+=v*b13,t15+=v*b14,t16+=v*b15,t2+=(v=a[2])*b0,t3+=v*b1,t4+=v*b2,t5+=v*b3,t6+=v*b4,t7+=v*b5,t8+=v*b6,t9+=v*b7,t10+=v*b8,t11+=v*b9,t12+=v*b10,t13+=v*b11,t14+=v*b12,t15+=v*b13,t16+=v*b14,t17+=v*b15,t3+=(v=a[3])*b0,t4+=v*b1,t5+=v*b2,t6+=v*b3,t7+=v*b4,t8+=v*b5,t9+=v*b6,t10+=v*b7,t11+=v*b8,t12+=v*b9,t13+=v*b10,t14+=v*b11,t15+=v*b12,t16+=v*b13,t17+=v*b14,t18+=v*b15,t4+=(v=a[4])*b0,t5+=v*b1,t6+=v*b2,t7+=v*b3,t8+=v*b4,t9+=v*b5,t10+=v*b6,t11+=v*b7,t12+=v*b8,t13+=v*b9,t14+=v*b10,t15+=v*b11,t16+=v*b12,t17+=v*b13,t18+=v*b14,t19+=v*b15,t5+=(v=a[5])*b0,t6+=v*b1,t7+=v*b2,t8+=v*b3,t9+=v*b4,t10+=v*b5,t11+=v*b6,t12+=v*b7,t13+=v*b8,t14+=v*b9,t15+=v*b10,t16+=v*b11,t17+=v*b12,t18+=v*b13,t19+=v*b14,t20+=v*b15,t6+=(v=a[6])*b0,t7+=v*b1,t8+=v*b2,t9+=v*b3,t10+=v*b4,t11+=v*b5,t12+=v*b6,t13+=v*b7,t14+=v*b8,t15+=v*b9,t16+=v*b10,t17+=v*b11,t18+=v*b12,t19+=v*b13,t20+=v*b14,t21+=v*b15,t7+=(v=a[7])*b0,t8+=v*b1,t9+=v*b2,t10+=v*b3,t11+=v*b4,t12+=v*b5,t13+=v*b6,t14+=v*b7,t15+=v*b8,t16+=v*b9,t17+=v*b10,t18+=v*b11,t19+=v*b12,t20+=v*b13,t21+=v*b14,t22+=v*b15,t8+=(v=a[8])*b0,t9+=v*b1,t10+=v*b2,t11+=v*b3,t12+=v*b4,t13+=v*b5,t14+=v*b6,t15+=v*b7,t16+=v*b8,t17+=v*b9,t18+=v*b10,t19+=v*b11,t20+=v*b12,t21+=v*b13,t22+=v*b14,t23+=v*b15,t9+=(v=a[9])*b0,t10+=v*b1,t11+=v*b2,t12+=v*b3,t13+=v*b4,t14+=v*b5,t15+=v*b6,t16+=v*b7,t17+=v*b8,t18+=v*b9,t19+=v*b10,t20+=v*b11,t21+=v*b12,t22+=v*b13,t23+=v*b14,t24+=v*b15,t10+=(v=a[10])*b0,t11+=v*b1,t12+=v*b2,t13+=v*b3,t14+=v*b4,t15+=v*b5,t16+=v*b6,t17+=v*b7,t18+=v*b8,t19+=v*b9,t20+=v*b10,t21+=v*b11,t22+=v*b12,t23+=v*b13,t24+=v*b14,t25+=v*b15,t11+=(v=a[11])*b0,t12+=v*b1,t13+=v*b2,t14+=v*b3,t15+=v*b4,t16+=v*b5,t17+=v*b6,t18+=v*b7,t19+=v*b8,t20+=v*b9,t21+=v*b10,t22+=v*b11,t23+=v*b12,t24+=v*b13,t25+=v*b14,t26+=v*b15,t12+=(v=a[12])*b0,t13+=v*b1,t14+=v*b2,t15+=v*b3,t16+=v*b4,t17+=v*b5,t18+=v*b6,t19+=v*b7,t20+=v*b8,t21+=v*b9,t22+=v*b10,t23+=v*b11,t24+=v*b12,t25+=v*b13,t26+=v*b14,t27+=v*b15,t13+=(v=a[13])*b0,t14+=v*b1,t15+=v*b2,t16+=v*b3,t17+=v*b4,t18+=v*b5,t19+=v*b6,t20+=v*b7,t21+=v*b8,t22+=v*b9,t23+=v*b10,t24+=v*b11,t25+=v*b12,t26+=v*b13,t27+=v*b14,t28+=v*b15,t14+=(v=a[14])*b0,t15+=v*b1,t16+=v*b2,t17+=v*b3,t18+=v*b4,t19+=v*b5,t20+=v*b6,t21+=v*b7,t22+=v*b8,t23+=v*b9,t24+=v*b10,t25+=v*b11,t26+=v*b12,t27+=v*b13,t28+=v*b14,t29+=v*b15,t15+=(v=a[15])*b0,t1+=38*(t17+=v*b2),t2+=38*(t18+=v*b3),t3+=38*(t19+=v*b4),t4+=38*(t20+=v*b5),t5+=38*(t21+=v*b6),t6+=38*(t22+=v*b7),t7+=38*(t23+=v*b8),t8+=38*(t24+=v*b9),t9+=38*(t25+=v*b10),t10+=38*(t26+=v*b11),t11+=38*(t27+=v*b12),t12+=38*(t28+=v*b13),t13+=38*(t29+=v*b14),t14+=38*(t30+=v*b15),t0=(v=(t0+=38*(t16+=v*b1))+(c=1)+65535)-65536*(c=Math.floor(v/65536)),t1=(v=t1+c+65535)-65536*(c=Math.floor(v/65536)),t2=(v=t2+c+65535)-65536*(c=Math.floor(v/65536)),t3=(v=t3+c+65535)-65536*(c=Math.floor(v/65536)),t4=(v=t4+c+65535)-65536*(c=Math.floor(v/65536)),t5=(v=t5+c+65535)-65536*(c=Math.floor(v/65536)),t6=(v=t6+c+65535)-65536*(c=Math.floor(v/65536)),t7=(v=t7+c+65535)-65536*(c=Math.floor(v/65536)),t8=(v=t8+c+65535)-65536*(c=Math.floor(v/65536)),t9=(v=t9+c+65535)-65536*(c=Math.floor(v/65536)),t10=(v=t10+c+65535)-65536*(c=Math.floor(v/65536)),t11=(v=t11+c+65535)-65536*(c=Math.floor(v/65536)),t12=(v=t12+c+65535)-65536*(c=Math.floor(v/65536)),t13=(v=t13+c+65535)-65536*(c=Math.floor(v/65536)),t14=(v=t14+c+65535)-65536*(c=Math.floor(v/65536)),t15=(v=t15+c+65535)-65536*(c=Math.floor(v/65536)),t0=(v=(t0+=c-1+37*(c-1))+(c=1)+65535)-65536*(c=Math.floor(v/65536)),t1=(v=t1+c+65535)-65536*(c=Math.floor(v/65536)),t2=(v=t2+c+65535)-65536*(c=Math.floor(v/65536)),t3=(v=t3+c+65535)-65536*(c=Math.floor(v/65536)),t4=(v=t4+c+65535)-65536*(c=Math.floor(v/65536)),t5=(v=t5+c+65535)-65536*(c=Math.floor(v/65536)),t6=(v=t6+c+65535)-65536*(c=Math.floor(v/65536)),t7=(v=t7+c+65535)-65536*(c=Math.floor(v/65536)),t8=(v=t8+c+65535)-65536*(c=Math.floor(v/65536)),t9=(v=t9+c+65535)-65536*(c=Math.floor(v/65536)),t10=(v=t10+c+65535)-65536*(c=Math.floor(v/65536)),t11=(v=t11+c+65535)-65536*(c=Math.floor(v/65536)),t12=(v=t12+c+65535)-65536*(c=Math.floor(v/65536)),t13=(v=t13+c+65535)-65536*(c=Math.floor(v/65536)),t14=(v=t14+c+65535)-65536*(c=Math.floor(v/65536)),t15=(v=t15+c+65535)-65536*(c=Math.floor(v/65536)),t0+=c-1+37*(c-1),o[0]=t0,o[1]=t1,o[2]=t2,o[3]=t3,o[4]=t4,o[5]=t5,o[6]=t6,o[7]=t7,o[8]=t8,o[9]=t9,o[10]=t10,o[11]=t11,o[12]=t12,o[13]=t13,o[14]=t14,o[15]=t15}function S(o,a){M(o,a,a)}function inv25519(o,i){var a,c=gf();for(a=0;a<16;a++)c[a]=i[a];for(a=253;0<=a;a--)S(c,c),2!==a&&4!==a&&M(c,c,i);for(a=0;a<16;a++)o[a]=c[a]}function crypto_scalarmult(q,n,p){var r,i,z=new Uint8Array(32),x=new Float64Array(80),a=gf(),b=gf(),c=gf(),d=gf(),e=gf(),f=gf();for(i=0;i<31;i++)z[i]=n[i];for(z[31]=127&n[31]|64,z[0]&=248,unpack25519(x,p),i=0;i<16;i++)b[i]=x[i],d[i]=a[i]=c[i]=0;for(a[0]=d[0]=1,i=254;0<=i;--i)sel25519(a,b,r=z[i>>>3]>>>(7&i)&1),sel25519(c,d,r),A(e,a,c),Z(a,a,c),A(c,b,d),Z(b,b,d),S(d,e),S(f,a),M(a,c,a),M(c,b,e),A(e,a,c),Z(a,a,c),S(b,a),Z(c,d,f),M(a,c,_121665),A(a,a,d),M(c,c,a),M(a,d,f),M(d,b,x),S(b,e),sel25519(a,b,r),sel25519(c,d,r);for(i=0;i<16;i++)x[i+16]=a[i],x[i+32]=c[i],x[i+48]=b[i],x[i+64]=d[i];var x32=x.subarray(32),x16=x.subarray(16);return inv25519(x32,x32),M(x16,x16,x32),pack25519(q,x16),0}function crypto_scalarmult_base(q,n){return crypto_scalarmult(q,n,_9)}function crypto_box_keypair(y,x){return randombytes(x,32),crypto_scalarmult_base(y,x)}function crypto_box_beforenm(k,y,x){var s=new Uint8Array(32);return crypto_scalarmult(s,x,y),crypto_core_hsalsa20(k,_0,s,sigma)}poly1305.prototype.blocks=function(m,mpos,bytes){for(var t0,t1,t2,t3,t4,t5,t6,t7,c,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,hibit=this.fin?0:2048,h0=this.h[0],h1=this.h[1],h2=this.h[2],h3=this.h[3],h4=this.h[4],h5=this.h[5],h6=this.h[6],h7=this.h[7],h8=this.h[8],h9=this.h[9],r0=this.r[0],r1=this.r[1],r2=this.r[2],r3=this.r[3],r4=this.r[4],r5=this.r[5],r6=this.r[6],r7=this.r[7],r8=this.r[8],r9=this.r[9];16<=bytes;)d0=c=0,d0+=(h0+=8191&(t0=255&m[mpos+0]|(255&m[mpos+1])<<8))*r0,d0+=(h1+=8191&(t0>>>13|(t1=255&m[mpos+2]|(255&m[mpos+3])<<8)<<3))*(5*r9),d0+=(h2+=8191&(t1>>>10|(t2=255&m[mpos+4]|(255&m[mpos+5])<<8)<<6))*(5*r8),d0+=(h3+=8191&(t2>>>7|(t3=255&m[mpos+6]|(255&m[mpos+7])<<8)<<9))*(5*r7),c=(d0+=(h4+=8191&(t3>>>4|(t4=255&m[mpos+8]|(255&m[mpos+9])<<8)<<12))*(5*r6))>>>13,d0&=8191,d0+=(h5+=t4>>>1&8191)*(5*r5),d0+=(h6+=8191&(t4>>>14|(t5=255&m[mpos+10]|(255&m[mpos+11])<<8)<<2))*(5*r4),d0+=(h7+=8191&(t5>>>11|(t6=255&m[mpos+12]|(255&m[mpos+13])<<8)<<5))*(5*r3),d0+=(h8+=8191&(t6>>>8|(t7=255&m[mpos+14]|(255&m[mpos+15])<<8)<<8))*(5*r2),d1=c+=(d0+=(h9+=t7>>>5|hibit)*(5*r1))>>>13,d1+=h0*r1,d1+=h1*r0,d1+=h2*(5*r9),d1+=h3*(5*r8),c=(d1+=h4*(5*r7))>>>13,d1&=8191,d1+=h5*(5*r6),d1+=h6*(5*r5),d1+=h7*(5*r4),d1+=h8*(5*r3),c+=(d1+=h9*(5*r2))>>>13,d1&=8191,d2=c,d2+=h0*r2,d2+=h1*r1,d2+=h2*r0,d2+=h3*(5*r9),c=(d2+=h4*(5*r8))>>>13,d2&=8191,d2+=h5*(5*r7),d2+=h6*(5*r6),d2+=h7*(5*r5),d2+=h8*(5*r4),d3=c+=(d2+=h9*(5*r3))>>>13,d3+=h0*r3,d3+=h1*r2,d3+=h2*r1,d3+=h3*r0,c=(d3+=h4*(5*r9))>>>13,d3&=8191,d3+=h5*(5*r8),d3+=h6*(5*r7),d3+=h7*(5*r6),d3+=h8*(5*r5),d4=c+=(d3+=h9*(5*r4))>>>13,d4+=h0*r4,d4+=h1*r3,d4+=h2*r2,d4+=h3*r1,c=(d4+=h4*r0)>>>13,d4&=8191,d4+=h5*(5*r9),d4+=h6*(5*r8),d4+=h7*(5*r7),d4+=h8*(5*r6),d5=c+=(d4+=h9*(5*r5))>>>13,d5+=h0*r5,d5+=h1*r4,d5+=h2*r3,d5+=h3*r2,c=(d5+=h4*r1)>>>13,d5&=8191,d5+=h5*r0,d5+=h6*(5*r9),d5+=h7*(5*r8),d5+=h8*(5*r7),d6=c+=(d5+=h9*(5*r6))>>>13,d6+=h0*r6,d6+=h1*r5,d6+=h2*r4,d6+=h3*r3,c=(d6+=h4*r2)>>>13,d6&=8191,d6+=h5*r1,d6+=h6*r0,d6+=h7*(5*r9),d6+=h8*(5*r8),d7=c+=(d6+=h9*(5*r7))>>>13,d7+=h0*r7,d7+=h1*r6,d7+=h2*r5,d7+=h3*r4,c=(d7+=h4*r3)>>>13,d7&=8191,d7+=h5*r2,d7+=h6*r1,d7+=h7*r0,d7+=h8*(5*r9),d8=c+=(d7+=h9*(5*r8))>>>13,d8+=h0*r8,d8+=h1*r7,d8+=h2*r6,d8+=h3*r5,c=(d8+=h4*r4)>>>13,d8&=8191,d8+=h5*r3,d8+=h6*r2,d8+=h7*r1,d8+=h8*r0,d9=c+=(d8+=h9*(5*r9))>>>13,d9+=h0*r9,d9+=h1*r8,d9+=h2*r7,d9+=h3*r6,c=(d9+=h4*r5)>>>13,d9&=8191,d9+=h5*r4,d9+=h6*r3,d9+=h7*r2,d9+=h8*r1,h0=d0=8191&(c=(c=((c+=(d9+=h9*r0)>>>13)<<2)+c|0)+(d0&=8191)|0),h1=d1+=c>>>=13,h2=d2&=8191,h3=d3&=8191,h4=d4&=8191,h5=d5&=8191,h6=d6&=8191,h7=d7&=8191,h8=d8&=8191,h9=d9&=8191,mpos+=16,bytes-=16;this.h[0]=h0,this.h[1]=h1,this.h[2]=h2,this.h[3]=h3,this.h[4]=h4,this.h[5]=h5,this.h[6]=h6,this.h[7]=h7,this.h[8]=h8,this.h[9]=h9},poly1305.prototype.finish=function(mac,macpos){var c,mask,f,i,g=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(c=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=c,c=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*c,c=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=c,c=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=c,g[0]=this.h[0]+5,c=g[0]>>>13,g[0]&=8191,i=1;i<10;i++)g[i]=this.h[i]+c,c=g[i]>>>13,g[i]&=8191;for(g[9]-=8192,mask=(1^c)-1,i=0;i<10;i++)g[i]&=mask;for(mask=~mask,i=0;i<10;i++)this.h[i]=this.h[i]&mask|g[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),f=this.h[0]+this.pad[0],this.h[0]=65535&f,i=1;i<8;i++)f=(this.h[i]+this.pad[i]|0)+(f>>>16)|0,this.h[i]=65535&f;mac[macpos+0]=this.h[0]>>>0&255,mac[macpos+1]=this.h[0]>>>8&255,mac[macpos+2]=this.h[1]>>>0&255,mac[macpos+3]=this.h[1]>>>8&255,mac[macpos+4]=this.h[2]>>>0&255,mac[macpos+5]=this.h[2]>>>8&255,mac[macpos+6]=this.h[3]>>>0&255,mac[macpos+7]=this.h[3]>>>8&255,mac[macpos+8]=this.h[4]>>>0&255,mac[macpos+9]=this.h[4]>>>8&255,mac[macpos+10]=this.h[5]>>>0&255,mac[macpos+11]=this.h[5]>>>8&255,mac[macpos+12]=this.h[6]>>>0&255,mac[macpos+13]=this.h[6]>>>8&255,mac[macpos+14]=this.h[7]>>>0&255,mac[macpos+15]=this.h[7]>>>8&255},poly1305.prototype.update=function(m,mpos,bytes){var i,want;if(this.leftover){for(bytes<(want=16-this.leftover)&&(want=bytes),i=0;i>>16,c=65535&(h=ah7),d=h>>>16,a+=65535&(l=((bl4=al4)>>>14|(bh4=ah4)<<18)^(al4>>>18|ah4<<14)^(ah4>>>9|al4<<23)),b+=l>>>16,c+=65535&(h=(ah4>>>14|al4<<18)^(ah4>>>18|al4<<14)^(al4>>>9|ah4<<23)),d+=h>>>16,a+=65535&(l=al4&(bl5=al5)^~al4&(bl6=al6)),b+=l>>>16,c+=65535&(h=ah4&(bh5=ah5)^~ah4&(bh6=ah6)),d+=h>>>16,h=K[2*i],a+=65535&(l=K[2*i+1]),b+=l>>>16,c+=65535&h,d+=h>>>16,h=wh[i%16],b+=(l=wl[i%16])>>>16,c+=65535&h,d+=h>>>16,c+=(b+=(a+=65535&l)>>>16)>>>16,a=65535&(l=tl=65535&a|b<<16),b=l>>>16,c=65535&(h=th=65535&c|(d+=c>>>16)<<16),d=h>>>16,a+=65535&(l=(al0>>>28|ah0<<4)^(ah0>>>2|al0<<30)^(ah0>>>7|al0<<25)),b+=l>>>16,c+=65535&(h=(ah0>>>28|al0<<4)^(al0>>>2|ah0<<30)^(al0>>>7|ah0<<25)),d+=h>>>16,b+=(l=al0&al1^al0&al2^al1&al2)>>>16,c+=65535&(h=ah0&ah1^ah0&ah2^ah1&ah2),d+=h>>>16,bh7=65535&(c+=(b+=(a+=65535&l)>>>16)>>>16)|(d+=c>>>16)<<16,bl7=65535&a|b<<16,a=65535&(l=bl3),b=l>>>16,c=65535&(h=bh3),d=h>>>16,b+=(l=tl)>>>16,c+=65535&(h=th),d+=h>>>16,ah1=bh0,ah2=bh1,ah3=bh2,ah4=bh3=65535&(c+=(b+=(a+=65535&l)>>>16)>>>16)|(d+=c>>>16)<<16,ah5=bh4,ah6=bh5,ah7=bh6,ah0=bh7,al1=bl0,al2=bl1,al3=bl2,al4=bl3=65535&a|b<<16,al5=bl4,al6=bl5,al7=bl6,al0=bl7,i%16==15)for(j=0;j<16;j++)h=wh[j],a=65535&(l=wl[j]),b=l>>>16,c=65535&h,d=h>>>16,h=wh[(j+9)%16],a+=65535&(l=wl[(j+9)%16]),b+=l>>>16,c+=65535&h,d+=h>>>16,th=wh[(j+1)%16],a+=65535&(l=((tl=wl[(j+1)%16])>>>1|th<<31)^(tl>>>8|th<<24)^(tl>>>7|th<<25)),b+=l>>>16,c+=65535&(h=(th>>>1|tl<<31)^(th>>>8|tl<<24)^th>>>7),d+=h>>>16,th=wh[(j+14)%16],b+=(l=((tl=wl[(j+14)%16])>>>19|th<<13)^(th>>>29|tl<<3)^(tl>>>6|th<<26))>>>16,c+=65535&(h=(th>>>19|tl<<13)^(tl>>>29|th<<3)^th>>>6),d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,wh[j]=65535&c|d<<16,wl[j]=65535&a|b<<16;a=65535&(l=al0),b=l>>>16,c=65535&(h=ah0),d=h>>>16,h=hh[0],b+=(l=hl[0])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[0]=ah0=65535&c|d<<16,hl[0]=al0=65535&a|b<<16,a=65535&(l=al1),b=l>>>16,c=65535&(h=ah1),d=h>>>16,h=hh[1],b+=(l=hl[1])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[1]=ah1=65535&c|d<<16,hl[1]=al1=65535&a|b<<16,a=65535&(l=al2),b=l>>>16,c=65535&(h=ah2),d=h>>>16,h=hh[2],b+=(l=hl[2])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[2]=ah2=65535&c|d<<16,hl[2]=al2=65535&a|b<<16,a=65535&(l=al3),b=l>>>16,c=65535&(h=ah3),d=h>>>16,h=hh[3],b+=(l=hl[3])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[3]=ah3=65535&c|d<<16,hl[3]=al3=65535&a|b<<16,a=65535&(l=al4),b=l>>>16,c=65535&(h=ah4),d=h>>>16,h=hh[4],b+=(l=hl[4])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[4]=ah4=65535&c|d<<16,hl[4]=al4=65535&a|b<<16,a=65535&(l=al5),b=l>>>16,c=65535&(h=ah5),d=h>>>16,h=hh[5],b+=(l=hl[5])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[5]=ah5=65535&c|d<<16,hl[5]=al5=65535&a|b<<16,a=65535&(l=al6),b=l>>>16,c=65535&(h=ah6),d=h>>>16,h=hh[6],b+=(l=hl[6])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[6]=ah6=65535&c|d<<16,hl[6]=al6=65535&a|b<<16,a=65535&(l=al7),b=l>>>16,c=65535&(h=ah7),d=h>>>16,h=hh[7],b+=(l=hl[7])>>>16,c+=65535&h,d+=h>>>16,d+=(c+=(b+=(a+=65535&l)>>>16)>>>16)>>>16,hh[7]=ah7=65535&c|d<<16,hl[7]=al7=65535&a|b<<16,pos+=128,n-=128}return n}function crypto_hash(out,m,n){var i,hh=new Int32Array(8),hl=new Int32Array(8),x=new Uint8Array(256),b=n;for(hh[0]=1779033703,hh[1]=3144134277,hh[2]=1013904242,hh[3]=2773480762,hh[4]=1359893119,hh[5]=2600822924,hh[6]=528734635,hh[7]=1541459225,hl[0]=4089235720,hl[1]=2227873595,hl[2]=4271175723,hl[3]=1595750129,hl[4]=2917565137,hl[5]=725511199,hl[6]=4215389547,hl[7]=327033209,crypto_hashblocks_hl(hh,hl,m,n),n%=128,i=0;i>(7&i)&1),add(q,p),add(p,p),cswap(p,q,b)}function scalarbase(p,s){var q=[gf(),gf(),gf(),gf()];set25519(q[0],X),set25519(q[1],Y),set25519(q[2],gf1),M(q[3],X,Y),scalarmult(p,q,s)}function crypto_sign_keypair(pk,sk,seeded){var i,d=new Uint8Array(64),p=[gf(),gf(),gf(),gf()];for(seeded||randombytes(sk,32),crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64,scalarbase(p,d),pack(pk,p),i=0;i<32;i++)sk[i+32]=pk[i];return 0}var L=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function modL(r,x){var carry,i,j,k;for(i=63;32<=i;--i){for(carry=0,j=i-32,k=i-12;j>8,x[j]-=256*carry;x[j]+=carry,x[i]=0}for(j=carry=0;j<32;j++)x[j]+=carry-(x[31]>>4)*L[j],carry=x[j]>>8,x[j]&=255;for(j=0;j<32;j++)x[j]-=carry*L[j];for(i=0;i<32;i++)x[i+1]+=x[i]>>8,r[i]=255&x[i]}function reduce(r){var i,x=new Float64Array(64);for(i=0;i<64;i++)x[i]=r[i];for(i=0;i<64;i++)r[i]=0;modL(r,x)}function crypto_sign(sm,m,n,sk){var i,j,d=new Uint8Array(64),h=new Uint8Array(64),r=new Uint8Array(64),x=new Float64Array(64),p=[gf(),gf(),gf(),gf()];crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64;var smlen=n+64;for(i=0;i>7&&Z(r[0],gf0,r[0]),M(r[3],r[0],r[1]),0)}function crypto_sign_open(m,sm,n,pk){var i,t=new Uint8Array(32),h=new Uint8Array(64),p=[gf(),gf(),gf(),gf()],q=[gf(),gf(),gf(),gf()];if(-1,n<64)return-1;if(unpackneg(q,pk))return-1;for(i=0;i>6:(code<55296||57344<=code?bytes[index++]=224|code>>12:(code=65536+((1023&code)<<10|1023&key.charCodeAt(++i)),bytes[index++]=240|code>>18,bytes[index++]=128|code>>12&63),bytes[index++]=128|code>>6&63),bytes[index++]=128|63&code);key=bytes}else{if("object"!=type)throw new Error(ERROR);if(null===key)throw new Error(ERROR);if(ARRAY_BUFFER&&key.constructor===ArrayBuffer)key=new Uint8Array(key);else if(!(Array.isArray(key)||ARRAY_BUFFER&&ArrayBuffer.isView(key)))throw new Error(ERROR)}64>2]|=message[index]<>2]|=code<>2]|=(192|code>>6)<>2]|=(224|code>>12)<>2]|=(240|code>>18)<>2]|=(128|code>>12&63)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=EXTRA[3&i],this.block=blocks[16],56<=i&&(this.hashed||this.hash(),blocks[0]=this.block,blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0),blocks[14]=this.hBytes<<3|this.bytes>>>29,blocks[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var j,s0,s1,maj,t1,ab,da,cd,bc,a=this.h0,b=this.h1,c=this.h2,d=this.h3,e=this.h4,f=this.h5,g=this.h6,h=this.h7,blocks=this.blocks;for(j=16;j<64;++j)s0=((t1=blocks[j-15])>>>7|t1<<25)^(t1>>>18|t1<<14)^t1>>>3,s1=((t1=blocks[j-2])>>>17|t1<<15)^(t1>>>19|t1<<13)^t1>>>10,blocks[j]=blocks[j-16]+s0+blocks[j-7]+s1<<0;for(bc=b&c,j=0;j<64;j+=4)this.first?(d=this.is224?(ab=300032,h=(t1=blocks[0]-1413257819)-150054599<<0,t1+24177077<<0):(ab=704751109,h=(t1=blocks[0]-210244248)-1521486534<<0,t1+143694565<<0),this.first=!1):(s0=(a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10),maj=(ab=a&b)^a&c^bc,h=d+(t1=h+(s1=(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7))+(e&f^~e&g)+K[j]+blocks[j])<<0,d=t1+(s0+maj)<<0),s0=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),maj=(da=d&a)^d&b^ab,g=c+(t1=g+(s1=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&e^~h&f)+K[j+1]+blocks[j+1])<<0,s0=((c=t1+(s0+maj)<<0)>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),maj=(cd=c&d)^c&a^da,f=b+(t1=f+(s1=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&h^~g&e)+K[j+2]+blocks[j+2])<<0,s0=((b=t1+(s0+maj)<<0)>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10),maj=(bc=b&c)^b&d^cd,e=a+(t1=e+(s1=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&g^~f&h)+K[j+3]+blocks[j+3])<<0,a=t1+(s0+maj)<<0;this.h0=this.h0+a<<0,this.h1=this.h1+b<<0,this.h2=this.h2+c<<0,this.h3=this.h3+d<<0,this.h4=this.h4+e<<0,this.h5=this.h5+f<<0,this.h6=this.h6+g<<0,this.h7=this.h7+h<<0},Sha256.prototype.hex=function(){this.finalize();var h0=this.h0,h1=this.h1,h2=this.h2,h3=this.h3,h4=this.h4,h5=this.h5,h6=this.h6,h7=this.h7,hex=HEX_CHARS[h0>>28&15]+HEX_CHARS[h0>>24&15]+HEX_CHARS[h0>>20&15]+HEX_CHARS[h0>>16&15]+HEX_CHARS[h0>>12&15]+HEX_CHARS[h0>>8&15]+HEX_CHARS[h0>>4&15]+HEX_CHARS[15&h0]+HEX_CHARS[h1>>28&15]+HEX_CHARS[h1>>24&15]+HEX_CHARS[h1>>20&15]+HEX_CHARS[h1>>16&15]+HEX_CHARS[h1>>12&15]+HEX_CHARS[h1>>8&15]+HEX_CHARS[h1>>4&15]+HEX_CHARS[15&h1]+HEX_CHARS[h2>>28&15]+HEX_CHARS[h2>>24&15]+HEX_CHARS[h2>>20&15]+HEX_CHARS[h2>>16&15]+HEX_CHARS[h2>>12&15]+HEX_CHARS[h2>>8&15]+HEX_CHARS[h2>>4&15]+HEX_CHARS[15&h2]+HEX_CHARS[h3>>28&15]+HEX_CHARS[h3>>24&15]+HEX_CHARS[h3>>20&15]+HEX_CHARS[h3>>16&15]+HEX_CHARS[h3>>12&15]+HEX_CHARS[h3>>8&15]+HEX_CHARS[h3>>4&15]+HEX_CHARS[15&h3]+HEX_CHARS[h4>>28&15]+HEX_CHARS[h4>>24&15]+HEX_CHARS[h4>>20&15]+HEX_CHARS[h4>>16&15]+HEX_CHARS[h4>>12&15]+HEX_CHARS[h4>>8&15]+HEX_CHARS[h4>>4&15]+HEX_CHARS[15&h4]+HEX_CHARS[h5>>28&15]+HEX_CHARS[h5>>24&15]+HEX_CHARS[h5>>20&15]+HEX_CHARS[h5>>16&15]+HEX_CHARS[h5>>12&15]+HEX_CHARS[h5>>8&15]+HEX_CHARS[h5>>4&15]+HEX_CHARS[15&h5]+HEX_CHARS[h6>>28&15]+HEX_CHARS[h6>>24&15]+HEX_CHARS[h6>>20&15]+HEX_CHARS[h6>>16&15]+HEX_CHARS[h6>>12&15]+HEX_CHARS[h6>>8&15]+HEX_CHARS[h6>>4&15]+HEX_CHARS[15&h6];return this.is224||(hex+=HEX_CHARS[h7>>28&15]+HEX_CHARS[h7>>24&15]+HEX_CHARS[h7>>20&15]+HEX_CHARS[h7>>16&15]+HEX_CHARS[h7>>12&15]+HEX_CHARS[h7>>8&15]+HEX_CHARS[h7>>4&15]+HEX_CHARS[15&h7]),hex},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var h0=this.h0,h1=this.h1,h2=this.h2,h3=this.h3,h4=this.h4,h5=this.h5,h6=this.h6,h7=this.h7,arr=[h0>>24&255,h0>>16&255,h0>>8&255,255&h0,h1>>24&255,h1>>16&255,h1>>8&255,255&h1,h2>>24&255,h2>>16&255,h2>>8&255,255&h2,h3>>24&255,h3>>16&255,h3>>8&255,255&h3,h4>>24&255,h4>>16&255,h4>>8&255,255&h4,h5>>24&255,h5>>16&255,h5>>8&255,255&h5,h6>>24&255,h6>>16&255,h6>>8&255,255&h6];return this.is224||arr.push(h7>>24&255,h7>>16&255,h7>>8&255,255&h7),arr},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var buffer=new ArrayBuffer(this.is224?28:32),dataView=new DataView(buffer);return dataView.setUint32(0,this.h0),dataView.setUint32(4,this.h1),dataView.setUint32(8,this.h2),dataView.setUint32(12,this.h3),dataView.setUint32(16,this.h4),dataView.setUint32(20,this.h5),dataView.setUint32(24,this.h6),this.is224||dataView.setUint32(28,this.h7),buffer},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var innerHash=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(innerHash),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}()}).call(this,__webpack_require__(4),__webpack_require__(5))},function(module,exports,__webpack_require__){var Buffer=__webpack_require__(0).Buffer,createHash=__webpack_require__(59),_pbkdf2=__webpack_require__(74),pbkdf2=_pbkdf2.pbkdf2Sync,pbkdf2Async=_pbkdf2.pbkdf2,randomBytes=__webpack_require__(77),unorm=__webpack_require__(78),CHINESE_SIMPLIFIED_WORDLIST=__webpack_require__(79),CHINESE_TRADITIONAL_WORDLIST=__webpack_require__(80),ENGLISH_WORDLIST=__webpack_require__(81),FRENCH_WORDLIST=__webpack_require__(82),ITALIAN_WORDLIST=__webpack_require__(83),JAPANESE_WORDLIST=__webpack_require__(84),KOREAN_WORDLIST=__webpack_require__(85),SPANISH_WORDLIST=__webpack_require__(86),DEFAULT_WORDLIST=ENGLISH_WORDLIST,INVALID_MNEMONIC="Invalid mnemonic",INVALID_ENTROPY="Invalid entropy",INVALID_CHECKSUM="Invalid mnemonic checksum";function lpad(str,padString,length){for(;str.length>>0),p=this.head,i=0;p;)src=p.data,target=ret,offset=i,src.copy(target,offset),i+=p.data.length,p=p.next;return ret},BufferList}(),util&&util.inspect&&util.inspect.custom&&(module.exports.prototype[util.inspect.custom]=function(){var obj=util.inspect({length:this.length});return this.constructor.name+" "+obj})},function(module,exports){},function(module,exports,__webpack_require__){(function(global){function config(name){try{if(!global.localStorage)return!1}catch(_){return!1}var val=global.localStorage[name];return null!=val&&"true"===String(val).toLowerCase()}module.exports=function deprecate(fn,msg){if(config("noDeprecation"))return fn;var warned=!1;return function deprecated(){if(!warned){if(config("throwDeprecation"))throw new Error(msg);config("traceDeprecation")?console.trace(msg):console.warn(msg),warned=!0}return fn.apply(this,arguments)}}}).call(this,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";module.exports=PassThrough;var Transform=__webpack_require__(33),util=__webpack_require__(11);function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}util.inherits=__webpack_require__(1),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){module.exports=__webpack_require__(16)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(7)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(15).Transform},function(module,exports,__webpack_require__){module.exports=__webpack_require__(15).PassThrough},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);function Sha(){this.init(),this._w=W,Hash.call(this,64,56)}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}inherits(Sha,Hash),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha.prototype._update=function(M){for(var num,W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=W[i-3]^W[i-8]^W[i-14]^W[i-16];for(var j=0;j<80;++j){var s=~~(j/20),t=0|((num=a)<<5|num>>>27)+ft(s,b,c,d)+e+W[j]+K[s];e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha.prototype._hash=function(){var H=Buffer.allocUnsafe(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);function Sha1(){this.init(),this._w=W,Hash.call(this,64,56)}function rotl5(num){return num<<5|num>>>27}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}inherits(Sha1,Hash),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha1.prototype._update=function(M){for(var num,W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=(num=W[i-3]^W[i-8]^W[i-14]^W[i-16])<<1|num>>>31;for(var j=0;j<80;++j){var s=~~(j/20),t=rotl5(a)+ft(s,b,c,d)+e+W[j]+K[s]|0;e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha1.prototype._hash=function(){var H=Buffer.allocUnsafe(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha1},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),Sha256=__webpack_require__(36),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,W=new Array(64);function Sha224(){this.init(),this._w=W,Hash.call(this,64,56)}inherits(Sha224,Sha256),Sha224.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},Sha224.prototype._hash=function(){var H=Buffer.allocUnsafe(28);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H},module.exports=Sha224},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),SHA512=__webpack_require__(37),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,W=new Array(160);function Sha384(){this.init(),this._w=W,Hash.call(this,128,112)}inherits(Sha384,SHA512),Sha384.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},Sha384.prototype._hash=function(){var H=Buffer.allocUnsafe(48);function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),H},module.exports=Sha384},function(module,exports,__webpack_require__){var Buffer=__webpack_require__(0).Buffer,Transform=__webpack_require__(29).Transform,StringDecoder=__webpack_require__(17).StringDecoder;function CipherBase(hashMode){Transform.call(this),this.hashMode="string"==typeof hashMode,this.hashMode?this[hashMode]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}__webpack_require__(1)(CipherBase,Transform),CipherBase.prototype.update=function(data,inputEnc,outputEnc){"string"==typeof data&&(data=Buffer.from(data,inputEnc));var outData=this._update(data);return this.hashMode?this:(outputEnc&&(outData=this._toString(outData,outputEnc)),outData)},CipherBase.prototype.setAutoPadding=function(){},CipherBase.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},CipherBase.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},CipherBase.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},CipherBase.prototype._transform=function(data,_,next){var err;try{this.hashMode?this._update(data):this.push(this._update(data))}catch(e){err=e}finally{next(err)}},CipherBase.prototype._flush=function(done){var err;try{this.push(this.__final())}catch(e){err=e}done(err)},CipherBase.prototype._finalOrDigest=function(outputEnc){var outData=this.__final()||Buffer.alloc(0);return outputEnc&&(outData=this._toString(outData,outputEnc,!0)),outData},CipherBase.prototype._toString=function(value,enc,fin){if(this._decoder||(this._decoder=new StringDecoder(enc),this._encoding=enc),this._encoding!==enc)throw new Error("can't switch encodings");var out=this._decoder.write(value);return fin&&(out+=this._decoder.end()),out},module.exports=CipherBase},function(module,exports,__webpack_require__){exports.pbkdf2=__webpack_require__(75),exports.pbkdf2Sync=__webpack_require__(40)},function(module,exports,__webpack_require__){(function(global,process){var ZERO_BUF,checkParameters=__webpack_require__(38),defaultEncoding=__webpack_require__(39),sync=__webpack_require__(40),Buffer=__webpack_require__(0).Buffer,subtle=global.crypto&&global.crypto.subtle,toBrowser={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},checks=[];function browserPbkdf2(password,salt,iterations,length,algo){return subtle.importKey("raw",password,{name:"PBKDF2"},!1,["deriveBits"]).then(function(key){return subtle.deriveBits({name:"PBKDF2",salt:salt,iterations:iterations,hash:{name:algo}},key,length<<3)}).then(function(res){return Buffer.from(res)})}module.exports=function(password,salt,iterations,keylen,digest,callback){"function"==typeof digest&&(callback=digest,digest=void 0);var algo=toBrowser[(digest=digest||"sha1").toLowerCase()];if(!algo||"function"!=typeof global.Promise)return process.nextTick(function(){var out;try{out=sync(password,salt,iterations,keylen,digest)}catch(e){return callback(e)}callback(null,out)});if(checkParameters(password,salt,iterations,keylen),"function"!=typeof callback)throw new Error("No callback provided to pbkdf2");Buffer.isBuffer(password)||(password=Buffer.from(password,defaultEncoding)),Buffer.isBuffer(salt)||(salt=Buffer.from(salt,defaultEncoding)),function resolvePromise(promise,callback){promise.then(function(out){process.nextTick(function(){callback(null,out)})},function(e){process.nextTick(function(){callback(e)})})}(function checkNative(algo){if(global.process&&!global.process.browser)return Promise.resolve(!1);if(!subtle||!subtle.importKey||!subtle.deriveBits)return Promise.resolve(!1);if(void 0!==checks[algo])return checks[algo];var prom=browserPbkdf2(ZERO_BUF=ZERO_BUF||Buffer.alloc(8),ZERO_BUF,10,128,algo).then(function(){return!0}).catch(function(){return!1});return checks[algo]=prom}(algo).then(function(resp){return resp?browserPbkdf2(password,salt,iterations,keylen,algo):sync(password,salt,iterations,keylen,digest)}),callback)}}).call(this,__webpack_require__(5),__webpack_require__(4))},function(module,exports,__webpack_require__){var MD5=__webpack_require__(27);module.exports=function(buffer){return(new MD5).update(buffer).digest()}},function(module,exports,__webpack_require__){"use strict";(function(global,process){var Buffer=__webpack_require__(0).Buffer,crypto=global.crypto||global.msCrypto;crypto&&crypto.getRandomValues?module.exports=function randomBytes(size,cb){if(4294967295>8&255]&&(cache[cp]=ret),ret},function fromCpOnly(next,cp,needFeature){return needFeature?next(cp,needFeature):new UChar(cp,null)},function fromRuleBasedJamo(next,cp,needFeature){var j;if(cp<4352||4371<=cp&&cp<44032||55204>6:(code<55296||57344<=code?bytes[index++]=224|code>>12:(code=65536+((1023&code)<<10|1023&key.charCodeAt(++i)),bytes[index++]=240|code>>18,bytes[index++]=128|code>>12&63),bytes[index++]=128|code>>6&63),bytes[index++]=128|63&code);key=bytes}else{if("object"!=type)throw new Error(ERROR);if(null===key)throw new Error(ERROR);if(ARRAY_BUFFER&&key.constructor===ArrayBuffer)key=new Uint8Array(key);else if(!(Array.isArray(key)||ARRAY_BUFFER&&ArrayBuffer.isView(key)))throw new Error(ERROR)}64>2]|=message[index]<>2]|=code<>2]|=(192|code>>6)<>2]|=(224|code>>12)<>2]|=(240|code>>18)<>2]|=(128|code>>12&63)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=EXTRA[3&i],this.block=blocks[16],56<=i&&(this.hashed||this.hash(),blocks[0]=this.block,blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0),blocks[14]=this.hBytes<<3|this.bytes>>>29,blocks[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var j,s0,s1,maj,t1,ab,da,cd,bc,a=this.h0,b=this.h1,c=this.h2,d=this.h3,e=this.h4,f=this.h5,g=this.h6,h=this.h7,blocks=this.blocks;for(j=16;j<64;++j)s0=((t1=blocks[j-15])>>>7|t1<<25)^(t1>>>18|t1<<14)^t1>>>3,s1=((t1=blocks[j-2])>>>17|t1<<15)^(t1>>>19|t1<<13)^t1>>>10,blocks[j]=blocks[j-16]+s0+blocks[j-7]+s1<<0;for(bc=b&c,j=0;j<64;j+=4)this.first?(d=this.is224?(ab=300032,h=(t1=blocks[0]-1413257819)-150054599<<0,t1+24177077<<0):(ab=704751109,h=(t1=blocks[0]-210244248)-1521486534<<0,t1+143694565<<0),this.first=!1):(s0=(a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10),maj=(ab=a&b)^a&c^bc,h=d+(t1=h+(s1=(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7))+(e&f^~e&g)+K[j]+blocks[j])<<0,d=t1+(s0+maj)<<0),s0=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),maj=(da=d&a)^d&b^ab,g=c+(t1=g+(s1=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&e^~h&f)+K[j+1]+blocks[j+1])<<0,s0=((c=t1+(s0+maj)<<0)>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),maj=(cd=c&d)^c&a^da,f=b+(t1=f+(s1=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&h^~g&e)+K[j+2]+blocks[j+2])<<0,s0=((b=t1+(s0+maj)<<0)>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10),maj=(bc=b&c)^b&d^cd,e=a+(t1=e+(s1=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&g^~f&h)+K[j+3]+blocks[j+3])<<0,a=t1+(s0+maj)<<0;this.h0=this.h0+a<<0,this.h1=this.h1+b<<0,this.h2=this.h2+c<<0,this.h3=this.h3+d<<0,this.h4=this.h4+e<<0,this.h5=this.h5+f<<0,this.h6=this.h6+g<<0,this.h7=this.h7+h<<0},Sha256.prototype.hex=function(){this.finalize();var h0=this.h0,h1=this.h1,h2=this.h2,h3=this.h3,h4=this.h4,h5=this.h5,h6=this.h6,h7=this.h7,hex=HEX_CHARS[h0>>28&15]+HEX_CHARS[h0>>24&15]+HEX_CHARS[h0>>20&15]+HEX_CHARS[h0>>16&15]+HEX_CHARS[h0>>12&15]+HEX_CHARS[h0>>8&15]+HEX_CHARS[h0>>4&15]+HEX_CHARS[15&h0]+HEX_CHARS[h1>>28&15]+HEX_CHARS[h1>>24&15]+HEX_CHARS[h1>>20&15]+HEX_CHARS[h1>>16&15]+HEX_CHARS[h1>>12&15]+HEX_CHARS[h1>>8&15]+HEX_CHARS[h1>>4&15]+HEX_CHARS[15&h1]+HEX_CHARS[h2>>28&15]+HEX_CHARS[h2>>24&15]+HEX_CHARS[h2>>20&15]+HEX_CHARS[h2>>16&15]+HEX_CHARS[h2>>12&15]+HEX_CHARS[h2>>8&15]+HEX_CHARS[h2>>4&15]+HEX_CHARS[15&h2]+HEX_CHARS[h3>>28&15]+HEX_CHARS[h3>>24&15]+HEX_CHARS[h3>>20&15]+HEX_CHARS[h3>>16&15]+HEX_CHARS[h3>>12&15]+HEX_CHARS[h3>>8&15]+HEX_CHARS[h3>>4&15]+HEX_CHARS[15&h3]+HEX_CHARS[h4>>28&15]+HEX_CHARS[h4>>24&15]+HEX_CHARS[h4>>20&15]+HEX_CHARS[h4>>16&15]+HEX_CHARS[h4>>12&15]+HEX_CHARS[h4>>8&15]+HEX_CHARS[h4>>4&15]+HEX_CHARS[15&h4]+HEX_CHARS[h5>>28&15]+HEX_CHARS[h5>>24&15]+HEX_CHARS[h5>>20&15]+HEX_CHARS[h5>>16&15]+HEX_CHARS[h5>>12&15]+HEX_CHARS[h5>>8&15]+HEX_CHARS[h5>>4&15]+HEX_CHARS[15&h5]+HEX_CHARS[h6>>28&15]+HEX_CHARS[h6>>24&15]+HEX_CHARS[h6>>20&15]+HEX_CHARS[h6>>16&15]+HEX_CHARS[h6>>12&15]+HEX_CHARS[h6>>8&15]+HEX_CHARS[h6>>4&15]+HEX_CHARS[15&h6];return this.is224||(hex+=HEX_CHARS[h7>>28&15]+HEX_CHARS[h7>>24&15]+HEX_CHARS[h7>>20&15]+HEX_CHARS[h7>>16&15]+HEX_CHARS[h7>>12&15]+HEX_CHARS[h7>>8&15]+HEX_CHARS[h7>>4&15]+HEX_CHARS[15&h7]),hex},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var h0=this.h0,h1=this.h1,h2=this.h2,h3=this.h3,h4=this.h4,h5=this.h5,h6=this.h6,h7=this.h7,arr=[h0>>24&255,h0>>16&255,h0>>8&255,255&h0,h1>>24&255,h1>>16&255,h1>>8&255,255&h1,h2>>24&255,h2>>16&255,h2>>8&255,255&h2,h3>>24&255,h3>>16&255,h3>>8&255,255&h3,h4>>24&255,h4>>16&255,h4>>8&255,255&h4,h5>>24&255,h5>>16&255,h5>>8&255,255&h5,h6>>24&255,h6>>16&255,h6>>8&255,255&h6];return this.is224||arr.push(h7>>24&255,h7>>16&255,h7>>8&255,255&h7),arr},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var buffer=new ArrayBuffer(this.is224?28:32),dataView=new DataView(buffer);return dataView.setUint32(0,this.h0),dataView.setUint32(4,this.h1),dataView.setUint32(8,this.h2),dataView.setUint32(12,this.h3),dataView.setUint32(16,this.h4),dataView.setUint32(20,this.h5),dataView.setUint32(24,this.h6),this.is224||dataView.setUint32(28,this.h7),buffer},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var innerHash=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(innerHash),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}()}).call(this,__webpack_require__(4),__webpack_require__(6))},function(module,exports,__webpack_require__){"use strict";var inherits=__webpack_require__(1),HashBase=__webpack_require__(28),Buffer=__webpack_require__(0).Buffer,ARRAY16=new Array(16);function MD5(){HashBase.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function rotl(x,n){return x<>>32-n}function fnF(a,b,c,d,m,k,s){return rotl(a+(b&c|~b&d)+m+k|0,s)+b|0}function fnG(a,b,c,d,m,k,s){return rotl(a+(b&d|c&~d)+m+k|0,s)+b|0}function fnH(a,b,c,d,m,k,s){return rotl(a+(b^c^d)+m+k|0,s)+b|0}function fnI(a,b,c,d,m,k,s){return rotl(a+(c^(b|~d))+m+k|0,s)+b|0}inherits(MD5,HashBase),MD5.prototype._update=function(){for(var M=ARRAY16,i=0;i<16;++i)M[i]=this._block.readInt32LE(4*i);var a=this._a,b=this._b,c=this._c,d=this._d;b=fnI(b=fnI(b=fnI(b=fnI(b=fnH(b=fnH(b=fnH(b=fnH(b=fnG(b=fnG(b=fnG(b=fnG(b=fnF(b=fnF(b=fnF(b=fnF(b,c=fnF(c,d=fnF(d,a=fnF(a,b,c,d,M[0],3614090360,7),b,c,M[1],3905402710,12),a,b,M[2],606105819,17),d,a,M[3],3250441966,22),c=fnF(c,d=fnF(d,a=fnF(a,b,c,d,M[4],4118548399,7),b,c,M[5],1200080426,12),a,b,M[6],2821735955,17),d,a,M[7],4249261313,22),c=fnF(c,d=fnF(d,a=fnF(a,b,c,d,M[8],1770035416,7),b,c,M[9],2336552879,12),a,b,M[10],4294925233,17),d,a,M[11],2304563134,22),c=fnF(c,d=fnF(d,a=fnF(a,b,c,d,M[12],1804603682,7),b,c,M[13],4254626195,12),a,b,M[14],2792965006,17),d,a,M[15],1236535329,22),c=fnG(c,d=fnG(d,a=fnG(a,b,c,d,M[1],4129170786,5),b,c,M[6],3225465664,9),a,b,M[11],643717713,14),d,a,M[0],3921069994,20),c=fnG(c,d=fnG(d,a=fnG(a,b,c,d,M[5],3593408605,5),b,c,M[10],38016083,9),a,b,M[15],3634488961,14),d,a,M[4],3889429448,20),c=fnG(c,d=fnG(d,a=fnG(a,b,c,d,M[9],568446438,5),b,c,M[14],3275163606,9),a,b,M[3],4107603335,14),d,a,M[8],1163531501,20),c=fnG(c,d=fnG(d,a=fnG(a,b,c,d,M[13],2850285829,5),b,c,M[2],4243563512,9),a,b,M[7],1735328473,14),d,a,M[12],2368359562,20),c=fnH(c,d=fnH(d,a=fnH(a,b,c,d,M[5],4294588738,4),b,c,M[8],2272392833,11),a,b,M[11],1839030562,16),d,a,M[14],4259657740,23),c=fnH(c,d=fnH(d,a=fnH(a,b,c,d,M[1],2763975236,4),b,c,M[4],1272893353,11),a,b,M[7],4139469664,16),d,a,M[10],3200236656,23),c=fnH(c,d=fnH(d,a=fnH(a,b,c,d,M[13],681279174,4),b,c,M[0],3936430074,11),a,b,M[3],3572445317,16),d,a,M[6],76029189,23),c=fnH(c,d=fnH(d,a=fnH(a,b,c,d,M[9],3654602809,4),b,c,M[12],3873151461,11),a,b,M[15],530742520,16),d,a,M[2],3299628645,23),c=fnI(c,d=fnI(d,a=fnI(a,b,c,d,M[0],4096336452,6),b,c,M[7],1126891415,10),a,b,M[14],2878612391,15),d,a,M[5],4237533241,21),c=fnI(c,d=fnI(d,a=fnI(a,b,c,d,M[12],1700485571,6),b,c,M[3],2399980690,10),a,b,M[10],4293915773,15),d,a,M[1],2240044497,21),c=fnI(c,d=fnI(d,a=fnI(a,b,c,d,M[8],1873313359,6),b,c,M[15],4264355552,10),a,b,M[6],2734768916,15),d,a,M[13],1309151649,21),c=fnI(c,d=fnI(d,a=fnI(a,b,c,d,M[4],4149444226,6),b,c,M[11],3174756917,10),a,b,M[2],718787259,15),d,a,M[9],3951481745,21),this._a=this._a+a|0,this._b=this._b+b|0,this._c=this._c+c|0,this._d=this._d+d|0},MD5.prototype._digest=function(){this._block[this._blockOffset++]=128,56=this._blockSize;){for(var i=this._blockOffset;istate.highWaterMark&&(state.highWaterMark=function computeNewHighWaterMark(n){return MAX_HWM<=n?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?pna.nextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,pna.nextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=function fromListPartial(n,list,hasStrings){var ret;nstr.length?str.length:n;if(nb===str.length?ret+=str:ret+=str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p).data=str.slice(nb);break}++c}return list.length-=c,ret}(n,list):function copyFromBuffer(n,list){var ret=Buffer.allocUnsafe(n),p=list.head,c=1;p.data.copy(ret),n-=p.data.length;for(;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p).data=buf.slice(nb);break}++c}return list.length-=c,ret}(n,list);return ret}(n,state.buffer,state.decoder),ret);var ret}function endReadable(stream){var state=stream._readableState;if(0=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var ret,doRead=state.needReadable;return debug("need readable",doRead),(0===state.length||state.length-n>>32-n}function fn1(a,b,c,d,e,m,k,s){return rotl(a+(b^c^d)+m+k|0,s)+e|0}function fn2(a,b,c,d,e,m,k,s){return rotl(a+(b&c|~b&d)+m+k|0,s)+e|0}function fn3(a,b,c,d,e,m,k,s){return rotl(a+((b|~c)^d)+m+k|0,s)+e|0}function fn4(a,b,c,d,e,m,k,s){return rotl(a+(b&d|c&~d)+m+k|0,s)+e|0}function fn5(a,b,c,d,e,m,k,s){return rotl(a+(b^(c|~d))+m+k|0,s)+e|0}inherits(RIPEMD160,HashBase),RIPEMD160.prototype._update=function(){for(var words=ARRAY16,j=0;j<16;++j)words[j]=this._block.readInt32LE(4*j);for(var al=0|this._a,bl=0|this._b,cl=0|this._c,dl=0|this._d,el=0|this._e,ar=0|this._a,br=0|this._b,cr=0|this._c,dr=0|this._d,er=0|this._e,i=0;i<80;i+=1){var tl,tr;tr=i<16?(tl=fn1(al,bl,cl,dl,el,words[zl[i]],hl[0],sl[i]),fn5(ar,br,cr,dr,er,words[zr[i]],hr[0],sr[i])):i<32?(tl=fn2(al,bl,cl,dl,el,words[zl[i]],hl[1],sl[i]),fn4(ar,br,cr,dr,er,words[zr[i]],hr[1],sr[i])):i<48?(tl=fn3(al,bl,cl,dl,el,words[zl[i]],hl[2],sl[i]),fn3(ar,br,cr,dr,er,words[zr[i]],hr[2],sr[i])):i<64?(tl=fn4(al,bl,cl,dl,el,words[zl[i]],hl[3],sl[i]),fn2(ar,br,cr,dr,er,words[zr[i]],hr[3],sr[i])):(tl=fn5(al,bl,cl,dl,el,words[zl[i]],hl[4],sl[i]),fn1(ar,br,cr,dr,er,words[zr[i]],hr[4],sr[i])),al=el,el=dl,dl=rotl(cl,10),cl=bl,bl=tl,ar=er,er=dr,dr=rotl(cr,10),cr=br,br=tr}var t=this._b+cl+dr|0;this._b=this._c+dl+er|0,this._c=this._d+el+ar|0,this._d=this._e+al+br|0,this._e=this._a+bl+cr|0,this._a=t},RIPEMD160.prototype._digest=function(){this._block[this._blockOffset++]=128,56>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10)}function sigma1(x){return(x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7)}function gamma0(x){return(x>>>7|x<<25)^(x>>>18|x<<14)^x>>>3}inherits(Sha256,Hash),Sha256.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},Sha256.prototype._update=function(M){for(var x,W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,f=0|this._f,g=0|this._g,h=0|this._h,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<64;++i)W[i]=0|(((x=W[i-2])>>>17|x<<15)^(x>>>19|x<<13)^x>>>10)+W[i-7]+gamma0(W[i-15])+W[i-16];for(var j=0;j<64;++j){var T1=h+sigma1(e)+ch(e,f,g)+K[j]+W[j]|0,T2=sigma0(a)+maj(a,b,c)|0;h=g,g=f,f=e,e=d+T1|0,d=c,c=b,b=a,a=T1+T2|0}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0,this._f=f+this._f|0,this._g=g+this._g|0,this._h=h+this._h|0},Sha256.prototype._hash=function(){var H=Buffer.allocUnsafe(32);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H.writeInt32BE(this._h,28),H},module.exports=Sha256},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,K=[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],W=new Array(160);function Sha512(){this.init(),this._w=W,Hash.call(this,128,112)}function Ch(x,y,z){return z^x&(y^z)}function maj(x,y,z){return x&y|z&(x|y)}function sigma0(x,xl){return(x>>>28|xl<<4)^(xl>>>2|x<<30)^(xl>>>7|x<<25)}function sigma1(x,xl){return(x>>>14|xl<<18)^(x>>>18|xl<<14)^(xl>>>9|x<<23)}function Gamma0(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^x>>>7}function Gamma0l(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^(x>>>7|xl<<25)}function Gamma1(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^x>>>6}function Gamma1l(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^(x>>>6|xl<<26)}function getCarry(a,b){return a>>>0>>0?1:0}inherits(Sha512,Hash),Sha512.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},Sha512.prototype._update=function(M){for(var W=this._w,ah=0|this._ah,bh=0|this._bh,ch=0|this._ch,dh=0|this._dh,eh=0|this._eh,fh=0|this._fh,gh=0|this._gh,hh=0|this._hh,al=0|this._al,bl=0|this._bl,cl=0|this._cl,dl=0|this._dl,el=0|this._el,fl=0|this._fl,gl=0|this._gl,hl=0|this._hl,i=0;i<32;i+=2)W[i]=M.readInt32BE(4*i),W[i+1]=M.readInt32BE(4*i+4);for(;i<160;i+=2){var xh=W[i-30],xl=W[i-30+1],gamma0=Gamma0(xh,xl),gamma0l=Gamma0l(xl,xh),gamma1=Gamma1(xh=W[i-4],xl=W[i-4+1]),gamma1l=Gamma1l(xl,xh),Wi7h=W[i-14],Wi7l=W[i-14+1],Wi16h=W[i-32],Wi16l=W[i-32+1],Wil=gamma0l+Wi7l|0,Wih=gamma0+Wi7h+getCarry(Wil,gamma0l)|0;Wih=(Wih=Wih+gamma1+getCarry(Wil=Wil+gamma1l|0,gamma1l)|0)+Wi16h+getCarry(Wil=Wil+Wi16l|0,Wi16l)|0,W[i]=Wih,W[i+1]=Wil}for(var j=0;j<160;j+=2){Wih=W[j],Wil=W[j+1];var majh=maj(ah,bh,ch),majl=maj(al,bl,cl),sigma0h=sigma0(ah,al),sigma0l=sigma0(al,ah),sigma1h=sigma1(eh,el),sigma1l=sigma1(el,eh),Kih=K[j],Kil=K[j+1],chh=Ch(eh,fh,gh),chl=Ch(el,fl,gl),t1l=hl+sigma1l|0,t1h=hh+sigma1h+getCarry(t1l,hl)|0;t1h=(t1h=(t1h=t1h+chh+getCarry(t1l=t1l+chl|0,chl)|0)+Kih+getCarry(t1l=t1l+Kil|0,Kil)|0)+Wih+getCarry(t1l=t1l+Wil|0,Wil)|0;var t2l=sigma0l+majl|0,t2h=sigma0h+majh+getCarry(t2l,sigma0l)|0;hh=gh,hl=gl,gh=fh,gl=fl,fh=eh,fl=el,eh=dh+t1h+getCarry(el=dl+t1l|0,dl)|0,dh=ch,dl=cl,ch=bh,cl=bl,bh=ah,bl=al,ah=t1h+t2h+getCarry(al=t1l+t2l|0,t1l)|0}this._al=this._al+al|0,this._bl=this._bl+bl|0,this._cl=this._cl+cl|0,this._dl=this._dl+dl|0,this._el=this._el+el|0,this._fl=this._fl+fl|0,this._gl=this._gl+gl|0,this._hl=this._hl+hl|0,this._ah=this._ah+ah+getCarry(this._al,al)|0,this._bh=this._bh+bh+getCarry(this._bl,bl)|0,this._ch=this._ch+ch+getCarry(this._cl,cl)|0,this._dh=this._dh+dh+getCarry(this._dl,dl)|0,this._eh=this._eh+eh+getCarry(this._el,el)|0,this._fh=this._fh+fh+getCarry(this._fl,fl)|0,this._gh=this._gh+gh+getCarry(this._gl,gl)|0,this._hh=this._hh+hh+getCarry(this._hl,hl)|0},Sha512.prototype._hash=function(){var H=Buffer.allocUnsafe(64);function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),writeInt64BE(this._gh,this._gl,48),writeInt64BE(this._hh,this._hl,56),H},module.exports=Sha512},function(module,exports,__webpack_require__){(function(Buffer){var MAX_ALLOC=Math.pow(2,30)-1;function checkBuffer(buf,name){if("string"!=typeof buf&&!Buffer.isBuffer(buf))throw new TypeError(name+" must be a buffer or string")}module.exports=function(password,salt,iterations,keylen){if(checkBuffer(password,"Password"),checkBuffer(salt,"Salt"),"number"!=typeof iterations)throw new TypeError("Iterations not a number");if(iterations<0)throw new TypeError("Bad iterations");if("number"!=typeof keylen)throw new TypeError("Key length not a number");if(keylen<0||MAX_ALLOCblocksize?key=hash(key):key.length=Utils.MaxSecond)throw new RangeError("Second have to be >= "+Utils.MinSecond+", and <: "+Utils.MaxSecond);data=encodeFieldNumberAndType(1,WireMap[Types.Time]).concat(encodeUVarint(s))}return data}var varint=__webpack_require__(20),svarint=__webpack_require__(48),Int53=__webpack_require__(49),Buffer=(__webpack_require__(118),__webpack_require__(0).Buffer),Utils=__webpack_require__(9),_require2=__webpack_require__(3),Types=_require2.Types,WireMap=(_require2.WireType,_require2.WireMap),encodeFieldNumberAndType=function encodeFieldNumberAndType(num,type){var encodedVal=num<<3|type;return varint.encode(encodedVal)};if(module.exports={encodeSignedVarint:encodeSignedVarint,encodeFieldNumberAndType:encodeFieldNumberAndType,encodeString:function encodeString(input){return encodeSlice(Array.from(Buffer.from(input)))},encodeInt8:function encodeInt8(input){return encodeSignedVarint(input)},encodeInt16:function encodeInt16(input){return encodeSignedVarint(input)},encodeInt32:function encodeInt32(input){var buffer=new ArrayBuffer(4);return new DataView(buffer).setUint32(0,input,!0),Array.from(new Uint8Array(buffer))},encodeInt64:function encodeInt64(input){var buff=Buffer(8);return Int53.writeInt64LE(input,buff,0),Array.from(new Int32Array(buff))},encodeSlice:encodeSlice,encodeBoolean:function encodeBoolean(input){return encodeUint8(input?1:0)},encodeUVarint:encodeUVarint,encodeTime:encodeTime},__webpack_require__.c[__webpack_require__.s]==module){var result=encodeTime(new Date("01 Dec 2018 00:12:00 GMT"));console.log(result)}}).call(this,__webpack_require__(13)(module))},function(module,exports,__webpack_require__){var varint=__webpack_require__(20);exports.encode=function encode(v,b,o){v=0<=v?2*v:-2*v-1;var r=varint.encode(v,b,o);return encode.bytes=varint.encode.bytes,r},exports.decode=function decode(b,o){var v=varint.decode(b,o);return decode.bytes=varint.decode.bytes,1&v?(v+1)/-2:v/2},exports.encodingLength=function(v){return varint.encodingLength(0<=v?2*v:-2*v-1)}},function(module,exports){var int53={},MAX_UINT32=4294967295,MAX_INT53=9007199254740991;function onesComplement(number){return(number=~number)<0&&(number=2147483648+(2147483647&number)),number}function uintHighLow(number){console.assert(-1Number.MaxInt8)throw new TypeError("EOF decoding int8");return{data:Int8Array.from([result.data])[0],byteLength:result.byteLength}},decodeInt16:function decodeInt16(input){var result=decodeSignedVarint(input);if(result.data>Number.MaxInt16)throw new TypeError("EOF decoding int8");return{data:new Int16Array.from([result])[0],byteLength:result.byteLength}},decodeInt64:function decodeInt64(input){var buf=Buffer.from(input.slice(0,8));return{data:Int53.readInt64LE(buf,0),byteLength:8}},decodeString:function decodeString(input){var decodedSlice=decodeSlice(input);return{data:Buffer.from(decodedSlice.data).toString("utf8"),byteLength:decodedSlice.byteLength}},decodeFieldNumberAndType:function decodeFieldNumberAndType(bz){var decodedData=decodeUVarint(bz),wiretypeNumber=7&decodedData.data,idx=decodedData.data>>3;if(536870911>25;return(33554431&pre)<<5^996825010&-(b>>0&1)^642813549&-(b>>1&1)^513874426&-(b>>2&1)^1027748829&-(b>>3&1)^705979059&-(b>>4&1)}function prefixChk(prefix){for(var chk=1,i=0;i>5}for(chk=polymodStep(chk),i=0;i>bits&maxV);if(pad)0LIMIT)throw new TypeError("Exceeds length limit");var lowered=str.toLowerCase(),uppered=str.toUpperCase();if(str!==lowered&&str!==uppered)throw new Error("Mixed-case string "+str);var split=(str=lowered).lastIndexOf("1");if(-1===split)throw new Error("No separator character for "+str);if(0===split)throw new Error("Missing prefix for "+str);var prefix=str.slice(0,split),wordChars=str.slice(split+1);if(wordChars.length<6)throw new Error("Data too short");for(var chk=prefixChk(prefix),words=[],i=0;i=wordChars.length||words.push(v)}if(1!==chk)throw new Error("Invalid checksum for "+str);return{prefix:prefix,words:words}},encode:function encode(prefix,words,LIMIT){if(LIMIT=LIMIT||90,prefix.length+7+words.length>LIMIT)throw new TypeError("Exceeds length limit");for(var chk=prefixChk(prefix=prefix.toLowerCase()),result=prefix+"1",i=0;i>5!=0)throw new Error("Non 5-bit word");chk=polymodStep(chk)^x,result+=ALPHABET.charAt(x)}for(i=0;i<6;++i)chk=polymodStep(chk);for(chk^=1,i=0;i<6;++i){result+=ALPHABET.charAt(chk>>5*(5-i)&31)}return result},toWords:function toWords(bytes){return convert(bytes,8,5,!0)},fromWords:function fromWords(words){return convert(words,5,8,!1)}}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),function(module){var global,_src_index__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(21),_src_index__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_src_index__WEBPACK_IMPORTED_MODULE_0__);global="undefined"!=typeof window?window:void 0,"object"==typeof module.exports?module.exports=_src_index__WEBPACK_IMPORTED_MODULE_0___default.a:global.QWeb=_src_index__WEBPACK_IMPORTED_MODULE_0___default.a}.call(this,__webpack_require__(53)(module))},function(module,exports){module.exports=function(originalModule){if(!originalModule.webpackPolyfill){var module=Object.create(originalModule);module.children||(module.children=[]),Object.defineProperty(module,"loaded",{enumerable:!0,get:function(){return module.l}}),Object.defineProperty(module,"id",{enumerable:!0,get:function(){return module.i}}),Object.defineProperty(module,"exports",{enumerable:!0}),module.webpackPolyfill=1}return module}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor};function defineProperties(target,props){for(var i=0;i>16&255,arr[curByte++]=tmp>>8&255,arr[curByte++]=255&tmp;2===placeHoldersLen&&(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[curByte++]=255&tmp);1===placeHoldersLen&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[curByte++]=tmp>>8&255,arr[curByte++]=255&tmp);return arr},exports.fromByteArray=function fromByteArray(uint8){for(var tmp,len=uint8.length,extraBytes=len%3,parts=[],i=0,len2=len-extraBytes;i>2]+lookup[tmp<<4&63]+"==")):2==extraBytes&&(tmp=(uint8[len-2]<<8)+uint8[len-1],parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"="));return parts.join("")};for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[63&num]);return output.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63},function(module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=8*nBytes-mLen-1,eMax=(1<>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;0>=-nBits,nBits+=mLen;0>1,rt=23===mLen?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||0===value&&1/value<0?1:0;for(value=Math.abs(value),isNaN(value)||value===1/0?(m=isNaN(value)?1:0,e=eMax):(e=Math.floor(Math.log(value)/Math.LN2),value*(c=Math.pow(2,-e))<1&&(e--,c*=2),2<=(value+=1<=e+eBias?rt/c:rt*Math.pow(2,1-eBias))*c&&(e++,c/=2),eMax<=e+eBias?(m=0,e=eMax):1<=e+eBias?(m=(value*c-1)*Math.pow(2,mLen),e+=eBias):(m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen),e=0));8<=mLen;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<>>0),p=this.head,i=0;p;)src=p.data,target=ret,offset=i,src.copy(target,offset),i+=p.data.length,p=p.next;return ret},BufferList),util&&util.inspect&&util.inspect.custom&&(module.exports.prototype[util.inspect.custom]=function(){var obj=util.inspect({length:this.length});return this.constructor.name+" "+obj})},function(module,exports){},function(module,exports,__webpack_require__){(function(global){function config(name){try{if(!global.localStorage)return!1}catch(_){return!1}var val=global.localStorage[name];return null!=val&&"true"===String(val).toLowerCase()}module.exports=function deprecate(fn,msg){if(config("noDeprecation"))return fn;var warned=!1;return function deprecated(){if(!warned){if(config("throwDeprecation"))throw new Error(msg);config("traceDeprecation")?console.trace(msg):console.warn(msg),warned=!0}return fn.apply(this,arguments)}}}).call(this,__webpack_require__(6))},function(module,exports,__webpack_require__){"use strict";module.exports=PassThrough;var Transform=__webpack_require__(33),util=__webpack_require__(11);function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}util.inherits=__webpack_require__(1),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){module.exports=__webpack_require__(16)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(7)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(15).Transform},function(module,exports,__webpack_require__){module.exports=__webpack_require__(15).PassThrough},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);function Sha(){this.init(),this._w=W,Hash.call(this,64,56)}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}inherits(Sha,Hash),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha.prototype._update=function(M){for(var num,W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=W[i-3]^W[i-8]^W[i-14]^W[i-16];for(var j=0;j<80;++j){var s=~~(j/20),t=0|((num=a)<<5|num>>>27)+ft(s,b,c,d)+e+W[j]+K[s];e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha.prototype._hash=function(){var H=Buffer.allocUnsafe(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);function Sha1(){this.init(),this._w=W,Hash.call(this,64,56)}function rotl5(num){return num<<5|num>>>27}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}inherits(Sha1,Hash),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha1.prototype._update=function(M){for(var num,W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=(num=W[i-3]^W[i-8]^W[i-14]^W[i-16])<<1|num>>>31;for(var j=0;j<80;++j){var s=~~(j/20),t=rotl5(a)+ft(s,b,c,d)+e+W[j]+K[s]|0;e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha1.prototype._hash=function(){var H=Buffer.allocUnsafe(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha1},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),Sha256=__webpack_require__(36),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,W=new Array(64);function Sha224(){this.init(),this._w=W,Hash.call(this,64,56)}inherits(Sha224,Sha256),Sha224.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},Sha224.prototype._hash=function(){var H=Buffer.allocUnsafe(28);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H},module.exports=Sha224},function(module,exports,__webpack_require__){var inherits=__webpack_require__(1),SHA512=__webpack_require__(37),Hash=__webpack_require__(8),Buffer=__webpack_require__(0).Buffer,W=new Array(160);function Sha384(){this.init(),this._w=W,Hash.call(this,128,112)}inherits(Sha384,SHA512),Sha384.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},Sha384.prototype._hash=function(){var H=Buffer.allocUnsafe(48);function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),H},module.exports=Sha384},function(module,exports,__webpack_require__){var Buffer=__webpack_require__(0).Buffer,Transform=__webpack_require__(29).Transform,StringDecoder=__webpack_require__(17).StringDecoder;function CipherBase(hashMode){Transform.call(this),this.hashMode="string"==typeof hashMode,this.hashMode?this[hashMode]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}__webpack_require__(1)(CipherBase,Transform),CipherBase.prototype.update=function(data,inputEnc,outputEnc){"string"==typeof data&&(data=Buffer.from(data,inputEnc));var outData=this._update(data);return this.hashMode?this:(outputEnc&&(outData=this._toString(outData,outputEnc)),outData)},CipherBase.prototype.setAutoPadding=function(){},CipherBase.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},CipherBase.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},CipherBase.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},CipherBase.prototype._transform=function(data,_,next){var err;try{this.hashMode?this._update(data):this.push(this._update(data))}catch(e){err=e}finally{next(err)}},CipherBase.prototype._flush=function(done){var err;try{this.push(this.__final())}catch(e){err=e}done(err)},CipherBase.prototype._finalOrDigest=function(outputEnc){var outData=this.__final()||Buffer.alloc(0);return outputEnc&&(outData=this._toString(outData,outputEnc,!0)),outData},CipherBase.prototype._toString=function(value,enc,fin){if(this._decoder||(this._decoder=new StringDecoder(enc),this._encoding=enc),this._encoding!==enc)throw new Error("can't switch encodings");var out=this._decoder.write(value);return fin&&(out+=this._decoder.end()),out},module.exports=CipherBase},function(module,exports,__webpack_require__){exports.pbkdf2=__webpack_require__(75),exports.pbkdf2Sync=__webpack_require__(40)},function(module,exports,__webpack_require__){(function(global,process){var ZERO_BUF,checkParameters=__webpack_require__(38),defaultEncoding=__webpack_require__(39),sync=__webpack_require__(40),Buffer=__webpack_require__(0).Buffer,subtle=global.crypto&&global.crypto.subtle,toBrowser={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},checks=[];function browserPbkdf2(password,salt,iterations,length,algo){return subtle.importKey("raw",password,{name:"PBKDF2"},!1,["deriveBits"]).then(function(key){return subtle.deriveBits({name:"PBKDF2",salt:salt,iterations:iterations,hash:{name:algo}},key,length<<3)}).then(function(res){return Buffer.from(res)})}module.exports=function(password,salt,iterations,keylen,digest,callback){"function"==typeof digest&&(callback=digest,digest=void 0);var algo=toBrowser[(digest=digest||"sha1").toLowerCase()];if(!algo||"function"!=typeof global.Promise)return process.nextTick(function(){var out;try{out=sync(password,salt,iterations,keylen,digest)}catch(e){return callback(e)}callback(null,out)});if(checkParameters(password,salt,iterations,keylen),"function"!=typeof callback)throw new Error("No callback provided to pbkdf2");Buffer.isBuffer(password)||(password=Buffer.from(password,defaultEncoding)),Buffer.isBuffer(salt)||(salt=Buffer.from(salt,defaultEncoding)),function resolvePromise(promise,callback){promise.then(function(out){process.nextTick(function(){callback(null,out)})},function(e){process.nextTick(function(){callback(e)})})}(function checkNative(algo){if(global.process&&!global.process.browser)return Promise.resolve(!1);if(!subtle||!subtle.importKey||!subtle.deriveBits)return Promise.resolve(!1);if(void 0!==checks[algo])return checks[algo];var prom=browserPbkdf2(ZERO_BUF=ZERO_BUF||Buffer.alloc(8),ZERO_BUF,10,128,algo).then(function(){return!0}).catch(function(){return!1});return checks[algo]=prom}(algo).then(function(resp){return resp?browserPbkdf2(password,salt,iterations,keylen,algo):sync(password,salt,iterations,keylen,digest)}),callback)}}).call(this,__webpack_require__(6),__webpack_require__(4))},function(module,exports,__webpack_require__){var MD5=__webpack_require__(27);module.exports=function(buffer){return(new MD5).update(buffer).digest()}},function(module,exports,__webpack_require__){"use strict";(function(global,process){var Buffer=__webpack_require__(0).Buffer,crypto=global.crypto||global.msCrypto;crypto&&crypto.getRandomValues?module.exports=function randomBytes(size,cb){if(4294967295>8&255]&&(cache[cp]=ret),ret},function fromCpOnly(next,cp,needFeature){return needFeature?next(cp,needFeature):new UChar(cp,null)},function fromRuleBasedJamo(next,cp,needFeature){var j;if(cp<4352||4371<=cp&&cp<44032||55204 * @license MIT */ -module.exports=function(obj){return null!=obj&&(isBuffer(obj)||function isSlowBuffer(obj){return"function"==typeof obj.readFloatLE&&"function"==typeof obj.slice&&isBuffer(obj.slice(0,0))}(obj)||!!obj._isBuffer)}},function(module,exports,__webpack_require__){"use strict";var defaults=__webpack_require__(18),utils=__webpack_require__(2),InterceptorManager=__webpack_require__(100),dispatchRequest=__webpack_require__(101);function Axios(instanceConfig){this.defaults=instanceConfig,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}Axios.prototype.request=function request(config){"string"==typeof config&&(config=utils.merge({url:arguments[0]},arguments[1])),(config=utils.merge(defaults,{method:"get"},this.defaults,config)).method=config.method.toLowerCase();var chain=[dispatchRequest,void 0],promise=Promise.resolve(config);for(this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor){chain.unshift(interceptor.fulfilled,interceptor.rejected)}),this.interceptors.response.forEach(function pushResponseInterceptors(interceptor){chain.push(interceptor.fulfilled,interceptor.rejected)});chain.length;)promise=promise.then(chain.shift(),chain.shift());return promise},utils.forEach(["delete","get","head","options"],function forEachMethodNoData(method){Axios.prototype[method]=function(url,config){return this.request(utils.merge(config||{},{method:method,url:url}))}}),utils.forEach(["post","put","patch"],function forEachMethodWithData(method){Axios.prototype[method]=function(url,data,config){return this.request(utils.merge(config||{},{method:method,url:url,data:data}))}}),module.exports=Axios},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2);module.exports=function normalizeHeaderName(headers,normalizedName){utils.forEach(headers,function processHeader(value,name){name!==normalizedName&&name.toUpperCase()===normalizedName.toUpperCase()&&(headers[normalizedName]=value,delete headers[name])})}},function(module,exports,__webpack_require__){"use strict";var createError=__webpack_require__(43);module.exports=function settle(resolve,reject,response){var validateStatus=response.config.validateStatus;response.status&&validateStatus&&!validateStatus(response.status)?reject(createError("Request failed with status code "+response.status,response.config,null,response.request,response)):resolve(response)}},function(module,exports,__webpack_require__){"use strict";module.exports=function enhanceError(error,config,code,request,response){return error.config=config,code&&(error.code=code),error.request=request,error.response=response,error}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2);function encode(val){return encodeURIComponent(val).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}module.exports=function buildURL(url,params,paramsSerializer){if(!params)return url;var serializedParams;if(paramsSerializer)serializedParams=paramsSerializer(params);else if(utils.isURLSearchParams(params))serializedParams=params.toString();else{var parts=[];utils.forEach(params,function serialize(val,key){null!=val&&(utils.isArray(val)?key+="[]":val=[val],utils.forEach(val,function parseValue(v){utils.isDate(v)?v=v.toISOString():utils.isObject(v)&&(v=JSON.stringify(v)),parts.push(encode(key)+"="+encode(v))}))}),serializedParams=parts.join("&")}return serializedParams&&(url+=(-1===url.indexOf("?")?"?":"&")+serializedParams),url}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2),ignoreDuplicateOf=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];module.exports=function parseHeaders(headers){var key,val,i,parsed={};return headers&&utils.forEach(headers.split("\n"),function parser(line){if(i=line.indexOf(":"),key=utils.trim(line.substr(0,i)).toLowerCase(),val=utils.trim(line.substr(i+1)),key){if(parsed[key]&&0<=ignoreDuplicateOf.indexOf(key))return;parsed[key]="set-cookie"===key?(parsed[key]?parsed[key]:[]).concat([val]):parsed[key]?parsed[key]+", "+val:val}}),parsed}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2);module.exports=utils.isStandardBrowserEnv()?function standardBrowserEnv(){var originURL,msie=/(msie|trident)/i.test(navigator.userAgent),urlParsingNode=document.createElement("a");function resolveURL(url){var href=url;return msie&&(urlParsingNode.setAttribute("href",href),href=urlParsingNode.href),urlParsingNode.setAttribute("href",href),{href:urlParsingNode.href,protocol:urlParsingNode.protocol?urlParsingNode.protocol.replace(/:$/,""):"",host:urlParsingNode.host,search:urlParsingNode.search?urlParsingNode.search.replace(/^\?/,""):"",hash:urlParsingNode.hash?urlParsingNode.hash.replace(/^#/,""):"",hostname:urlParsingNode.hostname,port:urlParsingNode.port,pathname:"/"===urlParsingNode.pathname.charAt(0)?urlParsingNode.pathname:"/"+urlParsingNode.pathname}}return originURL=resolveURL(window.location.href),function isURLSameOrigin(requestURL){var parsed=utils.isString(requestURL)?resolveURL(requestURL):requestURL;return parsed.protocol===originURL.protocol&&parsed.host===originURL.host}}():function isURLSameOrigin(){return!0}},function(module,exports,__webpack_require__){"use strict";function E(){this.message="String contains an invalid character"}(E.prototype=new Error).code=5,E.prototype.name="InvalidCharacterError",module.exports=function btoa(input){for(var block,charCode,str=String(input),output="",idx=0,map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";str.charAt(0|idx)||(map="=",idx%1);output+=map.charAt(63&block>>8-idx%1*8)){if(255<(charCode=str.charCodeAt(idx+=.75)))throw new E;block=block<<8|charCode}return output}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2);module.exports=utils.isStandardBrowserEnv()?function standardBrowserEnv(){return{write:function write(name,value,expires,path,domain,secure){var cookie=[];cookie.push(name+"="+encodeURIComponent(value)),utils.isNumber(expires)&&cookie.push("expires="+new Date(expires).toGMTString()),utils.isString(path)&&cookie.push("path="+path),utils.isString(domain)&&cookie.push("domain="+domain),!0===secure&&cookie.push("secure"),document.cookie=cookie.join("; ")},read:function read(name){var match=document.cookie.match(new RegExp("(^|;\\s*)("+name+")=([^;]*)"));return match?decodeURIComponent(match[3]):null},remove:function remove(name){this.write(name,"",Date.now()-864e5)}}}():{write:function write(){},read:function read(){return null},remove:function remove(){}}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2);function InterceptorManager(){this.handlers=[]}InterceptorManager.prototype.use=function use(fulfilled,rejected){return this.handlers.push({fulfilled:fulfilled,rejected:rejected}),this.handlers.length-1},InterceptorManager.prototype.eject=function eject(id){this.handlers[id]&&(this.handlers[id]=null)},InterceptorManager.prototype.forEach=function forEach(fn){utils.forEach(this.handlers,function forEachHandler(h){null!==h&&fn(h)})},module.exports=InterceptorManager},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2),transformData=__webpack_require__(102),isCancel=__webpack_require__(44),defaults=__webpack_require__(18),isAbsoluteURL=__webpack_require__(103),combineURLs=__webpack_require__(104);function throwIfCancellationRequested(config){config.cancelToken&&config.cancelToken.throwIfRequested()}module.exports=function dispatchRequest(config){return throwIfCancellationRequested(config),config.baseURL&&!isAbsoluteURL(config.url)&&(config.url=combineURLs(config.baseURL,config.url)),config.headers=config.headers||{},config.data=transformData(config.data,config.headers,config.transformRequest),config.headers=utils.merge(config.headers.common||{},config.headers[config.method]||{},config.headers||{}),utils.forEach(["delete","get","head","post","put","patch","common"],function cleanHeaderConfig(method){delete config.headers[method]}),(config.adapter||defaults.adapter)(config).then(function onAdapterResolution(response){return throwIfCancellationRequested(config),response.data=transformData(response.data,response.headers,config.transformResponse),response},function onAdapterRejection(reason){return isCancel(reason)||(throwIfCancellationRequested(config),reason&&reason.response&&(reason.response.data=transformData(reason.response.data,reason.response.headers,config.transformResponse))),Promise.reject(reason)})}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2);module.exports=function transformData(data,headers,fns){return utils.forEach(fns,function transform(fn){data=fn(data,headers)}),data}},function(module,exports,__webpack_require__){"use strict";module.exports=function isAbsoluteURL(url){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url)}},function(module,exports,__webpack_require__){"use strict";module.exports=function combineURLs(baseURL,relativeURL){return relativeURL?baseURL.replace(/\/+$/,"")+"/"+relativeURL.replace(/^\/+/,""):baseURL}},function(module,exports,__webpack_require__){"use strict";var Cancel=__webpack_require__(45);function CancelToken(executor){if("function"!=typeof executor)throw new TypeError("executor must be a function.");var resolvePromise;this.promise=new Promise(function promiseExecutor(resolve){resolvePromise=resolve});var token=this;executor(function cancel(message){token.reason||(token.reason=new Cancel(message),resolvePromise(token.reason))})}CancelToken.prototype.throwIfRequested=function throwIfRequested(){if(this.reason)throw this.reason},CancelToken.source=function source(){var cancel;return{token:new CancelToken(function executor(c){cancel=c}),cancel:cancel}},module.exports=CancelToken},function(module,exports,__webpack_require__){"use strict";module.exports=function spread(callback){return function wrap(arr){return callback.apply(null,arr)}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){Object.defineProperty(exports,"__esModule",{value:!0});var _regenerator2=_interopRequireDefault(__webpack_require__(108)),_createClass=function(){function defineProperties(target,props){for(var i=0;i>6:(code<55296||57344<=code?bytes[index++]=224|code>>12:(code=65536+((1023&code)<<10|1023&key.charCodeAt(++i)),bytes[index++]=240|code>>18,bytes[index++]=128|code>>12&63),bytes[index++]=128|code>>6&63),bytes[index++]=128|63&code);key=bytes}else{if("object"!==type)throw new Error(ERROR);if(null===key)throw new Error(ERROR);if(ARRAY_BUFFER&&key.constructor===ArrayBuffer)key=new Uint8Array(key);else if(!(Array.isArray(key)||ARRAY_BUFFER&&ArrayBuffer.isView(key)))throw new Error(ERROR)}64>2]|=message[index]<>2]|=code<>2]|=(192|code>>6)<>2]|=(224|code>>12)<>2]|=(240|code>>18)<>2]|=(128|code>>12&63)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=EXTRA[3&i],this.block=blocks[16],56<=i&&(this.hashed||this.hash(),blocks[0]=this.block,blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0),blocks[14]=this.hBytes<<3|this.bytes>>>29,blocks[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var j,s0,s1,maj,t1,ab,da,cd,bc,a=this.h0,b=this.h1,c=this.h2,d=this.h3,e=this.h4,f=this.h5,g=this.h6,h=this.h7,blocks=this.blocks;for(j=16;j<64;++j)s0=((t1=blocks[j-15])>>>7|t1<<25)^(t1>>>18|t1<<14)^t1>>>3,s1=((t1=blocks[j-2])>>>17|t1<<15)^(t1>>>19|t1<<13)^t1>>>10,blocks[j]=blocks[j-16]+s0+blocks[j-7]+s1<<0;for(bc=b&c,j=0;j<64;j+=4)this.first?(d=this.is224?(ab=300032,h=(t1=blocks[0]-1413257819)-150054599<<0,t1+24177077<<0):(ab=704751109,h=(t1=blocks[0]-210244248)-1521486534<<0,t1+143694565<<0),this.first=!1):(s0=(a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10),maj=(ab=a&b)^a&c^bc,h=d+(t1=h+(s1=(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7))+(e&f^~e&g)+K[j]+blocks[j])<<0,d=t1+(s0+maj)<<0),s0=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),maj=(da=d&a)^d&b^ab,g=c+(t1=g+(s1=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&e^~h&f)+K[j+1]+blocks[j+1])<<0,s0=((c=t1+(s0+maj)<<0)>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),maj=(cd=c&d)^c&a^da,f=b+(t1=f+(s1=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&h^~g&e)+K[j+2]+blocks[j+2])<<0,s0=((b=t1+(s0+maj)<<0)>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10),maj=(bc=b&c)^b&d^cd,e=a+(t1=e+(s1=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&g^~f&h)+K[j+3]+blocks[j+3])<<0,a=t1+(s0+maj)<<0;this.h0=this.h0+a<<0,this.h1=this.h1+b<<0,this.h2=this.h2+c<<0,this.h3=this.h3+d<<0,this.h4=this.h4+e<<0,this.h5=this.h5+f<<0,this.h6=this.h6+g<<0,this.h7=this.h7+h<<0},Sha256.prototype.hex=function(){this.finalize();var h0=this.h0,h1=this.h1,h2=this.h2,h3=this.h3,h4=this.h4,h5=this.h5,h6=this.h6,h7=this.h7,hex=HEX_CHARS[h0>>28&15]+HEX_CHARS[h0>>24&15]+HEX_CHARS[h0>>20&15]+HEX_CHARS[h0>>16&15]+HEX_CHARS[h0>>12&15]+HEX_CHARS[h0>>8&15]+HEX_CHARS[h0>>4&15]+HEX_CHARS[15&h0]+HEX_CHARS[h1>>28&15]+HEX_CHARS[h1>>24&15]+HEX_CHARS[h1>>20&15]+HEX_CHARS[h1>>16&15]+HEX_CHARS[h1>>12&15]+HEX_CHARS[h1>>8&15]+HEX_CHARS[h1>>4&15]+HEX_CHARS[15&h1]+HEX_CHARS[h2>>28&15]+HEX_CHARS[h2>>24&15]+HEX_CHARS[h2>>20&15]+HEX_CHARS[h2>>16&15]+HEX_CHARS[h2>>12&15]+HEX_CHARS[h2>>8&15]+HEX_CHARS[h2>>4&15]+HEX_CHARS[15&h2]+HEX_CHARS[h3>>28&15]+HEX_CHARS[h3>>24&15]+HEX_CHARS[h3>>20&15]+HEX_CHARS[h3>>16&15]+HEX_CHARS[h3>>12&15]+HEX_CHARS[h3>>8&15]+HEX_CHARS[h3>>4&15]+HEX_CHARS[15&h3]+HEX_CHARS[h4>>28&15]+HEX_CHARS[h4>>24&15]+HEX_CHARS[h4>>20&15]+HEX_CHARS[h4>>16&15]+HEX_CHARS[h4>>12&15]+HEX_CHARS[h4>>8&15]+HEX_CHARS[h4>>4&15]+HEX_CHARS[15&h4]+HEX_CHARS[h5>>28&15]+HEX_CHARS[h5>>24&15]+HEX_CHARS[h5>>20&15]+HEX_CHARS[h5>>16&15]+HEX_CHARS[h5>>12&15]+HEX_CHARS[h5>>8&15]+HEX_CHARS[h5>>4&15]+HEX_CHARS[15&h5]+HEX_CHARS[h6>>28&15]+HEX_CHARS[h6>>24&15]+HEX_CHARS[h6>>20&15]+HEX_CHARS[h6>>16&15]+HEX_CHARS[h6>>12&15]+HEX_CHARS[h6>>8&15]+HEX_CHARS[h6>>4&15]+HEX_CHARS[15&h6];return this.is224||(hex+=HEX_CHARS[h7>>28&15]+HEX_CHARS[h7>>24&15]+HEX_CHARS[h7>>20&15]+HEX_CHARS[h7>>16&15]+HEX_CHARS[h7>>12&15]+HEX_CHARS[h7>>8&15]+HEX_CHARS[h7>>4&15]+HEX_CHARS[15&h7]),hex},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var h0=this.h0,h1=this.h1,h2=this.h2,h3=this.h3,h4=this.h4,h5=this.h5,h6=this.h6,h7=this.h7,arr=[h0>>24&255,h0>>16&255,h0>>8&255,255&h0,h1>>24&255,h1>>16&255,h1>>8&255,255&h1,h2>>24&255,h2>>16&255,h2>>8&255,255&h2,h3>>24&255,h3>>16&255,h3>>8&255,255&h3,h4>>24&255,h4>>16&255,h4>>8&255,255&h4,h5>>24&255,h5>>16&255,h5>>8&255,255&h5,h6>>24&255,h6>>16&255,h6>>8&255,255&h6];return this.is224||arr.push(h7>>24&255,h7>>16&255,h7>>8&255,255&h7),arr},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var buffer=new ArrayBuffer(this.is224?28:32),dataView=new DataView(buffer);return dataView.setUint32(0,this.h0),dataView.setUint32(4,this.h1),dataView.setUint32(8,this.h2),dataView.setUint32(12,this.h3),dataView.setUint32(16,this.h4),dataView.setUint32(20,this.h5),dataView.setUint32(24,this.h6),this.is224||dataView.setUint32(28,this.h7),buffer},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var innerHash=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(innerHash),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}()}).call(this,__webpack_require__(4),__webpack_require__(5),__webpack_require__(12)(module))},function(module,exports,__webpack_require__){"use strict";var Reflection=__webpack_require__(10),Encoder=__webpack_require__(47),Types=__webpack_require__(3).Types,compositionTypes=[Types.Struct,Types.Interface,Types.ArrayStruct,Types.Interface],encodeBinary=function encodeBinary(instance,type,opts){var isBare=!(3>>=7;out[offset]=0|num;encode.bytes=offset-oldOffset+1;return out};var MSB=128,MSBALL=-128,INT=Math.pow(2,31)},function(module,exports,__webpack_require__){"use strict";module.exports=function read(buf,offset){var b,res=0,offset=offset||0,shift=0,counter=offset,l=buf.length;do{if(l<=counter)throw read.bytes=0,new RangeError("Could not decode varint");b=buf[counter++],res+=shift<28?(b&REST)<>8-idx%1*8)){if(255<(charCode=str.charCodeAt(idx+=.75)))throw new E;block=block<<8|charCode}return output}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2);module.exports=utils.isStandardBrowserEnv()?function standardBrowserEnv(){return{write:function write(name,value,expires,path,domain,secure){var cookie=[];cookie.push(name+"="+encodeURIComponent(value)),utils.isNumber(expires)&&cookie.push("expires="+new Date(expires).toGMTString()),utils.isString(path)&&cookie.push("path="+path),utils.isString(domain)&&cookie.push("domain="+domain),!0===secure&&cookie.push("secure"),document.cookie=cookie.join("; ")},read:function read(name){var match=document.cookie.match(new RegExp("(^|;\\s*)("+name+")=([^;]*)"));return match?decodeURIComponent(match[3]):null},remove:function remove(name){this.write(name,"",Date.now()-864e5)}}}():{write:function write(){},read:function read(){return null},remove:function remove(){}}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2);function InterceptorManager(){this.handlers=[]}InterceptorManager.prototype.use=function use(fulfilled,rejected){return this.handlers.push({fulfilled:fulfilled,rejected:rejected}),this.handlers.length-1},InterceptorManager.prototype.eject=function eject(id){this.handlers[id]&&(this.handlers[id]=null)},InterceptorManager.prototype.forEach=function forEach(fn){utils.forEach(this.handlers,function forEachHandler(h){null!==h&&fn(h)})},module.exports=InterceptorManager},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2),transformData=__webpack_require__(102),isCancel=__webpack_require__(44),defaults=__webpack_require__(18),isAbsoluteURL=__webpack_require__(103),combineURLs=__webpack_require__(104);function throwIfCancellationRequested(config){config.cancelToken&&config.cancelToken.throwIfRequested()}module.exports=function dispatchRequest(config){return throwIfCancellationRequested(config),config.baseURL&&!isAbsoluteURL(config.url)&&(config.url=combineURLs(config.baseURL,config.url)),config.headers=config.headers||{},config.data=transformData(config.data,config.headers,config.transformRequest),config.headers=utils.merge(config.headers.common||{},config.headers[config.method]||{},config.headers||{}),utils.forEach(["delete","get","head","post","put","patch","common"],function cleanHeaderConfig(method){delete config.headers[method]}),(config.adapter||defaults.adapter)(config).then(function onAdapterResolution(response){return throwIfCancellationRequested(config),response.data=transformData(response.data,response.headers,config.transformResponse),response},function onAdapterRejection(reason){return isCancel(reason)||(throwIfCancellationRequested(config),reason&&reason.response&&(reason.response.data=transformData(reason.response.data,reason.response.headers,config.transformResponse))),Promise.reject(reason)})}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(2);module.exports=function transformData(data,headers,fns){return utils.forEach(fns,function transform(fn){data=fn(data,headers)}),data}},function(module,exports,__webpack_require__){"use strict";module.exports=function isAbsoluteURL(url){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url)}},function(module,exports,__webpack_require__){"use strict";module.exports=function combineURLs(baseURL,relativeURL){return relativeURL?baseURL.replace(/\/+$/,"")+"/"+relativeURL.replace(/^\/+/,""):baseURL}},function(module,exports,__webpack_require__){"use strict";var Cancel=__webpack_require__(45);function CancelToken(executor){if("function"!=typeof executor)throw new TypeError("executor must be a function.");var resolvePromise;this.promise=new Promise(function promiseExecutor(resolve){resolvePromise=resolve});var token=this;executor(function cancel(message){token.reason||(token.reason=new Cancel(message),resolvePromise(token.reason))})}CancelToken.prototype.throwIfRequested=function throwIfRequested(){if(this.reason)throw this.reason},CancelToken.source=function source(){var cancel;return{token:new CancelToken(function executor(c){cancel=c}),cancel:cancel}},module.exports=CancelToken},function(module,exports,__webpack_require__){"use strict";module.exports=function spread(callback){return function wrap(arr){return callback.apply(null,arr)}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){Object.defineProperty(exports,"__esModule",{value:!0});var _regenerator2=_interopRequireDefault(__webpack_require__(108)),_createClass=function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor};function defineProperties(target,props){for(var i=0;i>>=7;out[offset]=0|num;encode.bytes=offset-oldOffset+1;return out};var MSB=128,MSBALL=-128,INT=Math.pow(2,31)},function(module,exports){module.exports=function read(buf,offset){var b,res=0,offset=offset||0,shift=0,counter=offset,l=buf.length;do{if(l<=counter)throw read.bytes=0,new RangeError("Could not decode varint");b=buf[counter++],res+=shift<28?(b&REST)< * * Copyright (c) 2015-2018, Jon Schlinkert. * Released under the MIT License. - */module.exports=function(time){if(!Array.isArray(time)||2!==time.length)throw new TypeError("expected an array from process.hrtime()");return 1e9*+time[0]+ +time[1]}},function(module,exports,__webpack_require__){"use strict";var Reflection=__webpack_require__(10),Decoder=__webpack_require__(50),Utils=__webpack_require__(9),_require=__webpack_require__(3),Types=_require.Types,WireType=_require.WireType,WireMap=_require.WireMap,decodeBinary=function decodeBinary(bz,instance,type,opts){var isBare=!(4{ it('#2 get the account by private key', ()=>{ const qweb = new QWeb({ chainId: testConfig.chainId, baseUrl: testConfig.APINode }) const newAccount = qweb.newAccount() - + const targetAccount = qweb.recoveryAccountByPrivateKey(newAccount.privateKey) expect(targetAccount.address).to.equal(newAccount.address) expect(targetAccount.privateKey).to.equal(newAccount.privateKey) expect(targetAccount.publicKey).to.equal(newAccount.publicKey) - expect(targetAccount.mnemonic).to.equal(newAccount.mnemonic) + // expect(targetAccount.mnemonic).to.equal(newAccount.mnemonic) }) + it('#3 my account on TestChain', ()=>{ + const qweb = new QWeb({ chainId: testConfig.chainId, baseUrl: testConfig.APINode }) + const account = qweb.account + + return account.get(testConfig.account.myAccount.address).then(resp=>{ + console.log('myAccount', resp.data.result) + expect(resp.data.result.value.base_account.account_address).to.equal(testConfig.account.myAccount.address) + }) + }) +}) -}) \ No newline at end of file +describe('[transcation]', ()=>{ + // it('#1 create the new account', ()=>{ + // const qweb = new QWeb({ chainId: testConfig.chainId, baseUrl: testConfig.APINode }) + // const newAccount = qweb.newAccount() + // expect(newAccount).not.null + // expect(newAccount.address).not.null + // expect(newAccount.privateKey).not.null + // expect(newAccount.publicKey).not.null + // expect(newAccount.mnemonic).not.null + // console.log('----- New Account -----') + // console.log(`Account Address:\t${newAccount.address}`) + // console.log(`Private Key:\t${newAccount.privateKey}`) + // console.log(`Public Key:\t${newAccount.publicKey}`) + // console.log(`Mnemonic Words:\t${newAccount.mnemonic}`) + // }) +}) From fb11cc5e86527b7091d980e741531b97c8761649 Mon Sep 17 00:00:00 2001 From: huming0618 Date: Wed, 15 May 2019 13:53:31 +0800 Subject: [PATCH 4/8] before lint change --- src/model/account.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/model/account.js b/src/model/account.js index 0d8859f..8ca5f3d 100644 --- a/src/model/account.js +++ b/src/model/account.js @@ -3,9 +3,10 @@ export default class Account { this._qweb = qweb } - get(address) { - return this._qweb.http.request({ + async get(address) { + const result = await this._qweb.http.request({ url: `nodes/${this._qweb.chainId}/accounts/${address}` }) + return result.value } } From d0169fb8771ce128a682b4ae96cab05cad3b3094 Mon Sep 17 00:00:00 2001 From: huming0618 Date: Wed, 15 May 2019 14:17:36 +0800 Subject: [PATCH 5/8] lint --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index d7dfeb6..c5b8a31 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "build": "npx babel src --out-dir dist/cmjs && npx webpack --config build/webpack.prod.conf.js", "dev": "webpack-dev-server --watch-content-base --inline --content-base ./example --port 9393 --host 127.0.0.1 --open --hot --config build/webpack.dev.conf.js", "lint": "eslint --ext .js,.vue src", + "lintfix": "eslint --fix --ext .js,.vue src", "test": "npm run lint", "unittest": "karma start karma.conf.js" }, From d91c9a5feee93a0601c736742499603cc2af84f4 Mon Sep 17 00:00:00 2001 From: huming0618 Date: Wed, 15 May 2019 14:36:28 +0800 Subject: [PATCH 6/8] accout async --- src/model/account.js | 2 +- test/qosweb.spec.js | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/model/account.js b/src/model/account.js index 8ca5f3d..d4ca5b8 100644 --- a/src/model/account.js +++ b/src/model/account.js @@ -7,6 +7,6 @@ export default class Account { const result = await this._qweb.http.request({ url: `nodes/${this._qweb.chainId}/accounts/${address}` }) - return result.value + return result.data.result.value } } diff --git a/test/qosweb.spec.js b/test/qosweb.spec.js index 8cc4c44..c8bdcbe 100644 --- a/test/qosweb.spec.js +++ b/test/qosweb.spec.js @@ -39,14 +39,12 @@ describe('[account]', ()=>{ // expect(targetAccount.mnemonic).to.equal(newAccount.mnemonic) }) - it('#3 my account on TestChain', ()=>{ + it('#3 my account on TestChain', async ()=>{ const qweb = new QWeb({ chainId: testConfig.chainId, baseUrl: testConfig.APINode }) const account = qweb.account - return account.get(testConfig.account.myAccount.address).then(resp=>{ - console.log('myAccount', resp.data.result) - expect(resp.data.result.value.base_account.account_address).to.equal(testConfig.account.myAccount.address) - }) + const detail = await account.get(testConfig.account.myAccount.address) + expect(detail.base_account.account_address).to.equal(testConfig.account.myAccount.address) }) }) From 8e81cf895ee95f395e34ea1759b9f324939114a5 Mon Sep 17 00:00:00 2001 From: huming0618 Date: Wed, 15 May 2019 14:54:21 +0800 Subject: [PATCH 7/8] config file --- build/webpack.base.conf.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js index 7245ce9..8b61f77 100644 --- a/build/webpack.base.conf.js +++ b/build/webpack.base.conf.js @@ -17,15 +17,7 @@ module.exports = { { test: /\.js$/, loader: 'babel-loader', - // options: { - // "presets": [ - // ['es2015', { modules: false }] - // ], - // }, include: [resolve('src'), resolve('test'), resolve('node_modules/js-amino'),], - // exclude: [ - // resolve('src/lib/Js-Amino') - // ] }, { test: /[\\\/]tweetnacl[\\\/]/, From 82260fc4d8dbb9329678a0472901d06f14e11bb5 Mon Sep 17 00:00:00 2001 From: huming0618 Date: Wed, 15 May 2019 14:55:45 +0800 Subject: [PATCH 8/8] remove quote --- build/webpack.base.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js index 8b61f77..5ba8937 100644 --- a/build/webpack.base.conf.js +++ b/build/webpack.base.conf.js @@ -17,7 +17,7 @@ module.exports = { { test: /\.js$/, loader: 'babel-loader', - include: [resolve('src'), resolve('test'), resolve('node_modules/js-amino'),], + include: [resolve('src'), resolve('test'), resolve('node_modules/js-amino')], }, { test: /[\\\/]tweetnacl[\\\/]/,