(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
/***/ 1:
/*!*********************************************************!*\
!*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet', '__webpack_require_UNI_MP_PLUGIN__'];
var singlePageDisableKey = ['lanDebug', 'router', 'worklet'];
var target = typeof globalThis !== 'undefined' ? globalThis : function () {
return this;
}();
var key = ['w', 'x'].join('');
var oldWx = target[key];
var launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null;
function isWxKey(key) {
if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
return false;
}
return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
}
function initWx() {
var newWx = {};
for (var _key in oldWx) {
if (isWxKey(_key)) {
// TODO wrapper function
newWx[_key] = oldWx[_key];
}
}
return newWx;
}
target[key] = initWx();
var _default = target[key];
exports.default = _default;
/***/ }),
/***/ 10:
/*!****************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 100:
/*!**************************************************************!*\
!*** ./node_modules/readable-stream/lib/_stream_writable.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process, global) {// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// A bit simpler than readable streams.
// Implement an async ._write(chunk, encoding, cb), and it'll handle all
// the drain event emission and buffering.
/**/
var pna = __webpack_require__(/*! process-nextick-args */ 91);
/**/
module.exports = Writable;
/* */
function WriteReq(chunk, encoding, cb) {
this.chunk = chunk;
this.encoding = encoding;
this.callback = cb;
this.next = null;
}
// It seems a linked list but it is not
// there will be only 2 of these for each stream
function CorkedRequest(state) {
var _this = this;
this.next = null;
this.entry = null;
this.finish = function () {
onCorkedFinish(_this, state);
};
}
/* */
/**/
var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
/**/
/**/
var Duplex;
/**/
Writable.WritableState = WritableState;
/**/
var util = Object.create(__webpack_require__(/*! core-util-is */ 94));
util.inherits = __webpack_require__(/*! inherits */ 86);
/**/
/**/
var internalUtil = {
deprecate: __webpack_require__(/*! util-deprecate */ 101)
};
/**/
/**/
var Stream = __webpack_require__(/*! ./internal/streams/stream */ 93);
/**/
/**/
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer;
var OurUint8Array = global.Uint8Array || function () {};
function _uint8ArrayToBuffer(chunk) {
return Buffer.from(chunk);
}
function _isUint8Array(obj) {
return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
}
/**/
var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ 98);
util.inherits(Writable, Stream);
function nop() {}
function WritableState(options, stream) {
Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 99);
options = options || {};
// Duplex streams are both readable and writable, but share
// the same options object.
// However, some cases require setting options to different
// values for the readable and the writable sides of the duplex stream.
// These options can be provided separately as readableXXX and writableXXX.
var isDuplex = stream instanceof Duplex;
// object stream flag to indicate whether or not this stream
// contains buffers or objects.
this.objectMode = !!options.objectMode;
if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
// the point at which write() starts returning false
// Note: 0 is a valid value, means that we always return false if
// the entire buffer is not flushed immediately on write()
var hwm = options.highWaterMark;
var writableHwm = options.writableHighWaterMark;
var defaultHwm = this.objectMode ? 16 : 16 * 1024;
if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
// cast to ints.
this.highWaterMark = Math.floor(this.highWaterMark);
// if _final has been called
this.finalCalled = false;
// drain event flag.
this.needDrain = false;
// at the start of calling end()
this.ending = false;
// when end() has been called, and returned
this.ended = false;
// when 'finish' is emitted
this.finished = false;
// has it been destroyed
this.destroyed = false;
// should we decode strings into buffers before passing to _write?
// this is here so that some node-core streams can optimize string
// handling at a lower level.
var noDecode = options.decodeStrings === false;
this.decodeStrings = !noDecode;
// Crypto is kind of old and crusty. Historically, its default string
// encoding is 'binary' so we have to make this configurable.
// Everything else in the universe uses 'utf8', though.
this.defaultEncoding = options.defaultEncoding || 'utf8';
// not an actual buffer we keep track of, but a measurement
// of how much we're waiting to get pushed to some underlying
// socket or file.
this.length = 0;
// a flag to see when we're in the middle of a write.
this.writing = false;
// when true all writes will be buffered until .uncork() call
this.corked = 0;
// a flag to be able to tell if the onwrite cb is called immediately,
// or on a later tick. We set this to true at first, because any
// actions that shouldn't happen until "later" should generally also
// not happen before the first write call.
this.sync = true;
// a flag to know if we're processing previously buffered items, which
// may call the _write() callback in the same tick, so that we don't
// end up in an overlapped onwrite situation.
this.bufferProcessing = false;
// the callback that's passed to _write(chunk,cb)
this.onwrite = function (er) {
onwrite(stream, er);
};
// the callback that the user supplies to write(chunk,encoding,cb)
this.writecb = null;
// the amount that is being written when _write is called.
this.writelen = 0;
this.bufferedRequest = null;
this.lastBufferedRequest = null;
// number of pending user-supplied write callbacks
// this must be 0 before 'finish' can be emitted
this.pendingcb = 0;
// emit prefinish if the only thing we're waiting for is _write cbs
// This is relevant for synchronous Transform streams
this.prefinished = false;
// True if the error was already emitted and should not be thrown again
this.errorEmitted = false;
// count buffered requests
this.bufferedRequestCount = 0;
// allocate the first CorkedRequest, there is always
// one allocated and free to use, and we maintain at most two
this.corkedRequestsFree = new CorkedRequest(this);
}
WritableState.prototype.getBuffer = function getBuffer() {
var current = this.bufferedRequest;
var out = [];
while (current) {
out.push(current);
current = current.next;
}
return out;
};
(function () {
try {
Object.defineProperty(WritableState.prototype, 'buffer', {
get: internalUtil.deprecate(function () {
return this.getBuffer();
}, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
});
} catch (_) {}
})();
// Test _writableState for inheritance to account for Duplex streams,
// whose prototype chain only points to Readable.
var realHasInstance;
if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
realHasInstance = Function.prototype[Symbol.hasInstance];
Object.defineProperty(Writable, Symbol.hasInstance, {
value: function (object) {
if (realHasInstance.call(this, object)) return true;
if (this !== Writable) return false;
return object && object._writableState instanceof WritableState;
}
});
} else {
realHasInstance = function (object) {
return object instanceof this;
};
}
function Writable(options) {
Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 99);
// Writable ctor is applied to Duplexes, too.
// `realHasInstance` is necessary because using plain `instanceof`
// would return false, as no `_writableState` property is attached.
// Trying to use the custom `instanceof` for Writable here will also break the
// Node.js LazyTransform implementation, which has a non-trivial getter for
// `_writableState` that would lead to infinite recursion.
if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
return new Writable(options);
}
this._writableState = new WritableState(options, this);
// legacy.
this.writable = true;
if (options) {
if (typeof options.write === 'function') this._write = options.write;
if (typeof options.writev === 'function') this._writev = options.writev;
if (typeof options.destroy === 'function') this._destroy = options.destroy;
if (typeof options.final === 'function') this._final = options.final;
}
Stream.call(this);
}
// Otherwise people can pipe Writable streams, which is just wrong.
Writable.prototype.pipe = function () {
this.emit('error', new Error('Cannot pipe, not readable'));
};
function writeAfterEnd(stream, cb) {
var er = new Error('write after end');
// TODO: defer error events consistently everywhere, not just the cb
stream.emit('error', er);
pna.nextTick(cb, er);
}
// Checks that a user-supplied chunk is valid, especially for the particular
// mode the stream is in. Currently this means that `null` is never accepted
// and undefined/non-string values are only allowed in object mode.
function validChunk(stream, state, chunk, cb) {
var valid = true;
var er = false;
if (chunk === null) {
er = new TypeError('May not write null values to stream');
} else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
er = new TypeError('Invalid non-string/buffer chunk');
}
if (er) {
stream.emit('error', er);
pna.nextTick(cb, er);
valid = false;
}
return valid;
}
Writable.prototype.write = function (chunk, encoding, cb) {
var state = this._writableState;
var ret = false;
var isBuf = !state.objectMode && _isUint8Array(chunk);
if (isBuf && !Buffer.isBuffer(chunk)) {
chunk = _uint8ArrayToBuffer(chunk);
}
if (typeof encoding === 'function') {
cb = encoding;
encoding = null;
}
if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
if (typeof cb !== 'function') cb = nop;
if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
state.pendingcb++;
ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
}
return ret;
};
Writable.prototype.cork = function () {
var state = this._writableState;
state.corked++;
};
Writable.prototype.uncork = function () {
var state = this._writableState;
if (state.corked) {
state.corked--;
if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
}
};
Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
// node::ParseEncoding() requires lower case.
if (typeof encoding === 'string') encoding = encoding.toLowerCase();
if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
this._writableState.defaultEncoding = encoding;
return this;
};
function decodeChunk(state, chunk, encoding) {
if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
chunk = Buffer.from(chunk, encoding);
}
return chunk;
}
Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
// making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
get: function () {
return this._writableState.highWaterMark;
}
});
// if we're already writing something, then just put this
// in the queue, and wait our turn. Otherwise, call _write
// If we return false, then we need a drain event, so set that flag.
function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
if (!isBuf) {
var newChunk = decodeChunk(state, chunk, encoding);
if (chunk !== newChunk) {
isBuf = true;
encoding = 'buffer';
chunk = newChunk;
}
}
var len = state.objectMode ? 1 : chunk.length;
state.length += len;
var ret = state.length < state.highWaterMark;
// we must ensure that previous needDrain will not be reset to false.
if (!ret) state.needDrain = true;
if (state.writing || state.corked) {
var last = state.lastBufferedRequest;
state.lastBufferedRequest = {
chunk: chunk,
encoding: encoding,
isBuf: isBuf,
callback: cb,
next: null
};
if (last) {
last.next = state.lastBufferedRequest;
} else {
state.bufferedRequest = state.lastBufferedRequest;
}
state.bufferedRequestCount += 1;
} else {
doWrite(stream, state, false, len, chunk, encoding, cb);
}
return ret;
}
function doWrite(stream, state, writev, len, chunk, encoding, cb) {
state.writelen = len;
state.writecb = cb;
state.writing = true;
state.sync = true;
if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
state.sync = false;
}
function onwriteError(stream, state, sync, er, cb) {
--state.pendingcb;
if (sync) {
// defer the callback if we are being called synchronously
// to avoid piling up things on the stack
pna.nextTick(cb, er);
// this can emit finish, and it will always happen
// after error
pna.nextTick(finishMaybe, stream, state);
stream._writableState.errorEmitted = true;
stream.emit('error', er);
} else {
// the caller expect this to happen before if
// it is async
cb(er);
stream._writableState.errorEmitted = true;
stream.emit('error', er);
// this can emit finish, but finish must
// always follow error
finishMaybe(stream, state);
}
}
function onwriteStateUpdate(state) {
state.writing = false;
state.writecb = null;
state.length -= state.writelen;
state.writelen = 0;
}
function onwrite(stream, er) {
var state = stream._writableState;
var sync = state.sync;
var cb = state.writecb;
onwriteStateUpdate(state);
if (er) onwriteError(stream, state, sync, er, cb);else {
// Check if we're actually ready to finish, but don't emit yet
var finished = needFinish(state);
if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
clearBuffer(stream, state);
}
if (sync) {
/**/
asyncWrite(afterWrite, stream, state, finished, cb);
/**/
} else {
afterWrite(stream, state, finished, cb);
}
}
}
function afterWrite(stream, state, finished, cb) {
if (!finished) onwriteDrain(stream, state);
state.pendingcb--;
cb();
finishMaybe(stream, state);
}
// Must force callback to be called on nextTick, so that we don't
// emit 'drain' before the write() consumer gets the 'false' return
// value, and has a chance to attach a 'drain' listener.
function onwriteDrain(stream, state) {
if (state.length === 0 && state.needDrain) {
state.needDrain = false;
stream.emit('drain');
}
}
// if there's something in the buffer waiting, then process it
function clearBuffer(stream, state) {
state.bufferProcessing = true;
var entry = state.bufferedRequest;
if (stream._writev && entry && entry.next) {
// Fast case, write everything using _writev()
var l = state.bufferedRequestCount;
var buffer = new Array(l);
var holder = state.corkedRequestsFree;
holder.entry = entry;
var count = 0;
var allBuffers = true;
while (entry) {
buffer[count] = entry;
if (!entry.isBuf) allBuffers = false;
entry = entry.next;
count += 1;
}
buffer.allBuffers = allBuffers;
doWrite(stream, state, true, state.length, buffer, '', holder.finish);
// doWrite is almost always async, defer these to save a bit of time
// as the hot path ends with doWrite
state.pendingcb++;
state.lastBufferedRequest = null;
if (holder.next) {
state.corkedRequestsFree = holder.next;
holder.next = null;
} else {
state.corkedRequestsFree = new CorkedRequest(state);
}
state.bufferedRequestCount = 0;
} else {
// Slow case, write chunks one-by-one
while (entry) {
var chunk = entry.chunk;
var encoding = entry.encoding;
var cb = entry.callback;
var len = state.objectMode ? 1 : chunk.length;
doWrite(stream, state, false, len, chunk, encoding, cb);
entry = entry.next;
state.bufferedRequestCount--;
// if we didn't call the onwrite immediately, then
// it means that we need to wait until it does.
// also, that means that the chunk and cb are currently
// being processed, so move the buffer counter past them.
if (state.writing) {
break;
}
}
if (entry === null) state.lastBufferedRequest = null;
}
state.bufferedRequest = entry;
state.bufferProcessing = false;
}
Writable.prototype._write = function (chunk, encoding, cb) {
cb(new Error('_write() is not implemented'));
};
Writable.prototype._writev = null;
Writable.prototype.end = function (chunk, encoding, cb) {
var state = this._writableState;
if (typeof chunk === 'function') {
cb = chunk;
chunk = null;
encoding = null;
} else if (typeof encoding === 'function') {
cb = encoding;
encoding = null;
}
if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
// .end() fully uncorks
if (state.corked) {
state.corked = 1;
this.uncork();
}
// ignore unnecessary end() calls.
if (!state.ending && !state.finished) endWritable(this, state, cb);
};
function needFinish(state) {
return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
}
function callFinal(stream, state) {
stream._final(function (err) {
state.pendingcb--;
if (err) {
stream.emit('error', err);
}
state.prefinished = true;
stream.emit('prefinish');
finishMaybe(stream, state);
});
}
function prefinish(stream, state) {
if (!state.prefinished && !state.finalCalled) {
if (typeof stream._final === 'function') {
state.pendingcb++;
state.finalCalled = true;
pna.nextTick(callFinal, stream, state);
} else {
state.prefinished = true;
stream.emit('prefinish');
}
}
}
function finishMaybe(stream, state) {
var need = needFinish(state);
if (need) {
prefinish(stream, state);
if (state.pendingcb === 0) {
state.finished = true;
stream.emit('finish');
}
}
return need;
}
function endWritable(stream, state, cb) {
state.ending = true;
finishMaybe(stream, state);
if (cb) {
if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
}
state.ended = true;
stream.writable = false;
}
function onCorkedFinish(corkReq, state, err) {
var entry = corkReq.entry;
corkReq.entry = null;
while (entry) {
var cb = entry.callback;
state.pendingcb--;
cb(err);
entry = entry.next;
}
if (state.corkedRequestsFree) {
state.corkedRequestsFree.next = corkReq;
} else {
state.corkedRequestsFree = corkReq;
}
}
Object.defineProperty(Writable.prototype, 'destroyed', {
get: function () {
if (this._writableState === undefined) {
return false;
}
return this._writableState.destroyed;
},
set: function (value) {
// we ignore the value if the stream
// has not been initialized yet
if (!this._writableState) {
return;
}
// backward compatibility, the user is explicitly
// managing destroyed
this._writableState.destroyed = value;
}
});
Writable.prototype.destroy = destroyImpl.destroy;
Writable.prototype._undestroy = destroyImpl.undestroy;
Writable.prototype._destroy = function (err, cb) {
this.end();
cb(err);
};
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 78), __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3)))
/***/ }),
/***/ 101:
/*!************************************************!*\
!*** ./node_modules/util-deprecate/browser.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {
/**
* Module exports.
*/
module.exports = deprecate;
/**
* Mark that a method should not be used.
* Returns a modified function which warns once by default.
*
* If `localStorage.noDeprecation = true` is set, then it is a no-op.
*
* If `localStorage.throwDeprecation = true` is set, then deprecated functions
* will throw an Error when invoked.
*
* If `localStorage.traceDeprecation = true` is set, then deprecated functions
* will invoke `console.trace()` instead of `console.error()`.
*
* @param {Function} fn - the function to deprecate
* @param {String} msg - the string to print to the console when `fn` is invoked
* @returns {Function} a new "deprecated" version of `fn`
* @api public
*/
function deprecate (fn, msg) {
if (config('noDeprecation')) {
return fn;
}
var warned = false;
function deprecated() {
if (!warned) {
if (config('throwDeprecation')) {
throw new Error(msg);
} else if (config('traceDeprecation')) {
console.trace(msg);
} else {
console.warn(msg);
}
warned = true;
}
return fn.apply(this, arguments);
}
return deprecated;
}
/**
* Checks `localStorage` for boolean values for the given `name`.
*
* @param {String} name
* @returns {Boolean}
* @api private
*/
function config (name) {
// accessing global.localStorage can trigger a DOMException in sandboxed iframes
try {
if (!global.localStorage) return false;
} catch (_) {
return false;
}
var val = global.localStorage[name];
if (null == val) return false;
return String(val).toLowerCase() === 'true';
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 3)))
/***/ }),
/***/ 102:
/*!***********************************************************!*\
!*** ./node_modules/string_decoder/lib/string_decoder.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
/**/
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer;
/**/
var isEncoding = Buffer.isEncoding || function (encoding) {
encoding = '' + encoding;
switch (encoding && encoding.toLowerCase()) {
case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
return true;
default:
return false;
}
};
function _normalizeEncoding(enc) {
if (!enc) return 'utf8';
var retried;
while (true) {
switch (enc) {
case 'utf8':
case 'utf-8':
return 'utf8';
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return 'utf16le';
case 'latin1':
case 'binary':
return 'latin1';
case 'base64':
case 'ascii':
case 'hex':
return enc;
default:
if (retried) return; // undefined
enc = ('' + enc).toLowerCase();
retried = true;
}
}
};
// Do not cache `Buffer.isEncoding` when checking encoding names as some
// modules monkey-patch it to support additional encodings
function normalizeEncoding(enc) {
var nenc = _normalizeEncoding(enc);
if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
return nenc || enc;
}
// StringDecoder provides an interface for efficiently splitting a series of
// buffers into a series of JS strings without breaking apart multi-byte
// characters.
exports.StringDecoder = StringDecoder;
function StringDecoder(encoding) {
this.encoding = normalizeEncoding(encoding);
var nb;
switch (this.encoding) {
case 'utf16le':
this.text = utf16Text;
this.end = utf16End;
nb = 4;
break;
case 'utf8':
this.fillLast = utf8FillLast;
nb = 4;
break;
case 'base64':
this.text = base64Text;
this.end = base64End;
nb = 3;
break;
default:
this.write = simpleWrite;
this.end = simpleEnd;
return;
}
this.lastNeed = 0;
this.lastTotal = 0;
this.lastChar = Buffer.allocUnsafe(nb);
}
StringDecoder.prototype.write = function (buf) {
if (buf.length === 0) return '';
var r;
var i;
if (this.lastNeed) {
r = this.fillLast(buf);
if (r === undefined) return '';
i = this.lastNeed;
this.lastNeed = 0;
} else {
i = 0;
}
if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
return r || '';
};
StringDecoder.prototype.end = utf8End;
// Returns only complete characters in a Buffer
StringDecoder.prototype.text = utf8Text;
// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
StringDecoder.prototype.fillLast = function (buf) {
if (this.lastNeed <= buf.length) {
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
}
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
this.lastNeed -= buf.length;
};
// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
// continuation byte. If an invalid byte is detected, -2 is returned.
function utf8CheckByte(byte) {
if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
return byte >> 6 === 0x02 ? -1 : -2;
}
// Checks at most 3 bytes at the end of a Buffer in order to detect an
// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
// needed to complete the UTF-8 character (if applicable) are returned.
function utf8CheckIncomplete(self, buf, i) {
var j = buf.length - 1;
if (j < i) return 0;
var nb = utf8CheckByte(buf[j]);
if (nb >= 0) {
if (nb > 0) self.lastNeed = nb - 1;
return nb;
}
if (--j < i || nb === -2) return 0;
nb = utf8CheckByte(buf[j]);
if (nb >= 0) {
if (nb > 0) self.lastNeed = nb - 2;
return nb;
}
if (--j < i || nb === -2) return 0;
nb = utf8CheckByte(buf[j]);
if (nb >= 0) {
if (nb > 0) {
if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
}
return nb;
}
return 0;
}
// Validates as many continuation bytes for a multi-byte UTF-8 character as
// needed or are available. If we see a non-continuation byte where we expect
// one, we "replace" the validated continuation bytes we've seen so far with
// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
// behavior. The continuation byte check is included three times in the case
// where all of the continuation bytes for a character exist in the same buffer.
// It is also done this way as a slight performance increase instead of using a
// loop.
function utf8CheckExtraBytes(self, buf, p) {
if ((buf[0] & 0xC0) !== 0x80) {
self.lastNeed = 0;
return '\ufffd';
}
if (self.lastNeed > 1 && buf.length > 1) {
if ((buf[1] & 0xC0) !== 0x80) {
self.lastNeed = 1;
return '\ufffd';
}
if (self.lastNeed > 2 && buf.length > 2) {
if ((buf[2] & 0xC0) !== 0x80) {
self.lastNeed = 2;
return '\ufffd';
}
}
}
}
// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
function utf8FillLast(buf) {
var p = this.lastTotal - this.lastNeed;
var r = utf8CheckExtraBytes(this, buf, p);
if (r !== undefined) return r;
if (this.lastNeed <= buf.length) {
buf.copy(this.lastChar, p, 0, this.lastNeed);
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
}
buf.copy(this.lastChar, p, 0, buf.length);
this.lastNeed -= buf.length;
}
// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
// partial character, the character's bytes are buffered until the required
// number of bytes are available.
function utf8Text(buf, i) {
var total = utf8CheckIncomplete(this, buf, i);
if (!this.lastNeed) return buf.toString('utf8', i);
this.lastTotal = total;
var end = buf.length - (total - this.lastNeed);
buf.copy(this.lastChar, 0, end);
return buf.toString('utf8', i, end);
}
// For UTF-8, a replacement character is added when ending on a partial
// character.
function utf8End(buf) {
var r = buf && buf.length ? this.write(buf) : '';
if (this.lastNeed) return r + '\ufffd';
return r;
}
// UTF-16LE typically needs two bytes per character, but even if we have an even
// number of bytes available, we need to check if we end on a leading/high
// surrogate. In that case, we need to wait for the next two bytes in order to
// decode the last character properly.
function utf16Text(buf, i) {
if ((buf.length - i) % 2 === 0) {
var r = buf.toString('utf16le', i);
if (r) {
var c = r.charCodeAt(r.length - 1);
if (c >= 0xD800 && c <= 0xDBFF) {
this.lastNeed = 2;
this.lastTotal = 4;
this.lastChar[0] = buf[buf.length - 2];
this.lastChar[1] = buf[buf.length - 1];
return r.slice(0, -1);
}
}
return r;
}
this.lastNeed = 1;
this.lastTotal = 2;
this.lastChar[0] = buf[buf.length - 1];
return buf.toString('utf16le', i, buf.length - 1);
}
// For UTF-16LE we do not explicitly append special replacement characters if we
// end on a partial character, we simply let v8 handle that.
function utf16End(buf) {
var r = buf && buf.length ? this.write(buf) : '';
if (this.lastNeed) {
var end = this.lastTotal - this.lastNeed;
return r + this.lastChar.toString('utf16le', 0, end);
}
return r;
}
function base64Text(buf, i) {
var n = (buf.length - i) % 3;
if (n === 0) return buf.toString('base64', i);
this.lastNeed = 3 - n;
this.lastTotal = 3;
if (n === 1) {
this.lastChar[0] = buf[buf.length - 1];
} else {
this.lastChar[0] = buf[buf.length - 2];
this.lastChar[1] = buf[buf.length - 1];
}
return buf.toString('base64', i, buf.length - n);
}
function base64End(buf) {
var r = buf && buf.length ? this.write(buf) : '';
if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
return r;
}
// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
function simpleWrite(buf) {
return buf.toString(this.encoding);
}
function simpleEnd(buf) {
return buf && buf.length ? this.write(buf) : '';
}
/***/ }),
/***/ 103:
/*!***************************************************************!*\
!*** ./node_modules/readable-stream/lib/_stream_transform.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// a transform stream is a readable/writable stream where you do
// something with the data. Sometimes it's called a "filter",
// but that's not a great name for it, since that implies a thing where
// some bits pass through, and others are simply ignored. (That would
// be a valid example of a transform, of course.)
//
// While the output is causally related to the input, it's not a
// necessarily symmetric or synchronous transformation. For example,
// a zlib stream might take multiple plain-text writes(), and then
// emit a single compressed chunk some time in the future.
//
// Here's how this works:
//
// The Transform stream has all the aspects of the readable and writable
// stream classes. When you write(chunk), that calls _write(chunk,cb)
// internally, and returns false if there's a lot of pending writes
// buffered up. When you call read(), that calls _read(n) until
// there's enough pending readable data buffered up.
//
// In a transform stream, the written data is placed in a buffer. When
// _read(n) is called, it transforms the queued up data, calling the
// buffered _write cb's as it consumes chunks. If consuming a single
// written chunk would result in multiple output chunks, then the first
// outputted bit calls the readcb, and subsequent chunks just go into
// the read buffer, and will cause it to emit 'readable' if necessary.
//
// This way, back-pressure is actually determined by the reading side,
// since _read has to be called to start processing a new chunk. However,
// a pathological inflate type of transform can cause excessive buffering
// here. For example, imagine a stream where every byte of input is
// interpreted as an integer from 0-255, and then results in that many
// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
// 1kb of data being output. In this case, you could write a very small
// amount of input, and end up with a very large amount of output. In
// such a pathological inflating mechanism, there'd be no way to tell
// the system to stop doing the transform. A single 4MB write could
// cause the system to run out of memory.
//
// However, even in such a pathological case, only a single written chunk
// would be consumed, and then the rest would wait (un-transformed) until
// the results of the previous transformed chunk were consumed.
module.exports = Transform;
var Duplex = __webpack_require__(/*! ./_stream_duplex */ 99);
/**/
var util = Object.create(__webpack_require__(/*! core-util-is */ 94));
util.inherits = __webpack_require__(/*! inherits */ 86);
/**/
util.inherits(Transform, Duplex);
function afterTransform(er, data) {
var ts = this._transformState;
ts.transforming = false;
var cb = ts.writecb;
if (!cb) {
return this.emit('error', new Error('write callback called multiple times'));
}
ts.writechunk = null;
ts.writecb = null;
if (data != null) // single equals check for both `null` and `undefined`
this.push(data);
cb(er);
var rs = this._readableState;
rs.reading = false;
if (rs.needReadable || rs.length < rs.highWaterMark) {
this._read(rs.highWaterMark);
}
}
function Transform(options) {
if (!(this instanceof Transform)) return new Transform(options);
Duplex.call(this, options);
this._transformState = {
afterTransform: afterTransform.bind(this),
needTransform: false,
transforming: false,
writecb: null,
writechunk: null,
writeencoding: null
};
// start out asking for a readable event once data is transformed.
this._readableState.needReadable = true;
// we have implemented the _read method, and done the other things
// that Readable wants before the first _read call, so unset the
// sync guard flag.
this._readableState.sync = false;
if (options) {
if (typeof options.transform === 'function') this._transform = options.transform;
if (typeof options.flush === 'function') this._flush = options.flush;
}
// When the writable side finishes, then flush out anything remaining.
this.on('prefinish', prefinish);
}
function prefinish() {
var _this = this;
if (typeof this._flush === 'function') {
this._flush(function (er, data) {
done(_this, er, data);
});
} else {
done(this, null, null);
}
}
Transform.prototype.push = function (chunk, encoding) {
this._transformState.needTransform = false;
return Duplex.prototype.push.call(this, chunk, encoding);
};
// This is the part where you do stuff!
// override this function in implementation classes.
// 'chunk' is an input chunk.
//
// Call `push(newChunk)` to pass along transformed output
// to the readable side. You may call 'push' zero or more times.
//
// Call `cb(err)` when you are done with this chunk. If you pass
// an error, then that'll put the hurt on the whole operation. If you
// never call cb(), then you'll never get another chunk.
Transform.prototype._transform = function (chunk, encoding, cb) {
throw new Error('_transform() is not implemented');
};
Transform.prototype._write = function (chunk, encoding, cb) {
var ts = this._transformState;
ts.writecb = cb;
ts.writechunk = chunk;
ts.writeencoding = encoding;
if (!ts.transforming) {
var rs = this._readableState;
if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
}
};
// Doesn't matter what the args are here.
// _transform does all the work.
// That we got here means that the readable side wants more data.
Transform.prototype._read = function (n) {
var ts = this._transformState;
if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
ts.transforming = true;
this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
} else {
// mark that we need a transform, so that any data that comes in
// will get processed, now that we've asked for it.
ts.needTransform = true;
}
};
Transform.prototype._destroy = function (err, cb) {
var _this2 = this;
Duplex.prototype._destroy.call(this, err, function (err2) {
cb(err2);
_this2.emit('close');
});
};
function done(stream, er, data) {
if (er) return stream.emit('error', er);
if (data != null) // single equals check for both `null` and `undefined`
stream.push(data);
// if there's nothing in the write buffer, then that means
// that nothing more will ever be provided
if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
return stream.push(null);
}
/***/ }),
/***/ 104:
/*!*****************************************************************!*\
!*** ./node_modules/readable-stream/lib/_stream_passthrough.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// a passthrough stream.
// basically just the most minimal sort of Transform stream.
// Every written chunk gets output as-is.
module.exports = PassThrough;
var Transform = __webpack_require__(/*! ./_stream_transform */ 103);
/**/
var util = Object.create(__webpack_require__(/*! core-util-is */ 94));
util.inherits = __webpack_require__(/*! inherits */ 86);
/**/
util.inherits(PassThrough, Transform);
function PassThrough(options) {
if (!(this instanceof PassThrough)) return new PassThrough(options);
Transform.call(this, options);
}
PassThrough.prototype._transform = function (chunk, encoding, cb) {
cb(null, chunk);
};
/***/ }),
/***/ 105:
/*!*****************************************!*\
!*** ./node_modules/ripemd160/index.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var Buffer = __webpack_require__(/*! buffer */ 81).Buffer
var inherits = __webpack_require__(/*! inherits */ 86)
var HashBase = __webpack_require__(/*! hash-base */ 88)
var ARRAY16 = new Array(16)
var zl = [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
]
var zr = [
5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
]
var sl = [
11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
]
var sr = [
8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
]
var hl = [0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e]
var hr = [0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000]
function RIPEMD160 () {
HashBase.call(this, 64)
// state
this._a = 0x67452301
this._b = 0xefcdab89
this._c = 0x98badcfe
this._d = 0x10325476
this._e = 0xc3d2e1f0
}
inherits(RIPEMD160, HashBase)
RIPEMD160.prototype._update = function () {
var words = ARRAY16
for (var j = 0; j < 16; ++j) words[j] = this._block.readInt32LE(j * 4)
var al = this._a | 0
var bl = this._b | 0
var cl = this._c | 0
var dl = this._d | 0
var el = this._e | 0
var ar = this._a | 0
var br = this._b | 0
var cr = this._c | 0
var dr = this._d | 0
var er = this._e | 0
// computation
for (var i = 0; i < 80; i += 1) {
var tl
var tr
if (i < 16) {
tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i])
tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i])
} else if (i < 32) {
tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i])
tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i])
} else if (i < 48) {
tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i])
tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i])
} else if (i < 64) {
tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i])
tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i])
} else { // if (i<80) {
tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i])
tr = 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
}
// update state
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 () {
// create padding and handle blocks
this._block[this._blockOffset++] = 0x80
if (this._blockOffset > 56) {
this._block.fill(0, this._blockOffset, 64)
this._update()
this._blockOffset = 0
}
this._block.fill(0, this._blockOffset, 56)
this._block.writeUInt32LE(this._length[0], 56)
this._block.writeUInt32LE(this._length[1], 60)
this._update()
// produce result
var buffer = Buffer.alloc ? Buffer.alloc(20) : new Buffer(20)
buffer.writeInt32LE(this._a, 0)
buffer.writeInt32LE(this._b, 4)
buffer.writeInt32LE(this._c, 8)
buffer.writeInt32LE(this._d, 12)
buffer.writeInt32LE(this._e, 16)
return buffer
}
function rotl (x, n) {
return (x << n) | (x >>> (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
}
module.exports = RIPEMD160
/***/ }),
/***/ 106:
/*!**************************************!*\
!*** ./node_modules/sha.js/index.js ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var exports = module.exports = function SHA (algorithm) {
algorithm = algorithm.toLowerCase()
var Algorithm = exports[algorithm]
if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')
return new Algorithm()
}
exports.sha = __webpack_require__(/*! ./sha */ 107)
exports.sha1 = __webpack_require__(/*! ./sha1 */ 109)
exports.sha224 = __webpack_require__(/*! ./sha224 */ 110)
exports.sha256 = __webpack_require__(/*! ./sha256 */ 111)
exports.sha384 = __webpack_require__(/*! ./sha384 */ 112)
exports.sha512 = __webpack_require__(/*! ./sha512 */ 113)
/***/ }),
/***/ 107:
/*!************************************!*\
!*** ./node_modules/sha.js/sha.js ***!
\************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/*
* A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined
* in FIPS PUB 180-1
* This source code is derived from sha1.js of the same repository.
* The difference between SHA-0 and SHA-1 is just a bitwise rotate left
* operation was added.
*/
var inherits = __webpack_require__(/*! inherits */ 86)
var Hash = __webpack_require__(/*! ./hash */ 108)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var K = [
0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
]
var W = new Array(80)
function Sha () {
this.init()
this._w = W
Hash.call(this, 64, 56)
}
inherits(Sha, Hash)
Sha.prototype.init = function () {
this._a = 0x67452301
this._b = 0xefcdab89
this._c = 0x98badcfe
this._d = 0x10325476
this._e = 0xc3d2e1f0
return this
}
function rotl5 (num) {
return (num << 5) | (num >>> 27)
}
function rotl30 (num) {
return (num << 30) | (num >>> 2)
}
function ft (s, b, c, d) {
if (s === 0) return (b & c) | ((~b) & d)
if (s === 2) return (b & c) | (b & d) | (c & d)
return b ^ c ^ d
}
Sha.prototype._update = function (M) {
var W = this._w
var a = this._a | 0
var b = this._b | 0
var c = this._c | 0
var d = this._d | 0
var e = this._e | 0
for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
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)
var 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
}
Sha.prototype._hash = function () {
var H = Buffer.allocUnsafe(20)
H.writeInt32BE(this._a | 0, 0)
H.writeInt32BE(this._b | 0, 4)
H.writeInt32BE(this._c | 0, 8)
H.writeInt32BE(this._d | 0, 12)
H.writeInt32BE(this._e | 0, 16)
return H
}
module.exports = Sha
/***/ }),
/***/ 108:
/*!*************************************!*\
!*** ./node_modules/sha.js/hash.js ***!
\*************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
// prototype class for hash functions
function Hash (blockSize, finalSize) {
this._block = Buffer.alloc(blockSize)
this._finalSize = finalSize
this._blockSize = blockSize
this._len = 0
}
Hash.prototype.update = function (data, enc) {
if (typeof data === 'string') {
enc = enc || 'utf8'
data = Buffer.from(data, enc)
}
var block = this._block
var blockSize = this._blockSize
var length = data.length
var accum = this._len
for (var offset = 0; offset < length;) {
var assigned = accum % blockSize
var remainder = Math.min(length - offset, blockSize - assigned)
for (var i = 0; i < remainder; i++) {
block[assigned + i] = data[offset + i]
}
accum += remainder
offset += remainder
if ((accum % blockSize) === 0) {
this._update(block)
}
}
this._len += length
return this
}
Hash.prototype.digest = function (enc) {
var rem = this._len % this._blockSize
this._block[rem] = 0x80
// zero (rem + 1) trailing bits, where (rem + 1) is the smallest
// non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize
this._block.fill(0, rem + 1)
if (rem >= this._finalSize) {
this._update(this._block)
this._block.fill(0)
}
var bits = this._len * 8
// uint32
if (bits <= 0xffffffff) {
this._block.writeUInt32BE(bits, this._blockSize - 4)
// uint64
} else {
var lowBits = (bits & 0xffffffff) >>> 0
var highBits = (bits - lowBits) / 0x100000000
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
/***/ }),
/***/ 1087:
/*!***********************************************************!*\
!*** E:/project/bigdata_WX/components/uni-icons/icons.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = {
'contact': "\uE100",
'person': "\uE101",
'personadd': "\uE102",
'contact-filled': "\uE130",
'person-filled': "\uE131",
'personadd-filled': "\uE132",
'phone': "\uE200",
'email': "\uE201",
'chatbubble': "\uE202",
'chatboxes': "\uE203",
'phone-filled': "\uE230",
'email-filled': "\uE231",
'chatbubble-filled': "\uE232",
'chatboxes-filled': "\uE233",
'weibo': "\uE260",
'weixin': "\uE261",
'pengyouquan': "\uE262",
'chat': "\uE263",
'qq': "\uE264",
'videocam': "\uE300",
'camera': "\uE301",
'mic': "\uE302",
'location': "\uE303",
'mic-filled': "\uE332",
'speech': "\uE332",
'location-filled': "\uE333",
'micoff': "\uE360",
'image': "\uE363",
'map': "\uE364",
'compose': "\uE400",
'trash': "\uE401",
'upload': "\uE402",
'download': "\uE403",
'close': "\uE404",
'redo': "\uE405",
'undo': "\uE406",
'refresh': "\uE407",
'star': "\uE408",
'plus': "\uE409",
'minus': "\uE410",
'circle': "\uE411",
'checkbox': "\uE411",
'close-filled': "\uE434",
'clear': "\uE434",
'refresh-filled': "\uE437",
'star-filled': "\uE438",
'plus-filled': "\uE439",
'minus-filled': "\uE440",
'circle-filled': "\uE441",
'checkbox-filled': "\uE442",
'closeempty': "\uE460",
'refreshempty': "\uE461",
'reload': "\uE462",
'starhalf': "\uE463",
'spinner': "\uE464",
'spinner-cycle': "\uE465",
'search': "\uE466",
'plusempty': "\uE468",
'forward': "\uE470",
'back': "\uE471",
'left-nav': "\uE471",
'checkmarkempty': "\uE472",
'home': "\uE500",
'navigate': "\uE501",
'gear': "\uE502",
'paperplane': "\uE503",
'info': "\uE504",
'help': "\uE505",
'locked': "\uE506",
'more': "\uE507",
'flag': "\uE508",
'home-filled': "\uE530",
'gear-filled': "\uE532",
'info-filled': "\uE534",
'help-filled': "\uE535",
'more-filled': "\uE537",
'settings': "\uE560",
'list': "\uE562",
'bars': "\uE563",
'loop': "\uE565",
'paperclip': "\uE567",
'eye': "\uE568",
'arrowup': "\uE580",
'arrowdown': "\uE581",
'arrowleft': "\uE582",
'arrowright': "\uE583",
'arrowthinup': "\uE584",
'arrowthindown': "\uE585",
'arrowthinleft': "\uE586",
'arrowthinright': "\uE587",
'pulldown': "\uE588",
'closefill': "\uE589",
'sound': "\uE590",
'scan': "\uE612"
};
exports.default = _default;
/***/ }),
/***/ 109:
/*!*************************************!*\
!*** ./node_modules/sha.js/sha1.js ***!
\*************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/*
* A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
* in FIPS PUB 180-1
* Version 2.1a Copyright Paul Johnston 2000 - 2002.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for details.
*/
var inherits = __webpack_require__(/*! inherits */ 86)
var Hash = __webpack_require__(/*! ./hash */ 108)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var K = [
0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
]
var W = new Array(80)
function Sha1 () {
this.init()
this._w = W
Hash.call(this, 64, 56)
}
inherits(Sha1, Hash)
Sha1.prototype.init = function () {
this._a = 0x67452301
this._b = 0xefcdab89
this._c = 0x98badcfe
this._d = 0x10325476
this._e = 0xc3d2e1f0
return this
}
function rotl1 (num) {
return (num << 1) | (num >>> 31)
}
function rotl5 (num) {
return (num << 5) | (num >>> 27)
}
function rotl30 (num) {
return (num << 30) | (num >>> 2)
}
function ft (s, b, c, d) {
if (s === 0) return (b & c) | ((~b) & d)
if (s === 2) return (b & c) | (b & d) | (c & d)
return b ^ c ^ d
}
Sha1.prototype._update = function (M) {
var W = this._w
var a = this._a | 0
var b = this._b | 0
var c = this._c | 0
var d = this._d | 0
var e = this._e | 0
for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])
for (var j = 0; j < 80; ++j) {
var s = ~~(j / 20)
var 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)
H.writeInt32BE(this._a | 0, 0)
H.writeInt32BE(this._b | 0, 4)
H.writeInt32BE(this._c | 0, 8)
H.writeInt32BE(this._d | 0, 12)
H.writeInt32BE(this._e | 0, 16)
return H
}
module.exports = Sha1
/***/ }),
/***/ 11:
/*!***************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
function _defineProperty(obj, key, value) {
key = toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 110:
/*!***************************************!*\
!*** ./node_modules/sha.js/sha224.js ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/**
* A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
* in FIPS 180-2
* Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
*
*/
var inherits = __webpack_require__(/*! inherits */ 86)
var Sha256 = __webpack_require__(/*! ./sha256 */ 111)
var Hash = __webpack_require__(/*! ./hash */ 108)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var W = new Array(64)
function Sha224 () {
this.init()
this._w = W // new Array(64)
Hash.call(this, 64, 56)
}
inherits(Sha224, Sha256)
Sha224.prototype.init = function () {
this._a = 0xc1059ed8
this._b = 0x367cd507
this._c = 0x3070dd17
this._d = 0xf70e5939
this._e = 0xffc00b31
this._f = 0x68581511
this._g = 0x64f98fa7
this._h = 0xbefa4fa4
return this
}
Sha224.prototype._hash = function () {
var H = Buffer.allocUnsafe(28)
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)
return H
}
module.exports = Sha224
/***/ }),
/***/ 1109:
/*!***********************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/util/emitter.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* 递归使用 call 方式this指向
* @param componentName // 需要找的组件的名称
* @param eventName // 事件名称
* @param params // 需要传递的参数
*/
function _broadcast(componentName, eventName, params) {
// 循环子节点找到名称一样的子节点 否则 递归 当前子节点
this.$children.map(function (child) {
if (componentName === child.$options.name) {
child.$emit.apply(child, [eventName].concat(params));
} else {
_broadcast.apply(child, [componentName, eventName].concat(params));
}
});
}
var _default = {
methods: {
/**
* 派发 (向上查找) (一个)
* @param componentName // 需要找的组件的名称
* @param eventName // 事件名称
* @param params // 需要传递的参数
*/
dispatch: function dispatch(componentName, eventName, params) {
var parent = this.$parent || this.$root; //$parent 找到最近的父节点 $root 根节点
var name = parent.$options.name; // 获取当前组件实例的name
// 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点
// 循环出当前名称的一样的组件实例
while (parent && (!name || name !== componentName)) {
parent = parent.$parent;
if (parent) {
name = parent.$options.name;
}
}
// 有节点表示当前找到了name一样的实例
if (parent) {
parent.$emit.apply(parent, [eventName].concat(params));
}
},
/**
* 广播 (向下查找) (广播多个)
* @param componentName // 需要找的组件的名称
* @param eventName // 事件名称
* @param params // 需要传递的参数
*/
broadcast: function broadcast(componentName, eventName, params) {
_broadcast.call(this, componentName, eventName, params);
}
}
};
exports.default = _default;
/***/ }),
/***/ 111:
/*!***************************************!*\
!*** ./node_modules/sha.js/sha256.js ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/**
* A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
* in FIPS 180-2
* Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
*
*/
var inherits = __webpack_require__(/*! inherits */ 86)
var Hash = __webpack_require__(/*! ./hash */ 108)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var K = [
0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
]
var W = new Array(64)
function Sha256 () {
this.init()
this._w = W // new Array(64)
Hash.call(this, 64, 56)
}
inherits(Sha256, Hash)
Sha256.prototype.init = function () {
this._a = 0x6a09e667
this._b = 0xbb67ae85
this._c = 0x3c6ef372
this._d = 0xa54ff53a
this._e = 0x510e527f
this._f = 0x9b05688c
this._g = 0x1f83d9ab
this._h = 0x5be0cd19
return this
}
function ch (x, y, z) {
return z ^ (x & (y ^ z))
}
function maj (x, y, z) {
return (x & y) | (z & (x | y))
}
function sigma0 (x) {
return (x >>> 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)
}
function gamma1 (x) {
return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)
}
Sha256.prototype._update = function (M) {
var W = this._w
var a = this._a | 0
var b = this._b | 0
var c = this._c | 0
var d = this._d | 0
var e = this._e | 0
var f = this._f | 0
var g = this._g | 0
var h = this._h | 0
for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0
for (var j = 0; j < 64; ++j) {
var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0
var 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)
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)
return H
}
module.exports = Sha256
/***/ }),
/***/ 112:
/*!***************************************!*\
!*** ./node_modules/sha.js/sha384.js ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var inherits = __webpack_require__(/*! inherits */ 86)
var SHA512 = __webpack_require__(/*! ./sha512 */ 113)
var Hash = __webpack_require__(/*! ./hash */ 108)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var W = new Array(160)
function Sha384 () {
this.init()
this._w = W
Hash.call(this, 128, 112)
}
inherits(Sha384, SHA512)
Sha384.prototype.init = function () {
this._ah = 0xcbbb9d5d
this._bh = 0x629a292a
this._ch = 0x9159015a
this._dh = 0x152fecd8
this._eh = 0x67332667
this._fh = 0x8eb44a87
this._gh = 0xdb0c2e0d
this._hh = 0x47b5481d
this._al = 0xc1059ed8
this._bl = 0x367cd507
this._cl = 0x3070dd17
this._dl = 0xf70e5939
this._el = 0xffc00b31
this._fl = 0x68581511
this._gl = 0x64f98fa7
this._hl = 0xbefa4fa4
return this
}
Sha384.prototype._hash = function () {
var H = Buffer.allocUnsafe(48)
function writeInt64BE (h, l, offset) {
H.writeInt32BE(h, offset)
H.writeInt32BE(l, offset + 4)
}
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)
return H
}
module.exports = Sha384
/***/ }),
/***/ 113:
/*!***************************************!*\
!*** ./node_modules/sha.js/sha512.js ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var inherits = __webpack_require__(/*! inherits */ 86)
var Hash = __webpack_require__(/*! ./hash */ 108)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var K = [
0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
]
var W = new Array(160)
function Sha512 () {
this.init()
this._w = W
Hash.call(this, 128, 112)
}
inherits(Sha512, Hash)
Sha512.prototype.init = function () {
this._ah = 0x6a09e667
this._bh = 0xbb67ae85
this._ch = 0x3c6ef372
this._dh = 0xa54ff53a
this._eh = 0x510e527f
this._fh = 0x9b05688c
this._gh = 0x1f83d9ab
this._hh = 0x5be0cd19
this._al = 0xf3bcc908
this._bl = 0x84caa73b
this._cl = 0xfe94f82b
this._dl = 0x5f1d36f1
this._el = 0xade682d1
this._fl = 0x2b3e6c1f
this._gl = 0xfb41bd6b
this._hl = 0x137e2179
return this
}
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) < (b >>> 0) ? 1 : 0
}
Sha512.prototype._update = function (M) {
var W = this._w
var ah = this._ah | 0
var bh = this._bh | 0
var ch = this._ch | 0
var dh = this._dh | 0
var eh = this._eh | 0
var fh = this._fh | 0
var gh = this._gh | 0
var hh = this._hh | 0
var al = this._al | 0
var bl = this._bl | 0
var cl = this._cl | 0
var dl = this._dl | 0
var el = this._el | 0
var fl = this._fl | 0
var gl = this._gl | 0
var hl = this._hl | 0
for (var i = 0; i < 32; i += 2) {
W[i] = M.readInt32BE(i * 4)
W[i + 1] = M.readInt32BE(i * 4 + 4)
}
for (; i < 160; i += 2) {
var xh = W[i - 15 * 2]
var xl = W[i - 15 * 2 + 1]
var gamma0 = Gamma0(xh, xl)
var gamma0l = Gamma0l(xl, xh)
xh = W[i - 2 * 2]
xl = W[i - 2 * 2 + 1]
var gamma1 = Gamma1(xh, xl)
var gamma1l = Gamma1l(xl, xh)
// W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
var Wi7h = W[i - 7 * 2]
var Wi7l = W[i - 7 * 2 + 1]
var Wi16h = W[i - 16 * 2]
var Wi16l = W[i - 16 * 2 + 1]
var Wil = (gamma0l + Wi7l) | 0
var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0
Wil = (Wil + gamma1l) | 0
Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0
Wil = (Wil + Wi16l) | 0
Wih = (Wih + Wi16h + getCarry(Wil, 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)
var majl = maj(al, bl, cl)
var sigma0h = sigma0(ah, al)
var sigma0l = sigma0(al, ah)
var sigma1h = sigma1(eh, el)
var sigma1l = sigma1(el, eh)
// t1 = h + sigma1 + ch + K[j] + W[j]
var Kih = K[j]
var Kil = K[j + 1]
var chh = Ch(eh, fh, gh)
var chl = Ch(el, fl, gl)
var t1l = (hl + sigma1l) | 0
var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0
t1l = (t1l + chl) | 0
t1h = (t1h + chh + getCarry(t1l, chl)) | 0
t1l = (t1l + Kil) | 0
t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0
t1l = (t1l + Wil) | 0
t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0
// t2 = sigma0 + maj
var t2l = (sigma0l + majl) | 0
var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0
hh = gh
hl = gl
gh = fh
gl = fl
fh = eh
fl = el
el = (dl + t1l) | 0
eh = (dh + t1h + getCarry(el, dl)) | 0
dh = ch
dl = cl
ch = bh
cl = bl
bh = ah
bl = al
al = (t1l + t2l) | 0
ah = (t1h + t2h + getCarry(al, 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)
}
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)
return H
}
module.exports = Sha512
/***/ }),
/***/ 114:
/*!*******************************************!*\
!*** ./node_modules/cipher-base/index.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var Transform = __webpack_require__(/*! stream */ 115).Transform
var StringDecoder = __webpack_require__(/*! string_decoder */ 102).StringDecoder
var inherits = __webpack_require__(/*! inherits */ 86)
function CipherBase (hashMode) {
Transform.call(this)
this.hashMode = typeof hashMode === 'string'
if (this.hashMode) {
this[hashMode] = this._finalOrDigest
} else {
this.final = this._finalOrDigest
}
if (this._final) {
this.__final = this._final
this._final = null
}
this._decoder = null
this._encoding = null
}
inherits(CipherBase, Transform)
CipherBase.prototype.update = function (data, inputEnc, outputEnc) {
if (typeof data === 'string') {
data = Buffer.from(data, inputEnc)
}
var outData = this._update(data)
if (this.hashMode) return this
if (outputEnc) {
outData = this._toString(outData, outputEnc)
}
return 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 {
if (this.hashMode) {
this._update(data)
} else {
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)
if (outputEnc) {
outData = this._toString(outData, outputEnc, true)
}
return outData
}
CipherBase.prototype._toString = function (value, enc, fin) {
if (!this._decoder) {
this._decoder = new StringDecoder(enc)
this._encoding = enc
}
if (this._encoding !== enc) throw new Error('can\'t switch encodings')
var out = this._decoder.write(value)
if (fin) {
out += this._decoder.end()
}
return out
}
module.exports = CipherBase
/***/ }),
/***/ 1145:
/*!*******************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/util/async-validator.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
/* eslint no-console:0 */
var formatRegExp = /%[sdj%]/g;
var warning = function warning() {}; // don't print warning message when in production env or node runtime
if (typeof process !== 'undefined' && Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"云飞智控","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}) && "development" !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') {
warning = function warning(type, errors) {
if (typeof console !== 'undefined' && console.warn) {
if (errors.every(function (e) {
return typeof e === 'string';
})) {
console.warn(type, errors);
}
}
};
}
function convertFieldsError(errors) {
if (!errors || !errors.length) return null;
var fields = {};
errors.forEach(function (error) {
var field = error.field;
fields[field] = fields[field] || [];
fields[field].push(error);
});
return fields;
}
function format() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var i = 1;
var f = args[0];
var len = args.length;
if (typeof f === 'function') {
return f.apply(null, args.slice(1));
}
if (typeof f === 'string') {
var str = String(f).replace(formatRegExp, function (x) {
if (x === '%%') {
return '%';
}
if (i >= len) {
return x;
}
switch (x) {
case '%s':
return String(args[i++]);
case '%d':
return Number(args[i++]);
case '%j':
try {
return JSON.stringify(args[i++]);
} catch (_) {
return '[Circular]';
}
break;
default:
return x;
}
});
for (var arg = args[i]; i < len; arg = args[++i]) {
str += " " + arg;
}
return str;
}
return f;
}
function isNativeStringType(type) {
return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';
}
function isEmptyValue(value, type) {
if (value === undefined || value === null) {
return true;
}
if (type === 'array' && Array.isArray(value) && !value.length) {
return true;
}
if (isNativeStringType(type) && typeof value === 'string' && !value) {
return true;
}
return false;
}
function asyncParallelArray(arr, func, callback) {
var results = [];
var total = 0;
var arrLength = arr.length;
function count(errors) {
results.push.apply(results, errors);
total++;
if (total === arrLength) {
callback(results);
}
}
arr.forEach(function (a) {
func(a, count);
});
}
function asyncSerialArray(arr, func, callback) {
var index = 0;
var arrLength = arr.length;
function next(errors) {
if (errors && errors.length) {
callback(errors);
return;
}
var original = index;
index = index + 1;
if (original < arrLength) {
func(arr[original], next);
} else {
callback([]);
}
}
next([]);
}
function flattenObjArr(objArr) {
var ret = [];
Object.keys(objArr).forEach(function (k) {
ret.push.apply(ret, objArr[k]);
});
return ret;
}
function asyncMap(objArr, option, func, callback) {
if (option.first) {
var _pending = new Promise(function (resolve, reject) {
var next = function next(errors) {
callback(errors);
return errors.length ? reject({
errors: errors,
fields: convertFieldsError(errors)
}) : resolve();
};
var flattenArr = flattenObjArr(objArr);
asyncSerialArray(flattenArr, func, next);
});
_pending["catch"](function (e) {
return e;
});
return _pending;
}
var firstFields = option.firstFields || [];
if (firstFields === true) {
firstFields = Object.keys(objArr);
}
var objArrKeys = Object.keys(objArr);
var objArrLength = objArrKeys.length;
var total = 0;
var results = [];
var pending = new Promise(function (resolve, reject) {
var next = function next(errors) {
results.push.apply(results, errors);
total++;
if (total === objArrLength) {
callback(results);
return results.length ? reject({
errors: results,
fields: convertFieldsError(results)
}) : resolve();
}
};
if (!objArrKeys.length) {
callback(results);
resolve();
}
objArrKeys.forEach(function (key) {
var arr = objArr[key];
if (firstFields.indexOf(key) !== -1) {
asyncSerialArray(arr, func, next);
} else {
asyncParallelArray(arr, func, next);
}
});
});
pending["catch"](function (e) {
return e;
});
return pending;
}
function complementError(rule) {
return function (oe) {
if (oe && oe.message) {
oe.field = oe.field || rule.fullField;
return oe;
}
return {
message: typeof oe === 'function' ? oe() : oe,
field: oe.field || rule.fullField
};
};
}
function deepMerge(target, source) {
if (source) {
for (var s in source) {
if (source.hasOwnProperty(s)) {
var value = source[s];
if ((0, _typeof2.default)(value) === 'object' && (0, _typeof2.default)(target[s]) === 'object') {
target[s] = _extends({}, target[s], {}, value);
} else {
target[s] = value;
}
}
}
}
return target;
}
/**
* Rule for validating required fields.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param source The source object being validated.
* @param errors An array of errors that this rule may add
* validation errors to.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function required(rule, value, source, errors, options, type) {
if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {
errors.push(format(options.messages.required, rule.fullField));
}
}
/**
* Rule for validating whitespace.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param source The source object being validated.
* @param errors An array of errors that this rule may add
* validation errors to.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function whitespace(rule, value, source, errors, options) {
if (/^\s+$/.test(value) || value === '') {
errors.push(format(options.messages.whitespace, rule.fullField));
}
}
/* eslint max-len:0 */
var pattern = {
// http://emailregex.com/
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", 'i'),
hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
};
var types = {
integer: function integer(value) {
return types.number(value) && parseInt(value, 10) === value;
},
"float": function float(value) {
return types.number(value) && !types.integer(value);
},
array: function array(value) {
return Array.isArray(value);
},
regexp: function regexp(value) {
if (value instanceof RegExp) {
return true;
}
try {
return !!new RegExp(value);
} catch (e) {
return false;
}
},
date: function date(value) {
return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear === 'function';
},
number: function number(value) {
if (isNaN(value)) {
return false;
}
// 修改源码,将字符串数值先转为数值
return typeof +value === 'number';
},
object: function object(value) {
return (0, _typeof2.default)(value) === 'object' && !types.array(value);
},
method: function method(value) {
return typeof value === 'function';
},
email: function email(value) {
return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
},
url: function url(value) {
return typeof value === 'string' && !!value.match(pattern.url);
},
hex: function hex(value) {
return typeof value === 'string' && !!value.match(pattern.hex);
}
};
/**
* Rule for validating the type of a value.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param source The source object being validated.
* @param errors An array of errors that this rule may add
* validation errors to.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function type(rule, value, source, errors, options) {
if (rule.required && value === undefined) {
required(rule, value, source, errors, options);
return;
}
var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
var ruleType = rule.type;
if (custom.indexOf(ruleType) > -1) {
if (!types[ruleType](value)) {
errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
} // straight typeof check
} else if (ruleType && (0, _typeof2.default)(value) !== rule.type) {
errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
}
}
/**
* Rule for validating minimum and maximum allowed values.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param source The source object being validated.
* @param errors An array of errors that this rule may add
* validation errors to.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function range(rule, value, source, errors, options) {
var len = typeof rule.len === 'number';
var min = typeof rule.min === 'number';
var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
var val = value;
var key = null;
var num = typeof value === 'number';
var str = typeof value === 'string';
var arr = Array.isArray(value);
if (num) {
key = 'number';
} else if (str) {
key = 'string';
} else if (arr) {
key = 'array';
} // if the value is not of a supported type for range validation
// the validation rule rule should use the
// type property to also test for a particular type
if (!key) {
return false;
}
if (arr) {
val = value.length;
}
if (str) {
// 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
val = value.replace(spRegexp, '_').length;
}
if (len) {
if (val !== rule.len) {
errors.push(format(options.messages[key].len, rule.fullField, rule.len));
}
} else if (min && !max && val < rule.min) {
errors.push(format(options.messages[key].min, rule.fullField, rule.min));
} else if (max && !min && val > rule.max) {
errors.push(format(options.messages[key].max, rule.fullField, rule.max));
} else if (min && max && (val < rule.min || val > rule.max)) {
errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
}
}
var ENUM = 'enum';
/**
* Rule for validating a value exists in an enumerable list.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param source The source object being validated.
* @param errors An array of errors that this rule may add
* validation errors to.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function enumerable(rule, value, source, errors, options) {
rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
if (rule[ENUM].indexOf(value) === -1) {
errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
}
}
/**
* Rule for validating a regular expression pattern.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param source The source object being validated.
* @param errors An array of errors that this rule may add
* validation errors to.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function pattern$1(rule, value, source, errors, options) {
if (rule.pattern) {
if (rule.pattern instanceof RegExp) {
// if a RegExp instance is passed, reset `lastIndex` in case its `global`
// flag is accidentally set to `true`, which in a validation scenario
// is not necessary and the result might be misleading
rule.pattern.lastIndex = 0;
if (!rule.pattern.test(value)) {
errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
}
} else if (typeof rule.pattern === 'string') {
var _pattern = new RegExp(rule.pattern);
if (!_pattern.test(value)) {
errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
}
}
}
}
var rules = {
required: required,
whitespace: whitespace,
type: type,
range: range,
"enum": enumerable,
pattern: pattern$1
};
/**
* Performs validation for string types.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function string(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value, 'string') && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options, 'string');
if (!isEmptyValue(value, 'string')) {
rules.type(rule, value, source, errors, options);
rules.range(rule, value, source, errors, options);
rules.pattern(rule, value, source, errors, options);
if (rule.whitespace === true) {
rules.whitespace(rule, value, source, errors, options);
}
}
}
callback(errors);
}
/**
* Validates a function.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function method(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== undefined) {
rules.type(rule, value, source, errors, options);
}
}
callback(errors);
}
/**
* Validates a number.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function number(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (value === '') {
value = undefined;
}
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== undefined) {
rules.type(rule, value, source, errors, options);
rules.range(rule, value, source, errors, options);
}
}
callback(errors);
}
/**
* Validates a boolean.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function _boolean(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== undefined) {
rules.type(rule, value, source, errors, options);
}
}
callback(errors);
}
/**
* Validates the regular expression type.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function regexp(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (!isEmptyValue(value)) {
rules.type(rule, value, source, errors, options);
}
}
callback(errors);
}
/**
* Validates a number is an integer.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function integer(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== undefined) {
rules.type(rule, value, source, errors, options);
rules.range(rule, value, source, errors, options);
}
}
callback(errors);
}
/**
* Validates a number is a floating point number.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function floatFn(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== undefined) {
rules.type(rule, value, source, errors, options);
rules.range(rule, value, source, errors, options);
}
}
callback(errors);
}
/**
* Validates an array.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function array(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value, 'array') && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options, 'array');
if (!isEmptyValue(value, 'array')) {
rules.type(rule, value, source, errors, options);
rules.range(rule, value, source, errors, options);
}
}
callback(errors);
}
/**
* Validates an object.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function object(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== undefined) {
rules.type(rule, value, source, errors, options);
}
}
callback(errors);
}
var ENUM$1 = 'enum';
/**
* Validates an enumerable list.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function enumerable$1(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== undefined) {
rules[ENUM$1](rule, value, source, errors, options);
}
}
callback(errors);
}
/**
* Validates a regular expression pattern.
*
* Performs validation when a rule only contains
* a pattern property but is not declared as a string type.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function pattern$2(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value, 'string') && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (!isEmptyValue(value, 'string')) {
rules.pattern(rule, value, source, errors, options);
}
}
callback(errors);
}
function date(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (!isEmptyValue(value)) {
var dateObject;
if (typeof value === 'number') {
dateObject = new Date(value);
} else {
dateObject = value;
}
rules.type(rule, dateObject, source, errors, options);
if (dateObject) {
rules.range(rule, dateObject.getTime(), source, errors, options);
}
}
}
callback(errors);
}
function required$1(rule, value, callback, source, options) {
var errors = [];
var type = Array.isArray(value) ? 'array' : (0, _typeof2.default)(value);
rules.required(rule, value, source, errors, options, type);
callback(errors);
}
function type$1(rule, value, callback, source, options) {
var ruleType = rule.type;
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value, ruleType) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options, ruleType);
if (!isEmptyValue(value, ruleType)) {
rules.type(rule, value, source, errors, options);
}
}
callback(errors);
}
/**
* Performs validation for any type.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function any(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
}
callback(errors);
}
var validators = {
string: string,
method: method,
number: number,
"boolean": _boolean,
regexp: regexp,
integer: integer,
"float": floatFn,
array: array,
object: object,
"enum": enumerable$1,
pattern: pattern$2,
date: date,
url: type$1,
hex: type$1,
email: type$1,
required: required$1,
any: any
};
function newMessages() {
return {
"default": 'Validation error on field %s',
required: '%s is required',
"enum": '%s must be one of %s',
whitespace: '%s cannot be empty',
date: {
format: '%s date %s is invalid for format %s',
parse: '%s date could not be parsed, %s is invalid ',
invalid: '%s date %s is invalid'
},
types: {
string: '%s is not a %s',
method: '%s is not a %s (function)',
array: '%s is not an %s',
object: '%s is not an %s',
number: '%s is not a %s',
date: '%s is not a %s',
"boolean": '%s is not a %s',
integer: '%s is not an %s',
"float": '%s is not a %s',
regexp: '%s is not a valid %s',
email: '%s is not a valid %s',
url: '%s is not a valid %s',
hex: '%s is not a valid %s'
},
string: {
len: '%s must be exactly %s characters',
min: '%s must be at least %s characters',
max: '%s cannot be longer than %s characters',
range: '%s must be between %s and %s characters'
},
number: {
len: '%s must equal %s',
min: '%s cannot be less than %s',
max: '%s cannot be greater than %s',
range: '%s must be between %s and %s'
},
array: {
len: '%s must be exactly %s in length',
min: '%s cannot be less than %s in length',
max: '%s cannot be greater than %s in length',
range: '%s must be between %s and %s in length'
},
pattern: {
mismatch: '%s value %s does not match pattern %s'
},
clone: function clone() {
var cloned = JSON.parse(JSON.stringify(this));
cloned.clone = this.clone;
return cloned;
}
};
}
var messages = newMessages();
/**
* Encapsulates a validation schema.
*
* @param descriptor An object declaring validation rules
* for this schema.
*/
function Schema(descriptor) {
this.rules = null;
this._messages = messages;
this.define(descriptor);
}
Schema.prototype = {
messages: function messages(_messages) {
if (_messages) {
this._messages = deepMerge(newMessages(), _messages);
}
return this._messages;
},
define: function define(rules) {
if (!rules) {
throw new Error('Cannot configure a schema with no rules');
}
if ((0, _typeof2.default)(rules) !== 'object' || Array.isArray(rules)) {
throw new Error('Rules must be an object');
}
this.rules = {};
var z;
var item;
for (z in rules) {
if (rules.hasOwnProperty(z)) {
item = rules[z];
this.rules[z] = Array.isArray(item) ? item : [item];
}
}
},
validate: function validate(source_, o, oc) {
var _this = this;
if (o === void 0) {
o = {};
}
if (oc === void 0) {
oc = function oc() {};
}
var source = source_;
var options = o;
var callback = oc;
if (typeof options === 'function') {
callback = options;
options = {};
}
if (!this.rules || Object.keys(this.rules).length === 0) {
if (callback) {
callback();
}
return Promise.resolve();
}
function complete(results) {
var i;
var errors = [];
var fields = {};
function add(e) {
if (Array.isArray(e)) {
var _errors;
errors = (_errors = errors).concat.apply(_errors, e);
} else {
errors.push(e);
}
}
for (i = 0; i < results.length; i++) {
add(results[i]);
}
if (!errors.length) {
errors = null;
fields = null;
} else {
fields = convertFieldsError(errors);
}
callback(errors, fields);
}
if (options.messages) {
var messages$1 = this.messages();
if (messages$1 === messages) {
messages$1 = newMessages();
}
deepMerge(messages$1, options.messages);
options.messages = messages$1;
} else {
options.messages = this.messages();
}
var arr;
var value;
var series = {};
var keys = options.keys || Object.keys(this.rules);
keys.forEach(function (z) {
arr = _this.rules[z];
value = source[z];
arr.forEach(function (r) {
var rule = r;
if (typeof rule.transform === 'function') {
if (source === source_) {
source = _extends({}, source);
}
value = source[z] = rule.transform(value);
}
if (typeof rule === 'function') {
rule = {
validator: rule
};
} else {
rule = _extends({}, rule);
}
rule.validator = _this.getValidationMethod(rule);
rule.field = z;
rule.fullField = rule.fullField || z;
rule.type = _this.getType(rule);
if (!rule.validator) {
return;
}
series[z] = series[z] || [];
series[z].push({
rule: rule,
value: value,
source: source,
field: z
});
});
});
var errorFields = {};
return asyncMap(series, options, function (data, doIt) {
var rule = data.rule;
var deep = (rule.type === 'object' || rule.type === 'array') && ((0, _typeof2.default)(rule.fields) === 'object' || (0, _typeof2.default)(rule.defaultField) === 'object');
deep = deep && (rule.required || !rule.required && data.value);
rule.field = data.field;
function addFullfield(key, schema) {
return _extends({}, schema, {
fullField: rule.fullField + "." + key
});
}
function cb(e) {
if (e === void 0) {
e = [];
}
var errors = e;
if (!Array.isArray(errors)) {
errors = [errors];
}
if (!options.suppressWarning && errors.length) {
Schema.warning('async-validator:', errors);
}
if (errors.length && rule.message) {
errors = [].concat(rule.message);
}
errors = errors.map(complementError(rule));
if (options.first && errors.length) {
errorFields[rule.field] = 1;
return doIt(errors);
}
if (!deep) {
doIt(errors);
} else {
// if rule is required but the target object
// does not exist fail at the rule level and don't
// go deeper
if (rule.required && !data.value) {
if (rule.message) {
errors = [].concat(rule.message).map(complementError(rule));
} else if (options.error) {
errors = [options.error(rule, format(options.messages.required, rule.field))];
} else {
errors = [];
}
return doIt(errors);
}
var fieldsSchema = {};
if (rule.defaultField) {
for (var k in data.value) {
if (data.value.hasOwnProperty(k)) {
fieldsSchema[k] = rule.defaultField;
}
}
}
fieldsSchema = _extends({}, fieldsSchema, {}, data.rule.fields);
for (var f in fieldsSchema) {
if (fieldsSchema.hasOwnProperty(f)) {
var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
}
}
var schema = new Schema(fieldsSchema);
schema.messages(options.messages);
if (data.rule.options) {
data.rule.options.messages = options.messages;
data.rule.options.error = options.error;
}
schema.validate(data.value, data.rule.options || options, function (errs) {
var finalErrors = [];
if (errors && errors.length) {
finalErrors.push.apply(finalErrors, errors);
}
if (errs && errs.length) {
finalErrors.push.apply(finalErrors, errs);
}
doIt(finalErrors.length ? finalErrors : null);
});
}
}
var res;
if (rule.asyncValidator) {
res = rule.asyncValidator(rule, data.value, cb, data.source, options);
} else if (rule.validator) {
res = rule.validator(rule, data.value, cb, data.source, options);
if (res === true) {
cb();
} else if (res === false) {
cb(rule.message || rule.field + " fails");
} else if (res instanceof Array) {
cb(res);
} else if (res instanceof Error) {
cb(res.message);
}
}
if (res && res.then) {
res.then(function () {
return cb();
}, function (e) {
return cb(e);
});
}
}, function (results) {
complete(results);
});
},
getType: function getType(rule) {
if (rule.type === undefined && rule.pattern instanceof RegExp) {
rule.type = 'pattern';
}
if (typeof rule.validator !== 'function' && rule.type && !validators.hasOwnProperty(rule.type)) {
throw new Error(format('Unknown rule type %s', rule.type));
}
return rule.type || 'string';
},
getValidationMethod: function getValidationMethod(rule) {
if (typeof rule.validator === 'function') {
return rule.validator;
}
var keys = Object.keys(rule);
var messageIndex = keys.indexOf('message');
if (messageIndex !== -1) {
keys.splice(messageIndex, 1);
}
if (keys.length === 1 && keys[0] === 'required') {
return validators.required;
}
return validators[this.getType(rule)] || false;
}
};
Schema.register = function register(type, validator) {
if (typeof validator !== 'function') {
throw new Error('Cannot register a validator by type, validator is not a function');
}
validators[type] = validator;
};
Schema.warning = warning;
Schema.messages = messages;
var _default = Schema;
exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/node-libs-browser/mock/process.js */ 78)))
/***/ }),
/***/ 115:
/*!*************************************************!*\
!*** ./node_modules/stream-browserify/index.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
module.exports = Stream;
var EE = __webpack_require__(/*! events */ 92).EventEmitter;
var inherits = __webpack_require__(/*! inherits */ 86);
inherits(Stream, EE);
Stream.Readable = __webpack_require__(/*! readable-stream/readable.js */ 89);
Stream.Writable = __webpack_require__(/*! readable-stream/writable.js */ 116);
Stream.Duplex = __webpack_require__(/*! readable-stream/duplex.js */ 117);
Stream.Transform = __webpack_require__(/*! readable-stream/transform.js */ 118);
Stream.PassThrough = __webpack_require__(/*! readable-stream/passthrough.js */ 119);
// Backwards-compat with node 0.4.x
Stream.Stream = Stream;
// old-style streams. Note that the pipe method (the only relevant
// part of this class) is overridden in the Readable class.
function Stream() {
EE.call(this);
}
Stream.prototype.pipe = function(dest, options) {
var source = this;
function ondata(chunk) {
if (dest.writable) {
if (false === dest.write(chunk) && source.pause) {
source.pause();
}
}
}
source.on('data', ondata);
function ondrain() {
if (source.readable && source.resume) {
source.resume();
}
}
dest.on('drain', ondrain);
// If the 'end' option is not supplied, dest.end() will be called when
// source gets the 'end' or 'close' events. Only dest.end() once.
if (!dest._isStdio && (!options || options.end !== false)) {
source.on('end', onend);
source.on('close', onclose);
}
var didOnEnd = false;
function onend() {
if (didOnEnd) return;
didOnEnd = true;
dest.end();
}
function onclose() {
if (didOnEnd) return;
didOnEnd = true;
if (typeof dest.destroy === 'function') dest.destroy();
}
// don't leave dangling pipes when there are errors.
function onerror(er) {
cleanup();
if (EE.listenerCount(this, 'error') === 0) {
throw er; // Unhandled stream error in pipe.
}
}
source.on('error', onerror);
dest.on('error', onerror);
// remove all the event listeners that were added.
function cleanup() {
source.removeListener('data', ondata);
dest.removeListener('drain', ondrain);
source.removeListener('end', onend);
source.removeListener('close', onclose);
source.removeListener('error', onerror);
dest.removeListener('error', onerror);
source.removeListener('end', cleanup);
source.removeListener('close', cleanup);
dest.removeListener('close', cleanup);
}
source.on('end', cleanup);
source.on('close', cleanup);
dest.on('close', cleanup);
dest.emit('pipe', source);
// Allow for unix-like usage: A.pipe(B).pipe(C)
return dest;
};
/***/ }),
/***/ 116:
/*!**********************************************************!*\
!*** ./node_modules/readable-stream/writable-browser.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./lib/_stream_writable.js */ 100);
/***/ }),
/***/ 117:
/*!********************************************************!*\
!*** ./node_modules/readable-stream/duplex-browser.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./lib/_stream_duplex.js */ 99);
/***/ }),
/***/ 118:
/*!***************************************************!*\
!*** ./node_modules/readable-stream/transform.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./readable */ 89).Transform
/***/ }),
/***/ 119:
/*!*****************************************************!*\
!*** ./node_modules/readable-stream/passthrough.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./readable */ 89).PassThrough
/***/ }),
/***/ 12:
/*!**************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
function toPropertyKey(t) {
var i = toPrimitive(t, "string");
return "symbol" == _typeof(i) ? i : String(i);
}
module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 120:
/*!*********************************************!*\
!*** ./node_modules/create-hmac/browser.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var inherits = __webpack_require__(/*! inherits */ 86)
var Legacy = __webpack_require__(/*! ./legacy */ 121)
var Base = __webpack_require__(/*! cipher-base */ 114)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var md5 = __webpack_require__(/*! create-hash/md5 */ 122)
var RIPEMD160 = __webpack_require__(/*! ripemd160 */ 105)
var sha = __webpack_require__(/*! sha.js */ 106)
var ZEROS = Buffer.alloc(128)
function Hmac (alg, key) {
Base.call(this, 'digest')
if (typeof key === 'string') {
key = Buffer.from(key)
}
var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64
this._alg = alg
this._key = key
if (key.length > blocksize) {
var hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)
key = hash.update(key).digest()
} else if (key.length < blocksize) {
key = Buffer.concat([key, ZEROS], blocksize)
}
var ipad = this._ipad = Buffer.allocUnsafe(blocksize)
var opad = this._opad = Buffer.allocUnsafe(blocksize)
for (var i = 0; i < blocksize; i++) {
ipad[i] = key[i] ^ 0x36
opad[i] = key[i] ^ 0x5C
}
this._hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)
this._hash.update(ipad)
}
inherits(Hmac, Base)
Hmac.prototype._update = function (data) {
this._hash.update(data)
}
Hmac.prototype._final = function () {
var h = this._hash.digest()
var hash = this._alg === 'rmd160' ? new RIPEMD160() : sha(this._alg)
return hash.update(this._opad).update(h).digest()
}
module.exports = function createHmac (alg, key) {
alg = alg.toLowerCase()
if (alg === 'rmd160' || alg === 'ripemd160') {
return new Hmac('rmd160', key)
}
if (alg === 'md5') {
return new Legacy(md5, key)
}
return new Hmac(alg, key)
}
/***/ }),
/***/ 1209:
/*!************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/util/province.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var provinceData = [{
"label": "北京市",
"value": "11"
}, {
"label": "天津市",
"value": "12"
}, {
"label": "河北省",
"value": "13"
}, {
"label": "山西省",
"value": "14"
}, {
"label": "内蒙古自治区",
"value": "15"
}, {
"label": "辽宁省",
"value": "21"
}, {
"label": "吉林省",
"value": "22"
}, {
"label": "黑龙江省",
"value": "23"
}, {
"label": "上海市",
"value": "31"
}, {
"label": "江苏省",
"value": "32"
}, {
"label": "浙江省",
"value": "33"
}, {
"label": "安徽省",
"value": "34"
}, {
"label": "福建省",
"value": "35"
}, {
"label": "江西省",
"value": "36"
}, {
"label": "山东省",
"value": "37"
}, {
"label": "河南省",
"value": "41"
}, {
"label": "湖北省",
"value": "42"
}, {
"label": "湖南省",
"value": "43"
}, {
"label": "广东省",
"value": "44"
}, {
"label": "广西壮族自治区",
"value": "45"
}, {
"label": "海南省",
"value": "46"
}, {
"label": "重庆市",
"value": "50"
}, {
"label": "四川省",
"value": "51"
}, {
"label": "贵州省",
"value": "52"
}, {
"label": "云南省",
"value": "53"
}, {
"label": "西藏自治区",
"value": "54"
}, {
"label": "陕西省",
"value": "61"
}, {
"label": "甘肃省",
"value": "62"
}, {
"label": "青海省",
"value": "63"
}, {
"label": "宁夏回族自治区",
"value": "64"
}, {
"label": "新疆维吾尔自治区",
"value": "65"
}, {
"label": "台湾",
"value": "66"
}, {
"label": "香港",
"value": "67"
}, {
"label": "澳门",
"value": "68"
}];
var _default = provinceData;
exports.default = _default;
/***/ }),
/***/ 121:
/*!********************************************!*\
!*** ./node_modules/create-hmac/legacy.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var inherits = __webpack_require__(/*! inherits */ 86)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var Base = __webpack_require__(/*! cipher-base */ 114)
var ZEROS = Buffer.alloc(128)
var blocksize = 64
function Hmac (alg, key) {
Base.call(this, 'digest')
if (typeof key === 'string') {
key = Buffer.from(key)
}
this._alg = alg
this._key = key
if (key.length > blocksize) {
key = alg(key)
} else if (key.length < blocksize) {
key = Buffer.concat([key, ZEROS], blocksize)
}
var ipad = this._ipad = Buffer.allocUnsafe(blocksize)
var opad = this._opad = Buffer.allocUnsafe(blocksize)
for (var i = 0; i < blocksize; i++) {
ipad[i] = key[i] ^ 0x36
opad[i] = key[i] ^ 0x5C
}
this._hash = [ipad]
}
inherits(Hmac, Base)
Hmac.prototype._update = function (data) {
this._hash.push(data)
}
Hmac.prototype._final = function () {
var h = this._alg(Buffer.concat(this._hash))
return this._alg(Buffer.concat([this._opad, h]))
}
module.exports = Hmac
/***/ }),
/***/ 1210:
/*!********************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/util/city.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var cityData = [[{
"label": "市辖区",
"value": "1101"
}], [{
"label": "市辖区",
"value": "1201"
}], [{
"label": "石家庄市",
"value": "1301"
}, {
"label": "唐山市",
"value": "1302"
}, {
"label": "秦皇岛市",
"value": "1303"
}, {
"label": "邯郸市",
"value": "1304"
}, {
"label": "邢台市",
"value": "1305"
}, {
"label": "保定市",
"value": "1306"
}, {
"label": "张家口市",
"value": "1307"
}, {
"label": "承德市",
"value": "1308"
}, {
"label": "沧州市",
"value": "1309"
}, {
"label": "廊坊市",
"value": "1310"
}, {
"label": "衡水市",
"value": "1311"
}], [{
"label": "太原市",
"value": "1401"
}, {
"label": "大同市",
"value": "1402"
}, {
"label": "阳泉市",
"value": "1403"
}, {
"label": "长治市",
"value": "1404"
}, {
"label": "晋城市",
"value": "1405"
}, {
"label": "朔州市",
"value": "1406"
}, {
"label": "晋中市",
"value": "1407"
}, {
"label": "运城市",
"value": "1408"
}, {
"label": "忻州市",
"value": "1409"
}, {
"label": "临汾市",
"value": "1410"
}, {
"label": "吕梁市",
"value": "1411"
}], [{
"label": "呼和浩特市",
"value": "1501"
}, {
"label": "包头市",
"value": "1502"
}, {
"label": "乌海市",
"value": "1503"
}, {
"label": "赤峰市",
"value": "1504"
}, {
"label": "通辽市",
"value": "1505"
}, {
"label": "鄂尔多斯市",
"value": "1506"
}, {
"label": "呼伦贝尔市",
"value": "1507"
}, {
"label": "巴彦淖尔市",
"value": "1508"
}, {
"label": "乌兰察布市",
"value": "1509"
}, {
"label": "兴安盟",
"value": "1522"
}, {
"label": "锡林郭勒盟",
"value": "1525"
}, {
"label": "阿拉善盟",
"value": "1529"
}], [{
"label": "沈阳市",
"value": "2101"
}, {
"label": "大连市",
"value": "2102"
}, {
"label": "鞍山市",
"value": "2103"
}, {
"label": "抚顺市",
"value": "2104"
}, {
"label": "本溪市",
"value": "2105"
}, {
"label": "丹东市",
"value": "2106"
}, {
"label": "锦州市",
"value": "2107"
}, {
"label": "营口市",
"value": "2108"
}, {
"label": "阜新市",
"value": "2109"
}, {
"label": "辽阳市",
"value": "2110"
}, {
"label": "盘锦市",
"value": "2111"
}, {
"label": "铁岭市",
"value": "2112"
}, {
"label": "朝阳市",
"value": "2113"
}, {
"label": "葫芦岛市",
"value": "2114"
}], [{
"label": "长春市",
"value": "2201"
}, {
"label": "吉林市",
"value": "2202"
}, {
"label": "四平市",
"value": "2203"
}, {
"label": "辽源市",
"value": "2204"
}, {
"label": "通化市",
"value": "2205"
}, {
"label": "白山市",
"value": "2206"
}, {
"label": "松原市",
"value": "2207"
}, {
"label": "白城市",
"value": "2208"
}, {
"label": "延边朝鲜族自治州",
"value": "2224"
}], [{
"label": "哈尔滨市",
"value": "2301"
}, {
"label": "齐齐哈尔市",
"value": "2302"
}, {
"label": "鸡西市",
"value": "2303"
}, {
"label": "鹤岗市",
"value": "2304"
}, {
"label": "双鸭山市",
"value": "2305"
}, {
"label": "大庆市",
"value": "2306"
}, {
"label": "伊春市",
"value": "2307"
}, {
"label": "佳木斯市",
"value": "2308"
}, {
"label": "七台河市",
"value": "2309"
}, {
"label": "牡丹江市",
"value": "2310"
}, {
"label": "黑河市",
"value": "2311"
}, {
"label": "绥化市",
"value": "2312"
}, {
"label": "大兴安岭地区",
"value": "2327"
}], [{
"label": "市辖区",
"value": "3101"
}], [{
"label": "南京市",
"value": "3201"
}, {
"label": "无锡市",
"value": "3202"
}, {
"label": "徐州市",
"value": "3203"
}, {
"label": "常州市",
"value": "3204"
}, {
"label": "苏州市",
"value": "3205"
}, {
"label": "南通市",
"value": "3206"
}, {
"label": "连云港市",
"value": "3207"
}, {
"label": "淮安市",
"value": "3208"
}, {
"label": "盐城市",
"value": "3209"
}, {
"label": "扬州市",
"value": "3210"
}, {
"label": "镇江市",
"value": "3211"
}, {
"label": "泰州市",
"value": "3212"
}, {
"label": "宿迁市",
"value": "3213"
}], [{
"label": "杭州市",
"value": "3301"
}, {
"label": "宁波市",
"value": "3302"
}, {
"label": "温州市",
"value": "3303"
}, {
"label": "嘉兴市",
"value": "3304"
}, {
"label": "湖州市",
"value": "3305"
}, {
"label": "绍兴市",
"value": "3306"
}, {
"label": "金华市",
"value": "3307"
}, {
"label": "衢州市",
"value": "3308"
}, {
"label": "舟山市",
"value": "3309"
}, {
"label": "台州市",
"value": "3310"
}, {
"label": "丽水市",
"value": "3311"
}], [{
"label": "合肥市",
"value": "3401"
}, {
"label": "芜湖市",
"value": "3402"
}, {
"label": "蚌埠市",
"value": "3403"
}, {
"label": "淮南市",
"value": "3404"
}, {
"label": "马鞍山市",
"value": "3405"
}, {
"label": "淮北市",
"value": "3406"
}, {
"label": "铜陵市",
"value": "3407"
}, {
"label": "安庆市",
"value": "3408"
}, {
"label": "黄山市",
"value": "3410"
}, {
"label": "滁州市",
"value": "3411"
}, {
"label": "阜阳市",
"value": "3412"
}, {
"label": "宿州市",
"value": "3413"
}, {
"label": "六安市",
"value": "3415"
}, {
"label": "亳州市",
"value": "3416"
}, {
"label": "池州市",
"value": "3417"
}, {
"label": "宣城市",
"value": "3418"
}], [{
"label": "福州市",
"value": "3501"
}, {
"label": "厦门市",
"value": "3502"
}, {
"label": "莆田市",
"value": "3503"
}, {
"label": "三明市",
"value": "3504"
}, {
"label": "泉州市",
"value": "3505"
}, {
"label": "漳州市",
"value": "3506"
}, {
"label": "南平市",
"value": "3507"
}, {
"label": "龙岩市",
"value": "3508"
}, {
"label": "宁德市",
"value": "3509"
}], [{
"label": "南昌市",
"value": "3601"
}, {
"label": "景德镇市",
"value": "3602"
}, {
"label": "萍乡市",
"value": "3603"
}, {
"label": "九江市",
"value": "3604"
}, {
"label": "新余市",
"value": "3605"
}, {
"label": "鹰潭市",
"value": "3606"
}, {
"label": "赣州市",
"value": "3607"
}, {
"label": "吉安市",
"value": "3608"
}, {
"label": "宜春市",
"value": "3609"
}, {
"label": "抚州市",
"value": "3610"
}, {
"label": "上饶市",
"value": "3611"
}], [{
"label": "济南市",
"value": "3701"
}, {
"label": "青岛市",
"value": "3702"
}, {
"label": "淄博市",
"value": "3703"
}, {
"label": "枣庄市",
"value": "3704"
}, {
"label": "东营市",
"value": "3705"
}, {
"label": "烟台市",
"value": "3706"
}, {
"label": "潍坊市",
"value": "3707"
}, {
"label": "济宁市",
"value": "3708"
}, {
"label": "泰安市",
"value": "3709"
}, {
"label": "威海市",
"value": "3710"
}, {
"label": "日照市",
"value": "3711"
}, {
"label": "莱芜市",
"value": "3712"
}, {
"label": "临沂市",
"value": "3713"
}, {
"label": "德州市",
"value": "3714"
}, {
"label": "聊城市",
"value": "3715"
}, {
"label": "滨州市",
"value": "3716"
}, {
"label": "菏泽市",
"value": "3717"
}], [{
"label": "郑州市",
"value": "4101"
}, {
"label": "开封市",
"value": "4102"
}, {
"label": "洛阳市",
"value": "4103"
}, {
"label": "平顶山市",
"value": "4104"
}, {
"label": "安阳市",
"value": "4105"
}, {
"label": "鹤壁市",
"value": "4106"
}, {
"label": "新乡市",
"value": "4107"
}, {
"label": "焦作市",
"value": "4108"
}, {
"label": "濮阳市",
"value": "4109"
}, {
"label": "许昌市",
"value": "4110"
}, {
"label": "漯河市",
"value": "4111"
}, {
"label": "三门峡市",
"value": "4112"
}, {
"label": "南阳市",
"value": "4113"
}, {
"label": "商丘市",
"value": "4114"
}, {
"label": "信阳市",
"value": "4115"
}, {
"label": "周口市",
"value": "4116"
}, {
"label": "驻马店市",
"value": "4117"
}, {
"label": "省直辖县级行政区划",
"value": "4190"
}], [{
"label": "武汉市",
"value": "4201"
}, {
"label": "黄石市",
"value": "4202"
}, {
"label": "十堰市",
"value": "4203"
}, {
"label": "宜昌市",
"value": "4205"
}, {
"label": "襄阳市",
"value": "4206"
}, {
"label": "鄂州市",
"value": "4207"
}, {
"label": "荆门市",
"value": "4208"
}, {
"label": "孝感市",
"value": "4209"
}, {
"label": "荆州市",
"value": "4210"
}, {
"label": "黄冈市",
"value": "4211"
}, {
"label": "咸宁市",
"value": "4212"
}, {
"label": "随州市",
"value": "4213"
}, {
"label": "恩施土家族苗族自治州",
"value": "4228"
}, {
"label": "省直辖县级行政区划",
"value": "4290"
}], [{
"label": "长沙市",
"value": "4301"
}, {
"label": "株洲市",
"value": "4302"
}, {
"label": "湘潭市",
"value": "4303"
}, {
"label": "衡阳市",
"value": "4304"
}, {
"label": "邵阳市",
"value": "4305"
}, {
"label": "岳阳市",
"value": "4306"
}, {
"label": "常德市",
"value": "4307"
}, {
"label": "张家界市",
"value": "4308"
}, {
"label": "益阳市",
"value": "4309"
}, {
"label": "郴州市",
"value": "4310"
}, {
"label": "永州市",
"value": "4311"
}, {
"label": "怀化市",
"value": "4312"
}, {
"label": "娄底市",
"value": "4313"
}, {
"label": "湘西土家族苗族自治州",
"value": "4331"
}], [{
"label": "广州市",
"value": "4401"
}, {
"label": "韶关市",
"value": "4402"
}, {
"label": "深圳市",
"value": "4403"
}, {
"label": "珠海市",
"value": "4404"
}, {
"label": "汕头市",
"value": "4405"
}, {
"label": "佛山市",
"value": "4406"
}, {
"label": "江门市",
"value": "4407"
}, {
"label": "湛江市",
"value": "4408"
}, {
"label": "茂名市",
"value": "4409"
}, {
"label": "肇庆市",
"value": "4412"
}, {
"label": "惠州市",
"value": "4413"
}, {
"label": "梅州市",
"value": "4414"
}, {
"label": "汕尾市",
"value": "4415"
}, {
"label": "河源市",
"value": "4416"
}, {
"label": "阳江市",
"value": "4417"
}, {
"label": "清远市",
"value": "4418"
}, {
"label": "东莞市",
"value": "4419"
}, {
"label": "中山市",
"value": "4420"
}, {
"label": "潮州市",
"value": "4451"
}, {
"label": "揭阳市",
"value": "4452"
}, {
"label": "云浮市",
"value": "4453"
}], [{
"label": "南宁市",
"value": "4501"
}, {
"label": "柳州市",
"value": "4502"
}, {
"label": "桂林市",
"value": "4503"
}, {
"label": "梧州市",
"value": "4504"
}, {
"label": "北海市",
"value": "4505"
}, {
"label": "防城港市",
"value": "4506"
}, {
"label": "钦州市",
"value": "4507"
}, {
"label": "贵港市",
"value": "4508"
}, {
"label": "玉林市",
"value": "4509"
}, {
"label": "百色市",
"value": "4510"
}, {
"label": "贺州市",
"value": "4511"
}, {
"label": "河池市",
"value": "4512"
}, {
"label": "来宾市",
"value": "4513"
}, {
"label": "崇左市",
"value": "4514"
}], [{
"label": "海口市",
"value": "4601"
}, {
"label": "三亚市",
"value": "4602"
}, {
"label": "三沙市",
"value": "4603"
}, {
"label": "儋州市",
"value": "4604"
}, {
"label": "省直辖县级行政区划",
"value": "4690"
}], [{
"label": "市辖区",
"value": "5001"
}, {
"label": "县",
"value": "5002"
}], [{
"label": "成都市",
"value": "5101"
}, {
"label": "自贡市",
"value": "5103"
}, {
"label": "攀枝花市",
"value": "5104"
}, {
"label": "泸州市",
"value": "5105"
}, {
"label": "德阳市",
"value": "5106"
}, {
"label": "绵阳市",
"value": "5107"
}, {
"label": "广元市",
"value": "5108"
}, {
"label": "遂宁市",
"value": "5109"
}, {
"label": "内江市",
"value": "5110"
}, {
"label": "乐山市",
"value": "5111"
}, {
"label": "南充市",
"value": "5113"
}, {
"label": "眉山市",
"value": "5114"
}, {
"label": "宜宾市",
"value": "5115"
}, {
"label": "广安市",
"value": "5116"
}, {
"label": "达州市",
"value": "5117"
}, {
"label": "雅安市",
"value": "5118"
}, {
"label": "巴中市",
"value": "5119"
}, {
"label": "资阳市",
"value": "5120"
}, {
"label": "阿坝藏族羌族自治州",
"value": "5132"
}, {
"label": "甘孜藏族自治州",
"value": "5133"
}, {
"label": "凉山彝族自治州",
"value": "5134"
}], [{
"label": "贵阳市",
"value": "5201"
}, {
"label": "六盘水市",
"value": "5202"
}, {
"label": "遵义市",
"value": "5203"
}, {
"label": "安顺市",
"value": "5204"
}, {
"label": "毕节市",
"value": "5205"
}, {
"label": "铜仁市",
"value": "5206"
}, {
"label": "黔西南布依族苗族自治州",
"value": "5223"
}, {
"label": "黔东南苗族侗族自治州",
"value": "5226"
}, {
"label": "黔南布依族苗族自治州",
"value": "5227"
}], [{
"label": "昆明市",
"value": "5301"
}, {
"label": "曲靖市",
"value": "5303"
}, {
"label": "玉溪市",
"value": "5304"
}, {
"label": "保山市",
"value": "5305"
}, {
"label": "昭通市",
"value": "5306"
}, {
"label": "丽江市",
"value": "5307"
}, {
"label": "普洱市",
"value": "5308"
}, {
"label": "临沧市",
"value": "5309"
}, {
"label": "楚雄彝族自治州",
"value": "5323"
}, {
"label": "红河哈尼族彝族自治州",
"value": "5325"
}, {
"label": "文山壮族苗族自治州",
"value": "5326"
}, {
"label": "西双版纳傣族自治州",
"value": "5328"
}, {
"label": "大理白族自治州",
"value": "5329"
}, {
"label": "德宏傣族景颇族自治州",
"value": "5331"
}, {
"label": "怒江傈僳族自治州",
"value": "5333"
}, {
"label": "迪庆藏族自治州",
"value": "5334"
}], [{
"label": "拉萨市",
"value": "5401"
}, {
"label": "日喀则市",
"value": "5402"
}, {
"label": "昌都市",
"value": "5403"
}, {
"label": "林芝市",
"value": "5404"
}, {
"label": "山南市",
"value": "5405"
}, {
"label": "那曲地区",
"value": "5424"
}, {
"label": "阿里地区",
"value": "5425"
}], [{
"label": "西安市",
"value": "6101"
}, {
"label": "铜川市",
"value": "6102"
}, {
"label": "宝鸡市",
"value": "6103"
}, {
"label": "咸阳市",
"value": "6104"
}, {
"label": "渭南市",
"value": "6105"
}, {
"label": "延安市",
"value": "6106"
}, {
"label": "汉中市",
"value": "6107"
}, {
"label": "榆林市",
"value": "6108"
}, {
"label": "安康市",
"value": "6109"
}, {
"label": "商洛市",
"value": "6110"
}], [{
"label": "兰州市",
"value": "6201"
}, {
"label": "嘉峪关市",
"value": "6202"
}, {
"label": "金昌市",
"value": "6203"
}, {
"label": "白银市",
"value": "6204"
}, {
"label": "天水市",
"value": "6205"
}, {
"label": "武威市",
"value": "6206"
}, {
"label": "张掖市",
"value": "6207"
}, {
"label": "平凉市",
"value": "6208"
}, {
"label": "酒泉市",
"value": "6209"
}, {
"label": "庆阳市",
"value": "6210"
}, {
"label": "定西市",
"value": "6211"
}, {
"label": "陇南市",
"value": "6212"
}, {
"label": "临夏回族自治州",
"value": "6229"
}, {
"label": "甘南藏族自治州",
"value": "6230"
}], [{
"label": "西宁市",
"value": "6301"
}, {
"label": "海东市",
"value": "6302"
}, {
"label": "海北藏族自治州",
"value": "6322"
}, {
"label": "黄南藏族自治州",
"value": "6323"
}, {
"label": "海南藏族自治州",
"value": "6325"
}, {
"label": "果洛藏族自治州",
"value": "6326"
}, {
"label": "玉树藏族自治州",
"value": "6327"
}, {
"label": "海西蒙古族藏族自治州",
"value": "6328"
}], [{
"label": "银川市",
"value": "6401"
}, {
"label": "石嘴山市",
"value": "6402"
}, {
"label": "吴忠市",
"value": "6403"
}, {
"label": "固原市",
"value": "6404"
}, {
"label": "中卫市",
"value": "6405"
}], [{
"label": "乌鲁木齐市",
"value": "6501"
}, {
"label": "克拉玛依市",
"value": "6502"
}, {
"label": "吐鲁番市",
"value": "6504"
}, {
"label": "哈密市",
"value": "6505"
}, {
"label": "昌吉回族自治州",
"value": "6523"
}, {
"label": "博尔塔拉蒙古自治州",
"value": "6527"
}, {
"label": "巴音郭楞蒙古自治州",
"value": "6528"
}, {
"label": "阿克苏地区",
"value": "6529"
}, {
"label": "克孜勒苏柯尔克孜自治州",
"value": "6530"
}, {
"label": "喀什地区",
"value": "6531"
}, {
"label": "和田地区",
"value": "6532"
}, {
"label": "伊犁哈萨克自治州",
"value": "6540"
}, {
"label": "塔城地区",
"value": "6542"
}, {
"label": "阿勒泰地区",
"value": "6543"
}, {
"label": "自治区直辖县级行政区划",
"value": "6590"
}], [{
"label": "台北",
"value": "6601"
}, {
"label": "高雄",
"value": "6602"
}, {
"label": "基隆",
"value": "6603"
}, {
"label": "台中",
"value": "6604"
}, {
"label": "台南",
"value": "6605"
}, {
"label": "新竹",
"value": "6606"
}, {
"label": "嘉义",
"value": "6607"
}, {
"label": "宜兰",
"value": "6608"
}, {
"label": "桃园",
"value": "6609"
}, {
"label": "苗栗",
"value": "6610"
}, {
"label": "彰化",
"value": "6611"
}, {
"label": "南投",
"value": "6612"
}, {
"label": "云林",
"value": "6613"
}, {
"label": "屏东",
"value": "6614"
}, {
"label": "台东",
"value": "6615"
}, {
"label": "花莲",
"value": "6616"
}, {
"label": "澎湖",
"value": "6617"
}], [{
"label": "香港岛",
"value": "6701"
}, {
"label": "九龙",
"value": "6702"
}, {
"label": "新界",
"value": "6703"
}], [{
"label": "澳门半岛",
"value": "6801"
}, {
"label": "氹仔岛",
"value": "6802"
}, {
"label": "路环岛",
"value": "6803"
}, {
"label": "路氹城",
"value": "6804"
}]];
var _default = cityData;
exports.default = _default;
/***/ }),
/***/ 1211:
/*!********************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/util/area.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var areaData = [[[{
"label": "东城区",
"value": "110101"
}, {
"label": "西城区",
"value": "110102"
}, {
"label": "朝阳区",
"value": "110105"
}, {
"label": "丰台区",
"value": "110106"
}, {
"label": "石景山区",
"value": "110107"
}, {
"label": "海淀区",
"value": "110108"
}, {
"label": "门头沟区",
"value": "110109"
}, {
"label": "房山区",
"value": "110111"
}, {
"label": "通州区",
"value": "110112"
}, {
"label": "顺义区",
"value": "110113"
}, {
"label": "昌平区",
"value": "110114"
}, {
"label": "大兴区",
"value": "110115"
}, {
"label": "怀柔区",
"value": "110116"
}, {
"label": "平谷区",
"value": "110117"
}, {
"label": "密云区",
"value": "110118"
}, {
"label": "延庆区",
"value": "110119"
}]], [[{
"label": "和平区",
"value": "120101"
}, {
"label": "河东区",
"value": "120102"
}, {
"label": "河西区",
"value": "120103"
}, {
"label": "南开区",
"value": "120104"
}, {
"label": "河北区",
"value": "120105"
}, {
"label": "红桥区",
"value": "120106"
}, {
"label": "东丽区",
"value": "120110"
}, {
"label": "西青区",
"value": "120111"
}, {
"label": "津南区",
"value": "120112"
}, {
"label": "北辰区",
"value": "120113"
}, {
"label": "武清区",
"value": "120114"
}, {
"label": "宝坻区",
"value": "120115"
}, {
"label": "滨海新区",
"value": "120116"
}, {
"label": "宁河区",
"value": "120117"
}, {
"label": "静海区",
"value": "120118"
}, {
"label": "蓟州区",
"value": "120119"
}]], [[{
"label": "长安区",
"value": "130102"
}, {
"label": "桥西区",
"value": "130104"
}, {
"label": "新华区",
"value": "130105"
}, {
"label": "井陉矿区",
"value": "130107"
}, {
"label": "裕华区",
"value": "130108"
}, {
"label": "藁城区",
"value": "130109"
}, {
"label": "鹿泉区",
"value": "130110"
}, {
"label": "栾城区",
"value": "130111"
}, {
"label": "井陉县",
"value": "130121"
}, {
"label": "正定县",
"value": "130123"
}, {
"label": "行唐县",
"value": "130125"
}, {
"label": "灵寿县",
"value": "130126"
}, {
"label": "高邑县",
"value": "130127"
}, {
"label": "深泽县",
"value": "130128"
}, {
"label": "赞皇县",
"value": "130129"
}, {
"label": "无极县",
"value": "130130"
}, {
"label": "平山县",
"value": "130131"
}, {
"label": "元氏县",
"value": "130132"
}, {
"label": "赵县",
"value": "130133"
}, {
"label": "石家庄高新技术产业开发区",
"value": "130171"
}, {
"label": "石家庄循环化工园区",
"value": "130172"
}, {
"label": "辛集市",
"value": "130181"
}, {
"label": "晋州市",
"value": "130183"
}, {
"label": "新乐市",
"value": "130184"
}], [{
"label": "路南区",
"value": "130202"
}, {
"label": "路北区",
"value": "130203"
}, {
"label": "古冶区",
"value": "130204"
}, {
"label": "开平区",
"value": "130205"
}, {
"label": "丰南区",
"value": "130207"
}, {
"label": "丰润区",
"value": "130208"
}, {
"label": "曹妃甸区",
"value": "130209"
}, {
"label": "滦县",
"value": "130223"
}, {
"label": "滦南县",
"value": "130224"
}, {
"label": "乐亭县",
"value": "130225"
}, {
"label": "迁西县",
"value": "130227"
}, {
"label": "玉田县",
"value": "130229"
}, {
"label": "唐山市芦台经济技术开发区",
"value": "130271"
}, {
"label": "唐山市汉沽管理区",
"value": "130272"
}, {
"label": "唐山高新技术产业开发区",
"value": "130273"
}, {
"label": "河北唐山海港经济开发区",
"value": "130274"
}, {
"label": "遵化市",
"value": "130281"
}, {
"label": "迁安市",
"value": "130283"
}], [{
"label": "海港区",
"value": "130302"
}, {
"label": "山海关区",
"value": "130303"
}, {
"label": "北戴河区",
"value": "130304"
}, {
"label": "抚宁区",
"value": "130306"
}, {
"label": "青龙满族自治县",
"value": "130321"
}, {
"label": "昌黎县",
"value": "130322"
}, {
"label": "卢龙县",
"value": "130324"
}, {
"label": "秦皇岛市经济技术开发区",
"value": "130371"
}, {
"label": "北戴河新区",
"value": "130372"
}], [{
"label": "邯山区",
"value": "130402"
}, {
"label": "丛台区",
"value": "130403"
}, {
"label": "复兴区",
"value": "130404"
}, {
"label": "峰峰矿区",
"value": "130406"
}, {
"label": "肥乡区",
"value": "130407"
}, {
"label": "永年区",
"value": "130408"
}, {
"label": "临漳县",
"value": "130423"
}, {
"label": "成安县",
"value": "130424"
}, {
"label": "大名县",
"value": "130425"
}, {
"label": "涉县",
"value": "130426"
}, {
"label": "磁县",
"value": "130427"
}, {
"label": "邱县",
"value": "130430"
}, {
"label": "鸡泽县",
"value": "130431"
}, {
"label": "广平县",
"value": "130432"
}, {
"label": "馆陶县",
"value": "130433"
}, {
"label": "魏县",
"value": "130434"
}, {
"label": "曲周县",
"value": "130435"
}, {
"label": "邯郸经济技术开发区",
"value": "130471"
}, {
"label": "邯郸冀南新区",
"value": "130473"
}, {
"label": "武安市",
"value": "130481"
}], [{
"label": "桥东区",
"value": "130502"
}, {
"label": "桥西区",
"value": "130503"
}, {
"label": "邢台县",
"value": "130521"
}, {
"label": "临城县",
"value": "130522"
}, {
"label": "内丘县",
"value": "130523"
}, {
"label": "柏乡县",
"value": "130524"
}, {
"label": "隆尧县",
"value": "130525"
}, {
"label": "任县",
"value": "130526"
}, {
"label": "南和县",
"value": "130527"
}, {
"label": "宁晋县",
"value": "130528"
}, {
"label": "巨鹿县",
"value": "130529"
}, {
"label": "新河县",
"value": "130530"
}, {
"label": "广宗县",
"value": "130531"
}, {
"label": "平乡县",
"value": "130532"
}, {
"label": "威县",
"value": "130533"
}, {
"label": "清河县",
"value": "130534"
}, {
"label": "临西县",
"value": "130535"
}, {
"label": "河北邢台经济开发区",
"value": "130571"
}, {
"label": "南宫市",
"value": "130581"
}, {
"label": "沙河市",
"value": "130582"
}], [{
"label": "竞秀区",
"value": "130602"
}, {
"label": "莲池区",
"value": "130606"
}, {
"label": "满城区",
"value": "130607"
}, {
"label": "清苑区",
"value": "130608"
}, {
"label": "徐水区",
"value": "130609"
}, {
"label": "涞水县",
"value": "130623"
}, {
"label": "阜平县",
"value": "130624"
}, {
"label": "定兴县",
"value": "130626"
}, {
"label": "唐县",
"value": "130627"
}, {
"label": "高阳县",
"value": "130628"
}, {
"label": "容城县",
"value": "130629"
}, {
"label": "涞源县",
"value": "130630"
}, {
"label": "望都县",
"value": "130631"
}, {
"label": "安新县",
"value": "130632"
}, {
"label": "易县",
"value": "130633"
}, {
"label": "曲阳县",
"value": "130634"
}, {
"label": "蠡县",
"value": "130635"
}, {
"label": "顺平县",
"value": "130636"
}, {
"label": "博野县",
"value": "130637"
}, {
"label": "雄县",
"value": "130638"
}, {
"label": "保定高新技术产业开发区",
"value": "130671"
}, {
"label": "保定白沟新城",
"value": "130672"
}, {
"label": "涿州市",
"value": "130681"
}, {
"label": "定州市",
"value": "130682"
}, {
"label": "安国市",
"value": "130683"
}, {
"label": "高碑店市",
"value": "130684"
}], [{
"label": "桥东区",
"value": "130702"
}, {
"label": "桥西区",
"value": "130703"
}, {
"label": "宣化区",
"value": "130705"
}, {
"label": "下花园区",
"value": "130706"
}, {
"label": "万全区",
"value": "130708"
}, {
"label": "崇礼区",
"value": "130709"
}, {
"label": "张北县",
"value": "130722"
}, {
"label": "康保县",
"value": "130723"
}, {
"label": "沽源县",
"value": "130724"
}, {
"label": "尚义县",
"value": "130725"
}, {
"label": "蔚县",
"value": "130726"
}, {
"label": "阳原县",
"value": "130727"
}, {
"label": "怀安县",
"value": "130728"
}, {
"label": "怀来县",
"value": "130730"
}, {
"label": "涿鹿县",
"value": "130731"
}, {
"label": "赤城县",
"value": "130732"
}, {
"label": "张家口市高新技术产业开发区",
"value": "130771"
}, {
"label": "张家口市察北管理区",
"value": "130772"
}, {
"label": "张家口市塞北管理区",
"value": "130773"
}], [{
"label": "双桥区",
"value": "130802"
}, {
"label": "双滦区",
"value": "130803"
}, {
"label": "鹰手营子矿区",
"value": "130804"
}, {
"label": "承德县",
"value": "130821"
}, {
"label": "兴隆县",
"value": "130822"
}, {
"label": "滦平县",
"value": "130824"
}, {
"label": "隆化县",
"value": "130825"
}, {
"label": "丰宁满族自治县",
"value": "130826"
}, {
"label": "宽城满族自治县",
"value": "130827"
}, {
"label": "围场满族蒙古族自治县",
"value": "130828"
}, {
"label": "承德高新技术产业开发区",
"value": "130871"
}, {
"label": "平泉市",
"value": "130881"
}], [{
"label": "新华区",
"value": "130902"
}, {
"label": "运河区",
"value": "130903"
}, {
"label": "沧县",
"value": "130921"
}, {
"label": "青县",
"value": "130922"
}, {
"label": "东光县",
"value": "130923"
}, {
"label": "海兴县",
"value": "130924"
}, {
"label": "盐山县",
"value": "130925"
}, {
"label": "肃宁县",
"value": "130926"
}, {
"label": "南皮县",
"value": "130927"
}, {
"label": "吴桥县",
"value": "130928"
}, {
"label": "献县",
"value": "130929"
}, {
"label": "孟村回族自治县",
"value": "130930"
}, {
"label": "河北沧州经济开发区",
"value": "130971"
}, {
"label": "沧州高新技术产业开发区",
"value": "130972"
}, {
"label": "沧州渤海新区",
"value": "130973"
}, {
"label": "泊头市",
"value": "130981"
}, {
"label": "任丘市",
"value": "130982"
}, {
"label": "黄骅市",
"value": "130983"
}, {
"label": "河间市",
"value": "130984"
}], [{
"label": "安次区",
"value": "131002"
}, {
"label": "广阳区",
"value": "131003"
}, {
"label": "固安县",
"value": "131022"
}, {
"label": "永清县",
"value": "131023"
}, {
"label": "香河县",
"value": "131024"
}, {
"label": "大城县",
"value": "131025"
}, {
"label": "文安县",
"value": "131026"
}, {
"label": "大厂回族自治县",
"value": "131028"
}, {
"label": "廊坊经济技术开发区",
"value": "131071"
}, {
"label": "霸州市",
"value": "131081"
}, {
"label": "三河市",
"value": "131082"
}], [{
"label": "桃城区",
"value": "131102"
}, {
"label": "冀州区",
"value": "131103"
}, {
"label": "枣强县",
"value": "131121"
}, {
"label": "武邑县",
"value": "131122"
}, {
"label": "武强县",
"value": "131123"
}, {
"label": "饶阳县",
"value": "131124"
}, {
"label": "安平县",
"value": "131125"
}, {
"label": "故城县",
"value": "131126"
}, {
"label": "景县",
"value": "131127"
}, {
"label": "阜城县",
"value": "131128"
}, {
"label": "河北衡水经济开发区",
"value": "131171"
}, {
"label": "衡水滨湖新区",
"value": "131172"
}, {
"label": "深州市",
"value": "131182"
}]], [[{
"label": "小店区",
"value": "140105"
}, {
"label": "迎泽区",
"value": "140106"
}, {
"label": "杏花岭区",
"value": "140107"
}, {
"label": "尖草坪区",
"value": "140108"
}, {
"label": "万柏林区",
"value": "140109"
}, {
"label": "晋源区",
"value": "140110"
}, {
"label": "清徐县",
"value": "140121"
}, {
"label": "阳曲县",
"value": "140122"
}, {
"label": "娄烦县",
"value": "140123"
}, {
"label": "山西转型综合改革示范区",
"value": "140171"
}, {
"label": "古交市",
"value": "140181"
}], [{
"label": "城区",
"value": "140202"
}, {
"label": "矿区",
"value": "140203"
}, {
"label": "南郊区",
"value": "140211"
}, {
"label": "新荣区",
"value": "140212"
}, {
"label": "阳高县",
"value": "140221"
}, {
"label": "天镇县",
"value": "140222"
}, {
"label": "广灵县",
"value": "140223"
}, {
"label": "灵丘县",
"value": "140224"
}, {
"label": "浑源县",
"value": "140225"
}, {
"label": "左云县",
"value": "140226"
}, {
"label": "大同县",
"value": "140227"
}, {
"label": "山西大同经济开发区",
"value": "140271"
}], [{
"label": "城区",
"value": "140302"
}, {
"label": "矿区",
"value": "140303"
}, {
"label": "郊区",
"value": "140311"
}, {
"label": "平定县",
"value": "140321"
}, {
"label": "盂县",
"value": "140322"
}, {
"label": "山西阳泉经济开发区",
"value": "140371"
}], [{
"label": "城区",
"value": "140402"
}, {
"label": "郊区",
"value": "140411"
}, {
"label": "长治县",
"value": "140421"
}, {
"label": "襄垣县",
"value": "140423"
}, {
"label": "屯留县",
"value": "140424"
}, {
"label": "平顺县",
"value": "140425"
}, {
"label": "黎城县",
"value": "140426"
}, {
"label": "壶关县",
"value": "140427"
}, {
"label": "长子县",
"value": "140428"
}, {
"label": "武乡县",
"value": "140429"
}, {
"label": "沁县",
"value": "140430"
}, {
"label": "沁源县",
"value": "140431"
}, {
"label": "山西长治高新技术产业园区",
"value": "140471"
}, {
"label": "潞城市",
"value": "140481"
}], [{
"label": "城区",
"value": "140502"
}, {
"label": "沁水县",
"value": "140521"
}, {
"label": "阳城县",
"value": "140522"
}, {
"label": "陵川县",
"value": "140524"
}, {
"label": "泽州县",
"value": "140525"
}, {
"label": "高平市",
"value": "140581"
}], [{
"label": "朔城区",
"value": "140602"
}, {
"label": "平鲁区",
"value": "140603"
}, {
"label": "山阴县",
"value": "140621"
}, {
"label": "应县",
"value": "140622"
}, {
"label": "右玉县",
"value": "140623"
}, {
"label": "怀仁县",
"value": "140624"
}, {
"label": "山西朔州经济开发区",
"value": "140671"
}], [{
"label": "榆次区",
"value": "140702"
}, {
"label": "榆社县",
"value": "140721"
}, {
"label": "左权县",
"value": "140722"
}, {
"label": "和顺县",
"value": "140723"
}, {
"label": "昔阳县",
"value": "140724"
}, {
"label": "寿阳县",
"value": "140725"
}, {
"label": "太谷县",
"value": "140726"
}, {
"label": "祁县",
"value": "140727"
}, {
"label": "平遥县",
"value": "140728"
}, {
"label": "灵石县",
"value": "140729"
}, {
"label": "介休市",
"value": "140781"
}], [{
"label": "盐湖区",
"value": "140802"
}, {
"label": "临猗县",
"value": "140821"
}, {
"label": "万荣县",
"value": "140822"
}, {
"label": "闻喜县",
"value": "140823"
}, {
"label": "稷山县",
"value": "140824"
}, {
"label": "新绛县",
"value": "140825"
}, {
"label": "绛县",
"value": "140826"
}, {
"label": "垣曲县",
"value": "140827"
}, {
"label": "夏县",
"value": "140828"
}, {
"label": "平陆县",
"value": "140829"
}, {
"label": "芮城县",
"value": "140830"
}, {
"label": "永济市",
"value": "140881"
}, {
"label": "河津市",
"value": "140882"
}], [{
"label": "忻府区",
"value": "140902"
}, {
"label": "定襄县",
"value": "140921"
}, {
"label": "五台县",
"value": "140922"
}, {
"label": "代县",
"value": "140923"
}, {
"label": "繁峙县",
"value": "140924"
}, {
"label": "宁武县",
"value": "140925"
}, {
"label": "静乐县",
"value": "140926"
}, {
"label": "神池县",
"value": "140927"
}, {
"label": "五寨县",
"value": "140928"
}, {
"label": "岢岚县",
"value": "140929"
}, {
"label": "河曲县",
"value": "140930"
}, {
"label": "保德县",
"value": "140931"
}, {
"label": "偏关县",
"value": "140932"
}, {
"label": "五台山风景名胜区",
"value": "140971"
}, {
"label": "原平市",
"value": "140981"
}], [{
"label": "尧都区",
"value": "141002"
}, {
"label": "曲沃县",
"value": "141021"
}, {
"label": "翼城县",
"value": "141022"
}, {
"label": "襄汾县",
"value": "141023"
}, {
"label": "洪洞县",
"value": "141024"
}, {
"label": "古县",
"value": "141025"
}, {
"label": "安泽县",
"value": "141026"
}, {
"label": "浮山县",
"value": "141027"
}, {
"label": "吉县",
"value": "141028"
}, {
"label": "乡宁县",
"value": "141029"
}, {
"label": "大宁县",
"value": "141030"
}, {
"label": "隰县",
"value": "141031"
}, {
"label": "永和县",
"value": "141032"
}, {
"label": "蒲县",
"value": "141033"
}, {
"label": "汾西县",
"value": "141034"
}, {
"label": "侯马市",
"value": "141081"
}, {
"label": "霍州市",
"value": "141082"
}], [{
"label": "离石区",
"value": "141102"
}, {
"label": "文水县",
"value": "141121"
}, {
"label": "交城县",
"value": "141122"
}, {
"label": "兴县",
"value": "141123"
}, {
"label": "临县",
"value": "141124"
}, {
"label": "柳林县",
"value": "141125"
}, {
"label": "石楼县",
"value": "141126"
}, {
"label": "岚县",
"value": "141127"
}, {
"label": "方山县",
"value": "141128"
}, {
"label": "中阳县",
"value": "141129"
}, {
"label": "交口县",
"value": "141130"
}, {
"label": "孝义市",
"value": "141181"
}, {
"label": "汾阳市",
"value": "141182"
}]], [[{
"label": "新城区",
"value": "150102"
}, {
"label": "回民区",
"value": "150103"
}, {
"label": "玉泉区",
"value": "150104"
}, {
"label": "赛罕区",
"value": "150105"
}, {
"label": "土默特左旗",
"value": "150121"
}, {
"label": "托克托县",
"value": "150122"
}, {
"label": "和林格尔县",
"value": "150123"
}, {
"label": "清水河县",
"value": "150124"
}, {
"label": "武川县",
"value": "150125"
}, {
"label": "呼和浩特金海工业园区",
"value": "150171"
}, {
"label": "呼和浩特经济技术开发区",
"value": "150172"
}], [{
"label": "东河区",
"value": "150202"
}, {
"label": "昆都仑区",
"value": "150203"
}, {
"label": "青山区",
"value": "150204"
}, {
"label": "石拐区",
"value": "150205"
}, {
"label": "白云鄂博矿区",
"value": "150206"
}, {
"label": "九原区",
"value": "150207"
}, {
"label": "土默特右旗",
"value": "150221"
}, {
"label": "固阳县",
"value": "150222"
}, {
"label": "达尔罕茂明安联合旗",
"value": "150223"
}, {
"label": "包头稀土高新技术产业开发区",
"value": "150271"
}], [{
"label": "海勃湾区",
"value": "150302"
}, {
"label": "海南区",
"value": "150303"
}, {
"label": "乌达区",
"value": "150304"
}], [{
"label": "红山区",
"value": "150402"
}, {
"label": "元宝山区",
"value": "150403"
}, {
"label": "松山区",
"value": "150404"
}, {
"label": "阿鲁科尔沁旗",
"value": "150421"
}, {
"label": "巴林左旗",
"value": "150422"
}, {
"label": "巴林右旗",
"value": "150423"
}, {
"label": "林西县",
"value": "150424"
}, {
"label": "克什克腾旗",
"value": "150425"
}, {
"label": "翁牛特旗",
"value": "150426"
}, {
"label": "喀喇沁旗",
"value": "150428"
}, {
"label": "宁城县",
"value": "150429"
}, {
"label": "敖汉旗",
"value": "150430"
}], [{
"label": "科尔沁区",
"value": "150502"
}, {
"label": "科尔沁左翼中旗",
"value": "150521"
}, {
"label": "科尔沁左翼后旗",
"value": "150522"
}, {
"label": "开鲁县",
"value": "150523"
}, {
"label": "库伦旗",
"value": "150524"
}, {
"label": "奈曼旗",
"value": "150525"
}, {
"label": "扎鲁特旗",
"value": "150526"
}, {
"label": "通辽经济技术开发区",
"value": "150571"
}, {
"label": "霍林郭勒市",
"value": "150581"
}], [{
"label": "东胜区",
"value": "150602"
}, {
"label": "康巴什区",
"value": "150603"
}, {
"label": "达拉特旗",
"value": "150621"
}, {
"label": "准格尔旗",
"value": "150622"
}, {
"label": "鄂托克前旗",
"value": "150623"
}, {
"label": "鄂托克旗",
"value": "150624"
}, {
"label": "杭锦旗",
"value": "150625"
}, {
"label": "乌审旗",
"value": "150626"
}, {
"label": "伊金霍洛旗",
"value": "150627"
}], [{
"label": "海拉尔区",
"value": "150702"
}, {
"label": "扎赉诺尔区",
"value": "150703"
}, {
"label": "阿荣旗",
"value": "150721"
}, {
"label": "莫力达瓦达斡尔族自治旗",
"value": "150722"
}, {
"label": "鄂伦春自治旗",
"value": "150723"
}, {
"label": "鄂温克族自治旗",
"value": "150724"
}, {
"label": "陈巴尔虎旗",
"value": "150725"
}, {
"label": "新巴尔虎左旗",
"value": "150726"
}, {
"label": "新巴尔虎右旗",
"value": "150727"
}, {
"label": "满洲里市",
"value": "150781"
}, {
"label": "牙克石市",
"value": "150782"
}, {
"label": "扎兰屯市",
"value": "150783"
}, {
"label": "额尔古纳市",
"value": "150784"
}, {
"label": "根河市",
"value": "150785"
}], [{
"label": "临河区",
"value": "150802"
}, {
"label": "五原县",
"value": "150821"
}, {
"label": "磴口县",
"value": "150822"
}, {
"label": "乌拉特前旗",
"value": "150823"
}, {
"label": "乌拉特中旗",
"value": "150824"
}, {
"label": "乌拉特后旗",
"value": "150825"
}, {
"label": "杭锦后旗",
"value": "150826"
}], [{
"label": "集宁区",
"value": "150902"
}, {
"label": "卓资县",
"value": "150921"
}, {
"label": "化德县",
"value": "150922"
}, {
"label": "商都县",
"value": "150923"
}, {
"label": "兴和县",
"value": "150924"
}, {
"label": "凉城县",
"value": "150925"
}, {
"label": "察哈尔右翼前旗",
"value": "150926"
}, {
"label": "察哈尔右翼中旗",
"value": "150927"
}, {
"label": "察哈尔右翼后旗",
"value": "150928"
}, {
"label": "四子王旗",
"value": "150929"
}, {
"label": "丰镇市",
"value": "150981"
}], [{
"label": "乌兰浩特市",
"value": "152201"
}, {
"label": "阿尔山市",
"value": "152202"
}, {
"label": "科尔沁右翼前旗",
"value": "152221"
}, {
"label": "科尔沁右翼中旗",
"value": "152222"
}, {
"label": "扎赉特旗",
"value": "152223"
}, {
"label": "突泉县",
"value": "152224"
}], [{
"label": "二连浩特市",
"value": "152501"
}, {
"label": "锡林浩特市",
"value": "152502"
}, {
"label": "阿巴嘎旗",
"value": "152522"
}, {
"label": "苏尼特左旗",
"value": "152523"
}, {
"label": "苏尼特右旗",
"value": "152524"
}, {
"label": "东乌珠穆沁旗",
"value": "152525"
}, {
"label": "西乌珠穆沁旗",
"value": "152526"
}, {
"label": "太仆寺旗",
"value": "152527"
}, {
"label": "镶黄旗",
"value": "152528"
}, {
"label": "正镶白旗",
"value": "152529"
}, {
"label": "正蓝旗",
"value": "152530"
}, {
"label": "多伦县",
"value": "152531"
}, {
"label": "乌拉盖管委会",
"value": "152571"
}], [{
"label": "阿拉善左旗",
"value": "152921"
}, {
"label": "阿拉善右旗",
"value": "152922"
}, {
"label": "额济纳旗",
"value": "152923"
}, {
"label": "内蒙古阿拉善经济开发区",
"value": "152971"
}]], [[{
"label": "和平区",
"value": "210102"
}, {
"label": "沈河区",
"value": "210103"
}, {
"label": "大东区",
"value": "210104"
}, {
"label": "皇姑区",
"value": "210105"
}, {
"label": "铁西区",
"value": "210106"
}, {
"label": "苏家屯区",
"value": "210111"
}, {
"label": "浑南区",
"value": "210112"
}, {
"label": "沈北新区",
"value": "210113"
}, {
"label": "于洪区",
"value": "210114"
}, {
"label": "辽中区",
"value": "210115"
}, {
"label": "康平县",
"value": "210123"
}, {
"label": "法库县",
"value": "210124"
}, {
"label": "新民市",
"value": "210181"
}], [{
"label": "中山区",
"value": "210202"
}, {
"label": "西岗区",
"value": "210203"
}, {
"label": "沙河口区",
"value": "210204"
}, {
"label": "甘井子区",
"value": "210211"
}, {
"label": "旅顺口区",
"value": "210212"
}, {
"label": "金州区",
"value": "210213"
}, {
"label": "普兰店区",
"value": "210214"
}, {
"label": "长海县",
"value": "210224"
}, {
"label": "瓦房店市",
"value": "210281"
}, {
"label": "庄河市",
"value": "210283"
}], [{
"label": "铁东区",
"value": "210302"
}, {
"label": "铁西区",
"value": "210303"
}, {
"label": "立山区",
"value": "210304"
}, {
"label": "千山区",
"value": "210311"
}, {
"label": "台安县",
"value": "210321"
}, {
"label": "岫岩满族自治县",
"value": "210323"
}, {
"label": "海城市",
"value": "210381"
}], [{
"label": "新抚区",
"value": "210402"
}, {
"label": "东洲区",
"value": "210403"
}, {
"label": "望花区",
"value": "210404"
}, {
"label": "顺城区",
"value": "210411"
}, {
"label": "抚顺县",
"value": "210421"
}, {
"label": "新宾满族自治县",
"value": "210422"
}, {
"label": "清原满族自治县",
"value": "210423"
}], [{
"label": "平山区",
"value": "210502"
}, {
"label": "溪湖区",
"value": "210503"
}, {
"label": "明山区",
"value": "210504"
}, {
"label": "南芬区",
"value": "210505"
}, {
"label": "本溪满族自治县",
"value": "210521"
}, {
"label": "桓仁满族自治县",
"value": "210522"
}], [{
"label": "元宝区",
"value": "210602"
}, {
"label": "振兴区",
"value": "210603"
}, {
"label": "振安区",
"value": "210604"
}, {
"label": "宽甸满族自治县",
"value": "210624"
}, {
"label": "东港市",
"value": "210681"
}, {
"label": "凤城市",
"value": "210682"
}], [{
"label": "古塔区",
"value": "210702"
}, {
"label": "凌河区",
"value": "210703"
}, {
"label": "太和区",
"value": "210711"
}, {
"label": "黑山县",
"value": "210726"
}, {
"label": "义县",
"value": "210727"
}, {
"label": "凌海市",
"value": "210781"
}, {
"label": "北镇市",
"value": "210782"
}], [{
"label": "站前区",
"value": "210802"
}, {
"label": "西市区",
"value": "210803"
}, {
"label": "鲅鱼圈区",
"value": "210804"
}, {
"label": "老边区",
"value": "210811"
}, {
"label": "盖州市",
"value": "210881"
}, {
"label": "大石桥市",
"value": "210882"
}], [{
"label": "海州区",
"value": "210902"
}, {
"label": "新邱区",
"value": "210903"
}, {
"label": "太平区",
"value": "210904"
}, {
"label": "清河门区",
"value": "210905"
}, {
"label": "细河区",
"value": "210911"
}, {
"label": "阜新蒙古族自治县",
"value": "210921"
}, {
"label": "彰武县",
"value": "210922"
}], [{
"label": "白塔区",
"value": "211002"
}, {
"label": "文圣区",
"value": "211003"
}, {
"label": "宏伟区",
"value": "211004"
}, {
"label": "弓长岭区",
"value": "211005"
}, {
"label": "太子河区",
"value": "211011"
}, {
"label": "辽阳县",
"value": "211021"
}, {
"label": "灯塔市",
"value": "211081"
}], [{
"label": "双台子区",
"value": "211102"
}, {
"label": "兴隆台区",
"value": "211103"
}, {
"label": "大洼区",
"value": "211104"
}, {
"label": "盘山县",
"value": "211122"
}], [{
"label": "银州区",
"value": "211202"
}, {
"label": "清河区",
"value": "211204"
}, {
"label": "铁岭县",
"value": "211221"
}, {
"label": "西丰县",
"value": "211223"
}, {
"label": "昌图县",
"value": "211224"
}, {
"label": "调兵山市",
"value": "211281"
}, {
"label": "开原市",
"value": "211282"
}], [{
"label": "双塔区",
"value": "211302"
}, {
"label": "龙城区",
"value": "211303"
}, {
"label": "朝阳县",
"value": "211321"
}, {
"label": "建平县",
"value": "211322"
}, {
"label": "喀喇沁左翼蒙古族自治县",
"value": "211324"
}, {
"label": "北票市",
"value": "211381"
}, {
"label": "凌源市",
"value": "211382"
}], [{
"label": "连山区",
"value": "211402"
}, {
"label": "龙港区",
"value": "211403"
}, {
"label": "南票区",
"value": "211404"
}, {
"label": "绥中县",
"value": "211421"
}, {
"label": "建昌县",
"value": "211422"
}, {
"label": "兴城市",
"value": "211481"
}]], [[{
"label": "南关区",
"value": "220102"
}, {
"label": "宽城区",
"value": "220103"
}, {
"label": "朝阳区",
"value": "220104"
}, {
"label": "二道区",
"value": "220105"
}, {
"label": "绿园区",
"value": "220106"
}, {
"label": "双阳区",
"value": "220112"
}, {
"label": "九台区",
"value": "220113"
}, {
"label": "农安县",
"value": "220122"
}, {
"label": "长春经济技术开发区",
"value": "220171"
}, {
"label": "长春净月高新技术产业开发区",
"value": "220172"
}, {
"label": "长春高新技术产业开发区",
"value": "220173"
}, {
"label": "长春汽车经济技术开发区",
"value": "220174"
}, {
"label": "榆树市",
"value": "220182"
}, {
"label": "德惠市",
"value": "220183"
}], [{
"label": "昌邑区",
"value": "220202"
}, {
"label": "龙潭区",
"value": "220203"
}, {
"label": "船营区",
"value": "220204"
}, {
"label": "丰满区",
"value": "220211"
}, {
"label": "永吉县",
"value": "220221"
}, {
"label": "吉林经济开发区",
"value": "220271"
}, {
"label": "吉林高新技术产业开发区",
"value": "220272"
}, {
"label": "吉林中国新加坡食品区",
"value": "220273"
}, {
"label": "蛟河市",
"value": "220281"
}, {
"label": "桦甸市",
"value": "220282"
}, {
"label": "舒兰市",
"value": "220283"
}, {
"label": "磐石市",
"value": "220284"
}], [{
"label": "铁西区",
"value": "220302"
}, {
"label": "铁东区",
"value": "220303"
}, {
"label": "梨树县",
"value": "220322"
}, {
"label": "伊通满族自治县",
"value": "220323"
}, {
"label": "公主岭市",
"value": "220381"
}, {
"label": "双辽市",
"value": "220382"
}], [{
"label": "龙山区",
"value": "220402"
}, {
"label": "西安区",
"value": "220403"
}, {
"label": "东丰县",
"value": "220421"
}, {
"label": "东辽县",
"value": "220422"
}], [{
"label": "东昌区",
"value": "220502"
}, {
"label": "二道江区",
"value": "220503"
}, {
"label": "通化县",
"value": "220521"
}, {
"label": "辉南县",
"value": "220523"
}, {
"label": "柳河县",
"value": "220524"
}, {
"label": "梅河口市",
"value": "220581"
}, {
"label": "集安市",
"value": "220582"
}], [{
"label": "浑江区",
"value": "220602"
}, {
"label": "江源区",
"value": "220605"
}, {
"label": "抚松县",
"value": "220621"
}, {
"label": "靖宇县",
"value": "220622"
}, {
"label": "长白朝鲜族自治县",
"value": "220623"
}, {
"label": "临江市",
"value": "220681"
}], [{
"label": "宁江区",
"value": "220702"
}, {
"label": "前郭尔罗斯蒙古族自治县",
"value": "220721"
}, {
"label": "长岭县",
"value": "220722"
}, {
"label": "乾安县",
"value": "220723"
}, {
"label": "吉林松原经济开发区",
"value": "220771"
}, {
"label": "扶余市",
"value": "220781"
}], [{
"label": "洮北区",
"value": "220802"
}, {
"label": "镇赉县",
"value": "220821"
}, {
"label": "通榆县",
"value": "220822"
}, {
"label": "吉林白城经济开发区",
"value": "220871"
}, {
"label": "洮南市",
"value": "220881"
}, {
"label": "大安市",
"value": "220882"
}], [{
"label": "延吉市",
"value": "222401"
}, {
"label": "图们市",
"value": "222402"
}, {
"label": "敦化市",
"value": "222403"
}, {
"label": "珲春市",
"value": "222404"
}, {
"label": "龙井市",
"value": "222405"
}, {
"label": "和龙市",
"value": "222406"
}, {
"label": "汪清县",
"value": "222424"
}, {
"label": "安图县",
"value": "222426"
}]], [[{
"label": "道里区",
"value": "230102"
}, {
"label": "南岗区",
"value": "230103"
}, {
"label": "道外区",
"value": "230104"
}, {
"label": "平房区",
"value": "230108"
}, {
"label": "松北区",
"value": "230109"
}, {
"label": "香坊区",
"value": "230110"
}, {
"label": "呼兰区",
"value": "230111"
}, {
"label": "阿城区",
"value": "230112"
}, {
"label": "双城区",
"value": "230113"
}, {
"label": "依兰县",
"value": "230123"
}, {
"label": "方正县",
"value": "230124"
}, {
"label": "宾县",
"value": "230125"
}, {
"label": "巴彦县",
"value": "230126"
}, {
"label": "木兰县",
"value": "230127"
}, {
"label": "通河县",
"value": "230128"
}, {
"label": "延寿县",
"value": "230129"
}, {
"label": "尚志市",
"value": "230183"
}, {
"label": "五常市",
"value": "230184"
}], [{
"label": "龙沙区",
"value": "230202"
}, {
"label": "建华区",
"value": "230203"
}, {
"label": "铁锋区",
"value": "230204"
}, {
"label": "昂昂溪区",
"value": "230205"
}, {
"label": "富拉尔基区",
"value": "230206"
}, {
"label": "碾子山区",
"value": "230207"
}, {
"label": "梅里斯达斡尔族区",
"value": "230208"
}, {
"label": "龙江县",
"value": "230221"
}, {
"label": "依安县",
"value": "230223"
}, {
"label": "泰来县",
"value": "230224"
}, {
"label": "甘南县",
"value": "230225"
}, {
"label": "富裕县",
"value": "230227"
}, {
"label": "克山县",
"value": "230229"
}, {
"label": "克东县",
"value": "230230"
}, {
"label": "拜泉县",
"value": "230231"
}, {
"label": "讷河市",
"value": "230281"
}], [{
"label": "鸡冠区",
"value": "230302"
}, {
"label": "恒山区",
"value": "230303"
}, {
"label": "滴道区",
"value": "230304"
}, {
"label": "梨树区",
"value": "230305"
}, {
"label": "城子河区",
"value": "230306"
}, {
"label": "麻山区",
"value": "230307"
}, {
"label": "鸡东县",
"value": "230321"
}, {
"label": "虎林市",
"value": "230381"
}, {
"label": "密山市",
"value": "230382"
}], [{
"label": "向阳区",
"value": "230402"
}, {
"label": "工农区",
"value": "230403"
}, {
"label": "南山区",
"value": "230404"
}, {
"label": "兴安区",
"value": "230405"
}, {
"label": "东山区",
"value": "230406"
}, {
"label": "兴山区",
"value": "230407"
}, {
"label": "萝北县",
"value": "230421"
}, {
"label": "绥滨县",
"value": "230422"
}], [{
"label": "尖山区",
"value": "230502"
}, {
"label": "岭东区",
"value": "230503"
}, {
"label": "四方台区",
"value": "230505"
}, {
"label": "宝山区",
"value": "230506"
}, {
"label": "集贤县",
"value": "230521"
}, {
"label": "友谊县",
"value": "230522"
}, {
"label": "宝清县",
"value": "230523"
}, {
"label": "饶河县",
"value": "230524"
}], [{
"label": "萨尔图区",
"value": "230602"
}, {
"label": "龙凤区",
"value": "230603"
}, {
"label": "让胡路区",
"value": "230604"
}, {
"label": "红岗区",
"value": "230605"
}, {
"label": "大同区",
"value": "230606"
}, {
"label": "肇州县",
"value": "230621"
}, {
"label": "肇源县",
"value": "230622"
}, {
"label": "林甸县",
"value": "230623"
}, {
"label": "杜尔伯特蒙古族自治县",
"value": "230624"
}, {
"label": "大庆高新技术产业开发区",
"value": "230671"
}], [{
"label": "伊春区",
"value": "230702"
}, {
"label": "南岔区",
"value": "230703"
}, {
"label": "友好区",
"value": "230704"
}, {
"label": "西林区",
"value": "230705"
}, {
"label": "翠峦区",
"value": "230706"
}, {
"label": "新青区",
"value": "230707"
}, {
"label": "美溪区",
"value": "230708"
}, {
"label": "金山屯区",
"value": "230709"
}, {
"label": "五营区",
"value": "230710"
}, {
"label": "乌马河区",
"value": "230711"
}, {
"label": "汤旺河区",
"value": "230712"
}, {
"label": "带岭区",
"value": "230713"
}, {
"label": "乌伊岭区",
"value": "230714"
}, {
"label": "红星区",
"value": "230715"
}, {
"label": "上甘岭区",
"value": "230716"
}, {
"label": "嘉荫县",
"value": "230722"
}, {
"label": "铁力市",
"value": "230781"
}], [{
"label": "向阳区",
"value": "230803"
}, {
"label": "前进区",
"value": "230804"
}, {
"label": "东风区",
"value": "230805"
}, {
"label": "郊区",
"value": "230811"
}, {
"label": "桦南县",
"value": "230822"
}, {
"label": "桦川县",
"value": "230826"
}, {
"label": "汤原县",
"value": "230828"
}, {
"label": "同江市",
"value": "230881"
}, {
"label": "富锦市",
"value": "230882"
}, {
"label": "抚远市",
"value": "230883"
}], [{
"label": "新兴区",
"value": "230902"
}, {
"label": "桃山区",
"value": "230903"
}, {
"label": "茄子河区",
"value": "230904"
}, {
"label": "勃利县",
"value": "230921"
}], [{
"label": "东安区",
"value": "231002"
}, {
"label": "阳明区",
"value": "231003"
}, {
"label": "爱民区",
"value": "231004"
}, {
"label": "西安区",
"value": "231005"
}, {
"label": "林口县",
"value": "231025"
}, {
"label": "牡丹江经济技术开发区",
"value": "231071"
}, {
"label": "绥芬河市",
"value": "231081"
}, {
"label": "海林市",
"value": "231083"
}, {
"label": "宁安市",
"value": "231084"
}, {
"label": "穆棱市",
"value": "231085"
}, {
"label": "东宁市",
"value": "231086"
}], [{
"label": "爱辉区",
"value": "231102"
}, {
"label": "嫩江县",
"value": "231121"
}, {
"label": "逊克县",
"value": "231123"
}, {
"label": "孙吴县",
"value": "231124"
}, {
"label": "北安市",
"value": "231181"
}, {
"label": "五大连池市",
"value": "231182"
}], [{
"label": "北林区",
"value": "231202"
}, {
"label": "望奎县",
"value": "231221"
}, {
"label": "兰西县",
"value": "231222"
}, {
"label": "青冈县",
"value": "231223"
}, {
"label": "庆安县",
"value": "231224"
}, {
"label": "明水县",
"value": "231225"
}, {
"label": "绥棱县",
"value": "231226"
}, {
"label": "安达市",
"value": "231281"
}, {
"label": "肇东市",
"value": "231282"
}, {
"label": "海伦市",
"value": "231283"
}], [{
"label": "加格达奇区",
"value": "232701"
}, {
"label": "松岭区",
"value": "232702"
}, {
"label": "新林区",
"value": "232703"
}, {
"label": "呼中区",
"value": "232704"
}, {
"label": "呼玛县",
"value": "232721"
}, {
"label": "塔河县",
"value": "232722"
}, {
"label": "漠河县",
"value": "232723"
}]], [[{
"label": "黄浦区",
"value": "310101"
}, {
"label": "徐汇区",
"value": "310104"
}, {
"label": "长宁区",
"value": "310105"
}, {
"label": "静安区",
"value": "310106"
}, {
"label": "普陀区",
"value": "310107"
}, {
"label": "虹口区",
"value": "310109"
}, {
"label": "杨浦区",
"value": "310110"
}, {
"label": "闵行区",
"value": "310112"
}, {
"label": "宝山区",
"value": "310113"
}, {
"label": "嘉定区",
"value": "310114"
}, {
"label": "浦东新区",
"value": "310115"
}, {
"label": "金山区",
"value": "310116"
}, {
"label": "松江区",
"value": "310117"
}, {
"label": "青浦区",
"value": "310118"
}, {
"label": "奉贤区",
"value": "310120"
}, {
"label": "崇明区",
"value": "310151"
}]], [[{
"label": "玄武区",
"value": "320102"
}, {
"label": "秦淮区",
"value": "320104"
}, {
"label": "建邺区",
"value": "320105"
}, {
"label": "鼓楼区",
"value": "320106"
}, {
"label": "浦口区",
"value": "320111"
}, {
"label": "栖霞区",
"value": "320113"
}, {
"label": "雨花台区",
"value": "320114"
}, {
"label": "江宁区",
"value": "320115"
}, {
"label": "六合区",
"value": "320116"
}, {
"label": "溧水区",
"value": "320117"
}, {
"label": "高淳区",
"value": "320118"
}], [{
"label": "锡山区",
"value": "320205"
}, {
"label": "惠山区",
"value": "320206"
}, {
"label": "滨湖区",
"value": "320211"
}, {
"label": "梁溪区",
"value": "320213"
}, {
"label": "新吴区",
"value": "320214"
}, {
"label": "江阴市",
"value": "320281"
}, {
"label": "宜兴市",
"value": "320282"
}], [{
"label": "鼓楼区",
"value": "320302"
}, {
"label": "云龙区",
"value": "320303"
}, {
"label": "贾汪区",
"value": "320305"
}, {
"label": "泉山区",
"value": "320311"
}, {
"label": "铜山区",
"value": "320312"
}, {
"label": "丰县",
"value": "320321"
}, {
"label": "沛县",
"value": "320322"
}, {
"label": "睢宁县",
"value": "320324"
}, {
"label": "徐州经济技术开发区",
"value": "320371"
}, {
"label": "新沂市",
"value": "320381"
}, {
"label": "邳州市",
"value": "320382"
}], [{
"label": "天宁区",
"value": "320402"
}, {
"label": "钟楼区",
"value": "320404"
}, {
"label": "新北区",
"value": "320411"
}, {
"label": "武进区",
"value": "320412"
}, {
"label": "金坛区",
"value": "320413"
}, {
"label": "溧阳市",
"value": "320481"
}], [{
"label": "虎丘区",
"value": "320505"
}, {
"label": "吴中区",
"value": "320506"
}, {
"label": "相城区",
"value": "320507"
}, {
"label": "姑苏区",
"value": "320508"
}, {
"label": "吴江区",
"value": "320509"
}, {
"label": "苏州工业园区",
"value": "320571"
}, {
"label": "常熟市",
"value": "320581"
}, {
"label": "张家港市",
"value": "320582"
}, {
"label": "昆山市",
"value": "320583"
}, {
"label": "太仓市",
"value": "320585"
}], [{
"label": "崇川区",
"value": "320602"
}, {
"label": "港闸区",
"value": "320611"
}, {
"label": "通州区",
"value": "320612"
}, {
"label": "海安县",
"value": "320621"
}, {
"label": "如东县",
"value": "320623"
}, {
"label": "南通经济技术开发区",
"value": "320671"
}, {
"label": "启东市",
"value": "320681"
}, {
"label": "如皋市",
"value": "320682"
}, {
"label": "海门市",
"value": "320684"
}], [{
"label": "连云区",
"value": "320703"
}, {
"label": "海州区",
"value": "320706"
}, {
"label": "赣榆区",
"value": "320707"
}, {
"label": "东海县",
"value": "320722"
}, {
"label": "灌云县",
"value": "320723"
}, {
"label": "灌南县",
"value": "320724"
}, {
"label": "连云港经济技术开发区",
"value": "320771"
}, {
"label": "连云港高新技术产业开发区",
"value": "320772"
}], [{
"label": "淮安区",
"value": "320803"
}, {
"label": "淮阴区",
"value": "320804"
}, {
"label": "清江浦区",
"value": "320812"
}, {
"label": "洪泽区",
"value": "320813"
}, {
"label": "涟水县",
"value": "320826"
}, {
"label": "盱眙县",
"value": "320830"
}, {
"label": "金湖县",
"value": "320831"
}, {
"label": "淮安经济技术开发区",
"value": "320871"
}], [{
"label": "亭湖区",
"value": "320902"
}, {
"label": "盐都区",
"value": "320903"
}, {
"label": "大丰区",
"value": "320904"
}, {
"label": "响水县",
"value": "320921"
}, {
"label": "滨海县",
"value": "320922"
}, {
"label": "阜宁县",
"value": "320923"
}, {
"label": "射阳县",
"value": "320924"
}, {
"label": "建湖县",
"value": "320925"
}, {
"label": "盐城经济技术开发区",
"value": "320971"
}, {
"label": "东台市",
"value": "320981"
}], [{
"label": "广陵区",
"value": "321002"
}, {
"label": "邗江区",
"value": "321003"
}, {
"label": "江都区",
"value": "321012"
}, {
"label": "宝应县",
"value": "321023"
}, {
"label": "扬州经济技术开发区",
"value": "321071"
}, {
"label": "仪征市",
"value": "321081"
}, {
"label": "高邮市",
"value": "321084"
}], [{
"label": "京口区",
"value": "321102"
}, {
"label": "润州区",
"value": "321111"
}, {
"label": "丹徒区",
"value": "321112"
}, {
"label": "镇江新区",
"value": "321171"
}, {
"label": "丹阳市",
"value": "321181"
}, {
"label": "扬中市",
"value": "321182"
}, {
"label": "句容市",
"value": "321183"
}], [{
"label": "海陵区",
"value": "321202"
}, {
"label": "高港区",
"value": "321203"
}, {
"label": "姜堰区",
"value": "321204"
}, {
"label": "泰州医药高新技术产业开发区",
"value": "321271"
}, {
"label": "兴化市",
"value": "321281"
}, {
"label": "靖江市",
"value": "321282"
}, {
"label": "泰兴市",
"value": "321283"
}], [{
"label": "宿城区",
"value": "321302"
}, {
"label": "宿豫区",
"value": "321311"
}, {
"label": "沭阳县",
"value": "321322"
}, {
"label": "泗阳县",
"value": "321323"
}, {
"label": "泗洪县",
"value": "321324"
}, {
"label": "宿迁经济技术开发区",
"value": "321371"
}]], [[{
"label": "上城区",
"value": "330102"
}, {
"label": "下城区",
"value": "330103"
}, {
"label": "江干区",
"value": "330104"
}, {
"label": "拱墅区",
"value": "330105"
}, {
"label": "西湖区",
"value": "330106"
}, {
"label": "滨江区",
"value": "330108"
}, {
"label": "萧山区",
"value": "330109"
}, {
"label": "余杭区",
"value": "330110"
}, {
"label": "富阳区",
"value": "330111"
}, {
"label": "临安区",
"value": "330112"
}, {
"label": "桐庐县",
"value": "330122"
}, {
"label": "淳安县",
"value": "330127"
}, {
"label": "建德市",
"value": "330182"
}], [{
"label": "海曙区",
"value": "330203"
}, {
"label": "江北区",
"value": "330205"
}, {
"label": "北仑区",
"value": "330206"
}, {
"label": "镇海区",
"value": "330211"
}, {
"label": "鄞州区",
"value": "330212"
}, {
"label": "奉化区",
"value": "330213"
}, {
"label": "象山县",
"value": "330225"
}, {
"label": "宁海县",
"value": "330226"
}, {
"label": "余姚市",
"value": "330281"
}, {
"label": "慈溪市",
"value": "330282"
}], [{
"label": "鹿城区",
"value": "330302"
}, {
"label": "龙湾区",
"value": "330303"
}, {
"label": "瓯海区",
"value": "330304"
}, {
"label": "洞头区",
"value": "330305"
}, {
"label": "永嘉县",
"value": "330324"
}, {
"label": "平阳县",
"value": "330326"
}, {
"label": "苍南县",
"value": "330327"
}, {
"label": "文成县",
"value": "330328"
}, {
"label": "泰顺县",
"value": "330329"
}, {
"label": "温州经济技术开发区",
"value": "330371"
}, {
"label": "瑞安市",
"value": "330381"
}, {
"label": "乐清市",
"value": "330382"
}], [{
"label": "南湖区",
"value": "330402"
}, {
"label": "秀洲区",
"value": "330411"
}, {
"label": "嘉善县",
"value": "330421"
}, {
"label": "海盐县",
"value": "330424"
}, {
"label": "海宁市",
"value": "330481"
}, {
"label": "平湖市",
"value": "330482"
}, {
"label": "桐乡市",
"value": "330483"
}], [{
"label": "吴兴区",
"value": "330502"
}, {
"label": "南浔区",
"value": "330503"
}, {
"label": "德清县",
"value": "330521"
}, {
"label": "长兴县",
"value": "330522"
}, {
"label": "安吉县",
"value": "330523"
}], [{
"label": "越城区",
"value": "330602"
}, {
"label": "柯桥区",
"value": "330603"
}, {
"label": "上虞区",
"value": "330604"
}, {
"label": "新昌县",
"value": "330624"
}, {
"label": "诸暨市",
"value": "330681"
}, {
"label": "嵊州市",
"value": "330683"
}], [{
"label": "婺城区",
"value": "330702"
}, {
"label": "金东区",
"value": "330703"
}, {
"label": "武义县",
"value": "330723"
}, {
"label": "浦江县",
"value": "330726"
}, {
"label": "磐安县",
"value": "330727"
}, {
"label": "兰溪市",
"value": "330781"
}, {
"label": "义乌市",
"value": "330782"
}, {
"label": "东阳市",
"value": "330783"
}, {
"label": "永康市",
"value": "330784"
}], [{
"label": "柯城区",
"value": "330802"
}, {
"label": "衢江区",
"value": "330803"
}, {
"label": "常山县",
"value": "330822"
}, {
"label": "开化县",
"value": "330824"
}, {
"label": "龙游县",
"value": "330825"
}, {
"label": "江山市",
"value": "330881"
}], [{
"label": "定海区",
"value": "330902"
}, {
"label": "普陀区",
"value": "330903"
}, {
"label": "岱山县",
"value": "330921"
}, {
"label": "嵊泗县",
"value": "330922"
}], [{
"label": "椒江区",
"value": "331002"
}, {
"label": "黄岩区",
"value": "331003"
}, {
"label": "路桥区",
"value": "331004"
}, {
"label": "三门县",
"value": "331022"
}, {
"label": "天台县",
"value": "331023"
}, {
"label": "仙居县",
"value": "331024"
}, {
"label": "温岭市",
"value": "331081"
}, {
"label": "临海市",
"value": "331082"
}, {
"label": "玉环市",
"value": "331083"
}], [{
"label": "莲都区",
"value": "331102"
}, {
"label": "青田县",
"value": "331121"
}, {
"label": "缙云县",
"value": "331122"
}, {
"label": "遂昌县",
"value": "331123"
}, {
"label": "松阳县",
"value": "331124"
}, {
"label": "云和县",
"value": "331125"
}, {
"label": "庆元县",
"value": "331126"
}, {
"label": "景宁畲族自治县",
"value": "331127"
}, {
"label": "龙泉市",
"value": "331181"
}]], [[{
"label": "瑶海区",
"value": "340102"
}, {
"label": "庐阳区",
"value": "340103"
}, {
"label": "蜀山区",
"value": "340104"
}, {
"label": "包河区",
"value": "340111"
}, {
"label": "长丰县",
"value": "340121"
}, {
"label": "肥东县",
"value": "340122"
}, {
"label": "肥西县",
"value": "340123"
}, {
"label": "庐江县",
"value": "340124"
}, {
"label": "合肥高新技术产业开发区",
"value": "340171"
}, {
"label": "合肥经济技术开发区",
"value": "340172"
}, {
"label": "合肥新站高新技术产业开发区",
"value": "340173"
}, {
"label": "巢湖市",
"value": "340181"
}], [{
"label": "镜湖区",
"value": "340202"
}, {
"label": "弋江区",
"value": "340203"
}, {
"label": "鸠江区",
"value": "340207"
}, {
"label": "三山区",
"value": "340208"
}, {
"label": "芜湖县",
"value": "340221"
}, {
"label": "繁昌县",
"value": "340222"
}, {
"label": "南陵县",
"value": "340223"
}, {
"label": "无为县",
"value": "340225"
}, {
"label": "芜湖经济技术开发区",
"value": "340271"
}, {
"label": "安徽芜湖长江大桥经济开发区",
"value": "340272"
}], [{
"label": "龙子湖区",
"value": "340302"
}, {
"label": "蚌山区",
"value": "340303"
}, {
"label": "禹会区",
"value": "340304"
}, {
"label": "淮上区",
"value": "340311"
}, {
"label": "怀远县",
"value": "340321"
}, {
"label": "五河县",
"value": "340322"
}, {
"label": "固镇县",
"value": "340323"
}, {
"label": "蚌埠市高新技术开发区",
"value": "340371"
}, {
"label": "蚌埠市经济开发区",
"value": "340372"
}], [{
"label": "大通区",
"value": "340402"
}, {
"label": "田家庵区",
"value": "340403"
}, {
"label": "谢家集区",
"value": "340404"
}, {
"label": "八公山区",
"value": "340405"
}, {
"label": "潘集区",
"value": "340406"
}, {
"label": "凤台县",
"value": "340421"
}, {
"label": "寿县",
"value": "340422"
}], [{
"label": "花山区",
"value": "340503"
}, {
"label": "雨山区",
"value": "340504"
}, {
"label": "博望区",
"value": "340506"
}, {
"label": "当涂县",
"value": "340521"
}, {
"label": "含山县",
"value": "340522"
}, {
"label": "和县",
"value": "340523"
}], [{
"label": "杜集区",
"value": "340602"
}, {
"label": "相山区",
"value": "340603"
}, {
"label": "烈山区",
"value": "340604"
}, {
"label": "濉溪县",
"value": "340621"
}], [{
"label": "铜官区",
"value": "340705"
}, {
"label": "义安区",
"value": "340706"
}, {
"label": "郊区",
"value": "340711"
}, {
"label": "枞阳县",
"value": "340722"
}], [{
"label": "迎江区",
"value": "340802"
}, {
"label": "大观区",
"value": "340803"
}, {
"label": "宜秀区",
"value": "340811"
}, {
"label": "怀宁县",
"value": "340822"
}, {
"label": "潜山县",
"value": "340824"
}, {
"label": "太湖县",
"value": "340825"
}, {
"label": "宿松县",
"value": "340826"
}, {
"label": "望江县",
"value": "340827"
}, {
"label": "岳西县",
"value": "340828"
}, {
"label": "安徽安庆经济开发区",
"value": "340871"
}, {
"label": "桐城市",
"value": "340881"
}], [{
"label": "屯溪区",
"value": "341002"
}, {
"label": "黄山区",
"value": "341003"
}, {
"label": "徽州区",
"value": "341004"
}, {
"label": "歙县",
"value": "341021"
}, {
"label": "休宁县",
"value": "341022"
}, {
"label": "黟县",
"value": "341023"
}, {
"label": "祁门县",
"value": "341024"
}], [{
"label": "琅琊区",
"value": "341102"
}, {
"label": "南谯区",
"value": "341103"
}, {
"label": "来安县",
"value": "341122"
}, {
"label": "全椒县",
"value": "341124"
}, {
"label": "定远县",
"value": "341125"
}, {
"label": "凤阳县",
"value": "341126"
}, {
"label": "苏滁现代产业园",
"value": "341171"
}, {
"label": "滁州经济技术开发区",
"value": "341172"
}, {
"label": "天长市",
"value": "341181"
}, {
"label": "明光市",
"value": "341182"
}], [{
"label": "颍州区",
"value": "341202"
}, {
"label": "颍东区",
"value": "341203"
}, {
"label": "颍泉区",
"value": "341204"
}, {
"label": "临泉县",
"value": "341221"
}, {
"label": "太和县",
"value": "341222"
}, {
"label": "阜南县",
"value": "341225"
}, {
"label": "颍上县",
"value": "341226"
}, {
"label": "阜阳合肥现代产业园区",
"value": "341271"
}, {
"label": "阜阳经济技术开发区",
"value": "341272"
}, {
"label": "界首市",
"value": "341282"
}], [{
"label": "埇桥区",
"value": "341302"
}, {
"label": "砀山县",
"value": "341321"
}, {
"label": "萧县",
"value": "341322"
}, {
"label": "灵璧县",
"value": "341323"
}, {
"label": "泗县",
"value": "341324"
}, {
"label": "宿州马鞍山现代产业园区",
"value": "341371"
}, {
"label": "宿州经济技术开发区",
"value": "341372"
}], [{
"label": "金安区",
"value": "341502"
}, {
"label": "裕安区",
"value": "341503"
}, {
"label": "叶集区",
"value": "341504"
}, {
"label": "霍邱县",
"value": "341522"
}, {
"label": "舒城县",
"value": "341523"
}, {
"label": "金寨县",
"value": "341524"
}, {
"label": "霍山县",
"value": "341525"
}], [{
"label": "谯城区",
"value": "341602"
}, {
"label": "涡阳县",
"value": "341621"
}, {
"label": "蒙城县",
"value": "341622"
}, {
"label": "利辛县",
"value": "341623"
}], [{
"label": "贵池区",
"value": "341702"
}, {
"label": "东至县",
"value": "341721"
}, {
"label": "石台县",
"value": "341722"
}, {
"label": "青阳县",
"value": "341723"
}], [{
"label": "宣州区",
"value": "341802"
}, {
"label": "郎溪县",
"value": "341821"
}, {
"label": "广德县",
"value": "341822"
}, {
"label": "泾县",
"value": "341823"
}, {
"label": "绩溪县",
"value": "341824"
}, {
"label": "旌德县",
"value": "341825"
}, {
"label": "宣城市经济开发区",
"value": "341871"
}, {
"label": "宁国市",
"value": "341881"
}]], [[{
"label": "鼓楼区",
"value": "350102"
}, {
"label": "台江区",
"value": "350103"
}, {
"label": "仓山区",
"value": "350104"
}, {
"label": "马尾区",
"value": "350105"
}, {
"label": "晋安区",
"value": "350111"
}, {
"label": "闽侯县",
"value": "350121"
}, {
"label": "连江县",
"value": "350122"
}, {
"label": "罗源县",
"value": "350123"
}, {
"label": "闽清县",
"value": "350124"
}, {
"label": "永泰县",
"value": "350125"
}, {
"label": "平潭县",
"value": "350128"
}, {
"label": "福清市",
"value": "350181"
}, {
"label": "长乐市",
"value": "350182"
}], [{
"label": "思明区",
"value": "350203"
}, {
"label": "海沧区",
"value": "350205"
}, {
"label": "湖里区",
"value": "350206"
}, {
"label": "集美区",
"value": "350211"
}, {
"label": "同安区",
"value": "350212"
}, {
"label": "翔安区",
"value": "350213"
}], [{
"label": "城厢区",
"value": "350302"
}, {
"label": "涵江区",
"value": "350303"
}, {
"label": "荔城区",
"value": "350304"
}, {
"label": "秀屿区",
"value": "350305"
}, {
"label": "仙游县",
"value": "350322"
}], [{
"label": "梅列区",
"value": "350402"
}, {
"label": "三元区",
"value": "350403"
}, {
"label": "明溪县",
"value": "350421"
}, {
"label": "清流县",
"value": "350423"
}, {
"label": "宁化县",
"value": "350424"
}, {
"label": "大田县",
"value": "350425"
}, {
"label": "尤溪县",
"value": "350426"
}, {
"label": "沙县",
"value": "350427"
}, {
"label": "将乐县",
"value": "350428"
}, {
"label": "泰宁县",
"value": "350429"
}, {
"label": "建宁县",
"value": "350430"
}, {
"label": "永安市",
"value": "350481"
}], [{
"label": "鲤城区",
"value": "350502"
}, {
"label": "丰泽区",
"value": "350503"
}, {
"label": "洛江区",
"value": "350504"
}, {
"label": "泉港区",
"value": "350505"
}, {
"label": "惠安县",
"value": "350521"
}, {
"label": "安溪县",
"value": "350524"
}, {
"label": "永春县",
"value": "350525"
}, {
"label": "德化县",
"value": "350526"
}, {
"label": "金门县",
"value": "350527"
}, {
"label": "石狮市",
"value": "350581"
}, {
"label": "晋江市",
"value": "350582"
}, {
"label": "南安市",
"value": "350583"
}], [{
"label": "芗城区",
"value": "350602"
}, {
"label": "龙文区",
"value": "350603"
}, {
"label": "云霄县",
"value": "350622"
}, {
"label": "漳浦县",
"value": "350623"
}, {
"label": "诏安县",
"value": "350624"
}, {
"label": "长泰县",
"value": "350625"
}, {
"label": "东山县",
"value": "350626"
}, {
"label": "南靖县",
"value": "350627"
}, {
"label": "平和县",
"value": "350628"
}, {
"label": "华安县",
"value": "350629"
}, {
"label": "龙海市",
"value": "350681"
}], [{
"label": "延平区",
"value": "350702"
}, {
"label": "建阳区",
"value": "350703"
}, {
"label": "顺昌县",
"value": "350721"
}, {
"label": "浦城县",
"value": "350722"
}, {
"label": "光泽县",
"value": "350723"
}, {
"label": "松溪县",
"value": "350724"
}, {
"label": "政和县",
"value": "350725"
}, {
"label": "邵武市",
"value": "350781"
}, {
"label": "武夷山市",
"value": "350782"
}, {
"label": "建瓯市",
"value": "350783"
}], [{
"label": "新罗区",
"value": "350802"
}, {
"label": "永定区",
"value": "350803"
}, {
"label": "长汀县",
"value": "350821"
}, {
"label": "上杭县",
"value": "350823"
}, {
"label": "武平县",
"value": "350824"
}, {
"label": "连城县",
"value": "350825"
}, {
"label": "漳平市",
"value": "350881"
}], [{
"label": "蕉城区",
"value": "350902"
}, {
"label": "霞浦县",
"value": "350921"
}, {
"label": "古田县",
"value": "350922"
}, {
"label": "屏南县",
"value": "350923"
}, {
"label": "寿宁县",
"value": "350924"
}, {
"label": "周宁县",
"value": "350925"
}, {
"label": "柘荣县",
"value": "350926"
}, {
"label": "福安市",
"value": "350981"
}, {
"label": "福鼎市",
"value": "350982"
}]], [[{
"label": "东湖区",
"value": "360102"
}, {
"label": "西湖区",
"value": "360103"
}, {
"label": "青云谱区",
"value": "360104"
}, {
"label": "湾里区",
"value": "360105"
}, {
"label": "青山湖区",
"value": "360111"
}, {
"label": "新建区",
"value": "360112"
}, {
"label": "南昌县",
"value": "360121"
}, {
"label": "安义县",
"value": "360123"
}, {
"label": "进贤县",
"value": "360124"
}], [{
"label": "昌江区",
"value": "360202"
}, {
"label": "珠山区",
"value": "360203"
}, {
"label": "浮梁县",
"value": "360222"
}, {
"label": "乐平市",
"value": "360281"
}], [{
"label": "安源区",
"value": "360302"
}, {
"label": "湘东区",
"value": "360313"
}, {
"label": "莲花县",
"value": "360321"
}, {
"label": "上栗县",
"value": "360322"
}, {
"label": "芦溪县",
"value": "360323"
}], [{
"label": "濂溪区",
"value": "360402"
}, {
"label": "浔阳区",
"value": "360403"
}, {
"label": "柴桑区",
"value": "360404"
}, {
"label": "武宁县",
"value": "360423"
}, {
"label": "修水县",
"value": "360424"
}, {
"label": "永修县",
"value": "360425"
}, {
"label": "德安县",
"value": "360426"
}, {
"label": "都昌县",
"value": "360428"
}, {
"label": "湖口县",
"value": "360429"
}, {
"label": "彭泽县",
"value": "360430"
}, {
"label": "瑞昌市",
"value": "360481"
}, {
"label": "共青城市",
"value": "360482"
}, {
"label": "庐山市",
"value": "360483"
}], [{
"label": "渝水区",
"value": "360502"
}, {
"label": "分宜县",
"value": "360521"
}], [{
"label": "月湖区",
"value": "360602"
}, {
"label": "余江县",
"value": "360622"
}, {
"label": "贵溪市",
"value": "360681"
}], [{
"label": "章贡区",
"value": "360702"
}, {
"label": "南康区",
"value": "360703"
}, {
"label": "赣县区",
"value": "360704"
}, {
"label": "信丰县",
"value": "360722"
}, {
"label": "大余县",
"value": "360723"
}, {
"label": "上犹县",
"value": "360724"
}, {
"label": "崇义县",
"value": "360725"
}, {
"label": "安远县",
"value": "360726"
}, {
"label": "龙南县",
"value": "360727"
}, {
"label": "定南县",
"value": "360728"
}, {
"label": "全南县",
"value": "360729"
}, {
"label": "宁都县",
"value": "360730"
}, {
"label": "于都县",
"value": "360731"
}, {
"label": "兴国县",
"value": "360732"
}, {
"label": "会昌县",
"value": "360733"
}, {
"label": "寻乌县",
"value": "360734"
}, {
"label": "石城县",
"value": "360735"
}, {
"label": "瑞金市",
"value": "360781"
}], [{
"label": "吉州区",
"value": "360802"
}, {
"label": "青原区",
"value": "360803"
}, {
"label": "吉安县",
"value": "360821"
}, {
"label": "吉水县",
"value": "360822"
}, {
"label": "峡江县",
"value": "360823"
}, {
"label": "新干县",
"value": "360824"
}, {
"label": "永丰县",
"value": "360825"
}, {
"label": "泰和县",
"value": "360826"
}, {
"label": "遂川县",
"value": "360827"
}, {
"label": "万安县",
"value": "360828"
}, {
"label": "安福县",
"value": "360829"
}, {
"label": "永新县",
"value": "360830"
}, {
"label": "井冈山市",
"value": "360881"
}], [{
"label": "袁州区",
"value": "360902"
}, {
"label": "奉新县",
"value": "360921"
}, {
"label": "万载县",
"value": "360922"
}, {
"label": "上高县",
"value": "360923"
}, {
"label": "宜丰县",
"value": "360924"
}, {
"label": "靖安县",
"value": "360925"
}, {
"label": "铜鼓县",
"value": "360926"
}, {
"label": "丰城市",
"value": "360981"
}, {
"label": "樟树市",
"value": "360982"
}, {
"label": "高安市",
"value": "360983"
}], [{
"label": "临川区",
"value": "361002"
}, {
"label": "东乡区",
"value": "361003"
}, {
"label": "南城县",
"value": "361021"
}, {
"label": "黎川县",
"value": "361022"
}, {
"label": "南丰县",
"value": "361023"
}, {
"label": "崇仁县",
"value": "361024"
}, {
"label": "乐安县",
"value": "361025"
}, {
"label": "宜黄县",
"value": "361026"
}, {
"label": "金溪县",
"value": "361027"
}, {
"label": "资溪县",
"value": "361028"
}, {
"label": "广昌县",
"value": "361030"
}], [{
"label": "信州区",
"value": "361102"
}, {
"label": "广丰区",
"value": "361103"
}, {
"label": "上饶县",
"value": "361121"
}, {
"label": "玉山县",
"value": "361123"
}, {
"label": "铅山县",
"value": "361124"
}, {
"label": "横峰县",
"value": "361125"
}, {
"label": "弋阳县",
"value": "361126"
}, {
"label": "余干县",
"value": "361127"
}, {
"label": "鄱阳县",
"value": "361128"
}, {
"label": "万年县",
"value": "361129"
}, {
"label": "婺源县",
"value": "361130"
}, {
"label": "德兴市",
"value": "361181"
}]], [[{
"label": "历下区",
"value": "370102"
}, {
"label": "市中区",
"value": "370103"
}, {
"label": "槐荫区",
"value": "370104"
}, {
"label": "天桥区",
"value": "370105"
}, {
"label": "历城区",
"value": "370112"
}, {
"label": "长清区",
"value": "370113"
}, {
"label": "章丘区",
"value": "370114"
}, {
"label": "平阴县",
"value": "370124"
}, {
"label": "济阳县",
"value": "370125"
}, {
"label": "商河县",
"value": "370126"
}, {
"label": "济南高新技术产业开发区",
"value": "370171"
}], [{
"label": "市南区",
"value": "370202"
}, {
"label": "市北区",
"value": "370203"
}, {
"label": "黄岛区",
"value": "370211"
}, {
"label": "崂山区",
"value": "370212"
}, {
"label": "李沧区",
"value": "370213"
}, {
"label": "城阳区",
"value": "370214"
}, {
"label": "即墨区",
"value": "370215"
}, {
"label": "青岛高新技术产业开发区",
"value": "370271"
}, {
"label": "胶州市",
"value": "370281"
}, {
"label": "平度市",
"value": "370283"
}, {
"label": "莱西市",
"value": "370285"
}], [{
"label": "淄川区",
"value": "370302"
}, {
"label": "张店区",
"value": "370303"
}, {
"label": "博山区",
"value": "370304"
}, {
"label": "临淄区",
"value": "370305"
}, {
"label": "周村区",
"value": "370306"
}, {
"label": "桓台县",
"value": "370321"
}, {
"label": "高青县",
"value": "370322"
}, {
"label": "沂源县",
"value": "370323"
}], [{
"label": "市中区",
"value": "370402"
}, {
"label": "薛城区",
"value": "370403"
}, {
"label": "峄城区",
"value": "370404"
}, {
"label": "台儿庄区",
"value": "370405"
}, {
"label": "山亭区",
"value": "370406"
}, {
"label": "滕州市",
"value": "370481"
}], [{
"label": "东营区",
"value": "370502"
}, {
"label": "河口区",
"value": "370503"
}, {
"label": "垦利区",
"value": "370505"
}, {
"label": "利津县",
"value": "370522"
}, {
"label": "广饶县",
"value": "370523"
}, {
"label": "东营经济技术开发区",
"value": "370571"
}, {
"label": "东营港经济开发区",
"value": "370572"
}], [{
"label": "芝罘区",
"value": "370602"
}, {
"label": "福山区",
"value": "370611"
}, {
"label": "牟平区",
"value": "370612"
}, {
"label": "莱山区",
"value": "370613"
}, {
"label": "长岛县",
"value": "370634"
}, {
"label": "烟台高新技术产业开发区",
"value": "370671"
}, {
"label": "烟台经济技术开发区",
"value": "370672"
}, {
"label": "龙口市",
"value": "370681"
}, {
"label": "莱阳市",
"value": "370682"
}, {
"label": "莱州市",
"value": "370683"
}, {
"label": "蓬莱市",
"value": "370684"
}, {
"label": "招远市",
"value": "370685"
}, {
"label": "栖霞市",
"value": "370686"
}, {
"label": "海阳市",
"value": "370687"
}], [{
"label": "潍城区",
"value": "370702"
}, {
"label": "寒亭区",
"value": "370703"
}, {
"label": "坊子区",
"value": "370704"
}, {
"label": "奎文区",
"value": "370705"
}, {
"label": "临朐县",
"value": "370724"
}, {
"label": "昌乐县",
"value": "370725"
}, {
"label": "潍坊滨海经济技术开发区",
"value": "370772"
}, {
"label": "青州市",
"value": "370781"
}, {
"label": "诸城市",
"value": "370782"
}, {
"label": "寿光市",
"value": "370783"
}, {
"label": "安丘市",
"value": "370784"
}, {
"label": "高密市",
"value": "370785"
}, {
"label": "昌邑市",
"value": "370786"
}], [{
"label": "任城区",
"value": "370811"
}, {
"label": "兖州区",
"value": "370812"
}, {
"label": "微山县",
"value": "370826"
}, {
"label": "鱼台县",
"value": "370827"
}, {
"label": "金乡县",
"value": "370828"
}, {
"label": "嘉祥县",
"value": "370829"
}, {
"label": "汶上县",
"value": "370830"
}, {
"label": "泗水县",
"value": "370831"
}, {
"label": "梁山县",
"value": "370832"
}, {
"label": "济宁高新技术产业开发区",
"value": "370871"
}, {
"label": "曲阜市",
"value": "370881"
}, {
"label": "邹城市",
"value": "370883"
}], [{
"label": "泰山区",
"value": "370902"
}, {
"label": "岱岳区",
"value": "370911"
}, {
"label": "宁阳县",
"value": "370921"
}, {
"label": "东平县",
"value": "370923"
}, {
"label": "新泰市",
"value": "370982"
}, {
"label": "肥城市",
"value": "370983"
}], [{
"label": "环翠区",
"value": "371002"
}, {
"label": "文登区",
"value": "371003"
}, {
"label": "威海火炬高技术产业开发区",
"value": "371071"
}, {
"label": "威海经济技术开发区",
"value": "371072"
}, {
"label": "威海临港经济技术开发区",
"value": "371073"
}, {
"label": "荣成市",
"value": "371082"
}, {
"label": "乳山市",
"value": "371083"
}], [{
"label": "东港区",
"value": "371102"
}, {
"label": "岚山区",
"value": "371103"
}, {
"label": "五莲县",
"value": "371121"
}, {
"label": "莒县",
"value": "371122"
}, {
"label": "日照经济技术开发区",
"value": "371171"
}, {
"label": "日照国际海洋城",
"value": "371172"
}], [{
"label": "莱城区",
"value": "371202"
}, {
"label": "钢城区",
"value": "371203"
}], [{
"label": "兰山区",
"value": "371302"
}, {
"label": "罗庄区",
"value": "371311"
}, {
"label": "河东区",
"value": "371312"
}, {
"label": "沂南县",
"value": "371321"
}, {
"label": "郯城县",
"value": "371322"
}, {
"label": "沂水县",
"value": "371323"
}, {
"label": "兰陵县",
"value": "371324"
}, {
"label": "费县",
"value": "371325"
}, {
"label": "平邑县",
"value": "371326"
}, {
"label": "莒南县",
"value": "371327"
}, {
"label": "蒙阴县",
"value": "371328"
}, {
"label": "临沭县",
"value": "371329"
}, {
"label": "临沂高新技术产业开发区",
"value": "371371"
}, {
"label": "临沂经济技术开发区",
"value": "371372"
}, {
"label": "临沂临港经济开发区",
"value": "371373"
}], [{
"label": "德城区",
"value": "371402"
}, {
"label": "陵城区",
"value": "371403"
}, {
"label": "宁津县",
"value": "371422"
}, {
"label": "庆云县",
"value": "371423"
}, {
"label": "临邑县",
"value": "371424"
}, {
"label": "齐河县",
"value": "371425"
}, {
"label": "平原县",
"value": "371426"
}, {
"label": "夏津县",
"value": "371427"
}, {
"label": "武城县",
"value": "371428"
}, {
"label": "德州经济技术开发区",
"value": "371471"
}, {
"label": "德州运河经济开发区",
"value": "371472"
}, {
"label": "乐陵市",
"value": "371481"
}, {
"label": "禹城市",
"value": "371482"
}], [{
"label": "东昌府区",
"value": "371502"
}, {
"label": "阳谷县",
"value": "371521"
}, {
"label": "莘县",
"value": "371522"
}, {
"label": "茌平县",
"value": "371523"
}, {
"label": "东阿县",
"value": "371524"
}, {
"label": "冠县",
"value": "371525"
}, {
"label": "高唐县",
"value": "371526"
}, {
"label": "临清市",
"value": "371581"
}], [{
"label": "滨城区",
"value": "371602"
}, {
"label": "沾化区",
"value": "371603"
}, {
"label": "惠民县",
"value": "371621"
}, {
"label": "阳信县",
"value": "371622"
}, {
"label": "无棣县",
"value": "371623"
}, {
"label": "博兴县",
"value": "371625"
}, {
"label": "邹平县",
"value": "371626"
}], [{
"label": "牡丹区",
"value": "371702"
}, {
"label": "定陶区",
"value": "371703"
}, {
"label": "曹县",
"value": "371721"
}, {
"label": "单县",
"value": "371722"
}, {
"label": "成武县",
"value": "371723"
}, {
"label": "巨野县",
"value": "371724"
}, {
"label": "郓城县",
"value": "371725"
}, {
"label": "鄄城县",
"value": "371726"
}, {
"label": "东明县",
"value": "371728"
}, {
"label": "菏泽经济技术开发区",
"value": "371771"
}, {
"label": "菏泽高新技术开发区",
"value": "371772"
}]], [[{
"label": "中原区",
"value": "410102"
}, {
"label": "二七区",
"value": "410103"
}, {
"label": "管城回族区",
"value": "410104"
}, {
"label": "金水区",
"value": "410105"
}, {
"label": "上街区",
"value": "410106"
}, {
"label": "惠济区",
"value": "410108"
}, {
"label": "中牟县",
"value": "410122"
}, {
"label": "郑州经济技术开发区",
"value": "410171"
}, {
"label": "郑州高新技术产业开发区",
"value": "410172"
}, {
"label": "郑州航空港经济综合实验区",
"value": "410173"
}, {
"label": "巩义市",
"value": "410181"
}, {
"label": "荥阳市",
"value": "410182"
}, {
"label": "新密市",
"value": "410183"
}, {
"label": "新郑市",
"value": "410184"
}, {
"label": "登封市",
"value": "410185"
}], [{
"label": "龙亭区",
"value": "410202"
}, {
"label": "顺河回族区",
"value": "410203"
}, {
"label": "鼓楼区",
"value": "410204"
}, {
"label": "禹王台区",
"value": "410205"
}, {
"label": "祥符区",
"value": "410212"
}, {
"label": "杞县",
"value": "410221"
}, {
"label": "通许县",
"value": "410222"
}, {
"label": "尉氏县",
"value": "410223"
}, {
"label": "兰考县",
"value": "410225"
}], [{
"label": "老城区",
"value": "410302"
}, {
"label": "西工区",
"value": "410303"
}, {
"label": "瀍河回族区",
"value": "410304"
}, {
"label": "涧西区",
"value": "410305"
}, {
"label": "吉利区",
"value": "410306"
}, {
"label": "洛龙区",
"value": "410311"
}, {
"label": "孟津县",
"value": "410322"
}, {
"label": "新安县",
"value": "410323"
}, {
"label": "栾川县",
"value": "410324"
}, {
"label": "嵩县",
"value": "410325"
}, {
"label": "汝阳县",
"value": "410326"
}, {
"label": "宜阳县",
"value": "410327"
}, {
"label": "洛宁县",
"value": "410328"
}, {
"label": "伊川县",
"value": "410329"
}, {
"label": "洛阳高新技术产业开发区",
"value": "410371"
}, {
"label": "偃师市",
"value": "410381"
}], [{
"label": "新华区",
"value": "410402"
}, {
"label": "卫东区",
"value": "410403"
}, {
"label": "石龙区",
"value": "410404"
}, {
"label": "湛河区",
"value": "410411"
}, {
"label": "宝丰县",
"value": "410421"
}, {
"label": "叶县",
"value": "410422"
}, {
"label": "鲁山县",
"value": "410423"
}, {
"label": "郏县",
"value": "410425"
}, {
"label": "平顶山高新技术产业开发区",
"value": "410471"
}, {
"label": "平顶山市新城区",
"value": "410472"
}, {
"label": "舞钢市",
"value": "410481"
}, {
"label": "汝州市",
"value": "410482"
}], [{
"label": "文峰区",
"value": "410502"
}, {
"label": "北关区",
"value": "410503"
}, {
"label": "殷都区",
"value": "410505"
}, {
"label": "龙安区",
"value": "410506"
}, {
"label": "安阳县",
"value": "410522"
}, {
"label": "汤阴县",
"value": "410523"
}, {
"label": "滑县",
"value": "410526"
}, {
"label": "内黄县",
"value": "410527"
}, {
"label": "安阳高新技术产业开发区",
"value": "410571"
}, {
"label": "林州市",
"value": "410581"
}], [{
"label": "鹤山区",
"value": "410602"
}, {
"label": "山城区",
"value": "410603"
}, {
"label": "淇滨区",
"value": "410611"
}, {
"label": "浚县",
"value": "410621"
}, {
"label": "淇县",
"value": "410622"
}, {
"label": "鹤壁经济技术开发区",
"value": "410671"
}], [{
"label": "红旗区",
"value": "410702"
}, {
"label": "卫滨区",
"value": "410703"
}, {
"label": "凤泉区",
"value": "410704"
}, {
"label": "牧野区",
"value": "410711"
}, {
"label": "新乡县",
"value": "410721"
}, {
"label": "获嘉县",
"value": "410724"
}, {
"label": "原阳县",
"value": "410725"
}, {
"label": "延津县",
"value": "410726"
}, {
"label": "封丘县",
"value": "410727"
}, {
"label": "长垣县",
"value": "410728"
}, {
"label": "新乡高新技术产业开发区",
"value": "410771"
}, {
"label": "新乡经济技术开发区",
"value": "410772"
}, {
"label": "新乡市平原城乡一体化示范区",
"value": "410773"
}, {
"label": "卫辉市",
"value": "410781"
}, {
"label": "辉县市",
"value": "410782"
}], [{
"label": "解放区",
"value": "410802"
}, {
"label": "中站区",
"value": "410803"
}, {
"label": "马村区",
"value": "410804"
}, {
"label": "山阳区",
"value": "410811"
}, {
"label": "修武县",
"value": "410821"
}, {
"label": "博爱县",
"value": "410822"
}, {
"label": "武陟县",
"value": "410823"
}, {
"label": "温县",
"value": "410825"
}, {
"label": "焦作城乡一体化示范区",
"value": "410871"
}, {
"label": "沁阳市",
"value": "410882"
}, {
"label": "孟州市",
"value": "410883"
}], [{
"label": "华龙区",
"value": "410902"
}, {
"label": "清丰县",
"value": "410922"
}, {
"label": "南乐县",
"value": "410923"
}, {
"label": "范县",
"value": "410926"
}, {
"label": "台前县",
"value": "410927"
}, {
"label": "濮阳县",
"value": "410928"
}, {
"label": "河南濮阳工业园区",
"value": "410971"
}, {
"label": "濮阳经济技术开发区",
"value": "410972"
}], [{
"label": "魏都区",
"value": "411002"
}, {
"label": "建安区",
"value": "411003"
}, {
"label": "鄢陵县",
"value": "411024"
}, {
"label": "襄城县",
"value": "411025"
}, {
"label": "许昌经济技术开发区",
"value": "411071"
}, {
"label": "禹州市",
"value": "411081"
}, {
"label": "长葛市",
"value": "411082"
}], [{
"label": "源汇区",
"value": "411102"
}, {
"label": "郾城区",
"value": "411103"
}, {
"label": "召陵区",
"value": "411104"
}, {
"label": "舞阳县",
"value": "411121"
}, {
"label": "临颍县",
"value": "411122"
}, {
"label": "漯河经济技术开发区",
"value": "411171"
}], [{
"label": "湖滨区",
"value": "411202"
}, {
"label": "陕州区",
"value": "411203"
}, {
"label": "渑池县",
"value": "411221"
}, {
"label": "卢氏县",
"value": "411224"
}, {
"label": "河南三门峡经济开发区",
"value": "411271"
}, {
"label": "义马市",
"value": "411281"
}, {
"label": "灵宝市",
"value": "411282"
}], [{
"label": "宛城区",
"value": "411302"
}, {
"label": "卧龙区",
"value": "411303"
}, {
"label": "南召县",
"value": "411321"
}, {
"label": "方城县",
"value": "411322"
}, {
"label": "西峡县",
"value": "411323"
}, {
"label": "镇平县",
"value": "411324"
}, {
"label": "内乡县",
"value": "411325"
}, {
"label": "淅川县",
"value": "411326"
}, {
"label": "社旗县",
"value": "411327"
}, {
"label": "唐河县",
"value": "411328"
}, {
"label": "新野县",
"value": "411329"
}, {
"label": "桐柏县",
"value": "411330"
}, {
"label": "南阳高新技术产业开发区",
"value": "411371"
}, {
"label": "南阳市城乡一体化示范区",
"value": "411372"
}, {
"label": "邓州市",
"value": "411381"
}], [{
"label": "梁园区",
"value": "411402"
}, {
"label": "睢阳区",
"value": "411403"
}, {
"label": "民权县",
"value": "411421"
}, {
"label": "睢县",
"value": "411422"
}, {
"label": "宁陵县",
"value": "411423"
}, {
"label": "柘城县",
"value": "411424"
}, {
"label": "虞城县",
"value": "411425"
}, {
"label": "夏邑县",
"value": "411426"
}, {
"label": "豫东综合物流产业聚集区",
"value": "411471"
}, {
"label": "河南商丘经济开发区",
"value": "411472"
}, {
"label": "永城市",
"value": "411481"
}], [{
"label": "浉河区",
"value": "411502"
}, {
"label": "平桥区",
"value": "411503"
}, {
"label": "罗山县",
"value": "411521"
}, {
"label": "光山县",
"value": "411522"
}, {
"label": "新县",
"value": "411523"
}, {
"label": "商城县",
"value": "411524"
}, {
"label": "固始县",
"value": "411525"
}, {
"label": "潢川县",
"value": "411526"
}, {
"label": "淮滨县",
"value": "411527"
}, {
"label": "息县",
"value": "411528"
}, {
"label": "信阳高新技术产业开发区",
"value": "411571"
}], [{
"label": "川汇区",
"value": "411602"
}, {
"label": "扶沟县",
"value": "411621"
}, {
"label": "西华县",
"value": "411622"
}, {
"label": "商水县",
"value": "411623"
}, {
"label": "沈丘县",
"value": "411624"
}, {
"label": "郸城县",
"value": "411625"
}, {
"label": "淮阳县",
"value": "411626"
}, {
"label": "太康县",
"value": "411627"
}, {
"label": "鹿邑县",
"value": "411628"
}, {
"label": "河南周口经济开发区",
"value": "411671"
}, {
"label": "项城市",
"value": "411681"
}], [{
"label": "驿城区",
"value": "411702"
}, {
"label": "西平县",
"value": "411721"
}, {
"label": "上蔡县",
"value": "411722"
}, {
"label": "平舆县",
"value": "411723"
}, {
"label": "正阳县",
"value": "411724"
}, {
"label": "确山县",
"value": "411725"
}, {
"label": "泌阳县",
"value": "411726"
}, {
"label": "汝南县",
"value": "411727"
}, {
"label": "遂平县",
"value": "411728"
}, {
"label": "新蔡县",
"value": "411729"
}, {
"label": "河南驻马店经济开发区",
"value": "411771"
}], [{
"label": "济源市",
"value": "419001"
}]], [[{
"label": "江岸区",
"value": "420102"
}, {
"label": "江汉区",
"value": "420103"
}, {
"label": "硚口区",
"value": "420104"
}, {
"label": "汉阳区",
"value": "420105"
}, {
"label": "武昌区",
"value": "420106"
}, {
"label": "青山区",
"value": "420107"
}, {
"label": "洪山区",
"value": "420111"
}, {
"label": "东西湖区",
"value": "420112"
}, {
"label": "汉南区",
"value": "420113"
}, {
"label": "蔡甸区",
"value": "420114"
}, {
"label": "江夏区",
"value": "420115"
}, {
"label": "黄陂区",
"value": "420116"
}, {
"label": "新洲区",
"value": "420117"
}], [{
"label": "黄石港区",
"value": "420202"
}, {
"label": "西塞山区",
"value": "420203"
}, {
"label": "下陆区",
"value": "420204"
}, {
"label": "铁山区",
"value": "420205"
}, {
"label": "阳新县",
"value": "420222"
}, {
"label": "大冶市",
"value": "420281"
}], [{
"label": "茅箭区",
"value": "420302"
}, {
"label": "张湾区",
"value": "420303"
}, {
"label": "郧阳区",
"value": "420304"
}, {
"label": "郧西县",
"value": "420322"
}, {
"label": "竹山县",
"value": "420323"
}, {
"label": "竹溪县",
"value": "420324"
}, {
"label": "房县",
"value": "420325"
}, {
"label": "丹江口市",
"value": "420381"
}], [{
"label": "西陵区",
"value": "420502"
}, {
"label": "伍家岗区",
"value": "420503"
}, {
"label": "点军区",
"value": "420504"
}, {
"label": "猇亭区",
"value": "420505"
}, {
"label": "夷陵区",
"value": "420506"
}, {
"label": "远安县",
"value": "420525"
}, {
"label": "兴山县",
"value": "420526"
}, {
"label": "秭归县",
"value": "420527"
}, {
"label": "长阳土家族自治县",
"value": "420528"
}, {
"label": "五峰土家族自治县",
"value": "420529"
}, {
"label": "宜都市",
"value": "420581"
}, {
"label": "当阳市",
"value": "420582"
}, {
"label": "枝江市",
"value": "420583"
}], [{
"label": "襄城区",
"value": "420602"
}, {
"label": "樊城区",
"value": "420606"
}, {
"label": "襄州区",
"value": "420607"
}, {
"label": "南漳县",
"value": "420624"
}, {
"label": "谷城县",
"value": "420625"
}, {
"label": "保康县",
"value": "420626"
}, {
"label": "老河口市",
"value": "420682"
}, {
"label": "枣阳市",
"value": "420683"
}, {
"label": "宜城市",
"value": "420684"
}], [{
"label": "梁子湖区",
"value": "420702"
}, {
"label": "华容区",
"value": "420703"
}, {
"label": "鄂城区",
"value": "420704"
}], [{
"label": "东宝区",
"value": "420802"
}, {
"label": "掇刀区",
"value": "420804"
}, {
"label": "京山县",
"value": "420821"
}, {
"label": "沙洋县",
"value": "420822"
}, {
"label": "钟祥市",
"value": "420881"
}], [{
"label": "孝南区",
"value": "420902"
}, {
"label": "孝昌县",
"value": "420921"
}, {
"label": "大悟县",
"value": "420922"
}, {
"label": "云梦县",
"value": "420923"
}, {
"label": "应城市",
"value": "420981"
}, {
"label": "安陆市",
"value": "420982"
}, {
"label": "汉川市",
"value": "420984"
}], [{
"label": "沙市区",
"value": "421002"
}, {
"label": "荆州区",
"value": "421003"
}, {
"label": "公安县",
"value": "421022"
}, {
"label": "监利县",
"value": "421023"
}, {
"label": "江陵县",
"value": "421024"
}, {
"label": "荆州经济技术开发区",
"value": "421071"
}, {
"label": "石首市",
"value": "421081"
}, {
"label": "洪湖市",
"value": "421083"
}, {
"label": "松滋市",
"value": "421087"
}], [{
"label": "黄州区",
"value": "421102"
}, {
"label": "团风县",
"value": "421121"
}, {
"label": "红安县",
"value": "421122"
}, {
"label": "罗田县",
"value": "421123"
}, {
"label": "英山县",
"value": "421124"
}, {
"label": "浠水县",
"value": "421125"
}, {
"label": "蕲春县",
"value": "421126"
}, {
"label": "黄梅县",
"value": "421127"
}, {
"label": "龙感湖管理区",
"value": "421171"
}, {
"label": "麻城市",
"value": "421181"
}, {
"label": "武穴市",
"value": "421182"
}], [{
"label": "咸安区",
"value": "421202"
}, {
"label": "嘉鱼县",
"value": "421221"
}, {
"label": "通城县",
"value": "421222"
}, {
"label": "崇阳县",
"value": "421223"
}, {
"label": "通山县",
"value": "421224"
}, {
"label": "赤壁市",
"value": "421281"
}], [{
"label": "曾都区",
"value": "421303"
}, {
"label": "随县",
"value": "421321"
}, {
"label": "广水市",
"value": "421381"
}], [{
"label": "恩施市",
"value": "422801"
}, {
"label": "利川市",
"value": "422802"
}, {
"label": "建始县",
"value": "422822"
}, {
"label": "巴东县",
"value": "422823"
}, {
"label": "宣恩县",
"value": "422825"
}, {
"label": "咸丰县",
"value": "422826"
}, {
"label": "来凤县",
"value": "422827"
}, {
"label": "鹤峰县",
"value": "422828"
}], [{
"label": "仙桃市",
"value": "429004"
}, {
"label": "潜江市",
"value": "429005"
}, {
"label": "天门市",
"value": "429006"
}, {
"label": "神农架林区",
"value": "429021"
}]], [[{
"label": "芙蓉区",
"value": "430102"
}, {
"label": "天心区",
"value": "430103"
}, {
"label": "岳麓区",
"value": "430104"
}, {
"label": "开福区",
"value": "430105"
}, {
"label": "雨花区",
"value": "430111"
}, {
"label": "望城区",
"value": "430112"
}, {
"label": "长沙县",
"value": "430121"
}, {
"label": "浏阳市",
"value": "430181"
}, {
"label": "宁乡市",
"value": "430182"
}], [{
"label": "荷塘区",
"value": "430202"
}, {
"label": "芦淞区",
"value": "430203"
}, {
"label": "石峰区",
"value": "430204"
}, {
"label": "天元区",
"value": "430211"
}, {
"label": "株洲县",
"value": "430221"
}, {
"label": "攸县",
"value": "430223"
}, {
"label": "茶陵县",
"value": "430224"
}, {
"label": "炎陵县",
"value": "430225"
}, {
"label": "云龙示范区",
"value": "430271"
}, {
"label": "醴陵市",
"value": "430281"
}], [{
"label": "雨湖区",
"value": "430302"
}, {
"label": "岳塘区",
"value": "430304"
}, {
"label": "湘潭县",
"value": "430321"
}, {
"label": "湖南湘潭高新技术产业园区",
"value": "430371"
}, {
"label": "湘潭昭山示范区",
"value": "430372"
}, {
"label": "湘潭九华示范区",
"value": "430373"
}, {
"label": "湘乡市",
"value": "430381"
}, {
"label": "韶山市",
"value": "430382"
}], [{
"label": "珠晖区",
"value": "430405"
}, {
"label": "雁峰区",
"value": "430406"
}, {
"label": "石鼓区",
"value": "430407"
}, {
"label": "蒸湘区",
"value": "430408"
}, {
"label": "南岳区",
"value": "430412"
}, {
"label": "衡阳县",
"value": "430421"
}, {
"label": "衡南县",
"value": "430422"
}, {
"label": "衡山县",
"value": "430423"
}, {
"label": "衡东县",
"value": "430424"
}, {
"label": "祁东县",
"value": "430426"
}, {
"label": "衡阳综合保税区",
"value": "430471"
}, {
"label": "湖南衡阳高新技术产业园区",
"value": "430472"
}, {
"label": "湖南衡阳松木经济开发区",
"value": "430473"
}, {
"label": "耒阳市",
"value": "430481"
}, {
"label": "常宁市",
"value": "430482"
}], [{
"label": "双清区",
"value": "430502"
}, {
"label": "大祥区",
"value": "430503"
}, {
"label": "北塔区",
"value": "430511"
}, {
"label": "邵东县",
"value": "430521"
}, {
"label": "新邵县",
"value": "430522"
}, {
"label": "邵阳县",
"value": "430523"
}, {
"label": "隆回县",
"value": "430524"
}, {
"label": "洞口县",
"value": "430525"
}, {
"label": "绥宁县",
"value": "430527"
}, {
"label": "新宁县",
"value": "430528"
}, {
"label": "城步苗族自治县",
"value": "430529"
}, {
"label": "武冈市",
"value": "430581"
}], [{
"label": "岳阳楼区",
"value": "430602"
}, {
"label": "云溪区",
"value": "430603"
}, {
"label": "君山区",
"value": "430611"
}, {
"label": "岳阳县",
"value": "430621"
}, {
"label": "华容县",
"value": "430623"
}, {
"label": "湘阴县",
"value": "430624"
}, {
"label": "平江县",
"value": "430626"
}, {
"label": "岳阳市屈原管理区",
"value": "430671"
}, {
"label": "汨罗市",
"value": "430681"
}, {
"label": "临湘市",
"value": "430682"
}], [{
"label": "武陵区",
"value": "430702"
}, {
"label": "鼎城区",
"value": "430703"
}, {
"label": "安乡县",
"value": "430721"
}, {
"label": "汉寿县",
"value": "430722"
}, {
"label": "澧县",
"value": "430723"
}, {
"label": "临澧县",
"value": "430724"
}, {
"label": "桃源县",
"value": "430725"
}, {
"label": "石门县",
"value": "430726"
}, {
"label": "常德市西洞庭管理区",
"value": "430771"
}, {
"label": "津市市",
"value": "430781"
}], [{
"label": "永定区",
"value": "430802"
}, {
"label": "武陵源区",
"value": "430811"
}, {
"label": "慈利县",
"value": "430821"
}, {
"label": "桑植县",
"value": "430822"
}], [{
"label": "资阳区",
"value": "430902"
}, {
"label": "赫山区",
"value": "430903"
}, {
"label": "南县",
"value": "430921"
}, {
"label": "桃江县",
"value": "430922"
}, {
"label": "安化县",
"value": "430923"
}, {
"label": "益阳市大通湖管理区",
"value": "430971"
}, {
"label": "湖南益阳高新技术产业园区",
"value": "430972"
}, {
"label": "沅江市",
"value": "430981"
}], [{
"label": "北湖区",
"value": "431002"
}, {
"label": "苏仙区",
"value": "431003"
}, {
"label": "桂阳县",
"value": "431021"
}, {
"label": "宜章县",
"value": "431022"
}, {
"label": "永兴县",
"value": "431023"
}, {
"label": "嘉禾县",
"value": "431024"
}, {
"label": "临武县",
"value": "431025"
}, {
"label": "汝城县",
"value": "431026"
}, {
"label": "桂东县",
"value": "431027"
}, {
"label": "安仁县",
"value": "431028"
}, {
"label": "资兴市",
"value": "431081"
}], [{
"label": "零陵区",
"value": "431102"
}, {
"label": "冷水滩区",
"value": "431103"
}, {
"label": "祁阳县",
"value": "431121"
}, {
"label": "东安县",
"value": "431122"
}, {
"label": "双牌县",
"value": "431123"
}, {
"label": "道县",
"value": "431124"
}, {
"label": "江永县",
"value": "431125"
}, {
"label": "宁远县",
"value": "431126"
}, {
"label": "蓝山县",
"value": "431127"
}, {
"label": "新田县",
"value": "431128"
}, {
"label": "江华瑶族自治县",
"value": "431129"
}, {
"label": "永州经济技术开发区",
"value": "431171"
}, {
"label": "永州市金洞管理区",
"value": "431172"
}, {
"label": "永州市回龙圩管理区",
"value": "431173"
}], [{
"label": "鹤城区",
"value": "431202"
}, {
"label": "中方县",
"value": "431221"
}, {
"label": "沅陵县",
"value": "431222"
}, {
"label": "辰溪县",
"value": "431223"
}, {
"label": "溆浦县",
"value": "431224"
}, {
"label": "会同县",
"value": "431225"
}, {
"label": "麻阳苗族自治县",
"value": "431226"
}, {
"label": "新晃侗族自治县",
"value": "431227"
}, {
"label": "芷江侗族自治县",
"value": "431228"
}, {
"label": "靖州苗族侗族自治县",
"value": "431229"
}, {
"label": "通道侗族自治县",
"value": "431230"
}, {
"label": "怀化市洪江管理区",
"value": "431271"
}, {
"label": "洪江市",
"value": "431281"
}], [{
"label": "娄星区",
"value": "431302"
}, {
"label": "双峰县",
"value": "431321"
}, {
"label": "新化县",
"value": "431322"
}, {
"label": "冷水江市",
"value": "431381"
}, {
"label": "涟源市",
"value": "431382"
}], [{
"label": "吉首市",
"value": "433101"
}, {
"label": "泸溪县",
"value": "433122"
}, {
"label": "凤凰县",
"value": "433123"
}, {
"label": "花垣县",
"value": "433124"
}, {
"label": "保靖县",
"value": "433125"
}, {
"label": "古丈县",
"value": "433126"
}, {
"label": "永顺县",
"value": "433127"
}, {
"label": "龙山县",
"value": "433130"
}, {
"label": "湖南吉首经济开发区",
"value": "433172"
}, {
"label": "湖南永顺经济开发区",
"value": "433173"
}]], [[{
"label": "荔湾区",
"value": "440103"
}, {
"label": "越秀区",
"value": "440104"
}, {
"label": "海珠区",
"value": "440105"
}, {
"label": "天河区",
"value": "440106"
}, {
"label": "白云区",
"value": "440111"
}, {
"label": "黄埔区",
"value": "440112"
}, {
"label": "番禺区",
"value": "440113"
}, {
"label": "花都区",
"value": "440114"
}, {
"label": "南沙区",
"value": "440115"
}, {
"label": "从化区",
"value": "440117"
}, {
"label": "增城区",
"value": "440118"
}], [{
"label": "武江区",
"value": "440203"
}, {
"label": "浈江区",
"value": "440204"
}, {
"label": "曲江区",
"value": "440205"
}, {
"label": "始兴县",
"value": "440222"
}, {
"label": "仁化县",
"value": "440224"
}, {
"label": "翁源县",
"value": "440229"
}, {
"label": "乳源瑶族自治县",
"value": "440232"
}, {
"label": "新丰县",
"value": "440233"
}, {
"label": "乐昌市",
"value": "440281"
}, {
"label": "南雄市",
"value": "440282"
}], [{
"label": "罗湖区",
"value": "440303"
}, {
"label": "福田区",
"value": "440304"
}, {
"label": "南山区",
"value": "440305"
}, {
"label": "宝安区",
"value": "440306"
}, {
"label": "龙岗区",
"value": "440307"
}, {
"label": "盐田区",
"value": "440308"
}, {
"label": "龙华区",
"value": "440309"
}, {
"label": "坪山区",
"value": "440310"
}], [{
"label": "香洲区",
"value": "440402"
}, {
"label": "斗门区",
"value": "440403"
}, {
"label": "金湾区",
"value": "440404"
}], [{
"label": "龙湖区",
"value": "440507"
}, {
"label": "金平区",
"value": "440511"
}, {
"label": "濠江区",
"value": "440512"
}, {
"label": "潮阳区",
"value": "440513"
}, {
"label": "潮南区",
"value": "440514"
}, {
"label": "澄海区",
"value": "440515"
}, {
"label": "南澳县",
"value": "440523"
}], [{
"label": "禅城区",
"value": "440604"
}, {
"label": "南海区",
"value": "440605"
}, {
"label": "顺德区",
"value": "440606"
}, {
"label": "三水区",
"value": "440607"
}, {
"label": "高明区",
"value": "440608"
}], [{
"label": "蓬江区",
"value": "440703"
}, {
"label": "江海区",
"value": "440704"
}, {
"label": "新会区",
"value": "440705"
}, {
"label": "台山市",
"value": "440781"
}, {
"label": "开平市",
"value": "440783"
}, {
"label": "鹤山市",
"value": "440784"
}, {
"label": "恩平市",
"value": "440785"
}], [{
"label": "赤坎区",
"value": "440802"
}, {
"label": "霞山区",
"value": "440803"
}, {
"label": "坡头区",
"value": "440804"
}, {
"label": "麻章区",
"value": "440811"
}, {
"label": "遂溪县",
"value": "440823"
}, {
"label": "徐闻县",
"value": "440825"
}, {
"label": "廉江市",
"value": "440881"
}, {
"label": "雷州市",
"value": "440882"
}, {
"label": "吴川市",
"value": "440883"
}], [{
"label": "茂南区",
"value": "440902"
}, {
"label": "电白区",
"value": "440904"
}, {
"label": "高州市",
"value": "440981"
}, {
"label": "化州市",
"value": "440982"
}, {
"label": "信宜市",
"value": "440983"
}], [{
"label": "端州区",
"value": "441202"
}, {
"label": "鼎湖区",
"value": "441203"
}, {
"label": "高要区",
"value": "441204"
}, {
"label": "广宁县",
"value": "441223"
}, {
"label": "怀集县",
"value": "441224"
}, {
"label": "封开县",
"value": "441225"
}, {
"label": "德庆县",
"value": "441226"
}, {
"label": "四会市",
"value": "441284"
}], [{
"label": "惠城区",
"value": "441302"
}, {
"label": "惠阳区",
"value": "441303"
}, {
"label": "博罗县",
"value": "441322"
}, {
"label": "惠东县",
"value": "441323"
}, {
"label": "龙门县",
"value": "441324"
}], [{
"label": "梅江区",
"value": "441402"
}, {
"label": "梅县区",
"value": "441403"
}, {
"label": "大埔县",
"value": "441422"
}, {
"label": "丰顺县",
"value": "441423"
}, {
"label": "五华县",
"value": "441424"
}, {
"label": "平远县",
"value": "441426"
}, {
"label": "蕉岭县",
"value": "441427"
}, {
"label": "兴宁市",
"value": "441481"
}], [{
"label": "城区",
"value": "441502"
}, {
"label": "海丰县",
"value": "441521"
}, {
"label": "陆河县",
"value": "441523"
}, {
"label": "陆丰市",
"value": "441581"
}], [{
"label": "源城区",
"value": "441602"
}, {
"label": "紫金县",
"value": "441621"
}, {
"label": "龙川县",
"value": "441622"
}, {
"label": "连平县",
"value": "441623"
}, {
"label": "和平县",
"value": "441624"
}, {
"label": "东源县",
"value": "441625"
}], [{
"label": "江城区",
"value": "441702"
}, {
"label": "阳东区",
"value": "441704"
}, {
"label": "阳西县",
"value": "441721"
}, {
"label": "阳春市",
"value": "441781"
}], [{
"label": "清城区",
"value": "441802"
}, {
"label": "清新区",
"value": "441803"
}, {
"label": "佛冈县",
"value": "441821"
}, {
"label": "阳山县",
"value": "441823"
}, {
"label": "连山壮族瑶族自治县",
"value": "441825"
}, {
"label": "连南瑶族自治县",
"value": "441826"
}, {
"label": "英德市",
"value": "441881"
}, {
"label": "连州市",
"value": "441882"
}], [{
"label": "东莞市",
"value": "441900"
}], [{
"label": "中山市",
"value": "442000"
}], [{
"label": "湘桥区",
"value": "445102"
}, {
"label": "潮安区",
"value": "445103"
}, {
"label": "饶平县",
"value": "445122"
}], [{
"label": "榕城区",
"value": "445202"
}, {
"label": "揭东区",
"value": "445203"
}, {
"label": "揭西县",
"value": "445222"
}, {
"label": "惠来县",
"value": "445224"
}, {
"label": "普宁市",
"value": "445281"
}], [{
"label": "云城区",
"value": "445302"
}, {
"label": "云安区",
"value": "445303"
}, {
"label": "新兴县",
"value": "445321"
}, {
"label": "郁南县",
"value": "445322"
}, {
"label": "罗定市",
"value": "445381"
}]], [[{
"label": "兴宁区",
"value": "450102"
}, {
"label": "青秀区",
"value": "450103"
}, {
"label": "江南区",
"value": "450105"
}, {
"label": "西乡塘区",
"value": "450107"
}, {
"label": "良庆区",
"value": "450108"
}, {
"label": "邕宁区",
"value": "450109"
}, {
"label": "武鸣区",
"value": "450110"
}, {
"label": "隆安县",
"value": "450123"
}, {
"label": "马山县",
"value": "450124"
}, {
"label": "上林县",
"value": "450125"
}, {
"label": "宾阳县",
"value": "450126"
}, {
"label": "横县",
"value": "450127"
}], [{
"label": "城中区",
"value": "450202"
}, {
"label": "鱼峰区",
"value": "450203"
}, {
"label": "柳南区",
"value": "450204"
}, {
"label": "柳北区",
"value": "450205"
}, {
"label": "柳江区",
"value": "450206"
}, {
"label": "柳城县",
"value": "450222"
}, {
"label": "鹿寨县",
"value": "450223"
}, {
"label": "融安县",
"value": "450224"
}, {
"label": "融水苗族自治县",
"value": "450225"
}, {
"label": "三江侗族自治县",
"value": "450226"
}], [{
"label": "秀峰区",
"value": "450302"
}, {
"label": "叠彩区",
"value": "450303"
}, {
"label": "象山区",
"value": "450304"
}, {
"label": "七星区",
"value": "450305"
}, {
"label": "雁山区",
"value": "450311"
}, {
"label": "临桂区",
"value": "450312"
}, {
"label": "阳朔县",
"value": "450321"
}, {
"label": "灵川县",
"value": "450323"
}, {
"label": "全州县",
"value": "450324"
}, {
"label": "兴安县",
"value": "450325"
}, {
"label": "永福县",
"value": "450326"
}, {
"label": "灌阳县",
"value": "450327"
}, {
"label": "龙胜各族自治县",
"value": "450328"
}, {
"label": "资源县",
"value": "450329"
}, {
"label": "平乐县",
"value": "450330"
}, {
"label": "荔浦县",
"value": "450331"
}, {
"label": "恭城瑶族自治县",
"value": "450332"
}], [{
"label": "万秀区",
"value": "450403"
}, {
"label": "长洲区",
"value": "450405"
}, {
"label": "龙圩区",
"value": "450406"
}, {
"label": "苍梧县",
"value": "450421"
}, {
"label": "藤县",
"value": "450422"
}, {
"label": "蒙山县",
"value": "450423"
}, {
"label": "岑溪市",
"value": "450481"
}], [{
"label": "海城区",
"value": "450502"
}, {
"label": "银海区",
"value": "450503"
}, {
"label": "铁山港区",
"value": "450512"
}, {
"label": "合浦县",
"value": "450521"
}], [{
"label": "港口区",
"value": "450602"
}, {
"label": "防城区",
"value": "450603"
}, {
"label": "上思县",
"value": "450621"
}, {
"label": "东兴市",
"value": "450681"
}], [{
"label": "钦南区",
"value": "450702"
}, {
"label": "钦北区",
"value": "450703"
}, {
"label": "灵山县",
"value": "450721"
}, {
"label": "浦北县",
"value": "450722"
}], [{
"label": "港北区",
"value": "450802"
}, {
"label": "港南区",
"value": "450803"
}, {
"label": "覃塘区",
"value": "450804"
}, {
"label": "平南县",
"value": "450821"
}, {
"label": "桂平市",
"value": "450881"
}], [{
"label": "玉州区",
"value": "450902"
}, {
"label": "福绵区",
"value": "450903"
}, {
"label": "容县",
"value": "450921"
}, {
"label": "陆川县",
"value": "450922"
}, {
"label": "博白县",
"value": "450923"
}, {
"label": "兴业县",
"value": "450924"
}, {
"label": "北流市",
"value": "450981"
}], [{
"label": "右江区",
"value": "451002"
}, {
"label": "田阳县",
"value": "451021"
}, {
"label": "田东县",
"value": "451022"
}, {
"label": "平果县",
"value": "451023"
}, {
"label": "德保县",
"value": "451024"
}, {
"label": "那坡县",
"value": "451026"
}, {
"label": "凌云县",
"value": "451027"
}, {
"label": "乐业县",
"value": "451028"
}, {
"label": "田林县",
"value": "451029"
}, {
"label": "西林县",
"value": "451030"
}, {
"label": "隆林各族自治县",
"value": "451031"
}, {
"label": "靖西市",
"value": "451081"
}], [{
"label": "八步区",
"value": "451102"
}, {
"label": "平桂区",
"value": "451103"
}, {
"label": "昭平县",
"value": "451121"
}, {
"label": "钟山县",
"value": "451122"
}, {
"label": "富川瑶族自治县",
"value": "451123"
}], [{
"label": "金城江区",
"value": "451202"
}, {
"label": "宜州区",
"value": "451203"
}, {
"label": "南丹县",
"value": "451221"
}, {
"label": "天峨县",
"value": "451222"
}, {
"label": "凤山县",
"value": "451223"
}, {
"label": "东兰县",
"value": "451224"
}, {
"label": "罗城仫佬族自治县",
"value": "451225"
}, {
"label": "环江毛南族自治县",
"value": "451226"
}, {
"label": "巴马瑶族自治县",
"value": "451227"
}, {
"label": "都安瑶族自治县",
"value": "451228"
}, {
"label": "大化瑶族自治县",
"value": "451229"
}], [{
"label": "兴宾区",
"value": "451302"
}, {
"label": "忻城县",
"value": "451321"
}, {
"label": "象州县",
"value": "451322"
}, {
"label": "武宣县",
"value": "451323"
}, {
"label": "金秀瑶族自治县",
"value": "451324"
}, {
"label": "合山市",
"value": "451381"
}], [{
"label": "江州区",
"value": "451402"
}, {
"label": "扶绥县",
"value": "451421"
}, {
"label": "宁明县",
"value": "451422"
}, {
"label": "龙州县",
"value": "451423"
}, {
"label": "大新县",
"value": "451424"
}, {
"label": "天等县",
"value": "451425"
}, {
"label": "凭祥市",
"value": "451481"
}]], [[{
"label": "秀英区",
"value": "460105"
}, {
"label": "龙华区",
"value": "460106"
}, {
"label": "琼山区",
"value": "460107"
}, {
"label": "美兰区",
"value": "460108"
}], [{
"label": "海棠区",
"value": "460202"
}, {
"label": "吉阳区",
"value": "460203"
}, {
"label": "天涯区",
"value": "460204"
}, {
"label": "崖州区",
"value": "460205"
}], [{
"label": "西沙群岛",
"value": "460321"
}, {
"label": "南沙群岛",
"value": "460322"
}, {
"label": "中沙群岛的岛礁及其海域",
"value": "460323"
}], [{
"label": "儋州市",
"value": "460400"
}], [{
"label": "五指山市",
"value": "469001"
}, {
"label": "琼海市",
"value": "469002"
}, {
"label": "文昌市",
"value": "469005"
}, {
"label": "万宁市",
"value": "469006"
}, {
"label": "东方市",
"value": "469007"
}, {
"label": "定安县",
"value": "469021"
}, {
"label": "屯昌县",
"value": "469022"
}, {
"label": "澄迈县",
"value": "469023"
}, {
"label": "临高县",
"value": "469024"
}, {
"label": "白沙黎族自治县",
"value": "469025"
}, {
"label": "昌江黎族自治县",
"value": "469026"
}, {
"label": "乐东黎族自治县",
"value": "469027"
}, {
"label": "陵水黎族自治县",
"value": "469028"
}, {
"label": "保亭黎族苗族自治县",
"value": "469029"
}, {
"label": "琼中黎族苗族自治县",
"value": "469030"
}]], [[{
"label": "万州区",
"value": "500101"
}, {
"label": "涪陵区",
"value": "500102"
}, {
"label": "渝中区",
"value": "500103"
}, {
"label": "大渡口区",
"value": "500104"
}, {
"label": "江北区",
"value": "500105"
}, {
"label": "沙坪坝区",
"value": "500106"
}, {
"label": "九龙坡区",
"value": "500107"
}, {
"label": "南岸区",
"value": "500108"
}, {
"label": "北碚区",
"value": "500109"
}, {
"label": "綦江区",
"value": "500110"
}, {
"label": "大足区",
"value": "500111"
}, {
"label": "渝北区",
"value": "500112"
}, {
"label": "巴南区",
"value": "500113"
}, {
"label": "黔江区",
"value": "500114"
}, {
"label": "长寿区",
"value": "500115"
}, {
"label": "江津区",
"value": "500116"
}, {
"label": "合川区",
"value": "500117"
}, {
"label": "永川区",
"value": "500118"
}, {
"label": "南川区",
"value": "500119"
}, {
"label": "璧山区",
"value": "500120"
}, {
"label": "铜梁区",
"value": "500151"
}, {
"label": "潼南区",
"value": "500152"
}, {
"label": "荣昌区",
"value": "500153"
}, {
"label": "开州区",
"value": "500154"
}, {
"label": "梁平区",
"value": "500155"
}, {
"label": "武隆区",
"value": "500156"
}], [{
"label": "城口县",
"value": "500229"
}, {
"label": "丰都县",
"value": "500230"
}, {
"label": "垫江县",
"value": "500231"
}, {
"label": "忠县",
"value": "500233"
}, {
"label": "云阳县",
"value": "500235"
}, {
"label": "奉节县",
"value": "500236"
}, {
"label": "巫山县",
"value": "500237"
}, {
"label": "巫溪县",
"value": "500238"
}, {
"label": "石柱土家族自治县",
"value": "500240"
}, {
"label": "秀山土家族苗族自治县",
"value": "500241"
}, {
"label": "酉阳土家族苗族自治县",
"value": "500242"
}, {
"label": "彭水苗族土家族自治县",
"value": "500243"
}]], [[{
"label": "锦江区",
"value": "510104"
}, {
"label": "青羊区",
"value": "510105"
}, {
"label": "金牛区",
"value": "510106"
}, {
"label": "武侯区",
"value": "510107"
}, {
"label": "成华区",
"value": "510108"
}, {
"label": "龙泉驿区",
"value": "510112"
}, {
"label": "青白江区",
"value": "510113"
}, {
"label": "新都区",
"value": "510114"
}, {
"label": "温江区",
"value": "510115"
}, {
"label": "双流区",
"value": "510116"
}, {
"label": "郫都区",
"value": "510117"
}, {
"label": "金堂县",
"value": "510121"
}, {
"label": "大邑县",
"value": "510129"
}, {
"label": "蒲江县",
"value": "510131"
}, {
"label": "新津县",
"value": "510132"
}, {
"label": "都江堰市",
"value": "510181"
}, {
"label": "彭州市",
"value": "510182"
}, {
"label": "邛崃市",
"value": "510183"
}, {
"label": "崇州市",
"value": "510184"
}, {
"label": "简阳市",
"value": "510185"
}], [{
"label": "自流井区",
"value": "510302"
}, {
"label": "贡井区",
"value": "510303"
}, {
"label": "大安区",
"value": "510304"
}, {
"label": "沿滩区",
"value": "510311"
}, {
"label": "荣县",
"value": "510321"
}, {
"label": "富顺县",
"value": "510322"
}], [{
"label": "东区",
"value": "510402"
}, {
"label": "西区",
"value": "510403"
}, {
"label": "仁和区",
"value": "510411"
}, {
"label": "米易县",
"value": "510421"
}, {
"label": "盐边县",
"value": "510422"
}], [{
"label": "江阳区",
"value": "510502"
}, {
"label": "纳溪区",
"value": "510503"
}, {
"label": "龙马潭区",
"value": "510504"
}, {
"label": "泸县",
"value": "510521"
}, {
"label": "合江县",
"value": "510522"
}, {
"label": "叙永县",
"value": "510524"
}, {
"label": "古蔺县",
"value": "510525"
}], [{
"label": "旌阳区",
"value": "510603"
}, {
"label": "罗江区",
"value": "510604"
}, {
"label": "中江县",
"value": "510623"
}, {
"label": "广汉市",
"value": "510681"
}, {
"label": "什邡市",
"value": "510682"
}, {
"label": "绵竹市",
"value": "510683"
}], [{
"label": "涪城区",
"value": "510703"
}, {
"label": "游仙区",
"value": "510704"
}, {
"label": "安州区",
"value": "510705"
}, {
"label": "三台县",
"value": "510722"
}, {
"label": "盐亭县",
"value": "510723"
}, {
"label": "梓潼县",
"value": "510725"
}, {
"label": "北川羌族自治县",
"value": "510726"
}, {
"label": "平武县",
"value": "510727"
}, {
"label": "江油市",
"value": "510781"
}], [{
"label": "利州区",
"value": "510802"
}, {
"label": "昭化区",
"value": "510811"
}, {
"label": "朝天区",
"value": "510812"
}, {
"label": "旺苍县",
"value": "510821"
}, {
"label": "青川县",
"value": "510822"
}, {
"label": "剑阁县",
"value": "510823"
}, {
"label": "苍溪县",
"value": "510824"
}], [{
"label": "船山区",
"value": "510903"
}, {
"label": "安居区",
"value": "510904"
}, {
"label": "蓬溪县",
"value": "510921"
}, {
"label": "射洪县",
"value": "510922"
}, {
"label": "大英县",
"value": "510923"
}], [{
"label": "市中区",
"value": "511002"
}, {
"label": "东兴区",
"value": "511011"
}, {
"label": "威远县",
"value": "511024"
}, {
"label": "资中县",
"value": "511025"
}, {
"label": "内江经济开发区",
"value": "511071"
}, {
"label": "隆昌市",
"value": "511083"
}], [{
"label": "市中区",
"value": "511102"
}, {
"label": "沙湾区",
"value": "511111"
}, {
"label": "五通桥区",
"value": "511112"
}, {
"label": "金口河区",
"value": "511113"
}, {
"label": "犍为县",
"value": "511123"
}, {
"label": "井研县",
"value": "511124"
}, {
"label": "夹江县",
"value": "511126"
}, {
"label": "沐川县",
"value": "511129"
}, {
"label": "峨边彝族自治县",
"value": "511132"
}, {
"label": "马边彝族自治县",
"value": "511133"
}, {
"label": "峨眉山市",
"value": "511181"
}], [{
"label": "顺庆区",
"value": "511302"
}, {
"label": "高坪区",
"value": "511303"
}, {
"label": "嘉陵区",
"value": "511304"
}, {
"label": "南部县",
"value": "511321"
}, {
"label": "营山县",
"value": "511322"
}, {
"label": "蓬安县",
"value": "511323"
}, {
"label": "仪陇县",
"value": "511324"
}, {
"label": "西充县",
"value": "511325"
}, {
"label": "阆中市",
"value": "511381"
}], [{
"label": "东坡区",
"value": "511402"
}, {
"label": "彭山区",
"value": "511403"
}, {
"label": "仁寿县",
"value": "511421"
}, {
"label": "洪雅县",
"value": "511423"
}, {
"label": "丹棱县",
"value": "511424"
}, {
"label": "青神县",
"value": "511425"
}], [{
"label": "翠屏区",
"value": "511502"
}, {
"label": "南溪区",
"value": "511503"
}, {
"label": "宜宾县",
"value": "511521"
}, {
"label": "江安县",
"value": "511523"
}, {
"label": "长宁县",
"value": "511524"
}, {
"label": "高县",
"value": "511525"
}, {
"label": "珙县",
"value": "511526"
}, {
"label": "筠连县",
"value": "511527"
}, {
"label": "兴文县",
"value": "511528"
}, {
"label": "屏山县",
"value": "511529"
}], [{
"label": "广安区",
"value": "511602"
}, {
"label": "前锋区",
"value": "511603"
}, {
"label": "岳池县",
"value": "511621"
}, {
"label": "武胜县",
"value": "511622"
}, {
"label": "邻水县",
"value": "511623"
}, {
"label": "华蓥市",
"value": "511681"
}], [{
"label": "通川区",
"value": "511702"
}, {
"label": "达川区",
"value": "511703"
}, {
"label": "宣汉县",
"value": "511722"
}, {
"label": "开江县",
"value": "511723"
}, {
"label": "大竹县",
"value": "511724"
}, {
"label": "渠县",
"value": "511725"
}, {
"label": "达州经济开发区",
"value": "511771"
}, {
"label": "万源市",
"value": "511781"
}], [{
"label": "雨城区",
"value": "511802"
}, {
"label": "名山区",
"value": "511803"
}, {
"label": "荥经县",
"value": "511822"
}, {
"label": "汉源县",
"value": "511823"
}, {
"label": "石棉县",
"value": "511824"
}, {
"label": "天全县",
"value": "511825"
}, {
"label": "芦山县",
"value": "511826"
}, {
"label": "宝兴县",
"value": "511827"
}], [{
"label": "巴州区",
"value": "511902"
}, {
"label": "恩阳区",
"value": "511903"
}, {
"label": "通江县",
"value": "511921"
}, {
"label": "南江县",
"value": "511922"
}, {
"label": "平昌县",
"value": "511923"
}, {
"label": "巴中经济开发区",
"value": "511971"
}], [{
"label": "雁江区",
"value": "512002"
}, {
"label": "安岳县",
"value": "512021"
}, {
"label": "乐至县",
"value": "512022"
}], [{
"label": "马尔康市",
"value": "513201"
}, {
"label": "汶川县",
"value": "513221"
}, {
"label": "理县",
"value": "513222"
}, {
"label": "茂县",
"value": "513223"
}, {
"label": "松潘县",
"value": "513224"
}, {
"label": "九寨沟县",
"value": "513225"
}, {
"label": "金川县",
"value": "513226"
}, {
"label": "小金县",
"value": "513227"
}, {
"label": "黑水县",
"value": "513228"
}, {
"label": "壤塘县",
"value": "513230"
}, {
"label": "阿坝县",
"value": "513231"
}, {
"label": "若尔盖县",
"value": "513232"
}, {
"label": "红原县",
"value": "513233"
}], [{
"label": "康定市",
"value": "513301"
}, {
"label": "泸定县",
"value": "513322"
}, {
"label": "丹巴县",
"value": "513323"
}, {
"label": "九龙县",
"value": "513324"
}, {
"label": "雅江县",
"value": "513325"
}, {
"label": "道孚县",
"value": "513326"
}, {
"label": "炉霍县",
"value": "513327"
}, {
"label": "甘孜县",
"value": "513328"
}, {
"label": "新龙县",
"value": "513329"
}, {
"label": "德格县",
"value": "513330"
}, {
"label": "白玉县",
"value": "513331"
}, {
"label": "石渠县",
"value": "513332"
}, {
"label": "色达县",
"value": "513333"
}, {
"label": "理塘县",
"value": "513334"
}, {
"label": "巴塘县",
"value": "513335"
}, {
"label": "乡城县",
"value": "513336"
}, {
"label": "稻城县",
"value": "513337"
}, {
"label": "得荣县",
"value": "513338"
}], [{
"label": "西昌市",
"value": "513401"
}, {
"label": "木里藏族自治县",
"value": "513422"
}, {
"label": "盐源县",
"value": "513423"
}, {
"label": "德昌县",
"value": "513424"
}, {
"label": "会理县",
"value": "513425"
}, {
"label": "会东县",
"value": "513426"
}, {
"label": "宁南县",
"value": "513427"
}, {
"label": "普格县",
"value": "513428"
}, {
"label": "布拖县",
"value": "513429"
}, {
"label": "金阳县",
"value": "513430"
}, {
"label": "昭觉县",
"value": "513431"
}, {
"label": "喜德县",
"value": "513432"
}, {
"label": "冕宁县",
"value": "513433"
}, {
"label": "越西县",
"value": "513434"
}, {
"label": "甘洛县",
"value": "513435"
}, {
"label": "美姑县",
"value": "513436"
}, {
"label": "雷波县",
"value": "513437"
}]], [[{
"label": "南明区",
"value": "520102"
}, {
"label": "云岩区",
"value": "520103"
}, {
"label": "花溪区",
"value": "520111"
}, {
"label": "乌当区",
"value": "520112"
}, {
"label": "白云区",
"value": "520113"
}, {
"label": "观山湖区",
"value": "520115"
}, {
"label": "开阳县",
"value": "520121"
}, {
"label": "息烽县",
"value": "520122"
}, {
"label": "修文县",
"value": "520123"
}, {
"label": "清镇市",
"value": "520181"
}], [{
"label": "钟山区",
"value": "520201"
}, {
"label": "六枝特区",
"value": "520203"
}, {
"label": "水城县",
"value": "520221"
}, {
"label": "盘州市",
"value": "520281"
}], [{
"label": "红花岗区",
"value": "520302"
}, {
"label": "汇川区",
"value": "520303"
}, {
"label": "播州区",
"value": "520304"
}, {
"label": "桐梓县",
"value": "520322"
}, {
"label": "绥阳县",
"value": "520323"
}, {
"label": "正安县",
"value": "520324"
}, {
"label": "道真仡佬族苗族自治县",
"value": "520325"
}, {
"label": "务川仡佬族苗族自治县",
"value": "520326"
}, {
"label": "凤冈县",
"value": "520327"
}, {
"label": "湄潭县",
"value": "520328"
}, {
"label": "余庆县",
"value": "520329"
}, {
"label": "习水县",
"value": "520330"
}, {
"label": "赤水市",
"value": "520381"
}, {
"label": "仁怀市",
"value": "520382"
}], [{
"label": "西秀区",
"value": "520402"
}, {
"label": "平坝区",
"value": "520403"
}, {
"label": "普定县",
"value": "520422"
}, {
"label": "镇宁布依族苗族自治县",
"value": "520423"
}, {
"label": "关岭布依族苗族自治县",
"value": "520424"
}, {
"label": "紫云苗族布依族自治县",
"value": "520425"
}], [{
"label": "七星关区",
"value": "520502"
}, {
"label": "大方县",
"value": "520521"
}, {
"label": "黔西县",
"value": "520522"
}, {
"label": "金沙县",
"value": "520523"
}, {
"label": "织金县",
"value": "520524"
}, {
"label": "纳雍县",
"value": "520525"
}, {
"label": "威宁彝族回族苗族自治县",
"value": "520526"
}, {
"label": "赫章县",
"value": "520527"
}], [{
"label": "碧江区",
"value": "520602"
}, {
"label": "万山区",
"value": "520603"
}, {
"label": "江口县",
"value": "520621"
}, {
"label": "玉屏侗族自治县",
"value": "520622"
}, {
"label": "石阡县",
"value": "520623"
}, {
"label": "思南县",
"value": "520624"
}, {
"label": "印江土家族苗族自治县",
"value": "520625"
}, {
"label": "德江县",
"value": "520626"
}, {
"label": "沿河土家族自治县",
"value": "520627"
}, {
"label": "松桃苗族自治县",
"value": "520628"
}], [{
"label": "兴义市",
"value": "522301"
}, {
"label": "兴仁县",
"value": "522322"
}, {
"label": "普安县",
"value": "522323"
}, {
"label": "晴隆县",
"value": "522324"
}, {
"label": "贞丰县",
"value": "522325"
}, {
"label": "望谟县",
"value": "522326"
}, {
"label": "册亨县",
"value": "522327"
}, {
"label": "安龙县",
"value": "522328"
}], [{
"label": "凯里市",
"value": "522601"
}, {
"label": "黄平县",
"value": "522622"
}, {
"label": "施秉县",
"value": "522623"
}, {
"label": "三穗县",
"value": "522624"
}, {
"label": "镇远县",
"value": "522625"
}, {
"label": "岑巩县",
"value": "522626"
}, {
"label": "天柱县",
"value": "522627"
}, {
"label": "锦屏县",
"value": "522628"
}, {
"label": "剑河县",
"value": "522629"
}, {
"label": "台江县",
"value": "522630"
}, {
"label": "黎平县",
"value": "522631"
}, {
"label": "榕江县",
"value": "522632"
}, {
"label": "从江县",
"value": "522633"
}, {
"label": "雷山县",
"value": "522634"
}, {
"label": "麻江县",
"value": "522635"
}, {
"label": "丹寨县",
"value": "522636"
}], [{
"label": "都匀市",
"value": "522701"
}, {
"label": "福泉市",
"value": "522702"
}, {
"label": "荔波县",
"value": "522722"
}, {
"label": "贵定县",
"value": "522723"
}, {
"label": "瓮安县",
"value": "522725"
}, {
"label": "独山县",
"value": "522726"
}, {
"label": "平塘县",
"value": "522727"
}, {
"label": "罗甸县",
"value": "522728"
}, {
"label": "长顺县",
"value": "522729"
}, {
"label": "龙里县",
"value": "522730"
}, {
"label": "惠水县",
"value": "522731"
}, {
"label": "三都水族自治县",
"value": "522732"
}]], [[{
"label": "五华区",
"value": "530102"
}, {
"label": "盘龙区",
"value": "530103"
}, {
"label": "官渡区",
"value": "530111"
}, {
"label": "西山区",
"value": "530112"
}, {
"label": "东川区",
"value": "530113"
}, {
"label": "呈贡区",
"value": "530114"
}, {
"label": "晋宁区",
"value": "530115"
}, {
"label": "富民县",
"value": "530124"
}, {
"label": "宜良县",
"value": "530125"
}, {
"label": "石林彝族自治县",
"value": "530126"
}, {
"label": "嵩明县",
"value": "530127"
}, {
"label": "禄劝彝族苗族自治县",
"value": "530128"
}, {
"label": "寻甸回族彝族自治县",
"value": "530129"
}, {
"label": "安宁市",
"value": "530181"
}], [{
"label": "麒麟区",
"value": "530302"
}, {
"label": "沾益区",
"value": "530303"
}, {
"label": "马龙县",
"value": "530321"
}, {
"label": "陆良县",
"value": "530322"
}, {
"label": "师宗县",
"value": "530323"
}, {
"label": "罗平县",
"value": "530324"
}, {
"label": "富源县",
"value": "530325"
}, {
"label": "会泽县",
"value": "530326"
}, {
"label": "宣威市",
"value": "530381"
}], [{
"label": "红塔区",
"value": "530402"
}, {
"label": "江川区",
"value": "530403"
}, {
"label": "澄江县",
"value": "530422"
}, {
"label": "通海县",
"value": "530423"
}, {
"label": "华宁县",
"value": "530424"
}, {
"label": "易门县",
"value": "530425"
}, {
"label": "峨山彝族自治县",
"value": "530426"
}, {
"label": "新平彝族傣族自治县",
"value": "530427"
}, {
"label": "元江哈尼族彝族傣族自治县",
"value": "530428"
}], [{
"label": "隆阳区",
"value": "530502"
}, {
"label": "施甸县",
"value": "530521"
}, {
"label": "龙陵县",
"value": "530523"
}, {
"label": "昌宁县",
"value": "530524"
}, {
"label": "腾冲市",
"value": "530581"
}], [{
"label": "昭阳区",
"value": "530602"
}, {
"label": "鲁甸县",
"value": "530621"
}, {
"label": "巧家县",
"value": "530622"
}, {
"label": "盐津县",
"value": "530623"
}, {
"label": "大关县",
"value": "530624"
}, {
"label": "永善县",
"value": "530625"
}, {
"label": "绥江县",
"value": "530626"
}, {
"label": "镇雄县",
"value": "530627"
}, {
"label": "彝良县",
"value": "530628"
}, {
"label": "威信县",
"value": "530629"
}, {
"label": "水富县",
"value": "530630"
}], [{
"label": "古城区",
"value": "530702"
}, {
"label": "玉龙纳西族自治县",
"value": "530721"
}, {
"label": "永胜县",
"value": "530722"
}, {
"label": "华坪县",
"value": "530723"
}, {
"label": "宁蒗彝族自治县",
"value": "530724"
}], [{
"label": "思茅区",
"value": "530802"
}, {
"label": "宁洱哈尼族彝族自治县",
"value": "530821"
}, {
"label": "墨江哈尼族自治县",
"value": "530822"
}, {
"label": "景东彝族自治县",
"value": "530823"
}, {
"label": "景谷傣族彝族自治县",
"value": "530824"
}, {
"label": "镇沅彝族哈尼族拉祜族自治县",
"value": "530825"
}, {
"label": "江城哈尼族彝族自治县",
"value": "530826"
}, {
"label": "孟连傣族拉祜族佤族自治县",
"value": "530827"
}, {
"label": "澜沧拉祜族自治县",
"value": "530828"
}, {
"label": "西盟佤族自治县",
"value": "530829"
}], [{
"label": "临翔区",
"value": "530902"
}, {
"label": "凤庆县",
"value": "530921"
}, {
"label": "云县",
"value": "530922"
}, {
"label": "永德县",
"value": "530923"
}, {
"label": "镇康县",
"value": "530924"
}, {
"label": "双江拉祜族佤族布朗族傣族自治县",
"value": "530925"
}, {
"label": "耿马傣族佤族自治县",
"value": "530926"
}, {
"label": "沧源佤族自治县",
"value": "530927"
}], [{
"label": "楚雄市",
"value": "532301"
}, {
"label": "双柏县",
"value": "532322"
}, {
"label": "牟定县",
"value": "532323"
}, {
"label": "南华县",
"value": "532324"
}, {
"label": "姚安县",
"value": "532325"
}, {
"label": "大姚县",
"value": "532326"
}, {
"label": "永仁县",
"value": "532327"
}, {
"label": "元谋县",
"value": "532328"
}, {
"label": "武定县",
"value": "532329"
}, {
"label": "禄丰县",
"value": "532331"
}], [{
"label": "个旧市",
"value": "532501"
}, {
"label": "开远市",
"value": "532502"
}, {
"label": "蒙自市",
"value": "532503"
}, {
"label": "弥勒市",
"value": "532504"
}, {
"label": "屏边苗族自治县",
"value": "532523"
}, {
"label": "建水县",
"value": "532524"
}, {
"label": "石屏县",
"value": "532525"
}, {
"label": "泸西县",
"value": "532527"
}, {
"label": "元阳县",
"value": "532528"
}, {
"label": "红河县",
"value": "532529"
}, {
"label": "金平苗族瑶族傣族自治县",
"value": "532530"
}, {
"label": "绿春县",
"value": "532531"
}, {
"label": "河口瑶族自治县",
"value": "532532"
}], [{
"label": "文山市",
"value": "532601"
}, {
"label": "砚山县",
"value": "532622"
}, {
"label": "西畴县",
"value": "532623"
}, {
"label": "麻栗坡县",
"value": "532624"
}, {
"label": "马关县",
"value": "532625"
}, {
"label": "丘北县",
"value": "532626"
}, {
"label": "广南县",
"value": "532627"
}, {
"label": "富宁县",
"value": "532628"
}], [{
"label": "景洪市",
"value": "532801"
}, {
"label": "勐海县",
"value": "532822"
}, {
"label": "勐腊县",
"value": "532823"
}], [{
"label": "大理市",
"value": "532901"
}, {
"label": "漾濞彝族自治县",
"value": "532922"
}, {
"label": "祥云县",
"value": "532923"
}, {
"label": "宾川县",
"value": "532924"
}, {
"label": "弥渡县",
"value": "532925"
}, {
"label": "南涧彝族自治县",
"value": "532926"
}, {
"label": "巍山彝族回族自治县",
"value": "532927"
}, {
"label": "永平县",
"value": "532928"
}, {
"label": "云龙县",
"value": "532929"
}, {
"label": "洱源县",
"value": "532930"
}, {
"label": "剑川县",
"value": "532931"
}, {
"label": "鹤庆县",
"value": "532932"
}], [{
"label": "瑞丽市",
"value": "533102"
}, {
"label": "芒市",
"value": "533103"
}, {
"label": "梁河县",
"value": "533122"
}, {
"label": "盈江县",
"value": "533123"
}, {
"label": "陇川县",
"value": "533124"
}], [{
"label": "泸水市",
"value": "533301"
}, {
"label": "福贡县",
"value": "533323"
}, {
"label": "贡山独龙族怒族自治县",
"value": "533324"
}, {
"label": "兰坪白族普米族自治县",
"value": "533325"
}], [{
"label": "香格里拉市",
"value": "533401"
}, {
"label": "德钦县",
"value": "533422"
}, {
"label": "维西傈僳族自治县",
"value": "533423"
}]], [[{
"label": "城关区",
"value": "540102"
}, {
"label": "堆龙德庆区",
"value": "540103"
}, {
"label": "林周县",
"value": "540121"
}, {
"label": "当雄县",
"value": "540122"
}, {
"label": "尼木县",
"value": "540123"
}, {
"label": "曲水县",
"value": "540124"
}, {
"label": "达孜县",
"value": "540126"
}, {
"label": "墨竹工卡县",
"value": "540127"
}, {
"label": "格尔木藏青工业园区",
"value": "540171"
}, {
"label": "拉萨经济技术开发区",
"value": "540172"
}, {
"label": "西藏文化旅游创意园区",
"value": "540173"
}, {
"label": "达孜工业园区",
"value": "540174"
}], [{
"label": "桑珠孜区",
"value": "540202"
}, {
"label": "南木林县",
"value": "540221"
}, {
"label": "江孜县",
"value": "540222"
}, {
"label": "定日县",
"value": "540223"
}, {
"label": "萨迦县",
"value": "540224"
}, {
"label": "拉孜县",
"value": "540225"
}, {
"label": "昂仁县",
"value": "540226"
}, {
"label": "谢通门县",
"value": "540227"
}, {
"label": "白朗县",
"value": "540228"
}, {
"label": "仁布县",
"value": "540229"
}, {
"label": "康马县",
"value": "540230"
}, {
"label": "定结县",
"value": "540231"
}, {
"label": "仲巴县",
"value": "540232"
}, {
"label": "亚东县",
"value": "540233"
}, {
"label": "吉隆县",
"value": "540234"
}, {
"label": "聂拉木县",
"value": "540235"
}, {
"label": "萨嘎县",
"value": "540236"
}, {
"label": "岗巴县",
"value": "540237"
}], [{
"label": "卡若区",
"value": "540302"
}, {
"label": "江达县",
"value": "540321"
}, {
"label": "贡觉县",
"value": "540322"
}, {
"label": "类乌齐县",
"value": "540323"
}, {
"label": "丁青县",
"value": "540324"
}, {
"label": "察雅县",
"value": "540325"
}, {
"label": "八宿县",
"value": "540326"
}, {
"label": "左贡县",
"value": "540327"
}, {
"label": "芒康县",
"value": "540328"
}, {
"label": "洛隆县",
"value": "540329"
}, {
"label": "边坝县",
"value": "540330"
}], [{
"label": "巴宜区",
"value": "540402"
}, {
"label": "工布江达县",
"value": "540421"
}, {
"label": "米林县",
"value": "540422"
}, {
"label": "墨脱县",
"value": "540423"
}, {
"label": "波密县",
"value": "540424"
}, {
"label": "察隅县",
"value": "540425"
}, {
"label": "朗县",
"value": "540426"
}], [{
"label": "乃东区",
"value": "540502"
}, {
"label": "扎囊县",
"value": "540521"
}, {
"label": "贡嘎县",
"value": "540522"
}, {
"label": "桑日县",
"value": "540523"
}, {
"label": "琼结县",
"value": "540524"
}, {
"label": "曲松县",
"value": "540525"
}, {
"label": "措美县",
"value": "540526"
}, {
"label": "洛扎县",
"value": "540527"
}, {
"label": "加查县",
"value": "540528"
}, {
"label": "隆子县",
"value": "540529"
}, {
"label": "错那县",
"value": "540530"
}, {
"label": "浪卡子县",
"value": "540531"
}], [{
"label": "那曲县",
"value": "542421"
}, {
"label": "嘉黎县",
"value": "542422"
}, {
"label": "比如县",
"value": "542423"
}, {
"label": "聂荣县",
"value": "542424"
}, {
"label": "安多县",
"value": "542425"
}, {
"label": "申扎县",
"value": "542426"
}, {
"label": "索县",
"value": "542427"
}, {
"label": "班戈县",
"value": "542428"
}, {
"label": "巴青县",
"value": "542429"
}, {
"label": "尼玛县",
"value": "542430"
}, {
"label": "双湖县",
"value": "542431"
}], [{
"label": "普兰县",
"value": "542521"
}, {
"label": "札达县",
"value": "542522"
}, {
"label": "噶尔县",
"value": "542523"
}, {
"label": "日土县",
"value": "542524"
}, {
"label": "革吉县",
"value": "542525"
}, {
"label": "改则县",
"value": "542526"
}, {
"label": "措勤县",
"value": "542527"
}]], [[{
"label": "新城区",
"value": "610102"
}, {
"label": "碑林区",
"value": "610103"
}, {
"label": "莲湖区",
"value": "610104"
}, {
"label": "灞桥区",
"value": "610111"
}, {
"label": "未央区",
"value": "610112"
}, {
"label": "雁塔区",
"value": "610113"
}, {
"label": "阎良区",
"value": "610114"
}, {
"label": "临潼区",
"value": "610115"
}, {
"label": "长安区",
"value": "610116"
}, {
"label": "高陵区",
"value": "610117"
}, {
"label": "鄠邑区",
"value": "610118"
}, {
"label": "蓝田县",
"value": "610122"
}, {
"label": "周至县",
"value": "610124"
}], [{
"label": "王益区",
"value": "610202"
}, {
"label": "印台区",
"value": "610203"
}, {
"label": "耀州区",
"value": "610204"
}, {
"label": "宜君县",
"value": "610222"
}], [{
"label": "渭滨区",
"value": "610302"
}, {
"label": "金台区",
"value": "610303"
}, {
"label": "陈仓区",
"value": "610304"
}, {
"label": "凤翔县",
"value": "610322"
}, {
"label": "岐山县",
"value": "610323"
}, {
"label": "扶风县",
"value": "610324"
}, {
"label": "眉县",
"value": "610326"
}, {
"label": "陇县",
"value": "610327"
}, {
"label": "千阳县",
"value": "610328"
}, {
"label": "麟游县",
"value": "610329"
}, {
"label": "凤县",
"value": "610330"
}, {
"label": "太白县",
"value": "610331"
}], [{
"label": "秦都区",
"value": "610402"
}, {
"label": "杨陵区",
"value": "610403"
}, {
"label": "渭城区",
"value": "610404"
}, {
"label": "三原县",
"value": "610422"
}, {
"label": "泾阳县",
"value": "610423"
}, {
"label": "乾县",
"value": "610424"
}, {
"label": "礼泉县",
"value": "610425"
}, {
"label": "永寿县",
"value": "610426"
}, {
"label": "彬县",
"value": "610427"
}, {
"label": "长武县",
"value": "610428"
}, {
"label": "旬邑县",
"value": "610429"
}, {
"label": "淳化县",
"value": "610430"
}, {
"label": "武功县",
"value": "610431"
}, {
"label": "兴平市",
"value": "610481"
}], [{
"label": "临渭区",
"value": "610502"
}, {
"label": "华州区",
"value": "610503"
}, {
"label": "潼关县",
"value": "610522"
}, {
"label": "大荔县",
"value": "610523"
}, {
"label": "合阳县",
"value": "610524"
}, {
"label": "澄城县",
"value": "610525"
}, {
"label": "蒲城县",
"value": "610526"
}, {
"label": "白水县",
"value": "610527"
}, {
"label": "富平县",
"value": "610528"
}, {
"label": "韩城市",
"value": "610581"
}, {
"label": "华阴市",
"value": "610582"
}], [{
"label": "宝塔区",
"value": "610602"
}, {
"label": "安塞区",
"value": "610603"
}, {
"label": "延长县",
"value": "610621"
}, {
"label": "延川县",
"value": "610622"
}, {
"label": "子长县",
"value": "610623"
}, {
"label": "志丹县",
"value": "610625"
}, {
"label": "吴起县",
"value": "610626"
}, {
"label": "甘泉县",
"value": "610627"
}, {
"label": "富县",
"value": "610628"
}, {
"label": "洛川县",
"value": "610629"
}, {
"label": "宜川县",
"value": "610630"
}, {
"label": "黄龙县",
"value": "610631"
}, {
"label": "黄陵县",
"value": "610632"
}], [{
"label": "汉台区",
"value": "610702"
}, {
"label": "南郑区",
"value": "610703"
}, {
"label": "城固县",
"value": "610722"
}, {
"label": "洋县",
"value": "610723"
}, {
"label": "西乡县",
"value": "610724"
}, {
"label": "勉县",
"value": "610725"
}, {
"label": "宁强县",
"value": "610726"
}, {
"label": "略阳县",
"value": "610727"
}, {
"label": "镇巴县",
"value": "610728"
}, {
"label": "留坝县",
"value": "610729"
}, {
"label": "佛坪县",
"value": "610730"
}], [{
"label": "榆阳区",
"value": "610802"
}, {
"label": "横山区",
"value": "610803"
}, {
"label": "府谷县",
"value": "610822"
}, {
"label": "靖边县",
"value": "610824"
}, {
"label": "定边县",
"value": "610825"
}, {
"label": "绥德县",
"value": "610826"
}, {
"label": "米脂县",
"value": "610827"
}, {
"label": "佳县",
"value": "610828"
}, {
"label": "吴堡县",
"value": "610829"
}, {
"label": "清涧县",
"value": "610830"
}, {
"label": "子洲县",
"value": "610831"
}, {
"label": "神木市",
"value": "610881"
}], [{
"label": "汉滨区",
"value": "610902"
}, {
"label": "汉阴县",
"value": "610921"
}, {
"label": "石泉县",
"value": "610922"
}, {
"label": "宁陕县",
"value": "610923"
}, {
"label": "紫阳县",
"value": "610924"
}, {
"label": "岚皋县",
"value": "610925"
}, {
"label": "平利县",
"value": "610926"
}, {
"label": "镇坪县",
"value": "610927"
}, {
"label": "旬阳县",
"value": "610928"
}, {
"label": "白河县",
"value": "610929"
}], [{
"label": "商州区",
"value": "611002"
}, {
"label": "洛南县",
"value": "611021"
}, {
"label": "丹凤县",
"value": "611022"
}, {
"label": "商南县",
"value": "611023"
}, {
"label": "山阳县",
"value": "611024"
}, {
"label": "镇安县",
"value": "611025"
}, {
"label": "柞水县",
"value": "611026"
}]], [[{
"label": "城关区",
"value": "620102"
}, {
"label": "七里河区",
"value": "620103"
}, {
"label": "西固区",
"value": "620104"
}, {
"label": "安宁区",
"value": "620105"
}, {
"label": "红古区",
"value": "620111"
}, {
"label": "永登县",
"value": "620121"
}, {
"label": "皋兰县",
"value": "620122"
}, {
"label": "榆中县",
"value": "620123"
}, {
"label": "兰州新区",
"value": "620171"
}], [{
"label": "嘉峪关市",
"value": "620201"
}], [{
"label": "金川区",
"value": "620302"
}, {
"label": "永昌县",
"value": "620321"
}], [{
"label": "白银区",
"value": "620402"
}, {
"label": "平川区",
"value": "620403"
}, {
"label": "靖远县",
"value": "620421"
}, {
"label": "会宁县",
"value": "620422"
}, {
"label": "景泰县",
"value": "620423"
}], [{
"label": "秦州区",
"value": "620502"
}, {
"label": "麦积区",
"value": "620503"
}, {
"label": "清水县",
"value": "620521"
}, {
"label": "秦安县",
"value": "620522"
}, {
"label": "甘谷县",
"value": "620523"
}, {
"label": "武山县",
"value": "620524"
}, {
"label": "张家川回族自治县",
"value": "620525"
}], [{
"label": "凉州区",
"value": "620602"
}, {
"label": "民勤县",
"value": "620621"
}, {
"label": "古浪县",
"value": "620622"
}, {
"label": "天祝藏族自治县",
"value": "620623"
}], [{
"label": "甘州区",
"value": "620702"
}, {
"label": "肃南裕固族自治县",
"value": "620721"
}, {
"label": "民乐县",
"value": "620722"
}, {
"label": "临泽县",
"value": "620723"
}, {
"label": "高台县",
"value": "620724"
}, {
"label": "山丹县",
"value": "620725"
}], [{
"label": "崆峒区",
"value": "620802"
}, {
"label": "泾川县",
"value": "620821"
}, {
"label": "灵台县",
"value": "620822"
}, {
"label": "崇信县",
"value": "620823"
}, {
"label": "华亭县",
"value": "620824"
}, {
"label": "庄浪县",
"value": "620825"
}, {
"label": "静宁县",
"value": "620826"
}, {
"label": "平凉工业园区",
"value": "620871"
}], [{
"label": "肃州区",
"value": "620902"
}, {
"label": "金塔县",
"value": "620921"
}, {
"label": "瓜州县",
"value": "620922"
}, {
"label": "肃北蒙古族自治县",
"value": "620923"
}, {
"label": "阿克塞哈萨克族自治县",
"value": "620924"
}, {
"label": "玉门市",
"value": "620981"
}, {
"label": "敦煌市",
"value": "620982"
}], [{
"label": "西峰区",
"value": "621002"
}, {
"label": "庆城县",
"value": "621021"
}, {
"label": "环县",
"value": "621022"
}, {
"label": "华池县",
"value": "621023"
}, {
"label": "合水县",
"value": "621024"
}, {
"label": "正宁县",
"value": "621025"
}, {
"label": "宁县",
"value": "621026"
}, {
"label": "镇原县",
"value": "621027"
}], [{
"label": "安定区",
"value": "621102"
}, {
"label": "通渭县",
"value": "621121"
}, {
"label": "陇西县",
"value": "621122"
}, {
"label": "渭源县",
"value": "621123"
}, {
"label": "临洮县",
"value": "621124"
}, {
"label": "漳县",
"value": "621125"
}, {
"label": "岷县",
"value": "621126"
}], [{
"label": "武都区",
"value": "621202"
}, {
"label": "成县",
"value": "621221"
}, {
"label": "文县",
"value": "621222"
}, {
"label": "宕昌县",
"value": "621223"
}, {
"label": "康县",
"value": "621224"
}, {
"label": "西和县",
"value": "621225"
}, {
"label": "礼县",
"value": "621226"
}, {
"label": "徽县",
"value": "621227"
}, {
"label": "两当县",
"value": "621228"
}], [{
"label": "临夏市",
"value": "622901"
}, {
"label": "临夏县",
"value": "622921"
}, {
"label": "康乐县",
"value": "622922"
}, {
"label": "永靖县",
"value": "622923"
}, {
"label": "广河县",
"value": "622924"
}, {
"label": "和政县",
"value": "622925"
}, {
"label": "东乡族自治县",
"value": "622926"
}, {
"label": "积石山保安族东乡族撒拉族自治县",
"value": "622927"
}], [{
"label": "合作市",
"value": "623001"
}, {
"label": "临潭县",
"value": "623021"
}, {
"label": "卓尼县",
"value": "623022"
}, {
"label": "舟曲县",
"value": "623023"
}, {
"label": "迭部县",
"value": "623024"
}, {
"label": "玛曲县",
"value": "623025"
}, {
"label": "碌曲县",
"value": "623026"
}, {
"label": "夏河县",
"value": "623027"
}]], [[{
"label": "城东区",
"value": "630102"
}, {
"label": "城中区",
"value": "630103"
}, {
"label": "城西区",
"value": "630104"
}, {
"label": "城北区",
"value": "630105"
}, {
"label": "大通回族土族自治县",
"value": "630121"
}, {
"label": "湟中县",
"value": "630122"
}, {
"label": "湟源县",
"value": "630123"
}], [{
"label": "乐都区",
"value": "630202"
}, {
"label": "平安区",
"value": "630203"
}, {
"label": "民和回族土族自治县",
"value": "630222"
}, {
"label": "互助土族自治县",
"value": "630223"
}, {
"label": "化隆回族自治县",
"value": "630224"
}, {
"label": "循化撒拉族自治县",
"value": "630225"
}], [{
"label": "门源回族自治县",
"value": "632221"
}, {
"label": "祁连县",
"value": "632222"
}, {
"label": "海晏县",
"value": "632223"
}, {
"label": "刚察县",
"value": "632224"
}], [{
"label": "同仁县",
"value": "632321"
}, {
"label": "尖扎县",
"value": "632322"
}, {
"label": "泽库县",
"value": "632323"
}, {
"label": "河南蒙古族自治县",
"value": "632324"
}], [{
"label": "共和县",
"value": "632521"
}, {
"label": "同德县",
"value": "632522"
}, {
"label": "贵德县",
"value": "632523"
}, {
"label": "兴海县",
"value": "632524"
}, {
"label": "贵南县",
"value": "632525"
}], [{
"label": "玛沁县",
"value": "632621"
}, {
"label": "班玛县",
"value": "632622"
}, {
"label": "甘德县",
"value": "632623"
}, {
"label": "达日县",
"value": "632624"
}, {
"label": "久治县",
"value": "632625"
}, {
"label": "玛多县",
"value": "632626"
}], [{
"label": "玉树市",
"value": "632701"
}, {
"label": "杂多县",
"value": "632722"
}, {
"label": "称多县",
"value": "632723"
}, {
"label": "治多县",
"value": "632724"
}, {
"label": "囊谦县",
"value": "632725"
}, {
"label": "曲麻莱县",
"value": "632726"
}], [{
"label": "格尔木市",
"value": "632801"
}, {
"label": "德令哈市",
"value": "632802"
}, {
"label": "乌兰县",
"value": "632821"
}, {
"label": "都兰县",
"value": "632822"
}, {
"label": "天峻县",
"value": "632823"
}, {
"label": "大柴旦行政委员会",
"value": "632857"
}, {
"label": "冷湖行政委员会",
"value": "632858"
}, {
"label": "茫崖行政委员会",
"value": "632859"
}]], [[{
"label": "兴庆区",
"value": "640104"
}, {
"label": "西夏区",
"value": "640105"
}, {
"label": "金凤区",
"value": "640106"
}, {
"label": "永宁县",
"value": "640121"
}, {
"label": "贺兰县",
"value": "640122"
}, {
"label": "灵武市",
"value": "640181"
}], [{
"label": "大武口区",
"value": "640202"
}, {
"label": "惠农区",
"value": "640205"
}, {
"label": "平罗县",
"value": "640221"
}], [{
"label": "利通区",
"value": "640302"
}, {
"label": "红寺堡区",
"value": "640303"
}, {
"label": "盐池县",
"value": "640323"
}, {
"label": "同心县",
"value": "640324"
}, {
"label": "青铜峡市",
"value": "640381"
}], [{
"label": "原州区",
"value": "640402"
}, {
"label": "西吉县",
"value": "640422"
}, {
"label": "隆德县",
"value": "640423"
}, {
"label": "泾源县",
"value": "640424"
}, {
"label": "彭阳县",
"value": "640425"
}], [{
"label": "沙坡头区",
"value": "640502"
}, {
"label": "中宁县",
"value": "640521"
}, {
"label": "海原县",
"value": "640522"
}]], [[{
"label": "天山区",
"value": "650102"
}, {
"label": "沙依巴克区",
"value": "650103"
}, {
"label": "新市区",
"value": "650104"
}, {
"label": "水磨沟区",
"value": "650105"
}, {
"label": "头屯河区",
"value": "650106"
}, {
"label": "达坂城区",
"value": "650107"
}, {
"label": "米东区",
"value": "650109"
}, {
"label": "乌鲁木齐县",
"value": "650121"
}, {
"label": "乌鲁木齐经济技术开发区",
"value": "650171"
}, {
"label": "乌鲁木齐高新技术产业开发区",
"value": "650172"
}], [{
"label": "独山子区",
"value": "650202"
}, {
"label": "克拉玛依区",
"value": "650203"
}, {
"label": "白碱滩区",
"value": "650204"
}, {
"label": "乌尔禾区",
"value": "650205"
}], [{
"label": "高昌区",
"value": "650402"
}, {
"label": "鄯善县",
"value": "650421"
}, {
"label": "托克逊县",
"value": "650422"
}], [{
"label": "伊州区",
"value": "650502"
}, {
"label": "巴里坤哈萨克自治县",
"value": "650521"
}, {
"label": "伊吾县",
"value": "650522"
}], [{
"label": "昌吉市",
"value": "652301"
}, {
"label": "阜康市",
"value": "652302"
}, {
"label": "呼图壁县",
"value": "652323"
}, {
"label": "玛纳斯县",
"value": "652324"
}, {
"label": "奇台县",
"value": "652325"
}, {
"label": "吉木萨尔县",
"value": "652327"
}, {
"label": "木垒哈萨克自治县",
"value": "652328"
}], [{
"label": "博乐市",
"value": "652701"
}, {
"label": "阿拉山口市",
"value": "652702"
}, {
"label": "精河县",
"value": "652722"
}, {
"label": "温泉县",
"value": "652723"
}], [{
"label": "库尔勒市",
"value": "652801"
}, {
"label": "轮台县",
"value": "652822"
}, {
"label": "尉犁县",
"value": "652823"
}, {
"label": "若羌县",
"value": "652824"
}, {
"label": "且末县",
"value": "652825"
}, {
"label": "焉耆回族自治县",
"value": "652826"
}, {
"label": "和静县",
"value": "652827"
}, {
"label": "和硕县",
"value": "652828"
}, {
"label": "博湖县",
"value": "652829"
}, {
"label": "库尔勒经济技术开发区",
"value": "652871"
}], [{
"label": "阿克苏市",
"value": "652901"
}, {
"label": "温宿县",
"value": "652922"
}, {
"label": "库车县",
"value": "652923"
}, {
"label": "沙雅县",
"value": "652924"
}, {
"label": "新和县",
"value": "652925"
}, {
"label": "拜城县",
"value": "652926"
}, {
"label": "乌什县",
"value": "652927"
}, {
"label": "阿瓦提县",
"value": "652928"
}, {
"label": "柯坪县",
"value": "652929"
}], [{
"label": "阿图什市",
"value": "653001"
}, {
"label": "阿克陶县",
"value": "653022"
}, {
"label": "阿合奇县",
"value": "653023"
}, {
"label": "乌恰县",
"value": "653024"
}], [{
"label": "喀什市",
"value": "653101"
}, {
"label": "疏附县",
"value": "653121"
}, {
"label": "疏勒县",
"value": "653122"
}, {
"label": "英吉沙县",
"value": "653123"
}, {
"label": "泽普县",
"value": "653124"
}, {
"label": "莎车县",
"value": "653125"
}, {
"label": "叶城县",
"value": "653126"
}, {
"label": "麦盖提县",
"value": "653127"
}, {
"label": "岳普湖县",
"value": "653128"
}, {
"label": "伽师县",
"value": "653129"
}, {
"label": "巴楚县",
"value": "653130"
}, {
"label": "塔什库尔干塔吉克自治县",
"value": "653131"
}], [{
"label": "和田市",
"value": "653201"
}, {
"label": "和田县",
"value": "653221"
}, {
"label": "墨玉县",
"value": "653222"
}, {
"label": "皮山县",
"value": "653223"
}, {
"label": "洛浦县",
"value": "653224"
}, {
"label": "策勒县",
"value": "653225"
}, {
"label": "于田县",
"value": "653226"
}, {
"label": "民丰县",
"value": "653227"
}], [{
"label": "伊宁市",
"value": "654002"
}, {
"label": "奎屯市",
"value": "654003"
}, {
"label": "霍尔果斯市",
"value": "654004"
}, {
"label": "伊宁县",
"value": "654021"
}, {
"label": "察布查尔锡伯自治县",
"value": "654022"
}, {
"label": "霍城县",
"value": "654023"
}, {
"label": "巩留县",
"value": "654024"
}, {
"label": "新源县",
"value": "654025"
}, {
"label": "昭苏县",
"value": "654026"
}, {
"label": "特克斯县",
"value": "654027"
}, {
"label": "尼勒克县",
"value": "654028"
}], [{
"label": "塔城市",
"value": "654201"
}, {
"label": "乌苏市",
"value": "654202"
}, {
"label": "额敏县",
"value": "654221"
}, {
"label": "沙湾县",
"value": "654223"
}, {
"label": "托里县",
"value": "654224"
}, {
"label": "裕民县",
"value": "654225"
}, {
"label": "和布克赛尔蒙古自治县",
"value": "654226"
}], [{
"label": "阿勒泰市",
"value": "654301"
}, {
"label": "布尔津县",
"value": "654321"
}, {
"label": "富蕴县",
"value": "654322"
}, {
"label": "福海县",
"value": "654323"
}, {
"label": "哈巴河县",
"value": "654324"
}, {
"label": "青河县",
"value": "654325"
}, {
"label": "吉木乃县",
"value": "654326"
}], [{
"label": "石河子市",
"value": "659001"
}, {
"label": "阿拉尔市",
"value": "659002"
}, {
"label": "图木舒克市",
"value": "659003"
}, {
"label": "五家渠市",
"value": "659004"
}, {
"label": "铁门关市",
"value": "659006"
}]], [[{
"label": "台北",
"value": "660101"
}], [{
"label": "高雄",
"value": "660201"
}], [{
"label": "基隆",
"value": "660301"
}], [{
"label": "台中",
"value": "660401"
}], [{
"label": "台南",
"value": "660501"
}], [{
"label": "新竹",
"value": "660601"
}], [{
"label": "嘉义",
"value": "660701"
}], [{
"label": "宜兰",
"value": "660801"
}], [{
"label": "桃园",
"value": "660901"
}], [{
"label": "苗栗",
"value": "661001"
}], [{
"label": "彰化",
"value": "661101"
}], [{
"label": "南投",
"value": "661201"
}], [{
"label": "云林",
"value": "661301"
}], [{
"label": "屏东",
"value": "661401"
}], [{
"label": "台东",
"value": "661501"
}], [{
"label": "花莲",
"value": "661601"
}], [{
"label": "澎湖",
"value": "661701"
}]], [[{
"label": "香港岛",
"value": "670101"
}], [{
"label": "九龙",
"value": "670201"
}], [{
"label": "新界",
"value": "670301"
}]], [[{
"label": "澳门半岛",
"value": "680101"
}], [{
"label": "氹仔岛",
"value": "680201"
}], [{
"label": "路环岛",
"value": "680301"
}], [{
"label": "路氹城",
"value": "680401"
}]]];
var _default = areaData;
exports.default = _default;
/***/ }),
/***/ 122:
/*!*****************************************!*\
!*** ./node_modules/create-hash/md5.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var MD5 = __webpack_require__(/*! md5.js */ 87)
module.exports = function (buffer) {
return new MD5().update(buffer).digest()
}
/***/ }),
/***/ 123:
/*!***********************************************!*\
!*** ./node_modules/browserify-sign/algos.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./browser/algorithms.json */ 124)
/***/ }),
/***/ 124:
/*!**************************************************************!*\
!*** ./node_modules/browserify-sign/browser/algorithms.json ***!
\**************************************************************/
/*! exports provided: sha224WithRSAEncryption, RSA-SHA224, sha256WithRSAEncryption, RSA-SHA256, sha384WithRSAEncryption, RSA-SHA384, sha512WithRSAEncryption, RSA-SHA512, RSA-SHA1, ecdsa-with-SHA1, sha256, sha224, sha384, sha512, DSA-SHA, DSA-SHA1, DSA, DSA-WITH-SHA224, DSA-SHA224, DSA-WITH-SHA256, DSA-SHA256, DSA-WITH-SHA384, DSA-SHA384, DSA-WITH-SHA512, DSA-SHA512, DSA-RIPEMD160, ripemd160WithRSA, RSA-RIPEMD160, md5WithRSAEncryption, RSA-MD5, default */
/***/ (function(module) {
module.exports = JSON.parse("{\"sha224WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"sha224\",\"id\":\"302d300d06096086480165030402040500041c\"},\"RSA-SHA224\":{\"sign\":\"ecdsa/rsa\",\"hash\":\"sha224\",\"id\":\"302d300d06096086480165030402040500041c\"},\"sha256WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"sha256\",\"id\":\"3031300d060960864801650304020105000420\"},\"RSA-SHA256\":{\"sign\":\"ecdsa/rsa\",\"hash\":\"sha256\",\"id\":\"3031300d060960864801650304020105000420\"},\"sha384WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"sha384\",\"id\":\"3041300d060960864801650304020205000430\"},\"RSA-SHA384\":{\"sign\":\"ecdsa/rsa\",\"hash\":\"sha384\",\"id\":\"3041300d060960864801650304020205000430\"},\"sha512WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"sha512\",\"id\":\"3051300d060960864801650304020305000440\"},\"RSA-SHA512\":{\"sign\":\"ecdsa/rsa\",\"hash\":\"sha512\",\"id\":\"3051300d060960864801650304020305000440\"},\"RSA-SHA1\":{\"sign\":\"rsa\",\"hash\":\"sha1\",\"id\":\"3021300906052b0e03021a05000414\"},\"ecdsa-with-SHA1\":{\"sign\":\"ecdsa\",\"hash\":\"sha1\",\"id\":\"\"},\"sha256\":{\"sign\":\"ecdsa\",\"hash\":\"sha256\",\"id\":\"\"},\"sha224\":{\"sign\":\"ecdsa\",\"hash\":\"sha224\",\"id\":\"\"},\"sha384\":{\"sign\":\"ecdsa\",\"hash\":\"sha384\",\"id\":\"\"},\"sha512\":{\"sign\":\"ecdsa\",\"hash\":\"sha512\",\"id\":\"\"},\"DSA-SHA\":{\"sign\":\"dsa\",\"hash\":\"sha1\",\"id\":\"\"},\"DSA-SHA1\":{\"sign\":\"dsa\",\"hash\":\"sha1\",\"id\":\"\"},\"DSA\":{\"sign\":\"dsa\",\"hash\":\"sha1\",\"id\":\"\"},\"DSA-WITH-SHA224\":{\"sign\":\"dsa\",\"hash\":\"sha224\",\"id\":\"\"},\"DSA-SHA224\":{\"sign\":\"dsa\",\"hash\":\"sha224\",\"id\":\"\"},\"DSA-WITH-SHA256\":{\"sign\":\"dsa\",\"hash\":\"sha256\",\"id\":\"\"},\"DSA-SHA256\":{\"sign\":\"dsa\",\"hash\":\"sha256\",\"id\":\"\"},\"DSA-WITH-SHA384\":{\"sign\":\"dsa\",\"hash\":\"sha384\",\"id\":\"\"},\"DSA-SHA384\":{\"sign\":\"dsa\",\"hash\":\"sha384\",\"id\":\"\"},\"DSA-WITH-SHA512\":{\"sign\":\"dsa\",\"hash\":\"sha512\",\"id\":\"\"},\"DSA-SHA512\":{\"sign\":\"dsa\",\"hash\":\"sha512\",\"id\":\"\"},\"DSA-RIPEMD160\":{\"sign\":\"dsa\",\"hash\":\"rmd160\",\"id\":\"\"},\"ripemd160WithRSA\":{\"sign\":\"rsa\",\"hash\":\"rmd160\",\"id\":\"3021300906052b2403020105000414\"},\"RSA-RIPEMD160\":{\"sign\":\"rsa\",\"hash\":\"rmd160\",\"id\":\"3021300906052b2403020105000414\"},\"md5WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"md5\",\"id\":\"3020300c06082a864886f70d020505000410\"},\"RSA-MD5\":{\"sign\":\"rsa\",\"hash\":\"md5\",\"id\":\"3020300c06082a864886f70d020505000410\"}}");
/***/ }),
/***/ 1240:
/*!***********************************************************************!*\
!*** E:/project/bigdata_WX/components/bazaar-city_list/citylist.json ***!
\***********************************************************************/
/*! exports provided: hotcity, city, default */
/***/ (function(module) {
module.exports = JSON.parse("{\"hotcity\":{\"title\":\"热门城市\",\"lists\":[\"上海\",\"北京\",\"广州\",\"深圳\",\"武汉\",\"天津\",\"西安\",\"南京\",\"杭州\",\"成都\",\"重庆\"]},\"city\":[{\"title\":\"A\",\"lists\":[\"阿坝\",\"阿拉善\",\"阿里\",\"安康\",\"安庆\",\"鞍山\",\"安顺\",\"安阳\",\"澳门\"]},{\"title\":\"B\",\"lists\":[\"北京\",\"白银\",\"保定\",\"宝鸡\",\"保山\",\"包头\",\"巴中\",\"北海\",\"蚌埠\",\"本溪\",\"毕节\",\"滨州\",\"百色\",\"亳州\"]},{\"title\":\"C\",\"lists\":[\"重庆\",\"成都\",\"长沙\",\"长春\",\"沧州\",\"常德\",\"昌都\",\"长治\",\"常州\",\"巢湖\",\"潮州\",\"承德\",\"郴州\",\"赤峰\",\"池州\",\"崇左\",\"楚雄\",\"滁州\",\"朝阳\"]},{\"title\":\"D\",\"lists\":[\"大连\",\"东莞\",\"大理\",\"丹东\",\"大庆\",\"大同\",\"大兴安岭\",\"德宏\",\"德阳\",\"德州\",\"定西\",\"迪庆\",\"东营\"]},{\"title\":\"E\",\"lists\":[\"鄂尔多斯\",\"恩施\",\"鄂州\"]},{\"title\":\"F\",\"lists\":[\"福州\",\"防城港\",\"佛山\",\"抚顺\",\"抚州\",\"阜新\",\"阜阳\"]},{\"title\":\"G\",\"lists\":[\"广州\",\"桂林\",\"贵阳\",\"甘南\",\"赣州\",\"甘孜\",\"广安\",\"广元\",\"贵港\",\"果洛\"]},{\"title\":\"H\",\"lists\":[\"杭州\",\"哈尔滨\",\"合肥\",\"海口\",\"呼和浩特\",\"海北\",\"海东\",\"海南\",\"海西\",\"邯郸\",\"汉中\",\"鹤壁\",\"河池\",\"鹤岗\",\"黑河\",\"衡水\",\"衡阳\",\"河源\",\"贺州\",\"红河\",\"淮安\",\"淮北\",\"怀化\",\"淮南\",\"黄冈\",\"黄南\",\"黄山\",\"黄石\",\"惠州\",\"葫芦岛\",\"呼伦贝尔\",\"湖州\",\"菏泽\"]},{\"title\":\"J\",\"lists\":[\"济南\",\"佳木斯\",\"吉安\",\"江门\",\"焦作\",\"嘉兴\",\"嘉峪关\",\"揭阳\",\"吉林\",\"金昌\",\"晋城\",\"景德镇\",\"荆门\",\"荆州\",\"金华\",\"济宁\",\"晋中\",\"锦州\",\"九江\",\"酒泉\"]},{\"title\":\"K\",\"lists\":[\"昆明\",\"开封\"]},{\"title\":\"L\",\"lists\":[\"兰州\",\"拉萨\",\"来宾\",\"莱芜\",\"廊坊\",\"乐山\",\"凉山\",\"连云港\",\"聊城\",\"辽阳\",\"辽源\",\"丽江\",\"临沧\",\"临汾\",\"临夏\",\"临沂\",\"林芝\",\"丽水\",\"六安\",\"六盘水\",\"柳州\",\"陇南\",\"龙岩\",\"娄底\",\"漯河\",\"洛阳\",\"泸州\",\"吕梁\"]},{\"title\":\"M\",\"lists\":[\"马鞍山\",\"茂名\",\"眉山\",\"梅州\",\"绵阳\",\"牡丹江\"]},{\"title\":\"N\",\"lists\":[\"南京\",\"南昌\",\"南宁\",\"宁波\",\"南充\",\"南平\",\"南通\",\"南阳\",\"那曲\",\"内江\",\"宁德\",\"怒江\"]},{\"title\":\"P\",\"lists\":[\"盘锦\",\"攀枝花\",\"平顶山\",\"平凉\",\"萍乡\",\"莆田\",\"濮阳\"]},{\"title\":\"Q\",\"lists\":[\"青岛\",\"黔东南\",\"黔南\",\"黔西南\",\"庆阳\",\"清远\",\"秦皇岛\",\"钦州\",\"齐齐哈尔\",\"泉州\",\"曲靖\",\"衢州\"]},{\"title\":\"R\",\"lists\":[\"日喀则\",\"日照\"]},{\"title\":\"S\",\"lists\":[\"上海\",\"深圳\",\"苏州\",\"沈阳\",\"石家庄\",\"三门峡\",\"三明\",\"三亚\",\"商洛\",\"商丘\",\"上饶\",\"山南\",\"汕头\",\"汕尾\",\"韶关\",\"绍兴\",\"邵阳\",\"十堰\",\"朔州\",\"四平\",\"绥化\",\"遂宁\",\"随州\",\"宿迁\",\"宿州\"]},{\"title\":\"T\",\"lists\":[\"天津\",\"太原\",\"泰安\",\"泰州\",\"台州\",\"唐山\",\"天水\",\"铁岭\",\"铜川\",\"通化\",\"通辽\",\"铜陵\",\"铜仁\",\"台湾\"]},{\"title\":\"W\",\"lists\":[\"武汉\",\"乌鲁木齐\",\"无锡\",\"威海\",\"潍坊\",\"文山\",\"温州\",\"乌海\",\"芜湖\",\"乌兰察布\",\"武威\",\"梧州\"]},{\"title\":\"X\",\"lists\":[\"厦门\",\"西安\",\"西宁\",\"襄樊\",\"湘潭\",\"湘西\",\"咸宁\",\"咸阳\",\"孝感\",\"邢台\",\"新乡\",\"信阳\",\"新余\",\"忻州\",\"西双版纳\",\"宣城\",\"许昌\",\"徐州\",\"香港\",\"锡林郭勒\",\"兴安\"]},{\"title\":\"Y\",\"lists\":[\"银川\",\"雅安\",\"延安\",\"延边\",\"盐城\",\"阳江\",\"阳泉\",\"扬州\",\"烟台\",\"宜宾\",\"宜昌\",\"宜春\",\"营口\",\"益阳\",\"永州\",\"岳阳\",\"榆林\",\"运城\",\"云浮\",\"玉树\",\"玉溪\",\"玉林\"]},{\"title\":\"Z\",\"lists\":[\"杂多县\",\"赞皇县\",\"枣强县\",\"枣阳市\",\"枣庄\",\"泽库县\",\"增城市\",\"曾都区\",\"泽普县\",\"泽州县\",\"札达县\",\"扎赉特旗\",\"扎兰屯市\",\"扎鲁特旗\",\"扎囊县\",\"张北县\",\"张店区\",\"章贡区\",\"张家港\",\"张家界\",\"张家口\",\"漳平市\",\"漳浦县\",\"章丘市\",\"樟树市\",\"张湾区\",\"彰武县\",\"漳县\",\"张掖\",\"漳州\",\"长子县\",\"湛河区\",\"湛江\",\"站前区\",\"沾益县\",\"诏安县\",\"召陵区\",\"昭平县\",\"肇庆\",\"昭通\",\"赵县\",\"昭阳区\",\"招远市\",\"肇源县\",\"肇州县\",\"柞水县\",\"柘城县\",\"浙江\",\"镇安县\",\"振安区\",\"镇巴县\",\"正安县\",\"正定县\",\"正定新区\",\"正蓝旗\",\"正宁县\",\"蒸湘区\",\"正镶白旗\",\"正阳县\",\"郑州\",\"镇海区\",\"镇江\",\"浈江区\",\"镇康县\",\"镇赉县\",\"镇平县\",\"振兴区\",\"镇雄县\",\"镇原县\",\"志丹县\",\"治多县\",\"芝罘区\",\"枝江市\",\"芷江侗族自治县\",\"织金县\",\"中方县\",\"中江县\",\"钟楼区\",\"中牟县\",\"中宁县\",\"中山\",\"中山区\",\"钟山区\",\"钟山县\",\"中卫\",\"钟祥市\",\"中阳县\",\"中原区\",\"周村区\",\"周口\",\"周宁县\",\"舟曲县\",\"舟山\",\"周至县\",\"庄河市\",\"诸城市\",\"珠海\",\"珠晖区\",\"诸暨市\",\"驻马店\",\"准格尔旗\",\"涿鹿县\",\"卓尼\",\"涿州市\",\"卓资县\",\"珠山区\",\"竹山县\",\"竹溪县\",\"株洲\",\"株洲县\",\"淄博\",\"子长县\",\"淄川区\",\"自贡\",\"秭归县\",\"紫金县\",\"自流井区\",\"资溪县\",\"资兴市\",\"资阳\"]}]}");
/***/ }),
/***/ 125:
/*!****************************************!*\
!*** ./node_modules/pbkdf2/browser.js ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
exports.pbkdf2 = __webpack_require__(/*! ./lib/async */ 126)
exports.pbkdf2Sync = __webpack_require__(/*! ./lib/sync */ 129)
/***/ }),
/***/ 126:
/*!******************************************!*\
!*** ./node_modules/pbkdf2/lib/async.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var checkParameters = __webpack_require__(/*! ./precondition */ 127)
var defaultEncoding = __webpack_require__(/*! ./default-encoding */ 128)
var sync = __webpack_require__(/*! ./sync */ 129)
var toBuffer = __webpack_require__(/*! ./to-buffer */ 130)
var ZERO_BUF
var subtle = global.crypto && global.crypto.subtle
var 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'
}
var checks = []
function checkNative (algo) {
if (global.process && !global.process.browser) {
return Promise.resolve(false)
}
if (!subtle || !subtle.importKey || !subtle.deriveBits) {
return Promise.resolve(false)
}
if (checks[algo] !== undefined) {
return checks[algo]
}
ZERO_BUF = ZERO_BUF || Buffer.alloc(8)
var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo)
.then(function () {
return true
}).catch(function () {
return false
})
checks[algo] = prom
return prom
}
var nextTick
function getNextTick () {
if (nextTick) {
return nextTick
}
if (global.process && global.process.nextTick) {
nextTick = global.process.nextTick
} else if (global.queueMicrotask) {
nextTick = global.queueMicrotask
} else if (global.setImmediate) {
nextTick = global.setImmediate
} else {
nextTick = global.setTimeout
}
return nextTick
}
function browserPbkdf2 (password, salt, iterations, length, algo) {
return subtle.importKey(
'raw', password, { name: 'PBKDF2' }, false, ['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)
})
}
function resolvePromise (promise, callback) {
promise.then(function (out) {
getNextTick()(function () {
callback(null, out)
})
}, function (e) {
getNextTick()(function () {
callback(e)
})
})
}
module.exports = function (password, salt, iterations, keylen, digest, callback) {
if (typeof digest === 'function') {
callback = digest
digest = undefined
}
digest = digest || 'sha1'
var algo = toBrowser[digest.toLowerCase()]
if (!algo || typeof global.Promise !== 'function') {
getNextTick()(function () {
var out
try {
out = sync(password, salt, iterations, keylen, digest)
} catch (e) {
return callback(e)
}
callback(null, out)
})
return
}
checkParameters(iterations, keylen)
password = toBuffer(password, defaultEncoding, 'Password')
salt = toBuffer(salt, defaultEncoding, 'Salt')
if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2')
resolvePromise(checkNative(algo).then(function (resp) {
if (resp) return browserPbkdf2(password, salt, iterations, keylen, algo)
return sync(password, salt, iterations, keylen, digest)
}), callback)
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3)))
/***/ }),
/***/ 127:
/*!*************************************************!*\
!*** ./node_modules/pbkdf2/lib/precondition.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs
module.exports = function (iterations, keylen) {
if (typeof iterations !== 'number') {
throw new TypeError('Iterations not a number')
}
if (iterations < 0) {
throw new TypeError('Bad iterations')
}
if (typeof keylen !== 'number') {
throw new TypeError('Key length not a number')
}
if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */
throw new TypeError('Bad key length')
}
}
/***/ }),
/***/ 128:
/*!*****************************************************!*\
!*** ./node_modules/pbkdf2/lib/default-encoding.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global, process) {var defaultEncoding
/* istanbul ignore next */
if (global.process && global.process.browser) {
defaultEncoding = 'utf-8'
} else if (global.process && global.process.version) {
var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)
defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'
} else {
defaultEncoding = 'utf-8'
}
module.exports = defaultEncoding
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3), __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 78)))
/***/ }),
/***/ 129:
/*!*************************************************!*\
!*** ./node_modules/pbkdf2/lib/sync-browser.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var md5 = __webpack_require__(/*! create-hash/md5 */ 122)
var RIPEMD160 = __webpack_require__(/*! ripemd160 */ 105)
var sha = __webpack_require__(/*! sha.js */ 106)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var checkParameters = __webpack_require__(/*! ./precondition */ 127)
var defaultEncoding = __webpack_require__(/*! ./default-encoding */ 128)
var toBuffer = __webpack_require__(/*! ./to-buffer */ 130)
var ZEROS = Buffer.alloc(128)
var sizes = {
md5: 16,
sha1: 20,
sha224: 28,
sha256: 32,
sha384: 48,
sha512: 64,
rmd160: 20,
ripemd160: 20
}
function Hmac (alg, key, saltLen) {
var hash = getDigest(alg)
var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64
if (key.length > blocksize) {
key = hash(key)
} else if (key.length < blocksize) {
key = Buffer.concat([key, ZEROS], blocksize)
}
var ipad = Buffer.allocUnsafe(blocksize + sizes[alg])
var opad = Buffer.allocUnsafe(blocksize + sizes[alg])
for (var i = 0; i < blocksize; i++) {
ipad[i] = key[i] ^ 0x36
opad[i] = key[i] ^ 0x5C
}
var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4)
ipad.copy(ipad1, 0, 0, blocksize)
this.ipad1 = ipad1
this.ipad2 = ipad
this.opad = opad
this.alg = alg
this.blocksize = blocksize
this.hash = hash
this.size = sizes[alg]
}
Hmac.prototype.run = function (data, ipad) {
data.copy(ipad, this.blocksize)
var h = this.hash(ipad)
h.copy(this.opad, this.blocksize)
return this.hash(this.opad)
}
function getDigest (alg) {
function shaFunc (data) {
return sha(alg).update(data).digest()
}
function rmd160Func (data) {
return new RIPEMD160().update(data).digest()
}
if (alg === 'rmd160' || alg === 'ripemd160') return rmd160Func
if (alg === 'md5') return md5
return shaFunc
}
function pbkdf2 (password, salt, iterations, keylen, digest) {
checkParameters(iterations, keylen)
password = toBuffer(password, defaultEncoding, 'Password')
salt = toBuffer(salt, defaultEncoding, 'Salt')
digest = digest || 'sha1'
var hmac = new Hmac(digest, password, salt.length)
var DK = Buffer.allocUnsafe(keylen)
var block1 = Buffer.allocUnsafe(salt.length + 4)
salt.copy(block1, 0, 0, salt.length)
var destPos = 0
var hLen = sizes[digest]
var l = Math.ceil(keylen / hLen)
for (var i = 1; i <= l; i++) {
block1.writeUInt32BE(i, salt.length)
var T = hmac.run(block1, hmac.ipad1)
var U = T
for (var j = 1; j < iterations; j++) {
U = hmac.run(U, hmac.ipad2)
for (var k = 0; k < hLen; k++) T[k] ^= U[k]
}
T.copy(DK, destPos)
destPos += hLen
}
return DK
}
module.exports = pbkdf2
/***/ }),
/***/ 13:
/*!*******************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _typeof(o) {
"@babel/helpers - typeof";
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
return typeof o;
} : function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
}
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 130:
/*!**********************************************!*\
!*** ./node_modules/pbkdf2/lib/to-buffer.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
module.exports = function (thing, encoding, name) {
if (Buffer.isBuffer(thing)) {
return thing
} else if (typeof thing === 'string') {
return Buffer.from(thing, encoding)
} else if (ArrayBuffer.isView(thing)) {
return Buffer.from(thing.buffer)
} else {
throw new TypeError(name + ' must be a string, a Buffer, a typed array or a DataView')
}
}
/***/ }),
/***/ 131:
/*!***************************************************!*\
!*** ./node_modules/browserify-cipher/browser.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var DES = __webpack_require__(/*! browserify-des */ 132)
var aes = __webpack_require__(/*! browserify-aes/browser */ 140)
var aesModes = __webpack_require__(/*! browserify-aes/modes */ 142)
var desModes = __webpack_require__(/*! browserify-des/modes */ 159)
var ebtk = __webpack_require__(/*! evp_bytestokey */ 157)
function createCipher (suite, password) {
suite = suite.toLowerCase()
var keyLen, ivLen
if (aesModes[suite]) {
keyLen = aesModes[suite].key
ivLen = aesModes[suite].iv
} else if (desModes[suite]) {
keyLen = desModes[suite].key * 8
ivLen = desModes[suite].iv
} else {
throw new TypeError('invalid suite type')
}
var keys = ebtk(password, false, keyLen, ivLen)
return createCipheriv(suite, keys.key, keys.iv)
}
function createDecipher (suite, password) {
suite = suite.toLowerCase()
var keyLen, ivLen
if (aesModes[suite]) {
keyLen = aesModes[suite].key
ivLen = aesModes[suite].iv
} else if (desModes[suite]) {
keyLen = desModes[suite].key * 8
ivLen = desModes[suite].iv
} else {
throw new TypeError('invalid suite type')
}
var keys = ebtk(password, false, keyLen, ivLen)
return createDecipheriv(suite, keys.key, keys.iv)
}
function createCipheriv (suite, key, iv) {
suite = suite.toLowerCase()
if (aesModes[suite]) return aes.createCipheriv(suite, key, iv)
if (desModes[suite]) return new DES({ key: key, iv: iv, mode: suite })
throw new TypeError('invalid suite type')
}
function createDecipheriv (suite, key, iv) {
suite = suite.toLowerCase()
if (aesModes[suite]) return aes.createDecipheriv(suite, key, iv)
if (desModes[suite]) return new DES({ key: key, iv: iv, mode: suite, decrypt: true })
throw new TypeError('invalid suite type')
}
function getCiphers () {
return Object.keys(desModes).concat(aes.getCiphers())
}
exports.createCipher = exports.Cipher = createCipher
exports.createCipheriv = exports.Cipheriv = createCipheriv
exports.createDecipher = exports.Decipher = createDecipher
exports.createDecipheriv = exports.Decipheriv = createDecipheriv
exports.listCiphers = exports.getCiphers = getCiphers
/***/ }),
/***/ 132:
/*!**********************************************!*\
!*** ./node_modules/browserify-des/index.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var CipherBase = __webpack_require__(/*! cipher-base */ 114)
var des = __webpack_require__(/*! des.js */ 133)
var inherits = __webpack_require__(/*! inherits */ 86)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var modes = {
'des-ede3-cbc': des.CBC.instantiate(des.EDE),
'des-ede3': des.EDE,
'des-ede-cbc': des.CBC.instantiate(des.EDE),
'des-ede': des.EDE,
'des-cbc': des.CBC.instantiate(des.DES),
'des-ecb': des.DES
}
modes.des = modes['des-cbc']
modes.des3 = modes['des-ede3-cbc']
module.exports = DES
inherits(DES, CipherBase)
function DES (opts) {
CipherBase.call(this)
var modeName = opts.mode.toLowerCase()
var mode = modes[modeName]
var type
if (opts.decrypt) {
type = 'decrypt'
} else {
type = 'encrypt'
}
var key = opts.key
if (!Buffer.isBuffer(key)) {
key = Buffer.from(key)
}
if (modeName === 'des-ede' || modeName === 'des-ede-cbc') {
key = Buffer.concat([key, key.slice(0, 8)])
}
var iv = opts.iv
if (!Buffer.isBuffer(iv)) {
iv = Buffer.from(iv)
}
this._des = mode.create({
key: key,
iv: iv,
type: type
})
}
DES.prototype._update = function (data) {
return Buffer.from(this._des.update(data))
}
DES.prototype._final = function () {
return Buffer.from(this._des.final())
}
/***/ }),
/***/ 133:
/*!****************************************!*\
!*** ./node_modules/des.js/lib/des.js ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.utils = __webpack_require__(/*! ./des/utils */ 134);
exports.Cipher = __webpack_require__(/*! ./des/cipher */ 135);
exports.DES = __webpack_require__(/*! ./des/des */ 137);
exports.CBC = __webpack_require__(/*! ./des/cbc */ 138);
exports.EDE = __webpack_require__(/*! ./des/ede */ 139);
/***/ }),
/***/ 134:
/*!**********************************************!*\
!*** ./node_modules/des.js/lib/des/utils.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.readUInt32BE = function readUInt32BE(bytes, off) {
var res = (bytes[0 + off] << 24) |
(bytes[1 + off] << 16) |
(bytes[2 + off] << 8) |
bytes[3 + off];
return res >>> 0;
};
exports.writeUInt32BE = function writeUInt32BE(bytes, value, off) {
bytes[0 + off] = value >>> 24;
bytes[1 + off] = (value >>> 16) & 0xff;
bytes[2 + off] = (value >>> 8) & 0xff;
bytes[3 + off] = value & 0xff;
};
exports.ip = function ip(inL, inR, out, off) {
var outL = 0;
var outR = 0;
for (var i = 6; i >= 0; i -= 2) {
for (var j = 0; j <= 24; j += 8) {
outL <<= 1;
outL |= (inR >>> (j + i)) & 1;
}
for (var j = 0; j <= 24; j += 8) {
outL <<= 1;
outL |= (inL >>> (j + i)) & 1;
}
}
for (var i = 6; i >= 0; i -= 2) {
for (var j = 1; j <= 25; j += 8) {
outR <<= 1;
outR |= (inR >>> (j + i)) & 1;
}
for (var j = 1; j <= 25; j += 8) {
outR <<= 1;
outR |= (inL >>> (j + i)) & 1;
}
}
out[off + 0] = outL >>> 0;
out[off + 1] = outR >>> 0;
};
exports.rip = function rip(inL, inR, out, off) {
var outL = 0;
var outR = 0;
for (var i = 0; i < 4; i++) {
for (var j = 24; j >= 0; j -= 8) {
outL <<= 1;
outL |= (inR >>> (j + i)) & 1;
outL <<= 1;
outL |= (inL >>> (j + i)) & 1;
}
}
for (var i = 4; i < 8; i++) {
for (var j = 24; j >= 0; j -= 8) {
outR <<= 1;
outR |= (inR >>> (j + i)) & 1;
outR <<= 1;
outR |= (inL >>> (j + i)) & 1;
}
}
out[off + 0] = outL >>> 0;
out[off + 1] = outR >>> 0;
};
exports.pc1 = function pc1(inL, inR, out, off) {
var outL = 0;
var outR = 0;
// 7, 15, 23, 31, 39, 47, 55, 63
// 6, 14, 22, 30, 39, 47, 55, 63
// 5, 13, 21, 29, 39, 47, 55, 63
// 4, 12, 20, 28
for (var i = 7; i >= 5; i--) {
for (var j = 0; j <= 24; j += 8) {
outL <<= 1;
outL |= (inR >> (j + i)) & 1;
}
for (var j = 0; j <= 24; j += 8) {
outL <<= 1;
outL |= (inL >> (j + i)) & 1;
}
}
for (var j = 0; j <= 24; j += 8) {
outL <<= 1;
outL |= (inR >> (j + i)) & 1;
}
// 1, 9, 17, 25, 33, 41, 49, 57
// 2, 10, 18, 26, 34, 42, 50, 58
// 3, 11, 19, 27, 35, 43, 51, 59
// 36, 44, 52, 60
for (var i = 1; i <= 3; i++) {
for (var j = 0; j <= 24; j += 8) {
outR <<= 1;
outR |= (inR >> (j + i)) & 1;
}
for (var j = 0; j <= 24; j += 8) {
outR <<= 1;
outR |= (inL >> (j + i)) & 1;
}
}
for (var j = 0; j <= 24; j += 8) {
outR <<= 1;
outR |= (inL >> (j + i)) & 1;
}
out[off + 0] = outL >>> 0;
out[off + 1] = outR >>> 0;
};
exports.r28shl = function r28shl(num, shift) {
return ((num << shift) & 0xfffffff) | (num >>> (28 - shift));
};
var pc2table = [
// inL => outL
14, 11, 17, 4, 27, 23, 25, 0,
13, 22, 7, 18, 5, 9, 16, 24,
2, 20, 12, 21, 1, 8, 15, 26,
// inR => outR
15, 4, 25, 19, 9, 1, 26, 16,
5, 11, 23, 8, 12, 7, 17, 0,
22, 3, 10, 14, 6, 20, 27, 24
];
exports.pc2 = function pc2(inL, inR, out, off) {
var outL = 0;
var outR = 0;
var len = pc2table.length >>> 1;
for (var i = 0; i < len; i++) {
outL <<= 1;
outL |= (inL >>> pc2table[i]) & 0x1;
}
for (var i = len; i < pc2table.length; i++) {
outR <<= 1;
outR |= (inR >>> pc2table[i]) & 0x1;
}
out[off + 0] = outL >>> 0;
out[off + 1] = outR >>> 0;
};
exports.expand = function expand(r, out, off) {
var outL = 0;
var outR = 0;
outL = ((r & 1) << 5) | (r >>> 27);
for (var i = 23; i >= 15; i -= 4) {
outL <<= 6;
outL |= (r >>> i) & 0x3f;
}
for (var i = 11; i >= 3; i -= 4) {
outR |= (r >>> i) & 0x3f;
outR <<= 6;
}
outR |= ((r & 0x1f) << 1) | (r >>> 31);
out[off + 0] = outL >>> 0;
out[off + 1] = outR >>> 0;
};
var sTable = [
14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1,
3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8,
4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7,
15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13,
15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14,
9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5,
0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2,
5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9,
10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10,
1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1,
13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7,
11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12,
7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3,
1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9,
10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8,
15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14,
2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1,
8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6,
4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13,
15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3,
12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5,
0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8,
9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10,
7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13,
4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10,
3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6,
1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7,
10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12,
13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4,
10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2,
7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13,
0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11
];
exports.substitute = function substitute(inL, inR) {
var out = 0;
for (var i = 0; i < 4; i++) {
var b = (inL >>> (18 - i * 6)) & 0x3f;
var sb = sTable[i * 0x40 + b];
out <<= 4;
out |= sb;
}
for (var i = 0; i < 4; i++) {
var b = (inR >>> (18 - i * 6)) & 0x3f;
var sb = sTable[4 * 0x40 + i * 0x40 + b];
out <<= 4;
out |= sb;
}
return out >>> 0;
};
var permuteTable = [
16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22,
30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7
];
exports.permute = function permute(num) {
var out = 0;
for (var i = 0; i < permuteTable.length; i++) {
out <<= 1;
out |= (num >>> permuteTable[i]) & 0x1;
}
return out >>> 0;
};
exports.padSplit = function padSplit(num, size, group) {
var str = num.toString(2);
while (str.length < size)
str = '0' + str;
var out = [];
for (var i = 0; i < size; i += group)
out.push(str.slice(i, i + group));
return out.join(' ');
};
/***/ }),
/***/ 135:
/*!***********************************************!*\
!*** ./node_modules/des.js/lib/des/cipher.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var assert = __webpack_require__(/*! minimalistic-assert */ 136);
function Cipher(options) {
this.options = options;
this.type = this.options.type;
this.blockSize = 8;
this._init();
this.buffer = new Array(this.blockSize);
this.bufferOff = 0;
}
module.exports = Cipher;
Cipher.prototype._init = function _init() {
// Might be overrided
};
Cipher.prototype.update = function update(data) {
if (data.length === 0)
return [];
if (this.type === 'decrypt')
return this._updateDecrypt(data);
else
return this._updateEncrypt(data);
};
Cipher.prototype._buffer = function _buffer(data, off) {
// Append data to buffer
var min = Math.min(this.buffer.length - this.bufferOff, data.length - off);
for (var i = 0; i < min; i++)
this.buffer[this.bufferOff + i] = data[off + i];
this.bufferOff += min;
// Shift next
return min;
};
Cipher.prototype._flushBuffer = function _flushBuffer(out, off) {
this._update(this.buffer, 0, out, off);
this.bufferOff = 0;
return this.blockSize;
};
Cipher.prototype._updateEncrypt = function _updateEncrypt(data) {
var inputOff = 0;
var outputOff = 0;
var count = ((this.bufferOff + data.length) / this.blockSize) | 0;
var out = new Array(count * this.blockSize);
if (this.bufferOff !== 0) {
inputOff += this._buffer(data, inputOff);
if (this.bufferOff === this.buffer.length)
outputOff += this._flushBuffer(out, outputOff);
}
// Write blocks
var max = data.length - ((data.length - inputOff) % this.blockSize);
for (; inputOff < max; inputOff += this.blockSize) {
this._update(data, inputOff, out, outputOff);
outputOff += this.blockSize;
}
// Queue rest
for (; inputOff < data.length; inputOff++, this.bufferOff++)
this.buffer[this.bufferOff] = data[inputOff];
return out;
};
Cipher.prototype._updateDecrypt = function _updateDecrypt(data) {
var inputOff = 0;
var outputOff = 0;
var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1;
var out = new Array(count * this.blockSize);
// TODO(indutny): optimize it, this is far from optimal
for (; count > 0; count--) {
inputOff += this._buffer(data, inputOff);
outputOff += this._flushBuffer(out, outputOff);
}
// Buffer rest of the input
inputOff += this._buffer(data, inputOff);
return out;
};
Cipher.prototype.final = function final(buffer) {
var first;
if (buffer)
first = this.update(buffer);
var last;
if (this.type === 'encrypt')
last = this._finalEncrypt();
else
last = this._finalDecrypt();
if (first)
return first.concat(last);
else
return last;
};
Cipher.prototype._pad = function _pad(buffer, off) {
if (off === 0)
return false;
while (off < buffer.length)
buffer[off++] = 0;
return true;
};
Cipher.prototype._finalEncrypt = function _finalEncrypt() {
if (!this._pad(this.buffer, this.bufferOff))
return [];
var out = new Array(this.blockSize);
this._update(this.buffer, 0, out, 0);
return out;
};
Cipher.prototype._unpad = function _unpad(buffer) {
return buffer;
};
Cipher.prototype._finalDecrypt = function _finalDecrypt() {
assert.equal(this.bufferOff, this.blockSize, 'Not enough data to decrypt');
var out = new Array(this.blockSize);
this._flushBuffer(out, 0);
return this._unpad(out);
};
/***/ }),
/***/ 136:
/*!***************************************************!*\
!*** ./node_modules/minimalistic-assert/index.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = assert;
function assert(val, msg) {
if (!val)
throw new Error(msg || 'Assertion failed');
}
assert.equal = function assertEqual(l, r, msg) {
if (l != r)
throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));
};
/***/ }),
/***/ 137:
/*!********************************************!*\
!*** ./node_modules/des.js/lib/des/des.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var assert = __webpack_require__(/*! minimalistic-assert */ 136);
var inherits = __webpack_require__(/*! inherits */ 86);
var utils = __webpack_require__(/*! ./utils */ 134);
var Cipher = __webpack_require__(/*! ./cipher */ 135);
function DESState() {
this.tmp = new Array(2);
this.keys = null;
}
function DES(options) {
Cipher.call(this, options);
var state = new DESState();
this._desState = state;
this.deriveKeys(state, options.key);
}
inherits(DES, Cipher);
module.exports = DES;
DES.create = function create(options) {
return new DES(options);
};
var shiftTable = [
1, 1, 2, 2, 2, 2, 2, 2,
1, 2, 2, 2, 2, 2, 2, 1
];
DES.prototype.deriveKeys = function deriveKeys(state, key) {
state.keys = new Array(16 * 2);
assert.equal(key.length, this.blockSize, 'Invalid key length');
var kL = utils.readUInt32BE(key, 0);
var kR = utils.readUInt32BE(key, 4);
utils.pc1(kL, kR, state.tmp, 0);
kL = state.tmp[0];
kR = state.tmp[1];
for (var i = 0; i < state.keys.length; i += 2) {
var shift = shiftTable[i >>> 1];
kL = utils.r28shl(kL, shift);
kR = utils.r28shl(kR, shift);
utils.pc2(kL, kR, state.keys, i);
}
};
DES.prototype._update = function _update(inp, inOff, out, outOff) {
var state = this._desState;
var l = utils.readUInt32BE(inp, inOff);
var r = utils.readUInt32BE(inp, inOff + 4);
// Initial Permutation
utils.ip(l, r, state.tmp, 0);
l = state.tmp[0];
r = state.tmp[1];
if (this.type === 'encrypt')
this._encrypt(state, l, r, state.tmp, 0);
else
this._decrypt(state, l, r, state.tmp, 0);
l = state.tmp[0];
r = state.tmp[1];
utils.writeUInt32BE(out, l, outOff);
utils.writeUInt32BE(out, r, outOff + 4);
};
DES.prototype._pad = function _pad(buffer, off) {
var value = buffer.length - off;
for (var i = off; i < buffer.length; i++)
buffer[i] = value;
return true;
};
DES.prototype._unpad = function _unpad(buffer) {
var pad = buffer[buffer.length - 1];
for (var i = buffer.length - pad; i < buffer.length; i++)
assert.equal(buffer[i], pad);
return buffer.slice(0, buffer.length - pad);
};
DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) {
var l = lStart;
var r = rStart;
// Apply f() x16 times
for (var i = 0; i < state.keys.length; i += 2) {
var keyL = state.keys[i];
var keyR = state.keys[i + 1];
// f(r, k)
utils.expand(r, state.tmp, 0);
keyL ^= state.tmp[0];
keyR ^= state.tmp[1];
var s = utils.substitute(keyL, keyR);
var f = utils.permute(s);
var t = r;
r = (l ^ f) >>> 0;
l = t;
}
// Reverse Initial Permutation
utils.rip(r, l, out, off);
};
DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) {
var l = rStart;
var r = lStart;
// Apply f() x16 times
for (var i = state.keys.length - 2; i >= 0; i -= 2) {
var keyL = state.keys[i];
var keyR = state.keys[i + 1];
// f(r, k)
utils.expand(l, state.tmp, 0);
keyL ^= state.tmp[0];
keyR ^= state.tmp[1];
var s = utils.substitute(keyL, keyR);
var f = utils.permute(s);
var t = l;
l = (r ^ f) >>> 0;
r = t;
}
// Reverse Initial Permutation
utils.rip(l, r, out, off);
};
/***/ }),
/***/ 138:
/*!********************************************!*\
!*** ./node_modules/des.js/lib/des/cbc.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var assert = __webpack_require__(/*! minimalistic-assert */ 136);
var inherits = __webpack_require__(/*! inherits */ 86);
var proto = {};
function CBCState(iv) {
assert.equal(iv.length, 8, 'Invalid IV length');
this.iv = new Array(8);
for (var i = 0; i < this.iv.length; i++)
this.iv[i] = iv[i];
}
function instantiate(Base) {
function CBC(options) {
Base.call(this, options);
this._cbcInit();
}
inherits(CBC, Base);
var keys = Object.keys(proto);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
CBC.prototype[key] = proto[key];
}
CBC.create = function create(options) {
return new CBC(options);
};
return CBC;
}
exports.instantiate = instantiate;
proto._cbcInit = function _cbcInit() {
var state = new CBCState(this.options.iv);
this._cbcState = state;
};
proto._update = function _update(inp, inOff, out, outOff) {
var state = this._cbcState;
var superProto = this.constructor.super_.prototype;
var iv = state.iv;
if (this.type === 'encrypt') {
for (var i = 0; i < this.blockSize; i++)
iv[i] ^= inp[inOff + i];
superProto._update.call(this, iv, 0, out, outOff);
for (var i = 0; i < this.blockSize; i++)
iv[i] = out[outOff + i];
} else {
superProto._update.call(this, inp, inOff, out, outOff);
for (var i = 0; i < this.blockSize; i++)
out[outOff + i] ^= iv[i];
for (var i = 0; i < this.blockSize; i++)
iv[i] = inp[inOff + i];
}
};
/***/ }),
/***/ 139:
/*!********************************************!*\
!*** ./node_modules/des.js/lib/des/ede.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var assert = __webpack_require__(/*! minimalistic-assert */ 136);
var inherits = __webpack_require__(/*! inherits */ 86);
var Cipher = __webpack_require__(/*! ./cipher */ 135);
var DES = __webpack_require__(/*! ./des */ 137);
function EDEState(type, key) {
assert.equal(key.length, 24, 'Invalid key length');
var k1 = key.slice(0, 8);
var k2 = key.slice(8, 16);
var k3 = key.slice(16, 24);
if (type === 'encrypt') {
this.ciphers = [
DES.create({ type: 'encrypt', key: k1 }),
DES.create({ type: 'decrypt', key: k2 }),
DES.create({ type: 'encrypt', key: k3 })
];
} else {
this.ciphers = [
DES.create({ type: 'decrypt', key: k3 }),
DES.create({ type: 'encrypt', key: k2 }),
DES.create({ type: 'decrypt', key: k1 })
];
}
}
function EDE(options) {
Cipher.call(this, options);
var state = new EDEState(this.type, this.options.key);
this._edeState = state;
}
inherits(EDE, Cipher);
module.exports = EDE;
EDE.create = function create(options) {
return new EDE(options);
};
EDE.prototype._update = function _update(inp, inOff, out, outOff) {
var state = this._edeState;
state.ciphers[0]._update(inp, inOff, out, outOff);
state.ciphers[1]._update(out, outOff, out, outOff);
state.ciphers[2]._update(out, outOff, out, outOff);
};
EDE.prototype._pad = DES.prototype._pad;
EDE.prototype._unpad = DES.prototype._unpad;
/***/ }),
/***/ 14:
/*!************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
function toPrimitive(t, r) {
if ("object" != _typeof(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 140:
/*!************************************************!*\
!*** ./node_modules/browserify-aes/browser.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var ciphers = __webpack_require__(/*! ./encrypter */ 141)
var deciphers = __webpack_require__(/*! ./decrypter */ 158)
var modes = __webpack_require__(/*! ./modes/list.json */ 152)
function getCiphers () {
return Object.keys(modes)
}
exports.createCipher = exports.Cipher = ciphers.createCipher
exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv
exports.createDecipher = exports.Decipher = deciphers.createDecipher
exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv
exports.listCiphers = exports.getCiphers = getCiphers
/***/ }),
/***/ 141:
/*!**************************************************!*\
!*** ./node_modules/browserify-aes/encrypter.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var MODES = __webpack_require__(/*! ./modes */ 142)
var AuthCipher = __webpack_require__(/*! ./authCipher */ 153)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var StreamCipher = __webpack_require__(/*! ./streamCipher */ 156)
var Transform = __webpack_require__(/*! cipher-base */ 114)
var aes = __webpack_require__(/*! ./aes */ 154)
var ebtk = __webpack_require__(/*! evp_bytestokey */ 157)
var inherits = __webpack_require__(/*! inherits */ 86)
function Cipher (mode, key, iv) {
Transform.call(this)
this._cache = new Splitter()
this._cipher = new aes.AES(key)
this._prev = Buffer.from(iv)
this._mode = mode
this._autopadding = true
}
inherits(Cipher, Transform)
Cipher.prototype._update = function (data) {
this._cache.add(data)
var chunk
var thing
var out = []
while ((chunk = this._cache.get())) {
thing = this._mode.encrypt(this, chunk)
out.push(thing)
}
return Buffer.concat(out)
}
var PADDING = Buffer.alloc(16, 0x10)
Cipher.prototype._final = function () {
var chunk = this._cache.flush()
if (this._autopadding) {
chunk = this._mode.encrypt(this, chunk)
this._cipher.scrub()
return chunk
}
if (!chunk.equals(PADDING)) {
this._cipher.scrub()
throw new Error('data not multiple of block length')
}
}
Cipher.prototype.setAutoPadding = function (setTo) {
this._autopadding = !!setTo
return this
}
function Splitter () {
this.cache = Buffer.allocUnsafe(0)
}
Splitter.prototype.add = function (data) {
this.cache = Buffer.concat([this.cache, data])
}
Splitter.prototype.get = function () {
if (this.cache.length > 15) {
var out = this.cache.slice(0, 16)
this.cache = this.cache.slice(16)
return out
}
return null
}
Splitter.prototype.flush = function () {
var len = 16 - this.cache.length
var padBuff = Buffer.allocUnsafe(len)
var i = -1
while (++i < len) {
padBuff.writeUInt8(len, i)
}
return Buffer.concat([this.cache, padBuff])
}
function createCipheriv (suite, password, iv) {
var config = MODES[suite.toLowerCase()]
if (!config) throw new TypeError('invalid suite type')
if (typeof password === 'string') password = Buffer.from(password)
if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)
if (typeof iv === 'string') iv = Buffer.from(iv)
if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)
if (config.type === 'stream') {
return new StreamCipher(config.module, password, iv)
} else if (config.type === 'auth') {
return new AuthCipher(config.module, password, iv)
}
return new Cipher(config.module, password, iv)
}
function createCipher (suite, password) {
var config = MODES[suite.toLowerCase()]
if (!config) throw new TypeError('invalid suite type')
var keys = ebtk(password, false, config.key, config.iv)
return createCipheriv(suite, keys.key, keys.iv)
}
exports.createCipheriv = createCipheriv
exports.createCipher = createCipher
/***/ }),
/***/ 142:
/*!****************************************************!*\
!*** ./node_modules/browserify-aes/modes/index.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var modeModules = {
ECB: __webpack_require__(/*! ./ecb */ 143),
CBC: __webpack_require__(/*! ./cbc */ 144),
CFB: __webpack_require__(/*! ./cfb */ 146),
CFB8: __webpack_require__(/*! ./cfb8 */ 147),
CFB1: __webpack_require__(/*! ./cfb1 */ 148),
OFB: __webpack_require__(/*! ./ofb */ 149),
CTR: __webpack_require__(/*! ./ctr */ 150),
GCM: __webpack_require__(/*! ./ctr */ 150)
}
var modes = __webpack_require__(/*! ./list.json */ 152)
for (var key in modes) {
modes[key].module = modeModules[modes[key].mode]
}
module.exports = modes
/***/ }),
/***/ 143:
/*!**************************************************!*\
!*** ./node_modules/browserify-aes/modes/ecb.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
exports.encrypt = function (self, block) {
return self._cipher.encryptBlock(block)
}
exports.decrypt = function (self, block) {
return self._cipher.decryptBlock(block)
}
/***/ }),
/***/ 144:
/*!**************************************************!*\
!*** ./node_modules/browserify-aes/modes/cbc.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var xor = __webpack_require__(/*! buffer-xor */ 145)
exports.encrypt = function (self, block) {
var data = xor(block, self._prev)
self._prev = self._cipher.encryptBlock(data)
return self._prev
}
exports.decrypt = function (self, block) {
var pad = self._prev
self._prev = block
var out = self._cipher.decryptBlock(block)
return xor(out, pad)
}
/***/ }),
/***/ 145:
/*!******************************************!*\
!*** ./node_modules/buffer-xor/index.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(Buffer) {module.exports = function xor (a, b) {
var length = Math.min(a.length, b.length)
var buffer = new Buffer(length)
for (var i = 0; i < length; ++i) {
buffer[i] = a[i] ^ b[i]
}
return buffer
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 81).Buffer))
/***/ }),
/***/ 146:
/*!**************************************************!*\
!*** ./node_modules/browserify-aes/modes/cfb.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var xor = __webpack_require__(/*! buffer-xor */ 145)
function encryptStart (self, data, decrypt) {
var len = data.length
var out = xor(data, self._cache)
self._cache = self._cache.slice(len)
self._prev = Buffer.concat([self._prev, decrypt ? data : out])
return out
}
exports.encrypt = function (self, data, decrypt) {
var out = Buffer.allocUnsafe(0)
var len
while (data.length) {
if (self._cache.length === 0) {
self._cache = self._cipher.encryptBlock(self._prev)
self._prev = Buffer.allocUnsafe(0)
}
if (self._cache.length <= data.length) {
len = self._cache.length
out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)])
data = data.slice(len)
} else {
out = Buffer.concat([out, encryptStart(self, data, decrypt)])
break
}
}
return out
}
/***/ }),
/***/ 147:
/*!***************************************************!*\
!*** ./node_modules/browserify-aes/modes/cfb8.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
function encryptByte (self, byteParam, decrypt) {
var pad = self._cipher.encryptBlock(self._prev)
var out = pad[0] ^ byteParam
self._prev = Buffer.concat([
self._prev.slice(1),
Buffer.from([decrypt ? byteParam : out])
])
return out
}
exports.encrypt = function (self, chunk, decrypt) {
var len = chunk.length
var out = Buffer.allocUnsafe(len)
var i = -1
while (++i < len) {
out[i] = encryptByte(self, chunk[i], decrypt)
}
return out
}
/***/ }),
/***/ 148:
/*!***************************************************!*\
!*** ./node_modules/browserify-aes/modes/cfb1.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
function encryptByte (self, byteParam, decrypt) {
var pad
var i = -1
var len = 8
var out = 0
var bit, value
while (++i < len) {
pad = self._cipher.encryptBlock(self._prev)
bit = (byteParam & (1 << (7 - i))) ? 0x80 : 0
value = pad[0] ^ bit
out += ((value & 0x80) >> (i % 8))
self._prev = shiftIn(self._prev, decrypt ? bit : value)
}
return out
}
function shiftIn (buffer, value) {
var len = buffer.length
var i = -1
var out = Buffer.allocUnsafe(buffer.length)
buffer = Buffer.concat([buffer, Buffer.from([value])])
while (++i < len) {
out[i] = buffer[i] << 1 | buffer[i + 1] >> (7)
}
return out
}
exports.encrypt = function (self, chunk, decrypt) {
var len = chunk.length
var out = Buffer.allocUnsafe(len)
var i = -1
while (++i < len) {
out[i] = encryptByte(self, chunk[i], decrypt)
}
return out
}
/***/ }),
/***/ 149:
/*!**************************************************!*\
!*** ./node_modules/browserify-aes/modes/ofb.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(Buffer) {var xor = __webpack_require__(/*! buffer-xor */ 145)
function getBlock (self) {
self._prev = self._cipher.encryptBlock(self._prev)
return self._prev
}
exports.encrypt = function (self, chunk) {
while (self._cache.length < chunk.length) {
self._cache = Buffer.concat([self._cache, getBlock(self)])
}
var pad = self._cache.slice(0, chunk.length)
self._cache = self._cache.slice(chunk.length)
return xor(chunk, pad)
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ 81).Buffer))
/***/ }),
/***/ 15:
/*!**********************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/construct.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
function _construct(t, e, r) {
if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
var o = [null];
o.push.apply(o, e);
var p = new (t.bind.apply(t, o))();
return r && setPrototypeOf(p, r.prototype), p;
}
module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 150:
/*!**************************************************!*\
!*** ./node_modules/browserify-aes/modes/ctr.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var xor = __webpack_require__(/*! buffer-xor */ 145)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var incr32 = __webpack_require__(/*! ../incr32 */ 151)
function getBlock (self) {
var out = self._cipher.encryptBlockRaw(self._prev)
incr32(self._prev)
return out
}
var blockSize = 16
exports.encrypt = function (self, chunk) {
var chunkNum = Math.ceil(chunk.length / blockSize)
var start = self._cache.length
self._cache = Buffer.concat([
self._cache,
Buffer.allocUnsafe(chunkNum * blockSize)
])
for (var i = 0; i < chunkNum; i++) {
var out = getBlock(self)
var offset = start + i * blockSize
self._cache.writeUInt32BE(out[0], offset + 0)
self._cache.writeUInt32BE(out[1], offset + 4)
self._cache.writeUInt32BE(out[2], offset + 8)
self._cache.writeUInt32BE(out[3], offset + 12)
}
var pad = self._cache.slice(0, chunk.length)
self._cache = self._cache.slice(chunk.length)
return xor(chunk, pad)
}
/***/ }),
/***/ 151:
/*!***********************************************!*\
!*** ./node_modules/browserify-aes/incr32.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function incr32 (iv) {
var len = iv.length
var item
while (len--) {
item = iv.readUInt8(len)
if (item === 255) {
iv.writeUInt8(0, len)
} else {
item++
iv.writeUInt8(item, len)
break
}
}
}
module.exports = incr32
/***/ }),
/***/ 152:
/*!*****************************************************!*\
!*** ./node_modules/browserify-aes/modes/list.json ***!
\*****************************************************/
/*! exports provided: aes-128-ecb, aes-192-ecb, aes-256-ecb, aes-128-cbc, aes-192-cbc, aes-256-cbc, aes128, aes192, aes256, aes-128-cfb, aes-192-cfb, aes-256-cfb, aes-128-cfb8, aes-192-cfb8, aes-256-cfb8, aes-128-cfb1, aes-192-cfb1, aes-256-cfb1, aes-128-ofb, aes-192-ofb, aes-256-ofb, aes-128-ctr, aes-192-ctr, aes-256-ctr, aes-128-gcm, aes-192-gcm, aes-256-gcm, default */
/***/ (function(module) {
module.exports = JSON.parse("{\"aes-128-ecb\":{\"cipher\":\"AES\",\"key\":128,\"iv\":0,\"mode\":\"ECB\",\"type\":\"block\"},\"aes-192-ecb\":{\"cipher\":\"AES\",\"key\":192,\"iv\":0,\"mode\":\"ECB\",\"type\":\"block\"},\"aes-256-ecb\":{\"cipher\":\"AES\",\"key\":256,\"iv\":0,\"mode\":\"ECB\",\"type\":\"block\"},\"aes-128-cbc\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes-192-cbc\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes-256-cbc\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes128\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes192\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes256\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes-128-cfb\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CFB\",\"type\":\"stream\"},\"aes-192-cfb\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CFB\",\"type\":\"stream\"},\"aes-256-cfb\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CFB\",\"type\":\"stream\"},\"aes-128-cfb8\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CFB8\",\"type\":\"stream\"},\"aes-192-cfb8\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CFB8\",\"type\":\"stream\"},\"aes-256-cfb8\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CFB8\",\"type\":\"stream\"},\"aes-128-cfb1\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CFB1\",\"type\":\"stream\"},\"aes-192-cfb1\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CFB1\",\"type\":\"stream\"},\"aes-256-cfb1\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CFB1\",\"type\":\"stream\"},\"aes-128-ofb\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"OFB\",\"type\":\"stream\"},\"aes-192-ofb\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"OFB\",\"type\":\"stream\"},\"aes-256-ofb\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"OFB\",\"type\":\"stream\"},\"aes-128-ctr\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CTR\",\"type\":\"stream\"},\"aes-192-ctr\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CTR\",\"type\":\"stream\"},\"aes-256-ctr\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CTR\",\"type\":\"stream\"},\"aes-128-gcm\":{\"cipher\":\"AES\",\"key\":128,\"iv\":12,\"mode\":\"GCM\",\"type\":\"auth\"},\"aes-192-gcm\":{\"cipher\":\"AES\",\"key\":192,\"iv\":12,\"mode\":\"GCM\",\"type\":\"auth\"},\"aes-256-gcm\":{\"cipher\":\"AES\",\"key\":256,\"iv\":12,\"mode\":\"GCM\",\"type\":\"auth\"}}");
/***/ }),
/***/ 153:
/*!***************************************************!*\
!*** ./node_modules/browserify-aes/authCipher.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var aes = __webpack_require__(/*! ./aes */ 154)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var Transform = __webpack_require__(/*! cipher-base */ 114)
var inherits = __webpack_require__(/*! inherits */ 86)
var GHASH = __webpack_require__(/*! ./ghash */ 155)
var xor = __webpack_require__(/*! buffer-xor */ 145)
var incr32 = __webpack_require__(/*! ./incr32 */ 151)
function xorTest (a, b) {
var out = 0
if (a.length !== b.length) out++
var len = Math.min(a.length, b.length)
for (var i = 0; i < len; ++i) {
out += (a[i] ^ b[i])
}
return out
}
function calcIv (self, iv, ck) {
if (iv.length === 12) {
self._finID = Buffer.concat([iv, Buffer.from([0, 0, 0, 1])])
return Buffer.concat([iv, Buffer.from([0, 0, 0, 2])])
}
var ghash = new GHASH(ck)
var len = iv.length
var toPad = len % 16
ghash.update(iv)
if (toPad) {
toPad = 16 - toPad
ghash.update(Buffer.alloc(toPad, 0))
}
ghash.update(Buffer.alloc(8, 0))
var ivBits = len * 8
var tail = Buffer.alloc(8)
tail.writeUIntBE(ivBits, 0, 8)
ghash.update(tail)
self._finID = ghash.state
var out = Buffer.from(self._finID)
incr32(out)
return out
}
function StreamCipher (mode, key, iv, decrypt) {
Transform.call(this)
var h = Buffer.alloc(4, 0)
this._cipher = new aes.AES(key)
var ck = this._cipher.encryptBlock(h)
this._ghash = new GHASH(ck)
iv = calcIv(this, iv, ck)
this._prev = Buffer.from(iv)
this._cache = Buffer.allocUnsafe(0)
this._secCache = Buffer.allocUnsafe(0)
this._decrypt = decrypt
this._alen = 0
this._len = 0
this._mode = mode
this._authTag = null
this._called = false
}
inherits(StreamCipher, Transform)
StreamCipher.prototype._update = function (chunk) {
if (!this._called && this._alen) {
var rump = 16 - (this._alen % 16)
if (rump < 16) {
rump = Buffer.alloc(rump, 0)
this._ghash.update(rump)
}
}
this._called = true
var out = this._mode.encrypt(this, chunk)
if (this._decrypt) {
this._ghash.update(chunk)
} else {
this._ghash.update(out)
}
this._len += chunk.length
return out
}
StreamCipher.prototype._final = function () {
if (this._decrypt && !this._authTag) throw new Error('Unsupported state or unable to authenticate data')
var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID))
if (this._decrypt && xorTest(tag, this._authTag)) throw new Error('Unsupported state or unable to authenticate data')
this._authTag = tag
this._cipher.scrub()
}
StreamCipher.prototype.getAuthTag = function getAuthTag () {
if (this._decrypt || !Buffer.isBuffer(this._authTag)) throw new Error('Attempting to get auth tag in unsupported state')
return this._authTag
}
StreamCipher.prototype.setAuthTag = function setAuthTag (tag) {
if (!this._decrypt) throw new Error('Attempting to set auth tag in unsupported state')
this._authTag = tag
}
StreamCipher.prototype.setAAD = function setAAD (buf) {
if (this._called) throw new Error('Attempting to set AAD in unsupported state')
this._ghash.update(buf)
this._alen += buf.length
}
module.exports = StreamCipher
/***/ }),
/***/ 154:
/*!********************************************!*\
!*** ./node_modules/browserify-aes/aes.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// based on the aes implimentation in triple sec
// https://github.com/keybase/triplesec
// which is in turn based on the one from crypto-js
// https://code.google.com/p/crypto-js/
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
function asUInt32Array (buf) {
if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)
var len = (buf.length / 4) | 0
var out = new Array(len)
for (var i = 0; i < len; i++) {
out[i] = buf.readUInt32BE(i * 4)
}
return out
}
function scrubVec (v) {
for (var i = 0; i < v.length; v++) {
v[i] = 0
}
}
function cryptBlock (M, keySchedule, SUB_MIX, SBOX, nRounds) {
var SUB_MIX0 = SUB_MIX[0]
var SUB_MIX1 = SUB_MIX[1]
var SUB_MIX2 = SUB_MIX[2]
var SUB_MIX3 = SUB_MIX[3]
var s0 = M[0] ^ keySchedule[0]
var s1 = M[1] ^ keySchedule[1]
var s2 = M[2] ^ keySchedule[2]
var s3 = M[3] ^ keySchedule[3]
var t0, t1, t2, t3
var ksRow = 4
for (var round = 1; round < nRounds; round++) {
t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[(s1 >>> 16) & 0xff] ^ SUB_MIX2[(s2 >>> 8) & 0xff] ^ SUB_MIX3[s3 & 0xff] ^ keySchedule[ksRow++]
t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[(s2 >>> 16) & 0xff] ^ SUB_MIX2[(s3 >>> 8) & 0xff] ^ SUB_MIX3[s0 & 0xff] ^ keySchedule[ksRow++]
t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[(s3 >>> 16) & 0xff] ^ SUB_MIX2[(s0 >>> 8) & 0xff] ^ SUB_MIX3[s1 & 0xff] ^ keySchedule[ksRow++]
t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[(s0 >>> 16) & 0xff] ^ SUB_MIX2[(s1 >>> 8) & 0xff] ^ SUB_MIX3[s2 & 0xff] ^ keySchedule[ksRow++]
s0 = t0
s1 = t1
s2 = t2
s3 = t3
}
t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]
t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]
t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]
t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]
t0 = t0 >>> 0
t1 = t1 >>> 0
t2 = t2 >>> 0
t3 = t3 >>> 0
return [t0, t1, t2, t3]
}
// AES constants
var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]
var G = (function () {
// Compute double table
var d = new Array(256)
for (var j = 0; j < 256; j++) {
if (j < 128) {
d[j] = j << 1
} else {
d[j] = (j << 1) ^ 0x11b
}
}
var SBOX = []
var INV_SBOX = []
var SUB_MIX = [[], [], [], []]
var INV_SUB_MIX = [[], [], [], []]
// Walk GF(2^8)
var x = 0
var xi = 0
for (var i = 0; i < 256; ++i) {
// Compute sbox
var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4)
sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63
SBOX[x] = sx
INV_SBOX[sx] = x
// Compute multiplication
var x2 = d[x]
var x4 = d[x2]
var x8 = d[x4]
// Compute sub bytes, mix columns tables
var t = (d[sx] * 0x101) ^ (sx * 0x1010100)
SUB_MIX[0][x] = (t << 24) | (t >>> 8)
SUB_MIX[1][x] = (t << 16) | (t >>> 16)
SUB_MIX[2][x] = (t << 8) | (t >>> 24)
SUB_MIX[3][x] = t
// Compute inv sub bytes, inv mix columns tables
t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100)
INV_SUB_MIX[0][sx] = (t << 24) | (t >>> 8)
INV_SUB_MIX[1][sx] = (t << 16) | (t >>> 16)
INV_SUB_MIX[2][sx] = (t << 8) | (t >>> 24)
INV_SUB_MIX[3][sx] = t
if (x === 0) {
x = xi = 1
} else {
x = x2 ^ d[d[d[x8 ^ x2]]]
xi ^= d[d[xi]]
}
}
return {
SBOX: SBOX,
INV_SBOX: INV_SBOX,
SUB_MIX: SUB_MIX,
INV_SUB_MIX: INV_SUB_MIX
}
})()
function AES (key) {
this._key = asUInt32Array(key)
this._reset()
}
AES.blockSize = 4 * 4
AES.keySize = 256 / 8
AES.prototype.blockSize = AES.blockSize
AES.prototype.keySize = AES.keySize
AES.prototype._reset = function () {
var keyWords = this._key
var keySize = keyWords.length
var nRounds = keySize + 6
var ksRows = (nRounds + 1) * 4
var keySchedule = []
for (var k = 0; k < keySize; k++) {
keySchedule[k] = keyWords[k]
}
for (k = keySize; k < ksRows; k++) {
var t = keySchedule[k - 1]
if (k % keySize === 0) {
t = (t << 8) | (t >>> 24)
t =
(G.SBOX[t >>> 24] << 24) |
(G.SBOX[(t >>> 16) & 0xff] << 16) |
(G.SBOX[(t >>> 8) & 0xff] << 8) |
(G.SBOX[t & 0xff])
t ^= RCON[(k / keySize) | 0] << 24
} else if (keySize > 6 && k % keySize === 4) {
t =
(G.SBOX[t >>> 24] << 24) |
(G.SBOX[(t >>> 16) & 0xff] << 16) |
(G.SBOX[(t >>> 8) & 0xff] << 8) |
(G.SBOX[t & 0xff])
}
keySchedule[k] = keySchedule[k - keySize] ^ t
}
var invKeySchedule = []
for (var ik = 0; ik < ksRows; ik++) {
var ksR = ksRows - ik
var tt = keySchedule[ksR - (ik % 4 ? 0 : 4)]
if (ik < 4 || ksR <= 4) {
invKeySchedule[ik] = tt
} else {
invKeySchedule[ik] =
G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^
G.INV_SUB_MIX[1][G.SBOX[(tt >>> 16) & 0xff]] ^
G.INV_SUB_MIX[2][G.SBOX[(tt >>> 8) & 0xff]] ^
G.INV_SUB_MIX[3][G.SBOX[tt & 0xff]]
}
}
this._nRounds = nRounds
this._keySchedule = keySchedule
this._invKeySchedule = invKeySchedule
}
AES.prototype.encryptBlockRaw = function (M) {
M = asUInt32Array(M)
return cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds)
}
AES.prototype.encryptBlock = function (M) {
var out = this.encryptBlockRaw(M)
var buf = Buffer.allocUnsafe(16)
buf.writeUInt32BE(out[0], 0)
buf.writeUInt32BE(out[1], 4)
buf.writeUInt32BE(out[2], 8)
buf.writeUInt32BE(out[3], 12)
return buf
}
AES.prototype.decryptBlock = function (M) {
M = asUInt32Array(M)
// swap
var m1 = M[1]
M[1] = M[3]
M[3] = m1
var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds)
var buf = Buffer.allocUnsafe(16)
buf.writeUInt32BE(out[0], 0)
buf.writeUInt32BE(out[3], 4)
buf.writeUInt32BE(out[2], 8)
buf.writeUInt32BE(out[1], 12)
return buf
}
AES.prototype.scrub = function () {
scrubVec(this._keySchedule)
scrubVec(this._invKeySchedule)
scrubVec(this._key)
}
module.exports.AES = AES
/***/ }),
/***/ 155:
/*!**********************************************!*\
!*** ./node_modules/browserify-aes/ghash.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var ZEROES = Buffer.alloc(16, 0)
function toArray (buf) {
return [
buf.readUInt32BE(0),
buf.readUInt32BE(4),
buf.readUInt32BE(8),
buf.readUInt32BE(12)
]
}
function fromArray (out) {
var buf = Buffer.allocUnsafe(16)
buf.writeUInt32BE(out[0] >>> 0, 0)
buf.writeUInt32BE(out[1] >>> 0, 4)
buf.writeUInt32BE(out[2] >>> 0, 8)
buf.writeUInt32BE(out[3] >>> 0, 12)
return buf
}
function GHASH (key) {
this.h = key
this.state = Buffer.alloc(16, 0)
this.cache = Buffer.allocUnsafe(0)
}
// from http://bitwiseshiftleft.github.io/sjcl/doc/symbols/src/core_gcm.js.html
// by Juho Vähä-Herttua
GHASH.prototype.ghash = function (block) {
var i = -1
while (++i < block.length) {
this.state[i] ^= block[i]
}
this._multiply()
}
GHASH.prototype._multiply = function () {
var Vi = toArray(this.h)
var Zi = [0, 0, 0, 0]
var j, xi, lsbVi
var i = -1
while (++i < 128) {
xi = (this.state[~~(i / 8)] & (1 << (7 - (i % 8)))) !== 0
if (xi) {
// Z_i+1 = Z_i ^ V_i
Zi[0] ^= Vi[0]
Zi[1] ^= Vi[1]
Zi[2] ^= Vi[2]
Zi[3] ^= Vi[3]
}
// Store the value of LSB(V_i)
lsbVi = (Vi[3] & 1) !== 0
// V_i+1 = V_i >> 1
for (j = 3; j > 0; j--) {
Vi[j] = (Vi[j] >>> 1) | ((Vi[j - 1] & 1) << 31)
}
Vi[0] = Vi[0] >>> 1
// If LSB(V_i) is 1, V_i+1 = (V_i >> 1) ^ R
if (lsbVi) {
Vi[0] = Vi[0] ^ (0xe1 << 24)
}
}
this.state = fromArray(Zi)
}
GHASH.prototype.update = function (buf) {
this.cache = Buffer.concat([this.cache, buf])
var chunk
while (this.cache.length >= 16) {
chunk = this.cache.slice(0, 16)
this.cache = this.cache.slice(16)
this.ghash(chunk)
}
}
GHASH.prototype.final = function (abl, bl) {
if (this.cache.length) {
this.ghash(Buffer.concat([this.cache, ZEROES], 16))
}
this.ghash(fromArray([0, abl, 0, bl]))
return this.state
}
module.exports = GHASH
/***/ }),
/***/ 156:
/*!*****************************************************!*\
!*** ./node_modules/browserify-aes/streamCipher.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var aes = __webpack_require__(/*! ./aes */ 154)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var Transform = __webpack_require__(/*! cipher-base */ 114)
var inherits = __webpack_require__(/*! inherits */ 86)
function StreamCipher (mode, key, iv, decrypt) {
Transform.call(this)
this._cipher = new aes.AES(key)
this._prev = Buffer.from(iv)
this._cache = Buffer.allocUnsafe(0)
this._secCache = Buffer.allocUnsafe(0)
this._decrypt = decrypt
this._mode = mode
}
inherits(StreamCipher, Transform)
StreamCipher.prototype._update = function (chunk) {
return this._mode.encrypt(this, chunk, this._decrypt)
}
StreamCipher.prototype._final = function () {
this._cipher.scrub()
}
module.exports = StreamCipher
/***/ }),
/***/ 157:
/*!**********************************************!*\
!*** ./node_modules/evp_bytestokey/index.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var MD5 = __webpack_require__(/*! md5.js */ 87)
/* eslint-disable camelcase */
function EVP_BytesToKey (password, salt, keyBits, ivLen) {
if (!Buffer.isBuffer(password)) password = Buffer.from(password, 'binary')
if (salt) {
if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, 'binary')
if (salt.length !== 8) throw new RangeError('salt should be Buffer with 8 byte length')
}
var keyLen = keyBits / 8
var key = Buffer.alloc(keyLen)
var iv = Buffer.alloc(ivLen || 0)
var tmp = Buffer.alloc(0)
while (keyLen > 0 || ivLen > 0) {
var hash = new MD5()
hash.update(tmp)
hash.update(password)
if (salt) hash.update(salt)
tmp = hash.digest()
var used = 0
if (keyLen > 0) {
var keyStart = key.length - keyLen
used = Math.min(keyLen, tmp.length)
tmp.copy(key, keyStart, 0, used)
keyLen -= used
}
if (used < tmp.length && ivLen > 0) {
var ivStart = iv.length - ivLen
var length = Math.min(ivLen, tmp.length - used)
tmp.copy(iv, ivStart, used, used + length)
ivLen -= length
}
}
tmp.fill(0)
return { key: key, iv: iv }
}
module.exports = EVP_BytesToKey
/***/ }),
/***/ 158:
/*!**************************************************!*\
!*** ./node_modules/browserify-aes/decrypter.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var AuthCipher = __webpack_require__(/*! ./authCipher */ 153)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var MODES = __webpack_require__(/*! ./modes */ 142)
var StreamCipher = __webpack_require__(/*! ./streamCipher */ 156)
var Transform = __webpack_require__(/*! cipher-base */ 114)
var aes = __webpack_require__(/*! ./aes */ 154)
var ebtk = __webpack_require__(/*! evp_bytestokey */ 157)
var inherits = __webpack_require__(/*! inherits */ 86)
function Decipher (mode, key, iv) {
Transform.call(this)
this._cache = new Splitter()
this._last = void 0
this._cipher = new aes.AES(key)
this._prev = Buffer.from(iv)
this._mode = mode
this._autopadding = true
}
inherits(Decipher, Transform)
Decipher.prototype._update = function (data) {
this._cache.add(data)
var chunk
var thing
var out = []
while ((chunk = this._cache.get(this._autopadding))) {
thing = this._mode.decrypt(this, chunk)
out.push(thing)
}
return Buffer.concat(out)
}
Decipher.prototype._final = function () {
var chunk = this._cache.flush()
if (this._autopadding) {
return unpad(this._mode.decrypt(this, chunk))
} else if (chunk) {
throw new Error('data not multiple of block length')
}
}
Decipher.prototype.setAutoPadding = function (setTo) {
this._autopadding = !!setTo
return this
}
function Splitter () {
this.cache = Buffer.allocUnsafe(0)
}
Splitter.prototype.add = function (data) {
this.cache = Buffer.concat([this.cache, data])
}
Splitter.prototype.get = function (autoPadding) {
var out
if (autoPadding) {
if (this.cache.length > 16) {
out = this.cache.slice(0, 16)
this.cache = this.cache.slice(16)
return out
}
} else {
if (this.cache.length >= 16) {
out = this.cache.slice(0, 16)
this.cache = this.cache.slice(16)
return out
}
}
return null
}
Splitter.prototype.flush = function () {
if (this.cache.length) return this.cache
}
function unpad (last) {
var padded = last[15]
if (padded < 1 || padded > 16) {
throw new Error('unable to decrypt data')
}
var i = -1
while (++i < padded) {
if (last[(i + (16 - padded))] !== padded) {
throw new Error('unable to decrypt data')
}
}
if (padded === 16) return
return last.slice(0, 16 - padded)
}
function createDecipheriv (suite, password, iv) {
var config = MODES[suite.toLowerCase()]
if (!config) throw new TypeError('invalid suite type')
if (typeof iv === 'string') iv = Buffer.from(iv)
if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)
if (typeof password === 'string') password = Buffer.from(password)
if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)
if (config.type === 'stream') {
return new StreamCipher(config.module, password, iv, true)
} else if (config.type === 'auth') {
return new AuthCipher(config.module, password, iv, true)
}
return new Decipher(config.module, password, iv)
}
function createDecipher (suite, password) {
var config = MODES[suite.toLowerCase()]
if (!config) throw new TypeError('invalid suite type')
var keys = ebtk(password, false, config.key, config.iv)
return createDecipheriv(suite, keys.key, keys.iv)
}
exports.createDecipher = createDecipher
exports.createDecipheriv = createDecipheriv
/***/ }),
/***/ 159:
/*!**********************************************!*\
!*** ./node_modules/browserify-des/modes.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
exports['des-ecb'] = {
key: 8,
iv: 0
}
exports['des-cbc'] = exports.des = {
key: 8,
iv: 8
}
exports['des-ede3-cbc'] = exports.des3 = {
key: 24,
iv: 8
}
exports['des-ede3'] = {
key: 24,
iv: 0
}
exports['des-ede-cbc'] = {
key: 16,
iv: 8
}
exports['des-ede'] = {
key: 16,
iv: 0
}
/***/ }),
/***/ 16:
/*!***************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _setPrototypeOf(o, p) {
module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
return _setPrototypeOf(o, p);
}
module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 160:
/*!************************************************!*\
!*** ./node_modules/diffie-hellman/browser.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(Buffer) {var generatePrime = __webpack_require__(/*! ./lib/generatePrime */ 161)
var primes = __webpack_require__(/*! ./lib/primes.json */ 168)
var DH = __webpack_require__(/*! ./lib/dh */ 169)
function getDiffieHellman (mod) {
var prime = new Buffer(primes[mod].prime, 'hex')
var gen = new Buffer(primes[mod].gen, 'hex')
return new DH(prime, gen)
}
var ENCODINGS = {
'binary': true, 'hex': true, 'base64': true
}
function createDiffieHellman (prime, enc, generator, genc) {
if (Buffer.isBuffer(enc) || ENCODINGS[enc] === undefined) {
return createDiffieHellman(prime, 'binary', enc, generator)
}
enc = enc || 'binary'
genc = genc || 'binary'
generator = generator || new Buffer([2])
if (!Buffer.isBuffer(generator)) {
generator = new Buffer(generator, genc)
}
if (typeof prime === 'number') {
return new DH(generatePrime(prime, generator), generator, true)
}
if (!Buffer.isBuffer(prime)) {
prime = new Buffer(prime, enc)
}
return new DH(prime, generator, true)
}
exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman
exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 81).Buffer))
/***/ }),
/***/ 161:
/*!**********************************************************!*\
!*** ./node_modules/diffie-hellman/lib/generatePrime.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var randomBytes = __webpack_require__(/*! randombytes */ 77);
module.exports = findPrime;
findPrime.simpleSieve = simpleSieve;
findPrime.fermatTest = fermatTest;
var BN = __webpack_require__(/*! bn.js */ 162);
var TWENTYFOUR = new BN(24);
var MillerRabin = __webpack_require__(/*! miller-rabin */ 165);
var millerRabin = new MillerRabin();
var ONE = new BN(1);
var TWO = new BN(2);
var FIVE = new BN(5);
var SIXTEEN = new BN(16);
var EIGHT = new BN(8);
var TEN = new BN(10);
var THREE = new BN(3);
var SEVEN = new BN(7);
var ELEVEN = new BN(11);
var FOUR = new BN(4);
var TWELVE = new BN(12);
var primes = null;
function _getPrimes() {
if (primes !== null)
return primes;
var limit = 0x100000;
var res = [];
res[0] = 2;
for (var i = 1, k = 3; k < limit; k += 2) {
var sqrt = Math.ceil(Math.sqrt(k));
for (var j = 0; j < i && res[j] <= sqrt; j++)
if (k % res[j] === 0)
break;
if (i !== j && res[j] <= sqrt)
continue;
res[i++] = k;
}
primes = res;
return res;
}
function simpleSieve(p) {
var primes = _getPrimes();
for (var i = 0; i < primes.length; i++)
if (p.modn(primes[i]) === 0) {
if (p.cmpn(primes[i]) === 0) {
return true;
} else {
return false;
}
}
return true;
}
function fermatTest(p) {
var red = BN.mont(p);
return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;
}
function findPrime(bits, gen) {
if (bits < 16) {
// this is what openssl does
if (gen === 2 || gen === 5) {
return new BN([0x8c, 0x7b]);
} else {
return new BN([0x8c, 0x27]);
}
}
gen = new BN(gen);
var num, n2;
while (true) {
num = new BN(randomBytes(Math.ceil(bits / 8)));
while (num.bitLength() > bits) {
num.ishrn(1);
}
if (num.isEven()) {
num.iadd(ONE);
}
if (!num.testn(1)) {
num.iadd(TWO);
}
if (!gen.cmp(TWO)) {
while (num.mod(TWENTYFOUR).cmp(ELEVEN)) {
num.iadd(FOUR);
}
} else if (!gen.cmp(FIVE)) {
while (num.mod(TEN).cmp(THREE)) {
num.iadd(FOUR);
}
}
n2 = num.shrn(1);
if (simpleSieve(n2) && simpleSieve(num) &&
fermatTest(n2) && fermatTest(num) &&
millerRabin.test(n2) && millerRabin.test(num)) {
return num;
}
}
}
/***/ }),
/***/ 162:
/*!**************************************!*\
!*** ./node_modules/bn.js/lib/bn.js ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {
'use strict';
// Utils
function assert (val, msg) {
if (!val) throw new Error(msg || 'Assertion failed');
}
// Could use `inherits` module, but don't want to move from single file
// architecture yet.
function inherits (ctor, superCtor) {
ctor.super_ = superCtor;
var TempCtor = function () {};
TempCtor.prototype = superCtor.prototype;
ctor.prototype = new TempCtor();
ctor.prototype.constructor = ctor;
}
// BN
function BN (number, base, endian) {
if (BN.isBN(number)) {
return number;
}
this.negative = 0;
this.words = null;
this.length = 0;
// Reduction context
this.red = null;
if (number !== null) {
if (base === 'le' || base === 'be') {
endian = base;
base = 10;
}
this._init(number || 0, base || 10, endian || 'be');
}
}
if (typeof module === 'object') {
module.exports = BN;
} else {
exports.BN = BN;
}
BN.BN = BN;
BN.wordSize = 26;
var Buffer;
try {
if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {
Buffer = window.Buffer;
} else {
Buffer = __webpack_require__(/*! buffer */ 164).Buffer;
}
} catch (e) {
}
BN.isBN = function isBN (num) {
if (num instanceof BN) {
return true;
}
return num !== null && typeof num === 'object' &&
num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
};
BN.max = function max (left, right) {
if (left.cmp(right) > 0) return left;
return right;
};
BN.min = function min (left, right) {
if (left.cmp(right) < 0) return left;
return right;
};
BN.prototype._init = function init (number, base, endian) {
if (typeof number === 'number') {
return this._initNumber(number, base, endian);
}
if (typeof number === 'object') {
return this._initArray(number, base, endian);
}
if (base === 'hex') {
base = 16;
}
assert(base === (base | 0) && base >= 2 && base <= 36);
number = number.toString().replace(/\s+/g, '');
var start = 0;
if (number[0] === '-') {
start++;
this.negative = 1;
}
if (start < number.length) {
if (base === 16) {
this._parseHex(number, start, endian);
} else {
this._parseBase(number, base, start);
if (endian === 'le') {
this._initArray(this.toArray(), base, endian);
}
}
}
};
BN.prototype._initNumber = function _initNumber (number, base, endian) {
if (number < 0) {
this.negative = 1;
number = -number;
}
if (number < 0x4000000) {
this.words = [ number & 0x3ffffff ];
this.length = 1;
} else if (number < 0x10000000000000) {
this.words = [
number & 0x3ffffff,
(number / 0x4000000) & 0x3ffffff
];
this.length = 2;
} else {
assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)
this.words = [
number & 0x3ffffff,
(number / 0x4000000) & 0x3ffffff,
1
];
this.length = 3;
}
if (endian !== 'le') return;
// Reverse the bytes
this._initArray(this.toArray(), base, endian);
};
BN.prototype._initArray = function _initArray (number, base, endian) {
// Perhaps a Uint8Array
assert(typeof number.length === 'number');
if (number.length <= 0) {
this.words = [ 0 ];
this.length = 1;
return this;
}
this.length = Math.ceil(number.length / 3);
this.words = new Array(this.length);
for (var i = 0; i < this.length; i++) {
this.words[i] = 0;
}
var j, w;
var off = 0;
if (endian === 'be') {
for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);
this.words[j] |= (w << off) & 0x3ffffff;
this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;
off += 24;
if (off >= 26) {
off -= 26;
j++;
}
}
} else if (endian === 'le') {
for (i = 0, j = 0; i < number.length; i += 3) {
w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);
this.words[j] |= (w << off) & 0x3ffffff;
this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;
off += 24;
if (off >= 26) {
off -= 26;
j++;
}
}
}
return this.strip();
};
function parseHex4Bits (string, index) {
var c = string.charCodeAt(index);
// 'A' - 'F'
if (c >= 65 && c <= 70) {
return c - 55;
// 'a' - 'f'
} else if (c >= 97 && c <= 102) {
return c - 87;
// '0' - '9'
} else {
return (c - 48) & 0xf;
}
}
function parseHexByte (string, lowerBound, index) {
var r = parseHex4Bits(string, index);
if (index - 1 >= lowerBound) {
r |= parseHex4Bits(string, index - 1) << 4;
}
return r;
}
BN.prototype._parseHex = function _parseHex (number, start, endian) {
// Create possibly bigger array to ensure that it fits the number
this.length = Math.ceil((number.length - start) / 6);
this.words = new Array(this.length);
for (var i = 0; i < this.length; i++) {
this.words[i] = 0;
}
// 24-bits chunks
var off = 0;
var j = 0;
var w;
if (endian === 'be') {
for (i = number.length - 1; i >= start; i -= 2) {
w = parseHexByte(number, start, i) << off;
this.words[j] |= w & 0x3ffffff;
if (off >= 18) {
off -= 18;
j += 1;
this.words[j] |= w >>> 26;
} else {
off += 8;
}
}
} else {
var parseLength = number.length - start;
for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {
w = parseHexByte(number, start, i) << off;
this.words[j] |= w & 0x3ffffff;
if (off >= 18) {
off -= 18;
j += 1;
this.words[j] |= w >>> 26;
} else {
off += 8;
}
}
}
this.strip();
};
function parseBase (str, start, end, mul) {
var r = 0;
var len = Math.min(str.length, end);
for (var i = start; i < len; i++) {
var c = str.charCodeAt(i) - 48;
r *= mul;
// 'a'
if (c >= 49) {
r += c - 49 + 0xa;
// 'A'
} else if (c >= 17) {
r += c - 17 + 0xa;
// '0' - '9'
} else {
r += c;
}
}
return r;
}
BN.prototype._parseBase = function _parseBase (number, base, start) {
// Initialize as zero
this.words = [ 0 ];
this.length = 1;
// Find length of limb in base
for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {
limbLen++;
}
limbLen--;
limbPow = (limbPow / base) | 0;
var total = number.length - start;
var mod = total % limbLen;
var end = Math.min(total, total - mod) + start;
var word = 0;
for (var i = start; i < end; i += limbLen) {
word = parseBase(number, i, i + limbLen, base);
this.imuln(limbPow);
if (this.words[0] + word < 0x4000000) {
this.words[0] += word;
} else {
this._iaddn(word);
}
}
if (mod !== 0) {
var pow = 1;
word = parseBase(number, i, number.length, base);
for (i = 0; i < mod; i++) {
pow *= base;
}
this.imuln(pow);
if (this.words[0] + word < 0x4000000) {
this.words[0] += word;
} else {
this._iaddn(word);
}
}
this.strip();
};
BN.prototype.copy = function copy (dest) {
dest.words = new Array(this.length);
for (var i = 0; i < this.length; i++) {
dest.words[i] = this.words[i];
}
dest.length = this.length;
dest.negative = this.negative;
dest.red = this.red;
};
BN.prototype.clone = function clone () {
var r = new BN(null);
this.copy(r);
return r;
};
BN.prototype._expand = function _expand (size) {
while (this.length < size) {
this.words[this.length++] = 0;
}
return this;
};
// Remove leading `0` from `this`
BN.prototype.strip = function strip () {
while (this.length > 1 && this.words[this.length - 1] === 0) {
this.length--;
}
return this._normSign();
};
BN.prototype._normSign = function _normSign () {
// -0 = 0
if (this.length === 1 && this.words[0] === 0) {
this.negative = 0;
}
return this;
};
BN.prototype.inspect = function inspect () {
return (this.red ? '';
};
/*
var zeros = [];
var groupSizes = [];
var groupBases = [];
var s = '';
var i = -1;
while (++i < BN.wordSize) {
zeros[i] = s;
s += '0';
}
groupSizes[0] = 0;
groupSizes[1] = 0;
groupBases[0] = 0;
groupBases[1] = 0;
var base = 2 - 1;
while (++base < 36 + 1) {
var groupSize = 0;
var groupBase = 1;
while (groupBase < (1 << BN.wordSize) / base) {
groupBase *= base;
groupSize += 1;
}
groupSizes[base] = groupSize;
groupBases[base] = groupBase;
}
*/
var zeros = [
'',
'0',
'00',
'000',
'0000',
'00000',
'000000',
'0000000',
'00000000',
'000000000',
'0000000000',
'00000000000',
'000000000000',
'0000000000000',
'00000000000000',
'000000000000000',
'0000000000000000',
'00000000000000000',
'000000000000000000',
'0000000000000000000',
'00000000000000000000',
'000000000000000000000',
'0000000000000000000000',
'00000000000000000000000',
'000000000000000000000000',
'0000000000000000000000000'
];
var groupSizes = [
0, 0,
25, 16, 12, 11, 10, 9, 8,
8, 7, 7, 7, 7, 6, 6,
6, 6, 6, 6, 6, 5, 5,
5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5
];
var groupBases = [
0, 0,
33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,
43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,
16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,
6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,
24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176
];
BN.prototype.toString = function toString (base, padding) {
base = base || 10;
padding = padding | 0 || 1;
var out;
if (base === 16 || base === 'hex') {
out = '';
var off = 0;
var carry = 0;
for (var i = 0; i < this.length; i++) {
var w = this.words[i];
var word = (((w << off) | carry) & 0xffffff).toString(16);
carry = (w >>> (24 - off)) & 0xffffff;
if (carry !== 0 || i !== this.length - 1) {
out = zeros[6 - word.length] + word + out;
} else {
out = word + out;
}
off += 2;
if (off >= 26) {
off -= 26;
i--;
}
}
if (carry !== 0) {
out = carry.toString(16) + out;
}
while (out.length % padding !== 0) {
out = '0' + out;
}
if (this.negative !== 0) {
out = '-' + out;
}
return out;
}
if (base === (base | 0) && base >= 2 && base <= 36) {
// var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));
var groupSize = groupSizes[base];
// var groupBase = Math.pow(base, groupSize);
var groupBase = groupBases[base];
out = '';
var c = this.clone();
c.negative = 0;
while (!c.isZero()) {
var r = c.modn(groupBase).toString(base);
c = c.idivn(groupBase);
if (!c.isZero()) {
out = zeros[groupSize - r.length] + r + out;
} else {
out = r + out;
}
}
if (this.isZero()) {
out = '0' + out;
}
while (out.length % padding !== 0) {
out = '0' + out;
}
if (this.negative !== 0) {
out = '-' + out;
}
return out;
}
assert(false, 'Base should be between 2 and 36');
};
BN.prototype.toNumber = function toNumber () {
var ret = this.words[0];
if (this.length === 2) {
ret += this.words[1] * 0x4000000;
} else if (this.length === 3 && this.words[2] === 0x01) {
// NOTE: at this stage it is known that the top bit is set
ret += 0x10000000000000 + (this.words[1] * 0x4000000);
} else if (this.length > 2) {
assert(false, 'Number can only safely store up to 53 bits');
}
return (this.negative !== 0) ? -ret : ret;
};
BN.prototype.toJSON = function toJSON () {
return this.toString(16);
};
BN.prototype.toBuffer = function toBuffer (endian, length) {
assert(typeof Buffer !== 'undefined');
return this.toArrayLike(Buffer, endian, length);
};
BN.prototype.toArray = function toArray (endian, length) {
return this.toArrayLike(Array, endian, length);
};
BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {
var byteLength = this.byteLength();
var reqLength = length || Math.max(1, byteLength);
assert(byteLength <= reqLength, 'byte array longer than desired length');
assert(reqLength > 0, 'Requested array length <= 0');
this.strip();
var littleEndian = endian === 'le';
var res = new ArrayType(reqLength);
var b, i;
var q = this.clone();
if (!littleEndian) {
// Assume big-endian
for (i = 0; i < reqLength - byteLength; i++) {
res[i] = 0;
}
for (i = 0; !q.isZero(); i++) {
b = q.andln(0xff);
q.iushrn(8);
res[reqLength - i - 1] = b;
}
} else {
for (i = 0; !q.isZero(); i++) {
b = q.andln(0xff);
q.iushrn(8);
res[i] = b;
}
for (; i < reqLength; i++) {
res[i] = 0;
}
}
return res;
};
if (Math.clz32) {
BN.prototype._countBits = function _countBits (w) {
return 32 - Math.clz32(w);
};
} else {
BN.prototype._countBits = function _countBits (w) {
var t = w;
var r = 0;
if (t >= 0x1000) {
r += 13;
t >>>= 13;
}
if (t >= 0x40) {
r += 7;
t >>>= 7;
}
if (t >= 0x8) {
r += 4;
t >>>= 4;
}
if (t >= 0x02) {
r += 2;
t >>>= 2;
}
return r + t;
};
}
BN.prototype._zeroBits = function _zeroBits (w) {
// Short-cut
if (w === 0) return 26;
var t = w;
var r = 0;
if ((t & 0x1fff) === 0) {
r += 13;
t >>>= 13;
}
if ((t & 0x7f) === 0) {
r += 7;
t >>>= 7;
}
if ((t & 0xf) === 0) {
r += 4;
t >>>= 4;
}
if ((t & 0x3) === 0) {
r += 2;
t >>>= 2;
}
if ((t & 0x1) === 0) {
r++;
}
return r;
};
// Return number of used bits in a BN
BN.prototype.bitLength = function bitLength () {
var w = this.words[this.length - 1];
var hi = this._countBits(w);
return (this.length - 1) * 26 + hi;
};
function toBitArray (num) {
var w = new Array(num.bitLength());
for (var bit = 0; bit < w.length; bit++) {
var off = (bit / 26) | 0;
var wbit = bit % 26;
w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;
}
return w;
}
// Number of trailing zero bits
BN.prototype.zeroBits = function zeroBits () {
if (this.isZero()) return 0;
var r = 0;
for (var i = 0; i < this.length; i++) {
var b = this._zeroBits(this.words[i]);
r += b;
if (b !== 26) break;
}
return r;
};
BN.prototype.byteLength = function byteLength () {
return Math.ceil(this.bitLength() / 8);
};
BN.prototype.toTwos = function toTwos (width) {
if (this.negative !== 0) {
return this.abs().inotn(width).iaddn(1);
}
return this.clone();
};
BN.prototype.fromTwos = function fromTwos (width) {
if (this.testn(width - 1)) {
return this.notn(width).iaddn(1).ineg();
}
return this.clone();
};
BN.prototype.isNeg = function isNeg () {
return this.negative !== 0;
};
// Return negative clone of `this`
BN.prototype.neg = function neg () {
return this.clone().ineg();
};
BN.prototype.ineg = function ineg () {
if (!this.isZero()) {
this.negative ^= 1;
}
return this;
};
// Or `num` with `this` in-place
BN.prototype.iuor = function iuor (num) {
while (this.length < num.length) {
this.words[this.length++] = 0;
}
for (var i = 0; i < num.length; i++) {
this.words[i] = this.words[i] | num.words[i];
}
return this.strip();
};
BN.prototype.ior = function ior (num) {
assert((this.negative | num.negative) === 0);
return this.iuor(num);
};
// Or `num` with `this`
BN.prototype.or = function or (num) {
if (this.length > num.length) return this.clone().ior(num);
return num.clone().ior(this);
};
BN.prototype.uor = function uor (num) {
if (this.length > num.length) return this.clone().iuor(num);
return num.clone().iuor(this);
};
// And `num` with `this` in-place
BN.prototype.iuand = function iuand (num) {
// b = min-length(num, this)
var b;
if (this.length > num.length) {
b = num;
} else {
b = this;
}
for (var i = 0; i < b.length; i++) {
this.words[i] = this.words[i] & num.words[i];
}
this.length = b.length;
return this.strip();
};
BN.prototype.iand = function iand (num) {
assert((this.negative | num.negative) === 0);
return this.iuand(num);
};
// And `num` with `this`
BN.prototype.and = function and (num) {
if (this.length > num.length) return this.clone().iand(num);
return num.clone().iand(this);
};
BN.prototype.uand = function uand (num) {
if (this.length > num.length) return this.clone().iuand(num);
return num.clone().iuand(this);
};
// Xor `num` with `this` in-place
BN.prototype.iuxor = function iuxor (num) {
// a.length > b.length
var a;
var b;
if (this.length > num.length) {
a = this;
b = num;
} else {
a = num;
b = this;
}
for (var i = 0; i < b.length; i++) {
this.words[i] = a.words[i] ^ b.words[i];
}
if (this !== a) {
for (; i < a.length; i++) {
this.words[i] = a.words[i];
}
}
this.length = a.length;
return this.strip();
};
BN.prototype.ixor = function ixor (num) {
assert((this.negative | num.negative) === 0);
return this.iuxor(num);
};
// Xor `num` with `this`
BN.prototype.xor = function xor (num) {
if (this.length > num.length) return this.clone().ixor(num);
return num.clone().ixor(this);
};
BN.prototype.uxor = function uxor (num) {
if (this.length > num.length) return this.clone().iuxor(num);
return num.clone().iuxor(this);
};
// Not ``this`` with ``width`` bitwidth
BN.prototype.inotn = function inotn (width) {
assert(typeof width === 'number' && width >= 0);
var bytesNeeded = Math.ceil(width / 26) | 0;
var bitsLeft = width % 26;
// Extend the buffer with leading zeroes
this._expand(bytesNeeded);
if (bitsLeft > 0) {
bytesNeeded--;
}
// Handle complete words
for (var i = 0; i < bytesNeeded; i++) {
this.words[i] = ~this.words[i] & 0x3ffffff;
}
// Handle the residue
if (bitsLeft > 0) {
this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));
}
// And remove leading zeroes
return this.strip();
};
BN.prototype.notn = function notn (width) {
return this.clone().inotn(width);
};
// Set `bit` of `this`
BN.prototype.setn = function setn (bit, val) {
assert(typeof bit === 'number' && bit >= 0);
var off = (bit / 26) | 0;
var wbit = bit % 26;
this._expand(off + 1);
if (val) {
this.words[off] = this.words[off] | (1 << wbit);
} else {
this.words[off] = this.words[off] & ~(1 << wbit);
}
return this.strip();
};
// Add `num` to `this` in-place
BN.prototype.iadd = function iadd (num) {
var r;
// negative + positive
if (this.negative !== 0 && num.negative === 0) {
this.negative = 0;
r = this.isub(num);
this.negative ^= 1;
return this._normSign();
// positive + negative
} else if (this.negative === 0 && num.negative !== 0) {
num.negative = 0;
r = this.isub(num);
num.negative = 1;
return r._normSign();
}
// a.length > b.length
var a, b;
if (this.length > num.length) {
a = this;
b = num;
} else {
a = num;
b = this;
}
var carry = 0;
for (var i = 0; i < b.length; i++) {
r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
this.words[i] = r & 0x3ffffff;
carry = r >>> 26;
}
for (; carry !== 0 && i < a.length; i++) {
r = (a.words[i] | 0) + carry;
this.words[i] = r & 0x3ffffff;
carry = r >>> 26;
}
this.length = a.length;
if (carry !== 0) {
this.words[this.length] = carry;
this.length++;
// Copy the rest of the words
} else if (a !== this) {
for (; i < a.length; i++) {
this.words[i] = a.words[i];
}
}
return this;
};
// Add `num` to `this`
BN.prototype.add = function add (num) {
var res;
if (num.negative !== 0 && this.negative === 0) {
num.negative = 0;
res = this.sub(num);
num.negative ^= 1;
return res;
} else if (num.negative === 0 && this.negative !== 0) {
this.negative = 0;
res = num.sub(this);
this.negative = 1;
return res;
}
if (this.length > num.length) return this.clone().iadd(num);
return num.clone().iadd(this);
};
// Subtract `num` from `this` in-place
BN.prototype.isub = function isub (num) {
// this - (-num) = this + num
if (num.negative !== 0) {
num.negative = 0;
var r = this.iadd(num);
num.negative = 1;
return r._normSign();
// -this - num = -(this + num)
} else if (this.negative !== 0) {
this.negative = 0;
this.iadd(num);
this.negative = 1;
return this._normSign();
}
// At this point both numbers are positive
var cmp = this.cmp(num);
// Optimization - zeroify
if (cmp === 0) {
this.negative = 0;
this.length = 1;
this.words[0] = 0;
return this;
}
// a > b
var a, b;
if (cmp > 0) {
a = this;
b = num;
} else {
a = num;
b = this;
}
var carry = 0;
for (var i = 0; i < b.length; i++) {
r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
carry = r >> 26;
this.words[i] = r & 0x3ffffff;
}
for (; carry !== 0 && i < a.length; i++) {
r = (a.words[i] | 0) + carry;
carry = r >> 26;
this.words[i] = r & 0x3ffffff;
}
// Copy rest of the words
if (carry === 0 && i < a.length && a !== this) {
for (; i < a.length; i++) {
this.words[i] = a.words[i];
}
}
this.length = Math.max(this.length, i);
if (a !== this) {
this.negative = 1;
}
return this.strip();
};
// Subtract `num` from `this`
BN.prototype.sub = function sub (num) {
return this.clone().isub(num);
};
function smallMulTo (self, num, out) {
out.negative = num.negative ^ self.negative;
var len = (self.length + num.length) | 0;
out.length = len;
len = (len - 1) | 0;
// Peel one iteration (compiler can't do it, because of code complexity)
var a = self.words[0] | 0;
var b = num.words[0] | 0;
var r = a * b;
var lo = r & 0x3ffffff;
var carry = (r / 0x4000000) | 0;
out.words[0] = lo;
for (var k = 1; k < len; k++) {
// Sum all words with the same `i + j = k` and accumulate `ncarry`,
// note that ncarry could be >= 0x3ffffff
var ncarry = carry >>> 26;
var rword = carry & 0x3ffffff;
var maxJ = Math.min(k, num.length - 1);
for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
var i = (k - j) | 0;
a = self.words[i] | 0;
b = num.words[j] | 0;
r = a * b + rword;
ncarry += (r / 0x4000000) | 0;
rword = r & 0x3ffffff;
}
out.words[k] = rword | 0;
carry = ncarry | 0;
}
if (carry !== 0) {
out.words[k] = carry | 0;
} else {
out.length--;
}
return out.strip();
}
// TODO(indutny): it may be reasonable to omit it for users who don't need
// to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit
// multiplication (like elliptic secp256k1).
var comb10MulTo = function comb10MulTo (self, num, out) {
var a = self.words;
var b = num.words;
var o = out.words;
var c = 0;
var lo;
var mid;
var hi;
var a0 = a[0] | 0;
var al0 = a0 & 0x1fff;
var ah0 = a0 >>> 13;
var a1 = a[1] | 0;
var al1 = a1 & 0x1fff;
var ah1 = a1 >>> 13;
var a2 = a[2] | 0;
var al2 = a2 & 0x1fff;
var ah2 = a2 >>> 13;
var a3 = a[3] | 0;
var al3 = a3 & 0x1fff;
var ah3 = a3 >>> 13;
var a4 = a[4] | 0;
var al4 = a4 & 0x1fff;
var ah4 = a4 >>> 13;
var a5 = a[5] | 0;
var al5 = a5 & 0x1fff;
var ah5 = a5 >>> 13;
var a6 = a[6] | 0;
var al6 = a6 & 0x1fff;
var ah6 = a6 >>> 13;
var a7 = a[7] | 0;
var al7 = a7 & 0x1fff;
var ah7 = a7 >>> 13;
var a8 = a[8] | 0;
var al8 = a8 & 0x1fff;
var ah8 = a8 >>> 13;
var a9 = a[9] | 0;
var al9 = a9 & 0x1fff;
var ah9 = a9 >>> 13;
var b0 = b[0] | 0;
var bl0 = b0 & 0x1fff;
var bh0 = b0 >>> 13;
var b1 = b[1] | 0;
var bl1 = b1 & 0x1fff;
var bh1 = b1 >>> 13;
var b2 = b[2] | 0;
var bl2 = b2 & 0x1fff;
var bh2 = b2 >>> 13;
var b3 = b[3] | 0;
var bl3 = b3 & 0x1fff;
var bh3 = b3 >>> 13;
var b4 = b[4] | 0;
var bl4 = b4 & 0x1fff;
var bh4 = b4 >>> 13;
var b5 = b[5] | 0;
var bl5 = b5 & 0x1fff;
var bh5 = b5 >>> 13;
var b6 = b[6] | 0;
var bl6 = b6 & 0x1fff;
var bh6 = b6 >>> 13;
var b7 = b[7] | 0;
var bl7 = b7 & 0x1fff;
var bh7 = b7 >>> 13;
var b8 = b[8] | 0;
var bl8 = b8 & 0x1fff;
var bh8 = b8 >>> 13;
var b9 = b[9] | 0;
var bl9 = b9 & 0x1fff;
var bh9 = b9 >>> 13;
out.negative = self.negative ^ num.negative;
out.length = 19;
/* k = 0 */
lo = Math.imul(al0, bl0);
mid = Math.imul(al0, bh0);
mid = (mid + Math.imul(ah0, bl0)) | 0;
hi = Math.imul(ah0, bh0);
var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;
w0 &= 0x3ffffff;
/* k = 1 */
lo = Math.imul(al1, bl0);
mid = Math.imul(al1, bh0);
mid = (mid + Math.imul(ah1, bl0)) | 0;
hi = Math.imul(ah1, bh0);
lo = (lo + Math.imul(al0, bl1)) | 0;
mid = (mid + Math.imul(al0, bh1)) | 0;
mid = (mid + Math.imul(ah0, bl1)) | 0;
hi = (hi + Math.imul(ah0, bh1)) | 0;
var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;
w1 &= 0x3ffffff;
/* k = 2 */
lo = Math.imul(al2, bl0);
mid = Math.imul(al2, bh0);
mid = (mid + Math.imul(ah2, bl0)) | 0;
hi = Math.imul(ah2, bh0);
lo = (lo + Math.imul(al1, bl1)) | 0;
mid = (mid + Math.imul(al1, bh1)) | 0;
mid = (mid + Math.imul(ah1, bl1)) | 0;
hi = (hi + Math.imul(ah1, bh1)) | 0;
lo = (lo + Math.imul(al0, bl2)) | 0;
mid = (mid + Math.imul(al0, bh2)) | 0;
mid = (mid + Math.imul(ah0, bl2)) | 0;
hi = (hi + Math.imul(ah0, bh2)) | 0;
var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;
w2 &= 0x3ffffff;
/* k = 3 */
lo = Math.imul(al3, bl0);
mid = Math.imul(al3, bh0);
mid = (mid + Math.imul(ah3, bl0)) | 0;
hi = Math.imul(ah3, bh0);
lo = (lo + Math.imul(al2, bl1)) | 0;
mid = (mid + Math.imul(al2, bh1)) | 0;
mid = (mid + Math.imul(ah2, bl1)) | 0;
hi = (hi + Math.imul(ah2, bh1)) | 0;
lo = (lo + Math.imul(al1, bl2)) | 0;
mid = (mid + Math.imul(al1, bh2)) | 0;
mid = (mid + Math.imul(ah1, bl2)) | 0;
hi = (hi + Math.imul(ah1, bh2)) | 0;
lo = (lo + Math.imul(al0, bl3)) | 0;
mid = (mid + Math.imul(al0, bh3)) | 0;
mid = (mid + Math.imul(ah0, bl3)) | 0;
hi = (hi + Math.imul(ah0, bh3)) | 0;
var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;
w3 &= 0x3ffffff;
/* k = 4 */
lo = Math.imul(al4, bl0);
mid = Math.imul(al4, bh0);
mid = (mid + Math.imul(ah4, bl0)) | 0;
hi = Math.imul(ah4, bh0);
lo = (lo + Math.imul(al3, bl1)) | 0;
mid = (mid + Math.imul(al3, bh1)) | 0;
mid = (mid + Math.imul(ah3, bl1)) | 0;
hi = (hi + Math.imul(ah3, bh1)) | 0;
lo = (lo + Math.imul(al2, bl2)) | 0;
mid = (mid + Math.imul(al2, bh2)) | 0;
mid = (mid + Math.imul(ah2, bl2)) | 0;
hi = (hi + Math.imul(ah2, bh2)) | 0;
lo = (lo + Math.imul(al1, bl3)) | 0;
mid = (mid + Math.imul(al1, bh3)) | 0;
mid = (mid + Math.imul(ah1, bl3)) | 0;
hi = (hi + Math.imul(ah1, bh3)) | 0;
lo = (lo + Math.imul(al0, bl4)) | 0;
mid = (mid + Math.imul(al0, bh4)) | 0;
mid = (mid + Math.imul(ah0, bl4)) | 0;
hi = (hi + Math.imul(ah0, bh4)) | 0;
var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;
w4 &= 0x3ffffff;
/* k = 5 */
lo = Math.imul(al5, bl0);
mid = Math.imul(al5, bh0);
mid = (mid + Math.imul(ah5, bl0)) | 0;
hi = Math.imul(ah5, bh0);
lo = (lo + Math.imul(al4, bl1)) | 0;
mid = (mid + Math.imul(al4, bh1)) | 0;
mid = (mid + Math.imul(ah4, bl1)) | 0;
hi = (hi + Math.imul(ah4, bh1)) | 0;
lo = (lo + Math.imul(al3, bl2)) | 0;
mid = (mid + Math.imul(al3, bh2)) | 0;
mid = (mid + Math.imul(ah3, bl2)) | 0;
hi = (hi + Math.imul(ah3, bh2)) | 0;
lo = (lo + Math.imul(al2, bl3)) | 0;
mid = (mid + Math.imul(al2, bh3)) | 0;
mid = (mid + Math.imul(ah2, bl3)) | 0;
hi = (hi + Math.imul(ah2, bh3)) | 0;
lo = (lo + Math.imul(al1, bl4)) | 0;
mid = (mid + Math.imul(al1, bh4)) | 0;
mid = (mid + Math.imul(ah1, bl4)) | 0;
hi = (hi + Math.imul(ah1, bh4)) | 0;
lo = (lo + Math.imul(al0, bl5)) | 0;
mid = (mid + Math.imul(al0, bh5)) | 0;
mid = (mid + Math.imul(ah0, bl5)) | 0;
hi = (hi + Math.imul(ah0, bh5)) | 0;
var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;
w5 &= 0x3ffffff;
/* k = 6 */
lo = Math.imul(al6, bl0);
mid = Math.imul(al6, bh0);
mid = (mid + Math.imul(ah6, bl0)) | 0;
hi = Math.imul(ah6, bh0);
lo = (lo + Math.imul(al5, bl1)) | 0;
mid = (mid + Math.imul(al5, bh1)) | 0;
mid = (mid + Math.imul(ah5, bl1)) | 0;
hi = (hi + Math.imul(ah5, bh1)) | 0;
lo = (lo + Math.imul(al4, bl2)) | 0;
mid = (mid + Math.imul(al4, bh2)) | 0;
mid = (mid + Math.imul(ah4, bl2)) | 0;
hi = (hi + Math.imul(ah4, bh2)) | 0;
lo = (lo + Math.imul(al3, bl3)) | 0;
mid = (mid + Math.imul(al3, bh3)) | 0;
mid = (mid + Math.imul(ah3, bl3)) | 0;
hi = (hi + Math.imul(ah3, bh3)) | 0;
lo = (lo + Math.imul(al2, bl4)) | 0;
mid = (mid + Math.imul(al2, bh4)) | 0;
mid = (mid + Math.imul(ah2, bl4)) | 0;
hi = (hi + Math.imul(ah2, bh4)) | 0;
lo = (lo + Math.imul(al1, bl5)) | 0;
mid = (mid + Math.imul(al1, bh5)) | 0;
mid = (mid + Math.imul(ah1, bl5)) | 0;
hi = (hi + Math.imul(ah1, bh5)) | 0;
lo = (lo + Math.imul(al0, bl6)) | 0;
mid = (mid + Math.imul(al0, bh6)) | 0;
mid = (mid + Math.imul(ah0, bl6)) | 0;
hi = (hi + Math.imul(ah0, bh6)) | 0;
var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;
w6 &= 0x3ffffff;
/* k = 7 */
lo = Math.imul(al7, bl0);
mid = Math.imul(al7, bh0);
mid = (mid + Math.imul(ah7, bl0)) | 0;
hi = Math.imul(ah7, bh0);
lo = (lo + Math.imul(al6, bl1)) | 0;
mid = (mid + Math.imul(al6, bh1)) | 0;
mid = (mid + Math.imul(ah6, bl1)) | 0;
hi = (hi + Math.imul(ah6, bh1)) | 0;
lo = (lo + Math.imul(al5, bl2)) | 0;
mid = (mid + Math.imul(al5, bh2)) | 0;
mid = (mid + Math.imul(ah5, bl2)) | 0;
hi = (hi + Math.imul(ah5, bh2)) | 0;
lo = (lo + Math.imul(al4, bl3)) | 0;
mid = (mid + Math.imul(al4, bh3)) | 0;
mid = (mid + Math.imul(ah4, bl3)) | 0;
hi = (hi + Math.imul(ah4, bh3)) | 0;
lo = (lo + Math.imul(al3, bl4)) | 0;
mid = (mid + Math.imul(al3, bh4)) | 0;
mid = (mid + Math.imul(ah3, bl4)) | 0;
hi = (hi + Math.imul(ah3, bh4)) | 0;
lo = (lo + Math.imul(al2, bl5)) | 0;
mid = (mid + Math.imul(al2, bh5)) | 0;
mid = (mid + Math.imul(ah2, bl5)) | 0;
hi = (hi + Math.imul(ah2, bh5)) | 0;
lo = (lo + Math.imul(al1, bl6)) | 0;
mid = (mid + Math.imul(al1, bh6)) | 0;
mid = (mid + Math.imul(ah1, bl6)) | 0;
hi = (hi + Math.imul(ah1, bh6)) | 0;
lo = (lo + Math.imul(al0, bl7)) | 0;
mid = (mid + Math.imul(al0, bh7)) | 0;
mid = (mid + Math.imul(ah0, bl7)) | 0;
hi = (hi + Math.imul(ah0, bh7)) | 0;
var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;
w7 &= 0x3ffffff;
/* k = 8 */
lo = Math.imul(al8, bl0);
mid = Math.imul(al8, bh0);
mid = (mid + Math.imul(ah8, bl0)) | 0;
hi = Math.imul(ah8, bh0);
lo = (lo + Math.imul(al7, bl1)) | 0;
mid = (mid + Math.imul(al7, bh1)) | 0;
mid = (mid + Math.imul(ah7, bl1)) | 0;
hi = (hi + Math.imul(ah7, bh1)) | 0;
lo = (lo + Math.imul(al6, bl2)) | 0;
mid = (mid + Math.imul(al6, bh2)) | 0;
mid = (mid + Math.imul(ah6, bl2)) | 0;
hi = (hi + Math.imul(ah6, bh2)) | 0;
lo = (lo + Math.imul(al5, bl3)) | 0;
mid = (mid + Math.imul(al5, bh3)) | 0;
mid = (mid + Math.imul(ah5, bl3)) | 0;
hi = (hi + Math.imul(ah5, bh3)) | 0;
lo = (lo + Math.imul(al4, bl4)) | 0;
mid = (mid + Math.imul(al4, bh4)) | 0;
mid = (mid + Math.imul(ah4, bl4)) | 0;
hi = (hi + Math.imul(ah4, bh4)) | 0;
lo = (lo + Math.imul(al3, bl5)) | 0;
mid = (mid + Math.imul(al3, bh5)) | 0;
mid = (mid + Math.imul(ah3, bl5)) | 0;
hi = (hi + Math.imul(ah3, bh5)) | 0;
lo = (lo + Math.imul(al2, bl6)) | 0;
mid = (mid + Math.imul(al2, bh6)) | 0;
mid = (mid + Math.imul(ah2, bl6)) | 0;
hi = (hi + Math.imul(ah2, bh6)) | 0;
lo = (lo + Math.imul(al1, bl7)) | 0;
mid = (mid + Math.imul(al1, bh7)) | 0;
mid = (mid + Math.imul(ah1, bl7)) | 0;
hi = (hi + Math.imul(ah1, bh7)) | 0;
lo = (lo + Math.imul(al0, bl8)) | 0;
mid = (mid + Math.imul(al0, bh8)) | 0;
mid = (mid + Math.imul(ah0, bl8)) | 0;
hi = (hi + Math.imul(ah0, bh8)) | 0;
var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;
w8 &= 0x3ffffff;
/* k = 9 */
lo = Math.imul(al9, bl0);
mid = Math.imul(al9, bh0);
mid = (mid + Math.imul(ah9, bl0)) | 0;
hi = Math.imul(ah9, bh0);
lo = (lo + Math.imul(al8, bl1)) | 0;
mid = (mid + Math.imul(al8, bh1)) | 0;
mid = (mid + Math.imul(ah8, bl1)) | 0;
hi = (hi + Math.imul(ah8, bh1)) | 0;
lo = (lo + Math.imul(al7, bl2)) | 0;
mid = (mid + Math.imul(al7, bh2)) | 0;
mid = (mid + Math.imul(ah7, bl2)) | 0;
hi = (hi + Math.imul(ah7, bh2)) | 0;
lo = (lo + Math.imul(al6, bl3)) | 0;
mid = (mid + Math.imul(al6, bh3)) | 0;
mid = (mid + Math.imul(ah6, bl3)) | 0;
hi = (hi + Math.imul(ah6, bh3)) | 0;
lo = (lo + Math.imul(al5, bl4)) | 0;
mid = (mid + Math.imul(al5, bh4)) | 0;
mid = (mid + Math.imul(ah5, bl4)) | 0;
hi = (hi + Math.imul(ah5, bh4)) | 0;
lo = (lo + Math.imul(al4, bl5)) | 0;
mid = (mid + Math.imul(al4, bh5)) | 0;
mid = (mid + Math.imul(ah4, bl5)) | 0;
hi = (hi + Math.imul(ah4, bh5)) | 0;
lo = (lo + Math.imul(al3, bl6)) | 0;
mid = (mid + Math.imul(al3, bh6)) | 0;
mid = (mid + Math.imul(ah3, bl6)) | 0;
hi = (hi + Math.imul(ah3, bh6)) | 0;
lo = (lo + Math.imul(al2, bl7)) | 0;
mid = (mid + Math.imul(al2, bh7)) | 0;
mid = (mid + Math.imul(ah2, bl7)) | 0;
hi = (hi + Math.imul(ah2, bh7)) | 0;
lo = (lo + Math.imul(al1, bl8)) | 0;
mid = (mid + Math.imul(al1, bh8)) | 0;
mid = (mid + Math.imul(ah1, bl8)) | 0;
hi = (hi + Math.imul(ah1, bh8)) | 0;
lo = (lo + Math.imul(al0, bl9)) | 0;
mid = (mid + Math.imul(al0, bh9)) | 0;
mid = (mid + Math.imul(ah0, bl9)) | 0;
hi = (hi + Math.imul(ah0, bh9)) | 0;
var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;
w9 &= 0x3ffffff;
/* k = 10 */
lo = Math.imul(al9, bl1);
mid = Math.imul(al9, bh1);
mid = (mid + Math.imul(ah9, bl1)) | 0;
hi = Math.imul(ah9, bh1);
lo = (lo + Math.imul(al8, bl2)) | 0;
mid = (mid + Math.imul(al8, bh2)) | 0;
mid = (mid + Math.imul(ah8, bl2)) | 0;
hi = (hi + Math.imul(ah8, bh2)) | 0;
lo = (lo + Math.imul(al7, bl3)) | 0;
mid = (mid + Math.imul(al7, bh3)) | 0;
mid = (mid + Math.imul(ah7, bl3)) | 0;
hi = (hi + Math.imul(ah7, bh3)) | 0;
lo = (lo + Math.imul(al6, bl4)) | 0;
mid = (mid + Math.imul(al6, bh4)) | 0;
mid = (mid + Math.imul(ah6, bl4)) | 0;
hi = (hi + Math.imul(ah6, bh4)) | 0;
lo = (lo + Math.imul(al5, bl5)) | 0;
mid = (mid + Math.imul(al5, bh5)) | 0;
mid = (mid + Math.imul(ah5, bl5)) | 0;
hi = (hi + Math.imul(ah5, bh5)) | 0;
lo = (lo + Math.imul(al4, bl6)) | 0;
mid = (mid + Math.imul(al4, bh6)) | 0;
mid = (mid + Math.imul(ah4, bl6)) | 0;
hi = (hi + Math.imul(ah4, bh6)) | 0;
lo = (lo + Math.imul(al3, bl7)) | 0;
mid = (mid + Math.imul(al3, bh7)) | 0;
mid = (mid + Math.imul(ah3, bl7)) | 0;
hi = (hi + Math.imul(ah3, bh7)) | 0;
lo = (lo + Math.imul(al2, bl8)) | 0;
mid = (mid + Math.imul(al2, bh8)) | 0;
mid = (mid + Math.imul(ah2, bl8)) | 0;
hi = (hi + Math.imul(ah2, bh8)) | 0;
lo = (lo + Math.imul(al1, bl9)) | 0;
mid = (mid + Math.imul(al1, bh9)) | 0;
mid = (mid + Math.imul(ah1, bl9)) | 0;
hi = (hi + Math.imul(ah1, bh9)) | 0;
var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;
w10 &= 0x3ffffff;
/* k = 11 */
lo = Math.imul(al9, bl2);
mid = Math.imul(al9, bh2);
mid = (mid + Math.imul(ah9, bl2)) | 0;
hi = Math.imul(ah9, bh2);
lo = (lo + Math.imul(al8, bl3)) | 0;
mid = (mid + Math.imul(al8, bh3)) | 0;
mid = (mid + Math.imul(ah8, bl3)) | 0;
hi = (hi + Math.imul(ah8, bh3)) | 0;
lo = (lo + Math.imul(al7, bl4)) | 0;
mid = (mid + Math.imul(al7, bh4)) | 0;
mid = (mid + Math.imul(ah7, bl4)) | 0;
hi = (hi + Math.imul(ah7, bh4)) | 0;
lo = (lo + Math.imul(al6, bl5)) | 0;
mid = (mid + Math.imul(al6, bh5)) | 0;
mid = (mid + Math.imul(ah6, bl5)) | 0;
hi = (hi + Math.imul(ah6, bh5)) | 0;
lo = (lo + Math.imul(al5, bl6)) | 0;
mid = (mid + Math.imul(al5, bh6)) | 0;
mid = (mid + Math.imul(ah5, bl6)) | 0;
hi = (hi + Math.imul(ah5, bh6)) | 0;
lo = (lo + Math.imul(al4, bl7)) | 0;
mid = (mid + Math.imul(al4, bh7)) | 0;
mid = (mid + Math.imul(ah4, bl7)) | 0;
hi = (hi + Math.imul(ah4, bh7)) | 0;
lo = (lo + Math.imul(al3, bl8)) | 0;
mid = (mid + Math.imul(al3, bh8)) | 0;
mid = (mid + Math.imul(ah3, bl8)) | 0;
hi = (hi + Math.imul(ah3, bh8)) | 0;
lo = (lo + Math.imul(al2, bl9)) | 0;
mid = (mid + Math.imul(al2, bh9)) | 0;
mid = (mid + Math.imul(ah2, bl9)) | 0;
hi = (hi + Math.imul(ah2, bh9)) | 0;
var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;
w11 &= 0x3ffffff;
/* k = 12 */
lo = Math.imul(al9, bl3);
mid = Math.imul(al9, bh3);
mid = (mid + Math.imul(ah9, bl3)) | 0;
hi = Math.imul(ah9, bh3);
lo = (lo + Math.imul(al8, bl4)) | 0;
mid = (mid + Math.imul(al8, bh4)) | 0;
mid = (mid + Math.imul(ah8, bl4)) | 0;
hi = (hi + Math.imul(ah8, bh4)) | 0;
lo = (lo + Math.imul(al7, bl5)) | 0;
mid = (mid + Math.imul(al7, bh5)) | 0;
mid = (mid + Math.imul(ah7, bl5)) | 0;
hi = (hi + Math.imul(ah7, bh5)) | 0;
lo = (lo + Math.imul(al6, bl6)) | 0;
mid = (mid + Math.imul(al6, bh6)) | 0;
mid = (mid + Math.imul(ah6, bl6)) | 0;
hi = (hi + Math.imul(ah6, bh6)) | 0;
lo = (lo + Math.imul(al5, bl7)) | 0;
mid = (mid + Math.imul(al5, bh7)) | 0;
mid = (mid + Math.imul(ah5, bl7)) | 0;
hi = (hi + Math.imul(ah5, bh7)) | 0;
lo = (lo + Math.imul(al4, bl8)) | 0;
mid = (mid + Math.imul(al4, bh8)) | 0;
mid = (mid + Math.imul(ah4, bl8)) | 0;
hi = (hi + Math.imul(ah4, bh8)) | 0;
lo = (lo + Math.imul(al3, bl9)) | 0;
mid = (mid + Math.imul(al3, bh9)) | 0;
mid = (mid + Math.imul(ah3, bl9)) | 0;
hi = (hi + Math.imul(ah3, bh9)) | 0;
var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;
w12 &= 0x3ffffff;
/* k = 13 */
lo = Math.imul(al9, bl4);
mid = Math.imul(al9, bh4);
mid = (mid + Math.imul(ah9, bl4)) | 0;
hi = Math.imul(ah9, bh4);
lo = (lo + Math.imul(al8, bl5)) | 0;
mid = (mid + Math.imul(al8, bh5)) | 0;
mid = (mid + Math.imul(ah8, bl5)) | 0;
hi = (hi + Math.imul(ah8, bh5)) | 0;
lo = (lo + Math.imul(al7, bl6)) | 0;
mid = (mid + Math.imul(al7, bh6)) | 0;
mid = (mid + Math.imul(ah7, bl6)) | 0;
hi = (hi + Math.imul(ah7, bh6)) | 0;
lo = (lo + Math.imul(al6, bl7)) | 0;
mid = (mid + Math.imul(al6, bh7)) | 0;
mid = (mid + Math.imul(ah6, bl7)) | 0;
hi = (hi + Math.imul(ah6, bh7)) | 0;
lo = (lo + Math.imul(al5, bl8)) | 0;
mid = (mid + Math.imul(al5, bh8)) | 0;
mid = (mid + Math.imul(ah5, bl8)) | 0;
hi = (hi + Math.imul(ah5, bh8)) | 0;
lo = (lo + Math.imul(al4, bl9)) | 0;
mid = (mid + Math.imul(al4, bh9)) | 0;
mid = (mid + Math.imul(ah4, bl9)) | 0;
hi = (hi + Math.imul(ah4, bh9)) | 0;
var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;
w13 &= 0x3ffffff;
/* k = 14 */
lo = Math.imul(al9, bl5);
mid = Math.imul(al9, bh5);
mid = (mid + Math.imul(ah9, bl5)) | 0;
hi = Math.imul(ah9, bh5);
lo = (lo + Math.imul(al8, bl6)) | 0;
mid = (mid + Math.imul(al8, bh6)) | 0;
mid = (mid + Math.imul(ah8, bl6)) | 0;
hi = (hi + Math.imul(ah8, bh6)) | 0;
lo = (lo + Math.imul(al7, bl7)) | 0;
mid = (mid + Math.imul(al7, bh7)) | 0;
mid = (mid + Math.imul(ah7, bl7)) | 0;
hi = (hi + Math.imul(ah7, bh7)) | 0;
lo = (lo + Math.imul(al6, bl8)) | 0;
mid = (mid + Math.imul(al6, bh8)) | 0;
mid = (mid + Math.imul(ah6, bl8)) | 0;
hi = (hi + Math.imul(ah6, bh8)) | 0;
lo = (lo + Math.imul(al5, bl9)) | 0;
mid = (mid + Math.imul(al5, bh9)) | 0;
mid = (mid + Math.imul(ah5, bl9)) | 0;
hi = (hi + Math.imul(ah5, bh9)) | 0;
var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;
w14 &= 0x3ffffff;
/* k = 15 */
lo = Math.imul(al9, bl6);
mid = Math.imul(al9, bh6);
mid = (mid + Math.imul(ah9, bl6)) | 0;
hi = Math.imul(ah9, bh6);
lo = (lo + Math.imul(al8, bl7)) | 0;
mid = (mid + Math.imul(al8, bh7)) | 0;
mid = (mid + Math.imul(ah8, bl7)) | 0;
hi = (hi + Math.imul(ah8, bh7)) | 0;
lo = (lo + Math.imul(al7, bl8)) | 0;
mid = (mid + Math.imul(al7, bh8)) | 0;
mid = (mid + Math.imul(ah7, bl8)) | 0;
hi = (hi + Math.imul(ah7, bh8)) | 0;
lo = (lo + Math.imul(al6, bl9)) | 0;
mid = (mid + Math.imul(al6, bh9)) | 0;
mid = (mid + Math.imul(ah6, bl9)) | 0;
hi = (hi + Math.imul(ah6, bh9)) | 0;
var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;
w15 &= 0x3ffffff;
/* k = 16 */
lo = Math.imul(al9, bl7);
mid = Math.imul(al9, bh7);
mid = (mid + Math.imul(ah9, bl7)) | 0;
hi = Math.imul(ah9, bh7);
lo = (lo + Math.imul(al8, bl8)) | 0;
mid = (mid + Math.imul(al8, bh8)) | 0;
mid = (mid + Math.imul(ah8, bl8)) | 0;
hi = (hi + Math.imul(ah8, bh8)) | 0;
lo = (lo + Math.imul(al7, bl9)) | 0;
mid = (mid + Math.imul(al7, bh9)) | 0;
mid = (mid + Math.imul(ah7, bl9)) | 0;
hi = (hi + Math.imul(ah7, bh9)) | 0;
var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;
w16 &= 0x3ffffff;
/* k = 17 */
lo = Math.imul(al9, bl8);
mid = Math.imul(al9, bh8);
mid = (mid + Math.imul(ah9, bl8)) | 0;
hi = Math.imul(ah9, bh8);
lo = (lo + Math.imul(al8, bl9)) | 0;
mid = (mid + Math.imul(al8, bh9)) | 0;
mid = (mid + Math.imul(ah8, bl9)) | 0;
hi = (hi + Math.imul(ah8, bh9)) | 0;
var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;
w17 &= 0x3ffffff;
/* k = 18 */
lo = Math.imul(al9, bl9);
mid = Math.imul(al9, bh9);
mid = (mid + Math.imul(ah9, bl9)) | 0;
hi = Math.imul(ah9, bh9);
var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;
w18 &= 0x3ffffff;
o[0] = w0;
o[1] = w1;
o[2] = w2;
o[3] = w3;
o[4] = w4;
o[5] = w5;
o[6] = w6;
o[7] = w7;
o[8] = w8;
o[9] = w9;
o[10] = w10;
o[11] = w11;
o[12] = w12;
o[13] = w13;
o[14] = w14;
o[15] = w15;
o[16] = w16;
o[17] = w17;
o[18] = w18;
if (c !== 0) {
o[19] = c;
out.length++;
}
return out;
};
// Polyfill comb
if (!Math.imul) {
comb10MulTo = smallMulTo;
}
function bigMulTo (self, num, out) {
out.negative = num.negative ^ self.negative;
out.length = self.length + num.length;
var carry = 0;
var hncarry = 0;
for (var k = 0; k < out.length - 1; k++) {
// Sum all words with the same `i + j = k` and accumulate `ncarry`,
// note that ncarry could be >= 0x3ffffff
var ncarry = hncarry;
hncarry = 0;
var rword = carry & 0x3ffffff;
var maxJ = Math.min(k, num.length - 1);
for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
var i = k - j;
var a = self.words[i] | 0;
var b = num.words[j] | 0;
var r = a * b;
var lo = r & 0x3ffffff;
ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;
lo = (lo + rword) | 0;
rword = lo & 0x3ffffff;
ncarry = (ncarry + (lo >>> 26)) | 0;
hncarry += ncarry >>> 26;
ncarry &= 0x3ffffff;
}
out.words[k] = rword;
carry = ncarry;
ncarry = hncarry;
}
if (carry !== 0) {
out.words[k] = carry;
} else {
out.length--;
}
return out.strip();
}
function jumboMulTo (self, num, out) {
var fftm = new FFTM();
return fftm.mulp(self, num, out);
}
BN.prototype.mulTo = function mulTo (num, out) {
var res;
var len = this.length + num.length;
if (this.length === 10 && num.length === 10) {
res = comb10MulTo(this, num, out);
} else if (len < 63) {
res = smallMulTo(this, num, out);
} else if (len < 1024) {
res = bigMulTo(this, num, out);
} else {
res = jumboMulTo(this, num, out);
}
return res;
};
// Cooley-Tukey algorithm for FFT
// slightly revisited to rely on looping instead of recursion
function FFTM (x, y) {
this.x = x;
this.y = y;
}
FFTM.prototype.makeRBT = function makeRBT (N) {
var t = new Array(N);
var l = BN.prototype._countBits(N) - 1;
for (var i = 0; i < N; i++) {
t[i] = this.revBin(i, l, N);
}
return t;
};
// Returns binary-reversed representation of `x`
FFTM.prototype.revBin = function revBin (x, l, N) {
if (x === 0 || x === N - 1) return x;
var rb = 0;
for (var i = 0; i < l; i++) {
rb |= (x & 1) << (l - i - 1);
x >>= 1;
}
return rb;
};
// Performs "tweedling" phase, therefore 'emulating'
// behaviour of the recursive algorithm
FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {
for (var i = 0; i < N; i++) {
rtws[i] = rws[rbt[i]];
itws[i] = iws[rbt[i]];
}
};
FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {
this.permute(rbt, rws, iws, rtws, itws, N);
for (var s = 1; s < N; s <<= 1) {
var l = s << 1;
var rtwdf = Math.cos(2 * Math.PI / l);
var itwdf = Math.sin(2 * Math.PI / l);
for (var p = 0; p < N; p += l) {
var rtwdf_ = rtwdf;
var itwdf_ = itwdf;
for (var j = 0; j < s; j++) {
var re = rtws[p + j];
var ie = itws[p + j];
var ro = rtws[p + j + s];
var io = itws[p + j + s];
var rx = rtwdf_ * ro - itwdf_ * io;
io = rtwdf_ * io + itwdf_ * ro;
ro = rx;
rtws[p + j] = re + ro;
itws[p + j] = ie + io;
rtws[p + j + s] = re - ro;
itws[p + j + s] = ie - io;
/* jshint maxdepth : false */
if (j !== l) {
rx = rtwdf * rtwdf_ - itwdf * itwdf_;
itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
rtwdf_ = rx;
}
}
}
}
};
FFTM.prototype.guessLen13b = function guessLen13b (n, m) {
var N = Math.max(m, n) | 1;
var odd = N & 1;
var i = 0;
for (N = N / 2 | 0; N; N = N >>> 1) {
i++;
}
return 1 << i + 1 + odd;
};
FFTM.prototype.conjugate = function conjugate (rws, iws, N) {
if (N <= 1) return;
for (var i = 0; i < N / 2; i++) {
var t = rws[i];
rws[i] = rws[N - i - 1];
rws[N - i - 1] = t;
t = iws[i];
iws[i] = -iws[N - i - 1];
iws[N - i - 1] = -t;
}
};
FFTM.prototype.normalize13b = function normalize13b (ws, N) {
var carry = 0;
for (var i = 0; i < N / 2; i++) {
var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +
Math.round(ws[2 * i] / N) +
carry;
ws[i] = w & 0x3ffffff;
if (w < 0x4000000) {
carry = 0;
} else {
carry = w / 0x4000000 | 0;
}
}
return ws;
};
FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {
var carry = 0;
for (var i = 0; i < len; i++) {
carry = carry + (ws[i] | 0);
rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;
rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;
}
// Pad with zeroes
for (i = 2 * len; i < N; ++i) {
rws[i] = 0;
}
assert(carry === 0);
assert((carry & ~0x1fff) === 0);
};
FFTM.prototype.stub = function stub (N) {
var ph = new Array(N);
for (var i = 0; i < N; i++) {
ph[i] = 0;
}
return ph;
};
FFTM.prototype.mulp = function mulp (x, y, out) {
var N = 2 * this.guessLen13b(x.length, y.length);
var rbt = this.makeRBT(N);
var _ = this.stub(N);
var rws = new Array(N);
var rwst = new Array(N);
var iwst = new Array(N);
var nrws = new Array(N);
var nrwst = new Array(N);
var niwst = new Array(N);
var rmws = out.words;
rmws.length = N;
this.convert13b(x.words, x.length, rws, N);
this.convert13b(y.words, y.length, nrws, N);
this.transform(rws, _, rwst, iwst, N, rbt);
this.transform(nrws, _, nrwst, niwst, N, rbt);
for (var i = 0; i < N; i++) {
var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
rwst[i] = rx;
}
this.conjugate(rwst, iwst, N);
this.transform(rwst, iwst, rmws, _, N, rbt);
this.conjugate(rmws, _, N);
this.normalize13b(rmws, N);
out.negative = x.negative ^ y.negative;
out.length = x.length + y.length;
return out.strip();
};
// Multiply `this` by `num`
BN.prototype.mul = function mul (num) {
var out = new BN(null);
out.words = new Array(this.length + num.length);
return this.mulTo(num, out);
};
// Multiply employing FFT
BN.prototype.mulf = function mulf (num) {
var out = new BN(null);
out.words = new Array(this.length + num.length);
return jumboMulTo(this, num, out);
};
// In-place Multiplication
BN.prototype.imul = function imul (num) {
return this.clone().mulTo(num, this);
};
BN.prototype.imuln = function imuln (num) {
assert(typeof num === 'number');
assert(num < 0x4000000);
// Carry
var carry = 0;
for (var i = 0; i < this.length; i++) {
var w = (this.words[i] | 0) * num;
var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);
carry >>= 26;
carry += (w / 0x4000000) | 0;
// NOTE: lo is 27bit maximum
carry += lo >>> 26;
this.words[i] = lo & 0x3ffffff;
}
if (carry !== 0) {
this.words[i] = carry;
this.length++;
}
return this;
};
BN.prototype.muln = function muln (num) {
return this.clone().imuln(num);
};
// `this` * `this`
BN.prototype.sqr = function sqr () {
return this.mul(this);
};
// `this` * `this` in-place
BN.prototype.isqr = function isqr () {
return this.imul(this.clone());
};
// Math.pow(`this`, `num`)
BN.prototype.pow = function pow (num) {
var w = toBitArray(num);
if (w.length === 0) return new BN(1);
// Skip leading zeroes
var res = this;
for (var i = 0; i < w.length; i++, res = res.sqr()) {
if (w[i] !== 0) break;
}
if (++i < w.length) {
for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
if (w[i] === 0) continue;
res = res.mul(q);
}
}
return res;
};
// Shift-left in-place
BN.prototype.iushln = function iushln (bits) {
assert(typeof bits === 'number' && bits >= 0);
var r = bits % 26;
var s = (bits - r) / 26;
var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);
var i;
if (r !== 0) {
var carry = 0;
for (i = 0; i < this.length; i++) {
var newCarry = this.words[i] & carryMask;
var c = ((this.words[i] | 0) - newCarry) << r;
this.words[i] = c | carry;
carry = newCarry >>> (26 - r);
}
if (carry) {
this.words[i] = carry;
this.length++;
}
}
if (s !== 0) {
for (i = this.length - 1; i >= 0; i--) {
this.words[i + s] = this.words[i];
}
for (i = 0; i < s; i++) {
this.words[i] = 0;
}
this.length += s;
}
return this.strip();
};
BN.prototype.ishln = function ishln (bits) {
// TODO(indutny): implement me
assert(this.negative === 0);
return this.iushln(bits);
};
// Shift-right in-place
// NOTE: `hint` is a lowest bit before trailing zeroes
// NOTE: if `extended` is present - it will be filled with destroyed bits
BN.prototype.iushrn = function iushrn (bits, hint, extended) {
assert(typeof bits === 'number' && bits >= 0);
var h;
if (hint) {
h = (hint - (hint % 26)) / 26;
} else {
h = 0;
}
var r = bits % 26;
var s = Math.min((bits - r) / 26, this.length);
var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);
var maskedWords = extended;
h -= s;
h = Math.max(0, h);
// Extended mode, copy masked part
if (maskedWords) {
for (var i = 0; i < s; i++) {
maskedWords.words[i] = this.words[i];
}
maskedWords.length = s;
}
if (s === 0) {
// No-op, we should not move anything at all
} else if (this.length > s) {
this.length -= s;
for (i = 0; i < this.length; i++) {
this.words[i] = this.words[i + s];
}
} else {
this.words[0] = 0;
this.length = 1;
}
var carry = 0;
for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
var word = this.words[i] | 0;
this.words[i] = (carry << (26 - r)) | (word >>> r);
carry = word & mask;
}
// Push carried bits as a mask
if (maskedWords && carry !== 0) {
maskedWords.words[maskedWords.length++] = carry;
}
if (this.length === 0) {
this.words[0] = 0;
this.length = 1;
}
return this.strip();
};
BN.prototype.ishrn = function ishrn (bits, hint, extended) {
// TODO(indutny): implement me
assert(this.negative === 0);
return this.iushrn(bits, hint, extended);
};
// Shift-left
BN.prototype.shln = function shln (bits) {
return this.clone().ishln(bits);
};
BN.prototype.ushln = function ushln (bits) {
return this.clone().iushln(bits);
};
// Shift-right
BN.prototype.shrn = function shrn (bits) {
return this.clone().ishrn(bits);
};
BN.prototype.ushrn = function ushrn (bits) {
return this.clone().iushrn(bits);
};
// Test if n bit is set
BN.prototype.testn = function testn (bit) {
assert(typeof bit === 'number' && bit >= 0);
var r = bit % 26;
var s = (bit - r) / 26;
var q = 1 << r;
// Fast case: bit is much higher than all existing words
if (this.length <= s) return false;
// Check bit and return
var w = this.words[s];
return !!(w & q);
};
// Return only lowers bits of number (in-place)
BN.prototype.imaskn = function imaskn (bits) {
assert(typeof bits === 'number' && bits >= 0);
var r = bits % 26;
var s = (bits - r) / 26;
assert(this.negative === 0, 'imaskn works only with positive numbers');
if (this.length <= s) {
return this;
}
if (r !== 0) {
s++;
}
this.length = Math.min(s, this.length);
if (r !== 0) {
var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);
this.words[this.length - 1] &= mask;
}
return this.strip();
};
// Return only lowers bits of number
BN.prototype.maskn = function maskn (bits) {
return this.clone().imaskn(bits);
};
// Add plain number `num` to `this`
BN.prototype.iaddn = function iaddn (num) {
assert(typeof num === 'number');
assert(num < 0x4000000);
if (num < 0) return this.isubn(-num);
// Possible sign change
if (this.negative !== 0) {
if (this.length === 1 && (this.words[0] | 0) < num) {
this.words[0] = num - (this.words[0] | 0);
this.negative = 0;
return this;
}
this.negative = 0;
this.isubn(num);
this.negative = 1;
return this;
}
// Add without checks
return this._iaddn(num);
};
BN.prototype._iaddn = function _iaddn (num) {
this.words[0] += num;
// Carry
for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {
this.words[i] -= 0x4000000;
if (i === this.length - 1) {
this.words[i + 1] = 1;
} else {
this.words[i + 1]++;
}
}
this.length = Math.max(this.length, i + 1);
return this;
};
// Subtract plain number `num` from `this`
BN.prototype.isubn = function isubn (num) {
assert(typeof num === 'number');
assert(num < 0x4000000);
if (num < 0) return this.iaddn(-num);
if (this.negative !== 0) {
this.negative = 0;
this.iaddn(num);
this.negative = 1;
return this;
}
this.words[0] -= num;
if (this.length === 1 && this.words[0] < 0) {
this.words[0] = -this.words[0];
this.negative = 1;
} else {
// Carry
for (var i = 0; i < this.length && this.words[i] < 0; i++) {
this.words[i] += 0x4000000;
this.words[i + 1] -= 1;
}
}
return this.strip();
};
BN.prototype.addn = function addn (num) {
return this.clone().iaddn(num);
};
BN.prototype.subn = function subn (num) {
return this.clone().isubn(num);
};
BN.prototype.iabs = function iabs () {
this.negative = 0;
return this;
};
BN.prototype.abs = function abs () {
return this.clone().iabs();
};
BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {
var len = num.length + shift;
var i;
this._expand(len);
var w;
var carry = 0;
for (i = 0; i < num.length; i++) {
w = (this.words[i + shift] | 0) + carry;
var right = (num.words[i] | 0) * mul;
w -= right & 0x3ffffff;
carry = (w >> 26) - ((right / 0x4000000) | 0);
this.words[i + shift] = w & 0x3ffffff;
}
for (; i < this.length - shift; i++) {
w = (this.words[i + shift] | 0) + carry;
carry = w >> 26;
this.words[i + shift] = w & 0x3ffffff;
}
if (carry === 0) return this.strip();
// Subtraction overflow
assert(carry === -1);
carry = 0;
for (i = 0; i < this.length; i++) {
w = -(this.words[i] | 0) + carry;
carry = w >> 26;
this.words[i] = w & 0x3ffffff;
}
this.negative = 1;
return this.strip();
};
BN.prototype._wordDiv = function _wordDiv (num, mode) {
var shift = this.length - num.length;
var a = this.clone();
var b = num;
// Normalize
var bhi = b.words[b.length - 1] | 0;
var bhiBits = this._countBits(bhi);
shift = 26 - bhiBits;
if (shift !== 0) {
b = b.ushln(shift);
a.iushln(shift);
bhi = b.words[b.length - 1] | 0;
}
// Initialize quotient
var m = a.length - b.length;
var q;
if (mode !== 'mod') {
q = new BN(null);
q.length = m + 1;
q.words = new Array(q.length);
for (var i = 0; i < q.length; i++) {
q.words[i] = 0;
}
}
var diff = a.clone()._ishlnsubmul(b, 1, m);
if (diff.negative === 0) {
a = diff;
if (q) {
q.words[m] = 1;
}
}
for (var j = m - 1; j >= 0; j--) {
var qj = (a.words[b.length + j] | 0) * 0x4000000 +
(a.words[b.length + j - 1] | 0);
// NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max
// (0x7ffffff)
qj = Math.min((qj / bhi) | 0, 0x3ffffff);
a._ishlnsubmul(b, qj, j);
while (a.negative !== 0) {
qj--;
a.negative = 0;
a._ishlnsubmul(b, 1, j);
if (!a.isZero()) {
a.negative ^= 1;
}
}
if (q) {
q.words[j] = qj;
}
}
if (q) {
q.strip();
}
a.strip();
// Denormalize
if (mode !== 'div' && shift !== 0) {
a.iushrn(shift);
}
return {
div: q || null,
mod: a
};
};
// NOTE: 1) `mode` can be set to `mod` to request mod only,
// to `div` to request div only, or be absent to
// request both div & mod
// 2) `positive` is true if unsigned mod is requested
BN.prototype.divmod = function divmod (num, mode, positive) {
assert(!num.isZero());
if (this.isZero()) {
return {
div: new BN(0),
mod: new BN(0)
};
}
var div, mod, res;
if (this.negative !== 0 && num.negative === 0) {
res = this.neg().divmod(num, mode);
if (mode !== 'mod') {
div = res.div.neg();
}
if (mode !== 'div') {
mod = res.mod.neg();
if (positive && mod.negative !== 0) {
mod.iadd(num);
}
}
return {
div: div,
mod: mod
};
}
if (this.negative === 0 && num.negative !== 0) {
res = this.divmod(num.neg(), mode);
if (mode !== 'mod') {
div = res.div.neg();
}
return {
div: div,
mod: res.mod
};
}
if ((this.negative & num.negative) !== 0) {
res = this.neg().divmod(num.neg(), mode);
if (mode !== 'div') {
mod = res.mod.neg();
if (positive && mod.negative !== 0) {
mod.isub(num);
}
}
return {
div: res.div,
mod: mod
};
}
// Both numbers are positive at this point
// Strip both numbers to approximate shift value
if (num.length > this.length || this.cmp(num) < 0) {
return {
div: new BN(0),
mod: this
};
}
// Very short reduction
if (num.length === 1) {
if (mode === 'div') {
return {
div: this.divn(num.words[0]),
mod: null
};
}
if (mode === 'mod') {
return {
div: null,
mod: new BN(this.modn(num.words[0]))
};
}
return {
div: this.divn(num.words[0]),
mod: new BN(this.modn(num.words[0]))
};
}
return this._wordDiv(num, mode);
};
// Find `this` / `num`
BN.prototype.div = function div (num) {
return this.divmod(num, 'div', false).div;
};
// Find `this` % `num`
BN.prototype.mod = function mod (num) {
return this.divmod(num, 'mod', false).mod;
};
BN.prototype.umod = function umod (num) {
return this.divmod(num, 'mod', true).mod;
};
// Find Round(`this` / `num`)
BN.prototype.divRound = function divRound (num) {
var dm = this.divmod(num);
// Fast case - exact division
if (dm.mod.isZero()) return dm.div;
var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
var half = num.ushrn(1);
var r2 = num.andln(1);
var cmp = mod.cmp(half);
// Round down
if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
// Round up
return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
};
BN.prototype.modn = function modn (num) {
assert(num <= 0x3ffffff);
var p = (1 << 26) % num;
var acc = 0;
for (var i = this.length - 1; i >= 0; i--) {
acc = (p * acc + (this.words[i] | 0)) % num;
}
return acc;
};
// In-place division by number
BN.prototype.idivn = function idivn (num) {
assert(num <= 0x3ffffff);
var carry = 0;
for (var i = this.length - 1; i >= 0; i--) {
var w = (this.words[i] | 0) + carry * 0x4000000;
this.words[i] = (w / num) | 0;
carry = w % num;
}
return this.strip();
};
BN.prototype.divn = function divn (num) {
return this.clone().idivn(num);
};
BN.prototype.egcd = function egcd (p) {
assert(p.negative === 0);
assert(!p.isZero());
var x = this;
var y = p.clone();
if (x.negative !== 0) {
x = x.umod(p);
} else {
x = x.clone();
}
// A * x + B * y = x
var A = new BN(1);
var B = new BN(0);
// C * x + D * y = y
var C = new BN(0);
var D = new BN(1);
var g = 0;
while (x.isEven() && y.isEven()) {
x.iushrn(1);
y.iushrn(1);
++g;
}
var yp = y.clone();
var xp = x.clone();
while (!x.isZero()) {
for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
if (i > 0) {
x.iushrn(i);
while (i-- > 0) {
if (A.isOdd() || B.isOdd()) {
A.iadd(yp);
B.isub(xp);
}
A.iushrn(1);
B.iushrn(1);
}
}
for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
if (j > 0) {
y.iushrn(j);
while (j-- > 0) {
if (C.isOdd() || D.isOdd()) {
C.iadd(yp);
D.isub(xp);
}
C.iushrn(1);
D.iushrn(1);
}
}
if (x.cmp(y) >= 0) {
x.isub(y);
A.isub(C);
B.isub(D);
} else {
y.isub(x);
C.isub(A);
D.isub(B);
}
}
return {
a: C,
b: D,
gcd: y.iushln(g)
};
};
// This is reduced incarnation of the binary EEA
// above, designated to invert members of the
// _prime_ fields F(p) at a maximal speed
BN.prototype._invmp = function _invmp (p) {
assert(p.negative === 0);
assert(!p.isZero());
var a = this;
var b = p.clone();
if (a.negative !== 0) {
a = a.umod(p);
} else {
a = a.clone();
}
var x1 = new BN(1);
var x2 = new BN(0);
var delta = b.clone();
while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
if (i > 0) {
a.iushrn(i);
while (i-- > 0) {
if (x1.isOdd()) {
x1.iadd(delta);
}
x1.iushrn(1);
}
}
for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
if (j > 0) {
b.iushrn(j);
while (j-- > 0) {
if (x2.isOdd()) {
x2.iadd(delta);
}
x2.iushrn(1);
}
}
if (a.cmp(b) >= 0) {
a.isub(b);
x1.isub(x2);
} else {
b.isub(a);
x2.isub(x1);
}
}
var res;
if (a.cmpn(1) === 0) {
res = x1;
} else {
res = x2;
}
if (res.cmpn(0) < 0) {
res.iadd(p);
}
return res;
};
BN.prototype.gcd = function gcd (num) {
if (this.isZero()) return num.abs();
if (num.isZero()) return this.abs();
var a = this.clone();
var b = num.clone();
a.negative = 0;
b.negative = 0;
// Remove common factor of two
for (var shift = 0; a.isEven() && b.isEven(); shift++) {
a.iushrn(1);
b.iushrn(1);
}
do {
while (a.isEven()) {
a.iushrn(1);
}
while (b.isEven()) {
b.iushrn(1);
}
var r = a.cmp(b);
if (r < 0) {
// Swap `a` and `b` to make `a` always bigger than `b`
var t = a;
a = b;
b = t;
} else if (r === 0 || b.cmpn(1) === 0) {
break;
}
a.isub(b);
} while (true);
return b.iushln(shift);
};
// Invert number in the field F(num)
BN.prototype.invm = function invm (num) {
return this.egcd(num).a.umod(num);
};
BN.prototype.isEven = function isEven () {
return (this.words[0] & 1) === 0;
};
BN.prototype.isOdd = function isOdd () {
return (this.words[0] & 1) === 1;
};
// And first word and num
BN.prototype.andln = function andln (num) {
return this.words[0] & num;
};
// Increment at the bit position in-line
BN.prototype.bincn = function bincn (bit) {
assert(typeof bit === 'number');
var r = bit % 26;
var s = (bit - r) / 26;
var q = 1 << r;
// Fast case: bit is much higher than all existing words
if (this.length <= s) {
this._expand(s + 1);
this.words[s] |= q;
return this;
}
// Add bit and propagate, if needed
var carry = q;
for (var i = s; carry !== 0 && i < this.length; i++) {
var w = this.words[i] | 0;
w += carry;
carry = w >>> 26;
w &= 0x3ffffff;
this.words[i] = w;
}
if (carry !== 0) {
this.words[i] = carry;
this.length++;
}
return this;
};
BN.prototype.isZero = function isZero () {
return this.length === 1 && this.words[0] === 0;
};
BN.prototype.cmpn = function cmpn (num) {
var negative = num < 0;
if (this.negative !== 0 && !negative) return -1;
if (this.negative === 0 && negative) return 1;
this.strip();
var res;
if (this.length > 1) {
res = 1;
} else {
if (negative) {
num = -num;
}
assert(num <= 0x3ffffff, 'Number is too big');
var w = this.words[0] | 0;
res = w === num ? 0 : w < num ? -1 : 1;
}
if (this.negative !== 0) return -res | 0;
return res;
};
// Compare two numbers and return:
// 1 - if `this` > `num`
// 0 - if `this` == `num`
// -1 - if `this` < `num`
BN.prototype.cmp = function cmp (num) {
if (this.negative !== 0 && num.negative === 0) return -1;
if (this.negative === 0 && num.negative !== 0) return 1;
var res = this.ucmp(num);
if (this.negative !== 0) return -res | 0;
return res;
};
// Unsigned comparison
BN.prototype.ucmp = function ucmp (num) {
// At this point both numbers have the same sign
if (this.length > num.length) return 1;
if (this.length < num.length) return -1;
var res = 0;
for (var i = this.length - 1; i >= 0; i--) {
var a = this.words[i] | 0;
var b = num.words[i] | 0;
if (a === b) continue;
if (a < b) {
res = -1;
} else if (a > b) {
res = 1;
}
break;
}
return res;
};
BN.prototype.gtn = function gtn (num) {
return this.cmpn(num) === 1;
};
BN.prototype.gt = function gt (num) {
return this.cmp(num) === 1;
};
BN.prototype.gten = function gten (num) {
return this.cmpn(num) >= 0;
};
BN.prototype.gte = function gte (num) {
return this.cmp(num) >= 0;
};
BN.prototype.ltn = function ltn (num) {
return this.cmpn(num) === -1;
};
BN.prototype.lt = function lt (num) {
return this.cmp(num) === -1;
};
BN.prototype.lten = function lten (num) {
return this.cmpn(num) <= 0;
};
BN.prototype.lte = function lte (num) {
return this.cmp(num) <= 0;
};
BN.prototype.eqn = function eqn (num) {
return this.cmpn(num) === 0;
};
BN.prototype.eq = function eq (num) {
return this.cmp(num) === 0;
};
//
// A reduce context, could be using montgomery or something better, depending
// on the `m` itself.
//
BN.red = function red (num) {
return new Red(num);
};
BN.prototype.toRed = function toRed (ctx) {
assert(!this.red, 'Already a number in reduction context');
assert(this.negative === 0, 'red works only with positives');
return ctx.convertTo(this)._forceRed(ctx);
};
BN.prototype.fromRed = function fromRed () {
assert(this.red, 'fromRed works only with numbers in reduction context');
return this.red.convertFrom(this);
};
BN.prototype._forceRed = function _forceRed (ctx) {
this.red = ctx;
return this;
};
BN.prototype.forceRed = function forceRed (ctx) {
assert(!this.red, 'Already a number in reduction context');
return this._forceRed(ctx);
};
BN.prototype.redAdd = function redAdd (num) {
assert(this.red, 'redAdd works only with red numbers');
return this.red.add(this, num);
};
BN.prototype.redIAdd = function redIAdd (num) {
assert(this.red, 'redIAdd works only with red numbers');
return this.red.iadd(this, num);
};
BN.prototype.redSub = function redSub (num) {
assert(this.red, 'redSub works only with red numbers');
return this.red.sub(this, num);
};
BN.prototype.redISub = function redISub (num) {
assert(this.red, 'redISub works only with red numbers');
return this.red.isub(this, num);
};
BN.prototype.redShl = function redShl (num) {
assert(this.red, 'redShl works only with red numbers');
return this.red.shl(this, num);
};
BN.prototype.redMul = function redMul (num) {
assert(this.red, 'redMul works only with red numbers');
this.red._verify2(this, num);
return this.red.mul(this, num);
};
BN.prototype.redIMul = function redIMul (num) {
assert(this.red, 'redMul works only with red numbers');
this.red._verify2(this, num);
return this.red.imul(this, num);
};
BN.prototype.redSqr = function redSqr () {
assert(this.red, 'redSqr works only with red numbers');
this.red._verify1(this);
return this.red.sqr(this);
};
BN.prototype.redISqr = function redISqr () {
assert(this.red, 'redISqr works only with red numbers');
this.red._verify1(this);
return this.red.isqr(this);
};
// Square root over p
BN.prototype.redSqrt = function redSqrt () {
assert(this.red, 'redSqrt works only with red numbers');
this.red._verify1(this);
return this.red.sqrt(this);
};
BN.prototype.redInvm = function redInvm () {
assert(this.red, 'redInvm works only with red numbers');
this.red._verify1(this);
return this.red.invm(this);
};
// Return negative clone of `this` % `red modulo`
BN.prototype.redNeg = function redNeg () {
assert(this.red, 'redNeg works only with red numbers');
this.red._verify1(this);
return this.red.neg(this);
};
BN.prototype.redPow = function redPow (num) {
assert(this.red && !num.red, 'redPow(normalNum)');
this.red._verify1(this);
return this.red.pow(this, num);
};
// Prime numbers with efficient reduction
var primes = {
k256: null,
p224: null,
p192: null,
p25519: null
};
// Pseudo-Mersenne prime
function MPrime (name, p) {
// P = 2 ^ N - K
this.name = name;
this.p = new BN(p, 16);
this.n = this.p.bitLength();
this.k = new BN(1).iushln(this.n).isub(this.p);
this.tmp = this._tmp();
}
MPrime.prototype._tmp = function _tmp () {
var tmp = new BN(null);
tmp.words = new Array(Math.ceil(this.n / 13));
return tmp;
};
MPrime.prototype.ireduce = function ireduce (num) {
// Assumes that `num` is less than `P^2`
// num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)
var r = num;
var rlen;
do {
this.split(r, this.tmp);
r = this.imulK(r);
r = r.iadd(this.tmp);
rlen = r.bitLength();
} while (rlen > this.n);
var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
if (cmp === 0) {
r.words[0] = 0;
r.length = 1;
} else if (cmp > 0) {
r.isub(this.p);
} else {
if (r.strip !== undefined) {
// r is BN v4 instance
r.strip();
} else {
// r is BN v5 instance
r._strip();
}
}
return r;
};
MPrime.prototype.split = function split (input, out) {
input.iushrn(this.n, 0, out);
};
MPrime.prototype.imulK = function imulK (num) {
return num.imul(this.k);
};
function K256 () {
MPrime.call(
this,
'k256',
'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');
}
inherits(K256, MPrime);
K256.prototype.split = function split (input, output) {
// 256 = 9 * 26 + 22
var mask = 0x3fffff;
var outLen = Math.min(input.length, 9);
for (var i = 0; i < outLen; i++) {
output.words[i] = input.words[i];
}
output.length = outLen;
if (input.length <= 9) {
input.words[0] = 0;
input.length = 1;
return;
}
// Shift by 9 limbs
var prev = input.words[9];
output.words[output.length++] = prev & mask;
for (i = 10; i < input.length; i++) {
var next = input.words[i] | 0;
input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);
prev = next;
}
prev >>>= 22;
input.words[i - 10] = prev;
if (prev === 0 && input.length > 10) {
input.length -= 10;
} else {
input.length -= 9;
}
};
K256.prototype.imulK = function imulK (num) {
// K = 0x1000003d1 = [ 0x40, 0x3d1 ]
num.words[num.length] = 0;
num.words[num.length + 1] = 0;
num.length += 2;
// bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390
var lo = 0;
for (var i = 0; i < num.length; i++) {
var w = num.words[i] | 0;
lo += w * 0x3d1;
num.words[i] = lo & 0x3ffffff;
lo = w * 0x40 + ((lo / 0x4000000) | 0);
}
// Fast length reduction
if (num.words[num.length - 1] === 0) {
num.length--;
if (num.words[num.length - 1] === 0) {
num.length--;
}
}
return num;
};
function P224 () {
MPrime.call(
this,
'p224',
'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');
}
inherits(P224, MPrime);
function P192 () {
MPrime.call(
this,
'p192',
'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');
}
inherits(P192, MPrime);
function P25519 () {
// 2 ^ 255 - 19
MPrime.call(
this,
'25519',
'7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');
}
inherits(P25519, MPrime);
P25519.prototype.imulK = function imulK (num) {
// K = 0x13
var carry = 0;
for (var i = 0; i < num.length; i++) {
var hi = (num.words[i] | 0) * 0x13 + carry;
var lo = hi & 0x3ffffff;
hi >>>= 26;
num.words[i] = lo;
carry = hi;
}
if (carry !== 0) {
num.words[num.length++] = carry;
}
return num;
};
// Exported mostly for testing purposes, use plain name instead
BN._prime = function prime (name) {
// Cached version of prime
if (primes[name]) return primes[name];
var prime;
if (name === 'k256') {
prime = new K256();
} else if (name === 'p224') {
prime = new P224();
} else if (name === 'p192') {
prime = new P192();
} else if (name === 'p25519') {
prime = new P25519();
} else {
throw new Error('Unknown prime ' + name);
}
primes[name] = prime;
return prime;
};
//
// Base reduction engine
//
function Red (m) {
if (typeof m === 'string') {
var prime = BN._prime(m);
this.m = prime.p;
this.prime = prime;
} else {
assert(m.gtn(1), 'modulus must be greater than 1');
this.m = m;
this.prime = null;
}
}
Red.prototype._verify1 = function _verify1 (a) {
assert(a.negative === 0, 'red works only with positives');
assert(a.red, 'red works only with red numbers');
};
Red.prototype._verify2 = function _verify2 (a, b) {
assert((a.negative | b.negative) === 0, 'red works only with positives');
assert(a.red && a.red === b.red,
'red works only with red numbers');
};
Red.prototype.imod = function imod (a) {
if (this.prime) return this.prime.ireduce(a)._forceRed(this);
return a.umod(this.m)._forceRed(this);
};
Red.prototype.neg = function neg (a) {
if (a.isZero()) {
return a.clone();
}
return this.m.sub(a)._forceRed(this);
};
Red.prototype.add = function add (a, b) {
this._verify2(a, b);
var res = a.add(b);
if (res.cmp(this.m) >= 0) {
res.isub(this.m);
}
return res._forceRed(this);
};
Red.prototype.iadd = function iadd (a, b) {
this._verify2(a, b);
var res = a.iadd(b);
if (res.cmp(this.m) >= 0) {
res.isub(this.m);
}
return res;
};
Red.prototype.sub = function sub (a, b) {
this._verify2(a, b);
var res = a.sub(b);
if (res.cmpn(0) < 0) {
res.iadd(this.m);
}
return res._forceRed(this);
};
Red.prototype.isub = function isub (a, b) {
this._verify2(a, b);
var res = a.isub(b);
if (res.cmpn(0) < 0) {
res.iadd(this.m);
}
return res;
};
Red.prototype.shl = function shl (a, num) {
this._verify1(a);
return this.imod(a.ushln(num));
};
Red.prototype.imul = function imul (a, b) {
this._verify2(a, b);
return this.imod(a.imul(b));
};
Red.prototype.mul = function mul (a, b) {
this._verify2(a, b);
return this.imod(a.mul(b));
};
Red.prototype.isqr = function isqr (a) {
return this.imul(a, a.clone());
};
Red.prototype.sqr = function sqr (a) {
return this.mul(a, a);
};
Red.prototype.sqrt = function sqrt (a) {
if (a.isZero()) return a.clone();
var mod3 = this.m.andln(3);
assert(mod3 % 2 === 1);
// Fast case
if (mod3 === 3) {
var pow = this.m.add(new BN(1)).iushrn(2);
return this.pow(a, pow);
}
// Tonelli-Shanks algorithm (Totally unoptimized and slow)
//
// Find Q and S, that Q * 2 ^ S = (P - 1)
var q = this.m.subn(1);
var s = 0;
while (!q.isZero() && q.andln(1) === 0) {
s++;
q.iushrn(1);
}
assert(!q.isZero());
var one = new BN(1).toRed(this);
var nOne = one.redNeg();
// Find quadratic non-residue
// NOTE: Max is such because of generalized Riemann hypothesis.
var lpow = this.m.subn(1).iushrn(1);
var z = this.m.bitLength();
z = new BN(2 * z * z).toRed(this);
while (this.pow(z, lpow).cmp(nOne) !== 0) {
z.redIAdd(nOne);
}
var c = this.pow(z, q);
var r = this.pow(a, q.addn(1).iushrn(1));
var t = this.pow(a, q);
var m = s;
while (t.cmp(one) !== 0) {
var tmp = t;
for (var i = 0; tmp.cmp(one) !== 0; i++) {
tmp = tmp.redSqr();
}
assert(i < m);
var b = this.pow(c, new BN(1).iushln(m - i - 1));
r = r.redMul(b);
c = b.redSqr();
t = t.redMul(c);
m = i;
}
return r;
};
Red.prototype.invm = function invm (a) {
var inv = a._invmp(this.m);
if (inv.negative !== 0) {
inv.negative = 0;
return this.imod(inv).redNeg();
} else {
return this.imod(inv);
}
};
Red.prototype.pow = function pow (a, num) {
if (num.isZero()) return new BN(1).toRed(this);
if (num.cmpn(1) === 0) return a.clone();
var windowSize = 4;
var wnd = new Array(1 << windowSize);
wnd[0] = new BN(1).toRed(this);
wnd[1] = a;
for (var i = 2; i < wnd.length; i++) {
wnd[i] = this.mul(wnd[i - 1], a);
}
var res = wnd[0];
var current = 0;
var currentLen = 0;
var start = num.bitLength() % 26;
if (start === 0) {
start = 26;
}
for (i = num.length - 1; i >= 0; i--) {
var word = num.words[i];
for (var j = start - 1; j >= 0; j--) {
var bit = (word >> j) & 1;
if (res !== wnd[0]) {
res = this.sqr(res);
}
if (bit === 0 && current === 0) {
currentLen = 0;
continue;
}
current <<= 1;
current |= bit;
currentLen++;
if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
res = this.mul(res, wnd[current]);
currentLen = 0;
current = 0;
}
start = 26;
}
return res;
};
Red.prototype.convertTo = function convertTo (num) {
var r = num.umod(this.m);
return r === num ? r.clone() : r;
};
Red.prototype.convertFrom = function convertFrom (num) {
var res = num.clone();
res.red = null;
return res;
};
//
// Montgomery method engine
//
BN.mont = function mont (num) {
return new Mont(num);
};
function Mont (m) {
Red.call(this, m);
this.shift = this.m.bitLength();
if (this.shift % 26 !== 0) {
this.shift += 26 - (this.shift % 26);
}
this.r = new BN(1).iushln(this.shift);
this.r2 = this.imod(this.r.sqr());
this.rinv = this.r._invmp(this.m);
this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
this.minv = this.minv.umod(this.r);
this.minv = this.r.sub(this.minv);
}
inherits(Mont, Red);
Mont.prototype.convertTo = function convertTo (num) {
return this.imod(num.ushln(this.shift));
};
Mont.prototype.convertFrom = function convertFrom (num) {
var r = this.imod(num.mul(this.rinv));
r.red = null;
return r;
};
Mont.prototype.imul = function imul (a, b) {
if (a.isZero() || b.isZero()) {
a.words[0] = 0;
a.length = 1;
return a;
}
var t = a.imul(b);
var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
var u = t.isub(c).iushrn(this.shift);
var res = u;
if (u.cmp(this.m) >= 0) {
res = u.isub(this.m);
} else if (u.cmpn(0) < 0) {
res = u.iadd(this.m);
}
return res._forceRed(this);
};
Mont.prototype.mul = function mul (a, b) {
if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
var t = a.mul(b);
var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
var u = t.isub(c).iushrn(this.shift);
var res = u;
if (u.cmp(this.m) >= 0) {
res = u.isub(this.m);
} else if (u.cmpn(0) < 0) {
res = u.iadd(this.m);
}
return res._forceRed(this);
};
Mont.prototype.invm = function invm (a) {
// (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R
var res = this.imod(a._invmp(this.m).mul(this.r2));
return res._forceRed(this);
};
})( false || module, this);
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ 163)(module)))
/***/ }),
/***/ 163:
/*!***********************************!*\
!*** (webpack)/buildin/module.js ***!
\***********************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = function(module) {
if (!module.webpackPolyfill) {
module.deprecate = function() {};
module.paths = [];
// module.parent = undefined by default
if (!module.children) module.children = [];
Object.defineProperty(module, "loaded", {
enumerable: true,
get: function() {
return module.l;
}
});
Object.defineProperty(module, "id", {
enumerable: true,
get: function() {
return module.i;
}
});
module.webpackPolyfill = 1;
}
return module;
};
/***/ }),
/***/ 164:
/*!************************!*\
!*** buffer (ignored) ***!
\************************/
/*! no static exports found */
/***/ (function(module, exports) {
/* (ignored) */
/***/ }),
/***/ 165:
/*!*********************************************!*\
!*** ./node_modules/miller-rabin/lib/mr.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var bn = __webpack_require__(/*! bn.js */ 162);
var brorand = __webpack_require__(/*! brorand */ 166);
function MillerRabin(rand) {
this.rand = rand || new brorand.Rand();
}
module.exports = MillerRabin;
MillerRabin.create = function create(rand) {
return new MillerRabin(rand);
};
MillerRabin.prototype._randbelow = function _randbelow(n) {
var len = n.bitLength();
var min_bytes = Math.ceil(len / 8);
// Generage random bytes until a number less than n is found.
// This ensures that 0..n-1 have an equal probability of being selected.
do
var a = new bn(this.rand.generate(min_bytes));
while (a.cmp(n) >= 0);
return a;
};
MillerRabin.prototype._randrange = function _randrange(start, stop) {
// Generate a random number greater than or equal to start and less than stop.
var size = stop.sub(start);
return start.add(this._randbelow(size));
};
MillerRabin.prototype.test = function test(n, k, cb) {
var len = n.bitLength();
var red = bn.mont(n);
var rone = new bn(1).toRed(red);
if (!k)
k = Math.max(1, (len / 48) | 0);
// Find d and s, (n - 1) = (2 ^ s) * d;
var n1 = n.subn(1);
for (var s = 0; !n1.testn(s); s++) {}
var d = n.shrn(s);
var rn1 = n1.toRed(red);
var prime = true;
for (; k > 0; k--) {
var a = this._randrange(new bn(2), n1);
if (cb)
cb(a);
var x = a.toRed(red).redPow(d);
if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)
continue;
for (var i = 1; i < s; i++) {
x = x.redSqr();
if (x.cmp(rone) === 0)
return false;
if (x.cmp(rn1) === 0)
break;
}
if (i === s)
return false;
}
return prime;
};
MillerRabin.prototype.getDivisor = function getDivisor(n, k) {
var len = n.bitLength();
var red = bn.mont(n);
var rone = new bn(1).toRed(red);
if (!k)
k = Math.max(1, (len / 48) | 0);
// Find d and s, (n - 1) = (2 ^ s) * d;
var n1 = n.subn(1);
for (var s = 0; !n1.testn(s); s++) {}
var d = n.shrn(s);
var rn1 = n1.toRed(red);
for (; k > 0; k--) {
var a = this._randrange(new bn(2), n1);
var g = n.gcd(a);
if (g.cmpn(1) !== 0)
return g;
var x = a.toRed(red).redPow(d);
if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)
continue;
for (var i = 1; i < s; i++) {
x = x.redSqr();
if (x.cmp(rone) === 0)
return x.fromRed().subn(1).gcd(n);
if (x.cmp(rn1) === 0)
break;
}
if (i === s) {
x = x.redSqr();
return x.fromRed().subn(1).gcd(n);
}
}
return false;
};
/***/ }),
/***/ 166:
/*!***************************************!*\
!*** ./node_modules/brorand/index.js ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var r;
module.exports = function rand(len) {
if (!r)
r = new Rand(null);
return r.generate(len);
};
function Rand(rand) {
this.rand = rand;
}
module.exports.Rand = Rand;
Rand.prototype.generate = function generate(len) {
return this._rand(len);
};
// Emulate crypto API using randy
Rand.prototype._rand = function _rand(n) {
if (this.rand.getBytes)
return this.rand.getBytes(n);
var res = new Uint8Array(n);
for (var i = 0; i < res.length; i++)
res[i] = this.rand.getByte();
return res;
};
if (typeof self === 'object') {
if (self.crypto && self.crypto.getRandomValues) {
// Modern browsers
Rand.prototype._rand = function _rand(n) {
var arr = new Uint8Array(n);
self.crypto.getRandomValues(arr);
return arr;
};
} else if (self.msCrypto && self.msCrypto.getRandomValues) {
// IE
Rand.prototype._rand = function _rand(n) {
var arr = new Uint8Array(n);
self.msCrypto.getRandomValues(arr);
return arr;
};
// Safari's WebWorkers do not have `crypto`
} else if (typeof window === 'object') {
// Old junk
Rand.prototype._rand = function() {
throw new Error('Not implemented yet');
};
}
} else {
// Node.js or Web worker with no crypto support
try {
var crypto = __webpack_require__(/*! crypto */ 167);
if (typeof crypto.randomBytes !== 'function')
throw new Error('Not supported');
Rand.prototype._rand = function _rand(n) {
return crypto.randomBytes(n);
};
} catch (e) {
}
}
/***/ }),
/***/ 167:
/*!************************!*\
!*** crypto (ignored) ***!
\************************/
/*! no static exports found */
/***/ (function(module, exports) {
/* (ignored) */
/***/ }),
/***/ 168:
/*!*****************************************************!*\
!*** ./node_modules/diffie-hellman/lib/primes.json ***!
\*****************************************************/
/*! exports provided: modp1, modp2, modp5, modp14, modp15, modp16, modp17, modp18, default */
/***/ (function(module) {
module.exports = JSON.parse("{\"modp1\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff\"},\"modp2\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff\"},\"modp5\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff\"},\"modp14\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff\"},\"modp15\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff\"},\"modp16\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff\"},\"modp17\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff\"},\"modp18\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff\"}}");
/***/ }),
/***/ 169:
/*!***********************************************!*\
!*** ./node_modules/diffie-hellman/lib/dh.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(Buffer) {var BN = __webpack_require__(/*! bn.js */ 162);
var MillerRabin = __webpack_require__(/*! miller-rabin */ 165);
var millerRabin = new MillerRabin();
var TWENTYFOUR = new BN(24);
var ELEVEN = new BN(11);
var TEN = new BN(10);
var THREE = new BN(3);
var SEVEN = new BN(7);
var primes = __webpack_require__(/*! ./generatePrime */ 161);
var randomBytes = __webpack_require__(/*! randombytes */ 77);
module.exports = DH;
function setPublicKey(pub, enc) {
enc = enc || 'utf8';
if (!Buffer.isBuffer(pub)) {
pub = new Buffer(pub, enc);
}
this._pub = new BN(pub);
return this;
}
function setPrivateKey(priv, enc) {
enc = enc || 'utf8';
if (!Buffer.isBuffer(priv)) {
priv = new Buffer(priv, enc);
}
this._priv = new BN(priv);
return this;
}
var primeCache = {};
function checkPrime(prime, generator) {
var gen = generator.toString('hex');
var hex = [gen, prime.toString(16)].join('_');
if (hex in primeCache) {
return primeCache[hex];
}
var error = 0;
if (prime.isEven() ||
!primes.simpleSieve ||
!primes.fermatTest(prime) ||
!millerRabin.test(prime)) {
//not a prime so +1
error += 1;
if (gen === '02' || gen === '05') {
// we'd be able to check the generator
// it would fail so +8
error += 8;
} else {
//we wouldn't be able to test the generator
// so +4
error += 4;
}
primeCache[hex] = error;
return error;
}
if (!millerRabin.test(prime.shrn(1))) {
//not a safe prime
error += 2;
}
var rem;
switch (gen) {
case '02':
if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) {
// unsuidable generator
error += 8;
}
break;
case '05':
rem = prime.mod(TEN);
if (rem.cmp(THREE) && rem.cmp(SEVEN)) {
// prime mod 10 needs to equal 3 or 7
error += 8;
}
break;
default:
error += 4;
}
primeCache[hex] = error;
return error;
}
function DH(prime, generator, malleable) {
this.setGenerator(generator);
this.__prime = new BN(prime);
this._prime = BN.mont(this.__prime);
this._primeLen = prime.length;
this._pub = undefined;
this._priv = undefined;
this._primeCode = undefined;
if (malleable) {
this.setPublicKey = setPublicKey;
this.setPrivateKey = setPrivateKey;
} else {
this._primeCode = 8;
}
}
Object.defineProperty(DH.prototype, 'verifyError', {
enumerable: true,
get: function () {
if (typeof this._primeCode !== 'number') {
this._primeCode = checkPrime(this.__prime, this.__gen);
}
return this._primeCode;
}
});
DH.prototype.generateKeys = function () {
if (!this._priv) {
this._priv = new BN(randomBytes(this._primeLen));
}
this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed();
return this.getPublicKey();
};
DH.prototype.computeSecret = function (other) {
other = new BN(other);
other = other.toRed(this._prime);
var secret = other.redPow(this._priv).fromRed();
var out = new Buffer(secret.toArray());
var prime = this.getPrime();
if (out.length < prime.length) {
var front = new Buffer(prime.length - out.length);
front.fill(0);
out = Buffer.concat([front, out]);
}
return out;
};
DH.prototype.getPublicKey = function getPublicKey(enc) {
return formatReturnValue(this._pub, enc);
};
DH.prototype.getPrivateKey = function getPrivateKey(enc) {
return formatReturnValue(this._priv, enc);
};
DH.prototype.getPrime = function (enc) {
return formatReturnValue(this.__prime, enc);
};
DH.prototype.getGenerator = function (enc) {
return formatReturnValue(this._gen, enc);
};
DH.prototype.setGenerator = function (gen, enc) {
enc = enc || 'utf8';
if (!Buffer.isBuffer(gen)) {
gen = new Buffer(gen, enc);
}
this.__gen = gen;
this._gen = new BN(gen);
return this;
};
function formatReturnValue(bn, enc) {
var buf = new Buffer(bn.toArray());
if (!enc) {
return buf;
} else {
return buf.toString(enc);
}
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ 81).Buffer))
/***/ }),
/***/ 17:
/*!*************************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _isNativeReflectConstruct() {
try {
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
} catch (t) {}
return (module.exports = _isNativeReflectConstruct = function _isNativeReflectConstruct() {
return !!t;
}, module.exports.__esModule = true, module.exports["default"] = module.exports)();
}
module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 170:
/*!*******************************************************!*\
!*** ./node_modules/browserify-sign/browser/index.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var createHash = __webpack_require__(/*! create-hash */ 85)
var stream = __webpack_require__(/*! readable-stream */ 89)
var inherits = __webpack_require__(/*! inherits */ 86)
var sign = __webpack_require__(/*! ./sign */ 171)
var verify = __webpack_require__(/*! ./verify */ 224)
var algorithms = __webpack_require__(/*! ./algorithms.json */ 124)
Object.keys(algorithms).forEach(function (key) {
algorithms[key].id = Buffer.from(algorithms[key].id, 'hex')
algorithms[key.toLowerCase()] = algorithms[key]
})
function Sign (algorithm) {
stream.Writable.call(this)
var data = algorithms[algorithm]
if (!data) throw new Error('Unknown message digest')
this._hashType = data.hash
this._hash = createHash(data.hash)
this._tag = data.id
this._signType = data.sign
}
inherits(Sign, stream.Writable)
Sign.prototype._write = function _write (data, _, done) {
this._hash.update(data)
done()
}
Sign.prototype.update = function update (data, enc) {
if (typeof data === 'string') data = Buffer.from(data, enc)
this._hash.update(data)
return this
}
Sign.prototype.sign = function signMethod (key, enc) {
this.end()
var hash = this._hash.digest()
var sig = sign(hash, key, this._hashType, this._signType, this._tag)
return enc ? sig.toString(enc) : sig
}
function Verify (algorithm) {
stream.Writable.call(this)
var data = algorithms[algorithm]
if (!data) throw new Error('Unknown message digest')
this._hash = createHash(data.hash)
this._tag = data.id
this._signType = data.sign
}
inherits(Verify, stream.Writable)
Verify.prototype._write = function _write (data, _, done) {
this._hash.update(data)
done()
}
Verify.prototype.update = function update (data, enc) {
if (typeof data === 'string') data = Buffer.from(data, enc)
this._hash.update(data)
return this
}
Verify.prototype.verify = function verifyMethod (key, sig, enc) {
if (typeof sig === 'string') sig = Buffer.from(sig, enc)
this.end()
var hash = this._hash.digest()
return verify(sig, hash, key, this._signType, this._tag)
}
function createSign (algorithm) {
return new Sign(algorithm)
}
function createVerify (algorithm) {
return new Verify(algorithm)
}
module.exports = {
Sign: createSign,
Verify: createVerify,
createSign: createSign,
createVerify: createVerify
}
/***/ }),
/***/ 171:
/*!******************************************************!*\
!*** ./node_modules/browserify-sign/browser/sign.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var createHmac = __webpack_require__(/*! create-hmac */ 120)
var crt = __webpack_require__(/*! browserify-rsa */ 172)
var EC = __webpack_require__(/*! elliptic */ 173).ec
var BN = __webpack_require__(/*! bn.js */ 162)
var parseKeys = __webpack_require__(/*! parse-asn1 */ 203)
var curves = __webpack_require__(/*! ./curves.json */ 223)
function sign (hash, key, hashType, signType, tag) {
var priv = parseKeys(key)
if (priv.curve) {
// rsa keys can be interpreted as ecdsa ones in openssl
if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')
return ecSign(hash, priv)
} else if (priv.type === 'dsa') {
if (signType !== 'dsa') throw new Error('wrong private key type')
return dsaSign(hash, priv, hashType)
} else {
if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')
}
hash = Buffer.concat([tag, hash])
var len = priv.modulus.byteLength()
var pad = [0, 1]
while (hash.length + pad.length + 1 < len) pad.push(0xff)
pad.push(0x00)
var i = -1
while (++i < hash.length) pad.push(hash[i])
var out = crt(pad, priv)
return out
}
function ecSign (hash, priv) {
var curveId = curves[priv.curve.join('.')]
if (!curveId) throw new Error('unknown curve ' + priv.curve.join('.'))
var curve = new EC(curveId)
var key = curve.keyFromPrivate(priv.privateKey)
var out = key.sign(hash)
return Buffer.from(out.toDER())
}
function dsaSign (hash, priv, algo) {
var x = priv.params.priv_key
var p = priv.params.p
var q = priv.params.q
var g = priv.params.g
var r = new BN(0)
var k
var H = bits2int(hash, q).mod(q)
var s = false
var kv = getKey(x, q, hash, algo)
while (s === false) {
k = makeKey(q, kv, algo)
r = makeR(g, k, p, q)
s = k.invm(q).imul(H.add(x.mul(r))).mod(q)
if (s.cmpn(0) === 0) {
s = false
r = new BN(0)
}
}
return toDER(r, s)
}
function toDER (r, s) {
r = r.toArray()
s = s.toArray()
// Pad values
if (r[0] & 0x80) r = [0].concat(r)
if (s[0] & 0x80) s = [0].concat(s)
var total = r.length + s.length + 4
var res = [0x30, total, 0x02, r.length]
res = res.concat(r, [0x02, s.length], s)
return Buffer.from(res)
}
function getKey (x, q, hash, algo) {
x = Buffer.from(x.toArray())
if (x.length < q.byteLength()) {
var zeros = Buffer.alloc(q.byteLength() - x.length)
x = Buffer.concat([zeros, x])
}
var hlen = hash.length
var hbits = bits2octets(hash, q)
var v = Buffer.alloc(hlen)
v.fill(1)
var k = Buffer.alloc(hlen)
k = createHmac(algo, k).update(v).update(Buffer.from([0])).update(x).update(hbits).digest()
v = createHmac(algo, k).update(v).digest()
k = createHmac(algo, k).update(v).update(Buffer.from([1])).update(x).update(hbits).digest()
v = createHmac(algo, k).update(v).digest()
return { k: k, v: v }
}
function bits2int (obits, q) {
var bits = new BN(obits)
var shift = (obits.length << 3) - q.bitLength()
if (shift > 0) bits.ishrn(shift)
return bits
}
function bits2octets (bits, q) {
bits = bits2int(bits, q)
bits = bits.mod(q)
var out = Buffer.from(bits.toArray())
if (out.length < q.byteLength()) {
var zeros = Buffer.alloc(q.byteLength() - out.length)
out = Buffer.concat([zeros, out])
}
return out
}
function makeKey (q, kv, algo) {
var t
var k
do {
t = Buffer.alloc(0)
while (t.length * 8 < q.bitLength()) {
kv.v = createHmac(algo, kv.k).update(kv.v).digest()
t = Buffer.concat([t, kv.v])
}
k = bits2int(t, q)
kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer.from([0])).digest()
kv.v = createHmac(algo, kv.k).update(kv.v).digest()
} while (k.cmp(q) !== -1)
return k
}
function makeR (g, k, p, q) {
return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q)
}
module.exports = sign
module.exports.getKey = getKey
module.exports.makeKey = makeKey
/***/ }),
/***/ 172:
/*!**********************************************!*\
!*** ./node_modules/browserify-rsa/index.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(Buffer) {var BN = __webpack_require__(/*! bn.js */ 162)
var randomBytes = __webpack_require__(/*! randombytes */ 77)
function blind (priv) {
var r = getr(priv)
var blinder = r.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed()
return { blinder: blinder, unblinder: r.invm(priv.modulus) }
}
function getr (priv) {
var len = priv.modulus.byteLength()
var r
do {
r = new BN(randomBytes(len))
} while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2))
return r
}
function crt (msg, priv) {
var blinds = blind(priv)
var len = priv.modulus.byteLength()
var blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus)
var c1 = blinded.toRed(BN.mont(priv.prime1))
var c2 = blinded.toRed(BN.mont(priv.prime2))
var qinv = priv.coefficient
var p = priv.prime1
var q = priv.prime2
var m1 = c1.redPow(priv.exponent1).fromRed()
var m2 = c2.redPow(priv.exponent2).fromRed()
var h = m1.isub(m2).imul(qinv).umod(p).imul(q)
return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer, 'be', len)
}
crt.getr = getr
module.exports = crt
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 81).Buffer))
/***/ }),
/***/ 173:
/*!***********************************************!*\
!*** ./node_modules/elliptic/lib/elliptic.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var elliptic = exports;
elliptic.version = __webpack_require__(/*! ../package.json */ 174).version;
elliptic.utils = __webpack_require__(/*! ./elliptic/utils */ 175);
elliptic.rand = __webpack_require__(/*! brorand */ 166);
elliptic.curve = __webpack_require__(/*! ./elliptic/curve */ 177);
elliptic.curves = __webpack_require__(/*! ./elliptic/curves */ 182);
// Protocols
elliptic.ec = __webpack_require__(/*! ./elliptic/ec */ 196);
elliptic.eddsa = __webpack_require__(/*! ./elliptic/eddsa */ 200);
/***/ }),
/***/ 174:
/*!********************************************!*\
!*** ./node_modules/elliptic/package.json ***!
\********************************************/
/*! exports provided: name, version, description, main, files, scripts, repository, keywords, author, license, bugs, homepage, devDependencies, dependencies, default */
/***/ (function(module) {
module.exports = JSON.parse("{\"name\":\"elliptic\",\"version\":\"6.5.4\",\"description\":\"EC cryptography\",\"main\":\"lib/elliptic.js\",\"files\":[\"lib\"],\"scripts\":{\"lint\":\"eslint lib test\",\"lint:fix\":\"npm run lint -- --fix\",\"unit\":\"istanbul test _mocha --reporter=spec test/index.js\",\"test\":\"npm run lint && npm run unit\",\"version\":\"grunt dist && git add dist/\"},\"repository\":{\"type\":\"git\",\"url\":\"git@github.com:indutny/elliptic\"},\"keywords\":[\"EC\",\"Elliptic\",\"curve\",\"Cryptography\"],\"author\":\"Fedor Indutny \",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/indutny/elliptic/issues\"},\"homepage\":\"https://github.com/indutny/elliptic\",\"devDependencies\":{\"brfs\":\"^2.0.2\",\"coveralls\":\"^3.1.0\",\"eslint\":\"^7.6.0\",\"grunt\":\"^1.2.1\",\"grunt-browserify\":\"^5.3.0\",\"grunt-cli\":\"^1.3.2\",\"grunt-contrib-connect\":\"^3.0.0\",\"grunt-contrib-copy\":\"^1.0.0\",\"grunt-contrib-uglify\":\"^5.0.0\",\"grunt-mocha-istanbul\":\"^5.0.2\",\"grunt-saucelabs\":\"^9.0.1\",\"istanbul\":\"^0.4.5\",\"mocha\":\"^8.0.1\"},\"dependencies\":{\"bn.js\":\"^4.11.9\",\"brorand\":\"^1.1.0\",\"hash.js\":\"^1.0.0\",\"hmac-drbg\":\"^1.0.1\",\"inherits\":\"^2.0.4\",\"minimalistic-assert\":\"^1.0.1\",\"minimalistic-crypto-utils\":\"^1.0.1\"}}");
/***/ }),
/***/ 175:
/*!*****************************************************!*\
!*** ./node_modules/elliptic/lib/elliptic/utils.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = exports;
var BN = __webpack_require__(/*! bn.js */ 162);
var minAssert = __webpack_require__(/*! minimalistic-assert */ 136);
var minUtils = __webpack_require__(/*! minimalistic-crypto-utils */ 176);
utils.assert = minAssert;
utils.toArray = minUtils.toArray;
utils.zero2 = minUtils.zero2;
utils.toHex = minUtils.toHex;
utils.encode = minUtils.encode;
// Represent num in a w-NAF form
function getNAF(num, w, bits) {
var naf = new Array(Math.max(num.bitLength(), bits) + 1);
naf.fill(0);
var ws = 1 << (w + 1);
var k = num.clone();
for (var i = 0; i < naf.length; i++) {
var z;
var mod = k.andln(ws - 1);
if (k.isOdd()) {
if (mod > (ws >> 1) - 1)
z = (ws >> 1) - mod;
else
z = mod;
k.isubn(z);
} else {
z = 0;
}
naf[i] = z;
k.iushrn(1);
}
return naf;
}
utils.getNAF = getNAF;
// Represent k1, k2 in a Joint Sparse Form
function getJSF(k1, k2) {
var jsf = [
[],
[],
];
k1 = k1.clone();
k2 = k2.clone();
var d1 = 0;
var d2 = 0;
var m8;
while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {
// First phase
var m14 = (k1.andln(3) + d1) & 3;
var m24 = (k2.andln(3) + d2) & 3;
if (m14 === 3)
m14 = -1;
if (m24 === 3)
m24 = -1;
var u1;
if ((m14 & 1) === 0) {
u1 = 0;
} else {
m8 = (k1.andln(7) + d1) & 7;
if ((m8 === 3 || m8 === 5) && m24 === 2)
u1 = -m14;
else
u1 = m14;
}
jsf[0].push(u1);
var u2;
if ((m24 & 1) === 0) {
u2 = 0;
} else {
m8 = (k2.andln(7) + d2) & 7;
if ((m8 === 3 || m8 === 5) && m14 === 2)
u2 = -m24;
else
u2 = m24;
}
jsf[1].push(u2);
// Second phase
if (2 * d1 === u1 + 1)
d1 = 1 - d1;
if (2 * d2 === u2 + 1)
d2 = 1 - d2;
k1.iushrn(1);
k2.iushrn(1);
}
return jsf;
}
utils.getJSF = getJSF;
function cachedProperty(obj, name, computer) {
var key = '_' + name;
obj.prototype[name] = function cachedProperty() {
return this[key] !== undefined ? this[key] :
this[key] = computer.call(this);
};
}
utils.cachedProperty = cachedProperty;
function parseBytes(bytes) {
return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') :
bytes;
}
utils.parseBytes = parseBytes;
function intFromLE(bytes) {
return new BN(bytes, 'hex', 'le');
}
utils.intFromLE = intFromLE;
/***/ }),
/***/ 176:
/*!*************************************************************!*\
!*** ./node_modules/minimalistic-crypto-utils/lib/utils.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = exports;
function toArray(msg, enc) {
if (Array.isArray(msg))
return msg.slice();
if (!msg)
return [];
var res = [];
if (typeof msg !== 'string') {
for (var i = 0; i < msg.length; i++)
res[i] = msg[i] | 0;
return res;
}
if (enc === 'hex') {
msg = msg.replace(/[^a-z0-9]+/ig, '');
if (msg.length % 2 !== 0)
msg = '0' + msg;
for (var i = 0; i < msg.length; i += 2)
res.push(parseInt(msg[i] + msg[i + 1], 16));
} else {
for (var i = 0; i < msg.length; i++) {
var c = msg.charCodeAt(i);
var hi = c >> 8;
var lo = c & 0xff;
if (hi)
res.push(hi, lo);
else
res.push(lo);
}
}
return res;
}
utils.toArray = toArray;
function zero2(word) {
if (word.length === 1)
return '0' + word;
else
return word;
}
utils.zero2 = zero2;
function toHex(msg) {
var res = '';
for (var i = 0; i < msg.length; i++)
res += zero2(msg[i].toString(16));
return res;
}
utils.toHex = toHex;
utils.encode = function encode(arr, enc) {
if (enc === 'hex')
return toHex(arr);
else
return arr;
};
/***/ }),
/***/ 177:
/*!***********************************************************!*\
!*** ./node_modules/elliptic/lib/elliptic/curve/index.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var curve = exports;
curve.base = __webpack_require__(/*! ./base */ 178);
curve.short = __webpack_require__(/*! ./short */ 179);
curve.mont = __webpack_require__(/*! ./mont */ 180);
curve.edwards = __webpack_require__(/*! ./edwards */ 181);
/***/ }),
/***/ 178:
/*!**********************************************************!*\
!*** ./node_modules/elliptic/lib/elliptic/curve/base.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var BN = __webpack_require__(/*! bn.js */ 162);
var utils = __webpack_require__(/*! ../utils */ 175);
var getNAF = utils.getNAF;
var getJSF = utils.getJSF;
var assert = utils.assert;
function BaseCurve(type, conf) {
this.type = type;
this.p = new BN(conf.p, 16);
// Use Montgomery, when there is no fast reduction for the prime
this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);
// Useful for many curves
this.zero = new BN(0).toRed(this.red);
this.one = new BN(1).toRed(this.red);
this.two = new BN(2).toRed(this.red);
// Curve configuration, optional
this.n = conf.n && new BN(conf.n, 16);
this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);
// Temporary arrays
this._wnafT1 = new Array(4);
this._wnafT2 = new Array(4);
this._wnafT3 = new Array(4);
this._wnafT4 = new Array(4);
this._bitLength = this.n ? this.n.bitLength() : 0;
// Generalized Greg Maxwell's trick
var adjustCount = this.n && this.p.div(this.n);
if (!adjustCount || adjustCount.cmpn(100) > 0) {
this.redN = null;
} else {
this._maxwellTrick = true;
this.redN = this.n.toRed(this.red);
}
}
module.exports = BaseCurve;
BaseCurve.prototype.point = function point() {
throw new Error('Not implemented');
};
BaseCurve.prototype.validate = function validate() {
throw new Error('Not implemented');
};
BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {
assert(p.precomputed);
var doubles = p._getDoubles();
var naf = getNAF(k, 1, this._bitLength);
var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);
I /= 3;
// Translate into more windowed form
var repr = [];
var j;
var nafW;
for (j = 0; j < naf.length; j += doubles.step) {
nafW = 0;
for (var l = j + doubles.step - 1; l >= j; l--)
nafW = (nafW << 1) + naf[l];
repr.push(nafW);
}
var a = this.jpoint(null, null, null);
var b = this.jpoint(null, null, null);
for (var i = I; i > 0; i--) {
for (j = 0; j < repr.length; j++) {
nafW = repr[j];
if (nafW === i)
b = b.mixedAdd(doubles.points[j]);
else if (nafW === -i)
b = b.mixedAdd(doubles.points[j].neg());
}
a = a.add(b);
}
return a.toP();
};
BaseCurve.prototype._wnafMul = function _wnafMul(p, k) {
var w = 4;
// Precompute window
var nafPoints = p._getNAFPoints(w);
w = nafPoints.wnd;
var wnd = nafPoints.points;
// Get NAF form
var naf = getNAF(k, w, this._bitLength);
// Add `this`*(N+1) for every w-NAF index
var acc = this.jpoint(null, null, null);
for (var i = naf.length - 1; i >= 0; i--) {
// Count zeroes
for (var l = 0; i >= 0 && naf[i] === 0; i--)
l++;
if (i >= 0)
l++;
acc = acc.dblp(l);
if (i < 0)
break;
var z = naf[i];
assert(z !== 0);
if (p.type === 'affine') {
// J +- P
if (z > 0)
acc = acc.mixedAdd(wnd[(z - 1) >> 1]);
else
acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());
} else {
// J +- J
if (z > 0)
acc = acc.add(wnd[(z - 1) >> 1]);
else
acc = acc.add(wnd[(-z - 1) >> 1].neg());
}
}
return p.type === 'affine' ? acc.toP() : acc;
};
BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,
points,
coeffs,
len,
jacobianResult) {
var wndWidth = this._wnafT1;
var wnd = this._wnafT2;
var naf = this._wnafT3;
// Fill all arrays
var max = 0;
var i;
var j;
var p;
for (i = 0; i < len; i++) {
p = points[i];
var nafPoints = p._getNAFPoints(defW);
wndWidth[i] = nafPoints.wnd;
wnd[i] = nafPoints.points;
}
// Comb small window NAFs
for (i = len - 1; i >= 1; i -= 2) {
var a = i - 1;
var b = i;
if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {
naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength);
naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength);
max = Math.max(naf[a].length, max);
max = Math.max(naf[b].length, max);
continue;
}
var comb = [
points[a], /* 1 */
null, /* 3 */
null, /* 5 */
points[b], /* 7 */
];
// Try to avoid Projective points, if possible
if (points[a].y.cmp(points[b].y) === 0) {
comb[1] = points[a].add(points[b]);
comb[2] = points[a].toJ().mixedAdd(points[b].neg());
} else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {
comb[1] = points[a].toJ().mixedAdd(points[b]);
comb[2] = points[a].add(points[b].neg());
} else {
comb[1] = points[a].toJ().mixedAdd(points[b]);
comb[2] = points[a].toJ().mixedAdd(points[b].neg());
}
var index = [
-3, /* -1 -1 */
-1, /* -1 0 */
-5, /* -1 1 */
-7, /* 0 -1 */
0, /* 0 0 */
7, /* 0 1 */
5, /* 1 -1 */
1, /* 1 0 */
3, /* 1 1 */
];
var jsf = getJSF(coeffs[a], coeffs[b]);
max = Math.max(jsf[0].length, max);
naf[a] = new Array(max);
naf[b] = new Array(max);
for (j = 0; j < max; j++) {
var ja = jsf[0][j] | 0;
var jb = jsf[1][j] | 0;
naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];
naf[b][j] = 0;
wnd[a] = comb;
}
}
var acc = this.jpoint(null, null, null);
var tmp = this._wnafT4;
for (i = max; i >= 0; i--) {
var k = 0;
while (i >= 0) {
var zero = true;
for (j = 0; j < len; j++) {
tmp[j] = naf[j][i] | 0;
if (tmp[j] !== 0)
zero = false;
}
if (!zero)
break;
k++;
i--;
}
if (i >= 0)
k++;
acc = acc.dblp(k);
if (i < 0)
break;
for (j = 0; j < len; j++) {
var z = tmp[j];
p;
if (z === 0)
continue;
else if (z > 0)
p = wnd[j][(z - 1) >> 1];
else if (z < 0)
p = wnd[j][(-z - 1) >> 1].neg();
if (p.type === 'affine')
acc = acc.mixedAdd(p);
else
acc = acc.add(p);
}
}
// Zeroify references
for (i = 0; i < len; i++)
wnd[i] = null;
if (jacobianResult)
return acc;
else
return acc.toP();
};
function BasePoint(curve, type) {
this.curve = curve;
this.type = type;
this.precomputed = null;
}
BaseCurve.BasePoint = BasePoint;
BasePoint.prototype.eq = function eq(/*other*/) {
throw new Error('Not implemented');
};
BasePoint.prototype.validate = function validate() {
return this.curve.validate(this);
};
BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
bytes = utils.toArray(bytes, enc);
var len = this.p.byteLength();
// uncompressed, hybrid-odd, hybrid-even
if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&
bytes.length - 1 === 2 * len) {
if (bytes[0] === 0x06)
assert(bytes[bytes.length - 1] % 2 === 0);
else if (bytes[0] === 0x07)
assert(bytes[bytes.length - 1] % 2 === 1);
var res = this.point(bytes.slice(1, 1 + len),
bytes.slice(1 + len, 1 + 2 * len));
return res;
} else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&
bytes.length - 1 === len) {
return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);
}
throw new Error('Unknown point format');
};
BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {
return this.encode(enc, true);
};
BasePoint.prototype._encode = function _encode(compact) {
var len = this.curve.p.byteLength();
var x = this.getX().toArray('be', len);
if (compact)
return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);
return [ 0x04 ].concat(x, this.getY().toArray('be', len));
};
BasePoint.prototype.encode = function encode(enc, compact) {
return utils.encode(this._encode(compact), enc);
};
BasePoint.prototype.precompute = function precompute(power) {
if (this.precomputed)
return this;
var precomputed = {
doubles: null,
naf: null,
beta: null,
};
precomputed.naf = this._getNAFPoints(8);
precomputed.doubles = this._getDoubles(4, power);
precomputed.beta = this._getBeta();
this.precomputed = precomputed;
return this;
};
BasePoint.prototype._hasDoubles = function _hasDoubles(k) {
if (!this.precomputed)
return false;
var doubles = this.precomputed.doubles;
if (!doubles)
return false;
return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);
};
BasePoint.prototype._getDoubles = function _getDoubles(step, power) {
if (this.precomputed && this.precomputed.doubles)
return this.precomputed.doubles;
var doubles = [ this ];
var acc = this;
for (var i = 0; i < power; i += step) {
for (var j = 0; j < step; j++)
acc = acc.dbl();
doubles.push(acc);
}
return {
step: step,
points: doubles,
};
};
BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {
if (this.precomputed && this.precomputed.naf)
return this.precomputed.naf;
var res = [ this ];
var max = (1 << wnd) - 1;
var dbl = max === 1 ? null : this.dbl();
for (var i = 1; i < max; i++)
res[i] = res[i - 1].add(dbl);
return {
wnd: wnd,
points: res,
};
};
BasePoint.prototype._getBeta = function _getBeta() {
return null;
};
BasePoint.prototype.dblp = function dblp(k) {
var r = this;
for (var i = 0; i < k; i++)
r = r.dbl();
return r;
};
/***/ }),
/***/ 179:
/*!***********************************************************!*\
!*** ./node_modules/elliptic/lib/elliptic/curve/short.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__(/*! ../utils */ 175);
var BN = __webpack_require__(/*! bn.js */ 162);
var inherits = __webpack_require__(/*! inherits */ 86);
var Base = __webpack_require__(/*! ./base */ 178);
var assert = utils.assert;
function ShortCurve(conf) {
Base.call(this, 'short', conf);
this.a = new BN(conf.a, 16).toRed(this.red);
this.b = new BN(conf.b, 16).toRed(this.red);
this.tinv = this.two.redInvm();
this.zeroA = this.a.fromRed().cmpn(0) === 0;
this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;
// If the curve is endomorphic, precalculate beta and lambda
this.endo = this._getEndomorphism(conf);
this._endoWnafT1 = new Array(4);
this._endoWnafT2 = new Array(4);
}
inherits(ShortCurve, Base);
module.exports = ShortCurve;
ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {
// No efficient endomorphism
if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)
return;
// Compute beta and lambda, that lambda * P = (beta * Px; Py)
var beta;
var lambda;
if (conf.beta) {
beta = new BN(conf.beta, 16).toRed(this.red);
} else {
var betas = this._getEndoRoots(this.p);
// Choose the smallest beta
beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];
beta = beta.toRed(this.red);
}
if (conf.lambda) {
lambda = new BN(conf.lambda, 16);
} else {
// Choose the lambda that is matching selected beta
var lambdas = this._getEndoRoots(this.n);
if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {
lambda = lambdas[0];
} else {
lambda = lambdas[1];
assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);
}
}
// Get basis vectors, used for balanced length-two representation
var basis;
if (conf.basis) {
basis = conf.basis.map(function(vec) {
return {
a: new BN(vec.a, 16),
b: new BN(vec.b, 16),
};
});
} else {
basis = this._getEndoBasis(lambda);
}
return {
beta: beta,
lambda: lambda,
basis: basis,
};
};
ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {
// Find roots of for x^2 + x + 1 in F
// Root = (-1 +- Sqrt(-3)) / 2
//
var red = num === this.p ? this.red : BN.mont(num);
var tinv = new BN(2).toRed(red).redInvm();
var ntinv = tinv.redNeg();
var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);
var l1 = ntinv.redAdd(s).fromRed();
var l2 = ntinv.redSub(s).fromRed();
return [ l1, l2 ];
};
ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {
// aprxSqrt >= sqrt(this.n)
var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));
// 3.74
// Run EGCD, until r(L + 1) < aprxSqrt
var u = lambda;
var v = this.n.clone();
var x1 = new BN(1);
var y1 = new BN(0);
var x2 = new BN(0);
var y2 = new BN(1);
// NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)
var a0;
var b0;
// First vector
var a1;
var b1;
// Second vector
var a2;
var b2;
var prevR;
var i = 0;
var r;
var x;
while (u.cmpn(0) !== 0) {
var q = v.div(u);
r = v.sub(q.mul(u));
x = x2.sub(q.mul(x1));
var y = y2.sub(q.mul(y1));
if (!a1 && r.cmp(aprxSqrt) < 0) {
a0 = prevR.neg();
b0 = x1;
a1 = r.neg();
b1 = x;
} else if (a1 && ++i === 2) {
break;
}
prevR = r;
v = u;
u = r;
x2 = x1;
x1 = x;
y2 = y1;
y1 = y;
}
a2 = r.neg();
b2 = x;
var len1 = a1.sqr().add(b1.sqr());
var len2 = a2.sqr().add(b2.sqr());
if (len2.cmp(len1) >= 0) {
a2 = a0;
b2 = b0;
}
// Normalize signs
if (a1.negative) {
a1 = a1.neg();
b1 = b1.neg();
}
if (a2.negative) {
a2 = a2.neg();
b2 = b2.neg();
}
return [
{ a: a1, b: b1 },
{ a: a2, b: b2 },
];
};
ShortCurve.prototype._endoSplit = function _endoSplit(k) {
var basis = this.endo.basis;
var v1 = basis[0];
var v2 = basis[1];
var c1 = v2.b.mul(k).divRound(this.n);
var c2 = v1.b.neg().mul(k).divRound(this.n);
var p1 = c1.mul(v1.a);
var p2 = c2.mul(v2.a);
var q1 = c1.mul(v1.b);
var q2 = c2.mul(v2.b);
// Calculate answer
var k1 = k.sub(p1).sub(p2);
var k2 = q1.add(q2).neg();
return { k1: k1, k2: k2 };
};
ShortCurve.prototype.pointFromX = function pointFromX(x, odd) {
x = new BN(x, 16);
if (!x.red)
x = x.toRed(this.red);
var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);
var y = y2.redSqrt();
if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
throw new Error('invalid point');
// XXX Is there any way to tell if the number is odd without converting it
// to non-red form?
var isOdd = y.fromRed().isOdd();
if (odd && !isOdd || !odd && isOdd)
y = y.redNeg();
return this.point(x, y);
};
ShortCurve.prototype.validate = function validate(point) {
if (point.inf)
return true;
var x = point.x;
var y = point.y;
var ax = this.a.redMul(x);
var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);
return y.redSqr().redISub(rhs).cmpn(0) === 0;
};
ShortCurve.prototype._endoWnafMulAdd =
function _endoWnafMulAdd(points, coeffs, jacobianResult) {
var npoints = this._endoWnafT1;
var ncoeffs = this._endoWnafT2;
for (var i = 0; i < points.length; i++) {
var split = this._endoSplit(coeffs[i]);
var p = points[i];
var beta = p._getBeta();
if (split.k1.negative) {
split.k1.ineg();
p = p.neg(true);
}
if (split.k2.negative) {
split.k2.ineg();
beta = beta.neg(true);
}
npoints[i * 2] = p;
npoints[i * 2 + 1] = beta;
ncoeffs[i * 2] = split.k1;
ncoeffs[i * 2 + 1] = split.k2;
}
var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);
// Clean-up references to points and coefficients
for (var j = 0; j < i * 2; j++) {
npoints[j] = null;
ncoeffs[j] = null;
}
return res;
};
function Point(curve, x, y, isRed) {
Base.BasePoint.call(this, curve, 'affine');
if (x === null && y === null) {
this.x = null;
this.y = null;
this.inf = true;
} else {
this.x = new BN(x, 16);
this.y = new BN(y, 16);
// Force redgomery representation when loading from JSON
if (isRed) {
this.x.forceRed(this.curve.red);
this.y.forceRed(this.curve.red);
}
if (!this.x.red)
this.x = this.x.toRed(this.curve.red);
if (!this.y.red)
this.y = this.y.toRed(this.curve.red);
this.inf = false;
}
}
inherits(Point, Base.BasePoint);
ShortCurve.prototype.point = function point(x, y, isRed) {
return new Point(this, x, y, isRed);
};
ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {
return Point.fromJSON(this, obj, red);
};
Point.prototype._getBeta = function _getBeta() {
if (!this.curve.endo)
return;
var pre = this.precomputed;
if (pre && pre.beta)
return pre.beta;
var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);
if (pre) {
var curve = this.curve;
var endoMul = function(p) {
return curve.point(p.x.redMul(curve.endo.beta), p.y);
};
pre.beta = beta;
beta.precomputed = {
beta: null,
naf: pre.naf && {
wnd: pre.naf.wnd,
points: pre.naf.points.map(endoMul),
},
doubles: pre.doubles && {
step: pre.doubles.step,
points: pre.doubles.points.map(endoMul),
},
};
}
return beta;
};
Point.prototype.toJSON = function toJSON() {
if (!this.precomputed)
return [ this.x, this.y ];
return [ this.x, this.y, this.precomputed && {
doubles: this.precomputed.doubles && {
step: this.precomputed.doubles.step,
points: this.precomputed.doubles.points.slice(1),
},
naf: this.precomputed.naf && {
wnd: this.precomputed.naf.wnd,
points: this.precomputed.naf.points.slice(1),
},
} ];
};
Point.fromJSON = function fromJSON(curve, obj, red) {
if (typeof obj === 'string')
obj = JSON.parse(obj);
var res = curve.point(obj[0], obj[1], red);
if (!obj[2])
return res;
function obj2point(obj) {
return curve.point(obj[0], obj[1], red);
}
var pre = obj[2];
res.precomputed = {
beta: null,
doubles: pre.doubles && {
step: pre.doubles.step,
points: [ res ].concat(pre.doubles.points.map(obj2point)),
},
naf: pre.naf && {
wnd: pre.naf.wnd,
points: [ res ].concat(pre.naf.points.map(obj2point)),
},
};
return res;
};
Point.prototype.inspect = function inspect() {
if (this.isInfinity())
return '';
return '';
};
Point.prototype.isInfinity = function isInfinity() {
return this.inf;
};
Point.prototype.add = function add(p) {
// O + P = P
if (this.inf)
return p;
// P + O = P
if (p.inf)
return this;
// P + P = 2P
if (this.eq(p))
return this.dbl();
// P + (-P) = O
if (this.neg().eq(p))
return this.curve.point(null, null);
// P + Q = O
if (this.x.cmp(p.x) === 0)
return this.curve.point(null, null);
var c = this.y.redSub(p.y);
if (c.cmpn(0) !== 0)
c = c.redMul(this.x.redSub(p.x).redInvm());
var nx = c.redSqr().redISub(this.x).redISub(p.x);
var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
return this.curve.point(nx, ny);
};
Point.prototype.dbl = function dbl() {
if (this.inf)
return this;
// 2P = O
var ys1 = this.y.redAdd(this.y);
if (ys1.cmpn(0) === 0)
return this.curve.point(null, null);
var a = this.curve.a;
var x2 = this.x.redSqr();
var dyinv = ys1.redInvm();
var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);
var nx = c.redSqr().redISub(this.x.redAdd(this.x));
var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
return this.curve.point(nx, ny);
};
Point.prototype.getX = function getX() {
return this.x.fromRed();
};
Point.prototype.getY = function getY() {
return this.y.fromRed();
};
Point.prototype.mul = function mul(k) {
k = new BN(k, 16);
if (this.isInfinity())
return this;
else if (this._hasDoubles(k))
return this.curve._fixedNafMul(this, k);
else if (this.curve.endo)
return this.curve._endoWnafMulAdd([ this ], [ k ]);
else
return this.curve._wnafMul(this, k);
};
Point.prototype.mulAdd = function mulAdd(k1, p2, k2) {
var points = [ this, p2 ];
var coeffs = [ k1, k2 ];
if (this.curve.endo)
return this.curve._endoWnafMulAdd(points, coeffs);
else
return this.curve._wnafMulAdd(1, points, coeffs, 2);
};
Point.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {
var points = [ this, p2 ];
var coeffs = [ k1, k2 ];
if (this.curve.endo)
return this.curve._endoWnafMulAdd(points, coeffs, true);
else
return this.curve._wnafMulAdd(1, points, coeffs, 2, true);
};
Point.prototype.eq = function eq(p) {
return this === p ||
this.inf === p.inf &&
(this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);
};
Point.prototype.neg = function neg(_precompute) {
if (this.inf)
return this;
var res = this.curve.point(this.x, this.y.redNeg());
if (_precompute && this.precomputed) {
var pre = this.precomputed;
var negate = function(p) {
return p.neg();
};
res.precomputed = {
naf: pre.naf && {
wnd: pre.naf.wnd,
points: pre.naf.points.map(negate),
},
doubles: pre.doubles && {
step: pre.doubles.step,
points: pre.doubles.points.map(negate),
},
};
}
return res;
};
Point.prototype.toJ = function toJ() {
if (this.inf)
return this.curve.jpoint(null, null, null);
var res = this.curve.jpoint(this.x, this.y, this.curve.one);
return res;
};
function JPoint(curve, x, y, z) {
Base.BasePoint.call(this, curve, 'jacobian');
if (x === null && y === null && z === null) {
this.x = this.curve.one;
this.y = this.curve.one;
this.z = new BN(0);
} else {
this.x = new BN(x, 16);
this.y = new BN(y, 16);
this.z = new BN(z, 16);
}
if (!this.x.red)
this.x = this.x.toRed(this.curve.red);
if (!this.y.red)
this.y = this.y.toRed(this.curve.red);
if (!this.z.red)
this.z = this.z.toRed(this.curve.red);
this.zOne = this.z === this.curve.one;
}
inherits(JPoint, Base.BasePoint);
ShortCurve.prototype.jpoint = function jpoint(x, y, z) {
return new JPoint(this, x, y, z);
};
JPoint.prototype.toP = function toP() {
if (this.isInfinity())
return this.curve.point(null, null);
var zinv = this.z.redInvm();
var zinv2 = zinv.redSqr();
var ax = this.x.redMul(zinv2);
var ay = this.y.redMul(zinv2).redMul(zinv);
return this.curve.point(ax, ay);
};
JPoint.prototype.neg = function neg() {
return this.curve.jpoint(this.x, this.y.redNeg(), this.z);
};
JPoint.prototype.add = function add(p) {
// O + P = P
if (this.isInfinity())
return p;
// P + O = P
if (p.isInfinity())
return this;
// 12M + 4S + 7A
var pz2 = p.z.redSqr();
var z2 = this.z.redSqr();
var u1 = this.x.redMul(pz2);
var u2 = p.x.redMul(z2);
var s1 = this.y.redMul(pz2.redMul(p.z));
var s2 = p.y.redMul(z2.redMul(this.z));
var h = u1.redSub(u2);
var r = s1.redSub(s2);
if (h.cmpn(0) === 0) {
if (r.cmpn(0) !== 0)
return this.curve.jpoint(null, null, null);
else
return this.dbl();
}
var h2 = h.redSqr();
var h3 = h2.redMul(h);
var v = u1.redMul(h2);
var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
var nz = this.z.redMul(p.z).redMul(h);
return this.curve.jpoint(nx, ny, nz);
};
JPoint.prototype.mixedAdd = function mixedAdd(p) {
// O + P = P
if (this.isInfinity())
return p.toJ();
// P + O = P
if (p.isInfinity())
return this;
// 8M + 3S + 7A
var z2 = this.z.redSqr();
var u1 = this.x;
var u2 = p.x.redMul(z2);
var s1 = this.y;
var s2 = p.y.redMul(z2).redMul(this.z);
var h = u1.redSub(u2);
var r = s1.redSub(s2);
if (h.cmpn(0) === 0) {
if (r.cmpn(0) !== 0)
return this.curve.jpoint(null, null, null);
else
return this.dbl();
}
var h2 = h.redSqr();
var h3 = h2.redMul(h);
var v = u1.redMul(h2);
var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
var nz = this.z.redMul(h);
return this.curve.jpoint(nx, ny, nz);
};
JPoint.prototype.dblp = function dblp(pow) {
if (pow === 0)
return this;
if (this.isInfinity())
return this;
if (!pow)
return this.dbl();
var i;
if (this.curve.zeroA || this.curve.threeA) {
var r = this;
for (i = 0; i < pow; i++)
r = r.dbl();
return r;
}
// 1M + 2S + 1A + N * (4S + 5M + 8A)
// N = 1 => 6M + 6S + 9A
var a = this.curve.a;
var tinv = this.curve.tinv;
var jx = this.x;
var jy = this.y;
var jz = this.z;
var jz4 = jz.redSqr().redSqr();
// Reuse results
var jyd = jy.redAdd(jy);
for (i = 0; i < pow; i++) {
var jx2 = jx.redSqr();
var jyd2 = jyd.redSqr();
var jyd4 = jyd2.redSqr();
var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
var t1 = jx.redMul(jyd2);
var nx = c.redSqr().redISub(t1.redAdd(t1));
var t2 = t1.redISub(nx);
var dny = c.redMul(t2);
dny = dny.redIAdd(dny).redISub(jyd4);
var nz = jyd.redMul(jz);
if (i + 1 < pow)
jz4 = jz4.redMul(jyd4);
jx = nx;
jz = nz;
jyd = dny;
}
return this.curve.jpoint(jx, jyd.redMul(tinv), jz);
};
JPoint.prototype.dbl = function dbl() {
if (this.isInfinity())
return this;
if (this.curve.zeroA)
return this._zeroDbl();
else if (this.curve.threeA)
return this._threeDbl();
else
return this._dbl();
};
JPoint.prototype._zeroDbl = function _zeroDbl() {
var nx;
var ny;
var nz;
// Z = 1
if (this.zOne) {
// hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html
// #doubling-mdbl-2007-bl
// 1M + 5S + 14A
// XX = X1^2
var xx = this.x.redSqr();
// YY = Y1^2
var yy = this.y.redSqr();
// YYYY = YY^2
var yyyy = yy.redSqr();
// S = 2 * ((X1 + YY)^2 - XX - YYYY)
var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
s = s.redIAdd(s);
// M = 3 * XX + a; a = 0
var m = xx.redAdd(xx).redIAdd(xx);
// T = M ^ 2 - 2*S
var t = m.redSqr().redISub(s).redISub(s);
// 8 * YYYY
var yyyy8 = yyyy.redIAdd(yyyy);
yyyy8 = yyyy8.redIAdd(yyyy8);
yyyy8 = yyyy8.redIAdd(yyyy8);
// X3 = T
nx = t;
// Y3 = M * (S - T) - 8 * YYYY
ny = m.redMul(s.redISub(t)).redISub(yyyy8);
// Z3 = 2*Y1
nz = this.y.redAdd(this.y);
} else {
// hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html
// #doubling-dbl-2009-l
// 2M + 5S + 13A
// A = X1^2
var a = this.x.redSqr();
// B = Y1^2
var b = this.y.redSqr();
// C = B^2
var c = b.redSqr();
// D = 2 * ((X1 + B)^2 - A - C)
var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);
d = d.redIAdd(d);
// E = 3 * A
var e = a.redAdd(a).redIAdd(a);
// F = E^2
var f = e.redSqr();
// 8 * C
var c8 = c.redIAdd(c);
c8 = c8.redIAdd(c8);
c8 = c8.redIAdd(c8);
// X3 = F - 2 * D
nx = f.redISub(d).redISub(d);
// Y3 = E * (D - X3) - 8 * C
ny = e.redMul(d.redISub(nx)).redISub(c8);
// Z3 = 2 * Y1 * Z1
nz = this.y.redMul(this.z);
nz = nz.redIAdd(nz);
}
return this.curve.jpoint(nx, ny, nz);
};
JPoint.prototype._threeDbl = function _threeDbl() {
var nx;
var ny;
var nz;
// Z = 1
if (this.zOne) {
// hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html
// #doubling-mdbl-2007-bl
// 1M + 5S + 15A
// XX = X1^2
var xx = this.x.redSqr();
// YY = Y1^2
var yy = this.y.redSqr();
// YYYY = YY^2
var yyyy = yy.redSqr();
// S = 2 * ((X1 + YY)^2 - XX - YYYY)
var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
s = s.redIAdd(s);
// M = 3 * XX + a
var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);
// T = M^2 - 2 * S
var t = m.redSqr().redISub(s).redISub(s);
// X3 = T
nx = t;
// Y3 = M * (S - T) - 8 * YYYY
var yyyy8 = yyyy.redIAdd(yyyy);
yyyy8 = yyyy8.redIAdd(yyyy8);
yyyy8 = yyyy8.redIAdd(yyyy8);
ny = m.redMul(s.redISub(t)).redISub(yyyy8);
// Z3 = 2 * Y1
nz = this.y.redAdd(this.y);
} else {
// hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b
// 3M + 5S
// delta = Z1^2
var delta = this.z.redSqr();
// gamma = Y1^2
var gamma = this.y.redSqr();
// beta = X1 * gamma
var beta = this.x.redMul(gamma);
// alpha = 3 * (X1 - delta) * (X1 + delta)
var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));
alpha = alpha.redAdd(alpha).redIAdd(alpha);
// X3 = alpha^2 - 8 * beta
var beta4 = beta.redIAdd(beta);
beta4 = beta4.redIAdd(beta4);
var beta8 = beta4.redAdd(beta4);
nx = alpha.redSqr().redISub(beta8);
// Z3 = (Y1 + Z1)^2 - gamma - delta
nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);
// Y3 = alpha * (4 * beta - X3) - 8 * gamma^2
var ggamma8 = gamma.redSqr();
ggamma8 = ggamma8.redIAdd(ggamma8);
ggamma8 = ggamma8.redIAdd(ggamma8);
ggamma8 = ggamma8.redIAdd(ggamma8);
ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);
}
return this.curve.jpoint(nx, ny, nz);
};
JPoint.prototype._dbl = function _dbl() {
var a = this.curve.a;
// 4M + 6S + 10A
var jx = this.x;
var jy = this.y;
var jz = this.z;
var jz4 = jz.redSqr().redSqr();
var jx2 = jx.redSqr();
var jy2 = jy.redSqr();
var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
var jxd4 = jx.redAdd(jx);
jxd4 = jxd4.redIAdd(jxd4);
var t1 = jxd4.redMul(jy2);
var nx = c.redSqr().redISub(t1.redAdd(t1));
var t2 = t1.redISub(nx);
var jyd8 = jy2.redSqr();
jyd8 = jyd8.redIAdd(jyd8);
jyd8 = jyd8.redIAdd(jyd8);
jyd8 = jyd8.redIAdd(jyd8);
var ny = c.redMul(t2).redISub(jyd8);
var nz = jy.redAdd(jy).redMul(jz);
return this.curve.jpoint(nx, ny, nz);
};
JPoint.prototype.trpl = function trpl() {
if (!this.curve.zeroA)
return this.dbl().add(this);
// hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl
// 5M + 10S + ...
// XX = X1^2
var xx = this.x.redSqr();
// YY = Y1^2
var yy = this.y.redSqr();
// ZZ = Z1^2
var zz = this.z.redSqr();
// YYYY = YY^2
var yyyy = yy.redSqr();
// M = 3 * XX + a * ZZ2; a = 0
var m = xx.redAdd(xx).redIAdd(xx);
// MM = M^2
var mm = m.redSqr();
// E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM
var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
e = e.redIAdd(e);
e = e.redAdd(e).redIAdd(e);
e = e.redISub(mm);
// EE = E^2
var ee = e.redSqr();
// T = 16*YYYY
var t = yyyy.redIAdd(yyyy);
t = t.redIAdd(t);
t = t.redIAdd(t);
t = t.redIAdd(t);
// U = (M + E)^2 - MM - EE - T
var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);
// X3 = 4 * (X1 * EE - 4 * YY * U)
var yyu4 = yy.redMul(u);
yyu4 = yyu4.redIAdd(yyu4);
yyu4 = yyu4.redIAdd(yyu4);
var nx = this.x.redMul(ee).redISub(yyu4);
nx = nx.redIAdd(nx);
nx = nx.redIAdd(nx);
// Y3 = 8 * Y1 * (U * (T - U) - E * EE)
var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));
ny = ny.redIAdd(ny);
ny = ny.redIAdd(ny);
ny = ny.redIAdd(ny);
// Z3 = (Z1 + E)^2 - ZZ - EE
var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);
return this.curve.jpoint(nx, ny, nz);
};
JPoint.prototype.mul = function mul(k, kbase) {
k = new BN(k, kbase);
return this.curve._wnafMul(this, k);
};
JPoint.prototype.eq = function eq(p) {
if (p.type === 'affine')
return this.eq(p.toJ());
if (this === p)
return true;
// x1 * z2^2 == x2 * z1^2
var z2 = this.z.redSqr();
var pz2 = p.z.redSqr();
if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)
return false;
// y1 * z2^3 == y2 * z1^3
var z3 = z2.redMul(this.z);
var pz3 = pz2.redMul(p.z);
return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;
};
JPoint.prototype.eqXToP = function eqXToP(x) {
var zs = this.z.redSqr();
var rx = x.toRed(this.curve.red).redMul(zs);
if (this.x.cmp(rx) === 0)
return true;
var xc = x.clone();
var t = this.curve.redN.redMul(zs);
for (;;) {
xc.iadd(this.curve.n);
if (xc.cmp(this.curve.p) >= 0)
return false;
rx.redIAdd(t);
if (this.x.cmp(rx) === 0)
return true;
}
};
JPoint.prototype.inspect = function inspect() {
if (this.isInfinity())
return '';
return '';
};
JPoint.prototype.isInfinity = function isInfinity() {
// XXX This code assumes that zero is always zero in red
return this.z.cmpn(0) === 0;
};
/***/ }),
/***/ 18:
/*!******************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
function _toConsumableArray(arr) {
return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
}
module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 180:
/*!**********************************************************!*\
!*** ./node_modules/elliptic/lib/elliptic/curve/mont.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var BN = __webpack_require__(/*! bn.js */ 162);
var inherits = __webpack_require__(/*! inherits */ 86);
var Base = __webpack_require__(/*! ./base */ 178);
var utils = __webpack_require__(/*! ../utils */ 175);
function MontCurve(conf) {
Base.call(this, 'mont', conf);
this.a = new BN(conf.a, 16).toRed(this.red);
this.b = new BN(conf.b, 16).toRed(this.red);
this.i4 = new BN(4).toRed(this.red).redInvm();
this.two = new BN(2).toRed(this.red);
this.a24 = this.i4.redMul(this.a.redAdd(this.two));
}
inherits(MontCurve, Base);
module.exports = MontCurve;
MontCurve.prototype.validate = function validate(point) {
var x = point.normalize().x;
var x2 = x.redSqr();
var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);
var y = rhs.redSqrt();
return y.redSqr().cmp(rhs) === 0;
};
function Point(curve, x, z) {
Base.BasePoint.call(this, curve, 'projective');
if (x === null && z === null) {
this.x = this.curve.one;
this.z = this.curve.zero;
} else {
this.x = new BN(x, 16);
this.z = new BN(z, 16);
if (!this.x.red)
this.x = this.x.toRed(this.curve.red);
if (!this.z.red)
this.z = this.z.toRed(this.curve.red);
}
}
inherits(Point, Base.BasePoint);
MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
return this.point(utils.toArray(bytes, enc), 1);
};
MontCurve.prototype.point = function point(x, z) {
return new Point(this, x, z);
};
MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
return Point.fromJSON(this, obj);
};
Point.prototype.precompute = function precompute() {
// No-op
};
Point.prototype._encode = function _encode() {
return this.getX().toArray('be', this.curve.p.byteLength());
};
Point.fromJSON = function fromJSON(curve, obj) {
return new Point(curve, obj[0], obj[1] || curve.one);
};
Point.prototype.inspect = function inspect() {
if (this.isInfinity())
return '';
return '';
};
Point.prototype.isInfinity = function isInfinity() {
// XXX This code assumes that zero is always zero in red
return this.z.cmpn(0) === 0;
};
Point.prototype.dbl = function dbl() {
// http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3
// 2M + 2S + 4A
// A = X1 + Z1
var a = this.x.redAdd(this.z);
// AA = A^2
var aa = a.redSqr();
// B = X1 - Z1
var b = this.x.redSub(this.z);
// BB = B^2
var bb = b.redSqr();
// C = AA - BB
var c = aa.redSub(bb);
// X3 = AA * BB
var nx = aa.redMul(bb);
// Z3 = C * (BB + A24 * C)
var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));
return this.curve.point(nx, nz);
};
Point.prototype.add = function add() {
throw new Error('Not supported on Montgomery curve');
};
Point.prototype.diffAdd = function diffAdd(p, diff) {
// http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3
// 4M + 2S + 6A
// A = X2 + Z2
var a = this.x.redAdd(this.z);
// B = X2 - Z2
var b = this.x.redSub(this.z);
// C = X3 + Z3
var c = p.x.redAdd(p.z);
// D = X3 - Z3
var d = p.x.redSub(p.z);
// DA = D * A
var da = d.redMul(a);
// CB = C * B
var cb = c.redMul(b);
// X5 = Z1 * (DA + CB)^2
var nx = diff.z.redMul(da.redAdd(cb).redSqr());
// Z5 = X1 * (DA - CB)^2
var nz = diff.x.redMul(da.redISub(cb).redSqr());
return this.curve.point(nx, nz);
};
Point.prototype.mul = function mul(k) {
var t = k.clone();
var a = this; // (N / 2) * Q + Q
var b = this.curve.point(null, null); // (N / 2) * Q
var c = this; // Q
for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1))
bits.push(t.andln(1));
for (var i = bits.length - 1; i >= 0; i--) {
if (bits[i] === 0) {
// N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q
a = a.diffAdd(b, c);
// N * Q = 2 * ((N / 2) * Q + Q))
b = b.dbl();
} else {
// N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q)
b = a.diffAdd(b, c);
// N * Q + Q = 2 * ((N / 2) * Q + Q)
a = a.dbl();
}
}
return b;
};
Point.prototype.mulAdd = function mulAdd() {
throw new Error('Not supported on Montgomery curve');
};
Point.prototype.jumlAdd = function jumlAdd() {
throw new Error('Not supported on Montgomery curve');
};
Point.prototype.eq = function eq(other) {
return this.getX().cmp(other.getX()) === 0;
};
Point.prototype.normalize = function normalize() {
this.x = this.x.redMul(this.z.redInvm());
this.z = this.curve.one;
return this;
};
Point.prototype.getX = function getX() {
// Normalize coordinates
this.normalize();
return this.x.fromRed();
};
/***/ }),
/***/ 181:
/*!*************************************************************!*\
!*** ./node_modules/elliptic/lib/elliptic/curve/edwards.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__(/*! ../utils */ 175);
var BN = __webpack_require__(/*! bn.js */ 162);
var inherits = __webpack_require__(/*! inherits */ 86);
var Base = __webpack_require__(/*! ./base */ 178);
var assert = utils.assert;
function EdwardsCurve(conf) {
// NOTE: Important as we are creating point in Base.call()
this.twisted = (conf.a | 0) !== 1;
this.mOneA = this.twisted && (conf.a | 0) === -1;
this.extended = this.mOneA;
Base.call(this, 'edwards', conf);
this.a = new BN(conf.a, 16).umod(this.red.m);
this.a = this.a.toRed(this.red);
this.c = new BN(conf.c, 16).toRed(this.red);
this.c2 = this.c.redSqr();
this.d = new BN(conf.d, 16).toRed(this.red);
this.dd = this.d.redAdd(this.d);
assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);
this.oneC = (conf.c | 0) === 1;
}
inherits(EdwardsCurve, Base);
module.exports = EdwardsCurve;
EdwardsCurve.prototype._mulA = function _mulA(num) {
if (this.mOneA)
return num.redNeg();
else
return this.a.redMul(num);
};
EdwardsCurve.prototype._mulC = function _mulC(num) {
if (this.oneC)
return num;
else
return this.c.redMul(num);
};
// Just for compatibility with Short curve
EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {
return this.point(x, y, z, t);
};
EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {
x = new BN(x, 16);
if (!x.red)
x = x.toRed(this.red);
var x2 = x.redSqr();
var rhs = this.c2.redSub(this.a.redMul(x2));
var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));
var y2 = rhs.redMul(lhs.redInvm());
var y = y2.redSqrt();
if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
throw new Error('invalid point');
var isOdd = y.fromRed().isOdd();
if (odd && !isOdd || !odd && isOdd)
y = y.redNeg();
return this.point(x, y);
};
EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {
y = new BN(y, 16);
if (!y.red)
y = y.toRed(this.red);
// x^2 = (y^2 - c^2) / (c^2 d y^2 - a)
var y2 = y.redSqr();
var lhs = y2.redSub(this.c2);
var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a);
var x2 = lhs.redMul(rhs.redInvm());
if (x2.cmp(this.zero) === 0) {
if (odd)
throw new Error('invalid point');
else
return this.point(this.zero, y);
}
var x = x2.redSqrt();
if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)
throw new Error('invalid point');
if (x.fromRed().isOdd() !== odd)
x = x.redNeg();
return this.point(x, y);
};
EdwardsCurve.prototype.validate = function validate(point) {
if (point.isInfinity())
return true;
// Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2)
point.normalize();
var x2 = point.x.redSqr();
var y2 = point.y.redSqr();
var lhs = x2.redMul(this.a).redAdd(y2);
var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));
return lhs.cmp(rhs) === 0;
};
function Point(curve, x, y, z, t) {
Base.BasePoint.call(this, curve, 'projective');
if (x === null && y === null && z === null) {
this.x = this.curve.zero;
this.y = this.curve.one;
this.z = this.curve.one;
this.t = this.curve.zero;
this.zOne = true;
} else {
this.x = new BN(x, 16);
this.y = new BN(y, 16);
this.z = z ? new BN(z, 16) : this.curve.one;
this.t = t && new BN(t, 16);
if (!this.x.red)
this.x = this.x.toRed(this.curve.red);
if (!this.y.red)
this.y = this.y.toRed(this.curve.red);
if (!this.z.red)
this.z = this.z.toRed(this.curve.red);
if (this.t && !this.t.red)
this.t = this.t.toRed(this.curve.red);
this.zOne = this.z === this.curve.one;
// Use extended coordinates
if (this.curve.extended && !this.t) {
this.t = this.x.redMul(this.y);
if (!this.zOne)
this.t = this.t.redMul(this.z.redInvm());
}
}
}
inherits(Point, Base.BasePoint);
EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
return Point.fromJSON(this, obj);
};
EdwardsCurve.prototype.point = function point(x, y, z, t) {
return new Point(this, x, y, z, t);
};
Point.fromJSON = function fromJSON(curve, obj) {
return new Point(curve, obj[0], obj[1], obj[2]);
};
Point.prototype.inspect = function inspect() {
if (this.isInfinity())
return '';
return '';
};
Point.prototype.isInfinity = function isInfinity() {
// XXX This code assumes that zero is always zero in red
return this.x.cmpn(0) === 0 &&
(this.y.cmp(this.z) === 0 ||
(this.zOne && this.y.cmp(this.curve.c) === 0));
};
Point.prototype._extDbl = function _extDbl() {
// hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
// #doubling-dbl-2008-hwcd
// 4M + 4S
// A = X1^2
var a = this.x.redSqr();
// B = Y1^2
var b = this.y.redSqr();
// C = 2 * Z1^2
var c = this.z.redSqr();
c = c.redIAdd(c);
// D = a * A
var d = this.curve._mulA(a);
// E = (X1 + Y1)^2 - A - B
var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);
// G = D + B
var g = d.redAdd(b);
// F = G - C
var f = g.redSub(c);
// H = D - B
var h = d.redSub(b);
// X3 = E * F
var nx = e.redMul(f);
// Y3 = G * H
var ny = g.redMul(h);
// T3 = E * H
var nt = e.redMul(h);
// Z3 = F * G
var nz = f.redMul(g);
return this.curve.point(nx, ny, nz, nt);
};
Point.prototype._projDbl = function _projDbl() {
// hyperelliptic.org/EFD/g1p/auto-twisted-projective.html
// #doubling-dbl-2008-bbjlp
// #doubling-dbl-2007-bl
// and others
// Generally 3M + 4S or 2M + 4S
// B = (X1 + Y1)^2
var b = this.x.redAdd(this.y).redSqr();
// C = X1^2
var c = this.x.redSqr();
// D = Y1^2
var d = this.y.redSqr();
var nx;
var ny;
var nz;
var e;
var h;
var j;
if (this.curve.twisted) {
// E = a * C
e = this.curve._mulA(c);
// F = E + D
var f = e.redAdd(d);
if (this.zOne) {
// X3 = (B - C - D) * (F - 2)
nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));
// Y3 = F * (E - D)
ny = f.redMul(e.redSub(d));
// Z3 = F^2 - 2 * F
nz = f.redSqr().redSub(f).redSub(f);
} else {
// H = Z1^2
h = this.z.redSqr();
// J = F - 2 * H
j = f.redSub(h).redISub(h);
// X3 = (B-C-D)*J
nx = b.redSub(c).redISub(d).redMul(j);
// Y3 = F * (E - D)
ny = f.redMul(e.redSub(d));
// Z3 = F * J
nz = f.redMul(j);
}
} else {
// E = C + D
e = c.redAdd(d);
// H = (c * Z1)^2
h = this.curve._mulC(this.z).redSqr();
// J = E - 2 * H
j = e.redSub(h).redSub(h);
// X3 = c * (B - E) * J
nx = this.curve._mulC(b.redISub(e)).redMul(j);
// Y3 = c * E * (C - D)
ny = this.curve._mulC(e).redMul(c.redISub(d));
// Z3 = E * J
nz = e.redMul(j);
}
return this.curve.point(nx, ny, nz);
};
Point.prototype.dbl = function dbl() {
if (this.isInfinity())
return this;
// Double in extended coordinates
if (this.curve.extended)
return this._extDbl();
else
return this._projDbl();
};
Point.prototype._extAdd = function _extAdd(p) {
// hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
// #addition-add-2008-hwcd-3
// 8M
// A = (Y1 - X1) * (Y2 - X2)
var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));
// B = (Y1 + X1) * (Y2 + X2)
var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));
// C = T1 * k * T2
var c = this.t.redMul(this.curve.dd).redMul(p.t);
// D = Z1 * 2 * Z2
var d = this.z.redMul(p.z.redAdd(p.z));
// E = B - A
var e = b.redSub(a);
// F = D - C
var f = d.redSub(c);
// G = D + C
var g = d.redAdd(c);
// H = B + A
var h = b.redAdd(a);
// X3 = E * F
var nx = e.redMul(f);
// Y3 = G * H
var ny = g.redMul(h);
// T3 = E * H
var nt = e.redMul(h);
// Z3 = F * G
var nz = f.redMul(g);
return this.curve.point(nx, ny, nz, nt);
};
Point.prototype._projAdd = function _projAdd(p) {
// hyperelliptic.org/EFD/g1p/auto-twisted-projective.html
// #addition-add-2008-bbjlp
// #addition-add-2007-bl
// 10M + 1S
// A = Z1 * Z2
var a = this.z.redMul(p.z);
// B = A^2
var b = a.redSqr();
// C = X1 * X2
var c = this.x.redMul(p.x);
// D = Y1 * Y2
var d = this.y.redMul(p.y);
// E = d * C * D
var e = this.curve.d.redMul(c).redMul(d);
// F = B - E
var f = b.redSub(e);
// G = B + E
var g = b.redAdd(e);
// X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D)
var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);
var nx = a.redMul(f).redMul(tmp);
var ny;
var nz;
if (this.curve.twisted) {
// Y3 = A * G * (D - a * C)
ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));
// Z3 = F * G
nz = f.redMul(g);
} else {
// Y3 = A * G * (D - C)
ny = a.redMul(g).redMul(d.redSub(c));
// Z3 = c * F * G
nz = this.curve._mulC(f).redMul(g);
}
return this.curve.point(nx, ny, nz);
};
Point.prototype.add = function add(p) {
if (this.isInfinity())
return p;
if (p.isInfinity())
return this;
if (this.curve.extended)
return this._extAdd(p);
else
return this._projAdd(p);
};
Point.prototype.mul = function mul(k) {
if (this._hasDoubles(k))
return this.curve._fixedNafMul(this, k);
else
return this.curve._wnafMul(this, k);
};
Point.prototype.mulAdd = function mulAdd(k1, p, k2) {
return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false);
};
Point.prototype.jmulAdd = function jmulAdd(k1, p, k2) {
return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true);
};
Point.prototype.normalize = function normalize() {
if (this.zOne)
return this;
// Normalize coordinates
var zi = this.z.redInvm();
this.x = this.x.redMul(zi);
this.y = this.y.redMul(zi);
if (this.t)
this.t = this.t.redMul(zi);
this.z = this.curve.one;
this.zOne = true;
return this;
};
Point.prototype.neg = function neg() {
return this.curve.point(this.x.redNeg(),
this.y,
this.z,
this.t && this.t.redNeg());
};
Point.prototype.getX = function getX() {
this.normalize();
return this.x.fromRed();
};
Point.prototype.getY = function getY() {
this.normalize();
return this.y.fromRed();
};
Point.prototype.eq = function eq(other) {
return this === other ||
this.getX().cmp(other.getX()) === 0 &&
this.getY().cmp(other.getY()) === 0;
};
Point.prototype.eqXToP = function eqXToP(x) {
var rx = x.toRed(this.curve.red).redMul(this.z);
if (this.x.cmp(rx) === 0)
return true;
var xc = x.clone();
var t = this.curve.redN.redMul(this.z);
for (;;) {
xc.iadd(this.curve.n);
if (xc.cmp(this.curve.p) >= 0)
return false;
rx.redIAdd(t);
if (this.x.cmp(rx) === 0)
return true;
}
};
// Compatibility with BaseCurve
Point.prototype.toP = Point.prototype.normalize;
Point.prototype.mixedAdd = Point.prototype.add;
/***/ }),
/***/ 182:
/*!******************************************************!*\
!*** ./node_modules/elliptic/lib/elliptic/curves.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var curves = exports;
var hash = __webpack_require__(/*! hash.js */ 183);
var curve = __webpack_require__(/*! ./curve */ 177);
var utils = __webpack_require__(/*! ./utils */ 175);
var assert = utils.assert;
function PresetCurve(options) {
if (options.type === 'short')
this.curve = new curve.short(options);
else if (options.type === 'edwards')
this.curve = new curve.edwards(options);
else
this.curve = new curve.mont(options);
this.g = this.curve.g;
this.n = this.curve.n;
this.hash = options.hash;
assert(this.g.validate(), 'Invalid curve');
assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O');
}
curves.PresetCurve = PresetCurve;
function defineCurve(name, options) {
Object.defineProperty(curves, name, {
configurable: true,
enumerable: true,
get: function() {
var curve = new PresetCurve(options);
Object.defineProperty(curves, name, {
configurable: true,
enumerable: true,
value: curve,
});
return curve;
},
});
}
defineCurve('p192', {
type: 'short',
prime: 'p192',
p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',
a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',
b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',
n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',
hash: hash.sha256,
gRed: false,
g: [
'188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',
'07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811',
],
});
defineCurve('p224', {
type: 'short',
prime: 'p224',
p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',
a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',
b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',
n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',
hash: hash.sha256,
gRed: false,
g: [
'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',
'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34',
],
});
defineCurve('p256', {
type: 'short',
prime: null,
p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',
a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',
b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',
n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',
hash: hash.sha256,
gRed: false,
g: [
'6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',
'4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5',
],
});
defineCurve('p384', {
type: 'short',
prime: null,
p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
'fffffffe ffffffff 00000000 00000000 ffffffff',
a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
'fffffffe ffffffff 00000000 00000000 fffffffc',
b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' +
'5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',
n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' +
'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',
hash: hash.sha384,
gRed: false,
g: [
'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' +
'5502f25d bf55296c 3a545e38 72760ab7',
'3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' +
'0a60b1ce 1d7e819d 7a431d7c 90ea0e5f',
],
});
defineCurve('p521', {
type: 'short',
prime: null,
p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
'ffffffff ffffffff ffffffff ffffffff ffffffff',
a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
'ffffffff ffffffff ffffffff ffffffff fffffffc',
b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' +
'99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' +
'3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00',
n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' +
'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',
hash: hash.sha512,
gRed: false,
g: [
'000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' +
'053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' +
'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66',
'00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' +
'579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' +
'3fad0761 353c7086 a272c240 88be9476 9fd16650',
],
});
defineCurve('curve25519', {
type: 'mont',
prime: 'p25519',
p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',
a: '76d06',
b: '1',
n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
hash: hash.sha256,
gRed: false,
g: [
'9',
],
});
defineCurve('ed25519', {
type: 'edwards',
prime: 'p25519',
p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',
a: '-1',
c: '1',
// -121665 * (121666^(-1)) (mod P)
d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',
n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
hash: hash.sha256,
gRed: false,
g: [
'216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',
// 4/5
'6666666666666666666666666666666666666666666666666666666666666658',
],
});
var pre;
try {
pre = __webpack_require__(/*! ./precomputed/secp256k1 */ 195);
} catch (e) {
pre = undefined;
}
defineCurve('secp256k1', {
type: 'short',
prime: 'k256',
p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',
a: '0',
b: '7',
n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',
h: '1',
hash: hash.sha256,
// Precomputed endomorphism
beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',
lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',
basis: [
{
a: '3086d221a7d46bcde86c90e49284eb15',
b: '-e4437ed6010e88286f547fa90abfe4c3',
},
{
a: '114ca50f7a8e2f3f657c1108d9d44cfd8',
b: '3086d221a7d46bcde86c90e49284eb15',
},
],
gRed: false,
g: [
'79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',
'483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',
pre,
],
});
/***/ }),
/***/ 183:
/*!******************************************!*\
!*** ./node_modules/hash.js/lib/hash.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var hash = exports;
hash.utils = __webpack_require__(/*! ./hash/utils */ 184);
hash.common = __webpack_require__(/*! ./hash/common */ 185);
hash.sha = __webpack_require__(/*! ./hash/sha */ 186);
hash.ripemd = __webpack_require__(/*! ./hash/ripemd */ 193);
hash.hmac = __webpack_require__(/*! ./hash/hmac */ 194);
// Proxy hash functions to the main object
hash.sha1 = hash.sha.sha1;
hash.sha256 = hash.sha.sha256;
hash.sha224 = hash.sha.sha224;
hash.sha384 = hash.sha.sha384;
hash.sha512 = hash.sha.sha512;
hash.ripemd160 = hash.ripemd.ripemd160;
/***/ }),
/***/ 184:
/*!************************************************!*\
!*** ./node_modules/hash.js/lib/hash/utils.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var assert = __webpack_require__(/*! minimalistic-assert */ 136);
var inherits = __webpack_require__(/*! inherits */ 86);
exports.inherits = inherits;
function isSurrogatePair(msg, i) {
if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {
return false;
}
if (i < 0 || i + 1 >= msg.length) {
return false;
}
return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;
}
function toArray(msg, enc) {
if (Array.isArray(msg))
return msg.slice();
if (!msg)
return [];
var res = [];
if (typeof msg === 'string') {
if (!enc) {
// Inspired by stringToUtf8ByteArray() in closure-library by Google
// https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143
// Apache License 2.0
// https://github.com/google/closure-library/blob/master/LICENSE
var p = 0;
for (var i = 0; i < msg.length; i++) {
var c = msg.charCodeAt(i);
if (c < 128) {
res[p++] = c;
} else if (c < 2048) {
res[p++] = (c >> 6) | 192;
res[p++] = (c & 63) | 128;
} else if (isSurrogatePair(msg, i)) {
c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);
res[p++] = (c >> 18) | 240;
res[p++] = ((c >> 12) & 63) | 128;
res[p++] = ((c >> 6) & 63) | 128;
res[p++] = (c & 63) | 128;
} else {
res[p++] = (c >> 12) | 224;
res[p++] = ((c >> 6) & 63) | 128;
res[p++] = (c & 63) | 128;
}
}
} else if (enc === 'hex') {
msg = msg.replace(/[^a-z0-9]+/ig, '');
if (msg.length % 2 !== 0)
msg = '0' + msg;
for (i = 0; i < msg.length; i += 2)
res.push(parseInt(msg[i] + msg[i + 1], 16));
}
} else {
for (i = 0; i < msg.length; i++)
res[i] = msg[i] | 0;
}
return res;
}
exports.toArray = toArray;
function toHex(msg) {
var res = '';
for (var i = 0; i < msg.length; i++)
res += zero2(msg[i].toString(16));
return res;
}
exports.toHex = toHex;
function htonl(w) {
var res = (w >>> 24) |
((w >>> 8) & 0xff00) |
((w << 8) & 0xff0000) |
((w & 0xff) << 24);
return res >>> 0;
}
exports.htonl = htonl;
function toHex32(msg, endian) {
var res = '';
for (var i = 0; i < msg.length; i++) {
var w = msg[i];
if (endian === 'little')
w = htonl(w);
res += zero8(w.toString(16));
}
return res;
}
exports.toHex32 = toHex32;
function zero2(word) {
if (word.length === 1)
return '0' + word;
else
return word;
}
exports.zero2 = zero2;
function zero8(word) {
if (word.length === 7)
return '0' + word;
else if (word.length === 6)
return '00' + word;
else if (word.length === 5)
return '000' + word;
else if (word.length === 4)
return '0000' + word;
else if (word.length === 3)
return '00000' + word;
else if (word.length === 2)
return '000000' + word;
else if (word.length === 1)
return '0000000' + word;
else
return word;
}
exports.zero8 = zero8;
function join32(msg, start, end, endian) {
var len = end - start;
assert(len % 4 === 0);
var res = new Array(len / 4);
for (var i = 0, k = start; i < res.length; i++, k += 4) {
var w;
if (endian === 'big')
w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];
else
w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];
res[i] = w >>> 0;
}
return res;
}
exports.join32 = join32;
function split32(msg, endian) {
var res = new Array(msg.length * 4);
for (var i = 0, k = 0; i < msg.length; i++, k += 4) {
var m = msg[i];
if (endian === 'big') {
res[k] = m >>> 24;
res[k + 1] = (m >>> 16) & 0xff;
res[k + 2] = (m >>> 8) & 0xff;
res[k + 3] = m & 0xff;
} else {
res[k + 3] = m >>> 24;
res[k + 2] = (m >>> 16) & 0xff;
res[k + 1] = (m >>> 8) & 0xff;
res[k] = m & 0xff;
}
}
return res;
}
exports.split32 = split32;
function rotr32(w, b) {
return (w >>> b) | (w << (32 - b));
}
exports.rotr32 = rotr32;
function rotl32(w, b) {
return (w << b) | (w >>> (32 - b));
}
exports.rotl32 = rotl32;
function sum32(a, b) {
return (a + b) >>> 0;
}
exports.sum32 = sum32;
function sum32_3(a, b, c) {
return (a + b + c) >>> 0;
}
exports.sum32_3 = sum32_3;
function sum32_4(a, b, c, d) {
return (a + b + c + d) >>> 0;
}
exports.sum32_4 = sum32_4;
function sum32_5(a, b, c, d, e) {
return (a + b + c + d + e) >>> 0;
}
exports.sum32_5 = sum32_5;
function sum64(buf, pos, ah, al) {
var bh = buf[pos];
var bl = buf[pos + 1];
var lo = (al + bl) >>> 0;
var hi = (lo < al ? 1 : 0) + ah + bh;
buf[pos] = hi >>> 0;
buf[pos + 1] = lo;
}
exports.sum64 = sum64;
function sum64_hi(ah, al, bh, bl) {
var lo = (al + bl) >>> 0;
var hi = (lo < al ? 1 : 0) + ah + bh;
return hi >>> 0;
}
exports.sum64_hi = sum64_hi;
function sum64_lo(ah, al, bh, bl) {
var lo = al + bl;
return lo >>> 0;
}
exports.sum64_lo = sum64_lo;
function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {
var carry = 0;
var lo = al;
lo = (lo + bl) >>> 0;
carry += lo < al ? 1 : 0;
lo = (lo + cl) >>> 0;
carry += lo < cl ? 1 : 0;
lo = (lo + dl) >>> 0;
carry += lo < dl ? 1 : 0;
var hi = ah + bh + ch + dh + carry;
return hi >>> 0;
}
exports.sum64_4_hi = sum64_4_hi;
function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {
var lo = al + bl + cl + dl;
return lo >>> 0;
}
exports.sum64_4_lo = sum64_4_lo;
function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
var carry = 0;
var lo = al;
lo = (lo + bl) >>> 0;
carry += lo < al ? 1 : 0;
lo = (lo + cl) >>> 0;
carry += lo < cl ? 1 : 0;
lo = (lo + dl) >>> 0;
carry += lo < dl ? 1 : 0;
lo = (lo + el) >>> 0;
carry += lo < el ? 1 : 0;
var hi = ah + bh + ch + dh + eh + carry;
return hi >>> 0;
}
exports.sum64_5_hi = sum64_5_hi;
function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
var lo = al + bl + cl + dl + el;
return lo >>> 0;
}
exports.sum64_5_lo = sum64_5_lo;
function rotr64_hi(ah, al, num) {
var r = (al << (32 - num)) | (ah >>> num);
return r >>> 0;
}
exports.rotr64_hi = rotr64_hi;
function rotr64_lo(ah, al, num) {
var r = (ah << (32 - num)) | (al >>> num);
return r >>> 0;
}
exports.rotr64_lo = rotr64_lo;
function shr64_hi(ah, al, num) {
return ah >>> num;
}
exports.shr64_hi = shr64_hi;
function shr64_lo(ah, al, num) {
var r = (ah << (32 - num)) | (al >>> num);
return r >>> 0;
}
exports.shr64_lo = shr64_lo;
/***/ }),
/***/ 185:
/*!*************************************************!*\
!*** ./node_modules/hash.js/lib/hash/common.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__(/*! ./utils */ 184);
var assert = __webpack_require__(/*! minimalistic-assert */ 136);
function BlockHash() {
this.pending = null;
this.pendingTotal = 0;
this.blockSize = this.constructor.blockSize;
this.outSize = this.constructor.outSize;
this.hmacStrength = this.constructor.hmacStrength;
this.padLength = this.constructor.padLength / 8;
this.endian = 'big';
this._delta8 = this.blockSize / 8;
this._delta32 = this.blockSize / 32;
}
exports.BlockHash = BlockHash;
BlockHash.prototype.update = function update(msg, enc) {
// Convert message to array, pad it, and join into 32bit blocks
msg = utils.toArray(msg, enc);
if (!this.pending)
this.pending = msg;
else
this.pending = this.pending.concat(msg);
this.pendingTotal += msg.length;
// Enough data, try updating
if (this.pending.length >= this._delta8) {
msg = this.pending;
// Process pending data in blocks
var r = msg.length % this._delta8;
this.pending = msg.slice(msg.length - r, msg.length);
if (this.pending.length === 0)
this.pending = null;
msg = utils.join32(msg, 0, msg.length - r, this.endian);
for (var i = 0; i < msg.length; i += this._delta32)
this._update(msg, i, i + this._delta32);
}
return this;
};
BlockHash.prototype.digest = function digest(enc) {
this.update(this._pad());
assert(this.pending === null);
return this._digest(enc);
};
BlockHash.prototype._pad = function pad() {
var len = this.pendingTotal;
var bytes = this._delta8;
var k = bytes - ((len + this.padLength) % bytes);
var res = new Array(k + this.padLength);
res[0] = 0x80;
for (var i = 1; i < k; i++)
res[i] = 0;
// Append length
len <<= 3;
if (this.endian === 'big') {
for (var t = 8; t < this.padLength; t++)
res[i++] = 0;
res[i++] = 0;
res[i++] = 0;
res[i++] = 0;
res[i++] = 0;
res[i++] = (len >>> 24) & 0xff;
res[i++] = (len >>> 16) & 0xff;
res[i++] = (len >>> 8) & 0xff;
res[i++] = len & 0xff;
} else {
res[i++] = len & 0xff;
res[i++] = (len >>> 8) & 0xff;
res[i++] = (len >>> 16) & 0xff;
res[i++] = (len >>> 24) & 0xff;
res[i++] = 0;
res[i++] = 0;
res[i++] = 0;
res[i++] = 0;
for (t = 8; t < this.padLength; t++)
res[i++] = 0;
}
return res;
};
/***/ }),
/***/ 186:
/*!**********************************************!*\
!*** ./node_modules/hash.js/lib/hash/sha.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.sha1 = __webpack_require__(/*! ./sha/1 */ 187);
exports.sha224 = __webpack_require__(/*! ./sha/224 */ 189);
exports.sha256 = __webpack_require__(/*! ./sha/256 */ 190);
exports.sha384 = __webpack_require__(/*! ./sha/384 */ 191);
exports.sha512 = __webpack_require__(/*! ./sha/512 */ 192);
/***/ }),
/***/ 187:
/*!************************************************!*\
!*** ./node_modules/hash.js/lib/hash/sha/1.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__(/*! ../utils */ 184);
var common = __webpack_require__(/*! ../common */ 185);
var shaCommon = __webpack_require__(/*! ./common */ 188);
var rotl32 = utils.rotl32;
var sum32 = utils.sum32;
var sum32_5 = utils.sum32_5;
var ft_1 = shaCommon.ft_1;
var BlockHash = common.BlockHash;
var sha1_K = [
0x5A827999, 0x6ED9EBA1,
0x8F1BBCDC, 0xCA62C1D6
];
function SHA1() {
if (!(this instanceof SHA1))
return new SHA1();
BlockHash.call(this);
this.h = [
0x67452301, 0xefcdab89, 0x98badcfe,
0x10325476, 0xc3d2e1f0 ];
this.W = new Array(80);
}
utils.inherits(SHA1, BlockHash);
module.exports = SHA1;
SHA1.blockSize = 512;
SHA1.outSize = 160;
SHA1.hmacStrength = 80;
SHA1.padLength = 64;
SHA1.prototype._update = function _update(msg, start) {
var W = this.W;
for (var i = 0; i < 16; i++)
W[i] = msg[start + i];
for(; i < W.length; i++)
W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
var a = this.h[0];
var b = this.h[1];
var c = this.h[2];
var d = this.h[3];
var e = this.h[4];
for (i = 0; i < W.length; i++) {
var s = ~~(i / 20);
var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);
e = d;
d = c;
c = rotl32(b, 30);
b = a;
a = t;
}
this.h[0] = sum32(this.h[0], a);
this.h[1] = sum32(this.h[1], b);
this.h[2] = sum32(this.h[2], c);
this.h[3] = sum32(this.h[3], d);
this.h[4] = sum32(this.h[4], e);
};
SHA1.prototype._digest = function digest(enc) {
if (enc === 'hex')
return utils.toHex32(this.h, 'big');
else
return utils.split32(this.h, 'big');
};
/***/ }),
/***/ 188:
/*!*****************************************************!*\
!*** ./node_modules/hash.js/lib/hash/sha/common.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__(/*! ../utils */ 184);
var rotr32 = utils.rotr32;
function ft_1(s, x, y, z) {
if (s === 0)
return ch32(x, y, z);
if (s === 1 || s === 3)
return p32(x, y, z);
if (s === 2)
return maj32(x, y, z);
}
exports.ft_1 = ft_1;
function ch32(x, y, z) {
return (x & y) ^ ((~x) & z);
}
exports.ch32 = ch32;
function maj32(x, y, z) {
return (x & y) ^ (x & z) ^ (y & z);
}
exports.maj32 = maj32;
function p32(x, y, z) {
return x ^ y ^ z;
}
exports.p32 = p32;
function s0_256(x) {
return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);
}
exports.s0_256 = s0_256;
function s1_256(x) {
return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);
}
exports.s1_256 = s1_256;
function g0_256(x) {
return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);
}
exports.g0_256 = g0_256;
function g1_256(x) {
return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);
}
exports.g1_256 = g1_256;
/***/ }),
/***/ 189:
/*!**************************************************!*\
!*** ./node_modules/hash.js/lib/hash/sha/224.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__(/*! ../utils */ 184);
var SHA256 = __webpack_require__(/*! ./256 */ 190);
function SHA224() {
if (!(this instanceof SHA224))
return new SHA224();
SHA256.call(this);
this.h = [
0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];
}
utils.inherits(SHA224, SHA256);
module.exports = SHA224;
SHA224.blockSize = 512;
SHA224.outSize = 224;
SHA224.hmacStrength = 192;
SHA224.padLength = 64;
SHA224.prototype._digest = function digest(enc) {
// Just truncate output
if (enc === 'hex')
return utils.toHex32(this.h.slice(0, 7), 'big');
else
return utils.split32(this.h.slice(0, 7), 'big');
};
/***/ }),
/***/ 19:
/*!******************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return arrayLikeToArray(arr);
}
module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 190:
/*!**************************************************!*\
!*** ./node_modules/hash.js/lib/hash/sha/256.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__(/*! ../utils */ 184);
var common = __webpack_require__(/*! ../common */ 185);
var shaCommon = __webpack_require__(/*! ./common */ 188);
var assert = __webpack_require__(/*! minimalistic-assert */ 136);
var sum32 = utils.sum32;
var sum32_4 = utils.sum32_4;
var sum32_5 = utils.sum32_5;
var ch32 = shaCommon.ch32;
var maj32 = shaCommon.maj32;
var s0_256 = shaCommon.s0_256;
var s1_256 = shaCommon.s1_256;
var g0_256 = shaCommon.g0_256;
var g1_256 = shaCommon.g1_256;
var BlockHash = common.BlockHash;
var sha256_K = [
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
];
function SHA256() {
if (!(this instanceof SHA256))
return new SHA256();
BlockHash.call(this);
this.h = [
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
];
this.k = sha256_K;
this.W = new Array(64);
}
utils.inherits(SHA256, BlockHash);
module.exports = SHA256;
SHA256.blockSize = 512;
SHA256.outSize = 256;
SHA256.hmacStrength = 192;
SHA256.padLength = 64;
SHA256.prototype._update = function _update(msg, start) {
var W = this.W;
for (var i = 0; i < 16; i++)
W[i] = msg[start + i];
for (; i < W.length; i++)
W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);
var a = this.h[0];
var b = this.h[1];
var c = this.h[2];
var d = this.h[3];
var e = this.h[4];
var f = this.h[5];
var g = this.h[6];
var h = this.h[7];
assert(this.k.length === W.length);
for (i = 0; i < W.length; i++) {
var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);
var T2 = sum32(s0_256(a), maj32(a, b, c));
h = g;
g = f;
f = e;
e = sum32(d, T1);
d = c;
c = b;
b = a;
a = sum32(T1, T2);
}
this.h[0] = sum32(this.h[0], a);
this.h[1] = sum32(this.h[1], b);
this.h[2] = sum32(this.h[2], c);
this.h[3] = sum32(this.h[3], d);
this.h[4] = sum32(this.h[4], e);
this.h[5] = sum32(this.h[5], f);
this.h[6] = sum32(this.h[6], g);
this.h[7] = sum32(this.h[7], h);
};
SHA256.prototype._digest = function digest(enc) {
if (enc === 'hex')
return utils.toHex32(this.h, 'big');
else
return utils.split32(this.h, 'big');
};
/***/ }),
/***/ 191:
/*!**************************************************!*\
!*** ./node_modules/hash.js/lib/hash/sha/384.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__(/*! ../utils */ 184);
var SHA512 = __webpack_require__(/*! ./512 */ 192);
function SHA384() {
if (!(this instanceof SHA384))
return new SHA384();
SHA512.call(this);
this.h = [
0xcbbb9d5d, 0xc1059ed8,
0x629a292a, 0x367cd507,
0x9159015a, 0x3070dd17,
0x152fecd8, 0xf70e5939,
0x67332667, 0xffc00b31,
0x8eb44a87, 0x68581511,
0xdb0c2e0d, 0x64f98fa7,
0x47b5481d, 0xbefa4fa4 ];
}
utils.inherits(SHA384, SHA512);
module.exports = SHA384;
SHA384.blockSize = 1024;
SHA384.outSize = 384;
SHA384.hmacStrength = 192;
SHA384.padLength = 128;
SHA384.prototype._digest = function digest(enc) {
if (enc === 'hex')
return utils.toHex32(this.h.slice(0, 12), 'big');
else
return utils.split32(this.h.slice(0, 12), 'big');
};
/***/ }),
/***/ 192:
/*!**************************************************!*\
!*** ./node_modules/hash.js/lib/hash/sha/512.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__(/*! ../utils */ 184);
var common = __webpack_require__(/*! ../common */ 185);
var assert = __webpack_require__(/*! minimalistic-assert */ 136);
var rotr64_hi = utils.rotr64_hi;
var rotr64_lo = utils.rotr64_lo;
var shr64_hi = utils.shr64_hi;
var shr64_lo = utils.shr64_lo;
var sum64 = utils.sum64;
var sum64_hi = utils.sum64_hi;
var sum64_lo = utils.sum64_lo;
var sum64_4_hi = utils.sum64_4_hi;
var sum64_4_lo = utils.sum64_4_lo;
var sum64_5_hi = utils.sum64_5_hi;
var sum64_5_lo = utils.sum64_5_lo;
var BlockHash = common.BlockHash;
var sha512_K = [
0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
];
function SHA512() {
if (!(this instanceof SHA512))
return new SHA512();
BlockHash.call(this);
this.h = [
0x6a09e667, 0xf3bcc908,
0xbb67ae85, 0x84caa73b,
0x3c6ef372, 0xfe94f82b,
0xa54ff53a, 0x5f1d36f1,
0x510e527f, 0xade682d1,
0x9b05688c, 0x2b3e6c1f,
0x1f83d9ab, 0xfb41bd6b,
0x5be0cd19, 0x137e2179 ];
this.k = sha512_K;
this.W = new Array(160);
}
utils.inherits(SHA512, BlockHash);
module.exports = SHA512;
SHA512.blockSize = 1024;
SHA512.outSize = 512;
SHA512.hmacStrength = 192;
SHA512.padLength = 128;
SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {
var W = this.W;
// 32 x 32bit words
for (var i = 0; i < 32; i++)
W[i] = msg[start + i];
for (; i < W.length; i += 2) {
var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2
var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);
var c1_hi = W[i - 14]; // i - 7
var c1_lo = W[i - 13];
var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15
var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);
var c3_hi = W[i - 32]; // i - 16
var c3_lo = W[i - 31];
W[i] = sum64_4_hi(
c0_hi, c0_lo,
c1_hi, c1_lo,
c2_hi, c2_lo,
c3_hi, c3_lo);
W[i + 1] = sum64_4_lo(
c0_hi, c0_lo,
c1_hi, c1_lo,
c2_hi, c2_lo,
c3_hi, c3_lo);
}
};
SHA512.prototype._update = function _update(msg, start) {
this._prepareBlock(msg, start);
var W = this.W;
var ah = this.h[0];
var al = this.h[1];
var bh = this.h[2];
var bl = this.h[3];
var ch = this.h[4];
var cl = this.h[5];
var dh = this.h[6];
var dl = this.h[7];
var eh = this.h[8];
var el = this.h[9];
var fh = this.h[10];
var fl = this.h[11];
var gh = this.h[12];
var gl = this.h[13];
var hh = this.h[14];
var hl = this.h[15];
assert(this.k.length === W.length);
for (var i = 0; i < W.length; i += 2) {
var c0_hi = hh;
var c0_lo = hl;
var c1_hi = s1_512_hi(eh, el);
var c1_lo = s1_512_lo(eh, el);
var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);
var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);
var c3_hi = this.k[i];
var c3_lo = this.k[i + 1];
var c4_hi = W[i];
var c4_lo = W[i + 1];
var T1_hi = sum64_5_hi(
c0_hi, c0_lo,
c1_hi, c1_lo,
c2_hi, c2_lo,
c3_hi, c3_lo,
c4_hi, c4_lo);
var T1_lo = sum64_5_lo(
c0_hi, c0_lo,
c1_hi, c1_lo,
c2_hi, c2_lo,
c3_hi, c3_lo,
c4_hi, c4_lo);
c0_hi = s0_512_hi(ah, al);
c0_lo = s0_512_lo(ah, al);
c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);
c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);
var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);
var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);
hh = gh;
hl = gl;
gh = fh;
gl = fl;
fh = eh;
fl = el;
eh = sum64_hi(dh, dl, T1_hi, T1_lo);
el = sum64_lo(dl, dl, T1_hi, T1_lo);
dh = ch;
dl = cl;
ch = bh;
cl = bl;
bh = ah;
bl = al;
ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);
al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);
}
sum64(this.h, 0, ah, al);
sum64(this.h, 2, bh, bl);
sum64(this.h, 4, ch, cl);
sum64(this.h, 6, dh, dl);
sum64(this.h, 8, eh, el);
sum64(this.h, 10, fh, fl);
sum64(this.h, 12, gh, gl);
sum64(this.h, 14, hh, hl);
};
SHA512.prototype._digest = function digest(enc) {
if (enc === 'hex')
return utils.toHex32(this.h, 'big');
else
return utils.split32(this.h, 'big');
};
function ch64_hi(xh, xl, yh, yl, zh) {
var r = (xh & yh) ^ ((~xh) & zh);
if (r < 0)
r += 0x100000000;
return r;
}
function ch64_lo(xh, xl, yh, yl, zh, zl) {
var r = (xl & yl) ^ ((~xl) & zl);
if (r < 0)
r += 0x100000000;
return r;
}
function maj64_hi(xh, xl, yh, yl, zh) {
var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);
if (r < 0)
r += 0x100000000;
return r;
}
function maj64_lo(xh, xl, yh, yl, zh, zl) {
var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);
if (r < 0)
r += 0x100000000;
return r;
}
function s0_512_hi(xh, xl) {
var c0_hi = rotr64_hi(xh, xl, 28);
var c1_hi = rotr64_hi(xl, xh, 2); // 34
var c2_hi = rotr64_hi(xl, xh, 7); // 39
var r = c0_hi ^ c1_hi ^ c2_hi;
if (r < 0)
r += 0x100000000;
return r;
}
function s0_512_lo(xh, xl) {
var c0_lo = rotr64_lo(xh, xl, 28);
var c1_lo = rotr64_lo(xl, xh, 2); // 34
var c2_lo = rotr64_lo(xl, xh, 7); // 39
var r = c0_lo ^ c1_lo ^ c2_lo;
if (r < 0)
r += 0x100000000;
return r;
}
function s1_512_hi(xh, xl) {
var c0_hi = rotr64_hi(xh, xl, 14);
var c1_hi = rotr64_hi(xh, xl, 18);
var c2_hi = rotr64_hi(xl, xh, 9); // 41
var r = c0_hi ^ c1_hi ^ c2_hi;
if (r < 0)
r += 0x100000000;
return r;
}
function s1_512_lo(xh, xl) {
var c0_lo = rotr64_lo(xh, xl, 14);
var c1_lo = rotr64_lo(xh, xl, 18);
var c2_lo = rotr64_lo(xl, xh, 9); // 41
var r = c0_lo ^ c1_lo ^ c2_lo;
if (r < 0)
r += 0x100000000;
return r;
}
function g0_512_hi(xh, xl) {
var c0_hi = rotr64_hi(xh, xl, 1);
var c1_hi = rotr64_hi(xh, xl, 8);
var c2_hi = shr64_hi(xh, xl, 7);
var r = c0_hi ^ c1_hi ^ c2_hi;
if (r < 0)
r += 0x100000000;
return r;
}
function g0_512_lo(xh, xl) {
var c0_lo = rotr64_lo(xh, xl, 1);
var c1_lo = rotr64_lo(xh, xl, 8);
var c2_lo = shr64_lo(xh, xl, 7);
var r = c0_lo ^ c1_lo ^ c2_lo;
if (r < 0)
r += 0x100000000;
return r;
}
function g1_512_hi(xh, xl) {
var c0_hi = rotr64_hi(xh, xl, 19);
var c1_hi = rotr64_hi(xl, xh, 29); // 61
var c2_hi = shr64_hi(xh, xl, 6);
var r = c0_hi ^ c1_hi ^ c2_hi;
if (r < 0)
r += 0x100000000;
return r;
}
function g1_512_lo(xh, xl) {
var c0_lo = rotr64_lo(xh, xl, 19);
var c1_lo = rotr64_lo(xl, xh, 29); // 61
var c2_lo = shr64_lo(xh, xl, 6);
var r = c0_lo ^ c1_lo ^ c2_lo;
if (r < 0)
r += 0x100000000;
return r;
}
/***/ }),
/***/ 193:
/*!*************************************************!*\
!*** ./node_modules/hash.js/lib/hash/ripemd.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__(/*! ./utils */ 184);
var common = __webpack_require__(/*! ./common */ 185);
var rotl32 = utils.rotl32;
var sum32 = utils.sum32;
var sum32_3 = utils.sum32_3;
var sum32_4 = utils.sum32_4;
var BlockHash = common.BlockHash;
function RIPEMD160() {
if (!(this instanceof RIPEMD160))
return new RIPEMD160();
BlockHash.call(this);
this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];
this.endian = 'little';
}
utils.inherits(RIPEMD160, BlockHash);
exports.ripemd160 = RIPEMD160;
RIPEMD160.blockSize = 512;
RIPEMD160.outSize = 160;
RIPEMD160.hmacStrength = 192;
RIPEMD160.padLength = 64;
RIPEMD160.prototype._update = function update(msg, start) {
var A = this.h[0];
var B = this.h[1];
var C = this.h[2];
var D = this.h[3];
var E = this.h[4];
var Ah = A;
var Bh = B;
var Ch = C;
var Dh = D;
var Eh = E;
for (var j = 0; j < 80; j++) {
var T = sum32(
rotl32(
sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),
s[j]),
E);
A = E;
E = D;
D = rotl32(C, 10);
C = B;
B = T;
T = sum32(
rotl32(
sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),
sh[j]),
Eh);
Ah = Eh;
Eh = Dh;
Dh = rotl32(Ch, 10);
Ch = Bh;
Bh = T;
}
T = sum32_3(this.h[1], C, Dh);
this.h[1] = sum32_3(this.h[2], D, Eh);
this.h[2] = sum32_3(this.h[3], E, Ah);
this.h[3] = sum32_3(this.h[4], A, Bh);
this.h[4] = sum32_3(this.h[0], B, Ch);
this.h[0] = T;
};
RIPEMD160.prototype._digest = function digest(enc) {
if (enc === 'hex')
return utils.toHex32(this.h, 'little');
else
return utils.split32(this.h, 'little');
};
function f(j, x, y, z) {
if (j <= 15)
return x ^ y ^ z;
else if (j <= 31)
return (x & y) | ((~x) & z);
else if (j <= 47)
return (x | (~y)) ^ z;
else if (j <= 63)
return (x & z) | (y & (~z));
else
return x ^ (y | (~z));
}
function K(j) {
if (j <= 15)
return 0x00000000;
else if (j <= 31)
return 0x5a827999;
else if (j <= 47)
return 0x6ed9eba1;
else if (j <= 63)
return 0x8f1bbcdc;
else
return 0xa953fd4e;
}
function Kh(j) {
if (j <= 15)
return 0x50a28be6;
else if (j <= 31)
return 0x5c4dd124;
else if (j <= 47)
return 0x6d703ef3;
else if (j <= 63)
return 0x7a6d76e9;
else
return 0x00000000;
}
var r = [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
];
var rh = [
5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
];
var s = [
11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
];
var sh = [
8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
];
/***/ }),
/***/ 194:
/*!***********************************************!*\
!*** ./node_modules/hash.js/lib/hash/hmac.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__(/*! ./utils */ 184);
var assert = __webpack_require__(/*! minimalistic-assert */ 136);
function Hmac(hash, key, enc) {
if (!(this instanceof Hmac))
return new Hmac(hash, key, enc);
this.Hash = hash;
this.blockSize = hash.blockSize / 8;
this.outSize = hash.outSize / 8;
this.inner = null;
this.outer = null;
this._init(utils.toArray(key, enc));
}
module.exports = Hmac;
Hmac.prototype._init = function init(key) {
// Shorten key, if needed
if (key.length > this.blockSize)
key = new this.Hash().update(key).digest();
assert(key.length <= this.blockSize);
// Add padding to key
for (var i = key.length; i < this.blockSize; i++)
key.push(0);
for (i = 0; i < key.length; i++)
key[i] ^= 0x36;
this.inner = new this.Hash().update(key);
// 0x36 ^ 0x5c = 0x6a
for (i = 0; i < key.length; i++)
key[i] ^= 0x6a;
this.outer = new this.Hash().update(key);
};
Hmac.prototype.update = function update(msg, enc) {
this.inner.update(msg, enc);
return this;
};
Hmac.prototype.digest = function digest(enc) {
this.outer.update(this.inner.digest());
return this.outer.digest(enc);
};
/***/ }),
/***/ 195:
/*!*********************************************************************!*\
!*** ./node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = {
doubles: {
step: 4,
points: [
[
'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a',
'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821',
],
[
'8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508',
'11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf',
],
[
'175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739',
'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695',
],
[
'363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640',
'4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9',
],
[
'8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c',
'4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36',
],
[
'723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda',
'96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f',
],
[
'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa',
'5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999',
],
[
'100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0',
'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09',
],
[
'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d',
'9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d',
],
[
'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d',
'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088',
],
[
'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1',
'9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d',
],
[
'53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0',
'5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8',
],
[
'8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047',
'10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a',
],
[
'385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862',
'283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453',
],
[
'6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7',
'7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160',
],
[
'3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd',
'56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0',
],
[
'85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83',
'7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6',
],
[
'948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a',
'53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589',
],
[
'6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8',
'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17',
],
[
'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d',
'4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda',
],
[
'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725',
'7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd',
],
[
'213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754',
'4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2',
],
[
'4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c',
'17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6',
],
[
'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6',
'6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f',
],
[
'76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39',
'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01',
],
[
'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891',
'893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3',
],
[
'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b',
'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f',
],
[
'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03',
'2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7',
],
[
'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d',
'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78',
],
[
'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070',
'7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1',
],
[
'90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4',
'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150',
],
[
'8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da',
'662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82',
],
[
'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11',
'1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc',
],
[
'8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e',
'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b',
],
[
'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41',
'2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51',
],
[
'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef',
'67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45',
],
[
'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8',
'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120',
],
[
'324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d',
'648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84',
],
[
'4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96',
'35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d',
],
[
'9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd',
'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d',
],
[
'6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5',
'9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8',
],
[
'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266',
'40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8',
],
[
'7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71',
'34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac',
],
[
'928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac',
'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f',
],
[
'85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751',
'1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962',
],
[
'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e',
'493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907',
],
[
'827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241',
'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec',
],
[
'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3',
'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d',
],
[
'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f',
'4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414',
],
[
'1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19',
'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd',
],
[
'146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be',
'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0',
],
[
'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9',
'6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811',
],
[
'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2',
'8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1',
],
[
'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13',
'7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c',
],
[
'174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c',
'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73',
],
[
'959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba',
'2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd',
],
[
'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151',
'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405',
],
[
'64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073',
'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589',
],
[
'8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458',
'38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e',
],
[
'13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b',
'69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27',
],
[
'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366',
'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1',
],
[
'8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa',
'40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482',
],
[
'8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0',
'620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945',
],
[
'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787',
'7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573',
],
[
'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e',
'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82',
],
],
},
naf: {
wnd: 7,
points: [
[
'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9',
'388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672',
],
[
'2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4',
'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6',
],
[
'5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc',
'6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da',
],
[
'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe',
'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37',
],
[
'774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb',
'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b',
],
[
'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8',
'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81',
],
[
'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e',
'581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58',
],
[
'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34',
'4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77',
],
[
'2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c',
'85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a',
],
[
'352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5',
'321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c',
],
[
'2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f',
'2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67',
],
[
'9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714',
'73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402',
],
[
'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729',
'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55',
],
[
'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db',
'2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482',
],
[
'6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4',
'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82',
],
[
'1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5',
'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396',
],
[
'605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479',
'2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49',
],
[
'62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d',
'80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf',
],
[
'80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f',
'1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a',
],
[
'7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb',
'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7',
],
[
'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9',
'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933',
],
[
'49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963',
'758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a',
],
[
'77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74',
'958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6',
],
[
'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530',
'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37',
],
[
'463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b',
'5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e',
],
[
'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247',
'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6',
],
[
'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1',
'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476',
],
[
'2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120',
'4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40',
],
[
'7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435',
'91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61',
],
[
'754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18',
'673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683',
],
[
'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8',
'59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5',
],
[
'186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb',
'3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b',
],
[
'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f',
'55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417',
],
[
'5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143',
'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868',
],
[
'290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba',
'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a',
],
[
'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45',
'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6',
],
[
'766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a',
'744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996',
],
[
'59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e',
'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e',
],
[
'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8',
'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d',
],
[
'7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c',
'30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2',
],
[
'948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519',
'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e',
],
[
'7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab',
'100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437',
],
[
'3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca',
'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311',
],
[
'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf',
'8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4',
],
[
'1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610',
'68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575',
],
[
'733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4',
'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d',
],
[
'15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c',
'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d',
],
[
'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940',
'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629',
],
[
'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980',
'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06',
],
[
'311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3',
'66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374',
],
[
'34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf',
'9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee',
],
[
'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63',
'4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1',
],
[
'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448',
'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b',
],
[
'32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf',
'5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661',
],
[
'7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5',
'8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6',
],
[
'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6',
'8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e',
],
[
'16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5',
'5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d',
],
[
'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99',
'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc',
],
[
'78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51',
'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4',
],
[
'494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5',
'42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c',
],
[
'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5',
'204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b',
],
[
'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997',
'4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913',
],
[
'841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881',
'73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154',
],
[
'5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5',
'39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865',
],
[
'36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66',
'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc',
],
[
'336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726',
'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224',
],
[
'8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede',
'6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e',
],
[
'1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94',
'60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6',
],
[
'85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31',
'3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511',
],
[
'29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51',
'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b',
],
[
'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252',
'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2',
],
[
'4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5',
'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c',
],
[
'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b',
'6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3',
],
[
'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4',
'322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d',
],
[
'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f',
'6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700',
],
[
'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889',
'2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4',
],
[
'591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246',
'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196',
],
[
'11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984',
'998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4',
],
[
'3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a',
'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257',
],
[
'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030',
'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13',
],
[
'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197',
'6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096',
],
[
'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593',
'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38',
],
[
'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef',
'21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f',
],
[
'347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38',
'60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448',
],
[
'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a',
'49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a',
],
[
'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111',
'5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4',
],
[
'4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502',
'7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437',
],
[
'3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea',
'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7',
],
[
'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26',
'8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d',
],
[
'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986',
'39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a',
],
[
'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e',
'62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54',
],
[
'48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4',
'25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77',
],
[
'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda',
'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517',
],
[
'6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859',
'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10',
],
[
'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f',
'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125',
],
[
'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c',
'6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e',
],
[
'13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942',
'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1',
],
[
'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a',
'1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2',
],
[
'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80',
'5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423',
],
[
'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d',
'438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8',
],
[
'8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1',
'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758',
],
[
'52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63',
'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375',
],
[
'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352',
'6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d',
],
[
'7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193',
'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec',
],
[
'5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00',
'9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0',
],
[
'32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58',
'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c',
],
[
'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7',
'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4',
],
[
'8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8',
'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f',
],
[
'4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e',
'67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649',
],
[
'3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d',
'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826',
],
[
'674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b',
'299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5',
],
[
'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f',
'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87',
],
[
'30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6',
'462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b',
],
[
'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297',
'62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc',
],
[
'93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a',
'7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c',
],
[
'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c',
'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f',
],
[
'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52',
'4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a',
],
[
'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb',
'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46',
],
[
'463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065',
'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f',
],
[
'7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917',
'603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03',
],
[
'74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9',
'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08',
],
[
'30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3',
'553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8',
],
[
'9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57',
'712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373',
],
[
'176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66',
'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3',
],
[
'75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8',
'9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8',
],
[
'809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721',
'9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1',
],
[
'1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180',
'4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9',
],
],
},
};
/***/ }),
/***/ 196:
/*!********************************************************!*\
!*** ./node_modules/elliptic/lib/elliptic/ec/index.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var BN = __webpack_require__(/*! bn.js */ 162);
var HmacDRBG = __webpack_require__(/*! hmac-drbg */ 197);
var utils = __webpack_require__(/*! ../utils */ 175);
var curves = __webpack_require__(/*! ../curves */ 182);
var rand = __webpack_require__(/*! brorand */ 166);
var assert = utils.assert;
var KeyPair = __webpack_require__(/*! ./key */ 198);
var Signature = __webpack_require__(/*! ./signature */ 199);
function EC(options) {
if (!(this instanceof EC))
return new EC(options);
// Shortcut `elliptic.ec(curve-name)`
if (typeof options === 'string') {
assert(Object.prototype.hasOwnProperty.call(curves, options),
'Unknown curve ' + options);
options = curves[options];
}
// Shortcut for `elliptic.ec(elliptic.curves.curveName)`
if (options instanceof curves.PresetCurve)
options = { curve: options };
this.curve = options.curve.curve;
this.n = this.curve.n;
this.nh = this.n.ushrn(1);
this.g = this.curve.g;
// Point on curve
this.g = options.curve.g;
this.g.precompute(options.curve.n.bitLength() + 1);
// Hash for function for DRBG
this.hash = options.hash || options.curve.hash;
}
module.exports = EC;
EC.prototype.keyPair = function keyPair(options) {
return new KeyPair(this, options);
};
EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {
return KeyPair.fromPrivate(this, priv, enc);
};
EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {
return KeyPair.fromPublic(this, pub, enc);
};
EC.prototype.genKeyPair = function genKeyPair(options) {
if (!options)
options = {};
// Instantiate Hmac_DRBG
var drbg = new HmacDRBG({
hash: this.hash,
pers: options.pers,
persEnc: options.persEnc || 'utf8',
entropy: options.entropy || rand(this.hash.hmacStrength),
entropyEnc: options.entropy && options.entropyEnc || 'utf8',
nonce: this.n.toArray(),
});
var bytes = this.n.byteLength();
var ns2 = this.n.sub(new BN(2));
for (;;) {
var priv = new BN(drbg.generate(bytes));
if (priv.cmp(ns2) > 0)
continue;
priv.iaddn(1);
return this.keyFromPrivate(priv);
}
};
EC.prototype._truncateToN = function _truncateToN(msg, truncOnly) {
var delta = msg.byteLength() * 8 - this.n.bitLength();
if (delta > 0)
msg = msg.ushrn(delta);
if (!truncOnly && msg.cmp(this.n) >= 0)
return msg.sub(this.n);
else
return msg;
};
EC.prototype.sign = function sign(msg, key, enc, options) {
if (typeof enc === 'object') {
options = enc;
enc = null;
}
if (!options)
options = {};
key = this.keyFromPrivate(key, enc);
msg = this._truncateToN(new BN(msg, 16));
// Zero-extend key to provide enough entropy
var bytes = this.n.byteLength();
var bkey = key.getPrivate().toArray('be', bytes);
// Zero-extend nonce to have the same byte size as N
var nonce = msg.toArray('be', bytes);
// Instantiate Hmac_DRBG
var drbg = new HmacDRBG({
hash: this.hash,
entropy: bkey,
nonce: nonce,
pers: options.pers,
persEnc: options.persEnc || 'utf8',
});
// Number of bytes to generate
var ns1 = this.n.sub(new BN(1));
for (var iter = 0; ; iter++) {
var k = options.k ?
options.k(iter) :
new BN(drbg.generate(this.n.byteLength()));
k = this._truncateToN(k, true);
if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)
continue;
var kp = this.g.mul(k);
if (kp.isInfinity())
continue;
var kpX = kp.getX();
var r = kpX.umod(this.n);
if (r.cmpn(0) === 0)
continue;
var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));
s = s.umod(this.n);
if (s.cmpn(0) === 0)
continue;
var recoveryParam = (kp.getY().isOdd() ? 1 : 0) |
(kpX.cmp(r) !== 0 ? 2 : 0);
// Use complement of `s`, if it is > `n / 2`
if (options.canonical && s.cmp(this.nh) > 0) {
s = this.n.sub(s);
recoveryParam ^= 1;
}
return new Signature({ r: r, s: s, recoveryParam: recoveryParam });
}
};
EC.prototype.verify = function verify(msg, signature, key, enc) {
msg = this._truncateToN(new BN(msg, 16));
key = this.keyFromPublic(key, enc);
signature = new Signature(signature, 'hex');
// Perform primitive values validation
var r = signature.r;
var s = signature.s;
if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)
return false;
if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)
return false;
// Validate signature
var sinv = s.invm(this.n);
var u1 = sinv.mul(msg).umod(this.n);
var u2 = sinv.mul(r).umod(this.n);
var p;
if (!this.curve._maxwellTrick) {
p = this.g.mulAdd(u1, key.getPublic(), u2);
if (p.isInfinity())
return false;
return p.getX().umod(this.n).cmp(r) === 0;
}
// NOTE: Greg Maxwell's trick, inspired by:
// https://git.io/vad3K
p = this.g.jmulAdd(u1, key.getPublic(), u2);
if (p.isInfinity())
return false;
// Compare `p.x` of Jacobian point with `r`,
// this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the
// inverse of `p.z^2`
return p.eqXToP(r);
};
EC.prototype.recoverPubKey = function(msg, signature, j, enc) {
assert((3 & j) === j, 'The recovery param is more than two bits');
signature = new Signature(signature, enc);
var n = this.n;
var e = new BN(msg);
var r = signature.r;
var s = signature.s;
// A set LSB signifies that the y-coordinate is odd
var isYOdd = j & 1;
var isSecondKey = j >> 1;
if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)
throw new Error('Unable to find sencond key candinate');
// 1.1. Let x = r + jn.
if (isSecondKey)
r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);
else
r = this.curve.pointFromX(r, isYOdd);
var rInv = signature.r.invm(n);
var s1 = n.sub(e).mul(rInv).umod(n);
var s2 = s.mul(rInv).umod(n);
// 1.6.1 Compute Q = r^-1 (sR - eG)
// Q = r^-1 (sR + -eG)
return this.g.mulAdd(s1, r, s2);
};
EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {
signature = new Signature(signature, enc);
if (signature.recoveryParam !== null)
return signature.recoveryParam;
for (var i = 0; i < 4; i++) {
var Qprime;
try {
Qprime = this.recoverPubKey(e, signature, i);
} catch (e) {
continue;
}
if (Qprime.eq(Q))
return i;
}
throw new Error('Unable to find valid recovery factor');
};
/***/ }),
/***/ 197:
/*!*************************************************!*\
!*** ./node_modules/hmac-drbg/lib/hmac-drbg.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var hash = __webpack_require__(/*! hash.js */ 183);
var utils = __webpack_require__(/*! minimalistic-crypto-utils */ 176);
var assert = __webpack_require__(/*! minimalistic-assert */ 136);
function HmacDRBG(options) {
if (!(this instanceof HmacDRBG))
return new HmacDRBG(options);
this.hash = options.hash;
this.predResist = !!options.predResist;
this.outLen = this.hash.outSize;
this.minEntropy = options.minEntropy || this.hash.hmacStrength;
this._reseed = null;
this.reseedInterval = null;
this.K = null;
this.V = null;
var entropy = utils.toArray(options.entropy, options.entropyEnc || 'hex');
var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex');
var pers = utils.toArray(options.pers, options.persEnc || 'hex');
assert(entropy.length >= (this.minEntropy / 8),
'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');
this._init(entropy, nonce, pers);
}
module.exports = HmacDRBG;
HmacDRBG.prototype._init = function init(entropy, nonce, pers) {
var seed = entropy.concat(nonce).concat(pers);
this.K = new Array(this.outLen / 8);
this.V = new Array(this.outLen / 8);
for (var i = 0; i < this.V.length; i++) {
this.K[i] = 0x00;
this.V[i] = 0x01;
}
this._update(seed);
this._reseed = 1;
this.reseedInterval = 0x1000000000000; // 2^48
};
HmacDRBG.prototype._hmac = function hmac() {
return new hash.hmac(this.hash, this.K);
};
HmacDRBG.prototype._update = function update(seed) {
var kmac = this._hmac()
.update(this.V)
.update([ 0x00 ]);
if (seed)
kmac = kmac.update(seed);
this.K = kmac.digest();
this.V = this._hmac().update(this.V).digest();
if (!seed)
return;
this.K = this._hmac()
.update(this.V)
.update([ 0x01 ])
.update(seed)
.digest();
this.V = this._hmac().update(this.V).digest();
};
HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {
// Optional entropy enc
if (typeof entropyEnc !== 'string') {
addEnc = add;
add = entropyEnc;
entropyEnc = null;
}
entropy = utils.toArray(entropy, entropyEnc);
add = utils.toArray(add, addEnc);
assert(entropy.length >= (this.minEntropy / 8),
'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');
this._update(entropy.concat(add || []));
this._reseed = 1;
};
HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {
if (this._reseed > this.reseedInterval)
throw new Error('Reseed is required');
// Optional encoding
if (typeof enc !== 'string') {
addEnc = add;
add = enc;
enc = null;
}
// Optional additional data
if (add) {
add = utils.toArray(add, addEnc || 'hex');
this._update(add);
}
var temp = [];
while (temp.length < len) {
this.V = this._hmac().update(this.V).digest();
temp = temp.concat(this.V);
}
var res = temp.slice(0, len);
this._update(add);
this._reseed++;
return utils.encode(res, enc);
};
/***/ }),
/***/ 198:
/*!******************************************************!*\
!*** ./node_modules/elliptic/lib/elliptic/ec/key.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var BN = __webpack_require__(/*! bn.js */ 162);
var utils = __webpack_require__(/*! ../utils */ 175);
var assert = utils.assert;
function KeyPair(ec, options) {
this.ec = ec;
this.priv = null;
this.pub = null;
// KeyPair(ec, { priv: ..., pub: ... })
if (options.priv)
this._importPrivate(options.priv, options.privEnc);
if (options.pub)
this._importPublic(options.pub, options.pubEnc);
}
module.exports = KeyPair;
KeyPair.fromPublic = function fromPublic(ec, pub, enc) {
if (pub instanceof KeyPair)
return pub;
return new KeyPair(ec, {
pub: pub,
pubEnc: enc,
});
};
KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {
if (priv instanceof KeyPair)
return priv;
return new KeyPair(ec, {
priv: priv,
privEnc: enc,
});
};
KeyPair.prototype.validate = function validate() {
var pub = this.getPublic();
if (pub.isInfinity())
return { result: false, reason: 'Invalid public key' };
if (!pub.validate())
return { result: false, reason: 'Public key is not a point' };
if (!pub.mul(this.ec.curve.n).isInfinity())
return { result: false, reason: 'Public key * N != O' };
return { result: true, reason: null };
};
KeyPair.prototype.getPublic = function getPublic(compact, enc) {
// compact is optional argument
if (typeof compact === 'string') {
enc = compact;
compact = null;
}
if (!this.pub)
this.pub = this.ec.g.mul(this.priv);
if (!enc)
return this.pub;
return this.pub.encode(enc, compact);
};
KeyPair.prototype.getPrivate = function getPrivate(enc) {
if (enc === 'hex')
return this.priv.toString(16, 2);
else
return this.priv;
};
KeyPair.prototype._importPrivate = function _importPrivate(key, enc) {
this.priv = new BN(key, enc || 16);
// Ensure that the priv won't be bigger than n, otherwise we may fail
// in fixed multiplication method
this.priv = this.priv.umod(this.ec.curve.n);
};
KeyPair.prototype._importPublic = function _importPublic(key, enc) {
if (key.x || key.y) {
// Montgomery points only have an `x` coordinate.
// Weierstrass/Edwards points on the other hand have both `x` and
// `y` coordinates.
if (this.ec.curve.type === 'mont') {
assert(key.x, 'Need x coordinate');
} else if (this.ec.curve.type === 'short' ||
this.ec.curve.type === 'edwards') {
assert(key.x && key.y, 'Need both x and y coordinate');
}
this.pub = this.ec.curve.point(key.x, key.y);
return;
}
this.pub = this.ec.curve.decodePoint(key, enc);
};
// ECDH
KeyPair.prototype.derive = function derive(pub) {
if(!pub.validate()) {
assert(pub.validate(), 'public point not validated');
}
return pub.mul(this.priv).getX();
};
// ECDSA
KeyPair.prototype.sign = function sign(msg, enc, options) {
return this.ec.sign(msg, this, enc, options);
};
KeyPair.prototype.verify = function verify(msg, signature) {
return this.ec.verify(msg, signature, this);
};
KeyPair.prototype.inspect = function inspect() {
return '';
};
/***/ }),
/***/ 199:
/*!************************************************************!*\
!*** ./node_modules/elliptic/lib/elliptic/ec/signature.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var BN = __webpack_require__(/*! bn.js */ 162);
var utils = __webpack_require__(/*! ../utils */ 175);
var assert = utils.assert;
function Signature(options, enc) {
if (options instanceof Signature)
return options;
if (this._importDER(options, enc))
return;
assert(options.r && options.s, 'Signature without r or s');
this.r = new BN(options.r, 16);
this.s = new BN(options.s, 16);
if (options.recoveryParam === undefined)
this.recoveryParam = null;
else
this.recoveryParam = options.recoveryParam;
}
module.exports = Signature;
function Position() {
this.place = 0;
}
function getLength(buf, p) {
var initial = buf[p.place++];
if (!(initial & 0x80)) {
return initial;
}
var octetLen = initial & 0xf;
// Indefinite length or overflow
if (octetLen === 0 || octetLen > 4) {
return false;
}
var val = 0;
for (var i = 0, off = p.place; i < octetLen; i++, off++) {
val <<= 8;
val |= buf[off];
val >>>= 0;
}
// Leading zeroes
if (val <= 0x7f) {
return false;
}
p.place = off;
return val;
}
function rmPadding(buf) {
var i = 0;
var len = buf.length - 1;
while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {
i++;
}
if (i === 0) {
return buf;
}
return buf.slice(i);
}
Signature.prototype._importDER = function _importDER(data, enc) {
data = utils.toArray(data, enc);
var p = new Position();
if (data[p.place++] !== 0x30) {
return false;
}
var len = getLength(data, p);
if (len === false) {
return false;
}
if ((len + p.place) !== data.length) {
return false;
}
if (data[p.place++] !== 0x02) {
return false;
}
var rlen = getLength(data, p);
if (rlen === false) {
return false;
}
var r = data.slice(p.place, rlen + p.place);
p.place += rlen;
if (data[p.place++] !== 0x02) {
return false;
}
var slen = getLength(data, p);
if (slen === false) {
return false;
}
if (data.length !== slen + p.place) {
return false;
}
var s = data.slice(p.place, slen + p.place);
if (r[0] === 0) {
if (r[1] & 0x80) {
r = r.slice(1);
} else {
// Leading zeroes
return false;
}
}
if (s[0] === 0) {
if (s[1] & 0x80) {
s = s.slice(1);
} else {
// Leading zeroes
return false;
}
}
this.r = new BN(r);
this.s = new BN(s);
this.recoveryParam = null;
return true;
};
function constructLength(arr, len) {
if (len < 0x80) {
arr.push(len);
return;
}
var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);
arr.push(octets | 0x80);
while (--octets) {
arr.push((len >>> (octets << 3)) & 0xff);
}
arr.push(len);
}
Signature.prototype.toDER = function toDER(enc) {
var r = this.r.toArray();
var s = this.s.toArray();
// Pad values
if (r[0] & 0x80)
r = [ 0 ].concat(r);
// Pad values
if (s[0] & 0x80)
s = [ 0 ].concat(s);
r = rmPadding(r);
s = rmPadding(s);
while (!s[0] && !(s[1] & 0x80)) {
s = s.slice(1);
}
var arr = [ 0x02 ];
constructLength(arr, r.length);
arr = arr.concat(r);
arr.push(0x02);
constructLength(arr, s.length);
var backHalf = arr.concat(s);
var res = [ 0x30 ];
constructLength(res, backHalf.length);
res = res.concat(backHalf);
return utils.encode(res, enc);
};
/***/ }),
/***/ 2:
/*!************************************************************!*\
!*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(wx, global) {
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createApp = createApp;
exports.createComponent = createComponent;
exports.createPage = createPage;
exports.createPlugin = createPlugin;
exports.createSubpackageApp = createSubpackageApp;
exports.default = void 0;
var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
var realAtob;
var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
if (typeof atob !== 'function') {
realAtob = function realAtob(str) {
str = String(str).replace(/[\t\n\f\r ]+/g, '');
if (!b64re.test(str)) {
throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
}
// Adding the padding if missing, for semplicity
str += '=='.slice(2 - (str.length & 3));
var bitmap;
var result = '';
var r1;
var r2;
var i = 0;
for (; i < str.length;) {
bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 | (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
}
return result;
};
} else {
// 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
realAtob = atob;
}
function b64DecodeUnicode(str) {
return decodeURIComponent(realAtob(str).split('').map(function (c) {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join(''));
}
function getCurrentUserInfo() {
var token = wx.getStorageSync('uni_id_token') || '';
var tokenArr = token.split('.');
if (!token || tokenArr.length !== 3) {
return {
uid: null,
role: [],
permission: [],
tokenExpired: 0
};
}
var userInfo;
try {
userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
} catch (error) {
throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
}
userInfo.tokenExpired = userInfo.exp * 1000;
delete userInfo.exp;
delete userInfo.iat;
return userInfo;
}
function uniIdMixin(Vue) {
Vue.prototype.uniIDHasRole = function (roleId) {
var _getCurrentUserInfo = getCurrentUserInfo(),
role = _getCurrentUserInfo.role;
return role.indexOf(roleId) > -1;
};
Vue.prototype.uniIDHasPermission = function (permissionId) {
var _getCurrentUserInfo2 = getCurrentUserInfo(),
permission = _getCurrentUserInfo2.permission;
return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
};
Vue.prototype.uniIDTokenValid = function () {
var _getCurrentUserInfo3 = getCurrentUserInfo(),
tokenExpired = _getCurrentUserInfo3.tokenExpired;
return tokenExpired > Date.now();
};
}
var _toString = Object.prototype.toString;
var hasOwnProperty = Object.prototype.hasOwnProperty;
function isFn(fn) {
return typeof fn === 'function';
}
function isStr(str) {
return typeof str === 'string';
}
function isObject(obj) {
return obj !== null && (0, _typeof2.default)(obj) === 'object';
}
function isPlainObject(obj) {
return _toString.call(obj) === '[object Object]';
}
function hasOwn(obj, key) {
return hasOwnProperty.call(obj, key);
}
function noop() {}
/**
* Create a cached version of a pure function.
*/
function cached(fn) {
var cache = Object.create(null);
return function cachedFn(str) {
var hit = cache[str];
return hit || (cache[str] = fn(str));
};
}
/**
* Camelize a hyphen-delimited string.
*/
var camelizeRE = /-(\w)/g;
var camelize = cached(function (str) {
return str.replace(camelizeRE, function (_, c) {
return c ? c.toUpperCase() : '';
});
});
function sortObject(obj) {
var sortObj = {};
if (isPlainObject(obj)) {
Object.keys(obj).sort().forEach(function (key) {
sortObj[key] = obj[key];
});
}
return !Object.keys(sortObj) ? obj : sortObj;
}
var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
var globalInterceptors = {};
var scopedInterceptors = {};
function mergeHook(parentVal, childVal) {
var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
return res ? dedupeHooks(res) : res;
}
function dedupeHooks(hooks) {
var res = [];
for (var i = 0; i < hooks.length; i++) {
if (res.indexOf(hooks[i]) === -1) {
res.push(hooks[i]);
}
}
return res;
}
function removeHook(hooks, hook) {
var index = hooks.indexOf(hook);
if (index !== -1) {
hooks.splice(index, 1);
}
}
function mergeInterceptorHook(interceptor, option) {
Object.keys(option).forEach(function (hook) {
if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
}
});
}
function removeInterceptorHook(interceptor, option) {
if (!interceptor || !option) {
return;
}
Object.keys(option).forEach(function (hook) {
if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
removeHook(interceptor[hook], option[hook]);
}
});
}
function addInterceptor(method, option) {
if (typeof method === 'string' && isPlainObject(option)) {
mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
} else if (isPlainObject(method)) {
mergeInterceptorHook(globalInterceptors, method);
}
}
function removeInterceptor(method, option) {
if (typeof method === 'string') {
if (isPlainObject(option)) {
removeInterceptorHook(scopedInterceptors[method], option);
} else {
delete scopedInterceptors[method];
}
} else if (isPlainObject(method)) {
removeInterceptorHook(globalInterceptors, method);
}
}
function wrapperHook(hook, params) {
return function (data) {
return hook(data, params) || data;
};
}
function isPromise(obj) {
return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
}
function queue(hooks, data, params) {
var promise = false;
for (var i = 0; i < hooks.length; i++) {
var hook = hooks[i];
if (promise) {
promise = Promise.resolve(wrapperHook(hook, params));
} else {
var res = hook(data, params);
if (isPromise(res)) {
promise = Promise.resolve(res);
}
if (res === false) {
return {
then: function then() {}
};
}
}
}
return promise || {
then: function then(callback) {
return callback(data);
}
};
}
function wrapperOptions(interceptor) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
['success', 'fail', 'complete'].forEach(function (name) {
if (Array.isArray(interceptor[name])) {
var oldCallback = options[name];
options[name] = function callbackInterceptor(res) {
queue(interceptor[name], res, options).then(function (res) {
/* eslint-disable no-mixed-operators */
return isFn(oldCallback) && oldCallback(res) || res;
});
};
}
});
return options;
}
function wrapperReturnValue(method, returnValue) {
var returnValueHooks = [];
if (Array.isArray(globalInterceptors.returnValue)) {
returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
}
var interceptor = scopedInterceptors[method];
if (interceptor && Array.isArray(interceptor.returnValue)) {
returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
}
returnValueHooks.forEach(function (hook) {
returnValue = hook(returnValue) || returnValue;
});
return returnValue;
}
function getApiInterceptorHooks(method) {
var interceptor = Object.create(null);
Object.keys(globalInterceptors).forEach(function (hook) {
if (hook !== 'returnValue') {
interceptor[hook] = globalInterceptors[hook].slice();
}
});
var scopedInterceptor = scopedInterceptors[method];
if (scopedInterceptor) {
Object.keys(scopedInterceptor).forEach(function (hook) {
if (hook !== 'returnValue') {
interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
}
});
}
return interceptor;
}
function invokeApi(method, api, options) {
for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
params[_key - 3] = arguments[_key];
}
var interceptor = getApiInterceptorHooks(method);
if (interceptor && Object.keys(interceptor).length) {
if (Array.isArray(interceptor.invoke)) {
var res = queue(interceptor.invoke, options);
return res.then(function (options) {
// 重新访问 getApiInterceptorHooks, 允许 invoke 中再次调用 addInterceptor,removeInterceptor
return api.apply(void 0, [wrapperOptions(getApiInterceptorHooks(method), options)].concat(params));
});
} else {
return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
}
}
return api.apply(void 0, [options].concat(params));
}
var promiseInterceptor = {
returnValue: function returnValue(res) {
if (!isPromise(res)) {
return res;
}
return new Promise(function (resolve, reject) {
res.then(function (res) {
if (res[0]) {
reject(res[0]);
} else {
resolve(res[1]);
}
});
});
}
};
var SYNC_API_RE = /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting|initUTS|requireUTS|registerUTS/;
var CONTEXT_API_RE = /^create|Manager$/;
// Context例外情况
var CONTEXT_API_RE_EXC = ['createBLEConnection'];
// 同步例外情况
var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
var CALLBACK_API_RE = /^on|^off/;
function isContextApi(name) {
return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
}
function isSyncApi(name) {
return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
}
function isCallbackApi(name) {
return CALLBACK_API_RE.test(name) && name !== 'onPush';
}
function handlePromise(promise) {
return promise.then(function (data) {
return [null, data];
}).catch(function (err) {
return [err];
});
}
function shouldPromise(name) {
if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
return false;
}
return true;
}
/* eslint-disable no-extend-native */
if (!Promise.prototype.finally) {
Promise.prototype.finally = function (callback) {
var promise = this.constructor;
return this.then(function (value) {
return promise.resolve(callback()).then(function () {
return value;
});
}, function (reason) {
return promise.resolve(callback()).then(function () {
throw reason;
});
});
};
}
function promisify(name, api) {
if (!shouldPromise(name) || !isFn(api)) {
return api;
}
return function promiseApi() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
params[_key2 - 1] = arguments[_key2];
}
if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
}
return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
success: resolve,
fail: reject
})].concat(params));
})));
};
}
var EPS = 1e-4;
var BASE_DEVICE_WIDTH = 750;
var isIOS = false;
var deviceWidth = 0;
var deviceDPR = 0;
function checkDeviceWidth() {
var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
platform = _wx$getSystemInfoSync.platform,
pixelRatio = _wx$getSystemInfoSync.pixelRatio,
windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
deviceWidth = windowWidth;
deviceDPR = pixelRatio;
isIOS = platform === 'ios';
}
function upx2px(number, newDeviceWidth) {
if (deviceWidth === 0) {
checkDeviceWidth();
}
number = Number(number);
if (number === 0) {
return 0;
}
var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
if (result < 0) {
result = -result;
}
result = Math.floor(result + EPS);
if (result === 0) {
if (deviceDPR === 1 || !isIOS) {
result = 1;
} else {
result = 0.5;
}
}
return number < 0 ? -result : result;
}
var LOCALE_ZH_HANS = 'zh-Hans';
var LOCALE_ZH_HANT = 'zh-Hant';
var LOCALE_EN = 'en';
var LOCALE_FR = 'fr';
var LOCALE_ES = 'es';
var messages = {};
var locale;
{
locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
}
function initI18nMessages() {
if (!isEnableLocale()) {
return;
}
var localeKeys = Object.keys(__uniConfig.locales);
if (localeKeys.length) {
localeKeys.forEach(function (locale) {
var curMessages = messages[locale];
var userMessages = __uniConfig.locales[locale];
if (curMessages) {
Object.assign(curMessages, userMessages);
} else {
messages[locale] = userMessages;
}
});
}
}
initI18nMessages();
var i18n = (0, _uniI18n.initVueI18n)(locale, {});
var t = i18n.t;
var i18nMixin = i18n.mixin = {
beforeCreate: function beforeCreate() {
var _this = this;
var unwatch = i18n.i18n.watchLocale(function () {
_this.$forceUpdate();
});
this.$once('hook:beforeDestroy', function () {
unwatch();
});
},
methods: {
$$t: function $$t(key, values) {
return t(key, values);
}
}
};
var setLocale = i18n.setLocale;
var getLocale = i18n.getLocale;
function initAppLocale(Vue, appVm, locale) {
var state = Vue.observable({
locale: locale || i18n.getLocale()
});
var localeWatchers = [];
appVm.$watchLocale = function (fn) {
localeWatchers.push(fn);
};
Object.defineProperty(appVm, '$locale', {
get: function get() {
return state.locale;
},
set: function set(v) {
state.locale = v;
localeWatchers.forEach(function (watch) {
return watch(v);
});
}
});
}
function isEnableLocale() {
return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
}
function include(str, parts) {
return !!parts.find(function (part) {
return str.indexOf(part) !== -1;
});
}
function startsWith(str, parts) {
return parts.find(function (part) {
return str.indexOf(part) === 0;
});
}
function normalizeLocale(locale, messages) {
if (!locale) {
return;
}
locale = locale.trim().replace(/_/g, '-');
if (messages && messages[locale]) {
return locale;
}
locale = locale.toLowerCase();
if (locale === 'chinese') {
// 支付宝
return LOCALE_ZH_HANS;
}
if (locale.indexOf('zh') === 0) {
if (locale.indexOf('-hans') > -1) {
return LOCALE_ZH_HANS;
}
if (locale.indexOf('-hant') > -1) {
return LOCALE_ZH_HANT;
}
if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
return LOCALE_ZH_HANT;
}
return LOCALE_ZH_HANS;
}
var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
if (lang) {
return lang;
}
}
// export function initI18n() {
// const localeKeys = Object.keys(__uniConfig.locales || {})
// if (localeKeys.length) {
// localeKeys.forEach((locale) =>
// i18n.add(locale, __uniConfig.locales[locale])
// )
// }
// }
function getLocale$1() {
// 优先使用 $locale
if (isFn(getApp)) {
var app = getApp({
allowDefault: true
});
if (app && app.$vm) {
return app.$vm.$locale;
}
}
return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
}
function setLocale$1(locale) {
var app = isFn(getApp) ? getApp() : false;
if (!app) {
return false;
}
var oldLocale = app.$vm.$locale;
if (oldLocale !== locale) {
app.$vm.$locale = locale;
onLocaleChangeCallbacks.forEach(function (fn) {
return fn({
locale: locale
});
});
return true;
}
return false;
}
var onLocaleChangeCallbacks = [];
function onLocaleChange(fn) {
if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
onLocaleChangeCallbacks.push(fn);
}
}
if (typeof global !== 'undefined') {
global.getLocale = getLocale$1;
}
var interceptors = {
promiseInterceptor: promiseInterceptor
};
var baseApi = /*#__PURE__*/Object.freeze({
__proto__: null,
upx2px: upx2px,
getLocale: getLocale$1,
setLocale: setLocale$1,
onLocaleChange: onLocaleChange,
addInterceptor: addInterceptor,
removeInterceptor: removeInterceptor,
interceptors: interceptors
});
function findExistsPageIndex(url) {
var pages = getCurrentPages();
var len = pages.length;
while (len--) {
var page = pages[len];
if (page.$page && page.$page.fullPath === url) {
return len;
}
}
return -1;
}
var redirectTo = {
name: function name(fromArgs) {
if (fromArgs.exists === 'back' && fromArgs.delta) {
return 'navigateBack';
}
return 'redirectTo';
},
args: function args(fromArgs) {
if (fromArgs.exists === 'back' && fromArgs.url) {
var existsPageIndex = findExistsPageIndex(fromArgs.url);
if (existsPageIndex !== -1) {
var delta = getCurrentPages().length - 1 - existsPageIndex;
if (delta > 0) {
fromArgs.delta = delta;
}
}
}
}
};
var previewImage = {
args: function args(fromArgs) {
var currentIndex = parseInt(fromArgs.current);
if (isNaN(currentIndex)) {
return;
}
var urls = fromArgs.urls;
if (!Array.isArray(urls)) {
return;
}
var len = urls.length;
if (!len) {
return;
}
if (currentIndex < 0) {
currentIndex = 0;
} else if (currentIndex >= len) {
currentIndex = len - 1;
}
if (currentIndex > 0) {
fromArgs.current = urls[currentIndex];
fromArgs.urls = urls.filter(function (item, index) {
return index < currentIndex ? item !== urls[currentIndex] : true;
});
} else {
fromArgs.current = urls[0];
}
return {
indicator: false,
loop: false
};
}
};
var UUID_KEY = '__DC_STAT_UUID';
var deviceId;
function useDeviceId(result) {
deviceId = deviceId || wx.getStorageSync(UUID_KEY);
if (!deviceId) {
deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
wx.setStorage({
key: UUID_KEY,
data: deviceId
});
}
result.deviceId = deviceId;
}
function addSafeAreaInsets(result) {
if (result.safeArea) {
var safeArea = result.safeArea;
result.safeAreaInsets = {
top: safeArea.top,
left: safeArea.left,
right: result.windowWidth - safeArea.right,
bottom: result.screenHeight - safeArea.bottom
};
}
}
function populateParameters(result) {
var _result$brand = result.brand,
brand = _result$brand === void 0 ? '' : _result$brand,
_result$model = result.model,
model = _result$model === void 0 ? '' : _result$model,
_result$system = result.system,
system = _result$system === void 0 ? '' : _result$system,
_result$language = result.language,
language = _result$language === void 0 ? '' : _result$language,
theme = result.theme,
version = result.version,
platform = result.platform,
fontSizeSetting = result.fontSizeSetting,
SDKVersion = result.SDKVersion,
pixelRatio = result.pixelRatio,
deviceOrientation = result.deviceOrientation;
// const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
var extraParam = {};
// osName osVersion
var osName = '';
var osVersion = '';
{
osName = system.split(' ')[0] || '';
osVersion = system.split(' ')[1] || '';
}
var hostVersion = version;
// deviceType
var deviceType = getGetDeviceType(result, model);
// deviceModel
var deviceBrand = getDeviceBrand(brand);
// hostName
var _hostName = getHostName(result);
// deviceOrientation
var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
// devicePixelRatio
var _devicePixelRatio = pixelRatio;
// SDKVersion
var _SDKVersion = SDKVersion;
// hostLanguage
var hostLanguage = language.replace(/_/g, '-');
// wx.getAccountInfoSync
var parameters = {
appId: "__UNI__DBA6730",
appName: "云飞智控",
appVersion: "1.0.4",
appVersionCode: "104",
appLanguage: getAppLanguage(hostLanguage),
uniCompileVersion: "4.06",
uniRuntimeVersion: "4.06",
uniPlatform: undefined || "mp-weixin",
deviceBrand: deviceBrand,
deviceModel: model,
deviceType: deviceType,
devicePixelRatio: _devicePixelRatio,
deviceOrientation: _deviceOrientation,
osName: osName.toLocaleLowerCase(),
osVersion: osVersion,
hostTheme: theme,
hostVersion: hostVersion,
hostLanguage: hostLanguage,
hostName: _hostName,
hostSDKVersion: _SDKVersion,
hostFontSizeSetting: fontSizeSetting,
windowTop: 0,
windowBottom: 0,
// TODO
osLanguage: undefined,
osTheme: undefined,
ua: undefined,
hostPackageName: undefined,
browserName: undefined,
browserVersion: undefined
};
Object.assign(result, parameters, extraParam);
}
function getGetDeviceType(result, model) {
var deviceType = result.deviceType || 'phone';
{
var deviceTypeMaps = {
ipad: 'pad',
windows: 'pc',
mac: 'pc'
};
var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
var _model = model.toLocaleLowerCase();
for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
var _m = deviceTypeMapsKeys[index];
if (_model.indexOf(_m) !== -1) {
deviceType = deviceTypeMaps[_m];
break;
}
}
}
return deviceType;
}
function getDeviceBrand(brand) {
var deviceBrand = brand;
if (deviceBrand) {
deviceBrand = brand.toLocaleLowerCase();
}
return deviceBrand;
}
function getAppLanguage(defaultLanguage) {
return getLocale$1 ? getLocale$1() : defaultLanguage;
}
function getHostName(result) {
var _platform = 'WeChat';
var _hostName = result.hostName || _platform; // mp-jd
{
if (result.environment) {
_hostName = result.environment;
} else if (result.host && result.host.env) {
_hostName = result.host.env;
}
}
return _hostName;
}
var getSystemInfo = {
returnValue: function returnValue(result) {
useDeviceId(result);
addSafeAreaInsets(result);
populateParameters(result);
}
};
var showActionSheet = {
args: function args(fromArgs) {
if ((0, _typeof2.default)(fromArgs) === 'object') {
fromArgs.alertText = fromArgs.title;
}
}
};
var getAppBaseInfo = {
returnValue: function returnValue(result) {
var _result = result,
version = _result.version,
language = _result.language,
SDKVersion = _result.SDKVersion,
theme = _result.theme;
var _hostName = getHostName(result);
var hostLanguage = language.replace('_', '-');
result = sortObject(Object.assign(result, {
appId: "__UNI__DBA6730",
appName: "云飞智控",
appVersion: "1.0.4",
appVersionCode: "104",
appLanguage: getAppLanguage(hostLanguage),
hostVersion: version,
hostLanguage: hostLanguage,
hostName: _hostName,
hostSDKVersion: SDKVersion,
hostTheme: theme
}));
}
};
var getDeviceInfo = {
returnValue: function returnValue(result) {
var _result2 = result,
brand = _result2.brand,
model = _result2.model;
var deviceType = getGetDeviceType(result, model);
var deviceBrand = getDeviceBrand(brand);
useDeviceId(result);
result = sortObject(Object.assign(result, {
deviceType: deviceType,
deviceBrand: deviceBrand,
deviceModel: model
}));
}
};
var getWindowInfo = {
returnValue: function returnValue(result) {
addSafeAreaInsets(result);
result = sortObject(Object.assign(result, {
windowTop: 0,
windowBottom: 0
}));
}
};
var getAppAuthorizeSetting = {
returnValue: function returnValue(result) {
var locationReducedAccuracy = result.locationReducedAccuracy;
result.locationAccuracy = 'unsupported';
if (locationReducedAccuracy === true) {
result.locationAccuracy = 'reduced';
} else if (locationReducedAccuracy === false) {
result.locationAccuracy = 'full';
}
}
};
// import navigateTo from 'uni-helpers/navigate-to'
var compressImage = {
args: function args(fromArgs) {
// https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
fromArgs.compressHeight = fromArgs.compressedHeight;
}
if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
fromArgs.compressWidth = fromArgs.compressedWidth;
}
}
};
var protocols = {
redirectTo: redirectTo,
// navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
previewImage: previewImage,
getSystemInfo: getSystemInfo,
getSystemInfoSync: getSystemInfo,
showActionSheet: showActionSheet,
getAppBaseInfo: getAppBaseInfo,
getDeviceInfo: getDeviceInfo,
getWindowInfo: getWindowInfo,
getAppAuthorizeSetting: getAppAuthorizeSetting,
compressImage: compressImage
};
var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
var canIUses = [];
var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
function processCallback(methodName, method, returnValue) {
return function (res) {
return method(processReturnValue(methodName, res, returnValue));
};
}
function processArgs(methodName, fromArgs) {
var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
if (isPlainObject(fromArgs)) {
// 一般 api 的参数解析
var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
if (isFn(argsOption)) {
argsOption = argsOption(fromArgs, toArgs) || {};
}
for (var key in fromArgs) {
if (hasOwn(argsOption, key)) {
var keyOption = argsOption[key];
if (isFn(keyOption)) {
keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
}
if (!keyOption) {
// 不支持的参数
console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
} else if (isStr(keyOption)) {
// 重写参数 key
toArgs[keyOption] = fromArgs[key];
} else if (isPlainObject(keyOption)) {
// {name:newName,value:value}可重新指定参数 key:value
toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
}
} else if (CALLBACKS.indexOf(key) !== -1) {
if (isFn(fromArgs[key])) {
toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
}
} else {
if (!keepFromArgs) {
toArgs[key] = fromArgs[key];
}
}
}
return toArgs;
} else if (isFn(fromArgs)) {
fromArgs = processCallback(methodName, fromArgs, returnValue);
}
return fromArgs;
}
function processReturnValue(methodName, res, returnValue) {
var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
if (isFn(protocols.returnValue)) {
// 处理通用 returnValue
res = protocols.returnValue(methodName, res);
}
return processArgs(methodName, res, returnValue, {}, keepReturnValue);
}
function wrapper(methodName, method) {
if (hasOwn(protocols, methodName)) {
var protocol = protocols[methodName];
if (!protocol) {
// 暂不支持的 api
return function () {
console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
};
}
return function (arg1, arg2) {
// 目前 api 最多两个参数
var options = protocol;
if (isFn(protocol)) {
options = protocol(arg1);
}
arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
var args = [arg1];
if (typeof arg2 !== 'undefined') {
args.push(arg2);
}
if (isFn(options.name)) {
methodName = options.name(arg1);
} else if (isStr(options.name)) {
methodName = options.name;
}
var returnValue = wx[methodName].apply(wx, args);
if (isSyncApi(methodName)) {
// 同步 api
return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
}
return returnValue;
};
}
return method;
}
var todoApis = Object.create(null);
var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
function createTodoApi(name) {
return function todoApi(_ref) {
var fail = _ref.fail,
complete = _ref.complete;
var res = {
errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
};
isFn(fail) && fail(res);
isFn(complete) && complete(res);
};
}
TODOS.forEach(function (name) {
todoApis[name] = createTodoApi(name);
});
var providers = {
oauth: ['weixin'],
share: ['weixin'],
payment: ['wxpay'],
push: ['weixin']
};
function getProvider(_ref2) {
var service = _ref2.service,
success = _ref2.success,
fail = _ref2.fail,
complete = _ref2.complete;
var res = false;
if (providers[service]) {
res = {
errMsg: 'getProvider:ok',
service: service,
provider: providers[service]
};
isFn(success) && success(res);
} else {
res = {
errMsg: 'getProvider:fail service not found'
};
isFn(fail) && fail(res);
}
isFn(complete) && complete(res);
}
var extraApi = /*#__PURE__*/Object.freeze({
__proto__: null,
getProvider: getProvider
});
var getEmitter = function () {
var Emitter;
return function getUniEmitter() {
if (!Emitter) {
Emitter = new _vue.default();
}
return Emitter;
};
}();
function apply(ctx, method, args) {
return ctx[method].apply(ctx, args);
}
function $on() {
return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
}
function $off() {
return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
}
function $once() {
return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
}
function $emit() {
return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
}
var eventApi = /*#__PURE__*/Object.freeze({
__proto__: null,
$on: $on,
$off: $off,
$once: $once,
$emit: $emit
});
/**
* 框架内 try-catch
*/
/**
* 开发者 try-catch
*/
function tryCatch(fn) {
return function () {
try {
return fn.apply(fn, arguments);
} catch (e) {
// TODO
console.error(e);
}
};
}
function getApiCallbacks(params) {
var apiCallbacks = {};
for (var name in params) {
var param = params[name];
if (isFn(param)) {
apiCallbacks[name] = tryCatch(param);
delete params[name];
}
}
return apiCallbacks;
}
var cid;
var cidErrMsg;
var enabled;
function normalizePushMessage(message) {
try {
return JSON.parse(message);
} catch (e) {}
return message;
}
function invokePushCallback(args) {
if (args.type === 'enabled') {
enabled = true;
} else if (args.type === 'clientId') {
cid = args.cid;
cidErrMsg = args.errMsg;
invokeGetPushCidCallbacks(cid, args.errMsg);
} else if (args.type === 'pushMsg') {
var message = {
type: 'receive',
data: normalizePushMessage(args.message)
};
for (var i = 0; i < onPushMessageCallbacks.length; i++) {
var callback = onPushMessageCallbacks[i];
callback(message);
// 该消息已被阻止
if (message.stopped) {
break;
}
}
} else if (args.type === 'click') {
onPushMessageCallbacks.forEach(function (callback) {
callback({
type: 'click',
data: normalizePushMessage(args.message)
});
});
}
}
var getPushCidCallbacks = [];
function invokeGetPushCidCallbacks(cid, errMsg) {
getPushCidCallbacks.forEach(function (callback) {
callback(cid, errMsg);
});
getPushCidCallbacks.length = 0;
}
function getPushClientId(args) {
if (!isPlainObject(args)) {
args = {};
}
var _getApiCallbacks = getApiCallbacks(args),
success = _getApiCallbacks.success,
fail = _getApiCallbacks.fail,
complete = _getApiCallbacks.complete;
var hasSuccess = isFn(success);
var hasFail = isFn(fail);
var hasComplete = isFn(complete);
Promise.resolve().then(function () {
if (typeof enabled === 'undefined') {
enabled = false;
cid = '';
cidErrMsg = 'uniPush is not enabled';
}
getPushCidCallbacks.push(function (cid, errMsg) {
var res;
if (cid) {
res = {
errMsg: 'getPushClientId:ok',
cid: cid
};
hasSuccess && success(res);
} else {
res = {
errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
};
hasFail && fail(res);
}
hasComplete && complete(res);
});
if (typeof cid !== 'undefined') {
invokeGetPushCidCallbacks(cid, cidErrMsg);
}
});
}
var onPushMessageCallbacks = [];
// 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
var onPushMessage = function onPushMessage(fn) {
if (onPushMessageCallbacks.indexOf(fn) === -1) {
onPushMessageCallbacks.push(fn);
}
};
var offPushMessage = function offPushMessage(fn) {
if (!fn) {
onPushMessageCallbacks.length = 0;
} else {
var index = onPushMessageCallbacks.indexOf(fn);
if (index > -1) {
onPushMessageCallbacks.splice(index, 1);
}
}
};
var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
if (!baseInfo) {
baseInfo = wx.getSystemInfoSync();
}
var host = baseInfo ? baseInfo.host : null;
var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
var api = /*#__PURE__*/Object.freeze({
__proto__: null,
shareVideoMessage: shareVideoMessage,
getPushClientId: getPushClientId,
onPushMessage: onPushMessage,
offPushMessage: offPushMessage,
invokePushCallback: invokePushCallback
});
var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
function findVmByVueId(vm, vuePid) {
var $children = vm.$children;
// 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
for (var i = $children.length - 1; i >= 0; i--) {
var childVm = $children[i];
if (childVm.$scope._$vueId === vuePid) {
return childVm;
}
}
// 反向递归查找
var parentVm;
for (var _i = $children.length - 1; _i >= 0; _i--) {
parentVm = findVmByVueId($children[_i], vuePid);
if (parentVm) {
return parentVm;
}
}
}
function initBehavior(options) {
return Behavior(options);
}
function isPage() {
return !!this.route;
}
function initRelation(detail) {
this.triggerEvent('__l', detail);
}
function selectAllComponents(mpInstance, selector, $refs) {
var components = mpInstance.selectAllComponents(selector) || [];
components.forEach(function (component) {
var ref = component.dataset.ref;
$refs[ref] = component.$vm || toSkip(component);
{
if (component.dataset.vueGeneric === 'scoped') {
component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
selectAllComponents(scopedComponent, selector, $refs);
});
}
}
});
}
function syncRefs(refs, newRefs) {
var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
var newKeys = Object.keys(newRefs);
newKeys.forEach(function (key) {
var oldValue = refs[key];
var newValue = newRefs[key];
if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
return oldValue.includes(value);
})) {
return;
}
refs[key] = newValue;
oldKeys.delete(key);
});
oldKeys.forEach(function (key) {
delete refs[key];
});
return refs;
}
function initRefs(vm) {
var mpInstance = vm.$scope;
var refs = {};
Object.defineProperty(vm, '$refs', {
get: function get() {
var $refs = {};
selectAllComponents(mpInstance, '.vue-ref', $refs);
// TODO 暂不考虑 for 中的 scoped
var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
forComponents.forEach(function (component) {
var ref = component.dataset.ref;
if (!$refs[ref]) {
$refs[ref] = [];
}
$refs[ref].push(component.$vm || toSkip(component));
});
return syncRefs(refs, $refs);
}
});
}
function handleLink(event) {
var _ref3 = event.detail || event.value,
vuePid = _ref3.vuePid,
vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
var parentVm;
if (vuePid) {
parentVm = findVmByVueId(this.$vm, vuePid);
}
if (!parentVm) {
parentVm = this.$vm;
}
vueOptions.parent = parentVm;
}
function markMPComponent(component) {
// 在 Vue 中标记为小程序组件
var IS_MP = '__v_isMPComponent';
Object.defineProperty(component, IS_MP, {
configurable: true,
enumerable: false,
value: true
});
return component;
}
function toSkip(obj) {
var OB = '__ob__';
var SKIP = '__v_skip';
if (isObject(obj) && Object.isExtensible(obj)) {
// 避免被 @vue/composition-api 观测
Object.defineProperty(obj, OB, {
configurable: true,
enumerable: false,
value: (0, _defineProperty2.default)({}, SKIP, true)
});
}
return obj;
}
var WORKLET_RE = /_(.*)_worklet_factory_/;
function initWorkletMethods(mpMethods, vueMethods) {
if (vueMethods) {
Object.keys(vueMethods).forEach(function (name) {
var matches = name.match(WORKLET_RE);
if (matches) {
var workletName = matches[1];
mpMethods[name] = vueMethods[name];
mpMethods[workletName] = vueMethods[workletName];
}
});
}
}
var MPPage = Page;
var MPComponent = Component;
var customizeRE = /:/g;
var customize = cached(function (str) {
return camelize(str.replace(customizeRE, '-'));
});
function initTriggerEvent(mpInstance) {
var oldTriggerEvent = mpInstance.triggerEvent;
var newTriggerEvent = function newTriggerEvent(event) {
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
args[_key3 - 1] = arguments[_key3];
}
// 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
if (this.$vm || this.dataset && this.dataset.comType) {
event = customize(event);
} else {
// 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
var newEvent = customize(event);
if (newEvent !== event) {
oldTriggerEvent.apply(this, [newEvent].concat(args));
}
}
return oldTriggerEvent.apply(this, [event].concat(args));
};
try {
// 京东小程序 triggerEvent 为只读
mpInstance.triggerEvent = newTriggerEvent;
} catch (error) {
mpInstance._triggerEvent = newTriggerEvent;
}
}
function initHook(name, options, isComponent) {
var oldHook = options[name];
options[name] = function () {
markMPComponent(this);
initTriggerEvent(this);
if (oldHook) {
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
args[_key4] = arguments[_key4];
}
return oldHook.apply(this, args);
}
};
}
if (!MPPage.__$wrappered) {
MPPage.__$wrappered = true;
Page = function Page() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
initHook('onLoad', options);
return MPPage(options);
};
Page.after = MPPage.after;
Component = function Component() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
initHook('created', options);
return MPComponent(options);
};
}
var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
function initMocks(vm, mocks) {
var mpInstance = vm.$mp[vm.mpType];
mocks.forEach(function (mock) {
if (hasOwn(mpInstance, mock)) {
vm[mock] = mpInstance[mock];
}
});
}
function hasHook(hook, vueOptions) {
if (!vueOptions) {
return true;
}
if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
return true;
}
vueOptions = vueOptions.default || vueOptions;
if (isFn(vueOptions)) {
if (isFn(vueOptions.extendOptions[hook])) {
return true;
}
if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
return true;
}
return false;
}
if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
return true;
}
var mixins = vueOptions.mixins;
if (Array.isArray(mixins)) {
return !!mixins.find(function (mixin) {
return hasHook(hook, mixin);
});
}
}
function initHooks(mpOptions, hooks, vueOptions) {
hooks.forEach(function (hook) {
if (hasHook(hook, vueOptions)) {
mpOptions[hook] = function (args) {
return this.$vm && this.$vm.__call_hook(hook, args);
};
}
});
}
function initUnknownHooks(mpOptions, vueOptions) {
var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
findHooks(vueOptions).forEach(function (hook) {
return initHook$1(mpOptions, hook, excludes);
});
}
function findHooks(vueOptions) {
var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
if (vueOptions) {
Object.keys(vueOptions).forEach(function (name) {
if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
hooks.push(name);
}
});
}
return hooks;
}
function initHook$1(mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
return this.$vm && this.$vm.__call_hook(hook, args);
};
}
}
function initVueComponent(Vue, vueOptions) {
vueOptions = vueOptions.default || vueOptions;
var VueComponent;
if (isFn(vueOptions)) {
VueComponent = vueOptions;
} else {
VueComponent = Vue.extend(vueOptions);
}
vueOptions = VueComponent.options;
return [VueComponent, vueOptions];
}
function initSlots(vm, vueSlots) {
if (Array.isArray(vueSlots) && vueSlots.length) {
var $slots = Object.create(null);
vueSlots.forEach(function (slotName) {
$slots[slotName] = true;
});
vm.$scopedSlots = vm.$slots = $slots;
}
}
function initVueIds(vueIds, mpInstance) {
vueIds = (vueIds || '').split(',');
var len = vueIds.length;
if (len === 1) {
mpInstance._$vueId = vueIds[0];
} else if (len === 2) {
mpInstance._$vueId = vueIds[0];
mpInstance._$vuePid = vueIds[1];
}
}
function initData(vueOptions, context) {
var data = vueOptions.data || {};
var methods = vueOptions.methods || {};
if (typeof data === 'function') {
try {
data = data.call(context); // 支持 Vue.prototype 上挂的数据
} catch (e) {
if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"云飞智控","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
}
}
} else {
try {
// 对 data 格式化
data = JSON.parse(JSON.stringify(data));
} catch (e) {}
}
if (!isPlainObject(data)) {
data = {};
}
Object.keys(methods).forEach(function (methodName) {
if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
data[methodName] = methods[methodName];
}
});
return data;
}
var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
function createObserver(name) {
return function observer(newVal, oldVal) {
if (this.$vm) {
this.$vm[name] = newVal; // 为了触发其他非 render watcher
}
};
}
function initBehaviors(vueOptions, initBehavior) {
var vueBehaviors = vueOptions.behaviors;
var vueExtends = vueOptions.extends;
var vueMixins = vueOptions.mixins;
var vueProps = vueOptions.props;
if (!vueProps) {
vueOptions.props = vueProps = [];
}
var behaviors = [];
if (Array.isArray(vueBehaviors)) {
vueBehaviors.forEach(function (behavior) {
behaviors.push(behavior.replace('uni://', "wx".concat("://")));
if (behavior === 'uni://form-field') {
if (Array.isArray(vueProps)) {
vueProps.push('name');
vueProps.push('value');
} else {
vueProps.name = {
type: String,
default: ''
};
vueProps.value = {
type: [String, Number, Boolean, Array, Object, Date],
default: ''
};
}
}
});
}
if (isPlainObject(vueExtends) && vueExtends.props) {
behaviors.push(initBehavior({
properties: initProperties(vueExtends.props, true)
}));
}
if (Array.isArray(vueMixins)) {
vueMixins.forEach(function (vueMixin) {
if (isPlainObject(vueMixin) && vueMixin.props) {
behaviors.push(initBehavior({
properties: initProperties(vueMixin.props, true)
}));
}
});
}
return behaviors;
}
function parsePropType(key, type, defaultValue, file) {
// [String]=>String
if (Array.isArray(type) && type.length === 1) {
return type[0];
}
return type;
}
function initProperties(props) {
var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
var options = arguments.length > 3 ? arguments[3] : undefined;
var properties = {};
if (!isBehavior) {
properties.vueId = {
type: String,
value: ''
};
{
if (options.virtualHost) {
properties.virtualHostStyle = {
type: null,
value: ''
};
properties.virtualHostClass = {
type: null,
value: ''
};
}
}
// scopedSlotsCompiler auto
properties.scopedSlotsCompiler = {
type: String,
value: ''
};
properties.vueSlots = {
// 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
type: null,
value: [],
observer: function observer(newVal, oldVal) {
var $slots = Object.create(null);
newVal.forEach(function (slotName) {
$slots[slotName] = true;
});
this.setData({
$slots: $slots
});
}
};
}
if (Array.isArray(props)) {
// ['title']
props.forEach(function (key) {
properties[key] = {
type: null,
observer: createObserver(key)
};
});
} else if (isPlainObject(props)) {
// {title:{type:String,default:''},content:String}
Object.keys(props).forEach(function (key) {
var opts = props[key];
if (isPlainObject(opts)) {
// title:{type:String,default:''}
var value = opts.default;
if (isFn(value)) {
value = value();
}
opts.type = parsePropType(key, opts.type);
properties[key] = {
type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
value: value,
observer: createObserver(key)
};
} else {
// content:String
var type = parsePropType(key, opts);
properties[key] = {
type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
observer: createObserver(key)
};
}
});
}
return properties;
}
function wrapper$1(event) {
// TODO 又得兼容 mpvue 的 mp 对象
try {
event.mp = JSON.parse(JSON.stringify(event));
} catch (e) {}
event.stopPropagation = noop;
event.preventDefault = noop;
event.target = event.target || {};
if (!hasOwn(event, 'detail')) {
event.detail = {};
}
if (hasOwn(event, 'markerId')) {
event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
event.detail.markerId = event.markerId;
}
if (isPlainObject(event.detail)) {
event.target = Object.assign({}, event.target, event.detail);
}
return event;
}
function getExtraValue(vm, dataPathsArray) {
var context = vm;
dataPathsArray.forEach(function (dataPathArray) {
var dataPath = dataPathArray[0];
var value = dataPathArray[2];
if (dataPath || typeof value !== 'undefined') {
// ['','',index,'disable']
var propPath = dataPathArray[1];
var valuePath = dataPathArray[3];
var vFor;
if (Number.isInteger(dataPath)) {
vFor = dataPath;
} else if (!dataPath) {
vFor = context;
} else if (typeof dataPath === 'string' && dataPath) {
if (dataPath.indexOf('#s#') === 0) {
vFor = dataPath.substr(3);
} else {
vFor = vm.__get_value(dataPath, context);
}
}
if (Number.isInteger(vFor)) {
context = value;
} else if (!propPath) {
context = vFor[value];
} else {
if (Array.isArray(vFor)) {
context = vFor.find(function (vForItem) {
return vm.__get_value(propPath, vForItem) === value;
});
} else if (isPlainObject(vFor)) {
context = Object.keys(vFor).find(function (vForKey) {
return vm.__get_value(propPath, vFor[vForKey]) === value;
});
} else {
console.error('v-for 暂不支持循环数据:', vFor);
}
}
if (valuePath) {
context = vm.__get_value(valuePath, context);
}
}
});
return context;
}
function processEventExtra(vm, extra, event, __args__) {
var extraObj = {};
if (Array.isArray(extra) && extra.length) {
/**
*[
* ['data.items', 'data.id', item.data.id],
* ['metas', 'id', meta.id]
*],
*[
* ['data.items', 'data.id', item.data.id],
* ['metas', 'id', meta.id]
*],
*'test'
*/
extra.forEach(function (dataPath, index) {
if (typeof dataPath === 'string') {
if (!dataPath) {
// model,prop.sync
extraObj['$' + index] = vm;
} else {
if (dataPath === '$event') {
// $event
extraObj['$' + index] = event;
} else if (dataPath === 'arguments') {
extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
} else if (dataPath.indexOf('$event.') === 0) {
// $event.target.value
extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
} else {
extraObj['$' + index] = vm.__get_value(dataPath);
}
}
} else {
extraObj['$' + index] = getExtraValue(vm, dataPath);
}
});
}
return extraObj;
}
function getObjByArray(arr) {
var obj = {};
for (var i = 1; i < arr.length; i++) {
var element = arr[i];
obj[element[0]] = element[1];
}
return obj;
}
function processEventArgs(vm, event) {
var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
var isCustom = arguments.length > 4 ? arguments[4] : undefined;
var methodName = arguments.length > 5 ? arguments[5] : undefined;
var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
// fixed 用户直接触发 mpInstance.triggerEvent
var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
if (isCustom) {
// 自定义事件
isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
if (!args.length) {
// 无参数,直接传入 event 或 detail 数组
if (isCustomMPEvent) {
return [event];
}
return __args__;
}
}
var extraObj = processEventExtra(vm, extra, event, __args__);
var ret = [];
args.forEach(function (arg) {
if (arg === '$event') {
if (methodName === '__set_model' && !isCustom) {
// input v-model value
ret.push(event.target.value);
} else {
if (isCustom && !isCustomMPEvent) {
ret.push(__args__[0]);
} else {
// wxcomponent 组件或内置组件
ret.push(event);
}
}
} else {
if (Array.isArray(arg) && arg[0] === 'o') {
ret.push(getObjByArray(arg));
} else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
ret.push(extraObj[arg]);
} else {
ret.push(arg);
}
}
});
return ret;
}
var ONCE = '~';
var CUSTOM = '^';
function isMatchEventType(eventType, optType) {
return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
}
function getContextVm(vm) {
var $parent = vm.$parent;
// 父组件是 scoped slots 或者其他自定义组件时继续查找
while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
$parent = $parent.$parent;
}
return $parent && $parent.$parent;
}
function handleEvent(event) {
var _this2 = this;
event = wrapper$1(event);
// [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
var dataset = (event.currentTarget || event.target).dataset;
if (!dataset) {
return console.warn('事件信息不存在');
}
var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
if (!eventOpts) {
return console.warn('事件信息不存在');
}
// [['handle',[1,2,a]],['handle1',[1,2,a]]]
var eventType = event.type;
var ret = [];
eventOpts.forEach(function (eventOpt) {
var type = eventOpt[0];
var eventsArray = eventOpt[1];
var isCustom = type.charAt(0) === CUSTOM;
type = isCustom ? type.slice(1) : type;
var isOnce = type.charAt(0) === ONCE;
type = isOnce ? type.slice(1) : type;
if (eventsArray && isMatchEventType(eventType, type)) {
eventsArray.forEach(function (eventArray) {
var methodName = eventArray[0];
if (methodName) {
var handlerCtx = _this2.$vm;
if (handlerCtx.$options.generic) {
// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx = getContextVm(handlerCtx) || handlerCtx;
}
if (methodName === '$emit') {
handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
return;
}
var handler = handlerCtx[methodName];
if (!isFn(handler)) {
var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
var path = _this2.route || _this2.is;
throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
}
if (isOnce) {
if (handler.once) {
return;
}
handler.once = true;
}
var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
params = Array.isArray(params) ? params : [];
// 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
// eslint-disable-next-line no-sparse-arrays
params = params.concat([,,,,,,,,,, event]);
}
ret.push(handler.apply(handlerCtx, params));
}
});
}
});
if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
return ret[0];
}
}
var eventChannels = {};
function getEventChannel(id) {
var eventChannel = eventChannels[id];
delete eventChannels[id];
return eventChannel;
}
var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
function initEventChannel() {
_vue.default.prototype.getOpenerEventChannel = function () {
// 微信小程序使用自身getOpenerEventChannel
{
return this.$scope.getOpenerEventChannel();
}
};
var callHook = _vue.default.prototype.__call_hook;
_vue.default.prototype.__call_hook = function (hook, args) {
if (hook === 'onLoad' && args && args.__id__) {
this.__eventChannel__ = getEventChannel(args.__id__);
delete args.__id__;
}
return callHook.call(this, hook, args);
};
}
function initScopedSlotsParams() {
var center = {};
var parents = {};
function currentId(fn) {
var vueIds = this.$options.propsData.vueId;
if (vueIds) {
var vueId = vueIds.split(',')[0];
fn(vueId);
}
}
_vue.default.prototype.$hasSSP = function (vueId) {
var slot = center[vueId];
if (!slot) {
parents[vueId] = this;
this.$on('hook:destroyed', function () {
delete parents[vueId];
});
}
return slot;
};
_vue.default.prototype.$getSSP = function (vueId, name, needAll) {
var slot = center[vueId];
if (slot) {
var params = slot[name] || [];
if (needAll) {
return params;
}
return params[0];
}
};
_vue.default.prototype.$setSSP = function (name, value) {
var index = 0;
currentId.call(this, function (vueId) {
var slot = center[vueId];
var params = slot[name] = slot[name] || [];
params.push(value);
index = params.length - 1;
});
return index;
};
_vue.default.prototype.$initSSP = function () {
currentId.call(this, function (vueId) {
center[vueId] = {};
});
};
_vue.default.prototype.$callSSP = function () {
currentId.call(this, function (vueId) {
if (parents[vueId]) {
parents[vueId].$forceUpdate();
}
});
};
_vue.default.mixin({
destroyed: function destroyed() {
var propsData = this.$options.propsData;
var vueId = propsData && propsData.vueId;
if (vueId) {
delete center[vueId];
delete parents[vueId];
}
}
});
}
function parseBaseApp(vm, _ref4) {
var mocks = _ref4.mocks,
initRefs = _ref4.initRefs;
initEventChannel();
{
initScopedSlotsParams();
}
if (vm.$options.store) {
_vue.default.prototype.$store = vm.$options.store;
}
uniIdMixin(_vue.default);
_vue.default.prototype.mpHost = "mp-weixin";
_vue.default.mixin({
beforeCreate: function beforeCreate() {
if (!this.$options.mpType) {
return;
}
this.mpType = this.$options.mpType;
this.$mp = (0, _defineProperty2.default)({
data: {}
}, this.mpType, this.$options.mpInstance);
this.$scope = this.$options.mpInstance;
delete this.$options.mpType;
delete this.$options.mpInstance;
if (this.mpType === 'page' && typeof getApp === 'function') {
// hack vue-i18n
var app = getApp();
if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n;
}
}
if (this.mpType !== 'app') {
initRefs(this);
initMocks(this, mocks);
}
}
});
var appOptions = {
onLaunch: function onLaunch(args) {
if (this.$vm) {
// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
return;
}
{
if (wx.canIUse && !wx.canIUse('nextTick')) {
// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
}
}
this.$vm = vm;
this.$vm.$mp = {
app: this
};
this.$vm.$scope = this;
// vm 上也挂载 globalData
this.$vm.globalData = this.globalData;
this.$vm._isMounted = true;
this.$vm.__call_hook('mounted', args);
this.$vm.__call_hook('onLaunch', args);
}
};
// 兼容旧版本 globalData
appOptions.globalData = vm.$options.globalData || {};
// 将 methods 中的方法挂在 getApp() 中
var methods = vm.$options.methods;
if (methods) {
Object.keys(methods).forEach(function (name) {
appOptions[name] = methods[name];
});
}
initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
initHooks(appOptions, hooks);
initUnknownHooks(appOptions, vm.$options);
return appOptions;
}
function parseApp(vm) {
return parseBaseApp(vm, {
mocks: mocks,
initRefs: initRefs
});
}
function createApp(vm) {
App(parseApp(vm));
return vm;
}
var encodeReserveRE = /[!'()*]/g;
var encodeReserveReplacer = function encodeReserveReplacer(c) {
return '%' + c.charCodeAt(0).toString(16);
};
var commaRE = /%2C/g;
// fixed encodeURIComponent which is more conformant to RFC3986:
// - escapes [!'()*]
// - preserve commas
var encode = function encode(str) {
return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
};
function stringifyQuery(obj) {
var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
var res = obj ? Object.keys(obj).map(function (key) {
var val = obj[key];
if (val === undefined) {
return '';
}
if (val === null) {
return encodeStr(key);
}
if (Array.isArray(val)) {
var result = [];
val.forEach(function (val2) {
if (val2 === undefined) {
return;
}
if (val2 === null) {
result.push(encodeStr(key));
} else {
result.push(encodeStr(key) + '=' + encodeStr(val2));
}
});
return result.join('&');
}
return encodeStr(key) + '=' + encodeStr(val);
}).filter(function (x) {
return x.length > 0;
}).join('&') : null;
return res ? "?".concat(res) : '';
}
function parseBaseComponent(vueComponentOptions) {
var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
isPage = _ref5.isPage,
initRelation = _ref5.initRelation;
var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
_initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
VueComponent = _initVueComponent2[0],
vueOptions = _initVueComponent2[1];
var options = _objectSpread({
multipleSlots: true,
// styleIsolation: 'apply-shared',
addGlobalClass: true
}, vueOptions.options || {});
{
// 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
Object.assign(options, vueOptions['mp-weixin'].options);
}
}
var componentOptions = {
options: options,
data: initData(vueOptions, _vue.default.prototype),
behaviors: initBehaviors(vueOptions, initBehavior),
properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
lifetimes: {
attached: function attached() {
var properties = this.properties;
var options = {
mpType: isPage.call(this) ? 'page' : 'component',
mpInstance: this,
propsData: properties
};
initVueIds(properties.vueId, this);
// 处理父子关系
initRelation.call(this, {
vuePid: this._$vuePid,
vueOptions: options
});
// 初始化 vue 实例
this.$vm = new VueComponent(options);
// 处理$slots,$scopedSlots(暂不支持动态变化$slots)
initSlots(this.$vm, properties.vueSlots);
// 触发首次 setData
this.$vm.$mount();
},
ready: function ready() {
// 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
// https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
if (this.$vm) {
this.$vm._isMounted = true;
this.$vm.__call_hook('mounted');
this.$vm.__call_hook('onReady');
}
},
detached: function detached() {
this.$vm && this.$vm.$destroy();
}
},
pageLifetimes: {
show: function show(args) {
this.$vm && this.$vm.__call_hook('onPageShow', args);
},
hide: function hide() {
this.$vm && this.$vm.__call_hook('onPageHide');
},
resize: function resize(size) {
this.$vm && this.$vm.__call_hook('onPageResize', size);
}
},
methods: {
__l: handleLink,
__e: handleEvent
}
};
// externalClasses
if (vueOptions.externalClasses) {
componentOptions.externalClasses = vueOptions.externalClasses;
}
if (Array.isArray(vueOptions.wxsCallMethods)) {
vueOptions.wxsCallMethods.forEach(function (callMethod) {
componentOptions.methods[callMethod] = function (args) {
return this.$vm[callMethod](args);
};
});
}
if (needVueOptions) {
return [componentOptions, vueOptions, VueComponent];
}
if (isPage) {
return componentOptions;
}
return [componentOptions, VueComponent];
}
function parseComponent(vueComponentOptions, needVueOptions) {
return parseBaseComponent(vueComponentOptions, {
isPage: isPage,
initRelation: initRelation
}, needVueOptions);
}
var hooks$1 = ['onShow', 'onHide', 'onUnload'];
hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
function parseBasePage(vuePageOptions) {
var _parseComponent = parseComponent(vuePageOptions, true),
_parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
pageOptions = _parseComponent2[0],
vueOptions = _parseComponent2[1];
initHooks(pageOptions.methods, hooks$1, vueOptions);
pageOptions.methods.onLoad = function (query) {
this.options = query;
var copyQuery = Object.assign({}, query);
delete copyQuery.__id__;
this.$page = {
fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
};
this.$vm.$mp.query = query; // 兼容 mpvue
this.$vm.__call_hook('onLoad', query);
};
{
initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
}
{
initWorkletMethods(pageOptions.methods, vueOptions.methods);
}
return pageOptions;
}
function parsePage(vuePageOptions) {
return parseBasePage(vuePageOptions);
}
function createPage(vuePageOptions) {
{
return Component(parsePage(vuePageOptions));
}
}
function createComponent(vueOptions) {
{
return Component(parseComponent(vueOptions));
}
}
function createSubpackageApp(vm) {
var appOptions = parseApp(vm);
var app = getApp({
allowDefault: true
});
vm.$scope = app;
var globalData = app.globalData;
if (globalData) {
Object.keys(appOptions.globalData).forEach(function (name) {
if (!hasOwn(globalData, name)) {
globalData[name] = appOptions.globalData[name];
}
});
}
Object.keys(appOptions).forEach(function (name) {
if (!hasOwn(app, name)) {
app[name] = appOptions[name];
}
});
if (isFn(appOptions.onShow) && wx.onAppShow) {
wx.onAppShow(function () {
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
args[_key5] = arguments[_key5];
}
vm.__call_hook('onShow', args);
});
}
if (isFn(appOptions.onHide) && wx.onAppHide) {
wx.onAppHide(function () {
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
args[_key6] = arguments[_key6];
}
vm.__call_hook('onHide', args);
});
}
if (isFn(appOptions.onLaunch)) {
var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
vm.__call_hook('onLaunch', args);
}
return vm;
}
function createPlugin(vm) {
var appOptions = parseApp(vm);
if (isFn(appOptions.onShow) && wx.onAppShow) {
wx.onAppShow(function () {
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
args[_key7] = arguments[_key7];
}
vm.__call_hook('onShow', args);
});
}
if (isFn(appOptions.onHide) && wx.onAppHide) {
wx.onAppHide(function () {
for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
args[_key8] = arguments[_key8];
}
vm.__call_hook('onHide', args);
});
}
if (isFn(appOptions.onLaunch)) {
var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
vm.__call_hook('onLaunch', args);
}
return vm;
}
todos.forEach(function (todoApi) {
protocols[todoApi] = false;
});
canIUses.forEach(function (canIUseApi) {
var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
if (!wx.canIUse(apiName)) {
protocols[canIUseApi] = false;
}
});
var uni = {};
if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
uni = new Proxy({}, {
get: function get(target, name) {
if (hasOwn(target, name)) {
return target[name];
}
if (baseApi[name]) {
return baseApi[name];
}
if (api[name]) {
return promisify(name, api[name]);
}
{
if (extraApi[name]) {
return promisify(name, extraApi[name]);
}
if (todoApis[name]) {
return promisify(name, todoApis[name]);
}
}
if (eventApi[name]) {
return eventApi[name];
}
return promisify(name, wrapper(name, wx[name]));
},
set: function set(target, name, value) {
target[name] = value;
return true;
}
});
} else {
Object.keys(baseApi).forEach(function (name) {
uni[name] = baseApi[name];
});
{
Object.keys(todoApis).forEach(function (name) {
uni[name] = promisify(name, todoApis[name]);
});
Object.keys(extraApi).forEach(function (name) {
uni[name] = promisify(name, extraApi[name]);
});
}
Object.keys(eventApi).forEach(function (name) {
uni[name] = eventApi[name];
});
Object.keys(api).forEach(function (name) {
uni[name] = promisify(name, api[name]);
});
Object.keys(wx).forEach(function (name) {
if (hasOwn(wx, name) || hasOwn(protocols, name)) {
uni[name] = promisify(name, wrapper(name, wx[name]));
}
});
}
wx.createApp = createApp;
wx.createPage = createPage;
wx.createComponent = createComponent;
wx.createSubpackageApp = createSubpackageApp;
wx.createPlugin = createPlugin;
var uni$1 = uni;
var _default = uni$1;
exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
/***/ }),
/***/ 20:
/*!****************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 200:
/*!***********************************************************!*\
!*** ./node_modules/elliptic/lib/elliptic/eddsa/index.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var hash = __webpack_require__(/*! hash.js */ 183);
var curves = __webpack_require__(/*! ../curves */ 182);
var utils = __webpack_require__(/*! ../utils */ 175);
var assert = utils.assert;
var parseBytes = utils.parseBytes;
var KeyPair = __webpack_require__(/*! ./key */ 201);
var Signature = __webpack_require__(/*! ./signature */ 202);
function EDDSA(curve) {
assert(curve === 'ed25519', 'only tested with ed25519 so far');
if (!(this instanceof EDDSA))
return new EDDSA(curve);
curve = curves[curve].curve;
this.curve = curve;
this.g = curve.g;
this.g.precompute(curve.n.bitLength() + 1);
this.pointClass = curve.point().constructor;
this.encodingLength = Math.ceil(curve.n.bitLength() / 8);
this.hash = hash.sha512;
}
module.exports = EDDSA;
/**
* @param {Array|String} message - message bytes
* @param {Array|String|KeyPair} secret - secret bytes or a keypair
* @returns {Signature} - signature
*/
EDDSA.prototype.sign = function sign(message, secret) {
message = parseBytes(message);
var key = this.keyFromSecret(secret);
var r = this.hashInt(key.messagePrefix(), message);
var R = this.g.mul(r);
var Rencoded = this.encodePoint(R);
var s_ = this.hashInt(Rencoded, key.pubBytes(), message)
.mul(key.priv());
var S = r.add(s_).umod(this.curve.n);
return this.makeSignature({ R: R, S: S, Rencoded: Rencoded });
};
/**
* @param {Array} message - message bytes
* @param {Array|String|Signature} sig - sig bytes
* @param {Array|String|Point|KeyPair} pub - public key
* @returns {Boolean} - true if public key matches sig of message
*/
EDDSA.prototype.verify = function verify(message, sig, pub) {
message = parseBytes(message);
sig = this.makeSignature(sig);
var key = this.keyFromPublic(pub);
var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message);
var SG = this.g.mul(sig.S());
var RplusAh = sig.R().add(key.pub().mul(h));
return RplusAh.eq(SG);
};
EDDSA.prototype.hashInt = function hashInt() {
var hash = this.hash();
for (var i = 0; i < arguments.length; i++)
hash.update(arguments[i]);
return utils.intFromLE(hash.digest()).umod(this.curve.n);
};
EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {
return KeyPair.fromPublic(this, pub);
};
EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {
return KeyPair.fromSecret(this, secret);
};
EDDSA.prototype.makeSignature = function makeSignature(sig) {
if (sig instanceof Signature)
return sig;
return new Signature(this, sig);
};
/**
* * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2
*
* EDDSA defines methods for encoding and decoding points and integers. These are
* helper convenience methods, that pass along to utility functions implied
* parameters.
*
*/
EDDSA.prototype.encodePoint = function encodePoint(point) {
var enc = point.getY().toArray('le', this.encodingLength);
enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0;
return enc;
};
EDDSA.prototype.decodePoint = function decodePoint(bytes) {
bytes = utils.parseBytes(bytes);
var lastIx = bytes.length - 1;
var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80);
var xIsOdd = (bytes[lastIx] & 0x80) !== 0;
var y = utils.intFromLE(normed);
return this.curve.pointFromY(y, xIsOdd);
};
EDDSA.prototype.encodeInt = function encodeInt(num) {
return num.toArray('le', this.encodingLength);
};
EDDSA.prototype.decodeInt = function decodeInt(bytes) {
return utils.intFromLE(bytes);
};
EDDSA.prototype.isPoint = function isPoint(val) {
return val instanceof this.pointClass;
};
/***/ }),
/***/ 201:
/*!*********************************************************!*\
!*** ./node_modules/elliptic/lib/elliptic/eddsa/key.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__(/*! ../utils */ 175);
var assert = utils.assert;
var parseBytes = utils.parseBytes;
var cachedProperty = utils.cachedProperty;
/**
* @param {EDDSA} eddsa - instance
* @param {Object} params - public/private key parameters
*
* @param {Array} [params.secret] - secret seed bytes
* @param {Point} [params.pub] - public key point (aka `A` in eddsa terms)
* @param {Array} [params.pub] - public key point encoded as bytes
*
*/
function KeyPair(eddsa, params) {
this.eddsa = eddsa;
this._secret = parseBytes(params.secret);
if (eddsa.isPoint(params.pub))
this._pub = params.pub;
else
this._pubBytes = parseBytes(params.pub);
}
KeyPair.fromPublic = function fromPublic(eddsa, pub) {
if (pub instanceof KeyPair)
return pub;
return new KeyPair(eddsa, { pub: pub });
};
KeyPair.fromSecret = function fromSecret(eddsa, secret) {
if (secret instanceof KeyPair)
return secret;
return new KeyPair(eddsa, { secret: secret });
};
KeyPair.prototype.secret = function secret() {
return this._secret;
};
cachedProperty(KeyPair, 'pubBytes', function pubBytes() {
return this.eddsa.encodePoint(this.pub());
});
cachedProperty(KeyPair, 'pub', function pub() {
if (this._pubBytes)
return this.eddsa.decodePoint(this._pubBytes);
return this.eddsa.g.mul(this.priv());
});
cachedProperty(KeyPair, 'privBytes', function privBytes() {
var eddsa = this.eddsa;
var hash = this.hash();
var lastIx = eddsa.encodingLength - 1;
var a = hash.slice(0, eddsa.encodingLength);
a[0] &= 248;
a[lastIx] &= 127;
a[lastIx] |= 64;
return a;
});
cachedProperty(KeyPair, 'priv', function priv() {
return this.eddsa.decodeInt(this.privBytes());
});
cachedProperty(KeyPair, 'hash', function hash() {
return this.eddsa.hash().update(this.secret()).digest();
});
cachedProperty(KeyPair, 'messagePrefix', function messagePrefix() {
return this.hash().slice(this.eddsa.encodingLength);
});
KeyPair.prototype.sign = function sign(message) {
assert(this._secret, 'KeyPair can only verify');
return this.eddsa.sign(message, this);
};
KeyPair.prototype.verify = function verify(message, sig) {
return this.eddsa.verify(message, sig, this);
};
KeyPair.prototype.getSecret = function getSecret(enc) {
assert(this._secret, 'KeyPair is public only');
return utils.encode(this.secret(), enc);
};
KeyPair.prototype.getPublic = function getPublic(enc) {
return utils.encode(this.pubBytes(), enc);
};
module.exports = KeyPair;
/***/ }),
/***/ 202:
/*!***************************************************************!*\
!*** ./node_modules/elliptic/lib/elliptic/eddsa/signature.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var BN = __webpack_require__(/*! bn.js */ 162);
var utils = __webpack_require__(/*! ../utils */ 175);
var assert = utils.assert;
var cachedProperty = utils.cachedProperty;
var parseBytes = utils.parseBytes;
/**
* @param {EDDSA} eddsa - eddsa instance
* @param {Array|Object} sig -
* @param {Array|Point} [sig.R] - R point as Point or bytes
* @param {Array|bn} [sig.S] - S scalar as bn or bytes
* @param {Array} [sig.Rencoded] - R point encoded
* @param {Array} [sig.Sencoded] - S scalar encoded
*/
function Signature(eddsa, sig) {
this.eddsa = eddsa;
if (typeof sig !== 'object')
sig = parseBytes(sig);
if (Array.isArray(sig)) {
sig = {
R: sig.slice(0, eddsa.encodingLength),
S: sig.slice(eddsa.encodingLength),
};
}
assert(sig.R && sig.S, 'Signature without R or S');
if (eddsa.isPoint(sig.R))
this._R = sig.R;
if (sig.S instanceof BN)
this._S = sig.S;
this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;
this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;
}
cachedProperty(Signature, 'S', function S() {
return this.eddsa.decodeInt(this.Sencoded());
});
cachedProperty(Signature, 'R', function R() {
return this.eddsa.decodePoint(this.Rencoded());
});
cachedProperty(Signature, 'Rencoded', function Rencoded() {
return this.eddsa.encodePoint(this.R());
});
cachedProperty(Signature, 'Sencoded', function Sencoded() {
return this.eddsa.encodeInt(this.S());
});
Signature.prototype.toBytes = function toBytes() {
return this.Rencoded().concat(this.Sencoded());
};
Signature.prototype.toHex = function toHex() {
return utils.encode(this.toBytes(), 'hex').toUpperCase();
};
module.exports = Signature;
/***/ }),
/***/ 203:
/*!******************************************!*\
!*** ./node_modules/parse-asn1/index.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var asn1 = __webpack_require__(/*! ./asn1 */ 204)
var aesid = __webpack_require__(/*! ./aesid.json */ 221)
var fixProc = __webpack_require__(/*! ./fixProc */ 222)
var ciphers = __webpack_require__(/*! browserify-aes */ 140)
var compat = __webpack_require__(/*! pbkdf2 */ 125)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
module.exports = parseKeys
function parseKeys (buffer) {
var password
if (typeof buffer === 'object' && !Buffer.isBuffer(buffer)) {
password = buffer.passphrase
buffer = buffer.key
}
if (typeof buffer === 'string') {
buffer = Buffer.from(buffer)
}
var stripped = fixProc(buffer, password)
var type = stripped.tag
var data = stripped.data
var subtype, ndata
switch (type) {
case 'CERTIFICATE':
ndata = asn1.certificate.decode(data, 'der').tbsCertificate.subjectPublicKeyInfo
// falls through
case 'PUBLIC KEY':
if (!ndata) {
ndata = asn1.PublicKey.decode(data, 'der')
}
subtype = ndata.algorithm.algorithm.join('.')
switch (subtype) {
case '1.2.840.113549.1.1.1':
return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der')
case '1.2.840.10045.2.1':
ndata.subjectPrivateKey = ndata.subjectPublicKey
return {
type: 'ec',
data: ndata
}
case '1.2.840.10040.4.1':
ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der')
return {
type: 'dsa',
data: ndata.algorithm.params
}
default: throw new Error('unknown key id ' + subtype)
}
// throw new Error('unknown key type ' + type)
case 'ENCRYPTED PRIVATE KEY':
data = asn1.EncryptedPrivateKey.decode(data, 'der')
data = decrypt(data, password)
// falls through
case 'PRIVATE KEY':
ndata = asn1.PrivateKey.decode(data, 'der')
subtype = ndata.algorithm.algorithm.join('.')
switch (subtype) {
case '1.2.840.113549.1.1.1':
return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der')
case '1.2.840.10045.2.1':
return {
curve: ndata.algorithm.curve,
privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey
}
case '1.2.840.10040.4.1':
ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der')
return {
type: 'dsa',
params: ndata.algorithm.params
}
default: throw new Error('unknown key id ' + subtype)
}
// throw new Error('unknown key type ' + type)
case 'RSA PUBLIC KEY':
return asn1.RSAPublicKey.decode(data, 'der')
case 'RSA PRIVATE KEY':
return asn1.RSAPrivateKey.decode(data, 'der')
case 'DSA PRIVATE KEY':
return {
type: 'dsa',
params: asn1.DSAPrivateKey.decode(data, 'der')
}
case 'EC PRIVATE KEY':
data = asn1.ECPrivateKey.decode(data, 'der')
return {
curve: data.parameters.value,
privateKey: data.privateKey
}
default: throw new Error('unknown key type ' + type)
}
}
parseKeys.signature = asn1.signature
function decrypt (data, password) {
var salt = data.algorithm.decrypt.kde.kdeparams.salt
var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10)
var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')]
var iv = data.algorithm.decrypt.cipher.iv
var cipherText = data.subjectPrivateKey
var keylen = parseInt(algo.split('-')[1], 10) / 8
var key = compat.pbkdf2Sync(password, salt, iters, keylen, 'sha1')
var cipher = ciphers.createDecipheriv(algo, key, iv)
var out = []
out.push(cipher.update(cipherText))
out.push(cipher.final())
return Buffer.concat(out)
}
/***/ }),
/***/ 204:
/*!*****************************************!*\
!*** ./node_modules/parse-asn1/asn1.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js
// Fedor, you are amazing.
var asn1 = __webpack_require__(/*! asn1.js */ 205)
exports.certificate = __webpack_require__(/*! ./certificate */ 220)
var RSAPrivateKey = asn1.define('RSAPrivateKey', function () {
this.seq().obj(
this.key('version').int(),
this.key('modulus').int(),
this.key('publicExponent').int(),
this.key('privateExponent').int(),
this.key('prime1').int(),
this.key('prime2').int(),
this.key('exponent1').int(),
this.key('exponent2').int(),
this.key('coefficient').int()
)
})
exports.RSAPrivateKey = RSAPrivateKey
var RSAPublicKey = asn1.define('RSAPublicKey', function () {
this.seq().obj(
this.key('modulus').int(),
this.key('publicExponent').int()
)
})
exports.RSAPublicKey = RSAPublicKey
var PublicKey = asn1.define('SubjectPublicKeyInfo', function () {
this.seq().obj(
this.key('algorithm').use(AlgorithmIdentifier),
this.key('subjectPublicKey').bitstr()
)
})
exports.PublicKey = PublicKey
var AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () {
this.seq().obj(
this.key('algorithm').objid(),
this.key('none').null_().optional(),
this.key('curve').objid().optional(),
this.key('params').seq().obj(
this.key('p').int(),
this.key('q').int(),
this.key('g').int()
).optional()
)
})
var PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () {
this.seq().obj(
this.key('version').int(),
this.key('algorithm').use(AlgorithmIdentifier),
this.key('subjectPrivateKey').octstr()
)
})
exports.PrivateKey = PrivateKeyInfo
var EncryptedPrivateKeyInfo = asn1.define('EncryptedPrivateKeyInfo', function () {
this.seq().obj(
this.key('algorithm').seq().obj(
this.key('id').objid(),
this.key('decrypt').seq().obj(
this.key('kde').seq().obj(
this.key('id').objid(),
this.key('kdeparams').seq().obj(
this.key('salt').octstr(),
this.key('iters').int()
)
),
this.key('cipher').seq().obj(
this.key('algo').objid(),
this.key('iv').octstr()
)
)
),
this.key('subjectPrivateKey').octstr()
)
})
exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo
var DSAPrivateKey = asn1.define('DSAPrivateKey', function () {
this.seq().obj(
this.key('version').int(),
this.key('p').int(),
this.key('q').int(),
this.key('g').int(),
this.key('pub_key').int(),
this.key('priv_key').int()
)
})
exports.DSAPrivateKey = DSAPrivateKey
exports.DSAparam = asn1.define('DSAparam', function () {
this.int()
})
var ECPrivateKey = asn1.define('ECPrivateKey', function () {
this.seq().obj(
this.key('version').int(),
this.key('privateKey').octstr(),
this.key('parameters').optional().explicit(0).use(ECParameters),
this.key('publicKey').optional().explicit(1).bitstr()
)
})
exports.ECPrivateKey = ECPrivateKey
var ECParameters = asn1.define('ECParameters', function () {
this.choice({
namedCurve: this.objid()
})
})
exports.signature = asn1.define('signature', function () {
this.seq().obj(
this.key('r').int(),
this.key('s').int()
)
})
/***/ }),
/***/ 205:
/*!******************************************!*\
!*** ./node_modules/asn1.js/lib/asn1.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const asn1 = exports;
asn1.bignum = __webpack_require__(/*! bn.js */ 162);
asn1.define = __webpack_require__(/*! ./asn1/api */ 206).define;
asn1.base = __webpack_require__(/*! ./asn1/base */ 218);
asn1.constants = __webpack_require__(/*! ./asn1/constants */ 219);
asn1.decoders = __webpack_require__(/*! ./asn1/decoders */ 215);
asn1.encoders = __webpack_require__(/*! ./asn1/encoders */ 207);
/***/ }),
/***/ 206:
/*!**********************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/api.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const encoders = __webpack_require__(/*! ./encoders */ 207);
const decoders = __webpack_require__(/*! ./decoders */ 215);
const inherits = __webpack_require__(/*! inherits */ 86);
const api = exports;
api.define = function define(name, body) {
return new Entity(name, body);
};
function Entity(name, body) {
this.name = name;
this.body = body;
this.decoders = {};
this.encoders = {};
}
Entity.prototype._createNamed = function createNamed(Base) {
const name = this.name;
function Generated(entity) {
this._initNamed(entity, name);
}
inherits(Generated, Base);
Generated.prototype._initNamed = function _initNamed(entity, name) {
Base.call(this, entity, name);
};
return new Generated(this);
};
Entity.prototype._getDecoder = function _getDecoder(enc) {
enc = enc || 'der';
// Lazily create decoder
if (!this.decoders.hasOwnProperty(enc))
this.decoders[enc] = this._createNamed(decoders[enc]);
return this.decoders[enc];
};
Entity.prototype.decode = function decode(data, enc, options) {
return this._getDecoder(enc).decode(data, options);
};
Entity.prototype._getEncoder = function _getEncoder(enc) {
enc = enc || 'der';
// Lazily create encoder
if (!this.encoders.hasOwnProperty(enc))
this.encoders[enc] = this._createNamed(encoders[enc]);
return this.encoders[enc];
};
Entity.prototype.encode = function encode(data, enc, /* internal */ reporter) {
return this._getEncoder(enc).encode(data, reporter);
};
/***/ }),
/***/ 207:
/*!*********************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/encoders/index.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const encoders = exports;
encoders.der = __webpack_require__(/*! ./der */ 208);
encoders.pem = __webpack_require__(/*! ./pem */ 214);
/***/ }),
/***/ 208:
/*!*******************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/encoders/der.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const inherits = __webpack_require__(/*! inherits */ 86);
const Buffer = __webpack_require__(/*! safer-buffer */ 209).Buffer;
const Node = __webpack_require__(/*! ../base/node */ 210);
// Import DER constants
const der = __webpack_require__(/*! ../constants/der */ 213);
function DEREncoder(entity) {
this.enc = 'der';
this.name = entity.name;
this.entity = entity;
// Construct base tree
this.tree = new DERNode();
this.tree._init(entity.body);
}
module.exports = DEREncoder;
DEREncoder.prototype.encode = function encode(data, reporter) {
return this.tree._encode(data, reporter).join();
};
// Tree methods
function DERNode(parent) {
Node.call(this, 'der', parent);
}
inherits(DERNode, Node);
DERNode.prototype._encodeComposite = function encodeComposite(tag,
primitive,
cls,
content) {
const encodedTag = encodeTag(tag, primitive, cls, this.reporter);
// Short form
if (content.length < 0x80) {
const header = Buffer.alloc(2);
header[0] = encodedTag;
header[1] = content.length;
return this._createEncoderBuffer([ header, content ]);
}
// Long form
// Count octets required to store length
let lenOctets = 1;
for (let i = content.length; i >= 0x100; i >>= 8)
lenOctets++;
const header = Buffer.alloc(1 + 1 + lenOctets);
header[0] = encodedTag;
header[1] = 0x80 | lenOctets;
for (let i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8)
header[i] = j & 0xff;
return this._createEncoderBuffer([ header, content ]);
};
DERNode.prototype._encodeStr = function encodeStr(str, tag) {
if (tag === 'bitstr') {
return this._createEncoderBuffer([ str.unused | 0, str.data ]);
} else if (tag === 'bmpstr') {
const buf = Buffer.alloc(str.length * 2);
for (let i = 0; i < str.length; i++) {
buf.writeUInt16BE(str.charCodeAt(i), i * 2);
}
return this._createEncoderBuffer(buf);
} else if (tag === 'numstr') {
if (!this._isNumstr(str)) {
return this.reporter.error('Encoding of string type: numstr supports ' +
'only digits and space');
}
return this._createEncoderBuffer(str);
} else if (tag === 'printstr') {
if (!this._isPrintstr(str)) {
return this.reporter.error('Encoding of string type: printstr supports ' +
'only latin upper and lower case letters, ' +
'digits, space, apostrophe, left and rigth ' +
'parenthesis, plus sign, comma, hyphen, ' +
'dot, slash, colon, equal sign, ' +
'question mark');
}
return this._createEncoderBuffer(str);
} else if (/str$/.test(tag)) {
return this._createEncoderBuffer(str);
} else if (tag === 'objDesc') {
return this._createEncoderBuffer(str);
} else {
return this.reporter.error('Encoding of string type: ' + tag +
' unsupported');
}
};
DERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) {
if (typeof id === 'string') {
if (!values)
return this.reporter.error('string objid given, but no values map found');
if (!values.hasOwnProperty(id))
return this.reporter.error('objid not found in values map');
id = values[id].split(/[\s.]+/g);
for (let i = 0; i < id.length; i++)
id[i] |= 0;
} else if (Array.isArray(id)) {
id = id.slice();
for (let i = 0; i < id.length; i++)
id[i] |= 0;
}
if (!Array.isArray(id)) {
return this.reporter.error('objid() should be either array or string, ' +
'got: ' + JSON.stringify(id));
}
if (!relative) {
if (id[1] >= 40)
return this.reporter.error('Second objid identifier OOB');
id.splice(0, 2, id[0] * 40 + id[1]);
}
// Count number of octets
let size = 0;
for (let i = 0; i < id.length; i++) {
let ident = id[i];
for (size++; ident >= 0x80; ident >>= 7)
size++;
}
const objid = Buffer.alloc(size);
let offset = objid.length - 1;
for (let i = id.length - 1; i >= 0; i--) {
let ident = id[i];
objid[offset--] = ident & 0x7f;
while ((ident >>= 7) > 0)
objid[offset--] = 0x80 | (ident & 0x7f);
}
return this._createEncoderBuffer(objid);
};
function two(num) {
if (num < 10)
return '0' + num;
else
return num;
}
DERNode.prototype._encodeTime = function encodeTime(time, tag) {
let str;
const date = new Date(time);
if (tag === 'gentime') {
str = [
two(date.getUTCFullYear()),
two(date.getUTCMonth() + 1),
two(date.getUTCDate()),
two(date.getUTCHours()),
two(date.getUTCMinutes()),
two(date.getUTCSeconds()),
'Z'
].join('');
} else if (tag === 'utctime') {
str = [
two(date.getUTCFullYear() % 100),
two(date.getUTCMonth() + 1),
two(date.getUTCDate()),
two(date.getUTCHours()),
two(date.getUTCMinutes()),
two(date.getUTCSeconds()),
'Z'
].join('');
} else {
this.reporter.error('Encoding ' + tag + ' time is not supported yet');
}
return this._encodeStr(str, 'octstr');
};
DERNode.prototype._encodeNull = function encodeNull() {
return this._createEncoderBuffer('');
};
DERNode.prototype._encodeInt = function encodeInt(num, values) {
if (typeof num === 'string') {
if (!values)
return this.reporter.error('String int or enum given, but no values map');
if (!values.hasOwnProperty(num)) {
return this.reporter.error('Values map doesn\'t contain: ' +
JSON.stringify(num));
}
num = values[num];
}
// Bignum, assume big endian
if (typeof num !== 'number' && !Buffer.isBuffer(num)) {
const numArray = num.toArray();
if (!num.sign && numArray[0] & 0x80) {
numArray.unshift(0);
}
num = Buffer.from(numArray);
}
if (Buffer.isBuffer(num)) {
let size = num.length;
if (num.length === 0)
size++;
const out = Buffer.alloc(size);
num.copy(out);
if (num.length === 0)
out[0] = 0;
return this._createEncoderBuffer(out);
}
if (num < 0x80)
return this._createEncoderBuffer(num);
if (num < 0x100)
return this._createEncoderBuffer([0, num]);
let size = 1;
for (let i = num; i >= 0x100; i >>= 8)
size++;
const out = new Array(size);
for (let i = out.length - 1; i >= 0; i--) {
out[i] = num & 0xff;
num >>= 8;
}
if(out[0] & 0x80) {
out.unshift(0);
}
return this._createEncoderBuffer(Buffer.from(out));
};
DERNode.prototype._encodeBool = function encodeBool(value) {
return this._createEncoderBuffer(value ? 0xff : 0);
};
DERNode.prototype._use = function use(entity, obj) {
if (typeof entity === 'function')
entity = entity(obj);
return entity._getEncoder('der').tree;
};
DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) {
const state = this._baseState;
let i;
if (state['default'] === null)
return false;
const data = dataBuffer.join();
if (state.defaultBuffer === undefined)
state.defaultBuffer = this._encodeValue(state['default'], reporter, parent).join();
if (data.length !== state.defaultBuffer.length)
return false;
for (i=0; i < data.length; i++)
if (data[i] !== state.defaultBuffer[i])
return false;
return true;
};
// Utility methods
function encodeTag(tag, primitive, cls, reporter) {
let res;
if (tag === 'seqof')
tag = 'seq';
else if (tag === 'setof')
tag = 'set';
if (der.tagByName.hasOwnProperty(tag))
res = der.tagByName[tag];
else if (typeof tag === 'number' && (tag | 0) === tag)
res = tag;
else
return reporter.error('Unknown tag: ' + tag);
if (res >= 0x1f)
return reporter.error('Multi-octet tag encoding unsupported');
if (!primitive)
res |= 0x20;
res |= (der.tagClassByName[cls || 'universal'] << 6);
return res;
}
/***/ }),
/***/ 209:
/*!********************************************!*\
!*** ./node_modules/safer-buffer/safer.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/* eslint-disable node/no-deprecated-api */
var buffer = __webpack_require__(/*! buffer */ 81)
var Buffer = buffer.Buffer
var safer = {}
var key
for (key in buffer) {
if (!buffer.hasOwnProperty(key)) continue
if (key === 'SlowBuffer' || key === 'Buffer') continue
safer[key] = buffer[key]
}
var Safer = safer.Buffer = {}
for (key in Buffer) {
if (!Buffer.hasOwnProperty(key)) continue
if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue
Safer[key] = Buffer[key]
}
safer.Buffer.prototype = Buffer.prototype
if (!Safer.from || Safer.from === Uint8Array.from) {
Safer.from = function (value, encodingOrOffset, length) {
if (typeof value === 'number') {
throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value)
}
if (value && typeof value.length === 'undefined') {
throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value)
}
return Buffer(value, encodingOrOffset, length)
}
}
if (!Safer.alloc) {
Safer.alloc = function (size, fill, encoding) {
if (typeof size !== 'number') {
throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size)
}
if (size < 0 || size >= 2 * (1 << 30)) {
throw new RangeError('The value "' + size + '" is invalid for option "size"')
}
var buf = Buffer(size)
if (!fill || fill.length === 0) {
buf.fill(0)
} else if (typeof encoding === 'string') {
buf.fill(fill, encoding)
} else {
buf.fill(fill)
}
return buf
}
}
if (!safer.kStringMaxLength) {
try {
safer.kStringMaxLength = process.binding('buffer').kStringMaxLength
} catch (e) {
// we can't determine kStringMaxLength in environments where process.binding
// is unsupported, so let's not set it
}
}
if (!safer.constants) {
safer.constants = {
MAX_LENGTH: safer.kMaxLength
}
if (safer.kStringMaxLength) {
safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength
}
}
module.exports = safer
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 78)))
/***/ }),
/***/ 21:
/*!******************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 210:
/*!****************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/base/node.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const Reporter = __webpack_require__(/*! ../base/reporter */ 211).Reporter;
const EncoderBuffer = __webpack_require__(/*! ../base/buffer */ 212).EncoderBuffer;
const DecoderBuffer = __webpack_require__(/*! ../base/buffer */ 212).DecoderBuffer;
const assert = __webpack_require__(/*! minimalistic-assert */ 136);
// Supported tags
const tags = [
'seq', 'seqof', 'set', 'setof', 'objid', 'bool',
'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc',
'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str',
'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr'
];
// Public methods list
const methods = [
'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice',
'any', 'contains'
].concat(tags);
// Overrided methods list
const overrided = [
'_peekTag', '_decodeTag', '_use',
'_decodeStr', '_decodeObjid', '_decodeTime',
'_decodeNull', '_decodeInt', '_decodeBool', '_decodeList',
'_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime',
'_encodeNull', '_encodeInt', '_encodeBool'
];
function Node(enc, parent, name) {
const state = {};
this._baseState = state;
state.name = name;
state.enc = enc;
state.parent = parent || null;
state.children = null;
// State
state.tag = null;
state.args = null;
state.reverseArgs = null;
state.choice = null;
state.optional = false;
state.any = false;
state.obj = false;
state.use = null;
state.useDecoder = null;
state.key = null;
state['default'] = null;
state.explicit = null;
state.implicit = null;
state.contains = null;
// Should create new instance on each method
if (!state.parent) {
state.children = [];
this._wrap();
}
}
module.exports = Node;
const stateProps = [
'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice',
'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit',
'implicit', 'contains'
];
Node.prototype.clone = function clone() {
const state = this._baseState;
const cstate = {};
stateProps.forEach(function(prop) {
cstate[prop] = state[prop];
});
const res = new this.constructor(cstate.parent);
res._baseState = cstate;
return res;
};
Node.prototype._wrap = function wrap() {
const state = this._baseState;
methods.forEach(function(method) {
this[method] = function _wrappedMethod() {
const clone = new this.constructor(this);
state.children.push(clone);
return clone[method].apply(clone, arguments);
};
}, this);
};
Node.prototype._init = function init(body) {
const state = this._baseState;
assert(state.parent === null);
body.call(this);
// Filter children
state.children = state.children.filter(function(child) {
return child._baseState.parent === this;
}, this);
assert.equal(state.children.length, 1, 'Root node can have only one child');
};
Node.prototype._useArgs = function useArgs(args) {
const state = this._baseState;
// Filter children and args
const children = args.filter(function(arg) {
return arg instanceof this.constructor;
}, this);
args = args.filter(function(arg) {
return !(arg instanceof this.constructor);
}, this);
if (children.length !== 0) {
assert(state.children === null);
state.children = children;
// Replace parent to maintain backward link
children.forEach(function(child) {
child._baseState.parent = this;
}, this);
}
if (args.length !== 0) {
assert(state.args === null);
state.args = args;
state.reverseArgs = args.map(function(arg) {
if (typeof arg !== 'object' || arg.constructor !== Object)
return arg;
const res = {};
Object.keys(arg).forEach(function(key) {
if (key == (key | 0))
key |= 0;
const value = arg[key];
res[value] = key;
});
return res;
});
}
};
//
// Overrided methods
//
overrided.forEach(function(method) {
Node.prototype[method] = function _overrided() {
const state = this._baseState;
throw new Error(method + ' not implemented for encoding: ' + state.enc);
};
});
//
// Public methods
//
tags.forEach(function(tag) {
Node.prototype[tag] = function _tagMethod() {
const state = this._baseState;
const args = Array.prototype.slice.call(arguments);
assert(state.tag === null);
state.tag = tag;
this._useArgs(args);
return this;
};
});
Node.prototype.use = function use(item) {
assert(item);
const state = this._baseState;
assert(state.use === null);
state.use = item;
return this;
};
Node.prototype.optional = function optional() {
const state = this._baseState;
state.optional = true;
return this;
};
Node.prototype.def = function def(val) {
const state = this._baseState;
assert(state['default'] === null);
state['default'] = val;
state.optional = true;
return this;
};
Node.prototype.explicit = function explicit(num) {
const state = this._baseState;
assert(state.explicit === null && state.implicit === null);
state.explicit = num;
return this;
};
Node.prototype.implicit = function implicit(num) {
const state = this._baseState;
assert(state.explicit === null && state.implicit === null);
state.implicit = num;
return this;
};
Node.prototype.obj = function obj() {
const state = this._baseState;
const args = Array.prototype.slice.call(arguments);
state.obj = true;
if (args.length !== 0)
this._useArgs(args);
return this;
};
Node.prototype.key = function key(newKey) {
const state = this._baseState;
assert(state.key === null);
state.key = newKey;
return this;
};
Node.prototype.any = function any() {
const state = this._baseState;
state.any = true;
return this;
};
Node.prototype.choice = function choice(obj) {
const state = this._baseState;
assert(state.choice === null);
state.choice = obj;
this._useArgs(Object.keys(obj).map(function(key) {
return obj[key];
}));
return this;
};
Node.prototype.contains = function contains(item) {
const state = this._baseState;
assert(state.use === null);
state.contains = item;
return this;
};
//
// Decoding
//
Node.prototype._decode = function decode(input, options) {
const state = this._baseState;
// Decode root node
if (state.parent === null)
return input.wrapResult(state.children[0]._decode(input, options));
let result = state['default'];
let present = true;
let prevKey = null;
if (state.key !== null)
prevKey = input.enterKey(state.key);
// Check if tag is there
if (state.optional) {
let tag = null;
if (state.explicit !== null)
tag = state.explicit;
else if (state.implicit !== null)
tag = state.implicit;
else if (state.tag !== null)
tag = state.tag;
if (tag === null && !state.any) {
// Trial and Error
const save = input.save();
try {
if (state.choice === null)
this._decodeGeneric(state.tag, input, options);
else
this._decodeChoice(input, options);
present = true;
} catch (e) {
present = false;
}
input.restore(save);
} else {
present = this._peekTag(input, tag, state.any);
if (input.isError(present))
return present;
}
}
// Push object on stack
let prevObj;
if (state.obj && present)
prevObj = input.enterObject();
if (present) {
// Unwrap explicit values
if (state.explicit !== null) {
const explicit = this._decodeTag(input, state.explicit);
if (input.isError(explicit))
return explicit;
input = explicit;
}
const start = input.offset;
// Unwrap implicit and normal values
if (state.use === null && state.choice === null) {
let save;
if (state.any)
save = input.save();
const body = this._decodeTag(
input,
state.implicit !== null ? state.implicit : state.tag,
state.any
);
if (input.isError(body))
return body;
if (state.any)
result = input.raw(save);
else
input = body;
}
if (options && options.track && state.tag !== null)
options.track(input.path(), start, input.length, 'tagged');
if (options && options.track && state.tag !== null)
options.track(input.path(), input.offset, input.length, 'content');
// Select proper method for tag
if (state.any) {
// no-op
} else if (state.choice === null) {
result = this._decodeGeneric(state.tag, input, options);
} else {
result = this._decodeChoice(input, options);
}
if (input.isError(result))
return result;
// Decode children
if (!state.any && state.choice === null && state.children !== null) {
state.children.forEach(function decodeChildren(child) {
// NOTE: We are ignoring errors here, to let parser continue with other
// parts of encoded data
child._decode(input, options);
});
}
// Decode contained/encoded by schema, only in bit or octet strings
if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) {
const data = new DecoderBuffer(result);
result = this._getUse(state.contains, input._reporterState.obj)
._decode(data, options);
}
}
// Pop object
if (state.obj && present)
result = input.leaveObject(prevObj);
// Set key
if (state.key !== null && (result !== null || present === true))
input.leaveKey(prevKey, state.key, result);
else if (prevKey !== null)
input.exitKey(prevKey);
return result;
};
Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) {
const state = this._baseState;
if (tag === 'seq' || tag === 'set')
return null;
if (tag === 'seqof' || tag === 'setof')
return this._decodeList(input, tag, state.args[0], options);
else if (/str$/.test(tag))
return this._decodeStr(input, tag, options);
else if (tag === 'objid' && state.args)
return this._decodeObjid(input, state.args[0], state.args[1], options);
else if (tag === 'objid')
return this._decodeObjid(input, null, null, options);
else if (tag === 'gentime' || tag === 'utctime')
return this._decodeTime(input, tag, options);
else if (tag === 'null_')
return this._decodeNull(input, options);
else if (tag === 'bool')
return this._decodeBool(input, options);
else if (tag === 'objDesc')
return this._decodeStr(input, tag, options);
else if (tag === 'int' || tag === 'enum')
return this._decodeInt(input, state.args && state.args[0], options);
if (state.use !== null) {
return this._getUse(state.use, input._reporterState.obj)
._decode(input, options);
} else {
return input.error('unknown tag: ' + tag);
}
};
Node.prototype._getUse = function _getUse(entity, obj) {
const state = this._baseState;
// Create altered use decoder if implicit is set
state.useDecoder = this._use(entity, obj);
assert(state.useDecoder._baseState.parent === null);
state.useDecoder = state.useDecoder._baseState.children[0];
if (state.implicit !== state.useDecoder._baseState.implicit) {
state.useDecoder = state.useDecoder.clone();
state.useDecoder._baseState.implicit = state.implicit;
}
return state.useDecoder;
};
Node.prototype._decodeChoice = function decodeChoice(input, options) {
const state = this._baseState;
let result = null;
let match = false;
Object.keys(state.choice).some(function(key) {
const save = input.save();
const node = state.choice[key];
try {
const value = node._decode(input, options);
if (input.isError(value))
return false;
result = { type: key, value: value };
match = true;
} catch (e) {
input.restore(save);
return false;
}
return true;
}, this);
if (!match)
return input.error('Choice not matched');
return result;
};
//
// Encoding
//
Node.prototype._createEncoderBuffer = function createEncoderBuffer(data) {
return new EncoderBuffer(data, this.reporter);
};
Node.prototype._encode = function encode(data, reporter, parent) {
const state = this._baseState;
if (state['default'] !== null && state['default'] === data)
return;
const result = this._encodeValue(data, reporter, parent);
if (result === undefined)
return;
if (this._skipDefault(result, reporter, parent))
return;
return result;
};
Node.prototype._encodeValue = function encode(data, reporter, parent) {
const state = this._baseState;
// Decode root node
if (state.parent === null)
return state.children[0]._encode(data, reporter || new Reporter());
let result = null;
// Set reporter to share it with a child class
this.reporter = reporter;
// Check if data is there
if (state.optional && data === undefined) {
if (state['default'] !== null)
data = state['default'];
else
return;
}
// Encode children first
let content = null;
let primitive = false;
if (state.any) {
// Anything that was given is translated to buffer
result = this._createEncoderBuffer(data);
} else if (state.choice) {
result = this._encodeChoice(data, reporter);
} else if (state.contains) {
content = this._getUse(state.contains, parent)._encode(data, reporter);
primitive = true;
} else if (state.children) {
content = state.children.map(function(child) {
if (child._baseState.tag === 'null_')
return child._encode(null, reporter, data);
if (child._baseState.key === null)
return reporter.error('Child should have a key');
const prevKey = reporter.enterKey(child._baseState.key);
if (typeof data !== 'object')
return reporter.error('Child expected, but input is not object');
const res = child._encode(data[child._baseState.key], reporter, data);
reporter.leaveKey(prevKey);
return res;
}, this).filter(function(child) {
return child;
});
content = this._createEncoderBuffer(content);
} else {
if (state.tag === 'seqof' || state.tag === 'setof') {
// TODO(indutny): this should be thrown on DSL level
if (!(state.args && state.args.length === 1))
return reporter.error('Too many args for : ' + state.tag);
if (!Array.isArray(data))
return reporter.error('seqof/setof, but data is not Array');
const child = this.clone();
child._baseState.implicit = null;
content = this._createEncoderBuffer(data.map(function(item) {
const state = this._baseState;
return this._getUse(state.args[0], data)._encode(item, reporter);
}, child));
} else if (state.use !== null) {
result = this._getUse(state.use, parent)._encode(data, reporter);
} else {
content = this._encodePrimitive(state.tag, data);
primitive = true;
}
}
// Encode data itself
if (!state.any && state.choice === null) {
const tag = state.implicit !== null ? state.implicit : state.tag;
const cls = state.implicit === null ? 'universal' : 'context';
if (tag === null) {
if (state.use === null)
reporter.error('Tag could be omitted only for .use()');
} else {
if (state.use === null)
result = this._encodeComposite(tag, primitive, cls, content);
}
}
// Wrap in explicit
if (state.explicit !== null)
result = this._encodeComposite(state.explicit, false, 'context', result);
return result;
};
Node.prototype._encodeChoice = function encodeChoice(data, reporter) {
const state = this._baseState;
const node = state.choice[data.type];
if (!node) {
assert(
false,
data.type + ' not found in ' +
JSON.stringify(Object.keys(state.choice)));
}
return node._encode(data.value, reporter);
};
Node.prototype._encodePrimitive = function encodePrimitive(tag, data) {
const state = this._baseState;
if (/str$/.test(tag))
return this._encodeStr(data, tag);
else if (tag === 'objid' && state.args)
return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);
else if (tag === 'objid')
return this._encodeObjid(data, null, null);
else if (tag === 'gentime' || tag === 'utctime')
return this._encodeTime(data, tag);
else if (tag === 'null_')
return this._encodeNull();
else if (tag === 'int' || tag === 'enum')
return this._encodeInt(data, state.args && state.reverseArgs[0]);
else if (tag === 'bool')
return this._encodeBool(data);
else if (tag === 'objDesc')
return this._encodeStr(data, tag);
else
throw new Error('Unsupported tag: ' + tag);
};
Node.prototype._isNumstr = function isNumstr(str) {
return /^[0-9 ]*$/.test(str);
};
Node.prototype._isPrintstr = function isPrintstr(str) {
return /^[A-Za-z0-9 '()+,-./:=?]*$/.test(str);
};
/***/ }),
/***/ 211:
/*!********************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/base/reporter.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const inherits = __webpack_require__(/*! inherits */ 86);
function Reporter(options) {
this._reporterState = {
obj: null,
path: [],
options: options || {},
errors: []
};
}
exports.Reporter = Reporter;
Reporter.prototype.isError = function isError(obj) {
return obj instanceof ReporterError;
};
Reporter.prototype.save = function save() {
const state = this._reporterState;
return { obj: state.obj, pathLen: state.path.length };
};
Reporter.prototype.restore = function restore(data) {
const state = this._reporterState;
state.obj = data.obj;
state.path = state.path.slice(0, data.pathLen);
};
Reporter.prototype.enterKey = function enterKey(key) {
return this._reporterState.path.push(key);
};
Reporter.prototype.exitKey = function exitKey(index) {
const state = this._reporterState;
state.path = state.path.slice(0, index - 1);
};
Reporter.prototype.leaveKey = function leaveKey(index, key, value) {
const state = this._reporterState;
this.exitKey(index);
if (state.obj !== null)
state.obj[key] = value;
};
Reporter.prototype.path = function path() {
return this._reporterState.path.join('/');
};
Reporter.prototype.enterObject = function enterObject() {
const state = this._reporterState;
const prev = state.obj;
state.obj = {};
return prev;
};
Reporter.prototype.leaveObject = function leaveObject(prev) {
const state = this._reporterState;
const now = state.obj;
state.obj = prev;
return now;
};
Reporter.prototype.error = function error(msg) {
let err;
const state = this._reporterState;
const inherited = msg instanceof ReporterError;
if (inherited) {
err = msg;
} else {
err = new ReporterError(state.path.map(function(elem) {
return '[' + JSON.stringify(elem) + ']';
}).join(''), msg.message || msg, msg.stack);
}
if (!state.options.partial)
throw err;
if (!inherited)
state.errors.push(err);
return err;
};
Reporter.prototype.wrapResult = function wrapResult(result) {
const state = this._reporterState;
if (!state.options.partial)
return result;
return {
result: this.isError(result) ? null : result,
errors: state.errors
};
};
function ReporterError(path, msg) {
this.path = path;
this.rethrow(msg);
}
inherits(ReporterError, Error);
ReporterError.prototype.rethrow = function rethrow(msg) {
this.message = msg + ' at: ' + (this.path || '(shallow)');
if (Error.captureStackTrace)
Error.captureStackTrace(this, ReporterError);
if (!this.stack) {
try {
// IE only adds stack when thrown
throw new Error(this.message);
} catch (e) {
this.stack = e.stack;
}
}
return this;
};
/***/ }),
/***/ 212:
/*!******************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/base/buffer.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const inherits = __webpack_require__(/*! inherits */ 86);
const Reporter = __webpack_require__(/*! ../base/reporter */ 211).Reporter;
const Buffer = __webpack_require__(/*! safer-buffer */ 209).Buffer;
function DecoderBuffer(base, options) {
Reporter.call(this, options);
if (!Buffer.isBuffer(base)) {
this.error('Input not Buffer');
return;
}
this.base = base;
this.offset = 0;
this.length = base.length;
}
inherits(DecoderBuffer, Reporter);
exports.DecoderBuffer = DecoderBuffer;
DecoderBuffer.isDecoderBuffer = function isDecoderBuffer(data) {
if (data instanceof DecoderBuffer) {
return true;
}
// Or accept compatible API
const isCompatible = typeof data === 'object' &&
Buffer.isBuffer(data.base) &&
data.constructor.name === 'DecoderBuffer' &&
typeof data.offset === 'number' &&
typeof data.length === 'number' &&
typeof data.save === 'function' &&
typeof data.restore === 'function' &&
typeof data.isEmpty === 'function' &&
typeof data.readUInt8 === 'function' &&
typeof data.skip === 'function' &&
typeof data.raw === 'function';
return isCompatible;
};
DecoderBuffer.prototype.save = function save() {
return { offset: this.offset, reporter: Reporter.prototype.save.call(this) };
};
DecoderBuffer.prototype.restore = function restore(save) {
// Return skipped data
const res = new DecoderBuffer(this.base);
res.offset = save.offset;
res.length = this.offset;
this.offset = save.offset;
Reporter.prototype.restore.call(this, save.reporter);
return res;
};
DecoderBuffer.prototype.isEmpty = function isEmpty() {
return this.offset === this.length;
};
DecoderBuffer.prototype.readUInt8 = function readUInt8(fail) {
if (this.offset + 1 <= this.length)
return this.base.readUInt8(this.offset++, true);
else
return this.error(fail || 'DecoderBuffer overrun');
};
DecoderBuffer.prototype.skip = function skip(bytes, fail) {
if (!(this.offset + bytes <= this.length))
return this.error(fail || 'DecoderBuffer overrun');
const res = new DecoderBuffer(this.base);
// Share reporter state
res._reporterState = this._reporterState;
res.offset = this.offset;
res.length = this.offset + bytes;
this.offset += bytes;
return res;
};
DecoderBuffer.prototype.raw = function raw(save) {
return this.base.slice(save ? save.offset : this.offset, this.length);
};
function EncoderBuffer(value, reporter) {
if (Array.isArray(value)) {
this.length = 0;
this.value = value.map(function(item) {
if (!EncoderBuffer.isEncoderBuffer(item))
item = new EncoderBuffer(item, reporter);
this.length += item.length;
return item;
}, this);
} else if (typeof value === 'number') {
if (!(0 <= value && value <= 0xff))
return reporter.error('non-byte EncoderBuffer value');
this.value = value;
this.length = 1;
} else if (typeof value === 'string') {
this.value = value;
this.length = Buffer.byteLength(value);
} else if (Buffer.isBuffer(value)) {
this.value = value;
this.length = value.length;
} else {
return reporter.error('Unsupported type: ' + typeof value);
}
}
exports.EncoderBuffer = EncoderBuffer;
EncoderBuffer.isEncoderBuffer = function isEncoderBuffer(data) {
if (data instanceof EncoderBuffer) {
return true;
}
// Or accept compatible API
const isCompatible = typeof data === 'object' &&
data.constructor.name === 'EncoderBuffer' &&
typeof data.length === 'number' &&
typeof data.join === 'function';
return isCompatible;
};
EncoderBuffer.prototype.join = function join(out, offset) {
if (!out)
out = Buffer.alloc(this.length);
if (!offset)
offset = 0;
if (this.length === 0)
return out;
if (Array.isArray(this.value)) {
this.value.forEach(function(item) {
item.join(out, offset);
offset += item.length;
});
} else {
if (typeof this.value === 'number')
out[offset] = this.value;
else if (typeof this.value === 'string')
out.write(this.value, offset);
else if (Buffer.isBuffer(this.value))
this.value.copy(out, offset);
offset += this.length;
}
return out;
};
/***/ }),
/***/ 213:
/*!********************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/constants/der.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// Helper
function reverse(map) {
const res = {};
Object.keys(map).forEach(function(key) {
// Convert key to integer if it is stringified
if ((key | 0) == key)
key = key | 0;
const value = map[key];
res[value] = key;
});
return res;
}
exports.tagClass = {
0: 'universal',
1: 'application',
2: 'context',
3: 'private'
};
exports.tagClassByName = reverse(exports.tagClass);
exports.tag = {
0x00: 'end',
0x01: 'bool',
0x02: 'int',
0x03: 'bitstr',
0x04: 'octstr',
0x05: 'null_',
0x06: 'objid',
0x07: 'objDesc',
0x08: 'external',
0x09: 'real',
0x0a: 'enum',
0x0b: 'embed',
0x0c: 'utf8str',
0x0d: 'relativeOid',
0x10: 'seq',
0x11: 'set',
0x12: 'numstr',
0x13: 'printstr',
0x14: 't61str',
0x15: 'videostr',
0x16: 'ia5str',
0x17: 'utctime',
0x18: 'gentime',
0x19: 'graphstr',
0x1a: 'iso646str',
0x1b: 'genstr',
0x1c: 'unistr',
0x1d: 'charstr',
0x1e: 'bmpstr'
};
exports.tagByName = reverse(exports.tag);
/***/ }),
/***/ 214:
/*!*******************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/encoders/pem.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const inherits = __webpack_require__(/*! inherits */ 86);
const DEREncoder = __webpack_require__(/*! ./der */ 208);
function PEMEncoder(entity) {
DEREncoder.call(this, entity);
this.enc = 'pem';
}
inherits(PEMEncoder, DEREncoder);
module.exports = PEMEncoder;
PEMEncoder.prototype.encode = function encode(data, options) {
const buf = DEREncoder.prototype.encode.call(this, data);
const p = buf.toString('base64');
const out = [ '-----BEGIN ' + options.label + '-----' ];
for (let i = 0; i < p.length; i += 64)
out.push(p.slice(i, i + 64));
out.push('-----END ' + options.label + '-----');
return out.join('\n');
};
/***/ }),
/***/ 215:
/*!*********************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/decoders/index.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const decoders = exports;
decoders.der = __webpack_require__(/*! ./der */ 216);
decoders.pem = __webpack_require__(/*! ./pem */ 217);
/***/ }),
/***/ 216:
/*!*******************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/decoders/der.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const inherits = __webpack_require__(/*! inherits */ 86);
const bignum = __webpack_require__(/*! bn.js */ 162);
const DecoderBuffer = __webpack_require__(/*! ../base/buffer */ 212).DecoderBuffer;
const Node = __webpack_require__(/*! ../base/node */ 210);
// Import DER constants
const der = __webpack_require__(/*! ../constants/der */ 213);
function DERDecoder(entity) {
this.enc = 'der';
this.name = entity.name;
this.entity = entity;
// Construct base tree
this.tree = new DERNode();
this.tree._init(entity.body);
}
module.exports = DERDecoder;
DERDecoder.prototype.decode = function decode(data, options) {
if (!DecoderBuffer.isDecoderBuffer(data)) {
data = new DecoderBuffer(data, options);
}
return this.tree._decode(data, options);
};
// Tree methods
function DERNode(parent) {
Node.call(this, 'der', parent);
}
inherits(DERNode, Node);
DERNode.prototype._peekTag = function peekTag(buffer, tag, any) {
if (buffer.isEmpty())
return false;
const state = buffer.save();
const decodedTag = derDecodeTag(buffer, 'Failed to peek tag: "' + tag + '"');
if (buffer.isError(decodedTag))
return decodedTag;
buffer.restore(state);
return decodedTag.tag === tag || decodedTag.tagStr === tag ||
(decodedTag.tagStr + 'of') === tag || any;
};
DERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) {
const decodedTag = derDecodeTag(buffer,
'Failed to decode tag of "' + tag + '"');
if (buffer.isError(decodedTag))
return decodedTag;
let len = derDecodeLen(buffer,
decodedTag.primitive,
'Failed to get length of "' + tag + '"');
// Failure
if (buffer.isError(len))
return len;
if (!any &&
decodedTag.tag !== tag &&
decodedTag.tagStr !== tag &&
decodedTag.tagStr + 'of' !== tag) {
return buffer.error('Failed to match tag: "' + tag + '"');
}
if (decodedTag.primitive || len !== null)
return buffer.skip(len, 'Failed to match body of: "' + tag + '"');
// Indefinite length... find END tag
const state = buffer.save();
const res = this._skipUntilEnd(
buffer,
'Failed to skip indefinite length body: "' + this.tag + '"');
if (buffer.isError(res))
return res;
len = buffer.offset - state.offset;
buffer.restore(state);
return buffer.skip(len, 'Failed to match body of: "' + tag + '"');
};
DERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) {
for (;;) {
const tag = derDecodeTag(buffer, fail);
if (buffer.isError(tag))
return tag;
const len = derDecodeLen(buffer, tag.primitive, fail);
if (buffer.isError(len))
return len;
let res;
if (tag.primitive || len !== null)
res = buffer.skip(len);
else
res = this._skipUntilEnd(buffer, fail);
// Failure
if (buffer.isError(res))
return res;
if (tag.tagStr === 'end')
break;
}
};
DERNode.prototype._decodeList = function decodeList(buffer, tag, decoder,
options) {
const result = [];
while (!buffer.isEmpty()) {
const possibleEnd = this._peekTag(buffer, 'end');
if (buffer.isError(possibleEnd))
return possibleEnd;
const res = decoder.decode(buffer, 'der', options);
if (buffer.isError(res) && possibleEnd)
break;
result.push(res);
}
return result;
};
DERNode.prototype._decodeStr = function decodeStr(buffer, tag) {
if (tag === 'bitstr') {
const unused = buffer.readUInt8();
if (buffer.isError(unused))
return unused;
return { unused: unused, data: buffer.raw() };
} else if (tag === 'bmpstr') {
const raw = buffer.raw();
if (raw.length % 2 === 1)
return buffer.error('Decoding of string type: bmpstr length mismatch');
let str = '';
for (let i = 0; i < raw.length / 2; i++) {
str += String.fromCharCode(raw.readUInt16BE(i * 2));
}
return str;
} else if (tag === 'numstr') {
const numstr = buffer.raw().toString('ascii');
if (!this._isNumstr(numstr)) {
return buffer.error('Decoding of string type: ' +
'numstr unsupported characters');
}
return numstr;
} else if (tag === 'octstr') {
return buffer.raw();
} else if (tag === 'objDesc') {
return buffer.raw();
} else if (tag === 'printstr') {
const printstr = buffer.raw().toString('ascii');
if (!this._isPrintstr(printstr)) {
return buffer.error('Decoding of string type: ' +
'printstr unsupported characters');
}
return printstr;
} else if (/str$/.test(tag)) {
return buffer.raw().toString();
} else {
return buffer.error('Decoding of string type: ' + tag + ' unsupported');
}
};
DERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) {
let result;
const identifiers = [];
let ident = 0;
let subident = 0;
while (!buffer.isEmpty()) {
subident = buffer.readUInt8();
ident <<= 7;
ident |= subident & 0x7f;
if ((subident & 0x80) === 0) {
identifiers.push(ident);
ident = 0;
}
}
if (subident & 0x80)
identifiers.push(ident);
const first = (identifiers[0] / 40) | 0;
const second = identifiers[0] % 40;
if (relative)
result = identifiers;
else
result = [first, second].concat(identifiers.slice(1));
if (values) {
let tmp = values[result.join(' ')];
if (tmp === undefined)
tmp = values[result.join('.')];
if (tmp !== undefined)
result = tmp;
}
return result;
};
DERNode.prototype._decodeTime = function decodeTime(buffer, tag) {
const str = buffer.raw().toString();
let year;
let mon;
let day;
let hour;
let min;
let sec;
if (tag === 'gentime') {
year = str.slice(0, 4) | 0;
mon = str.slice(4, 6) | 0;
day = str.slice(6, 8) | 0;
hour = str.slice(8, 10) | 0;
min = str.slice(10, 12) | 0;
sec = str.slice(12, 14) | 0;
} else if (tag === 'utctime') {
year = str.slice(0, 2) | 0;
mon = str.slice(2, 4) | 0;
day = str.slice(4, 6) | 0;
hour = str.slice(6, 8) | 0;
min = str.slice(8, 10) | 0;
sec = str.slice(10, 12) | 0;
if (year < 70)
year = 2000 + year;
else
year = 1900 + year;
} else {
return buffer.error('Decoding ' + tag + ' time is not supported yet');
}
return Date.UTC(year, mon - 1, day, hour, min, sec, 0);
};
DERNode.prototype._decodeNull = function decodeNull() {
return null;
};
DERNode.prototype._decodeBool = function decodeBool(buffer) {
const res = buffer.readUInt8();
if (buffer.isError(res))
return res;
else
return res !== 0;
};
DERNode.prototype._decodeInt = function decodeInt(buffer, values) {
// Bigint, return as it is (assume big endian)
const raw = buffer.raw();
let res = new bignum(raw);
if (values)
res = values[res.toString(10)] || res;
return res;
};
DERNode.prototype._use = function use(entity, obj) {
if (typeof entity === 'function')
entity = entity(obj);
return entity._getDecoder('der').tree;
};
// Utility methods
function derDecodeTag(buf, fail) {
let tag = buf.readUInt8(fail);
if (buf.isError(tag))
return tag;
const cls = der.tagClass[tag >> 6];
const primitive = (tag & 0x20) === 0;
// Multi-octet tag - load
if ((tag & 0x1f) === 0x1f) {
let oct = tag;
tag = 0;
while ((oct & 0x80) === 0x80) {
oct = buf.readUInt8(fail);
if (buf.isError(oct))
return oct;
tag <<= 7;
tag |= oct & 0x7f;
}
} else {
tag &= 0x1f;
}
const tagStr = der.tag[tag];
return {
cls: cls,
primitive: primitive,
tag: tag,
tagStr: tagStr
};
}
function derDecodeLen(buf, primitive, fail) {
let len = buf.readUInt8(fail);
if (buf.isError(len))
return len;
// Indefinite form
if (!primitive && len === 0x80)
return null;
// Definite form
if ((len & 0x80) === 0) {
// Short form
return len;
}
// Long form
const num = len & 0x7f;
if (num > 4)
return buf.error('length octect is too long');
len = 0;
for (let i = 0; i < num; i++) {
len <<= 8;
const j = buf.readUInt8(fail);
if (buf.isError(j))
return j;
len |= j;
}
return len;
}
/***/ }),
/***/ 217:
/*!*******************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/decoders/pem.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const inherits = __webpack_require__(/*! inherits */ 86);
const Buffer = __webpack_require__(/*! safer-buffer */ 209).Buffer;
const DERDecoder = __webpack_require__(/*! ./der */ 216);
function PEMDecoder(entity) {
DERDecoder.call(this, entity);
this.enc = 'pem';
}
inherits(PEMDecoder, DERDecoder);
module.exports = PEMDecoder;
PEMDecoder.prototype.decode = function decode(data, options) {
const lines = data.toString().split(/[\r\n]+/g);
const label = options.label.toUpperCase();
const re = /^-----(BEGIN|END) ([^-]+)-----$/;
let start = -1;
let end = -1;
for (let i = 0; i < lines.length; i++) {
const match = lines[i].match(re);
if (match === null)
continue;
if (match[2] !== label)
continue;
if (start === -1) {
if (match[1] !== 'BEGIN')
break;
start = i;
} else {
if (match[1] !== 'END')
break;
end = i;
break;
}
}
if (start === -1 || end === -1)
throw new Error('PEM section not found for: ' + label);
const base64 = lines.slice(start + 1, end).join('');
// Remove excessive symbols
base64.replace(/[^a-z0-9+/=]+/gi, '');
const input = Buffer.from(base64, 'base64');
return DERDecoder.prototype.decode.call(this, input, options);
};
/***/ }),
/***/ 218:
/*!*****************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/base/index.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const base = exports;
base.Reporter = __webpack_require__(/*! ./reporter */ 211).Reporter;
base.DecoderBuffer = __webpack_require__(/*! ./buffer */ 212).DecoderBuffer;
base.EncoderBuffer = __webpack_require__(/*! ./buffer */ 212).EncoderBuffer;
base.Node = __webpack_require__(/*! ./node */ 210);
/***/ }),
/***/ 219:
/*!**********************************************************!*\
!*** ./node_modules/asn1.js/lib/asn1/constants/index.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const constants = exports;
// Helper
constants._reverse = function reverse(map) {
const res = {};
Object.keys(map).forEach(function(key) {
// Convert key to integer if it is stringified
if ((key | 0) == key)
key = key | 0;
const value = map[key];
res[value] = key;
});
return res;
};
constants.der = __webpack_require__(/*! ./der */ 213);
/***/ }),
/***/ 22:
/*!*************************************************************!*\
!*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(uni, global) {
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
exports.compileI18nJsonStr = compileI18nJsonStr;
exports.hasI18nJson = hasI18nJson;
exports.initVueI18n = initVueI18n;
exports.isI18nStr = isI18nStr;
exports.isString = void 0;
exports.normalizeLocale = normalizeLocale;
exports.parseI18nJson = parseI18nJson;
exports.resolveLocale = resolveLocale;
var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
var isObject = function isObject(val) {
return val !== null && (0, _typeof2.default)(val) === 'object';
};
var defaultDelimiters = ['{', '}'];
var BaseFormatter = /*#__PURE__*/function () {
function BaseFormatter() {
(0, _classCallCheck2.default)(this, BaseFormatter);
this._caches = Object.create(null);
}
(0, _createClass2.default)(BaseFormatter, [{
key: "interpolate",
value: function interpolate(message, values) {
var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
if (!values) {
return [message];
}
var tokens = this._caches[message];
if (!tokens) {
tokens = parse(message, delimiters);
this._caches[message] = tokens;
}
return compile(tokens, values);
}
}]);
return BaseFormatter;
}();
exports.Formatter = BaseFormatter;
var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
function parse(format, _ref) {
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
startDelimiter = _ref2[0],
endDelimiter = _ref2[1];
var tokens = [];
var position = 0;
var text = '';
while (position < format.length) {
var char = format[position++];
if (char === startDelimiter) {
if (text) {
tokens.push({
type: 'text',
value: text
});
}
text = '';
var sub = '';
char = format[position++];
while (char !== undefined && char !== endDelimiter) {
sub += char;
char = format[position++];
}
var isClosed = char === endDelimiter;
var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
tokens.push({
value: sub,
type: type
});
}
// else if (char === '%') {
// // when found rails i18n syntax, skip text capture
// if (format[position] !== '{') {
// text += char
// }
// }
else {
text += char;
}
}
text && tokens.push({
type: 'text',
value: text
});
return tokens;
}
function compile(tokens, values) {
var compiled = [];
var index = 0;
var mode = Array.isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
if (mode === 'unknown') {
return compiled;
}
while (index < tokens.length) {
var token = tokens[index];
switch (token.type) {
case 'text':
compiled.push(token.value);
break;
case 'list':
compiled.push(values[parseInt(token.value, 10)]);
break;
case 'named':
if (mode === 'named') {
compiled.push(values[token.value]);
} else {
if (true) {
console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
}
}
break;
case 'unknown':
if (true) {
console.warn("Detect 'unknown' type of token!");
}
break;
}
index++;
}
return compiled;
}
var LOCALE_ZH_HANS = 'zh-Hans';
exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
var LOCALE_ZH_HANT = 'zh-Hant';
exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
var LOCALE_EN = 'en';
exports.LOCALE_EN = LOCALE_EN;
var LOCALE_FR = 'fr';
exports.LOCALE_FR = LOCALE_FR;
var LOCALE_ES = 'es';
exports.LOCALE_ES = LOCALE_ES;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var hasOwn = function hasOwn(val, key) {
return hasOwnProperty.call(val, key);
};
var defaultFormatter = new BaseFormatter();
function include(str, parts) {
return !!parts.find(function (part) {
return str.indexOf(part) !== -1;
});
}
function startsWith(str, parts) {
return parts.find(function (part) {
return str.indexOf(part) === 0;
});
}
function normalizeLocale(locale, messages) {
if (!locale) {
return;
}
locale = locale.trim().replace(/_/g, '-');
if (messages && messages[locale]) {
return locale;
}
locale = locale.toLowerCase();
if (locale === 'chinese') {
// 支付宝
return LOCALE_ZH_HANS;
}
if (locale.indexOf('zh') === 0) {
if (locale.indexOf('-hans') > -1) {
return LOCALE_ZH_HANS;
}
if (locale.indexOf('-hant') > -1) {
return LOCALE_ZH_HANT;
}
if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
return LOCALE_ZH_HANT;
}
return LOCALE_ZH_HANS;
}
var locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
if (messages && Object.keys(messages).length > 0) {
locales = Object.keys(messages);
}
var lang = startsWith(locale, locales);
if (lang) {
return lang;
}
}
var I18n = /*#__PURE__*/function () {
function I18n(_ref3) {
var locale = _ref3.locale,
fallbackLocale = _ref3.fallbackLocale,
messages = _ref3.messages,
watcher = _ref3.watcher,
formater = _ref3.formater;
(0, _classCallCheck2.default)(this, I18n);
this.locale = LOCALE_EN;
this.fallbackLocale = LOCALE_EN;
this.message = {};
this.messages = {};
this.watchers = [];
if (fallbackLocale) {
this.fallbackLocale = fallbackLocale;
}
this.formater = formater || defaultFormatter;
this.messages = messages || {};
this.setLocale(locale || LOCALE_EN);
if (watcher) {
this.watchLocale(watcher);
}
}
(0, _createClass2.default)(I18n, [{
key: "setLocale",
value: function setLocale(locale) {
var _this = this;
var oldLocale = this.locale;
this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
if (!this.messages[this.locale]) {
// 可能初始化时不存在
this.messages[this.locale] = {};
}
this.message = this.messages[this.locale];
// 仅发生变化时,通知
if (oldLocale !== this.locale) {
this.watchers.forEach(function (watcher) {
watcher(_this.locale, oldLocale);
});
}
}
}, {
key: "getLocale",
value: function getLocale() {
return this.locale;
}
}, {
key: "watchLocale",
value: function watchLocale(fn) {
var _this2 = this;
var index = this.watchers.push(fn) - 1;
return function () {
_this2.watchers.splice(index, 1);
};
}
}, {
key: "add",
value: function add(locale, message) {
var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
var curMessages = this.messages[locale];
if (curMessages) {
if (override) {
Object.assign(curMessages, message);
} else {
Object.keys(message).forEach(function (key) {
if (!hasOwn(curMessages, key)) {
curMessages[key] = message[key];
}
});
}
} else {
this.messages[locale] = message;
}
}
}, {
key: "f",
value: function f(message, values, delimiters) {
return this.formater.interpolate(message, values, delimiters).join('');
}
}, {
key: "t",
value: function t(key, locale, values) {
var message = this.message;
if (typeof locale === 'string') {
locale = normalizeLocale(locale, this.messages);
locale && (message = this.messages[locale]);
} else {
values = locale;
}
if (!hasOwn(message, key)) {
console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
return key;
}
return this.formater.interpolate(message[key], values).join('');
}
}]);
return I18n;
}();
exports.I18n = I18n;
function watchAppLocale(appVm, i18n) {
// 需要保证 watch 的触发在组件渲染之前
if (appVm.$watchLocale) {
// vue2
appVm.$watchLocale(function (newLocale) {
i18n.setLocale(newLocale);
});
} else {
appVm.$watch(function () {
return appVm.$locale;
}, function (newLocale) {
i18n.setLocale(newLocale);
});
}
}
function getDefaultLocale() {
if (typeof uni !== 'undefined' && uni.getLocale) {
return uni.getLocale();
}
// 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
if (typeof global !== 'undefined' && global.getLocale) {
return global.getLocale();
}
return LOCALE_EN;
}
function initVueI18n(locale) {
var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
var watcher = arguments.length > 3 ? arguments[3] : undefined;
// 兼容旧版本入参
if (typeof locale !== 'string') {
var _ref4 = [messages, locale];
locale = _ref4[0];
messages = _ref4[1];
}
if (typeof locale !== 'string') {
// 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
locale = getDefaultLocale();
}
if (typeof fallbackLocale !== 'string') {
fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
}
var i18n = new I18n({
locale: locale,
fallbackLocale: fallbackLocale,
messages: messages,
watcher: watcher
});
var _t = function t(key, values) {
if (typeof getApp !== 'function') {
// app view
/* eslint-disable no-func-assign */
_t = function t(key, values) {
return i18n.t(key, values);
};
} else {
var isWatchedAppLocale = false;
_t = function t(key, values) {
var appVm = getApp().$vm;
// 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
// options: {
// type: Array,
// default () {
// return [{
// icon: 'shop',
// text: t("uni-goods-nav.options.shop"),
// }, {
// icon: 'cart',
// text: t("uni-goods-nav.options.cart")
// }]
// }
// },
if (appVm) {
// 触发响应式
appVm.$locale;
if (!isWatchedAppLocale) {
isWatchedAppLocale = true;
watchAppLocale(appVm, i18n);
}
}
return i18n.t(key, values);
};
}
return _t(key, values);
};
return {
i18n: i18n,
f: function f(message, values, delimiters) {
return i18n.f(message, values, delimiters);
},
t: function t(key, values) {
return _t(key, values);
},
add: function add(locale, message) {
var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
return i18n.add(locale, message, override);
},
watch: function watch(fn) {
return i18n.watchLocale(fn);
},
getLocale: function getLocale() {
return i18n.getLocale();
},
setLocale: function setLocale(newLocale) {
return i18n.setLocale(newLocale);
}
};
}
var isString = function isString(val) {
return typeof val === 'string';
};
exports.isString = isString;
var formater;
function hasI18nJson(jsonObj, delimiters) {
if (!formater) {
formater = new BaseFormatter();
}
return walkJsonObj(jsonObj, function (jsonObj, key) {
var value = jsonObj[key];
if (isString(value)) {
if (isI18nStr(value, delimiters)) {
return true;
}
} else {
return hasI18nJson(value, delimiters);
}
});
}
function parseI18nJson(jsonObj, values, delimiters) {
if (!formater) {
formater = new BaseFormatter();
}
walkJsonObj(jsonObj, function (jsonObj, key) {
var value = jsonObj[key];
if (isString(value)) {
if (isI18nStr(value, delimiters)) {
jsonObj[key] = compileStr(value, values, delimiters);
}
} else {
parseI18nJson(value, values, delimiters);
}
});
return jsonObj;
}
function compileI18nJsonStr(jsonStr, _ref5) {
var locale = _ref5.locale,
locales = _ref5.locales,
delimiters = _ref5.delimiters;
if (!isI18nStr(jsonStr, delimiters)) {
return jsonStr;
}
if (!formater) {
formater = new BaseFormatter();
}
var localeValues = [];
Object.keys(locales).forEach(function (name) {
if (name !== locale) {
localeValues.push({
locale: name,
values: locales[name]
});
}
});
localeValues.unshift({
locale: locale,
values: locales[locale]
});
try {
return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
} catch (e) {}
return jsonStr;
}
function isI18nStr(value, delimiters) {
return value.indexOf(delimiters[0]) > -1;
}
function compileStr(value, values, delimiters) {
return formater.interpolate(value, values, delimiters).join('');
}
function compileValue(jsonObj, key, localeValues, delimiters) {
var value = jsonObj[key];
if (isString(value)) {
// 存在国际化
if (isI18nStr(value, delimiters)) {
jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
if (localeValues.length > 1) {
// 格式化国际化语言
var valueLocales = jsonObj[key + 'Locales'] = {};
localeValues.forEach(function (localValue) {
valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
});
}
}
} else {
compileJsonObj(value, localeValues, delimiters);
}
}
function compileJsonObj(jsonObj, localeValues, delimiters) {
walkJsonObj(jsonObj, function (jsonObj, key) {
compileValue(jsonObj, key, localeValues, delimiters);
});
return jsonObj;
}
function walkJsonObj(jsonObj, walk) {
if (Array.isArray(jsonObj)) {
for (var i = 0; i < jsonObj.length; i++) {
if (walk(jsonObj, i)) {
return true;
}
}
} else if (isObject(jsonObj)) {
for (var key in jsonObj) {
if (walk(jsonObj, key)) {
return true;
}
}
}
return false;
}
function resolveLocale(locales) {
return function (locale) {
if (!locale) {
return locale;
}
locale = normalizeLocale(locale) || locale;
return resolveLocaleChain(locale).find(function (locale) {
return locales.indexOf(locale) > -1;
});
};
}
function resolveLocaleChain(locale) {
var chain = [];
var tokens = locale.split('-');
while (tokens.length) {
chain.push(tokens.join('-'));
tokens.pop();
}
return chain;
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
/***/ }),
/***/ 220:
/*!************************************************!*\
!*** ./node_modules/parse-asn1/certificate.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js
// thanks to @Rantanen
var asn = __webpack_require__(/*! asn1.js */ 205)
var Time = asn.define('Time', function () {
this.choice({
utcTime: this.utctime(),
generalTime: this.gentime()
})
})
var AttributeTypeValue = asn.define('AttributeTypeValue', function () {
this.seq().obj(
this.key('type').objid(),
this.key('value').any()
)
})
var AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () {
this.seq().obj(
this.key('algorithm').objid(),
this.key('parameters').optional(),
this.key('curve').objid().optional()
)
})
var SubjectPublicKeyInfo = asn.define('SubjectPublicKeyInfo', function () {
this.seq().obj(
this.key('algorithm').use(AlgorithmIdentifier),
this.key('subjectPublicKey').bitstr()
)
})
var RelativeDistinguishedName = asn.define('RelativeDistinguishedName', function () {
this.setof(AttributeTypeValue)
})
var RDNSequence = asn.define('RDNSequence', function () {
this.seqof(RelativeDistinguishedName)
})
var Name = asn.define('Name', function () {
this.choice({
rdnSequence: this.use(RDNSequence)
})
})
var Validity = asn.define('Validity', function () {
this.seq().obj(
this.key('notBefore').use(Time),
this.key('notAfter').use(Time)
)
})
var Extension = asn.define('Extension', function () {
this.seq().obj(
this.key('extnID').objid(),
this.key('critical').bool().def(false),
this.key('extnValue').octstr()
)
})
var TBSCertificate = asn.define('TBSCertificate', function () {
this.seq().obj(
this.key('version').explicit(0).int().optional(),
this.key('serialNumber').int(),
this.key('signature').use(AlgorithmIdentifier),
this.key('issuer').use(Name),
this.key('validity').use(Validity),
this.key('subject').use(Name),
this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo),
this.key('issuerUniqueID').implicit(1).bitstr().optional(),
this.key('subjectUniqueID').implicit(2).bitstr().optional(),
this.key('extensions').explicit(3).seqof(Extension).optional()
)
})
var X509Certificate = asn.define('X509Certificate', function () {
this.seq().obj(
this.key('tbsCertificate').use(TBSCertificate),
this.key('signatureAlgorithm').use(AlgorithmIdentifier),
this.key('signatureValue').bitstr()
)
})
module.exports = X509Certificate
/***/ }),
/***/ 221:
/*!********************************************!*\
!*** ./node_modules/parse-asn1/aesid.json ***!
\********************************************/
/*! exports provided: 2.16.840.1.101.3.4.1.1, 2.16.840.1.101.3.4.1.2, 2.16.840.1.101.3.4.1.3, 2.16.840.1.101.3.4.1.4, 2.16.840.1.101.3.4.1.21, 2.16.840.1.101.3.4.1.22, 2.16.840.1.101.3.4.1.23, 2.16.840.1.101.3.4.1.24, 2.16.840.1.101.3.4.1.41, 2.16.840.1.101.3.4.1.42, 2.16.840.1.101.3.4.1.43, 2.16.840.1.101.3.4.1.44, default */
/***/ (function(module) {
module.exports = JSON.parse("{\"2.16.840.1.101.3.4.1.1\":\"aes-128-ecb\",\"2.16.840.1.101.3.4.1.2\":\"aes-128-cbc\",\"2.16.840.1.101.3.4.1.3\":\"aes-128-ofb\",\"2.16.840.1.101.3.4.1.4\":\"aes-128-cfb\",\"2.16.840.1.101.3.4.1.21\":\"aes-192-ecb\",\"2.16.840.1.101.3.4.1.22\":\"aes-192-cbc\",\"2.16.840.1.101.3.4.1.23\":\"aes-192-ofb\",\"2.16.840.1.101.3.4.1.24\":\"aes-192-cfb\",\"2.16.840.1.101.3.4.1.41\":\"aes-256-ecb\",\"2.16.840.1.101.3.4.1.42\":\"aes-256-cbc\",\"2.16.840.1.101.3.4.1.43\":\"aes-256-ofb\",\"2.16.840.1.101.3.4.1.44\":\"aes-256-cfb\"}");
/***/ }),
/***/ 222:
/*!********************************************!*\
!*** ./node_modules/parse-asn1/fixProc.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// adapted from https://github.com/apatil/pemstrip
var findProc = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m
var startRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m
var fullRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m
var evp = __webpack_require__(/*! evp_bytestokey */ 157)
var ciphers = __webpack_require__(/*! browserify-aes */ 140)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
module.exports = function (okey, password) {
var key = okey.toString()
var match = key.match(findProc)
var decrypted
if (!match) {
var match2 = key.match(fullRegex)
decrypted = Buffer.from(match2[2].replace(/[\r\n]/g, ''), 'base64')
} else {
var suite = 'aes' + match[1]
var iv = Buffer.from(match[2], 'hex')
var cipherText = Buffer.from(match[3].replace(/[\r\n]/g, ''), 'base64')
var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key
var out = []
var cipher = ciphers.createDecipheriv(suite, cipherKey, iv)
out.push(cipher.update(cipherText))
out.push(cipher.final())
decrypted = Buffer.concat(out)
}
var tag = key.match(startRegex)[1]
return {
tag: tag,
data: decrypted
}
}
/***/ }),
/***/ 223:
/*!**********************************************************!*\
!*** ./node_modules/browserify-sign/browser/curves.json ***!
\**********************************************************/
/*! exports provided: 1.3.132.0.10, 1.3.132.0.33, 1.2.840.10045.3.1.1, 1.2.840.10045.3.1.7, 1.3.132.0.34, 1.3.132.0.35, default */
/***/ (function(module) {
module.exports = JSON.parse("{\"1.3.132.0.10\":\"secp256k1\",\"1.3.132.0.33\":\"p224\",\"1.2.840.10045.3.1.1\":\"p192\",\"1.2.840.10045.3.1.7\":\"p256\",\"1.3.132.0.34\":\"p384\",\"1.3.132.0.35\":\"p521\"}");
/***/ }),
/***/ 224:
/*!********************************************************!*\
!*** ./node_modules/browserify-sign/browser/verify.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var BN = __webpack_require__(/*! bn.js */ 162)
var EC = __webpack_require__(/*! elliptic */ 173).ec
var parseKeys = __webpack_require__(/*! parse-asn1 */ 203)
var curves = __webpack_require__(/*! ./curves.json */ 223)
function verify (sig, hash, key, signType, tag) {
var pub = parseKeys(key)
if (pub.type === 'ec') {
// rsa keys can be interpreted as ecdsa ones in openssl
if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')
return ecVerify(sig, hash, pub)
} else if (pub.type === 'dsa') {
if (signType !== 'dsa') throw new Error('wrong public key type')
return dsaVerify(sig, hash, pub)
} else {
if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')
}
hash = Buffer.concat([tag, hash])
var len = pub.modulus.byteLength()
var pad = [1]
var padNum = 0
while (hash.length + pad.length + 2 < len) {
pad.push(0xff)
padNum++
}
pad.push(0x00)
var i = -1
while (++i < hash.length) {
pad.push(hash[i])
}
pad = Buffer.from(pad)
var red = BN.mont(pub.modulus)
sig = new BN(sig).toRed(red)
sig = sig.redPow(new BN(pub.publicExponent))
sig = Buffer.from(sig.fromRed().toArray())
var out = padNum < 8 ? 1 : 0
len = Math.min(sig.length, pad.length)
if (sig.length !== pad.length) out = 1
i = -1
while (++i < len) out |= sig[i] ^ pad[i]
return out === 0
}
function ecVerify (sig, hash, pub) {
var curveId = curves[pub.data.algorithm.curve.join('.')]
if (!curveId) throw new Error('unknown curve ' + pub.data.algorithm.curve.join('.'))
var curve = new EC(curveId)
var pubkey = pub.data.subjectPrivateKey.data
return curve.verify(hash, sig, pubkey)
}
function dsaVerify (sig, hash, pub) {
var p = pub.data.p
var q = pub.data.q
var g = pub.data.g
var y = pub.data.pub_key
var unpacked = parseKeys.signature.decode(sig, 'der')
var s = unpacked.s
var r = unpacked.r
checkValue(s, q)
checkValue(r, q)
var montp = BN.mont(p)
var w = s.invm(q)
var v = g.toRed(montp)
.redPow(new BN(hash).mul(w).mod(q))
.fromRed()
.mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed())
.mod(p)
.mod(q)
return v.cmp(r) === 0
}
function checkValue (b, q) {
if (b.cmpn(0) <= 0) throw new Error('invalid sig')
if (b.cmp(q) >= q) throw new Error('invalid sig')
}
module.exports = verify
/***/ }),
/***/ 225:
/*!*********************************************!*\
!*** ./node_modules/create-ecdh/browser.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(Buffer) {var elliptic = __webpack_require__(/*! elliptic */ 173)
var BN = __webpack_require__(/*! bn.js */ 162)
module.exports = function createECDH (curve) {
return new ECDH(curve)
}
var aliases = {
secp256k1: {
name: 'secp256k1',
byteLength: 32
},
secp224r1: {
name: 'p224',
byteLength: 28
},
prime256v1: {
name: 'p256',
byteLength: 32
},
prime192v1: {
name: 'p192',
byteLength: 24
},
ed25519: {
name: 'ed25519',
byteLength: 32
},
secp384r1: {
name: 'p384',
byteLength: 48
},
secp521r1: {
name: 'p521',
byteLength: 66
}
}
aliases.p224 = aliases.secp224r1
aliases.p256 = aliases.secp256r1 = aliases.prime256v1
aliases.p192 = aliases.secp192r1 = aliases.prime192v1
aliases.p384 = aliases.secp384r1
aliases.p521 = aliases.secp521r1
function ECDH (curve) {
this.curveType = aliases[curve]
if (!this.curveType) {
this.curveType = {
name: curve
}
}
this.curve = new elliptic.ec(this.curveType.name) // eslint-disable-line new-cap
this.keys = void 0
}
ECDH.prototype.generateKeys = function (enc, format) {
this.keys = this.curve.genKeyPair()
return this.getPublicKey(enc, format)
}
ECDH.prototype.computeSecret = function (other, inenc, enc) {
inenc = inenc || 'utf8'
if (!Buffer.isBuffer(other)) {
other = new Buffer(other, inenc)
}
var otherPub = this.curve.keyFromPublic(other).getPublic()
var out = otherPub.mul(this.keys.getPrivate()).getX()
return formatReturnValue(out, enc, this.curveType.byteLength)
}
ECDH.prototype.getPublicKey = function (enc, format) {
var key = this.keys.getPublic(format === 'compressed', true)
if (format === 'hybrid') {
if (key[key.length - 1] % 2) {
key[0] = 7
} else {
key[0] = 6
}
}
return formatReturnValue(key, enc)
}
ECDH.prototype.getPrivateKey = function (enc) {
return formatReturnValue(this.keys.getPrivate(), enc)
}
ECDH.prototype.setPublicKey = function (pub, enc) {
enc = enc || 'utf8'
if (!Buffer.isBuffer(pub)) {
pub = new Buffer(pub, enc)
}
this.keys._importPublic(pub)
return this
}
ECDH.prototype.setPrivateKey = function (priv, enc) {
enc = enc || 'utf8'
if (!Buffer.isBuffer(priv)) {
priv = new Buffer(priv, enc)
}
var _priv = new BN(priv)
_priv = _priv.toString(16)
this.keys = this.curve.genKeyPair()
this.keys._importPrivate(_priv)
return this
}
function formatReturnValue (bn, enc, len) {
if (!Array.isArray(bn)) {
bn = bn.toArray()
}
var buf = new Buffer(bn)
if (len && buf.length < len) {
var zeros = new Buffer(len - buf.length)
zeros.fill(0)
buf = Buffer.concat([zeros, buf])
}
if (!enc) {
return buf
} else {
return buf.toString(enc)
}
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 81).Buffer))
/***/ }),
/***/ 226:
/*!************************************************!*\
!*** ./node_modules/public-encrypt/browser.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
exports.publicEncrypt = __webpack_require__(/*! ./publicEncrypt */ 227)
exports.privateDecrypt = __webpack_require__(/*! ./privateDecrypt */ 231)
exports.privateEncrypt = function privateEncrypt (key, buf) {
return exports.publicEncrypt(key, buf, true)
}
exports.publicDecrypt = function publicDecrypt (key, buf) {
return exports.privateDecrypt(key, buf, true)
}
/***/ }),
/***/ 227:
/*!******************************************************!*\
!*** ./node_modules/public-encrypt/publicEncrypt.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var parseKeys = __webpack_require__(/*! parse-asn1 */ 203)
var randomBytes = __webpack_require__(/*! randombytes */ 77)
var createHash = __webpack_require__(/*! create-hash */ 85)
var mgf = __webpack_require__(/*! ./mgf */ 228)
var xor = __webpack_require__(/*! ./xor */ 229)
var BN = __webpack_require__(/*! bn.js */ 162)
var withPublic = __webpack_require__(/*! ./withPublic */ 230)
var crt = __webpack_require__(/*! browserify-rsa */ 172)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
module.exports = function publicEncrypt (publicKey, msg, reverse) {
var padding
if (publicKey.padding) {
padding = publicKey.padding
} else if (reverse) {
padding = 1
} else {
padding = 4
}
var key = parseKeys(publicKey)
var paddedMsg
if (padding === 4) {
paddedMsg = oaep(key, msg)
} else if (padding === 1) {
paddedMsg = pkcs1(key, msg, reverse)
} else if (padding === 3) {
paddedMsg = new BN(msg)
if (paddedMsg.cmp(key.modulus) >= 0) {
throw new Error('data too long for modulus')
}
} else {
throw new Error('unknown padding')
}
if (reverse) {
return crt(paddedMsg, key)
} else {
return withPublic(paddedMsg, key)
}
}
function oaep (key, msg) {
var k = key.modulus.byteLength()
var mLen = msg.length
var iHash = createHash('sha1').update(Buffer.alloc(0)).digest()
var hLen = iHash.length
var hLen2 = 2 * hLen
if (mLen > k - hLen2 - 2) {
throw new Error('message too long')
}
var ps = Buffer.alloc(k - mLen - hLen2 - 2)
var dblen = k - hLen - 1
var seed = randomBytes(hLen)
var maskedDb = xor(Buffer.concat([iHash, ps, Buffer.alloc(1, 1), msg], dblen), mgf(seed, dblen))
var maskedSeed = xor(seed, mgf(maskedDb, hLen))
return new BN(Buffer.concat([Buffer.alloc(1), maskedSeed, maskedDb], k))
}
function pkcs1 (key, msg, reverse) {
var mLen = msg.length
var k = key.modulus.byteLength()
if (mLen > k - 11) {
throw new Error('message too long')
}
var ps
if (reverse) {
ps = Buffer.alloc(k - mLen - 3, 0xff)
} else {
ps = nonZero(k - mLen - 3)
}
return new BN(Buffer.concat([Buffer.from([0, reverse ? 1 : 2]), ps, Buffer.alloc(1), msg], k))
}
function nonZero (len) {
var out = Buffer.allocUnsafe(len)
var i = 0
var cache = randomBytes(len * 2)
var cur = 0
var num
while (i < len) {
if (cur === cache.length) {
cache = randomBytes(len * 2)
cur = 0
}
num = cache[cur++]
if (num) {
out[i++] = num
}
}
return out
}
/***/ }),
/***/ 228:
/*!********************************************!*\
!*** ./node_modules/public-encrypt/mgf.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var createHash = __webpack_require__(/*! create-hash */ 85)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
module.exports = function (seed, len) {
var t = Buffer.alloc(0)
var i = 0
var c
while (t.length < len) {
c = i2ops(i++)
t = Buffer.concat([t, createHash('sha1').update(seed).update(c).digest()])
}
return t.slice(0, len)
}
function i2ops (c) {
var out = Buffer.allocUnsafe(4)
out.writeUInt32BE(c, 0)
return out
}
/***/ }),
/***/ 229:
/*!********************************************!*\
!*** ./node_modules/public-encrypt/xor.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = function xor (a, b) {
var len = a.length
var i = -1
while (++i < len) {
a[i] ^= b[i]
}
return a
}
/***/ }),
/***/ 23:
/*!***************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 230:
/*!***************************************************!*\
!*** ./node_modules/public-encrypt/withPublic.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var BN = __webpack_require__(/*! bn.js */ 162)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
function withPublic (paddedMsg, key) {
return Buffer.from(paddedMsg
.toRed(BN.mont(key.modulus))
.redPow(new BN(key.publicExponent))
.fromRed()
.toArray())
}
module.exports = withPublic
/***/ }),
/***/ 231:
/*!*******************************************************!*\
!*** ./node_modules/public-encrypt/privateDecrypt.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var parseKeys = __webpack_require__(/*! parse-asn1 */ 203)
var mgf = __webpack_require__(/*! ./mgf */ 228)
var xor = __webpack_require__(/*! ./xor */ 229)
var BN = __webpack_require__(/*! bn.js */ 162)
var crt = __webpack_require__(/*! browserify-rsa */ 172)
var createHash = __webpack_require__(/*! create-hash */ 85)
var withPublic = __webpack_require__(/*! ./withPublic */ 230)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
module.exports = function privateDecrypt (privateKey, enc, reverse) {
var padding
if (privateKey.padding) {
padding = privateKey.padding
} else if (reverse) {
padding = 1
} else {
padding = 4
}
var key = parseKeys(privateKey)
var k = key.modulus.byteLength()
if (enc.length > k || new BN(enc).cmp(key.modulus) >= 0) {
throw new Error('decryption error')
}
var msg
if (reverse) {
msg = withPublic(new BN(enc), key)
} else {
msg = crt(enc, key)
}
var zBuffer = Buffer.alloc(k - msg.length)
msg = Buffer.concat([zBuffer, msg], k)
if (padding === 4) {
return oaep(key, msg)
} else if (padding === 1) {
return pkcs1(key, msg, reverse)
} else if (padding === 3) {
return msg
} else {
throw new Error('unknown padding')
}
}
function oaep (key, msg) {
var k = key.modulus.byteLength()
var iHash = createHash('sha1').update(Buffer.alloc(0)).digest()
var hLen = iHash.length
if (msg[0] !== 0) {
throw new Error('decryption error')
}
var maskedSeed = msg.slice(1, hLen + 1)
var maskedDb = msg.slice(hLen + 1)
var seed = xor(maskedSeed, mgf(maskedDb, hLen))
var db = xor(maskedDb, mgf(seed, k - hLen - 1))
if (compare(iHash, db.slice(0, hLen))) {
throw new Error('decryption error')
}
var i = hLen
while (db[i] === 0) {
i++
}
if (db[i++] !== 1) {
throw new Error('decryption error')
}
return db.slice(i)
}
function pkcs1 (key, msg, reverse) {
var p1 = msg.slice(0, 2)
var i = 2
var status = 0
while (msg[i++] !== 0) {
if (i >= msg.length) {
status++
break
}
}
var ps = msg.slice(2, i - 1)
if ((p1.toString('hex') !== '0002' && !reverse) || (p1.toString('hex') !== '0001' && reverse)) {
status++
}
if (ps.length < 8) {
status++
}
if (status) {
throw new Error('decryption error')
}
return msg.slice(i)
}
function compare (a, b) {
a = Buffer.from(a)
b = Buffer.from(b)
var dif = 0
var len = a.length
if (a.length !== b.length) {
dif++
len = Math.min(a.length, b.length)
}
var i = -1
while (++i < len) {
dif += (a[i] ^ b[i])
}
return dif
}
/***/ }),
/***/ 232:
/*!********************************************!*\
!*** ./node_modules/randomfill/browser.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global, process) {
function oldBrowser () {
throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11')
}
var safeBuffer = __webpack_require__(/*! safe-buffer */ 80)
var randombytes = __webpack_require__(/*! randombytes */ 77)
var Buffer = safeBuffer.Buffer
var kBufferMaxLength = safeBuffer.kMaxLength
var crypto = global.crypto || global.msCrypto
var kMaxUint32 = Math.pow(2, 32) - 1
function assertOffset (offset, length) {
if (typeof offset !== 'number' || offset !== offset) { // eslint-disable-line no-self-compare
throw new TypeError('offset must be a number')
}
if (offset > kMaxUint32 || offset < 0) {
throw new TypeError('offset must be a uint32')
}
if (offset > kBufferMaxLength || offset > length) {
throw new RangeError('offset out of range')
}
}
function assertSize (size, offset, length) {
if (typeof size !== 'number' || size !== size) { // eslint-disable-line no-self-compare
throw new TypeError('size must be a number')
}
if (size > kMaxUint32 || size < 0) {
throw new TypeError('size must be a uint32')
}
if (size + offset > length || size > kBufferMaxLength) {
throw new RangeError('buffer too small')
}
}
if ((crypto && crypto.getRandomValues) || !process.browser) {
exports.randomFill = randomFill
exports.randomFillSync = randomFillSync
} else {
exports.randomFill = oldBrowser
exports.randomFillSync = oldBrowser
}
function randomFill (buf, offset, size, cb) {
if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {
throw new TypeError('"buf" argument must be a Buffer or Uint8Array')
}
if (typeof offset === 'function') {
cb = offset
offset = 0
size = buf.length
} else if (typeof size === 'function') {
cb = size
size = buf.length - offset
} else if (typeof cb !== 'function') {
throw new TypeError('"cb" argument must be a function')
}
assertOffset(offset, buf.length)
assertSize(size, offset, buf.length)
return actualFill(buf, offset, size, cb)
}
function actualFill (buf, offset, size, cb) {
if (process.browser) {
var ourBuf = buf.buffer
var uint = new Uint8Array(ourBuf, offset, size)
crypto.getRandomValues(uint)
if (cb) {
process.nextTick(function () {
cb(null, buf)
})
return
}
return buf
}
if (cb) {
randombytes(size, function (err, bytes) {
if (err) {
return cb(err)
}
bytes.copy(buf, offset)
cb(null, buf)
})
return
}
var bytes = randombytes(size)
bytes.copy(buf, offset)
return buf
}
function randomFillSync (buf, offset, size) {
if (typeof offset === 'undefined') {
offset = 0
}
if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {
throw new TypeError('"buf" argument must be a Buffer or Uint8Array')
}
assertOffset(offset, buf.length)
if (size === undefined) size = buf.length - offset
assertSize(size, offset, buf.length)
return actualFill(buf, offset, size)
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 3), __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 78)))
/***/ }),
/***/ 24:
/*!************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}
module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 25:
/*!******************************************************************************************!*\
!*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
\******************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* WEBPACK VAR INJECTION */(function(global) {/*!
* Vue.js v2.6.11
* (c) 2014-2023 Evan You
* Released under the MIT License.
*/
/* */
var emptyObject = Object.freeze({});
// These helpers produce better VM code in JS engines due to their
// explicitness and function inlining.
function isUndef (v) {
return v === undefined || v === null
}
function isDef (v) {
return v !== undefined && v !== null
}
function isTrue (v) {
return v === true
}
function isFalse (v) {
return v === false
}
/**
* Check if value is primitive.
*/
function isPrimitive (value) {
return (
typeof value === 'string' ||
typeof value === 'number' ||
// $flow-disable-line
typeof value === 'symbol' ||
typeof value === 'boolean'
)
}
/**
* Quick object check - this is primarily used to tell
* Objects from primitive values when we know the value
* is a JSON-compliant type.
*/
function isObject (obj) {
return obj !== null && typeof obj === 'object'
}
/**
* Get the raw type string of a value, e.g., [object Object].
*/
var _toString = Object.prototype.toString;
function toRawType (value) {
return _toString.call(value).slice(8, -1)
}
/**
* Strict object type check. Only returns true
* for plain JavaScript objects.
*/
function isPlainObject (obj) {
return _toString.call(obj) === '[object Object]'
}
function isRegExp (v) {
return _toString.call(v) === '[object RegExp]'
}
/**
* Check if val is a valid array index.
*/
function isValidArrayIndex (val) {
var n = parseFloat(String(val));
return n >= 0 && Math.floor(n) === n && isFinite(val)
}
function isPromise (val) {
return (
isDef(val) &&
typeof val.then === 'function' &&
typeof val.catch === 'function'
)
}
/**
* Convert a value to a string that is actually rendered.
*/
function toString (val) {
return val == null
? ''
: Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
? JSON.stringify(val, null, 2)
: String(val)
}
/**
* Convert an input value to a number for persistence.
* If the conversion fails, return original string.
*/
function toNumber (val) {
var n = parseFloat(val);
return isNaN(n) ? val : n
}
/**
* Make a map and return a function for checking if a key
* is in that map.
*/
function makeMap (
str,
expectsLowerCase
) {
var map = Object.create(null);
var list = str.split(',');
for (var i = 0; i < list.length; i++) {
map[list[i]] = true;
}
return expectsLowerCase
? function (val) { return map[val.toLowerCase()]; }
: function (val) { return map[val]; }
}
/**
* Check if a tag is a built-in tag.
*/
var isBuiltInTag = makeMap('slot,component', true);
/**
* Check if an attribute is a reserved attribute.
*/
var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
/**
* Remove an item from an array.
*/
function remove (arr, item) {
if (arr.length) {
var index = arr.indexOf(item);
if (index > -1) {
return arr.splice(index, 1)
}
}
}
/**
* Check whether an object has the property.
*/
var hasOwnProperty = Object.prototype.hasOwnProperty;
function hasOwn (obj, key) {
return hasOwnProperty.call(obj, key)
}
/**
* Create a cached version of a pure function.
*/
function cached (fn) {
var cache = Object.create(null);
return (function cachedFn (str) {
var hit = cache[str];
return hit || (cache[str] = fn(str))
})
}
/**
* Camelize a hyphen-delimited string.
*/
var camelizeRE = /-(\w)/g;
var camelize = cached(function (str) {
return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
});
/**
* Capitalize a string.
*/
var capitalize = cached(function (str) {
return str.charAt(0).toUpperCase() + str.slice(1)
});
/**
* Hyphenate a camelCase string.
*/
var hyphenateRE = /\B([A-Z])/g;
var hyphenate = cached(function (str) {
return str.replace(hyphenateRE, '-$1').toLowerCase()
});
/**
* Simple bind polyfill for environments that do not support it,
* e.g., PhantomJS 1.x. Technically, we don't need this anymore
* since native bind is now performant enough in most browsers.
* But removing it would mean breaking code that was able to run in
* PhantomJS 1.x, so this must be kept for backward compatibility.
*/
/* istanbul ignore next */
function polyfillBind (fn, ctx) {
function boundFn (a) {
var l = arguments.length;
return l
? l > 1
? fn.apply(ctx, arguments)
: fn.call(ctx, a)
: fn.call(ctx)
}
boundFn._length = fn.length;
return boundFn
}
function nativeBind (fn, ctx) {
return fn.bind(ctx)
}
var bind = Function.prototype.bind
? nativeBind
: polyfillBind;
/**
* Convert an Array-like object to a real Array.
*/
function toArray (list, start) {
start = start || 0;
var i = list.length - start;
var ret = new Array(i);
while (i--) {
ret[i] = list[i + start];
}
return ret
}
/**
* Mix properties into target object.
*/
function extend (to, _from) {
for (var key in _from) {
to[key] = _from[key];
}
return to
}
/**
* Merge an Array of Objects into a single Object.
*/
function toObject (arr) {
var res = {};
for (var i = 0; i < arr.length; i++) {
if (arr[i]) {
extend(res, arr[i]);
}
}
return res
}
/* eslint-disable no-unused-vars */
/**
* Perform no operation.
* Stubbing args to make Flow happy without leaving useless transpiled code
* with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
*/
function noop (a, b, c) {}
/**
* Always return false.
*/
var no = function (a, b, c) { return false; };
/* eslint-enable no-unused-vars */
/**
* Return the same value.
*/
var identity = function (_) { return _; };
/**
* Check if two values are loosely equal - that is,
* if they are plain objects, do they have the same shape?
*/
function looseEqual (a, b) {
if (a === b) { return true }
var isObjectA = isObject(a);
var isObjectB = isObject(b);
if (isObjectA && isObjectB) {
try {
var isArrayA = Array.isArray(a);
var isArrayB = Array.isArray(b);
if (isArrayA && isArrayB) {
return a.length === b.length && a.every(function (e, i) {
return looseEqual(e, b[i])
})
} else if (a instanceof Date && b instanceof Date) {
return a.getTime() === b.getTime()
} else if (!isArrayA && !isArrayB) {
var keysA = Object.keys(a);
var keysB = Object.keys(b);
return keysA.length === keysB.length && keysA.every(function (key) {
return looseEqual(a[key], b[key])
})
} else {
/* istanbul ignore next */
return false
}
} catch (e) {
/* istanbul ignore next */
return false
}
} else if (!isObjectA && !isObjectB) {
return String(a) === String(b)
} else {
return false
}
}
/**
* Return the first index at which a loosely equal value can be
* found in the array (if value is a plain object, the array must
* contain an object of the same shape), or -1 if it is not present.
*/
function looseIndexOf (arr, val) {
for (var i = 0; i < arr.length; i++) {
if (looseEqual(arr[i], val)) { return i }
}
return -1
}
/**
* Ensure a function is called only once.
*/
function once (fn) {
var called = false;
return function () {
if (!called) {
called = true;
fn.apply(this, arguments);
}
}
}
var ASSET_TYPES = [
'component',
'directive',
'filter'
];
var LIFECYCLE_HOOKS = [
'beforeCreate',
'created',
'beforeMount',
'mounted',
'beforeUpdate',
'updated',
'beforeDestroy',
'destroyed',
'activated',
'deactivated',
'errorCaptured',
'serverPrefetch'
];
/* */
var config = ({
/**
* Option merge strategies (used in core/util/options)
*/
// $flow-disable-line
optionMergeStrategies: Object.create(null),
/**
* Whether to suppress warnings.
*/
silent: false,
/**
* Show production mode tip message on boot?
*/
productionTip: "development" !== 'production',
/**
* Whether to enable devtools
*/
devtools: "development" !== 'production',
/**
* Whether to record perf
*/
performance: false,
/**
* Error handler for watcher errors
*/
errorHandler: null,
/**
* Warn handler for watcher warns
*/
warnHandler: null,
/**
* Ignore certain custom elements
*/
ignoredElements: [],
/**
* Custom user key aliases for v-on
*/
// $flow-disable-line
keyCodes: Object.create(null),
/**
* Check if a tag is reserved so that it cannot be registered as a
* component. This is platform-dependent and may be overwritten.
*/
isReservedTag: no,
/**
* Check if an attribute is reserved so that it cannot be used as a component
* prop. This is platform-dependent and may be overwritten.
*/
isReservedAttr: no,
/**
* Check if a tag is an unknown element.
* Platform-dependent.
*/
isUnknownElement: no,
/**
* Get the namespace of an element
*/
getTagNamespace: noop,
/**
* Parse the real tag name for the specific platform.
*/
parsePlatformTagName: identity,
/**
* Check if an attribute must be bound using property, e.g. value
* Platform-dependent.
*/
mustUseProp: no,
/**
* Perform updates asynchronously. Intended to be used by Vue Test Utils
* This will significantly reduce performance if set to false.
*/
async: true,
/**
* Exposed for legacy reasons
*/
_lifecycleHooks: LIFECYCLE_HOOKS
});
/* */
/**
* unicode letters used for parsing html tags, component names and property paths.
* using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
* skipping \u10000-\uEFFFF due to it freezing up PhantomJS
*/
var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
/**
* Check if a string starts with $ or _
*/
function isReserved (str) {
var c = (str + '').charCodeAt(0);
return c === 0x24 || c === 0x5F
}
/**
* Define a property.
*/
function def (obj, key, val, enumerable) {
Object.defineProperty(obj, key, {
value: val,
enumerable: !!enumerable,
writable: true,
configurable: true
});
}
/**
* Parse simple path.
*/
var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
function parsePath (path) {
if (bailRE.test(path)) {
return
}
var segments = path.split('.');
return function (obj) {
for (var i = 0; i < segments.length; i++) {
if (!obj) { return }
obj = obj[segments[i]];
}
return obj
}
}
/* */
// can we use __proto__?
var hasProto = '__proto__' in {};
// Browser environment sniffing
var inBrowser = typeof window !== 'undefined';
var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
var UA = inBrowser && window.navigator.userAgent.toLowerCase();
var isIE = UA && /msie|trident/.test(UA);
var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
var isEdge = UA && UA.indexOf('edge/') > 0;
var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
var isPhantomJS = UA && /phantomjs/.test(UA);
var isFF = UA && UA.match(/firefox\/(\d+)/);
// Firefox has a "watch" function on Object.prototype...
var nativeWatch = ({}).watch;
if (inBrowser) {
try {
var opts = {};
Object.defineProperty(opts, 'passive', ({
get: function get () {
}
})); // https://github.com/facebook/flow/issues/285
window.addEventListener('test-passive', null, opts);
} catch (e) {}
}
// this needs to be lazy-evaled because vue may be required before
// vue-server-renderer can set VUE_ENV
var _isServer;
var isServerRendering = function () {
if (_isServer === undefined) {
/* istanbul ignore if */
if (!inBrowser && !inWeex && typeof global !== 'undefined') {
// detect presence of vue-server-renderer and avoid
// Webpack shimming the process
_isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
} else {
_isServer = false;
}
}
return _isServer
};
// detect devtools
var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
/* istanbul ignore next */
function isNative (Ctor) {
return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
}
var hasSymbol =
typeof Symbol !== 'undefined' && isNative(Symbol) &&
typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
var _Set;
/* istanbul ignore if */ // $flow-disable-line
if (typeof Set !== 'undefined' && isNative(Set)) {
// use native Set when available.
_Set = Set;
} else {
// a non-standard Set polyfill that only works with primitive keys.
_Set = /*@__PURE__*/(function () {
function Set () {
this.set = Object.create(null);
}
Set.prototype.has = function has (key) {
return this.set[key] === true
};
Set.prototype.add = function add (key) {
this.set[key] = true;
};
Set.prototype.clear = function clear () {
this.set = Object.create(null);
};
return Set;
}());
}
/* */
var warn = noop;
var tip = noop;
var generateComponentTrace = (noop); // work around flow check
var formatComponentName = (noop);
if (true) {
var hasConsole = typeof console !== 'undefined';
var classifyRE = /(?:^|[-_])(\w)/g;
var classify = function (str) { return str
.replace(classifyRE, function (c) { return c.toUpperCase(); })
.replace(/[-_]/g, ''); };
warn = function (msg, vm) {
var trace = vm ? generateComponentTrace(vm) : '';
if (config.warnHandler) {
config.warnHandler.call(null, msg, vm, trace);
} else if (hasConsole && (!config.silent)) {
console.error(("[Vue warn]: " + msg + trace));
}
};
tip = function (msg, vm) {
if (hasConsole && (!config.silent)) {
console.warn("[Vue tip]: " + msg + (
vm ? generateComponentTrace(vm) : ''
));
}
};
formatComponentName = function (vm, includeFile) {
if (vm.$root === vm) {
if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
return ('') + vm.$options.__file
}
return ''
}
var options = typeof vm === 'function' && vm.cid != null
? vm.options
: vm._isVue
? vm.$options || vm.constructor.options
: vm;
var name = options.name || options._componentTag;
var file = options.__file;
if (!name && file) {
var match = file.match(/([^/\\]+)\.vue$/);
name = match && match[1];
}
return (
(name ? ("<" + (classify(name)) + ">") : "") +
(file && includeFile !== false ? (" at " + file) : '')
)
};
var repeat = function (str, n) {
var res = '';
while (n) {
if (n % 2 === 1) { res += str; }
if (n > 1) { str += str; }
n >>= 1;
}
return res
};
generateComponentTrace = function (vm) {
if (vm._isVue && vm.$parent) {
var tree = [];
var currentRecursiveSequence = 0;
while (vm && vm.$options.name !== 'PageBody') {
if (tree.length > 0) {
var last = tree[tree.length - 1];
if (last.constructor === vm.constructor) {
currentRecursiveSequence++;
vm = vm.$parent;
continue
} else if (currentRecursiveSequence > 0) {
tree[tree.length - 1] = [last, currentRecursiveSequence];
currentRecursiveSequence = 0;
}
}
!vm.$options.isReserved && tree.push(vm);
vm = vm.$parent;
}
return '\n\nfound in\n\n' + tree
.map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
: formatComponentName(vm))); })
.join('\n')
} else {
return ("\n\n(found in " + (formatComponentName(vm)) + ")")
}
};
}
/* */
var uid = 0;
/**
* A dep is an observable that can have multiple
* directives subscribing to it.
*/
var Dep = function Dep () {
this.id = uid++;
this.subs = [];
};
Dep.prototype.addSub = function addSub (sub) {
this.subs.push(sub);
};
Dep.prototype.removeSub = function removeSub (sub) {
remove(this.subs, sub);
};
Dep.prototype.depend = function depend () {
if (Dep.SharedObject.target) {
Dep.SharedObject.target.addDep(this);
}
};
Dep.prototype.notify = function notify () {
// stabilize the subscriber list first
var subs = this.subs.slice();
if ( true && !config.async) {
// subs aren't sorted in scheduler if not running async
// we need to sort them now to make sure they fire in correct
// order
subs.sort(function (a, b) { return a.id - b.id; });
}
for (var i = 0, l = subs.length; i < l; i++) {
subs[i].update();
}
};
// The current target watcher being evaluated.
// This is globally unique because only one watcher
// can be evaluated at a time.
// fixed by xxxxxx (nvue shared vuex)
/* eslint-disable no-undef */
Dep.SharedObject = {};
Dep.SharedObject.target = null;
Dep.SharedObject.targetStack = [];
function pushTarget (target) {
Dep.SharedObject.targetStack.push(target);
Dep.SharedObject.target = target;
Dep.target = target;
}
function popTarget () {
Dep.SharedObject.targetStack.pop();
Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
Dep.target = Dep.SharedObject.target;
}
/* */
var VNode = function VNode (
tag,
data,
children,
text,
elm,
context,
componentOptions,
asyncFactory
) {
this.tag = tag;
this.data = data;
this.children = children;
this.text = text;
this.elm = elm;
this.ns = undefined;
this.context = context;
this.fnContext = undefined;
this.fnOptions = undefined;
this.fnScopeId = undefined;
this.key = data && data.key;
this.componentOptions = componentOptions;
this.componentInstance = undefined;
this.parent = undefined;
this.raw = false;
this.isStatic = false;
this.isRootInsert = true;
this.isComment = false;
this.isCloned = false;
this.isOnce = false;
this.asyncFactory = asyncFactory;
this.asyncMeta = undefined;
this.isAsyncPlaceholder = false;
};
var prototypeAccessors = { child: { configurable: true } };
// DEPRECATED: alias for componentInstance for backwards compat.
/* istanbul ignore next */
prototypeAccessors.child.get = function () {
return this.componentInstance
};
Object.defineProperties( VNode.prototype, prototypeAccessors );
var createEmptyVNode = function (text) {
if ( text === void 0 ) text = '';
var node = new VNode();
node.text = text;
node.isComment = true;
return node
};
function createTextVNode (val) {
return new VNode(undefined, undefined, undefined, String(val))
}
// optimized shallow clone
// used for static nodes and slot nodes because they may be reused across
// multiple renders, cloning them avoids errors when DOM manipulations rely
// on their elm reference.
function cloneVNode (vnode) {
var cloned = new VNode(
vnode.tag,
vnode.data,
// #7975
// clone children array to avoid mutating original in case of cloning
// a child.
vnode.children && vnode.children.slice(),
vnode.text,
vnode.elm,
vnode.context,
vnode.componentOptions,
vnode.asyncFactory
);
cloned.ns = vnode.ns;
cloned.isStatic = vnode.isStatic;
cloned.key = vnode.key;
cloned.isComment = vnode.isComment;
cloned.fnContext = vnode.fnContext;
cloned.fnOptions = vnode.fnOptions;
cloned.fnScopeId = vnode.fnScopeId;
cloned.asyncMeta = vnode.asyncMeta;
cloned.isCloned = true;
return cloned
}
/*
* not type checking this file because flow doesn't play well with
* dynamically accessing methods on Array prototype
*/
var arrayProto = Array.prototype;
var arrayMethods = Object.create(arrayProto);
var methodsToPatch = [
'push',
'pop',
'shift',
'unshift',
'splice',
'sort',
'reverse'
];
/**
* Intercept mutating methods and emit events
*/
methodsToPatch.forEach(function (method) {
// cache original method
var original = arrayProto[method];
def(arrayMethods, method, function mutator () {
var args = [], len = arguments.length;
while ( len-- ) args[ len ] = arguments[ len ];
var result = original.apply(this, args);
var ob = this.__ob__;
var inserted;
switch (method) {
case 'push':
case 'unshift':
inserted = args;
break
case 'splice':
inserted = args.slice(2);
break
}
if (inserted) { ob.observeArray(inserted); }
// notify change
ob.dep.notify();
return result
});
});
/* */
var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
/**
* In some cases we may want to disable observation inside a component's
* update computation.
*/
var shouldObserve = true;
function toggleObserving (value) {
shouldObserve = value;
}
/**
* Observer class that is attached to each observed
* object. Once attached, the observer converts the target
* object's property keys into getter/setters that
* collect dependencies and dispatch updates.
*/
var Observer = function Observer (value) {
this.value = value;
this.dep = new Dep();
this.vmCount = 0;
def(value, '__ob__', this);
if (Array.isArray(value)) {
if (hasProto) {
{// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
if(value.push !== value.__proto__.push){
copyAugment(value, arrayMethods, arrayKeys);
} else {
protoAugment(value, arrayMethods);
}
}
} else {
copyAugment(value, arrayMethods, arrayKeys);
}
this.observeArray(value);
} else {
this.walk(value);
}
};
/**
* Walk through all properties and convert them into
* getter/setters. This method should only be called when
* value type is Object.
*/
Observer.prototype.walk = function walk (obj) {
var keys = Object.keys(obj);
for (var i = 0; i < keys.length; i++) {
defineReactive$$1(obj, keys[i]);
}
};
/**
* Observe a list of Array items.
*/
Observer.prototype.observeArray = function observeArray (items) {
for (var i = 0, l = items.length; i < l; i++) {
observe(items[i]);
}
};
// helpers
/**
* Augment a target Object or Array by intercepting
* the prototype chain using __proto__
*/
function protoAugment (target, src) {
/* eslint-disable no-proto */
target.__proto__ = src;
/* eslint-enable no-proto */
}
/**
* Augment a target Object or Array by defining
* hidden properties.
*/
/* istanbul ignore next */
function copyAugment (target, src, keys) {
for (var i = 0, l = keys.length; i < l; i++) {
var key = keys[i];
def(target, key, src[key]);
}
}
/**
* Attempt to create an observer instance for a value,
* returns the new observer if successfully observed,
* or the existing observer if the value already has one.
*/
function observe (value, asRootData) {
if (!isObject(value) || value instanceof VNode) {
return
}
var ob;
if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
ob = value.__ob__;
} else if (
shouldObserve &&
!isServerRendering() &&
(Array.isArray(value) || isPlainObject(value)) &&
Object.isExtensible(value) &&
!value._isVue &&
!value.__v_isMPComponent
) {
ob = new Observer(value);
}
if (asRootData && ob) {
ob.vmCount++;
}
return ob
}
/**
* Define a reactive property on an Object.
*/
function defineReactive$$1 (
obj,
key,
val,
customSetter,
shallow
) {
var dep = new Dep();
var property = Object.getOwnPropertyDescriptor(obj, key);
if (property && property.configurable === false) {
return
}
// cater for pre-defined getter/setters
var getter = property && property.get;
var setter = property && property.set;
if ((!getter || setter) && arguments.length === 2) {
val = obj[key];
}
var childOb = !shallow && observe(val);
Object.defineProperty(obj, key, {
enumerable: true,
configurable: true,
get: function reactiveGetter () {
var value = getter ? getter.call(obj) : val;
if (Dep.SharedObject.target) { // fixed by xxxxxx
dep.depend();
if (childOb) {
childOb.dep.depend();
if (Array.isArray(value)) {
dependArray(value);
}
}
}
return value
},
set: function reactiveSetter (newVal) {
var value = getter ? getter.call(obj) : val;
/* eslint-disable no-self-compare */
if (newVal === value || (newVal !== newVal && value !== value)) {
return
}
/* eslint-enable no-self-compare */
if ( true && customSetter) {
customSetter();
}
// #7981: for accessor properties without setter
if (getter && !setter) { return }
if (setter) {
setter.call(obj, newVal);
} else {
val = newVal;
}
childOb = !shallow && observe(newVal);
dep.notify();
}
});
}
/**
* Set a property on an object. Adds the new property and
* triggers change notification if the property doesn't
* already exist.
*/
function set (target, key, val) {
if ( true &&
(isUndef(target) || isPrimitive(target))
) {
warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
}
if (Array.isArray(target) && isValidArrayIndex(key)) {
target.length = Math.max(target.length, key);
target.splice(key, 1, val);
return val
}
if (key in target && !(key in Object.prototype)) {
target[key] = val;
return val
}
var ob = (target).__ob__;
if (target._isVue || (ob && ob.vmCount)) {
true && warn(
'Avoid adding reactive properties to a Vue instance or its root $data ' +
'at runtime - declare it upfront in the data option.'
);
return val
}
if (!ob) {
target[key] = val;
return val
}
defineReactive$$1(ob.value, key, val);
ob.dep.notify();
return val
}
/**
* Delete a property and trigger change if necessary.
*/
function del (target, key) {
if ( true &&
(isUndef(target) || isPrimitive(target))
) {
warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
}
if (Array.isArray(target) && isValidArrayIndex(key)) {
target.splice(key, 1);
return
}
var ob = (target).__ob__;
if (target._isVue || (ob && ob.vmCount)) {
true && warn(
'Avoid deleting properties on a Vue instance or its root $data ' +
'- just set it to null.'
);
return
}
if (!hasOwn(target, key)) {
return
}
delete target[key];
if (!ob) {
return
}
ob.dep.notify();
}
/**
* Collect dependencies on array elements when the array is touched, since
* we cannot intercept array element access like property getters.
*/
function dependArray (value) {
for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
e = value[i];
e && e.__ob__ && e.__ob__.dep.depend();
if (Array.isArray(e)) {
dependArray(e);
}
}
}
/* */
/**
* Option overwriting strategies are functions that handle
* how to merge a parent option value and a child option
* value into the final value.
*/
var strats = config.optionMergeStrategies;
/**
* Options with restrictions
*/
if (true) {
strats.el = strats.propsData = function (parent, child, vm, key) {
if (!vm) {
warn(
"option \"" + key + "\" can only be used during instance " +
'creation with the `new` keyword.'
);
}
return defaultStrat(parent, child)
};
}
/**
* Helper that recursively merges two data objects together.
*/
function mergeData (to, from) {
if (!from) { return to }
var key, toVal, fromVal;
var keys = hasSymbol
? Reflect.ownKeys(from)
: Object.keys(from);
for (var i = 0; i < keys.length; i++) {
key = keys[i];
// in case the object is already observed...
if (key === '__ob__') { continue }
toVal = to[key];
fromVal = from[key];
if (!hasOwn(to, key)) {
set(to, key, fromVal);
} else if (
toVal !== fromVal &&
isPlainObject(toVal) &&
isPlainObject(fromVal)
) {
mergeData(toVal, fromVal);
}
}
return to
}
/**
* Data
*/
function mergeDataOrFn (
parentVal,
childVal,
vm
) {
if (!vm) {
// in a Vue.extend merge, both should be functions
if (!childVal) {
return parentVal
}
if (!parentVal) {
return childVal
}
// when parentVal & childVal are both present,
// we need to return a function that returns the
// merged result of both functions... no need to
// check if parentVal is a function here because
// it has to be a function to pass previous merges.
return function mergedDataFn () {
return mergeData(
typeof childVal === 'function' ? childVal.call(this, this) : childVal,
typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
)
}
} else {
return function mergedInstanceDataFn () {
// instance merge
var instanceData = typeof childVal === 'function'
? childVal.call(vm, vm)
: childVal;
var defaultData = typeof parentVal === 'function'
? parentVal.call(vm, vm)
: parentVal;
if (instanceData) {
return mergeData(instanceData, defaultData)
} else {
return defaultData
}
}
}
}
strats.data = function (
parentVal,
childVal,
vm
) {
if (!vm) {
if (childVal && typeof childVal !== 'function') {
true && warn(
'The "data" option should be a function ' +
'that returns a per-instance value in component ' +
'definitions.',
vm
);
return parentVal
}
return mergeDataOrFn(parentVal, childVal)
}
return mergeDataOrFn(parentVal, childVal, vm)
};
/**
* Hooks and props are merged as arrays.
*/
function mergeHook (
parentVal,
childVal
) {
var res = childVal
? parentVal
? parentVal.concat(childVal)
: Array.isArray(childVal)
? childVal
: [childVal]
: parentVal;
return res
? dedupeHooks(res)
: res
}
function dedupeHooks (hooks) {
var res = [];
for (var i = 0; i < hooks.length; i++) {
if (res.indexOf(hooks[i]) === -1) {
res.push(hooks[i]);
}
}
return res
}
LIFECYCLE_HOOKS.forEach(function (hook) {
strats[hook] = mergeHook;
});
/**
* Assets
*
* When a vm is present (instance creation), we need to do
* a three-way merge between constructor options, instance
* options and parent options.
*/
function mergeAssets (
parentVal,
childVal,
vm,
key
) {
var res = Object.create(parentVal || null);
if (childVal) {
true && assertObjectType(key, childVal, vm);
return extend(res, childVal)
} else {
return res
}
}
ASSET_TYPES.forEach(function (type) {
strats[type + 's'] = mergeAssets;
});
/**
* Watchers.
*
* Watchers hashes should not overwrite one
* another, so we merge them as arrays.
*/
strats.watch = function (
parentVal,
childVal,
vm,
key
) {
// work around Firefox's Object.prototype.watch...
if (parentVal === nativeWatch) { parentVal = undefined; }
if (childVal === nativeWatch) { childVal = undefined; }
/* istanbul ignore if */
if (!childVal) { return Object.create(parentVal || null) }
if (true) {
assertObjectType(key, childVal, vm);
}
if (!parentVal) { return childVal }
var ret = {};
extend(ret, parentVal);
for (var key$1 in childVal) {
var parent = ret[key$1];
var child = childVal[key$1];
if (parent && !Array.isArray(parent)) {
parent = [parent];
}
ret[key$1] = parent
? parent.concat(child)
: Array.isArray(child) ? child : [child];
}
return ret
};
/**
* Other object hashes.
*/
strats.props =
strats.methods =
strats.inject =
strats.computed = function (
parentVal,
childVal,
vm,
key
) {
if (childVal && "development" !== 'production') {
assertObjectType(key, childVal, vm);
}
if (!parentVal) { return childVal }
var ret = Object.create(null);
extend(ret, parentVal);
if (childVal) { extend(ret, childVal); }
return ret
};
strats.provide = mergeDataOrFn;
/**
* Default strategy.
*/
var defaultStrat = function (parentVal, childVal) {
return childVal === undefined
? parentVal
: childVal
};
/**
* Validate component names
*/
function checkComponents (options) {
for (var key in options.components) {
validateComponentName(key);
}
}
function validateComponentName (name) {
if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
warn(
'Invalid component name: "' + name + '". Component names ' +
'should conform to valid custom element name in html5 specification.'
);
}
if (isBuiltInTag(name) || config.isReservedTag(name)) {
warn(
'Do not use built-in or reserved HTML elements as component ' +
'id: ' + name
);
}
}
/**
* Ensure all props option syntax are normalized into the
* Object-based format.
*/
function normalizeProps (options, vm) {
var props = options.props;
if (!props) { return }
var res = {};
var i, val, name;
if (Array.isArray(props)) {
i = props.length;
while (i--) {
val = props[i];
if (typeof val === 'string') {
name = camelize(val);
res[name] = { type: null };
} else if (true) {
warn('props must be strings when using array syntax.');
}
}
} else if (isPlainObject(props)) {
for (var key in props) {
val = props[key];
name = camelize(key);
res[name] = isPlainObject(val)
? val
: { type: val };
}
} else if (true) {
warn(
"Invalid value for option \"props\": expected an Array or an Object, " +
"but got " + (toRawType(props)) + ".",
vm
);
}
options.props = res;
}
/**
* Normalize all injections into Object-based format
*/
function normalizeInject (options, vm) {
var inject = options.inject;
if (!inject) { return }
var normalized = options.inject = {};
if (Array.isArray(inject)) {
for (var i = 0; i < inject.length; i++) {
normalized[inject[i]] = { from: inject[i] };
}
} else if (isPlainObject(inject)) {
for (var key in inject) {
var val = inject[key];
normalized[key] = isPlainObject(val)
? extend({ from: key }, val)
: { from: val };
}
} else if (true) {
warn(
"Invalid value for option \"inject\": expected an Array or an Object, " +
"but got " + (toRawType(inject)) + ".",
vm
);
}
}
/**
* Normalize raw function directives into object format.
*/
function normalizeDirectives (options) {
var dirs = options.directives;
if (dirs) {
for (var key in dirs) {
var def$$1 = dirs[key];
if (typeof def$$1 === 'function') {
dirs[key] = { bind: def$$1, update: def$$1 };
}
}
}
}
function assertObjectType (name, value, vm) {
if (!isPlainObject(value)) {
warn(
"Invalid value for option \"" + name + "\": expected an Object, " +
"but got " + (toRawType(value)) + ".",
vm
);
}
}
/**
* Merge two option objects into a new one.
* Core utility used in both instantiation and inheritance.
*/
function mergeOptions (
parent,
child,
vm
) {
if (true) {
checkComponents(child);
}
if (typeof child === 'function') {
child = child.options;
}
normalizeProps(child, vm);
normalizeInject(child, vm);
normalizeDirectives(child);
// Apply extends and mixins on the child options,
// but only if it is a raw options object that isn't
// the result of another mergeOptions call.
// Only merged options has the _base property.
if (!child._base) {
if (child.extends) {
parent = mergeOptions(parent, child.extends, vm);
}
if (child.mixins) {
for (var i = 0, l = child.mixins.length; i < l; i++) {
parent = mergeOptions(parent, child.mixins[i], vm);
}
}
}
var options = {};
var key;
for (key in parent) {
mergeField(key);
}
for (key in child) {
if (!hasOwn(parent, key)) {
mergeField(key);
}
}
function mergeField (key) {
var strat = strats[key] || defaultStrat;
options[key] = strat(parent[key], child[key], vm, key);
}
return options
}
/**
* Resolve an asset.
* This function is used because child instances need access
* to assets defined in its ancestor chain.
*/
function resolveAsset (
options,
type,
id,
warnMissing
) {
/* istanbul ignore if */
if (typeof id !== 'string') {
return
}
var assets = options[type];
// check local registration variations first
if (hasOwn(assets, id)) { return assets[id] }
var camelizedId = camelize(id);
if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
var PascalCaseId = capitalize(camelizedId);
if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
// fallback to prototype chain
var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
if ( true && warnMissing && !res) {
warn(
'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
options
);
}
return res
}
/* */
function validateProp (
key,
propOptions,
propsData,
vm
) {
var prop = propOptions[key];
var absent = !hasOwn(propsData, key);
var value = propsData[key];
// boolean casting
var booleanIndex = getTypeIndex(Boolean, prop.type);
if (booleanIndex > -1) {
if (absent && !hasOwn(prop, 'default')) {
value = false;
} else if (value === '' || value === hyphenate(key)) {
// only cast empty string / same name to boolean if
// boolean has higher priority
var stringIndex = getTypeIndex(String, prop.type);
if (stringIndex < 0 || booleanIndex < stringIndex) {
value = true;
}
}
}
// check default value
if (value === undefined) {
value = getPropDefaultValue(vm, prop, key);
// since the default value is a fresh copy,
// make sure to observe it.
var prevShouldObserve = shouldObserve;
toggleObserving(true);
observe(value);
toggleObserving(prevShouldObserve);
}
if (
true
) {
assertProp(prop, key, value, vm, absent);
}
return value
}
/**
* Get the default value of a prop.
*/
function getPropDefaultValue (vm, prop, key) {
// no default, return undefined
if (!hasOwn(prop, 'default')) {
return undefined
}
var def = prop.default;
// warn against non-factory defaults for Object & Array
if ( true && isObject(def)) {
warn(
'Invalid default value for prop "' + key + '": ' +
'Props with type Object/Array must use a factory function ' +
'to return the default value.',
vm
);
}
// the raw prop value was also undefined from previous render,
// return previous default value to avoid unnecessary watcher trigger
if (vm && vm.$options.propsData &&
vm.$options.propsData[key] === undefined &&
vm._props[key] !== undefined
) {
return vm._props[key]
}
// call factory function for non-Function types
// a value is Function if its prototype is function even across different execution context
return typeof def === 'function' && getType(prop.type) !== 'Function'
? def.call(vm)
: def
}
/**
* Assert whether a prop is valid.
*/
function assertProp (
prop,
name,
value,
vm,
absent
) {
if (prop.required && absent) {
warn(
'Missing required prop: "' + name + '"',
vm
);
return
}
if (value == null && !prop.required) {
return
}
var type = prop.type;
var valid = !type || type === true;
var expectedTypes = [];
if (type) {
if (!Array.isArray(type)) {
type = [type];
}
for (var i = 0; i < type.length && !valid; i++) {
var assertedType = assertType(value, type[i]);
expectedTypes.push(assertedType.expectedType || '');
valid = assertedType.valid;
}
}
if (!valid) {
warn(
getInvalidTypeMessage(name, value, expectedTypes),
vm
);
return
}
var validator = prop.validator;
if (validator) {
if (!validator(value)) {
warn(
'Invalid prop: custom validator check failed for prop "' + name + '".',
vm
);
}
}
}
var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
function assertType (value, type) {
var valid;
var expectedType = getType(type);
if (simpleCheckRE.test(expectedType)) {
var t = typeof value;
valid = t === expectedType.toLowerCase();
// for primitive wrapper objects
if (!valid && t === 'object') {
valid = value instanceof type;
}
} else if (expectedType === 'Object') {
valid = isPlainObject(value);
} else if (expectedType === 'Array') {
valid = Array.isArray(value);
} else {
valid = value instanceof type;
}
return {
valid: valid,
expectedType: expectedType
}
}
/**
* Use function string name to check built-in types,
* because a simple equality check will fail when running
* across different vms / iframes.
*/
function getType (fn) {
var match = fn && fn.toString().match(/^\s*function (\w+)/);
return match ? match[1] : ''
}
function isSameType (a, b) {
return getType(a) === getType(b)
}
function getTypeIndex (type, expectedTypes) {
if (!Array.isArray(expectedTypes)) {
return isSameType(expectedTypes, type) ? 0 : -1
}
for (var i = 0, len = expectedTypes.length; i < len; i++) {
if (isSameType(expectedTypes[i], type)) {
return i
}
}
return -1
}
function getInvalidTypeMessage (name, value, expectedTypes) {
var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
" Expected " + (expectedTypes.map(capitalize).join(', '));
var expectedType = expectedTypes[0];
var receivedType = toRawType(value);
var expectedValue = styleValue(value, expectedType);
var receivedValue = styleValue(value, receivedType);
// check if we need to specify expected value
if (expectedTypes.length === 1 &&
isExplicable(expectedType) &&
!isBoolean(expectedType, receivedType)) {
message += " with value " + expectedValue;
}
message += ", got " + receivedType + " ";
// check if we need to specify received value
if (isExplicable(receivedType)) {
message += "with value " + receivedValue + ".";
}
return message
}
function styleValue (value, type) {
if (type === 'String') {
return ("\"" + value + "\"")
} else if (type === 'Number') {
return ("" + (Number(value)))
} else {
return ("" + value)
}
}
function isExplicable (value) {
var explicitTypes = ['string', 'number', 'boolean'];
return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
}
function isBoolean () {
var args = [], len = arguments.length;
while ( len-- ) args[ len ] = arguments[ len ];
return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
}
/* */
function handleError (err, vm, info) {
// Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
// See: https://github.com/vuejs/vuex/issues/1505
pushTarget();
try {
if (vm) {
var cur = vm;
while ((cur = cur.$parent)) {
var hooks = cur.$options.errorCaptured;
if (hooks) {
for (var i = 0; i < hooks.length; i++) {
try {
var capture = hooks[i].call(cur, err, vm, info) === false;
if (capture) { return }
} catch (e) {
globalHandleError(e, cur, 'errorCaptured hook');
}
}
}
}
}
globalHandleError(err, vm, info);
} finally {
popTarget();
}
}
function invokeWithErrorHandling (
handler,
context,
args,
vm,
info
) {
var res;
try {
res = args ? handler.apply(context, args) : handler.call(context);
if (res && !res._isVue && isPromise(res) && !res._handled) {
res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
// issue #9511
// avoid catch triggering multiple times when nested calls
res._handled = true;
}
} catch (e) {
handleError(e, vm, info);
}
return res
}
function globalHandleError (err, vm, info) {
if (config.errorHandler) {
try {
return config.errorHandler.call(null, err, vm, info)
} catch (e) {
// if the user intentionally throws the original error in the handler,
// do not log it twice
if (e !== err) {
logError(e, null, 'config.errorHandler');
}
}
}
logError(err, vm, info);
}
function logError (err, vm, info) {
if (true) {
warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
}
/* istanbul ignore else */
if ((inBrowser || inWeex) && typeof console !== 'undefined') {
console.error(err);
} else {
throw err
}
}
/* */
var callbacks = [];
var pending = false;
function flushCallbacks () {
pending = false;
var copies = callbacks.slice(0);
callbacks.length = 0;
for (var i = 0; i < copies.length; i++) {
copies[i]();
}
}
// Here we have async deferring wrappers using microtasks.
// In 2.5 we used (macro) tasks (in combination with microtasks).
// However, it has subtle problems when state is changed right before repaint
// (e.g. #6813, out-in transitions).
// Also, using (macro) tasks in event handler would cause some weird behaviors
// that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
// So we now use microtasks everywhere, again.
// A major drawback of this tradeoff is that there are some scenarios
// where microtasks have too high a priority and fire in between supposedly
// sequential events (e.g. #4521, #6690, which have workarounds)
// or even between bubbling of the same event (#6566).
var timerFunc;
// The nextTick behavior leverages the microtask queue, which can be accessed
// via either native Promise.then or MutationObserver.
// MutationObserver has wider support, however it is seriously bugged in
// UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
// completely stops working after triggering a few times... so, if native
// Promise is available, we will use it:
/* istanbul ignore next, $flow-disable-line */
if (typeof Promise !== 'undefined' && isNative(Promise)) {
var p = Promise.resolve();
timerFunc = function () {
p.then(flushCallbacks);
// In problematic UIWebViews, Promise.then doesn't completely break, but
// it can get stuck in a weird state where callbacks are pushed into the
// microtask queue but the queue isn't being flushed, until the browser
// needs to do some other work, e.g. handle a timer. Therefore we can
// "force" the microtask queue to be flushed by adding an empty timer.
if (isIOS) { setTimeout(noop); }
};
} else if (!isIE && typeof MutationObserver !== 'undefined' && (
isNative(MutationObserver) ||
// PhantomJS and iOS 7.x
MutationObserver.toString() === '[object MutationObserverConstructor]'
)) {
// Use MutationObserver where native Promise is not available,
// e.g. PhantomJS, iOS7, Android 4.4
// (#6466 MutationObserver is unreliable in IE11)
var counter = 1;
var observer = new MutationObserver(flushCallbacks);
var textNode = document.createTextNode(String(counter));
observer.observe(textNode, {
characterData: true
});
timerFunc = function () {
counter = (counter + 1) % 2;
textNode.data = String(counter);
};
} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
// Fallback to setImmediate.
// Technically it leverages the (macro) task queue,
// but it is still a better choice than setTimeout.
timerFunc = function () {
setImmediate(flushCallbacks);
};
} else {
// Fallback to setTimeout.
timerFunc = function () {
setTimeout(flushCallbacks, 0);
};
}
function nextTick (cb, ctx) {
var _resolve;
callbacks.push(function () {
if (cb) {
try {
cb.call(ctx);
} catch (e) {
handleError(e, ctx, 'nextTick');
}
} else if (_resolve) {
_resolve(ctx);
}
});
if (!pending) {
pending = true;
timerFunc();
}
// $flow-disable-line
if (!cb && typeof Promise !== 'undefined') {
return new Promise(function (resolve) {
_resolve = resolve;
})
}
}
/* */
/* not type checking this file because flow doesn't play well with Proxy */
var initProxy;
if (true) {
var allowedGlobals = makeMap(
'Infinity,undefined,NaN,isFinite,isNaN,' +
'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
'require' // for Webpack/Browserify
);
var warnNonPresent = function (target, key) {
warn(
"Property or method \"" + key + "\" is not defined on the instance but " +
'referenced during render. Make sure that this property is reactive, ' +
'either in the data option, or for class-based components, by ' +
'initializing the property. ' +
'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
target
);
};
var warnReservedPrefix = function (target, key) {
warn(
"Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
'prevent conflicts with Vue internals. ' +
'See: https://vuejs.org/v2/api/#data',
target
);
};
var hasProxy =
typeof Proxy !== 'undefined' && isNative(Proxy);
if (hasProxy) {
var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
config.keyCodes = new Proxy(config.keyCodes, {
set: function set (target, key, value) {
if (isBuiltInModifier(key)) {
warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
return false
} else {
target[key] = value;
return true
}
}
});
}
var hasHandler = {
has: function has (target, key) {
var has = key in target;
var isAllowed = allowedGlobals(key) ||
(typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
if (!has && !isAllowed) {
if (key in target.$data) { warnReservedPrefix(target, key); }
else { warnNonPresent(target, key); }
}
return has || !isAllowed
}
};
var getHandler = {
get: function get (target, key) {
if (typeof key === 'string' && !(key in target)) {
if (key in target.$data) { warnReservedPrefix(target, key); }
else { warnNonPresent(target, key); }
}
return target[key]
}
};
initProxy = function initProxy (vm) {
if (hasProxy) {
// determine which proxy handler to use
var options = vm.$options;
var handlers = options.render && options.render._withStripped
? getHandler
: hasHandler;
vm._renderProxy = new Proxy(vm, handlers);
} else {
vm._renderProxy = vm;
}
};
}
/* */
var seenObjects = new _Set();
/**
* Recursively traverse an object to evoke all converted
* getters, so that every nested property inside the object
* is collected as a "deep" dependency.
*/
function traverse (val) {
_traverse(val, seenObjects);
seenObjects.clear();
}
function _traverse (val, seen) {
var i, keys;
var isA = Array.isArray(val);
if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
return
}
if (val.__ob__) {
var depId = val.__ob__.dep.id;
if (seen.has(depId)) {
return
}
seen.add(depId);
}
if (isA) {
i = val.length;
while (i--) { _traverse(val[i], seen); }
} else {
keys = Object.keys(val);
i = keys.length;
while (i--) { _traverse(val[keys[i]], seen); }
}
}
var mark;
var measure;
if (true) {
var perf = inBrowser && window.performance;
/* istanbul ignore if */
if (
perf &&
perf.mark &&
perf.measure &&
perf.clearMarks &&
perf.clearMeasures
) {
mark = function (tag) { return perf.mark(tag); };
measure = function (name, startTag, endTag) {
perf.measure(name, startTag, endTag);
perf.clearMarks(startTag);
perf.clearMarks(endTag);
// perf.clearMeasures(name)
};
}
}
/* */
var normalizeEvent = cached(function (name) {
var passive = name.charAt(0) === '&';
name = passive ? name.slice(1) : name;
var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
name = once$$1 ? name.slice(1) : name;
var capture = name.charAt(0) === '!';
name = capture ? name.slice(1) : name;
return {
name: name,
once: once$$1,
capture: capture,
passive: passive
}
});
function createFnInvoker (fns, vm) {
function invoker () {
var arguments$1 = arguments;
var fns = invoker.fns;
if (Array.isArray(fns)) {
var cloned = fns.slice();
for (var i = 0; i < cloned.length; i++) {
invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
}
} else {
// return handler return value for single handlers
return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
}
}
invoker.fns = fns;
return invoker
}
function updateListeners (
on,
oldOn,
add,
remove$$1,
createOnceHandler,
vm
) {
var name, def$$1, cur, old, event;
for (name in on) {
def$$1 = cur = on[name];
old = oldOn[name];
event = normalizeEvent(name);
if (isUndef(cur)) {
true && warn(
"Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
vm
);
} else if (isUndef(old)) {
if (isUndef(cur.fns)) {
cur = on[name] = createFnInvoker(cur, vm);
}
if (isTrue(event.once)) {
cur = on[name] = createOnceHandler(event.name, cur, event.capture);
}
add(event.name, cur, event.capture, event.passive, event.params);
} else if (cur !== old) {
old.fns = cur;
on[name] = old;
}
}
for (name in oldOn) {
if (isUndef(on[name])) {
event = normalizeEvent(name);
remove$$1(event.name, oldOn[name], event.capture);
}
}
}
/* */
/* */
// fixed by xxxxxx (mp properties)
function extractPropertiesFromVNodeData(data, Ctor, res, context) {
var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
if (isUndef(propOptions)) {
return res
}
var externalClasses = Ctor.options.mpOptions.externalClasses || [];
var attrs = data.attrs;
var props = data.props;
if (isDef(attrs) || isDef(props)) {
for (var key in propOptions) {
var altKey = hyphenate(key);
var result = checkProp(res, props, key, altKey, true) ||
checkProp(res, attrs, key, altKey, false);
// externalClass
if (
result &&
res[key] &&
externalClasses.indexOf(altKey) !== -1 &&
context[camelize(res[key])]
) {
// 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
res[key] = context[camelize(res[key])];
}
}
}
return res
}
function extractPropsFromVNodeData (
data,
Ctor,
tag,
context// fixed by xxxxxx
) {
// we are only extracting raw values here.
// validation and default values are handled in the child
// component itself.
var propOptions = Ctor.options.props;
if (isUndef(propOptions)) {
// fixed by xxxxxx
return extractPropertiesFromVNodeData(data, Ctor, {}, context)
}
var res = {};
var attrs = data.attrs;
var props = data.props;
if (isDef(attrs) || isDef(props)) {
for (var key in propOptions) {
var altKey = hyphenate(key);
if (true) {
var keyInLowerCase = key.toLowerCase();
if (
key !== keyInLowerCase &&
attrs && hasOwn(attrs, keyInLowerCase)
) {
tip(
"Prop \"" + keyInLowerCase + "\" is passed to component " +
(formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
" \"" + key + "\". " +
"Note that HTML attributes are case-insensitive and camelCased " +
"props need to use their kebab-case equivalents when using in-DOM " +
"templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
);
}
}
checkProp(res, props, key, altKey, true) ||
checkProp(res, attrs, key, altKey, false);
}
}
// fixed by xxxxxx
return extractPropertiesFromVNodeData(data, Ctor, res, context)
}
function checkProp (
res,
hash,
key,
altKey,
preserve
) {
if (isDef(hash)) {
if (hasOwn(hash, key)) {
res[key] = hash[key];
if (!preserve) {
delete hash[key];
}
return true
} else if (hasOwn(hash, altKey)) {
res[key] = hash[altKey];
if (!preserve) {
delete hash[altKey];
}
return true
}
}
return false
}
/* */
// The template compiler attempts to minimize the need for normalization by
// statically analyzing the template at compile time.
//
// For plain HTML markup, normalization can be completely skipped because the
// generated render function is guaranteed to return Array. There are
// two cases where extra normalization is needed:
// 1. When the children contains components - because a functional component
// may return an Array instead of a single root. In this case, just a simple
// normalization is needed - if any child is an Array, we flatten the whole
// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
// because functional components already normalize their own children.
function simpleNormalizeChildren (children) {
for (var i = 0; i < children.length; i++) {
if (Array.isArray(children[i])) {
return Array.prototype.concat.apply([], children)
}
}
return children
}
// 2. When the children contains constructs that always generated nested Arrays,
// e.g. , , v-for, or when the children is provided by user
// with hand-written render functions / JSX. In such cases a full normalization
// is needed to cater to all possible types of children values.
function normalizeChildren (children) {
return isPrimitive(children)
? [createTextVNode(children)]
: Array.isArray(children)
? normalizeArrayChildren(children)
: undefined
}
function isTextNode (node) {
return isDef(node) && isDef(node.text) && isFalse(node.isComment)
}
function normalizeArrayChildren (children, nestedIndex) {
var res = [];
var i, c, lastIndex, last;
for (i = 0; i < children.length; i++) {
c = children[i];
if (isUndef(c) || typeof c === 'boolean') { continue }
lastIndex = res.length - 1;
last = res[lastIndex];
// nested
if (Array.isArray(c)) {
if (c.length > 0) {
c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
// merge adjacent text nodes
if (isTextNode(c[0]) && isTextNode(last)) {
res[lastIndex] = createTextVNode(last.text + (c[0]).text);
c.shift();
}
res.push.apply(res, c);
}
} else if (isPrimitive(c)) {
if (isTextNode(last)) {
// merge adjacent text nodes
// this is necessary for SSR hydration because text nodes are
// essentially merged when rendered to HTML strings
res[lastIndex] = createTextVNode(last.text + c);
} else if (c !== '') {
// convert primitive to vnode
res.push(createTextVNode(c));
}
} else {
if (isTextNode(c) && isTextNode(last)) {
// merge adjacent text nodes
res[lastIndex] = createTextVNode(last.text + c.text);
} else {
// default key for nested array children (likely generated by v-for)
if (isTrue(children._isVList) &&
isDef(c.tag) &&
isUndef(c.key) &&
isDef(nestedIndex)) {
c.key = "__vlist" + nestedIndex + "_" + i + "__";
}
res.push(c);
}
}
}
return res
}
/* */
function initProvide (vm) {
var provide = vm.$options.provide;
if (provide) {
vm._provided = typeof provide === 'function'
? provide.call(vm)
: provide;
}
}
function initInjections (vm) {
var result = resolveInject(vm.$options.inject, vm);
if (result) {
toggleObserving(false);
Object.keys(result).forEach(function (key) {
/* istanbul ignore else */
if (true) {
defineReactive$$1(vm, key, result[key], function () {
warn(
"Avoid mutating an injected value directly since the changes will be " +
"overwritten whenever the provided component re-renders. " +
"injection being mutated: \"" + key + "\"",
vm
);
});
} else {}
});
toggleObserving(true);
}
}
function resolveInject (inject, vm) {
if (inject) {
// inject is :any because flow is not smart enough to figure out cached
var result = Object.create(null);
var keys = hasSymbol
? Reflect.ownKeys(inject)
: Object.keys(inject);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
// #6574 in case the inject object is observed...
if (key === '__ob__') { continue }
var provideKey = inject[key].from;
var source = vm;
while (source) {
if (source._provided && hasOwn(source._provided, provideKey)) {
result[key] = source._provided[provideKey];
break
}
source = source.$parent;
}
if (!source) {
if ('default' in inject[key]) {
var provideDefault = inject[key].default;
result[key] = typeof provideDefault === 'function'
? provideDefault.call(vm)
: provideDefault;
} else if (true) {
warn(("Injection \"" + key + "\" not found"), vm);
}
}
}
return result
}
}
/* */
/**
* Runtime helper for resolving raw children VNodes into a slot object.
*/
function resolveSlots (
children,
context
) {
if (!children || !children.length) {
return {}
}
var slots = {};
for (var i = 0, l = children.length; i < l; i++) {
var child = children[i];
var data = child.data;
// remove slot attribute if the node is resolved as a Vue slot node
if (data && data.attrs && data.attrs.slot) {
delete data.attrs.slot;
}
// named slots should only be respected if the vnode was rendered in the
// same context.
if ((child.context === context || child.fnContext === context) &&
data && data.slot != null
) {
var name = data.slot;
var slot = (slots[name] || (slots[name] = []));
if (child.tag === 'template') {
slot.push.apply(slot, child.children || []);
} else {
slot.push(child);
}
} else {
// fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
(slots['page'] || (slots['page'] = [])).push(child);
}else{
(slots.default || (slots.default = [])).push(child);
}
}
}
// ignore slots that contains only whitespace
for (var name$1 in slots) {
if (slots[name$1].every(isWhitespace)) {
delete slots[name$1];
}
}
return slots
}
function isWhitespace (node) {
return (node.isComment && !node.asyncFactory) || node.text === ' '
}
/* */
function normalizeScopedSlots (
slots,
normalSlots,
prevSlots
) {
var res;
var hasNormalSlots = Object.keys(normalSlots).length > 0;
var isStable = slots ? !!slots.$stable : !hasNormalSlots;
var key = slots && slots.$key;
if (!slots) {
res = {};
} else if (slots._normalized) {
// fast path 1: child component re-render only, parent did not change
return slots._normalized
} else if (
isStable &&
prevSlots &&
prevSlots !== emptyObject &&
key === prevSlots.$key &&
!hasNormalSlots &&
!prevSlots.$hasNormal
) {
// fast path 2: stable scoped slots w/ no normal slots to proxy,
// only need to normalize once
return prevSlots
} else {
res = {};
for (var key$1 in slots) {
if (slots[key$1] && key$1[0] !== '$') {
res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
}
}
}
// expose normal slots on scopedSlots
for (var key$2 in normalSlots) {
if (!(key$2 in res)) {
res[key$2] = proxyNormalSlot(normalSlots, key$2);
}
}
// avoriaz seems to mock a non-extensible $scopedSlots object
// and when that is passed down this would cause an error
if (slots && Object.isExtensible(slots)) {
(slots)._normalized = res;
}
def(res, '$stable', isStable);
def(res, '$key', key);
def(res, '$hasNormal', hasNormalSlots);
return res
}
function normalizeScopedSlot(normalSlots, key, fn) {
var normalized = function () {
var res = arguments.length ? fn.apply(null, arguments) : fn({});
res = res && typeof res === 'object' && !Array.isArray(res)
? [res] // single vnode
: normalizeChildren(res);
return res && (
res.length === 0 ||
(res.length === 1 && res[0].isComment) // #9658
) ? undefined
: res
};
// this is a slot using the new v-slot syntax without scope. although it is
// compiled as a scoped slot, render fn users would expect it to be present
// on this.$slots because the usage is semantically a normal slot.
if (fn.proxy) {
Object.defineProperty(normalSlots, key, {
get: normalized,
enumerable: true,
configurable: true
});
}
return normalized
}
function proxyNormalSlot(slots, key) {
return function () { return slots[key]; }
}
/* */
/**
* Runtime helper for rendering v-for lists.
*/
function renderList (
val,
render
) {
var ret, i, l, keys, key;
if (Array.isArray(val) || typeof val === 'string') {
ret = new Array(val.length);
for (i = 0, l = val.length; i < l; i++) {
ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
}
} else if (typeof val === 'number') {
ret = new Array(val);
for (i = 0; i < val; i++) {
ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
}
} else if (isObject(val)) {
if (hasSymbol && val[Symbol.iterator]) {
ret = [];
var iterator = val[Symbol.iterator]();
var result = iterator.next();
while (!result.done) {
ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
result = iterator.next();
}
} else {
keys = Object.keys(val);
ret = new Array(keys.length);
for (i = 0, l = keys.length; i < l; i++) {
key = keys[i];
ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
}
}
}
if (!isDef(ret)) {
ret = [];
}
(ret)._isVList = true;
return ret
}
/* */
/**
* Runtime helper for rendering
*/
function renderSlot (
name,
fallback,
props,
bindObject
) {
var scopedSlotFn = this.$scopedSlots[name];
var nodes;
if (scopedSlotFn) { // scoped slot
props = props || {};
if (bindObject) {
if ( true && !isObject(bindObject)) {
warn(
'slot v-bind without argument expects an Object',
this
);
}
props = extend(extend({}, bindObject), props);
}
// fixed by xxxxxx app-plus scopedSlot
nodes = scopedSlotFn(props, this, props._i) || fallback;
} else {
nodes = this.$slots[name] || fallback;
}
var target = props && props.slot;
if (target) {
return this.$createElement('template', { slot: target }, nodes)
} else {
return nodes
}
}
/* */
/**
* Runtime helper for resolving filters
*/
function resolveFilter (id) {
return resolveAsset(this.$options, 'filters', id, true) || identity
}
/* */
function isKeyNotMatch (expect, actual) {
if (Array.isArray(expect)) {
return expect.indexOf(actual) === -1
} else {
return expect !== actual
}
}
/**
* Runtime helper for checking keyCodes from config.
* exposed as Vue.prototype._k
* passing in eventKeyName as last argument separately for backwards compat
*/
function checkKeyCodes (
eventKeyCode,
key,
builtInKeyCode,
eventKeyName,
builtInKeyName
) {
var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
return isKeyNotMatch(builtInKeyName, eventKeyName)
} else if (mappedKeyCode) {
return isKeyNotMatch(mappedKeyCode, eventKeyCode)
} else if (eventKeyName) {
return hyphenate(eventKeyName) !== key
}
}
/* */
/**
* Runtime helper for merging v-bind="object" into a VNode's data.
*/
function bindObjectProps (
data,
tag,
value,
asProp,
isSync
) {
if (value) {
if (!isObject(value)) {
true && warn(
'v-bind without argument expects an Object or Array value',
this
);
} else {
if (Array.isArray(value)) {
value = toObject(value);
}
var hash;
var loop = function ( key ) {
if (
key === 'class' ||
key === 'style' ||
isReservedAttribute(key)
) {
hash = data;
} else {
var type = data.attrs && data.attrs.type;
hash = asProp || config.mustUseProp(tag, type, key)
? data.domProps || (data.domProps = {})
: data.attrs || (data.attrs = {});
}
var camelizedKey = camelize(key);
var hyphenatedKey = hyphenate(key);
if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
hash[key] = value[key];
if (isSync) {
var on = data.on || (data.on = {});
on[("update:" + key)] = function ($event) {
value[key] = $event;
};
}
}
};
for (var key in value) loop( key );
}
}
return data
}
/* */
/**
* Runtime helper for rendering static trees.
*/
function renderStatic (
index,
isInFor
) {
var cached = this._staticTrees || (this._staticTrees = []);
var tree = cached[index];
// if has already-rendered static tree and not inside v-for,
// we can reuse the same tree.
if (tree && !isInFor) {
return tree
}
// otherwise, render a fresh tree.
tree = cached[index] = this.$options.staticRenderFns[index].call(
this._renderProxy,
null,
this // for render fns generated for functional component templates
);
markStatic(tree, ("__static__" + index), false);
return tree
}
/**
* Runtime helper for v-once.
* Effectively it means marking the node as static with a unique key.
*/
function markOnce (
tree,
index,
key
) {
markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
return tree
}
function markStatic (
tree,
key,
isOnce
) {
if (Array.isArray(tree)) {
for (var i = 0; i < tree.length; i++) {
if (tree[i] && typeof tree[i] !== 'string') {
markStaticNode(tree[i], (key + "_" + i), isOnce);
}
}
} else {
markStaticNode(tree, key, isOnce);
}
}
function markStaticNode (node, key, isOnce) {
node.isStatic = true;
node.key = key;
node.isOnce = isOnce;
}
/* */
function bindObjectListeners (data, value) {
if (value) {
if (!isPlainObject(value)) {
true && warn(
'v-on without argument expects an Object value',
this
);
} else {
var on = data.on = data.on ? extend({}, data.on) : {};
for (var key in value) {
var existing = on[key];
var ours = value[key];
on[key] = existing ? [].concat(existing, ours) : ours;
}
}
}
return data
}
/* */
function resolveScopedSlots (
fns, // see flow/vnode
res,
// the following are added in 2.6
hasDynamicKeys,
contentHashKey
) {
res = res || { $stable: !hasDynamicKeys };
for (var i = 0; i < fns.length; i++) {
var slot = fns[i];
if (Array.isArray(slot)) {
resolveScopedSlots(slot, res, hasDynamicKeys);
} else if (slot) {
// marker for reverse proxying v-slot without scope on this.$slots
if (slot.proxy) {
slot.fn.proxy = true;
}
res[slot.key] = slot.fn;
}
}
if (contentHashKey) {
(res).$key = contentHashKey;
}
return res
}
/* */
function bindDynamicKeys (baseObj, values) {
for (var i = 0; i < values.length; i += 2) {
var key = values[i];
if (typeof key === 'string' && key) {
baseObj[values[i]] = values[i + 1];
} else if ( true && key !== '' && key !== null) {
// null is a special value for explicitly removing a binding
warn(
("Invalid value for dynamic directive argument (expected string or null): " + key),
this
);
}
}
return baseObj
}
// helper to dynamically append modifier runtime markers to event names.
// ensure only append when value is already string, otherwise it will be cast
// to string and cause the type check to miss.
function prependModifier (value, symbol) {
return typeof value === 'string' ? symbol + value : value
}
/* */
function installRenderHelpers (target) {
target._o = markOnce;
target._n = toNumber;
target._s = toString;
target._l = renderList;
target._t = renderSlot;
target._q = looseEqual;
target._i = looseIndexOf;
target._m = renderStatic;
target._f = resolveFilter;
target._k = checkKeyCodes;
target._b = bindObjectProps;
target._v = createTextVNode;
target._e = createEmptyVNode;
target._u = resolveScopedSlots;
target._g = bindObjectListeners;
target._d = bindDynamicKeys;
target._p = prependModifier;
}
/* */
function FunctionalRenderContext (
data,
props,
children,
parent,
Ctor
) {
var this$1 = this;
var options = Ctor.options;
// ensure the createElement function in functional components
// gets a unique context - this is necessary for correct named slot check
var contextVm;
if (hasOwn(parent, '_uid')) {
contextVm = Object.create(parent);
// $flow-disable-line
contextVm._original = parent;
} else {
// the context vm passed in is a functional context as well.
// in this case we want to make sure we are able to get a hold to the
// real context instance.
contextVm = parent;
// $flow-disable-line
parent = parent._original;
}
var isCompiled = isTrue(options._compiled);
var needNormalization = !isCompiled;
this.data = data;
this.props = props;
this.children = children;
this.parent = parent;
this.listeners = data.on || emptyObject;
this.injections = resolveInject(options.inject, parent);
this.slots = function () {
if (!this$1.$slots) {
normalizeScopedSlots(
data.scopedSlots,
this$1.$slots = resolveSlots(children, parent)
);
}
return this$1.$slots
};
Object.defineProperty(this, 'scopedSlots', ({
enumerable: true,
get: function get () {
return normalizeScopedSlots(data.scopedSlots, this.slots())
}
}));
// support for compiled functional template
if (isCompiled) {
// exposing $options for renderStatic()
this.$options = options;
// pre-resolve slots for renderSlot()
this.$slots = this.slots();
this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
}
if (options._scopeId) {
this._c = function (a, b, c, d) {
var vnode = createElement(contextVm, a, b, c, d, needNormalization);
if (vnode && !Array.isArray(vnode)) {
vnode.fnScopeId = options._scopeId;
vnode.fnContext = parent;
}
return vnode
};
} else {
this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
}
}
installRenderHelpers(FunctionalRenderContext.prototype);
function createFunctionalComponent (
Ctor,
propsData,
data,
contextVm,
children
) {
var options = Ctor.options;
var props = {};
var propOptions = options.props;
if (isDef(propOptions)) {
for (var key in propOptions) {
props[key] = validateProp(key, propOptions, propsData || emptyObject);
}
} else {
if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
if (isDef(data.props)) { mergeProps(props, data.props); }
}
var renderContext = new FunctionalRenderContext(
data,
props,
children,
contextVm,
Ctor
);
var vnode = options.render.call(null, renderContext._c, renderContext);
if (vnode instanceof VNode) {
return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
} else if (Array.isArray(vnode)) {
var vnodes = normalizeChildren(vnode) || [];
var res = new Array(vnodes.length);
for (var i = 0; i < vnodes.length; i++) {
res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
}
return res
}
}
function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
// #7817 clone node before setting fnContext, otherwise if the node is reused
// (e.g. it was from a cached normal slot) the fnContext causes named slots
// that should not be matched to match.
var clone = cloneVNode(vnode);
clone.fnContext = contextVm;
clone.fnOptions = options;
if (true) {
(clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
}
if (data.slot) {
(clone.data || (clone.data = {})).slot = data.slot;
}
return clone
}
function mergeProps (to, from) {
for (var key in from) {
to[camelize(key)] = from[key];
}
}
/* */
/* */
/* */
/* */
// inline hooks to be invoked on component VNodes during patch
var componentVNodeHooks = {
init: function init (vnode, hydrating) {
if (
vnode.componentInstance &&
!vnode.componentInstance._isDestroyed &&
vnode.data.keepAlive
) {
// kept-alive components, treat as a patch
var mountedNode = vnode; // work around flow
componentVNodeHooks.prepatch(mountedNode, mountedNode);
} else {
var child = vnode.componentInstance = createComponentInstanceForVnode(
vnode,
activeInstance
);
child.$mount(hydrating ? vnode.elm : undefined, hydrating);
}
},
prepatch: function prepatch (oldVnode, vnode) {
var options = vnode.componentOptions;
var child = vnode.componentInstance = oldVnode.componentInstance;
updateChildComponent(
child,
options.propsData, // updated props
options.listeners, // updated listeners
vnode, // new parent vnode
options.children // new children
);
},
insert: function insert (vnode) {
var context = vnode.context;
var componentInstance = vnode.componentInstance;
if (!componentInstance._isMounted) {
callHook(componentInstance, 'onServiceCreated');
callHook(componentInstance, 'onServiceAttached');
componentInstance._isMounted = true;
callHook(componentInstance, 'mounted');
}
if (vnode.data.keepAlive) {
if (context._isMounted) {
// vue-router#1212
// During updates, a kept-alive component's child components may
// change, so directly walking the tree here may call activated hooks
// on incorrect children. Instead we push them into a queue which will
// be processed after the whole patch process ended.
queueActivatedComponent(componentInstance);
} else {
activateChildComponent(componentInstance, true /* direct */);
}
}
},
destroy: function destroy (vnode) {
var componentInstance = vnode.componentInstance;
if (!componentInstance._isDestroyed) {
if (!vnode.data.keepAlive) {
componentInstance.$destroy();
} else {
deactivateChildComponent(componentInstance, true /* direct */);
}
}
}
};
var hooksToMerge = Object.keys(componentVNodeHooks);
function createComponent (
Ctor,
data,
context,
children,
tag
) {
if (isUndef(Ctor)) {
return
}
var baseCtor = context.$options._base;
// plain options object: turn it into a constructor
if (isObject(Ctor)) {
Ctor = baseCtor.extend(Ctor);
}
// if at this stage it's not a constructor or an async component factory,
// reject.
if (typeof Ctor !== 'function') {
if (true) {
warn(("Invalid Component definition: " + (String(Ctor))), context);
}
return
}
// async component
var asyncFactory;
if (isUndef(Ctor.cid)) {
asyncFactory = Ctor;
Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
if (Ctor === undefined) {
// return a placeholder node for async component, which is rendered
// as a comment node but preserves all the raw information for the node.
// the information will be used for async server-rendering and hydration.
return createAsyncPlaceholder(
asyncFactory,
data,
context,
children,
tag
)
}
}
data = data || {};
// resolve constructor options in case global mixins are applied after
// component constructor creation
resolveConstructorOptions(Ctor);
// transform component v-model data into props & events
if (isDef(data.model)) {
transformModel(Ctor.options, data);
}
// extract props
var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
// functional component
if (isTrue(Ctor.options.functional)) {
return createFunctionalComponent(Ctor, propsData, data, context, children)
}
// extract listeners, since these needs to be treated as
// child component listeners instead of DOM listeners
var listeners = data.on;
// replace with listeners with .native modifier
// so it gets processed during parent component patch.
data.on = data.nativeOn;
if (isTrue(Ctor.options.abstract)) {
// abstract components do not keep anything
// other than props & listeners & slot
// work around flow
var slot = data.slot;
data = {};
if (slot) {
data.slot = slot;
}
}
// install component management hooks onto the placeholder node
installComponentHooks(data);
// return a placeholder vnode
var name = Ctor.options.name || tag;
var vnode = new VNode(
("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
data, undefined, undefined, undefined, context,
{ Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
asyncFactory
);
return vnode
}
function createComponentInstanceForVnode (
vnode, // we know it's MountedComponentVNode but flow doesn't
parent // activeInstance in lifecycle state
) {
var options = {
_isComponent: true,
_parentVnode: vnode,
parent: parent
};
// check inline-template render functions
var inlineTemplate = vnode.data.inlineTemplate;
if (isDef(inlineTemplate)) {
options.render = inlineTemplate.render;
options.staticRenderFns = inlineTemplate.staticRenderFns;
}
return new vnode.componentOptions.Ctor(options)
}
function installComponentHooks (data) {
var hooks = data.hook || (data.hook = {});
for (var i = 0; i < hooksToMerge.length; i++) {
var key = hooksToMerge[i];
var existing = hooks[key];
var toMerge = componentVNodeHooks[key];
if (existing !== toMerge && !(existing && existing._merged)) {
hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
}
}
}
function mergeHook$1 (f1, f2) {
var merged = function (a, b) {
// flow complains about extra args which is why we use any
f1(a, b);
f2(a, b);
};
merged._merged = true;
return merged
}
// transform component v-model info (value and callback) into
// prop and event handler respectively.
function transformModel (options, data) {
var prop = (options.model && options.model.prop) || 'value';
var event = (options.model && options.model.event) || 'input'
;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
var on = data.on || (data.on = {});
var existing = on[event];
var callback = data.model.callback;
if (isDef(existing)) {
if (
Array.isArray(existing)
? existing.indexOf(callback) === -1
: existing !== callback
) {
on[event] = [callback].concat(existing);
}
} else {
on[event] = callback;
}
}
/* */
var SIMPLE_NORMALIZE = 1;
var ALWAYS_NORMALIZE = 2;
// wrapper function for providing a more flexible interface
// without getting yelled at by flow
function createElement (
context,
tag,
data,
children,
normalizationType,
alwaysNormalize
) {
if (Array.isArray(data) || isPrimitive(data)) {
normalizationType = children;
children = data;
data = undefined;
}
if (isTrue(alwaysNormalize)) {
normalizationType = ALWAYS_NORMALIZE;
}
return _createElement(context, tag, data, children, normalizationType)
}
function _createElement (
context,
tag,
data,
children,
normalizationType
) {
if (isDef(data) && isDef((data).__ob__)) {
true && warn(
"Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
'Always create fresh vnode data objects in each render!',
context
);
return createEmptyVNode()
}
// object syntax in v-bind
if (isDef(data) && isDef(data.is)) {
tag = data.is;
}
if (!tag) {
// in case of component :is set to falsy value
return createEmptyVNode()
}
// warn against non-primitive key
if ( true &&
isDef(data) && isDef(data.key) && !isPrimitive(data.key)
) {
{
warn(
'Avoid using non-primitive value as key, ' +
'use string/number value instead.',
context
);
}
}
// support single function children as default scoped slot
if (Array.isArray(children) &&
typeof children[0] === 'function'
) {
data = data || {};
data.scopedSlots = { default: children[0] };
children.length = 0;
}
if (normalizationType === ALWAYS_NORMALIZE) {
children = normalizeChildren(children);
} else if (normalizationType === SIMPLE_NORMALIZE) {
children = simpleNormalizeChildren(children);
}
var vnode, ns;
if (typeof tag === 'string') {
var Ctor;
ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
if (config.isReservedTag(tag)) {
// platform built-in elements
if ( true && isDef(data) && isDef(data.nativeOn)) {
warn(
("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
context
);
}
vnode = new VNode(
config.parsePlatformTagName(tag), data, children,
undefined, undefined, context
);
} else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
// component
vnode = createComponent(Ctor, data, context, children, tag);
} else {
// unknown or unlisted namespaced elements
// check at runtime because it may get assigned a namespace when its
// parent normalizes children
vnode = new VNode(
tag, data, children,
undefined, undefined, context
);
}
} else {
// direct component options / constructor
vnode = createComponent(tag, data, context, children);
}
if (Array.isArray(vnode)) {
return vnode
} else if (isDef(vnode)) {
if (isDef(ns)) { applyNS(vnode, ns); }
if (isDef(data)) { registerDeepBindings(data); }
return vnode
} else {
return createEmptyVNode()
}
}
function applyNS (vnode, ns, force) {
vnode.ns = ns;
if (vnode.tag === 'foreignObject') {
// use default namespace inside foreignObject
ns = undefined;
force = true;
}
if (isDef(vnode.children)) {
for (var i = 0, l = vnode.children.length; i < l; i++) {
var child = vnode.children[i];
if (isDef(child.tag) && (
isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
applyNS(child, ns, force);
}
}
}
}
// ref #5318
// necessary to ensure parent re-render when deep bindings like :style and
// :class are used on slot nodes
function registerDeepBindings (data) {
if (isObject(data.style)) {
traverse(data.style);
}
if (isObject(data.class)) {
traverse(data.class);
}
}
/* */
function initRender (vm) {
vm._vnode = null; // the root of the child tree
vm._staticTrees = null; // v-once cached trees
var options = vm.$options;
var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
var renderContext = parentVnode && parentVnode.context;
vm.$slots = resolveSlots(options._renderChildren, renderContext);
vm.$scopedSlots = emptyObject;
// bind the createElement fn to this instance
// so that we get proper render context inside it.
// args order: tag, data, children, normalizationType, alwaysNormalize
// internal version is used by render functions compiled from templates
vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
// normalization is always applied for the public version, used in
// user-written render functions.
vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
// $attrs & $listeners are exposed for easier HOC creation.
// they need to be reactive so that HOCs using them are always updated
var parentData = parentVnode && parentVnode.data;
/* istanbul ignore else */
if (true) {
defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
!isUpdatingChildComponent && warn("$attrs is readonly.", vm);
}, true);
defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
!isUpdatingChildComponent && warn("$listeners is readonly.", vm);
}, true);
} else {}
}
var currentRenderingInstance = null;
function renderMixin (Vue) {
// install runtime convenience helpers
installRenderHelpers(Vue.prototype);
Vue.prototype.$nextTick = function (fn) {
return nextTick(fn, this)
};
Vue.prototype._render = function () {
var vm = this;
var ref = vm.$options;
var render = ref.render;
var _parentVnode = ref._parentVnode;
if (_parentVnode) {
vm.$scopedSlots = normalizeScopedSlots(
_parentVnode.data.scopedSlots,
vm.$slots,
vm.$scopedSlots
);
}
// set parent vnode. this allows render functions to have access
// to the data on the placeholder node.
vm.$vnode = _parentVnode;
// render self
var vnode;
try {
// There's no need to maintain a stack because all render fns are called
// separately from one another. Nested component's render fns are called
// when parent component is patched.
currentRenderingInstance = vm;
vnode = render.call(vm._renderProxy, vm.$createElement);
} catch (e) {
handleError(e, vm, "render");
// return error render result,
// or previous vnode to prevent render error causing blank component
/* istanbul ignore else */
if ( true && vm.$options.renderError) {
try {
vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
} catch (e) {
handleError(e, vm, "renderError");
vnode = vm._vnode;
}
} else {
vnode = vm._vnode;
}
} finally {
currentRenderingInstance = null;
}
// if the returned array contains only a single node, allow it
if (Array.isArray(vnode) && vnode.length === 1) {
vnode = vnode[0];
}
// return empty vnode in case the render function errored out
if (!(vnode instanceof VNode)) {
if ( true && Array.isArray(vnode)) {
warn(
'Multiple root nodes returned from render function. Render function ' +
'should return a single root node.',
vm
);
}
vnode = createEmptyVNode();
}
// set parent
vnode.parent = _parentVnode;
return vnode
};
}
/* */
function ensureCtor (comp, base) {
if (
comp.__esModule ||
(hasSymbol && comp[Symbol.toStringTag] === 'Module')
) {
comp = comp.default;
}
return isObject(comp)
? base.extend(comp)
: comp
}
function createAsyncPlaceholder (
factory,
data,
context,
children,
tag
) {
var node = createEmptyVNode();
node.asyncFactory = factory;
node.asyncMeta = { data: data, context: context, children: children, tag: tag };
return node
}
function resolveAsyncComponent (
factory,
baseCtor
) {
if (isTrue(factory.error) && isDef(factory.errorComp)) {
return factory.errorComp
}
if (isDef(factory.resolved)) {
return factory.resolved
}
var owner = currentRenderingInstance;
if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
// already pending
factory.owners.push(owner);
}
if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
return factory.loadingComp
}
if (owner && !isDef(factory.owners)) {
var owners = factory.owners = [owner];
var sync = true;
var timerLoading = null;
var timerTimeout = null
;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
var forceRender = function (renderCompleted) {
for (var i = 0, l = owners.length; i < l; i++) {
(owners[i]).$forceUpdate();
}
if (renderCompleted) {
owners.length = 0;
if (timerLoading !== null) {
clearTimeout(timerLoading);
timerLoading = null;
}
if (timerTimeout !== null) {
clearTimeout(timerTimeout);
timerTimeout = null;
}
}
};
var resolve = once(function (res) {
// cache resolved
factory.resolved = ensureCtor(res, baseCtor);
// invoke callbacks only if this is not a synchronous resolve
// (async resolves are shimmed as synchronous during SSR)
if (!sync) {
forceRender(true);
} else {
owners.length = 0;
}
});
var reject = once(function (reason) {
true && warn(
"Failed to resolve async component: " + (String(factory)) +
(reason ? ("\nReason: " + reason) : '')
);
if (isDef(factory.errorComp)) {
factory.error = true;
forceRender(true);
}
});
var res = factory(resolve, reject);
if (isObject(res)) {
if (isPromise(res)) {
// () => Promise
if (isUndef(factory.resolved)) {
res.then(resolve, reject);
}
} else if (isPromise(res.component)) {
res.component.then(resolve, reject);
if (isDef(res.error)) {
factory.errorComp = ensureCtor(res.error, baseCtor);
}
if (isDef(res.loading)) {
factory.loadingComp = ensureCtor(res.loading, baseCtor);
if (res.delay === 0) {
factory.loading = true;
} else {
timerLoading = setTimeout(function () {
timerLoading = null;
if (isUndef(factory.resolved) && isUndef(factory.error)) {
factory.loading = true;
forceRender(false);
}
}, res.delay || 200);
}
}
if (isDef(res.timeout)) {
timerTimeout = setTimeout(function () {
timerTimeout = null;
if (isUndef(factory.resolved)) {
reject(
true
? ("timeout (" + (res.timeout) + "ms)")
: undefined
);
}
}, res.timeout);
}
}
}
sync = false;
// return in case resolved synchronously
return factory.loading
? factory.loadingComp
: factory.resolved
}
}
/* */
function isAsyncPlaceholder (node) {
return node.isComment && node.asyncFactory
}
/* */
function getFirstComponentChild (children) {
if (Array.isArray(children)) {
for (var i = 0; i < children.length; i++) {
var c = children[i];
if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
return c
}
}
}
}
/* */
/* */
function initEvents (vm) {
vm._events = Object.create(null);
vm._hasHookEvent = false;
// init parent attached events
var listeners = vm.$options._parentListeners;
if (listeners) {
updateComponentListeners(vm, listeners);
}
}
var target;
function add (event, fn) {
target.$on(event, fn);
}
function remove$1 (event, fn) {
target.$off(event, fn);
}
function createOnceHandler (event, fn) {
var _target = target;
return function onceHandler () {
var res = fn.apply(null, arguments);
if (res !== null) {
_target.$off(event, onceHandler);
}
}
}
function updateComponentListeners (
vm,
listeners,
oldListeners
) {
target = vm;
updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
target = undefined;
}
function eventsMixin (Vue) {
var hookRE = /^hook:/;
Vue.prototype.$on = function (event, fn) {
var vm = this;
if (Array.isArray(event)) {
for (var i = 0, l = event.length; i < l; i++) {
vm.$on(event[i], fn);
}
} else {
(vm._events[event] || (vm._events[event] = [])).push(fn);
// optimize hook:event cost by using a boolean flag marked at registration
// instead of a hash lookup
if (hookRE.test(event)) {
vm._hasHookEvent = true;
}
}
return vm
};
Vue.prototype.$once = function (event, fn) {
var vm = this;
function on () {
vm.$off(event, on);
fn.apply(vm, arguments);
}
on.fn = fn;
vm.$on(event, on);
return vm
};
Vue.prototype.$off = function (event, fn) {
var vm = this;
// all
if (!arguments.length) {
vm._events = Object.create(null);
return vm
}
// array of events
if (Array.isArray(event)) {
for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
vm.$off(event[i$1], fn);
}
return vm
}
// specific event
var cbs = vm._events[event];
if (!cbs) {
return vm
}
if (!fn) {
vm._events[event] = null;
return vm
}
// specific handler
var cb;
var i = cbs.length;
while (i--) {
cb = cbs[i];
if (cb === fn || cb.fn === fn) {
cbs.splice(i, 1);
break
}
}
return vm
};
Vue.prototype.$emit = function (event) {
var vm = this;
if (true) {
var lowerCaseEvent = event.toLowerCase();
if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
tip(
"Event \"" + lowerCaseEvent + "\" is emitted in component " +
(formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
"Note that HTML attributes are case-insensitive and you cannot use " +
"v-on to listen to camelCase events when using in-DOM templates. " +
"You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
);
}
}
var cbs = vm._events[event];
if (cbs) {
cbs = cbs.length > 1 ? toArray(cbs) : cbs;
var args = toArray(arguments, 1);
var info = "event handler for \"" + event + "\"";
for (var i = 0, l = cbs.length; i < l; i++) {
invokeWithErrorHandling(cbs[i], vm, args, vm, info);
}
}
return vm
};
}
/* */
var activeInstance = null;
var isUpdatingChildComponent = false;
function setActiveInstance(vm) {
var prevActiveInstance = activeInstance;
activeInstance = vm;
return function () {
activeInstance = prevActiveInstance;
}
}
function initLifecycle (vm) {
var options = vm.$options;
// locate first non-abstract parent
var parent = options.parent;
if (parent && !options.abstract) {
while (parent.$options.abstract && parent.$parent) {
parent = parent.$parent;
}
parent.$children.push(vm);
}
vm.$parent = parent;
vm.$root = parent ? parent.$root : vm;
vm.$children = [];
vm.$refs = {};
vm._watcher = null;
vm._inactive = null;
vm._directInactive = false;
vm._isMounted = false;
vm._isDestroyed = false;
vm._isBeingDestroyed = false;
}
function lifecycleMixin (Vue) {
Vue.prototype._update = function (vnode, hydrating) {
var vm = this;
var prevEl = vm.$el;
var prevVnode = vm._vnode;
var restoreActiveInstance = setActiveInstance(vm);
vm._vnode = vnode;
// Vue.prototype.__patch__ is injected in entry points
// based on the rendering backend used.
if (!prevVnode) {
// initial render
vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
} else {
// updates
vm.$el = vm.__patch__(prevVnode, vnode);
}
restoreActiveInstance();
// update __vue__ reference
if (prevEl) {
prevEl.__vue__ = null;
}
if (vm.$el) {
vm.$el.__vue__ = vm;
}
// if parent is an HOC, update its $el as well
if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
vm.$parent.$el = vm.$el;
}
// updated hook is called by the scheduler to ensure that children are
// updated in a parent's updated hook.
};
Vue.prototype.$forceUpdate = function () {
var vm = this;
if (vm._watcher) {
vm._watcher.update();
}
};
Vue.prototype.$destroy = function () {
var vm = this;
if (vm._isBeingDestroyed) {
return
}
callHook(vm, 'beforeDestroy');
vm._isBeingDestroyed = true;
// remove self from parent
var parent = vm.$parent;
if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
remove(parent.$children, vm);
}
// teardown watchers
if (vm._watcher) {
vm._watcher.teardown();
}
var i = vm._watchers.length;
while (i--) {
vm._watchers[i].teardown();
}
// remove reference from data ob
// frozen object may not have observer.
if (vm._data.__ob__) {
vm._data.__ob__.vmCount--;
}
// call the last hook...
vm._isDestroyed = true;
// invoke destroy hooks on current rendered tree
vm.__patch__(vm._vnode, null);
// fire destroyed hook
callHook(vm, 'destroyed');
// turn off all instance listeners.
vm.$off();
// remove __vue__ reference
if (vm.$el) {
vm.$el.__vue__ = null;
}
// release circular reference (#6759)
if (vm.$vnode) {
vm.$vnode.parent = null;
}
};
}
function updateChildComponent (
vm,
propsData,
listeners,
parentVnode,
renderChildren
) {
if (true) {
isUpdatingChildComponent = true;
}
// determine whether component has slot children
// we need to do this before overwriting $options._renderChildren.
// check if there are dynamic scopedSlots (hand-written or compiled but with
// dynamic slot names). Static scoped slots compiled from template has the
// "$stable" marker.
var newScopedSlots = parentVnode.data.scopedSlots;
var oldScopedSlots = vm.$scopedSlots;
var hasDynamicScopedSlot = !!(
(newScopedSlots && !newScopedSlots.$stable) ||
(oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
(newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
);
// Any static slot children from the parent may have changed during parent's
// update. Dynamic scoped slots may also have changed. In such cases, a forced
// update is necessary to ensure correctness.
var needsForceUpdate = !!(
renderChildren || // has new static slots
vm.$options._renderChildren || // has old static slots
hasDynamicScopedSlot
);
vm.$options._parentVnode = parentVnode;
vm.$vnode = parentVnode; // update vm's placeholder node without re-render
if (vm._vnode) { // update child tree's parent
vm._vnode.parent = parentVnode;
}
vm.$options._renderChildren = renderChildren;
// update $attrs and $listeners hash
// these are also reactive so they may trigger child update if the child
// used them during render
vm.$attrs = parentVnode.data.attrs || emptyObject;
vm.$listeners = listeners || emptyObject;
// update props
if (propsData && vm.$options.props) {
toggleObserving(false);
var props = vm._props;
var propKeys = vm.$options._propKeys || [];
for (var i = 0; i < propKeys.length; i++) {
var key = propKeys[i];
var propOptions = vm.$options.props; // wtf flow?
props[key] = validateProp(key, propOptions, propsData, vm);
}
toggleObserving(true);
// keep a copy of raw propsData
vm.$options.propsData = propsData;
}
// fixed by xxxxxx update properties(mp runtime)
vm._$updateProperties && vm._$updateProperties(vm);
// update listeners
listeners = listeners || emptyObject;
var oldListeners = vm.$options._parentListeners;
vm.$options._parentListeners = listeners;
updateComponentListeners(vm, listeners, oldListeners);
// resolve slots + force update if has children
if (needsForceUpdate) {
vm.$slots = resolveSlots(renderChildren, parentVnode.context);
vm.$forceUpdate();
}
if (true) {
isUpdatingChildComponent = false;
}
}
function isInInactiveTree (vm) {
while (vm && (vm = vm.$parent)) {
if (vm._inactive) { return true }
}
return false
}
function activateChildComponent (vm, direct) {
if (direct) {
vm._directInactive = false;
if (isInInactiveTree(vm)) {
return
}
} else if (vm._directInactive) {
return
}
if (vm._inactive || vm._inactive === null) {
vm._inactive = false;
for (var i = 0; i < vm.$children.length; i++) {
activateChildComponent(vm.$children[i]);
}
callHook(vm, 'activated');
}
}
function deactivateChildComponent (vm, direct) {
if (direct) {
vm._directInactive = true;
if (isInInactiveTree(vm)) {
return
}
}
if (!vm._inactive) {
vm._inactive = true;
for (var i = 0; i < vm.$children.length; i++) {
deactivateChildComponent(vm.$children[i]);
}
callHook(vm, 'deactivated');
}
}
function callHook (vm, hook) {
// #7573 disable dep collection when invoking lifecycle hooks
pushTarget();
var handlers = vm.$options[hook];
var info = hook + " hook";
if (handlers) {
for (var i = 0, j = handlers.length; i < j; i++) {
invokeWithErrorHandling(handlers[i], vm, null, vm, info);
}
}
if (vm._hasHookEvent) {
vm.$emit('hook:' + hook);
}
popTarget();
}
/* */
var MAX_UPDATE_COUNT = 100;
var queue = [];
var activatedChildren = [];
var has = {};
var circular = {};
var waiting = false;
var flushing = false;
var index = 0;
/**
* Reset the scheduler's state.
*/
function resetSchedulerState () {
index = queue.length = activatedChildren.length = 0;
has = {};
if (true) {
circular = {};
}
waiting = flushing = false;
}
// Async edge case #6566 requires saving the timestamp when event listeners are
// attached. However, calling performance.now() has a perf overhead especially
// if the page has thousands of event listeners. Instead, we take a timestamp
// every time the scheduler flushes and use that for all event listeners
// attached during that flush.
var currentFlushTimestamp = 0;
// Async edge case fix requires storing an event listener's attach timestamp.
var getNow = Date.now;
// Determine what event timestamp the browser is using. Annoyingly, the
// timestamp can either be hi-res (relative to page load) or low-res
// (relative to UNIX epoch), so in order to compare time we have to use the
// same timestamp type when saving the flush timestamp.
// All IE versions use low-res event timestamps, and have problematic clock
// implementations (#9632)
if (inBrowser && !isIE) {
var performance = window.performance;
if (
performance &&
typeof performance.now === 'function' &&
getNow() > document.createEvent('Event').timeStamp
) {
// if the event timestamp, although evaluated AFTER the Date.now(), is
// smaller than it, it means the event is using a hi-res timestamp,
// and we need to use the hi-res version for event listener timestamps as
// well.
getNow = function () { return performance.now(); };
}
}
/**
* Flush both queues and run the watchers.
*/
function flushSchedulerQueue () {
currentFlushTimestamp = getNow();
flushing = true;
var watcher, id;
// Sort queue before flush.
// This ensures that:
// 1. Components are updated from parent to child. (because parent is always
// created before the child)
// 2. A component's user watchers are run before its render watcher (because
// user watchers are created before the render watcher)
// 3. If a component is destroyed during a parent component's watcher run,
// its watchers can be skipped.
queue.sort(function (a, b) { return a.id - b.id; });
// do not cache length because more watchers might be pushed
// as we run existing watchers
for (index = 0; index < queue.length; index++) {
watcher = queue[index];
if (watcher.before) {
watcher.before();
}
id = watcher.id;
has[id] = null;
watcher.run();
// in dev build, check and stop circular updates.
if ( true && has[id] != null) {
circular[id] = (circular[id] || 0) + 1;
if (circular[id] > MAX_UPDATE_COUNT) {
warn(
'You may have an infinite update loop ' + (
watcher.user
? ("in watcher with expression \"" + (watcher.expression) + "\"")
: "in a component render function."
),
watcher.vm
);
break
}
}
}
// keep copies of post queues before resetting state
var activatedQueue = activatedChildren.slice();
var updatedQueue = queue.slice();
resetSchedulerState();
// call component updated and activated hooks
callActivatedHooks(activatedQueue);
callUpdatedHooks(updatedQueue);
// devtool hook
/* istanbul ignore if */
if (devtools && config.devtools) {
devtools.emit('flush');
}
}
function callUpdatedHooks (queue) {
var i = queue.length;
while (i--) {
var watcher = queue[i];
var vm = watcher.vm;
if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
callHook(vm, 'updated');
}
}
}
/**
* Queue a kept-alive component that was activated during patch.
* The queue will be processed after the entire tree has been patched.
*/
function queueActivatedComponent (vm) {
// setting _inactive to false here so that a render function can
// rely on checking whether it's in an inactive tree (e.g. router-view)
vm._inactive = false;
activatedChildren.push(vm);
}
function callActivatedHooks (queue) {
for (var i = 0; i < queue.length; i++) {
queue[i]._inactive = true;
activateChildComponent(queue[i], true /* true */);
}
}
/**
* Push a watcher into the watcher queue.
* Jobs with duplicate IDs will be skipped unless it's
* pushed when the queue is being flushed.
*/
function queueWatcher (watcher) {
var id = watcher.id;
if (has[id] == null) {
has[id] = true;
if (!flushing) {
queue.push(watcher);
} else {
// if already flushing, splice the watcher based on its id
// if already past its id, it will be run next immediately.
var i = queue.length - 1;
while (i > index && queue[i].id > watcher.id) {
i--;
}
queue.splice(i + 1, 0, watcher);
}
// queue the flush
if (!waiting) {
waiting = true;
if ( true && !config.async) {
flushSchedulerQueue();
return
}
nextTick(flushSchedulerQueue);
}
}
}
/* */
var uid$2 = 0;
/**
* A watcher parses an expression, collects dependencies,
* and fires callback when the expression value changes.
* This is used for both the $watch() api and directives.
*/
var Watcher = function Watcher (
vm,
expOrFn,
cb,
options,
isRenderWatcher
) {
this.vm = vm;
if (isRenderWatcher) {
vm._watcher = this;
}
vm._watchers.push(this);
// options
if (options) {
this.deep = !!options.deep;
this.user = !!options.user;
this.lazy = !!options.lazy;
this.sync = !!options.sync;
this.before = options.before;
} else {
this.deep = this.user = this.lazy = this.sync = false;
}
this.cb = cb;
this.id = ++uid$2; // uid for batching
this.active = true;
this.dirty = this.lazy; // for lazy watchers
this.deps = [];
this.newDeps = [];
this.depIds = new _Set();
this.newDepIds = new _Set();
this.expression = true
? expOrFn.toString()
: undefined;
// parse expression for getter
if (typeof expOrFn === 'function') {
this.getter = expOrFn;
} else {
this.getter = parsePath(expOrFn);
if (!this.getter) {
this.getter = noop;
true && warn(
"Failed watching path: \"" + expOrFn + "\" " +
'Watcher only accepts simple dot-delimited paths. ' +
'For full control, use a function instead.',
vm
);
}
}
this.value = this.lazy
? undefined
: this.get();
};
/**
* Evaluate the getter, and re-collect dependencies.
*/
Watcher.prototype.get = function get () {
pushTarget(this);
var value;
var vm = this.vm;
try {
value = this.getter.call(vm, vm);
} catch (e) {
if (this.user) {
handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
} else {
throw e
}
} finally {
// "touch" every property so they are all tracked as
// dependencies for deep watching
if (this.deep) {
traverse(value);
}
popTarget();
this.cleanupDeps();
}
return value
};
/**
* Add a dependency to this directive.
*/
Watcher.prototype.addDep = function addDep (dep) {
var id = dep.id;
if (!this.newDepIds.has(id)) {
this.newDepIds.add(id);
this.newDeps.push(dep);
if (!this.depIds.has(id)) {
dep.addSub(this);
}
}
};
/**
* Clean up for dependency collection.
*/
Watcher.prototype.cleanupDeps = function cleanupDeps () {
var i = this.deps.length;
while (i--) {
var dep = this.deps[i];
if (!this.newDepIds.has(dep.id)) {
dep.removeSub(this);
}
}
var tmp = this.depIds;
this.depIds = this.newDepIds;
this.newDepIds = tmp;
this.newDepIds.clear();
tmp = this.deps;
this.deps = this.newDeps;
this.newDeps = tmp;
this.newDeps.length = 0;
};
/**
* Subscriber interface.
* Will be called when a dependency changes.
*/
Watcher.prototype.update = function update () {
/* istanbul ignore else */
if (this.lazy) {
this.dirty = true;
} else if (this.sync) {
this.run();
} else {
queueWatcher(this);
}
};
/**
* Scheduler job interface.
* Will be called by the scheduler.
*/
Watcher.prototype.run = function run () {
if (this.active) {
var value = this.get();
if (
value !== this.value ||
// Deep watchers and watchers on Object/Arrays should fire even
// when the value is the same, because the value may
// have mutated.
isObject(value) ||
this.deep
) {
// set new value
var oldValue = this.value;
this.value = value;
if (this.user) {
try {
this.cb.call(this.vm, value, oldValue);
} catch (e) {
handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
}
} else {
this.cb.call(this.vm, value, oldValue);
}
}
}
};
/**
* Evaluate the value of the watcher.
* This only gets called for lazy watchers.
*/
Watcher.prototype.evaluate = function evaluate () {
this.value = this.get();
this.dirty = false;
};
/**
* Depend on all deps collected by this watcher.
*/
Watcher.prototype.depend = function depend () {
var i = this.deps.length;
while (i--) {
this.deps[i].depend();
}
};
/**
* Remove self from all dependencies' subscriber list.
*/
Watcher.prototype.teardown = function teardown () {
if (this.active) {
// remove self from vm's watcher list
// this is a somewhat expensive operation so we skip it
// if the vm is being destroyed.
if (!this.vm._isBeingDestroyed) {
remove(this.vm._watchers, this);
}
var i = this.deps.length;
while (i--) {
this.deps[i].removeSub(this);
}
this.active = false;
}
};
/* */
var sharedPropertyDefinition = {
enumerable: true,
configurable: true,
get: noop,
set: noop
};
function proxy (target, sourceKey, key) {
sharedPropertyDefinition.get = function proxyGetter () {
return this[sourceKey][key]
};
sharedPropertyDefinition.set = function proxySetter (val) {
this[sourceKey][key] = val;
};
Object.defineProperty(target, key, sharedPropertyDefinition);
}
function initState (vm) {
vm._watchers = [];
var opts = vm.$options;
if (opts.props) { initProps(vm, opts.props); }
if (opts.methods) { initMethods(vm, opts.methods); }
if (opts.data) {
initData(vm);
} else {
observe(vm._data = {}, true /* asRootData */);
}
if (opts.computed) { initComputed(vm, opts.computed); }
if (opts.watch && opts.watch !== nativeWatch) {
initWatch(vm, opts.watch);
}
}
function initProps (vm, propsOptions) {
var propsData = vm.$options.propsData || {};
var props = vm._props = {};
// cache prop keys so that future props updates can iterate using Array
// instead of dynamic object key enumeration.
var keys = vm.$options._propKeys = [];
var isRoot = !vm.$parent;
// root instance props should be converted
if (!isRoot) {
toggleObserving(false);
}
var loop = function ( key ) {
keys.push(key);
var value = validateProp(key, propsOptions, propsData, vm);
/* istanbul ignore else */
if (true) {
var hyphenatedKey = hyphenate(key);
if (isReservedAttribute(hyphenatedKey) ||
config.isReservedAttr(hyphenatedKey)) {
warn(
("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
vm
);
}
defineReactive$$1(props, key, value, function () {
if (!isRoot && !isUpdatingChildComponent) {
{
if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
return
}
//fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
if(
key === 'value' &&
Array.isArray(vm.$options.behaviors) &&
vm.$options.behaviors.indexOf('uni://form-field') !== -1
){
return
}
if(vm._getFormData){
return
}
var $parent = vm.$parent;
while($parent){
if($parent.__next_tick_pending){
return
}
$parent = $parent.$parent;
}
}
warn(
"Avoid mutating a prop directly since the value will be " +
"overwritten whenever the parent component re-renders. " +
"Instead, use a data or computed property based on the prop's " +
"value. Prop being mutated: \"" + key + "\"",
vm
);
}
});
} else {}
// static props are already proxied on the component's prototype
// during Vue.extend(). We only need to proxy props defined at
// instantiation here.
if (!(key in vm)) {
proxy(vm, "_props", key);
}
};
for (var key in propsOptions) loop( key );
toggleObserving(true);
}
function initData (vm) {
var data = vm.$options.data;
data = vm._data = typeof data === 'function'
? getData(data, vm)
: data || {};
if (!isPlainObject(data)) {
data = {};
true && warn(
'data functions should return an object:\n' +
'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
vm
);
}
// proxy data on instance
var keys = Object.keys(data);
var props = vm.$options.props;
var methods = vm.$options.methods;
var i = keys.length;
while (i--) {
var key = keys[i];
if (true) {
if (methods && hasOwn(methods, key)) {
warn(
("Method \"" + key + "\" has already been defined as a data property."),
vm
);
}
}
if (props && hasOwn(props, key)) {
true && warn(
"The data property \"" + key + "\" is already declared as a prop. " +
"Use prop default value instead.",
vm
);
} else if (!isReserved(key)) {
proxy(vm, "_data", key);
}
}
// observe data
observe(data, true /* asRootData */);
}
function getData (data, vm) {
// #7573 disable dep collection when invoking data getters
pushTarget();
try {
return data.call(vm, vm)
} catch (e) {
handleError(e, vm, "data()");
return {}
} finally {
popTarget();
}
}
var computedWatcherOptions = { lazy: true };
function initComputed (vm, computed) {
// $flow-disable-line
var watchers = vm._computedWatchers = Object.create(null);
// computed properties are just getters during SSR
var isSSR = isServerRendering();
for (var key in computed) {
var userDef = computed[key];
var getter = typeof userDef === 'function' ? userDef : userDef.get;
if ( true && getter == null) {
warn(
("Getter is missing for computed property \"" + key + "\"."),
vm
);
}
if (!isSSR) {
// create internal watcher for the computed property.
watchers[key] = new Watcher(
vm,
getter || noop,
noop,
computedWatcherOptions
);
}
// component-defined computed properties are already defined on the
// component prototype. We only need to define computed properties defined
// at instantiation here.
if (!(key in vm)) {
defineComputed(vm, key, userDef);
} else if (true) {
if (key in vm.$data) {
warn(("The computed property \"" + key + "\" is already defined in data."), vm);
} else if (vm.$options.props && key in vm.$options.props) {
warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
}
}
}
}
function defineComputed (
target,
key,
userDef
) {
var shouldCache = !isServerRendering();
if (typeof userDef === 'function') {
sharedPropertyDefinition.get = shouldCache
? createComputedGetter(key)
: createGetterInvoker(userDef);
sharedPropertyDefinition.set = noop;
} else {
sharedPropertyDefinition.get = userDef.get
? shouldCache && userDef.cache !== false
? createComputedGetter(key)
: createGetterInvoker(userDef.get)
: noop;
sharedPropertyDefinition.set = userDef.set || noop;
}
if ( true &&
sharedPropertyDefinition.set === noop) {
sharedPropertyDefinition.set = function () {
warn(
("Computed property \"" + key + "\" was assigned to but it has no setter."),
this
);
};
}
Object.defineProperty(target, key, sharedPropertyDefinition);
}
function createComputedGetter (key) {
return function computedGetter () {
var watcher = this._computedWatchers && this._computedWatchers[key];
if (watcher) {
if (watcher.dirty) {
watcher.evaluate();
}
if (Dep.SharedObject.target) {// fixed by xxxxxx
watcher.depend();
}
return watcher.value
}
}
}
function createGetterInvoker(fn) {
return function computedGetter () {
return fn.call(this, this)
}
}
function initMethods (vm, methods) {
var props = vm.$options.props;
for (var key in methods) {
if (true) {
if (typeof methods[key] !== 'function') {
warn(
"Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
"Did you reference the function correctly?",
vm
);
}
if (props && hasOwn(props, key)) {
warn(
("Method \"" + key + "\" has already been defined as a prop."),
vm
);
}
if ((key in vm) && isReserved(key)) {
warn(
"Method \"" + key + "\" conflicts with an existing Vue instance method. " +
"Avoid defining component methods that start with _ or $."
);
}
}
vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
}
}
function initWatch (vm, watch) {
for (var key in watch) {
var handler = watch[key];
if (Array.isArray(handler)) {
for (var i = 0; i < handler.length; i++) {
createWatcher(vm, key, handler[i]);
}
} else {
createWatcher(vm, key, handler);
}
}
}
function createWatcher (
vm,
expOrFn,
handler,
options
) {
if (isPlainObject(handler)) {
options = handler;
handler = handler.handler;
}
if (typeof handler === 'string') {
handler = vm[handler];
}
return vm.$watch(expOrFn, handler, options)
}
function stateMixin (Vue) {
// flow somehow has problems with directly declared definition object
// when using Object.defineProperty, so we have to procedurally build up
// the object here.
var dataDef = {};
dataDef.get = function () { return this._data };
var propsDef = {};
propsDef.get = function () { return this._props };
if (true) {
dataDef.set = function () {
warn(
'Avoid replacing instance root $data. ' +
'Use nested data properties instead.',
this
);
};
propsDef.set = function () {
warn("$props is readonly.", this);
};
}
Object.defineProperty(Vue.prototype, '$data', dataDef);
Object.defineProperty(Vue.prototype, '$props', propsDef);
Vue.prototype.$set = set;
Vue.prototype.$delete = del;
Vue.prototype.$watch = function (
expOrFn,
cb,
options
) {
var vm = this;
if (isPlainObject(cb)) {
return createWatcher(vm, expOrFn, cb, options)
}
options = options || {};
options.user = true;
var watcher = new Watcher(vm, expOrFn, cb, options);
if (options.immediate) {
try {
cb.call(vm, watcher.value);
} catch (error) {
handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
}
}
return function unwatchFn () {
watcher.teardown();
}
};
}
/* */
var uid$3 = 0;
function initMixin (Vue) {
Vue.prototype._init = function (options) {
var vm = this;
// a uid
vm._uid = uid$3++;
var startTag, endTag;
/* istanbul ignore if */
if ( true && config.performance && mark) {
startTag = "vue-perf-start:" + (vm._uid);
endTag = "vue-perf-end:" + (vm._uid);
mark(startTag);
}
// a flag to avoid this being observed
vm._isVue = true;
// merge options
if (options && options._isComponent) {
// optimize internal component instantiation
// since dynamic options merging is pretty slow, and none of the
// internal component options needs special treatment.
initInternalComponent(vm, options);
} else {
vm.$options = mergeOptions(
resolveConstructorOptions(vm.constructor),
options || {},
vm
);
}
/* istanbul ignore else */
if (true) {
initProxy(vm);
} else {}
// expose real self
vm._self = vm;
initLifecycle(vm);
initEvents(vm);
initRender(vm);
callHook(vm, 'beforeCreate');
!vm._$fallback && initInjections(vm); // resolve injections before data/props
initState(vm);
!vm._$fallback && initProvide(vm); // resolve provide after data/props
!vm._$fallback && callHook(vm, 'created');
/* istanbul ignore if */
if ( true && config.performance && mark) {
vm._name = formatComponentName(vm, false);
mark(endTag);
measure(("vue " + (vm._name) + " init"), startTag, endTag);
}
if (vm.$options.el) {
vm.$mount(vm.$options.el);
}
};
}
function initInternalComponent (vm, options) {
var opts = vm.$options = Object.create(vm.constructor.options);
// doing this because it's faster than dynamic enumeration.
var parentVnode = options._parentVnode;
opts.parent = options.parent;
opts._parentVnode = parentVnode;
var vnodeComponentOptions = parentVnode.componentOptions;
opts.propsData = vnodeComponentOptions.propsData;
opts._parentListeners = vnodeComponentOptions.listeners;
opts._renderChildren = vnodeComponentOptions.children;
opts._componentTag = vnodeComponentOptions.tag;
if (options.render) {
opts.render = options.render;
opts.staticRenderFns = options.staticRenderFns;
}
}
function resolveConstructorOptions (Ctor) {
var options = Ctor.options;
if (Ctor.super) {
var superOptions = resolveConstructorOptions(Ctor.super);
var cachedSuperOptions = Ctor.superOptions;
if (superOptions !== cachedSuperOptions) {
// super option changed,
// need to resolve new options.
Ctor.superOptions = superOptions;
// check if there are any late-modified/attached options (#4976)
var modifiedOptions = resolveModifiedOptions(Ctor);
// update base extend options
if (modifiedOptions) {
extend(Ctor.extendOptions, modifiedOptions);
}
options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
if (options.name) {
options.components[options.name] = Ctor;
}
}
}
return options
}
function resolveModifiedOptions (Ctor) {
var modified;
var latest = Ctor.options;
var sealed = Ctor.sealedOptions;
for (var key in latest) {
if (latest[key] !== sealed[key]) {
if (!modified) { modified = {}; }
modified[key] = latest[key];
}
}
return modified
}
function Vue (options) {
if ( true &&
!(this instanceof Vue)
) {
warn('Vue is a constructor and should be called with the `new` keyword');
}
this._init(options);
}
initMixin(Vue);
stateMixin(Vue);
eventsMixin(Vue);
lifecycleMixin(Vue);
renderMixin(Vue);
/* */
function initUse (Vue) {
Vue.use = function (plugin) {
var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
if (installedPlugins.indexOf(plugin) > -1) {
return this
}
// additional parameters
var args = toArray(arguments, 1);
args.unshift(this);
if (typeof plugin.install === 'function') {
plugin.install.apply(plugin, args);
} else if (typeof plugin === 'function') {
plugin.apply(null, args);
}
installedPlugins.push(plugin);
return this
};
}
/* */
function initMixin$1 (Vue) {
Vue.mixin = function (mixin) {
this.options = mergeOptions(this.options, mixin);
return this
};
}
/* */
function initExtend (Vue) {
/**
* Each instance constructor, including Vue, has a unique
* cid. This enables us to create wrapped "child
* constructors" for prototypal inheritance and cache them.
*/
Vue.cid = 0;
var cid = 1;
/**
* Class inheritance
*/
Vue.extend = function (extendOptions) {
extendOptions = extendOptions || {};
var Super = this;
var SuperId = Super.cid;
var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
if (cachedCtors[SuperId]) {
return cachedCtors[SuperId]
}
var name = extendOptions.name || Super.options.name;
if ( true && name) {
validateComponentName(name);
}
var Sub = function VueComponent (options) {
this._init(options);
};
Sub.prototype = Object.create(Super.prototype);
Sub.prototype.constructor = Sub;
Sub.cid = cid++;
Sub.options = mergeOptions(
Super.options,
extendOptions
);
Sub['super'] = Super;
// For props and computed properties, we define the proxy getters on
// the Vue instances at extension time, on the extended prototype. This
// avoids Object.defineProperty calls for each instance created.
if (Sub.options.props) {
initProps$1(Sub);
}
if (Sub.options.computed) {
initComputed$1(Sub);
}
// allow further extension/mixin/plugin usage
Sub.extend = Super.extend;
Sub.mixin = Super.mixin;
Sub.use = Super.use;
// create asset registers, so extended classes
// can have their private assets too.
ASSET_TYPES.forEach(function (type) {
Sub[type] = Super[type];
});
// enable recursive self-lookup
if (name) {
Sub.options.components[name] = Sub;
}
// keep a reference to the super options at extension time.
// later at instantiation we can check if Super's options have
// been updated.
Sub.superOptions = Super.options;
Sub.extendOptions = extendOptions;
Sub.sealedOptions = extend({}, Sub.options);
// cache constructor
cachedCtors[SuperId] = Sub;
return Sub
};
}
function initProps$1 (Comp) {
var props = Comp.options.props;
for (var key in props) {
proxy(Comp.prototype, "_props", key);
}
}
function initComputed$1 (Comp) {
var computed = Comp.options.computed;
for (var key in computed) {
defineComputed(Comp.prototype, key, computed[key]);
}
}
/* */
function initAssetRegisters (Vue) {
/**
* Create asset registration methods.
*/
ASSET_TYPES.forEach(function (type) {
Vue[type] = function (
id,
definition
) {
if (!definition) {
return this.options[type + 's'][id]
} else {
/* istanbul ignore if */
if ( true && type === 'component') {
validateComponentName(id);
}
if (type === 'component' && isPlainObject(definition)) {
definition.name = definition.name || id;
definition = this.options._base.extend(definition);
}
if (type === 'directive' && typeof definition === 'function') {
definition = { bind: definition, update: definition };
}
this.options[type + 's'][id] = definition;
return definition
}
};
});
}
/* */
function getComponentName (opts) {
return opts && (opts.Ctor.options.name || opts.tag)
}
function matches (pattern, name) {
if (Array.isArray(pattern)) {
return pattern.indexOf(name) > -1
} else if (typeof pattern === 'string') {
return pattern.split(',').indexOf(name) > -1
} else if (isRegExp(pattern)) {
return pattern.test(name)
}
/* istanbul ignore next */
return false
}
function pruneCache (keepAliveInstance, filter) {
var cache = keepAliveInstance.cache;
var keys = keepAliveInstance.keys;
var _vnode = keepAliveInstance._vnode;
for (var key in cache) {
var cachedNode = cache[key];
if (cachedNode) {
var name = getComponentName(cachedNode.componentOptions);
if (name && !filter(name)) {
pruneCacheEntry(cache, key, keys, _vnode);
}
}
}
}
function pruneCacheEntry (
cache,
key,
keys,
current
) {
var cached$$1 = cache[key];
if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
cached$$1.componentInstance.$destroy();
}
cache[key] = null;
remove(keys, key);
}
var patternTypes = [String, RegExp, Array];
var KeepAlive = {
name: 'keep-alive',
abstract: true,
props: {
include: patternTypes,
exclude: patternTypes,
max: [String, Number]
},
created: function created () {
this.cache = Object.create(null);
this.keys = [];
},
destroyed: function destroyed () {
for (var key in this.cache) {
pruneCacheEntry(this.cache, key, this.keys);
}
},
mounted: function mounted () {
var this$1 = this;
this.$watch('include', function (val) {
pruneCache(this$1, function (name) { return matches(val, name); });
});
this.$watch('exclude', function (val) {
pruneCache(this$1, function (name) { return !matches(val, name); });
});
},
render: function render () {
var slot = this.$slots.default;
var vnode = getFirstComponentChild(slot);
var componentOptions = vnode && vnode.componentOptions;
if (componentOptions) {
// check pattern
var name = getComponentName(componentOptions);
var ref = this;
var include = ref.include;
var exclude = ref.exclude;
if (
// not included
(include && (!name || !matches(include, name))) ||
// excluded
(exclude && name && matches(exclude, name))
) {
return vnode
}
var ref$1 = this;
var cache = ref$1.cache;
var keys = ref$1.keys;
var key = vnode.key == null
// same constructor may get registered as different local components
// so cid alone is not enough (#3269)
? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
: vnode.key;
if (cache[key]) {
vnode.componentInstance = cache[key].componentInstance;
// make current key freshest
remove(keys, key);
keys.push(key);
} else {
cache[key] = vnode;
keys.push(key);
// prune oldest entry
if (this.max && keys.length > parseInt(this.max)) {
pruneCacheEntry(cache, keys[0], keys, this._vnode);
}
}
vnode.data.keepAlive = true;
}
return vnode || (slot && slot[0])
}
};
var builtInComponents = {
KeepAlive: KeepAlive
};
/* */
function initGlobalAPI (Vue) {
// config
var configDef = {};
configDef.get = function () { return config; };
if (true) {
configDef.set = function () {
warn(
'Do not replace the Vue.config object, set individual fields instead.'
);
};
}
Object.defineProperty(Vue, 'config', configDef);
// exposed util methods.
// NOTE: these are not considered part of the public API - avoid relying on
// them unless you are aware of the risk.
Vue.util = {
warn: warn,
extend: extend,
mergeOptions: mergeOptions,
defineReactive: defineReactive$$1
};
Vue.set = set;
Vue.delete = del;
Vue.nextTick = nextTick;
// 2.6 explicit observable API
Vue.observable = function (obj) {
observe(obj);
return obj
};
Vue.options = Object.create(null);
ASSET_TYPES.forEach(function (type) {
Vue.options[type + 's'] = Object.create(null);
});
// this is used to identify the "base" constructor to extend all plain-object
// components with in Weex's multi-instance scenarios.
Vue.options._base = Vue;
extend(Vue.options.components, builtInComponents);
initUse(Vue);
initMixin$1(Vue);
initExtend(Vue);
initAssetRegisters(Vue);
}
initGlobalAPI(Vue);
Object.defineProperty(Vue.prototype, '$isServer', {
get: isServerRendering
});
Object.defineProperty(Vue.prototype, '$ssrContext', {
get: function get () {
/* istanbul ignore next */
return this.$vnode && this.$vnode.ssrContext
}
});
// expose FunctionalRenderContext for ssr runtime helper installation
Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext
});
Vue.version = '2.6.11';
/**
* https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
*/
var ARRAYTYPE = '[object Array]';
var OBJECTTYPE = '[object Object]';
var NULLTYPE = '[object Null]';
var UNDEFINEDTYPE = '[object Undefined]';
// const FUNCTIONTYPE = '[object Function]'
function diff(current, pre) {
var result = {};
syncKeys(current, pre);
_diff(current, pre, '', result);
return result
}
function syncKeys(current, pre) {
if (current === pre) { return }
var rootCurrentType = type(current);
var rootPreType = type(pre);
if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
if(Object.keys(current).length >= Object.keys(pre).length){
for (var key in pre) {
var currentValue = current[key];
if (currentValue === undefined) {
current[key] = null;
} else {
syncKeys(currentValue, pre[key]);
}
}
}
} else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
if (current.length >= pre.length) {
pre.forEach(function (item, index) {
syncKeys(current[index], item);
});
}
}
}
function nullOrUndefined(currentType, preType) {
if(
(currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
(preType === NULLTYPE || preType === UNDEFINEDTYPE)
) {
return false
}
return true
}
function _diff(current, pre, path, result) {
if (current === pre) { return }
var rootCurrentType = type(current);
var rootPreType = type(pre);
if (rootCurrentType == OBJECTTYPE) {
if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
setResult(result, path, current);
} else {
var loop = function ( key ) {
var currentValue = current[key];
var preValue = pre[key];
var currentType = type(currentValue);
var preType = type(preValue);
if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
}
} else if (currentType == ARRAYTYPE) {
if (preType != ARRAYTYPE) {
setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
} else {
if (currentValue.length < preValue.length) {
setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
} else {
currentValue.forEach(function (item, index) {
_diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
});
}
}
} else if (currentType == OBJECTTYPE) {
if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
} else {
for (var subKey in currentValue) {
_diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
}
}
}
};
for (var key in current) loop( key );
}
} else if (rootCurrentType == ARRAYTYPE) {
if (rootPreType != ARRAYTYPE) {
setResult(result, path, current);
} else {
if (current.length < pre.length) {
setResult(result, path, current);
} else {
current.forEach(function (item, index) {
_diff(item, pre[index], path + '[' + index + ']', result);
});
}
}
} else {
setResult(result, path, current);
}
}
function setResult(result, k, v) {
// if (type(v) != FUNCTIONTYPE) {
result[k] = v;
// }
}
function type(obj) {
return Object.prototype.toString.call(obj)
}
/* */
function flushCallbacks$1(vm) {
if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"云飞智控","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
var mpInstance = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
}
var copies = vm.__next_tick_callbacks.slice(0);
vm.__next_tick_callbacks.length = 0;
for (var i = 0; i < copies.length; i++) {
copies[i]();
}
}
}
function hasRenderWatcher(vm) {
return queue.find(function (watcher) { return vm._watcher === watcher; })
}
function nextTick$1(vm, cb) {
//1.nextTick 之前 已 setData 且 setData 还未回调完成
//2.nextTick 之前存在 render watcher
if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"云飞智控","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
var mpInstance = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
']:nextVueTick');
}
return nextTick(cb, vm)
}else{
if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"云飞智控","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
var mpInstance$1 = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
']:nextMPTick');
}
}
var _resolve;
if (!vm.__next_tick_callbacks) {
vm.__next_tick_callbacks = [];
}
vm.__next_tick_callbacks.push(function () {
if (cb) {
try {
cb.call(vm);
} catch (e) {
handleError(e, vm, 'nextTick');
}
} else if (_resolve) {
_resolve(vm);
}
});
// $flow-disable-line
if (!cb && typeof Promise !== 'undefined') {
return new Promise(function (resolve) {
_resolve = resolve;
})
}
}
/* */
function clearInstance(key, value) {
// 简易去除 Vue 和小程序组件实例
if (value) {
if (value._isVue || value.__v_isMPComponent) {
return {}
}
}
return value
}
function cloneWithData(vm) {
// 确保当前 vm 所有数据被同步
var ret = Object.create(null);
var dataKeys = [].concat(
Object.keys(vm._data || {}),
Object.keys(vm._computedWatchers || {}));
dataKeys.reduce(function(ret, key) {
ret[key] = vm[key];
return ret
}, ret);
// vue-composition-api
var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
var rawBindings = compositionApiState && compositionApiState.rawBindings;
if (rawBindings) {
Object.keys(rawBindings).forEach(function (key) {
ret[key] = vm[key];
});
}
//TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
Object.assign(ret, vm.$mp.data || {});
if (
Array.isArray(vm.$options.behaviors) &&
vm.$options.behaviors.indexOf('uni://form-field') !== -1
) { //form-field
ret['name'] = vm.name;
ret['value'] = vm.value;
}
return JSON.parse(JSON.stringify(ret, clearInstance))
}
var patch = function(oldVnode, vnode) {
var this$1 = this;
if (vnode === null) { //destroy
return
}
if (this.mpType === 'page' || this.mpType === 'component') {
var mpInstance = this.$scope;
var data = Object.create(null);
try {
data = cloneWithData(this);
} catch (err) {
console.error(err);
}
data.__webviewId__ = mpInstance.data.__webviewId__;
var mpData = Object.create(null);
Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
mpData[key] = mpInstance.data[key];
});
var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
if (Object.keys(diffData).length) {
if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"云飞智控","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
']差量更新',
JSON.stringify(diffData));
}
this.__next_tick_pending = true;
mpInstance.setData(diffData, function () {
this$1.__next_tick_pending = false;
flushCallbacks$1(this$1);
});
} else {
flushCallbacks$1(this);
}
}
};
/* */
function createEmptyRender() {
}
function mountComponent$1(
vm,
el,
hydrating
) {
if (!vm.mpType) {//main.js 中的 new Vue
return vm
}
if (vm.mpType === 'app') {
vm.$options.render = createEmptyRender;
}
if (!vm.$options.render) {
vm.$options.render = createEmptyRender;
if (true) {
/* istanbul ignore if */
if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
vm.$options.el || el) {
warn(
'You are using the runtime-only build of Vue where the template ' +
'compiler is not available. Either pre-compile the templates into ' +
'render functions, or use the compiler-included build.',
vm
);
} else {
warn(
'Failed to mount component: template or render function not defined.',
vm
);
}
}
}
!vm._$fallback && callHook(vm, 'beforeMount');
var updateComponent = function () {
vm._update(vm._render(), hydrating);
};
// we set this to vm._watcher inside the watcher's constructor
// since the watcher's initial patch may call $forceUpdate (e.g. inside child
// component's mounted hook), which relies on vm._watcher being already defined
new Watcher(vm, updateComponent, noop, {
before: function before() {
if (vm._isMounted && !vm._isDestroyed) {
callHook(vm, 'beforeUpdate');
}
}
}, true /* isRenderWatcher */);
hydrating = false;
return vm
}
/* */
function renderClass (
staticClass,
dynamicClass
) {
if (isDef(staticClass) || isDef(dynamicClass)) {
return concat(staticClass, stringifyClass(dynamicClass))
}
/* istanbul ignore next */
return ''
}
function concat (a, b) {
return a ? b ? (a + ' ' + b) : a : (b || '')
}
function stringifyClass (value) {
if (Array.isArray(value)) {
return stringifyArray(value)
}
if (isObject(value)) {
return stringifyObject(value)
}
if (typeof value === 'string') {
return value
}
/* istanbul ignore next */
return ''
}
function stringifyArray (value) {
var res = '';
var stringified;
for (var i = 0, l = value.length; i < l; i++) {
if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
if (res) { res += ' '; }
res += stringified;
}
}
return res
}
function stringifyObject (value) {
var res = '';
for (var key in value) {
if (value[key]) {
if (res) { res += ' '; }
res += key;
}
}
return res
}
/* */
var parseStyleText = cached(function (cssText) {
var res = {};
var listDelimiter = /;(?![^(]*\))/g;
var propertyDelimiter = /:(.+)/;
cssText.split(listDelimiter).forEach(function (item) {
if (item) {
var tmp = item.split(propertyDelimiter);
tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
}
});
return res
});
// normalize possible array / string values into Object
function normalizeStyleBinding (bindingStyle) {
if (Array.isArray(bindingStyle)) {
return toObject(bindingStyle)
}
if (typeof bindingStyle === 'string') {
return parseStyleText(bindingStyle)
}
return bindingStyle
}
/* */
var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
function getTarget(obj, path) {
var parts = path.split('.');
var key = parts[0];
if (key.indexOf('__$n') === 0) { //number index
key = parseInt(key.replace('__$n', ''));
}
if (parts.length === 1) {
return obj[key]
}
return getTarget(obj[key], parts.slice(1).join('.'))
}
function internalMixin(Vue) {
Vue.config.errorHandler = function(err, vm, info) {
Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
console.error(err);
/* eslint-disable no-undef */
var app = typeof getApp === 'function' && getApp();
if (app && app.onError) {
app.onError(err);
}
};
var oldEmit = Vue.prototype.$emit;
Vue.prototype.$emit = function(event) {
if (this.$scope && event) {
var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
if (triggerEvent) {
try {
triggerEvent.call(this.$scope, event, {
__args__: toArray(arguments, 1)
});
} catch (error) {
}
}
}
return oldEmit.apply(this, arguments)
};
Vue.prototype.$nextTick = function(fn) {
return nextTick$1(this, fn)
};
MP_METHODS.forEach(function (method) {
Vue.prototype[method] = function(args) {
if (this.$scope && this.$scope[method]) {
return this.$scope[method](args)
}
// mp-alipay
if (typeof my === 'undefined') {
return
}
if (method === 'createSelectorQuery') {
/* eslint-disable no-undef */
return my.createSelectorQuery(args)
} else if (method === 'createIntersectionObserver') {
/* eslint-disable no-undef */
return my.createIntersectionObserver(args)
}
// TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
};
});
Vue.prototype.__init_provide = initProvide;
Vue.prototype.__init_injections = initInjections;
Vue.prototype.__call_hook = function(hook, args) {
var vm = this;
// #7573 disable dep collection when invoking lifecycle hooks
pushTarget();
var handlers = vm.$options[hook];
var info = hook + " hook";
var ret;
if (handlers) {
for (var i = 0, j = handlers.length; i < j; i++) {
ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
}
}
if (vm._hasHookEvent) {
vm.$emit('hook:' + hook, args);
}
popTarget();
return ret
};
Vue.prototype.__set_model = function(target, key, value, modifiers) {
if (Array.isArray(modifiers)) {
if (modifiers.indexOf('trim') !== -1) {
value = value.trim();
}
if (modifiers.indexOf('number') !== -1) {
value = this._n(value);
}
}
if (!target) {
target = this;
}
// 解决动态属性添加
Vue.set(target, key, value);
};
Vue.prototype.__set_sync = function(target, key, value) {
if (!target) {
target = this;
}
// 解决动态属性添加
Vue.set(target, key, value);
};
Vue.prototype.__get_orig = function(item) {
if (isPlainObject(item)) {
return item['$orig'] || item
}
return item
};
Vue.prototype.__get_value = function(dataPath, target) {
return getTarget(target || this, dataPath)
};
Vue.prototype.__get_class = function(dynamicClass, staticClass) {
return renderClass(staticClass, dynamicClass)
};
Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
if (!dynamicStyle && !staticStyle) {
return ''
}
var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
};
Vue.prototype.__map = function(val, iteratee) {
//TODO 暂不考虑 string
var ret, i, l, keys, key;
if (Array.isArray(val)) {
ret = new Array(val.length);
for (i = 0, l = val.length; i < l; i++) {
ret[i] = iteratee(val[i], i);
}
return ret
} else if (isObject(val)) {
keys = Object.keys(val);
ret = Object.create(null);
for (i = 0, l = keys.length; i < l; i++) {
key = keys[i];
ret[key] = iteratee(val[key], key, i);
}
return ret
} else if (typeof val === 'number') {
ret = new Array(val);
for (i = 0, l = val; i < l; i++) {
// 第一个参数暂时仍和小程序一致
ret[i] = iteratee(i, i);
}
return ret
}
return []
};
}
/* */
var LIFECYCLE_HOOKS$1 = [
//App
'onLaunch',
'onShow',
'onHide',
'onUniNViewMessage',
'onPageNotFound',
'onThemeChange',
'onError',
'onUnhandledRejection',
//Page
'onInit',
'onLoad',
// 'onShow',
'onReady',
// 'onHide',
'onUnload',
'onPullDownRefresh',
'onReachBottom',
'onTabItemTap',
'onAddToFavorites',
'onShareTimeline',
'onShareAppMessage',
'onResize',
'onPageScroll',
'onNavigationBarButtonTap',
'onBackPress',
'onNavigationBarSearchInputChanged',
'onNavigationBarSearchInputConfirmed',
'onNavigationBarSearchInputClicked',
'onUploadDouyinVideo',
'onNFCReadMessage',
//Component
// 'onReady', // 兼容旧版本,应该移除该事件
'onPageShow',
'onPageHide',
'onPageResize'
];
function lifecycleMixin$1(Vue) {
//fixed vue-class-component
var oldExtend = Vue.extend;
Vue.extend = function(extendOptions) {
extendOptions = extendOptions || {};
var methods = extendOptions.methods;
if (methods) {
Object.keys(methods).forEach(function (methodName) {
if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
extendOptions[methodName] = methods[methodName];
delete methods[methodName];
}
});
}
return oldExtend.call(this, extendOptions)
};
var strategies = Vue.config.optionMergeStrategies;
var mergeHook = strategies.created;
LIFECYCLE_HOOKS$1.forEach(function (hook) {
strategies[hook] = mergeHook;
});
Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
}
/* */
// install platform patch function
Vue.prototype.__patch__ = patch;
// public mount method
Vue.prototype.$mount = function(
el ,
hydrating
) {
return mountComponent$1(this, el, hydrating)
};
lifecycleMixin$1(Vue);
internalMixin(Vue);
/* */
/* harmony default export */ __webpack_exports__["default"] = (Vue);
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
/***/ }),
/***/ 257:
/*!**********************************************!*\
!*** E:/project/bigdata_WX/util/anitthro.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
var timer1 = null; //防抖,
var timer2 = null; //节流
function Debounce(fn, t) {
//防抖
var delay = t || 500;
return function () {
var _this = this;
var args = arguments;
// let timer1 = null
// console.log(timer1);
if (timer1) {
clearTimeout(timer1);
}
timer1 = setTimeout(function () {
fn.apply(_this, args);
timer1 = null;
}, delay);
};
}
// 使用
/*import {Debounce} from '@/common/debounceThrottle.js'
Debounce(() => {
//要执行的函数
}, 200)() */
function Throttle(fn, t) {
//节流
var last;
var interval = t || 500;
return function () {
var _this2 = this;
var args = arguments;
var now = +new Date();
if (last && now - last < interval) {
clearTimeout(timer2);
timer2 = setTimeout(function () {
last = now;
fn.apply(_this2, args);
}, interval);
} else {
last = now;
fn.apply(this, args);
}
};
}
module.exports = {
Debounce: Debounce,
Throttle: Throttle
};
/***/ }),
/***/ 26:
/*!****************************************!*\
!*** E:/project/bigdata_WX/pages.json ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/***/ }),
/***/ 3:
/*!***********************************!*\
!*** (webpack)/buildin/global.js ***!
\***********************************/
/*! no static exports found */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || new Function("return this")();
} catch (e) {
// This works if the window reference is available
if (typeof window === "object") g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/***/ 32:
/*!**********************************************************************************************************!*\
!*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
\**********************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
/* globals __VUE_SSR_CONTEXT__ */
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.
function normalizeComponent (
scriptExports,
render,
staticRenderFns,
functionalTemplate,
injectStyles,
scopeId,
moduleIdentifier, /* server only */
shadowMode, /* vue-cli only */
components, // fixed by xxxxxx auto components
renderjs // fixed by xxxxxx renderjs
) {
// Vue.extend constructor export interop
var options = typeof scriptExports === 'function'
? scriptExports.options
: scriptExports
// fixed by xxxxxx auto components
if (components) {
if (!options.components) {
options.components = {}
}
var hasOwn = Object.prototype.hasOwnProperty
for (var name in components) {
if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
options.components[name] = components[name]
}
}
}
// fixed by xxxxxx renderjs
if (renderjs) {
if(typeof renderjs.beforeCreate === 'function'){
renderjs.beforeCreate = [renderjs.beforeCreate]
}
(renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
this[renderjs.__module] = this
});
(options.mixins || (options.mixins = [])).push(renderjs)
}
// render functions
if (render) {
options.render = render
options.staticRenderFns = staticRenderFns
options._compiled = true
}
// functional template
if (functionalTemplate) {
options.functional = true
}
// scopedId
if (scopeId) {
options._scopeId = 'data-v-' + scopeId
}
var hook
if (moduleIdentifier) { // server build
hook = function (context) {
// 2.3 injection
context =
context || // cached call
(this.$vnode && this.$vnode.ssrContext) || // stateful
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
// 2.2 with runInNewContext: true
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
context = __VUE_SSR_CONTEXT__
}
// inject component styles
if (injectStyles) {
injectStyles.call(this, context)
}
// register component module identifier for async chunk inferrence
if (context && context._registeredComponents) {
context._registeredComponents.add(moduleIdentifier)
}
}
// used by ssr in case component is cached and beforeCreate
// never gets called
options._ssrRegister = hook
} else if (injectStyles) {
hook = shadowMode
? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
: injectStyles
}
if (hook) {
if (options.functional) {
// for template-only hot-reload because in that case the render fn doesn't
// go through the normalizer
options._injectStyles = hook
// register for functioal component in vue file
var originalRender = options.render
options.render = function renderWithStyleInjection (h, context) {
hook.call(context)
return originalRender(h, context)
}
} else {
// inject component registration as beforeCreate hook
var existing = options.beforeCreate
options.beforeCreate = existing
? [].concat(existing, hook)
: [hook]
}
}
return {
exports: scriptExports,
options: options
}
}
/***/ }),
/***/ 33:
/*!***********************************************!*\
!*** E:/project/bigdata_WX/uview-ui/index.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(uni) {
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 34));
var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 35));
var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 39));
var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 40));
var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 44));
var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 45));
var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 46));
var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 47));
var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 48));
var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 49));
var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 50));
var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 37));
var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 36));
var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 51));
var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 38));
var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 52));
var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 53));
var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 54));
var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 55));
var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 56));
var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 57);
var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 58));
var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 59));
var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 60));
var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 61));
// 引入全局mixin
// 引入关于是否mixin集成小程序分享的配置
// import wxshare from './libs/mixin/mpShare.js'
// 全局挂载引入http相关请求拦截插件
function wranning(str) {
// 开发环境进行信息输出,主要是一些报错信息
// 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
// https://uniapp.dcloud.io/frame?id=%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e5%92%8c%e7%94%9f%e4%ba%a7%e7%8e%af%e5%a2%83
if (true) {
console.warn(str);
}
}
// 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
// HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
// let vuexStore = {};
// try {
// vuexStore = require("@/store/$u.mixin.js");
// } catch (e) {
// //TODO handle the exception
// }
// post类型对象参数转为get类型url参数
var $u = {
queryParams: _queryParams.default,
route: _route.default,
timeFormat: _timeFormat.default,
date: _timeFormat.default,
// 另名date
timeFrom: _timeFrom.default,
colorGradient: _colorGradient.default.colorGradient,
colorToRgba: _colorGradient.default.colorToRgba,
guid: _guid.default,
color: _color.default,
sys: _sys.sys,
os: _sys.os,
type2icon: _type2icon.default,
randomArray: _randomArray.default,
wranning: wranning,
get: _request.default.get,
post: _request.default.post,
put: _request.default.put,
'delete': _request.default.delete,
hexToRgb: _colorGradient.default.hexToRgb,
rgbToHex: _colorGradient.default.rgbToHex,
test: _test.default,
random: _random.default,
deepClone: _deepClone.default,
deepMerge: _deepMerge.default,
getParent: _getParent.default,
$parent: _$parent.default,
addUnit: _addUnit.default,
trim: _trim.default,
type: ['primary', 'success', 'error', 'warning', 'info'],
http: _request.default,
toast: _toast.default,
config: _config.default,
// uView配置信息相关,比如版本号
zIndex: _zIndex.default,
debounce: _debounce.default,
throttle: _throttle.default
};
// $u挂载到uni对象上
uni.$u = $u;
var install = function install(Vue) {
Vue.mixin(_mixin.default);
if (Vue.prototype.openShare) {
Vue.mixin(mpShare);
}
// Vue.mixin(vuexStore);
// 时间格式化,同时两个名称,date和timeFormat
Vue.filter('timeFormat', function (timestamp, format) {
return (0, _timeFormat.default)(timestamp, format);
});
Vue.filter('date', function (timestamp, format) {
return (0, _timeFormat.default)(timestamp, format);
});
// 将多久以前的方法,注入到全局过滤器
Vue.filter('timeFrom', function (timestamp, format) {
return (0, _timeFrom.default)(timestamp, format);
});
Vue.prototype.$u = $u;
};
var _default = {
install: install
};
exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
/***/ }),
/***/ 34:
/*!**********************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/mixin/mixin.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(uni) {module.exports = {
data: function data() {
return {};
},
onLoad: function onLoad() {
// getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
this.$u.getRect = this.$uGetRect;
},
methods: {
// 查询节点信息
// 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
// 解决办法为在组件根部再套一个没有任何作用的view元素
$uGetRect: function $uGetRect(selector, all) {
var _this = this;
return new Promise(function (resolve) {
uni.createSelectorQuery().in(_this)[all ? 'selectAll' : 'select'](selector).boundingClientRect(function (rect) {
if (all && Array.isArray(rect) && rect.length) {
resolve(rect);
}
if (!all && rect) {
resolve(rect);
}
}).exec();
});
},
getParentData: function getParentData() {
var _this2 = this;
var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
// 避免在created中去定义parent变量
if (!this.parent) this.parent = false;
// 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
// 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
// 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
this.parent = this.$u.$parent.call(this, parentName);
if (this.parent) {
// 历遍parentData中的属性,将parent中的同名属性赋值给parentData
Object.keys(this.parentData).map(function (key) {
_this2.parentData[key] = _this2.parent[key];
});
}
},
// 阻止事件冒泡
preventEvent: function preventEvent(e) {
e && e.stopPropagation && e.stopPropagation();
}
},
onReachBottom: function onReachBottom() {
uni.$emit('uOnReachBottom');
}
};
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
/***/ }),
/***/ 35:
/*!************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/request/index.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(uni) {
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 36));
var _test = _interopRequireDefault(__webpack_require__(/*! ../function/test */ 38));
var Request = /*#__PURE__*/function () {
function Request() {
var _this = this;
(0, _classCallCheck2.default)(this, Request);
this.config = {
baseUrl: '',
// 请求的根域名
// 默认的请求头
header: {},
method: 'POST',
// 设置为json,返回后uni.request会对数据进行一次JSON.parse
dataType: 'json',
// 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
responseType: 'text',
showLoading: true,
// 是否显示请求中的loading
loadingText: '请求中...',
loadingTime: 800,
// 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
timer: null,
// 定时器
originalData: false,
// 是否在拦截器中返回服务端的原始数据,见文档说明
loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
};
// 拦截器
this.interceptor = {
// 请求前的拦截
request: null,
// 请求后的拦截
response: null
};
// get请求
this.get = function (url) {
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
return _this.request({
method: 'GET',
url: url,
header: header,
data: data
});
};
// post请求
this.post = function (url) {
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
return _this.request({
url: url,
method: 'POST',
header: header,
data: data
});
};
// put请求,不支持支付宝小程序(HX2.6.15)
this.put = function (url) {
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
return _this.request({
url: url,
method: 'PUT',
header: header,
data: data
});
};
// delete请求,不支持支付宝和头条小程序(HX2.6.15)
this.delete = function (url) {
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
return _this.request({
url: url,
method: 'DELETE',
header: header,
data: data
});
};
}
(0, _createClass2.default)(Request, [{
key: "setConfig",
value:
// 设置全局默认配置
function setConfig(customConfig) {
// 深度合并对象,否则会造成对象深层属性丢失
this.config = (0, _deepMerge.default)(this.config, customConfig);
}
// 主要请求部分
}, {
key: "request",
value: function request() {
var _this2 = this;
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
// 检查请求拦截
if (this.interceptor.request && typeof this.interceptor.request === 'function') {
var tmpConfig = {};
var interceptorRequest = this.interceptor.request(options);
if (interceptorRequest === false) {
// 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
return new Promise(function () {});
}
this.options = interceptorRequest;
}
options.dataType = options.dataType || this.config.dataType;
options.responseType = options.responseType || this.config.responseType;
options.url = options.url || '';
options.params = options.params || {};
options.header = Object.assign(this.config.header, options.header);
options.method = options.method || this.config.method;
return new Promise(function (resolve, reject) {
options.complete = function (response) {
// 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
uni.hideLoading();
// 清除定时器,如果请求回来了,就无需loading
clearTimeout(_this2.config.timer);
_this2.config.timer = null;
// 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
if (_this2.config.originalData) {
// 判断是否存在拦截器
if (_this2.interceptor.response && typeof _this2.interceptor.response === 'function') {
var resInterceptors = _this2.interceptor.response(response);
// 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
if (resInterceptors !== false) {
resolve(resInterceptors);
} else {
// 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
reject(response);
}
} else {
// 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
resolve(response);
}
} else {
if (response.statusCode == 200) {
if (_this2.interceptor.response && typeof _this2.interceptor.response === 'function') {
var _resInterceptors = _this2.interceptor.response(response.data);
if (_resInterceptors !== false) {
resolve(_resInterceptors);
} else {
reject(response.data);
}
} else {
// 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
resolve(response.data);
}
} else {
// 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
// if(response.errMsg) {
// uni.showModal({
// title: response.errMsg
// });
// }
reject(response);
}
}
};
// 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
options.url = _test.default.url(options.url) ? options.url : _this2.config.baseUrl + (options.url.indexOf('/') == 0 ? options.url : '/' + options.url);
// 是否显示loading
// 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
// 而没有清除前者的定时器,导致前者超时,一直显示loading
if (_this2.config.showLoading && !_this2.config.timer) {
_this2.config.timer = setTimeout(function () {
uni.showLoading({
title: _this2.config.loadingText,
mask: _this2.config.loadingMask
});
_this2.config.timer = null;
}, _this2.config.loadingTime);
}
uni.request(options);
});
// .catch(res => {
// // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
// // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
// return new Promise(()=>{});
// })
}
}]);
return Request;
}();
var _default = new Request();
exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
/***/ }),
/***/ 36:
/*!*****************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/deepMerge.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./deepClone */ 37));
// JS对象深度合并
function deepMerge() {
var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
target = (0, _deepClone.default)(target);
if ((0, _typeof2.default)(target) !== 'object' || (0, _typeof2.default)(source) !== 'object') return false;
for (var prop in source) {
if (!source.hasOwnProperty(prop)) continue;
if (prop in target) {
if ((0, _typeof2.default)(target[prop]) !== 'object') {
target[prop] = source[prop];
} else {
if ((0, _typeof2.default)(source[prop]) !== 'object') {
target[prop] = source[prop];
} else {
if (target[prop].concat && source[prop].concat) {
target[prop] = target[prop].concat(source[prop]);
} else {
target[prop] = deepMerge(target[prop], source[prop]);
}
}
}
} else {
target[prop] = source[prop];
}
}
return target;
}
var _default = deepMerge;
exports.default = _default;
/***/ }),
/***/ 37:
/*!*****************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/deepClone.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
// 判断arr是否为一个数组,返回一个bool值
function isArray(arr) {
return Object.prototype.toString.call(arr) === '[object Array]';
}
// 深度克隆
function deepClone(obj) {
// 对常见的“非”值,直接返回原来值
if ([null, undefined, NaN, false].includes(obj)) return obj;
if ((0, _typeof2.default)(obj) !== "object" && typeof obj !== 'function') {
//原始类型直接返回
return obj;
}
var o = isArray(obj) ? [] : {};
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
o[i] = (0, _typeof2.default)(obj[i]) === "object" ? deepClone(obj[i]) : obj[i];
}
}
return o;
}
var _default = deepClone;
exports.default = _default;
/***/ }),
/***/ 370:
/*!*****************************************************************************!*\
!*** E:/project/bigdata_WX/components/js_sdk/u-charts/u-charts/u-charts.js ***!
\*****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(uni, module) {/*
* uCharts v1.9.6.20210214
* uni-app平台高性能跨全端图表,支持H5、APP、小程序(微信/支付宝/百度/头条/QQ/360)
* Copyright (c) 2021 QIUN秋云 https://www.ucharts.cn All rights reserved.
* Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
*
* uCharts官方网站
* https://www.uCharts.cn
*
* 开源地址:
* https://gitee.com/uCharts/uCharts
*
* uni-app插件市场地址:
* http://ext.dcloud.net.cn/plugin?id=271
*
*/
var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
var config = {
yAxisWidth: 15,
yAxisSplit: 5,
xAxisHeight: 22,
xAxisLineHeight: 22,
legendHeight: 15,
yAxisTitleWidth: 15,
padding: [10, 10, 10, 10],
pixelRatio: 1,
rotate: false,
columePadding: 3,
fontSize: 13,
//dataPointShape: ['diamond', 'circle', 'triangle', 'rect'],
dataPointShape: ['circle', 'circle', 'circle', 'circle'],
colors: ['#1890ff', '#2fc25b', '#facc14', '#f04864', '#8543e0', '#90ed7d'],
pieChartLinePadding: 15,
pieChartTextPadding: 5,
xAxisTextPadding: 3,
titleColor: '#333333',
titleFontSize: 20,
subtitleColor: '#999999',
subtitleFontSize: 15,
toolTipPadding: 3,
toolTipBackground: '#000000',
toolTipOpacity: 0.7,
toolTipLineHeight: 20,
radarLabelTextMargin: 15,
gaugeLabelTextMargin: 15
};
var assign = function assign(target) {
for (var _len2 = arguments.length, varArgs = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
varArgs[_key2 - 1] = arguments[_key2];
}
if (target == null) {
throw new TypeError('Cannot convert undefined or null to object');
}
if (!varArgs || varArgs.length <= 0) {
return target;
}
// 深度合并对象
function deepAssign(obj1, obj2) {
for (var key in obj2) {
obj1[key] = obj1[key] && obj1[key].toString() === "[object Object]" ? deepAssign(obj1[key], obj2[key]) : obj1[key] = obj2[key];
}
return obj1;
}
varArgs.forEach(function (val) {
target = deepAssign(target, val);
});
return target;
};
var util = {
toFixed: function toFixed(num, limit) {
limit = limit || 2;
if (this.isFloat(num)) {
num = num.toFixed(limit);
}
return num;
},
isFloat: function isFloat(num) {
return num % 1 !== 0;
},
approximatelyEqual: function approximatelyEqual(num1, num2) {
return Math.abs(num1 - num2) < 1e-10;
},
isSameSign: function isSameSign(num1, num2) {
return Math.abs(num1) === num1 && Math.abs(num2) === num2 || Math.abs(num1) !== num1 && Math.abs(num2) !== num2;
},
isSameXCoordinateArea: function isSameXCoordinateArea(p1, p2) {
return this.isSameSign(p1.x, p2.x);
},
isCollision: function isCollision(obj1, obj2) {
obj1.end = {};
obj1.end.x = obj1.start.x + obj1.width;
obj1.end.y = obj1.start.y - obj1.height;
obj2.end = {};
obj2.end.x = obj2.start.x + obj2.width;
obj2.end.y = obj2.start.y - obj2.height;
var flag = obj2.start.x > obj1.end.x || obj2.end.x < obj1.start.x || obj2.end.y > obj1.start.y || obj2.start.y < obj1.end.y;
return !flag;
}
};
//兼容H5点击事件
function getH5Offset(e) {
e.mp = {
changedTouches: []
};
e.mp.changedTouches.push({
x: e.offsetX,
y: e.offsetY
});
return e;
}
// hex 转 rgba
function hexToRgb(hexValue, opc) {
var rgx = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
var hex = hexValue.replace(rgx, function (m, r, g, b) {
return r + r + g + g + b + b;
});
var rgb = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
var r = parseInt(rgb[1], 16);
var g = parseInt(rgb[2], 16);
var b = parseInt(rgb[3], 16);
return 'rgba(' + r + ',' + g + ',' + b + ',' + opc + ')';
}
function findRange(num, type, limit) {
if (isNaN(num)) {
throw new Error('[uCharts] unvalid series data!');
}
limit = limit || 10;
type = type ? type : 'upper';
var multiple = 1;
while (limit < 1) {
limit *= 10;
multiple *= 10;
}
if (type === 'upper') {
num = Math.ceil(num * multiple);
} else {
num = Math.floor(num * multiple);
}
while (num % limit !== 0) {
if (type === 'upper') {
num++;
} else {
num--;
}
}
return num / multiple;
}
function calCandleMA(dayArr, nameArr, colorArr, kdata) {
var seriesTemp = [];
for (var k = 0; k < dayArr.length; k++) {
var seriesItem = {
data: [],
name: nameArr[k],
color: colorArr[k]
};
for (var i = 0, len = kdata.length; i < len; i++) {
if (i < dayArr[k]) {
seriesItem.data.push(null);
continue;
}
var sum = 0;
for (var j = 0; j < dayArr[k]; j++) {
sum += kdata[i - j][1];
}
seriesItem.data.push(+(sum / dayArr[k]).toFixed(3));
}
seriesTemp.push(seriesItem);
}
return seriesTemp;
}
function calValidDistance(self, distance, chartData, config, opts) {
var dataChartAreaWidth = opts.width - opts.area[1] - opts.area[3];
var dataChartWidth = chartData.eachSpacing * (opts.chartData.xAxisData.xAxisPoints.length - 1);
var validDistance = distance;
if (distance >= 0) {
validDistance = 0;
self.event.trigger('scrollLeft');
} else if (Math.abs(distance) >= dataChartWidth - dataChartAreaWidth) {
validDistance = dataChartAreaWidth - dataChartWidth;
self.event.trigger('scrollRight');
}
return validDistance;
}
function isInAngleRange(angle, startAngle, endAngle) {
function adjust(angle) {
while (angle < 0) {
angle += 2 * Math.PI;
}
while (angle > 2 * Math.PI) {
angle -= 2 * Math.PI;
}
return angle;
}
angle = adjust(angle);
startAngle = adjust(startAngle);
endAngle = adjust(endAngle);
if (startAngle > endAngle) {
endAngle += 2 * Math.PI;
if (angle < startAngle) {
angle += 2 * Math.PI;
}
}
return angle >= startAngle && angle <= endAngle;
}
function calRotateTranslate(x, y, h) {
var xv = x;
var yv = h - y;
var transX = xv + (h - yv - xv) / Math.sqrt(2);
transX *= -1;
var transY = (h - yv) * (Math.sqrt(2) - 1) - (h - yv - xv) / Math.sqrt(2);
return {
transX: transX,
transY: transY
};
}
function createCurveControlPoints(points, i) {
function isNotMiddlePoint(points, i) {
if (points[i - 1] && points[i + 1]) {
return points[i].y >= Math.max(points[i - 1].y, points[i + 1].y) || points[i].y <= Math.min(points[i - 1].y, points[i + 1].y);
} else {
return false;
}
}
function isNotMiddlePointX(points, i) {
if (points[i - 1] && points[i + 1]) {
return points[i].x >= Math.max(points[i - 1].x, points[i + 1].x) || points[i].x <= Math.min(points[i - 1].x, points[i + 1].x);
} else {
return false;
}
}
var a = 0.2;
var b = 0.2;
var pAx = null;
var pAy = null;
var pBx = null;
var pBy = null;
if (i < 1) {
pAx = points[0].x + (points[1].x - points[0].x) * a;
pAy = points[0].y + (points[1].y - points[0].y) * a;
} else {
pAx = points[i].x + (points[i + 1].x - points[i - 1].x) * a;
pAy = points[i].y + (points[i + 1].y - points[i - 1].y) * a;
}
if (i > points.length - 3) {
var last = points.length - 1;
pBx = points[last].x - (points[last].x - points[last - 1].x) * b;
pBy = points[last].y - (points[last].y - points[last - 1].y) * b;
} else {
pBx = points[i + 1].x - (points[i + 2].x - points[i].x) * b;
pBy = points[i + 1].y - (points[i + 2].y - points[i].y) * b;
}
if (isNotMiddlePoint(points, i + 1)) {
pBy = points[i + 1].y;
}
if (isNotMiddlePoint(points, i)) {
pAy = points[i].y;
}
if (isNotMiddlePointX(points, i + 1)) {
pBx = points[i + 1].x;
}
if (isNotMiddlePointX(points, i)) {
pAx = points[i].x;
}
if (pAy >= Math.max(points[i].y, points[i + 1].y) || pAy <= Math.min(points[i].y, points[i + 1].y)) {
pAy = points[i].y;
}
if (pBy >= Math.max(points[i].y, points[i + 1].y) || pBy <= Math.min(points[i].y, points[i + 1].y)) {
pBy = points[i + 1].y;
}
if (pAx >= Math.max(points[i].x, points[i + 1].x) || pAx <= Math.min(points[i].x, points[i + 1].x)) {
pAx = points[i].x;
}
if (pBx >= Math.max(points[i].x, points[i + 1].x) || pBx <= Math.min(points[i].x, points[i + 1].x)) {
pBx = points[i + 1].x;
}
return {
ctrA: {
x: pAx,
y: pAy
},
ctrB: {
x: pBx,
y: pBy
}
};
}
function convertCoordinateOrigin(x, y, center) {
return {
x: center.x + x,
y: center.y - y
};
}
function avoidCollision(obj, target) {
if (target) {
// is collision test
while (util.isCollision(obj, target)) {
if (obj.start.x > 0) {
obj.start.y--;
} else if (obj.start.x < 0) {
obj.start.y++;
} else {
if (obj.start.y > 0) {
obj.start.y++;
} else {
obj.start.y--;
}
}
}
}
return obj;
}
function fillSeries(series, opts, config) {
var index = 0;
return series.map(function (item) {
if (!item.color) {
item.color = config.colors[index];
index = (index + 1) % config.colors.length;
}
if (!item.index) {
item.index = 0;
}
if (!item.type) {
item.type = opts.type;
}
if (typeof item.show == "undefined") {
item.show = true;
}
if (!item.type) {
item.type = opts.type;
}
if (!item.pointShape) {
item.pointShape = "circle";
}
if (!item.legendShape) {
switch (item.type) {
case 'line':
item.legendShape = "line";
break;
case 'column':
item.legendShape = "rect";
break;
case 'area':
item.legendShape = "triangle";
break;
default:
item.legendShape = "circle";
}
}
return item;
});
}
function getDataRange(minData, maxData) {
var limit = 0;
var range = maxData - minData;
if (range >= 10000) {
limit = 1000;
} else if (range >= 1000) {
limit = 100;
} else if (range >= 100) {
limit = 10;
} else if (range >= 10) {
limit = 5;
} else if (range >= 1) {
limit = 1;
} else if (range >= 0.1) {
limit = 0.1;
} else if (range >= 0.01) {
limit = 0.01;
} else if (range >= 0.001) {
limit = 0.001;
} else if (range >= 0.0001) {
limit = 0.0001;
} else if (range >= 0.00001) {
limit = 0.00001;
} else {
limit = 0.000001;
}
return {
minRange: findRange(minData, 'lower', limit),
maxRange: findRange(maxData, 'upper', limit)
};
}
function measureText(text) {
var fontSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : config.fontSize;
text = String(text);
var text = text.split('');
var width = 0;
for (var i = 0; i < text.length; i++) {
var item = text[i];
if (/[a-zA-Z]/.test(item)) {
width += 7;
} else if (/[0-9]/.test(item)) {
width += 5.5;
} else if (/\./.test(item)) {
width += 2.7;
} else if (/-/.test(item)) {
width += 3.25;
} else if (/[\u4e00-\u9fa5]/.test(item)) {
width += 10;
} else if (/\(|\)/.test(item)) {
width += 3.73;
} else if (/\s/.test(item)) {
width += 2.5;
} else if (/%/.test(item)) {
width += 8;
} else {
width += 10;
}
}
return width * fontSize / 10;
}
function dataCombine(series) {
return series.reduce(function (a, b) {
return (a.data ? a.data : a).concat(b.data);
}, []);
}
function dataCombineStack(series, len) {
var sum = new Array(len);
for (var j = 0; j < sum.length; j++) {
sum[j] = 0;
}
for (var i = 0; i < series.length; i++) {
for (var j = 0; j < sum.length; j++) {
sum[j] += series[i].data[j];
}
}
return series.reduce(function (a, b) {
return (a.data ? a.data : a).concat(b.data).concat(sum);
}, []);
}
function getTouches(touches, opts, e) {
var x, y;
if (touches.clientX) {
if (opts.rotate) {
y = opts.height - touches.clientX * opts.pixelRatio;
x = (touches.pageY - e.currentTarget.offsetTop - opts.height / opts.pixelRatio / 2 * (opts.pixelRatio - 1)) * opts.pixelRatio;
} else {
x = touches.clientX * opts.pixelRatio;
y = (touches.pageY - e.currentTarget.offsetTop - opts.height / opts.pixelRatio / 2 * (opts.pixelRatio - 1)) * opts.pixelRatio;
}
} else {
if (opts.rotate) {
y = opts.height - touches.x * opts.pixelRatio;
x = touches.y * opts.pixelRatio;
} else {
x = touches.x * opts.pixelRatio;
y = touches.y * opts.pixelRatio;
}
}
return {
x: x,
y: y
};
}
function getSeriesDataItem(series, index) {
var data = [];
for (var i = 0; i < series.length; i++) {
var item = series[i];
if (item.data[index] !== null && typeof item.data[index] !== 'undefined' && item.show) {
var seriesItem = {};
seriesItem.color = item.color;
seriesItem.type = item.type;
seriesItem.style = item.style;
seriesItem.pointShape = item.pointShape;
seriesItem.disableLegend = item.disableLegend;
seriesItem.name = item.name;
seriesItem.show = item.show;
seriesItem.data = item.format ? item.format(item.data[index]) : item.data[index];
data.push(seriesItem);
}
}
return data;
}
function getMaxTextListLength(list) {
var lengthList = list.map(function (item) {
return measureText(item);
});
return Math.max.apply(null, lengthList);
}
function getRadarCoordinateSeries(length) {
var eachAngle = 2 * Math.PI / length;
var CoordinateSeries = [];
for (var i = 0; i < length; i++) {
CoordinateSeries.push(eachAngle * i);
}
return CoordinateSeries.map(function (item) {
return -1 * item + Math.PI / 2;
});
}
function getToolTipData(seriesData, calPoints, index, categories) {
var option = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
var textList = seriesData.map(function (item) {
var titleText = [];
if (categories) {
titleText = categories;
} else {
titleText = item.data;
}
return {
text: option.format ? option.format(item, titleText[index]) : item.name + ': ' + item.data,
color: item.color
};
});
var validCalPoints = [];
var offset = {
x: 0,
y: 0
};
for (var i = 0; i < calPoints.length; i++) {
var points = calPoints[i];
if (typeof points[index] !== 'undefined' && points[index] !== null) {
validCalPoints.push(points[index]);
}
}
for (var _i = 0; _i < validCalPoints.length; _i++) {
var item = validCalPoints[_i];
offset.x = Math.round(item.x);
offset.y += item.y;
}
offset.y /= validCalPoints.length;
return {
textList: textList,
offset: offset
};
}
function getMixToolTipData(seriesData, calPoints, index, categories) {
var option = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
var textList = seriesData.map(function (item) {
return {
text: option.format ? option.format(item, categories[index]) : item.name + ': ' + item.data,
color: item.color,
disableLegend: item.disableLegend ? true : false
};
});
textList = textList.filter(function (item) {
if (item.disableLegend !== true) {
return item;
}
});
var validCalPoints = [];
var offset = {
x: 0,
y: 0
};
for (var i = 0; i < calPoints.length; i++) {
var points = calPoints[i];
if (typeof points[index] !== 'undefined' && points[index] !== null) {
validCalPoints.push(points[index]);
}
}
for (var _i2 = 0; _i2 < validCalPoints.length; _i2++) {
var item = validCalPoints[_i2];
offset.x = Math.round(item.x);
offset.y += item.y;
}
offset.y /= validCalPoints.length;
return {
textList: textList,
offset: offset
};
}
function getCandleToolTipData(series, seriesData, calPoints, index, categories, extra) {
var option = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
var upColor = extra.color.upFill;
var downColor = extra.color.downFill;
//颜色顺序为开盘,收盘,最低,最高
var color = [upColor, upColor, downColor, upColor];
var textList = [];
var text0 = {
text: categories[index],
color: null
};
textList.push(text0);
seriesData.map(function (item) {
if (index == 0) {
if (item.data[1] - item.data[0] < 0) {
color[1] = downColor;
} else {
color[1] = upColor;
}
} else {
if (item.data[0] < series[index - 1][1]) {
color[0] = downColor;
}
if (item.data[1] < item.data[0]) {
color[1] = downColor;
}
if (item.data[2] > series[index - 1][1]) {
color[2] = upColor;
}
if (item.data[3] < series[index - 1][1]) {
color[3] = downColor;
}
}
var text1 = {
text: '开盘:' + item.data[0],
color: color[0]
};
var text2 = {
text: '收盘:' + item.data[1],
color: color[1]
};
var text3 = {
text: '最低:' + item.data[2],
color: color[2]
};
var text4 = {
text: '最高:' + item.data[3],
color: color[3]
};
textList.push(text1, text2, text3, text4);
});
var validCalPoints = [];
var offset = {
x: 0,
y: 0
};
for (var i = 0; i < calPoints.length; i++) {
var points = calPoints[i];
if (typeof points[index] !== 'undefined' && points[index] !== null) {
validCalPoints.push(points[index]);
}
}
offset.x = Math.round(validCalPoints[0][0].x);
return {
textList: textList,
offset: offset
};
}
function filterSeries(series) {
var tempSeries = [];
for (var i = 0; i < series.length; i++) {
if (series[i].show == true) {
tempSeries.push(series[i]);
}
}
return tempSeries;
}
function findCurrentIndex(currentPoints, calPoints, opts, config) {
var offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
var currentIndex = -1;
var spacing = opts.chartData.eachSpacing / 2;
var xAxisPoints = [];
if (calPoints && calPoints.length > 0) {
for (var i = 1; i < opts.chartData.xAxisPoints.length; i++) {
xAxisPoints.push(opts.chartData.xAxisPoints[i] - spacing);
}
if ((opts.type == 'line' || opts.type == 'area') && opts.xAxis.boundaryGap == 'justify') {
spacing = opts.chartData.eachSpacing / 2;
}
if (!opts.categories) {
spacing = 0;
}
if (isInExactChartArea(currentPoints, opts, config)) {
xAxisPoints.forEach(function (item, index) {
if (currentPoints.x + offset + spacing > item) {
currentIndex = index;
}
});
}
}
return currentIndex;
}
function findLegendIndex(currentPoints, legendData, opts) {
var currentIndex = -1;
if (isInExactLegendArea(currentPoints, legendData.area)) {
var points = legendData.points;
var index = -1;
for (var i = 0, len = points.length; i < len; i++) {
var item = points[i];
for (var j = 0; j < item.length; j++) {
index += 1;
var area = item[j]['area'];
if (currentPoints.x > area[0] && currentPoints.x < area[2] && currentPoints.y > area[1] && currentPoints.y < area[3]) {
currentIndex = index;
break;
}
}
}
return currentIndex;
}
return currentIndex;
}
function isInExactLegendArea(currentPoints, area) {
return currentPoints.x > area.start.x && currentPoints.x < area.end.x && currentPoints.y > area.start.y && currentPoints.y < area.end.y;
}
function isInExactChartArea(currentPoints, opts, config) {
return currentPoints.x <= opts.width - opts.area[1] + 10 && currentPoints.x >= opts.area[3] - 10 && currentPoints.y >= opts.area[0] && currentPoints.y <= opts.height - opts.area[2];
}
function findRadarChartCurrentIndex(currentPoints, radarData, count) {
var eachAngleArea = 2 * Math.PI / count;
var currentIndex = -1;
if (isInExactPieChartArea(currentPoints, radarData.center, radarData.radius)) {
var fixAngle = function fixAngle(angle) {
if (angle < 0) {
angle += 2 * Math.PI;
}
if (angle > 2 * Math.PI) {
angle -= 2 * Math.PI;
}
return angle;
};
var angle = Math.atan2(radarData.center.y - currentPoints.y, currentPoints.x - radarData.center.x);
angle = -1 * angle;
if (angle < 0) {
angle += 2 * Math.PI;
}
var angleList = radarData.angleList.map(function (item) {
item = fixAngle(-1 * item);
return item;
});
angleList.forEach(function (item, index) {
var rangeStart = fixAngle(item - eachAngleArea / 2);
var rangeEnd = fixAngle(item + eachAngleArea / 2);
if (rangeEnd < rangeStart) {
rangeEnd += 2 * Math.PI;
}
if (angle >= rangeStart && angle <= rangeEnd || angle + 2 * Math.PI >= rangeStart && angle + 2 * Math.PI <= rangeEnd) {
currentIndex = index;
}
});
}
return currentIndex;
}
function findFunnelChartCurrentIndex(currentPoints, funnelData) {
var currentIndex = -1;
for (var i = 0, len = funnelData.series.length; i < len; i++) {
var item = funnelData.series[i];
if (currentPoints.x > item.funnelArea[0] && currentPoints.x < item.funnelArea[2] && currentPoints.y > item.funnelArea[1] && currentPoints.y < item.funnelArea[3]) {
currentIndex = i;
break;
}
}
return currentIndex;
}
function findWordChartCurrentIndex(currentPoints, wordData) {
var currentIndex = -1;
for (var i = 0, len = wordData.length; i < len; i++) {
var item = wordData[i];
if (currentPoints.x > item.area[0] && currentPoints.x < item.area[2] && currentPoints.y > item.area[1] && currentPoints.y < item.area[3]) {
currentIndex = i;
break;
}
}
return currentIndex;
}
function findMapChartCurrentIndex(currentPoints, opts) {
var currentIndex = -1;
var cData = opts.chartData.mapData;
var data = opts.series;
var tmp = pointToCoordinate(currentPoints.y, currentPoints.x, cData.bounds, cData.scale, cData.xoffset, cData.yoffset);
var poi = [tmp.x, tmp.y];
for (var i = 0, len = data.length; i < len; i++) {
var item = data[i].geometry.coordinates;
if (isPoiWithinPoly(poi, item)) {
currentIndex = i;
break;
}
}
return currentIndex;
}
function findPieChartCurrentIndex(currentPoints, pieData) {
var currentIndex = -1;
if (isInExactPieChartArea(currentPoints, pieData.center, pieData.radius)) {
var angle = Math.atan2(pieData.center.y - currentPoints.y, currentPoints.x - pieData.center.x);
angle = -angle;
for (var i = 0, len = pieData.series.length; i < len; i++) {
var item = pieData.series[i];
if (isInAngleRange(angle, item._start_, item._start_ + item._proportion_ * 2 * Math.PI)) {
currentIndex = i;
break;
}
}
}
return currentIndex;
}
function isInExactPieChartArea(currentPoints, center, radius) {
return Math.pow(currentPoints.x - center.x, 2) + Math.pow(currentPoints.y - center.y, 2) <= Math.pow(radius, 2);
}
function splitPoints(points) {
var newPoints = [];
var items = [];
points.forEach(function (item, index) {
if (item !== null) {
items.push(item);
} else {
if (items.length) {
newPoints.push(items);
}
items = [];
}
});
if (items.length) {
newPoints.push(items);
}
return newPoints;
}
function calLegendData(series, opts, config, chartData) {
var legendData = {
area: {
start: {
x: 0,
y: 0
},
end: {
x: 0,
y: 0
},
width: 0,
height: 0,
wholeWidth: 0,
wholeHeight: 0
},
points: [],
widthArr: [],
heightArr: []
};
if (opts.legend.show === false) {
chartData.legendData = legendData;
return legendData;
}
var padding = opts.legend.padding;
var margin = opts.legend.margin;
var fontSize = opts.legend.fontSize;
var shapeWidth = 15 * opts.pixelRatio;
var shapeRight = 5 * opts.pixelRatio;
var lineHeight = Math.max(opts.legend.lineHeight * opts.pixelRatio, fontSize);
if (opts.legend.position == 'top' || opts.legend.position == 'bottom') {
var legendList = [];
var widthCount = 0;
var widthCountArr = [];
var currentRow = [];
for (var i = 0; i < series.length; i++) {
var item = series[i];
var itemWidth = shapeWidth + shapeRight + measureText(item.name || 'undefined', fontSize) + opts.legend.itemGap;
if (widthCount + itemWidth > opts.width - opts.padding[1] - opts.padding[3]) {
legendList.push(currentRow);
widthCountArr.push(widthCount - opts.legend.itemGap);
widthCount = itemWidth;
currentRow = [item];
} else {
widthCount += itemWidth;
currentRow.push(item);
}
}
if (currentRow.length) {
legendList.push(currentRow);
widthCountArr.push(widthCount - opts.legend.itemGap);
legendData.widthArr = widthCountArr;
var legendWidth = Math.max.apply(null, widthCountArr);
switch (opts.legend.float) {
case 'left':
legendData.area.start.x = opts.padding[3];
legendData.area.end.x = opts.padding[3] + 2 * padding;
break;
case 'right':
legendData.area.start.x = opts.width - opts.padding[1] - legendWidth - 2 * padding;
legendData.area.end.x = opts.width - opts.padding[1];
break;
default:
legendData.area.start.x = (opts.width - legendWidth) / 2 - padding;
legendData.area.end.x = (opts.width + legendWidth) / 2 + padding;
}
legendData.area.width = legendWidth + 2 * padding;
legendData.area.wholeWidth = legendWidth + 2 * padding;
legendData.area.height = legendList.length * lineHeight + 2 * padding;
legendData.area.wholeHeight = legendList.length * lineHeight + 2 * padding + 2 * margin;
legendData.points = legendList;
}
} else {
var len = series.length;
var maxHeight = opts.height - opts.padding[0] - opts.padding[2] - 2 * margin - 2 * padding;
var maxLength = Math.min(Math.floor(maxHeight / lineHeight), len);
legendData.area.height = maxLength * lineHeight + padding * 2;
legendData.area.wholeHeight = maxLength * lineHeight + padding * 2;
switch (opts.legend.float) {
case 'top':
legendData.area.start.y = opts.padding[0] + margin;
legendData.area.end.y = opts.padding[0] + margin + legendData.area.height;
break;
case 'bottom':
legendData.area.start.y = opts.height - opts.padding[2] - margin - legendData.area.height;
legendData.area.end.y = opts.height - opts.padding[2] - margin;
break;
default:
legendData.area.start.y = (opts.height - legendData.area.height) / 2;
legendData.area.end.y = (opts.height + legendData.area.height) / 2;
}
var lineNum = len % maxLength === 0 ? len / maxLength : Math.floor(len / maxLength + 1);
var _currentRow = [];
for (var _i3 = 0; _i3 < lineNum; _i3++) {
var temp = series.slice(_i3 * maxLength, _i3 * maxLength + maxLength);
_currentRow.push(temp);
}
legendData.points = _currentRow;
if (_currentRow.length) {
for (var _i4 = 0; _i4 < _currentRow.length; _i4++) {
var _item = _currentRow[_i4];
var maxWidth = 0;
for (var j = 0; j < _item.length; j++) {
var _itemWidth = shapeWidth + shapeRight + measureText(_item[j].name || 'undefined', fontSize) + opts.legend.itemGap;
if (_itemWidth > maxWidth) {
maxWidth = _itemWidth;
}
}
legendData.widthArr.push(maxWidth);
legendData.heightArr.push(_item.length * lineHeight + padding * 2);
}
var _legendWidth = 0;
for (var _i5 = 0; _i5 < legendData.widthArr.length; _i5++) {
_legendWidth += legendData.widthArr[_i5];
}
legendData.area.width = _legendWidth - opts.legend.itemGap + 2 * padding;
legendData.area.wholeWidth = legendData.area.width + padding;
}
}
switch (opts.legend.position) {
case 'top':
legendData.area.start.y = opts.padding[0] + margin;
legendData.area.end.y = opts.padding[0] + margin + legendData.area.height;
break;
case 'bottom':
legendData.area.start.y = opts.height - opts.padding[2] - legendData.area.height - margin;
legendData.area.end.y = opts.height - opts.padding[2] - margin;
break;
case 'left':
legendData.area.start.x = opts.padding[3];
legendData.area.end.x = opts.padding[3] + legendData.area.width;
break;
case 'right':
legendData.area.start.x = opts.width - opts.padding[1] - legendData.area.width;
legendData.area.end.x = opts.width - opts.padding[1];
break;
}
chartData.legendData = legendData;
return legendData;
}
function calCategoriesData(categories, opts, config, eachSpacing) {
var result = {
angle: 0,
xAxisHeight: config.xAxisHeight
};
var categoriesTextLenth = categories.map(function (item) {
return measureText(item, opts.xAxis.fontSize || config.fontSize);
});
var maxTextLength = Math.max.apply(this, categoriesTextLenth);
if (opts.xAxis.rotateLabel == true && maxTextLength + 2 * config.xAxisTextPadding > eachSpacing) {
result.angle = 45 * Math.PI / 180;
result.xAxisHeight = 2 * config.xAxisTextPadding + maxTextLength * Math.sin(result.angle);
}
return result;
}
function getXAxisTextList(series, opts, config) {
var index = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : -1;
var data = dataCombine(series);
var sorted = [];
// remove null from data
data = data.filter(function (item) {
//return item !== null;
if (_typeof(item) === 'object' && item !== null) {
if (item.constructor.toString().indexOf('Array') > -1) {
return item !== null;
} else {
return item.value !== null;
}
} else {
return item !== null;
}
});
data.map(function (item) {
if (_typeof(item) === 'object') {
if (item.constructor.toString().indexOf('Array') > -1) {
if (opts.type == 'candle') {
item.map(function (subitem) {
sorted.push(subitem);
});
} else {
sorted.push(item[0]);
}
} else {
sorted.push(item.value);
}
} else {
sorted.push(item);
}
});
var minData = 0;
var maxData = 0;
if (sorted.length > 0) {
minData = Math.min.apply(this, sorted);
maxData = Math.max.apply(this, sorted);
}
//为了兼容v1.9.0之前的项目
if (index > -1) {
if (typeof opts.xAxis.data[index].min === 'number') {
minData = Math.min(opts.xAxis.data[index].min, minData);
}
if (typeof opts.xAxis.data[index].max === 'number') {
maxData = Math.max(opts.xAxis.data[index].max, maxData);
}
} else {
if (typeof opts.xAxis.min === 'number') {
minData = Math.min(opts.xAxis.min, minData);
}
if (typeof opts.xAxis.max === 'number') {
maxData = Math.max(opts.xAxis.max, maxData);
}
}
if (minData === maxData) {
var rangeSpan = maxData || 10;
maxData += rangeSpan;
}
//var dataRange = getDataRange(minData, maxData);
var minRange = minData;
var maxRange = maxData;
var range = [];
var eachRange = (maxRange - minRange) / opts.xAxis.splitNumber;
for (var i = 0; i <= opts.xAxis.splitNumber; i++) {
range.push(minRange + eachRange * i);
}
return range;
}
function calXAxisData(series, opts, config) {
var result = {
angle: 0,
xAxisHeight: config.xAxisHeight
};
result.ranges = getXAxisTextList(series, opts, config);
result.rangesFormat = result.ranges.map(function (item) {
item = opts.xAxis.format ? opts.xAxis.format(item) : util.toFixed(item, 2);
return item;
});
var xAxisScaleValues = result.ranges.map(function (item) {
// 如果刻度值是浮点数,则保留两位小数
item = util.toFixed(item, 2);
// 若有自定义格式则调用自定义的格式化函数
item = opts.xAxis.format ? opts.xAxis.format(Number(item)) : item;
return item;
});
result = Object.assign(result, getXAxisPoints(xAxisScaleValues, opts, config));
// 计算X轴刻度的属性譬如每个刻度的间隔,刻度的起始点\结束点以及总长
var eachSpacing = result.eachSpacing;
var textLength = xAxisScaleValues.map(function (item) {
return measureText(item);
});
// get max length of categories text
var maxTextLength = Math.max.apply(this, textLength);
// 如果刻度值文本内容过长,则将其逆时针旋转45°
if (maxTextLength + 2 * config.xAxisTextPadding > eachSpacing) {
result.angle = 45 * Math.PI / 180;
result.xAxisHeight = 2 * config.xAxisTextPadding + maxTextLength * Math.sin(result.angle);
}
if (opts.xAxis.disabled === true) {
result.xAxisHeight = 0;
}
return result;
}
function getRadarDataPoints(angleList, center, radius, series, opts) {
var process = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
var radarOption = opts.extra.radar || {};
radarOption.max = radarOption.max || 0;
var maxData = Math.max(radarOption.max, Math.max.apply(null, dataCombine(series)));
var data = [];
var _loop2 = function _loop2(i) {
var each = series[i];
var listItem = {};
listItem.color = each.color;
listItem.legendShape = each.legendShape;
listItem.pointShape = each.pointShape;
listItem.data = [];
each.data.forEach(function (item, index) {
var tmp = {};
tmp.angle = angleList[index];
tmp.proportion = item / maxData;
tmp.position = convertCoordinateOrigin(radius * tmp.proportion * process * Math.cos(tmp.angle), radius * tmp.proportion * process * Math.sin(tmp.angle), center);
listItem.data.push(tmp);
});
data.push(listItem);
};
for (var i = 0; i < series.length; i++) {
_loop2(i);
}
return data;
}
function getPieDataPoints(series, radius) {
var process = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
var count = 0;
var _start_ = 0;
for (var i = 0; i < series.length; i++) {
var item = series[i];
item.data = item.data === null ? 0 : item.data;
count += item.data;
}
for (var _i6 = 0; _i6 < series.length; _i6++) {
var _item2 = series[_i6];
_item2.data = _item2.data === null ? 0 : _item2.data;
if (count === 0) {
_item2._proportion_ = 1 / series.length * process;
} else {
_item2._proportion_ = _item2.data / count * process;
}
_item2._radius_ = radius;
}
for (var _i7 = 0; _i7 < series.length; _i7++) {
var _item3 = series[_i7];
_item3._start_ = _start_;
_start_ += 2 * _item3._proportion_ * Math.PI;
}
return series;
}
function getFunnelDataPoints(series, radius) {
var process = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
series = series.sort(function (a, b) {
return parseInt(b.data) - parseInt(a.data);
});
for (var i = 0; i < series.length; i++) {
series[i].radius = series[i].data / series[0].data * radius * process;
series[i]._proportion_ = series[i].data / series[0].data;
}
return series.reverse();
}
function getRoseDataPoints(series, type, minRadius, radius) {
var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
var count = 0;
var _start_ = 0;
var dataArr = [];
for (var i = 0; i < series.length; i++) {
var item = series[i];
item.data = item.data === null ? 0 : item.data;
count += item.data;
dataArr.push(item.data);
}
var minData = Math.min.apply(null, dataArr);
var maxData = Math.max.apply(null, dataArr);
var radiusLength = radius - minRadius;
for (var _i8 = 0; _i8 < series.length; _i8++) {
var _item4 = series[_i8];
_item4.data = _item4.data === null ? 0 : _item4.data;
if (count === 0 || type == 'area') {
_item4._proportion_ = _item4.data / count * process;
_item4._rose_proportion_ = 1 / series.length * process;
} else {
_item4._proportion_ = _item4.data / count * process;
_item4._rose_proportion_ = _item4.data / count * process;
}
_item4._radius_ = minRadius + radiusLength * ((_item4.data - minData) / (maxData - minData));
}
for (var _i9 = 0; _i9 < series.length; _i9++) {
var _item5 = series[_i9];
_item5._start_ = _start_;
_start_ += 2 * _item5._rose_proportion_ * Math.PI;
}
return series;
}
function getArcbarDataPoints(series, arcbarOption) {
var process = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
if (process == 1) {
process = 0.999999;
}
for (var i = 0; i < series.length; i++) {
var item = series[i];
item.data = item.data === null ? 0 : item.data;
var totalAngle = void 0;
if (arcbarOption.type == 'circle') {
totalAngle = 2;
} else {
if (arcbarOption.endAngle < arcbarOption.startAngle) {
totalAngle = 2 + arcbarOption.endAngle - arcbarOption.startAngle;
} else {
totalAngle = arcbarOption.startAngle - arcbarOption.endAngle;
}
}
item._proportion_ = totalAngle * item.data * process + arcbarOption.startAngle;
if (item._proportion_ >= 2) {
item._proportion_ = item._proportion_ % 2;
}
}
return series;
}
function getGaugeAxisPoints(categories, startAngle, endAngle) {
var totalAngle = startAngle - endAngle + 1;
var tempStartAngle = startAngle;
for (var i = 0; i < categories.length; i++) {
categories[i].value = categories[i].value === null ? 0 : categories[i].value;
categories[i]._startAngle_ = tempStartAngle;
categories[i]._endAngle_ = totalAngle * categories[i].value + startAngle;
if (categories[i]._endAngle_ >= 2) {
categories[i]._endAngle_ = categories[i]._endAngle_ % 2;
}
tempStartAngle = categories[i]._endAngle_;
}
return categories;
}
function getGaugeDataPoints(series, categories, gaugeOption) {
var process = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
for (var i = 0; i < series.length; i++) {
var item = series[i];
item.data = item.data === null ? 0 : item.data;
if (gaugeOption.pointer.color == 'auto') {
for (var _i10 = 0; _i10 < categories.length; _i10++) {
if (item.data <= categories[_i10].value) {
item.color = categories[_i10].color;
break;
}
}
} else {
item.color = gaugeOption.pointer.color;
}
var totalAngle = gaugeOption.startAngle - gaugeOption.endAngle + 1;
item._endAngle_ = totalAngle * item.data + gaugeOption.startAngle;
item._oldAngle_ = gaugeOption.oldAngle;
if (gaugeOption.oldAngle < gaugeOption.endAngle) {
item._oldAngle_ += 2;
}
if (item.data >= gaugeOption.oldData) {
item._proportion_ = (item._endAngle_ - item._oldAngle_) * process + gaugeOption.oldAngle;
} else {
item._proportion_ = item._oldAngle_ - (item._oldAngle_ - item._endAngle_) * process;
}
if (item._proportion_ >= 2) {
item._proportion_ = item._proportion_ % 2;
}
}
return series;
}
function getPieTextMaxLength(series) {
series = getPieDataPoints(series);
var maxLength = 0;
for (var i = 0; i < series.length; i++) {
var item = series[i];
var text = item.format ? item.format(+item._proportion_.toFixed(2)) : util.toFixed(item._proportion_ * 100) + '%';
maxLength = Math.max(maxLength, measureText(text));
}
return maxLength;
}
function fixColumeData(points, eachSpacing, columnLen, index, config, opts) {
return points.map(function (item) {
if (item === null) {
return null;
}
item.width = Math.ceil((eachSpacing - 2 * config.columePadding) / columnLen);
if (opts.extra.column && opts.extra.column.width && +opts.extra.column.width > 0) {
item.width = Math.min(item.width, +opts.extra.column.width);
}
if (item.width <= 0) {
item.width = 1;
}
item.x += (index + 0.5 - columnLen / 2) * item.width;
return item;
});
}
function fixColumeMeterData(points, eachSpacing, columnLen, index, config, opts, border) {
return points.map(function (item) {
if (item === null) {
return null;
}
item.width = Math.ceil((eachSpacing - 2 * config.columePadding) / 2);
if (opts.extra.column && opts.extra.column.width && +opts.extra.column.width > 0) {
item.width = Math.min(item.width, +opts.extra.column.width);
}
if (index > 0) {
item.width -= 2 * border;
}
return item;
});
}
function fixColumeStackData(points, eachSpacing, columnLen, index, config, opts, series) {
return points.map(function (item, indexn) {
if (item === null) {
return null;
}
item.width = Math.ceil((eachSpacing - 2 * config.columePadding) / 2);
if (opts.extra.column && opts.extra.column.width && +opts.extra.column.width > 0) {
item.width = Math.min(item.width, +opts.extra.column.width);
}
return item;
});
}
function getXAxisPoints(categories, opts, config) {
var spacingValid = opts.width - opts.area[1] - opts.area[3];
var dataCount = opts.enableScroll ? Math.min(opts.xAxis.itemCount, categories.length) : categories.length;
if ((opts.type == 'line' || opts.type == 'area') && dataCount > 1 && opts.xAxis.boundaryGap == 'justify') {
dataCount -= 1;
}
var eachSpacing = spacingValid / dataCount;
var xAxisPoints = [];
var startX = opts.area[3];
var endX = opts.width - opts.area[1];
categories.forEach(function (item, index) {
xAxisPoints.push(startX + index * eachSpacing);
});
if (opts.xAxis.boundaryGap !== 'justify') {
if (opts.enableScroll === true) {
xAxisPoints.push(startX + categories.length * eachSpacing);
} else {
xAxisPoints.push(endX);
}
}
return {
xAxisPoints: xAxisPoints,
startX: startX,
endX: endX,
eachSpacing: eachSpacing
};
}
function getCandleDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config) {
var process = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 1;
var points = [];
var validHeight = opts.height - opts.area[0] - opts.area[2];
data.forEach(function (item, index) {
if (item === null) {
points.push(null);
} else {
var cPoints = [];
item.forEach(function (items, indexs) {
var point = {};
point.x = xAxisPoints[index] + Math.round(eachSpacing / 2);
var value = items.value || items;
var height = validHeight * (value - minRange) / (maxRange - minRange);
height *= process;
point.y = opts.height - Math.round(height) - opts.area[2];
cPoints.push(point);
});
points.push(cPoints);
}
});
return points;
}
function getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config) {
var process = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 1;
var boundaryGap = 'center';
if (opts.type == 'line' || opts.type == 'area') {
boundaryGap = opts.xAxis.boundaryGap;
}
var points = [];
var validHeight = opts.height - opts.area[0] - opts.area[2];
var validWidth = opts.width - opts.area[1] - opts.area[3];
data.forEach(function (item, index) {
if (item === null) {
points.push(null);
} else {
var point = {};
point.color = item.color;
point.x = xAxisPoints[index];
var value = item;
if (_typeof(item) === 'object' && item !== null) {
if (item.constructor.toString().indexOf('Array') > -1) {
var xranges, xminRange, xmaxRange;
xranges = [].concat(opts.chartData.xAxisData.ranges);
xminRange = xranges.shift();
xmaxRange = xranges.pop();
value = item[1];
point.x = opts.area[3] + validWidth * (item[0] - xminRange) / (xmaxRange - xminRange);
} else {
value = item.value;
}
}
if (boundaryGap == 'center') {
point.x += Math.round(eachSpacing / 2);
}
var height = validHeight * (value - minRange) / (maxRange - minRange);
height *= process;
point.y = opts.height - Math.round(height) - opts.area[2];
points.push(point);
}
});
return points;
}
function getStackDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, seriesIndex, stackSeries) {
var process = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : 1;
var points = [];
var validHeight = opts.height - opts.area[0] - opts.area[2];
data.forEach(function (item, index) {
if (item === null) {
points.push(null);
} else {
var point = {};
point.color = item.color;
point.x = xAxisPoints[index] + Math.round(eachSpacing / 2);
if (seriesIndex > 0) {
var value = 0;
for (var i = 0; i <= seriesIndex; i++) {
value += stackSeries[i].data[index];
}
var value0 = value - item;
var height = validHeight * (value - minRange) / (maxRange - minRange);
var height0 = validHeight * (value0 - minRange) / (maxRange - minRange);
} else {
var value = item;
var height = validHeight * (value - minRange) / (maxRange - minRange);
var height0 = 0;
}
var heightc = height0;
height *= process;
heightc *= process;
point.y = opts.height - Math.round(height) - opts.area[2];
point.y0 = opts.height - Math.round(heightc) - opts.area[2];
points.push(point);
}
});
return points;
}
function getYAxisTextList(series, opts, config, stack) {
var index = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : -1;
var data;
if (stack == 'stack') {
data = dataCombineStack(series, opts.categories.length);
} else {
data = dataCombine(series);
}
var sorted = [];
// remove null from data
data = data.filter(function (item) {
//return item !== null;
if (_typeof(item) === 'object' && item !== null) {
if (item.constructor.toString().indexOf('Array') > -1) {
return item !== null;
} else {
return item.value !== null;
}
} else {
return item !== null;
}
});
data.map(function (item) {
if (_typeof(item) === 'object') {
if (item.constructor.toString().indexOf('Array') > -1) {
if (opts.type == 'candle') {
item.map(function (subitem) {
sorted.push(subitem);
});
} else {
sorted.push(item[1]);
}
} else {
sorted.push(item.value);
}
} else {
sorted.push(item);
}
});
var minData = 0;
var maxData = 0;
if (sorted.length > 0) {
minData = Math.min.apply(this, sorted);
maxData = Math.max.apply(this, sorted);
}
//为了兼容v1.9.0之前的项目
if (index > -1) {
if (typeof opts.yAxis.data[index].min === 'number') {
minData = Math.min(opts.yAxis.data[index].min, minData);
}
if (typeof opts.yAxis.data[index].max === 'number') {
maxData = Math.max(opts.yAxis.data[index].max, maxData);
}
} else {
if (typeof opts.yAxis.min === 'number') {
minData = Math.min(opts.yAxis.min, minData);
}
if (typeof opts.yAxis.max === 'number') {
maxData = Math.max(opts.yAxis.max, maxData);
}
}
if (minData === maxData) {
var rangeSpan = maxData || 10;
maxData += rangeSpan;
}
var dataRange = getDataRange(minData, maxData);
var minRange = dataRange.minRange;
var maxRange = dataRange.maxRange;
var range = [];
var eachRange = (maxRange - minRange) / opts.yAxis.splitNumber;
for (var i = 0; i <= opts.yAxis.splitNumber; i++) {
range.push(minRange + eachRange * i);
}
return range.reverse();
}
function calYAxisData(series, opts, config) {
//堆叠图重算Y轴
var columnstyle = assign({}, {
type: ""
}, opts.extra.column);
//如果是多Y轴,重新计算
var YLength = opts.yAxis.data.length;
var newSeries = new Array(YLength);
if (YLength > 0) {
for (var i = 0; i < YLength; i++) {
newSeries[i] = [];
for (var j = 0; j < series.length; j++) {
if (series[j].index == i) {
newSeries[i].push(series[j]);
}
}
}
var rangesArr = new Array(YLength);
var rangesFormatArr = new Array(YLength);
var yAxisWidthArr = new Array(YLength);
var _loop3 = function _loop3(_i11) {
var yData = opts.yAxis.data[_i11];
//如果总开关不显示,强制每个Y轴为不显示
if (opts.yAxis.disabled == true) {
yData.disabled = true;
}
rangesArr[_i11] = getYAxisTextList(newSeries[_i11], opts, config, columnstyle.type, _i11);
var yAxisFontSizes = yData.fontSize || config.fontSize;
yAxisWidthArr[_i11] = {
position: yData.position ? yData.position : 'left',
width: 0
};
rangesFormatArr[_i11] = rangesArr[_i11].map(function (items) {
items = util.toFixed(items, 6);
items = yData.format ? yData.format(Number(items)) : items;
yAxisWidthArr[_i11].width = Math.max(yAxisWidthArr[_i11].width, measureText(items, yAxisFontSizes) + 5);
return items;
});
var calibration = yData.calibration ? 4 * opts.pixelRatio : 0;
yAxisWidthArr[_i11].width += calibration + 3 * opts.pixelRatio;
if (yData.disabled === true) {
yAxisWidthArr[_i11].width = 0;
}
};
for (var _i11 = 0; _i11 < YLength; _i11++) {
_loop3(_i11);
}
} else {
var rangesArr = new Array(1);
var rangesFormatArr = new Array(1);
var yAxisWidthArr = new Array(1);
rangesArr[0] = getYAxisTextList(series, opts, config, columnstyle.type);
yAxisWidthArr[0] = {
position: 'left',
width: 0
};
var yAxisFontSize = opts.yAxis.fontSize || config.fontSize;
rangesFormatArr[0] = rangesArr[0].map(function (item) {
item = util.toFixed(item, 6);
item = opts.yAxis.format ? opts.yAxis.format(Number(item)) : item;
yAxisWidthArr[0].width = Math.max(yAxisWidthArr[0].width, measureText(item, yAxisFontSize) + 5);
return item;
});
yAxisWidthArr[0].width += 3 * opts.pixelRatio;
if (opts.yAxis.disabled === true) {
yAxisWidthArr[0] = {
position: 'left',
width: 0
};
opts.yAxis.data[0] = {
disabled: true
};
} else {
opts.yAxis.data[0] = {
disabled: false,
position: 'left',
max: opts.yAxis.max,
min: opts.yAxis.min,
format: opts.yAxis.format
};
}
}
return {
rangesFormat: rangesFormatArr,
ranges: rangesArr,
yAxisWidth: yAxisWidthArr
};
}
function calTooltipYAxisData(point, series, opts, config, eachSpacing) {
var ranges = [].concat(opts.chartData.yAxisData.ranges);
var spacingValid = opts.height - opts.area[0] - opts.area[2];
var minAxis = opts.area[0];
var items = [];
for (var i = 0; i < ranges.length; i++) {
var maxVal = ranges[i].shift();
var minVal = ranges[i].pop();
var item = maxVal - (maxVal - minVal) * (point - minAxis) / spacingValid;
item = opts.yAxis.data[i].format ? opts.yAxis.data[i].format(Number(item)) : item.toFixed(0);
items.push(String(item));
}
return items;
}
function calMarkLineData(points, opts) {
var minRange, maxRange;
var spacingValid = opts.height - opts.area[0] - opts.area[2];
for (var i = 0; i < points.length; i++) {
points[i].yAxisIndex = points[i].yAxisIndex ? points[i].yAxisIndex : 0;
var range = [].concat(opts.chartData.yAxisData.ranges[points[i].yAxisIndex]);
minRange = range.pop();
maxRange = range.shift();
var height = spacingValid * (points[i].value - minRange) / (maxRange - minRange);
points[i].y = opts.height - Math.round(height) - opts.area[2];
}
return points;
}
function contextRotate(context, opts) {
if (opts.rotateLock !== true) {
context.translate(opts.height, 0);
context.rotate(90 * Math.PI / 180);
} else if (opts._rotate_ !== true) {
context.translate(opts.height, 0);
context.rotate(90 * Math.PI / 180);
opts._rotate_ = true;
}
}
function drawPointShape(points, color, shape, context, opts) {
context.beginPath();
if (opts.dataPointShapeType == 'hollow') {
context.setStrokeStyle(color);
context.setFillStyle(opts.background);
context.setLineWidth(2 * opts.pixelRatio);
} else {
context.setStrokeStyle("#ffffff");
context.setFillStyle(color);
context.setLineWidth(1 * opts.pixelRatio);
}
if (shape === 'diamond') {
points.forEach(function (item, index) {
if (item !== null) {
context.moveTo(item.x, item.y - 4.5);
context.lineTo(item.x - 4.5, item.y);
context.lineTo(item.x, item.y + 4.5);
context.lineTo(item.x + 4.5, item.y);
context.lineTo(item.x, item.y - 4.5);
}
});
} else if (shape === 'circle') {
points.forEach(function (item, index) {
if (item !== null) {
context.moveTo(item.x + 2.5 * opts.pixelRatio, item.y);
context.arc(item.x, item.y, 3 * opts.pixelRatio, 0, 2 * Math.PI, false);
}
});
} else if (shape === 'rect') {
points.forEach(function (item, index) {
if (item !== null) {
context.moveTo(item.x - 3.5, item.y - 3.5);
context.rect(item.x - 3.5, item.y - 3.5, 7, 7);
}
});
} else if (shape === 'triangle') {
points.forEach(function (item, index) {
if (item !== null) {
context.moveTo(item.x, item.y - 4.5);
context.lineTo(item.x - 4.5, item.y + 4.5);
context.lineTo(item.x + 4.5, item.y + 4.5);
context.lineTo(item.x, item.y - 4.5);
}
});
}
context.closePath();
context.fill();
context.stroke();
}
function drawRingTitle(opts, config, context, center) {
var titlefontSize = opts.title.fontSize || config.titleFontSize;
var subtitlefontSize = opts.subtitle.fontSize || config.subtitleFontSize;
var title = opts.title.name || '';
var subtitle = opts.subtitle.name || '';
var titleFontColor = opts.title.color || config.titleColor;
var subtitleFontColor = opts.subtitle.color || config.subtitleColor;
var titleHeight = title ? titlefontSize : 0;
var subtitleHeight = subtitle ? subtitlefontSize : 0;
var margin = 5;
if (subtitle) {
var textWidth = measureText(subtitle, subtitlefontSize);
var startX = center.x - textWidth / 2 + (opts.subtitle.offsetX || 0);
var startY = center.y + subtitlefontSize / 2 + (opts.subtitle.offsetY || 0);
if (title) {
startY += (titleHeight + margin) / 2;
}
context.beginPath();
context.setFontSize(subtitlefontSize);
context.setFillStyle(subtitleFontColor);
context.fillText(subtitle, startX, startY);
context.closePath();
context.stroke();
}
if (title) {
var _textWidth = measureText(title, titlefontSize);
var _startX = center.x - _textWidth / 2 + (opts.title.offsetX || 0);
var _startY = center.y + titlefontSize / 2 + (opts.title.offsetY || 0);
if (subtitle) {
_startY -= (subtitleHeight + margin) / 2;
}
context.beginPath();
context.setFontSize(titlefontSize);
context.setFillStyle(titleFontColor);
context.fillText(title, _startX, _startY);
context.closePath();
context.stroke();
}
}
function drawPointText(points, series, config, context) {
// 绘制数据文案
var data = series.data;
points.forEach(function (item, index) {
if (item !== null) {
//var formatVal = series.format ? series.format(data[index]) : data[index];
context.beginPath();
context.setFontSize(series.textSize || config.fontSize);
context.setFillStyle(series.textColor || '#666666');
var value = data[index];
if (_typeof(data[index]) === 'object' && data[index] !== null) {
if (data[index].constructor == Array) {
value = data[index][1];
} else {
value = data[index].value;
}
}
var formatVal = series.format ? series.format(value) : value;
context.fillText(String(formatVal), item.x - measureText(formatVal, series.textSize || config.fontSize) / 2, item.y - 4);
context.closePath();
context.stroke();
}
});
}
function drawGaugeLabel(gaugeOption, radius, centerPosition, opts, config, context) {
radius -= gaugeOption.width / 2 + config.gaugeLabelTextMargin;
var totalAngle = gaugeOption.startAngle - gaugeOption.endAngle + 1;
var splitAngle = totalAngle / gaugeOption.splitLine.splitNumber;
var totalNumber = gaugeOption.endNumber - gaugeOption.startNumber;
var splitNumber = totalNumber / gaugeOption.splitLine.splitNumber;
var nowAngle = gaugeOption.startAngle;
var nowNumber = gaugeOption.startNumber;
for (var i = 0; i < gaugeOption.splitLine.splitNumber + 1; i++) {
var pos = {
x: radius * Math.cos(nowAngle * Math.PI),
y: radius * Math.sin(nowAngle * Math.PI)
};
var labelText = gaugeOption.labelFormat ? gaugeOption.labelFormat(nowNumber) : nowNumber;
pos.x += centerPosition.x - measureText(labelText) / 2;
pos.y += centerPosition.y;
var startX = pos.x;
var startY = pos.y;
context.beginPath();
context.setFontSize(config.fontSize);
context.setFillStyle(gaugeOption.labelColor || '#666666');
context.fillText(labelText, startX, startY + config.fontSize / 2);
context.closePath();
context.stroke();
nowAngle += splitAngle;
if (nowAngle >= 2) {
nowAngle = nowAngle % 2;
}
nowNumber += splitNumber;
}
}
function drawRadarLabel(angleList, radius, centerPosition, opts, config, context) {
var radarOption = opts.extra.radar || {};
radius += config.radarLabelTextMargin;
angleList.forEach(function (angle, index) {
var pos = {
x: radius * Math.cos(angle),
y: radius * Math.sin(angle)
};
var posRelativeCanvas = convertCoordinateOrigin(pos.x, pos.y, centerPosition);
var startX = posRelativeCanvas.x;
var startY = posRelativeCanvas.y;
if (util.approximatelyEqual(pos.x, 0)) {
startX -= measureText(opts.categories[index] || '') / 2;
} else if (pos.x < 0) {
startX -= measureText(opts.categories[index] || '');
}
context.beginPath();
context.setFontSize(config.fontSize);
context.setFillStyle(radarOption.labelColor || '#666666');
context.fillText(opts.categories[index] || '', startX, startY + config.fontSize / 2);
context.closePath();
context.stroke();
});
}
function drawPieText(series, opts, config, context, radius, center) {
var lineRadius = config.pieChartLinePadding;
var textObjectCollection = [];
var lastTextObject = null;
var seriesConvert = series.map(function (item) {
var text = item.format ? item.format(+item._proportion_.toFixed(2)) : util.toFixed(item._proportion_.toFixed(4) * 100) + '%';
if (item._rose_proportion_) item._proportion_ = item._rose_proportion_;
var arc = 2 * Math.PI - (item._start_ + 2 * Math.PI * item._proportion_ / 2);
var color = item.color;
var radius = item._radius_;
return {
arc: arc,
text: text,
color: color,
radius: radius,
textColor: item.textColor,
textSize: item.textSize
};
});
for (var i = 0; i < seriesConvert.length; i++) {
var item = seriesConvert[i];
// line end
var orginX1 = Math.cos(item.arc) * (item.radius + lineRadius);
var orginY1 = Math.sin(item.arc) * (item.radius + lineRadius);
// line start
var orginX2 = Math.cos(item.arc) * item.radius;
var orginY2 = Math.sin(item.arc) * item.radius;
// text start
var orginX3 = orginX1 >= 0 ? orginX1 + config.pieChartTextPadding : orginX1 - config.pieChartTextPadding;
var orginY3 = orginY1;
var textWidth = measureText(item.text, item.textSize || config.fontSize);
var startY = orginY3;
if (lastTextObject && util.isSameXCoordinateArea(lastTextObject.start, {
x: orginX3
})) {
if (orginX3 > 0) {
startY = Math.min(orginY3, lastTextObject.start.y);
} else if (orginX1 < 0) {
startY = Math.max(orginY3, lastTextObject.start.y);
} else {
if (orginY3 > 0) {
startY = Math.max(orginY3, lastTextObject.start.y);
} else {
startY = Math.min(orginY3, lastTextObject.start.y);
}
}
}
if (orginX3 < 0) {
orginX3 -= textWidth;
}
var textObject = {
lineStart: {
x: orginX2,
y: orginY2
},
lineEnd: {
x: orginX1,
y: orginY1
},
start: {
x: orginX3,
y: startY
},
width: textWidth,
height: config.fontSize,
text: item.text,
color: item.color,
textColor: item.textColor,
textSize: item.textSize
};
lastTextObject = avoidCollision(textObject, lastTextObject);
textObjectCollection.push(lastTextObject);
}
for (var _i12 = 0; _i12 < textObjectCollection.length; _i12++) {
var _item6 = textObjectCollection[_i12];
var lineStartPoistion = convertCoordinateOrigin(_item6.lineStart.x, _item6.lineStart.y, center);
var lineEndPoistion = convertCoordinateOrigin(_item6.lineEnd.x, _item6.lineEnd.y, center);
var textPosition = convertCoordinateOrigin(_item6.start.x, _item6.start.y, center);
context.setLineWidth(1 * opts.pixelRatio);
context.setFontSize(config.fontSize);
context.beginPath();
context.setStrokeStyle(_item6.color);
context.setFillStyle(_item6.color);
context.moveTo(lineStartPoistion.x, lineStartPoistion.y);
var curveStartX = _item6.start.x < 0 ? textPosition.x + _item6.width : textPosition.x;
var textStartX = _item6.start.x < 0 ? textPosition.x - 5 : textPosition.x + 5;
context.quadraticCurveTo(lineEndPoistion.x, lineEndPoistion.y, curveStartX, textPosition.y);
context.moveTo(lineStartPoistion.x, lineStartPoistion.y);
context.stroke();
context.closePath();
context.beginPath();
context.moveTo(textPosition.x + _item6.width, textPosition.y);
context.arc(curveStartX, textPosition.y, 2, 0, 2 * Math.PI);
context.closePath();
context.fill();
context.beginPath();
context.setFontSize(_item6.textSize || config.fontSize);
context.setFillStyle(_item6.textColor || '#666666');
context.fillText(_item6.text, textStartX, textPosition.y + 3);
context.closePath();
context.stroke();
context.closePath();
}
}
function drawToolTipSplitLine(offsetX, opts, config, context) {
var toolTipOption = opts.extra.tooltip || {};
toolTipOption.gridType = toolTipOption.gridType == undefined ? 'solid' : toolTipOption.gridType;
toolTipOption.dashLength = toolTipOption.dashLength == undefined ? 4 : toolTipOption.dashLength;
var startY = opts.area[0];
var endY = opts.height - opts.area[2];
if (toolTipOption.gridType == 'dash') {
context.setLineDash([toolTipOption.dashLength, toolTipOption.dashLength]);
}
context.setStrokeStyle(toolTipOption.gridColor || '#cccccc');
context.setLineWidth(1 * opts.pixelRatio);
context.beginPath();
context.moveTo(offsetX, startY);
context.lineTo(offsetX, endY);
context.stroke();
context.setLineDash([]);
if (toolTipOption.xAxisLabel) {
var labelText = opts.categories[opts.tooltip.index];
context.setFontSize(config.fontSize);
var textWidth = measureText(labelText, config.fontSize);
var textX = offsetX - 0.5 * textWidth;
var textY = endY;
context.beginPath();
context.setFillStyle(hexToRgb(toolTipOption.labelBgColor || config.toolTipBackground, toolTipOption.labelBgOpacity || config.toolTipOpacity));
context.setStrokeStyle(toolTipOption.labelBgColor || config.toolTipBackground);
context.setLineWidth(1 * opts.pixelRatio);
context.rect(textX - config.toolTipPadding, textY, textWidth + 2 * config.toolTipPadding, config.fontSize + 2 * config.toolTipPadding);
context.closePath();
context.stroke();
context.fill();
context.beginPath();
context.setFontSize(config.fontSize);
context.setFillStyle(toolTipOption.labelFontColor || config.fontColor);
context.fillText(String(labelText), textX, textY + config.toolTipPadding + config.fontSize);
context.closePath();
context.stroke();
}
}
function drawMarkLine(opts, config, context) {
var markLineOption = assign({}, {
type: 'solid',
dashLength: 4,
data: []
}, opts.extra.markLine);
var startX = opts.area[3];
var endX = opts.width - opts.area[1];
var points = calMarkLineData(markLineOption.data, opts);
for (var i = 0; i < points.length; i++) {
var item = assign({}, {
lineColor: '#DE4A42',
showLabel: false,
labelFontColor: '#666666',
labelBgColor: '#DFE8FF',
labelBgOpacity: 0.8,
yAxisIndex: 0
}, points[i]);
if (markLineOption.type == 'dash') {
context.setLineDash([markLineOption.dashLength, markLineOption.dashLength]);
}
context.setStrokeStyle(item.lineColor);
context.setLineWidth(1 * opts.pixelRatio);
context.beginPath();
context.moveTo(startX, item.y);
context.lineTo(endX, item.y);
context.stroke();
context.setLineDash([]);
if (item.showLabel) {
var labelText = opts.yAxis.format ? opts.yAxis.format(Number(item.value)) : item.value;
context.setFontSize(config.fontSize);
var textWidth = measureText(labelText, config.fontSize);
var bgStartX = opts.padding[3] + config.yAxisTitleWidth - config.toolTipPadding;
var bgEndX = Math.max(opts.area[3], textWidth + config.toolTipPadding * 2);
var bgWidth = bgEndX - bgStartX;
var textX = bgStartX + (bgWidth - textWidth) / 2;
var textY = item.y;
context.setFillStyle(hexToRgb(item.labelBgColor, item.labelBgOpacity));
context.setStrokeStyle(item.labelBgColor);
context.setLineWidth(1 * opts.pixelRatio);
context.beginPath();
context.rect(bgStartX, textY - 0.5 * config.fontSize - config.toolTipPadding, bgWidth, config.fontSize + 2 * config.toolTipPadding);
context.closePath();
context.stroke();
context.fill();
context.beginPath();
context.setFontSize(config.fontSize);
context.setFillStyle(item.labelFontColor);
context.fillText(String(labelText), textX, textY + 0.5 * config.fontSize);
context.stroke();
}
}
}
function drawToolTipHorizentalLine(opts, config, context, eachSpacing, xAxisPoints) {
var toolTipOption = assign({}, {
gridType: 'solid',
dashLength: 4
}, opts.extra.tooltip);
var startX = opts.area[3];
var endX = opts.width - opts.area[1];
if (toolTipOption.gridType == 'dash') {
context.setLineDash([toolTipOption.dashLength, toolTipOption.dashLength]);
}
context.setStrokeStyle(toolTipOption.gridColor || '#cccccc');
context.setLineWidth(1 * opts.pixelRatio);
context.beginPath();
context.moveTo(startX, opts.tooltip.offset.y);
context.lineTo(endX, opts.tooltip.offset.y);
context.stroke();
context.setLineDash([]);
if (toolTipOption.yAxisLabel) {
var labelText = calTooltipYAxisData(opts.tooltip.offset.y, opts.series, opts, config, eachSpacing);
var widthArr = opts.chartData.yAxisData.yAxisWidth;
var tStartLeft = opts.area[3];
var tStartRight = opts.width - opts.area[1];
for (var i = 0; i < labelText.length; i++) {
context.setFontSize(config.fontSize);
var textWidth = measureText(labelText[i], config.fontSize);
var bgStartX = void 0,
bgEndX = void 0,
bgWidth = void 0;
if (widthArr[i].position == 'left') {
bgStartX = tStartLeft - widthArr[i].width;
bgEndX = Math.max(bgStartX, bgStartX + textWidth + config.toolTipPadding * 2);
} else {
bgStartX = tStartRight;
bgEndX = Math.max(bgStartX + widthArr[i].width, bgStartX + textWidth + config.toolTipPadding * 2);
}
bgWidth = bgEndX - bgStartX;
var textX = bgStartX + (bgWidth - textWidth) / 2;
var textY = opts.tooltip.offset.y;
context.beginPath();
context.setFillStyle(hexToRgb(toolTipOption.labelBgColor || config.toolTipBackground, toolTipOption.labelBgOpacity || config.toolTipOpacity));
context.setStrokeStyle(toolTipOption.labelBgColor || config.toolTipBackground);
context.setLineWidth(1 * opts.pixelRatio);
context.rect(bgStartX, textY - 0.5 * config.fontSize - config.toolTipPadding, bgWidth, config.fontSize + 2 * config.toolTipPadding);
context.closePath();
context.stroke();
context.fill();
context.beginPath();
context.setFontSize(config.fontSize);
context.setFillStyle(toolTipOption.labelFontColor || config.fontColor);
context.fillText(labelText[i], textX, textY + 0.5 * config.fontSize);
context.closePath();
context.stroke();
if (widthArr[i].position == 'left') {
tStartLeft -= widthArr[i].width + opts.yAxis.padding;
} else {
tStartRight += widthArr[i].width + opts.yAxis.padding;
}
}
}
}
function drawToolTipSplitArea(offsetX, opts, config, context, eachSpacing) {
var toolTipOption = assign({}, {
activeBgColor: '#000000',
activeBgOpacity: 0.08
}, opts.extra.tooltip);
var startY = opts.area[0];
var endY = opts.height - opts.area[2];
context.beginPath();
context.setFillStyle(hexToRgb(toolTipOption.activeBgColor, toolTipOption.activeBgOpacity));
context.rect(offsetX - eachSpacing / 2, startY, eachSpacing, endY - startY);
context.closePath();
context.fill();
}
function drawToolTip(textList, offset, opts, config, context, eachSpacing, xAxisPoints) {
var toolTipOption = assign({}, {
showBox: true,
bgColor: '#000000',
bgOpacity: 0.7,
fontColor: '#FFFFFF'
}, opts.extra.tooltip);
var legendWidth = 4 * opts.pixelRatio;
var legendMarginRight = 5 * opts.pixelRatio;
var arrowWidth = 8 * opts.pixelRatio;
var isOverRightBorder = false;
if (opts.type == 'line' || opts.type == 'area' || opts.type == 'candle' || opts.type == 'mix') {
drawToolTipSplitLine(opts.tooltip.offset.x, opts, config, context);
}
offset = assign({
x: 0,
y: 0
}, offset);
offset.y -= 8 * opts.pixelRatio;
var textWidth = textList.map(function (item) {
return measureText(item.text, config.fontSize);
});
var toolTipWidth = legendWidth + legendMarginRight + 4 * config.toolTipPadding + Math.max.apply(null, textWidth);
var toolTipHeight = 2 * config.toolTipPadding + textList.length * config.toolTipLineHeight;
if (toolTipOption.showBox == false) {
return;
}
// if beyond the right border
if (offset.x - Math.abs(opts._scrollDistance_) + arrowWidth + toolTipWidth > opts.width) {
isOverRightBorder = true;
}
if (toolTipHeight + offset.y > opts.height) {
offset.y = opts.height - toolTipHeight;
}
// draw background rect
context.beginPath();
context.setFillStyle(hexToRgb(toolTipOption.bgColor || config.toolTipBackground, toolTipOption.bgOpacity || config.toolTipOpacity));
if (isOverRightBorder) {
context.moveTo(offset.x, offset.y + 10 * opts.pixelRatio);
context.lineTo(offset.x - arrowWidth, offset.y + 10 * opts.pixelRatio - 5 * opts.pixelRatio);
context.lineTo(offset.x - arrowWidth, offset.y);
context.lineTo(offset.x - arrowWidth - Math.round(toolTipWidth), offset.y);
context.lineTo(offset.x - arrowWidth - Math.round(toolTipWidth), offset.y + toolTipHeight);
context.lineTo(offset.x - arrowWidth, offset.y + toolTipHeight);
context.lineTo(offset.x - arrowWidth, offset.y + 10 * opts.pixelRatio + 5 * opts.pixelRatio);
context.lineTo(offset.x, offset.y + 10 * opts.pixelRatio);
} else {
context.moveTo(offset.x, offset.y + 10 * opts.pixelRatio);
context.lineTo(offset.x + arrowWidth, offset.y + 10 * opts.pixelRatio - 5 * opts.pixelRatio);
context.lineTo(offset.x + arrowWidth, offset.y);
context.lineTo(offset.x + arrowWidth + Math.round(toolTipWidth), offset.y);
context.lineTo(offset.x + arrowWidth + Math.round(toolTipWidth), offset.y + toolTipHeight);
context.lineTo(offset.x + arrowWidth, offset.y + toolTipHeight);
context.lineTo(offset.x + arrowWidth, offset.y + 10 * opts.pixelRatio + 5 * opts.pixelRatio);
context.lineTo(offset.x, offset.y + 10 * opts.pixelRatio);
}
context.closePath();
context.fill();
// draw legend
textList.forEach(function (item, index) {
if (item.color !== null) {
context.beginPath();
context.setFillStyle(item.color);
var startX = offset.x + arrowWidth + 2 * config.toolTipPadding;
var startY = offset.y + (config.toolTipLineHeight - config.fontSize) / 2 + config.toolTipLineHeight * index + config.toolTipPadding + 1;
if (isOverRightBorder) {
startX = offset.x - toolTipWidth - arrowWidth + 2 * config.toolTipPadding;
}
context.fillRect(startX, startY, legendWidth, config.fontSize);
context.closePath();
}
});
// draw text list
textList.forEach(function (item, index) {
var startX = offset.x + arrowWidth + 2 * config.toolTipPadding + legendWidth + legendMarginRight;
if (isOverRightBorder) {
startX = offset.x - toolTipWidth - arrowWidth + 2 * config.toolTipPadding + +legendWidth + legendMarginRight;
}
var startY = offset.y + (config.toolTipLineHeight - config.fontSize) / 2 + config.toolTipLineHeight * index + config.toolTipPadding;
context.beginPath();
context.setFontSize(config.fontSize);
context.setFillStyle(toolTipOption.fontColor);
context.fillText(item.text, startX, startY + config.fontSize);
context.closePath();
context.stroke();
});
}
function drawYAxisTitle(title, opts, config, context) {
var startX = config.xAxisHeight + (opts.height - config.xAxisHeight - measureText(title)) / 2;
context.save();
context.beginPath();
context.setFontSize(config.fontSize);
context.setFillStyle(opts.yAxis.titleFontColor || '#333333');
context.translate(0, opts.height);
context.rotate(-90 * Math.PI / 180);
context.fillText(title, startX, opts.padding[3] + 0.5 * config.fontSize);
context.closePath();
context.stroke();
context.restore();
}
function drawColumnDataPoints(series, opts, config, context) {
var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
var xAxisData = opts.chartData.xAxisData,
xAxisPoints = xAxisData.xAxisPoints,
eachSpacing = xAxisData.eachSpacing;
var columnOption = assign({}, {
type: 'group',
width: eachSpacing / 2,
meter: {
border: 4,
fillColor: '#FFFFFF'
}
}, opts.extra.column);
var calPoints = [];
context.save();
var leftNum = -2;
var rightNum = xAxisPoints.length + 2;
if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) {
context.translate(opts._scrollDistance_, 0);
leftNum = Math.floor(-opts._scrollDistance_ / eachSpacing) - 2;
rightNum = leftNum + opts.xAxis.itemCount + 4;
}
if (opts.tooltip && opts.tooltip.textList && opts.tooltip.textList.length && process === 1) {
drawToolTipSplitArea(opts.tooltip.offset.x, opts, config, context, eachSpacing);
}
series.forEach(function (eachSeries, seriesIndex) {
var ranges, minRange, maxRange;
ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
minRange = ranges.pop();
maxRange = ranges.shift();
var data = eachSeries.data;
switch (columnOption.type) {
case 'group':
var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
var tooltipPoints = getStackDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, seriesIndex, series, process);
calPoints.push(tooltipPoints);
points = fixColumeData(points, eachSpacing, series.length, seriesIndex, config, opts);
for (var i = 0; i < points.length; i++) {
var item = points[i];
if (item !== null && i > leftNum && i < rightNum) {
context.beginPath();
context.setStrokeStyle(item.color || eachSeries.color);
context.setLineWidth(1);
context.setFillStyle(item.color || eachSeries.color);
var startX = item.x - item.width / 2;
var height = opts.height - item.y - opts.area[2];
context.moveTo(startX, item.y);
context.lineTo(startX + item.width - 2, item.y);
context.lineTo(startX + item.width - 2, opts.height - opts.area[2]);
context.lineTo(startX, opts.height - opts.area[2]);
context.lineTo(startX, item.y);
context.closePath();
context.stroke();
context.fill();
}
}
;
break;
case 'stack':
// 绘制堆叠数据图
var points = getStackDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, seriesIndex, series, process);
calPoints.push(points);
points = fixColumeStackData(points, eachSpacing, series.length, seriesIndex, config, opts, series);
for (var _i13 = 0; _i13 < points.length; _i13++) {
var _item7 = points[_i13];
if (_item7 !== null && _i13 > leftNum && _i13 < rightNum) {
context.beginPath();
context.setFillStyle(_item7.color || eachSeries.color);
var startX = _item7.x - _item7.width / 2 + 1;
var height = opts.height - _item7.y - opts.area[2];
var height0 = opts.height - _item7.y0 - opts.area[2];
if (seriesIndex > 0) {
height -= height0;
}
context.moveTo(startX, _item7.y);
context.fillRect(startX, _item7.y, _item7.width - 2, height);
context.closePath();
context.fill();
}
}
;
break;
case 'meter':
// 绘制温度计数据图
var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
calPoints.push(points);
points = fixColumeMeterData(points, eachSpacing, series.length, seriesIndex, config, opts, columnOption.meter.border);
if (seriesIndex == 0) {
for (var _i14 = 0; _i14 < points.length; _i14++) {
var _item8 = points[_i14];
if (_item8 !== null && _i14 > leftNum && _i14 < rightNum) {
//画背景颜色
context.beginPath();
context.setFillStyle(columnOption.meter.fillColor);
var startX = _item8.x - _item8.width / 2;
var height = opts.height - _item8.y - opts.area[2];
context.moveTo(startX, _item8.y);
context.fillRect(startX, _item8.y, _item8.width, height);
context.closePath();
context.fill();
//画边框线
if (columnOption.meter.border > 0) {
context.beginPath();
context.setStrokeStyle(eachSeries.color);
context.setLineWidth(columnOption.meter.border * opts.pixelRatio);
context.moveTo(startX + columnOption.meter.border * 0.5, _item8.y + height);
context.lineTo(startX + columnOption.meter.border * 0.5, _item8.y + columnOption.meter.border * 0.5);
context.lineTo(startX + _item8.width - columnOption.meter.border * 0.5, _item8.y + columnOption.meter.border * 0.5);
context.lineTo(startX + _item8.width - columnOption.meter.border * 0.5, _item8.y + height);
context.stroke();
}
}
}
;
} else {
for (var _i15 = 0; _i15 < points.length; _i15++) {
var _item9 = points[_i15];
if (_item9 !== null && _i15 > leftNum && _i15 < rightNum) {
context.beginPath();
context.setFillStyle(_item9.color || eachSeries.color);
var startX = _item9.x - _item9.width / 2;
var height = opts.height - _item9.y - opts.area[2];
context.moveTo(startX, _item9.y);
context.fillRect(startX, _item9.y, _item9.width, height);
context.closePath();
context.fill();
}
}
;
}
break;
}
});
if (opts.dataLabel !== false && process === 1) {
series.forEach(function (eachSeries, seriesIndex) {
var ranges, minRange, maxRange;
ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
minRange = ranges.pop();
maxRange = ranges.shift();
var data = eachSeries.data;
switch (columnOption.type) {
case 'group':
var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
points = fixColumeData(points, eachSpacing, series.length, seriesIndex, config, opts);
drawPointText(points, eachSeries, config, context);
break;
case 'stack':
var points = getStackDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, seriesIndex, series, process);
drawPointText(points, eachSeries, config, context);
break;
case 'meter':
var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
drawPointText(points, eachSeries, config, context);
break;
}
});
}
context.restore();
return {
xAxisPoints: xAxisPoints,
calPoints: calPoints,
eachSpacing: eachSpacing
};
}
function drawCandleDataPoints(series, seriesMA, opts, config, context) {
var process = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
var candleOption = assign({}, {
color: {},
average: {}
}, opts.extra.candle);
candleOption.color = assign({}, {
upLine: '#f04864',
upFill: '#f04864',
downLine: '#2fc25b',
downFill: '#2fc25b'
}, candleOption.color);
candleOption.average = assign({}, {
show: false,
name: [],
day: [],
color: config.colors
}, candleOption.average);
opts.extra.candle = candleOption;
var xAxisData = opts.chartData.xAxisData,
xAxisPoints = xAxisData.xAxisPoints,
eachSpacing = xAxisData.eachSpacing;
var calPoints = [];
context.save();
var leftNum = -2;
var rightNum = xAxisPoints.length + 2;
var leftSpace = 0;
var rightSpace = opts.width + eachSpacing;
if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) {
context.translate(opts._scrollDistance_, 0);
leftNum = Math.floor(-opts._scrollDistance_ / eachSpacing) - 2;
rightNum = leftNum + opts.xAxis.itemCount + 4;
leftSpace = -opts._scrollDistance_ - eachSpacing + opts.area[3];
rightSpace = leftSpace + (opts.xAxis.itemCount + 4) * eachSpacing;
}
//画均线
if (candleOption.average.show || seriesMA) {
//Merge pull request !12 from 邱贵翔
seriesMA.forEach(function (eachSeries, seriesIndex) {
var ranges, minRange, maxRange;
ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
minRange = ranges.pop();
maxRange = ranges.shift();
var data = eachSeries.data;
var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
var splitPointList = splitPoints(points);
for (var i = 0; i < splitPointList.length; i++) {
var _points = splitPointList[i];
context.beginPath();
context.setStrokeStyle(eachSeries.color);
context.setLineWidth(1);
if (_points.length === 1) {
context.moveTo(_points[0].x, _points[0].y);
context.arc(_points[0].x, _points[0].y, 1, 0, 2 * Math.PI);
} else {
context.moveTo(_points[0].x, _points[0].y);
var startPoint = 0;
for (var j = 0; j < _points.length; j++) {
var item = _points[j];
if (startPoint == 0 && item.x > leftSpace) {
context.moveTo(item.x, item.y);
startPoint = 1;
}
if (j > 0 && item.x > leftSpace && item.x < rightSpace) {
var ctrlPoint = createCurveControlPoints(_points, j - 1);
context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y, item.x, item.y);
}
}
context.moveTo(_points[0].x, _points[0].y);
}
context.closePath();
context.stroke();
}
});
}
//画K线
series.forEach(function (eachSeries, seriesIndex) {
var ranges, minRange, maxRange;
ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
minRange = ranges.pop();
maxRange = ranges.shift();
var data = eachSeries.data;
var points = getCandleDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
calPoints.push(points);
var splitPointList = splitPoints(points);
for (var i = 0; i < splitPointList[0].length; i++) {
if (i > leftNum && i < rightNum) {
var item = splitPointList[0][i];
context.beginPath();
//如果上涨
if (data[i][1] - data[i][0] > 0) {
context.setStrokeStyle(candleOption.color.upLine);
context.setFillStyle(candleOption.color.upFill);
context.setLineWidth(1 * opts.pixelRatio);
context.moveTo(item[3].x, item[3].y); //顶点
context.lineTo(item[1].x, item[1].y); //收盘中间点
context.lineTo(item[1].x - eachSpacing / 4, item[1].y); //收盘左侧点
context.lineTo(item[0].x - eachSpacing / 4, item[0].y); //开盘左侧点
context.lineTo(item[0].x, item[0].y); //开盘中间点
context.lineTo(item[2].x, item[2].y); //底点
context.lineTo(item[0].x, item[0].y); //开盘中间点
context.lineTo(item[0].x + eachSpacing / 4, item[0].y); //开盘右侧点
context.lineTo(item[1].x + eachSpacing / 4, item[1].y); //收盘右侧点
context.lineTo(item[1].x, item[1].y); //收盘中间点
context.moveTo(item[3].x, item[3].y); //顶点
} else {
context.setStrokeStyle(candleOption.color.downLine);
context.setFillStyle(candleOption.color.downFill);
context.setLineWidth(1 * opts.pixelRatio);
context.moveTo(item[3].x, item[3].y); //顶点
context.lineTo(item[0].x, item[0].y); //开盘中间点
context.lineTo(item[0].x - eachSpacing / 4, item[0].y); //开盘左侧点
context.lineTo(item[1].x - eachSpacing / 4, item[1].y); //收盘左侧点
context.lineTo(item[1].x, item[1].y); //收盘中间点
context.lineTo(item[2].x, item[2].y); //底点
context.lineTo(item[1].x, item[1].y); //收盘中间点
context.lineTo(item[1].x + eachSpacing / 4, item[1].y); //收盘右侧点
context.lineTo(item[0].x + eachSpacing / 4, item[0].y); //开盘右侧点
context.lineTo(item[0].x, item[0].y); //开盘中间点
context.moveTo(item[3].x, item[3].y); //顶点
}
context.closePath();
context.fill();
context.stroke();
}
}
});
context.restore();
return {
xAxisPoints: xAxisPoints,
calPoints: calPoints,
eachSpacing: eachSpacing
};
}
function drawAreaDataPoints(series, opts, config, context) {
var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
var areaOption = assign({}, {
type: 'straight',
opacity: 0.2,
addLine: false,
width: 2,
gradient: false
}, opts.extra.area);
var xAxisData = opts.chartData.xAxisData,
xAxisPoints = xAxisData.xAxisPoints,
eachSpacing = xAxisData.eachSpacing;
var endY = opts.height - opts.area[2];
var calPoints = [];
context.save();
var leftSpace = 0;
var rightSpace = opts.width + eachSpacing;
if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) {
context.translate(opts._scrollDistance_, 0);
leftSpace = -opts._scrollDistance_ - eachSpacing + opts.area[3];
rightSpace = leftSpace + (opts.xAxis.itemCount + 4) * eachSpacing;
}
series.forEach(function (eachSeries, seriesIndex) {
var ranges, minRange, maxRange;
ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
minRange = ranges.pop();
maxRange = ranges.shift();
var data = eachSeries.data;
var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
calPoints.push(points);
var splitPointList = splitPoints(points);
for (var i = 0; i < splitPointList.length; i++) {
var _points2 = splitPointList[i];
// 绘制区域数
context.beginPath();
context.setStrokeStyle(hexToRgb(eachSeries.color, areaOption.opacity));
if (areaOption.gradient) {
var gradient = context.createLinearGradient(0, opts.area[0], 0, opts.height - opts.area[2]);
gradient.addColorStop('0', hexToRgb(eachSeries.color, areaOption.opacity));
gradient.addColorStop('1.0', hexToRgb("#FFFFFF", 0.1));
context.setFillStyle(gradient);
} else {
context.setFillStyle(hexToRgb(eachSeries.color, areaOption.opacity));
}
context.setLineWidth(areaOption.width * opts.pixelRatio);
if (_points2.length > 1) {
var firstPoint = _points2[0];
var lastPoint = _points2[_points2.length - 1];
context.moveTo(firstPoint.x, firstPoint.y);
var startPoint = 0;
if (areaOption.type === 'curve') {
for (var j = 0; j < _points2.length; j++) {
var item = _points2[j];
if (startPoint == 0 && item.x > leftSpace) {
context.moveTo(item.x, item.y);
startPoint = 1;
}
if (j > 0 && item.x > leftSpace && item.x < rightSpace) {
var ctrlPoint = createCurveControlPoints(_points2, j - 1);
context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y, item.x, item.y);
}
}
;
} else {
for (var _j = 0; _j < _points2.length; _j++) {
var _item10 = _points2[_j];
if (startPoint == 0 && _item10.x > leftSpace) {
context.moveTo(_item10.x, _item10.y);
startPoint = 1;
}
if (_j > 0 && _item10.x > leftSpace && _item10.x < rightSpace) {
context.lineTo(_item10.x, _item10.y);
}
}
;
}
context.lineTo(lastPoint.x, endY);
context.lineTo(firstPoint.x, endY);
context.lineTo(firstPoint.x, firstPoint.y);
} else {
var _item11 = _points2[0];
context.moveTo(_item11.x - eachSpacing / 2, _item11.y);
context.lineTo(_item11.x + eachSpacing / 2, _item11.y);
context.lineTo(_item11.x + eachSpacing / 2, endY);
context.lineTo(_item11.x - eachSpacing / 2, endY);
context.moveTo(_item11.x - eachSpacing / 2, _item11.y);
}
context.closePath();
context.fill();
//画连线
if (areaOption.addLine) {
if (eachSeries.lineType == 'dash') {
var dashLength = eachSeries.dashLength ? eachSeries.dashLength : 8;
dashLength *= opts.pixelRatio;
context.setLineDash([dashLength, dashLength]);
}
context.beginPath();
context.setStrokeStyle(eachSeries.color);
context.setLineWidth(areaOption.width * opts.pixelRatio);
if (_points2.length === 1) {
context.moveTo(_points2[0].x, _points2[0].y);
context.arc(_points2[0].x, _points2[0].y, 1, 0, 2 * Math.PI);
} else {
context.moveTo(_points2[0].x, _points2[0].y);
var _startPoint = 0;
if (areaOption.type === 'curve') {
for (var _j2 = 0; _j2 < _points2.length; _j2++) {
var _item12 = _points2[_j2];
if (_startPoint == 0 && _item12.x > leftSpace) {
context.moveTo(_item12.x, _item12.y);
_startPoint = 1;
}
if (_j2 > 0 && _item12.x > leftSpace && _item12.x < rightSpace) {
var _ctrlPoint = createCurveControlPoints(_points2, _j2 - 1);
context.bezierCurveTo(_ctrlPoint.ctrA.x, _ctrlPoint.ctrA.y, _ctrlPoint.ctrB.x, _ctrlPoint.ctrB.y, _item12.x, _item12.y);
}
}
;
} else {
for (var _j3 = 0; _j3 < _points2.length; _j3++) {
var _item13 = _points2[_j3];
if (_startPoint == 0 && _item13.x > leftSpace) {
context.moveTo(_item13.x, _item13.y);
_startPoint = 1;
}
if (_j3 > 0 && _item13.x > leftSpace && _item13.x < rightSpace) {
context.lineTo(_item13.x, _item13.y);
}
}
;
}
context.moveTo(_points2[0].x, _points2[0].y);
}
context.stroke();
context.setLineDash([]);
}
}
//画点
if (opts.dataPointShape !== false) {
drawPointShape(points, eachSeries.color, eachSeries.pointShape, context, opts);
}
});
if (opts.dataLabel !== false && process === 1) {
series.forEach(function (eachSeries, seriesIndex) {
var ranges, minRange, maxRange;
ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
minRange = ranges.pop();
maxRange = ranges.shift();
var data = eachSeries.data;
var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
drawPointText(points, eachSeries, config, context);
});
}
context.restore();
return {
xAxisPoints: xAxisPoints,
calPoints: calPoints,
eachSpacing: eachSpacing
};
}
function drawLineDataPoints(series, opts, config, context) {
var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
var lineOption = assign({}, {
type: 'straight',
width: 2
}, opts.extra.line);
lineOption.width *= opts.pixelRatio;
var xAxisData = opts.chartData.xAxisData,
xAxisPoints = xAxisData.xAxisPoints,
eachSpacing = xAxisData.eachSpacing;
var calPoints = [];
context.save();
var leftSpace = 0;
var rightSpace = opts.width + eachSpacing;
if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) {
context.translate(opts._scrollDistance_, 0);
leftSpace = -opts._scrollDistance_ - eachSpacing + opts.area[3];
rightSpace = leftSpace + (opts.xAxis.itemCount + 4) * eachSpacing;
}
series.forEach(function (eachSeries, seriesIndex) {
var ranges, minRange, maxRange;
ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
minRange = ranges.pop();
maxRange = ranges.shift();
var data = eachSeries.data;
var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
calPoints.push(points);
var splitPointList = splitPoints(points);
if (eachSeries.lineType == 'dash') {
var dashLength = eachSeries.dashLength ? eachSeries.dashLength : 8;
dashLength *= opts.pixelRatio;
context.setLineDash([dashLength, dashLength]);
}
context.beginPath();
context.setStrokeStyle(eachSeries.color);
context.setLineWidth(lineOption.width);
splitPointList.forEach(function (points, index) {
if (points.length === 1) {
context.moveTo(points[0].x, points[0].y);
context.arc(points[0].x, points[0].y, 1, 0, 2 * Math.PI);
} else {
context.moveTo(points[0].x, points[0].y);
var startPoint = 0;
if (lineOption.type === 'curve') {
for (var j = 0; j < points.length; j++) {
var item = points[j];
if (startPoint == 0 && item.x > leftSpace) {
context.moveTo(item.x, item.y);
startPoint = 1;
}
if (j > 0 && item.x > leftSpace && item.x < rightSpace) {
var ctrlPoint = createCurveControlPoints(points, j - 1);
context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y, item.x, item.y);
}
}
;
}
if (lineOption.type === 'straight') {
for (var _j4 = 0; _j4 < points.length; _j4++) {
var _item14 = points[_j4];
if (startPoint == 0 && _item14.x > leftSpace) {
context.moveTo(_item14.x, _item14.y);
startPoint = 1;
}
if (_j4 > 0 && _item14.x > leftSpace && _item14.x < rightSpace) {
context.lineTo(_item14.x, _item14.y);
}
}
;
}
if (lineOption.type === 'step') {
for (var _j5 = 0; _j5 < points.length; _j5++) {
var _item15 = points[_j5];
if (startPoint == 0 && _item15.x > leftSpace) {
context.moveTo(_item15.x, _item15.y);
startPoint = 1;
}
if (_j5 > 0 && _item15.x > leftSpace && _item15.x < rightSpace) {
context.lineTo(_item15.x, points[_j5 - 1].y);
context.lineTo(_item15.x, _item15.y);
}
}
;
}
context.moveTo(points[0].x, points[0].y);
}
});
context.stroke();
context.setLineDash([]);
if (opts.dataPointShape !== false) {
drawPointShape(points, eachSeries.color, eachSeries.pointShape, context, opts);
}
});
if (opts.dataLabel !== false && process === 1) {
series.forEach(function (eachSeries, seriesIndex) {
var ranges, minRange, maxRange;
ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
minRange = ranges.pop();
maxRange = ranges.shift();
var data = eachSeries.data;
var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
drawPointText(points, eachSeries, config, context);
});
}
context.restore();
return {
xAxisPoints: xAxisPoints,
calPoints: calPoints,
eachSpacing: eachSpacing
};
}
function drawMixDataPoints(series, opts, config, context) {
var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
var xAxisData = opts.chartData.xAxisData,
xAxisPoints = xAxisData.xAxisPoints,
eachSpacing = xAxisData.eachSpacing;
var endY = opts.height - opts.area[2];
var calPoints = [];
var columnIndex = 0;
var columnLength = 0;
series.forEach(function (eachSeries, seriesIndex) {
if (eachSeries.type == 'column') {
columnLength += 1;
}
});
context.save();
var leftNum = -2;
var rightNum = xAxisPoints.length + 2;
var leftSpace = 0;
var rightSpace = opts.width + eachSpacing;
if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) {
context.translate(opts._scrollDistance_, 0);
leftNum = Math.floor(-opts._scrollDistance_ / eachSpacing) - 2;
rightNum = leftNum + opts.xAxis.itemCount + 4;
leftSpace = -opts._scrollDistance_ - eachSpacing + opts.area[3];
rightSpace = leftSpace + (opts.xAxis.itemCount + 4) * eachSpacing;
}
series.forEach(function (eachSeries, seriesIndex) {
var ranges, minRange, maxRange;
ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
minRange = ranges.pop();
maxRange = ranges.shift();
var data = eachSeries.data;
var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
calPoints.push(points);
// 绘制柱状数据图
if (eachSeries.type == 'column') {
points = fixColumeData(points, eachSpacing, columnLength, columnIndex, config, opts);
for (var i = 0; i < points.length; i++) {
var item = points[i];
if (item !== null && i > leftNum && i < rightNum) {
context.beginPath();
context.setStrokeStyle(item.color || eachSeries.color);
context.setLineWidth(1);
context.setFillStyle(item.color || eachSeries.color);
var startX = item.x - item.width / 2;
var height = opts.height - item.y - opts.area[2];
context.moveTo(startX, item.y);
context.moveTo(startX, item.y);
context.lineTo(startX + item.width - 2, item.y);
context.lineTo(startX + item.width - 2, opts.height - opts.area[2]);
context.lineTo(startX, opts.height - opts.area[2]);
context.lineTo(startX, item.y);
context.closePath();
context.stroke();
context.fill();
context.closePath();
context.fill();
}
}
columnIndex += 1;
}
//绘制区域图数据
if (eachSeries.type == 'area') {
var _splitPointList = splitPoints(points);
for (var _i16 = 0; _i16 < _splitPointList.length; _i16++) {
var _points3 = _splitPointList[_i16];
// 绘制区域数据
context.beginPath();
context.setStrokeStyle(eachSeries.color);
context.setFillStyle(hexToRgb(eachSeries.color, 0.2));
context.setLineWidth(2 * opts.pixelRatio);
if (_points3.length > 1) {
var firstPoint = _points3[0];
var lastPoint = _points3[_points3.length - 1];
context.moveTo(firstPoint.x, firstPoint.y);
var startPoint = 0;
if (eachSeries.style === 'curve') {
for (var j = 0; j < _points3.length; j++) {
var _item16 = _points3[j];
if (startPoint == 0 && _item16.x > leftSpace) {
context.moveTo(_item16.x, _item16.y);
startPoint = 1;
}
if (j > 0 && _item16.x > leftSpace && _item16.x < rightSpace) {
var ctrlPoint = createCurveControlPoints(_points3, j - 1);
context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y, _item16.x, _item16.y);
}
}
;
} else {
for (var _j6 = 0; _j6 < _points3.length; _j6++) {
var _item17 = _points3[_j6];
if (startPoint == 0 && _item17.x > leftSpace) {
context.moveTo(_item17.x, _item17.y);
startPoint = 1;
}
if (_j6 > 0 && _item17.x > leftSpace && _item17.x < rightSpace) {
context.lineTo(_item17.x, _item17.y);
}
}
;
}
context.lineTo(lastPoint.x, endY);
context.lineTo(firstPoint.x, endY);
context.lineTo(firstPoint.x, firstPoint.y);
} else {
var _item18 = _points3[0];
context.moveTo(_item18.x - eachSpacing / 2, _item18.y);
context.lineTo(_item18.x + eachSpacing / 2, _item18.y);
context.lineTo(_item18.x + eachSpacing / 2, endY);
context.lineTo(_item18.x - eachSpacing / 2, endY);
context.moveTo(_item18.x - eachSpacing / 2, _item18.y);
}
context.closePath();
context.fill();
}
}
// 绘制折线数据图
if (eachSeries.type == 'line') {
var splitPointList = splitPoints(points);
splitPointList.forEach(function (points, index) {
if (eachSeries.lineType == 'dash') {
var dashLength = eachSeries.dashLength ? eachSeries.dashLength : 8;
dashLength *= opts.pixelRatio;
context.setLineDash([dashLength, dashLength]);
}
context.beginPath();
context.setStrokeStyle(eachSeries.color);
context.setLineWidth(2 * opts.pixelRatio);
if (points.length === 1) {
context.moveTo(points[0].x, points[0].y);
context.arc(points[0].x, points[0].y, 1, 0, 2 * Math.PI);
} else {
context.moveTo(points[0].x, points[0].y);
var _startPoint2 = 0;
if (eachSeries.style == 'curve') {
for (var _j7 = 0; _j7 < points.length; _j7++) {
var _item19 = points[_j7];
if (_startPoint2 == 0 && _item19.x > leftSpace) {
context.moveTo(_item19.x, _item19.y);
_startPoint2 = 1;
}
if (_j7 > 0 && _item19.x > leftSpace && _item19.x < rightSpace) {
var ctrlPoint = createCurveControlPoints(points, _j7 - 1);
context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y, _item19.x, _item19.y);
}
}
} else {
for (var _j8 = 0; _j8 < points.length; _j8++) {
var _item20 = points[_j8];
if (_startPoint2 == 0 && _item20.x > leftSpace) {
context.moveTo(_item20.x, _item20.y);
_startPoint2 = 1;
}
if (_j8 > 0 && _item20.x > leftSpace && _item20.x < rightSpace) {
context.lineTo(_item20.x, _item20.y);
}
}
}
context.moveTo(points[0].x, points[0].y);
}
context.stroke();
context.setLineDash([]);
});
}
// 绘制点数据图
if (eachSeries.type == 'point') {
eachSeries.addPoint = true;
}
if (eachSeries.addPoint == true && eachSeries.type !== 'column') {
drawPointShape(points, eachSeries.color, eachSeries.pointShape, context, opts);
}
});
if (opts.dataLabel !== false && process === 1) {
var columnIndex = 0;
series.forEach(function (eachSeries, seriesIndex) {
var ranges, minRange, maxRange;
ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
minRange = ranges.pop();
maxRange = ranges.shift();
var data = eachSeries.data;
var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
if (eachSeries.type !== 'column') {
drawPointText(points, eachSeries, config, context);
} else {
points = fixColumeData(points, eachSpacing, columnLength, columnIndex, config, opts);
drawPointText(points, eachSeries, config, context);
columnIndex += 1;
}
});
}
context.restore();
return {
xAxisPoints: xAxisPoints,
calPoints: calPoints,
eachSpacing: eachSpacing
};
}
function drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints) {
var toolTipOption = opts.extra.tooltip || {};
if (toolTipOption.horizentalLine && opts.tooltip && process === 1 && (opts.type == 'line' || opts.type == 'area' || opts.type == 'column' || opts.type == 'candle' || opts.type == 'mix')) {
drawToolTipHorizentalLine(opts, config, context, eachSpacing, xAxisPoints);
}
context.save();
if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) {
context.translate(opts._scrollDistance_, 0);
}
if (opts.tooltip && opts.tooltip.textList && opts.tooltip.textList.length && process === 1) {
drawToolTip(opts.tooltip.textList, opts.tooltip.offset, opts, config, context, eachSpacing, xAxisPoints);
}
context.restore();
}
function drawXAxis(categories, opts, config, context) {
var xAxisData = opts.chartData.xAxisData,
xAxisPoints = xAxisData.xAxisPoints,
startX = xAxisData.startX,
endX = xAxisData.endX,
eachSpacing = xAxisData.eachSpacing;
var boundaryGap = 'center';
if (opts.type == 'line' || opts.type == 'area') {
boundaryGap = opts.xAxis.boundaryGap;
}
var startY = opts.height - opts.area[2];
var endY = opts.area[0];
//绘制滚动条
if (opts.enableScroll && opts.xAxis.scrollShow) {
var scrollY = opts.height - opts.area[2] + config.xAxisHeight;
var scrollScreenWidth = endX - startX;
var scrollTotalWidth = eachSpacing * (xAxisPoints.length - 1);
var scrollWidth = scrollScreenWidth * scrollScreenWidth / scrollTotalWidth;
var scrollLeft = 0;
if (opts._scrollDistance_) {
scrollLeft = -opts._scrollDistance_ * scrollScreenWidth / scrollTotalWidth;
}
context.beginPath();
context.setLineCap('round');
context.setLineWidth(6 * opts.pixelRatio);
context.setStrokeStyle(opts.xAxis.scrollBackgroundColor || "#EFEBEF");
context.moveTo(startX, scrollY);
context.lineTo(endX, scrollY);
context.stroke();
context.closePath();
context.beginPath();
context.setLineCap('round');
context.setLineWidth(6 * opts.pixelRatio);
context.setStrokeStyle(opts.xAxis.scrollColor || "#A6A6A6");
context.moveTo(startX + scrollLeft, scrollY);
context.lineTo(startX + scrollLeft + scrollWidth, scrollY);
context.stroke();
context.closePath();
context.setLineCap('butt');
}
context.save();
if (opts._scrollDistance_ && opts._scrollDistance_ !== 0) {
context.translate(opts._scrollDistance_, 0);
}
//绘制X轴刻度线
if (opts.xAxis.calibration === true) {
context.setStrokeStyle(opts.xAxis.gridColor || "#cccccc");
context.setLineCap('butt');
context.setLineWidth(1 * opts.pixelRatio);
xAxisPoints.forEach(function (item, index) {
if (index > 0) {
context.beginPath();
context.moveTo(item - eachSpacing / 2, startY);
context.lineTo(item - eachSpacing / 2, startY + 3 * opts.pixelRatio);
context.closePath();
context.stroke();
}
});
}
//绘制X轴网格
if (opts.xAxis.disableGrid !== true) {
context.setStrokeStyle(opts.xAxis.gridColor || "#cccccc");
context.setLineCap('butt');
context.setLineWidth(1 * opts.pixelRatio);
if (opts.xAxis.gridType == 'dash') {
context.setLineDash([opts.xAxis.dashLength, opts.xAxis.dashLength]);
}
opts.xAxis.gridEval = opts.xAxis.gridEval || 1;
xAxisPoints.forEach(function (item, index) {
if (index % opts.xAxis.gridEval == 0) {
context.beginPath();
context.moveTo(item, startY);
context.lineTo(item, endY);
context.stroke();
}
});
context.setLineDash([]);
}
//绘制X轴文案
if (opts.xAxis.disabled !== true) {
// 对X轴列表做抽稀处理
//默认全部显示X轴标签
var maxXAxisListLength = categories.length;
//如果设置了X轴单屏数量
if (opts.xAxis.labelCount) {
//如果设置X轴密度
if (opts.xAxis.itemCount) {
maxXAxisListLength = Math.ceil(categories.length / opts.xAxis.itemCount * opts.xAxis.labelCount);
} else {
maxXAxisListLength = opts.xAxis.labelCount;
}
maxXAxisListLength -= 1;
}
var ratio = Math.ceil(categories.length / maxXAxisListLength);
var newCategories = [];
var cgLength = categories.length;
for (var i = 0; i < cgLength; i++) {
if (i % ratio !== 0) {
newCategories.push("");
} else {
newCategories.push(categories[i]);
}
}
newCategories[cgLength - 1] = categories[cgLength - 1];
var xAxisFontSize = opts.xAxis.fontSize || config.fontSize;
if (config._xAxisTextAngle_ === 0) {
newCategories.forEach(function (item, index) {
var offset = -measureText(String(item), xAxisFontSize) / 2;
if (boundaryGap == 'center') {
offset += eachSpacing / 2;
}
var scrollHeight = 0;
if (opts.xAxis.scrollShow) {
scrollHeight = 6 * opts.pixelRatio;
}
context.beginPath();
context.setFontSize(xAxisFontSize);
context.setFillStyle(opts.xAxis.fontColor || '#666666');
context.fillText(String(item), xAxisPoints[index] + offset, startY + xAxisFontSize + (config.xAxisHeight - scrollHeight - xAxisFontSize) / 2);
context.closePath();
context.stroke();
});
} else {
newCategories.forEach(function (item, index) {
context.save();
context.beginPath();
context.setFontSize(xAxisFontSize);
context.setFillStyle(opts.xAxis.fontColor || '#666666');
var textWidth = measureText(String(item), xAxisFontSize);
var offset = -textWidth;
if (boundaryGap == 'center') {
offset += eachSpacing / 2;
}
var _calRotateTranslate = calRotateTranslate(xAxisPoints[index] + eachSpacing / 2, startY + xAxisFontSize / 2 + 5, opts.height),
transX = _calRotateTranslate.transX,
transY = _calRotateTranslate.transY;
context.rotate(-1 * config._xAxisTextAngle_);
context.translate(transX, transY);
context.fillText(String(item), xAxisPoints[index] + offset, startY + xAxisFontSize + 5);
context.closePath();
context.stroke();
context.restore();
});
}
}
context.restore();
//绘制X轴轴线
if (opts.xAxis.axisLine) {
context.beginPath();
context.setStrokeStyle(opts.xAxis.axisLineColor);
context.setLineWidth(1 * opts.pixelRatio);
context.moveTo(startX, opts.height - opts.area[2]);
context.lineTo(endX, opts.height - opts.area[2]);
context.stroke();
}
}
function drawYAxisGrid(categories, opts, config, context) {
if (opts.yAxis.disableGrid === true) {
return;
}
var spacingValid = opts.height - opts.area[0] - opts.area[2];
var eachSpacing = spacingValid / opts.yAxis.splitNumber;
var startX = opts.area[3];
var xAxisPoints = opts.chartData.xAxisData.xAxisPoints,
xAxiseachSpacing = opts.chartData.xAxisData.eachSpacing;
var TotalWidth = xAxiseachSpacing * (xAxisPoints.length - 1);
var endX = startX + TotalWidth;
var points = [];
for (var i = 0; i < opts.yAxis.splitNumber + 1; i++) {
points.push(opts.height - opts.area[2] - eachSpacing * i);
}
context.save();
if (opts._scrollDistance_ && opts._scrollDistance_ !== 0) {
context.translate(opts._scrollDistance_, 0);
}
if (opts.yAxis.gridType == 'dash') {
context.setLineDash([opts.yAxis.dashLength, opts.yAxis.dashLength]);
}
context.setStrokeStyle(opts.yAxis.gridColor);
context.setLineWidth(1 * opts.pixelRatio);
points.forEach(function (item, index) {
context.beginPath();
context.moveTo(startX, item);
context.lineTo(endX, item);
context.stroke();
});
context.setLineDash([]);
context.restore();
}
function drawYAxis(series, opts, config, context) {
if (opts.yAxis.disabled === true) {
return;
}
var spacingValid = opts.height - opts.area[0] - opts.area[2];
var eachSpacing = spacingValid / opts.yAxis.splitNumber;
var startX = opts.area[3];
var endX = opts.width - opts.area[1];
var endY = opts.height - opts.area[2];
var fillEndY = endY + config.xAxisHeight;
if (opts.xAxis.scrollShow) {
fillEndY -= 3 * opts.pixelRatio;
}
if (opts.xAxis.rotateLabel) {
fillEndY = opts.height - opts.area[2] + 3;
}
// set YAxis background
context.beginPath();
context.setFillStyle(opts.background || '#ffffff');
if (opts._scrollDistance_ < 0) {
context.fillRect(0, 0, startX, fillEndY);
}
if (opts.enableScroll == true) {
context.fillRect(endX, 0, opts.width, fillEndY);
}
context.closePath();
context.stroke();
var points = [];
for (var i = 0; i <= opts.yAxis.splitNumber; i++) {
points.push(opts.area[0] + eachSpacing * i);
}
var tStartLeft = opts.area[3];
var tStartRight = opts.width - opts.area[1];
var _loop4 = function _loop4(_i17) {
var yData = opts.yAxis.data[_i17];
if (yData.disabled !== true) {
var rangesFormat = opts.chartData.yAxisData.rangesFormat[_i17];
var yAxisFontSize = yData.fontSize || config.fontSize;
var yAxisWidth = opts.chartData.yAxisData.yAxisWidth[_i17];
//画Y轴刻度及文案
rangesFormat.forEach(function (item, index) {
var pos = points[index] ? points[index] : endY;
context.beginPath();
context.setFontSize(yAxisFontSize);
context.setLineWidth(1 * opts.pixelRatio);
context.setStrokeStyle(yData.axisLineColor || '#cccccc');
context.setFillStyle(yData.fontColor || '#666666');
if (yAxisWidth.position == 'left') {
context.fillText(String(item), tStartLeft - yAxisWidth.width, pos + yAxisFontSize / 2);
//画刻度线
if (yData.calibration == true) {
context.moveTo(tStartLeft, pos);
context.lineTo(tStartLeft - 3 * opts.pixelRatio, pos);
}
} else {
context.fillText(String(item), tStartRight + 4 * opts.pixelRatio, pos + yAxisFontSize / 2);
//画刻度线
if (yData.calibration == true) {
context.moveTo(tStartRight, pos);
context.lineTo(tStartRight + 3 * opts.pixelRatio, pos);
}
}
context.closePath();
context.stroke();
});
//画Y轴轴线
if (yData.axisLine !== false) {
context.beginPath();
context.setStrokeStyle(yData.axisLineColor || '#cccccc');
context.setLineWidth(1 * opts.pixelRatio);
if (yAxisWidth.position == 'left') {
context.moveTo(tStartLeft, opts.height - opts.area[2]);
context.lineTo(tStartLeft, opts.area[0]);
} else {
context.moveTo(tStartRight, opts.height - opts.area[2]);
context.lineTo(tStartRight, opts.area[0]);
}
context.stroke();
}
//画Y轴标题
if (opts.yAxis.showTitle) {
var titleFontSize = yData.titleFontSize || config.fontSize;
var title = yData.title;
context.beginPath();
context.setFontSize(titleFontSize);
context.setFillStyle(yData.titleFontColor || '#666666');
if (yAxisWidth.position == 'left') {
context.fillText(title, tStartLeft - measureText(title, titleFontSize) / 2, opts.area[0] - 10 * opts.pixelRatio);
} else {
context.fillText(title, tStartRight - measureText(title, titleFontSize) / 2, opts.area[0] - 10 * opts.pixelRatio);
}
context.closePath();
context.stroke();
}
if (yAxisWidth.position == 'left') {
tStartLeft -= yAxisWidth.width + opts.yAxis.padding;
} else {
tStartRight += yAxisWidth.width + opts.yAxis.padding;
}
}
};
for (var _i17 = 0; _i17 < opts.yAxis.data.length; _i17++) {
_loop4(_i17);
}
}
function drawLegend(series, opts, config, context, chartData) {
if (opts.legend.show === false) {
return;
}
var legendData = chartData.legendData;
var legendList = legendData.points;
var legendArea = legendData.area;
var padding = opts.legend.padding;
var fontSize = opts.legend.fontSize;
var shapeWidth = 15 * opts.pixelRatio;
var shapeRight = 5 * opts.pixelRatio;
var itemGap = opts.legend.itemGap;
var lineHeight = Math.max(opts.legend.lineHeight * opts.pixelRatio, fontSize);
//画背景及边框
context.beginPath();
context.setLineWidth(opts.legend.borderWidth);
context.setStrokeStyle(opts.legend.borderColor);
context.setFillStyle(opts.legend.backgroundColor);
context.moveTo(legendArea.start.x, legendArea.start.y);
context.rect(legendArea.start.x, legendArea.start.y, legendArea.width, legendArea.height);
context.closePath();
context.fill();
context.stroke();
legendList.forEach(function (itemList, listIndex) {
var width = 0;
var height = 0;
width = legendData.widthArr[listIndex];
height = legendData.heightArr[listIndex];
var startX = 0;
var startY = 0;
if (opts.legend.position == 'top' || opts.legend.position == 'bottom') {
startX = legendArea.start.x + (legendArea.width - width) / 2;
startY = legendArea.start.y + padding + listIndex * lineHeight;
} else {
if (listIndex == 0) {
width = 0;
} else {
width = legendData.widthArr[listIndex - 1];
}
startX = legendArea.start.x + padding + width;
startY = legendArea.start.y + padding + (legendArea.height - height) / 2;
}
context.setFontSize(config.fontSize);
for (var i = 0; i < itemList.length; i++) {
var item = itemList[i];
item.area = [0, 0, 0, 0];
item.area[0] = startX;
item.area[1] = startY;
item.area[3] = startY + lineHeight;
context.beginPath();
context.setLineWidth(1 * opts.pixelRatio);
context.setStrokeStyle(item.show ? item.color : opts.legend.hiddenColor);
context.setFillStyle(item.show ? item.color : opts.legend.hiddenColor);
switch (item.legendShape) {
case 'line':
context.moveTo(startX, startY + 0.5 * lineHeight - 2 * opts.pixelRatio);
context.fillRect(startX, startY + 0.5 * lineHeight - 2 * opts.pixelRatio, 15 * opts.pixelRatio, 4 * opts.pixelRatio);
break;
case 'triangle':
context.moveTo(startX + 7.5 * opts.pixelRatio, startY + 0.5 * lineHeight - 5 * opts.pixelRatio);
context.lineTo(startX + 2.5 * opts.pixelRatio, startY + 0.5 * lineHeight + 5 * opts.pixelRatio);
context.lineTo(startX + 12.5 * opts.pixelRatio, startY + 0.5 * lineHeight + 5 * opts.pixelRatio);
context.lineTo(startX + 7.5 * opts.pixelRatio, startY + 0.5 * lineHeight - 5 * opts.pixelRatio);
break;
case 'diamond':
context.moveTo(startX + 7.5 * opts.pixelRatio, startY + 0.5 * lineHeight - 5 * opts.pixelRatio);
context.lineTo(startX + 2.5 * opts.pixelRatio, startY + 0.5 * lineHeight);
context.lineTo(startX + 7.5 * opts.pixelRatio, startY + 0.5 * lineHeight + 5 * opts.pixelRatio);
context.lineTo(startX + 12.5 * opts.pixelRatio, startY + 0.5 * lineHeight);
context.lineTo(startX + 7.5 * opts.pixelRatio, startY + 0.5 * lineHeight - 5 * opts.pixelRatio);
break;
case 'circle':
context.moveTo(startX + 7.5 * opts.pixelRatio, startY + 0.5 * lineHeight);
context.arc(startX + 7.5 * opts.pixelRatio, startY + 0.5 * lineHeight, 5 * opts.pixelRatio, 0, 2 * Math.PI);
break;
case 'rect':
context.moveTo(startX, startY + 0.5 * lineHeight - 5 * opts.pixelRatio);
context.fillRect(startX, startY + 0.5 * lineHeight - 5 * opts.pixelRatio, 15 * opts.pixelRatio, 10 * opts.pixelRatio);
break;
default:
context.moveTo(startX, startY + 0.5 * lineHeight - 5 * opts.pixelRatio);
context.fillRect(startX, startY + 0.5 * lineHeight - 5 * opts.pixelRatio, 15 * opts.pixelRatio, 10 * opts.pixelRatio);
}
context.closePath();
context.fill();
context.stroke();
startX += shapeWidth + shapeRight;
var fontTrans = 0.5 * lineHeight + 0.5 * fontSize - 2;
context.beginPath();
context.setFontSize(fontSize);
context.setFillStyle(item.show ? opts.legend.fontColor : opts.legend.hiddenColor);
context.fillText(item.name, startX, startY + fontTrans);
context.closePath();
context.stroke();
if (opts.legend.position == 'top' || opts.legend.position == 'bottom') {
startX += measureText(item.name, fontSize) + itemGap;
item.area[2] = startX;
} else {
item.area[2] = startX + measureText(item.name, fontSize) + itemGap;
;
startX -= shapeWidth + shapeRight;
startY += lineHeight;
}
}
});
}
function drawPieDataPoints(series, opts, config, context) {
var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
var pieOption = assign({}, {
activeOpacity: 0.5,
activeRadius: 10 * opts.pixelRatio,
offsetAngle: 0,
labelWidth: 15 * opts.pixelRatio,
ringWidth: 0,
border: false,
borderWidth: 2,
borderColor: '#FFFFFF'
}, opts.extra.pie);
var centerPosition = {
x: opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2,
y: opts.area[0] + (opts.height - opts.area[0] - opts.area[2]) / 2
};
if (config.pieChartLinePadding == 0) {
config.pieChartLinePadding = pieOption.activeRadius;
}
var radius = Math.min((opts.width - opts.area[1] - opts.area[3]) / 2 - config.pieChartLinePadding - config.pieChartTextPadding - config._pieTextMaxLength_, (opts.height - opts.area[0] - opts.area[2]) / 2 - config.pieChartLinePadding - config.pieChartTextPadding);
series = getPieDataPoints(series, radius, process);
var activeRadius = pieOption.activeRadius;
series = series.map(function (eachSeries) {
eachSeries._start_ += pieOption.offsetAngle * Math.PI / 180;
return eachSeries;
});
series.forEach(function (eachSeries, seriesIndex) {
if (opts.tooltip) {
if (opts.tooltip.index == seriesIndex) {
context.beginPath();
context.setFillStyle(hexToRgb(eachSeries.color, opts.extra.pie.activeOpacity || 0.5));
context.moveTo(centerPosition.x, centerPosition.y);
context.arc(centerPosition.x, centerPosition.y, eachSeries._radius_ + activeRadius, eachSeries._start_, eachSeries._start_ + 2 * eachSeries._proportion_ * Math.PI);
context.closePath();
context.fill();
}
}
context.beginPath();
context.setLineWidth(pieOption.borderWidth * opts.pixelRatio);
context.lineJoin = "round";
context.setStrokeStyle(pieOption.borderColor);
context.setFillStyle(eachSeries.color);
context.moveTo(centerPosition.x, centerPosition.y);
context.arc(centerPosition.x, centerPosition.y, eachSeries._radius_, eachSeries._start_, eachSeries._start_ + 2 * eachSeries._proportion_ * Math.PI);
context.closePath();
context.fill();
if (pieOption.border == true) {
context.stroke();
}
});
if (opts.type === 'ring') {
var innerPieWidth = radius * 0.6;
if (typeof opts.extra.pie.ringWidth === 'number' && opts.extra.pie.ringWidth > 0) {
innerPieWidth = Math.max(0, radius - opts.extra.pie.ringWidth);
}
context.beginPath();
context.setFillStyle(opts.background || '#ffffff');
context.moveTo(centerPosition.x, centerPosition.y);
context.arc(centerPosition.x, centerPosition.y, innerPieWidth, 0, 2 * Math.PI);
context.closePath();
context.fill();
}
if (opts.dataLabel !== false && process === 1) {
var valid = false;
for (var i = 0, len = series.length; i < len; i++) {
if (series[i].data > 0) {
valid = true;
break;
}
}
if (valid) {
drawPieText(series, opts, config, context, radius, centerPosition);
}
}
if (process === 1 && opts.type === 'ring') {
drawRingTitle(opts, config, context, centerPosition);
}
return {
center: centerPosition,
radius: radius,
series: series
};
}
function drawRoseDataPoints(series, opts, config, context) {
var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
var roseOption = assign({}, {
type: 'area',
activeOpacity: 0.5,
activeRadius: 10 * opts.pixelRatio,
offsetAngle: 0,
labelWidth: 15 * opts.pixelRatio,
border: false,
borderWidth: 2,
borderColor: '#FFFFFF'
}, opts.extra.rose);
if (config.pieChartLinePadding == 0) {
config.pieChartLinePadding = roseOption.activeRadius;
}
var centerPosition = {
x: opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2,
y: opts.area[0] + (opts.height - opts.area[0] - opts.area[2]) / 2
};
var radius = Math.min((opts.width - opts.area[1] - opts.area[3]) / 2 - config.pieChartLinePadding - config.pieChartTextPadding - config._pieTextMaxLength_, (opts.height - opts.area[0] - opts.area[2]) / 2 - config.pieChartLinePadding - config.pieChartTextPadding);
var minRadius = roseOption.minRadius || radius * 0.5;
series = getRoseDataPoints(series, roseOption.type, minRadius, radius, process);
var activeRadius = roseOption.activeRadius;
series = series.map(function (eachSeries) {
eachSeries._start_ += (roseOption.offsetAngle || 0) * Math.PI / 180;
return eachSeries;
});
series.forEach(function (eachSeries, seriesIndex) {
if (opts.tooltip) {
if (opts.tooltip.index == seriesIndex) {
context.beginPath();
context.setFillStyle(hexToRgb(eachSeries.color, roseOption.activeOpacity || 0.5));
context.moveTo(centerPosition.x, centerPosition.y);
context.arc(centerPosition.x, centerPosition.y, activeRadius + eachSeries._radius_, eachSeries._start_, eachSeries._start_ + 2 * eachSeries._rose_proportion_ * Math.PI);
context.closePath();
context.fill();
}
}
context.beginPath();
context.setLineWidth(roseOption.borderWidth * opts.pixelRatio);
context.lineJoin = "round";
context.setStrokeStyle(roseOption.borderColor);
context.setFillStyle(eachSeries.color);
context.moveTo(centerPosition.x, centerPosition.y);
context.arc(centerPosition.x, centerPosition.y, eachSeries._radius_, eachSeries._start_, eachSeries._start_ + 2 * eachSeries._rose_proportion_ * Math.PI);
context.closePath();
context.fill();
if (roseOption.border == true) {
context.stroke();
}
});
if (opts.dataLabel !== false && process === 1) {
var valid = false;
for (var i = 0, len = series.length; i < len; i++) {
if (series[i].data > 0) {
valid = true;
break;
}
}
if (valid) {
drawPieText(series, opts, config, context, radius, centerPosition);
}
}
return {
center: centerPosition,
radius: radius,
series: series
};
}
function drawArcbarDataPoints(series, opts, config, context) {
var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
var arcbarOption = assign({}, {
startAngle: 0.75,
endAngle: 0.25,
type: 'default',
width: 12 * opts.pixelRatio,
gap: 2 * opts.pixelRatio
}, opts.extra.arcbar);
series = getArcbarDataPoints(series, arcbarOption, process);
var centerPosition;
if (arcbarOption.center) {
centerPosition = arcbarOption.center;
} else {
centerPosition = {
x: opts.width / 2,
y: opts.height / 2
};
}
var radius;
if (arcbarOption.radius) {
radius = arcbarOption.radius;
} else {
radius = Math.min(centerPosition.x, centerPosition.y);
radius -= 5 * opts.pixelRatio;
radius -= arcbarOption.width / 2;
}
for (var i = 0; i < series.length; i++) {
var eachSeries = series[i];
//背景颜色
context.setLineWidth(arcbarOption.width);
context.setStrokeStyle(arcbarOption.backgroundColor || '#E9E9E9');
context.setLineCap('round');
context.beginPath();
if (arcbarOption.type == 'default') {
context.arc(centerPosition.x, centerPosition.y, radius - (arcbarOption.width + arcbarOption.gap) * i, arcbarOption.startAngle * Math.PI, arcbarOption.endAngle * Math.PI, false);
} else {
context.arc(centerPosition.x, centerPosition.y, radius - (arcbarOption.width + arcbarOption.gap) * i, 0, 2 * Math.PI, false);
}
context.stroke();
//进度条
context.setLineWidth(arcbarOption.width);
context.setStrokeStyle(eachSeries.color);
context.setLineCap('round');
context.beginPath();
context.arc(centerPosition.x, centerPosition.y, radius - (arcbarOption.width + arcbarOption.gap) * i, arcbarOption.startAngle * Math.PI, eachSeries._proportion_ * Math.PI, false);
context.stroke();
}
drawRingTitle(opts, config, context, centerPosition);
return {
center: centerPosition,
radius: radius,
series: series
};
}
function drawGaugeDataPoints(categories, series, opts, config, context) {
var process = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
var gaugeOption = assign({}, {
type: 'default',
startAngle: 0.75,
endAngle: 0.25,
width: 15,
splitLine: {
fixRadius: 0,
splitNumber: 10,
width: 15,
color: '#FFFFFF',
childNumber: 5,
childWidth: 5
},
pointer: {
width: 15,
color: 'auto'
}
}, opts.extra.gauge);
if (gaugeOption.oldAngle == undefined) {
gaugeOption.oldAngle = gaugeOption.startAngle;
}
if (gaugeOption.oldData == undefined) {
gaugeOption.oldData = 0;
}
categories = getGaugeAxisPoints(categories, gaugeOption.startAngle, gaugeOption.endAngle);
var centerPosition = {
x: opts.width / 2,
y: opts.height / 2
};
var radius = Math.min(centerPosition.x, centerPosition.y);
radius -= 5 * opts.pixelRatio;
radius -= gaugeOption.width / 2;
var innerRadius = radius - gaugeOption.width;
var totalAngle = 0;
//判断仪表盘的样式:default百度样式,progress新样式
if (gaugeOption.type == 'progress') {
//## 第一步画中心圆形背景和进度条背景
//中心圆形背景
var pieRadius = radius - gaugeOption.width * 3;
context.beginPath();
var gradient = context.createLinearGradient(centerPosition.x, centerPosition.y - pieRadius, centerPosition.x, centerPosition.y + pieRadius);
//配置渐变填充(起点:中心点向上减半径;结束点中心点向下加半径)
gradient.addColorStop('0', hexToRgb(series[0].color, 0.3));
gradient.addColorStop('1.0', hexToRgb("#FFFFFF", 0.1));
context.setFillStyle(gradient);
context.arc(centerPosition.x, centerPosition.y, pieRadius, 0, 2 * Math.PI, false);
context.fill();
//画进度条背景
context.setLineWidth(gaugeOption.width);
context.setStrokeStyle(hexToRgb(series[0].color, 0.3));
context.setLineCap('round');
context.beginPath();
context.arc(centerPosition.x, centerPosition.y, innerRadius, gaugeOption.startAngle * Math.PI, gaugeOption.endAngle * Math.PI, false);
context.stroke();
//## 第二步画刻度线
totalAngle = gaugeOption.startAngle - gaugeOption.endAngle + 1;
var splitAngle = totalAngle / gaugeOption.splitLine.splitNumber;
var childAngle = totalAngle / gaugeOption.splitLine.splitNumber / gaugeOption.splitLine.childNumber;
var startX = -radius - gaugeOption.width * 0.5 - gaugeOption.splitLine.fixRadius;
var endX = -radius - gaugeOption.width - gaugeOption.splitLine.fixRadius + gaugeOption.splitLine.width;
context.save();
context.translate(centerPosition.x, centerPosition.y);
context.rotate((gaugeOption.startAngle - 1) * Math.PI);
var len = gaugeOption.splitLine.splitNumber * gaugeOption.splitLine.childNumber + 1;
var proc = series[0].data * process;
for (var i = 0; i < len; i++) {
context.beginPath();
//刻度线随进度变色
if (proc > i / len) {
context.setStrokeStyle(hexToRgb(series[0].color, 1));
} else {
context.setStrokeStyle(hexToRgb(series[0].color, 0.3));
}
context.setLineWidth(3 * opts.pixelRatio);
context.moveTo(startX, 0);
context.lineTo(endX, 0);
context.stroke();
context.rotate(childAngle * Math.PI);
}
context.restore();
//## 第三步画进度条
series = getArcbarDataPoints(series, gaugeOption, process);
context.setLineWidth(gaugeOption.width);
context.setStrokeStyle(series[0].color);
context.setLineCap('round');
context.beginPath();
context.arc(centerPosition.x, centerPosition.y, innerRadius, gaugeOption.startAngle * Math.PI, series[0]._proportion_ * Math.PI, false);
context.stroke();
//## 第四步画指针
var pointerRadius = radius - gaugeOption.width * 2.5;
context.save();
context.translate(centerPosition.x, centerPosition.y);
context.rotate((series[0]._proportion_ - 1) * Math.PI);
context.beginPath();
context.setLineWidth(gaugeOption.width / 3);
var gradient3 = context.createLinearGradient(0, -pointerRadius * 0.6, 0, pointerRadius * 0.6);
gradient3.addColorStop('0', hexToRgb('#FFFFFF', 0));
gradient3.addColorStop('0.5', hexToRgb(series[0].color, 1));
gradient3.addColorStop('1.0', hexToRgb('#FFFFFF', 0));
context.setStrokeStyle(gradient3);
context.arc(0, 0, pointerRadius, 0.85 * Math.PI, 1.15 * Math.PI, false);
context.stroke();
context.beginPath();
context.setLineWidth(1);
context.setStrokeStyle(series[0].color);
context.setFillStyle(series[0].color);
context.moveTo(-pointerRadius - gaugeOption.width / 3 / 2, -4);
context.lineTo(-pointerRadius - gaugeOption.width / 3 / 2 - 4, 0);
context.lineTo(-pointerRadius - gaugeOption.width / 3 / 2, 4);
context.lineTo(-pointerRadius - gaugeOption.width / 3 / 2, -4);
context.stroke();
context.fill();
context.restore();
//default百度样式
} else {
//画背景
context.setLineWidth(gaugeOption.width);
context.setLineCap('butt');
for (var _i18 = 0; _i18 < categories.length; _i18++) {
var eachCategories = categories[_i18];
context.beginPath();
context.setStrokeStyle(eachCategories.color);
context.arc(centerPosition.x, centerPosition.y, radius, eachCategories._startAngle_ * Math.PI, eachCategories._endAngle_ * Math.PI, false);
context.stroke();
}
context.save();
//画刻度线
totalAngle = gaugeOption.startAngle - gaugeOption.endAngle + 1;
var _splitAngle = totalAngle / gaugeOption.splitLine.splitNumber;
var _childAngle = totalAngle / gaugeOption.splitLine.splitNumber / gaugeOption.splitLine.childNumber;
var _startX2 = -radius - gaugeOption.width * 0.5 - gaugeOption.splitLine.fixRadius;
var _endX = -radius - gaugeOption.width * 0.5 - gaugeOption.splitLine.fixRadius + gaugeOption.splitLine.width;
var childendX = -radius - gaugeOption.width * 0.5 - gaugeOption.splitLine.fixRadius + gaugeOption.splitLine.childWidth;
context.translate(centerPosition.x, centerPosition.y);
context.rotate((gaugeOption.startAngle - 1) * Math.PI);
for (var _i19 = 0; _i19 < gaugeOption.splitLine.splitNumber + 1; _i19++) {
context.beginPath();
context.setStrokeStyle(gaugeOption.splitLine.color);
context.setLineWidth(2 * opts.pixelRatio);
context.moveTo(_startX2, 0);
context.lineTo(_endX, 0);
context.stroke();
context.rotate(_splitAngle * Math.PI);
}
context.restore();
context.save();
context.translate(centerPosition.x, centerPosition.y);
context.rotate((gaugeOption.startAngle - 1) * Math.PI);
for (var _i20 = 0; _i20 < gaugeOption.splitLine.splitNumber * gaugeOption.splitLine.childNumber + 1; _i20++) {
context.beginPath();
context.setStrokeStyle(gaugeOption.splitLine.color);
context.setLineWidth(1 * opts.pixelRatio);
context.moveTo(_startX2, 0);
context.lineTo(childendX, 0);
context.stroke();
context.rotate(_childAngle * Math.PI);
}
context.restore();
//画指针
series = getGaugeDataPoints(series, categories, gaugeOption, process);
for (var _i21 = 0; _i21 < series.length; _i21++) {
var eachSeries = series[_i21];
context.save();
context.translate(centerPosition.x, centerPosition.y);
context.rotate((eachSeries._proportion_ - 1) * Math.PI);
context.beginPath();
context.setFillStyle(eachSeries.color);
context.moveTo(gaugeOption.pointer.width, 0);
context.lineTo(0, -gaugeOption.pointer.width / 2);
context.lineTo(-innerRadius, 0);
context.lineTo(0, gaugeOption.pointer.width / 2);
context.lineTo(gaugeOption.pointer.width, 0);
context.closePath();
context.fill();
context.beginPath();
context.setFillStyle('#FFFFFF');
context.arc(0, 0, gaugeOption.pointer.width / 6, 0, 2 * Math.PI, false);
context.fill();
context.restore();
}
if (opts.dataLabel !== false) {
drawGaugeLabel(gaugeOption, radius, centerPosition, opts, config, context);
}
}
//画仪表盘标题,副标题
drawRingTitle(opts, config, context, centerPosition);
if (process === 1 && opts.type === 'gauge') {
opts.extra.gauge.oldAngle = series[0]._proportion_;
opts.extra.gauge.oldData = series[0].data;
}
return {
center: centerPosition,
radius: radius,
innerRadius: innerRadius,
categories: categories,
totalAngle: totalAngle
};
}
function drawRadarDataPoints(series, opts, config, context) {
var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
var radarOption = assign({}, {
gridColor: '#cccccc',
gridType: 'radar',
labelColor: '#666666',
opacity: 0.2,
gridCount: 3
}, opts.extra.radar);
var coordinateAngle = getRadarCoordinateSeries(opts.categories.length);
var centerPosition = {
x: opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2,
y: opts.area[0] + (opts.height - opts.area[0] - opts.area[2]) / 2
};
var radius = Math.min(centerPosition.x - (getMaxTextListLength(opts.categories) + config.radarLabelTextMargin), centerPosition.y - config.radarLabelTextMargin);
//TODO逻辑不对
radius -= opts.padding[1];
// 画分割线
context.beginPath();
context.setLineWidth(1 * opts.pixelRatio);
context.setStrokeStyle(radarOption.gridColor);
coordinateAngle.forEach(function (angle) {
var pos = convertCoordinateOrigin(radius * Math.cos(angle), radius * Math.sin(angle), centerPosition);
context.moveTo(centerPosition.x, centerPosition.y);
context.lineTo(pos.x, pos.y);
});
context.stroke();
context.closePath();
// 画背景网格
var _loop = function _loop(i) {
var startPos = {};
context.beginPath();
context.setLineWidth(1 * opts.pixelRatio);
context.setStrokeStyle(radarOption.gridColor);
if (radarOption.gridType == 'radar') {
coordinateAngle.forEach(function (angle, index) {
var pos = convertCoordinateOrigin(radius / radarOption.gridCount * i * Math.cos(angle), radius / radarOption.gridCount * i * Math.sin(angle), centerPosition);
if (index === 0) {
startPos = pos;
context.moveTo(pos.x, pos.y);
} else {
context.lineTo(pos.x, pos.y);
}
});
context.lineTo(startPos.x, startPos.y);
} else {
var pos = convertCoordinateOrigin(radius / radarOption.gridCount * i * Math.cos(1.5), radius / radarOption.gridCount * i * Math.sin(1.5), centerPosition);
context.arc(centerPosition.x, centerPosition.y, centerPosition.y - pos.y, 0, 2 * Math.PI, false);
}
context.stroke();
context.closePath();
};
for (var i = 1; i <= radarOption.gridCount; i++) {
_loop(i);
}
var radarDataPoints = getRadarDataPoints(coordinateAngle, centerPosition, radius, series, opts, process);
radarDataPoints.forEach(function (eachSeries, seriesIndex) {
// 绘制区域数据
context.beginPath();
context.setFillStyle(hexToRgb(eachSeries.color, radarOption.opacity));
eachSeries.data.forEach(function (item, index) {
if (index === 0) {
context.moveTo(item.position.x, item.position.y);
} else {
context.lineTo(item.position.x, item.position.y);
}
});
context.closePath();
context.fill();
if (opts.dataPointShape !== false) {
var points = eachSeries.data.map(function (item) {
return item.position;
});
drawPointShape(points, eachSeries.color, eachSeries.pointShape, context, opts);
}
});
// draw label text
drawRadarLabel(coordinateAngle, radius, centerPosition, opts, config, context);
return {
center: centerPosition,
radius: radius,
angleList: coordinateAngle
};
}
function normalInt(min, max, iter) {
iter = iter == 0 ? 1 : iter;
var arr = [];
for (var i = 0; i < iter; i++) {
arr[i] = Math.random();
}
;
return Math.floor(arr.reduce(function (i, j) {
return i + j;
}) / iter * (max - min)) + min;
}
;
function collisionNew(area, points, width, height) {
var isIn = false;
for (var i = 0; i < points.length; i++) {
if (points[i].area) {
if (area[3] < points[i].area[1] || area[0] > points[i].area[2] || area[1] > points[i].area[3] || area[2] < points[i].area[0]) {
if (area[0] < 0 || area[1] < 0 || area[2] > width || area[3] > height) {
isIn = true;
break;
} else {
isIn = false;
}
} else {
isIn = true;
break;
}
}
}
return isIn;
}
;
function getBoundingBox(data) {
var bounds = {},
coords;
bounds.xMin = 180;
bounds.xMax = 0;
bounds.yMin = 90;
bounds.yMax = 0;
for (var i = 0; i < data.length; i++) {
var coorda = data[i].geometry.coordinates;
for (var k = 0; k < coorda.length; k++) {
coords = coorda[k];
if (coords.length == 1) {
coords = coords[0];
}
for (var j = 0; j < coords.length; j++) {
var longitude = coords[j][0];
var latitude = coords[j][1];
var point = {
x: longitude,
y: latitude
};
bounds.xMin = bounds.xMin < point.x ? bounds.xMin : point.x;
bounds.xMax = bounds.xMax > point.x ? bounds.xMax : point.x;
bounds.yMin = bounds.yMin < point.y ? bounds.yMin : point.y;
bounds.yMax = bounds.yMax > point.y ? bounds.yMax : point.y;
}
}
}
return bounds;
}
function coordinateToPoint(latitude, longitude, bounds, scale, xoffset, yoffset) {
return {
x: (longitude - bounds.xMin) * scale + xoffset,
y: (bounds.yMax - latitude) * scale + yoffset
};
}
function pointToCoordinate(pointY, pointX, bounds, scale, xoffset, yoffset) {
return {
x: (pointX - xoffset) / scale + bounds.xMin,
y: bounds.yMax - (pointY - yoffset) / scale
};
}
function isRayIntersectsSegment(poi, s_poi, e_poi) {
if (s_poi[1] == e_poi[1]) {
return false;
}
if (s_poi[1] > poi[1] && e_poi[1] > poi[1]) {
return false;
}
if (s_poi[1] < poi[1] && e_poi[1] < poi[1]) {
return false;
}
if (s_poi[1] == poi[1] && e_poi[1] > poi[1]) {
return false;
}
if (e_poi[1] == poi[1] && s_poi[1] > poi[1]) {
return false;
}
if (s_poi[0] < poi[0] && e_poi[1] < poi[1]) {
return false;
}
var xseg = e_poi[0] - (e_poi[0] - s_poi[0]) * (e_poi[1] - poi[1]) / (e_poi[1] - s_poi[1]);
if (xseg < poi[0]) {
return false;
} else {
return true;
}
}
function isPoiWithinPoly(poi, poly) {
var sinsc = 0;
for (var i = 0; i < poly.length; i++) {
var epoly = poly[i][0];
if (poly.length == 1) {
epoly = poly[i][0];
}
for (var j = 0; j < epoly.length - 1; j++) {
var s_poi = epoly[j];
var e_poi = epoly[j + 1];
if (isRayIntersectsSegment(poi, s_poi, e_poi)) {
sinsc += 1;
}
}
}
if (sinsc % 2 == 1) {
return true;
} else {
return false;
}
}
function drawMapDataPoints(series, opts, config, context) {
var mapOption = assign({}, {
border: true,
borderWidth: 1,
borderColor: '#666666',
fillOpacity: 0.6,
activeBorderColor: '#f04864',
activeFillColor: '#facc14',
activeFillOpacity: 1
}, opts.extra.map);
var coords, point;
var data = series;
var bounds = getBoundingBox(data);
var xScale = opts.width / Math.abs(bounds.xMax - bounds.xMin);
var yScale = opts.height / Math.abs(bounds.yMax - bounds.yMin);
var scale = xScale < yScale ? xScale : yScale;
var xoffset = opts.width / 2 - Math.abs(bounds.xMax - bounds.xMin) / 2 * scale;
var yoffset = opts.height / 2 - Math.abs(bounds.yMax - bounds.yMin) / 2 * scale;
context.beginPath();
context.clearRect(0, 0, opts.width, opts.height);
context.setFillStyle(opts.background || '#FFFFFF');
context.rect(0, 0, opts.width, opts.height);
context.fill();
for (var i = 0; i < data.length; i++) {
context.beginPath();
context.setLineWidth(mapOption.borderWidth * opts.pixelRatio);
context.setStrokeStyle(mapOption.borderColor);
context.setFillStyle(hexToRgb(series[i].color, mapOption.fillOpacity));
if (opts.tooltip) {
if (opts.tooltip.index == i) {
context.setStrokeStyle(mapOption.activeBorderColor);
context.setFillStyle(hexToRgb(mapOption.activeFillColor, mapOption.activeFillOpacity));
}
}
var coorda = data[i].geometry.coordinates;
for (var k = 0; k < coorda.length; k++) {
coords = coorda[k];
if (coords.length == 1) {
coords = coords[0];
}
for (var j = 0; j < coords.length; j++) {
point = coordinateToPoint(coords[j][1], coords[j][0], bounds, scale, xoffset, yoffset);
if (j === 0) {
context.beginPath();
context.moveTo(point.x, point.y);
} else {
context.lineTo(point.x, point.y);
}
}
context.fill();
if (mapOption.border == true) {
context.stroke();
}
}
if (opts.dataLabel == true) {
var centerPoint = data[i].properties.centroid;
if (centerPoint) {
point = coordinateToPoint(centerPoint[1], centerPoint[0], bounds, scale, xoffset, yoffset);
var fontSize = data[i].textSize || config.fontSize;
var text = data[i].properties.name;
context.beginPath();
context.setFontSize(fontSize);
context.setFillStyle(data[i].textColor || '#666666');
context.fillText(text, point.x - measureText(text, fontSize) / 2, point.y + fontSize / 2);
context.closePath();
context.stroke();
}
}
}
opts.chartData.mapData = {
bounds: bounds,
scale: scale,
xoffset: xoffset,
yoffset: yoffset
};
drawToolTipBridge(opts, config, context, 1);
context.draw();
}
function getWordCloudPoint(opts, type) {
var points = opts.series.sort(function (a, b) {
return parseInt(b.textSize) - parseInt(a.textSize);
});
switch (type) {
case 'normal':
for (var i = 0; i < points.length; i++) {
var text = points[i].name;
var tHeight = points[i].textSize;
var tWidth = measureText(text, tHeight);
var x = void 0,
y = void 0;
var area = void 0;
var breaknum = 0;
while (true) {
breaknum++;
x = normalInt(-opts.width / 2, opts.width / 2, 5) - tWidth / 2;
y = normalInt(-opts.height / 2, opts.height / 2, 5) + tHeight / 2;
area = [x - 5 + opts.width / 2, y - 5 - tHeight + opts.height / 2, x + tWidth + 5 + opts.width / 2, y + 5 + opts.height / 2];
var isCollision = collisionNew(area, points, opts.width, opts.height);
if (!isCollision) break;
if (breaknum == 1000) {
area = [-100, -100, -100, -100];
break;
}
}
;
points[i].area = area;
}
break;
case 'vertical':
var Spin = function Spin() {
//获取均匀随机值,是否旋转,旋转的概率为(1-0.5)
if (Math.random() > 0.7) {
return true;
} else {
return false;
}
;
};
;
for (var _i22 = 0; _i22 < points.length; _i22++) {
var _text = points[_i22].name;
var _tHeight = points[_i22].textSize;
var _tWidth = measureText(_text, _tHeight);
var isSpin = Spin();
var _x = void 0,
_y = void 0,
_area = void 0,
areav = void 0;
var _breaknum = 0;
while (true) {
_breaknum++;
var _isCollision = void 0;
if (isSpin) {
_x = normalInt(-opts.width / 2, opts.width / 2, 5) - _tWidth / 2;
_y = normalInt(-opts.height / 2, opts.height / 2, 5) + _tHeight / 2;
_area = [_y - 5 - _tWidth + opts.width / 2, -_x - 5 + opts.height / 2, _y + 5 + opts.width / 2, -_x + _tHeight + 5 + opts.height / 2];
areav = [opts.width - (opts.width / 2 - opts.height / 2) - (-_x + _tHeight + 5 + opts.height / 2) - 5, opts.height / 2 - opts.width / 2 + (_y - 5 - _tWidth + opts.width / 2) - 5, opts.width - (opts.width / 2 - opts.height / 2) - (-_x + _tHeight + 5 + opts.height / 2) + _tHeight, opts.height / 2 - opts.width / 2 + (_y - 5 - _tWidth + opts.width / 2) + _tWidth + 5];
_isCollision = collisionNew(areav, points, opts.height, opts.width);
} else {
_x = normalInt(-opts.width / 2, opts.width / 2, 5) - _tWidth / 2;
_y = normalInt(-opts.height / 2, opts.height / 2, 5) + _tHeight / 2;
_area = [_x - 5 + opts.width / 2, _y - 5 - _tHeight + opts.height / 2, _x + _tWidth + 5 + opts.width / 2, _y + 5 + opts.height / 2];
_isCollision = collisionNew(_area, points, opts.width, opts.height);
}
if (!_isCollision) break;
if (_breaknum == 1000) {
_area = [-1000, -1000, -1000, -1000];
break;
}
}
;
if (isSpin) {
points[_i22].area = areav;
points[_i22].areav = _area;
} else {
points[_i22].area = _area;
}
points[_i22].rotate = isSpin;
}
;
break;
}
return points;
}
function drawWordCloudDataPoints(series, opts, config, context) {
var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
var wordOption = assign({}, {
type: 'normal',
autoColors: true
}, opts.extra.word);
context.beginPath();
context.setFillStyle(opts.background || '#FFFFFF');
context.rect(0, 0, opts.width, opts.height);
context.fill();
context.save();
var points = opts.chartData.wordCloudData;
context.translate(opts.width / 2, opts.height / 2);
for (var i = 0; i < points.length; i++) {
context.save();
if (points[i].rotate) {
context.rotate(90 * Math.PI / 180);
}
var text = points[i].name;
var tHeight = points[i].textSize;
var tWidth = measureText(text, tHeight);
context.beginPath();
context.setStrokeStyle(points[i].color);
context.setFillStyle(points[i].color);
context.setFontSize(tHeight);
if (points[i].rotate) {
if (points[i].areav[0] > 0) {
if (opts.tooltip) {
if (opts.tooltip.index == i) {
context.strokeText(text, (points[i].areav[0] + 5 - opts.width / 2) * process - tWidth * (1 - process) / 2, (points[i].areav[1] + 5 + tHeight - opts.height / 2) * process);
} else {
context.fillText(text, (points[i].areav[0] + 5 - opts.width / 2) * process - tWidth * (1 - process) / 2, (points[i].areav[1] + 5 + tHeight - opts.height / 2) * process);
}
} else {
context.fillText(text, (points[i].areav[0] + 5 - opts.width / 2) * process - tWidth * (1 - process) / 2, (points[i].areav[1] + 5 + tHeight - opts.height / 2) * process);
}
}
} else {
if (points[i].area[0] > 0) {
if (opts.tooltip) {
if (opts.tooltip.index == i) {
context.strokeText(text, (points[i].area[0] + 5 - opts.width / 2) * process - tWidth * (1 - process) / 2, (points[i].area[1] + 5 + tHeight - opts.height / 2) * process);
} else {
context.fillText(text, (points[i].area[0] + 5 - opts.width / 2) * process - tWidth * (1 - process) / 2, (points[i].area[1] + 5 + tHeight - opts.height / 2) * process);
}
} else {
context.fillText(text, (points[i].area[0] + 5 - opts.width / 2) * process - tWidth * (1 - process) / 2, (points[i].area[1] + 5 + tHeight - opts.height / 2) * process);
}
}
}
context.stroke();
context.restore();
}
context.restore();
}
function drawFunnelDataPoints(series, opts, config, context) {
var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
var funnelOption = assign({}, {
activeWidth: 10,
activeOpacity: 0.3,
border: false,
borderWidth: 2,
borderColor: '#FFFFFF',
fillOpacity: 1,
labelAlign: 'right'
}, opts.extra.funnel);
var eachSpacing = (opts.height - opts.area[0] - opts.area[2]) / series.length;
var centerPosition = {
x: opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2,
y: opts.height - opts.area[2]
};
var activeWidth = funnelOption.activeWidth;
var radius = Math.min((opts.width - opts.area[1] - opts.area[3]) / 2 - activeWidth, (opts.height - opts.area[0] - opts.area[2]) / 2 - activeWidth);
series = getFunnelDataPoints(series, radius, process);
context.save();
context.translate(centerPosition.x, centerPosition.y);
for (var i = 0; i < series.length; i++) {
if (i == 0) {
if (opts.tooltip) {
if (opts.tooltip.index == i) {
context.beginPath();
context.setFillStyle(hexToRgb(series[i].color, funnelOption.activeOpacity));
context.moveTo(-activeWidth, 0);
context.lineTo(-series[i].radius - activeWidth, -eachSpacing);
context.lineTo(series[i].radius + activeWidth, -eachSpacing);
context.lineTo(activeWidth, 0);
context.lineTo(-activeWidth, 0);
context.closePath();
context.fill();
}
}
series[i].funnelArea = [centerPosition.x - series[i].radius, centerPosition.y - eachSpacing, centerPosition.x + series[i].radius, centerPosition.y];
context.beginPath();
context.setLineWidth(funnelOption.borderWidth * opts.pixelRatio);
context.setStrokeStyle(funnelOption.borderColor);
context.setFillStyle(hexToRgb(series[i].color, funnelOption.fillOpacity));
context.moveTo(0, 0);
context.lineTo(-series[i].radius, -eachSpacing);
context.lineTo(series[i].radius, -eachSpacing);
context.lineTo(0, 0);
context.closePath();
context.fill();
if (funnelOption.border == true) {
context.stroke();
}
} else {
if (opts.tooltip) {
if (opts.tooltip.index == i) {
context.beginPath();
context.setFillStyle(hexToRgb(series[i].color, funnelOption.activeOpacity));
context.moveTo(0, 0);
context.lineTo(-series[i - 1].radius - activeWidth, 0);
context.lineTo(-series[i].radius - activeWidth, -eachSpacing);
context.lineTo(series[i].radius + activeWidth, -eachSpacing);
context.lineTo(series[i - 1].radius + activeWidth, 0);
context.lineTo(0, 0);
context.closePath();
context.fill();
}
}
series[i].funnelArea = [centerPosition.x - series[i].radius, centerPosition.y - eachSpacing * (i + 1), centerPosition.x + series[i].radius, centerPosition.y - eachSpacing * i];
context.beginPath();
context.setLineWidth(funnelOption.borderWidth * opts.pixelRatio);
context.setStrokeStyle(funnelOption.borderColor);
context.setFillStyle(hexToRgb(series[i].color, funnelOption.fillOpacity));
context.moveTo(0, 0);
context.lineTo(-series[i - 1].radius, 0);
context.lineTo(-series[i].radius, -eachSpacing);
context.lineTo(series[i].radius, -eachSpacing);
context.lineTo(series[i - 1].radius, 0);
context.lineTo(0, 0);
context.closePath();
context.fill();
if (funnelOption.border == true) {
context.stroke();
}
}
context.translate(0, -eachSpacing);
}
context.restore();
if (opts.dataLabel !== false && process === 1) {
drawFunnelText(series, opts, context, eachSpacing, funnelOption.labelAlign, activeWidth, centerPosition);
}
return {
center: centerPosition,
radius: radius,
series: series
};
}
function drawFunnelText(series, opts, context, eachSpacing, labelAlign, activeWidth, centerPosition) {
for (var i = 0; i < series.length; i++) {
var item = series[i];
var startX = void 0,
endX = void 0,
startY = void 0,
fontSize = void 0;
var text = item.format ? item.format(+item._proportion_.toFixed(2)) : util.toFixed(item._proportion_ * 100) + '%';
if (labelAlign == 'right') {
if (i == 0) {
startX = (item.funnelArea[2] + centerPosition.x) / 2;
} else {
startX = (item.funnelArea[2] + series[i - 1].funnelArea[2]) / 2;
}
endX = startX + activeWidth * 2;
startY = item.funnelArea[1] + eachSpacing / 2;
fontSize = item.textSize || opts.fontSize;
context.setLineWidth(1 * opts.pixelRatio);
context.setStrokeStyle(item.color);
context.setFillStyle(item.color);
context.beginPath();
context.moveTo(startX, startY);
context.lineTo(endX, startY);
context.stroke();
context.closePath();
context.beginPath();
context.moveTo(endX, startY);
context.arc(endX, startY, 2, 0, 2 * Math.PI);
context.closePath();
context.fill();
context.beginPath();
context.setFontSize(fontSize);
context.setFillStyle(item.textColor || '#666666');
context.fillText(text, endX + 5, startY + fontSize / 2 - 2);
context.closePath();
context.stroke();
context.closePath();
} else {
if (i == 0) {
startX = (item.funnelArea[0] + centerPosition.x) / 2;
} else {
startX = (item.funnelArea[0] + series[i - 1].funnelArea[0]) / 2;
}
endX = startX - activeWidth * 2;
startY = item.funnelArea[1] + eachSpacing / 2;
fontSize = item.textSize || opts.fontSize;
context.setLineWidth(1 * opts.pixelRatio);
context.setStrokeStyle(item.color);
context.setFillStyle(item.color);
context.beginPath();
context.moveTo(startX, startY);
context.lineTo(endX, startY);
context.stroke();
context.closePath();
context.beginPath();
context.moveTo(endX, startY);
context.arc(endX, startY, 2, 0, 2 * Math.PI);
context.closePath();
context.fill();
context.beginPath();
context.setFontSize(fontSize);
context.setFillStyle(item.textColor || '#666666');
context.fillText(text, endX - 5 - measureText(text), startY + fontSize / 2 - 2);
context.closePath();
context.stroke();
context.closePath();
}
}
}
function drawCanvas(opts, context) {
context.draw();
}
var Timing = {
easeIn: function easeIn(pos) {
return Math.pow(pos, 3);
},
easeOut: function easeOut(pos) {
return Math.pow(pos - 1, 3) + 1;
},
easeInOut: function easeInOut(pos) {
if ((pos /= 0.5) < 1) {
return 0.5 * Math.pow(pos, 3);
} else {
return 0.5 * (Math.pow(pos - 2, 3) + 2);
}
},
linear: function linear(pos) {
return pos;
}
};
function Animation(opts) {
this.isStop = false;
opts.duration = typeof opts.duration === 'undefined' ? 1000 : opts.duration;
opts.timing = opts.timing || 'linear';
var delay = 17;
function createAnimationFrame() {
if (typeof setTimeout !== 'undefined') {
return function (step, delay) {
setTimeout(function () {
var timeStamp = +new Date();
step(timeStamp);
}, delay);
};
} else if (typeof requestAnimationFrame !== 'undefined') {
return requestAnimationFrame;
} else {
return function (step) {
step(null);
};
}
}
;
var animationFrame = createAnimationFrame();
var startTimeStamp = null;
var _step = function step(timestamp) {
if (timestamp === null || this.isStop === true) {
opts.onProcess && opts.onProcess(1);
opts.onAnimationFinish && opts.onAnimationFinish();
return;
}
if (startTimeStamp === null) {
startTimeStamp = timestamp;
}
if (timestamp - startTimeStamp < opts.duration) {
var process = (timestamp - startTimeStamp) / opts.duration;
var timingFunction = Timing[opts.timing];
process = timingFunction(process);
opts.onProcess && opts.onProcess(process);
animationFrame(_step, delay);
} else {
opts.onProcess && opts.onProcess(1);
opts.onAnimationFinish && opts.onAnimationFinish();
}
};
_step = _step.bind(this);
animationFrame(_step, delay);
}
// stop animation immediately
// and tigger onAnimationFinish
Animation.prototype.stop = function () {
this.isStop = true;
};
function drawCharts(type, opts, config, context) {
var _this = this;
var series = opts.series;
var categories = opts.categories;
series = fillSeries(series, opts, config);
var duration = opts.animation ? opts.duration : 0;
_this.animationInstance && _this.animationInstance.stop();
var seriesMA = null;
if (type == 'candle') {
var average = assign({}, opts.extra.candle.average);
if (average.show) {
seriesMA = calCandleMA(average.day, average.name, average.color, series[0].data);
seriesMA = fillSeries(seriesMA, opts, config);
opts.seriesMA = seriesMA;
} else if (opts.seriesMA) {
seriesMA = opts.seriesMA = fillSeries(opts.seriesMA, opts, config);
} else {
seriesMA = series;
}
} else {
seriesMA = series;
}
/* 过滤掉show=false的series */
opts._series_ = series = filterSeries(series);
//重新计算图表区域
opts.area = new Array(4);
//复位绘图区域
for (var j = 0; j < 4; j++) {
opts.area[j] = opts.padding[j];
}
//通过计算三大区域:图例、X轴、Y轴的大小,确定绘图区域
var _calLegendData = calLegendData(seriesMA, opts, config, opts.chartData),
legendHeight = _calLegendData.area.wholeHeight,
legendWidth = _calLegendData.area.wholeWidth;
switch (opts.legend.position) {
case 'top':
opts.area[0] += legendHeight;
break;
case 'bottom':
opts.area[2] += legendHeight;
break;
case 'left':
opts.area[3] += legendWidth;
break;
case 'right':
opts.area[1] += legendWidth;
break;
}
var _calYAxisData = {},
yAxisWidth = 0;
if (opts.type === 'line' || opts.type === 'column' || opts.type === 'area' || opts.type === 'mix' || opts.type === 'candle') {
_calYAxisData = calYAxisData(series, opts, config);
yAxisWidth = _calYAxisData.yAxisWidth;
//如果显示Y轴标题
if (opts.yAxis.showTitle) {
var maxTitleHeight = 0;
for (var i = 0; i < opts.yAxis.data.length; i++) {
maxTitleHeight = Math.max(maxTitleHeight, opts.yAxis.data[i].titleFontSize ? opts.yAxis.data[i].titleFontSize : config.fontSize);
}
opts.area[0] += (maxTitleHeight + 6) * opts.pixelRatio;
}
var rightIndex = 0,
leftIndex = 0;
//计算主绘图区域左右位置
for (var _i23 = 0; _i23 < yAxisWidth.length; _i23++) {
if (yAxisWidth[_i23].position == 'left') {
if (leftIndex > 0) {
opts.area[3] += yAxisWidth[_i23].width + opts.yAxis.padding;
} else {
opts.area[3] += yAxisWidth[_i23].width;
}
leftIndex += 1;
} else {
if (rightIndex > 0) {
opts.area[1] += yAxisWidth[_i23].width + opts.yAxis.padding;
} else {
opts.area[1] += yAxisWidth[_i23].width;
}
rightIndex += 1;
}
}
} else {
config.yAxisWidth = yAxisWidth;
}
opts.chartData.yAxisData = _calYAxisData;
if (opts.categories && opts.categories.length) {
opts.chartData.xAxisData = getXAxisPoints(opts.categories, opts, config);
var _calCategoriesData = calCategoriesData(opts.categories, opts, config, opts.chartData.xAxisData.eachSpacing),
xAxisHeight = _calCategoriesData.xAxisHeight,
angle = _calCategoriesData.angle;
config.xAxisHeight = xAxisHeight;
config._xAxisTextAngle_ = angle;
opts.area[2] += xAxisHeight;
opts.chartData.categoriesData = _calCategoriesData;
} else {
if (opts.type === 'line' || opts.type === 'area' || opts.type === 'points') {
opts.chartData.xAxisData = calXAxisData(series, opts, config);
categories = opts.chartData.xAxisData.rangesFormat;
var _calCategoriesData2 = calCategoriesData(categories, opts, config, opts.chartData.xAxisData.eachSpacing),
_xAxisHeight = _calCategoriesData2.xAxisHeight,
_angle = _calCategoriesData2.angle;
config.xAxisHeight = _xAxisHeight;
config._xAxisTextAngle_ = _angle;
opts.area[2] += _xAxisHeight;
opts.chartData.categoriesData = _calCategoriesData2;
} else {
opts.chartData.xAxisData = {
xAxisPoints: []
};
}
}
//计算右对齐偏移距离
if (opts.enableScroll && opts.xAxis.scrollAlign == 'right' && opts._scrollDistance_ === undefined) {
var offsetLeft = 0,
xAxisPoints = opts.chartData.xAxisData.xAxisPoints,
startX = opts.chartData.xAxisData.startX,
endX = opts.chartData.xAxisData.endX,
eachSpacing = opts.chartData.xAxisData.eachSpacing;
var totalWidth = eachSpacing * (xAxisPoints.length - 1);
var screenWidth = endX - startX;
offsetLeft = screenWidth - totalWidth;
_this.scrollOption = {
currentOffset: offsetLeft,
startTouchX: offsetLeft,
distance: 0,
lastMoveTime: 0
};
opts._scrollDistance_ = offsetLeft;
}
if (type === 'pie' || type === 'ring' || type === 'rose') {
config._pieTextMaxLength_ = opts.dataLabel === false ? 0 : getPieTextMaxLength(seriesMA);
}
switch (type) {
case 'word':
var wordOption = assign({}, {
type: 'normal',
autoColors: true
}, opts.extra.word);
if (opts.updateData == true || opts.updateData == undefined) {
opts.chartData.wordCloudData = getWordCloudPoint(opts, wordOption.type);
}
this.animationInstance = new Animation({
timing: 'easeInOut',
duration: duration,
onProcess: function onProcess(process) {
context.clearRect(0, 0, opts.width, opts.height);
if (opts.rotate) {
contextRotate(context, opts);
}
drawWordCloudDataPoints(series, opts, config, context, process);
drawCanvas(opts, context);
},
onAnimationFinish: function onAnimationFinish() {
_this.event.trigger('renderComplete');
}
});
break;
case 'map':
context.clearRect(0, 0, opts.width, opts.height);
drawMapDataPoints(series, opts, config, context);
break;
case 'funnel':
this.animationInstance = new Animation({
timing: 'easeInOut',
duration: duration,
onProcess: function onProcess(process) {
context.clearRect(0, 0, opts.width, opts.height);
if (opts.rotate) {
contextRotate(context, opts);
}
opts.chartData.funnelData = drawFunnelDataPoints(series, opts, config, context, process);
drawLegend(opts.series, opts, config, context, opts.chartData);
drawToolTipBridge(opts, config, context, process);
drawCanvas(opts, context);
},
onAnimationFinish: function onAnimationFinish() {
_this.event.trigger('renderComplete');
}
});
break;
case 'line':
this.animationInstance = new Animation({
timing: 'easeIn',
duration: duration,
onProcess: function onProcess(process) {
context.clearRect(0, 0, opts.width, opts.height);
if (opts.rotate) {
contextRotate(context, opts);
}
drawYAxisGrid(categories, opts, config, context);
drawXAxis(categories, opts, config, context);
var _drawLineDataPoints = drawLineDataPoints(series, opts, config, context, process),
xAxisPoints = _drawLineDataPoints.xAxisPoints,
calPoints = _drawLineDataPoints.calPoints,
eachSpacing = _drawLineDataPoints.eachSpacing;
opts.chartData.xAxisPoints = xAxisPoints;
opts.chartData.calPoints = calPoints;
opts.chartData.eachSpacing = eachSpacing;
drawYAxis(series, opts, config, context);
if (opts.enableMarkLine !== false && process === 1) {
drawMarkLine(opts, config, context);
}
drawLegend(opts.series, opts, config, context, opts.chartData);
drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints);
drawCanvas(opts, context);
},
onAnimationFinish: function onAnimationFinish() {
_this.event.trigger('renderComplete');
}
});
break;
case 'mix':
this.animationInstance = new Animation({
timing: 'easeIn',
duration: duration,
onProcess: function onProcess(process) {
context.clearRect(0, 0, opts.width, opts.height);
if (opts.rotate) {
contextRotate(context, opts);
}
drawYAxisGrid(categories, opts, config, context);
drawXAxis(categories, opts, config, context);
var _drawMixDataPoints = drawMixDataPoints(series, opts, config, context, process),
xAxisPoints = _drawMixDataPoints.xAxisPoints,
calPoints = _drawMixDataPoints.calPoints,
eachSpacing = _drawMixDataPoints.eachSpacing;
opts.chartData.xAxisPoints = xAxisPoints;
opts.chartData.calPoints = calPoints;
opts.chartData.eachSpacing = eachSpacing;
drawYAxis(series, opts, config, context);
if (opts.enableMarkLine !== false && process === 1) {
drawMarkLine(opts, config, context);
}
drawLegend(opts.series, opts, config, context, opts.chartData);
drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints);
drawCanvas(opts, context);
},
onAnimationFinish: function onAnimationFinish() {
_this.event.trigger('renderComplete');
}
});
break;
case 'column':
this.animationInstance = new Animation({
timing: 'easeIn',
duration: duration,
onProcess: function onProcess(process) {
context.clearRect(0, 0, opts.width, opts.height);
if (opts.rotate) {
contextRotate(context, opts);
}
drawYAxisGrid(categories, opts, config, context);
drawXAxis(categories, opts, config, context);
var _drawColumnDataPoints = drawColumnDataPoints(series, opts, config, context, process),
xAxisPoints = _drawColumnDataPoints.xAxisPoints,
calPoints = _drawColumnDataPoints.calPoints,
eachSpacing = _drawColumnDataPoints.eachSpacing;
opts.chartData.xAxisPoints = xAxisPoints;
opts.chartData.calPoints = calPoints;
opts.chartData.eachSpacing = eachSpacing;
drawYAxis(series, opts, config, context);
if (opts.enableMarkLine !== false && process === 1) {
drawMarkLine(opts, config, context);
}
drawLegend(opts.series, opts, config, context, opts.chartData);
drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints);
drawCanvas(opts, context);
},
onAnimationFinish: function onAnimationFinish() {
_this.event.trigger('renderComplete');
}
});
break;
case 'area':
this.animationInstance = new Animation({
timing: 'easeIn',
duration: duration,
onProcess: function onProcess(process) {
context.clearRect(0, 0, opts.width, opts.height);
if (opts.rotate) {
contextRotate(context, opts);
}
drawYAxisGrid(categories, opts, config, context);
drawXAxis(categories, opts, config, context);
var _drawAreaDataPoints = drawAreaDataPoints(series, opts, config, context, process),
xAxisPoints = _drawAreaDataPoints.xAxisPoints,
calPoints = _drawAreaDataPoints.calPoints,
eachSpacing = _drawAreaDataPoints.eachSpacing;
opts.chartData.xAxisPoints = xAxisPoints;
opts.chartData.calPoints = calPoints;
opts.chartData.eachSpacing = eachSpacing;
drawYAxis(series, opts, config, context);
if (opts.enableMarkLine !== false && process === 1) {
drawMarkLine(opts, config, context);
}
drawLegend(opts.series, opts, config, context, opts.chartData);
drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints);
drawCanvas(opts, context);
},
onAnimationFinish: function onAnimationFinish() {
_this.event.trigger('renderComplete');
}
});
break;
case 'ring':
case 'pie':
this.animationInstance = new Animation({
timing: 'easeInOut',
duration: duration,
onProcess: function onProcess(process) {
context.clearRect(0, 0, opts.width, opts.height);
if (opts.rotate) {
contextRotate(context, opts);
}
opts.chartData.pieData = drawPieDataPoints(series, opts, config, context, process);
drawLegend(opts.series, opts, config, context, opts.chartData);
drawToolTipBridge(opts, config, context, process);
drawCanvas(opts, context);
},
onAnimationFinish: function onAnimationFinish() {
_this.event.trigger('renderComplete');
}
});
break;
case 'rose':
this.animationInstance = new Animation({
timing: 'easeInOut',
duration: duration,
onProcess: function onProcess(process) {
context.clearRect(0, 0, opts.width, opts.height);
if (opts.rotate) {
contextRotate(context, opts);
}
opts.chartData.pieData = drawRoseDataPoints(series, opts, config, context, process);
drawLegend(opts.series, opts, config, context, opts.chartData);
drawToolTipBridge(opts, config, context, process);
drawCanvas(opts, context);
},
onAnimationFinish: function onAnimationFinish() {
_this.event.trigger('renderComplete');
}
});
break;
case 'radar':
this.animationInstance = new Animation({
timing: 'easeInOut',
duration: duration,
onProcess: function onProcess(process) {
context.clearRect(0, 0, opts.width, opts.height);
if (opts.rotate) {
contextRotate(context, opts);
}
opts.chartData.radarData = drawRadarDataPoints(series, opts, config, context, process);
drawLegend(opts.series, opts, config, context, opts.chartData);
drawToolTipBridge(opts, config, context, process);
drawCanvas(opts, context);
},
onAnimationFinish: function onAnimationFinish() {
_this.event.trigger('renderComplete');
}
});
break;
case 'arcbar':
this.animationInstance = new Animation({
timing: 'easeInOut',
duration: duration,
onProcess: function onProcess(process) {
context.clearRect(0, 0, opts.width, opts.height);
if (opts.rotate) {
contextRotate(context, opts);
}
opts.chartData.arcbarData = drawArcbarDataPoints(series, opts, config, context, process);
drawCanvas(opts, context);
},
onAnimationFinish: function onAnimationFinish() {
_this.event.trigger('renderComplete');
}
});
break;
case 'gauge':
this.animationInstance = new Animation({
timing: 'easeInOut',
duration: duration,
onProcess: function onProcess(process) {
context.clearRect(0, 0, opts.width, opts.height);
if (opts.rotate) {
contextRotate(context, opts);
}
opts.chartData.gaugeData = drawGaugeDataPoints(categories, series, opts, config, context, process);
drawCanvas(opts, context);
},
onAnimationFinish: function onAnimationFinish() {
_this.event.trigger('renderComplete');
}
});
break;
case 'candle':
this.animationInstance = new Animation({
timing: 'easeIn',
duration: duration,
onProcess: function onProcess(process) {
context.clearRect(0, 0, opts.width, opts.height);
if (opts.rotate) {
contextRotate(context, opts);
}
drawYAxisGrid(categories, opts, config, context);
drawXAxis(categories, opts, config, context);
var _drawCandleDataPoints = drawCandleDataPoints(series, seriesMA, opts, config, context, process),
xAxisPoints = _drawCandleDataPoints.xAxisPoints,
calPoints = _drawCandleDataPoints.calPoints,
eachSpacing = _drawCandleDataPoints.eachSpacing;
opts.chartData.xAxisPoints = xAxisPoints;
opts.chartData.calPoints = calPoints;
opts.chartData.eachSpacing = eachSpacing;
drawYAxis(series, opts, config, context);
if (opts.enableMarkLine !== false && process === 1) {
drawMarkLine(opts, config, context);
}
if (seriesMA) {
drawLegend(seriesMA, opts, config, context, opts.chartData);
} else {
drawLegend(opts.series, opts, config, context, opts.chartData);
}
drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints);
drawCanvas(opts, context);
},
onAnimationFinish: function onAnimationFinish() {
_this.event.trigger('renderComplete');
}
});
break;
}
}
// simple event implement
function Event() {
this.events = {};
}
Event.prototype.addEventListener = function (type, listener) {
this.events[type] = this.events[type] || [];
this.events[type].push(listener);
};
Event.prototype.delEventListener = function (type) {
this.events[type] = [];
};
Event.prototype.trigger = function () {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var type = args[0];
var params = args.slice(1);
if (!!this.events[type]) {
this.events[type].forEach(function (listener) {
try {
listener.apply(null, params);
} catch (e) {
console.error(e);
}
});
}
};
var Charts = function Charts(opts) {
opts.pixelRatio = opts.pixelRatio ? opts.pixelRatio : 1;
opts.fontSize = opts.fontSize ? opts.fontSize * opts.pixelRatio : 13 * opts.pixelRatio;
opts.title = assign({}, opts.title);
opts.subtitle = assign({}, opts.subtitle);
opts.duration = opts.duration ? opts.duration : 1000;
opts.yAxis = assign({}, {
data: [],
showTitle: false,
disabled: false,
disableGrid: false,
splitNumber: 5,
gridType: 'solid',
dashLength: 4 * opts.pixelRatio,
gridColor: '#cccccc',
padding: 10,
fontColor: '#666666'
}, opts.yAxis);
opts.yAxis.dashLength *= opts.pixelRatio;
opts.yAxis.padding *= opts.pixelRatio;
opts.xAxis = assign({}, {
rotateLabel: false,
type: 'calibration',
gridType: 'solid',
dashLength: 4,
scrollAlign: 'left',
boundaryGap: 'center',
axisLine: true,
axisLineColor: '#cccccc'
}, opts.xAxis);
opts.xAxis.dashLength *= opts.pixelRatio;
opts.legend = assign({}, {
show: true,
position: 'bottom',
float: 'center',
backgroundColor: 'rgba(0,0,0,0)',
borderColor: 'rgba(0,0,0,0)',
borderWidth: 0,
padding: 5,
margin: 5,
itemGap: 10,
fontSize: opts.fontSize,
lineHeight: opts.fontSize,
fontColor: '#333333',
format: {},
hiddenColor: '#CECECE'
}, opts.legend);
opts.legend.borderWidth = opts.legend.borderWidth * opts.pixelRatio;
opts.legend.itemGap = opts.legend.itemGap * opts.pixelRatio;
opts.legend.padding = opts.legend.padding * opts.pixelRatio;
opts.legend.margin = opts.legend.margin * opts.pixelRatio;
opts.extra = assign({}, opts.extra);
opts.rotate = opts.rotate ? true : false;
opts.animation = opts.animation ? true : false;
opts.rotate = opts.rotate ? true : false;
opts.canvas2d = opts.canvas2d ? true : false;
var config$$1 = JSON.parse(JSON.stringify(config));
config$$1.colors = opts.colors ? opts.colors : config$$1.colors;
config$$1.yAxisTitleWidth = opts.yAxis.disabled !== true && opts.yAxis.title ? config$$1.yAxisTitleWidth : 0;
if (opts.type == 'pie' || opts.type == 'ring') {
config$$1.pieChartLinePadding = opts.dataLabel === false ? 0 : opts.extra.pie.labelWidth * opts.pixelRatio || config$$1.pieChartLinePadding * opts.pixelRatio;
}
if (opts.type == 'rose') {
config$$1.pieChartLinePadding = opts.dataLabel === false ? 0 : opts.extra.rose.labelWidth * opts.pixelRatio || config$$1.pieChartLinePadding * opts.pixelRatio;
}
config$$1.pieChartTextPadding = opts.dataLabel === false ? 0 : config$$1.pieChartTextPadding * opts.pixelRatio;
config$$1.yAxisSplit = opts.yAxis.splitNumber ? opts.yAxis.splitNumber : config.yAxisSplit;
//屏幕旋转
config$$1.rotate = opts.rotate;
if (opts.rotate) {
var tempWidth = opts.width;
var tempHeight = opts.height;
opts.width = tempHeight;
opts.height = tempWidth;
}
//适配高分屏
opts.padding = opts.padding ? opts.padding : config$$1.padding;
for (var i = 0; i < 4; i++) {
opts.padding[i] *= opts.pixelRatio;
}
config$$1.yAxisWidth = config.yAxisWidth * opts.pixelRatio;
config$$1.xAxisHeight = config.xAxisHeight * opts.pixelRatio;
if (opts.enableScroll && opts.xAxis.scrollShow) {
config$$1.xAxisHeight += 6 * opts.pixelRatio;
}
config$$1.xAxisLineHeight = config.xAxisLineHeight * opts.pixelRatio;
config$$1.fontSize = opts.fontSize;
config$$1.titleFontSize = config.titleFontSize * opts.pixelRatio;
config$$1.subtitleFontSize = config.subtitleFontSize * opts.pixelRatio;
config$$1.toolTipPadding = config.toolTipPadding * opts.pixelRatio;
config$$1.toolTipLineHeight = config.toolTipLineHeight * opts.pixelRatio;
config$$1.columePadding = config.columePadding * opts.pixelRatio;
this.context = opts.context ? opts.context : uni.createCanvasContext(opts.canvasId, opts.$this);
if (opts.canvas2d) {
this.context.setStrokeStyle = function (e) {
return this.strokeStyle = e;
};
this.context.setLineWidth = function (e) {
return this.lineWidth = e;
};
this.context.setLineCap = function (e) {
return this.lineCap = e;
};
this.context.setFontSize = function (e) {
return this.font = e + "px sans-serif";
};
this.context.setFillStyle = function (e) {
return this.fillStyle = e;
};
this.context.draw = function () {};
}
/* 兼容原生H5
this.context = document.getElementById(opts.canvasId).getContext("2d");
this.context.setStrokeStyle = function(e){ return this.strokeStyle=e; }
this.context.setLineWidth = function(e){ return this.lineWidth=e; }
this.context.setLineCap = function(e){ return this.lineCap=e; }
this.context.setFontSize = function(e){ return this.font=e+"px sans-serif"; }
this.context.setFillStyle = function(e){ return this.fillStyle=e; }
this.context.draw = function(){ }
*/
opts.chartData = {};
this.event = new Event();
this.scrollOption = {
currentOffset: 0,
startTouchX: 0,
distance: 0,
lastMoveTime: 0
};
this.opts = opts;
this.config = config$$1;
drawCharts.call(this, opts.type, opts, config$$1, this.context);
};
Charts.prototype.updateData = function () {
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
this.opts = assign({}, this.opts, data);
this.opts.updateData = true;
var scrollPosition = data.scrollPosition || 'current';
switch (scrollPosition) {
case 'current':
this.opts._scrollDistance_ = this.scrollOption.currentOffset;
break;
case 'left':
this.opts._scrollDistance_ = 0;
this.scrollOption = {
currentOffset: 0,
startTouchX: 0,
distance: 0,
lastMoveTime: 0
};
break;
case 'right':
var _calYAxisData = calYAxisData(this.opts.series, this.opts, this.config),
yAxisWidth = _calYAxisData.yAxisWidth;
this.config.yAxisWidth = yAxisWidth;
var offsetLeft = 0;
var _getXAxisPoints0 = getXAxisPoints(this.opts.categories, this.opts, this.config),
xAxisPoints = _getXAxisPoints0.xAxisPoints,
startX = _getXAxisPoints0.startX,
endX = _getXAxisPoints0.endX,
eachSpacing = _getXAxisPoints0.eachSpacing;
var totalWidth = eachSpacing * (xAxisPoints.length - 1);
var screenWidth = endX - startX;
offsetLeft = screenWidth - totalWidth;
this.scrollOption = {
currentOffset: offsetLeft,
startTouchX: offsetLeft,
distance: 0,
lastMoveTime: 0
};
this.opts._scrollDistance_ = offsetLeft;
break;
}
drawCharts.call(this, this.opts.type, this.opts, this.config, this.context);
};
Charts.prototype.zoom = function () {
var val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.opts.xAxis.itemCount;
if (this.opts.enableScroll !== true) {
console.log('请启用滚动条后使用!');
return;
}
//当前屏幕中间点
var centerPoint = Math.round(Math.abs(this.scrollOption.currentOffset) / this.opts.chartData.eachSpacing) + Math.round(this.opts.xAxis.itemCount / 2);
this.opts.animation = false;
this.opts.xAxis.itemCount = val.itemCount;
//重新计算x轴偏移距离
var _calYAxisData = calYAxisData(this.opts.series, this.opts, this.config),
yAxisWidth = _calYAxisData.yAxisWidth;
this.config.yAxisWidth = yAxisWidth;
var offsetLeft = 0;
var _getXAxisPoints0 = getXAxisPoints(this.opts.categories, this.opts, this.config),
xAxisPoints = _getXAxisPoints0.xAxisPoints,
startX = _getXAxisPoints0.startX,
endX = _getXAxisPoints0.endX,
eachSpacing = _getXAxisPoints0.eachSpacing;
var centerLeft = eachSpacing * centerPoint;
var screenWidth = endX - startX;
var MaxLeft = screenWidth - eachSpacing * (xAxisPoints.length - 1);
offsetLeft = screenWidth / 2 - centerLeft;
if (offsetLeft > 0) {
offsetLeft = 0;
}
if (offsetLeft < MaxLeft) {
offsetLeft = MaxLeft;
}
this.scrollOption = {
currentOffset: offsetLeft,
startTouchX: offsetLeft,
distance: 0,
lastMoveTime: 0
};
this.opts._scrollDistance_ = offsetLeft;
drawCharts.call(this, this.opts.type, this.opts, this.config, this.context);
};
Charts.prototype.stopAnimation = function () {
this.animationInstance && this.animationInstance.stop();
};
Charts.prototype.addEventListener = function (type, listener) {
this.event.addEventListener(type, listener);
};
Charts.prototype.delEventListener = function (type) {
this.event.delEventListener(type);
};
Charts.prototype.getCurrentDataIndex = function (e) {
var touches = null;
if (e.changedTouches) {
touches = e.changedTouches[0];
} else {
touches = e.mp.changedTouches[0];
}
if (touches) {
var _touches$ = getTouches(touches, this.opts, e);
if (this.opts.type === 'pie' || this.opts.type === 'ring' || this.opts.type === 'rose') {
return findPieChartCurrentIndex({
x: _touches$.x,
y: _touches$.y
}, this.opts.chartData.pieData);
} else if (this.opts.type === 'radar') {
return findRadarChartCurrentIndex({
x: _touches$.x,
y: _touches$.y
}, this.opts.chartData.radarData, this.opts.categories.length);
} else if (this.opts.type === 'funnel') {
return findFunnelChartCurrentIndex({
x: _touches$.x,
y: _touches$.y
}, this.opts.chartData.funnelData);
} else if (this.opts.type === 'map') {
return findMapChartCurrentIndex({
x: _touches$.x,
y: _touches$.y
}, this.opts);
} else if (this.opts.type === 'word') {
return findWordChartCurrentIndex({
x: _touches$.x,
y: _touches$.y
}, this.opts.chartData.wordCloudData);
} else {
return findCurrentIndex({
x: _touches$.x,
y: _touches$.y
}, this.opts.chartData.calPoints, this.opts, this.config, Math.abs(this.scrollOption.currentOffset));
}
}
return -1;
};
Charts.prototype.getLegendDataIndex = function (e) {
var touches = null;
if (e.changedTouches) {
touches = e.changedTouches[0];
} else {
touches = e.mp.changedTouches[0];
}
if (touches) {
var _touches$ = getTouches(touches, this.opts, e);
return findLegendIndex({
x: _touches$.x,
y: _touches$.y
}, this.opts.chartData.legendData);
}
return -1;
};
Charts.prototype.touchLegend = function (e) {
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var touches = null;
if (e.changedTouches) {
touches = e.changedTouches[0];
} else {
touches = e.mp.changedTouches[0];
}
if (touches) {
var _touches$ = getTouches(touches, this.opts, e);
var index = this.getLegendDataIndex(e);
if (index >= 0) {
this.opts.series[index].show = !this.opts.series[index].show;
this.opts.animation = option.animation ? true : false;
this.opts._scrollDistance_ = this.scrollOption.currentOffset;
drawCharts.call(this, this.opts.type, this.opts, this.config, this.context);
}
}
};
Charts.prototype.showToolTip = function (e) {
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var touches = null;
if (e.changedTouches) {
touches = e.changedTouches[0];
} else {
touches = e.mp.changedTouches[0];
}
if (!touches) {
console.log("touchError");
}
var _touches$ = getTouches(touches, this.opts, e);
var currentOffset = this.scrollOption.currentOffset;
var opts = assign({}, this.opts, {
_scrollDistance_: currentOffset,
animation: false
});
if (this.opts.type === 'line' || this.opts.type === 'area' || this.opts.type === 'column') {
var index = option.index == undefined ? this.getCurrentDataIndex(e) : option.index;
if (index > -1) {
var seriesData = getSeriesDataItem(this.opts.series, index);
if (seriesData.length !== 0) {
var _getToolTipData = getToolTipData(seriesData, this.opts.chartData.calPoints, index, this.opts.categories, option),
textList = _getToolTipData.textList,
offset = _getToolTipData.offset;
offset.y = _touches$.y;
opts.tooltip = {
textList: option.textList ? option.textList : textList,
offset: offset,
option: option,
index: index
};
}
}
drawCharts.call(this, opts.type, opts, this.config, this.context);
}
if (this.opts.type === 'mix') {
var index = option.index == undefined ? this.getCurrentDataIndex(e) : option.index;
if (index > -1) {
var currentOffset = this.scrollOption.currentOffset;
var opts = assign({}, this.opts, {
_scrollDistance_: currentOffset,
animation: false
});
var seriesData = getSeriesDataItem(this.opts.series, index);
if (seriesData.length !== 0) {
var _getMixToolTipData = getMixToolTipData(seriesData, this.opts.chartData.calPoints, index, this.opts.categories, option),
textList = _getMixToolTipData.textList,
offset = _getMixToolTipData.offset;
offset.y = _touches$.y;
opts.tooltip = {
textList: option.textList ? option.textList : textList,
offset: offset,
option: option,
index: index
};
}
}
drawCharts.call(this, opts.type, opts, this.config, this.context);
}
if (this.opts.type === 'candle') {
var index = option.index == undefined ? this.getCurrentDataIndex(e) : option.index;
if (index > -1) {
var currentOffset = this.scrollOption.currentOffset;
var opts = assign({}, this.opts, {
_scrollDistance_: currentOffset,
animation: false
});
var seriesData = getSeriesDataItem(this.opts.series, index);
if (seriesData.length !== 0) {
var _getToolTipData = getCandleToolTipData(this.opts.series[0].data, seriesData, this.opts.chartData.calPoints, index, this.opts.categories, this.opts.extra.candle, option),
textList = _getToolTipData.textList,
offset = _getToolTipData.offset;
offset.y = _touches$.y;
opts.tooltip = {
textList: option.textList ? option.textList : textList,
offset: offset,
option: option,
index: index
};
}
}
drawCharts.call(this, opts.type, opts, this.config, this.context);
}
if (this.opts.type === 'pie' || this.opts.type === 'ring' || this.opts.type === 'rose' || this.opts.type === 'funnel') {
var index = option.index == undefined ? this.getCurrentDataIndex(e) : option.index;
if (index > -1) {
var currentOffset = this.scrollOption.currentOffset;
var opts = assign({}, this.opts, {
_scrollDistance_: currentOffset,
animation: false
});
var seriesData = this.opts._series_[index];
var textList = [{
text: option.format ? option.format(seriesData) : seriesData.name + ': ' + seriesData.data,
color: seriesData.color
}];
var offset = {
x: _touches$.x,
y: _touches$.y
};
opts.tooltip = {
textList: option.textList ? option.textList : textList,
offset: offset,
option: option,
index: index
};
}
drawCharts.call(this, opts.type, opts, this.config, this.context);
}
if (this.opts.type === 'map' || this.opts.type === 'word') {
var index = option.index == undefined ? this.getCurrentDataIndex(e) : option.index;
if (index > -1) {
var currentOffset = this.scrollOption.currentOffset;
var opts = assign({}, this.opts, {
_scrollDistance_: currentOffset,
animation: false
});
var seriesData = this.opts._series_[index];
var textList = [{
text: option.format ? option.format(seriesData) : seriesData.properties.name,
color: seriesData.color
}];
var offset = {
x: _touches$.x,
y: _touches$.y
};
opts.tooltip = {
textList: option.textList ? option.textList : textList,
offset: offset,
option: option,
index: index
};
}
opts.updateData = false;
drawCharts.call(this, opts.type, opts, this.config, this.context);
}
if (this.opts.type === 'radar') {
var index = option.index == undefined ? this.getCurrentDataIndex(e) : option.index;
if (index > -1) {
var currentOffset = this.scrollOption.currentOffset;
var opts = assign({}, this.opts, {
_scrollDistance_: currentOffset,
animation: false
});
var seriesData = getSeriesDataItem(this.opts.series, index);
if (seriesData.length !== 0) {
var textList = seriesData.map(function (item) {
return {
text: option.format ? option.format(item) : item.name + ': ' + item.data,
color: item.color
};
});
var offset = {
x: _touches$.x,
y: _touches$.y
};
opts.tooltip = {
textList: option.textList ? option.textList : textList,
offset: offset,
option: option,
index: index
};
}
}
drawCharts.call(this, opts.type, opts, this.config, this.context);
}
};
Charts.prototype.translate = function (distance) {
this.scrollOption = {
currentOffset: distance,
startTouchX: distance,
distance: 0,
lastMoveTime: 0
};
var opts = assign({}, this.opts, {
_scrollDistance_: distance,
animation: false
});
drawCharts.call(this, this.opts.type, opts, this.config, this.context);
};
Charts.prototype.scrollStart = function (e) {
var touches = null;
if (e.changedTouches) {
touches = e.changedTouches[0];
} else {
touches = e.mp.changedTouches[0];
}
var _touches$ = getTouches(touches, this.opts, e);
if (touches && this.opts.enableScroll === true) {
this.scrollOption.startTouchX = _touches$.x;
}
};
Charts.prototype.scroll = function (e) {
if (this.scrollOption.lastMoveTime === 0) {
this.scrollOption.lastMoveTime = Date.now();
}
var Limit = this.opts.extra.touchMoveLimit || 20;
var currMoveTime = Date.now();
var duration = currMoveTime - this.scrollOption.lastMoveTime;
if (duration < Math.floor(1000 / Limit)) return;
this.scrollOption.lastMoveTime = currMoveTime;
var touches = null;
if (e.changedTouches) {
touches = e.changedTouches[0];
} else {
touches = e.mp.changedTouches[0];
}
if (touches && this.opts.enableScroll === true) {
var _touches$ = getTouches(touches, this.opts, e);
var _distance;
_distance = _touches$.x - this.scrollOption.startTouchX;
var currentOffset = this.scrollOption.currentOffset;
var validDistance = calValidDistance(this, currentOffset + _distance, this.opts.chartData, this.config, this.opts);
this.scrollOption.distance = _distance = validDistance - currentOffset;
var opts = assign({}, this.opts, {
_scrollDistance_: currentOffset + _distance,
animation: false
});
drawCharts.call(this, opts.type, opts, this.config, this.context);
return currentOffset + _distance;
}
};
Charts.prototype.scrollEnd = function (e) {
if (this.opts.enableScroll === true) {
var _scrollOption = this.scrollOption,
currentOffset = _scrollOption.currentOffset,
distance = _scrollOption.distance;
this.scrollOption.currentOffset = currentOffset + distance;
this.scrollOption.distance = 0;
}
};
if (( false ? undefined : _typeof(module)) === "object" && _typeof(module.exports) === "object") {
module.exports = Charts;
//export default Charts;//建议使用nodejs的module导出方式,如报错请使用export方式导出
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! (webpack)/buildin/module.js */ 163)(module)))
/***/ }),
/***/ 371:
/*!************************************************************!*\
!*** E:/project/bigdata_WX/static/js/equipState_dict.json ***!
\************************************************************/
/*! exports provided: imei, iccid, csq, lat, lng, dtype, ws, dver, vbat, st, et, tps, lps, rps, dps, collt, current, hrt, hst, at, ah, stamp, dat_f, rcnt, htim, batStatus, tt, shake, shake_sec, ts, upds, dnds, lamp, fuse_voltage, ds, bt, tcs, clt_t, gps, cv, bv, ct, info, proj, btype, cs, bs, infr_ct, volt_ct, wind_drec, wind_sped, cold_sw, wind_sw, pre_temp, set_temp, usb_sta, work_sta, imgres, staytime, cul_time, coll_time, addtime, hs, is_online, gs, tph, tpl, boot, lux, clt, dattim, datt, tbs, type, simStatus, default */
/***/ (function(module) {
module.exports = JSON.parse("{\"imei\":{\"name\":\"设备ID\",\"unit\":\"\",\"desc\":\"通讯板唯一ID\"},\"iccid\":{\"name\":\"物联网卡\",\"unit\":\"\",\"desc\":\"用于查询物联网卡的套餐、流量信息等\"},\"csq\":{\"name\":\"信号强度\",\"unit\":\"\",\"desc\":\"\"},\"lat\":{\"name\":\"纬度\",\"unit\":\"\",\"desc\":\"\"},\"lng\":{\"name\":\"经度\",\"unit\":\"\",\"desc\":\"\"},\"dtype\":{\"name\":\"设备类型\",\"unit\":\"\",\"desc\":\"\"},\"ws\":{\"name\":\"工作状态\",\"unit\":\"\",\"value\":{\"0\":\"待机\",\"1\":\"工作\",\"2\":\"充电\"},\"desc\":\"工作状态、0 待机, 1 工作\"},\"dver\":{\"name\":\"设备版本\",\"unit\":\"\",\"desc\":\"设备固件版本\"},\"vbat\":{\"name\":\"电压\",\"unit\":\"V\",\"desc\":\"\"},\"st\":{\"name\":\"开始时间\",\"unit\":\"h\",\"desc\":\"时控开始时间:0-23\"},\"et\":{\"name\":\"结束时间\",\"unit\":\"h\",\"desc\":\"时控结束时间:0-23\"},\"tps\":{\"name\":\"温控状态\",\"unit\":\"\",\"value\":{\"0\":\"正常\",\"1\":\"温控\"},\"desc\":\"0-正常,1-保护\"},\"lps\":{\"name\":\"光控状态\",\"unit\":\"\",\"value\":{\"0\":\"正常\",\"1\":\"光控\"},\"desc\":\"0-正常,1-保护\"},\"rps\":{\"name\":\"雨控状态\",\"unit\":\"\",\"value\":{\"0\":\"正常\",\"1\":\"雨控\"},\"desc\":\"0-正常,1-保护\"},\"dps\":{\"name\":\"倾倒状态\",\"unit\":\"\",\"value\":{\"0\":\"正常\",\"1\":\"保护\"},\"desc\":\"0-正常,1-保护\"},\"collt\":{\"name\":\"收集时间\",\"unit\":\"\",\"desc\":\"收集时间:1-30\"},\"current\":{\"name\":\"功率\",\"unit\":\"mA\",\"desc\":\"功率:单位mA\"},\"hrt\":{\"name\":\"加热仓温度\",\"unit\":\"°C\",\"desc\":\"加热仓实时温度\"},\"hst\":{\"name\":\"加热仓设定温度\",\"unit\":\"°C\",\"desc\":\"加热仓设定温度:70-130\"},\"at\":{\"name\":\"环境温度\",\"unit\":\"°C\",\"desc\":\"\"},\"ah\":{\"name\":\"环境湿度\",\"unit\":\"%RH\",\"desc\":\"\"},\"stamp\":{\"name\":\"时间\",\"unit\":\"\",\"desc\":\"\"},\"dat_f\":{\"name\":\"数据上传间隔\",\"unit\":\"\",\"desc\":\"数据上传时间间隔\"},\"rcnt\":{\"name\":\"开机次数\",\"unit\":\"\",\"desc\":\"每次重启加1\"},\"htim\":{\"name\":\"加热时间\",\"unit\":\"min\",\"desc\":\"加热时间:1-30分钟\"},\"batStatus\":{\"name\":\"电压状态\",\"unit\":\"\",\"value\":{\"0\":\"正常\",\"1\":\"电量过低\"},\"desc\":\"0-正常 1-欠压\"},\"tt\":{\"name\":\"定时时长\",\"unit\":\"h\",\"desc\":\"定时时间1~10\"},\"shake\":{\"name\":\"震动开关\",\"unit\":\"\",\"value\":{\"0\":\"关闭\",\"1\":\"开启\"},\"desc\":\"0-关,1-开\"},\"shake_sec\":{\"name\":\"震动时间\",\"unit\":\"ms\",\"desc\":\"1~20(步长:100ms)\"},\"ts\":{\"name\":\"定时模式\",\"unit\":\"\",\"value\":{\"0\":\"光控\",\"1\":\"时控\"},\"desc\":\"0-光控,1-时控\"},\"upds\":{\"name\":\"上仓门状态\",\"unit\":\"\",\"value\":{\"0\":\"关闭\",\"1\":\"开启\"},\"desc\":\"1 打开,0 关闭\"},\"dnds\":{\"name\":\"下仓门状态\",\"unit\":\"\",\"value\":{\"0\":\"关闭\",\"1\":\"开启\"},\"desc\":\"1 打开,0 关闭\"},\"lamp\":{\"name\":\"灯管状态\",\"unit\":\"\",\"value\":{\"0\":\"工作\",\"1\":\"异常\"},\"desc\":\"灯管/工作状态 0 工作 1未工\"},\"fuse_voltage\":{\"name\":\"保险丝电压\",\"unit\":\"V\",\"desc\":\"\"},\"ds\":{\"name\":\"设备开关\",\"unit\":\"\",\"value\":{\"0\":\"关机\",\"1\":\"开机\"},\"desc\":\"0 关机 1 开机\"},\"bt\":{\"name\":\"主板温度\",\"unit\":\"°C\",\"desc\":\"\"},\"tcs\":{\"name\":\"时控开关\",\"unit\":\"\",\"value\":{\"0\":\"关机\",\"1\":\"开机\"},\"desc\":\"0 关闭 1 开启\"},\"clt_t\":{\"name\":\"清虫间隔\",\"unit\":\"min\",\"desc\":\"清虫时间间隔\"},\"gps\":{\"name\":\"定位方式\",\"unit\":\"\",\"value\":{\"0\":\"手动定位\",\"1\":\"GPS 定位\",\"2\":\"LBS 定位\"},\"desc\":\"0 手动定位 1 GPS 定位 2 LBS 定位\"},\"cv\":{\"name\":\"充电电压\",\"unit\":\"V\",\"desc\":\"充电电压\"},\"bv\":{\"name\":\"电池电压\",\"unit\":\"V\",\"desc\":\"电池电压\"},\"ct\":{\"name\":\"电击次数\",\"unit\":\"\",\"desc\":\"电击次数 (最大255)\"},\"info\":{\"name\":\"重启信息\",\"unit\":\"\",\"desc\":\"1正常 2 socket重连 3 MQTT重连\"},\"proj\":{\"name\":\"设备型号\",\"unit\":\"\",\"desc\":\"性诱一型或者二型\"},\"btype\":{\"name\":\"电池类型\",\"unit\":\"\",\"value\":{\"0\":\"蓄电池\",\"1\":\"锂电池\"},\"desc\":\"0 蓄电池,1锂电池\"},\"cs\":{\"name\":\"充电状态\",\"unit\":\"\",\"value\":{\"0\":\"非充电\",\"1\":\"充电\"},\"desc\":\"0非充电,1充电\"},\"bs\":{\"name\":\"电池状态\",\"unit\":\"\",\"value\":{\"0\":\"正常\",\"1\":\"欠压\",\"2\":\"过压\"},\"desc\":\"0 正常,1欠压, 2过压\"},\"infr_ct\":{\"name\":\"红外计数值\",\"unit\":\"\",\"desc\":\"性诱红外计数值\"},\"volt_ct\":{\"name\":\"高压计数值\",\"unit\":\"\",\"desc\":\"性诱高压计数值\"},\"wind_drec\":{\"name\":\"风向\",\"unit\":\"\",\"desc\":\"性诱风向\"},\"wind_sped\":{\"name\":\"风速\",\"unit\":\"\",\"desc\":\"性诱风向\"},\"cold_sw\":{\"name\":\"制冷开关\",\"unit\":\"\",\"value\":{\"0\":\"关闭\",\"1\":\"开启\"},\"desc\":\"制冷机开关 0 关闭, 1 开启\"},\"wind_sw\":{\"name\":\"风机开关\",\"unit\":\"\",\"value\":{\"0\":\"关闭\",\"1\":\"开启\"},\"desc\":\"风机开关 0 关闭, 1 开启\"},\"pre_temp\":{\"name\":\"保温仓温度\",\"unit\":\"℃\",\"desc\":\"保温仓当前温度-℃\"},\"set_temp\":{\"name\":\"保温仓设定温度\",\"unit\":\"℃\",\"desc\":\"保温仓设定温度-℃\"},\"usb_sta\":{\"name\":\"摄像头状态\",\"unit\":\"\",\"value\":{\"0\":\"正常\",\"1\":\"异常\"},\"desc\":\"摄像头状态 0 正常, 1 异常\"},\"work_sta\":{\"name\":\"摄像头状态\",\"unit\":\"\",\"value\":{\"0\":\"待机\",\"1\":\"收集\",\"2\":\"培养\",\"3\":\"拍照\"},\"desc\":\"摄像头状态 0 待机, 1 收集, 2 培养, 3 拍照\"},\"imgres\":{\"name\":\"图片分辨率\",\"unit\":\"\",\"desc\":\"图片分辨率默认为7(最高)\"},\"staytime\":{\"name\":\"已培养时间\",\"unit\":\"h\",\"desc\":\"已培养时间-小时\"},\"cul_time\":{\"name\":\"孢子培养时间\",\"unit\":\"h\",\"desc\":\"孢子培养时间-小时\"},\"coll_time\":{\"name\":\"收集时间\",\"unit\":\"h\",\"desc\":\"收集时间[8-10,14-16]\"},\"addtime\":{\"name\":\"上报时间\",\"unit\":\"\",\"desc\":\"数据上报时间\"},\"hs\":{\"name\":\"加热状态\",\"unit\":\"\",\"value\":{\"0\":\"正常\",\"1\":\"加热\"},\"desc\":\"测报灯状态0 正常, 1 加热\"},\"is_online\":{\"name\":\"在线状态\",\"unit\":\"\",\"value\":{\"0\":\"离线\",\"1\":\"在线\"},\"desc\":\"设备在线离线状态\"},\"gs\":{\"name\":\"通道状态\",\"unit\":\"\",\"value\":{\"0\":\"排水\",\"1\":\"落虫\"},\"desc\":\"通道状态\"},\"tph\":{\"name\":\"高温保护阀值\",\"unit\":\"°C\",\"desc\":\"高温保护阀值\"},\"tpl\":{\"name\":\"低温保护阀值\",\"unit\":\"°C\",\"desc\":\"低温保护阀值\"},\"boot\":{\"name\":\"禁止工作\",\"unit\":\"\",\"value\":{\"0\":\"正常\",\"1\":\"使能(禁止工作)\"},\"desc\":\"禁止工作\"},\"lux\":{\"name\":\"光照强度\",\"unit\":\"\",\"value\":{\"0\":\"正常\",\"1\":\"使能(禁止工作)\"},\"desc\":\"光照强度\"},\"clt\":{\"name\":\"清虫间隔\",\"unit\":\"min\",\"desc\":\"清虫时间间隔\"},\"dattim\":{\"name\":\"数据上传间隔\",\"unit\":\"\",\"desc\":\"数据上传时间间隔\"},\"datt\":{\"name\":\"数据上传间隔\",\"unit\":\"\",\"desc\":\"数据上传时间间隔\"},\"tbs\":{\"name\":\"灯管状态\",\"unit\":\"\",\"value\":{\"0\":\"正常\",\"1\":\"异常\"},\"desc\":\"数据上传时间间隔\"},\"type\":{\"name\":\"设备类型\",\"unit\":\"\",\"value\":{\"0\":\"--\",\"1\":\"--\",\"2\":\"杀虫灯\",\"3\":\"测报灯\",\"4\":\"性诱器\",\"5\":\"气象站\",\"6\":\"--\",\"7\":\"孢子仪\"},\"desc\":\"设备类型\"},\"simStatus\":{\"name\":\"sim卡状态\",\"unit\":\"\",\"value\":[{\"name\":\"未知\",\"val\":0},{\"name\":\"测试期\",\"val\":1},{\"name\":\"沉默期\",\"val\":2},{\"name\":\"使用中\",\"val\":3},{\"name\":\"停机\",\"val\":4},{\"name\":\"停机保号\",\"val\":5},{\"name\":\"预销号\",\"val\":6},{\"name\":\"销号\",\"val\":7}],\"desc\":\"sim卡状态\"}}");
/***/ }),
/***/ 38:
/*!************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/test.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
/**
* 验证电子邮箱格式
*/
function email(value) {
return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
}
/**
* 验证手机格式
*/
function mobile(value) {
return /^1[23456789]\d{9}$/.test(value);
}
/**
* 验证URL格式
*/
function url(value) {
return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
}
/**
* 验证日期格式
*/
function date(value) {
return !/Invalid|NaN/.test(new Date(value).toString());
}
/**
* 验证ISO类型的日期格式
*/
function dateISO(value) {
return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
}
/**
* 验证十进制数字
*/
function number(value) {
return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
}
/**
* 验证整数
*/
function digits(value) {
return /^\d+$/.test(value);
}
/**
* 验证身份证号码
*/
function idCard(value) {
return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value);
}
/**
* 是否车牌号
*/
function carNo(value) {
// 新能源车牌
var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
// 旧车牌
var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
if (value.length === 7) {
return creg.test(value);
} else if (value.length === 8) {
return xreg.test(value);
} else {
return false;
}
}
/**
* 金额,只允许2位小数
*/
function amount(value) {
//金额,只允许保留两位小数
return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
}
/**
* 中文
*/
function chinese(value) {
var reg = /^[\u4e00-\u9fa5]+$/gi;
return reg.test(value);
}
/**
* 只能输入字母
*/
function letter(value) {
return /^[a-zA-Z]*$/.test(value);
}
/**
* 只能是字母或者数字
*/
function enOrNum(value) {
//英文或者数字
var reg = /^[0-9a-zA-Z]*$/g;
return reg.test(value);
}
/**
* 验证是否包含某个值
*/
function contains(value, param) {
return value.indexOf(param) >= 0;
}
/**
* 验证一个值范围[min, max]
*/
function range(value, param) {
return value >= param[0] && value <= param[1];
}
/**
* 验证一个长度范围[min, max]
*/
function rangeLength(value, param) {
return value.length >= param[0] && value.length <= param[1];
}
/**
* 是否固定电话
*/
function landline(value) {
var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
return reg.test(value);
}
/**
* 判断是否为空
*/
function empty(value) {
switch ((0, _typeof2.default)(value)) {
case 'undefined':
return true;
case 'string':
if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
break;
case 'boolean':
if (!value) return true;
break;
case 'number':
if (0 === value || isNaN(value)) return true;
break;
case 'object':
if (null === value || value.length === 0) return true;
for (var i in value) {
return false;
}
return true;
}
return false;
}
/**
* 是否json字符串
*/
function jsonString(value) {
if (typeof value == 'string') {
try {
var obj = JSON.parse(value);
if ((0, _typeof2.default)(obj) == 'object' && obj) {
return true;
} else {
return false;
}
} catch (e) {
return false;
}
}
return false;
}
/**
* 是否数组
*/
function array(value) {
if (typeof Array.isArray === "function") {
return Array.isArray(value);
} else {
return Object.prototype.toString.call(value) === "[object Array]";
}
}
/**
* 是否对象
*/
function object(value) {
return Object.prototype.toString.call(value) === '[object Object]';
}
/**
* 是否短信验证码
*/
function code(value) {
var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
return new RegExp("^\\d{".concat(len, "}$")).test(value);
}
var _default = {
email: email,
mobile: mobile,
url: url,
date: date,
dateISO: dateISO,
number: number,
digits: digits,
idCard: idCard,
carNo: carNo,
amount: amount,
chinese: chinese,
letter: letter,
enOrNum: enOrNum,
contains: contains,
range: range,
rangeLength: rangeLength,
empty: empty,
isEmpty: empty,
jsonString: jsonString,
landline: landline,
object: object,
array: array,
code: code
};
exports.default = _default;
/***/ }),
/***/ 39:
/*!*******************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/queryParams.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* 对象转url参数
* @param {*} data,对象
* @param {*} isPrefix,是否自动加上"?"
*/
function queryParams() {
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var isPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var arrayFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'brackets';
var prefix = isPrefix ? '?' : '';
var _result = [];
if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';
var _loop = function _loop(key) {
var value = data[key];
// 去掉为空的参数
if (['', undefined, null].indexOf(value) >= 0) {
return "continue";
}
// 如果值为数组,另行处理
if (value.constructor === Array) {
// e.g. {ids: [1, 2, 3]}
switch (arrayFormat) {
case 'indices':
// 结果: ids[0]=1&ids[1]=2&ids[2]=3
for (var i = 0; i < value.length; i++) {
_result.push(key + '[' + i + ']=' + value[i]);
}
break;
case 'brackets':
// 结果: ids[]=1&ids[]=2&ids[]=3
value.forEach(function (_value) {
_result.push(key + '[]=' + _value);
});
break;
case 'repeat':
// 结果: ids=1&ids=2&ids=3
value.forEach(function (_value) {
_result.push(key + '=' + _value);
});
break;
case 'comma':
// 结果: ids=1,2,3
var commaStr = "";
value.forEach(function (_value) {
commaStr += (commaStr ? "," : "") + _value;
});
_result.push(key + '=' + commaStr);
break;
default:
value.forEach(function (_value) {
_result.push(key + '[]=' + _value);
});
}
} else {
_result.push(key + '=' + value);
}
};
for (var key in data) {
var _ret = _loop(key);
if (_ret === "continue") continue;
}
return _result.length ? prefix + _result.join('&') : '';
}
var _default = queryParams;
exports.default = _default;
/***/ }),
/***/ 4:
/*!**********************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 40:
/*!*************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/route.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(uni) {
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 41));
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 43));
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
/**
* 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
* 并且带有路由拦截功能
*/
var Router = /*#__PURE__*/function () {
// 原始属性定义
function Router() {
(0, _classCallCheck2.default)(this, Router);
(0, _defineProperty2.default)(this, "config", {
type: 'navigateTo',
url: '',
delta: 1,
// navigateBack页面后退时,回退的层数
params: {},
// 传递的参数
animationType: 'pop-in',
// 窗口动画,只在APP有效
animationDuration: 300,
// 窗口动画持续时间,单位毫秒,只在APP有效
intercept: false // 是否需要拦截
});
// 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
// 这里在构造函数中进行this绑定
this.route = this.route.bind(this);
}
// 判断url前面是否有"/",如果没有则加上,否则无法跳转
(0, _createClass2.default)(Router, [{
key: "addRootPath",
value: function addRootPath(url) {
return url[0] === '/' ? url : "/".concat(url);
}
// 整合路由参数
}, {
key: "mixinParam",
value: function mixinParam(url, params) {
url = this.addRootPath(url);
// 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
// 如果有url中有get参数,转换后无需带上"?"
var query = '';
if (/.*\/.*\?.*=.*/.test(url)) {
// object对象转为get类型的参数
query = uni.$u.queryParams(params, false);
// 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
return url += "&" + query;
} else {
// 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
query = uni.$u.queryParams(params);
return url += query;
}
}
// 对外的方法名称
}, {
key: "route",
value: function () {
var _route = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
var options,
params,
mergeConfig,
isNext,
_args = arguments;
return _regenerator.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
// 合并用户的配置和内部的默认配置
mergeConfig = {};
if (typeof options === 'string') {
// 如果options为字符串,则为route(url, params)的形式
mergeConfig.url = this.mixinParam(options, params);
mergeConfig.type = 'navigateTo';
} else {
mergeConfig = uni.$u.deepClone(options, this.config);
// 否则正常使用mergeConfig中的url和params进行拼接
mergeConfig.url = this.mixinParam(options.url, options.params);
}
if (params.intercept) {
this.config.intercept = params.intercept;
}
// params参数也带给拦截器
mergeConfig.params = params;
// 合并内外部参数
mergeConfig = uni.$u.deepMerge(this.config, mergeConfig);
// 判断用户是否定义了拦截器
if (!(typeof uni.$u.routeIntercept === 'function')) {
_context.next = 14;
break;
}
_context.next = 10;
return new Promise(function (resolve, reject) {
uni.$u.routeIntercept(mergeConfig, resolve);
});
case 10:
isNext = _context.sent;
// 如果isNext为true,则执行路由跳转
isNext && this.openPage(mergeConfig);
_context.next = 15;
break;
case 14:
this.openPage(mergeConfig);
case 15:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
function route() {
return _route.apply(this, arguments);
}
return route;
}() // 执行路由跳转
}, {
key: "openPage",
value: function openPage(config) {
// 解构参数
var url = config.url,
type = config.type,
delta = config.delta,
animationType = config.animationType,
animationDuration = config.animationDuration;
if (config.type == 'navigateTo' || config.type == 'to') {
uni.navigateTo({
url: url,
animationType: animationType,
animationDuration: animationDuration
});
}
if (config.type == 'redirectTo' || config.type == 'redirect') {
uni.redirectTo({
url: url
});
}
if (config.type == 'switchTab' || config.type == 'tab') {
uni.switchTab({
url: url
});
}
if (config.type == 'reLaunch' || config.type == 'launch') {
uni.reLaunch({
url: url
});
}
if (config.type == 'navigateBack' || config.type == 'back') {
uni.navigateBack({
delta: delta
});
}
}
}]);
return Router;
}();
var _default = new Router().route;
exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
/***/ }),
/***/ 41:
/*!************************************************************************************************!*\
!*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
\************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// TODO(Babel 8): Remove this file.
var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 42)();
module.exports = runtime;
/***/ }),
/***/ 412:
/*!*************************************************************!*\
!*** E:/project/bigdata_WX/static/data/cbd_pest_library.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
// 害虫库
var insect_dict = {
'1': '金龟子',
'2': '夜蛾',
'3': '二点委夜蛾',
'4': '梨剑纹夜蛾',
'5': '杨扇舟蛾',
'6': '舟蛾',
'7': '旋幽夜蛾',
'8': '蝼蛄',
'9': '步甲',
'10': '螟蛾',
'11': '毛黄鳃金龟',
'12': '尺蛾',
'13': '剑纹夜蛾',
'14': '粉缘钻夜蛾',
'15': '夜蛾科',
'16': '七星瓢虫',
'17': '棉铃虫',
'18': '蜻蜓',
'19': '蚊',
'20': '东方粘虫',
'21': '叶蝉',
'22': '春尺蠖',
'23': '雄性春尺蠖',
'24': '杨小舟蛾',
'25': '甘蓝夜蛾',
'26': '小地老虎',
'27': '两点尼夜蛾',
'28': '柳阴翅斑螟',
'29': '桑褶翅尺蛾',
'30': '宽胫夜蛾',
'31': '尺蠖',
'32': '一点钻夜蛾',
'33': '天蛾',
'34': '裳夜蛾',
'35': '灯蛾',
'36': '美国白蛾',
'37': '八字白眉天蛾',
'38': '陌夜蛾',
'39': '豆天蛾',
'40': '麦蛾',
'41': '围连环夜蛾',
'42': '亚美尺蛾',
'43': '梨星毛虫',
'44': '银锭夜蛾',
'45': '黄臀灯蛾',
'46': '大螟',
'47': '燕尾舟蛾',
'48': '榆津尺蛾',
'49': '朽木夜蛾',
'50': '黄地老虎',
'51': '白钩粘夜蛾',
'52': '桃蛀螟',
'53': '甜菜夜蛾',
'54': '斜纹夜蛾',
'55': '蚀夜蛾',
'56': '淡银锭夜蛾',
'57': '齿美冬夜蛾',
'58': '一点金刚钻',
'59': '胡桃豹夜蛾',
'60': '桑剑纹夜蛾',
'61': '蓝目天蛾',
'62': '黑绒绢金龟',
'63': '烟青虫',
'64': '暗黑鳃金龟',
'65': '中华绒金龟',
'66': '八字地老虎',
'67': '榆绿天蛾',
'68': '红星雪灯蛾',
'69': '雀纹天蛾',
'70': '铜绿丽金龟',
'71': '水龟虫',
'72': '曲线尼夜蛾',
'73': '粘虫',
'74': '瘦银锭夜蛾',
'75': '红天蛾',
'76': '鳃金龟',
'77': '大黑鳃金龟',
'78': '大地老虎',
'79': '玉米螟',
'80': '赤角盲蝽',
'81': '槐尺蛾',
'82': '银纹夜蛾',
'83': '天牛',
'84': '乏夜蛾',
'85': '丁香天蛾',
'86': '构月天蛾',
'87': '虎甲',
'88': '劳氏粘虫',
'89': '白薯天蛾',
'90': '广鹿蛾',
'91': '二十八星瓢虫',
'92': '腮金龟',
'93': '人纹污夜蛾',
'94': '叩甲',
'95': '楸蠹野螟',
'96': '丝绵木金星尺蛾',
'97': '红缘灯蛾',
'98': '黄褐丽金龟',
'99': '螟蛾科',
'100': '红棕灰夜蛾',
'101': '黑绒绢金龟',
'102': '广鹿灯蛾',
'103': '蝽',
'104': '蜂',
'105': '大造桥虫',
'106': '童剑纹夜蛾',
'107': '晃剑纹夜蛾',
'108': '钩粘虫',
'109': '直影夜蛾',
'110': '毛黄绢金龟',
'111': '乌氏小尾天蚕蛾',
'112': '褐边绿刺蛾',
'113': '广鹿舟蛾',
'114': '颜倾城',
'115': '龙虱',
'116': '双带盘瓢虫',
'117': '槲犹冬夜蛾',
'118': '洋槐天蛾',
'119': '弧角散纹夜蛾',
'120': '黄脉天蛾',
'121': '葡萄天蛾',
'122': '桃六点天蛾',
'123': '异色瓢虫',
'124': '榆黄足毒蛾',
'125': '客来夜蛾',
'126': '桦尺蛾',
'127': '草地螟',
'128': '细条纹野螟',
'129': '污灯蛾属',
'130': '杨二尾舟蛾',
'131': '克什杆野螟',
'132': '筱客来夜蛾',
'133': '栗六点天蛾',
'134': '紫光盾天蛾',
'135': '款冬玉米螟',
'136': '草蛉',
'137': '亚麻篱灯蛾',
'138': '扁连环夜蛾',
'139': '圣蜣螂',
'140': '白钩粘虫',
'141': '苇实夜蛾',
'142': '姬蜂',
'143': '秘夜蛾',
'144': '织网夜蛾',
'145': '深色白眉天蛾',
'146': '短扇舟蛾',
'147': '白须天蛾',
'148': '歌梦尼夜蛾',
'149': '海安夜蛾',
'150': '满丫纹夜蛾',
'151': '蟋蟀',
'152': '双斑青步甲',
'153': '白条夜蛾',
'154': '蟪蛄',
'155': '负子蝽',
'156': '脊青步甲',
'157': '宽斑青步甲',
'158': '稻从卷叶螟',
'159': '淡剑夜蛾',
'160': '甜菜白带野螟',
'161': '樗蚕',
'162': '蒙古寒蝉',
'163': '中带三角夜蛾',
'164': '蝗虫',
'165': '多色异丽金龟',
'166': '白色小卷蛾',
'167': '狭边青步甲',
'168': '棉卷叶野螟',
'169': '豆荚野螟',
'170': '麻小食心虫',
'171': '星斑虎甲',
'172': '黄缘龙虱',
'173': '无斑弧丽金龟',
'174': '白额鹰翅天蛾',
'175': '日本真龙虱',
'176': '山东云斑螟',
'177': '小文夜蛾',
'178': '三条蛀野螟',
'179': '榆掌舟蛾',
'180': '刺槐掌舟蛾',
'181': '星绒天蛾',
'182': '杨剑舟蛾',
'183': '刀夜蛾',
'184': '红节天蛾',
'185': '星白雪灯蛾',
'186': '桃剑纹夜蛾',
'187': '谐夜蛾',
'188': '小剑纹夜蛾',
'189': '鸣鸣蝉',
'190': '姬夜蛾',
'191': '落叶松毛虫',
'192': '苹六点天蛾',
'193': '四斑绢野螟',
'194': '甘薯天蛾',
'195': '小线角木蠹蛾',
'196': '三斑蕊夜蛾',
'197': '白雪灯蛾',
'198': '黄刺蛾',
'199': '茶翅蝽',
'200': '杨树枯叶蛾',
"201": "标瑙夜蛾",
"202": "瓜绢野螟",
"203": "稻绿蝽",
"204": "杨雪毒蛾",
"205": "榆白边舟蛾",
"206": "扁刺蛾",
"207": "绒黏夜蛾",
"208": "庸肖毛翅夜蛾",
"209": "中华婪步甲",
"210": "褐黄前锹甲",
"211": "旱柳原野螟",
"212": "巨影夜蛾",
"213": "食蚜蝇",
"214": "双斑葬甲",
"215": "黄毒蛾",
"216": "婪步甲",
"217": "土甲",
"218": "中华真地鳖",
"219": "紫线夜蛾",
"220": "小黄鳃金龟",
"221": "中华真土鳖",
"222": "云斑虎甲",
"223": "中华黧尺蛾",
"224": "中华绿刺蛾",
"225": "巨豹纹尺蛾",
"226": "多斑豹蠹蛾",
"227": "桑尺蛾",
"228": "灰直纹螟",
"229": "中国绿刺蛾",
"230": "云杉梢斑螟",
"231": "桑绢野螟",
"232": "黄杨绢野螟",
"233": "突背斑红蝽",
"234": "高粱条螟",
"235": "小麦负泥虫",
"236": "苹掌舟蛾",
"237": "绒粘夜蛾",
"238": "灰白灯蛾",
"239": "隐丫纹夜蛾",
"240": "满纹夜蛾",
"241": "黑剑狼夜蛾",
"242": "蜣螂",
"243": "福婆鳃金龟",
"244": "雨尺蛾",
"245": "优美苔蛾",
"246": "黄斑野螟",
"247": "疆夜蛾",
"248": "六点天蛾",
"249": "斜线夜蛾",
"250": "石榴巾夜蛾",
"251": "绒星天蛾",
"252": "霜天蛾",
"253": "大田鳖",
"254": "灰双纹螟",
"255": "青尺蛾",
"256": "二线绿尺蛾",
"257": "散纹夜蛾",
"258": "红双线尺蛾",
"259": "胞短栉夜蛾",
"260": "飞虱科",
"261": "桃多斑野螟",
"262": "甜菜青野螟",
"263": "核桃鹰翅天蛾",
"264": "角顶尺蛾",
"265": "葡萄缺角天蛾",
"266": "绿尾大蚕蛾",
"267": "杨褐枯叶蝶",
"268": "双云尺蛾",
"269": "斑拟兜夜蛾",
"270": "阿莎尺蛾",
"271": "榄绿岐角螟",
"272": "青革土蝽",
"273": "核桃美舟蛾",
"274": "斑点卷叶螟",
"275": "黄褐箩纹蛾",
"276": "白环红天蛾",
"277": "白腹网丛螟",
"278": "枯叶蛾",
"279": "丹日明夜蛾",
"280": "仿白边舟蛾",
"281": "槐羽舟蛾",
"282": "草地贪夜蛾",
"283": "环夜蛾",
"284": "尘尺蛾",
"285": "黄二星舟蛾",
"286": "榆木蠹蛾",
"287": "水黾",
"288": "银装冬夜蛾",
"289": "饰奇尺蛾",
"290": "枯叶蝶",
"291": "步甲",
"292": "阔胸禾犀金龟",
"293": "眼斑钩蛾",
"294": "三开蜣螂",
"295": "金星步甲",
"296": "残夜蛾",
"297": "野蚕蛾",
"298": "芦苇豹蠹蛾",
"299": "华晓扁犀金龟",
"300": "灰胸突鳃金龟",
"301": "龟纹瓢虫",
"302": "麻皮蝽",
"303": "斑须蝽",
"304": "斜斑虎甲",
"305": "地鳖",
"306": "叶甲",
"307": "燕夜蛾",
"308": "黑纹北灯蛾",
"309": "网夜蛾",
"310": "棘翅夜蛾",
"311": "规尺蛾",
"312": "苜蓿银纹夜蛾",
"313": "拟扇舟蛾",
"314": "丁目大蚕蛾",
"315": "金黄蛾",
"316": "黄星雪灯蛾",
"317": "暗纹紫褐螟",
"318": "白眉天蛾",
"319": "黄板盘瓢虫",
"320": "玫岐角螟",
"321": "枯黄贡尺蛾",
"322": "小豆长喙天蛾",
"323": "橙拟灯蛾",
"324": "粉蝶灯蛾",
"325": "纹散丽灯蛾",
"326": "雪尾尺蛾",
"327": "鹰翅天蛾",
"328": "波纹蛾",
"329": "黑条灰灯蛾",
"330": "八点灰灯蛾",
"331": "间纹弦夜蛾",
"332": "缤夜蛾"
};
var _default = insect_dict;
exports.default = _default;
/***/ }),
/***/ 42:
/*!*******************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
function _regeneratorRuntime() {
"use strict";
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
return e;
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
var t,
e = {},
r = Object.prototype,
n = r.hasOwnProperty,
o = Object.defineProperty || function (t, e, r) {
t[e] = r.value;
},
i = "function" == typeof Symbol ? Symbol : {},
a = i.iterator || "@@iterator",
c = i.asyncIterator || "@@asyncIterator",
u = i.toStringTag || "@@toStringTag";
function define(t, e, r) {
return Object.defineProperty(t, e, {
value: r,
enumerable: !0,
configurable: !0,
writable: !0
}), t[e];
}
try {
define({}, "");
} catch (t) {
define = function define(t, e, r) {
return t[e] = r;
};
}
function wrap(t, e, r, n) {
var i = e && e.prototype instanceof Generator ? e : Generator,
a = Object.create(i.prototype),
c = new Context(n || []);
return o(a, "_invoke", {
value: makeInvokeMethod(t, r, c)
}), a;
}
function tryCatch(t, e, r) {
try {
return {
type: "normal",
arg: t.call(e, r)
};
} catch (t) {
return {
type: "throw",
arg: t
};
}
}
e.wrap = wrap;
var h = "suspendedStart",
l = "suspendedYield",
f = "executing",
s = "completed",
y = {};
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
var p = {};
define(p, a, function () {
return this;
});
var d = Object.getPrototypeOf,
v = d && d(d(values([])));
v && v !== r && n.call(v, a) && (p = v);
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
function defineIteratorMethods(t) {
["next", "throw", "return"].forEach(function (e) {
define(t, e, function (t) {
return this._invoke(e, t);
});
});
}
function AsyncIterator(t, e) {
function invoke(r, o, i, a) {
var c = tryCatch(t[r], t, o);
if ("throw" !== c.type) {
var u = c.arg,
h = u.value;
return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
invoke("next", t, i, a);
}, function (t) {
invoke("throw", t, i, a);
}) : e.resolve(h).then(function (t) {
u.value = t, i(u);
}, function (t) {
return invoke("throw", t, i, a);
});
}
a(c.arg);
}
var r;
o(this, "_invoke", {
value: function value(t, n) {
function callInvokeWithMethodAndArg() {
return new e(function (e, r) {
invoke(t, n, e, r);
});
}
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
}
});
}
function makeInvokeMethod(e, r, n) {
var o = h;
return function (i, a) {
if (o === f) throw new Error("Generator is already running");
if (o === s) {
if ("throw" === i) throw a;
return {
value: t,
done: !0
};
}
for (n.method = i, n.arg = a;;) {
var c = n.delegate;
if (c) {
var u = maybeInvokeDelegate(c, n);
if (u) {
if (u === y) continue;
return u;
}
}
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
if (o === h) throw o = s, n.arg;
n.dispatchException(n.arg);
} else "return" === n.method && n.abrupt("return", n.arg);
o = f;
var p = tryCatch(e, r, n);
if ("normal" === p.type) {
if (o = n.done ? s : l, p.arg === y) continue;
return {
value: p.arg,
done: n.done
};
}
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
}
};
}
function maybeInvokeDelegate(e, r) {
var n = r.method,
o = e.iterator[n];
if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
var i = tryCatch(o, e.iterator, r.arg);
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
var a = i.arg;
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
}
function pushTryEntry(t) {
var e = {
tryLoc: t[0]
};
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
}
function resetTryEntry(t) {
var e = t.completion || {};
e.type = "normal", delete e.arg, t.completion = e;
}
function Context(t) {
this.tryEntries = [{
tryLoc: "root"
}], t.forEach(pushTryEntry, this), this.reset(!0);
}
function values(e) {
if (e || "" === e) {
var r = e[a];
if (r) return r.call(e);
if ("function" == typeof e.next) return e;
if (!isNaN(e.length)) {
var o = -1,
i = function next() {
for (; ++o < e.length;) {
if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
}
return next.value = t, next.done = !0, next;
};
return i.next = i;
}
}
throw new TypeError(_typeof(e) + " is not iterable");
}
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
value: GeneratorFunctionPrototype,
configurable: !0
}), o(GeneratorFunctionPrototype, "constructor", {
value: GeneratorFunction,
configurable: !0
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
var e = "function" == typeof t && t.constructor;
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
}, e.mark = function (t) {
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
}, e.awrap = function (t) {
return {
__await: t
};
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
return this;
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
void 0 === i && (i = Promise);
var a = new AsyncIterator(wrap(t, r, n, o), i);
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
return t.done ? t.value : a.next();
});
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
return this;
}), define(g, "toString", function () {
return "[object Generator]";
}), e.keys = function (t) {
var e = Object(t),
r = [];
for (var n in e) {
r.push(n);
}
return r.reverse(), function next() {
for (; r.length;) {
var t = r.pop();
if (t in e) return next.value = t, next.done = !1, next;
}
return next.done = !0, next;
};
}, e.values = values, Context.prototype = {
constructor: Context,
reset: function reset(e) {
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) {
"t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
}
},
stop: function stop() {
this.done = !0;
var t = this.tryEntries[0].completion;
if ("throw" === t.type) throw t.arg;
return this.rval;
},
dispatchException: function dispatchException(e) {
if (this.done) throw e;
var r = this;
function handle(n, o) {
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
}
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
var i = this.tryEntries[o],
a = i.completion;
if ("root" === i.tryLoc) return handle("end");
if (i.tryLoc <= this.prev) {
var c = n.call(i, "catchLoc"),
u = n.call(i, "finallyLoc");
if (c && u) {
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
} else if (c) {
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
} else {
if (!u) throw new Error("try statement without catch or finally");
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
}
}
}
},
abrupt: function abrupt(t, e) {
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
var o = this.tryEntries[r];
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
var i = o;
break;
}
}
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
var a = i ? i.completion : {};
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
},
complete: function complete(t, e) {
if ("throw" === t.type) throw t.arg;
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
},
finish: function finish(t) {
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
var r = this.tryEntries[e];
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
}
},
"catch": function _catch(t) {
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
var r = this.tryEntries[e];
if (r.tryLoc === t) {
var n = r.completion;
if ("throw" === n.type) {
var o = n.arg;
resetTryEntry(r);
}
return o;
}
}
throw new Error("illegal catch attempt");
},
delegateYield: function delegateYield(e, r, n) {
return this.delegate = {
iterator: values(e),
resultName: r,
nextLoc: n
}, "next" === this.method && (this.arg = t), y;
}
}, e;
}
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 43:
/*!*****************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 44:
/*!******************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/timeFormat.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
// padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
// 所以这里做一个兼容polyfill的兼容处理
if (!String.prototype.padStart) {
// 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
String.prototype.padStart = function (maxLength) {
var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError('fillString must be String');
var str = this;
// 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
if (str.length >= maxLength) return String(str);
var fillLength = maxLength - str.length,
times = Math.ceil(fillLength / fillString.length);
while (times >>= 1) {
fillString += fillString;
if (times === 1) {
fillString += fillString;
}
}
return fillString.slice(0, fillLength) + str;
};
}
// 其他更多是格式化有如下:
// yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
function timeFormat() {
var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
// 如果为null,则格式化当前时间
if (!dateTime) dateTime = Number(new Date());
// 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
if (dateTime.toString().length == 10) dateTime *= 1000;
var date = new Date(Number(dateTime));
var ret;
var opt = {
"y+": date.getFullYear().toString(),
// 年
"m+": (date.getMonth() + 1).toString(),
// 月
"d+": date.getDate().toString(),
// 日
"h+": date.getHours().toString(),
// 时
"M+": date.getMinutes().toString(),
// 分
"s+": date.getSeconds().toString() // 秒
// 有其他格式化字符需求可以继续添加,必须转化成字符串
};
for (var k in opt) {
ret = new RegExp("(" + k + ")").exec(fmt);
if (ret) {
fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
}
;
}
;
return fmt;
}
var _default = timeFormat;
exports.default = _default;
/***/ }),
/***/ 45:
/*!****************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/timeFrom.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/timeFormat.js */ 44));
/**
* 时间戳转为多久之前
* @param String timestamp 时间戳
* @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
* 如果为布尔值false,无论什么时间,都返回多久以前的格式
*/
function timeFrom() {
var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
// 如果为null,则格式化当前时间
if (!dateTime) dateTime = Number(new Date());
// 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
if (dateTime.toString().length == 10) dateTime *= 1000;
var timestamp = +new Date(Number(dateTime));
var timer = (Number(new Date()) - timestamp) / 1000;
// 如果小于5分钟,则返回"刚刚",其他以此类推
var tips = '';
switch (true) {
case timer < 300:
tips = '刚刚';
break;
case timer >= 300 && timer < 3600:
tips = parseInt(timer / 60) + '分钟前';
break;
case timer >= 3600 && timer < 86400:
tips = parseInt(timer / 3600) + '小时前';
break;
case timer >= 86400 && timer < 2592000:
tips = parseInt(timer / 86400) + '天前';
break;
default:
// 如果format为false,则无论什么时间戳,都显示xx之前
if (format === false) {
if (timer >= 2592000 && timer < 365 * 86400) {
tips = parseInt(timer / (86400 * 30)) + '个月前';
} else {
tips = parseInt(timer / (86400 * 365)) + '年前';
}
} else {
tips = (0, _timeFormat.default)(timestamp, format);
}
}
return tips;
}
var _default = timeFrom;
exports.default = _default;
/***/ }),
/***/ 46:
/*!*********************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/colorGradient.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* 求两个颜色之间的渐变值
* @param {string} startColor 开始的颜色
* @param {string} endColor 结束的颜色
* @param {number} step 颜色等分的份额
* */
function colorGradient() {
var startColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rgb(0, 0, 0)';
var endColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rgb(255, 255, 255)';
var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
var startR = startRGB[0];
var startG = startRGB[1];
var startB = startRGB[2];
var endRGB = hexToRgb(endColor, false);
var endR = endRGB[0];
var endG = endRGB[1];
var endB = endRGB[2];
var sR = (endR - startR) / step; //总差值
var sG = (endG - startG) / step;
var sB = (endB - startB) / step;
var colorArr = [];
for (var i = 0; i < step; i++) {
//计算每一步的hex值
var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB * i + startB) + ')');
colorArr.push(hex);
}
return colorArr;
}
// 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
function hexToRgb(sColor) {
var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
sColor = sColor.toLowerCase();
if (sColor && reg.test(sColor)) {
if (sColor.length === 4) {
var sColorNew = "#";
for (var i = 1; i < 4; i += 1) {
sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
}
sColor = sColorNew;
}
//处理六位的颜色值
var sColorChange = [];
for (var _i = 1; _i < 7; _i += 2) {
sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
}
if (!str) {
return sColorChange;
} else {
return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
}
} else if (/^(rgb|RGB)/.test(sColor)) {
var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
return arr.map(function (val) {
return Number(val);
});
} else {
return sColor;
}
}
;
// 将rgb表示方式转换为hex表示方式
function rgbToHex(rgb) {
var _this = rgb;
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
if (/^(rgb|RGB)/.test(_this)) {
var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
var strHex = "#";
for (var i = 0; i < aColor.length; i++) {
var hex = Number(aColor[i]).toString(16);
hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
if (hex === "0") {
hex += hex;
}
strHex += hex;
}
if (strHex.length !== 7) {
strHex = _this;
}
return strHex;
} else if (reg.test(_this)) {
var aNum = _this.replace(/#/, "").split("");
if (aNum.length === 6) {
return _this;
} else if (aNum.length === 3) {
var numHex = "#";
for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
numHex += aNum[_i2] + aNum[_i2];
}
return numHex;
}
} else {
return _this;
}
}
/**
* JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
* sHex为传入的十六进制的色值
* alpha为rgba的透明度
*/
function colorToRgba(color) {
var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
color = rgbToHex(color);
// 十六进制颜色值的正则表达式
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
/* 16进制颜色转为RGB格式 */
var sColor = color.toLowerCase();
if (sColor && reg.test(sColor)) {
if (sColor.length === 4) {
var sColorNew = '#';
for (var i = 1; i < 4; i += 1) {
sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
}
sColor = sColorNew;
}
// 处理六位的颜色值
var sColorChange = [];
for (var _i3 = 1; _i3 < 7; _i3 += 2) {
sColorChange.push(parseInt('0x' + sColor.slice(_i3, _i3 + 2)));
}
// return sColorChange.join(',')
return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')';
} else {
return sColor;
}
}
var _default = {
colorGradient: colorGradient,
hexToRgb: hexToRgb,
rgbToHex: rgbToHex,
colorToRgba: colorToRgba
};
exports.default = _default;
/***/ }),
/***/ 47:
/*!************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/guid.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
* 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
* 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
* 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
* v-for的时候,推荐使用后端返回的id而不是循环的index
* @param {Number} len uuid的长度
* @param {Boolean} firstU 将返回的首字母置为"u"
* @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
*/
function guid() {
var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;
var firstU = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var radix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
var uuid = [];
radix = radix || chars.length;
if (len) {
// 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
for (var i = 0; i < len; i++) {
uuid[i] = chars[0 | Math.random() * radix];
}
} else {
var r;
// rfc4122标准要求返回的uuid中,某些位为固定的字符
uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
uuid[14] = '4';
for (var _i = 0; _i < 36; _i++) {
if (!uuid[_i]) {
r = 0 | Math.random() * 16;
uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
}
}
}
// 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
if (firstU) {
uuid.shift();
return 'u' + uuid.join('');
} else {
return uuid.join('');
}
}
var _default = guid;
exports.default = _default;
/***/ }),
/***/ 48:
/*!*************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/color.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
// 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
// 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
var color = {
primary: "#2979ff",
primaryDark: "#2b85e4",
primaryDisabled: "#a0cfff",
primaryLight: "#ecf5ff",
bgColor: "#f3f4f6",
info: "#909399",
infoDark: "#82848a",
infoDisabled: "#c8c9cc",
infoLight: "#f4f4f5",
warning: "#ff9900",
warningDark: "#f29100",
warningDisabled: "#fcbd71",
warningLight: "#fdf6ec",
error: "#fa3534",
errorDark: "#dd6161",
errorDisabled: "#fab6b6",
errorLight: "#fef0f0",
success: "#19be6b",
successDark: "#18b566",
successDisabled: "#71d5a1",
successLight: "#dbf1e1",
mainColor: "#303133",
contentColor: "#606266",
tipsColor: "#909399",
lightColor: "#c0c4cc",
borderColor: "#e4e7ed"
};
var _default = color;
exports.default = _default;
/***/ }),
/***/ 49:
/*!*****************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/type2icon.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* 根据主题type值,获取对应的图标
* @param String type 主题名称,primary|info|error|warning|success
* @param String fill 是否使用fill填充实体的图标
*/
function type2icon() {
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';
var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
// 如果非预置值,默认为success
if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
var iconName = '';
// 目前(2019-12-12),info和primary使用同一个图标
switch (type) {
case 'primary':
iconName = 'info-circle';
break;
case 'info':
iconName = 'info-circle';
break;
case 'error':
iconName = 'close-circle';
break;
case 'warning':
iconName = 'error-circle';
break;
case 'success':
iconName = 'checkmark-circle';
break;
default:
iconName = 'checkmark-circle';
}
// 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
if (fill) iconName += '-fill';
return iconName;
}
var _default = type2icon;
exports.default = _default;
/***/ }),
/***/ 5:
/*!**************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
function _slicedToArray(arr, i) {
return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
}
module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 50:
/*!*******************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/randomArray.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
// 打乱数组
function randomArray() {
var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
// 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
return array.sort(function () {
return Math.random() - 0.5;
});
}
var _default = randomArray;
exports.default = _default;
/***/ }),
/***/ 51:
/*!***************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/addUnit.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = addUnit;
var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 38));
// 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
function addUnit() {
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';
var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
value = String(value);
// 用uView内置验证规则中的number判断是否为数值
return _test.default.number(value) ? "".concat(value).concat(unit) : value;
}
/***/ }),
/***/ 52:
/*!**************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/random.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function random(min, max) {
if (min >= 0 && max > 0 && max >= min) {
var gab = max - min + 1;
return Math.floor(Math.random() * gab + min);
} else {
return 0;
}
}
var _default = random;
exports.default = _default;
/***/ }),
/***/ 53:
/*!************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/trim.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function trim(str) {
var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
if (pos == 'both') {
return str.replace(/^\s+|\s+$/g, "");
} else if (pos == "left") {
return str.replace(/^\s*/, '');
} else if (pos == 'right') {
return str.replace(/(\s*$)/g, "");
} else if (pos == 'all') {
return str.replace(/\s+/g, "");
} else {
return str;
}
}
var _default = trim;
exports.default = _default;
/***/ }),
/***/ 54:
/*!*************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/toast.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(uni) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function toast(title) {
var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1500;
uni.showToast({
title: title,
icon: 'none',
duration: duration
});
}
var _default = toast;
exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
/***/ }),
/***/ 55:
/*!*****************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/getParent.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getParent;
var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
// 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
// this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
function getParent(name, keys) {
var parent = this.$parent;
// 通过while历遍,这里主要是为了H5需要多层解析的问题
while (parent) {
// 父组件
if (parent.$options.name !== name) {
// 如果组件的name不相等,继续上一级寻找
parent = parent.$parent;
} else {
var _ret = function () {
var data = {};
// 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
if (Array.isArray(keys)) {
keys.map(function (val) {
data[val] = parent[val] ? parent[val] : '';
});
} else {
// 历遍传过来的对象参数
for (var i in keys) {
// 如果子组件有此值则用,无此值则用父组件的值
// 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
if (Array.isArray(keys[i])) {
if (keys[i].length) {
data[i] = keys[i];
} else {
data[i] = parent[i];
}
} else if (keys[i].constructor === Object) {
// 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
if (Object.keys(keys[i]).length) {
data[i] = keys[i];
} else {
data[i] = parent[i];
}
} else {
// 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
}
}
}
return {
v: data
};
}();
if ((0, _typeof2.default)(_ret) === "object") return _ret.v;
}
}
return {};
}
/***/ }),
/***/ 56:
/*!***************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/$parent.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = $parent;
// 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
// this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
// 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
// 值(默认为undefined),就是查找最顶层的$parent
function $parent() {
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
var parent = this.$parent;
// 通过while历遍,这里主要是为了H5需要多层解析的问题
while (parent) {
// 父组件
if (parent.$options && parent.$options.name !== name) {
// 如果组件的name不相等,继续上一级寻找
parent = parent.$parent;
} else {
return parent;
}
}
return false;
}
/***/ }),
/***/ 57:
/*!***********************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/sys.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(uni) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.os = os;
exports.sys = sys;
function os() {
return uni.getSystemInfoSync().platform;
}
;
function sys() {
return uni.getSystemInfoSync();
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
/***/ }),
/***/ 58:
/*!****************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/debounce.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var timeout = null;
/**
* 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
*
* @param {Function} func 要执行的回调函数
* @param {Number} wait 延时的时间
* @param {Boolean} immediate 是否立即执行
* @return null
*/
function debounce(func) {
var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
// 清除定时器
if (timeout !== null) clearTimeout(timeout);
// 立即执行,此类情况一般用不到
if (immediate) {
var callNow = !timeout;
timeout = setTimeout(function () {
timeout = null;
}, wait);
if (callNow) typeof func === 'function' && func();
} else {
// 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
timeout = setTimeout(function () {
typeof func === 'function' && func();
}, wait);
}
}
var _default = debounce;
exports.default = _default;
/***/ }),
/***/ 59:
/*!****************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/function/throttle.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var timer, flag;
/**
* 节流原理:在一定时间内,只能触发一次
*
* @param {Function} func 要执行的回调函数
* @param {Number} wait 延时的时间
* @param {Boolean} immediate 是否立即执行
* @return null
*/
function throttle(func) {
var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
if (immediate) {
if (!flag) {
flag = true;
// 如果是立即执行,则在wait毫秒内开始时执行
typeof func === 'function' && func();
timer = setTimeout(function () {
flag = false;
}, wait);
}
} else {
if (!flag) {
flag = true;
// 如果是非立即执行,则在wait毫秒内的结束处执行
timer = setTimeout(function () {
flag = false;
typeof func === 'function' && func();
}, wait);
}
}
}
;
var _default = throttle;
exports.default = _default;
/***/ }),
/***/ 6:
/*!***************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 60:
/*!************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/config/config.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
// 此版本发布于2020-11-16
var version = '1.8.1';
var _default = {
v: version,
version: version,
// 主题名称
type: ['primary', 'success', 'info', 'error', 'warning']
};
exports.default = _default;
/***/ }),
/***/ 61:
/*!************************************************************!*\
!*** E:/project/bigdata_WX/uview-ui/libs/config/zIndex.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
// uniapp在H5中各API的z-index值如下:
/**
* actionsheet: 999
* modal: 999
* navigate: 998
* tabbar: 998
* toast: 999
*/
var _default = {
toast: 10090,
noNetwork: 10080,
// popup包含popup,actionsheet,keyboard,picker的值
popup: 10075,
mask: 10070,
navbar: 980,
topTips: 975,
sticky: 970,
indexListSticky: 965
};
exports.default = _default;
/***/ }),
/***/ 62:
/*!*****************************************!*\
!*** E:/project/bigdata_WX/util/api.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(uni) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.myRequest = void 0;
// let BASE_URL = 'http://114.115.147.140:8002'
// const BASE_URL='http://8.136.98.49:8002'
// let BASE_URL = 'http://192.168.0.36:8003'
var BASE_URL = 'https://wx.hnyfwlw.com';
var myRequest = function myRequest(options) {
// BASE_URL=uni.getStorageSync('http')
// if(BASE_URL==''){
// BASE_URL = 'https://wx.hnyfwlw.com/'
// }
// console.log(BASE_URL)
var session_key = "";
session_key = uni.getStorageSync('session_key');
var url = options.url;
var data = options.data || {};
if (url != 'user.login.login_user' && url != 'pest.pests.insect_discern' && url != 'pest.pests.plant_discern' && url != 'pest.pests.pests_contrast' && url != 'pest.pests.pests_expert_img' && url != 'pest.pests.pests_img' && url != 'recognizationSys' && url != 'base.bases.base_photo' && url != 'pest.warning_record.rolemanage_img' && url != 'home.homes.personal_photo' && url != 'ascend.ascend_manage.product_info' && url != 'ascend.ascend_manage.quality_info' && url != 'ascend.ascend_manage.grow_info' && url != 'ascend.ascend_manage.all_ascend' && url != 'after_sale.after_sale_manage.device_check' && url != 'after_sale.after_sale_manage.aftersale_apply') {
data.token = session_key;
}
return new Promise(function (resolve, reject) {
uni.request({
url: BASE_URL + options.url,
method: options.method || 'POST',
header: {
"Content-Type": "application/x-www-form-urlencoded"
},
data: data,
success: function success(res) {
if (res.data.message) {
if (res.data.message !== "识别无结果" && res.data.message !== "该设备未绑定SIM") {
return uni.showToast({
title: res.data.message,
icon: "none"
});
} else {
resolve(res.data.data);
}
}
resolve(res.data.data);
},
fail: function fail(err) {
uni.showToast({
title: '请求接口失败'
});
reject(err);
}
});
});
};
exports.myRequest = myRequest;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
/***/ }),
/***/ 63:
/*!*****************************************************!*\
!*** E:/project/bigdata_WX/util/QueryPermission.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(uni) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.QueryPermission = QueryPermission;
var list = [];
function QueryPermission(id) {
uni.getStorage({
key: "jurisdiction",
success: function success(res) {
list = JSON.parse(res.data);
}
});
// console.log(list)
for (var i = 0; i < list.length; i++) {
if (list[i].children) {
var data = list[i].children;
for (var j = 0; j < data.length; j++) {
if (data[j].children) {
var item = data[j].children;
for (var k = 0; k < item.length; k++) {
if (item[k].pur_id == id) {
return true;
}
}
}
}
}
}
return false;
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
/***/ }),
/***/ 7:
/*!*********************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _iterableToArrayLimit(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e,
n,
i,
u,
a = [],
f = !0,
o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) {
;
}
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 75:
/*!*******************************************************************!*\
!*** E:/project/bigdata_WX/components/jsencrypt/jsencrypt.min.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
var CryptoJS = CryptoJS || function (a, b) {
var c, e, f, g, h, i, j, k, l, m, n, o, q;
if (!c && "undefined" != typeof global && global.crypto && (c = global.crypto), !c && "function" == "function") try {
c = __webpack_require__(/*! crypto */ 76);
} catch (d) {}
return e = function e() {
if (c) {
if ("function" == typeof c.getRandomValues) try {
return c.getRandomValues(new Uint32Array(1))[0];
} catch (a) {}
if ("function" == typeof c.randomBytes) try {
return c.randomBytes(4).readInt32LE();
} catch (a) {}
}
throw new Error("Native crypto module could not be used to get secure random number.");
}, f = Object.create || function () {
function a() {}
return function (b) {
var c;
return a.prototype = b, c = new a(), a.prototype = null, c;
};
}(), g = {}, h = g.lib = {}, i = h.Base = function () {
return {
extend: function extend(a) {
var b = f(this);
return a && b.mixIn(a), b.hasOwnProperty("init") && this.init !== b.init || (b.init = function () {
b.$super.init.apply(this, arguments);
}), b.init.prototype = b, b.$super = this, b;
},
create: function create() {
var a = this.extend();
return a.init.apply(a, arguments), a;
},
init: function init() {},
mixIn: function mixIn(a) {
for (var b in a) {
a.hasOwnProperty(b) && (this[b] = a[b]);
}
a.hasOwnProperty("toString") && (this.toString = a.toString);
},
clone: function clone() {
return this.init.prototype.extend(this);
}
};
}(), j = h.WordArray = i.extend({
init: function init(a, c) {
a = this.words = a || [], this.sigBytes = c != b ? c : 4 * a.length;
},
toString: function toString(a) {
return (a || l).stringify(this);
},
concat: function concat(a) {
var f,
g,
b = this.words,
c = a.words,
d = this.sigBytes,
e = a.sigBytes;
if (this.clamp(), d % 4) for (f = 0; e > f; f++) {
g = 255 & c[f >>> 2] >>> 24 - 8 * (f % 4), b[d + f >>> 2] |= g << 24 - 8 * ((d + f) % 4);
} else for (f = 0; e > f; f += 4) {
b[d + f >>> 2] = c[f >>> 2];
}
return this.sigBytes += e, this;
},
clamp: function clamp() {
var b = this.words,
c = this.sigBytes;
b[c >>> 2] &= 4294967295 << 32 - 8 * (c % 4), b.length = a.ceil(c / 4);
},
clone: function clone() {
var a = i.clone.call(this);
return a.words = this.words.slice(0), a;
},
random: function random(a) {
var c,
b = [];
for (c = 0; a > c; c += 4) {
b.push(e());
}
return new j.init(b, a);
}
}), k = g.enc = {}, l = k.Hex = {
stringify: function stringify(a) {
var e,
f,
b = a.words,
c = a.sigBytes,
d = [];
for (e = 0; c > e; e++) {
f = 255 & b[e >>> 2] >>> 24 - 8 * (e % 4), d.push((f >>> 4).toString(16)), d.push((15 & f).toString(16));
}
return d.join("");
},
parse: function parse(a) {
var d,
b = a.length,
c = [];
for (d = 0; b > d; d += 2) {
c[d >>> 3] |= parseInt(a.substr(d, 2), 16) << 24 - 4 * (d % 8);
}
return new j.init(c, b / 2);
}
}, m = k.Latin1 = {
stringify: function stringify(a) {
var e,
f,
b = a.words,
c = a.sigBytes,
d = [];
for (e = 0; c > e; e++) {
f = 255 & b[e >>> 2] >>> 24 - 8 * (e % 4), d.push(String.fromCharCode(f));
}
return d.join("");
},
parse: function parse(a) {
var d,
b = a.length,
c = [];
for (d = 0; b > d; d++) {
c[d >>> 2] |= (255 & a.charCodeAt(d)) << 24 - 8 * (d % 4);
}
return new j.init(c, b);
}
}, n = k.Utf8 = {
stringify: function stringify(a) {
try {
return decodeURIComponent(escape(m.stringify(a)));
} catch (b) {
throw new Error("Malformed UTF-8 data");
}
},
parse: function parse(a) {
return m.parse(unescape(encodeURIComponent(a)));
}
}, o = h.BufferedBlockAlgorithm = i.extend({
reset: function reset() {
this._data = new j.init(), this._nDataBytes = 0;
},
_append: function _append(a) {
"string" == typeof a && (a = n.parse(a)), this._data.concat(a), this._nDataBytes += a.sigBytes;
},
_process: function _process(b) {
var c,
k,
l,
m,
d = this._data,
e = d.words,
f = d.sigBytes,
g = this.blockSize,
h = 4 * g,
i = f / h;
if (i = b ? a.ceil(i) : a.max((0 | i) - this._minBufferSize, 0), k = i * g, l = a.min(4 * k, f), k) {
for (m = 0; k > m; m += g) {
this._doProcessBlock(e, m);
}
c = e.splice(0, k), d.sigBytes -= l;
}
return new j.init(c, l);
},
clone: function clone() {
var a = i.clone.call(this);
return a._data = this._data.clone(), a;
},
_minBufferSize: 0
}), h.Hasher = o.extend({
cfg: i.extend(),
init: function init(a) {
this.cfg = this.cfg.extend(a), this.reset();
},
reset: function reset() {
o.reset.call(this), this._doReset();
},
update: function update(a) {
return this._append(a), this._process(), this;
},
finalize: function finalize(a) {
a && this._append(a);
var b = this._doFinalize();
return b;
},
blockSize: 16,
_createHelper: function _createHelper(a) {
return function (b, c) {
return new a.init(c).finalize(b);
};
},
_createHmacHelper: function _createHmacHelper(a) {
return function (b, c) {
return new q.HMAC.init(a, c).finalize(b);
};
}
}), q = g.algo = {}, g;
}(Math);
!function () {
function f(a, b, d) {
var g,
h,
i,
j,
e = [],
f = 0;
for (g = 0; b > g; g++) {
g % 4 && (h = d[a.charCodeAt(g - 1)] << 2 * (g % 4), i = d[a.charCodeAt(g)] >>> 6 - 2 * (g % 4), j = h | i, e[f >>> 2] |= j << 24 - 8 * (f % 4), f++);
}
return c.create(e, f);
}
var a = CryptoJS,
b = a.lib,
c = b.WordArray,
d = a.enc;
d.Base64 = {
stringify: function stringify(a) {
var e,
f,
g,
h,
i,
j,
k,
l,
b = a.words,
c = a.sigBytes,
d = this._map;
for (a.clamp(), e = [], f = 0; c > f; f += 3) {
for (g = 255 & b[f >>> 2] >>> 24 - 8 * (f % 4), h = 255 & b[f + 1 >>> 2] >>> 24 - 8 * ((f + 1) % 4), i = 255 & b[f + 2 >>> 2] >>> 24 - 8 * ((f + 2) % 4), j = g << 16 | h << 8 | i, k = 0; 4 > k && c > f + .75 * k; k++) {
e.push(d.charAt(63 & j >>> 6 * (3 - k)));
}
}
if (l = d.charAt(64)) for (; e.length % 4;) {
e.push(l);
}
return e.join("");
},
parse: function parse(a) {
var e,
g,
h,
b = a.length,
c = this._map,
d = this._reverseMap;
if (!d) for (d = this._reverseMap = [], e = 0; e < c.length; e++) {
d[c.charCodeAt(e)] = e;
}
return g = c.charAt(64), g && (h = a.indexOf(g), -1 !== h && (b = h)), f(a, b, d);
},
_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
};
}(), function (a) {
function i(a, b, c, d, e, f, g) {
var h = a + (b & c | ~b & d) + e + g;
return (h << f | h >>> 32 - f) + b;
}
function j(a, b, c, d, e, f, g) {
var h = a + (b & d | c & ~d) + e + g;
return (h << f | h >>> 32 - f) + b;
}
function k(a, b, c, d, e, f, g) {
var h = a + (b ^ c ^ d) + e + g;
return (h << f | h >>> 32 - f) + b;
}
function l(a, b, c, d, e, f, g) {
var h = a + (c ^ (b | ~d)) + e + g;
return (h << f | h >>> 32 - f) + b;
}
var h,
b = CryptoJS,
c = b.lib,
d = c.WordArray,
e = c.Hasher,
f = b.algo,
g = [];
!function () {
for (var b = 0; 64 > b; b++) {
g[b] = 0 | 4294967296 * a.abs(a.sin(b + 1));
}
}(), h = f.MD5 = e.extend({
_doReset: function _doReset() {
this._hash = new d.init([1732584193, 4023233417, 2562383102, 271733878]);
},
_doProcessBlock: function _doProcessBlock(a, b) {
var c, d, e, f, h, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E;
for (c = 0; 16 > c; c++) {
d = b + c, e = a[d], a[d] = 16711935 & (e << 8 | e >>> 24) | 4278255360 & (e << 24 | e >>> 8);
}
f = this._hash.words, h = a[b + 0], m = a[b + 1], n = a[b + 2], o = a[b + 3], p = a[b + 4], q = a[b + 5], r = a[b + 6], s = a[b + 7], t = a[b + 8], u = a[b + 9], v = a[b + 10], w = a[b + 11], x = a[b + 12], y = a[b + 13], z = a[b + 14], A = a[b + 15], B = f[0], C = f[1], D = f[2], E = f[3], B = i(B, C, D, E, h, 7, g[0]), E = i(E, B, C, D, m, 12, g[1]), D = i(D, E, B, C, n, 17, g[2]), C = i(C, D, E, B, o, 22, g[3]), B = i(B, C, D, E, p, 7, g[4]), E = i(E, B, C, D, q, 12, g[5]), D = i(D, E, B, C, r, 17, g[6]), C = i(C, D, E, B, s, 22, g[7]), B = i(B, C, D, E, t, 7, g[8]), E = i(E, B, C, D, u, 12, g[9]), D = i(D, E, B, C, v, 17, g[10]), C = i(C, D, E, B, w, 22, g[11]), B = i(B, C, D, E, x, 7, g[12]), E = i(E, B, C, D, y, 12, g[13]), D = i(D, E, B, C, z, 17, g[14]), C = i(C, D, E, B, A, 22, g[15]), B = j(B, C, D, E, m, 5, g[16]), E = j(E, B, C, D, r, 9, g[17]), D = j(D, E, B, C, w, 14, g[18]), C = j(C, D, E, B, h, 20, g[19]), B = j(B, C, D, E, q, 5, g[20]), E = j(E, B, C, D, v, 9, g[21]), D = j(D, E, B, C, A, 14, g[22]), C = j(C, D, E, B, p, 20, g[23]), B = j(B, C, D, E, u, 5, g[24]), E = j(E, B, C, D, z, 9, g[25]), D = j(D, E, B, C, o, 14, g[26]), C = j(C, D, E, B, t, 20, g[27]), B = j(B, C, D, E, y, 5, g[28]), E = j(E, B, C, D, n, 9, g[29]), D = j(D, E, B, C, s, 14, g[30]), C = j(C, D, E, B, x, 20, g[31]), B = k(B, C, D, E, q, 4, g[32]), E = k(E, B, C, D, t, 11, g[33]), D = k(D, E, B, C, w, 16, g[34]), C = k(C, D, E, B, z, 23, g[35]), B = k(B, C, D, E, m, 4, g[36]), E = k(E, B, C, D, p, 11, g[37]), D = k(D, E, B, C, s, 16, g[38]), C = k(C, D, E, B, v, 23, g[39]), B = k(B, C, D, E, y, 4, g[40]), E = k(E, B, C, D, h, 11, g[41]), D = k(D, E, B, C, o, 16, g[42]), C = k(C, D, E, B, r, 23, g[43]), B = k(B, C, D, E, u, 4, g[44]), E = k(E, B, C, D, x, 11, g[45]), D = k(D, E, B, C, A, 16, g[46]), C = k(C, D, E, B, n, 23, g[47]), B = l(B, C, D, E, h, 6, g[48]), E = l(E, B, C, D, s, 10, g[49]), D = l(D, E, B, C, z, 15, g[50]), C = l(C, D, E, B, q, 21, g[51]), B = l(B, C, D, E, x, 6, g[52]), E = l(E, B, C, D, o, 10, g[53]), D = l(D, E, B, C, v, 15, g[54]), C = l(C, D, E, B, m, 21, g[55]), B = l(B, C, D, E, t, 6, g[56]), E = l(E, B, C, D, A, 10, g[57]), D = l(D, E, B, C, r, 15, g[58]), C = l(C, D, E, B, y, 21, g[59]), B = l(B, C, D, E, p, 6, g[60]), E = l(E, B, C, D, w, 10, g[61]), D = l(D, E, B, C, n, 15, g[62]), C = l(C, D, E, B, u, 21, g[63]), f[0] = 0 | f[0] + B, f[1] = 0 | f[1] + C, f[2] = 0 | f[2] + D, f[3] = 0 | f[3] + E;
},
_doFinalize: function _doFinalize() {
var f,
g,
h,
i,
j,
k,
b = this._data,
c = b.words,
d = 8 * this._nDataBytes,
e = 8 * b.sigBytes;
for (c[e >>> 5] |= 128 << 24 - e % 32, f = a.floor(d / 4294967296), g = d, c[(e + 64 >>> 9 << 4) + 15] = 16711935 & (f << 8 | f >>> 24) | 4278255360 & (f << 24 | f >>> 8), c[(e + 64 >>> 9 << 4) + 14] = 16711935 & (g << 8 | g >>> 24) | 4278255360 & (g << 24 | g >>> 8), b.sigBytes = 4 * (c.length + 1), this._process(), h = this._hash, i = h.words, j = 0; 4 > j; j++) {
k = i[j], i[j] = 16711935 & (k << 8 | k >>> 24) | 4278255360 & (k << 24 | k >>> 8);
}
return h;
},
clone: function clone() {
var a = e.clone.call(this);
return a._hash = this._hash.clone(), a;
}
}), b.MD5 = e._createHelper(h), b.HmacMD5 = e._createHmacHelper(h);
}(Math), function () {
var a = CryptoJS,
b = a.lib,
c = b.WordArray,
d = b.Hasher,
e = a.algo,
f = [],
g = e.SHA1 = d.extend({
_doReset: function _doReset() {
this._hash = new c.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
},
_doProcessBlock: function _doProcessBlock(a, b) {
var j,
k,
l,
c = this._hash.words,
d = c[0],
e = c[1],
g = c[2],
h = c[3],
i = c[4];
for (j = 0; 80 > j; j++) {
16 > j ? f[j] = 0 | a[b + j] : (k = f[j - 3] ^ f[j - 8] ^ f[j - 14] ^ f[j - 16], f[j] = k << 1 | k >>> 31), l = (d << 5 | d >>> 27) + i + f[j], l += 20 > j ? (e & g | ~e & h) + 1518500249 : 40 > j ? (e ^ g ^ h) + 1859775393 : 60 > j ? (e & g | e & h | g & h) - 1894007588 : (e ^ g ^ h) - 899497514, i = h, h = g, g = e << 30 | e >>> 2, e = d, d = l;
}
c[0] = 0 | c[0] + d, c[1] = 0 | c[1] + e, c[2] = 0 | c[2] + g, c[3] = 0 | c[3] + h, c[4] = 0 | c[4] + i;
},
_doFinalize: function _doFinalize() {
var a = this._data,
b = a.words,
c = 8 * this._nDataBytes,
d = 8 * a.sigBytes;
return b[d >>> 5] |= 128 << 24 - d % 32, b[(d + 64 >>> 9 << 4) + 14] = Math.floor(c / 4294967296), b[(d + 64 >>> 9 << 4) + 15] = c, a.sigBytes = 4 * b.length, this._process(), this._hash;
},
clone: function clone() {
var a = d.clone.call(this);
return a._hash = this._hash.clone(), a;
}
});
a.SHA1 = d._createHelper(g), a.HmacSHA1 = d._createHmacHelper(g);
}(), function (a) {
var i,
j,
b = CryptoJS,
c = b.lib,
d = c.WordArray,
e = c.Hasher,
f = b.algo,
g = [],
h = [];
!function () {
function b(b) {
var d,
c = a.sqrt(b);
for (d = 2; c >= d; d++) {
if (!(b % d)) return !1;
}
return !0;
}
function c(a) {
return 0 | 4294967296 * (a - (0 | a));
}
for (var d = 2, e = 0; 64 > e;) {
b(d) && (8 > e && (g[e] = c(a.pow(d, .5))), h[e] = c(a.pow(d, 1 / 3)), e++), d++;
}
}(), i = [], j = f.SHA256 = e.extend({
_doReset: function _doReset() {
this._hash = new d.init(g.slice(0));
},
_doProcessBlock: function _doProcessBlock(a, b) {
var n,
o,
p,
q,
r,
s,
t,
u,
v,
w,
x,
c = this._hash.words,
d = c[0],
e = c[1],
f = c[2],
g = c[3],
j = c[4],
k = c[5],
l = c[6],
m = c[7];
for (n = 0; 64 > n; n++) {
16 > n ? i[n] = 0 | a[b + n] : (o = i[n - 15], p = (o << 25 | o >>> 7) ^ (o << 14 | o >>> 18) ^ o >>> 3, q = i[n - 2], r = (q << 15 | q >>> 17) ^ (q << 13 | q >>> 19) ^ q >>> 10, i[n] = p + i[n - 7] + r + i[n - 16]), s = j & k ^ ~j & l, t = d & e ^ d & f ^ e & f, u = (d << 30 | d >>> 2) ^ (d << 19 | d >>> 13) ^ (d << 10 | d >>> 22), v = (j << 26 | j >>> 6) ^ (j << 21 | j >>> 11) ^ (j << 7 | j >>> 25), w = m + v + s + h[n] + i[n], x = u + t, m = l, l = k, k = j, j = 0 | g + w, g = f, f = e, e = d, d = 0 | w + x;
}
c[0] = 0 | c[0] + d, c[1] = 0 | c[1] + e, c[2] = 0 | c[2] + f, c[3] = 0 | c[3] + g, c[4] = 0 | c[4] + j, c[5] = 0 | c[5] + k, c[6] = 0 | c[6] + l, c[7] = 0 | c[7] + m;
},
_doFinalize: function _doFinalize() {
var b = this._data,
c = b.words,
d = 8 * this._nDataBytes,
e = 8 * b.sigBytes;
return c[e >>> 5] |= 128 << 24 - e % 32, c[(e + 64 >>> 9 << 4) + 14] = a.floor(d / 4294967296), c[(e + 64 >>> 9 << 4) + 15] = d, b.sigBytes = 4 * c.length, this._process(), this._hash;
},
clone: function clone() {
var a = e.clone.call(this);
return a._hash = this._hash.clone(), a;
}
}), b.SHA256 = e._createHelper(j), b.HmacSHA256 = e._createHmacHelper(j);
}(Math), function () {
function f(a) {
return 4278255360 & a << 8 | 16711935 & a >>> 8;
}
var a = CryptoJS,
b = a.lib,
c = b.WordArray,
d = a.enc;
d.Utf16 = d.Utf16BE = {
stringify: function stringify(a) {
var e,
f,
b = a.words,
c = a.sigBytes,
d = [];
for (e = 0; c > e; e += 2) {
f = 65535 & b[e >>> 2] >>> 16 - 8 * (e % 4), d.push(String.fromCharCode(f));
}
return d.join("");
},
parse: function parse(a) {
var e,
b = a.length,
d = [];
for (e = 0; b > e; e++) {
d[e >>> 1] |= a.charCodeAt(e) << 16 - 16 * (e % 2);
}
return c.create(d, 2 * b);
}
}, d.Utf16LE = {
stringify: function stringify(a) {
var e,
g,
b = a.words,
c = a.sigBytes,
d = [];
for (e = 0; c > e; e += 2) {
g = f(65535 & b[e >>> 2] >>> 16 - 8 * (e % 4)), d.push(String.fromCharCode(g));
}
return d.join("");
},
parse: function parse(a) {
var e,
b = a.length,
d = [];
for (e = 0; b > e; e++) {
d[e >>> 1] |= f(a.charCodeAt(e) << 16 - 16 * (e % 2));
}
return c.create(d, 2 * b);
}
};
}(), function () {
var a, b, c, d, e;
"function" == typeof ArrayBuffer && (a = CryptoJS, b = a.lib, c = b.WordArray, d = c.init, e = c.init = function (a) {
var b, c, e;
if (a instanceof ArrayBuffer && (a = new Uint8Array(a)), (a instanceof Int8Array || "undefined" != typeof Uint8ClampedArray && a instanceof Uint8ClampedArray || a instanceof Int16Array || a instanceof Uint16Array || a instanceof Int32Array || a instanceof Uint32Array || a instanceof Float32Array || a instanceof Float64Array) && (a = new Uint8Array(a.buffer, a.byteOffset, a.byteLength)), a instanceof Uint8Array) {
for (b = a.byteLength, c = [], e = 0; b > e; e++) {
c[e >>> 2] |= a[e] << 24 - 8 * (e % 4);
}
d.call(this, c, b);
} else d.apply(this, arguments);
}, e.prototype = c);
}(), function () {
function n(a, b, c) {
return a ^ b ^ c;
}
function o(a, b, c) {
return a & b | ~a & c;
}
function p(a, b, c) {
return (a | ~b) ^ c;
}
function q(a, b, c) {
return a & c | b & ~c;
}
function r(a, b, c) {
return a ^ (b | ~c);
}
function s(a, b) {
return a << b | a >>> 32 - b;
}
var b = CryptoJS,
c = b.lib,
d = c.WordArray,
e = c.Hasher,
f = b.algo,
g = d.create([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]),
h = d.create([5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]),
i = d.create([11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]),
j = d.create([8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]),
k = d.create([0, 1518500249, 1859775393, 2400959708, 2840853838]),
l = d.create([1352829926, 1548603684, 1836072691, 2053994217, 0]),
m = f.RIPEMD160 = e.extend({
_doReset: function _doReset() {
this._hash = d.create([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
},
_doProcessBlock: function _doProcessBlock(a, b) {
var c, d, e, f, m, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I;
for (c = 0; 16 > c; c++) {
d = b + c, e = a[d], a[d] = 16711935 & (e << 8 | e >>> 24) | 4278255360 & (e << 24 | e >>> 8);
}
for (f = this._hash.words, m = k.words, t = l.words, u = g.words, v = h.words, w = i.words, x = j.words, D = y = f[0], E = z = f[1], F = A = f[2], G = B = f[3], H = C = f[4], c = 0; 80 > c; c += 1) {
I = 0 | y + a[b + u[c]], I += 16 > c ? n(z, A, B) + m[0] : 32 > c ? o(z, A, B) + m[1] : 48 > c ? p(z, A, B) + m[2] : 64 > c ? q(z, A, B) + m[3] : r(z, A, B) + m[4], I = 0 | I, I = s(I, w[c]), I = 0 | I + C, y = C, C = B, B = s(A, 10), A = z, z = I, I = 0 | D + a[b + v[c]], I += 16 > c ? r(E, F, G) + t[0] : 32 > c ? q(E, F, G) + t[1] : 48 > c ? p(E, F, G) + t[2] : 64 > c ? o(E, F, G) + t[3] : n(E, F, G) + t[4], I = 0 | I, I = s(I, x[c]), I = 0 | I + H, D = H, H = G, G = s(F, 10), F = E, E = I;
}
I = 0 | f[1] + A + G, f[1] = 0 | f[2] + B + H, f[2] = 0 | f[3] + C + D, f[3] = 0 | f[4] + y + E, f[4] = 0 | f[0] + z + F, f[0] = I;
},
_doFinalize: function _doFinalize() {
var e,
f,
g,
h,
a = this._data,
b = a.words,
c = 8 * this._nDataBytes,
d = 8 * a.sigBytes;
for (b[d >>> 5] |= 128 << 24 - d % 32, b[(d + 64 >>> 9 << 4) + 14] = 16711935 & (c << 8 | c >>> 24) | 4278255360 & (c << 24 | c >>> 8), a.sigBytes = 4 * (b.length + 1), this._process(), e = this._hash, f = e.words, g = 0; 5 > g; g++) {
h = f[g], f[g] = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8);
}
return e;
},
clone: function clone() {
var a = e.clone.call(this);
return a._hash = this._hash.clone(), a;
}
});
b.RIPEMD160 = e._createHelper(m), b.HmacRIPEMD160 = e._createHmacHelper(m);
}(Math), function () {
var a = CryptoJS,
b = a.lib,
c = b.Base,
d = a.enc,
e = d.Utf8,
f = a.algo;
f.HMAC = c.extend({
init: function init(a, b) {
var c, d, f, g, h, i, j;
for (a = this._hasher = new a.init(), "string" == typeof b && (b = e.parse(b)), c = a.blockSize, d = 4 * c, b.sigBytes > d && (b = a.finalize(b)), b.clamp(), f = this._oKey = b.clone(), g = this._iKey = b.clone(), h = f.words, i = g.words, j = 0; c > j; j++) {
h[j] ^= 1549556828, i[j] ^= 909522486;
}
f.sigBytes = g.sigBytes = d, this.reset();
},
reset: function reset() {
var a = this._hasher;
a.reset(), a.update(this._iKey);
},
update: function update(a) {
return this._hasher.update(a), this;
},
finalize: function finalize(a) {
var d,
b = this._hasher,
c = b.finalize(a);
return b.reset(), d = b.finalize(this._oKey.clone().concat(c));
}
});
}(), function () {
var a = CryptoJS,
b = a.lib,
c = b.Base,
d = b.WordArray,
e = a.algo,
f = e.SHA1,
g = e.HMAC,
h = e.PBKDF2 = c.extend({
cfg: c.extend({
keySize: 4,
hasher: f,
iterations: 1
}),
init: function init(a) {
this.cfg = this.cfg.extend(a);
},
compute: function compute(a, b) {
for (var m, n, o, p, q, r, s, c = this.cfg, e = g.create(c.hasher, a), f = d.create(), h = d.create([1]), i = f.words, j = h.words, k = c.keySize, l = c.iterations; i.length < k;) {
for (m = e.update(b).finalize(h), e.reset(), n = m.words, o = n.length, p = m, q = 1; l > q; q++) {
for (p = e.finalize(p), e.reset(), r = p.words, s = 0; o > s; s++) {
n[s] ^= r[s];
}
}
f.concat(m), j[0]++;
}
return f.sigBytes = 4 * k, f;
}
});
a.PBKDF2 = function (a, b, c) {
return h.create(c).compute(a, b);
};
}(), function () {
var a = CryptoJS,
b = a.lib,
c = b.Base,
d = b.WordArray,
e = a.algo,
f = e.MD5,
g = e.EvpKDF = c.extend({
cfg: c.extend({
keySize: 4,
hasher: f,
iterations: 1
}),
init: function init(a) {
this.cfg = this.cfg.extend(a);
},
compute: function compute(a, b) {
for (var c, k, e = this.cfg, f = e.hasher.create(), g = d.create(), h = g.words, i = e.keySize, j = e.iterations; h.length < i;) {
for (c && f.update(c), c = f.update(a).finalize(b), f.reset(), k = 1; j > k; k++) {
c = f.finalize(c), f.reset();
}
g.concat(c);
}
return g.sigBytes = 4 * i, g;
}
});
a.EvpKDF = function (a, b, c) {
return g.create(c).compute(a, b);
};
}(), function () {
var a = CryptoJS,
b = a.lib,
c = b.WordArray,
d = a.algo,
e = d.SHA256,
f = d.SHA224 = e.extend({
_doReset: function _doReset() {
this._hash = new c.init([3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]);
},
_doFinalize: function _doFinalize() {
var a = e._doFinalize.call(this);
return a.sigBytes -= 4, a;
}
});
a.SHA224 = e._createHelper(f), a.HmacSHA224 = e._createHmacHelper(f);
}(), function (a) {
var b = CryptoJS,
c = b.lib,
d = c.Base,
e = c.WordArray,
f = b.x64 = {};
f.Word = d.extend({
init: function init(a, b) {
this.high = a, this.low = b;
}
}), f.WordArray = d.extend({
init: function init(b, c) {
b = this.words = b || [], this.sigBytes = c != a ? c : 8 * b.length;
},
toX32: function toX32() {
var d,
f,
a = this.words,
b = a.length,
c = [];
for (d = 0; b > d; d++) {
f = a[d], c.push(f.high), c.push(f.low);
}
return e.create(c, this.sigBytes);
},
clone: function clone() {
var e,
a = d.clone.call(this),
b = a.words = this.words.slice(0),
c = b.length;
for (e = 0; c > e; e++) {
b[e] = b[e].clone();
}
return a;
}
});
}(), function (a) {
var l,
m,
b = CryptoJS,
c = b.lib,
d = c.WordArray,
e = c.Hasher,
f = b.x64,
g = f.Word,
h = b.algo,
i = [],
j = [],
k = [];
!function () {
var c,
d,
e,
f,
h,
l,
m,
n,
o,
a = 1,
b = 0;
for (c = 0; 24 > c; c++) {
i[a + 5 * b] = (c + 1) * (c + 2) / 2 % 64, d = b % 5, e = (2 * a + 3 * b) % 5, a = d, b = e;
}
for (a = 0; 5 > a; a++) {
for (b = 0; 5 > b; b++) {
j[a + 5 * b] = b + 5 * ((2 * a + 3 * b) % 5);
}
}
for (f = 1, h = 0; 24 > h; h++) {
for (l = 0, m = 0, n = 0; 7 > n; n++) {
1 & f && (o = (1 << n) - 1, 32 > o ? m ^= 1 << o : l ^= 1 << o - 32), 128 & f ? f = 113 ^ f << 1 : f <<= 1;
}
k[h] = g.create(l, m);
}
}(), l = [], function () {
for (var a = 0; 25 > a; a++) {
l[a] = g.create();
}
}(), m = h.SHA3 = e.extend({
cfg: e.cfg.extend({
outputLength: 512
}),
_doReset: function _doReset() {
var b,
a = this._state = [];
for (b = 0; 25 > b; b++) {
a[b] = new g.init();
}
this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
},
_doProcessBlock: function _doProcessBlock(a, b) {
var e,
f,
g,
h,
m,
n,
o,
p,
q,
r,
s,
t,
u,
v,
w,
x,
y,
z,
A,
B,
C,
D,
E,
F,
G,
c = this._state,
d = this.blockSize / 2;
for (e = 0; d > e; e++) {
f = a[b + 2 * e], g = a[b + 2 * e + 1], f = 16711935 & (f << 8 | f >>> 24) | 4278255360 & (f << 24 | f >>> 8), g = 16711935 & (g << 8 | g >>> 24) | 4278255360 & (g << 24 | g >>> 8), h = c[e], h.high ^= g, h.low ^= f;
}
for (m = 0; 24 > m; m++) {
for (n = 0; 5 > n; n++) {
for (o = 0, p = 0, q = 0; 5 > q; q++) {
h = c[n + 5 * q], o ^= h.high, p ^= h.low;
}
r = l[n], r.high = o, r.low = p;
}
for (n = 0; 5 > n; n++) {
for (s = l[(n + 4) % 5], t = l[(n + 1) % 5], u = t.high, v = t.low, o = s.high ^ (u << 1 | v >>> 31), p = s.low ^ (v << 1 | u >>> 31), q = 0; 5 > q; q++) {
h = c[n + 5 * q], h.high ^= o, h.low ^= p;
}
}
for (w = 1; 25 > w; w++) {
h = c[w], x = h.high, y = h.low, z = i[w], 32 > z ? (o = x << z | y >>> 32 - z, p = y << z | x >>> 32 - z) : (o = y << z - 32 | x >>> 64 - z, p = x << z - 32 | y >>> 64 - z), A = l[j[w]], A.high = o, A.low = p;
}
for (B = l[0], C = c[0], B.high = C.high, B.low = C.low, n = 0; 5 > n; n++) {
for (q = 0; 5 > q; q++) {
w = n + 5 * q, h = c[w], D = l[w], E = l[(n + 1) % 5 + 5 * q], F = l[(n + 2) % 5 + 5 * q], h.high = D.high ^ ~E.high & F.high, h.low = D.low ^ ~E.low & F.low;
}
}
h = c[0], G = k[m], h.high ^= G.high, h.low ^= G.low;
}
},
_doFinalize: function _doFinalize() {
var f,
g,
h,
i,
j,
k,
l,
m,
n,
o,
b = this._data,
c = b.words;
for (8 * this._nDataBytes, f = 8 * b.sigBytes, g = 32 * this.blockSize, c[f >>> 5] |= 1 << 24 - f % 32, c[(a.ceil((f + 1) / g) * g >>> 5) - 1] |= 128, b.sigBytes = 4 * c.length, this._process(), h = this._state, i = this.cfg.outputLength / 8, j = i / 8, k = [], l = 0; j > l; l++) {
m = h[l], n = m.high, o = m.low, n = 16711935 & (n << 8 | n >>> 24) | 4278255360 & (n << 24 | n >>> 8), o = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), k.push(o), k.push(n);
}
return new d.init(k, i);
},
clone: function clone() {
var c,
a = e.clone.call(this),
b = a._state = this._state.slice(0);
for (c = 0; 25 > c; c++) {
b[c] = b[c].clone();
}
return a;
}
}), b.SHA3 = e._createHelper(m), b.HmacSHA3 = e._createHmacHelper(m);
}(Math), function () {
function h() {
return e.create.apply(e, arguments);
}
var k,
a = CryptoJS,
b = a.lib,
c = b.Hasher,
d = a.x64,
e = d.Word,
f = d.WordArray,
g = a.algo,
i = [h(1116352408, 3609767458), h(1899447441, 602891725), h(3049323471, 3964484399), h(3921009573, 2173295548), h(961987163, 4081628472), h(1508970993, 3053834265), h(2453635748, 2937671579), h(2870763221, 3664609560), h(3624381080, 2734883394), h(310598401, 1164996542), h(607225278, 1323610764), h(1426881987, 3590304994), h(1925078388, 4068182383), h(2162078206, 991336113), h(2614888103, 633803317), h(3248222580, 3479774868), h(3835390401, 2666613458), h(4022224774, 944711139), h(264347078, 2341262773), h(604807628, 2007800933), h(770255983, 1495990901), h(1249150122, 1856431235), h(1555081692, 3175218132), h(1996064986, 2198950837), h(2554220882, 3999719339), h(2821834349, 766784016), h(2952996808, 2566594879), h(3210313671, 3203337956), h(3336571891, 1034457026), h(3584528711, 2466948901), h(113926993, 3758326383), h(338241895, 168717936), h(666307205, 1188179964), h(773529912, 1546045734), h(1294757372, 1522805485), h(1396182291, 2643833823), h(1695183700, 2343527390), h(1986661051, 1014477480), h(2177026350, 1206759142), h(2456956037, 344077627), h(2730485921, 1290863460), h(2820302411, 3158454273), h(3259730800, 3505952657), h(3345764771, 106217008), h(3516065817, 3606008344), h(3600352804, 1432725776), h(4094571909, 1467031594), h(275423344, 851169720), h(430227734, 3100823752), h(506948616, 1363258195), h(659060556, 3750685593), h(883997877, 3785050280), h(958139571, 3318307427), h(1322822218, 3812723403), h(1537002063, 2003034995), h(1747873779, 3602036899), h(1955562222, 1575990012), h(2024104815, 1125592928), h(2227730452, 2716904306), h(2361852424, 442776044), h(2428436474, 593698344), h(2756734187, 3733110249), h(3204031479, 2999351573), h(3329325298, 3815920427), h(3391569614, 3928383900), h(3515267271, 566280711), h(3940187606, 3454069534), h(4118630271, 4000239992), h(116418474, 1914138554), h(174292421, 2731055270), h(289380356, 3203993006), h(460393269, 320620315), h(685471733, 587496836), h(852142971, 1086792851), h(1017036298, 365543100), h(1126000580, 2618297676), h(1288033470, 3409855158), h(1501505948, 4234509866), h(1607167915, 987167468), h(1816402316, 1246189591)],
j = [];
!function () {
for (var a = 0; 80 > a; a++) {
j[a] = h();
}
}(), k = g.SHA512 = c.extend({
_doReset: function _doReset() {
this._hash = new f.init([new e.init(1779033703, 4089235720), new e.init(3144134277, 2227873595), new e.init(1013904242, 4271175723), new e.init(2773480762, 1595750129), new e.init(1359893119, 2917565137), new e.init(2600822924, 725511199), new e.init(528734635, 4215389547), new e.init(1541459225, 327033209)]);
},
_doProcessBlock: function _doProcessBlock(a, b) {
var T,
U,
V,
W,
X,
Y,
Z,
$,
_,
ab,
bb,
cb,
db,
eb,
fb,
gb,
hb,
ib,
jb,
kb,
lb,
mb,
nb,
ob,
pb,
qb,
rb,
sb,
tb,
ub,
vb,
wb,
xb,
yb,
zb,
c = this._hash.words,
d = c[0],
e = c[1],
f = c[2],
g = c[3],
h = c[4],
k = c[5],
l = c[6],
m = c[7],
n = d.high,
o = d.low,
p = e.high,
q = e.low,
r = f.high,
s = f.low,
t = g.high,
u = g.low,
v = h.high,
w = h.low,
x = k.high,
y = k.low,
z = l.high,
A = l.low,
B = m.high,
C = m.low,
D = n,
E = o,
F = p,
G = q,
H = r,
I = s,
J = t,
K = u,
L = v,
M = w,
N = x,
O = y,
P = z,
Q = A,
R = B,
S = C;
for (T = 0; 80 > T; T++) {
W = j[T], 16 > T ? (V = W.high = 0 | a[b + 2 * T], U = W.low = 0 | a[b + 2 * T + 1]) : (X = j[T - 15], Y = X.high, Z = X.low, $ = (Y >>> 1 | Z << 31) ^ (Y >>> 8 | Z << 24) ^ Y >>> 7, _ = (Z >>> 1 | Y << 31) ^ (Z >>> 8 | Y << 24) ^ (Z >>> 7 | Y << 25), ab = j[T - 2], bb = ab.high, cb = ab.low, db = (bb >>> 19 | cb << 13) ^ (bb << 3 | cb >>> 29) ^ bb >>> 6, eb = (cb >>> 19 | bb << 13) ^ (cb << 3 | bb >>> 29) ^ (cb >>> 6 | bb << 26), fb = j[T - 7], gb = fb.high, hb = fb.low, ib = j[T - 16], jb = ib.high, kb = ib.low, U = _ + hb, V = $ + gb + (_ >>> 0 > U >>> 0 ? 1 : 0), U += eb, V = V + db + (eb >>> 0 > U >>> 0 ? 1 : 0), U += kb, V = V + jb + (kb >>> 0 > U >>> 0 ? 1 : 0), W.high = V, W.low = U), lb = L & N ^ ~L & P, mb = M & O ^ ~M & Q, nb = D & F ^ D & H ^ F & H, ob = E & G ^ E & I ^ G & I, pb = (D >>> 28 | E << 4) ^ (D << 30 | E >>> 2) ^ (D << 25 | E >>> 7), qb = (E >>> 28 | D << 4) ^ (E << 30 | D >>> 2) ^ (E << 25 | D >>> 7), rb = (L >>> 14 | M << 18) ^ (L >>> 18 | M << 14) ^ (L << 23 | M >>> 9), sb = (M >>> 14 | L << 18) ^ (M >>> 18 | L << 14) ^ (M << 23 | L >>> 9), tb = i[T], ub = tb.high, vb = tb.low, wb = S + sb, xb = R + rb + (S >>> 0 > wb >>> 0 ? 1 : 0), wb += mb, xb = xb + lb + (mb >>> 0 > wb >>> 0 ? 1 : 0), wb += vb, xb = xb + ub + (vb >>> 0 > wb >>> 0 ? 1 : 0), wb += U, xb = xb + V + (U >>> 0 > wb >>> 0 ? 1 : 0), yb = qb + ob, zb = pb + nb + (qb >>> 0 > yb >>> 0 ? 1 : 0), R = P, S = Q, P = N, Q = O, N = L, O = M, M = 0 | K + wb, L = 0 | J + xb + (K >>> 0 > M >>> 0 ? 1 : 0), J = H, K = I, H = F, I = G, F = D, G = E, E = 0 | wb + yb, D = 0 | xb + zb + (wb >>> 0 > E >>> 0 ? 1 : 0);
}
o = d.low = o + E, d.high = n + D + (E >>> 0 > o >>> 0 ? 1 : 0), q = e.low = q + G, e.high = p + F + (G >>> 0 > q >>> 0 ? 1 : 0), s = f.low = s + I, f.high = r + H + (I >>> 0 > s >>> 0 ? 1 : 0), u = g.low = u + K, g.high = t + J + (K >>> 0 > u >>> 0 ? 1 : 0), w = h.low = w + M, h.high = v + L + (M >>> 0 > w >>> 0 ? 1 : 0), y = k.low = y + O, k.high = x + N + (O >>> 0 > y >>> 0 ? 1 : 0), A = l.low = A + Q, l.high = z + P + (Q >>> 0 > A >>> 0 ? 1 : 0), C = m.low = C + S, m.high = B + R + (S >>> 0 > C >>> 0 ? 1 : 0);
},
_doFinalize: function _doFinalize() {
var e,
a = this._data,
b = a.words,
c = 8 * this._nDataBytes,
d = 8 * a.sigBytes;
return b[d >>> 5] |= 128 << 24 - d % 32, b[(d + 128 >>> 10 << 5) + 30] = Math.floor(c / 4294967296), b[(d + 128 >>> 10 << 5) + 31] = c, a.sigBytes = 4 * b.length, this._process(), e = this._hash.toX32();
},
clone: function clone() {
var a = c.clone.call(this);
return a._hash = this._hash.clone(), a;
},
blockSize: 32
}), a.SHA512 = c._createHelper(k), a.HmacSHA512 = c._createHmacHelper(k);
}(), function () {
var a = CryptoJS,
b = a.x64,
c = b.Word,
d = b.WordArray,
e = a.algo,
f = e.SHA512,
g = e.SHA384 = f.extend({
_doReset: function _doReset() {
this._hash = new d.init([new c.init(3418070365, 3238371032), new c.init(1654270250, 914150663), new c.init(2438529370, 812702999), new c.init(355462360, 4144912697), new c.init(1731405415, 4290775857), new c.init(2394180231, 1750603025), new c.init(3675008525, 1694076839), new c.init(1203062813, 3204075428)]);
},
_doFinalize: function _doFinalize() {
var a = f._doFinalize.call(this);
return a.sigBytes -= 16, a;
}
});
a.SHA384 = f._createHelper(g), a.HmacSHA384 = f._createHmacHelper(g);
}(), CryptoJS.lib.Cipher || function (a) {
var i,
j,
k,
l,
n,
o,
p,
q,
r,
t,
u,
v,
w,
x,
y,
z,
b = CryptoJS,
c = b.lib,
d = c.Base,
e = c.WordArray,
f = c.BufferedBlockAlgorithm,
g = b.enc;
g.Utf8, i = g.Base64, j = b.algo, k = j.EvpKDF, l = c.Cipher = f.extend({
cfg: d.extend(),
createEncryptor: function createEncryptor(a, b) {
return this.create(this._ENC_XFORM_MODE, a, b);
},
createDecryptor: function createDecryptor(a, b) {
return this.create(this._DEC_XFORM_MODE, a, b);
},
init: function init(a, b, c) {
this.cfg = this.cfg.extend(c), this._xformMode = a, this._key = b, this.reset();
},
reset: function reset() {
f.reset.call(this), this._doReset();
},
process: function process(a) {
return this._append(a), this._process();
},
finalize: function finalize(a) {
a && this._append(a);
var b = this._doFinalize();
return b;
},
keySize: 4,
ivSize: 4,
_ENC_XFORM_MODE: 1,
_DEC_XFORM_MODE: 2,
_createHelper: function () {
function a(a) {
return "string" == typeof a ? z : w;
}
return function (b) {
return {
encrypt: function encrypt(c, d, e) {
return a(d).encrypt(b, c, d, e);
},
decrypt: function decrypt(c, d, e) {
return a(d).decrypt(b, c, d, e);
}
};
};
}()
}), c.StreamCipher = l.extend({
_doFinalize: function _doFinalize() {
var a = this._process(!0);
return a;
},
blockSize: 1
}), n = b.mode = {}, o = c.BlockCipherMode = d.extend({
createEncryptor: function createEncryptor(a, b) {
return this.Encryptor.create(a, b);
},
createDecryptor: function createDecryptor(a, b) {
return this.Decryptor.create(a, b);
},
init: function init(a, b) {
this._cipher = a, this._iv = b;
}
}), p = n.CBC = function () {
function c(b, c, d) {
var e,
g,
f = this._iv;
for (f ? (e = f, this._iv = a) : e = this._prevBlock, g = 0; d > g; g++) {
b[c + g] ^= e[g];
}
}
var b = o.extend();
return b.Encryptor = b.extend({
processBlock: function processBlock(a, b) {
var d = this._cipher,
e = d.blockSize;
c.call(this, a, b, e), d.encryptBlock(a, b), this._prevBlock = a.slice(b, b + e);
}
}), b.Decryptor = b.extend({
processBlock: function processBlock(a, b) {
var d = this._cipher,
e = d.blockSize,
f = a.slice(b, b + e);
d.decryptBlock(a, b), c.call(this, a, b, e), this._prevBlock = f;
}
}), b;
}(), q = b.pad = {}, r = q.Pkcs7 = {
pad: function pad(a, b) {
var h,
i,
c = 4 * b,
d = c - a.sigBytes % c,
f = d << 24 | d << 16 | d << 8 | d,
g = [];
for (h = 0; d > h; h += 4) {
g.push(f);
}
i = e.create(g, d), a.concat(i);
},
unpad: function unpad(a) {
var b = 255 & a.words[a.sigBytes - 1 >>> 2];
a.sigBytes -= b;
}
}, c.BlockCipher = l.extend({
cfg: l.cfg.extend({
mode: p,
padding: r
}),
reset: function reset() {
var a, b, c, d;
l.reset.call(this), b = this.cfg, c = b.iv, d = b.mode, this._xformMode == this._ENC_XFORM_MODE ? a = d.createEncryptor : (a = d.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == a ? this._mode.init(this, c && c.words) : (this._mode = a.call(d, this, c && c.words), this._mode.__creator = a);
},
_doProcessBlock: function _doProcessBlock(a, b) {
this._mode.processBlock(a, b);
},
_doFinalize: function _doFinalize() {
var a,
b = this.cfg.padding;
return this._xformMode == this._ENC_XFORM_MODE ? (b.pad(this._data, this.blockSize), a = this._process(!0)) : (a = this._process(!0), b.unpad(a)), a;
},
blockSize: 4
}), t = c.CipherParams = d.extend({
init: function init(a) {
this.mixIn(a);
},
toString: function toString(a) {
return (a || this.formatter).stringify(this);
}
}), u = b.format = {}, v = u.OpenSSL = {
stringify: function stringify(a) {
var b,
c = a.ciphertext,
d = a.salt;
return b = d ? e.create([1398893684, 1701076831]).concat(d).concat(c) : c, b.toString(i);
},
parse: function parse(a) {
var b,
c = i.parse(a),
d = c.words;
return 1398893684 == d[0] && 1701076831 == d[1] && (b = e.create(d.slice(2, 4)), d.splice(0, 4), c.sigBytes -= 16), t.create({
ciphertext: c,
salt: b
});
}
}, w = c.SerializableCipher = d.extend({
cfg: d.extend({
format: v
}),
encrypt: function encrypt(a, b, c, d) {
var e, f, g;
return d = this.cfg.extend(d), e = a.createEncryptor(c, d), f = e.finalize(b), g = e.cfg, t.create({
ciphertext: f,
key: c,
iv: g.iv,
algorithm: a,
mode: g.mode,
padding: g.padding,
blockSize: a.blockSize,
formatter: d.format
});
},
decrypt: function decrypt(a, b, c, d) {
d = this.cfg.extend(d), b = this._parse(b, d.format);
var e = a.createDecryptor(c, d).finalize(b.ciphertext);
return e;
},
_parse: function _parse(a, b) {
return "string" == typeof a ? b.parse(a, this) : a;
}
}), x = b.kdf = {}, y = x.OpenSSL = {
execute: function execute(a, b, c, d) {
var f, g;
return d || (d = e.random(8)), f = k.create({
keySize: b + c
}).compute(a, d), g = e.create(f.words.slice(b), 4 * c), f.sigBytes = 4 * b, t.create({
key: f,
iv: g,
salt: d
});
}
}, z = c.PasswordBasedCipher = w.extend({
cfg: w.cfg.extend({
kdf: y
}),
encrypt: function encrypt(a, b, c, d) {
var e, f;
return d = this.cfg.extend(d), e = d.kdf.execute(c, a.keySize, a.ivSize), d.iv = e.iv, f = w.encrypt.call(this, a, b, e.key, d), f.mixIn(e), f;
},
decrypt: function decrypt(a, b, c, d) {
var e, f;
return d = this.cfg.extend(d), b = this._parse(b, d.format), e = d.kdf.execute(c, a.keySize, a.ivSize, b.salt), d.iv = e.iv, f = w.decrypt.call(this, a, b, e.key, d);
}
});
}(), CryptoJS.mode.CFB = function () {
function b(a, b, c, d) {
var e,
g,
f = this._iv;
for (f ? (e = f.slice(0), this._iv = void 0) : e = this._prevBlock, d.encryptBlock(e, 0), g = 0; c > g; g++) {
a[b + g] ^= e[g];
}
}
var a = CryptoJS.lib.BlockCipherMode.extend();
return a.Encryptor = a.extend({
processBlock: function processBlock(a, c) {
var d = this._cipher,
e = d.blockSize;
b.call(this, a, c, e, d), this._prevBlock = a.slice(c, c + e);
}
}), a.Decryptor = a.extend({
processBlock: function processBlock(a, c) {
var d = this._cipher,
e = d.blockSize,
f = a.slice(c, c + e);
b.call(this, a, c, e, d), this._prevBlock = f;
}
}), a;
}(), CryptoJS.mode.ECB = function () {
var a = CryptoJS.lib.BlockCipherMode.extend();
return a.Encryptor = a.extend({
processBlock: function processBlock(a, b) {
this._cipher.encryptBlock(a, b);
}
}), a.Decryptor = a.extend({
processBlock: function processBlock(a, b) {
this._cipher.decryptBlock(a, b);
}
}), a;
}(), CryptoJS.pad.AnsiX923 = {
pad: function pad(a, b) {
var c = a.sigBytes,
d = 4 * b,
e = d - c % d,
f = c + e - 1;
a.clamp(), a.words[f >>> 2] |= e << 24 - 8 * (f % 4), a.sigBytes += e;
},
unpad: function unpad(a) {
var b = 255 & a.words[a.sigBytes - 1 >>> 2];
a.sigBytes -= b;
}
}, CryptoJS.pad.Iso10126 = {
pad: function pad(a, b) {
var c = 4 * b,
d = c - a.sigBytes % c;
a.concat(CryptoJS.lib.WordArray.random(d - 1)).concat(CryptoJS.lib.WordArray.create([d << 24], 1));
},
unpad: function unpad(a) {
var b = 255 & a.words[a.sigBytes - 1 >>> 2];
a.sigBytes -= b;
}
}, CryptoJS.pad.Iso97971 = {
pad: function pad(a, b) {
a.concat(CryptoJS.lib.WordArray.create([2147483648], 1)), CryptoJS.pad.ZeroPadding.pad(a, b);
},
unpad: function unpad(a) {
CryptoJS.pad.ZeroPadding.unpad(a), a.sigBytes--;
}
}, CryptoJS.mode.OFB = function () {
var a = CryptoJS.lib.BlockCipherMode.extend(),
b = a.Encryptor = a.extend({
processBlock: function processBlock(a, b) {
var g,
c = this._cipher,
d = c.blockSize,
e = this._iv,
f = this._keystream;
for (e && (f = this._keystream = e.slice(0), this._iv = void 0), c.encryptBlock(f, 0), g = 0; d > g; g++) {
a[b + g] ^= f[g];
}
}
});
return a.Decryptor = b, a;
}(), CryptoJS.pad.NoPadding = {
pad: function pad() {},
unpad: function unpad() {}
}, function () {
var b = CryptoJS,
c = b.lib,
d = c.CipherParams,
e = b.enc,
f = e.Hex,
g = b.format;
g.Hex = {
stringify: function stringify(a) {
return a.ciphertext.toString(f);
},
parse: function parse(a) {
var b = f.parse(a);
return d.create({
ciphertext: b
});
}
};
}(), function () {
var o,
p,
a = CryptoJS,
b = a.lib,
c = b.BlockCipher,
d = a.algo,
e = [],
f = [],
g = [],
h = [],
i = [],
j = [],
k = [],
l = [],
m = [],
n = [];
!function () {
var b,
c,
d,
o,
p,
q,
r,
s,
a = [];
for (b = 0; 256 > b; b++) {
a[b] = 128 > b ? b << 1 : 283 ^ b << 1;
}
for (c = 0, d = 0, b = 0; 256 > b; b++) {
o = d ^ d << 1 ^ d << 2 ^ d << 3 ^ d << 4, o = 99 ^ (o >>> 8 ^ 255 & o), e[c] = o, f[o] = c, p = a[c], q = a[p], r = a[q], s = 257 * a[o] ^ 16843008 * o, g[c] = s << 24 | s >>> 8, h[c] = s << 16 | s >>> 16, i[c] = s << 8 | s >>> 24, j[c] = s, s = 16843009 * r ^ 65537 * q ^ 257 * p ^ 16843008 * c, k[o] = s << 24 | s >>> 8, l[o] = s << 16 | s >>> 16, m[o] = s << 8 | s >>> 24, n[o] = s, c ? (c = p ^ a[a[a[r ^ p]]], d ^= a[a[d]]) : c = d = 1;
}
}(), o = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], p = d.AES = c.extend({
_doReset: function _doReset() {
var a, b, c, d, f, g, h, i, j, p;
if (!this._nRounds || this._keyPriorReset !== this._key) {
for (b = this._keyPriorReset = this._key, c = b.words, d = b.sigBytes / 4, f = this._nRounds = d + 6, g = 4 * (f + 1), h = this._keySchedule = [], i = 0; g > i; i++) {
d > i ? h[i] = c[i] : (a = h[i - 1], i % d ? d > 6 && 4 == i % d && (a = e[a >>> 24] << 24 | e[255 & a >>> 16] << 16 | e[255 & a >>> 8] << 8 | e[255 & a]) : (a = a << 8 | a >>> 24, a = e[a >>> 24] << 24 | e[255 & a >>> 16] << 16 | e[255 & a >>> 8] << 8 | e[255 & a], a ^= o[0 | i / d] << 24), h[i] = h[i - d] ^ a);
}
for (j = this._invKeySchedule = [], p = 0; g > p; p++) {
i = g - p, a = p % 4 ? h[i] : h[i - 4], j[p] = 4 > p || 4 >= i ? a : k[e[a >>> 24]] ^ l[e[255 & a >>> 16]] ^ m[e[255 & a >>> 8]] ^ n[e[255 & a]];
}
}
},
encryptBlock: function encryptBlock(a, b) {
this._doCryptBlock(a, b, this._keySchedule, g, h, i, j, e);
},
decryptBlock: function decryptBlock(a, b) {
var c = a[b + 1];
a[b + 1] = a[b + 3], a[b + 3] = c, this._doCryptBlock(a, b, this._invKeySchedule, k, l, m, n, f), c = a[b + 1], a[b + 1] = a[b + 3], a[b + 3] = c;
},
_doCryptBlock: function _doCryptBlock(a, b, c, d, e, f, g, h) {
var o,
p,
q,
r,
s,
i = this._nRounds,
j = a[b] ^ c[0],
k = a[b + 1] ^ c[1],
l = a[b + 2] ^ c[2],
m = a[b + 3] ^ c[3],
n = 4;
for (o = 1; i > o; o++) {
p = d[j >>> 24] ^ e[255 & k >>> 16] ^ f[255 & l >>> 8] ^ g[255 & m] ^ c[n++], q = d[k >>> 24] ^ e[255 & l >>> 16] ^ f[255 & m >>> 8] ^ g[255 & j] ^ c[n++], r = d[l >>> 24] ^ e[255 & m >>> 16] ^ f[255 & j >>> 8] ^ g[255 & k] ^ c[n++], s = d[m >>> 24] ^ e[255 & j >>> 16] ^ f[255 & k >>> 8] ^ g[255 & l] ^ c[n++], j = p, k = q, l = r, m = s;
}
p = (h[j >>> 24] << 24 | h[255 & k >>> 16] << 16 | h[255 & l >>> 8] << 8 | h[255 & m]) ^ c[n++], q = (h[k >>> 24] << 24 | h[255 & l >>> 16] << 16 | h[255 & m >>> 8] << 8 | h[255 & j]) ^ c[n++], r = (h[l >>> 24] << 24 | h[255 & m >>> 16] << 16 | h[255 & j >>> 8] << 8 | h[255 & k]) ^ c[n++], s = (h[m >>> 24] << 24 | h[255 & j >>> 16] << 16 | h[255 & k >>> 8] << 8 | h[255 & l]) ^ c[n++], a[b] = p, a[b + 1] = q, a[b + 2] = r, a[b + 3] = s;
},
keySize: 8
}), a.AES = c._createHelper(p);
}(), function () {
function l(a, b) {
var c = (this._lBlock >>> a ^ this._rBlock) & b;
this._rBlock ^= c, this._lBlock ^= c << a;
}
function m(a, b) {
var c = (this._rBlock >>> a ^ this._lBlock) & b;
this._lBlock ^= c, this._rBlock ^= c << a;
}
var n,
a = CryptoJS,
b = a.lib,
c = b.WordArray,
d = b.BlockCipher,
e = a.algo,
f = [57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4],
g = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32],
h = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28],
i = [{
0: 8421888,
268435456: 32768,
536870912: 8421378,
805306368: 2,
1073741824: 512,
1342177280: 8421890,
1610612736: 8389122,
1879048192: 8388608,
2147483648: 514,
2415919104: 8389120,
2684354560: 33280,
2952790016: 8421376,
3221225472: 32770,
3489660928: 8388610,
3758096384: 0,
4026531840: 33282,
134217728: 0,
402653184: 8421890,
671088640: 33282,
939524096: 32768,
1207959552: 8421888,
1476395008: 512,
1744830464: 8421378,
2013265920: 2,
2281701376: 8389120,
2550136832: 33280,
2818572288: 8421376,
3087007744: 8389122,
3355443200: 8388610,
3623878656: 32770,
3892314112: 514,
4160749568: 8388608,
1: 32768,
268435457: 2,
536870913: 8421888,
805306369: 8388608,
1073741825: 8421378,
1342177281: 33280,
1610612737: 512,
1879048193: 8389122,
2147483649: 8421890,
2415919105: 8421376,
2684354561: 8388610,
2952790017: 33282,
3221225473: 514,
3489660929: 8389120,
3758096385: 32770,
4026531841: 0,
134217729: 8421890,
402653185: 8421376,
671088641: 8388608,
939524097: 512,
1207959553: 32768,
1476395009: 8388610,
1744830465: 2,
2013265921: 33282,
2281701377: 32770,
2550136833: 8389122,
2818572289: 514,
3087007745: 8421888,
3355443201: 8389120,
3623878657: 0,
3892314113: 33280,
4160749569: 8421378
}, {
0: 1074282512,
16777216: 16384,
33554432: 524288,
50331648: 1074266128,
67108864: 1073741840,
83886080: 1074282496,
100663296: 1073758208,
117440512: 16,
134217728: 540672,
150994944: 1073758224,
167772160: 1073741824,
184549376: 540688,
201326592: 524304,
218103808: 0,
234881024: 16400,
251658240: 1074266112,
8388608: 1073758208,
25165824: 540688,
41943040: 16,
58720256: 1073758224,
75497472: 1074282512,
92274688: 1073741824,
109051904: 524288,
125829120: 1074266128,
142606336: 524304,
159383552: 0,
176160768: 16384,
192937984: 1074266112,
209715200: 1073741840,
226492416: 540672,
243269632: 1074282496,
260046848: 16400,
268435456: 0,
285212672: 1074266128,
301989888: 1073758224,
318767104: 1074282496,
335544320: 1074266112,
352321536: 16,
369098752: 540688,
385875968: 16384,
402653184: 16400,
419430400: 524288,
436207616: 524304,
452984832: 1073741840,
469762048: 540672,
486539264: 1073758208,
503316480: 1073741824,
520093696: 1074282512,
276824064: 540688,
293601280: 524288,
310378496: 1074266112,
327155712: 16384,
343932928: 1073758208,
360710144: 1074282512,
377487360: 16,
394264576: 1073741824,
411041792: 1074282496,
427819008: 1073741840,
444596224: 1073758224,
461373440: 524304,
478150656: 0,
494927872: 16400,
511705088: 1074266128,
528482304: 540672
}, {
0: 260,
1048576: 0,
2097152: 67109120,
3145728: 65796,
4194304: 65540,
5242880: 67108868,
6291456: 67174660,
7340032: 67174400,
8388608: 67108864,
9437184: 67174656,
10485760: 65792,
11534336: 67174404,
12582912: 67109124,
13631488: 65536,
14680064: 4,
15728640: 256,
524288: 67174656,
1572864: 67174404,
2621440: 0,
3670016: 67109120,
4718592: 67108868,
5767168: 65536,
6815744: 65540,
7864320: 260,
8912896: 4,
9961472: 256,
11010048: 67174400,
12058624: 65796,
13107200: 65792,
14155776: 67109124,
15204352: 67174660,
16252928: 67108864,
16777216: 67174656,
17825792: 65540,
18874368: 65536,
19922944: 67109120,
20971520: 256,
22020096: 67174660,
23068672: 67108868,
24117248: 0,
25165824: 67109124,
26214400: 67108864,
27262976: 4,
28311552: 65792,
29360128: 67174400,
30408704: 260,
31457280: 65796,
32505856: 67174404,
17301504: 67108864,
18350080: 260,
19398656: 67174656,
20447232: 0,
21495808: 65540,
22544384: 67109120,
23592960: 256,
24641536: 67174404,
25690112: 65536,
26738688: 67174660,
27787264: 65796,
28835840: 67108868,
29884416: 67109124,
30932992: 67174400,
31981568: 4,
33030144: 65792
}, {
0: 2151682048,
65536: 2147487808,
131072: 4198464,
196608: 2151677952,
262144: 0,
327680: 4198400,
393216: 2147483712,
458752: 4194368,
524288: 2147483648,
589824: 4194304,
655360: 64,
720896: 2147487744,
786432: 2151678016,
851968: 4160,
917504: 4096,
983040: 2151682112,
32768: 2147487808,
98304: 64,
163840: 2151678016,
229376: 2147487744,
294912: 4198400,
360448: 2151682112,
425984: 0,
491520: 2151677952,
557056: 4096,
622592: 2151682048,
688128: 4194304,
753664: 4160,
819200: 2147483648,
884736: 4194368,
950272: 4198464,
1015808: 2147483712,
1048576: 4194368,
1114112: 4198400,
1179648: 2147483712,
1245184: 0,
1310720: 4160,
1376256: 2151678016,
1441792: 2151682048,
1507328: 2147487808,
1572864: 2151682112,
1638400: 2147483648,
1703936: 2151677952,
1769472: 4198464,
1835008: 2147487744,
1900544: 4194304,
1966080: 64,
2031616: 4096,
1081344: 2151677952,
1146880: 2151682112,
1212416: 0,
1277952: 4198400,
1343488: 4194368,
1409024: 2147483648,
1474560: 2147487808,
1540096: 64,
1605632: 2147483712,
1671168: 4096,
1736704: 2147487744,
1802240: 2151678016,
1867776: 4160,
1933312: 2151682048,
1998848: 4194304,
2064384: 4198464
}, {
0: 128,
4096: 17039360,
8192: 262144,
12288: 536870912,
16384: 537133184,
20480: 16777344,
24576: 553648256,
28672: 262272,
32768: 16777216,
36864: 537133056,
40960: 536871040,
45056: 553910400,
49152: 553910272,
53248: 0,
57344: 17039488,
61440: 553648128,
2048: 17039488,
6144: 553648256,
10240: 128,
14336: 17039360,
18432: 262144,
22528: 537133184,
26624: 553910272,
30720: 536870912,
34816: 537133056,
38912: 0,
43008: 553910400,
47104: 16777344,
51200: 536871040,
55296: 553648128,
59392: 16777216,
63488: 262272,
65536: 262144,
69632: 128,
73728: 536870912,
77824: 553648256,
81920: 16777344,
86016: 553910272,
90112: 537133184,
94208: 16777216,
98304: 553910400,
102400: 553648128,
106496: 17039360,
110592: 537133056,
114688: 262272,
118784: 536871040,
122880: 0,
126976: 17039488,
67584: 553648256,
71680: 16777216,
75776: 17039360,
79872: 537133184,
83968: 536870912,
88064: 17039488,
92160: 128,
96256: 553910272,
100352: 262272,
104448: 553910400,
108544: 0,
112640: 553648128,
116736: 16777344,
120832: 262144,
124928: 537133056,
129024: 536871040
}, {
0: 268435464,
256: 8192,
512: 270532608,
768: 270540808,
1024: 268443648,
1280: 2097152,
1536: 2097160,
1792: 268435456,
2048: 0,
2304: 268443656,
2560: 2105344,
2816: 8,
3072: 270532616,
3328: 2105352,
3584: 8200,
3840: 270540800,
128: 270532608,
384: 270540808,
640: 8,
896: 2097152,
1152: 2105352,
1408: 268435464,
1664: 268443648,
1920: 8200,
2176: 2097160,
2432: 8192,
2688: 268443656,
2944: 270532616,
3200: 0,
3456: 270540800,
3712: 2105344,
3968: 268435456,
4096: 268443648,
4352: 270532616,
4608: 270540808,
4864: 8200,
5120: 2097152,
5376: 268435456,
5632: 268435464,
5888: 2105344,
6144: 2105352,
6400: 0,
6656: 8,
6912: 270532608,
7168: 8192,
7424: 268443656,
7680: 270540800,
7936: 2097160,
4224: 8,
4480: 2105344,
4736: 2097152,
4992: 268435464,
5248: 268443648,
5504: 8200,
5760: 270540808,
6016: 270532608,
6272: 270540800,
6528: 270532616,
6784: 8192,
7040: 2105352,
7296: 2097160,
7552: 0,
7808: 268435456,
8064: 268443656
}, {
0: 1048576,
16: 33555457,
32: 1024,
48: 1049601,
64: 34604033,
80: 0,
96: 1,
112: 34603009,
128: 33555456,
144: 1048577,
160: 33554433,
176: 34604032,
192: 34603008,
208: 1025,
224: 1049600,
240: 33554432,
8: 34603009,
24: 0,
40: 33555457,
56: 34604032,
72: 1048576,
88: 33554433,
104: 33554432,
120: 1025,
136: 1049601,
152: 33555456,
168: 34603008,
184: 1048577,
200: 1024,
216: 34604033,
232: 1,
248: 1049600,
256: 33554432,
272: 1048576,
288: 33555457,
304: 34603009,
320: 1048577,
336: 33555456,
352: 34604032,
368: 1049601,
384: 1025,
400: 34604033,
416: 1049600,
432: 1,
448: 0,
464: 34603008,
480: 33554433,
496: 1024,
264: 1049600,
280: 33555457,
296: 34603009,
312: 1,
328: 33554432,
344: 1048576,
360: 1025,
376: 34604032,
392: 33554433,
408: 34603008,
424: 0,
440: 34604033,
456: 1049601,
472: 1024,
488: 33555456,
504: 1048577
}, {
0: 134219808,
1: 131072,
2: 134217728,
3: 32,
4: 131104,
5: 134350880,
6: 134350848,
7: 2048,
8: 134348800,
9: 134219776,
10: 133120,
11: 134348832,
12: 2080,
13: 0,
14: 134217760,
15: 133152,
2147483648: 2048,
2147483649: 134350880,
2147483650: 134219808,
2147483651: 134217728,
2147483652: 134348800,
2147483653: 133120,
2147483654: 133152,
2147483655: 32,
2147483656: 134217760,
2147483657: 2080,
2147483658: 131104,
2147483659: 134350848,
2147483660: 0,
2147483661: 134348832,
2147483662: 134219776,
2147483663: 131072,
16: 133152,
17: 134350848,
18: 32,
19: 2048,
20: 134219776,
21: 134217760,
22: 134348832,
23: 131072,
24: 0,
25: 131104,
26: 134348800,
27: 134219808,
28: 134350880,
29: 133120,
30: 2080,
31: 134217728,
2147483664: 131072,
2147483665: 2048,
2147483666: 134348832,
2147483667: 133152,
2147483668: 32,
2147483669: 134348800,
2147483670: 134217728,
2147483671: 134219808,
2147483672: 134350880,
2147483673: 134217760,
2147483674: 134219776,
2147483675: 0,
2147483676: 133120,
2147483677: 2080,
2147483678: 131104,
2147483679: 134350848
}],
j = [4160749569, 528482304, 33030144, 2064384, 129024, 8064, 504, 2147483679],
k = e.DES = d.extend({
_doReset: function _doReset() {
var d,
e,
i,
j,
k,
l,
m,
a = this._key,
b = a.words,
c = [];
for (d = 0; 56 > d; d++) {
e = f[d] - 1, c[d] = 1 & b[e >>> 5] >>> 31 - e % 32;
}
for (i = this._subKeys = [], j = 0; 16 > j; j++) {
for (k = i[j] = [], l = h[j], d = 0; 24 > d; d++) {
k[0 | d / 6] |= c[(g[d] - 1 + l) % 28] << 31 - d % 6, k[4 + (0 | d / 6)] |= c[28 + (g[d + 24] - 1 + l) % 28] << 31 - d % 6;
}
for (k[0] = k[0] << 1 | k[0] >>> 31, d = 1; 7 > d; d++) {
k[d] = k[d] >>> 4 * (d - 1) + 3;
}
k[7] = k[7] << 5 | k[7] >>> 27;
}
for (m = this._invSubKeys = [], d = 0; 16 > d; d++) {
m[d] = i[15 - d];
}
},
encryptBlock: function encryptBlock(a, b) {
this._doCryptBlock(a, b, this._subKeys);
},
decryptBlock: function decryptBlock(a, b) {
this._doCryptBlock(a, b, this._invSubKeys);
},
_doCryptBlock: function _doCryptBlock(a, b, c) {
var d, e, f, g, h, k, n;
for (this._lBlock = a[b], this._rBlock = a[b + 1], l.call(this, 4, 252645135), l.call(this, 16, 65535), m.call(this, 2, 858993459), m.call(this, 8, 16711935), l.call(this, 1, 1431655765), d = 0; 16 > d; d++) {
for (e = c[d], f = this._lBlock, g = this._rBlock, h = 0, k = 0; 8 > k; k++) {
h |= i[k][((g ^ e[k]) & j[k]) >>> 0];
}
this._lBlock = g, this._rBlock = f ^ h;
}
n = this._lBlock, this._lBlock = this._rBlock, this._rBlock = n, l.call(this, 1, 1431655765), m.call(this, 8, 16711935), m.call(this, 2, 858993459), l.call(this, 16, 65535), l.call(this, 4, 252645135), a[b] = this._lBlock, a[b + 1] = this._rBlock;
},
keySize: 2,
ivSize: 2,
blockSize: 2
});
a.DES = d._createHelper(k), n = e.TripleDES = d.extend({
_doReset: function _doReset() {
var d,
e,
f,
a = this._key,
b = a.words;
if (2 !== b.length && 4 !== b.length && b.length < 6) throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");
d = b.slice(0, 2), e = b.length < 4 ? b.slice(0, 2) : b.slice(2, 4), f = b.length < 6 ? b.slice(0, 2) : b.slice(4, 6), this._des1 = k.createEncryptor(c.create(d)), this._des2 = k.createEncryptor(c.create(e)), this._des3 = k.createEncryptor(c.create(f));
},
encryptBlock: function encryptBlock(a, b) {
this._des1.encryptBlock(a, b), this._des2.decryptBlock(a, b), this._des3.encryptBlock(a, b);
},
decryptBlock: function decryptBlock(a, b) {
this._des3.decryptBlock(a, b), this._des2.encryptBlock(a, b), this._des1.decryptBlock(a, b);
},
keySize: 6,
ivSize: 2,
blockSize: 2
}), a.TripleDES = d._createHelper(n);
}(), function () {
function f() {
var e,
f,
a = this._S,
b = this._i,
c = this._j,
d = 0;
for (e = 0; 4 > e; e++) {
b = (b + 1) % 256, c = (c + a[b]) % 256, f = a[b], a[b] = a[c], a[c] = f, d |= a[(a[b] + a[c]) % 256] << 24 - 8 * e;
}
return this._i = b, this._j = c, d;
}
var g,
a = CryptoJS,
b = a.lib,
c = b.StreamCipher,
d = a.algo,
e = d.RC4 = c.extend({
_doReset: function _doReset() {
var e,
f,
g,
h,
i,
a = this._key,
b = a.words,
c = a.sigBytes,
d = this._S = [];
for (e = 0; 256 > e; e++) {
d[e] = e;
}
for (e = 0, f = 0; 256 > e; e++) {
g = e % c, h = 255 & b[g >>> 2] >>> 24 - 8 * (g % 4), f = (f + d[e] + h) % 256, i = d[e], d[e] = d[f], d[f] = i;
}
this._i = this._j = 0;
},
_doProcessBlock: function _doProcessBlock(a, b) {
a[b] ^= f.call(this);
},
keySize: 8,
ivSize: 0
});
a.RC4 = c._createHelper(e), g = d.RC4Drop = e.extend({
cfg: e.cfg.extend({
drop: 192
}),
_doReset: function _doReset() {
e._doReset.call(this);
for (var a = this.cfg.drop; a > 0; a--) {
f.call(this);
}
}
}), a.RC4Drop = c._createHelper(g);
}(), CryptoJS.mode.CTRGladman = function () {
function b(a) {
var b, c, d;
return 255 === (255 & a >> 24) ? (b = 255 & a >> 16, c = 255 & a >> 8, d = 255 & a, 255 === b ? (b = 0, 255 === c ? (c = 0, 255 === d ? d = 0 : ++d) : ++c) : ++b, a = 0, a += b << 16, a += c << 8, a += d) : a += 1 << 24, a;
}
function c(a) {
return 0 === (a[0] = b(a[0])) && (a[1] = b(a[1])), a;
}
var a = CryptoJS.lib.BlockCipherMode.extend(),
d = a.Encryptor = a.extend({
processBlock: function processBlock(a, b) {
var h,
i,
d = this._cipher,
e = d.blockSize,
f = this._iv,
g = this._counter;
for (f && (g = this._counter = f.slice(0), this._iv = void 0), c(g), h = g.slice(0), d.encryptBlock(h, 0), i = 0; e > i; i++) {
a[b + i] ^= h[i];
}
}
});
return a.Decryptor = d, a;
}(), function () {
function i() {
var c,
d,
e,
h,
i,
j,
a = this._X,
b = this._C;
for (c = 0; 8 > c; c++) {
f[c] = b[c];
}
for (b[0] = 0 | b[0] + 1295307597 + this._b, b[1] = 0 | b[1] + 3545052371 + (b[0] >>> 0 < f[0] >>> 0 ? 1 : 0), b[2] = 0 | b[2] + 886263092 + (b[1] >>> 0 < f[1] >>> 0 ? 1 : 0), b[3] = 0 | b[3] + 1295307597 + (b[2] >>> 0 < f[2] >>> 0 ? 1 : 0), b[4] = 0 | b[4] + 3545052371 + (b[3] >>> 0 < f[3] >>> 0 ? 1 : 0), b[5] = 0 | b[5] + 886263092 + (b[4] >>> 0 < f[4] >>> 0 ? 1 : 0), b[6] = 0 | b[6] + 1295307597 + (b[5] >>> 0 < f[5] >>> 0 ? 1 : 0), b[7] = 0 | b[7] + 3545052371 + (b[6] >>> 0 < f[6] >>> 0 ? 1 : 0), this._b = b[7] >>> 0 < f[7] >>> 0 ? 1 : 0, c = 0; 8 > c; c++) {
d = a[c] + b[c], e = 65535 & d, h = d >>> 16, i = ((e * e >>> 17) + e * h >>> 15) + h * h, j = (0 | (4294901760 & d) * d) + (0 | (65535 & d) * d), g[c] = i ^ j;
}
a[0] = 0 | g[0] + (g[7] << 16 | g[7] >>> 16) + (g[6] << 16 | g[6] >>> 16), a[1] = 0 | g[1] + (g[0] << 8 | g[0] >>> 24) + g[7], a[2] = 0 | g[2] + (g[1] << 16 | g[1] >>> 16) + (g[0] << 16 | g[0] >>> 16), a[3] = 0 | g[3] + (g[2] << 8 | g[2] >>> 24) + g[1], a[4] = 0 | g[4] + (g[3] << 16 | g[3] >>> 16) + (g[2] << 16 | g[2] >>> 16), a[5] = 0 | g[5] + (g[4] << 8 | g[4] >>> 24) + g[3], a[6] = 0 | g[6] + (g[5] << 16 | g[5] >>> 16) + (g[4] << 16 | g[4] >>> 16), a[7] = 0 | g[7] + (g[6] << 8 | g[6] >>> 24) + g[5];
}
var a = CryptoJS,
b = a.lib,
c = b.StreamCipher,
d = a.algo,
e = [],
f = [],
g = [],
h = d.Rabbit = c.extend({
_doReset: function _doReset() {
var c,
d,
e,
f,
g,
h,
j,
k,
l,
m,
a = this._key.words,
b = this.cfg.iv;
for (c = 0; 4 > c; c++) {
a[c] = 16711935 & (a[c] << 8 | a[c] >>> 24) | 4278255360 & (a[c] << 24 | a[c] >>> 8);
}
for (d = this._X = [a[0], a[3] << 16 | a[2] >>> 16, a[1], a[0] << 16 | a[3] >>> 16, a[2], a[1] << 16 | a[0] >>> 16, a[3], a[2] << 16 | a[1] >>> 16], e = this._C = [a[2] << 16 | a[2] >>> 16, 4294901760 & a[0] | 65535 & a[1], a[3] << 16 | a[3] >>> 16, 4294901760 & a[1] | 65535 & a[2], a[0] << 16 | a[0] >>> 16, 4294901760 & a[2] | 65535 & a[3], a[1] << 16 | a[1] >>> 16, 4294901760 & a[3] | 65535 & a[0]], this._b = 0, c = 0; 4 > c; c++) {
i.call(this);
}
for (c = 0; 8 > c; c++) {
e[c] ^= d[7 & c + 4];
}
if (b) for (f = b.words, g = f[0], h = f[1], j = 16711935 & (g << 8 | g >>> 24) | 4278255360 & (g << 24 | g >>> 8), k = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8), l = j >>> 16 | 4294901760 & k, m = k << 16 | 65535 & j, e[0] ^= j, e[1] ^= l, e[2] ^= k, e[3] ^= m, e[4] ^= j, e[5] ^= l, e[6] ^= k, e[7] ^= m, c = 0; 4 > c; c++) {
i.call(this);
}
},
_doProcessBlock: function _doProcessBlock(a, b) {
var d,
c = this._X;
for (i.call(this), e[0] = c[0] ^ c[5] >>> 16 ^ c[3] << 16, e[1] = c[2] ^ c[7] >>> 16 ^ c[5] << 16, e[2] = c[4] ^ c[1] >>> 16 ^ c[7] << 16, e[3] = c[6] ^ c[3] >>> 16 ^ c[1] << 16, d = 0; 4 > d; d++) {
e[d] = 16711935 & (e[d] << 8 | e[d] >>> 24) | 4278255360 & (e[d] << 24 | e[d] >>> 8), a[b + d] ^= e[d];
}
},
blockSize: 4,
ivSize: 2
});
a.Rabbit = c._createHelper(h);
}(), CryptoJS.mode.CTR = function () {
var a = CryptoJS.lib.BlockCipherMode.extend(),
b = a.Encryptor = a.extend({
processBlock: function processBlock(a, b) {
var g,
h,
c = this._cipher,
d = c.blockSize,
e = this._iv,
f = this._counter;
for (e && (f = this._counter = e.slice(0), this._iv = void 0), g = f.slice(0), c.encryptBlock(g, 0), f[d - 1] = 0 | f[d - 1] + 1, h = 0; d > h; h++) {
a[b + h] ^= g[h];
}
}
});
return a.Decryptor = b, a;
}(), function () {
function i() {
var c,
d,
e,
h,
i,
j,
a = this._X,
b = this._C;
for (c = 0; 8 > c; c++) {
f[c] = b[c];
}
for (b[0] = 0 | b[0] + 1295307597 + this._b, b[1] = 0 | b[1] + 3545052371 + (b[0] >>> 0 < f[0] >>> 0 ? 1 : 0), b[2] = 0 | b[2] + 886263092 + (b[1] >>> 0 < f[1] >>> 0 ? 1 : 0), b[3] = 0 | b[3] + 1295307597 + (b[2] >>> 0 < f[2] >>> 0 ? 1 : 0), b[4] = 0 | b[4] + 3545052371 + (b[3] >>> 0 < f[3] >>> 0 ? 1 : 0), b[5] = 0 | b[5] + 886263092 + (b[4] >>> 0 < f[4] >>> 0 ? 1 : 0), b[6] = 0 | b[6] + 1295307597 + (b[5] >>> 0 < f[5] >>> 0 ? 1 : 0), b[7] = 0 | b[7] + 3545052371 + (b[6] >>> 0 < f[6] >>> 0 ? 1 : 0), this._b = b[7] >>> 0 < f[7] >>> 0 ? 1 : 0, c = 0; 8 > c; c++) {
d = a[c] + b[c], e = 65535 & d, h = d >>> 16, i = ((e * e >>> 17) + e * h >>> 15) + h * h, j = (0 | (4294901760 & d) * d) + (0 | (65535 & d) * d), g[c] = i ^ j;
}
a[0] = 0 | g[0] + (g[7] << 16 | g[7] >>> 16) + (g[6] << 16 | g[6] >>> 16), a[1] = 0 | g[1] + (g[0] << 8 | g[0] >>> 24) + g[7], a[2] = 0 | g[2] + (g[1] << 16 | g[1] >>> 16) + (g[0] << 16 | g[0] >>> 16), a[3] = 0 | g[3] + (g[2] << 8 | g[2] >>> 24) + g[1], a[4] = 0 | g[4] + (g[3] << 16 | g[3] >>> 16) + (g[2] << 16 | g[2] >>> 16), a[5] = 0 | g[5] + (g[4] << 8 | g[4] >>> 24) + g[3], a[6] = 0 | g[6] + (g[5] << 16 | g[5] >>> 16) + (g[4] << 16 | g[4] >>> 16), a[7] = 0 | g[7] + (g[6] << 8 | g[6] >>> 24) + g[5];
}
var a = CryptoJS,
b = a.lib,
c = b.StreamCipher,
d = a.algo,
e = [],
f = [],
g = [],
h = d.RabbitLegacy = c.extend({
_doReset: function _doReset() {
var e,
f,
g,
h,
j,
k,
l,
m,
a = this._key.words,
b = this.cfg.iv,
c = this._X = [a[0], a[3] << 16 | a[2] >>> 16, a[1], a[0] << 16 | a[3] >>> 16, a[2], a[1] << 16 | a[0] >>> 16, a[3], a[2] << 16 | a[1] >>> 16],
d = this._C = [a[2] << 16 | a[2] >>> 16, 4294901760 & a[0] | 65535 & a[1], a[3] << 16 | a[3] >>> 16, 4294901760 & a[1] | 65535 & a[2], a[0] << 16 | a[0] >>> 16, 4294901760 & a[2] | 65535 & a[3], a[1] << 16 | a[1] >>> 16, 4294901760 & a[3] | 65535 & a[0]];
for (this._b = 0, e = 0; 4 > e; e++) {
i.call(this);
}
for (e = 0; 8 > e; e++) {
d[e] ^= c[7 & e + 4];
}
if (b) for (f = b.words, g = f[0], h = f[1], j = 16711935 & (g << 8 | g >>> 24) | 4278255360 & (g << 24 | g >>> 8), k = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8), l = j >>> 16 | 4294901760 & k, m = k << 16 | 65535 & j, d[0] ^= j, d[1] ^= l, d[2] ^= k, d[3] ^= m, d[4] ^= j, d[5] ^= l, d[6] ^= k, d[7] ^= m, e = 0; 4 > e; e++) {
i.call(this);
}
},
_doProcessBlock: function _doProcessBlock(a, b) {
var d,
c = this._X;
for (i.call(this), e[0] = c[0] ^ c[5] >>> 16 ^ c[3] << 16, e[1] = c[2] ^ c[7] >>> 16 ^ c[5] << 16, e[2] = c[4] ^ c[1] >>> 16 ^ c[7] << 16, e[3] = c[6] ^ c[3] >>> 16 ^ c[1] << 16, d = 0; 4 > d; d++) {
e[d] = 16711935 & (e[d] << 8 | e[d] >>> 24) | 4278255360 & (e[d] << 24 | e[d] >>> 8), a[b + d] ^= e[d];
}
},
blockSize: 4,
ivSize: 2
});
a.RabbitLegacy = c._createHelper(h);
}(), CryptoJS.pad.ZeroPadding = {
pad: function pad(a, b) {
var c = 4 * b;
a.clamp(), a.sigBytes += c - (a.sigBytes % c || c);
},
unpad: function unpad(a) {
var b = a.words,
c = a.sigBytes - 1;
for (c = a.sigBytes - 1; c >= 0; c--) {
if (255 & b[c >>> 2] >>> 24 - 8 * (c % 4)) {
a.sigBytes = c + 1;
break;
}
}
}
};
try {} catch (e) {}
!function (a, b) {
"object" == ( false ? undefined : _typeof(exports)) && "undefined" != typeof module ? b(exports) : true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (b),
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : undefined;
}(this, function (a) {
"use strict";
function c(a) {
return b.charAt(a);
}
function d(a, b) {
return a & b;
}
function e(a, b) {
return a | b;
}
function f(a, b) {
return a ^ b;
}
function g(a, b) {
return a & ~b;
}
function h(a) {
if (0 == a) return -1;
var b = 0;
return 0 == (65535 & a) && (a >>= 16, b += 16), 0 == (255 & a) && (a >>= 8, b += 8), 0 == (15 & a) && (a >>= 4, b += 4), 0 == (3 & a) && (a >>= 2, b += 2), 0 == (1 & a) && ++b, b;
}
function i(a) {
for (var b = 0; 0 != a;) {
a &= a - 1, ++b;
}
return b;
}
function l(a) {
var b,
c,
d = "";
for (b = 0; b + 3 <= a.length; b += 3) {
c = parseInt(a.substring(b, b + 3), 16), d += j.charAt(c >> 6) + j.charAt(63 & c);
}
for (b + 1 == a.length ? (c = parseInt(a.substring(b, b + 1), 16), d += j.charAt(c << 2)) : b + 2 == a.length && (c = parseInt(a.substring(b, b + 2), 16), d += j.charAt(c >> 2) + j.charAt((3 & c) << 4)); (3 & d.length) > 0;) {
d += k;
}
return d;
}
function m(a) {
var d,
g,
b = "",
e = 0,
f = 0;
for (d = 0; d < a.length && a.charAt(d) != k; ++d) {
g = j.indexOf(a.charAt(d)), 0 > g || (0 == e ? (b += c(g >> 2), f = 3 & g, e = 1) : 1 == e ? (b += c(f << 2 | g >> 4), f = 15 & g, e = 2) : 2 == e ? (b += c(f), b += c(g >> 2), f = 3 & g, e = 3) : (b += c(f << 2 | g >> 4), b += c(15 & g), e = 0));
}
return 1 == e && (b += c(f << 2)), b;
}
function o(a, b) {
function c() {
this.constructor = a;
}
_n(a, b), a.prototype = null === b ? Object.create(b) : (c.prototype = b.prototype, new c());
}
function y(a, b) {
return a.length > b && (a = a.substring(0, b) + v), a;
}
function M() {
return new H(null);
}
function N(a, b) {
return new H(a, b);
}
function Q(a, b, c, d, e, f) {
for (var i, j, k, g = 16383 & b, h = b >> 14; --f >= 0;) {
i = 16383 & this[a], j = this[a++] >> 14, k = h * i + j * g, i = g * i + ((16383 & k) << 14) + c[d] + e, e = (i >> 28) + (k >> 14) + h * j, c[d++] = 268435455 & i;
}
return e;
}
function V(a, b) {
var c = S[a.charCodeAt(b)];
return null == c ? -1 : c;
}
function W(a) {
var b = M();
return b.fromInt(a), b;
}
function X(a) {
var c,
b = 1;
return 0 != (c = a >>> 16) && (a = c, b += 16), 0 != (c = a >> 8) && (a = c, b += 8), 0 != (c = a >> 4) && (a = c, b += 4), 0 != (c = a >> 2) && (a = c, b += 2), 0 != (c = a >> 1) && (a = c, b += 1), b;
}
function Z() {
return new Y();
}
function fb() {
if (null == _) {
for (_ = Z(); $ > bb;) {
var a = Math.floor(65536 * Math.random());
ab[bb++] = 255 & a;
}
for (_.init(ab), bb = 0; bb < ab.length; ++bb) {
ab[bb] = 0;
}
bb = 0;
}
return _.next();
}
function hb(a, b) {
var c, d, e, f;
if (b < a.length + 22) return console.error("Message too long for RSA"), null;
for (c = b - a.length - 6, d = "", e = 0; c > e; e += 2) {
d += "ff";
}
return f = "0001" + d + "00" + a, N(f, 16);
}
function ib(a, b) {
var c, d, e, f, g;
if (b < a.length + 11) return console.error("Message too long for RSA"), null;
for (c = [], d = a.length - 1; d >= 0 && b > 0;) {
e = a.charCodeAt(d--), 128 > e ? c[--b] = e : e > 127 && 2048 > e ? (c[--b] = 128 | 63 & e, c[--b] = 192 | e >> 6) : (c[--b] = 128 | 63 & e, c[--b] = 128 | 63 & e >> 6, c[--b] = 224 | e >> 12);
}
for (c[--b] = 0, f = new gb(), g = []; b > 2;) {
for (g[0] = 0; 0 == g[0];) {
f.nextBytes(g);
}
c[--b] = g[0];
}
return c[--b] = 2, c[--b] = 0, new H(c);
}
function kb(a, b) {
for (var e, f, c = a.toByteArray(), d = 0; d < c.length && 0 == c[d];) {
++d;
}
if (c.length - d != b - 1 || 2 != c[d]) return null;
for (++d; 0 != c[d];) {
if (++d >= c.length) return null;
}
for (e = ""; ++d < c.length;) {
f = 255 & c[d], 128 > f ? e += String.fromCharCode(f) : f > 191 && 224 > f ? (e += String.fromCharCode((31 & f) << 6 | 63 & c[d + 1]), ++d) : (e += String.fromCharCode((15 & f) << 12 | (63 & c[d + 1]) << 6 | 63 & c[d + 2]), d += 2);
}
return e;
}
function mb(a) {
return lb[a] || "";
}
function nb(a) {
var b, c, d;
for (b in lb) {
if (lb.hasOwnProperty(b) && (c = lb[b], d = c.length, a.substr(0, d) == c)) return a.substr(d);
}
return a;
}
var p,
r,
C,
R,
S,
T,
U,
Y,
$,
_,
ab,
bb,
cb,
db,
gb,
jb,
lb,
ob,
pb,
qb,
rb,
b = "0123456789abcdefghijklmnopqrstuvwxyz",
j = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
k = "=",
_n = function n(a, b) {
return _n = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function (a, b) {
a.__proto__ = b;
} || function (a, b) {
for (var c in b) {
b.hasOwnProperty(c) && (a[c] = b[c]);
}
}, _n(a, b);
},
q = {
decode: function decode(a) {
var b, c, d, e, f, g, h;
if (void 0 === p) {
for (c = "0123456789ABCDEF", d = " \f\n\r\t\xA0\u2028\u2029", p = {}, b = 0; 16 > b; ++b) {
p[c.charAt(b)] = b;
}
for (c = c.toLowerCase(), b = 10; 16 > b; ++b) {
p[c.charAt(b)] = b;
}
for (b = 0; b < d.length; ++b) {
p[d.charAt(b)] = -1;
}
}
for (e = [], f = 0, g = 0, b = 0; b < a.length && (h = a.charAt(b), "=" != h); ++b) {
if (h = p[h], -1 != h) {
if (void 0 === h) throw new Error("Illegal character at offset " + b);
f |= h, ++g >= 2 ? (e[e.length] = f, f = 0, g = 0) : f <<= 4;
}
}
if (g) throw new Error("Hex encoding incomplete: 4 bits missing");
return e;
}
},
s = {
decode: function decode(a) {
var b, c, d, e, f, g, h;
if (void 0 === r) {
for (c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", d = "= \f\n\r\t\xA0\u2028\u2029", r = Object.create(null), b = 0; 64 > b; ++b) {
r[c.charAt(b)] = b;
}
for (b = 0; b < d.length; ++b) {
r[d.charAt(b)] = -1;
}
}
for (e = [], f = 0, g = 0, b = 0; b < a.length && (h = a.charAt(b), "=" != h); ++b) {
if (h = r[h], -1 != h) {
if (void 0 === h) throw new Error("Illegal character at offset " + b);
f |= h, ++g >= 4 ? (e[e.length] = f >> 16, e[e.length] = 255 & f >> 8, e[e.length] = 255 & f, f = 0, g = 0) : f <<= 6;
}
}
switch (g) {
case 1:
throw new Error("Base64 encoding incomplete: at least 2 bits missing");
case 2:
e[e.length] = f >> 10;
break;
case 3:
e[e.length] = f >> 16, e[e.length] = 255 & f >> 8;
}
return e;
},
re: /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,
unarmor: function unarmor(a) {
var b = s.re.exec(a);
if (b) if (b[1]) a = b[1];else {
if (!b[2]) throw new Error("RegExp out of sync");
a = b[2];
}
return s.decode(a);
}
},
t = 1e13,
u = function () {
function a(a) {
this.buf = [+a || 0];
}
return a.prototype.mulAdd = function (a, b) {
var e,
f,
c = this.buf,
d = c.length;
for (e = 0; d > e; ++e) {
f = c[e] * a + b, t > f ? b = 0 : (b = 0 | f / t, f -= b * t), c[e] = f;
}
b > 0 && (c[e] = b);
}, a.prototype.sub = function (a) {
var d,
e,
b = this.buf,
c = b.length;
for (d = 0; c > d; ++d) {
e = b[d] - a, 0 > e ? (e += t, a = 1) : a = 0, b[d] = e;
}
for (; 0 === b[b.length - 1];) {
b.pop();
}
}, a.prototype.toString = function (a) {
var b, c, d;
if (10 != (a || 10)) throw new Error("only base 10 is supported");
for (b = this.buf, c = b[b.length - 1].toString(), d = b.length - 2; d >= 0; --d) {
c += (t + b[d]).toString().substring(1);
}
return c;
}, a.prototype.valueOf = function () {
var c,
a = this.buf,
b = 0;
for (c = a.length - 1; c >= 0; --c) {
b = b * t + a[c];
}
return b;
}, a.prototype.simplify = function () {
var a = this.buf;
return 1 == a.length ? a[0] : this;
}, a;
}(),
v = "…",
w = /^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,
x = /^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,
z = function () {
function a(b, c) {
this.hexDigits = "0123456789ABCDEF", b instanceof a ? (this.enc = b.enc, this.pos = b.pos) : (this.enc = b, this.pos = c);
}
return a.prototype.get = function (a) {
if (void 0 === a && (a = this.pos++), a >= this.enc.length) throw new Error("Requesting byte offset " + a + " on a stream of length " + this.enc.length);
return "string" == typeof this.enc ? this.enc.charCodeAt(a) : this.enc[a];
}, a.prototype.hexByte = function (a) {
return this.hexDigits.charAt(15 & a >> 4) + this.hexDigits.charAt(15 & a);
}, a.prototype.hexDump = function (a, b, c) {
var e,
d = "";
for (e = a; b > e; ++e) {
if (d += this.hexByte(this.get(e)), c !== !0) switch (15 & e) {
case 7:
d += " ";
break;
case 15:
d += "\n";
break;
default:
d += " ";
}
}
return d;
}, a.prototype.isASCII = function (a, b) {
var c, d;
for (c = a; b > c; ++c) {
if (d = this.get(c), 32 > d || d > 176) return !1;
}
return !0;
}, a.prototype.parseStringISO = function (a, b) {
var d,
c = "";
for (d = a; b > d; ++d) {
c += String.fromCharCode(this.get(d));
}
return c;
}, a.prototype.parseStringUTF = function (a, b) {
var d,
e,
c = "";
for (d = a; b > d;) {
e = this.get(d++), c += 128 > e ? String.fromCharCode(e) : e > 191 && 224 > e ? String.fromCharCode((31 & e) << 6 | 63 & this.get(d++)) : String.fromCharCode((15 & e) << 12 | (63 & this.get(d++)) << 6 | 63 & this.get(d++));
}
return c;
}, a.prototype.parseStringBMP = function (a, b) {
var d,
e,
f,
c = "";
for (f = a; b > f;) {
d = this.get(f++), e = this.get(f++), c += String.fromCharCode(d << 8 | e);
}
return c;
}, a.prototype.parseTime = function (a, b, c) {
var d = this.parseStringISO(a, b),
e = (c ? w : x).exec(d);
return e ? (c && (e[1] = +e[1], e[1] += +e[1] < 70 ? 2e3 : 1900), d = e[1] + "-" + e[2] + "-" + e[3] + " " + e[4], e[5] && (d += ":" + e[5], e[6] && (d += ":" + e[6], e[7] && (d += "." + e[7]))), e[8] && (d += " UTC", "Z" != e[8] && (d += e[8], e[9] && (d += ":" + e[9]))), d) : "Unrecognized time: " + d;
}, a.prototype.parseInteger = function (a, b) {
for (var f, h, i, c = this.get(a), d = c > 127, e = d ? 255 : 0, g = ""; c == e && ++a < b;) {
c = this.get(a);
}
if (f = b - a, 0 === f) return d ? -1 : 0;
if (f > 4) {
for (g = c, f <<= 3; 0 == (128 & (+g ^ e));) {
g = +g << 1, --f;
}
g = "(" + f + " bit)\n";
}
for (d && (c -= 256), h = new u(c), i = a + 1; b > i; ++i) {
h.mulAdd(256, this.get(i));
}
return g + h.toString();
}, a.prototype.parseBitString = function (a, b, c) {
var h,
i,
j,
k,
d = this.get(a),
e = (b - a - 1 << 3) - d,
f = "(" + e + " bit)\n",
g = "";
for (h = a + 1; b > h; ++h) {
for (i = this.get(h), j = h == b - 1 ? d : 0, k = 7; k >= j; --k) {
g += 1 & i >> k ? "1" : "0";
}
if (g.length > c) return f + y(g, c);
}
return f + g;
}, a.prototype.parseOctetString = function (a, b, c) {
var d, e, f;
if (this.isASCII(a, b)) return y(this.parseStringISO(a, b), c);
for (d = b - a, e = "(" + d + " byte)\n", c /= 2, d > c && (b = a + c), f = a; b > f; ++f) {
e += this.hexByte(this.get(f));
}
return d > c && (e += v), e;
}, a.prototype.parseOID = function (a, b, c) {
var g,
h,
i,
d = "",
e = new u(),
f = 0;
for (g = a; b > g; ++g) {
if (h = this.get(g), e.mulAdd(128, 127 & h), f += 7, !(128 & h)) {
if ("" === d ? (e = e.simplify(), e instanceof u ? (e.sub(80), d = "2." + e.toString()) : (i = 80 > e ? 40 > e ? 0 : 1 : 2, d = i + "." + (e - 40 * i))) : d += "." + e.toString(), d.length > c) return y(d, c);
e = new u(), f = 0;
}
}
return f > 0 && (d += ".incomplete"), d;
}, a;
}(),
A = function () {
function a(a, b, c, d, e) {
if (!(d instanceof B)) throw new Error("Invalid tag value.");
this.stream = a, this.header = b, this.length = c, this.tag = d, this.sub = e;
}
return a.prototype.typeName = function () {
switch (this.tag.tagClass) {
case 0:
switch (this.tag.tagNumber) {
case 0:
return "EOC";
case 1:
return "BOOLEAN";
case 2:
return "INTEGER";
case 3:
return "BIT_STRING";
case 4:
return "OCTET_STRING";
case 5:
return "NULL";
case 6:
return "OBJECT_IDENTIFIER";
case 7:
return "ObjectDescriptor";
case 8:
return "EXTERNAL";
case 9:
return "REAL";
case 10:
return "ENUMERATED";
case 11:
return "EMBEDDED_PDV";
case 12:
return "UTF8String";
case 16:
return "SEQUENCE";
case 17:
return "SET";
case 18:
return "NumericString";
case 19:
return "PrintableString";
case 20:
return "TeletexString";
case 21:
return "VideotexString";
case 22:
return "IA5String";
case 23:
return "UTCTime";
case 24:
return "GeneralizedTime";
case 25:
return "GraphicString";
case 26:
return "VisibleString";
case 27:
return "GeneralString";
case 28:
return "UniversalString";
case 30:
return "BMPString";
}
return "Universal_" + this.tag.tagNumber.toString();
case 1:
return "Application_" + this.tag.tagNumber.toString();
case 2:
return "[" + this.tag.tagNumber.toString() + "]";
case 3:
return "Private_" + this.tag.tagNumber.toString();
}
}, a.prototype.content = function (a) {
var b, c;
if (void 0 === this.tag) return null;
if (void 0 === a && (a = 1 / 0), b = this.posContent(), c = Math.abs(this.length), !this.tag.isUniversal()) return null !== this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(b, b + c, a);
switch (this.tag.tagNumber) {
case 1:
return 0 === this.stream.get(b) ? "false" : "true";
case 2:
return this.stream.parseInteger(b, b + c);
case 3:
return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseBitString(b, b + c, a);
case 4:
return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(b, b + c, a);
case 6:
return this.stream.parseOID(b, b + c, a);
case 16:
case 17:
return null !== this.sub ? "(" + this.sub.length + " elem)" : "(no elem)";
case 12:
return y(this.stream.parseStringUTF(b, b + c), a);
case 18:
case 19:
case 20:
case 21:
case 22:
case 26:
return y(this.stream.parseStringISO(b, b + c), a);
case 30:
return y(this.stream.parseStringBMP(b, b + c), a);
case 23:
case 24:
return this.stream.parseTime(b, b + c, 23 == this.tag.tagNumber);
}
return null;
}, a.prototype.toString = function () {
return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + (null === this.sub ? "null" : this.sub.length) + "]";
}, a.prototype.toPrettyString = function (a) {
var b, c, d;
if (void 0 === a && (a = ""), b = a + this.typeName() + " @" + this.stream.pos, this.length >= 0 && (b += "+"), b += this.length, this.tag.tagConstructed ? b += " (constructed)" : !this.tag.isUniversal() || 3 != this.tag.tagNumber && 4 != this.tag.tagNumber || null === this.sub || (b += " (encapsulates)"), b += "\n", null !== this.sub) for (a += " ", c = 0, d = this.sub.length; d > c; ++c) {
b += this.sub[c].toPrettyString(a);
}
return b;
}, a.prototype.posStart = function () {
return this.stream.pos;
}, a.prototype.posContent = function () {
return this.stream.pos + this.header;
}, a.prototype.posEnd = function () {
return this.stream.pos + this.header + Math.abs(this.length);
}, a.prototype.toHexString = function () {
return this.stream.hexDump(this.posStart(), this.posEnd(), !0);
}, a.decodeLength = function (a) {
var d,
b = a.get(),
c = 127 & b;
if (c == b) return c;
if (c > 6) throw new Error("Length over 48 bits not supported at position " + (a.pos - 1));
if (0 === c) return null;
for (b = 0, d = 0; c > d; ++d) {
b = 256 * b + a.get();
}
return b;
}, a.prototype.getHexStringValue = function () {
var a = this.toHexString(),
b = 2 * this.header,
c = 2 * this.length;
return a.substr(b, c);
}, a.decode = function (b) {
var c, d, e, f, g, h, i, j, k;
if (c = b instanceof z ? b : new z(b, 0), d = new z(c), e = new B(c), f = a.decodeLength(c), g = c.pos, h = g - d.pos, i = null, j = function j() {
var d,
e,
b = [];
if (null !== f) {
for (d = g + f; c.pos < d;) {
b[b.length] = a.decode(c);
}
if (c.pos != d) throw new Error("Content size is not correct for container starting at offset " + g);
} else try {
for (; e = a.decode(c), !e.tag.isEOC();) {
b[b.length] = e;
}
f = g - c.pos;
} catch (h) {
throw new Error("Exception while decoding undefined length content: " + h);
}
return b;
}, e.tagConstructed) i = j();else if (e.isUniversal() && (3 == e.tagNumber || 4 == e.tagNumber)) try {
if (3 == e.tagNumber && 0 != c.get()) throw new Error("BIT STRINGs with unused bits cannot encapsulate.");
for (i = j(), k = 0; k < i.length; ++k) {
if (i[k].tag.isEOC()) throw new Error("EOC is not supposed to be actual content.");
}
} catch (l) {
i = null;
}
if (null === i) {
if (null === f) throw new Error("We can't skip over an invalid tag with undefined length at offset " + g);
c.pos = g + Math.abs(f);
}
return new a(d, h, f, e, i);
}, a;
}(),
B = function () {
function a(a) {
var c,
b = a.get();
if (this.tagClass = b >> 6, this.tagConstructed = 0 !== (32 & b), this.tagNumber = 31 & b, 31 == this.tagNumber) {
c = new u();
do {
b = a.get(), c.mulAdd(128, 127 & b);
} while (128 & b);
this.tagNumber = c.simplify();
}
}
return a.prototype.isUniversal = function () {
return 0 === this.tagClass;
}, a.prototype.isEOC = function () {
return 0 === this.tagClass && 0 === this.tagNumber;
}, a;
}(),
F = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997],
G = (1 << 26) / F[F.length - 1],
H = function () {
function a(a, b, c) {
null != a && ("number" == typeof a ? this.fromNumber(a, b, c) : null == b && "string" != typeof a ? this.fromString(a, 256) : this.fromString(a, b));
}
return a.prototype.toString = function (a) {
var b, d, e, f, g, h, i;
if (this.s < 0) return "-" + this.negate().toString(a);
if (16 == a) b = 4;else if (8 == a) b = 3;else if (2 == a) b = 1;else if (32 == a) b = 5;else {
if (4 != a) return this.toRadix(a);
b = 2;
}
if (d = (1 << b) - 1, f = !1, g = "", h = this.t, i = this.DB - h * this.DB % b, h-- > 0) for (i < this.DB && (e = this[h] >> i) > 0 && (f = !0, g = c(e)); h >= 0;) {
b > i ? (e = (this[h] & (1 << i) - 1) << b - i, e |= this[--h] >> (i += this.DB - b)) : (e = this[h] >> (i -= b) & d, 0 >= i && (i += this.DB, --h)), e > 0 && (f = !0), f && (g += c(e));
}
return f ? g : "0";
}, a.prototype.negate = function () {
var b = M();
return a.ZERO.subTo(this, b), b;
}, a.prototype.abs = function () {
return this.s < 0 ? this.negate() : this;
}, a.prototype.compareTo = function (a) {
var c,
b = this.s - a.s;
if (0 != b) return b;
if (c = this.t, b = c - a.t, 0 != b) return this.s < 0 ? -b : b;
for (; --c >= 0;) {
if (0 != (b = this[c] - a[c])) return b;
}
return 0;
}, a.prototype.bitLength = function () {
return this.t <= 0 ? 0 : this.DB * (this.t - 1) + X(this[this.t - 1] ^ this.s & this.DM);
}, a.prototype.mod = function (b) {
var c = M();
return this.abs().divRemTo(b, null, c), this.s < 0 && c.compareTo(a.ZERO) > 0 && b.subTo(c, c), c;
}, a.prototype.modPowInt = function (a, b) {
var c;
return c = 256 > a || b.isEven() ? new J(b) : new K(b), this.exp(a, c);
}, a.prototype.clone = function () {
var a = M();
return this.copyTo(a), a;
}, a.prototype.intValue = function () {
if (this.s < 0) {
if (1 == this.t) return this[0] - this.DV;
if (0 == this.t) return -1;
} else {
if (1 == this.t) return this[0];
if (0 == this.t) return 0;
}
return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];
}, a.prototype.byteValue = function () {
return 0 == this.t ? this.s : this[0] << 24 >> 24;
}, a.prototype.shortValue = function () {
return 0 == this.t ? this.s : this[0] << 16 >> 16;
}, a.prototype.signum = function () {
return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this[0] <= 0 ? 0 : 1;
}, a.prototype.toByteArray = function () {
var c,
d,
e,
a = this.t,
b = [];
if (b[0] = this.s, c = this.DB - a * this.DB % 8, e = 0, a-- > 0) for (c < this.DB && (d = this[a] >> c) != (this.s & this.DM) >> c && (b[e++] = d | this.s << this.DB - c); a >= 0;) {
8 > c ? (d = (this[a] & (1 << c) - 1) << 8 - c, d |= this[--a] >> (c += this.DB - 8)) : (d = 255 & this[a] >> (c -= 8), 0 >= c && (c += this.DB, --a)), 0 != (128 & d) && (d |= -256), 0 == e && (128 & this.s) != (128 & d) && ++e, (e > 0 || d != this.s) && (b[e++] = d);
}
return b;
}, a.prototype.equals = function (a) {
return 0 == this.compareTo(a);
}, a.prototype.min = function (a) {
return this.compareTo(a) < 0 ? this : a;
}, a.prototype.max = function (a) {
return this.compareTo(a) > 0 ? this : a;
}, a.prototype.and = function (a) {
var b = M();
return this.bitwiseTo(a, d, b), b;
}, a.prototype.or = function (a) {
var b = M();
return this.bitwiseTo(a, e, b), b;
}, a.prototype.xor = function (a) {
var b = M();
return this.bitwiseTo(a, f, b), b;
}, a.prototype.andNot = function (a) {
var b = M();
return this.bitwiseTo(a, g, b), b;
}, a.prototype.not = function () {
var b,
a = M();
for (b = 0; b < this.t; ++b) {
a[b] = this.DM & ~this[b];
}
return a.t = this.t, a.s = ~this.s, a;
}, a.prototype.shiftLeft = function (a) {
var b = M();
return 0 > a ? this.rShiftTo(-a, b) : this.lShiftTo(a, b), b;
}, a.prototype.shiftRight = function (a) {
var b = M();
return 0 > a ? this.lShiftTo(-a, b) : this.rShiftTo(a, b), b;
}, a.prototype.getLowestSetBit = function () {
for (var a = 0; a < this.t; ++a) {
if (0 != this[a]) return a * this.DB + h(this[a]);
}
return this.s < 0 ? this.t * this.DB : -1;
}, a.prototype.bitCount = function () {
var c,
a = 0,
b = this.s & this.DM;
for (c = 0; c < this.t; ++c) {
a += i(this[c] ^ b);
}
return a;
}, a.prototype.testBit = function (a) {
var b = Math.floor(a / this.DB);
return b >= this.t ? 0 != this.s : 0 != (this[b] & 1 << a % this.DB);
}, a.prototype.setBit = function (a) {
return this.changeBit(a, e);
}, a.prototype.clearBit = function (a) {
return this.changeBit(a, g);
}, a.prototype.flipBit = function (a) {
return this.changeBit(a, f);
}, a.prototype.add = function (a) {
var b = M();
return this.addTo(a, b), b;
}, a.prototype.subtract = function (a) {
var b = M();
return this.subTo(a, b), b;
}, a.prototype.multiply = function (a) {
var b = M();
return this.multiplyTo(a, b), b;
}, a.prototype.divide = function (a) {
var b = M();
return this.divRemTo(a, b, null), b;
}, a.prototype.remainder = function (a) {
var b = M();
return this.divRemTo(a, null, b), b;
}, a.prototype.divideAndRemainder = function (a) {
var b = M(),
c = M();
return this.divRemTo(a, b, c), [b, c];
}, a.prototype.modPow = function (a, b) {
var d,
f,
g,
h,
i,
j,
k,
l,
m,
n,
o,
p,
c = a.bitLength(),
e = W(1);
if (0 >= c) return e;
if (d = 18 > c ? 1 : 48 > c ? 3 : 144 > c ? 4 : 768 > c ? 5 : 6, f = 8 > c ? new J(b) : b.isEven() ? new L(b) : new K(b), g = [], h = 3, i = d - 1, j = (1 << d) - 1, g[1] = f.convert(this), d > 1) for (k = M(), f.sqrTo(g[1], k); j >= h;) {
g[h] = M(), f.mulTo(k, g[h - 2], g[h]), h += 2;
}
for (l = a.t - 1, n = !0, o = M(), c = X(a[l]) - 1; l >= 0;) {
for (c >= i ? m = a[l] >> c - i & j : (m = (a[l] & (1 << c + 1) - 1) << i - c, l > 0 && (m |= a[l - 1] >> this.DB + c - i)), h = d; 0 == (1 & m);) {
m >>= 1, --h;
}
if ((c -= h) < 0 && (c += this.DB, --l), n) g[m].copyTo(e), n = !1;else {
for (; h > 1;) {
f.sqrTo(e, o), f.sqrTo(o, e), h -= 2;
}
h > 0 ? f.sqrTo(e, o) : (p = e, e = o, o = p), f.mulTo(o, g[m], e);
}
for (; l >= 0 && 0 == (a[l] & 1 << c);) {
f.sqrTo(e, o), p = e, e = o, o = p, --c < 0 && (c = this.DB - 1, --l);
}
}
return f.revert(e);
}, a.prototype.modInverse = function (b) {
var d,
e,
f,
g,
h,
i,
c = b.isEven();
if (this.isEven() && c || 0 == b.signum()) return a.ZERO;
for (d = b.clone(), e = this.clone(), f = W(1), g = W(0), h = W(0), i = W(1); 0 != d.signum();) {
for (; d.isEven();) {
d.rShiftTo(1, d), c ? (f.isEven() && g.isEven() || (f.addTo(this, f), g.subTo(b, g)), f.rShiftTo(1, f)) : g.isEven() || g.subTo(b, g), g.rShiftTo(1, g);
}
for (; e.isEven();) {
e.rShiftTo(1, e), c ? (h.isEven() && i.isEven() || (h.addTo(this, h), i.subTo(b, i)), h.rShiftTo(1, h)) : i.isEven() || i.subTo(b, i), i.rShiftTo(1, i);
}
d.compareTo(e) >= 0 ? (d.subTo(e, d), c && f.subTo(h, f), g.subTo(i, g)) : (e.subTo(d, e), c && h.subTo(f, h), i.subTo(g, i));
}
return 0 != e.compareTo(a.ONE) ? a.ZERO : i.compareTo(b) >= 0 ? i.subtract(b) : i.signum() < 0 ? (i.addTo(b, i), i.signum() < 0 ? i.add(b) : i) : i;
}, a.prototype.pow = function (a) {
return this.exp(a, new I());
}, a.prototype.gcd = function (a) {
var d,
e,
f,
b = this.s < 0 ? this.negate() : this.clone(),
c = a.s < 0 ? a.negate() : a.clone();
if (b.compareTo(c) < 0 && (d = b, b = c, c = d), e = b.getLowestSetBit(), f = c.getLowestSetBit(), 0 > f) return b;
for (f > e && (f = e), f > 0 && (b.rShiftTo(f, b), c.rShiftTo(f, c)); b.signum() > 0;) {
(e = b.getLowestSetBit()) > 0 && b.rShiftTo(e, b), (e = c.getLowestSetBit()) > 0 && c.rShiftTo(e, c), b.compareTo(c) >= 0 ? (b.subTo(c, b), b.rShiftTo(1, b)) : (c.subTo(b, c), c.rShiftTo(1, c));
}
return f > 0 && c.lShiftTo(f, c), c;
}, a.prototype.isProbablePrime = function (a) {
var b,
d,
e,
c = this.abs();
if (1 == c.t && c[0] <= F[F.length - 1]) {
for (b = 0; b < F.length; ++b) {
if (c[0] == F[b]) return !0;
}
return !1;
}
if (c.isEven()) return !1;
for (b = 1; b < F.length;) {
for (d = F[b], e = b + 1; e < F.length && G > d;) {
d *= F[e++];
}
for (d = c.modInt(d); e > b;) {
if (0 == d % F[b++]) return !1;
}
}
return c.millerRabin(a);
}, a.prototype.copyTo = function (a) {
for (var b = this.t - 1; b >= 0; --b) {
a[b] = this[b];
}
a.t = this.t, a.s = this.s;
}, a.prototype.fromInt = function (a) {
this.t = 1, this.s = 0 > a ? -1 : 0, a > 0 ? this[0] = a : -1 > a ? this[0] = a + this.DV : this.t = 0;
}, a.prototype.fromString = function (b, c) {
var d, e, f, g, h;
if (16 == c) d = 4;else if (8 == c) d = 3;else if (256 == c) d = 8;else if (2 == c) d = 1;else if (32 == c) d = 5;else {
if (4 != c) return this.fromRadix(b, c), void 0;
d = 2;
}
for (this.t = 0, this.s = 0, e = b.length, f = !1, g = 0; --e >= 0;) {
h = 8 == d ? 255 & +b[e] : V(b, e), 0 > h ? "-" == b.charAt(e) && (f = !0) : (f = !1, 0 == g ? this[this.t++] = h : g + d > this.DB ? (this[this.t - 1] |= (h & (1 << this.DB - g) - 1) << g, this[this.t++] = h >> this.DB - g) : this[this.t - 1] |= h << g, g += d, g >= this.DB && (g -= this.DB));
}
8 == d && 0 != (128 & +b[0]) && (this.s = -1, g > 0 && (this[this.t - 1] |= (1 << this.DB - g) - 1 << g)), this.clamp(), f && a.ZERO.subTo(this, this);
}, a.prototype.clamp = function () {
for (var a = this.s & this.DM; this.t > 0 && this[this.t - 1] == a;) {
--this.t;
}
}, a.prototype.dlShiftTo = function (a, b) {
var c;
for (c = this.t - 1; c >= 0; --c) {
b[c + a] = this[c];
}
for (c = a - 1; c >= 0; --c) {
b[c] = 0;
}
b.t = this.t + a, b.s = this.s;
}, a.prototype.drShiftTo = function (a, b) {
for (var c = a; c < this.t; ++c) {
b[c - a] = this[c];
}
b.t = Math.max(this.t - a, 0), b.s = this.s;
}, a.prototype.lShiftTo = function (a, b) {
var h,
c = a % this.DB,
d = this.DB - c,
e = (1 << d) - 1,
f = Math.floor(a / this.DB),
g = this.s << c & this.DM;
for (h = this.t - 1; h >= 0; --h) {
b[h + f + 1] = this[h] >> d | g, g = (this[h] & e) << c;
}
for (h = f - 1; h >= 0; --h) {
b[h] = 0;
}
b[f] = g, b.t = this.t + f + 1, b.s = this.s, b.clamp();
}, a.prototype.rShiftTo = function (a, b) {
var c, d, e, f, g;
if (b.s = this.s, c = Math.floor(a / this.DB), c >= this.t) return b.t = 0, void 0;
for (d = a % this.DB, e = this.DB - d, f = (1 << d) - 1, b[0] = this[c] >> d, g = c + 1; g < this.t; ++g) {
b[g - c - 1] |= (this[g] & f) << e, b[g - c] = this[g] >> d;
}
d > 0 && (b[this.t - c - 1] |= (this.s & f) << e), b.t = this.t - c, b.clamp();
}, a.prototype.subTo = function (a, b) {
for (var c = 0, d = 0, e = Math.min(a.t, this.t); e > c;) {
d += this[c] - a[c], b[c++] = d & this.DM, d >>= this.DB;
}
if (a.t < this.t) {
for (d -= a.s; c < this.t;) {
d += this[c], b[c++] = d & this.DM, d >>= this.DB;
}
d += this.s;
} else {
for (d += this.s; c < a.t;) {
d -= a[c], b[c++] = d & this.DM, d >>= this.DB;
}
d -= a.s;
}
b.s = 0 > d ? -1 : 0, -1 > d ? b[c++] = this.DV + d : d > 0 && (b[c++] = d), b.t = c, b.clamp();
}, a.prototype.multiplyTo = function (b, c) {
var d = this.abs(),
e = b.abs(),
f = d.t;
for (c.t = f + e.t; --f >= 0;) {
c[f] = 0;
}
for (f = 0; f < e.t; ++f) {
c[f + d.t] = d.am(0, e[f], c, f, 0, d.t);
}
c.s = 0, c.clamp(), this.s != b.s && a.ZERO.subTo(c, c);
}, a.prototype.squareTo = function (a) {
for (var d, b = this.abs(), c = a.t = 2 * b.t; --c >= 0;) {
a[c] = 0;
}
for (c = 0; c < b.t - 1; ++c) {
d = b.am(c, b[c], a, 2 * c, 0, 1), (a[c + b.t] += b.am(c + 1, 2 * b[c], a, 2 * c + 1, d, b.t - c - 1)) >= b.DV && (a[c + b.t] -= b.DV, a[c + b.t + 1] = 1);
}
a.t > 0 && (a[a.t - 1] += b.am(c, b[c], a, 2 * c, 0, 1)), a.s = 0, a.clamp();
}, a.prototype.divRemTo = function (b, c, d) {
var f,
g,
h,
i,
j,
k,
l,
m,
n,
o,
p,
q,
r,
s,
t,
e = b.abs();
if (!(e.t <= 0)) {
if (f = this.abs(), f.t < e.t) return null != c && c.fromInt(0), null != d && this.copyTo(d), void 0;
if (null == d && (d = M()), g = M(), h = this.s, i = b.s, j = this.DB - X(e[e.t - 1]), j > 0 ? (e.lShiftTo(j, g), f.lShiftTo(j, d)) : (e.copyTo(g), f.copyTo(d)), k = g.t, l = g[k - 1], 0 != l) {
for (m = l * (1 << this.F1) + (k > 1 ? g[k - 2] >> this.F2 : 0), n = this.FV / m, o = (1 << this.F1) / m, p = 1 << this.F2, q = d.t, r = q - k, s = null == c ? M() : c, g.dlShiftTo(r, s), d.compareTo(s) >= 0 && (d[d.t++] = 1, d.subTo(s, d)), a.ONE.dlShiftTo(k, s), s.subTo(g, g); g.t < k;) {
g[g.t++] = 0;
}
for (; --r >= 0;) {
if (t = d[--q] == l ? this.DM : Math.floor(d[q] * n + (d[q - 1] + p) * o), (d[q] += g.am(0, t, d, r, 0, k)) < t) for (g.dlShiftTo(r, s), d.subTo(s, d); d[q] < --t;) {
d.subTo(s, d);
}
}
null != c && (d.drShiftTo(k, c), h != i && a.ZERO.subTo(c, c)), d.t = k, d.clamp(), j > 0 && d.rShiftTo(j, d), 0 > h && a.ZERO.subTo(d, d);
}
}
}, a.prototype.invDigit = function () {
var a, b;
return this.t < 1 ? 0 : (a = this[0], 0 == (1 & a) ? 0 : (b = 3 & a, b = 15 & b * (2 - (15 & a) * b), b = 255 & b * (2 - (255 & a) * b), b = 65535 & b * (2 - (65535 & (65535 & a) * b)), b = b * (2 - a * b % this.DV) % this.DV, b > 0 ? this.DV - b : -b));
}, a.prototype.isEven = function () {
return 0 == (this.t > 0 ? 1 & this[0] : this.s);
}, a.prototype.exp = function (b, c) {
var d, e, f, g, h;
if (b > 4294967295 || 1 > b) return a.ONE;
for (d = M(), e = M(), f = c.convert(this), g = X(b) - 1, f.copyTo(d); --g >= 0;) {
c.sqrTo(d, e), (b & 1 << g) > 0 ? c.mulTo(e, f, d) : (h = d, d = e, e = h);
}
return c.revert(d);
}, a.prototype.chunkSize = function (a) {
return Math.floor(Math.LN2 * this.DB / Math.log(a));
}, a.prototype.toRadix = function (a) {
var b, c, d, e, f, g;
if (null == a && (a = 10), 0 == this.signum() || 2 > a || a > 36) return "0";
for (b = this.chunkSize(a), c = Math.pow(a, b), d = W(c), e = M(), f = M(), g = "", this.divRemTo(d, e, f); e.signum() > 0;) {
g = (c + f.intValue()).toString(a).substr(1) + g, e.divRemTo(d, e, f);
}
return f.intValue().toString(a) + g;
}, a.prototype.fromRadix = function (b, c) {
var d, e, f, g, h, i, j;
for (this.fromInt(0), null == c && (c = 10), d = this.chunkSize(c), e = Math.pow(c, d), f = !1, g = 0, h = 0, i = 0; i < b.length; ++i) {
j = V(b, i), 0 > j ? "-" == b.charAt(i) && 0 == this.signum() && (f = !0) : (h = c * h + j, ++g >= d && (this.dMultiply(e), this.dAddOffset(h, 0), g = 0, h = 0));
}
g > 0 && (this.dMultiply(Math.pow(c, g)), this.dAddOffset(h, 0)), f && a.ZERO.subTo(this, this);
}, a.prototype.fromNumber = function (b, c, d) {
var f, g;
if ("number" == typeof c) {
if (2 > b) this.fromInt(1);else for (this.fromNumber(b, d), this.testBit(b - 1) || this.bitwiseTo(a.ONE.shiftLeft(b - 1), e, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(c);) {
this.dAddOffset(2, 0), this.bitLength() > b && this.subTo(a.ONE.shiftLeft(b - 1), this);
}
} else f = [], g = 7 & b, f.length = (b >> 3) + 1, c.nextBytes(f), g > 0 ? f[0] &= (1 << g) - 1 : f[0] = 0, this.fromString(f, 256);
}, a.prototype.bitwiseTo = function (a, b, c) {
var d,
e,
f = Math.min(a.t, this.t);
for (d = 0; f > d; ++d) {
c[d] = b(this[d], a[d]);
}
if (a.t < this.t) {
for (e = a.s & this.DM, d = f; d < this.t; ++d) {
c[d] = b(this[d], e);
}
c.t = this.t;
} else {
for (e = this.s & this.DM, d = f; d < a.t; ++d) {
c[d] = b(e, a[d]);
}
c.t = a.t;
}
c.s = b(this.s, a.s), c.clamp();
}, a.prototype.changeBit = function (b, c) {
var d = a.ONE.shiftLeft(b);
return this.bitwiseTo(d, c, d), d;
}, a.prototype.addTo = function (a, b) {
for (var c = 0, d = 0, e = Math.min(a.t, this.t); e > c;) {
d += this[c] + a[c], b[c++] = d & this.DM, d >>= this.DB;
}
if (a.t < this.t) {
for (d += a.s; c < this.t;) {
d += this[c], b[c++] = d & this.DM, d >>= this.DB;
}
d += this.s;
} else {
for (d += this.s; c < a.t;) {
d += a[c], b[c++] = d & this.DM, d >>= this.DB;
}
d += a.s;
}
b.s = 0 > d ? -1 : 0, d > 0 ? b[c++] = d : -1 > d && (b[c++] = this.DV + d), b.t = c, b.clamp();
}, a.prototype.dMultiply = function (a) {
this[this.t] = this.am(0, a - 1, this, 0, 0, this.t), ++this.t, this.clamp();
}, a.prototype.dAddOffset = function (a, b) {
if (0 != a) {
for (; this.t <= b;) {
this[this.t++] = 0;
}
for (this[b] += a; this[b] >= this.DV;) {
this[b] -= this.DV, ++b >= this.t && (this[this.t++] = 0), ++this[b];
}
}
}, a.prototype.multiplyLowerTo = function (a, b, c) {
var e,
d = Math.min(this.t + a.t, b);
for (c.s = 0, c.t = d; d > 0;) {
c[--d] = 0;
}
for (e = c.t - this.t; e > d; ++d) {
c[d + this.t] = this.am(0, a[d], c, d, 0, this.t);
}
for (e = Math.min(a.t, b); e > d; ++d) {
this.am(0, a[d], c, d, 0, b - d);
}
c.clamp();
}, a.prototype.multiplyUpperTo = function (a, b, c) {
--b;
var d = c.t = this.t + a.t - b;
for (c.s = 0; --d >= 0;) {
c[d] = 0;
}
for (d = Math.max(b - this.t, 0); d < a.t; ++d) {
c[this.t + d - b] = this.am(b - d, a[d], c, 0, 0, this.t + d - b);
}
c.clamp(), c.drShiftTo(1, c);
}, a.prototype.modInt = function (a) {
var b, c, d;
if (0 >= a) return 0;
if (b = this.DV % a, c = this.s < 0 ? a - 1 : 0, this.t > 0) if (0 == b) c = this[0] % a;else for (d = this.t - 1; d >= 0; --d) {
c = (b * c + this[d]) % a;
}
return c;
}, a.prototype.millerRabin = function (b) {
var e,
f,
g,
h,
i,
c = this.subtract(a.ONE),
d = c.getLowestSetBit();
if (0 >= d) return !1;
for (e = c.shiftRight(d), b = b + 1 >> 1, b > F.length && (b = F.length), f = M(), g = 0; b > g; ++g) {
if (f.fromInt(F[Math.floor(Math.random() * F.length)]), h = f.modPow(e, this), 0 != h.compareTo(a.ONE) && 0 != h.compareTo(c)) {
for (i = 1; i++ < d && 0 != h.compareTo(c);) {
if (h = h.modPowInt(2, this), 0 == h.compareTo(a.ONE)) return !1;
}
if (0 != h.compareTo(c)) return !1;
}
}
return !0;
}, a.prototype.square = function () {
var a = M();
return this.squareTo(a), a;
}, a.prototype.gcda = function (a, b) {
var e,
f,
g,
_h,
c = this.s < 0 ? this.negate() : this.clone(),
d = a.s < 0 ? a.negate() : a.clone();
return c.compareTo(d) < 0 && (e = c, c = d, d = e), f = c.getLowestSetBit(), g = d.getLowestSetBit(), 0 > g ? (b(c), void 0) : (g > f && (g = f), g > 0 && (c.rShiftTo(g, c), d.rShiftTo(g, d)), _h = function h() {
(f = c.getLowestSetBit()) > 0 && c.rShiftTo(f, c), (f = d.getLowestSetBit()) > 0 && d.rShiftTo(f, d), c.compareTo(d) >= 0 ? (c.subTo(d, c), c.rShiftTo(1, c)) : (d.subTo(c, d), d.rShiftTo(1, d)), c.signum() > 0 ? setTimeout(_h, 0) : (g > 0 && d.lShiftTo(g, d), setTimeout(function () {
b(d);
}, 0));
}, setTimeout(_h, 10), void 0);
}, a.prototype.fromNumberAsync = function (b, c, d, f) {
var g, _h2, i, j;
"number" == typeof c ? 2 > b ? this.fromInt(1) : (this.fromNumber(b, d), this.testBit(b - 1) || this.bitwiseTo(a.ONE.shiftLeft(b - 1), e, this), this.isEven() && this.dAddOffset(1, 0), g = this, _h2 = function h() {
g.dAddOffset(2, 0), g.bitLength() > b && g.subTo(a.ONE.shiftLeft(b - 1), g), g.isProbablePrime(c) ? setTimeout(function () {
f();
}, 0) : setTimeout(_h2, 0);
}, setTimeout(_h2, 0)) : (i = [], j = 7 & b, i.length = (b >> 3) + 1, c.nextBytes(i), j > 0 ? i[0] &= (1 << j) - 1 : i[0] = 0, this.fromString(i, 256));
}, a;
}(),
I = function () {
function a() {}
return a.prototype.convert = function (a) {
return a;
}, a.prototype.revert = function (a) {
return a;
}, a.prototype.mulTo = function (a, b, c) {
a.multiplyTo(b, c);
}, a.prototype.sqrTo = function (a, b) {
a.squareTo(b);
}, a;
}(),
J = function () {
function a(a) {
this.m = a;
}
return a.prototype.convert = function (a) {
return a.s < 0 || a.compareTo(this.m) >= 0 ? a.mod(this.m) : a;
}, a.prototype.revert = function (a) {
return a;
}, a.prototype.reduce = function (a) {
a.divRemTo(this.m, null, a);
}, a.prototype.mulTo = function (a, b, c) {
a.multiplyTo(b, c), this.reduce(c);
}, a.prototype.sqrTo = function (a, b) {
a.squareTo(b), this.reduce(b);
}, a;
}(),
K = function () {
function a(a) {
this.m = a, this.mp = a.invDigit(), this.mpl = 32767 & this.mp, this.mph = this.mp >> 15, this.um = (1 << a.DB - 15) - 1, this.mt2 = 2 * a.t;
}
return a.prototype.convert = function (a) {
var b = M();
return a.abs().dlShiftTo(this.m.t, b), b.divRemTo(this.m, null, b), a.s < 0 && b.compareTo(H.ZERO) > 0 && this.m.subTo(b, b), b;
}, a.prototype.revert = function (a) {
var b = M();
return a.copyTo(b), this.reduce(b), b;
}, a.prototype.reduce = function (a) {
for (var b, c, d; a.t <= this.mt2;) {
a[a.t++] = 0;
}
for (b = 0; b < this.m.t; ++b) {
for (c = 32767 & a[b], d = c * this.mpl + ((c * this.mph + (a[b] >> 15) * this.mpl & this.um) << 15) & a.DM, c = b + this.m.t, a[c] += this.m.am(0, d, a, b, 0, this.m.t); a[c] >= a.DV;) {
a[c] -= a.DV, a[++c]++;
}
}
a.clamp(), a.drShiftTo(this.m.t, a), a.compareTo(this.m) >= 0 && a.subTo(this.m, a);
}, a.prototype.mulTo = function (a, b, c) {
a.multiplyTo(b, c), this.reduce(c);
}, a.prototype.sqrTo = function (a, b) {
a.squareTo(b), this.reduce(b);
}, a;
}(),
L = function () {
function a(a) {
this.m = a, this.r2 = M(), this.q3 = M(), H.ONE.dlShiftTo(2 * a.t, this.r2), this.mu = this.r2.divide(a);
}
return a.prototype.convert = function (a) {
if (a.s < 0 || a.t > 2 * this.m.t) return a.mod(this.m);
if (a.compareTo(this.m) < 0) return a;
var b = M();
return a.copyTo(b), this.reduce(b), b;
}, a.prototype.revert = function (a) {
return a;
}, a.prototype.reduce = function (a) {
for (a.drShiftTo(this.m.t - 1, this.r2), a.t > this.m.t + 1 && (a.t = this.m.t + 1, a.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); a.compareTo(this.r2) < 0;) {
a.dAddOffset(1, this.m.t + 1);
}
for (a.subTo(this.r2, a); a.compareTo(this.m) >= 0;) {
a.subTo(this.m, a);
}
}, a.prototype.mulTo = function (a, b, c) {
a.multiplyTo(b, c), this.reduce(c);
}, a.prototype.sqrTo = function (a, b) {
a.squareTo(b), this.reduce(b);
}, a;
}();
for (H.prototype.am = Q, C = 28, H.prototype.DB = C, H.prototype.DM = (1 << C) - 1, H.prototype.DV = 1 << C, R = 52, H.prototype.FV = Math.pow(2, R), H.prototype.F1 = R - C, H.prototype.F2 = 2 * C - R, S = [], T = "0".charCodeAt(0), U = 0; 9 >= U; ++U) {
S[T++] = U;
}
for (T = "a".charCodeAt(0), U = 10; 36 > U; ++U) {
S[T++] = U;
}
for (T = "A".charCodeAt(0), U = 10; 36 > U; ++U) {
S[T++] = U;
}
if (H.ZERO = W(0), H.ONE = W(1), Y = function () {
function a() {
this.i = 0, this.j = 0, this.S = [];
}
return a.prototype.init = function (a) {
var b, c, d;
for (b = 0; 256 > b; ++b) {
this.S[b] = b;
}
for (c = 0, b = 0; 256 > b; ++b) {
c = 255 & c + this.S[b] + a[b % a.length], d = this.S[b], this.S[b] = this.S[c], this.S[c] = d;
}
this.i = 0, this.j = 0;
}, a.prototype.next = function () {
var a;
return this.i = 255 & this.i + 1, this.j = 255 & this.j + this.S[this.i], a = this.S[this.i], this.S[this.i] = this.S[this.j], this.S[this.j] = a, this.S[255 & a + this.S[this.i]];
}, a;
}(), $ = 256, ab = null, null == ab && (ab = [], bb = 0, cb = void 0, CryptoJS && CryptoJS.getRandomValues)) for (db = new Uint32Array(256), CryptoJS.getRandomValues(db), cb = 0; cb < db.length; ++cb) {
ab[bb++] = 255 & db[cb];
}
gb = function () {
function a() {}
return a.prototype.nextBytes = function (a) {
for (var b = 0; b < a.length; ++b) {
a[b] = fb();
}
}, a;
}(), jb = function () {
function a() {
this.n = null, this.e = 0, this.d = null, this.p = null, this.q = null, this.dmp1 = null, this.dmq1 = null, this.coeff = null;
}
return a.prototype.doPublic = function (a) {
return a.modPowInt(this.e, this.n);
}, a.prototype.doPrivate = function (a) {
var b, c;
if (null == this.p || null == this.q) return a.modPow(this.d, this.n);
for (b = a.mod(this.p).modPow(this.dmp1, this.p), c = a.mod(this.q).modPow(this.dmq1, this.q); b.compareTo(c) < 0;) {
b = b.add(this.p);
}
return b.subtract(c).multiply(this.coeff).mod(this.p).multiply(this.q).add(c);
}, a.prototype.setPublic = function (a, b) {
null != a && null != b && a.length > 0 && b.length > 0 ? (this.n = N(a, 16), this.e = parseInt(b, 16)) : console.error("Invalid RSA public key");
}, a.prototype.encrypt = function (a) {
var c,
d,
b = ib(a, this.n.bitLength() + 7 >> 3);
return null == b ? null : (c = this.doPublic(b), null == c ? null : (d = c.toString(16), 0 == (1 & d.length) ? d : "0" + d));
}, a.prototype.setPrivate = function (a, b, c) {
null != a && null != b && a.length > 0 && b.length > 0 ? (this.n = N(a, 16), this.e = parseInt(b, 16), this.d = N(c, 16)) : console.error("Invalid RSA private key");
}, a.prototype.setPrivateEx = function (a, b, c, d, e, f, g, h) {
null != a && null != b && a.length > 0 && b.length > 0 ? (this.n = N(a, 16), this.e = parseInt(b, 16), this.d = N(c, 16), this.p = N(d, 16), this.q = N(e, 16), this.dmp1 = N(f, 16), this.dmq1 = N(g, 16), this.coeff = N(h, 16)) : console.error("Invalid RSA private key");
}, a.prototype.generate = function (a, b) {
var e,
f,
g,
h,
i,
c = new gb(),
d = a >> 1;
for (this.e = parseInt(b, 16), e = new H(b, 16);;) {
for (; this.p = new H(a - d, 1, c), 0 != this.p.subtract(H.ONE).gcd(e).compareTo(H.ONE) || !this.p.isProbablePrime(10);) {
;
}
for (; this.q = new H(d, 1, c), 0 != this.q.subtract(H.ONE).gcd(e).compareTo(H.ONE) || !this.q.isProbablePrime(10);) {
;
}
if (this.p.compareTo(this.q) <= 0 && (f = this.p, this.p = this.q, this.q = f), g = this.p.subtract(H.ONE), h = this.q.subtract(H.ONE), i = g.multiply(h), 0 == i.gcd(e).compareTo(H.ONE)) {
this.n = this.p.multiply(this.q), this.d = e.modInverse(i), this.dmp1 = this.d.mod(g), this.dmq1 = this.d.mod(h), this.coeff = this.q.modInverse(this.p);
break;
}
}
}, a.prototype.decrypt = function (a) {
var b = N(a, 16),
c = this.doPrivate(b);
return null == c ? null : kb(c, this.n.bitLength() + 7 >> 3);
}, a.prototype.generateAsync = function (a, b, c) {
var f,
g,
_h3,
d = new gb(),
e = a >> 1;
this.e = parseInt(b, 16), f = new H(b, 16), g = this, _h3 = function h() {
var b = function b() {
var a, b, d, e;
g.p.compareTo(g.q) <= 0 && (a = g.p, g.p = g.q, g.q = a), b = g.p.subtract(H.ONE), d = g.q.subtract(H.ONE), e = b.multiply(d), 0 == e.gcd(f).compareTo(H.ONE) ? (g.n = g.p.multiply(g.q), g.d = f.modInverse(e), g.dmp1 = g.d.mod(b), g.dmq1 = g.d.mod(d), g.coeff = g.q.modInverse(g.p), setTimeout(function () {
c();
}, 0)) : setTimeout(_h3, 0);
},
i = function i() {
g.q = M(), g.q.fromNumberAsync(e, 1, d, function () {
g.q.subtract(H.ONE).gcda(f, function (a) {
0 == a.compareTo(H.ONE) && g.q.isProbablePrime(10) ? setTimeout(b, 0) : setTimeout(i, 0);
});
});
},
j = function j() {
g.p = M(), g.p.fromNumberAsync(a - e, 1, d, function () {
g.p.subtract(H.ONE).gcda(f, function (a) {
0 == a.compareTo(H.ONE) && g.p.isProbablePrime(10) ? setTimeout(i, 0) : setTimeout(j, 0);
});
});
};
setTimeout(j, 0);
}, setTimeout(_h3, 0);
}, a.prototype.sign = function (a, b, c) {
var g,
h,
d = mb(c),
e = d + b(a).toString(),
f = hb(e, this.n.bitLength() / 4);
return null == f ? null : (g = this.doPrivate(f), null == g ? null : (h = g.toString(16), 0 == (1 & h.length) ? h : "0" + h));
}, a.prototype.verify = function (a, b, c) {
var f,
g,
d = N(b, 16),
e = this.doPublic(d);
return null == e ? null : (f = e.toString(16).replace(/^1f+00/, ""), g = nb(f), g == c(a).toString());
}, a;
}(), lb = {
md2: "3020300c06082a864886f70d020205000410",
md5: "3020300c06082a864886f70d020505000410",
sha1: "3021300906052b0e03021a05000414",
sha224: "302d300d06096086480165030402040500041c",
sha256: "3031300d060960864801650304020105000420",
sha384: "3041300d060960864801650304020205000430",
sha512: "3051300d060960864801650304020305000440",
ripemd160: "3021300906052b2403020105000414"
}, ob = {}, ob.lang = {
extend: function extend(a, b, c) {
var d, e, f, g;
if (!b || !a) throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");
if (d = function d() {}, d.prototype = b.prototype, a.prototype = new d(), a.prototype.constructor = a, a.superclass = b.prototype, b.prototype.constructor == Object.prototype.constructor && (b.prototype.constructor = b), c) {
for (e in c) {
a.prototype[e] = c[e];
}
f = function f() {}, g = ["toString", "valueOf"];
try {
/MSIE/.test(navigator.userAgent) && (f = function f(a, b) {
for (e = 0; e < g.length; e += 1) {
var c = g[e],
d = b[c];
"function" == typeof d && d != Object.prototype[c] && (a[c] = d);
}
});
} catch (h) {}
f(a.prototype, c);
}
}
}, pb = {}, "undefined" != typeof pb.asn1 && pb.asn1 || (pb.asn1 = {}), pb.asn1.ASN1Util = new function () {
this.integerToByteHex = function (a) {
var b = a.toString(16);
return 1 == b.length % 2 && (b = "0" + b), b;
}, this.bigIntToMinTwosComplementsHex = function (a) {
var c,
d,
e,
f,
g,
h,
b = a.toString(16);
if ("-" != b.substr(0, 1)) 1 == b.length % 2 ? b = "0" + b : b.match(/^[0-7]/) || (b = "00" + b);else {
for (c = b.substr(1), d = c.length, 1 == d % 2 ? d += 1 : b.match(/^[0-7]/) || (d += 2), e = "", f = 0; d > f; f++) {
e += "f";
}
g = new H(e, 16), h = g.xor(a).add(H.ONE), b = h.toString(16).replace(/^-/, "");
}
return b;
}, this.getPEMStringFromHex = function (a, b) {
return hextopem(a, b);
}, this.newObject = function (a) {
var w,
x,
y,
z,
A,
B,
C,
D,
b = pb,
c = b.asn1,
d = c.DERBoolean,
e = c.DERInteger,
f = c.DERBitString,
g = c.DEROctetString,
h = c.DERNull,
i = c.DERObjectIdentifier,
j = c.DEREnumerated,
k = c.DERUTF8String,
l = c.DERNumericString,
m = c.DERPrintableString,
n = c.DERTeletexString,
o = c.DERIA5String,
p = c.DERUTCTime,
q = c.DERGeneralizedTime,
r = c.DERSequence,
s = c.DERSet,
t = c.DERTaggedObject,
u = c.ASN1Util.newObject,
v = Object.keys(a);
if (1 != v.length) throw "key of param shall be only one.";
if (w = v[0], -1 == ":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" + w + ":")) throw "undefined key: " + w;
if ("bool" == w) return new d(a[w]);
if ("int" == w) return new e(a[w]);
if ("bitstr" == w) return new f(a[w]);
if ("octstr" == w) return new g(a[w]);
if ("null" == w) return new h(a[w]);
if ("oid" == w) return new i(a[w]);
if ("enum" == w) return new j(a[w]);
if ("utf8str" == w) return new k(a[w]);
if ("numstr" == w) return new l(a[w]);
if ("prnstr" == w) return new m(a[w]);
if ("telstr" == w) return new n(a[w]);
if ("ia5str" == w) return new o(a[w]);
if ("utctime" == w) return new p(a[w]);
if ("gentime" == w) return new q(a[w]);
if ("seq" == w) {
for (x = a[w], y = [], z = 0; z < x.length; z++) {
A = u(x[z]), y.push(A);
}
return new r({
array: y
});
}
if ("set" == w) {
for (x = a[w], y = [], z = 0; z < x.length; z++) {
A = u(x[z]), y.push(A);
}
return new s({
array: y
});
}
if ("tag" == w) {
if (B = a[w], "[object Array]" === Object.prototype.toString.call(B) && 3 == B.length) return C = u(B[2]), new t({
tag: B[0],
explicit: B[1],
obj: C
});
if (D = {}, void 0 !== B.explicit && (D.explicit = B.explicit), void 0 !== B.tag && (D.tag = B.tag), void 0 === B.obj) throw "obj shall be specified for 'tag'.";
return D.obj = u(B.obj), new t(D);
}
}, this.jsonToASN1HEX = function (a) {
var b = this.newObject(a);
return b.getEncodedHex();
};
}(), pb.asn1.ASN1Util.oidHexToInt = function (a) {
var f,
g,
h,
i,
j,
b = "",
c = parseInt(a.substr(0, 2), 16),
d = Math.floor(c / 40),
e = c % 40;
for (b = d + "." + e, f = "", g = 2; g < a.length; g += 2) {
h = parseInt(a.substr(g, 2), 16), i = ("00000000" + h.toString(2)).slice(-8), f += i.substr(1, 7), "0" == i.substr(0, 1) && (j = new H(f, 2), b = b + "." + j.toString(10), f = "");
}
return b;
}, pb.asn1.ASN1Util.oidIntToHex = function (a) {
var d,
e,
f,
g,
b = function b(a) {
var b = a.toString(16);
return 1 == b.length && (b = "0" + b), b;
},
c = function c(a) {
var g,
h,
i,
c = "",
d = new H(a, 10),
e = d.toString(2),
f = 7 - e.length % 7;
for (7 == f && (f = 0), g = "", h = 0; f > h; h++) {
g += "0";
}
for (e = g + e, h = 0; h < e.length - 1; h += 7) {
i = e.substr(h, 7), h != e.length - 7 && (i = "1" + i), c += b(parseInt(i, 2));
}
return c;
};
if (!a.match(/^[0-9.]+$/)) throw "malformed oid string: " + a;
for (d = "", e = a.split("."), f = 40 * parseInt(e[0]) + parseInt(e[1]), d += b(f), e.splice(0, 2), g = 0; g < e.length; g++) {
d += c(e[g]);
}
return d;
}, pb.asn1.ASN1Object = function () {
var a = "";
this.getLengthHexFromValue = function () {
var b, c, d, e;
if ("undefined" == typeof this.hV || null == this.hV) throw "this.hV is null or undefined.";
if (1 == this.hV.length % 2) throw "value hex must be even length: n=" + a.length + ",v=" + this.hV;
if (b = this.hV.length / 2, c = b.toString(16), 1 == c.length % 2 && (c = "0" + c), 128 > b) return c;
if (d = c.length / 2, d > 15) throw "ASN.1 length too long to represent by 8x: n = " + b.toString(16);
return e = 128 + d, e.toString(16) + c;
}, this.getEncodedHex = function () {
return (null == this.hTLV || this.isModified) && (this.hV = this.getFreshValueHex(), this.hL = this.getLengthHexFromValue(), this.hTLV = this.hT + this.hL + this.hV, this.isModified = !1), this.hTLV;
}, this.getValueHex = function () {
return this.getEncodedHex(), this.hV;
}, this.getFreshValueHex = function () {
return "";
};
}, pb.asn1.DERAbstractString = function (a) {
pb.asn1.DERAbstractString.superclass.constructor.call(this), this.getString = function () {
return this.s;
}, this.setString = function (a) {
this.hTLV = null, this.isModified = !0, this.s = a, this.hV = stohex(this.s);
}, this.setStringHex = function (a) {
this.hTLV = null, this.isModified = !0, this.s = null, this.hV = a;
}, this.getFreshValueHex = function () {
return this.hV;
}, "undefined" != typeof a && ("string" == typeof a ? this.setString(a) : "undefined" != typeof a["str"] ? this.setString(a["str"]) : "undefined" != typeof a["hex"] && this.setStringHex(a["hex"]));
}, ob.lang.extend(pb.asn1.DERAbstractString, pb.asn1.ASN1Object), pb.asn1.DERAbstractTime = function () {
pb.asn1.DERAbstractTime.superclass.constructor.call(this), this.localDateToUTC = function (a) {
utc = a.getTime() + 6e4 * a.getTimezoneOffset();
var b = new Date(utc);
return b;
}, this.formatDate = function (a, b, c) {
var g,
h,
i,
j,
k,
l,
m,
n,
d = this.zeroPadding,
e = this.localDateToUTC(a),
f = String(e.getFullYear());
return "utc" == b && (f = f.substr(2, 2)), g = d(String(e.getMonth() + 1), 2), h = d(String(e.getDate()), 2), i = d(String(e.getHours()), 2), j = d(String(e.getMinutes()), 2), k = d(String(e.getSeconds()), 2), l = f + g + h + i + j + k, c === !0 && (m = e.getMilliseconds(), 0 != m && (n = d(String(m), 3), n = n.replace(/[0]+$/, ""), l = l + "." + n)), l + "Z";
}, this.zeroPadding = function (a, b) {
return a.length >= b ? a : new Array(b - a.length + 1).join("0") + a;
}, this.getString = function () {
return this.s;
}, this.setString = function (a) {
this.hTLV = null, this.isModified = !0, this.s = a, this.hV = stohex(a);
}, this.setByDateValue = function (a, b, c, d, e, f) {
var g = new Date(Date.UTC(a, b - 1, c, d, e, f, 0));
this.setByDate(g);
}, this.getFreshValueHex = function () {
return this.hV;
};
}, ob.lang.extend(pb.asn1.DERAbstractTime, pb.asn1.ASN1Object), pb.asn1.DERAbstractStructured = function (a) {
pb.asn1.DERAbstractString.superclass.constructor.call(this), this.setByASN1ObjectArray = function (a) {
this.hTLV = null, this.isModified = !0, this.asn1Array = a;
}, this.appendASN1Object = function (a) {
this.hTLV = null, this.isModified = !0, this.asn1Array.push(a);
}, this.asn1Array = new Array(), "undefined" != typeof a && "undefined" != typeof a["array"] && (this.asn1Array = a["array"]);
}, ob.lang.extend(pb.asn1.DERAbstractStructured, pb.asn1.ASN1Object), pb.asn1.DERBoolean = function () {
pb.asn1.DERBoolean.superclass.constructor.call(this), this.hT = "01", this.hTLV = "0101ff";
}, ob.lang.extend(pb.asn1.DERBoolean, pb.asn1.ASN1Object), pb.asn1.DERInteger = function (a) {
pb.asn1.DERInteger.superclass.constructor.call(this), this.hT = "02", this.setByBigInteger = function (a) {
this.hTLV = null, this.isModified = !0, this.hV = pb.asn1.ASN1Util.bigIntToMinTwosComplementsHex(a);
}, this.setByInteger = function (a) {
var b = new H(String(a), 10);
this.setByBigInteger(b);
}, this.setValueHex = function (a) {
this.hV = a;
}, this.getFreshValueHex = function () {
return this.hV;
}, "undefined" != typeof a && ("undefined" != typeof a["bigint"] ? this.setByBigInteger(a["bigint"]) : "undefined" != typeof a["int"] ? this.setByInteger(a["int"]) : "number" == typeof a ? this.setByInteger(a) : "undefined" != typeof a["hex"] && this.setValueHex(a["hex"]));
}, ob.lang.extend(pb.asn1.DERInteger, pb.asn1.ASN1Object), pb.asn1.DERBitString = function (a) {
if (void 0 !== a && "undefined" != typeof a.obj) {
var b = pb.asn1.ASN1Util.newObject(a.obj);
a.hex = "00" + b.getEncodedHex();
}
pb.asn1.DERBitString.superclass.constructor.call(this), this.hT = "03", this.setHexValueIncludingUnusedBits = function (a) {
this.hTLV = null, this.isModified = !0, this.hV = a;
}, this.setUnusedBitsAndHexValue = function (a, b) {
if (0 > a || a > 7) throw "unused bits shall be from 0 to 7: u = " + a;
var c = "0" + a;
this.hTLV = null, this.isModified = !0, this.hV = c + b;
}, this.setByBinaryString = function (a) {
var b, c, d, e, f;
for (a = a.replace(/0+$/, ""), b = 8 - a.length % 8, 8 == b && (b = 0), c = 0; b >= c; c++) {
a += "0";
}
for (d = "", c = 0; c < a.length - 1; c += 8) {
e = a.substr(c, 8), f = parseInt(e, 2).toString(16), 1 == f.length && (f = "0" + f), d += f;
}
this.hTLV = null, this.isModified = !0, this.hV = "0" + b + d;
}, this.setByBooleanArray = function (a) {
var c,
b = "";
for (c = 0; c < a.length; c++) {
b += 1 == a[c] ? "1" : "0";
}
this.setByBinaryString(b);
}, this.newFalseArray = function (a) {
var c,
b = new Array(a);
for (c = 0; a > c; c++) {
b[c] = !1;
}
return b;
}, this.getFreshValueHex = function () {
return this.hV;
}, "undefined" != typeof a && ("string" == typeof a && a.toLowerCase().match(/^[0-9a-f]+$/) ? this.setHexValueIncludingUnusedBits(a) : "undefined" != typeof a["hex"] ? this.setHexValueIncludingUnusedBits(a["hex"]) : "undefined" != typeof a["bin"] ? this.setByBinaryString(a["bin"]) : "undefined" != typeof a["array"] && this.setByBooleanArray(a["array"]));
}, ob.lang.extend(pb.asn1.DERBitString, pb.asn1.ASN1Object), pb.asn1.DEROctetString = function (a) {
if (void 0 !== a && "undefined" != typeof a.obj) {
var b = pb.asn1.ASN1Util.newObject(a.obj);
a.hex = b.getEncodedHex();
}
pb.asn1.DEROctetString.superclass.constructor.call(this, a), this.hT = "04";
}, ob.lang.extend(pb.asn1.DEROctetString, pb.asn1.DERAbstractString), pb.asn1.DERNull = function () {
pb.asn1.DERNull.superclass.constructor.call(this), this.hT = "05", this.hTLV = "0500";
}, ob.lang.extend(pb.asn1.DERNull, pb.asn1.ASN1Object), pb.asn1.DERObjectIdentifier = function (a) {
var b = function b(a) {
var b = a.toString(16);
return 1 == b.length && (b = "0" + b), b;
},
c = function c(a) {
var g,
h,
i,
c = "",
d = new H(a, 10),
e = d.toString(2),
f = 7 - e.length % 7;
for (7 == f && (f = 0), g = "", h = 0; f > h; h++) {
g += "0";
}
for (e = g + e, h = 0; h < e.length - 1; h += 7) {
i = e.substr(h, 7), h != e.length - 7 && (i = "1" + i), c += b(parseInt(i, 2));
}
return c;
};
pb.asn1.DERObjectIdentifier.superclass.constructor.call(this), this.hT = "06", this.setValueHex = function (a) {
this.hTLV = null, this.isModified = !0, this.s = null, this.hV = a;
}, this.setValueOidString = function (a) {
var d, e, f, g;
if (!a.match(/^[0-9.]+$/)) throw "malformed oid string: " + a;
for (d = "", e = a.split("."), f = 40 * parseInt(e[0]) + parseInt(e[1]), d += b(f), e.splice(0, 2), g = 0; g < e.length; g++) {
d += c(e[g]);
}
this.hTLV = null, this.isModified = !0, this.s = null, this.hV = d;
}, this.setValueName = function (a) {
var b = pb.asn1.x509.OID.name2oid(a);
if ("" === b) throw "DERObjectIdentifier oidName undefined: " + a;
this.setValueOidString(b);
}, this.getFreshValueHex = function () {
return this.hV;
}, void 0 !== a && ("string" == typeof a ? a.match(/^[0-2].[0-9.]+$/) ? this.setValueOidString(a) : this.setValueName(a) : void 0 !== a.oid ? this.setValueOidString(a.oid) : void 0 !== a.hex ? this.setValueHex(a.hex) : void 0 !== a.name && this.setValueName(a.name));
}, ob.lang.extend(pb.asn1.DERObjectIdentifier, pb.asn1.ASN1Object), pb.asn1.DEREnumerated = function (a) {
pb.asn1.DEREnumerated.superclass.constructor.call(this), this.hT = "0a", this.setByBigInteger = function (a) {
this.hTLV = null, this.isModified = !0, this.hV = pb.asn1.ASN1Util.bigIntToMinTwosComplementsHex(a);
}, this.setByInteger = function (a) {
var b = new H(String(a), 10);
this.setByBigInteger(b);
}, this.setValueHex = function (a) {
this.hV = a;
}, this.getFreshValueHex = function () {
return this.hV;
}, "undefined" != typeof a && ("undefined" != typeof a["int"] ? this.setByInteger(a["int"]) : "number" == typeof a ? this.setByInteger(a) : "undefined" != typeof a["hex"] && this.setValueHex(a["hex"]));
}, ob.lang.extend(pb.asn1.DEREnumerated, pb.asn1.ASN1Object), pb.asn1.DERUTF8String = function (a) {
pb.asn1.DERUTF8String.superclass.constructor.call(this, a), this.hT = "0c";
}, ob.lang.extend(pb.asn1.DERUTF8String, pb.asn1.DERAbstractString), pb.asn1.DERNumericString = function (a) {
pb.asn1.DERNumericString.superclass.constructor.call(this, a), this.hT = "12";
}, ob.lang.extend(pb.asn1.DERNumericString, pb.asn1.DERAbstractString), pb.asn1.DERPrintableString = function (a) {
pb.asn1.DERPrintableString.superclass.constructor.call(this, a), this.hT = "13";
}, ob.lang.extend(pb.asn1.DERPrintableString, pb.asn1.DERAbstractString), pb.asn1.DERTeletexString = function (a) {
pb.asn1.DERTeletexString.superclass.constructor.call(this, a), this.hT = "14";
}, ob.lang.extend(pb.asn1.DERTeletexString, pb.asn1.DERAbstractString), pb.asn1.DERIA5String = function (a) {
pb.asn1.DERIA5String.superclass.constructor.call(this, a), this.hT = "16";
}, ob.lang.extend(pb.asn1.DERIA5String, pb.asn1.DERAbstractString), pb.asn1.DERUTCTime = function (a) {
pb.asn1.DERUTCTime.superclass.constructor.call(this, a), this.hT = "17", this.setByDate = function (a) {
this.hTLV = null, this.isModified = !0, this.date = a, this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s);
}, this.getFreshValueHex = function () {
return "undefined" == typeof this.date && "undefined" == typeof this.s && (this.date = new Date(), this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s)), this.hV;
}, void 0 !== a && (void 0 !== a.str ? this.setString(a.str) : "string" == typeof a && a.match(/^[0-9]{12}Z$/) ? this.setString(a) : void 0 !== a.hex ? this.setStringHex(a.hex) : void 0 !== a.date && this.setByDate(a.date));
}, ob.lang.extend(pb.asn1.DERUTCTime, pb.asn1.DERAbstractTime), pb.asn1.DERGeneralizedTime = function (a) {
pb.asn1.DERGeneralizedTime.superclass.constructor.call(this, a), this.hT = "18", this.withMillis = !1, this.setByDate = function (a) {
this.hTLV = null, this.isModified = !0, this.date = a, this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s);
}, this.getFreshValueHex = function () {
return void 0 === this.date && void 0 === this.s && (this.date = new Date(), this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s)), this.hV;
}, void 0 !== a && (void 0 !== a.str ? this.setString(a.str) : "string" == typeof a && a.match(/^[0-9]{14}Z$/) ? this.setString(a) : void 0 !== a.hex ? this.setStringHex(a.hex) : void 0 !== a.date && this.setByDate(a.date), a.millis === !0 && (this.withMillis = !0));
}, ob.lang.extend(pb.asn1.DERGeneralizedTime, pb.asn1.DERAbstractTime), pb.asn1.DERSequence = function (a) {
pb.asn1.DERSequence.superclass.constructor.call(this, a), this.hT = "30", this.getFreshValueHex = function () {
var b,
c,
a = "";
for (b = 0; b < this.asn1Array.length; b++) {
c = this.asn1Array[b], a += c.getEncodedHex();
}
return this.hV = a, this.hV;
};
}, ob.lang.extend(pb.asn1.DERSequence, pb.asn1.DERAbstractStructured), pb.asn1.DERSet = function (a) {
pb.asn1.DERSet.superclass.constructor.call(this, a), this.hT = "31", this.sortFlag = !0, this.getFreshValueHex = function () {
var b,
c,
a = new Array();
for (b = 0; b < this.asn1Array.length; b++) {
c = this.asn1Array[b], a.push(c.getEncodedHex());
}
return 1 == this.sortFlag && a.sort(), this.hV = a.join(""), this.hV;
}, "undefined" != typeof a && "undefined" != typeof a.sortflag && 0 == a.sortflag && (this.sortFlag = !1);
}, ob.lang.extend(pb.asn1.DERSet, pb.asn1.DERAbstractStructured), pb.asn1.DERTaggedObject = function (a) {
pb.asn1.DERTaggedObject.superclass.constructor.call(this), this.hT = "a0", this.hV = "", this.isExplicit = !0, this.asn1Object = null, this.setASN1Object = function (a, b, c) {
this.hT = b, this.isExplicit = a, this.asn1Object = c, this.isExplicit ? (this.hV = this.asn1Object.getEncodedHex(), this.hTLV = null, this.isModified = !0) : (this.hV = null, this.hTLV = c.getEncodedHex(), this.hTLV = this.hTLV.replace(/^../, b), this.isModified = !1);
}, this.getFreshValueHex = function () {
return this.hV;
}, "undefined" != typeof a && ("undefined" != typeof a["tag"] && (this.hT = a["tag"]), "undefined" != typeof a["explicit"] && (this.isExplicit = a["explicit"]), "undefined" != typeof a["obj"] && (this.asn1Object = a["obj"], this.setASN1Object(this.isExplicit, this.hT, this.asn1Object)));
}, ob.lang.extend(pb.asn1.DERTaggedObject, pb.asn1.ASN1Object), qb = function (a) {
function b(c) {
var d = a.call(this) || this;
return c && ("string" == typeof c ? d.parseKey(c) : (b.hasPrivateKeyProperty(c) || b.hasPublicKeyProperty(c)) && d.parsePropertiesFrom(c)), d;
}
return o(b, a), b.prototype.parseKey = function (a) {
var b, c, d, e, f, g, h, i, j, k, l, m, n;
try {
if (b = 0, c = 0, d = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/, e = d.test(a) ? q.decode(a) : s.unarmor(a), f = A.decode(e), 3 === f.sub.length && (f = f.sub[2].sub[0]), 9 === f.sub.length) b = f.sub[1].getHexStringValue(), this.n = N(b, 16), c = f.sub[2].getHexStringValue(), this.e = parseInt(c, 16), g = f.sub[3].getHexStringValue(), this.d = N(g, 16), h = f.sub[4].getHexStringValue(), this.p = N(h, 16), i = f.sub[5].getHexStringValue(), this.q = N(i, 16), j = f.sub[6].getHexStringValue(), this.dmp1 = N(j, 16), k = f.sub[7].getHexStringValue(), this.dmq1 = N(k, 16), l = f.sub[8].getHexStringValue(), this.coeff = N(l, 16);else {
if (2 !== f.sub.length) return !1;
m = f.sub[1], n = m.sub[0], b = n.sub[0].getHexStringValue(), this.n = N(b, 16), c = n.sub[1].getHexStringValue(), this.e = parseInt(c, 16);
}
return !0;
} catch (o) {
return !1;
}
}, b.prototype.getPrivateBaseKey = function () {
var a = {
array: [new pb.asn1.DERInteger({
"int": 0
}), new pb.asn1.DERInteger({
bigint: this.n
}), new pb.asn1.DERInteger({
"int": this.e
}), new pb.asn1.DERInteger({
bigint: this.d
}), new pb.asn1.DERInteger({
bigint: this.p
}), new pb.asn1.DERInteger({
bigint: this.q
}), new pb.asn1.DERInteger({
bigint: this.dmp1
}), new pb.asn1.DERInteger({
bigint: this.dmq1
}), new pb.asn1.DERInteger({
bigint: this.coeff
})]
},
b = new pb.asn1.DERSequence(a);
return b.getEncodedHex();
}, b.prototype.getPrivateBaseKeyB64 = function () {
return l(this.getPrivateBaseKey());
}, b.prototype.getPublicBaseKey = function () {
var a = new pb.asn1.DERSequence({
array: [new pb.asn1.DERObjectIdentifier({
oid: "1.2.840.113549.1.1.1"
}), new pb.asn1.DERNull()]
}),
b = new pb.asn1.DERSequence({
array: [new pb.asn1.DERInteger({
bigint: this.n
}), new pb.asn1.DERInteger({
"int": this.e
})]
}),
c = new pb.asn1.DERBitString({
hex: "00" + b.getEncodedHex()
}),
d = new pb.asn1.DERSequence({
array: [a, c]
});
return d.getEncodedHex();
}, b.prototype.getPublicBaseKeyB64 = function () {
return l(this.getPublicBaseKey());
}, b.wordwrap = function (a, b) {
if (b = b || 64, !a) return a;
var c = "(.{1," + b + "})( +|$\n?)|(.{1," + b + "})";
return a.match(RegExp(c, "g")).join("\n");
}, b.prototype.getPrivateKey = function () {
var a = "-----BEGIN RSA PRIVATE KEY-----\n";
return a += b.wordwrap(this.getPrivateBaseKeyB64()) + "\n", a += "-----END RSA PRIVATE KEY-----";
}, b.prototype.getPublicKey = function () {
var a = "-----BEGIN PUBLIC KEY-----\n";
return a += b.wordwrap(this.getPublicBaseKeyB64()) + "\n", a += "-----END PUBLIC KEY-----";
}, b.hasPublicKeyProperty = function (a) {
return a = a || {}, a.hasOwnProperty("n") && a.hasOwnProperty("e");
}, b.hasPrivateKeyProperty = function (a) {
return a = a || {}, a.hasOwnProperty("n") && a.hasOwnProperty("e") && a.hasOwnProperty("d") && a.hasOwnProperty("p") && a.hasOwnProperty("q") && a.hasOwnProperty("dmp1") && a.hasOwnProperty("dmq1") && a.hasOwnProperty("coeff");
}, b.prototype.parsePropertiesFrom = function (a) {
this.n = a.n, this.e = a.e, a.hasOwnProperty("d") && (this.d = a.d, this.p = a.p, this.q = a.q, this.dmp1 = a.dmp1, this.dmq1 = a.dmq1, this.coeff = a.coeff);
}, b;
}(jb), rb = function () {
function a(a) {
a = a || {}, this.default_key_size = parseInt(a.default_key_size, 10) || 1024, this.default_public_exponent = a.default_public_exponent || "010001", this.log = a.log || !1, this.key = null;
}
return a.prototype.setKey = function (a) {
this.log && this.key && console.warn("A key was already set, overriding existing."), this.key = new qb(a);
}, a.prototype.setPrivateKey = function (a) {
this.setKey(a);
}, a.prototype.setPublicKey = function (a) {
this.setKey(a);
}, a.prototype.decrypt = function (a) {
try {
return this.getKey().decrypt(m(a));
} catch (b) {
return !1;
}
}, a.prototype.encrypt = function (a) {
try {
return l(this.getKey().encrypt(a));
} catch (b) {
return !1;
}
}, a.prototype.sign = function (a, b, c) {
try {
return l(this.getKey().sign(a, b, c));
} catch (d) {
return !1;
}
}, a.prototype.verify = function (a, b, c) {
try {
return this.getKey().verify(a, m(b), c);
} catch (d) {
return !1;
}
}, a.prototype.getKey = function (a) {
if (!this.key) {
if (this.key = new qb(), a && "[object Function]" === {}.toString.call(a)) return this.key.generateAsync(this.default_key_size, this.default_public_exponent, a), void 0;
this.key.generate(this.default_key_size, this.default_public_exponent);
}
return this.key;
}, a.prototype.getPrivateKey = function () {
return this.getKey().getPrivateKey();
}, a.prototype.getPrivateKeyB64 = function () {
return this.getKey().getPrivateBaseKeyB64();
}, a.prototype.getPublicKey = function () {
return this.getKey().getPublicKey();
}, a.prototype.getPublicKeyB64 = function () {
return this.getKey().getPublicBaseKeyB64();
}, a.version = "3.0.0-rc.1", a;
}(), a.JSEncrypt = rb, a.default = rb, Object.defineProperty(a, "__esModule", {
value: !0
});
});
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! (webpack)/buildin/global.js */ 3)))
/***/ }),
/***/ 76:
/*!*************************************************!*\
!*** ./node_modules/crypto-browserify/index.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = __webpack_require__(/*! randombytes */ 77)
exports.createHash = exports.Hash = __webpack_require__(/*! create-hash */ 85)
exports.createHmac = exports.Hmac = __webpack_require__(/*! create-hmac */ 120)
var algos = __webpack_require__(/*! browserify-sign/algos */ 123)
var algoKeys = Object.keys(algos)
var hashes = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'].concat(algoKeys)
exports.getHashes = function () {
return hashes
}
var p = __webpack_require__(/*! pbkdf2 */ 125)
exports.pbkdf2 = p.pbkdf2
exports.pbkdf2Sync = p.pbkdf2Sync
var aes = __webpack_require__(/*! browserify-cipher */ 131)
exports.Cipher = aes.Cipher
exports.createCipher = aes.createCipher
exports.Cipheriv = aes.Cipheriv
exports.createCipheriv = aes.createCipheriv
exports.Decipher = aes.Decipher
exports.createDecipher = aes.createDecipher
exports.Decipheriv = aes.Decipheriv
exports.createDecipheriv = aes.createDecipheriv
exports.getCiphers = aes.getCiphers
exports.listCiphers = aes.listCiphers
var dh = __webpack_require__(/*! diffie-hellman */ 160)
exports.DiffieHellmanGroup = dh.DiffieHellmanGroup
exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup
exports.getDiffieHellman = dh.getDiffieHellman
exports.createDiffieHellman = dh.createDiffieHellman
exports.DiffieHellman = dh.DiffieHellman
var sign = __webpack_require__(/*! browserify-sign */ 170)
exports.createSign = sign.createSign
exports.Sign = sign.Sign
exports.createVerify = sign.createVerify
exports.Verify = sign.Verify
exports.createECDH = __webpack_require__(/*! create-ecdh */ 225)
var publicEncrypt = __webpack_require__(/*! public-encrypt */ 226)
exports.publicEncrypt = publicEncrypt.publicEncrypt
exports.privateEncrypt = publicEncrypt.privateEncrypt
exports.publicDecrypt = publicEncrypt.publicDecrypt
exports.privateDecrypt = publicEncrypt.privateDecrypt
// the least I can do is make error messages for the rest of the node.js/crypto api.
// ;[
// 'createCredentials'
// ].forEach(function (name) {
// exports[name] = function () {
// throw new Error([
// 'sorry, ' + name + ' is not implemented yet',
// 'we accept pull requests',
// 'https://github.com/crypto-browserify/crypto-browserify'
// ].join('\n'))
// }
// })
var rf = __webpack_require__(/*! randomfill */ 232)
exports.randomFill = rf.randomFill
exports.randomFillSync = rf.randomFillSync
exports.createCredentials = function () {
throw new Error([
'sorry, createCredentials is not implemented yet',
'we accept pull requests',
'https://github.com/crypto-browserify/crypto-browserify'
].join('\n'))
}
exports.constants = {
'DH_CHECK_P_NOT_SAFE_PRIME': 2,
'DH_CHECK_P_NOT_PRIME': 1,
'DH_UNABLE_TO_CHECK_GENERATOR': 4,
'DH_NOT_SUITABLE_GENERATOR': 8,
'NPN_ENABLED': 1,
'ALPN_ENABLED': 1,
'RSA_PKCS1_PADDING': 1,
'RSA_SSLV23_PADDING': 2,
'RSA_NO_PADDING': 3,
'RSA_PKCS1_OAEP_PADDING': 4,
'RSA_X931_PADDING': 5,
'RSA_PKCS1_PSS_PADDING': 6,
'POINT_CONVERSION_COMPRESSED': 2,
'POINT_CONVERSION_UNCOMPRESSED': 4,
'POINT_CONVERSION_HYBRID': 6
}
/***/ }),
/***/ 77:
/*!*********************************************!*\
!*** ./node_modules/randombytes/browser.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global, process) {
// limit of Crypto.getRandomValues()
// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues
var MAX_BYTES = 65536
// Node supports requesting up to this number of bytes
// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48
var MAX_UINT32 = 4294967295
function oldBrowser () {
throw new Error('Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11')
}
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var crypto = global.crypto || global.msCrypto
if (crypto && crypto.getRandomValues) {
module.exports = randomBytes
} else {
module.exports = oldBrowser
}
function randomBytes (size, cb) {
// phantomjs needs to throw
if (size > MAX_UINT32) throw new RangeError('requested too many random bytes')
var bytes = Buffer.allocUnsafe(size)
if (size > 0) { // getRandomValues fails on IE if size == 0
if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues
// can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues
for (var generated = 0; generated < size; generated += MAX_BYTES) {
// buffer.slice automatically checks if the end is past the end of
// the buffer so we don't have to here
crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES))
}
} else {
crypto.getRandomValues(bytes)
}
}
if (typeof cb === 'function') {
return process.nextTick(function () {
cb(null, bytes)
})
}
return bytes
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 3), __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 78)))
/***/ }),
/***/ 78:
/*!********************************************************!*\
!*** ./node_modules/node-libs-browser/mock/process.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
exports.nextTick = function nextTick(fn) {
var args = Array.prototype.slice.call(arguments);
args.shift();
setTimeout(function () {
fn.apply(null, args);
}, 0);
};
exports.platform = exports.arch =
exports.execPath = exports.title = 'browser';
exports.pid = 1;
exports.browser = true;
exports.env = {};
exports.argv = [];
exports.binding = function (name) {
throw new Error('No such module. (Possibly not yet loaded)')
};
(function () {
var cwd = '/';
var path;
exports.cwd = function () { return cwd };
exports.chdir = function (dir) {
if (!path) path = __webpack_require__(/*! path */ 79);
cwd = path.resolve(dir, cwd);
};
})();
exports.exit = exports.kill =
exports.umask = exports.dlopen =
exports.uptime = exports.memoryUsage =
exports.uvCounters = function() {};
exports.features = {};
/***/ }),
/***/ 79:
/*!***********************************************!*\
!*** ./node_modules/path-browserify/index.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
// backported and transplited with Babel, with backwards-compat fixes
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// resolves . and .. elements in a path array with directory names there
// must be no slashes, empty elements, or device names (c:\) in the array
// (so also no leading and trailing slashes - it does not distinguish
// relative and absolute paths)
function normalizeArray(parts, allowAboveRoot) {
// if the path tries to go above the root, `up` ends up > 0
var up = 0;
for (var i = parts.length - 1; i >= 0; i--) {
var last = parts[i];
if (last === '.') {
parts.splice(i, 1);
} else if (last === '..') {
parts.splice(i, 1);
up++;
} else if (up) {
parts.splice(i, 1);
up--;
}
}
// if the path is allowed to go above the root, restore leading ..s
if (allowAboveRoot) {
for (; up--; up) {
parts.unshift('..');
}
}
return parts;
}
// path.resolve([from ...], to)
// posix version
exports.resolve = function() {
var resolvedPath = '',
resolvedAbsolute = false;
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
var path = (i >= 0) ? arguments[i] : process.cwd();
// Skip empty and invalid entries
if (typeof path !== 'string') {
throw new TypeError('Arguments to path.resolve must be strings');
} else if (!path) {
continue;
}
resolvedPath = path + '/' + resolvedPath;
resolvedAbsolute = path.charAt(0) === '/';
}
// At this point the path should be resolved to a full absolute path, but
// handle relative paths to be safe (might happen when process.cwd() fails)
// Normalize the path
resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
return !!p;
}), !resolvedAbsolute).join('/');
return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
};
// path.normalize(path)
// posix version
exports.normalize = function(path) {
var isAbsolute = exports.isAbsolute(path),
trailingSlash = substr(path, -1) === '/';
// Normalize the path
path = normalizeArray(filter(path.split('/'), function(p) {
return !!p;
}), !isAbsolute).join('/');
if (!path && !isAbsolute) {
path = '.';
}
if (path && trailingSlash) {
path += '/';
}
return (isAbsolute ? '/' : '') + path;
};
// posix version
exports.isAbsolute = function(path) {
return path.charAt(0) === '/';
};
// posix version
exports.join = function() {
var paths = Array.prototype.slice.call(arguments, 0);
return exports.normalize(filter(paths, function(p, index) {
if (typeof p !== 'string') {
throw new TypeError('Arguments to path.join must be strings');
}
return p;
}).join('/'));
};
// path.relative(from, to)
// posix version
exports.relative = function(from, to) {
from = exports.resolve(from).substr(1);
to = exports.resolve(to).substr(1);
function trim(arr) {
var start = 0;
for (; start < arr.length; start++) {
if (arr[start] !== '') break;
}
var end = arr.length - 1;
for (; end >= 0; end--) {
if (arr[end] !== '') break;
}
if (start > end) return [];
return arr.slice(start, end - start + 1);
}
var fromParts = trim(from.split('/'));
var toParts = trim(to.split('/'));
var length = Math.min(fromParts.length, toParts.length);
var samePartsLength = length;
for (var i = 0; i < length; i++) {
if (fromParts[i] !== toParts[i]) {
samePartsLength = i;
break;
}
}
var outputParts = [];
for (var i = samePartsLength; i < fromParts.length; i++) {
outputParts.push('..');
}
outputParts = outputParts.concat(toParts.slice(samePartsLength));
return outputParts.join('/');
};
exports.sep = '/';
exports.delimiter = ':';
exports.dirname = function (path) {
if (typeof path !== 'string') path = path + '';
if (path.length === 0) return '.';
var code = path.charCodeAt(0);
var hasRoot = code === 47 /*/*/;
var end = -1;
var matchedSlash = true;
for (var i = path.length - 1; i >= 1; --i) {
code = path.charCodeAt(i);
if (code === 47 /*/*/) {
if (!matchedSlash) {
end = i;
break;
}
} else {
// We saw the first non-path separator
matchedSlash = false;
}
}
if (end === -1) return hasRoot ? '/' : '.';
if (hasRoot && end === 1) {
// return '//';
// Backwards-compat fix:
return '/';
}
return path.slice(0, end);
};
function basename(path) {
if (typeof path !== 'string') path = path + '';
var start = 0;
var end = -1;
var matchedSlash = true;
var i;
for (i = path.length - 1; i >= 0; --i) {
if (path.charCodeAt(i) === 47 /*/*/) {
// If we reached a path separator that was not part of a set of path
// separators at the end of the string, stop now
if (!matchedSlash) {
start = i + 1;
break;
}
} else if (end === -1) {
// We saw the first non-path separator, mark this as the end of our
// path component
matchedSlash = false;
end = i + 1;
}
}
if (end === -1) return '';
return path.slice(start, end);
}
// Uses a mixed approach for backwards-compatibility, as ext behavior changed
// in new Node.js versions, so only basename() above is backported here
exports.basename = function (path, ext) {
var f = basename(path);
if (ext && f.substr(-1 * ext.length) === ext) {
f = f.substr(0, f.length - ext.length);
}
return f;
};
exports.extname = function (path) {
if (typeof path !== 'string') path = path + '';
var startDot = -1;
var startPart = 0;
var end = -1;
var matchedSlash = true;
// Track the state of characters (if any) we see before our first dot and
// after any path separator we find
var preDotState = 0;
for (var i = path.length - 1; i >= 0; --i) {
var code = path.charCodeAt(i);
if (code === 47 /*/*/) {
// If we reached a path separator that was not part of a set of path
// separators at the end of the string, stop now
if (!matchedSlash) {
startPart = i + 1;
break;
}
continue;
}
if (end === -1) {
// We saw the first non-path separator, mark this as the end of our
// extension
matchedSlash = false;
end = i + 1;
}
if (code === 46 /*.*/) {
// If this is our first dot, mark it as the start of our extension
if (startDot === -1)
startDot = i;
else if (preDotState !== 1)
preDotState = 1;
} else if (startDot !== -1) {
// We saw a non-dot and non-path separator before our dot, so we should
// have a good chance at having a non-empty extension
preDotState = -1;
}
}
if (startDot === -1 || end === -1 ||
// We saw a non-dot character immediately before the dot
preDotState === 0 ||
// The (right-most) trimmed path component is exactly '..'
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
return '';
}
return path.slice(startDot, end);
};
function filter (xs, f) {
if (xs.filter) return xs.filter(f);
var res = [];
for (var i = 0; i < xs.length; i++) {
if (f(xs[i], i, xs)) res.push(xs[i]);
}
return res;
}
// String.prototype.substr - negative index don't work in IE8
var substr = 'ab'.substr(-1) === 'b'
? function (str, start, len) { return str.substr(start, len) }
: function (str, start, len) {
if (start < 0) start = str.length + start;
return str.substr(start, len);
}
;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 78)))
/***/ }),
/***/ 8:
/*!***************************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
\***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
}
module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 80:
/*!*******************************************!*\
!*** ./node_modules/safe-buffer/index.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/*! safe-buffer. MIT License. Feross Aboukhadijeh */
/* eslint-disable node/no-deprecated-api */
var buffer = __webpack_require__(/*! buffer */ 81)
var Buffer = buffer.Buffer
// alternative to using Object.keys for old browsers
function copyProps (src, dst) {
for (var key in src) {
dst[key] = src[key]
}
}
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
module.exports = buffer
} else {
// Copy properties from require('buffer')
copyProps(buffer, exports)
exports.Buffer = SafeBuffer
}
function SafeBuffer (arg, encodingOrOffset, length) {
return Buffer(arg, encodingOrOffset, length)
}
SafeBuffer.prototype = Object.create(Buffer.prototype)
// Copy static methods from Buffer
copyProps(Buffer, SafeBuffer)
SafeBuffer.from = function (arg, encodingOrOffset, length) {
if (typeof arg === 'number') {
throw new TypeError('Argument must not be a number')
}
return Buffer(arg, encodingOrOffset, length)
}
SafeBuffer.alloc = function (size, fill, encoding) {
if (typeof size !== 'number') {
throw new TypeError('Argument must be a number')
}
var buf = Buffer(size)
if (fill !== undefined) {
if (typeof encoding === 'string') {
buf.fill(fill, encoding)
} else {
buf.fill(fill)
}
} else {
buf.fill(0)
}
return buf
}
SafeBuffer.allocUnsafe = function (size) {
if (typeof size !== 'number') {
throw new TypeError('Argument must be a number')
}
return Buffer(size)
}
SafeBuffer.allocUnsafeSlow = function (size) {
if (typeof size !== 'number') {
throw new TypeError('Argument must be a number')
}
return buffer.SlowBuffer(size)
}
/***/ }),
/***/ 81:
/*!**************************************!*\
!*** ./node_modules/buffer/index.js ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh
* @license MIT
*/
/* eslint-disable no-proto */
var base64 = __webpack_require__(/*! base64-js */ 82)
var ieee754 = __webpack_require__(/*! ieee754 */ 83)
var isArray = __webpack_require__(/*! isarray */ 84)
exports.Buffer = Buffer
exports.SlowBuffer = SlowBuffer
exports.INSPECT_MAX_BYTES = 50
/**
* If `Buffer.TYPED_ARRAY_SUPPORT`:
* === true Use Uint8Array implementation (fastest)
* === false Use Object implementation (most compatible, even IE6)
*
* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
* Opera 11.6+, iOS 4.2+.
*
* Due to various browser bugs, sometimes the Object implementation will be used even
* when the browser supports typed arrays.
*
* Note:
*
* - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
* See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
*
* - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
*
* - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
* incorrect length in some situations.
* We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
* get the Object implementation, which is slower but behaves correctly.
*/
Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
? global.TYPED_ARRAY_SUPPORT
: typedArraySupport()
/*
* Export kMaxLength after typed array support is determined.
*/
exports.kMaxLength = kMaxLength()
function typedArraySupport () {
try {
var arr = new Uint8Array(1)
arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
return arr.foo() === 42 && // typed array instances can be augmented
typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
} catch (e) {
return false
}
}
function kMaxLength () {
return Buffer.TYPED_ARRAY_SUPPORT
? 0x7fffffff
: 0x3fffffff
}
function createBuffer (that, length) {
if (kMaxLength() < length) {
throw new RangeError('Invalid typed array length')
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
// Return an augmented `Uint8Array` instance, for best performance
that = new Uint8Array(length)
that.__proto__ = Buffer.prototype
} else {
// Fallback: Return an object instance of the Buffer class
if (that === null) {
that = new Buffer(length)
}
that.length = length
}
return that
}
/**
* The Buffer constructor returns instances of `Uint8Array` that have their
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
* returns a single octet.
*
* The `Uint8Array` prototype remains unmodified.
*/
function Buffer (arg, encodingOrOffset, length) {
if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
return new Buffer(arg, encodingOrOffset, length)
}
// Common case.
if (typeof arg === 'number') {
if (typeof encodingOrOffset === 'string') {
throw new Error(
'If encoding is specified then the first argument must be a string'
)
}
return allocUnsafe(this, arg)
}
return from(this, arg, encodingOrOffset, length)
}
Buffer.poolSize = 8192 // not used by this implementation
// TODO: Legacy, not needed anymore. Remove in next major version.
Buffer._augment = function (arr) {
arr.__proto__ = Buffer.prototype
return arr
}
function from (that, value, encodingOrOffset, length) {
if (typeof value === 'number') {
throw new TypeError('"value" argument must not be a number')
}
if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
return fromArrayBuffer(that, value, encodingOrOffset, length)
}
if (typeof value === 'string') {
return fromString(that, value, encodingOrOffset)
}
return fromObject(that, value)
}
/**
* Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
* if value is a number.
* Buffer.from(str[, encoding])
* Buffer.from(array)
* Buffer.from(buffer)
* Buffer.from(arrayBuffer[, byteOffset[, length]])
**/
Buffer.from = function (value, encodingOrOffset, length) {
return from(null, value, encodingOrOffset, length)
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
Buffer.prototype.__proto__ = Uint8Array.prototype
Buffer.__proto__ = Uint8Array
if (typeof Symbol !== 'undefined' && Symbol.species &&
Buffer[Symbol.species] === Buffer) {
// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
Object.defineProperty(Buffer, Symbol.species, {
value: null,
configurable: true
})
}
}
function assertSize (size) {
if (typeof size !== 'number') {
throw new TypeError('"size" argument must be a number')
} else if (size < 0) {
throw new RangeError('"size" argument must not be negative')
}
}
function alloc (that, size, fill, encoding) {
assertSize(size)
if (size <= 0) {
return createBuffer(that, size)
}
if (fill !== undefined) {
// Only pay attention to encoding if it's a string. This
// prevents accidentally sending in a number that would
// be interpretted as a start offset.
return typeof encoding === 'string'
? createBuffer(that, size).fill(fill, encoding)
: createBuffer(that, size).fill(fill)
}
return createBuffer(that, size)
}
/**
* Creates a new filled Buffer instance.
* alloc(size[, fill[, encoding]])
**/
Buffer.alloc = function (size, fill, encoding) {
return alloc(null, size, fill, encoding)
}
function allocUnsafe (that, size) {
assertSize(size)
that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
if (!Buffer.TYPED_ARRAY_SUPPORT) {
for (var i = 0; i < size; ++i) {
that[i] = 0
}
}
return that
}
/**
* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
* */
Buffer.allocUnsafe = function (size) {
return allocUnsafe(null, size)
}
/**
* Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
*/
Buffer.allocUnsafeSlow = function (size) {
return allocUnsafe(null, size)
}
function fromString (that, string, encoding) {
if (typeof encoding !== 'string' || encoding === '') {
encoding = 'utf8'
}
if (!Buffer.isEncoding(encoding)) {
throw new TypeError('"encoding" must be a valid string encoding')
}
var length = byteLength(string, encoding) | 0
that = createBuffer(that, length)
var actual = that.write(string, encoding)
if (actual !== length) {
// Writing a hex string, for example, that contains invalid characters will
// cause everything after the first invalid character to be ignored. (e.g.
// 'abxxcd' will be treated as 'ab')
that = that.slice(0, actual)
}
return that
}
function fromArrayLike (that, array) {
var length = array.length < 0 ? 0 : checked(array.length) | 0
that = createBuffer(that, length)
for (var i = 0; i < length; i += 1) {
that[i] = array[i] & 255
}
return that
}
function fromArrayBuffer (that, array, byteOffset, length) {
array.byteLength // this throws if `array` is not a valid ArrayBuffer
if (byteOffset < 0 || array.byteLength < byteOffset) {
throw new RangeError('\'offset\' is out of bounds')
}
if (array.byteLength < byteOffset + (length || 0)) {
throw new RangeError('\'length\' is out of bounds')
}
if (byteOffset === undefined && length === undefined) {
array = new Uint8Array(array)
} else if (length === undefined) {
array = new Uint8Array(array, byteOffset)
} else {
array = new Uint8Array(array, byteOffset, length)
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
// Return an augmented `Uint8Array` instance, for best performance
that = array
that.__proto__ = Buffer.prototype
} else {
// Fallback: Return an object instance of the Buffer class
that = fromArrayLike(that, array)
}
return that
}
function fromObject (that, obj) {
if (Buffer.isBuffer(obj)) {
var len = checked(obj.length) | 0
that = createBuffer(that, len)
if (that.length === 0) {
return that
}
obj.copy(that, 0, 0, len)
return that
}
if (obj) {
if ((typeof ArrayBuffer !== 'undefined' &&
obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
if (typeof obj.length !== 'number' || isnan(obj.length)) {
return createBuffer(that, 0)
}
return fromArrayLike(that, obj)
}
if (obj.type === 'Buffer' && isArray(obj.data)) {
return fromArrayLike(that, obj.data)
}
}
throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
}
function checked (length) {
// Note: cannot use `length < kMaxLength()` here because that fails when
// length is NaN (which is otherwise coerced to zero.)
if (length >= kMaxLength()) {
throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
'size: 0x' + kMaxLength().toString(16) + ' bytes')
}
return length | 0
}
function SlowBuffer (length) {
if (+length != length) { // eslint-disable-line eqeqeq
length = 0
}
return Buffer.alloc(+length)
}
Buffer.isBuffer = function isBuffer (b) {
return !!(b != null && b._isBuffer)
}
Buffer.compare = function compare (a, b) {
if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
throw new TypeError('Arguments must be Buffers')
}
if (a === b) return 0
var x = a.length
var y = b.length
for (var i = 0, len = Math.min(x, y); i < len; ++i) {
if (a[i] !== b[i]) {
x = a[i]
y = b[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
Buffer.isEncoding = function isEncoding (encoding) {
switch (String(encoding).toLowerCase()) {
case 'hex':
case 'utf8':
case 'utf-8':
case 'ascii':
case 'latin1':
case 'binary':
case 'base64':
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return true
default:
return false
}
}
Buffer.concat = function concat (list, length) {
if (!isArray(list)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
if (list.length === 0) {
return Buffer.alloc(0)
}
var i
if (length === undefined) {
length = 0
for (i = 0; i < list.length; ++i) {
length += list[i].length
}
}
var buffer = Buffer.allocUnsafe(length)
var pos = 0
for (i = 0; i < list.length; ++i) {
var buf = list[i]
if (!Buffer.isBuffer(buf)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
buf.copy(buffer, pos)
pos += buf.length
}
return buffer
}
function byteLength (string, encoding) {
if (Buffer.isBuffer(string)) {
return string.length
}
if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
(ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
return string.byteLength
}
if (typeof string !== 'string') {
string = '' + string
}
var len = string.length
if (len === 0) return 0
// Use a for loop to avoid recursion
var loweredCase = false
for (;;) {
switch (encoding) {
case 'ascii':
case 'latin1':
case 'binary':
return len
case 'utf8':
case 'utf-8':
case undefined:
return utf8ToBytes(string).length
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return len * 2
case 'hex':
return len >>> 1
case 'base64':
return base64ToBytes(string).length
default:
if (loweredCase) return utf8ToBytes(string).length // assume utf8
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.byteLength = byteLength
function slowToString (encoding, start, end) {
var loweredCase = false
// No need to verify that "this.length <= MAX_UINT32" since it's a read-only
// property of a typed array.
// This behaves neither like String nor Uint8Array in that we set start/end
// to their upper/lower bounds if the value passed is out of range.
// undefined is handled specially as per ECMA-262 6th Edition,
// Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
if (start === undefined || start < 0) {
start = 0
}
// Return early if start > this.length. Done here to prevent potential uint32
// coercion fail below.
if (start > this.length) {
return ''
}
if (end === undefined || end > this.length) {
end = this.length
}
if (end <= 0) {
return ''
}
// Force coersion to uint32. This will also coerce falsey/NaN values to 0.
end >>>= 0
start >>>= 0
if (end <= start) {
return ''
}
if (!encoding) encoding = 'utf8'
while (true) {
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 = true
}
}
}
// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
// Buffer instances.
Buffer.prototype._isBuffer = true
function swap (b, n, m) {
var i = b[n]
b[n] = b[m]
b[m] = i
}
Buffer.prototype.swap16 = function swap16 () {
var len = this.length
if (len % 2 !== 0) {
throw new RangeError('Buffer size must be a multiple of 16-bits')
}
for (var i = 0; i < len; i += 2) {
swap(this, i, i + 1)
}
return this
}
Buffer.prototype.swap32 = function swap32 () {
var len = this.length
if (len % 4 !== 0) {
throw new RangeError('Buffer size must be a multiple of 32-bits')
}
for (var i = 0; i < len; i += 4) {
swap(this, i, i + 3)
swap(this, i + 1, i + 2)
}
return this
}
Buffer.prototype.swap64 = function swap64 () {
var len = this.length
if (len % 8 !== 0) {
throw new RangeError('Buffer size must be a multiple of 64-bits')
}
for (var i = 0; i < len; i += 8) {
swap(this, i, i + 7)
swap(this, i + 1, i + 6)
swap(this, i + 2, i + 5)
swap(this, i + 3, i + 4)
}
return this
}
Buffer.prototype.toString = function toString () {
var length = this.length | 0
if (length === 0) return ''
if (arguments.length === 0) return utf8Slice(this, 0, length)
return slowToString.apply(this, arguments)
}
Buffer.prototype.equals = function equals (b) {
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
if (this === b) return true
return Buffer.compare(this, b) === 0
}
Buffer.prototype.inspect = function inspect () {
var str = ''
var max = exports.INSPECT_MAX_BYTES
if (this.length > 0) {
str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
if (this.length > max) str += ' ... '
}
return ''
}
Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
if (!Buffer.isBuffer(target)) {
throw new TypeError('Argument must be a Buffer')
}
if (start === undefined) {
start = 0
}
if (end === undefined) {
end = target ? target.length : 0
}
if (thisStart === undefined) {
thisStart = 0
}
if (thisEnd === undefined) {
thisEnd = this.length
}
if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
throw new RangeError('out of range index')
}
if (thisStart >= thisEnd && start >= end) {
return 0
}
if (thisStart >= thisEnd) {
return -1
}
if (start >= end) {
return 1
}
start >>>= 0
end >>>= 0
thisStart >>>= 0
thisEnd >>>= 0
if (this === target) return 0
var x = thisEnd - thisStart
var y = end - start
var len = Math.min(x, y)
var thisCopy = this.slice(thisStart, thisEnd)
var targetCopy = target.slice(start, end)
for (var i = 0; i < len; ++i) {
if (thisCopy[i] !== targetCopy[i]) {
x = thisCopy[i]
y = targetCopy[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
//
// Arguments:
// - buffer - a Buffer to search
// - val - a string, Buffer, or number
// - byteOffset - an index into `buffer`; will be clamped to an int32
// - encoding - an optional encoding, relevant is val is a string
// - dir - true for indexOf, false for lastIndexOf
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
// Empty buffer means no match
if (buffer.length === 0) return -1
// Normalize byteOffset
if (typeof byteOffset === 'string') {
encoding = byteOffset
byteOffset = 0
} else if (byteOffset > 0x7fffffff) {
byteOffset = 0x7fffffff
} else if (byteOffset < -0x80000000) {
byteOffset = -0x80000000
}
byteOffset = +byteOffset // Coerce to Number.
if (isNaN(byteOffset)) {
// byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
byteOffset = dir ? 0 : (buffer.length - 1)
}
// Normalize byteOffset: negative offsets start from the end of the buffer
if (byteOffset < 0) byteOffset = buffer.length + byteOffset
if (byteOffset >= buffer.length) {
if (dir) return -1
else byteOffset = buffer.length - 1
} else if (byteOffset < 0) {
if (dir) byteOffset = 0
else return -1
}
// Normalize val
if (typeof val === 'string') {
val = Buffer.from(val, encoding)
}
// Finally, search either indexOf (if dir is true) or lastIndexOf
if (Buffer.isBuffer(val)) {
// Special case: looking for empty string/buffer always fails
if (val.length === 0) {
return -1
}
return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
} else if (typeof val === 'number') {
val = val & 0xFF // Search for a byte value [0-255]
if (Buffer.TYPED_ARRAY_SUPPORT &&
typeof Uint8Array.prototype.indexOf === 'function') {
if (dir) {
return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
} else {
return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
}
}
return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
}
throw new TypeError('val must be string, number or Buffer')
}
function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
var indexSize = 1
var arrLength = arr.length
var valLength = val.length
if (encoding !== undefined) {
encoding = String(encoding).toLowerCase()
if (encoding === 'ucs2' || encoding === 'ucs-2' ||
encoding === 'utf16le' || encoding === 'utf-16le') {
if (arr.length < 2 || val.length < 2) {
return -1
}
indexSize = 2
arrLength /= 2
valLength /= 2
byteOffset /= 2
}
}
function read (buf, i) {
if (indexSize === 1) {
return buf[i]
} else {
return buf.readUInt16BE(i * indexSize)
}
}
var i
if (dir) {
var foundIndex = -1
for (i = byteOffset; i < arrLength; i++) {
if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
if (foundIndex === -1) foundIndex = i
if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
} else {
if (foundIndex !== -1) i -= i - foundIndex
foundIndex = -1
}
}
} else {
if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
for (i = byteOffset; i >= 0; i--) {
var found = true
for (var j = 0; j < valLength; j++) {
if (read(arr, i + j) !== read(val, j)) {
found = false
break
}
}
if (found) return i
}
}
return -1
}
Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
return this.indexOf(val, byteOffset, encoding) !== -1
}
Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
}
Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
}
function hexWrite (buf, string, offset, length) {
offset = Number(offset) || 0
var remaining = buf.length - offset
if (!length) {
length = remaining
} else {
length = Number(length)
if (length > remaining) {
length = remaining
}
}
// must be an even number of digits
var strLen = string.length
if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
if (length > strLen / 2) {
length = strLen / 2
}
for (var i = 0; i < length; ++i) {
var parsed = parseInt(string.substr(i * 2, 2), 16)
if (isNaN(parsed)) return i
buf[offset + i] = parsed
}
return i
}
function utf8Write (buf, string, offset, length) {
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
}
function asciiWrite (buf, string, offset, length) {
return blitBuffer(asciiToBytes(string), buf, offset, length)
}
function latin1Write (buf, string, offset, length) {
return asciiWrite(buf, string, offset, length)
}
function base64Write (buf, string, offset, length) {
return blitBuffer(base64ToBytes(string), buf, offset, length)
}
function ucs2Write (buf, string, offset, length) {
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
}
Buffer.prototype.write = function write (string, offset, length, encoding) {
// Buffer#write(string)
if (offset === undefined) {
encoding = 'utf8'
length = this.length
offset = 0
// Buffer#write(string, encoding)
} else if (length === undefined && typeof offset === 'string') {
encoding = offset
length = this.length
offset = 0
// Buffer#write(string, offset[, length][, encoding])
} else if (isFinite(offset)) {
offset = offset | 0
if (isFinite(length)) {
length = length | 0
if (encoding === undefined) encoding = 'utf8'
} else {
encoding = length
length = undefined
}
// legacy write(string, encoding, offset, length) - remove in v0.13
} else {
throw new Error(
'Buffer.write(string, encoding, offset[, length]) is no longer supported'
)
}
var remaining = this.length - offset
if (length === undefined || length > remaining) length = remaining
if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
throw new RangeError('Attempt to write outside buffer bounds')
}
if (!encoding) encoding = 'utf8'
var loweredCase = false
for (;;) {
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':
// Warning: maxLength not taken into account in base64Write
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 = true
}
}
}
Buffer.prototype.toJSON = function toJSON () {
return {
type: 'Buffer',
data: Array.prototype.slice.call(this._arr || this, 0)
}
}
function base64Slice (buf, start, end) {
if (start === 0 && end === buf.length) {
return base64.fromByteArray(buf)
} else {
return base64.fromByteArray(buf.slice(start, end))
}
}
function utf8Slice (buf, start, end) {
end = Math.min(buf.length, end)
var res = []
var i = start
while (i < end) {
var firstByte = buf[i]
var codePoint = null
var bytesPerSequence = (firstByte > 0xEF) ? 4
: (firstByte > 0xDF) ? 3
: (firstByte > 0xBF) ? 2
: 1
if (i + bytesPerSequence <= end) {
var secondByte, thirdByte, fourthByte, tempCodePoint
switch (bytesPerSequence) {
case 1:
if (firstByte < 0x80) {
codePoint = firstByte
}
break
case 2:
secondByte = buf[i + 1]
if ((secondByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
if (tempCodePoint > 0x7F) {
codePoint = tempCodePoint
}
}
break
case 3:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
codePoint = tempCodePoint
}
}
break
case 4:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
fourthByte = buf[i + 3]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
codePoint = tempCodePoint
}
}
}
}
if (codePoint === null) {
// we did not generate a valid codePoint so insert a
// replacement char (U+FFFD) and advance only 1 byte
codePoint = 0xFFFD
bytesPerSequence = 1
} else if (codePoint > 0xFFFF) {
// encode to utf16 (surrogate pair dance)
codePoint -= 0x10000
res.push(codePoint >>> 10 & 0x3FF | 0xD800)
codePoint = 0xDC00 | codePoint & 0x3FF
}
res.push(codePoint)
i += bytesPerSequence
}
return decodeCodePointsArray(res)
}
// Based on http://stackoverflow.com/a/22747272/680742, the browser with
// the lowest limit is Chrome, with 0x10000 args.
// We go 1 magnitude less, for safety
var MAX_ARGUMENTS_LENGTH = 0x1000
function decodeCodePointsArray (codePoints) {
var len = codePoints.length
if (len <= MAX_ARGUMENTS_LENGTH) {
return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
}
// Decode in chunks to avoid "call stack size exceeded".
var res = ''
var i = 0
while (i < len) {
res += String.fromCharCode.apply(
String,
codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
)
}
return res
}
function asciiSlice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; ++i) {
ret += String.fromCharCode(buf[i] & 0x7F)
}
return ret
}
function latin1Slice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; ++i) {
ret += String.fromCharCode(buf[i])
}
return ret
}
function hexSlice (buf, start, end) {
var len = buf.length
if (!start || start < 0) start = 0
if (!end || end < 0 || end > len) end = len
var out = ''
for (var i = start; i < end; ++i) {
out += toHex(buf[i])
}
return out
}
function utf16leSlice (buf, start, end) {
var bytes = buf.slice(start, end)
var res = ''
for (var i = 0; i < bytes.length; i += 2) {
res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
}
return res
}
Buffer.prototype.slice = function slice (start, end) {
var len = this.length
start = ~~start
end = end === undefined ? len : ~~end
if (start < 0) {
start += len
if (start < 0) start = 0
} else if (start > len) {
start = len
}
if (end < 0) {
end += len
if (end < 0) end = 0
} else if (end > len) {
end = len
}
if (end < start) end = start
var newBuf
if (Buffer.TYPED_ARRAY_SUPPORT) {
newBuf = this.subarray(start, end)
newBuf.__proto__ = Buffer.prototype
} else {
var sliceLen = end - start
newBuf = new Buffer(sliceLen, undefined)
for (var i = 0; i < sliceLen; ++i) {
newBuf[i] = this[i + start]
}
}
return newBuf
}
/*
* Need to make sure that buffer isn't trying to write out of bounds.
*/
function checkOffset (offset, ext, length) {
if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
}
Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
return val
}
Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
checkOffset(offset, byteLength, this.length)
}
var val = this[offset + --byteLength]
var mul = 1
while (byteLength > 0 && (mul *= 0x100)) {
val += this[offset + --byteLength] * mul
}
return val
}
Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
if (!noAssert) checkOffset(offset, 1, this.length)
return this[offset]
}
Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
return this[offset] | (this[offset + 1] << 8)
}
Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
return (this[offset] << 8) | this[offset + 1]
}
Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ((this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16)) +
(this[offset + 3] * 0x1000000)
}
Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] * 0x1000000) +
((this[offset + 1] << 16) |
(this[offset + 2] << 8) |
this[offset + 3])
}
Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var i = byteLength
var mul = 1
var val = this[offset + --i]
while (i > 0 && (mul *= 0x100)) {
val += this[offset + --i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
if (!noAssert) checkOffset(offset, 1, this.length)
if (!(this[offset] & 0x80)) return (this[offset])
return ((0xff - this[offset] + 1) * -1)
}
Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset] | (this[offset + 1] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset + 1] | (this[offset] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16) |
(this[offset + 3] << 24)
}
Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] << 24) |
(this[offset + 1] << 16) |
(this[offset + 2] << 8) |
(this[offset + 3])
}
Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, true, 23, 4)
}
Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, false, 23, 4)
}
Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, true, 52, 8)
}
Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, false, 52, 8)
}
function checkInt (buf, value, offset, ext, max, min) {
if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
if (offset + ext > buf.length) throw new RangeError('Index out of range')
}
Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
var maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
var mul = 1
var i = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
var maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
var i = byteLength - 1
var mul = 1
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
this[offset] = (value & 0xff)
return offset + 1
}
function objectWriteUInt16 (buf, value, offset, littleEndian) {
if (value < 0) value = 0xffff + value + 1
for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
(littleEndian ? i : 1 - i) * 8
}
}
Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
} else {
objectWriteUInt16(this, value, offset, true)
}
return offset + 2
}
Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
} else {
objectWriteUInt16(this, value, offset, false)
}
return offset + 2
}
function objectWriteUInt32 (buf, value, offset, littleEndian) {
if (value < 0) value = 0xffffffff + value + 1
for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
}
}
Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset + 3] = (value >>> 24)
this[offset + 2] = (value >>> 16)
this[offset + 1] = (value >>> 8)
this[offset] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, true)
}
return offset + 4
}
Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, false)
}
return offset + 4
}
Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) {
var limit = Math.pow(2, 8 * byteLength - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = 0
var mul = 1
var sub = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) {
var limit = Math.pow(2, 8 * byteLength - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = byteLength - 1
var mul = 1
var sub = 0
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
if (value < 0) value = 0xff + value + 1
this[offset] = (value & 0xff)
return offset + 1
}
Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
} else {
objectWriteUInt16(this, value, offset, true)
}
return offset + 2
}
Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
} else {
objectWriteUInt16(this, value, offset, false)
}
return offset + 2
}
Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
this[offset + 2] = (value >>> 16)
this[offset + 3] = (value >>> 24)
} else {
objectWriteUInt32(this, value, offset, true)
}
return offset + 4
}
Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (value < 0) value = 0xffffffff + value + 1
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, false)
}
return offset + 4
}
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) {
if (!noAssert) {
checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
}
ieee754.write(buf, value, offset, littleEndian, 23, 4)
return offset + 4
}
Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
return writeFloat(this, value, offset, true, noAssert)
}
Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
return writeFloat(this, value, offset, false, noAssert)
}
function writeDouble (buf, value, offset, littleEndian, noAssert) {
if (!noAssert) {
checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
}
ieee754.write(buf, value, offset, littleEndian, 52, 8)
return offset + 8
}
Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
return writeDouble(this, value, offset, true, noAssert)
}
Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
return writeDouble(this, value, offset, false, noAssert)
}
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
if (!start) start = 0
if (!end && end !== 0) end = this.length
if (targetStart >= target.length) targetStart = target.length
if (!targetStart) targetStart = 0
if (end > 0 && end < start) end = start
// Copy 0 bytes; we're done
if (end === start) return 0
if (target.length === 0 || this.length === 0) return 0
// Fatal error conditions
if (targetStart < 0) {
throw new RangeError('targetStart out of bounds')
}
if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
if (end < 0) throw new RangeError('sourceEnd out of bounds')
// Are we oob?
if (end > this.length) end = this.length
if (target.length - targetStart < end - start) {
end = target.length - targetStart + start
}
var len = end - start
var i
if (this === target && start < targetStart && targetStart < end) {
// descending copy from end
for (i = len - 1; i >= 0; --i) {
target[i + targetStart] = this[i + start]
}
} else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
// ascending copy from start
for (i = 0; i < len; ++i) {
target[i + targetStart] = this[i + start]
}
} else {
Uint8Array.prototype.set.call(
target,
this.subarray(start, start + len),
targetStart
)
}
return len
}
// Usage:
// buffer.fill(number[, offset[, end]])
// buffer.fill(buffer[, offset[, end]])
// buffer.fill(string[, offset[, end]][, encoding])
Buffer.prototype.fill = function fill (val, start, end, encoding) {
// Handle string cases:
if (typeof val === 'string') {
if (typeof start === 'string') {
encoding = start
start = 0
end = this.length
} else if (typeof end === 'string') {
encoding = end
end = this.length
}
if (val.length === 1) {
var code = val.charCodeAt(0)
if (code < 256) {
val = code
}
}
if (encoding !== undefined && typeof encoding !== 'string') {
throw new TypeError('encoding must be a string')
}
if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
throw new TypeError('Unknown encoding: ' + encoding)
}
} else if (typeof val === 'number') {
val = val & 255
}
// Invalid ranges are not set to a default, so can range check early.
if (start < 0 || this.length < start || this.length < end) {
throw new RangeError('Out of range index')
}
if (end <= start) {
return this
}
start = start >>> 0
end = end === undefined ? this.length : end >>> 0
if (!val) val = 0
var i
if (typeof val === 'number') {
for (i = start; i < end; ++i) {
this[i] = val
}
} else {
var bytes = Buffer.isBuffer(val)
? val
: utf8ToBytes(new Buffer(val, encoding).toString())
var len = bytes.length
for (i = 0; i < end - start; ++i) {
this[i + start] = bytes[i % len]
}
}
return this
}
// HELPER FUNCTIONS
// ================
var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
function base64clean (str) {
// Node strips out invalid characters like \n and \t from the string, base64-js does not
str = stringtrim(str).replace(INVALID_BASE64_RE, '')
// Node converts strings with length < 2 to ''
if (str.length < 2) return ''
// Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
while (str.length % 4 !== 0) {
str = str + '='
}
return str
}
function stringtrim (str) {
if (str.trim) return str.trim()
return str.replace(/^\s+|\s+$/g, '')
}
function toHex (n) {
if (n < 16) return '0' + n.toString(16)
return n.toString(16)
}
function utf8ToBytes (string, units) {
units = units || Infinity
var codePoint
var length = string.length
var leadSurrogate = null
var bytes = []
for (var i = 0; i < length; ++i) {
codePoint = string.charCodeAt(i)
// is surrogate component
if (codePoint > 0xD7FF && codePoint < 0xE000) {
// last char was a lead
if (!leadSurrogate) {
// no lead yet
if (codePoint > 0xDBFF) {
// unexpected trail
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
} else if (i + 1 === length) {
// unpaired lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
}
// valid lead
leadSurrogate = codePoint
continue
}
// 2 leads in a row
if (codePoint < 0xDC00) {
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
leadSurrogate = codePoint
continue
}
// valid surrogate pair
codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
} else if (leadSurrogate) {
// valid bmp char, but last char was a lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
}
leadSurrogate = null
// encode utf8
if (codePoint < 0x80) {
if ((units -= 1) < 0) break
bytes.push(codePoint)
} else if (codePoint < 0x800) {
if ((units -= 2) < 0) break
bytes.push(
codePoint >> 0x6 | 0xC0,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x10000) {
if ((units -= 3) < 0) break
bytes.push(
codePoint >> 0xC | 0xE0,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x110000) {
if ((units -= 4) < 0) break
bytes.push(
codePoint >> 0x12 | 0xF0,
codePoint >> 0xC & 0x3F | 0x80,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else {
throw new Error('Invalid code point')
}
}
return bytes
}
function asciiToBytes (str) {
var byteArray = []
for (var i = 0; i < str.length; ++i) {
// Node's code seems to be doing this and not & 0x7F..
byteArray.push(str.charCodeAt(i) & 0xFF)
}
return byteArray
}
function utf16leToBytes (str, units) {
var c, hi, lo
var byteArray = []
for (var i = 0; i < str.length; ++i) {
if ((units -= 2) < 0) break
c = str.charCodeAt(i)
hi = c >> 8
lo = c % 256
byteArray.push(lo)
byteArray.push(hi)
}
return byteArray
}
function base64ToBytes (str) {
return base64.toByteArray(base64clean(str))
}
function blitBuffer (src, dst, offset, length) {
for (var i = 0; i < length; ++i) {
if ((i + offset >= dst.length) || (i >= src.length)) break
dst[i + offset] = src[i]
}
return i
}
function isnan (val) {
return val !== val // eslint-disable-line no-self-compare
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 3)))
/***/ }),
/***/ 82:
/*!*****************************************!*\
!*** ./node_modules/base64-js/index.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.byteLength = byteLength
exports.toByteArray = toByteArray
exports.fromByteArray = fromByteArray
var lookup = []
var revLookup = []
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
for (var i = 0, len = code.length; i < len; ++i) {
lookup[i] = code[i]
revLookup[code.charCodeAt(i)] = i
}
// Support decoding URL-safe base64 strings, as Node.js does.
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
revLookup['-'.charCodeAt(0)] = 62
revLookup['_'.charCodeAt(0)] = 63
function getLens (b64) {
var len = b64.length
if (len % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4')
}
// Trim off extra bytes after placeholder bytes are found
// See: https://github.com/beatgammit/base64-js/issues/42
var validLen = b64.indexOf('=')
if (validLen === -1) validLen = len
var placeHoldersLen = validLen === len
? 0
: 4 - (validLen % 4)
return [validLen, placeHoldersLen]
}
// base64 is 4/3 + up to two characters of the original data
function byteLength (b64) {
var lens = getLens(b64)
var validLen = lens[0]
var placeHoldersLen = lens[1]
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}
function _byteLength (b64, validLen, placeHoldersLen) {
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}
function toByteArray (b64) {
var tmp
var lens = getLens(b64)
var validLen = lens[0]
var placeHoldersLen = lens[1]
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
var curByte = 0
// if there are placeholders, only get up to the last complete 4 chars
var len = placeHoldersLen > 0
? validLen - 4
: validLen
var i
for (i = 0; i < len; i += 4) {
tmp =
(revLookup[b64.charCodeAt(i)] << 18) |
(revLookup[b64.charCodeAt(i + 1)] << 12) |
(revLookup[b64.charCodeAt(i + 2)] << 6) |
revLookup[b64.charCodeAt(i + 3)]
arr[curByte++] = (tmp >> 16) & 0xFF
arr[curByte++] = (tmp >> 8) & 0xFF
arr[curByte++] = tmp & 0xFF
}
if (placeHoldersLen === 2) {
tmp =
(revLookup[b64.charCodeAt(i)] << 2) |
(revLookup[b64.charCodeAt(i + 1)] >> 4)
arr[curByte++] = tmp & 0xFF
}
if (placeHoldersLen === 1) {
tmp =
(revLookup[b64.charCodeAt(i)] << 10) |
(revLookup[b64.charCodeAt(i + 1)] << 4) |
(revLookup[b64.charCodeAt(i + 2)] >> 2)
arr[curByte++] = (tmp >> 8) & 0xFF
arr[curByte++] = tmp & 0xFF
}
return arr
}
function tripletToBase64 (num) {
return lookup[num >> 18 & 0x3F] +
lookup[num >> 12 & 0x3F] +
lookup[num >> 6 & 0x3F] +
lookup[num & 0x3F]
}
function encodeChunk (uint8, start, end) {
var tmp
var output = []
for (var i = start; i < end; i += 3) {
tmp =
((uint8[i] << 16) & 0xFF0000) +
((uint8[i + 1] << 8) & 0xFF00) +
(uint8[i + 2] & 0xFF)
output.push(tripletToBase64(tmp))
}
return output.join('')
}
function fromByteArray (uint8) {
var tmp
var len = uint8.length
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
var parts = []
var maxChunkLength = 16383 // must be multiple of 3
// go through the array every three bytes, we'll deal with trailing stuff later
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
}
// pad the end with zeros, but make sure to not forget the extra bytes
if (extraBytes === 1) {
tmp = uint8[len - 1]
parts.push(
lookup[tmp >> 2] +
lookup[(tmp << 4) & 0x3F] +
'=='
)
} else if (extraBytes === 2) {
tmp = (uint8[len - 2] << 8) + uint8[len - 1]
parts.push(
lookup[tmp >> 10] +
lookup[(tmp >> 4) & 0x3F] +
lookup[(tmp << 2) & 0x3F] +
'='
)
}
return parts.join('')
}
/***/ }),
/***/ 83:
/*!***************************************!*\
!*** ./node_modules/ieee754/index.js ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
var e, m
var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var nBits = -7
var i = isLE ? (nBytes - 1) : 0
var d = isLE ? -1 : 1
var s = buffer[offset + i]
i += d
e = s & ((1 << (-nBits)) - 1)
s >>= (-nBits)
nBits += eLen
for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
m = e & ((1 << (-nBits)) - 1)
e >>= (-nBits)
nBits += mLen
for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
if (e === 0) {
e = 1 - eBias
} else if (e === eMax) {
return m ? NaN : ((s ? -1 : 1) * Infinity)
} else {
m = m + Math.pow(2, mLen)
e = e - eBias
}
return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
}
exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
var e, m, c
var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
var i = isLE ? 0 : (nBytes - 1)
var d = isLE ? 1 : -1
var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
value = Math.abs(value)
if (isNaN(value) || value === Infinity) {
m = isNaN(value) ? 1 : 0
e = eMax
} else {
e = Math.floor(Math.log(value) / Math.LN2)
if (value * (c = Math.pow(2, -e)) < 1) {
e--
c *= 2
}
if (e + eBias >= 1) {
value += rt / c
} else {
value += rt * Math.pow(2, 1 - eBias)
}
if (value * c >= 2) {
e++
c /= 2
}
if (e + eBias >= eMax) {
m = 0
e = eMax
} else if (e + eBias >= 1) {
m = ((value * c) - 1) * Math.pow(2, mLen)
e = e + eBias
} else {
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
e = 0
}
}
for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
e = (e << mLen) | m
eLen += mLen
for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
buffer[offset + i - d] |= s * 128
}
/***/ }),
/***/ 84:
/*!***************************************!*\
!*** ./node_modules/isarray/index.js ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = Array.isArray || function (arr) {
return toString.call(arr) == '[object Array]';
};
/***/ }),
/***/ 85:
/*!*********************************************!*\
!*** ./node_modules/create-hash/browser.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var inherits = __webpack_require__(/*! inherits */ 86)
var MD5 = __webpack_require__(/*! md5.js */ 87)
var RIPEMD160 = __webpack_require__(/*! ripemd160 */ 105)
var sha = __webpack_require__(/*! sha.js */ 106)
var Base = __webpack_require__(/*! cipher-base */ 114)
function Hash (hash) {
Base.call(this, 'digest')
this._hash = hash
}
inherits(Hash, Base)
Hash.prototype._update = function (data) {
this._hash.update(data)
}
Hash.prototype._final = function () {
return this._hash.digest()
}
module.exports = function createHash (alg) {
alg = alg.toLowerCase()
if (alg === 'md5') return new MD5()
if (alg === 'rmd160' || alg === 'ripemd160') return new RIPEMD160()
return new Hash(sha(alg))
}
/***/ }),
/***/ 86:
/*!***************************************************!*\
!*** ./node_modules/inherits/inherits_browser.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
if (superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
})
}
};
} else {
// old school shim for old browsers
module.exports = function inherits(ctor, superCtor) {
if (superCtor) {
ctor.super_ = superCtor
var TempCtor = function () {}
TempCtor.prototype = superCtor.prototype
ctor.prototype = new TempCtor()
ctor.prototype.constructor = ctor
}
}
}
/***/ }),
/***/ 87:
/*!**************************************!*\
!*** ./node_modules/md5.js/index.js ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var inherits = __webpack_require__(/*! inherits */ 86)
var HashBase = __webpack_require__(/*! hash-base */ 88)
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var ARRAY16 = new Array(16)
function MD5 () {
HashBase.call(this, 64)
// state
this._a = 0x67452301
this._b = 0xefcdab89
this._c = 0x98badcfe
this._d = 0x10325476
}
inherits(MD5, HashBase)
MD5.prototype._update = function () {
var M = ARRAY16
for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4)
var a = this._a
var b = this._b
var c = this._c
var d = this._d
a = fnF(a, b, c, d, M[0], 0xd76aa478, 7)
d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12)
c = fnF(c, d, a, b, M[2], 0x242070db, 17)
b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22)
a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7)
d = fnF(d, a, b, c, M[5], 0x4787c62a, 12)
c = fnF(c, d, a, b, M[6], 0xa8304613, 17)
b = fnF(b, c, d, a, M[7], 0xfd469501, 22)
a = fnF(a, b, c, d, M[8], 0x698098d8, 7)
d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12)
c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17)
b = fnF(b, c, d, a, M[11], 0x895cd7be, 22)
a = fnF(a, b, c, d, M[12], 0x6b901122, 7)
d = fnF(d, a, b, c, M[13], 0xfd987193, 12)
c = fnF(c, d, a, b, M[14], 0xa679438e, 17)
b = fnF(b, c, d, a, M[15], 0x49b40821, 22)
a = fnG(a, b, c, d, M[1], 0xf61e2562, 5)
d = fnG(d, a, b, c, M[6], 0xc040b340, 9)
c = fnG(c, d, a, b, M[11], 0x265e5a51, 14)
b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20)
a = fnG(a, b, c, d, M[5], 0xd62f105d, 5)
d = fnG(d, a, b, c, M[10], 0x02441453, 9)
c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14)
b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20)
a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5)
d = fnG(d, a, b, c, M[14], 0xc33707d6, 9)
c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14)
b = fnG(b, c, d, a, M[8], 0x455a14ed, 20)
a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5)
d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9)
c = fnG(c, d, a, b, M[7], 0x676f02d9, 14)
b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20)
a = fnH(a, b, c, d, M[5], 0xfffa3942, 4)
d = fnH(d, a, b, c, M[8], 0x8771f681, 11)
c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16)
b = fnH(b, c, d, a, M[14], 0xfde5380c, 23)
a = fnH(a, b, c, d, M[1], 0xa4beea44, 4)
d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11)
c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16)
b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23)
a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4)
d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11)
c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16)
b = fnH(b, c, d, a, M[6], 0x04881d05, 23)
a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4)
d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11)
c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16)
b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23)
a = fnI(a, b, c, d, M[0], 0xf4292244, 6)
d = fnI(d, a, b, c, M[7], 0x432aff97, 10)
c = fnI(c, d, a, b, M[14], 0xab9423a7, 15)
b = fnI(b, c, d, a, M[5], 0xfc93a039, 21)
a = fnI(a, b, c, d, M[12], 0x655b59c3, 6)
d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10)
c = fnI(c, d, a, b, M[10], 0xffeff47d, 15)
b = fnI(b, c, d, a, M[1], 0x85845dd1, 21)
a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6)
d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10)
c = fnI(c, d, a, b, M[6], 0xa3014314, 15)
b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21)
a = fnI(a, b, c, d, M[4], 0xf7537e82, 6)
d = fnI(d, a, b, c, M[11], 0xbd3af235, 10)
c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15)
b = fnI(b, c, d, a, M[9], 0xeb86d391, 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 () {
// create padding and handle blocks
this._block[this._blockOffset++] = 0x80
if (this._blockOffset > 56) {
this._block.fill(0, this._blockOffset, 64)
this._update()
this._blockOffset = 0
}
this._block.fill(0, this._blockOffset, 56)
this._block.writeUInt32LE(this._length[0], 56)
this._block.writeUInt32LE(this._length[1], 60)
this._update()
// produce result
var buffer = Buffer.allocUnsafe(16)
buffer.writeInt32LE(this._a, 0)
buffer.writeInt32LE(this._b, 4)
buffer.writeInt32LE(this._c, 8)
buffer.writeInt32LE(this._d, 12)
return buffer
}
function rotl (x, n) {
return (x << n) | (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
}
module.exports = MD5
/***/ }),
/***/ 88:
/*!*****************************************!*\
!*** ./node_modules/hash-base/index.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer
var Transform = __webpack_require__(/*! readable-stream */ 89).Transform
var inherits = __webpack_require__(/*! inherits */ 86)
function throwIfNotStringOrBuffer (val, prefix) {
if (!Buffer.isBuffer(val) && typeof val !== 'string') {
throw new TypeError(prefix + ' must be a string or a buffer')
}
}
function HashBase (blockSize) {
Transform.call(this)
this._block = Buffer.allocUnsafe(blockSize)
this._blockSize = blockSize
this._blockOffset = 0
this._length = [0, 0, 0, 0]
this._finalized = false
}
inherits(HashBase, Transform)
HashBase.prototype._transform = function (chunk, encoding, callback) {
var error = null
try {
this.update(chunk, encoding)
} catch (err) {
error = err
}
callback(error)
}
HashBase.prototype._flush = function (callback) {
var error = null
try {
this.push(this.digest())
} catch (err) {
error = err
}
callback(error)
}
HashBase.prototype.update = function (data, encoding) {
throwIfNotStringOrBuffer(data, 'Data')
if (this._finalized) throw new Error('Digest already called')
if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding)
// consume data
var block = this._block
var offset = 0
while (this._blockOffset + data.length - offset >= this._blockSize) {
for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]
this._update()
this._blockOffset = 0
}
while (offset < data.length) block[this._blockOffset++] = data[offset++]
// update length
for (var j = 0, carry = data.length * 8; carry > 0; ++j) {
this._length[j] += carry
carry = (this._length[j] / 0x0100000000) | 0
if (carry > 0) this._length[j] -= 0x0100000000 * carry
}
return this
}
HashBase.prototype._update = function () {
throw new Error('_update is not implemented')
}
HashBase.prototype.digest = function (encoding) {
if (this._finalized) throw new Error('Digest already called')
this._finalized = true
var digest = this._digest()
if (encoding !== undefined) digest = digest.toString(encoding)
// reset state
this._block.fill(0)
this._blockOffset = 0
for (var i = 0; i < 4; ++i) this._length[i] = 0
return digest
}
HashBase.prototype._digest = function () {
throw new Error('_digest is not implemented')
}
module.exports = HashBase
/***/ }),
/***/ 89:
/*!**********************************************************!*\
!*** ./node_modules/readable-stream/readable-browser.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ 90);
exports.Stream = exports;
exports.Readable = exports;
exports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ 100);
exports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ 99);
exports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ 103);
exports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ 104);
/***/ }),
/***/ 9:
/*!*****************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
return arr2;
}
module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ 90:
/*!**************************************************************!*\
!*** ./node_modules/readable-stream/lib/_stream_readable.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
/**/
var pna = __webpack_require__(/*! process-nextick-args */ 91);
/**/
module.exports = Readable;
/**/
var isArray = __webpack_require__(/*! isarray */ 84);
/**/
/**/
var Duplex;
/**/
Readable.ReadableState = ReadableState;
/**/
var EE = __webpack_require__(/*! events */ 92).EventEmitter;
var EElistenerCount = function (emitter, type) {
return emitter.listeners(type).length;
};
/**/
/**/
var Stream = __webpack_require__(/*! ./internal/streams/stream */ 93);
/**/
/**/
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer;
var OurUint8Array = global.Uint8Array || function () {};
function _uint8ArrayToBuffer(chunk) {
return Buffer.from(chunk);
}
function _isUint8Array(obj) {
return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
}
/**/
/**/
var util = Object.create(__webpack_require__(/*! core-util-is */ 94));
util.inherits = __webpack_require__(/*! inherits */ 86);
/**/
/**/
var debugUtil = __webpack_require__(/*! util */ 95);
var debug = void 0;
if (debugUtil && debugUtil.debuglog) {
debug = debugUtil.debuglog('stream');
} else {
debug = function () {};
}
/**/
var BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ 96);
var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ 98);
var StringDecoder;
util.inherits(Readable, Stream);
var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
function prependListener(emitter, event, fn) {
// Sadly this is not cacheable as some libraries bundle their own
// event emitter implementation with them.
if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
// This is a hack to make sure that our error handler is attached before any
// userland ones. NEVER DO THIS. This is here only because this code needs
// to continue to work with older versions of Node.js that do not include
// the prependListener() method. The goal is to eventually remove this hack.
if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
}
function ReadableState(options, stream) {
Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 99);
options = options || {};
// Duplex streams are both readable and writable, but share
// the same options object.
// However, some cases require setting options to different
// values for the readable and the writable sides of the duplex stream.
// These options can be provided separately as readableXXX and writableXXX.
var isDuplex = stream instanceof Duplex;
// object stream flag. Used to make read(n) ignore n and to
// make all the buffer merging and length checks go away
this.objectMode = !!options.objectMode;
if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
// the point at which it stops calling _read() to fill the buffer
// Note: 0 is a valid value, means "don't call _read preemptively ever"
var hwm = options.highWaterMark;
var readableHwm = options.readableHighWaterMark;
var defaultHwm = this.objectMode ? 16 : 16 * 1024;
if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
// cast to ints.
this.highWaterMark = Math.floor(this.highWaterMark);
// A linked list is used to store data chunks instead of an array because the
// linked list can remove elements from the beginning faster than
// array.shift()
this.buffer = new BufferList();
this.length = 0;
this.pipes = null;
this.pipesCount = 0;
this.flowing = null;
this.ended = false;
this.endEmitted = false;
this.reading = false;
// a flag to be able to tell if the event 'readable'/'data' is emitted
// immediately, or on a later tick. We set this to true at first, because
// any actions that shouldn't happen until "later" should generally also
// not happen before the first read call.
this.sync = true;
// whenever we return null, then we set a flag to say
// that we're awaiting a 'readable' event emission.
this.needReadable = false;
this.emittedReadable = false;
this.readableListening = false;
this.resumeScheduled = false;
// has it been destroyed
this.destroyed = false;
// Crypto is kind of old and crusty. Historically, its default string
// encoding is 'binary' so we have to make this configurable.
// Everything else in the universe uses 'utf8', though.
this.defaultEncoding = options.defaultEncoding || 'utf8';
// the number of writers that are awaiting a drain event in .pipe()s
this.awaitDrain = 0;
// if true, a maybeReadMore has been scheduled
this.readingMore = false;
this.decoder = null;
this.encoding = null;
if (options.encoding) {
if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ 102).StringDecoder;
this.decoder = new StringDecoder(options.encoding);
this.encoding = options.encoding;
}
}
function Readable(options) {
Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 99);
if (!(this instanceof Readable)) return new Readable(options);
this._readableState = new ReadableState(options, this);
// legacy
this.readable = true;
if (options) {
if (typeof options.read === 'function') this._read = options.read;
if (typeof options.destroy === 'function') this._destroy = options.destroy;
}
Stream.call(this);
}
Object.defineProperty(Readable.prototype, 'destroyed', {
get: function () {
if (this._readableState === undefined) {
return false;
}
return this._readableState.destroyed;
},
set: function (value) {
// we ignore the value if the stream
// has not been initialized yet
if (!this._readableState) {
return;
}
// backward compatibility, the user is explicitly
// managing destroyed
this._readableState.destroyed = value;
}
});
Readable.prototype.destroy = destroyImpl.destroy;
Readable.prototype._undestroy = destroyImpl.undestroy;
Readable.prototype._destroy = function (err, cb) {
this.push(null);
cb(err);
};
// Manually shove something into the read() buffer.
// This returns true if the highWaterMark has not been hit yet,
// similar to how Writable.write() returns true if you should
// write() some more.
Readable.prototype.push = function (chunk, encoding) {
var state = this._readableState;
var skipChunkCheck;
if (!state.objectMode) {
if (typeof chunk === 'string') {
encoding = encoding || state.defaultEncoding;
if (encoding !== state.encoding) {
chunk = Buffer.from(chunk, encoding);
encoding = '';
}
skipChunkCheck = true;
}
} else {
skipChunkCheck = true;
}
return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
};
// Unshift should *always* be something directly out of read()
Readable.prototype.unshift = function (chunk) {
return readableAddChunk(this, chunk, null, true, false);
};
function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
var state = stream._readableState;
if (chunk === null) {
state.reading = false;
onEofChunk(stream, state);
} else {
var er;
if (!skipChunkCheck) er = chunkInvalid(state, chunk);
if (er) {
stream.emit('error', er);
} else if (state.objectMode || chunk && chunk.length > 0) {
if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
chunk = _uint8ArrayToBuffer(chunk);
}
if (addToFront) {
if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
} else if (state.ended) {
stream.emit('error', new Error('stream.push() after EOF'));
} else {
state.reading = false;
if (state.decoder && !encoding) {
chunk = state.decoder.write(chunk);
if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
} else {
addChunk(stream, state, chunk, false);
}
}
} else if (!addToFront) {
state.reading = false;
}
}
return needMoreData(state);
}
function addChunk(stream, state, chunk, addToFront) {
if (state.flowing && state.length === 0 && !state.sync) {
stream.emit('data', chunk);
stream.read(0);
} else {
// update the buffer info.
state.length += state.objectMode ? 1 : chunk.length;
if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
if (state.needReadable) emitReadable(stream);
}
maybeReadMore(stream, state);
}
function chunkInvalid(state, chunk) {
var er;
if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
er = new TypeError('Invalid non-string/buffer chunk');
}
return er;
}
// if it's past the high water mark, we can push in some more.
// Also, if we have no data yet, we can stand some
// more bytes. This is to work around cases where hwm=0,
// such as the repl. Also, if the push() triggered a
// readable event, and the user called read(largeNumber) such that
// needReadable was set, then we ought to push more, so that another
// 'readable' event will be triggered.
function needMoreData(state) {
return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
}
Readable.prototype.isPaused = function () {
return this._readableState.flowing === false;
};
// backwards compatibility.
Readable.prototype.setEncoding = function (enc) {
if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ 102).StringDecoder;
this._readableState.decoder = new StringDecoder(enc);
this._readableState.encoding = enc;
return this;
};
// Don't raise the hwm > 8MB
var MAX_HWM = 0x800000;
function computeNewHighWaterMark(n) {
if (n >= MAX_HWM) {
n = MAX_HWM;
} else {
// Get the next highest power of 2 to prevent increasing hwm excessively in
// tiny amounts
n--;
n |= n >>> 1;
n |= n >>> 2;
n |= n >>> 4;
n |= n >>> 8;
n |= n >>> 16;
n++;
}
return n;
}
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function howMuchToRead(n, state) {
if (n <= 0 || state.length === 0 && state.ended) return 0;
if (state.objectMode) return 1;
if (n !== n) {
// Only flow one buffer at a time
if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
}
// If we're asking for more than the current hwm, then raise the hwm.
if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
if (n <= state.length) return n;
// Don't have enough
if (!state.ended) {
state.needReadable = true;
return 0;
}
return state.length;
}
// you can override either this method, or the async _read(n) below.
Readable.prototype.read = function (n) {
debug('read', n);
n = parseInt(n, 10);
var state = this._readableState;
var nOrig = n;
if (n !== 0) state.emittedReadable = false;
// if we're doing read(0) to trigger a readable event, but we
// already have a bunch of data in the buffer, then just trigger
// the 'readable' event and move on.
if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
debug('read: emitReadable', state.length, state.ended);
if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
return null;
}
n = howMuchToRead(n, state);
// if we've ended, and we're now clear, then finish it up.
if (n === 0 && state.ended) {
if (state.length === 0) endReadable(this);
return null;
}
// All the actual chunk generation logic needs to be
// *below* the call to _read. The reason is that in certain
// synthetic stream cases, such as passthrough streams, _read
// may be a completely synchronous operation which may change
// the state of the read buffer, providing enough data when
// before there was *not* enough.
//
// So, the steps are:
// 1. Figure out what the state of things will be after we do
// a read from the buffer.
//
// 2. If that resulting state will trigger a _read, then call _read.
// Note that this may be asynchronous, or synchronous. Yes, it is
// deeply ugly to write APIs this way, but that still doesn't mean
// that the Readable class should behave improperly, as streams are
// designed to be sync/async agnostic.
// Take note if the _read call is sync or async (ie, if the read call
// has returned yet), so that we know whether or not it's safe to emit
// 'readable' etc.
//
// 3. Actually pull the requested chunks out of the buffer and return.
// if we need a readable event, then we need to do some reading.
var doRead = state.needReadable;
debug('need readable', doRead);
// if we currently have less than the highWaterMark, then also read some
if (state.length === 0 || state.length - n < state.highWaterMark) {
doRead = true;
debug('length less than watermark', doRead);
}
// however, if we've ended, then there's no point, and if we're already
// reading, then it's unnecessary.
if (state.ended || state.reading) {
doRead = false;
debug('reading or ended', doRead);
} else if (doRead) {
debug('do read');
state.reading = true;
state.sync = true;
// if the length is currently zero, then we *need* a readable event.
if (state.length === 0) state.needReadable = true;
// call internal read method
this._read(state.highWaterMark);
state.sync = false;
// If _read pushed data synchronously, then `reading` will be false,
// and we need to re-evaluate how much data we can return to the user.
if (!state.reading) n = howMuchToRead(nOrig, state);
}
var ret;
if (n > 0) ret = fromList(n, state);else ret = null;
if (ret === null) {
state.needReadable = true;
n = 0;
} else {
state.length -= n;
}
if (state.length === 0) {
// If we have nothing in the buffer, then we want to know
// as soon as we *do* get something into the buffer.
if (!state.ended) state.needReadable = true;
// If we tried to read() past the EOF, then emit end on the next tick.
if (nOrig !== n && state.ended) endReadable(this);
}
if (ret !== null) this.emit('data', ret);
return ret;
};
function onEofChunk(stream, state) {
if (state.ended) return;
if (state.decoder) {
var chunk = state.decoder.end();
if (chunk && chunk.length) {
state.buffer.push(chunk);
state.length += state.objectMode ? 1 : chunk.length;
}
}
state.ended = true;
// emit 'readable' now to make sure it gets picked up.
emitReadable(stream);
}
// Don't emit readable right away in sync mode, because this can trigger
// another read() call => stack overflow. This way, it might trigger
// a nextTick recursion warning, but that's not so bad.
function emitReadable(stream) {
var state = stream._readableState;
state.needReadable = false;
if (!state.emittedReadable) {
debug('emitReadable', state.flowing);
state.emittedReadable = true;
if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
}
}
function emitReadable_(stream) {
debug('emit readable');
stream.emit('readable');
flow(stream);
}
// at this point, the user has presumably seen the 'readable' event,
// and called read() to consume some data. that may have triggered
// in turn another _read(n) call, in which case reading = true if
// it's in progress.
// However, if we're not ended, or reading, and the length < hwm,
// then go ahead and try to read some more preemptively.
function maybeReadMore(stream, state) {
if (!state.readingMore) {
state.readingMore = true;
pna.nextTick(maybeReadMore_, stream, state);
}
}
function maybeReadMore_(stream, state) {
var len = state.length;
while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
debug('maybeReadMore read 0');
stream.read(0);
if (len === state.length)
// didn't get any data, stop spinning.
break;else len = state.length;
}
state.readingMore = false;
}
// abstract method. to be overridden in specific implementation classes.
// call cb(er, data) where data is <= n in length.
// for virtual (non-string, non-buffer) streams, "length" is somewhat
// arbitrary, and perhaps not very meaningful.
Readable.prototype._read = function (n) {
this.emit('error', new Error('_read() is not implemented'));
};
Readable.prototype.pipe = function (dest, pipeOpts) {
var src = this;
var state = this._readableState;
switch (state.pipesCount) {
case 0:
state.pipes = dest;
break;
case 1:
state.pipes = [state.pipes, dest];
break;
default:
state.pipes.push(dest);
break;
}
state.pipesCount += 1;
debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
var endFn = doEnd ? onend : unpipe;
if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
dest.on('unpipe', onunpipe);
function onunpipe(readable, unpipeInfo) {
debug('onunpipe');
if (readable === src) {
if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
unpipeInfo.hasUnpiped = true;
cleanup();
}
}
}
function onend() {
debug('onend');
dest.end();
}
// when the dest drains, it reduces the awaitDrain counter
// on the source. This would be more elegant with a .once()
// handler in flow(), but adding and removing repeatedly is
// too slow.
var ondrain = pipeOnDrain(src);
dest.on('drain', ondrain);
var cleanedUp = false;
function cleanup() {
debug('cleanup');
// cleanup event handlers once the pipe is broken
dest.removeListener('close', onclose);
dest.removeListener('finish', onfinish);
dest.removeListener('drain', ondrain);
dest.removeListener('error', onerror);
dest.removeListener('unpipe', onunpipe);
src.removeListener('end', onend);
src.removeListener('end', unpipe);
src.removeListener('data', ondata);
cleanedUp = true;
// if the reader is waiting for a drain event from this
// specific writer, then it would cause it to never start
// flowing again.
// So, if this is awaiting a drain, then we just call it now.
// If we don't know, then assume that we are waiting for one.
if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
}
// If the user pushes more data while we're writing to dest then we'll end up
// in ondata again. However, we only want to increase awaitDrain once because
// dest will only emit one 'drain' event for the multiple writes.
// => Introduce a guard on increasing awaitDrain.
var increasedAwaitDrain = false;
src.on('data', ondata);
function ondata(chunk) {
debug('ondata');
increasedAwaitDrain = false;
var ret = dest.write(chunk);
if (false === ret && !increasedAwaitDrain) {
// If the user unpiped during `dest.write()`, it is possible
// to get stuck in a permanently paused state if that write
// also returned false.
// => Check whether `dest` is still a piping destination.
if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
debug('false write response, pause', src._readableState.awaitDrain);
src._readableState.awaitDrain++;
increasedAwaitDrain = true;
}
src.pause();
}
}
// if the dest has an error, then stop piping into it.
// however, don't suppress the throwing behavior for this.
function onerror(er) {
debug('onerror', er);
unpipe();
dest.removeListener('error', onerror);
if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
}
// Make sure our error handler is attached before userland ones.
prependListener(dest, 'error', onerror);
// Both close and finish should trigger unpipe, but only once.
function onclose() {
dest.removeListener('finish', onfinish);
unpipe();
}
dest.once('close', onclose);
function onfinish() {
debug('onfinish');
dest.removeListener('close', onclose);
unpipe();
}
dest.once('finish', onfinish);
function unpipe() {
debug('unpipe');
src.unpipe(dest);
}
// tell the dest that it's being piped to
dest.emit('pipe', src);
// start the flow if it hasn't been started already.
if (!state.flowing) {
debug('pipe resume');
src.resume();
}
return dest;
};
function pipeOnDrain(src) {
return function () {
var state = src._readableState;
debug('pipeOnDrain', state.awaitDrain);
if (state.awaitDrain) state.awaitDrain--;
if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
state.flowing = true;
flow(src);
}
};
}
Readable.prototype.unpipe = function (dest) {
var state = this._readableState;
var unpipeInfo = { hasUnpiped: false };
// if we're not piping anywhere, then do nothing.
if (state.pipesCount === 0) return this;
// just one destination. most common case.
if (state.pipesCount === 1) {
// passed in one, but it's not the right one.
if (dest && dest !== state.pipes) return this;
if (!dest) dest = state.pipes;
// got a match.
state.pipes = null;
state.pipesCount = 0;
state.flowing = false;
if (dest) dest.emit('unpipe', this, unpipeInfo);
return this;
}
// slow case. multiple pipe destinations.
if (!dest) {
// remove all.
var dests = state.pipes;
var len = state.pipesCount;
state.pipes = null;
state.pipesCount = 0;
state.flowing = false;
for (var i = 0; i < len; i++) {
dests[i].emit('unpipe', this, unpipeInfo);
}return this;
}
// try to find the right one.
var index = indexOf(state.pipes, dest);
if (index === -1) return this;
state.pipes.splice(index, 1);
state.pipesCount -= 1;
if (state.pipesCount === 1) state.pipes = state.pipes[0];
dest.emit('unpipe', this, unpipeInfo);
return this;
};
// set up data events if they are asked for
// Ensure readable listeners eventually get something
Readable.prototype.on = function (ev, fn) {
var res = Stream.prototype.on.call(this, ev, fn);
if (ev === 'data') {
// Start flowing on next tick if stream isn't explicitly paused
if (this._readableState.flowing !== false) this.resume();
} else if (ev === 'readable') {
var state = this._readableState;
if (!state.endEmitted && !state.readableListening) {
state.readableListening = state.needReadable = true;
state.emittedReadable = false;
if (!state.reading) {
pna.nextTick(nReadingNextTick, this);
} else if (state.length) {
emitReadable(this);
}
}
}
return res;
};
Readable.prototype.addListener = Readable.prototype.on;
function nReadingNextTick(self) {
debug('readable nexttick read 0');
self.read(0);
}
// pause() and resume() are remnants of the legacy readable stream API
// If the user uses them, then switch into old mode.
Readable.prototype.resume = function () {
var state = this._readableState;
if (!state.flowing) {
debug('resume');
state.flowing = true;
resume(this, state);
}
return this;
};
function resume(stream, state) {
if (!state.resumeScheduled) {
state.resumeScheduled = true;
pna.nextTick(resume_, stream, state);
}
}
function resume_(stream, state) {
if (!state.reading) {
debug('resume read 0');
stream.read(0);
}
state.resumeScheduled = false;
state.awaitDrain = 0;
stream.emit('resume');
flow(stream);
if (state.flowing && !state.reading) stream.read(0);
}
Readable.prototype.pause = function () {
debug('call pause flowing=%j', this._readableState.flowing);
if (false !== this._readableState.flowing) {
debug('pause');
this._readableState.flowing = false;
this.emit('pause');
}
return this;
};
function flow(stream) {
var state = stream._readableState;
debug('flow', state.flowing);
while (state.flowing && stream.read() !== null) {}
}
// wrap an old-style stream as the async data source.
// This is *not* part of the readable stream interface.
// It is an ugly unfortunate mess of history.
Readable.prototype.wrap = function (stream) {
var _this = this;
var state = this._readableState;
var paused = false;
stream.on('end', function () {
debug('wrapped end');
if (state.decoder && !state.ended) {
var chunk = state.decoder.end();
if (chunk && chunk.length) _this.push(chunk);
}
_this.push(null);
});
stream.on('data', function (chunk) {
debug('wrapped data');
if (state.decoder) chunk = state.decoder.write(chunk);
// don't skip over falsy values in objectMode
if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
var ret = _this.push(chunk);
if (!ret) {
paused = true;
stream.pause();
}
});
// proxy all the other methods.
// important when wrapping filters and duplexes.
for (var i in stream) {
if (this[i] === undefined && typeof stream[i] === 'function') {
this[i] = function (method) {
return function () {
return stream[method].apply(stream, arguments);
};
}(i);
}
}
// proxy certain important events.
for (var n = 0; n < kProxyEvents.length; n++) {
stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
}
// when we try to consume some more bytes, simply unpause the
// underlying stream.
this._read = function (n) {
debug('wrapped _read', n);
if (paused) {
paused = false;
stream.resume();
}
};
return this;
};
Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
// making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
get: function () {
return this._readableState.highWaterMark;
}
});
// exposed for testing purposes only.
Readable._fromList = fromList;
// Pluck off n bytes from an array of buffers.
// Length is the combined lengths of all the buffers in the list.
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function fromList(n, state) {
// nothing buffered
if (state.length === 0) return null;
var ret;
if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
// read it all, truncate the list
if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
state.buffer.clear();
} else {
// read part of list
ret = fromListPartial(n, state.buffer, state.decoder);
}
return ret;
}
// Extracts only enough buffered data to satisfy the amount requested.
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function fromListPartial(n, list, hasStrings) {
var ret;
if (n < list.head.data.length) {
// slice is the same for buffers and strings
ret = list.head.data.slice(0, n);
list.head.data = list.head.data.slice(n);
} else if (n === list.head.data.length) {
// first chunk is a perfect match
ret = list.shift();
} else {
// result spans more than one buffer
ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
}
return ret;
}
// Copies a specified amount of characters from the list of buffered data
// chunks.
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function copyFromBufferString(n, list) {
var p = list.head;
var c = 1;
var ret = p.data;
n -= ret.length;
while (p = p.next) {
var str = p.data;
var nb = n > str.length ? str.length : n;
if (nb === str.length) ret += str;else ret += str.slice(0, n);
n -= nb;
if (n === 0) {
if (nb === str.length) {
++c;
if (p.next) list.head = p.next;else list.head = list.tail = null;
} else {
list.head = p;
p.data = str.slice(nb);
}
break;
}
++c;
}
list.length -= c;
return ret;
}
// Copies a specified amount of bytes from the list of buffered data chunks.
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function copyFromBuffer(n, list) {
var ret = Buffer.allocUnsafe(n);
var p = list.head;
var c = 1;
p.data.copy(ret);
n -= p.data.length;
while (p = p.next) {
var buf = p.data;
var nb = n > buf.length ? buf.length : n;
buf.copy(ret, ret.length - n, 0, nb);
n -= nb;
if (n === 0) {
if (nb === buf.length) {
++c;
if (p.next) list.head = p.next;else list.head = list.tail = null;
} else {
list.head = p;
p.data = buf.slice(nb);
}
break;
}
++c;
}
list.length -= c;
return ret;
}
function endReadable(stream) {
var state = stream._readableState;
// If we get here before consuming all the bytes, then that is a
// bug in node. Should never happen.
if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
if (!state.endEmitted) {
state.ended = true;
pna.nextTick(endReadableNT, state, stream);
}
}
function endReadableNT(state, stream) {
// Check that we didn't get one last unshift.
if (!state.endEmitted && state.length === 0) {
state.endEmitted = true;
stream.readable = false;
stream.emit('end');
}
}
function indexOf(xs, x) {
for (var i = 0, l = xs.length; i < l; i++) {
if (xs[i] === x) return i;
}
return -1;
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3), __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 78)))
/***/ }),
/***/ 91:
/*!****************************************************!*\
!*** ./node_modules/process-nextick-args/index.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {
if (typeof process === 'undefined' ||
!process.version ||
process.version.indexOf('v0.') === 0 ||
process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
module.exports = { nextTick: nextTick };
} else {
module.exports = process
}
function nextTick(fn, arg1, arg2, arg3) {
if (typeof fn !== 'function') {
throw new TypeError('"callback" argument must be a function');
}
var len = arguments.length;
var args, i;
switch (len) {
case 0:
case 1:
return process.nextTick(fn);
case 2:
return process.nextTick(function afterTickOne() {
fn.call(null, arg1);
});
case 3:
return process.nextTick(function afterTickTwo() {
fn.call(null, arg1, arg2);
});
case 4:
return process.nextTick(function afterTickThree() {
fn.call(null, arg1, arg2, arg3);
});
default:
args = new Array(len - 1);
i = 0;
while (i < args.length) {
args[i++] = arguments[i];
}
return process.nextTick(function afterTick() {
fn.apply(null, args);
});
}
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 78)))
/***/ }),
/***/ 92:
/*!***************************************!*\
!*** ./node_modules/events/events.js ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var R = typeof Reflect === 'object' ? Reflect : null
var ReflectApply = R && typeof R.apply === 'function'
? R.apply
: function ReflectApply(target, receiver, args) {
return Function.prototype.apply.call(target, receiver, args);
}
var ReflectOwnKeys
if (R && typeof R.ownKeys === 'function') {
ReflectOwnKeys = R.ownKeys
} else if (Object.getOwnPropertySymbols) {
ReflectOwnKeys = function ReflectOwnKeys(target) {
return Object.getOwnPropertyNames(target)
.concat(Object.getOwnPropertySymbols(target));
};
} else {
ReflectOwnKeys = function ReflectOwnKeys(target) {
return Object.getOwnPropertyNames(target);
};
}
function ProcessEmitWarning(warning) {
if (console && console.warn) console.warn(warning);
}
var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
return value !== value;
}
function EventEmitter() {
EventEmitter.init.call(this);
}
module.exports = EventEmitter;
module.exports.once = once;
// Backwards-compat with node 0.10.x
EventEmitter.EventEmitter = EventEmitter;
EventEmitter.prototype._events = undefined;
EventEmitter.prototype._eventsCount = 0;
EventEmitter.prototype._maxListeners = undefined;
// By default EventEmitters will print a warning if more than 10 listeners are
// added to it. This is a useful default which helps finding memory leaks.
var defaultMaxListeners = 10;
function checkListener(listener) {
if (typeof listener !== 'function') {
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
}
}
Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
enumerable: true,
get: function() {
return defaultMaxListeners;
},
set: function(arg) {
if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
}
defaultMaxListeners = arg;
}
});
EventEmitter.init = function() {
if (this._events === undefined ||
this._events === Object.getPrototypeOf(this)._events) {
this._events = Object.create(null);
this._eventsCount = 0;
}
this._maxListeners = this._maxListeners || undefined;
};
// Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
}
this._maxListeners = n;
return this;
};
function _getMaxListeners(that) {
if (that._maxListeners === undefined)
return EventEmitter.defaultMaxListeners;
return that._maxListeners;
}
EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
return _getMaxListeners(this);
};
EventEmitter.prototype.emit = function emit(type) {
var args = [];
for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
var doError = (type === 'error');
var events = this._events;
if (events !== undefined)
doError = (doError && events.error === undefined);
else if (!doError)
return false;
// If there is no 'error' event listener then throw.
if (doError) {
var er;
if (args.length > 0)
er = args[0];
if (er instanceof Error) {
// Note: The comments on the `throw` lines are intentional, they show
// up in Node's output if this results in an unhandled exception.
throw er; // Unhandled 'error' event
}
// At least give some kind of context to the user
var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
err.context = er;
throw err; // Unhandled 'error' event
}
var handler = events[type];
if (handler === undefined)
return false;
if (typeof handler === 'function') {
ReflectApply(handler, this, args);
} else {
var len = handler.length;
var listeners = arrayClone(handler, len);
for (var i = 0; i < len; ++i)
ReflectApply(listeners[i], this, args);
}
return true;
};
function _addListener(target, type, listener, prepend) {
var m;
var events;
var existing;
checkListener(listener);
events = target._events;
if (events === undefined) {
events = target._events = Object.create(null);
target._eventsCount = 0;
} else {
// To avoid recursion in the case that type === "newListener"! Before
// adding it to the listeners, first emit "newListener".
if (events.newListener !== undefined) {
target.emit('newListener', type,
listener.listener ? listener.listener : listener);
// Re-assign `events` because a newListener handler could have caused the
// this._events to be assigned to a new object
events = target._events;
}
existing = events[type];
}
if (existing === undefined) {
// Optimize the case of one listener. Don't need the extra array object.
existing = events[type] = listener;
++target._eventsCount;
} else {
if (typeof existing === 'function') {
// Adding the second element, need to change to array.
existing = events[type] =
prepend ? [listener, existing] : [existing, listener];
// If we've already got an array, just append.
} else if (prepend) {
existing.unshift(listener);
} else {
existing.push(listener);
}
// Check for listener leak
m = _getMaxListeners(target);
if (m > 0 && existing.length > m && !existing.warned) {
existing.warned = true;
// No error code for this since it is a Warning
// eslint-disable-next-line no-restricted-syntax
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;
ProcessEmitWarning(w);
}
}
return target;
}
EventEmitter.prototype.addListener = function addListener(type, listener) {
return _addListener(this, type, listener, false);
};
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
EventEmitter.prototype.prependListener =
function prependListener(type, listener) {
return _addListener(this, type, listener, true);
};
function onceWrapper() {
if (!this.fired) {
this.target.removeListener(this.type, this.wrapFn);
this.fired = true;
if (arguments.length === 0)
return this.listener.call(this.target);
return this.listener.apply(this.target, arguments);
}
}
function _onceWrap(target, type, listener) {
var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
var wrapped = onceWrapper.bind(state);
wrapped.listener = listener;
state.wrapFn = wrapped;
return wrapped;
}
EventEmitter.prototype.once = function once(type, listener) {
checkListener(listener);
this.on(type, _onceWrap(this, type, listener));
return this;
};
EventEmitter.prototype.prependOnceListener =
function prependOnceListener(type, listener) {
checkListener(listener);
this.prependListener(type, _onceWrap(this, type, listener));
return this;
};
// Emits a 'removeListener' event if and only if the listener was removed.
EventEmitter.prototype.removeListener =
function removeListener(type, listener) {
var list, events, position, i, originalListener;
checkListener(listener);
events = this._events;
if (events === undefined)
return this;
list = events[type];
if (list === undefined)
return this;
if (list === listener || list.listener === listener) {
if (--this._eventsCount === 0)
this._events = Object.create(null);
else {
delete events[type];
if (events.removeListener)
this.emit('removeListener', type, list.listener || listener);
}
} else if (typeof list !== 'function') {
position = -1;
for (i = list.length - 1; i >= 0; i--) {
if (list[i] === listener || list[i].listener === listener) {
originalListener = list[i].listener;
position = i;
break;
}
}
if (position < 0)
return this;
if (position === 0)
list.shift();
else {
spliceOne(list, position);
}
if (list.length === 1)
events[type] = list[0];
if (events.removeListener !== undefined)
this.emit('removeListener', type, originalListener || listener);
}
return this;
};
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
EventEmitter.prototype.removeAllListeners =
function removeAllListeners(type) {
var listeners, events, i;
events = this._events;
if (events === undefined)
return this;
// not listening for removeListener, no need to emit
if (events.removeListener === undefined) {
if (arguments.length === 0) {
this._events = Object.create(null);
this._eventsCount = 0;
} else if (events[type] !== undefined) {
if (--this._eventsCount === 0)
this._events = Object.create(null);
else
delete events[type];
}
return this;
}
// emit removeListener for all listeners on all events
if (arguments.length === 0) {
var keys = Object.keys(events);
var key;
for (i = 0; i < keys.length; ++i) {
key = keys[i];
if (key === 'removeListener') continue;
this.removeAllListeners(key);
}
this.removeAllListeners('removeListener');
this._events = Object.create(null);
this._eventsCount = 0;
return this;
}
listeners = events[type];
if (typeof listeners === 'function') {
this.removeListener(type, listeners);
} else if (listeners !== undefined) {
// LIFO order
for (i = listeners.length - 1; i >= 0; i--) {
this.removeListener(type, listeners[i]);
}
}
return this;
};
function _listeners(target, type, unwrap) {
var events = target._events;
if (events === undefined)
return [];
var evlistener = events[type];
if (evlistener === undefined)
return [];
if (typeof evlistener === 'function')
return unwrap ? [evlistener.listener || evlistener] : [evlistener];
return unwrap ?
unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
}
EventEmitter.prototype.listeners = function listeners(type) {
return _listeners(this, type, true);
};
EventEmitter.prototype.rawListeners = function rawListeners(type) {
return _listeners(this, type, false);
};
EventEmitter.listenerCount = function(emitter, type) {
if (typeof emitter.listenerCount === 'function') {
return emitter.listenerCount(type);
} else {
return listenerCount.call(emitter, type);
}
};
EventEmitter.prototype.listenerCount = listenerCount;
function listenerCount(type) {
var events = this._events;
if (events !== undefined) {
var evlistener = events[type];
if (typeof evlistener === 'function') {
return 1;
} else if (evlistener !== undefined) {
return evlistener.length;
}
}
return 0;
}
EventEmitter.prototype.eventNames = function eventNames() {
return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
};
function arrayClone(arr, n) {
var copy = new Array(n);
for (var i = 0; i < n; ++i)
copy[i] = arr[i];
return copy;
}
function spliceOne(list, index) {
for (; index + 1 < list.length; index++)
list[index] = list[index + 1];
list.pop();
}
function unwrapListeners(arr) {
var ret = new Array(arr.length);
for (var i = 0; i < ret.length; ++i) {
ret[i] = arr[i].listener || arr[i];
}
return ret;
}
function once(emitter, name) {
return new Promise(function (resolve, reject) {
function errorListener(err) {
emitter.removeListener(name, resolver);
reject(err);
}
function resolver() {
if (typeof emitter.removeListener === 'function') {
emitter.removeListener('error', errorListener);
}
resolve([].slice.call(arguments));
};
eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
if (name !== 'error') {
addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
}
});
}
function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
if (typeof emitter.on === 'function') {
eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
}
}
function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
if (typeof emitter.on === 'function') {
if (flags.once) {
emitter.once(name, listener);
} else {
emitter.on(name, listener);
}
} else if (typeof emitter.addEventListener === 'function') {
// EventTarget does not have `error` event semantics like Node
// EventEmitters, we do not listen for `error` events here.
emitter.addEventListener(name, function wrapListener(arg) {
// IE does not have builtin `{ once: true }` support so we
// have to do it manually.
if (flags.once) {
emitter.removeEventListener(name, wrapListener);
}
listener(arg);
});
} else {
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
}
}
/***/ }),
/***/ 93:
/*!*****************************************************************************!*\
!*** ./node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
\*****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! events */ 92).EventEmitter;
/***/ }),
/***/ 94:
/*!***********************************************!*\
!*** ./node_modules/core-util-is/lib/util.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
function isArray(arg) {
if (Array.isArray) {
return Array.isArray(arg);
}
return objectToString(arg) === '[object Array]';
}
exports.isArray = isArray;
function isBoolean(arg) {
return typeof arg === 'boolean';
}
exports.isBoolean = isBoolean;
function isNull(arg) {
return arg === null;
}
exports.isNull = isNull;
function isNullOrUndefined(arg) {
return arg == null;
}
exports.isNullOrUndefined = isNullOrUndefined;
function isNumber(arg) {
return typeof arg === 'number';
}
exports.isNumber = isNumber;
function isString(arg) {
return typeof arg === 'string';
}
exports.isString = isString;
function isSymbol(arg) {
return typeof arg === 'symbol';
}
exports.isSymbol = isSymbol;
function isUndefined(arg) {
return arg === void 0;
}
exports.isUndefined = isUndefined;
function isRegExp(re) {
return objectToString(re) === '[object RegExp]';
}
exports.isRegExp = isRegExp;
function isObject(arg) {
return typeof arg === 'object' && arg !== null;
}
exports.isObject = isObject;
function isDate(d) {
return objectToString(d) === '[object Date]';
}
exports.isDate = isDate;
function isError(e) {
return (objectToString(e) === '[object Error]' || e instanceof Error);
}
exports.isError = isError;
function isFunction(arg) {
return typeof arg === 'function';
}
exports.isFunction = isFunction;
function isPrimitive(arg) {
return arg === null ||
typeof arg === 'boolean' ||
typeof arg === 'number' ||
typeof arg === 'string' ||
typeof arg === 'symbol' || // ES6 symbol
typeof arg === 'undefined';
}
exports.isPrimitive = isPrimitive;
exports.isBuffer = __webpack_require__(/*! buffer */ 81).Buffer.isBuffer;
function objectToString(o) {
return Object.prototype.toString.call(o);
}
/***/ }),
/***/ 95:
/*!**********************!*\
!*** util (ignored) ***!
\**********************/
/*! no static exports found */
/***/ (function(module, exports) {
/* (ignored) */
/***/ }),
/***/ 96:
/*!*************************************************************************!*\
!*** ./node_modules/readable-stream/lib/internal/streams/BufferList.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Buffer = __webpack_require__(/*! safe-buffer */ 80).Buffer;
var util = __webpack_require__(/*! util */ 97);
function copyBuffer(src, target, offset) {
src.copy(target, offset);
}
module.exports = function () {
function BufferList() {
_classCallCheck(this, BufferList);
this.head = null;
this.tail = null;
this.length = 0;
}
BufferList.prototype.push = function push(v) {
var entry = { data: v, next: null };
if (this.length > 0) this.tail.next = entry;else this.head = entry;
this.tail = entry;
++this.length;
};
BufferList.prototype.unshift = function unshift(v) {
var entry = { data: v, next: this.head };
if (this.length === 0) this.tail = entry;
this.head = entry;
++this.length;
};
BufferList.prototype.shift = function shift() {
if (this.length === 0) return;
var ret = this.head.data;
if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
--this.length;
return ret;
};
BufferList.prototype.clear = function clear() {
this.head = this.tail = null;
this.length = 0;
};
BufferList.prototype.join = function join(s) {
if (this.length === 0) return '';
var p = this.head;
var ret = '' + p.data;
while (p = p.next) {
ret += s + p.data;
}return ret;
};
BufferList.prototype.concat = function concat(n) {
if (this.length === 0) return Buffer.alloc(0);
if (this.length === 1) return this.head.data;
var ret = Buffer.allocUnsafe(n >>> 0);
var p = this.head;
var i = 0;
while (p) {
copyBuffer(p.data, ret, i);
i += p.data.length;
p = p.next;
}
return ret;
};
return BufferList;
}();
if (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;
};
}
/***/ }),
/***/ 97:
/*!**********************!*\
!*** util (ignored) ***!
\**********************/
/*! no static exports found */
/***/ (function(module, exports) {
/* (ignored) */
/***/ }),
/***/ 98:
/*!**********************************************************************!*\
!*** ./node_modules/readable-stream/lib/internal/streams/destroy.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**/
var pna = __webpack_require__(/*! process-nextick-args */ 91);
/**/
// undocumented cb() API, needed for core, not for public API
function destroy(err, cb) {
var _this = this;
var readableDestroyed = this._readableState && this._readableState.destroyed;
var writableDestroyed = this._writableState && this._writableState.destroyed;
if (readableDestroyed || writableDestroyed) {
if (cb) {
cb(err);
} else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
pna.nextTick(emitErrorNT, this, err);
}
return this;
}
// we set destroyed to true before firing error callbacks in order
// to make it re-entrance safe in case destroy() is called within callbacks
if (this._readableState) {
this._readableState.destroyed = true;
}
// if this is a duplex stream mark the writable part as destroyed as well
if (this._writableState) {
this._writableState.destroyed = true;
}
this._destroy(err || null, function (err) {
if (!cb && err) {
pna.nextTick(emitErrorNT, _this, err);
if (_this._writableState) {
_this._writableState.errorEmitted = true;
}
} else if (cb) {
cb(err);
}
});
return this;
}
function undestroy() {
if (this._readableState) {
this._readableState.destroyed = false;
this._readableState.reading = false;
this._readableState.ended = false;
this._readableState.endEmitted = false;
}
if (this._writableState) {
this._writableState.destroyed = false;
this._writableState.ended = false;
this._writableState.ending = false;
this._writableState.finished = false;
this._writableState.errorEmitted = false;
}
}
function emitErrorNT(self, err) {
self.emit('error', err);
}
module.exports = {
destroy: destroy,
undestroy: undestroy
};
/***/ }),
/***/ 99:
/*!************************************************************!*\
!*** ./node_modules/readable-stream/lib/_stream_duplex.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// a duplex stream is just a stream that is both readable and writable.
// Since JS doesn't have multiple prototypal inheritance, this class
// prototypally inherits from Readable, and then parasitically from
// Writable.
/**/
var pna = __webpack_require__(/*! process-nextick-args */ 91);
/**/
/**/
var objectKeys = Object.keys || function (obj) {
var keys = [];
for (var key in obj) {
keys.push(key);
}return keys;
};
/**/
module.exports = Duplex;
/**/
var util = Object.create(__webpack_require__(/*! core-util-is */ 94));
util.inherits = __webpack_require__(/*! inherits */ 86);
/**/
var Readable = __webpack_require__(/*! ./_stream_readable */ 90);
var Writable = __webpack_require__(/*! ./_stream_writable */ 100);
util.inherits(Duplex, Readable);
{
// avoid scope creep, the keys array can then be collected
var keys = objectKeys(Writable.prototype);
for (var v = 0; v < keys.length; v++) {
var method = keys[v];
if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
}
}
function Duplex(options) {
if (!(this instanceof Duplex)) return new Duplex(options);
Readable.call(this, options);
Writable.call(this, options);
if (options && options.readable === false) this.readable = false;
if (options && options.writable === false) this.writable = false;
this.allowHalfOpen = true;
if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
this.once('end', onend);
}
Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
// making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
get: function () {
return this._writableState.highWaterMark;
}
});
// the no-half-open enforcer
function onend() {
// if we allow half-open state, or if the writable side ended,
// then we're ok.
if (this.allowHalfOpen || this._writableState.ended) return;
// no more data can be written.
// But allow more writes to happen in this tick.
pna.nextTick(onEndNT, this);
}
function onEndNT(self) {
self.end();
}
Object.defineProperty(Duplex.prototype, 'destroyed', {
get: function () {
if (this._readableState === undefined || this._writableState === undefined) {
return false;
}
return this._readableState.destroyed && this._writableState.destroyed;
},
set: function (value) {
// we ignore the value if the stream
// has not been initialized yet
if (this._readableState === undefined || this._writableState === undefined) {
return;
}
// backward compatibility, the user is explicitly
// managing destroyed
this._readableState.destroyed = value;
this._writableState.destroyed = value;
}
});
Duplex.prototype._destroy = function (err, cb) {
this.push(null);
this.end();
pna.nextTick(cb, err);
};
/***/ })
}]);
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map