diff --git a/packages/amazon-cognito-identity-js/dist/amazon-cognito-identity.js b/packages/amazon-cognito-identity-js/dist/amazon-cognito-identity.js index a5bac6d1d27..b050559a30d 100644 --- a/packages/amazon-cognito-identity-js/dist/amazon-cognito-identity.js +++ b/packages/amazon-cognito-identity-js/dist/amazon-cognito-identity.js @@ -29,7087 +29,7164 @@ return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; - +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { - +/******/ /******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) +/******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; - +/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} /******/ }; - +/******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - +/******/ /******/ // Flag the module as loaded -/******/ module.loaded = true; - +/******/ module.l = true; +/******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } - - +/******/ +/******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; - +/******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; - +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __webpack_require__.i = function(value) { return value; }; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; - +/******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(0); +/******/ return __webpack_require__(__webpack_require__.s = 19); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { - 'use strict'; - - exports.__esModule = true; - - var _AuthenticationDetails = __webpack_require__(19); +"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__(20) +var ieee754 = __webpack_require__(25) +var isArray = __webpack_require__(26) + +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() - Object.defineProperty(exports, 'AuthenticationDetails', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_AuthenticationDetails).default; - } - }); +/* + * 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. + */ - var _AuthenticationHelper = __webpack_require__(3); +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(exports, __webpack_require__(28))) - Object.defineProperty(exports, 'AuthenticationHelper', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_AuthenticationHelper).default; - } - }); +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { - var _CognitoAccessToken = __webpack_require__(5); +var Buffer = __webpack_require__(0).Buffer; +var intSize = 4; +var zeroBuffer = new Buffer(intSize); zeroBuffer.fill(0); +var chrsz = 8; + +function toArray(buf, bigEndian) { + if ((buf.length % intSize) !== 0) { + var len = buf.length + (intSize - (buf.length % intSize)); + buf = Buffer.concat([buf, zeroBuffer], len); + } + + var arr = []; + var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE; + for (var i = 0; i < buf.length; i += intSize) { + arr.push(fn.call(buf, i)); + } + return arr; +} + +function toBuffer(arr, size, bigEndian) { + var buf = new Buffer(size); + var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE; + for (var i = 0; i < arr.length; i++) { + fn.call(buf, arr[i], i * 4, true); + } + return buf; +} + +function hash(buf, fn, hashSize, bigEndian) { + if (!Buffer.isBuffer(buf)) buf = new Buffer(buf); + var arr = fn(toArray(buf, bigEndian), buf.length * chrsz); + return toBuffer(arr, hashSize, bigEndian); +} + +module.exports = { hash: hash }; - Object.defineProperty(exports, 'CognitoAccessToken', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_CognitoAccessToken).default; - } - }); - var _CognitoIdToken = __webpack_require__(6); +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { - Object.defineProperty(exports, 'CognitoIdToken', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_CognitoIdToken).default; - } - }); +"use strict"; - var _CognitoRefreshToken = __webpack_require__(8); - Object.defineProperty(exports, 'CognitoRefreshToken', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_CognitoRefreshToken).default; - } - }); +exports.__esModule = true; - var _CognitoUser = __webpack_require__(9); +var _buffer = __webpack_require__(0); - Object.defineProperty(exports, 'CognitoUser', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_CognitoUser).default; - } - }); +var _cryptoBrowserify = __webpack_require__(13); - var _CognitoUserAttribute = __webpack_require__(10); +var crypto = _interopRequireWildcard(_cryptoBrowserify); - Object.defineProperty(exports, 'CognitoUserAttribute', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_CognitoUserAttribute).default; - } - }); +var _BigInteger = __webpack_require__(10); - var _CognitoUserPool = __webpack_require__(21); +var _BigInteger2 = _interopRequireDefault(_BigInteger); - Object.defineProperty(exports, 'CognitoUserPool', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_CognitoUserPool).default; - } - }); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _CognitoUserSession = __webpack_require__(11); +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - Object.defineProperty(exports, 'CognitoUserSession', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_CognitoUserSession).default; - } - }); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /*! + * Copyright 2016 Amazon.com, + * Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Amazon Software License (the "License"). + * You may not use this file except in compliance with the + * License. A copy of the License is located at + * + * http://aws.amazon.com/asl/ + * + * or in the "license" file accompanying this file. This file is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, express or implied. See the License + * for the specific language governing permissions and + * limitations under the License. + */ - var _CookieStorage = __webpack_require__(22); +var createHash = crypto.createHash; +var createHmac = crypto.createHmac; +var randomBytes = crypto.randomBytes; - Object.defineProperty(exports, 'CookieStorage', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_CookieStorage).default; - } - }); +var initN = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1' + '29024E088A67CC74020BBEA63B139B22514A08798E3404DD' + 'EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245' + 'E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' + 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D' + 'C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F' + '83655D23DCA3AD961C62F356208552BB9ED529077096966D' + '670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B' + 'E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9' + 'DE2BCBF6955817183995497CEA956AE515D2261898FA0510' + '15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64' + 'ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7' + 'ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B' + 'F12FFA06D98A0864D87602733EC86A64521F2B18177B200C' + 'BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31' + '43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF'; - var _DateHelper = __webpack_require__(12); +var newPasswordRequiredChallengeUserAttributePrefix = 'userAttributes.'; - Object.defineProperty(exports, 'DateHelper', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_DateHelper).default; - } - }); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/** @class */ -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { +var AuthenticationHelper = function () { + /** + * Constructs a new AuthenticationHelper object + * @param {string} PoolName Cognito user pool name. + */ + function AuthenticationHelper(PoolName) { + _classCallCheck(this, AuthenticationHelper); - /* WEBPACK VAR INJECTION */(function(global) {/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ - /* eslint-disable no-proto */ - - 'use strict' - - var base64 = __webpack_require__(15) - var ieee754 = __webpack_require__(16) - var isArray = __webpack_require__(17) - - 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 - } - } + this.N = new _BigInteger2.default(initN, 16); + this.g = new _BigInteger2.default('2', 16); + this.k = new _BigInteger2.default(this.hexHash('00' + this.N.toString(16) + '0' + this.g.toString(16)), 16); - function kMaxLength () { - return Buffer.TYPED_ARRAY_SUPPORT - ? 0x7fffffff - : 0x3fffffff - } + this.smallAValue = this.generateRandomSmallA(); + this.getLargeAValue(function () {}); - 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 - } + this.infoBits = _buffer.Buffer.from('Caldera Derived Key', 'utf8'); - /** - * 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) - } + this.poolName = PoolName; + } - Buffer.poolSize = 8192 // not used by this implementation + /** + * @returns {BigInteger} small A, a random number + */ - // 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') - } + AuthenticationHelper.prototype.getSmallAValue = function getSmallAValue() { + return this.smallAValue; + }; - if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { - return fromArrayBuffer(that, value, encodingOrOffset, length) - } + /** + * @param {nodeCallback} callback Called with (err, largeAValue) + * @returns {void} + */ - if (typeof value === 'string') { - return fromString(that, value, encodingOrOffset) - } - return fromObject(that, value) - } + AuthenticationHelper.prototype.getLargeAValue = function getLargeAValue(callback) { + var _this = this; - /** - * 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 (this.largeAValue) { + callback(null, this.largeAValue); + } else { + this.calculateA(this.smallAValue, function (err, largeAValue) { + if (err) { + callback(err, null); + } - 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 - }) - } - } + _this.largeAValue = largeAValue; + callback(null, _this.largeAValue); + }); + } + }; - 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') - } - } + /** + * helper function to generate a random big integer + * @returns {BigInteger} a random value. + * @private + */ - 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) - } + AuthenticationHelper.prototype.generateRandomSmallA = function generateRandomSmallA() { + var hexRandom = randomBytes(128).toString('hex'); - 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 - } + var randomBigInt = new _BigInteger2.default(hexRandom, 16); + var smallABigInt = randomBigInt.mod(this.N); - /** - * 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) - } + return smallABigInt; + }; - function fromString (that, string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8' - } + /** + * helper function to generate a random string + * @returns {string} a random value. + * @private + */ - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('"encoding" must be a valid string encoding') - } - var length = byteLength(string, encoding) | 0 - that = createBuffer(that, length) + AuthenticationHelper.prototype.generateRandomString = function generateRandomString() { + return randomBytes(40).toString('base64'); + }; - var actual = that.write(string, encoding) + /** + * @returns {string} Generated random value included in password hash. + */ - 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 - } + AuthenticationHelper.prototype.getRandomPassword = function getRandomPassword() { + return this.randomPassword; + }; - 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 - } + /** + * @returns {string} Generated random value included in devices hash. + */ - 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.') - } + AuthenticationHelper.prototype.getSaltDevices = function getSaltDevices() { + return this.SaltToHashDevices; + }; - 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 - } + /** + * @returns {string} Value used to verify devices. + */ - 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) - } + AuthenticationHelper.prototype.getVerifierDevices = function getVerifierDevices() { + return this.verifierDevices; + }; - Buffer.compare = function compare (a, b) { - if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError('Arguments must be Buffers') - } + /** + * Generate salts and compute verifier. + * @param {string} deviceGroupKey Devices to generate verifier for. + * @param {string} username User to generate verifier for. + * @param {nodeCallback} callback Called with (err, null) + * @returns {void} + */ - if (a === b) return 0 - var x = a.length - var y = b.length + AuthenticationHelper.prototype.generateHashDevice = function generateHashDevice(deviceGroupKey, username, callback) { + var _this2 = this; - for (var i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i] - y = b[i] - break - } - } + this.randomPassword = this.generateRandomString(); + var combinedString = '' + deviceGroupKey + username + ':' + this.randomPassword; + var hashedString = this.hash(combinedString); - if (x < y) return -1 - if (y < x) return 1 - return 0 - } + var hexRandom = randomBytes(16).toString('hex'); + this.SaltToHashDevices = this.padHex(new _BigInteger2.default(hexRandom, 16)); - 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 - } - } + this.g.modPow(new _BigInteger2.default(this.hexHash(this.SaltToHashDevices + hashedString), 16), this.N, function (err, verifierDevicesNotPadded) { + if (err) { + callback(err, null); + } - 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 - } + _this2.verifierDevices = _this2.padHex(verifierDevicesNotPadded); + callback(null, null); + }); + }; - 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 - } - } - } + /** + * Calculate the client's public value A = g^a%N + * with the generated random number a + * @param {BigInteger} a Randomly generated small A. + * @param {nodeCallback} callback Called with (err, largeAValue) + * @returns {void} + * @private + */ - // 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 - } + AuthenticationHelper.prototype.calculateA = function calculateA(a, callback) { + var _this3 = this; - 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 - } + this.g.modPow(a, this.N, function (err, A) { + if (err) { + callback(err, null); + } - 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 - } + if (A.mod(_this3.N).equals(_BigInteger2.default.ZERO)) { + callback(new Error('Illegal paramater. A mod N cannot be 0.'), null); + } - 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 - } + callback(null, A); + }); + }; - 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) - } + /** + * Calculate the client's value U which is the hash of A and B + * @param {BigInteger} A Large A value. + * @param {BigInteger} B Server B value. + * @returns {BigInteger} Computed U value. + * @private + */ - 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 '' - } + AuthenticationHelper.prototype.calculateU = function calculateU(A, B) { + this.UHexHash = this.hexHash(this.padHex(A) + this.padHex(B)); + var finalU = new _BigInteger2.default(this.UHexHash, 16); - 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 - } + return finalU; + }; - // 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') - } + /** + * Calculate a hash from a bitArray + * @param {Buffer} buf Value to hash. + * @returns {String} Hex-encoded hash. + * @private + */ + + + AuthenticationHelper.prototype.hash = function hash(buf) { + var hashHex = createHash('sha256').update(buf).digest('hex'); + return new Array(64 - hashHex.length).join('0') + hashHex; + }; + + /** + * Calculate a hash from a hex string + * @param {String} hexStr Value to hash. + * @returns {String} Hex-encoded hash. + * @private + */ + + + AuthenticationHelper.prototype.hexHash = function hexHash(hexStr) { + return this.hash(_buffer.Buffer.from(hexStr, 'hex')); + }; + + /** + * Standard hkdf algorithm + * @param {Buffer} ikm Input key material. + * @param {Buffer} salt Salt value. + * @returns {Buffer} Strong key material. + * @private + */ + + + AuthenticationHelper.prototype.computehkdf = function computehkdf(ikm, salt) { + var prk = createHmac('sha256', salt).update(ikm).digest(); + var infoBitsUpdate = _buffer.Buffer.concat([this.infoBits, _buffer.Buffer.from(String.fromCharCode(1), 'utf8')]); + var hmac = createHmac('sha256', prk).update(infoBitsUpdate).digest(); + return hmac.slice(0, 16); + }; + + /** + * Calculates the final hkdf based on computed S value, and computed U value and the key + * @param {String} username Username. + * @param {String} password Password. + * @param {BigInteger} serverBValue Server B value. + * @param {BigInteger} salt Generated salt. + * @param {nodeCallback} callback Called with (err, hkdfValue) + * @returns {void} + */ + + + AuthenticationHelper.prototype.getPasswordAuthenticationKey = function getPasswordAuthenticationKey(username, password, serverBValue, salt, callback) { + var _this4 = this; + + if (serverBValue.mod(this.N).equals(_BigInteger2.default.ZERO)) { + throw new Error('B cannot be zero.'); + } + + this.UValue = this.calculateU(this.largeAValue, serverBValue); + + if (this.UValue.equals(_BigInteger2.default.ZERO)) { + throw new Error('U cannot be zero.'); + } + + var usernamePassword = '' + this.poolName + username + ':' + password; + var usernamePasswordHash = this.hash(usernamePassword); + + var xValue = new _BigInteger2.default(this.hexHash(this.padHex(salt) + usernamePasswordHash), 16); + this.calculateS(xValue, serverBValue, function (err, sValue) { + if (err) { + callback(err, null); + } + + var hkdf = _this4.computehkdf(_buffer.Buffer.from(_this4.padHex(sValue), 'hex'), _buffer.Buffer.from(_this4.padHex(_this4.UValue.toString(16)), 'hex')); + + callback(null, hkdf); + }); + }; + + /** + * Calculates the S value used in getPasswordAuthenticationKey + * @param {BigInteger} xValue Salted password hash value. + * @param {BigInteger} serverBValue Server B value. + * @param {nodeCallback} callback Called on success or error. + * @returns {void} + */ + + + AuthenticationHelper.prototype.calculateS = function calculateS(xValue, serverBValue, callback) { + var _this5 = this; - 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 - } + this.g.modPow(xValue, this.N, function (err, gModPowXN) { + if (err) { + callback(err, null); + } + + var intValue2 = serverBValue.subtract(_this5.k.multiply(gModPowXN)); + intValue2.modPow(_this5.smallAValue.add(_this5.UValue.multiply(xValue)), _this5.N, function (err2, result) { + if (err2) { + callback(err2, null); + } + + callback(null, result.mod(_this5.N)); + }); + }); + }; + + /** + * Return constant newPasswordRequiredChallengeUserAttributePrefix + * @return {newPasswordRequiredChallengeUserAttributePrefix} constant prefix value + */ + + + AuthenticationHelper.prototype.getNewPasswordRequiredChallengeUserAttributePrefix = function getNewPasswordRequiredChallengeUserAttributePrefix() { + return newPasswordRequiredChallengeUserAttributePrefix; + }; - Buffer.prototype.includes = function includes (val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1 - } + /** + * Converts a BigInteger (or hex string) to hex format padded with zeroes for hashing + * @param {BigInteger|String} bigInt Number or string to pad. + * @returns {String} Padded hex string. + */ + + + AuthenticationHelper.prototype.padHex = function padHex(bigInt) { + var hashStr = bigInt.toString(16); + if (hashStr.length % 2 === 1) { + hashStr = '0' + hashStr; + } else if ('89ABCDEFabcdef'.indexOf(hashStr[0]) !== -1) { + hashStr = '00' + hashStr; + } + return hashStr; + }; + + return AuthenticationHelper; +}(); - Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true) - } +exports.default = AuthenticationHelper; - Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false) - } +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { - 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 - } +"use strict"; - 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) - } +exports.__esModule = true; - function latin1Write (buf, string, offset, length) { - return asciiWrite(buf, string, offset, length) - } +var _CognitoJwtToken2 = __webpack_require__(11); - function base64Write (buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length) - } +var _CognitoJwtToken3 = _interopRequireDefault(_CognitoJwtToken2); - function ucs2Write (buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - 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 - } - } - } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - Buffer.prototype.toJSON = function toJSON () { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - } - } +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - function base64Slice (buf, start, end) { - if (start === 0 && end === buf.length) { - return base64.fromByteArray(buf) - } else { - return base64.fromByteArray(buf.slice(start, end)) - } - } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* + * Copyright 2016 Amazon.com, + * Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Amazon Software License (the "License"). + * You may not use this file except in compliance with the + * License. A copy of the License is located at + * + * http://aws.amazon.com/asl/ + * + * or in the "license" file accompanying this file. This file is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, express or implied. See the License + * for the specific language governing permissions and + * limitations under the License. + */ - 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) - } +/** @class */ +var CognitoAccessToken = function (_CognitoJwtToken) { + _inherits(CognitoAccessToken, _CognitoJwtToken); - // 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 - } + /** + * Constructs a new CognitoAccessToken object + * @param {string=} AccessToken The JWT access token. + */ + function CognitoAccessToken() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + AccessToken = _ref.AccessToken; - function asciiSlice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) + _classCallCheck(this, CognitoAccessToken); - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 0x7F) - } - return ret - } + return _possibleConstructorReturn(this, _CognitoJwtToken.call(this, AccessToken || '')); + } - function latin1Slice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) + return CognitoAccessToken; +}(_CognitoJwtToken3.default); - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]) - } - return ret - } +exports.default = CognitoAccessToken; - function hexSlice (buf, start, end) { - var len = buf.length +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { - if (!start || start < 0) start = 0 - if (!end || end < 0 || end > len) end = len +"use strict"; - 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 - } +exports.__esModule = true; - 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 - } +var _CognitoJwtToken2 = __webpack_require__(11); - /* - * 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') - } +var _CognitoJwtToken3 = _interopRequireDefault(_CognitoJwtToken2); - Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - return val - } +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) { - checkOffset(offset, byteLength, this.length) - } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*! + * Copyright 2016 Amazon.com, + * Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Amazon Software License (the "License"). + * You may not use this file except in compliance with the + * License. A copy of the License is located at + * + * http://aws.amazon.com/asl/ + * + * or in the "license" file accompanying this file. This file is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, express or implied. See the License + * for the specific language governing permissions and + * limitations under the License. + */ - var val = this[offset + --byteLength] - var mul = 1 - while (byteLength > 0 && (mul *= 0x100)) { - val += this[offset + --byteLength] * mul - } +/** @class */ +var CognitoIdToken = function (_CognitoJwtToken) { + _inherits(CognitoIdToken, _CognitoJwtToken); - return val - } + /** + * Constructs a new CognitoIdToken object + * @param {string=} IdToken The JWT Id token + */ + function CognitoIdToken() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + IdToken = _ref.IdToken; - Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length) - return this[offset] - } + _classCallCheck(this, CognitoIdToken); - Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - return this[offset] | (this[offset + 1] << 8) - } + return _possibleConstructorReturn(this, _CognitoJwtToken.call(this, IdToken || '')); + } - Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - return (this[offset] << 8) | this[offset + 1] - } + return CognitoIdToken; +}(_CognitoJwtToken3.default); - Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) +exports.default = CognitoIdToken; - return ((this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - (this[offset + 3] * 0x1000000) - } +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { - Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) +"use strict"; - 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) +exports.__esModule = true; - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } - mul *= 0x80 +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - if (val >= mul) val -= Math.pow(2, 8 * byteLength) +/*! + * Copyright 2016 Amazon.com, + * Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Amazon Software License (the "License"). + * You may not use this file except in compliance with the + * License. A copy of the License is located at + * + * http://aws.amazon.com/asl/ + * + * or in the "license" file accompanying this file. This file is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, express or implied. See the License + * for the specific language governing permissions and + * limitations under the License. + */ - return val - } +/** @class */ +var CognitoRefreshToken = function () { + /** + * Constructs a new CognitoRefreshToken object + * @param {string=} RefreshToken The JWT refresh token. + */ + function CognitoRefreshToken() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + RefreshToken = _ref.RefreshToken; - Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) + _classCallCheck(this, CognitoRefreshToken); - var i = byteLength - var mul = 1 - var val = this[offset + --i] - while (i > 0 && (mul *= 0x100)) { - val += this[offset + --i] * mul - } - mul *= 0x80 + // Assign object + this.token = RefreshToken || ''; + } - if (val >= mul) val -= Math.pow(2, 8 * byteLength) + /** + * @returns {string} the record's token. + */ - 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) - } + CognitoRefreshToken.prototype.getToken = function getToken() { + return this.token; + }; - 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 - } + return CognitoRefreshToken; +}(); - 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 - } +exports.default = CognitoRefreshToken; - Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { - return (this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) - } +"use strict"; - 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]) - } +exports.__esModule = true; - Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, true, 23, 4) - } +var _buffer = __webpack_require__(0); - Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, false, 23, 4) - } +var _cryptoBrowserify = __webpack_require__(13); - Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, true, 52, 8) - } +var crypto = _interopRequireWildcard(_cryptoBrowserify); - Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, false, 52, 8) - } +var _BigInteger = __webpack_require__(10); - 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') - } +var _BigInteger2 = _interopRequireDefault(_BigInteger); - 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 - } +var _AuthenticationHelper = __webpack_require__(2); - 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 - } +var _AuthenticationHelper2 = _interopRequireDefault(_AuthenticationHelper); - 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 - } +var _CognitoAccessToken = __webpack_require__(3); - 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 - } - } +var _CognitoAccessToken2 = _interopRequireDefault(_CognitoAccessToken); - 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 - } +var _CognitoIdToken = __webpack_require__(4); - 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 - } +var _CognitoIdToken2 = _interopRequireDefault(_CognitoIdToken); - 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 - } - } +var _CognitoRefreshToken = __webpack_require__(5); - 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 - } +var _CognitoRefreshToken2 = _interopRequireDefault(_CognitoRefreshToken); - 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 - } +var _CognitoUserSession = __webpack_require__(8); - 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 - } +var _CognitoUserSession2 = _interopRequireDefault(_CognitoUserSession); - 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 - } +var _DateHelper = __webpack_require__(9); - 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 - } +var _DateHelper2 = _interopRequireDefault(_DateHelper); - 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 - } +var _CognitoUserAttribute = __webpack_require__(7); - 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 - } +var _CognitoUserAttribute2 = _interopRequireDefault(_CognitoUserAttribute); - 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 - } +var _StorageHelper = __webpack_require__(12); - 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 - } +var _StorageHelper2 = _interopRequireDefault(_StorageHelper); - 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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - 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 - } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert) - } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /*! + * Copyright 2016 Amazon.com, + * Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Amazon Software License (the "License"). + * You may not use this file except in compliance with the + * License. A copy of the License is located at + * + * http://aws.amazon.com/asl/ + * + * or in the "license" file accompanying this file. This file is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, express or implied. See the License + * for the specific language governing permissions and + * limitations under the License. + */ - Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert) - } +//import createHmac from 'create-hmac'; - 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) - } +var createHmac = crypto.createHmac; - Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert) - } +/** + * @callback nodeCallback + * @template T result + * @param {*} err The operation failure reason, or null. + * @param {T} result The operation result. + */ - // 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 - } +/** + * @callback onFailure + * @param {*} err Failure reason. + */ - // 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 - } +/** + * @callback onSuccess + * @template T result + * @param {T} result The operation result. + */ - // 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 - } +/** + * @callback mfaRequired + * @param {*} details MFA challenge details. + */ - function stringtrim (str) { - if (str.trim) return str.trim() - return str.replace(/^\s+|\s+$/g, '') - } +/** + * @callback customChallenge + * @param {*} details Custom challenge details. + */ - function toHex (n) { - if (n < 16) return '0' + n.toString(16) - return n.toString(16) - } +/** + * @callback inputVerificationCode + * @param {*} data Server response. + */ - 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 - } +/** + * @callback authSuccess + * @param {CognitoUserSession} session The new session. + * @param {bool=} userConfirmationNecessary User must be confirmed. + */ - 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 - } +/** @class */ +var CognitoUser = function () { + /** + * Constructs a new CognitoUser object + * @param {object} data Creation options + * @param {string} data.Username The user's username. + * @param {CognitoUserPool} data.Pool Pool containing the user. + * @param {object} data.Storage Optional storage object. + */ + function CognitoUser(data) { + _classCallCheck(this, CognitoUser); + + if (data == null || data.Username == null || data.Pool == null) { + throw new Error('Username and pool information are required.'); + } + + this.username = data.Username || ''; + this.pool = data.Pool; + this.Session = null; + + this.client = data.Pool.client; + + this.signInUserSession = null; + this.authenticationFlowType = 'USER_SRP_AUTH'; + + this.storage = data.Storage || new _StorageHelper2.default().getStorage(); + } + + /** + * Sets the session for this user + * @param {CognitoUserSession} signInUserSession the session + * @returns {void} + */ + + + CognitoUser.prototype.setSignInUserSession = function setSignInUserSession(signInUserSession) { + this.clearCachedTokens(); + this.signInUserSession = signInUserSession; + this.cacheTokens(); + }; + + /** + * @returns {CognitoUserSession} the current session for this user + */ + + + CognitoUser.prototype.getSignInUserSession = function getSignInUserSession() { + return this.signInUserSession; + }; + + /** + * @returns {string} the user's username + */ + + + CognitoUser.prototype.getUsername = function getUsername() { + return this.username; + }; + + /** + * @returns {String} the authentication flow type + */ + + + CognitoUser.prototype.getAuthenticationFlowType = function getAuthenticationFlowType() { + return this.authenticationFlowType; + }; + + /** + * sets authentication flow type + * @param {string} authenticationFlowType New value. + * @returns {void} + */ + + + CognitoUser.prototype.setAuthenticationFlowType = function setAuthenticationFlowType(authenticationFlowType) { + this.authenticationFlowType = authenticationFlowType; + }; + + /** + * This is used for authenticating the user through the custom authentication flow. + * @param {AuthenticationDetails} authDetails Contains the authentication data + * @param {object} callback Result callback map. + * @param {onFailure} callback.onFailure Called on any error. + * @param {customChallenge} callback.customChallenge Custom challenge + * response required to continue. + * @param {authSuccess} callback.onSuccess Called on success with the new session. + * @returns {void} + */ + + + CognitoUser.prototype.initiateAuth = function initiateAuth(authDetails, callback) { + var _this = this; + + var authParameters = authDetails.getAuthParameters(); + authParameters.USERNAME = this.username; + + var jsonReq = { + AuthFlow: 'CUSTOM_AUTH', + ClientId: this.pool.getClientId(), + AuthParameters: authParameters, + ClientMetadata: authDetails.getValidationData() + }; + if (this.getUserContextData()) { + jsonReq.UserContextData = this.getUserContextData(); + } + + this.client.request('InitiateAuth', jsonReq, function (err, data) { + if (err) { + return callback.onFailure(err); + } + var challengeName = data.ChallengeName; + var challengeParameters = data.ChallengeParameters; + + if (challengeName === 'CUSTOM_CHALLENGE') { + _this.Session = data.Session; + return callback.customChallenge(challengeParameters); + } + _this.signInUserSession = _this.getCognitoUserSession(data.AuthenticationResult); + _this.cacheTokens(); + return callback.onSuccess(_this.signInUserSession); + }); + }; + + /** + * This is used for authenticating the user. + * stuff + * @param {AuthenticationDetails} authDetails Contains the authentication data + * @param {object} callback Result callback map. + * @param {onFailure} callback.onFailure Called on any error. + * @param {newPasswordRequired} callback.newPasswordRequired new + * password and any required attributes are required to continue + * @param {mfaRequired} callback.mfaRequired MFA code + * required to continue. + * @param {customChallenge} callback.customChallenge Custom challenge + * response required to continue. + * @param {authSuccess} callback.onSuccess Called on success with the new session. + * @returns {void} + */ + + + CognitoUser.prototype.authenticateUser = function authenticateUser(authDetails, callback) { + if (this.authenticationFlowType === 'USER_PASSWORD_AUTH') { + return this.authenticateUserPlainUsernamePassword(authDetails, callback); + } else if (this.authenticationFlowType === 'USER_SRP_AUTH') { + return this.authenticateUserDefaultAuth(authDetails, callback); + } + return callback.onFailure(new Error('Authentication flow type is invalid.')); + }; + + /** + * This is used for authenticating the user. it calls the AuthenticationHelper for SRP related + * stuff + * @param {AuthenticationDetails} authDetails Contains the authentication data + * @param {object} callback Result callback map. + * @param {onFailure} callback.onFailure Called on any error. + * @param {newPasswordRequired} callback.newPasswordRequired new + * password and any required attributes are required to continue + * @param {mfaRequired} callback.mfaRequired MFA code + * required to continue. + * @param {customChallenge} callback.customChallenge Custom challenge + * response required to continue. + * @param {authSuccess} callback.onSuccess Called on success with the new session. + * @returns {void} + */ + + + CognitoUser.prototype.authenticateUserDefaultAuth = function authenticateUserDefaultAuth(authDetails, callback) { + var _this2 = this; + + var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]); + var dateHelper = new _DateHelper2.default(); + + var serverBValue = void 0; + var salt = void 0; + var authParameters = {}; + + if (this.deviceKey != null) { + authParameters.DEVICE_KEY = this.deviceKey; + } + + authParameters.USERNAME = this.username; + authenticationHelper.getLargeAValue(function (errOnAValue, aValue) { + // getLargeAValue callback start + if (errOnAValue) { + callback.onFailure(errOnAValue); + } + + authParameters.SRP_A = aValue.toString(16); + + if (_this2.authenticationFlowType === 'CUSTOM_AUTH') { + authParameters.CHALLENGE_NAME = 'SRP_A'; + } + + var jsonReq = { + AuthFlow: _this2.authenticationFlowType, + ClientId: _this2.pool.getClientId(), + AuthParameters: authParameters, + ClientMetadata: authDetails.getValidationData() + }; + if (_this2.getUserContextData(_this2.username)) { + jsonReq.UserContextData = _this2.getUserContextData(_this2.username); + } + + _this2.client.request('InitiateAuth', jsonReq, function (err, data) { + if (err) { + return callback.onFailure(err); + } + + var challengeParameters = data.ChallengeParameters; + + _this2.username = challengeParameters.USER_ID_FOR_SRP; + serverBValue = new _BigInteger2.default(challengeParameters.SRP_B, 16); + salt = new _BigInteger2.default(challengeParameters.SALT, 16); + _this2.getCachedDeviceKeyAndPassword(); + + authenticationHelper.getPasswordAuthenticationKey(_this2.username, authDetails.getPassword(), serverBValue, salt, function (errOnHkdf, hkdf) { + // getPasswordAuthenticationKey callback start + if (errOnHkdf) { + callback.onFailure(errOnHkdf); + } + + var dateNow = dateHelper.getNowString(); + + var signatureString = createHmac('sha256', hkdf).update(_buffer.Buffer.concat([_buffer.Buffer.from(_this2.pool.getUserPoolId().split('_')[1], 'utf8'), _buffer.Buffer.from(_this2.username, 'utf8'), _buffer.Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'), _buffer.Buffer.from(dateNow, 'utf8')])).digest('base64'); + + var challengeResponses = {}; + + challengeResponses.USERNAME = _this2.username; + challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK; + challengeResponses.TIMESTAMP = dateNow; + challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString; + + if (_this2.deviceKey != null) { + challengeResponses.DEVICE_KEY = _this2.deviceKey; + } + + var respondToAuthChallenge = function respondToAuthChallenge(challenge, challengeCallback) { + return _this2.client.request('RespondToAuthChallenge', challenge, function (errChallenge, dataChallenge) { + if (errChallenge && errChallenge.code === 'ResourceNotFoundException' && errChallenge.message.toLowerCase().indexOf('device') !== -1) { + challengeResponses.DEVICE_KEY = null; + _this2.deviceKey = null; + _this2.randomPassword = null; + _this2.deviceGroupKey = null; + _this2.clearCachedDeviceKeyAndPassword(); + return respondToAuthChallenge(challenge, challengeCallback); + } + return challengeCallback(errChallenge, dataChallenge); + }); + }; + + var jsonReqResp = { + ChallengeName: 'PASSWORD_VERIFIER', + ClientId: _this2.pool.getClientId(), + ChallengeResponses: challengeResponses, + Session: data.Session + }; + if (_this2.getUserContextData()) { + jsonReqResp.UserContextData = _this2.getUserContextData(); + } + respondToAuthChallenge(jsonReqResp, function (errAuthenticate, dataAuthenticate) { + if (errAuthenticate) { + return callback.onFailure(errAuthenticate); + } + + var challengeName = dataAuthenticate.ChallengeName; + if (challengeName === 'NEW_PASSWORD_REQUIRED') { + _this2.Session = dataAuthenticate.Session; + var userAttributes = null; + var rawRequiredAttributes = null; + var requiredAttributes = []; + var userAttributesPrefix = authenticationHelper.getNewPasswordRequiredChallengeUserAttributePrefix(); + + if (dataAuthenticate.ChallengeParameters) { + userAttributes = JSON.parse(dataAuthenticate.ChallengeParameters.userAttributes); + rawRequiredAttributes = JSON.parse(dataAuthenticate.ChallengeParameters.requiredAttributes); + } + + if (rawRequiredAttributes) { + for (var i = 0; i < rawRequiredAttributes.length; i++) { + requiredAttributes[i] = rawRequiredAttributes[i].substr(userAttributesPrefix.length); + } + } + return callback.newPasswordRequired(userAttributes, requiredAttributes); + } + return _this2.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback); + }); + return undefined; + // getPasswordAuthenticationKey callback end + }); + return undefined; + }); + // getLargeAValue callback end + }); + }; + + /** + * PRIVATE ONLY: This is an internal only method and should not + * be directly called by the consumers. + * @param {AuthenticationDetails} authDetails Contains the authentication data. + * @param {object} callback Result callback map. + * @param {onFailure} callback.onFailure Called on any error. + * @param {mfaRequired} callback.mfaRequired MFA code + * required to continue. + * @param {authSuccess} callback.onSuccess Called on success with the new session. + * @returns {void} + */ + + + CognitoUser.prototype.authenticateUserPlainUsernamePassword = function authenticateUserPlainUsernamePassword(authDetails, callback) { + var _this3 = this; + + var authParameters = {}; + authParameters.USERNAME = this.username; + authParameters.PASSWORD = authDetails.getPassword(); + if (!authParameters.PASSWORD) { + callback.onFailure(new Error('PASSWORD parameter is required')); + return; + } + var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]); + this.getCachedDeviceKeyAndPassword(); + if (this.deviceKey != null) { + authParameters.DEVICE_KEY = this.deviceKey; + } + + var jsonReq = { + AuthFlow: 'USER_PASSWORD_AUTH', + ClientId: this.pool.getClientId(), + AuthParameters: authParameters, + ClientMetadata: authDetails.getValidationData() + }; + if (this.getUserContextData(this.username)) { + jsonReq.UserContextData = this.getUserContextData(this.username); + } + // USER_PASSWORD_AUTH happens in a single round-trip: client sends userName and password, + // Cognito UserPools verifies password and returns tokens. + this.client.request('InitiateAuth', jsonReq, function (err, authResult) { + if (err) { + return callback.onFailure(err); + } + return _this3.authenticateUserInternal(authResult, authenticationHelper, callback); + }); + }; + + /** + * PRIVATE ONLY: This is an internal only method and should not + * be directly called by the consumers. + * @param {object} dataAuthenticate authentication data + * @param {object} authenticationHelper helper created + * @param {callback} callback passed on from caller + * @returns {void} + */ + + + CognitoUser.prototype.authenticateUserInternal = function authenticateUserInternal(dataAuthenticate, authenticationHelper, callback) { + var _this4 = this; + + var challengeName = dataAuthenticate.ChallengeName; + var challengeParameters = dataAuthenticate.ChallengeParameters; + + if (challengeName === 'SMS_MFA') { + this.Session = dataAuthenticate.Session; + return callback.mfaRequired(challengeName, challengeParameters); + } + + if (challengeName === 'SELECT_MFA_TYPE') { + this.Session = dataAuthenticate.Session; + return callback.selectMFAType(challengeName, challengeParameters); + } + + if (challengeName === 'MFA_SETUP') { + this.Session = dataAuthenticate.Session; + return callback.mfaSetup(challengeName, challengeParameters); + } + + if (challengeName === 'SOFTWARE_TOKEN_MFA') { + this.Session = dataAuthenticate.Session; + return callback.totpRequired(challengeName, challengeParameters); + } + + if (challengeName === 'CUSTOM_CHALLENGE') { + this.Session = dataAuthenticate.Session; + return callback.customChallenge(challengeParameters); + } + + if (challengeName === 'DEVICE_SRP_AUTH') { + this.getDeviceResponse(callback); + return undefined; + } + + this.signInUserSession = this.getCognitoUserSession(dataAuthenticate.AuthenticationResult); + this.cacheTokens(); + + var newDeviceMetadata = dataAuthenticate.AuthenticationResult.NewDeviceMetadata; + if (newDeviceMetadata == null) { + return callback.onSuccess(this.signInUserSession); + } + + authenticationHelper.generateHashDevice(dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, function (errGenHash) { + if (errGenHash) { + return callback.onFailure(errGenHash); + } + + var deviceSecretVerifierConfig = { + Salt: _buffer.Buffer.from(authenticationHelper.getSaltDevices(), 'hex').toString('base64'), + PasswordVerifier: _buffer.Buffer.from(authenticationHelper.getVerifierDevices(), 'hex').toString('base64') + }; + + _this4.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier; + _this4.deviceGroupKey = newDeviceMetadata.DeviceGroupKey; + _this4.randomPassword = authenticationHelper.getRandomPassword(); + + _this4.client.request('ConfirmDevice', { + DeviceKey: newDeviceMetadata.DeviceKey, + AccessToken: _this4.signInUserSession.getAccessToken().getJwtToken(), + DeviceSecretVerifierConfig: deviceSecretVerifierConfig, + DeviceName: navigator.userAgent + }, function (errConfirm, dataConfirm) { + if (errConfirm) { + return callback.onFailure(errConfirm); + } + + _this4.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey; + _this4.cacheDeviceKeyAndPassword(); + if (dataConfirm.UserConfirmationNecessary === true) { + return callback.onSuccess(_this4.signInUserSession, dataConfirm.UserConfirmationNecessary); + } + return callback.onSuccess(_this4.signInUserSession); + }); + return undefined; + }); + return undefined; + }; + + /** + * This method is user to complete the NEW_PASSWORD_REQUIRED challenge. + * Pass the new password with any new user attributes to be updated. + * User attribute keys must be of format userAttributes.. + * @param {string} newPassword new password for this user + * @param {object} requiredAttributeData map with values for all required attributes + * @param {object} callback Result callback map. + * @param {onFailure} callback.onFailure Called on any error. + * @param {mfaRequired} callback.mfaRequired MFA code required to continue. + * @param {customChallenge} callback.customChallenge Custom challenge + * response required to continue. + * @param {authSuccess} callback.onSuccess Called on success with the new session. + * @returns {void} + */ + + + CognitoUser.prototype.completeNewPasswordChallenge = function completeNewPasswordChallenge(newPassword, requiredAttributeData, callback) { + var _this5 = this; + + if (!newPassword) { + return callback.onFailure(new Error('New password is required.')); + } + var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]); + var userAttributesPrefix = authenticationHelper.getNewPasswordRequiredChallengeUserAttributePrefix(); + + var finalUserAttributes = {}; + if (requiredAttributeData) { + Object.keys(requiredAttributeData).forEach(function (key) { + finalUserAttributes[userAttributesPrefix + key] = requiredAttributeData[key]; + }); + } + + finalUserAttributes.NEW_PASSWORD = newPassword; + finalUserAttributes.USERNAME = this.username; + var jsonReq = { + ChallengeName: 'NEW_PASSWORD_REQUIRED', + ClientId: this.pool.getClientId(), + ChallengeResponses: finalUserAttributes, + Session: this.Session + }; + if (this.getUserContextData()) { + jsonReq.UserContextData = this.getUserContextData(); + } + + this.client.request('RespondToAuthChallenge', jsonReq, function (errAuthenticate, dataAuthenticate) { + if (errAuthenticate) { + return callback.onFailure(errAuthenticate); + } + return _this5.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback); + }); + return undefined; + }; + + /** + * This is used to get a session using device authentication. It is called at the end of user + * authentication + * + * @param {object} callback Result callback map. + * @param {onFailure} callback.onFailure Called on any error. + * @param {authSuccess} callback.onSuccess Called on success with the new session. + * @returns {void} + * @private + */ + + + CognitoUser.prototype.getDeviceResponse = function getDeviceResponse(callback) { + var _this6 = this; + + var authenticationHelper = new _AuthenticationHelper2.default(this.deviceGroupKey); + var dateHelper = new _DateHelper2.default(); + + var authParameters = {}; + + authParameters.USERNAME = this.username; + authParameters.DEVICE_KEY = this.deviceKey; + authenticationHelper.getLargeAValue(function (errAValue, aValue) { + // getLargeAValue callback start + if (errAValue) { + callback.onFailure(errAValue); + } + + authParameters.SRP_A = aValue.toString(16); + + var jsonReq = { + ChallengeName: 'DEVICE_SRP_AUTH', + ClientId: _this6.pool.getClientId(), + ChallengeResponses: authParameters + }; + if (_this6.getUserContextData()) { + jsonReq.UserContextData = _this6.getUserContextData(); + } + _this6.client.request('RespondToAuthChallenge', jsonReq, function (err, data) { + if (err) { + return callback.onFailure(err); + } + + var challengeParameters = data.ChallengeParameters; + + var serverBValue = new _BigInteger2.default(challengeParameters.SRP_B, 16); + var salt = new _BigInteger2.default(challengeParameters.SALT, 16); + + authenticationHelper.getPasswordAuthenticationKey(_this6.deviceKey, _this6.randomPassword, serverBValue, salt, function (errHkdf, hkdf) { + // getPasswordAuthenticationKey callback start + if (errHkdf) { + return callback.onFailure(errHkdf); + } + + var dateNow = dateHelper.getNowString(); + + var signatureString = createHmac('sha256', hkdf).update(_buffer.Buffer.concat([_buffer.Buffer.from(_this6.deviceGroupKey, 'utf8'), _buffer.Buffer.from(_this6.deviceKey, 'utf8'), _buffer.Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'), _buffer.Buffer.from(dateNow, 'utf8')])).digest('base64'); + + var challengeResponses = {}; + + challengeResponses.USERNAME = _this6.username; + challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK; + challengeResponses.TIMESTAMP = dateNow; + challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString; + challengeResponses.DEVICE_KEY = _this6.deviceKey; + + var jsonReqResp = { + ChallengeName: 'DEVICE_PASSWORD_VERIFIER', + ClientId: _this6.pool.getClientId(), + ChallengeResponses: challengeResponses, + Session: data.Session + }; + if (_this6.getUserContextData()) { + jsonReqResp.UserContextData = _this6.getUserContextData(); + } + + _this6.client.request('RespondToAuthChallenge', jsonReqResp, function (errAuthenticate, dataAuthenticate) { + if (errAuthenticate) { + return callback.onFailure(errAuthenticate); + } + + _this6.signInUserSession = _this6.getCognitoUserSession(dataAuthenticate.AuthenticationResult); + _this6.cacheTokens(); + + return callback.onSuccess(_this6.signInUserSession); + }); + return undefined; + // getPasswordAuthenticationKey callback end + }); + return undefined; + }); + // getLargeAValue callback end + }); + }; + + /** + * This is used for a certain user to confirm the registration by using a confirmation code + * @param {string} confirmationCode Code entered by user. + * @param {bool} forceAliasCreation Allow migrating from an existing email / phone number. + * @param {nodeCallback} callback Called on success or error. + * @returns {void} + */ + + + CognitoUser.prototype.confirmRegistration = function confirmRegistration(confirmationCode, forceAliasCreation, callback) { + var jsonReq = { + ClientId: this.pool.getClientId(), + ConfirmationCode: confirmationCode, + Username: this.username, + ForceAliasCreation: forceAliasCreation + }; + if (this.getUserContextData()) { + jsonReq.UserContextData = this.getUserContextData(); + } + this.client.request('ConfirmSignUp', jsonReq, function (err) { + if (err) { + return callback(err, null); + } + return callback(null, 'SUCCESS'); + }); + }; + + /** + * This is used by the user once he has the responses to a custom challenge + * @param {string} answerChallenge The custom challange answer. + * @param {object} callback Result callback map. + * @param {onFailure} callback.onFailure Called on any error. + * @param {customChallenge} callback.customChallenge + * Custom challenge response required to continue. + * @param {authSuccess} callback.onSuccess Called on success with the new session. + * @returns {void} + */ + + + CognitoUser.prototype.sendCustomChallengeAnswer = function sendCustomChallengeAnswer(answerChallenge, callback) { + var _this7 = this; + + var challengeResponses = {}; + challengeResponses.USERNAME = this.username; + challengeResponses.ANSWER = answerChallenge; + + var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]); + this.getCachedDeviceKeyAndPassword(); + if (this.deviceKey != null) { + challengeResponses.DEVICE_KEY = this.deviceKey; + } + + var jsonReq = { + ChallengeName: 'CUSTOM_CHALLENGE', + ChallengeResponses: challengeResponses, + ClientId: this.pool.getClientId(), + Session: this.Session + }; + if (this.getUserContextData()) { + jsonReq.UserContextData = this.getUserContextData(); + } + this.client.request('RespondToAuthChallenge', jsonReq, function (err, data) { + if (err) { + return callback.onFailure(err); + } + + return _this7.authenticateUserInternal(data, authenticationHelper, callback); + }); + }; + + /** + * This is used by the user once he has an MFA code + * @param {string} confirmationCode The MFA code entered by the user. + * @param {object} callback Result callback map. + * @param {string} mfaType The mfa we are replying to. + * @param {onFailure} callback.onFailure Called on any error. + * @param {authSuccess} callback.onSuccess Called on success with the new session. + * @returns {void} + */ + + + CognitoUser.prototype.sendMFACode = function sendMFACode(confirmationCode, callback, mfaType) { + var _this8 = this; + + var challengeResponses = {}; + challengeResponses.USERNAME = this.username; + challengeResponses.SMS_MFA_CODE = confirmationCode; + var mfaTypeSelection = mfaType || 'SMS_MFA'; + if (mfaTypeSelection === 'SOFTWARE_TOKEN_MFA') { + challengeResponses.SOFTWARE_TOKEN_MFA_CODE = confirmationCode; + } + + if (this.deviceKey != null) { + challengeResponses.DEVICE_KEY = this.deviceKey; + } + + var jsonReq = { + ChallengeName: mfaTypeSelection, + ChallengeResponses: challengeResponses, + ClientId: this.pool.getClientId(), + Session: this.Session + }; + if (this.getUserContextData()) { + jsonReq.UserContextData = this.getUserContextData(); + } + + this.client.request('RespondToAuthChallenge', jsonReq, function (err, dataAuthenticate) { + if (err) { + return callback.onFailure(err); + } + + var challengeName = dataAuthenticate.ChallengeName; + + if (challengeName === 'DEVICE_SRP_AUTH') { + _this8.getDeviceResponse(callback); + return undefined; + } + + _this8.signInUserSession = _this8.getCognitoUserSession(dataAuthenticate.AuthenticationResult); + _this8.cacheTokens(); + + if (dataAuthenticate.AuthenticationResult.NewDeviceMetadata == null) { + return callback.onSuccess(_this8.signInUserSession); + } + + var authenticationHelper = new _AuthenticationHelper2.default(_this8.pool.getUserPoolId().split('_')[1]); + authenticationHelper.generateHashDevice(dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, function (errGenHash) { + if (errGenHash) { + return callback.onFailure(errGenHash); + } + + var deviceSecretVerifierConfig = { + Salt: _buffer.Buffer.from(authenticationHelper.getSaltDevices(), 'hex').toString('base64'), + PasswordVerifier: _buffer.Buffer.from(authenticationHelper.getVerifierDevices(), 'hex').toString('base64') + }; + + _this8.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier; + _this8.deviceGroupKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey; + _this8.randomPassword = authenticationHelper.getRandomPassword(); + + _this8.client.request('ConfirmDevice', { + DeviceKey: dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, + AccessToken: _this8.signInUserSession.getAccessToken().getJwtToken(), + DeviceSecretVerifierConfig: deviceSecretVerifierConfig, + DeviceName: navigator.userAgent + }, function (errConfirm, dataConfirm) { + if (errConfirm) { + return callback.onFailure(errConfirm); + } + + _this8.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey; + _this8.cacheDeviceKeyAndPassword(); + if (dataConfirm.UserConfirmationNecessary === true) { + return callback.onSuccess(_this8.signInUserSession, dataConfirm.UserConfirmationNecessary); + } + return callback.onSuccess(_this8.signInUserSession); + }); + return undefined; + }); + return undefined; + }); + }; + + /** + * This is used by an authenticated user to change the current password + * @param {string} oldUserPassword The current password. + * @param {string} newUserPassword The requested new password. + * @param {nodeCallback} callback Called on success or error. + * @returns {void} + */ + + + CognitoUser.prototype.changePassword = function changePassword(oldUserPassword, newUserPassword, callback) { + if (!(this.signInUserSession != null && this.signInUserSession.isValid())) { + return callback(new Error('User is not authenticated'), null); + } + + this.client.request('ChangePassword', { + PreviousPassword: oldUserPassword, + ProposedPassword: newUserPassword, + AccessToken: this.signInUserSession.getAccessToken().getJwtToken() + }, function (err) { + if (err) { + return callback(err, null); + } + return callback(null, 'SUCCESS'); + }); + return undefined; + }; + + /** + * This is used by an authenticated user to enable MFA for himself + * @param {nodeCallback} callback Called on success or error. + * @returns {void} + */ + + + CognitoUser.prototype.enableMFA = function enableMFA(callback) { + if (this.signInUserSession == null || !this.signInUserSession.isValid()) { + return callback(new Error('User is not authenticated'), null); + } + + var mfaOptions = []; + var mfaEnabled = { + DeliveryMedium: 'SMS', + AttributeName: 'phone_number' + }; + mfaOptions.push(mfaEnabled); + + this.client.request('SetUserSettings', { + MFAOptions: mfaOptions, + AccessToken: this.signInUserSession.getAccessToken().getJwtToken() + }, function (err) { + if (err) { + return callback(err, null); + } + return callback(null, 'SUCCESS'); + }); + return undefined; + }; + + /** + * This is used by an authenticated user to enable MFA for himself + * @param {string[]} smsMfaSettings the sms mfa settings + * @param {string[]} softwareTokenMfaSettings the software token mfa settings + * @param {nodeCallback} callback Called on success or error. + * @returns {void} + */ + + + CognitoUser.prototype.setUserMfaPreference = function setUserMfaPreference(smsMfaSettings, softwareTokenMfaSettings, callback) { + if (this.signInUserSession == null || !this.signInUserSession.isValid()) { + return callback(new Error('User is not authenticated'), null); + } + + this.client.request('SetUserMFAPreference', { + SMSMfaSettings: smsMfaSettings, + SoftwareTokenMfaSettings: softwareTokenMfaSettings, + AccessToken: this.signInUserSession.getAccessToken().getJwtToken() + }, function (err) { + if (err) { + return callback(err, null); + } + return callback(null, 'SUCCESS'); + }); + return undefined; + }; + + /** + * This is used by an authenticated user to disable MFA for himself + * @param {nodeCallback} callback Called on success or error. + * @returns {void} + */ + + + CognitoUser.prototype.disableMFA = function disableMFA(callback) { + if (this.signInUserSession == null || !this.signInUserSession.isValid()) { + return callback(new Error('User is not authenticated'), null); + } + + var mfaOptions = []; + + this.client.request('SetUserSettings', { + MFAOptions: mfaOptions, + AccessToken: this.signInUserSession.getAccessToken().getJwtToken() + }, function (err) { + if (err) { + return callback(err, null); + } + return callback(null, 'SUCCESS'); + }); + return undefined; + }; + + /** + * This is used by an authenticated user to delete himself + * @param {nodeCallback} callback Called on success or error. + * @returns {void} + */ + + + CognitoUser.prototype.deleteUser = function deleteUser(callback) { + var _this9 = this; + + if (this.signInUserSession == null || !this.signInUserSession.isValid()) { + return callback(new Error('User is not authenticated'), null); + } + + this.client.request('DeleteUser', { + AccessToken: this.signInUserSession.getAccessToken().getJwtToken() + }, function (err) { + if (err) { + return callback(err, null); + } + _this9.clearCachedTokens(); + return callback(null, 'SUCCESS'); + }); + return undefined; + }; + + /** + * @typedef {CognitoUserAttribute | { Name:string, Value:string }} AttributeArg + */ + /** + * This is used by an authenticated user to change a list of attributes + * @param {AttributeArg[]} attributes A list of the new user attributes. + * @param {nodeCallback} callback Called on success or error. + * @returns {void} + */ + + + CognitoUser.prototype.updateAttributes = function updateAttributes(attributes, callback) { + if (this.signInUserSession == null || !this.signInUserSession.isValid()) { + return callback(new Error('User is not authenticated'), null); + } + + this.client.request('UpdateUserAttributes', { + AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), + UserAttributes: attributes + }, function (err) { + if (err) { + return callback(err, null); + } + return callback(null, 'SUCCESS'); + }); + return undefined; + }; + + /** + * This is used by an authenticated user to get a list of attributes + * @param {nodeCallback} callback Called on success or error. + * @returns {void} + */ + + + CognitoUser.prototype.getUserAttributes = function getUserAttributes(callback) { + if (!(this.signInUserSession != null && this.signInUserSession.isValid())) { + return callback(new Error('User is not authenticated'), null); + } + + this.client.request('GetUser', { + AccessToken: this.signInUserSession.getAccessToken().getJwtToken() + }, function (err, userData) { + if (err) { + return callback(err, null); + } + + var attributeList = []; + + for (var i = 0; i < userData.UserAttributes.length; i++) { + var attribute = { + Name: userData.UserAttributes[i].Name, + Value: userData.UserAttributes[i].Value + }; + var userAttribute = new _CognitoUserAttribute2.default(attribute); + attributeList.push(userAttribute); + } + + return callback(null, attributeList); + }); + return undefined; + }; + + /** + * This is used by an authenticated user to get the MFAOptions + * @param {nodeCallback} callback Called on success or error. + * @returns {void} + */ + + + CognitoUser.prototype.getMFAOptions = function getMFAOptions(callback) { + if (!(this.signInUserSession != null && this.signInUserSession.isValid())) { + return callback(new Error('User is not authenticated'), null); + } + + this.client.request('GetUser', { + AccessToken: this.signInUserSession.getAccessToken().getJwtToken() + }, function (err, userData) { + if (err) { + return callback(err, null); + } + + return callback(null, userData.MFAOptions); + }); + return undefined; + }; + + /** + * This is used by an authenticated user to delete a list of attributes + * @param {string[]} attributeList Names of the attributes to delete. + * @param {nodeCallback} callback Called on success or error. + * @returns {void} + */ + + + CognitoUser.prototype.deleteAttributes = function deleteAttributes(attributeList, callback) { + if (!(this.signInUserSession != null && this.signInUserSession.isValid())) { + return callback(new Error('User is not authenticated'), null); + } + + this.client.request('DeleteUserAttributes', { + UserAttributeNames: attributeList, + AccessToken: this.signInUserSession.getAccessToken().getJwtToken() + }, function (err) { + if (err) { + return callback(err, null); + } + return callback(null, 'SUCCESS'); + }); + return undefined; + }; + + /** + * This is used by a user to resend a confirmation code + * @param {nodeCallback} callback Called on success or error. + * @returns {void} + */ + + + CognitoUser.prototype.resendConfirmationCode = function resendConfirmationCode(callback) { + var jsonReq = { + ClientId: this.pool.getClientId(), + Username: this.username + }; + + this.client.request('ResendConfirmationCode', jsonReq, function (err, result) { + if (err) { + return callback(err, null); + } + return callback(null, result); + }); + }; + + /** + * This is used to get a session, either from the session object + * or from the local storage, or by using a refresh token + * + * @param {nodeCallback} callback Called on success or error. + * @returns {void} + */ + + + CognitoUser.prototype.getSession = function getSession(callback) { + if (this.username == null) { + return callback(new Error('Username is null. Cannot retrieve a new session'), null); + } + + if (this.signInUserSession != null && this.signInUserSession.isValid()) { + return callback(null, this.signInUserSession); + } + + var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username; + var idTokenKey = keyPrefix + '.idToken'; + var accessTokenKey = keyPrefix + '.accessToken'; + var refreshTokenKey = keyPrefix + '.refreshToken'; + var clockDriftKey = keyPrefix + '.clockDrift'; + + if (this.storage.getItem(idTokenKey)) { + var idToken = new _CognitoIdToken2.default({ + IdToken: this.storage.getItem(idTokenKey) + }); + var accessToken = new _CognitoAccessToken2.default({ + AccessToken: this.storage.getItem(accessTokenKey) + }); + var refreshToken = new _CognitoRefreshToken2.default({ + RefreshToken: this.storage.getItem(refreshTokenKey) + }); + var clockDrift = parseInt(this.storage.getItem(clockDriftKey), 0) || 0; + + var sessionData = { + IdToken: idToken, + AccessToken: accessToken, + RefreshToken: refreshToken, + ClockDrift: clockDrift + }; + var cachedSession = new _CognitoUserSession2.default(sessionData); + if (cachedSession.isValid()) { + this.signInUserSession = cachedSession; + return callback(null, this.signInUserSession); + } + + if (refreshToken.getToken() == null) { + return callback(new Error('Cannot retrieve a new session. Please authenticate.'), null); + } + + this.refreshSession(refreshToken, callback); + } else { + callback(new Error('Local storage is missing an ID Token, Please authenticate'), null); + } + + return undefined; + }; + + /** + * This uses the refreshToken to retrieve a new session + * @param {CognitoRefreshToken} refreshToken A previous session's refresh token. + * @param {nodeCallback} callback Called on success or error. + * @returns {void} + */ + + + CognitoUser.prototype.refreshSession = function refreshSession(refreshToken, callback) { + var _this10 = this; + + var authParameters = {}; + authParameters.REFRESH_TOKEN = refreshToken.getToken(); + var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId(); + var lastUserKey = keyPrefix + '.LastAuthUser'; + + if (this.storage.getItem(lastUserKey)) { + this.username = this.storage.getItem(lastUserKey); + var deviceKeyKey = keyPrefix + '.' + this.username + '.deviceKey'; + this.deviceKey = this.storage.getItem(deviceKeyKey); + authParameters.DEVICE_KEY = this.deviceKey; + } + + var jsonReq = { + ClientId: this.pool.getClientId(), + AuthFlow: 'REFRESH_TOKEN_AUTH', + AuthParameters: authParameters + }; + if (this.getUserContextData()) { + jsonReq.UserContextData = this.getUserContextData(); + } + this.client.request('InitiateAuth', jsonReq, function (err, authResult) { + if (err) { + if (err.code === 'NotAuthorizedException') { + _this10.clearCachedTokens(); + } + return callback(err, null); + } + if (authResult) { + var authenticationResult = authResult.AuthenticationResult; + if (!Object.prototype.hasOwnProperty.call(authenticationResult, 'RefreshToken')) { + authenticationResult.RefreshToken = refreshToken.getToken(); + } + _this10.signInUserSession = _this10.getCognitoUserSession(authenticationResult); + _this10.cacheTokens(); + return callback(null, _this10.signInUserSession); + } + return undefined; + }); + }; + + /** + * This is used to save the session tokens to local storage + * @returns {void} + */ + + + CognitoUser.prototype.cacheTokens = function cacheTokens() { + var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId(); + var idTokenKey = keyPrefix + '.' + this.username + '.idToken'; + var accessTokenKey = keyPrefix + '.' + this.username + '.accessToken'; + var refreshTokenKey = keyPrefix + '.' + this.username + '.refreshToken'; + var clockDriftKey = keyPrefix + '.' + this.username + '.clockDrift'; + var lastUserKey = keyPrefix + '.LastAuthUser'; + + this.storage.setItem(idTokenKey, this.signInUserSession.getIdToken().getJwtToken()); + this.storage.setItem(accessTokenKey, this.signInUserSession.getAccessToken().getJwtToken()); + this.storage.setItem(refreshTokenKey, this.signInUserSession.getRefreshToken().getToken()); + this.storage.setItem(clockDriftKey, '' + this.signInUserSession.getClockDrift()); + this.storage.setItem(lastUserKey, this.username); + }; + + /** + * This is used to cache the device key and device group and device password + * @returns {void} + */ + + + CognitoUser.prototype.cacheDeviceKeyAndPassword = function cacheDeviceKeyAndPassword() { + var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username; + var deviceKeyKey = keyPrefix + '.deviceKey'; + var randomPasswordKey = keyPrefix + '.randomPasswordKey'; + var deviceGroupKeyKey = keyPrefix + '.deviceGroupKey'; + + this.storage.setItem(deviceKeyKey, this.deviceKey); + this.storage.setItem(randomPasswordKey, this.randomPassword); + this.storage.setItem(deviceGroupKeyKey, this.deviceGroupKey); + }; + + /** + * This is used to get current device key and device group and device password + * @returns {void} + */ + + + CognitoUser.prototype.getCachedDeviceKeyAndPassword = function getCachedDeviceKeyAndPassword() { + var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username; + var deviceKeyKey = keyPrefix + '.deviceKey'; + var randomPasswordKey = keyPrefix + '.randomPasswordKey'; + var deviceGroupKeyKey = keyPrefix + '.deviceGroupKey'; + + if (this.storage.getItem(deviceKeyKey)) { + this.deviceKey = this.storage.getItem(deviceKeyKey); + this.randomPassword = this.storage.getItem(randomPasswordKey); + this.deviceGroupKey = this.storage.getItem(deviceGroupKeyKey); + } + }; + + /** + * This is used to clear the device key info from local storage + * @returns {void} + */ + + + CognitoUser.prototype.clearCachedDeviceKeyAndPassword = function clearCachedDeviceKeyAndPassword() { + var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username; + var deviceKeyKey = keyPrefix + '.deviceKey'; + var randomPasswordKey = keyPrefix + '.randomPasswordKey'; + var deviceGroupKeyKey = keyPrefix + '.deviceGroupKey'; + + this.storage.removeItem(deviceKeyKey); + this.storage.removeItem(randomPasswordKey); + this.storage.removeItem(deviceGroupKeyKey); + }; + + /** + * This is used to clear the session tokens from local storage + * @returns {void} + */ + + + CognitoUser.prototype.clearCachedTokens = function clearCachedTokens() { + var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId(); + var idTokenKey = keyPrefix + '.' + this.username + '.idToken'; + var accessTokenKey = keyPrefix + '.' + this.username + '.accessToken'; + var refreshTokenKey = keyPrefix + '.' + this.username + '.refreshToken'; + var lastUserKey = keyPrefix + '.LastAuthUser'; + + this.storage.removeItem(idTokenKey); + this.storage.removeItem(accessTokenKey); + this.storage.removeItem(refreshTokenKey); + this.storage.removeItem(lastUserKey); + }; + + /** + * This is used to build a user session from tokens retrieved in the authentication result + * @param {object} authResult Successful auth response from server. + * @returns {CognitoUserSession} The new user session. + * @private + */ + + + CognitoUser.prototype.getCognitoUserSession = function getCognitoUserSession(authResult) { + var idToken = new _CognitoIdToken2.default(authResult); + var accessToken = new _CognitoAccessToken2.default(authResult); + var refreshToken = new _CognitoRefreshToken2.default(authResult); + + var sessionData = { + IdToken: idToken, + AccessToken: accessToken, + RefreshToken: refreshToken + }; + + return new _CognitoUserSession2.default(sessionData); + }; + + /** + * This is used to initiate a forgot password request + * @param {object} callback Result callback map. + * @param {onFailure} callback.onFailure Called on any error. + * @param {inputVerificationCode?} callback.inputVerificationCode + * Optional callback raised instead of onSuccess with response data. + * @param {onSuccess} callback.onSuccess Called on success. + * @returns {void} + */ + + + CognitoUser.prototype.forgotPassword = function forgotPassword(callback) { + var jsonReq = { + ClientId: this.pool.getClientId(), + Username: this.username + }; + if (this.getUserContextData()) { + jsonReq.UserContextData = this.getUserContextData(); + } + this.client.request('ForgotPassword', jsonReq, function (err, data) { + if (err) { + return callback.onFailure(err); + } + if (typeof callback.inputVerificationCode === 'function') { + return callback.inputVerificationCode(data); + } + return callback.onSuccess(data); + }); + }; + + /** + * This is used to confirm a new password using a confirmationCode + * @param {string} confirmationCode Code entered by user. + * @param {string} newPassword Confirm new password. + * @param {object} callback Result callback map. + * @param {onFailure} callback.onFailure Called on any error. + * @param {onSuccess} callback.onSuccess Called on success. + * @returns {void} + */ + + + CognitoUser.prototype.confirmPassword = function confirmPassword(confirmationCode, newPassword, callback) { + var jsonReq = { + ClientId: this.pool.getClientId(), + Username: this.username, + ConfirmationCode: confirmationCode, + Password: newPassword + }; + if (this.getUserContextData()) { + jsonReq.UserContextData = this.getUserContextData(); + } + this.client.request('ConfirmForgotPassword', jsonReq, function (err) { + if (err) { + return callback.onFailure(err); + } + return callback.onSuccess(); + }); + }; + + /** + * This is used to initiate an attribute confirmation request + * @param {string} attributeName User attribute that needs confirmation. + * @param {object} callback Result callback map. + * @param {onFailure} callback.onFailure Called on any error. + * @param {inputVerificationCode} callback.inputVerificationCode Called on success. + * @returns {void} + */ + + + CognitoUser.prototype.getAttributeVerificationCode = function getAttributeVerificationCode(attributeName, callback) { + if (this.signInUserSession == null || !this.signInUserSession.isValid()) { + return callback.onFailure(new Error('User is not authenticated')); + } + + this.client.request('GetUserAttributeVerificationCode', { + AttributeName: attributeName, + AccessToken: this.signInUserSession.getAccessToken().getJwtToken() + }, function (err, data) { + if (err) { + return callback.onFailure(err); + } + if (typeof callback.inputVerificationCode === 'function') { + return callback.inputVerificationCode(data); + } + return callback.onSuccess(); + }); + return undefined; + }; + + /** + * This is used to confirm an attribute using a confirmation code + * @param {string} attributeName Attribute being confirmed. + * @param {string} confirmationCode Code entered by user. + * @param {object} callback Result callback map. + * @param {onFailure} callback.onFailure Called on any error. + * @param {onSuccess} callback.onSuccess Called on success. + * @returns {void} + */ + + + CognitoUser.prototype.verifyAttribute = function verifyAttribute(attributeName, confirmationCode, callback) { + if (this.signInUserSession == null || !this.signInUserSession.isValid()) { + return callback.onFailure(new Error('User is not authenticated')); + } + + this.client.request('VerifyUserAttribute', { + AttributeName: attributeName, + Code: confirmationCode, + AccessToken: this.signInUserSession.getAccessToken().getJwtToken() + }, function (err) { + if (err) { + return callback.onFailure(err); + } + return callback.onSuccess('SUCCESS'); + }); + return undefined; + }; + + /** + * This is used to get the device information using the current device key + * @param {object} callback Result callback map. + * @param {onFailure} callback.onFailure Called on any error. + * @param {onSuccess<*>} callback.onSuccess Called on success with device data. + * @returns {void} + */ + + + CognitoUser.prototype.getDevice = function getDevice(callback) { + if (this.signInUserSession == null || !this.signInUserSession.isValid()) { + return callback.onFailure(new Error('User is not authenticated')); + } + + this.client.request('GetDevice', { + AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), + DeviceKey: this.deviceKey + }, function (err, data) { + if (err) { + return callback.onFailure(err); + } + return callback.onSuccess(data); + }); + return undefined; + }; + + /** + * This is used to forget a specific device + * @param {string} deviceKey Device key. + * @param {object} callback Result callback map. + * @param {onFailure} callback.onFailure Called on any error. + * @param {onSuccess} callback.onSuccess Called on success. + * @returns {void} + */ + + + CognitoUser.prototype.forgetSpecificDevice = function forgetSpecificDevice(deviceKey, callback) { + if (this.signInUserSession == null || !this.signInUserSession.isValid()) { + return callback.onFailure(new Error('User is not authenticated')); + } + + this.client.request('ForgetDevice', { + AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), + DeviceKey: deviceKey + }, function (err) { + if (err) { + return callback.onFailure(err); + } + return callback.onSuccess('SUCCESS'); + }); + return undefined; + }; + + /** + * This is used to forget the current device + * @param {object} callback Result callback map. + * @param {onFailure} callback.onFailure Called on any error. + * @param {onSuccess} callback.onSuccess Called on success. + * @returns {void} + */ + + + CognitoUser.prototype.forgetDevice = function forgetDevice(callback) { + var _this11 = this; + + this.forgetSpecificDevice(this.deviceKey, { + onFailure: callback.onFailure, + onSuccess: function onSuccess(result) { + _this11.deviceKey = null; + _this11.deviceGroupKey = null; + _this11.randomPassword = null; + _this11.clearCachedDeviceKeyAndPassword(); + return callback.onSuccess(result); + } + }); + }; + + /** + * This is used to set the device status as remembered + * @param {object} callback Result callback map. + * @param {onFailure} callback.onFailure Called on any error. + * @param {onSuccess} callback.onSuccess Called on success. + * @returns {void} + */ + + + CognitoUser.prototype.setDeviceStatusRemembered = function setDeviceStatusRemembered(callback) { + if (this.signInUserSession == null || !this.signInUserSession.isValid()) { + return callback.onFailure(new Error('User is not authenticated')); + } + + this.client.request('UpdateDeviceStatus', { + AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), + DeviceKey: this.deviceKey, + DeviceRememberedStatus: 'remembered' + }, function (err) { + if (err) { + return callback.onFailure(err); + } + return callback.onSuccess('SUCCESS'); + }); + return undefined; + }; + + /** + * This is used to set the device status as not remembered + * @param {object} callback Result callback map. + * @param {onFailure} callback.onFailure Called on any error. + * @param {onSuccess} callback.onSuccess Called on success. + * @returns {void} + */ + + + CognitoUser.prototype.setDeviceStatusNotRemembered = function setDeviceStatusNotRemembered(callback) { + if (this.signInUserSession == null || !this.signInUserSession.isValid()) { + return callback.onFailure(new Error('User is not authenticated')); + } + + this.client.request('UpdateDeviceStatus', { + AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), + DeviceKey: this.deviceKey, + DeviceRememberedStatus: 'not_remembered' + }, function (err) { + if (err) { + return callback.onFailure(err); + } + return callback.onSuccess('SUCCESS'); + }); + return undefined; + }; + + /** + * This is used to list all devices for a user + * + * @param {int} limit the number of devices returned in a call + * @param {string} paginationToken the pagination token in case any was returned before + * @param {object} callback Result callback map. + * @param {onFailure} callback.onFailure Called on any error. + * @param {onSuccess<*>} callback.onSuccess Called on success with device list. + * @returns {void} + */ + + + CognitoUser.prototype.listDevices = function listDevices(limit, paginationToken, callback) { + if (this.signInUserSession == null || !this.signInUserSession.isValid()) { + return callback.onFailure(new Error('User is not authenticated')); + } + + this.client.request('ListDevices', { + AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), + Limit: limit, + PaginationToken: paginationToken + }, function (err, data) { + if (err) { + return callback.onFailure(err); + } + return callback.onSuccess(data); + }); + return undefined; + }; + + /** + * This is used to globally revoke all tokens issued to a user + * @param {object} callback Result callback map. + * @param {onFailure} callback.onFailure Called on any error. + * @param {onSuccess} callback.onSuccess Called on success. + * @returns {void} + */ + + + CognitoUser.prototype.globalSignOut = function globalSignOut(callback) { + var _this12 = this; + + if (this.signInUserSession == null || !this.signInUserSession.isValid()) { + return callback.onFailure(new Error('User is not authenticated')); + } + + this.client.request('GlobalSignOut', { + AccessToken: this.signInUserSession.getAccessToken().getJwtToken() + }, function (err) { + if (err) { + return callback.onFailure(err); + } + _this12.clearCachedTokens(); + return callback.onSuccess('SUCCESS'); + }); + return undefined; + }; + + /** + * This is used for the user to signOut of the application and clear the cached tokens. + * @returns {void} + */ + + + CognitoUser.prototype.signOut = function signOut() { + this.signInUserSession = null; + this.clearCachedTokens(); + }; + + /** + * This is used by a user trying to select a given MFA + * @param {string} answerChallenge the mfa the user wants + * @param {nodeCallback} callback Called on success or error. + * @returns {void} + */ + + + CognitoUser.prototype.sendMFASelectionAnswer = function sendMFASelectionAnswer(answerChallenge, callback) { + var _this13 = this; + + var challengeResponses = {}; + challengeResponses.USERNAME = this.username; + challengeResponses.ANSWER = answerChallenge; + + var jsonReq = { + ChallengeName: 'SELECT_MFA_TYPE', + ChallengeResponses: challengeResponses, + ClientId: this.pool.getClientId(), + Session: this.Session + }; + if (this.getUserContextData()) { + jsonReq.UserContextData = this.getUserContextData(); + } + this.client.request('RespondToAuthChallenge', jsonReq, function (err, data) { + if (err) { + return callback.onFailure(err); + } + _this13.Session = data.Session; + if (answerChallenge === 'SMS_MFA') { + return callback.mfaRequired(data.challengeName, data.challengeParameters); + } + if (answerChallenge === 'SOFTWARE_TOKEN_MFA') { + return callback.totpRequired(data.challengeName, data.challengeParameters); + } + return undefined; + }); + }; + + /** + * This returns the user context data for advanced security feature. + * @returns {void} + */ + + + CognitoUser.prototype.getUserContextData = function getUserContextData() { + var pool = this.pool; + return pool.getUserContextData(this.username); + }; + + /** + * This is used by an authenticated or a user trying to authenticate to associate a TOTP MFA + * @param {nodeCallback} callback Called on success or error. + * @returns {void} + */ + + + CognitoUser.prototype.associateSoftwareToken = function associateSoftwareToken(callback) { + var _this14 = this; + + if (!(this.signInUserSession != null && this.signInUserSession.isValid())) { + this.client.request('AssociateSoftwareToken', { + Session: this.Session + }, function (err, data) { + if (err) { + return callback.onFailure(err); + } + _this14.Session = data.Session; + return callback.associateSecretCode(data.SecretCode); + }); + } else { + this.client.request('AssociateSoftwareToken', { + AccessToken: this.signInUserSession.getAccessToken().getJwtToken() + }, function (err, data) { + if (err) { + return callback.onFailure(err); + } + return callback.associateSecretCode(data.SecretCode); + }); + } + }; + + /** + * This is used by an authenticated or a user trying to authenticate to verify a TOTP MFA + * @param {string} totpCode The MFA code entered by the user. + * @param {string} friendlyDeviceName The device name we are assigning to the device. + * @param {nodeCallback} callback Called on success or error. + * @returns {void} + */ + + + CognitoUser.prototype.verifySoftwareToken = function verifySoftwareToken(totpCode, friendlyDeviceName, callback) { + var _this15 = this; + + if (!(this.signInUserSession != null && this.signInUserSession.isValid())) { + this.client.request('VerifySoftwareToken', { + Session: this.Session, + UserCode: totpCode, + FriendlyDeviceName: friendlyDeviceName + }, function (err, data) { + if (err) { + return callback.onFailure(err); + } + _this15.Session = data.Session; + var challengeResponses = {}; + challengeResponses.USERNAME = _this15.username; + var jsonReq = { + ChallengeName: 'MFA_SETUP', + ClientId: _this15.pool.getClientId(), + ChallengeResponses: challengeResponses, + Session: _this15.Session + }; + if (_this15.getUserContextData()) { + jsonReq.UserContextData = _this15.getUserContextData(); + } + _this15.client.request('RespondToAuthChallenge', jsonReq, function (errRespond, dataRespond) { + if (errRespond) { + return callback.onFailure(errRespond); + } + _this15.signInUserSession = _this15.getCognitoUserSession(dataRespond.AuthenticationResult); + _this15.cacheTokens(); + return callback.onSuccess(_this15.signInUserSession); + }); + return undefined; + }); + } else { + this.client.request('VerifySoftwareToken', { + AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), + UserCode: totpCode, + FriendlyDeviceName: friendlyDeviceName + }, function (err, data) { + if (err) { + return callback.onFailure(err); + } + return callback.onSuccess(data); + }); + } + }; + + return CognitoUser; +}(); + +exports.default = CognitoUser; - function utf16leToBytes (str, units) { - var c, hi, lo - var byteArray = [] - for (var i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) break +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { - c = str.charCodeAt(i) - hi = c >> 8 - lo = c % 256 - byteArray.push(lo) - byteArray.push(hi) - } +"use strict"; - return byteArray - } - function base64ToBytes (str) { - return base64.toByteArray(base64clean(str)) - } +exports.__esModule = true; - 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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - function isnan (val) { - return val !== val // eslint-disable-line no-self-compare - } +/*! + * Copyright 2016 Amazon.com, + * Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Amazon Software License (the "License"). + * You may not use this file except in compliance with the + * License. A copy of the License is located at + * + * http://aws.amazon.com/asl/ + * + * or in the "license" file accompanying this file. This file is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, express or implied. See the License + * for the specific language governing permissions and + * limitations under the License. + */ - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) +/** @class */ +var CognitoUserAttribute = function () { + /** + * Constructs a new CognitoUserAttribute object + * @param {string=} Name The record's name + * @param {string=} Value The record's value + */ + function CognitoUserAttribute() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + Name = _ref.Name, + Value = _ref.Value; -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { + _classCallCheck(this, CognitoUserAttribute); - var Buffer = __webpack_require__(1).Buffer; - var intSize = 4; - var zeroBuffer = new Buffer(intSize); zeroBuffer.fill(0); - var chrsz = 8; - - function toArray(buf, bigEndian) { - if ((buf.length % intSize) !== 0) { - var len = buf.length + (intSize - (buf.length % intSize)); - buf = Buffer.concat([buf, zeroBuffer], len); - } - - var arr = []; - var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE; - for (var i = 0; i < buf.length; i += intSize) { - arr.push(fn.call(buf, i)); - } - return arr; - } + this.Name = Name || ''; + this.Value = Value || ''; + } - function toBuffer(arr, size, bigEndian) { - var buf = new Buffer(size); - var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE; - for (var i = 0; i < arr.length; i++) { - fn.call(buf, arr[i], i * 4, true); - } - return buf; - } + /** + * @returns {string} the record's value. + */ - function hash(buf, fn, hashSize, bigEndian) { - if (!Buffer.isBuffer(buf)) buf = new Buffer(buf); - var arr = fn(toArray(buf, bigEndian), buf.length * chrsz); - return toBuffer(arr, hashSize, bigEndian); - } - module.exports = { hash: hash }; + CognitoUserAttribute.prototype.getValue = function getValue() { + return this.Value; + }; + /** + * Sets the record's value. + * @param {string} value The new value. + * @returns {CognitoUserAttribute} The record for method chaining. + */ -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - 'use strict'; + CognitoUserAttribute.prototype.setValue = function setValue(value) { + this.Value = value; + return this; + }; - exports.__esModule = true; + /** + * @returns {string} the record's name. + */ - var _buffer = __webpack_require__(1); - var _cryptoBrowserify = __webpack_require__(14); + CognitoUserAttribute.prototype.getName = function getName() { + return this.Name; + }; - var crypto = _interopRequireWildcard(_cryptoBrowserify); + /** + * Sets the record's name + * @param {string} name The new name. + * @returns {CognitoUserAttribute} The record for method chaining. + */ - var _BigInteger = __webpack_require__(4); - var _BigInteger2 = _interopRequireDefault(_BigInteger); + CognitoUserAttribute.prototype.setName = function setName(name) { + this.Name = name; + return this; + }; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /** + * @returns {string} a string representation of the record. + */ - function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /*! - * Copyright 2016 Amazon.com, - * Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Amazon Software License (the "License"). - * You may not use this file except in compliance with the - * License. A copy of the License is located at - * - * http://aws.amazon.com/asl/ - * - * or in the "license" file accompanying this file. This file is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, express or implied. See the License - * for the specific language governing permissions and - * limitations under the License. - */ + CognitoUserAttribute.prototype.toString = function toString() { + return JSON.stringify(this); + }; - var createHash = crypto.createHash; - var createHmac = crypto.createHmac; - var randomBytes = crypto.randomBytes; + /** + * @returns {object} a flat object representing the record. + */ - var initN = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1' + '29024E088A67CC74020BBEA63B139B22514A08798E3404DD' + 'EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245' + 'E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' + 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D' + 'C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F' + '83655D23DCA3AD961C62F356208552BB9ED529077096966D' + '670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B' + 'E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9' + 'DE2BCBF6955817183995497CEA956AE515D2261898FA0510' + '15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64' + 'ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7' + 'ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B' + 'F12FFA06D98A0864D87602733EC86A64521F2B18177B200C' + 'BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31' + '43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF'; - var newPasswordRequiredChallengeUserAttributePrefix = 'userAttributes.'; + CognitoUserAttribute.prototype.toJSON = function toJSON() { + return { + Name: this.Name, + Value: this.Value + }; + }; - /** @class */ + return CognitoUserAttribute; +}(); - var AuthenticationHelper = function () { - /** - * Constructs a new AuthenticationHelper object - * @param {string} PoolName Cognito user pool name. - */ - function AuthenticationHelper(PoolName) { - _classCallCheck(this, AuthenticationHelper); +exports.default = CognitoUserAttribute; + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { - this.N = new _BigInteger2.default(initN, 16); - this.g = new _BigInteger2.default('2', 16); - this.k = new _BigInteger2.default(this.hexHash('00' + this.N.toString(16) + '0' + this.g.toString(16)), 16); +"use strict"; - this.smallAValue = this.generateRandomSmallA(); - this.getLargeAValue(function () {}); - this.infoBits = _buffer.Buffer.from('Caldera Derived Key', 'utf8'); +exports.__esModule = true; - this.poolName = PoolName; - } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - /** - * @returns {BigInteger} small A, a random number - */ +/*! + * Copyright 2016 Amazon.com, + * Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Amazon Software License (the "License"). + * You may not use this file except in compliance with the + * License. A copy of the License is located at + * + * http://aws.amazon.com/asl/ + * + * or in the "license" file accompanying this file. This file is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, express or implied. See the License + * for the specific language governing permissions and + * limitations under the License. + */ +/** @class */ +var CognitoUserSession = function () { + /** + * Constructs a new CognitoUserSession object + * @param {CognitoIdToken} IdToken The session's Id token. + * @param {CognitoRefreshToken=} RefreshToken The session's refresh token. + * @param {CognitoAccessToken} AccessToken The session's access token. + * @param {int} ClockDrift The saved computer's clock drift or undefined to force calculation. + */ + function CognitoUserSession() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + IdToken = _ref.IdToken, + RefreshToken = _ref.RefreshToken, + AccessToken = _ref.AccessToken, + ClockDrift = _ref.ClockDrift; - AuthenticationHelper.prototype.getSmallAValue = function getSmallAValue() { - return this.smallAValue; - }; + _classCallCheck(this, CognitoUserSession); - /** - * @param {nodeCallback} callback Called with (err, largeAValue) - * @returns {void} - */ + if (AccessToken == null || IdToken == null) { + throw new Error('Id token and Access Token must be present.'); + } + this.idToken = IdToken; + this.refreshToken = RefreshToken; + this.accessToken = AccessToken; + this.clockDrift = ClockDrift === undefined ? this.calculateClockDrift() : ClockDrift; + } - AuthenticationHelper.prototype.getLargeAValue = function getLargeAValue(callback) { - var _this = this; + /** + * @returns {CognitoIdToken} the session's Id token + */ - if (this.largeAValue) { - callback(null, this.largeAValue); - } else { - this.calculateA(this.smallAValue, function (err, largeAValue) { - if (err) { - callback(err, null); - } - _this.largeAValue = largeAValue; - callback(null, _this.largeAValue); - }); - } - }; + CognitoUserSession.prototype.getIdToken = function getIdToken() { + return this.idToken; + }; - /** - * helper function to generate a random big integer - * @returns {BigInteger} a random value. - * @private - */ + /** + * @returns {CognitoRefreshToken} the session's refresh token + */ - AuthenticationHelper.prototype.generateRandomSmallA = function generateRandomSmallA() { - var hexRandom = randomBytes(128).toString('hex'); + CognitoUserSession.prototype.getRefreshToken = function getRefreshToken() { + return this.refreshToken; + }; - var randomBigInt = new _BigInteger2.default(hexRandom, 16); - var smallABigInt = randomBigInt.mod(this.N); + /** + * @returns {CognitoAccessToken} the session's access token + */ - return smallABigInt; - }; - /** - * helper function to generate a random string - * @returns {string} a random value. - * @private - */ + CognitoUserSession.prototype.getAccessToken = function getAccessToken() { + return this.accessToken; + }; + /** + * @returns {int} the session's clock drift + */ - AuthenticationHelper.prototype.generateRandomString = function generateRandomString() { - return randomBytes(40).toString('base64'); - }; - /** - * @returns {string} Generated random value included in password hash. - */ + CognitoUserSession.prototype.getClockDrift = function getClockDrift() { + return this.clockDrift; + }; + /** + * @returns {int} the computer's clock drift + */ - AuthenticationHelper.prototype.getRandomPassword = function getRandomPassword() { - return this.randomPassword; - }; - /** - * @returns {string} Generated random value included in devices hash. - */ + CognitoUserSession.prototype.calculateClockDrift = function calculateClockDrift() { + var now = Math.floor(new Date() / 1000); + var iat = Math.min(this.accessToken.getIssuedAt(), this.idToken.getIssuedAt()); + return now - iat; + }; - AuthenticationHelper.prototype.getSaltDevices = function getSaltDevices() { - return this.SaltToHashDevices; - }; + /** + * Checks to see if the session is still valid based on session expiry information found + * in tokens and the current time (adjusted with clock drift) + * @returns {boolean} if the session is still valid + */ - /** - * @returns {string} Value used to verify devices. - */ + CognitoUserSession.prototype.isValid = function isValid() { + var now = Math.floor(new Date() / 1000); + var adjusted = now - this.clockDrift; - AuthenticationHelper.prototype.getVerifierDevices = function getVerifierDevices() { - return this.verifierDevices; - }; + return adjusted < this.accessToken.getExpiration() && adjusted < this.idToken.getExpiration(); + }; - /** - * Generate salts and compute verifier. - * @param {string} deviceGroupKey Devices to generate verifier for. - * @param {string} username User to generate verifier for. - * @param {nodeCallback} callback Called with (err, null) - * @returns {void} - */ + return CognitoUserSession; +}(); +exports.default = CognitoUserSession; - AuthenticationHelper.prototype.generateHashDevice = function generateHashDevice(deviceGroupKey, username, callback) { - var _this2 = this; +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { - this.randomPassword = this.generateRandomString(); - var combinedString = '' + deviceGroupKey + username + ':' + this.randomPassword; - var hashedString = this.hash(combinedString); +"use strict"; - var hexRandom = randomBytes(16).toString('hex'); - this.SaltToHashDevices = this.padHex(new _BigInteger2.default(hexRandom, 16)); - this.g.modPow(new _BigInteger2.default(this.hexHash(this.SaltToHashDevices + hashedString), 16), this.N, function (err, verifierDevicesNotPadded) { - if (err) { - callback(err, null); - } +exports.__esModule = true; - _this2.verifierDevices = _this2.padHex(verifierDevicesNotPadded); - callback(null, null); - }); - }; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - /** - * Calculate the client's public value A = g^a%N - * with the generated random number a - * @param {BigInteger} a Randomly generated small A. - * @param {nodeCallback} callback Called with (err, largeAValue) - * @returns {void} - * @private - */ +/*! + * Copyright 2016 Amazon.com, + * Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Amazon Software License (the "License"). + * You may not use this file except in compliance with the + * License. A copy of the License is located at + * + * http://aws.amazon.com/asl/ + * + * or in the "license" file accompanying this file. This file is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, express or implied. See the License + * for the specific language governing permissions and + * limitations under the License. + */ +var monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; +var weekNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; - AuthenticationHelper.prototype.calculateA = function calculateA(a, callback) { - var _this3 = this; +/** @class */ - this.g.modPow(a, this.N, function (err, A) { - if (err) { - callback(err, null); - } +var DateHelper = function () { + function DateHelper() { + _classCallCheck(this, DateHelper); + } - if (A.mod(_this3.N).equals(_BigInteger2.default.ZERO)) { - callback(new Error('Illegal paramater. A mod N cannot be 0.'), null); - } + /** + * @returns {string} The current time in "ddd MMM D HH:mm:ss UTC YYYY" format. + */ + DateHelper.prototype.getNowString = function getNowString() { + var now = new Date(); - callback(null, A); - }); - }; + var weekDay = weekNames[now.getUTCDay()]; + var month = monthNames[now.getUTCMonth()]; + var day = now.getUTCDate(); - /** - * Calculate the client's value U which is the hash of A and B - * @param {BigInteger} A Large A value. - * @param {BigInteger} B Server B value. - * @returns {BigInteger} Computed U value. - * @private - */ + var hours = now.getUTCHours(); + if (hours < 10) { + hours = '0' + hours; + } + var minutes = now.getUTCMinutes(); + if (minutes < 10) { + minutes = '0' + minutes; + } - AuthenticationHelper.prototype.calculateU = function calculateU(A, B) { - this.UHexHash = this.hexHash(this.padHex(A) + this.padHex(B)); - var finalU = new _BigInteger2.default(this.UHexHash, 16); + var seconds = now.getUTCSeconds(); + if (seconds < 10) { + seconds = '0' + seconds; + } - return finalU; - }; + var year = now.getUTCFullYear(); - /** - * Calculate a hash from a bitArray - * @param {Buffer} buf Value to hash. - * @returns {String} Hex-encoded hash. - * @private - */ - - - AuthenticationHelper.prototype.hash = function hash(buf) { - var hashHex = createHash('sha256').update(buf).digest('hex'); - return new Array(64 - hashHex.length).join('0') + hashHex; - }; - - /** - * Calculate a hash from a hex string - * @param {String} hexStr Value to hash. - * @returns {String} Hex-encoded hash. - * @private - */ - - - AuthenticationHelper.prototype.hexHash = function hexHash(hexStr) { - return this.hash(_buffer.Buffer.from(hexStr, 'hex')); - }; - - /** - * Standard hkdf algorithm - * @param {Buffer} ikm Input key material. - * @param {Buffer} salt Salt value. - * @returns {Buffer} Strong key material. - * @private - */ - - - AuthenticationHelper.prototype.computehkdf = function computehkdf(ikm, salt) { - var prk = createHmac('sha256', salt).update(ikm).digest(); - var infoBitsUpdate = _buffer.Buffer.concat([this.infoBits, _buffer.Buffer.from(String.fromCharCode(1), 'utf8')]); - var hmac = createHmac('sha256', prk).update(infoBitsUpdate).digest(); - return hmac.slice(0, 16); - }; - - /** - * Calculates the final hkdf based on computed S value, and computed U value and the key - * @param {String} username Username. - * @param {String} password Password. - * @param {BigInteger} serverBValue Server B value. - * @param {BigInteger} salt Generated salt. - * @param {nodeCallback} callback Called with (err, hkdfValue) - * @returns {void} - */ - - - AuthenticationHelper.prototype.getPasswordAuthenticationKey = function getPasswordAuthenticationKey(username, password, serverBValue, salt, callback) { - var _this4 = this; - - if (serverBValue.mod(this.N).equals(_BigInteger2.default.ZERO)) { - throw new Error('B cannot be zero.'); - } - - this.UValue = this.calculateU(this.largeAValue, serverBValue); - - if (this.UValue.equals(_BigInteger2.default.ZERO)) { - throw new Error('U cannot be zero.'); - } - - var usernamePassword = '' + this.poolName + username + ':' + password; - var usernamePasswordHash = this.hash(usernamePassword); - - var xValue = new _BigInteger2.default(this.hexHash(this.padHex(salt) + usernamePasswordHash), 16); - this.calculateS(xValue, serverBValue, function (err, sValue) { - if (err) { - callback(err, null); - } - - var hkdf = _this4.computehkdf(_buffer.Buffer.from(_this4.padHex(sValue), 'hex'), _buffer.Buffer.from(_this4.padHex(_this4.UValue.toString(16)), 'hex')); - - callback(null, hkdf); - }); - }; - - /** - * Calculates the S value used in getPasswordAuthenticationKey - * @param {BigInteger} xValue Salted password hash value. - * @param {BigInteger} serverBValue Server B value. - * @param {nodeCallback} callback Called on success or error. - * @returns {void} - */ - - - AuthenticationHelper.prototype.calculateS = function calculateS(xValue, serverBValue, callback) { - var _this5 = this; + // ddd MMM D HH:mm:ss UTC YYYY + var dateNow = weekDay + ' ' + month + ' ' + day + ' ' + hours + ':' + minutes + ':' + seconds + ' UTC ' + year; - this.g.modPow(xValue, this.N, function (err, gModPowXN) { - if (err) { - callback(err, null); - } - - var intValue2 = serverBValue.subtract(_this5.k.multiply(gModPowXN)); - intValue2.modPow(_this5.smallAValue.add(_this5.UValue.multiply(xValue)), _this5.N, function (err2, result) { - if (err2) { - callback(err2, null); - } - - callback(null, result.mod(_this5.N)); - }); - }); - }; - - /** - * Return constant newPasswordRequiredChallengeUserAttributePrefix - * @return {newPasswordRequiredChallengeUserAttributePrefix} constant prefix value - */ - - - AuthenticationHelper.prototype.getNewPasswordRequiredChallengeUserAttributePrefix = function getNewPasswordRequiredChallengeUserAttributePrefix() { - return newPasswordRequiredChallengeUserAttributePrefix; - }; + return dateNow; + }; - /** - * Converts a BigInteger (or hex string) to hex format padded with zeroes for hashing - * @param {BigInteger|String} bigInt Number or string to pad. - * @returns {String} Padded hex string. - */ - - - AuthenticationHelper.prototype.padHex = function padHex(bigInt) { - var hashStr = bigInt.toString(16); - if (hashStr.length % 2 === 1) { - hashStr = '0' + hashStr; - } else if ('89ABCDEFabcdef'.indexOf(hashStr[0]) !== -1) { - hashStr = '00' + hashStr; - } - return hashStr; - }; - - return AuthenticationHelper; - }(); + return DateHelper; +}(); - exports.default = AuthenticationHelper; +exports.default = DateHelper; /***/ }), -/* 4 */ -/***/ (function(module, exports) { - - "use strict"; - - exports.__esModule = true; - // A small implementation of BigInteger based on http://www-cs-students.stanford.edu/~tjw/jsbn/ - // - // All public methods have been removed except the following: - // new BigInteger(a, b) (only radix 2, 4, 8, 16 and 32 supported) - // toString (only radix 2, 4, 8, 16 and 32 supported) - // negate - // abs - // compareTo - // bitLength - // mod - // equals - // add - // subtract - // multiply - // divide - // modPow - - exports.default = BigInteger; - - /* - * Copyright (c) 2003-2005 Tom Wu - * All Rights Reserved. - * - * 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" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF - * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * In addition, the following condition applies: - * - * All redistributions must retain an intact copy of this copyright notice - * and disclaimer. - */ - - // (public) Constructor - - function BigInteger(a, b) { - if (a != null) this.fromString(a, b); - } +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { - // return new, unset BigInteger - function nbi() { - return new BigInteger(null); - } +"use strict"; + + +exports.__esModule = true; +// A small implementation of BigInteger based on http://www-cs-students.stanford.edu/~tjw/jsbn/ +// +// All public methods have been removed except the following: +// new BigInteger(a, b) (only radix 2, 4, 8, 16 and 32 supported) +// toString (only radix 2, 4, 8, 16 and 32 supported) +// negate +// abs +// compareTo +// bitLength +// mod +// equals +// add +// subtract +// multiply +// divide +// modPow + +exports.default = BigInteger; + +/* + * Copyright (c) 2003-2005 Tom Wu + * All Rights Reserved. + * + * 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" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF + * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * In addition, the following condition applies: + * + * All redistributions must retain an intact copy of this copyright notice + * and disclaimer. + */ - // Bits per digit - var dbits; - - // JavaScript engine analysis - var canary = 0xdeadbeefcafe; - var j_lm = (canary & 0xffffff) == 0xefcafe; - - // am: Compute w_j += (x*this_i), propagate carries, - // c is initial carry, returns final carry. - // c < 3*dvalue, x < 2*dvalue, this_i < dvalue - // We need to select the fastest one that works in this environment. - - // am1: use a single mult and divide to get the high bits, - // max digit bits should be 26 because - // max internal value = 2*dvalue^2-2*dvalue (< 2^53) - function am1(i, x, w, j, c, n) { - while (--n >= 0) { - var v = x * this[i++] + w[j] + c; - c = Math.floor(v / 0x4000000); - w[j++] = v & 0x3ffffff; - } - return c; - } - // am2 avoids a big mult-and-extract completely. - // Max digit bits should be <= 30 because we do bitwise ops - // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) - function am2(i, x, w, j, c, n) { - var xl = x & 0x7fff, - xh = x >> 15; - while (--n >= 0) { - var l = this[i] & 0x7fff; - var h = this[i++] >> 15; - var m = xh * l + h * xl; - l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff); - c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30); - w[j++] = l & 0x3fffffff; - } - return c; - } - // Alternately, set max digit bits to 28 since some - // browsers slow down when dealing with 32-bit numbers. - function am3(i, x, w, j, c, n) { - var xl = x & 0x3fff, - xh = x >> 14; - while (--n >= 0) { - var l = this[i] & 0x3fff; - var h = this[i++] >> 14; - var m = xh * l + h * xl; - l = xl * l + ((m & 0x3fff) << 14) + w[j] + c; - c = (l >> 28) + (m >> 14) + xh * h; - w[j++] = l & 0xfffffff; - } - return c; - } - var inBrowser = typeof navigator !== "undefined"; - if (inBrowser && j_lm && navigator.appName == "Microsoft Internet Explorer") { - BigInteger.prototype.am = am2; - dbits = 30; - } else if (inBrowser && j_lm && navigator.appName != "Netscape") { - BigInteger.prototype.am = am1; - dbits = 26; - } else { - // Mozilla/Netscape seems to prefer am3 - BigInteger.prototype.am = am3; - dbits = 28; - } +// (public) Constructor + +function BigInteger(a, b) { + if (a != null) this.fromString(a, b); +} + +// return new, unset BigInteger +function nbi() { + return new BigInteger(null); +} + +// Bits per digit +var dbits; + +// JavaScript engine analysis +var canary = 0xdeadbeefcafe; +var j_lm = (canary & 0xffffff) == 0xefcafe; + +// am: Compute w_j += (x*this_i), propagate carries, +// c is initial carry, returns final carry. +// c < 3*dvalue, x < 2*dvalue, this_i < dvalue +// We need to select the fastest one that works in this environment. + +// am1: use a single mult and divide to get the high bits, +// max digit bits should be 26 because +// max internal value = 2*dvalue^2-2*dvalue (< 2^53) +function am1(i, x, w, j, c, n) { + while (--n >= 0) { + var v = x * this[i++] + w[j] + c; + c = Math.floor(v / 0x4000000); + w[j++] = v & 0x3ffffff; + } + return c; +} +// am2 avoids a big mult-and-extract completely. +// Max digit bits should be <= 30 because we do bitwise ops +// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) +function am2(i, x, w, j, c, n) { + var xl = x & 0x7fff, + xh = x >> 15; + while (--n >= 0) { + var l = this[i] & 0x7fff; + var h = this[i++] >> 15; + var m = xh * l + h * xl; + l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff); + c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30); + w[j++] = l & 0x3fffffff; + } + return c; +} +// Alternately, set max digit bits to 28 since some +// browsers slow down when dealing with 32-bit numbers. +function am3(i, x, w, j, c, n) { + var xl = x & 0x3fff, + xh = x >> 14; + while (--n >= 0) { + var l = this[i] & 0x3fff; + var h = this[i++] >> 14; + var m = xh * l + h * xl; + l = xl * l + ((m & 0x3fff) << 14) + w[j] + c; + c = (l >> 28) + (m >> 14) + xh * h; + w[j++] = l & 0xfffffff; + } + return c; +} +var inBrowser = typeof navigator !== "undefined"; +if (inBrowser && j_lm && navigator.appName == "Microsoft Internet Explorer") { + BigInteger.prototype.am = am2; + dbits = 30; +} else if (inBrowser && j_lm && navigator.appName != "Netscape") { + BigInteger.prototype.am = am1; + dbits = 26; +} else { + // Mozilla/Netscape seems to prefer am3 + BigInteger.prototype.am = am3; + dbits = 28; +} + +BigInteger.prototype.DB = dbits; +BigInteger.prototype.DM = (1 << dbits) - 1; +BigInteger.prototype.DV = 1 << dbits; + +var BI_FP = 52; +BigInteger.prototype.FV = Math.pow(2, BI_FP); +BigInteger.prototype.F1 = BI_FP - dbits; +BigInteger.prototype.F2 = 2 * dbits - BI_FP; + +// Digit conversions +var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz"; +var BI_RC = new Array(); +var rr, vv; +rr = "0".charCodeAt(0); +for (vv = 0; vv <= 9; ++vv) { + BI_RC[rr++] = vv; +}rr = "a".charCodeAt(0); +for (vv = 10; vv < 36; ++vv) { + BI_RC[rr++] = vv; +}rr = "A".charCodeAt(0); +for (vv = 10; vv < 36; ++vv) { + BI_RC[rr++] = vv; +}function int2char(n) { + return BI_RM.charAt(n); +} +function intAt(s, i) { + var c = BI_RC[s.charCodeAt(i)]; + return c == null ? -1 : c; +} + +// (protected) copy this to r +function bnpCopyTo(r) { + for (var i = this.t - 1; i >= 0; --i) { + r[i] = this[i]; + }r.t = this.t; + r.s = this.s; +} + +// (protected) set from integer value x, -DV <= x < DV +function bnpFromInt(x) { + this.t = 1; + this.s = x < 0 ? -1 : 0; + if (x > 0) this[0] = x;else if (x < -1) this[0] = x + this.DV;else this.t = 0; +} + +// return bigint initialized to value +function nbv(i) { + var r = nbi(); + + r.fromInt(i); + + return r; +} + +// (protected) set from string and radix +function bnpFromString(s, b) { + var k; + if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported"); + this.t = 0; + this.s = 0; + var i = s.length, + mi = false, + sh = 0; + while (--i >= 0) { + var x = intAt(s, i); + if (x < 0) { + if (s.charAt(i) == "-") mi = true; + continue; + } + mi = false; + if (sh == 0) this[this.t++] = x;else if (sh + k > this.DB) { + this[this.t - 1] |= (x & (1 << this.DB - sh) - 1) << sh; + this[this.t++] = x >> this.DB - sh; + } else this[this.t - 1] |= x << sh; + sh += k; + if (sh >= this.DB) sh -= this.DB; + } + this.clamp(); + if (mi) BigInteger.ZERO.subTo(this, this); +} + +// (protected) clamp off excess high words +function bnpClamp() { + var c = this.s & this.DM; + while (this.t > 0 && this[this.t - 1] == c) { + --this.t; + } +} + +// (public) return string representation in given radix +function bnToString(b) { + if (this.s < 0) return "-" + this.negate().toString(); + var k; + if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported"); + var km = (1 << k) - 1, + d, + m = false, + r = "", + i = this.t; + var p = this.DB - i * this.DB % k; + if (i-- > 0) { + if (p < this.DB && (d = this[i] >> p) > 0) { + m = true; + r = int2char(d); + } + while (i >= 0) { + if (p < k) { + d = (this[i] & (1 << p) - 1) << k - p; + d |= this[--i] >> (p += this.DB - k); + } else { + d = this[i] >> (p -= k) & km; + if (p <= 0) { + p += this.DB; + --i; + } + } + if (d > 0) m = true; + if (m) r += int2char(d); + } + } + return m ? r : "0"; +} + +// (public) -this +function bnNegate() { + var r = nbi(); + + BigInteger.ZERO.subTo(this, r); + + return r; +} + +// (public) |this| +function bnAbs() { + return this.s < 0 ? this.negate() : this; +} + +// (public) return + if this > a, - if this < a, 0 if equal +function bnCompareTo(a) { + var r = this.s - a.s; + if (r != 0) return r; + var i = this.t; + r = i - a.t; + if (r != 0) return this.s < 0 ? -r : r; + while (--i >= 0) { + if ((r = this[i] - a[i]) != 0) return r; + }return 0; +} + +// returns bit length of the integer x +function nbits(x) { + var r = 1, + t; + if ((t = x >>> 16) != 0) { + x = t; + r += 16; + } + if ((t = x >> 8) != 0) { + x = t; + r += 8; + } + if ((t = x >> 4) != 0) { + x = t; + r += 4; + } + if ((t = x >> 2) != 0) { + x = t; + r += 2; + } + if ((t = x >> 1) != 0) { + x = t; + r += 1; + } + return r; +} + +// (public) return the number of bits in "this" +function bnBitLength() { + if (this.t <= 0) return 0; + return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM); +} + +// (protected) r = this << n*DB +function bnpDLShiftTo(n, r) { + var i; + for (i = this.t - 1; i >= 0; --i) { + r[i + n] = this[i]; + }for (i = n - 1; i >= 0; --i) { + r[i] = 0; + }r.t = this.t + n; + r.s = this.s; +} + +// (protected) r = this >> n*DB +function bnpDRShiftTo(n, r) { + for (var i = n; i < this.t; ++i) { + r[i - n] = this[i]; + }r.t = Math.max(this.t - n, 0); + r.s = this.s; +} + +// (protected) r = this << n +function bnpLShiftTo(n, r) { + var bs = n % this.DB; + var cbs = this.DB - bs; + var bm = (1 << cbs) - 1; + var ds = Math.floor(n / this.DB), + c = this.s << bs & this.DM, + i; + for (i = this.t - 1; i >= 0; --i) { + r[i + ds + 1] = this[i] >> cbs | c; + c = (this[i] & bm) << bs; + } + for (i = ds - 1; i >= 0; --i) { + r[i] = 0; + }r[ds] = c; + r.t = this.t + ds + 1; + r.s = this.s; + r.clamp(); +} + +// (protected) r = this >> n +function bnpRShiftTo(n, r) { + r.s = this.s; + var ds = Math.floor(n / this.DB); + if (ds >= this.t) { + r.t = 0; + return; + } + var bs = n % this.DB; + var cbs = this.DB - bs; + var bm = (1 << bs) - 1; + r[0] = this[ds] >> bs; + for (var i = ds + 1; i < this.t; ++i) { + r[i - ds - 1] |= (this[i] & bm) << cbs; + r[i - ds] = this[i] >> bs; + } + if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs; + r.t = this.t - ds; + r.clamp(); +} + +// (protected) r = this - a +function bnpSubTo(a, r) { + var i = 0, + c = 0, + m = Math.min(a.t, this.t); + while (i < m) { + c += this[i] - a[i]; + r[i++] = c & this.DM; + c >>= this.DB; + } + if (a.t < this.t) { + c -= a.s; + while (i < this.t) { + c += this[i]; + r[i++] = c & this.DM; + c >>= this.DB; + } + c += this.s; + } else { + c += this.s; + while (i < a.t) { + c -= a[i]; + r[i++] = c & this.DM; + c >>= this.DB; + } + c -= a.s; + } + r.s = c < 0 ? -1 : 0; + if (c < -1) r[i++] = this.DV + c;else if (c > 0) r[i++] = c; + r.t = i; + r.clamp(); +} + +// (protected) r = this * a, r != this,a (HAC 14.12) +// "this" should be the larger one if appropriate. +function bnpMultiplyTo(a, r) { + var x = this.abs(), + y = a.abs(); + var i = x.t; + r.t = i + y.t; + while (--i >= 0) { + r[i] = 0; + }for (i = 0; i < y.t; ++i) { + r[i + x.t] = x.am(0, y[i], r, i, 0, x.t); + }r.s = 0; + r.clamp(); + if (this.s != a.s) BigInteger.ZERO.subTo(r, r); +} + +// (protected) r = this^2, r != this (HAC 14.16) +function bnpSquareTo(r) { + var x = this.abs(); + var i = r.t = 2 * x.t; + while (--i >= 0) { + r[i] = 0; + }for (i = 0; i < x.t - 1; ++i) { + var c = x.am(i, x[i], r, 2 * i, 0, 1); + if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) { + r[i + x.t] -= x.DV; + r[i + x.t + 1] = 1; + } + } + if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1); + r.s = 0; + r.clamp(); +} + +// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) +// r != q, this != m. q or r may be null. +function bnpDivRemTo(m, q, r) { + var pm = m.abs(); + if (pm.t <= 0) return; + var pt = this.abs(); + if (pt.t < pm.t) { + if (q != null) q.fromInt(0); + if (r != null) this.copyTo(r); + return; + } + if (r == null) r = nbi(); + var y = nbi(), + ts = this.s, + ms = m.s; + var nsh = this.DB - nbits(pm[pm.t - 1]); + // normalize modulus + if (nsh > 0) { + pm.lShiftTo(nsh, y); + pt.lShiftTo(nsh, r); + } else { + pm.copyTo(y); + pt.copyTo(r); + } + var ys = y.t; + var y0 = y[ys - 1]; + if (y0 == 0) return; + var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0); + var d1 = this.FV / yt, + d2 = (1 << this.F1) / yt, + e = 1 << this.F2; + var i = r.t, + j = i - ys, + t = q == null ? nbi() : q; + y.dlShiftTo(j, t); + if (r.compareTo(t) >= 0) { + r[r.t++] = 1; + r.subTo(t, r); + } + BigInteger.ONE.dlShiftTo(ys, t); + t.subTo(y, y); + // "negative" y so we can replace sub with am later + while (y.t < ys) { + y[y.t++] = 0; + }while (--j >= 0) { + // Estimate quotient digit + var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2); + if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { + // Try it out + y.dlShiftTo(j, t); + r.subTo(t, r); + while (r[i] < --qd) { + r.subTo(t, r); + } + } + } + if (q != null) { + r.drShiftTo(ys, q); + if (ts != ms) BigInteger.ZERO.subTo(q, q); + } + r.t = ys; + r.clamp(); + if (nsh > 0) r.rShiftTo(nsh, r); + // Denormalize remainder + if (ts < 0) BigInteger.ZERO.subTo(r, r); +} + +// (public) this mod a +function bnMod(a) { + var r = nbi(); + this.abs().divRemTo(a, null, r); + if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r); + return r; +} + +// (protected) return "-1/this % 2^DB"; useful for Mont. reduction +// justification: +// xy == 1 (mod m) +// xy = 1+km +// xy(2-xy) = (1+km)(1-km) +// x[y(2-xy)] = 1-k^2m^2 +// x[y(2-xy)] == 1 (mod m^2) +// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 +// should reduce x and y(2-xy) by m^2 at each step to keep size bounded. +// JS multiply "overflows" differently from C/C++, so care is needed here. +function bnpInvDigit() { + if (this.t < 1) return 0; + var x = this[0]; + if ((x & 1) == 0) return 0; + var y = x & 3; + // y == 1/x mod 2^2 + y = y * (2 - (x & 0xf) * y) & 0xf; + // y == 1/x mod 2^4 + y = y * (2 - (x & 0xff) * y) & 0xff; + // y == 1/x mod 2^8 + y = y * (2 - ((x & 0xffff) * y & 0xffff)) & 0xffff; + // y == 1/x mod 2^16 + // last step - calculate inverse mod DV directly; + // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints + y = y * (2 - x * y % this.DV) % this.DV; + // y == 1/x mod 2^dbits + // we really want the negative inverse, and -DV < y < DV + return y > 0 ? this.DV - y : -y; +} + +function bnEquals(a) { + return this.compareTo(a) == 0; +} + +// (protected) r = this + a +function bnpAddTo(a, r) { + var i = 0, + c = 0, + m = Math.min(a.t, this.t); + while (i < m) { + c += this[i] + a[i]; + r[i++] = c & this.DM; + c >>= this.DB; + } + if (a.t < this.t) { + c += a.s; + while (i < this.t) { + c += this[i]; + r[i++] = c & this.DM; + c >>= this.DB; + } + c += this.s; + } else { + c += this.s; + while (i < a.t) { + c += a[i]; + r[i++] = c & this.DM; + c >>= this.DB; + } + c += a.s; + } + r.s = c < 0 ? -1 : 0; + if (c > 0) r[i++] = c;else if (c < -1) r[i++] = this.DV + c; + r.t = i; + r.clamp(); +} + +// (public) this + a +function bnAdd(a) { + var r = nbi(); + + this.addTo(a, r); + + return r; +} + +// (public) this - a +function bnSubtract(a) { + var r = nbi(); + + this.subTo(a, r); + + return r; +} + +// (public) this * a +function bnMultiply(a) { + var r = nbi(); + + this.multiplyTo(a, r); + + return r; +} + +// (public) this / a +function bnDivide(a) { + var r = nbi(); + + this.divRemTo(a, r, null); + + return r; +} + +// Montgomery reduction +function Montgomery(m) { + this.m = m; + this.mp = m.invDigit(); + this.mpl = this.mp & 0x7fff; + this.mph = this.mp >> 15; + this.um = (1 << m.DB - 15) - 1; + this.mt2 = 2 * m.t; +} + +// xR mod m +function montConvert(x) { + var r = nbi(); + x.abs().dlShiftTo(this.m.t, r); + r.divRemTo(this.m, null, r); + if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r); + return r; +} + +// x/R mod m +function montRevert(x) { + var r = nbi(); + x.copyTo(r); + this.reduce(r); + return r; +} + +// x = x/R mod m (HAC 14.32) +function montReduce(x) { + while (x.t <= this.mt2) { + // pad x so am has enough room later + x[x.t++] = 0; + }for (var i = 0; i < this.m.t; ++i) { + // faster way of calculating u0 = x[i]*mp mod DV + var j = x[i] & 0x7fff; + var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM; + // use am to combine the multiply-shift-add into one call + j = i + this.m.t; + x[j] += this.m.am(0, u0, x, i, 0, this.m.t); + // propagate carry + while (x[j] >= x.DV) { + x[j] -= x.DV; + x[++j]++; + } + } + x.clamp(); + x.drShiftTo(this.m.t, x); + if (x.compareTo(this.m) >= 0) x.subTo(this.m, x); +} + +// r = "x^2/R mod m"; x != r +function montSqrTo(x, r) { + x.squareTo(r); + + this.reduce(r); +} + +// r = "xy/R mod m"; x,y != r +function montMulTo(x, y, r) { + x.multiplyTo(y, r); + + this.reduce(r); +} + +Montgomery.prototype.convert = montConvert; +Montgomery.prototype.revert = montRevert; +Montgomery.prototype.reduce = montReduce; +Montgomery.prototype.mulTo = montMulTo; +Montgomery.prototype.sqrTo = montSqrTo; + +// (public) this^e % m (HAC 14.85) +function bnModPow(e, m, callback) { + var i = e.bitLength(), + k, + r = nbv(1), + z = new Montgomery(m); + if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6; + + // precomputation + var g = new Array(), + n = 3, + k1 = k - 1, + km = (1 << k) - 1; + g[1] = z.convert(this); + if (k > 1) { + var g2 = nbi(); + z.sqrTo(g[1], g2); + while (n <= km) { + g[n] = nbi(); + z.mulTo(g2, g[n - 2], g[n]); + n += 2; + } + } + + var j = e.t - 1, + w, + is1 = true, + r2 = nbi(), + t; + i = nbits(e[j]) - 1; + while (j >= 0) { + if (i >= k1) w = e[j] >> i - k1 & km;else { + w = (e[j] & (1 << i + 1) - 1) << k1 - i; + if (j > 0) w |= e[j - 1] >> this.DB + i - k1; + } + + n = k; + while ((w & 1) == 0) { + w >>= 1; + --n; + } + if ((i -= n) < 0) { + i += this.DB; + --j; + } + if (is1) { + // ret == 1, don't bother squaring or multiplying it + g[w].copyTo(r); + is1 = false; + } else { + while (n > 1) { + z.sqrTo(r, r2); + z.sqrTo(r2, r); + n -= 2; + } + if (n > 0) z.sqrTo(r, r2);else { + t = r; + r = r2; + r2 = t; + } + z.mulTo(r2, g[w], r); + } + + while (j >= 0 && (e[j] & 1 << i) == 0) { + z.sqrTo(r, r2); + t = r; + r = r2; + r2 = t; + if (--i < 0) { + i = this.DB - 1; + --j; + } + } + } + var result = z.revert(r); + callback(null, result); + return result; +} + +// protected +BigInteger.prototype.copyTo = bnpCopyTo; +BigInteger.prototype.fromInt = bnpFromInt; +BigInteger.prototype.fromString = bnpFromString; +BigInteger.prototype.clamp = bnpClamp; +BigInteger.prototype.dlShiftTo = bnpDLShiftTo; +BigInteger.prototype.drShiftTo = bnpDRShiftTo; +BigInteger.prototype.lShiftTo = bnpLShiftTo; +BigInteger.prototype.rShiftTo = bnpRShiftTo; +BigInteger.prototype.subTo = bnpSubTo; +BigInteger.prototype.multiplyTo = bnpMultiplyTo; +BigInteger.prototype.squareTo = bnpSquareTo; +BigInteger.prototype.divRemTo = bnpDivRemTo; +BigInteger.prototype.invDigit = bnpInvDigit; +BigInteger.prototype.addTo = bnpAddTo; + +// public +BigInteger.prototype.toString = bnToString; +BigInteger.prototype.negate = bnNegate; +BigInteger.prototype.abs = bnAbs; +BigInteger.prototype.compareTo = bnCompareTo; +BigInteger.prototype.bitLength = bnBitLength; +BigInteger.prototype.mod = bnMod; +BigInteger.prototype.equals = bnEquals; +BigInteger.prototype.add = bnAdd; +BigInteger.prototype.subtract = bnSubtract; +BigInteger.prototype.multiply = bnMultiply; +BigInteger.prototype.divide = bnDivide; +BigInteger.prototype.modPow = bnModPow; + +// "constants" +BigInteger.ZERO = nbv(0); +BigInteger.ONE = nbv(1); - BigInteger.prototype.DB = dbits; - BigInteger.prototype.DM = (1 << dbits) - 1; - BigInteger.prototype.DV = 1 << dbits; - - var BI_FP = 52; - BigInteger.prototype.FV = Math.pow(2, BI_FP); - BigInteger.prototype.F1 = BI_FP - dbits; - BigInteger.prototype.F2 = 2 * dbits - BI_FP; - - // Digit conversions - var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz"; - var BI_RC = new Array(); - var rr, vv; - rr = "0".charCodeAt(0); - for (vv = 0; vv <= 9; ++vv) { - BI_RC[rr++] = vv; - }rr = "a".charCodeAt(0); - for (vv = 10; vv < 36; ++vv) { - BI_RC[rr++] = vv; - }rr = "A".charCodeAt(0); - for (vv = 10; vv < 36; ++vv) { - BI_RC[rr++] = vv; - }function int2char(n) { - return BI_RM.charAt(n); - } - function intAt(s, i) { - var c = BI_RC[s.charCodeAt(i)]; - return c == null ? -1 : c; - } +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { - // (protected) copy this to r - function bnpCopyTo(r) { - for (var i = this.t - 1; i >= 0; --i) { - r[i] = this[i]; - }r.t = this.t; - r.s = this.s; - } +"use strict"; - // (protected) set from integer value x, -DV <= x < DV - function bnpFromInt(x) { - this.t = 1; - this.s = x < 0 ? -1 : 0; - if (x > 0) this[0] = x;else if (x < -1) this[0] = x + this.DV;else this.t = 0; - } - // return bigint initialized to value - function nbv(i) { - var r = nbi(); +exports.__esModule = true; - r.fromInt(i); +var _buffer = __webpack_require__(0); - return r; - } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /*! + * Copyright 2016 Amazon.com, + * Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Amazon Software License (the "License"). + * You may not use this file except in compliance with the + * License. A copy of the License is located at + * + * http://aws.amazon.com/asl/ + * + * or in the "license" file accompanying this file. This file is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, express or implied. See the License + * for the specific language governing permissions and + * limitations under the License. + */ - // (protected) set from string and radix - function bnpFromString(s, b) { - var k; - if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported"); - this.t = 0; - this.s = 0; - var i = s.length, - mi = false, - sh = 0; - while (--i >= 0) { - var x = intAt(s, i); - if (x < 0) { - if (s.charAt(i) == "-") mi = true; - continue; - } - mi = false; - if (sh == 0) this[this.t++] = x;else if (sh + k > this.DB) { - this[this.t - 1] |= (x & (1 << this.DB - sh) - 1) << sh; - this[this.t++] = x >> this.DB - sh; - } else this[this.t - 1] |= x << sh; - sh += k; - if (sh >= this.DB) sh -= this.DB; - } - this.clamp(); - if (mi) BigInteger.ZERO.subTo(this, this); - } +/** @class */ +var CognitoJwtToken = function () { + /** + * Constructs a new CognitoJwtToken object + * @param {string=} token The JWT token. + */ + function CognitoJwtToken(token) { + _classCallCheck(this, CognitoJwtToken); - // (protected) clamp off excess high words - function bnpClamp() { - var c = this.s & this.DM; - while (this.t > 0 && this[this.t - 1] == c) { - --this.t; - } - } + // Assign object + this.jwtToken = token || ''; + this.payload = this.decodePayload(); + } - // (public) return string representation in given radix - function bnToString(b) { - if (this.s < 0) return "-" + this.negate().toString(); - var k; - if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported"); - var km = (1 << k) - 1, - d, - m = false, - r = "", - i = this.t; - var p = this.DB - i * this.DB % k; - if (i-- > 0) { - if (p < this.DB && (d = this[i] >> p) > 0) { - m = true; - r = int2char(d); - } - while (i >= 0) { - if (p < k) { - d = (this[i] & (1 << p) - 1) << k - p; - d |= this[--i] >> (p += this.DB - k); - } else { - d = this[i] >> (p -= k) & km; - if (p <= 0) { - p += this.DB; - --i; - } - } - if (d > 0) m = true; - if (m) r += int2char(d); - } - } - return m ? r : "0"; - } + /** + * @returns {string} the record's token. + */ - // (public) -this - function bnNegate() { - var r = nbi(); - BigInteger.ZERO.subTo(this, r); + CognitoJwtToken.prototype.getJwtToken = function getJwtToken() { + return this.jwtToken; + }; - return r; - } + /** + * @returns {int} the token's expiration (exp member). + */ - // (public) |this| - function bnAbs() { - return this.s < 0 ? this.negate() : this; - } - // (public) return + if this > a, - if this < a, 0 if equal - function bnCompareTo(a) { - var r = this.s - a.s; - if (r != 0) return r; - var i = this.t; - r = i - a.t; - if (r != 0) return this.s < 0 ? -r : r; - while (--i >= 0) { - if ((r = this[i] - a[i]) != 0) return r; - }return 0; - } + CognitoJwtToken.prototype.getExpiration = function getExpiration() { + return this.payload.exp; + }; - // returns bit length of the integer x - function nbits(x) { - var r = 1, - t; - if ((t = x >>> 16) != 0) { - x = t; - r += 16; - } - if ((t = x >> 8) != 0) { - x = t; - r += 8; - } - if ((t = x >> 4) != 0) { - x = t; - r += 4; - } - if ((t = x >> 2) != 0) { - x = t; - r += 2; - } - if ((t = x >> 1) != 0) { - x = t; - r += 1; - } - return r; - } + /** + * @returns {int} the token's "issued at" (iat member). + */ - // (public) return the number of bits in "this" - function bnBitLength() { - if (this.t <= 0) return 0; - return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM); - } - // (protected) r = this << n*DB - function bnpDLShiftTo(n, r) { - var i; - for (i = this.t - 1; i >= 0; --i) { - r[i + n] = this[i]; - }for (i = n - 1; i >= 0; --i) { - r[i] = 0; - }r.t = this.t + n; - r.s = this.s; - } + CognitoJwtToken.prototype.getIssuedAt = function getIssuedAt() { + return this.payload.iat; + }; - // (protected) r = this >> n*DB - function bnpDRShiftTo(n, r) { - for (var i = n; i < this.t; ++i) { - r[i - n] = this[i]; - }r.t = Math.max(this.t - n, 0); - r.s = this.s; - } + /** + * @returns {object} the token's payload. + */ - // (protected) r = this << n - function bnpLShiftTo(n, r) { - var bs = n % this.DB; - var cbs = this.DB - bs; - var bm = (1 << cbs) - 1; - var ds = Math.floor(n / this.DB), - c = this.s << bs & this.DM, - i; - for (i = this.t - 1; i >= 0; --i) { - r[i + ds + 1] = this[i] >> cbs | c; - c = (this[i] & bm) << bs; - } - for (i = ds - 1; i >= 0; --i) { - r[i] = 0; - }r[ds] = c; - r.t = this.t + ds + 1; - r.s = this.s; - r.clamp(); - } - // (protected) r = this >> n - function bnpRShiftTo(n, r) { - r.s = this.s; - var ds = Math.floor(n / this.DB); - if (ds >= this.t) { - r.t = 0; - return; - } - var bs = n % this.DB; - var cbs = this.DB - bs; - var bm = (1 << bs) - 1; - r[0] = this[ds] >> bs; - for (var i = ds + 1; i < this.t; ++i) { - r[i - ds - 1] |= (this[i] & bm) << cbs; - r[i - ds] = this[i] >> bs; - } - if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs; - r.t = this.t - ds; - r.clamp(); - } + CognitoJwtToken.prototype.decodePayload = function decodePayload() { + var payload = this.jwtToken.split('.')[1]; + try { + return JSON.parse(_buffer.Buffer.from(payload, 'base64').toString('utf8')); + } catch (err) { + return {}; + } + }; - // (protected) r = this - a - function bnpSubTo(a, r) { - var i = 0, - c = 0, - m = Math.min(a.t, this.t); - while (i < m) { - c += this[i] - a[i]; - r[i++] = c & this.DM; - c >>= this.DB; - } - if (a.t < this.t) { - c -= a.s; - while (i < this.t) { - c += this[i]; - r[i++] = c & this.DM; - c >>= this.DB; - } - c += this.s; - } else { - c += this.s; - while (i < a.t) { - c -= a[i]; - r[i++] = c & this.DM; - c >>= this.DB; - } - c -= a.s; - } - r.s = c < 0 ? -1 : 0; - if (c < -1) r[i++] = this.DV + c;else if (c > 0) r[i++] = c; - r.t = i; - r.clamp(); - } + return CognitoJwtToken; +}(); - // (protected) r = this * a, r != this,a (HAC 14.12) - // "this" should be the larger one if appropriate. - function bnpMultiplyTo(a, r) { - var x = this.abs(), - y = a.abs(); - var i = x.t; - r.t = i + y.t; - while (--i >= 0) { - r[i] = 0; - }for (i = 0; i < y.t; ++i) { - r[i + x.t] = x.am(0, y[i], r, i, 0, x.t); - }r.s = 0; - r.clamp(); - if (this.s != a.s) BigInteger.ZERO.subTo(r, r); - } - - // (protected) r = this^2, r != this (HAC 14.16) - function bnpSquareTo(r) { - var x = this.abs(); - var i = r.t = 2 * x.t; - while (--i >= 0) { - r[i] = 0; - }for (i = 0; i < x.t - 1; ++i) { - var c = x.am(i, x[i], r, 2 * i, 0, 1); - if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) { - r[i + x.t] -= x.DV; - r[i + x.t + 1] = 1; - } - } - if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1); - r.s = 0; - r.clamp(); - } - - // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) - // r != q, this != m. q or r may be null. - function bnpDivRemTo(m, q, r) { - var pm = m.abs(); - if (pm.t <= 0) return; - var pt = this.abs(); - if (pt.t < pm.t) { - if (q != null) q.fromInt(0); - if (r != null) this.copyTo(r); - return; - } - if (r == null) r = nbi(); - var y = nbi(), - ts = this.s, - ms = m.s; - var nsh = this.DB - nbits(pm[pm.t - 1]); - // normalize modulus - if (nsh > 0) { - pm.lShiftTo(nsh, y); - pt.lShiftTo(nsh, r); - } else { - pm.copyTo(y); - pt.copyTo(r); - } - var ys = y.t; - var y0 = y[ys - 1]; - if (y0 == 0) return; - var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0); - var d1 = this.FV / yt, - d2 = (1 << this.F1) / yt, - e = 1 << this.F2; - var i = r.t, - j = i - ys, - t = q == null ? nbi() : q; - y.dlShiftTo(j, t); - if (r.compareTo(t) >= 0) { - r[r.t++] = 1; - r.subTo(t, r); - } - BigInteger.ONE.dlShiftTo(ys, t); - t.subTo(y, y); - // "negative" y so we can replace sub with am later - while (y.t < ys) { - y[y.t++] = 0; - }while (--j >= 0) { - // Estimate quotient digit - var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2); - if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { - // Try it out - y.dlShiftTo(j, t); - r.subTo(t, r); - while (r[i] < --qd) { - r.subTo(t, r); - } - } - } - if (q != null) { - r.drShiftTo(ys, q); - if (ts != ms) BigInteger.ZERO.subTo(q, q); - } - r.t = ys; - r.clamp(); - if (nsh > 0) r.rShiftTo(nsh, r); - // Denormalize remainder - if (ts < 0) BigInteger.ZERO.subTo(r, r); - } - - // (public) this mod a - function bnMod(a) { - var r = nbi(); - this.abs().divRemTo(a, null, r); - if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r); - return r; - } - - // (protected) return "-1/this % 2^DB"; useful for Mont. reduction - // justification: - // xy == 1 (mod m) - // xy = 1+km - // xy(2-xy) = (1+km)(1-km) - // x[y(2-xy)] = 1-k^2m^2 - // x[y(2-xy)] == 1 (mod m^2) - // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 - // should reduce x and y(2-xy) by m^2 at each step to keep size bounded. - // JS multiply "overflows" differently from C/C++, so care is needed here. - function bnpInvDigit() { - if (this.t < 1) return 0; - var x = this[0]; - if ((x & 1) == 0) return 0; - var y = x & 3; - // y == 1/x mod 2^2 - y = y * (2 - (x & 0xf) * y) & 0xf; - // y == 1/x mod 2^4 - y = y * (2 - (x & 0xff) * y) & 0xff; - // y == 1/x mod 2^8 - y = y * (2 - ((x & 0xffff) * y & 0xffff)) & 0xffff; - // y == 1/x mod 2^16 - // last step - calculate inverse mod DV directly; - // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints - y = y * (2 - x * y % this.DV) % this.DV; - // y == 1/x mod 2^dbits - // we really want the negative inverse, and -DV < y < DV - return y > 0 ? this.DV - y : -y; - } - - function bnEquals(a) { - return this.compareTo(a) == 0; - } - - // (protected) r = this + a - function bnpAddTo(a, r) { - var i = 0, - c = 0, - m = Math.min(a.t, this.t); - while (i < m) { - c += this[i] + a[i]; - r[i++] = c & this.DM; - c >>= this.DB; - } - if (a.t < this.t) { - c += a.s; - while (i < this.t) { - c += this[i]; - r[i++] = c & this.DM; - c >>= this.DB; - } - c += this.s; - } else { - c += this.s; - while (i < a.t) { - c += a[i]; - r[i++] = c & this.DM; - c >>= this.DB; - } - c += a.s; - } - r.s = c < 0 ? -1 : 0; - if (c > 0) r[i++] = c;else if (c < -1) r[i++] = this.DV + c; - r.t = i; - r.clamp(); - } - - // (public) this + a - function bnAdd(a) { - var r = nbi(); - - this.addTo(a, r); - - return r; - } - - // (public) this - a - function bnSubtract(a) { - var r = nbi(); - - this.subTo(a, r); - - return r; - } - - // (public) this * a - function bnMultiply(a) { - var r = nbi(); - - this.multiplyTo(a, r); - - return r; - } - - // (public) this / a - function bnDivide(a) { - var r = nbi(); - - this.divRemTo(a, r, null); - - return r; - } - - // Montgomery reduction - function Montgomery(m) { - this.m = m; - this.mp = m.invDigit(); - this.mpl = this.mp & 0x7fff; - this.mph = this.mp >> 15; - this.um = (1 << m.DB - 15) - 1; - this.mt2 = 2 * m.t; - } - - // xR mod m - function montConvert(x) { - var r = nbi(); - x.abs().dlShiftTo(this.m.t, r); - r.divRemTo(this.m, null, r); - if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r); - return r; - } - - // x/R mod m - function montRevert(x) { - var r = nbi(); - x.copyTo(r); - this.reduce(r); - return r; - } - - // x = x/R mod m (HAC 14.32) - function montReduce(x) { - while (x.t <= this.mt2) { - // pad x so am has enough room later - x[x.t++] = 0; - }for (var i = 0; i < this.m.t; ++i) { - // faster way of calculating u0 = x[i]*mp mod DV - var j = x[i] & 0x7fff; - var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM; - // use am to combine the multiply-shift-add into one call - j = i + this.m.t; - x[j] += this.m.am(0, u0, x, i, 0, this.m.t); - // propagate carry - while (x[j] >= x.DV) { - x[j] -= x.DV; - x[++j]++; - } - } - x.clamp(); - x.drShiftTo(this.m.t, x); - if (x.compareTo(this.m) >= 0) x.subTo(this.m, x); - } - - // r = "x^2/R mod m"; x != r - function montSqrTo(x, r) { - x.squareTo(r); - - this.reduce(r); - } - - // r = "xy/R mod m"; x,y != r - function montMulTo(x, y, r) { - x.multiplyTo(y, r); - - this.reduce(r); - } - - Montgomery.prototype.convert = montConvert; - Montgomery.prototype.revert = montRevert; - Montgomery.prototype.reduce = montReduce; - Montgomery.prototype.mulTo = montMulTo; - Montgomery.prototype.sqrTo = montSqrTo; - - // (public) this^e % m (HAC 14.85) - function bnModPow(e, m, callback) { - var i = e.bitLength(), - k, - r = nbv(1), - z = new Montgomery(m); - if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6; - - // precomputation - var g = new Array(), - n = 3, - k1 = k - 1, - km = (1 << k) - 1; - g[1] = z.convert(this); - if (k > 1) { - var g2 = nbi(); - z.sqrTo(g[1], g2); - while (n <= km) { - g[n] = nbi(); - z.mulTo(g2, g[n - 2], g[n]); - n += 2; - } - } - - var j = e.t - 1, - w, - is1 = true, - r2 = nbi(), - t; - i = nbits(e[j]) - 1; - while (j >= 0) { - if (i >= k1) w = e[j] >> i - k1 & km;else { - w = (e[j] & (1 << i + 1) - 1) << k1 - i; - if (j > 0) w |= e[j - 1] >> this.DB + i - k1; - } - - n = k; - while ((w & 1) == 0) { - w >>= 1; - --n; - } - if ((i -= n) < 0) { - i += this.DB; - --j; - } - if (is1) { - // ret == 1, don't bother squaring or multiplying it - g[w].copyTo(r); - is1 = false; - } else { - while (n > 1) { - z.sqrTo(r, r2); - z.sqrTo(r2, r); - n -= 2; - } - if (n > 0) z.sqrTo(r, r2);else { - t = r; - r = r2; - r2 = t; - } - z.mulTo(r2, g[w], r); - } - - while (j >= 0 && (e[j] & 1 << i) == 0) { - z.sqrTo(r, r2); - t = r; - r = r2; - r2 = t; - if (--i < 0) { - i = this.DB - 1; - --j; - } - } - } - var result = z.revert(r); - callback(null, result); - return result; - } - - // protected - BigInteger.prototype.copyTo = bnpCopyTo; - BigInteger.prototype.fromInt = bnpFromInt; - BigInteger.prototype.fromString = bnpFromString; - BigInteger.prototype.clamp = bnpClamp; - BigInteger.prototype.dlShiftTo = bnpDLShiftTo; - BigInteger.prototype.drShiftTo = bnpDRShiftTo; - BigInteger.prototype.lShiftTo = bnpLShiftTo; - BigInteger.prototype.rShiftTo = bnpRShiftTo; - BigInteger.prototype.subTo = bnpSubTo; - BigInteger.prototype.multiplyTo = bnpMultiplyTo; - BigInteger.prototype.squareTo = bnpSquareTo; - BigInteger.prototype.divRemTo = bnpDivRemTo; - BigInteger.prototype.invDigit = bnpInvDigit; - BigInteger.prototype.addTo = bnpAddTo; - - // public - BigInteger.prototype.toString = bnToString; - BigInteger.prototype.negate = bnNegate; - BigInteger.prototype.abs = bnAbs; - BigInteger.prototype.compareTo = bnCompareTo; - BigInteger.prototype.bitLength = bnBitLength; - BigInteger.prototype.mod = bnMod; - BigInteger.prototype.equals = bnEquals; - BigInteger.prototype.add = bnAdd; - BigInteger.prototype.subtract = bnSubtract; - BigInteger.prototype.multiply = bnMultiply; - BigInteger.prototype.divide = bnDivide; - BigInteger.prototype.modPow = bnModPow; - - // "constants" - BigInteger.ZERO = nbv(0); - BigInteger.ONE = nbv(1); +exports.default = CognitoJwtToken; /***/ }), -/* 5 */ +/* 12 */ /***/ (function(module, exports, __webpack_require__) { - 'use strict'; +"use strict"; - exports.__esModule = true; - var _CognitoJwtToken2 = __webpack_require__(7); +exports.__esModule = true; - var _CognitoJwtToken3 = _interopRequireDefault(_CognitoJwtToken2); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/*! + * Copyright 2016 Amazon.com, + * Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Amazon Software License (the "License"). + * You may not use this file except in compliance with the + * License. A copy of the License is located at + * + * http://aws.amazon.com/asl/ + * + * or in the "license" file accompanying this file. This file is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, express or implied. See the License + * for the specific language governing permissions and + * limitations under the License. + */ - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var dataMemory = {}; - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +/** @class */ - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* - * Copyright 2016 Amazon.com, - * Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Amazon Software License (the "License"). - * You may not use this file except in compliance with the - * License. A copy of the License is located at - * - * http://aws.amazon.com/asl/ - * - * or in the "license" file accompanying this file. This file is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, express or implied. See the License - * for the specific language governing permissions and - * limitations under the License. - */ +var MemoryStorage = function () { + function MemoryStorage() { + _classCallCheck(this, MemoryStorage); + } - /** @class */ - var CognitoAccessToken = function (_CognitoJwtToken) { - _inherits(CognitoAccessToken, _CognitoJwtToken); + /** + * This is used to set a specific item in storage + * @param {string} key - the key for the item + * @param {object} value - the value + * @returns {string} value that was set + */ + MemoryStorage.setItem = function setItem(key, value) { + dataMemory[key] = value; + return dataMemory[key]; + }; - /** - * Constructs a new CognitoAccessToken object - * @param {string=} AccessToken The JWT access token. - */ - function CognitoAccessToken() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - AccessToken = _ref.AccessToken; + /** + * This is used to get a specific key from storage + * @param {string} key - the key for the item + * This is used to clear the storage + * @returns {string} the data item + */ - _classCallCheck(this, CognitoAccessToken); - return _possibleConstructorReturn(this, _CognitoJwtToken.call(this, AccessToken || '')); - } + MemoryStorage.getItem = function getItem(key) { + return Object.prototype.hasOwnProperty.call(dataMemory, key) ? dataMemory[key] : undefined; + }; - return CognitoAccessToken; - }(_CognitoJwtToken3.default); + /** + * This is used to remove an item from storage + * @param {string} key - the key being set + * @returns {string} value - value that was deleted + */ - exports.default = CognitoAccessToken; -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { + MemoryStorage.removeItem = function removeItem(key) { + return delete dataMemory[key]; + }; - 'use strict'; + /** + * This is used to clear the storage + * @returns {string} nothing + */ - exports.__esModule = true; - var _CognitoJwtToken2 = __webpack_require__(7); + MemoryStorage.clear = function clear() { + dataMemory = {}; + return dataMemory; + }; - var _CognitoJwtToken3 = _interopRequireDefault(_CognitoJwtToken2); + return MemoryStorage; +}(); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/** @class */ - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +var StorageHelper = function () { - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*! - * Copyright 2016 Amazon.com, - * Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Amazon Software License (the "License"). - * You may not use this file except in compliance with the - * License. A copy of the License is located at - * - * http://aws.amazon.com/asl/ - * - * or in the "license" file accompanying this file. This file is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, express or implied. See the License - * for the specific language governing permissions and - * limitations under the License. - */ + /** + * This is used to get a storage object + * @returns {object} the storage + */ + function StorageHelper() { + _classCallCheck(this, StorageHelper); - /** @class */ - var CognitoIdToken = function (_CognitoJwtToken) { - _inherits(CognitoIdToken, _CognitoJwtToken); + try { + this.storageWindow = window.localStorage; + this.storageWindow.setItem('aws.cognito.test-ls', 1); + this.storageWindow.removeItem('aws.cognito.test-ls'); + } catch (exception) { + this.storageWindow = MemoryStorage; + } + } - /** - * Constructs a new CognitoIdToken object - * @param {string=} IdToken The JWT Id token - */ - function CognitoIdToken() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - IdToken = _ref.IdToken; + /** + * This is used to return the storage + * @returns {object} the storage + */ - _classCallCheck(this, CognitoIdToken); - return _possibleConstructorReturn(this, _CognitoJwtToken.call(this, IdToken || '')); - } + StorageHelper.prototype.getStorage = function getStorage() { + return this.storageWindow; + }; - return CognitoIdToken; - }(_CognitoJwtToken3.default); + return StorageHelper; +}(); - exports.default = CognitoIdToken; +exports.default = StorageHelper; /***/ }), -/* 7 */ +/* 13 */ /***/ (function(module, exports, __webpack_require__) { - 'use strict'; - - exports.__esModule = true; - - var _buffer = __webpack_require__(1); - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /*! - * Copyright 2016 Amazon.com, - * Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Amazon Software License (the "License"). - * You may not use this file except in compliance with the - * License. A copy of the License is located at - * - * http://aws.amazon.com/asl/ - * - * or in the "license" file accompanying this file. This file is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, express or implied. See the License - * for the specific language governing permissions and - * limitations under the License. - */ - - /** @class */ - var CognitoJwtToken = function () { - /** - * Constructs a new CognitoJwtToken object - * @param {string=} token The JWT token. - */ - function CognitoJwtToken(token) { - _classCallCheck(this, CognitoJwtToken); - - // Assign object - this.jwtToken = token || ''; - this.payload = this.decodePayload(); - } - - /** - * @returns {string} the record's token. - */ - - - CognitoJwtToken.prototype.getJwtToken = function getJwtToken() { - return this.jwtToken; - }; - - /** - * @returns {int} the token's expiration (exp member). - */ - - - CognitoJwtToken.prototype.getExpiration = function getExpiration() { - return this.payload.exp; - }; +var Buffer = __webpack_require__(0).Buffer +var sha = __webpack_require__(23) +var sha256 = __webpack_require__(24) +var rng = __webpack_require__(22) +var md5 = __webpack_require__(21) + +var algorithms = { + sha1: sha, + sha256: sha256, + md5: md5 +} + +var blocksize = 64 +var zeroBuffer = new Buffer(blocksize); zeroBuffer.fill(0) +function hmac(fn, key, data) { + if(!Buffer.isBuffer(key)) key = new Buffer(key) + if(!Buffer.isBuffer(data)) data = new Buffer(data) + + if(key.length > blocksize) { + key = fn(key) + } else if(key.length < blocksize) { + key = Buffer.concat([key, zeroBuffer], blocksize) + } + + var ipad = new Buffer(blocksize), opad = new Buffer(blocksize) + for(var i = 0; i < blocksize; i++) { + ipad[i] = key[i] ^ 0x36 + opad[i] = key[i] ^ 0x5C + } + + var hash = fn(Buffer.concat([ipad, data])) + return fn(Buffer.concat([opad, hash])) +} + +function hash(alg, key) { + alg = alg || 'sha1' + var fn = algorithms[alg] + var bufs = [] + var length = 0 + if(!fn) error('algorithm:', alg, 'is not yet supported') + return { + update: function (data) { + if(!Buffer.isBuffer(data)) data = new Buffer(data) + + bufs.push(data) + length += data.length + return this + }, + digest: function (enc) { + var buf = Buffer.concat(bufs) + var r = key ? hmac(fn, key, buf) : fn(buf) + bufs = null + return enc ? r.toString(enc) : r + } + } +} + +function error () { + var m = [].slice.call(arguments).join(' ') + throw new Error([ + m, + 'we accept pull requests', + 'http://github.com/dominictarr/crypto-browserify' + ].join('\n')) +} + +exports.createHash = function (alg) { return hash(alg) } +exports.createHmac = function (alg, key) { return hash(alg, key) } +exports.randomBytes = function(size, callback) { + if (callback && callback.call) { + try { + callback.call(this, undefined, new Buffer(rng(size))) + } catch (err) { callback(err) } + } else { + return new Buffer(rng(size)) + } +} + +function each(a, f) { + for(var i in a) + f(a[i], i) +} + +// the least I can do is make error messages for the rest of the node.js/crypto api. +each(['createCredentials' +, 'createCipher' +, 'createCipheriv' +, 'createDecipher' +, 'createDecipheriv' +, 'createSign' +, 'createVerify' +, 'createDiffieHellman' +, 'pbkdf2'], function (name) { + exports[name] = function () { + error('sorry,', name, 'is not implemented yet') + } +}) - /** - * @returns {int} the token's "issued at" (iat member). - */ - - - CognitoJwtToken.prototype.getIssuedAt = function getIssuedAt() { - return this.payload.iat; - }; - - /** - * @returns {object} the token's payload. - */ - - - CognitoJwtToken.prototype.decodePayload = function decodePayload() { - var payload = this.jwtToken.split('.')[1]; - try { - return JSON.parse(_buffer.Buffer.from(payload, 'base64').toString('utf8')); - } catch (err) { - return {}; - } - }; - - return CognitoJwtToken; - }(); - - exports.default = CognitoJwtToken; - -/***/ }), -/* 8 */ -/***/ (function(module, exports) { - - 'use strict'; - - exports.__esModule = true; - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - /*! - * Copyright 2016 Amazon.com, - * Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Amazon Software License (the "License"). - * You may not use this file except in compliance with the - * License. A copy of the License is located at - * - * http://aws.amazon.com/asl/ - * - * or in the "license" file accompanying this file. This file is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, express or implied. See the License - * for the specific language governing permissions and - * limitations under the License. - */ - - /** @class */ - var CognitoRefreshToken = function () { - /** - * Constructs a new CognitoRefreshToken object - * @param {string=} RefreshToken The JWT refresh token. - */ - function CognitoRefreshToken() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - RefreshToken = _ref.RefreshToken; - - _classCallCheck(this, CognitoRefreshToken); - - // Assign object - this.token = RefreshToken || ''; - } - - /** - * @returns {string} the record's token. - */ - - - CognitoRefreshToken.prototype.getToken = function getToken() { - return this.token; - }; - - return CognitoRefreshToken; - }(); - - exports.default = CognitoRefreshToken; /***/ }), -/* 9 */ +/* 14 */ /***/ (function(module, exports, __webpack_require__) { - 'use strict'; - - exports.__esModule = true; - - var _buffer = __webpack_require__(1); - - var _cryptoBrowserify = __webpack_require__(14); - - var crypto = _interopRequireWildcard(_cryptoBrowserify); - - var _BigInteger = __webpack_require__(4); - - var _BigInteger2 = _interopRequireDefault(_BigInteger); - - var _AuthenticationHelper = __webpack_require__(3); - - var _AuthenticationHelper2 = _interopRequireDefault(_AuthenticationHelper); - - var _CognitoAccessToken = __webpack_require__(5); - - var _CognitoAccessToken2 = _interopRequireDefault(_CognitoAccessToken); - - var _CognitoIdToken = __webpack_require__(6); - - var _CognitoIdToken2 = _interopRequireDefault(_CognitoIdToken); +"use strict"; - var _CognitoRefreshToken = __webpack_require__(8); - var _CognitoRefreshToken2 = _interopRequireDefault(_CognitoRefreshToken); +exports.__esModule = true; - var _CognitoUserSession = __webpack_require__(11); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - var _CognitoUserSession2 = _interopRequireDefault(_CognitoUserSession); - - var _DateHelper = __webpack_require__(12); - - var _DateHelper2 = _interopRequireDefault(_DateHelper); - - var _CognitoUserAttribute = __webpack_require__(10); - - var _CognitoUserAttribute2 = _interopRequireDefault(_CognitoUserAttribute); - - var _StorageHelper = __webpack_require__(13); +/*! + * Copyright 2016 Amazon.com, + * Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Amazon Software License (the "License"). + * You may not use this file except in compliance with the + * License. A copy of the License is located at + * + * http://aws.amazon.com/asl/ + * + * or in the "license" file accompanying this file. This file is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, express or implied. See the License + * for the specific language governing permissions and + * limitations under the License. + */ - var _StorageHelper2 = _interopRequireDefault(_StorageHelper); +/** @class */ +var AuthenticationDetails = function () { + /** + * Constructs a new AuthenticationDetails object + * @param {object=} data Creation options. + * @param {string} data.Username User being authenticated. + * @param {string} data.Password Plain-text password to authenticate with. + * @param {(AttributeArg[])?} data.ValidationData Application extra metadata. + * @param {(AttributeArg[])?} data.AuthParamaters Authentication paramaters for custom auth. + */ + function AuthenticationDetails(data) { + _classCallCheck(this, AuthenticationDetails); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _ref = data || {}, + ValidationData = _ref.ValidationData, + Username = _ref.Username, + Password = _ref.Password, + AuthParameters = _ref.AuthParameters; - function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + this.validationData = ValidationData || {}; + this.authParameters = AuthParameters || {}; + this.username = Username; + this.password = Password; + } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /*! - * Copyright 2016 Amazon.com, - * Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Amazon Software License (the "License"). - * You may not use this file except in compliance with the - * License. A copy of the License is located at - * - * http://aws.amazon.com/asl/ - * - * or in the "license" file accompanying this file. This file is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, express or implied. See the License - * for the specific language governing permissions and - * limitations under the License. - */ + /** + * @returns {string} the record's username + */ - //import createHmac from 'create-hmac'; + AuthenticationDetails.prototype.getUsername = function getUsername() { + return this.username; + }; - var createHmac = crypto.createHmac; + /** + * @returns {string} the record's password + */ - /** - * @callback nodeCallback - * @template T result - * @param {*} err The operation failure reason, or null. - * @param {T} result The operation result. - */ - /** - * @callback onFailure - * @param {*} err Failure reason. - */ + AuthenticationDetails.prototype.getPassword = function getPassword() { + return this.password; + }; - /** - * @callback onSuccess - * @template T result - * @param {T} result The operation result. - */ + /** + * @returns {Array} the record's validationData + */ - /** - * @callback mfaRequired - * @param {*} details MFA challenge details. - */ - /** - * @callback customChallenge - * @param {*} details Custom challenge details. - */ + AuthenticationDetails.prototype.getValidationData = function getValidationData() { + return this.validationData; + }; - /** - * @callback inputVerificationCode - * @param {*} data Server response. - */ + /** + * @returns {Array} the record's authParameters + */ - /** - * @callback authSuccess - * @param {CognitoUserSession} session The new session. - * @param {bool=} userConfirmationNecessary User must be confirmed. - */ - /** @class */ - var CognitoUser = function () { - /** - * Constructs a new CognitoUser object - * @param {object} data Creation options - * @param {string} data.Username The user's username. - * @param {CognitoUserPool} data.Pool Pool containing the user. - * @param {object} data.Storage Optional storage object. - */ - function CognitoUser(data) { - _classCallCheck(this, CognitoUser); + AuthenticationDetails.prototype.getAuthParameters = function getAuthParameters() { + return this.authParameters; + }; - if (data == null || data.Username == null || data.Pool == null) { - throw new Error('Username and pool information are required.'); - } + return AuthenticationDetails; +}(); - this.username = data.Username || ''; - this.pool = data.Pool; - this.Session = null; - - this.client = data.Pool.client; - - this.signInUserSession = null; - this.authenticationFlowType = 'USER_SRP_AUTH'; - - this.storage = data.Storage || new _StorageHelper2.default().getStorage(); - } - - /** - * Sets the session for this user - * @param {CognitoUserSession} signInUserSession the session - * @returns {void} - */ - - - CognitoUser.prototype.setSignInUserSession = function setSignInUserSession(signInUserSession) { - this.clearCachedTokens(); - this.signInUserSession = signInUserSession; - this.cacheTokens(); - }; - - /** - * @returns {CognitoUserSession} the current session for this user - */ - - - CognitoUser.prototype.getSignInUserSession = function getSignInUserSession() { - return this.signInUserSession; - }; - - /** - * @returns {string} the user's username - */ - - - CognitoUser.prototype.getUsername = function getUsername() { - return this.username; - }; - - /** - * @returns {String} the authentication flow type - */ - - - CognitoUser.prototype.getAuthenticationFlowType = function getAuthenticationFlowType() { - return this.authenticationFlowType; - }; - - /** - * sets authentication flow type - * @param {string} authenticationFlowType New value. - * @returns {void} - */ - - - CognitoUser.prototype.setAuthenticationFlowType = function setAuthenticationFlowType(authenticationFlowType) { - this.authenticationFlowType = authenticationFlowType; - }; - - /** - * This is used for authenticating the user through the custom authentication flow. - * @param {AuthenticationDetails} authDetails Contains the authentication data - * @param {object} callback Result callback map. - * @param {onFailure} callback.onFailure Called on any error. - * @param {customChallenge} callback.customChallenge Custom challenge - * response required to continue. - * @param {authSuccess} callback.onSuccess Called on success with the new session. - * @returns {void} - */ - - - CognitoUser.prototype.initiateAuth = function initiateAuth(authDetails, callback) { - var _this = this; - - var authParameters = authDetails.getAuthParameters(); - authParameters.USERNAME = this.username; - - var jsonReq = { - AuthFlow: 'CUSTOM_AUTH', - ClientId: this.pool.getClientId(), - AuthParameters: authParameters, - ClientMetadata: authDetails.getValidationData() - }; - if (this.getUserContextData()) { - jsonReq.UserContextData = this.getUserContextData(); - } - - this.client.request('InitiateAuth', jsonReq, function (err, data) { - if (err) { - return callback.onFailure(err); - } - var challengeName = data.ChallengeName; - var challengeParameters = data.ChallengeParameters; - - if (challengeName === 'CUSTOM_CHALLENGE') { - _this.Session = data.Session; - return callback.customChallenge(challengeParameters); - } - _this.signInUserSession = _this.getCognitoUserSession(data.AuthenticationResult); - _this.cacheTokens(); - return callback.onSuccess(_this.signInUserSession); - }); - }; - - /** - * This is used for authenticating the user. - * stuff - * @param {AuthenticationDetails} authDetails Contains the authentication data - * @param {object} callback Result callback map. - * @param {onFailure} callback.onFailure Called on any error. - * @param {newPasswordRequired} callback.newPasswordRequired new - * password and any required attributes are required to continue - * @param {mfaRequired} callback.mfaRequired MFA code - * required to continue. - * @param {customChallenge} callback.customChallenge Custom challenge - * response required to continue. - * @param {authSuccess} callback.onSuccess Called on success with the new session. - * @returns {void} - */ - - - CognitoUser.prototype.authenticateUser = function authenticateUser(authDetails, callback) { - if (this.authenticationFlowType === 'USER_PASSWORD_AUTH') { - return this.authenticateUserPlainUsernamePassword(authDetails, callback); - } else if (this.authenticationFlowType === 'USER_SRP_AUTH') { - return this.authenticateUserDefaultAuth(authDetails, callback); - } - return callback.onFailure(new Error('Authentication flow type is invalid.')); - }; - - /** - * This is used for authenticating the user. it calls the AuthenticationHelper for SRP related - * stuff - * @param {AuthenticationDetails} authDetails Contains the authentication data - * @param {object} callback Result callback map. - * @param {onFailure} callback.onFailure Called on any error. - * @param {newPasswordRequired} callback.newPasswordRequired new - * password and any required attributes are required to continue - * @param {mfaRequired} callback.mfaRequired MFA code - * required to continue. - * @param {customChallenge} callback.customChallenge Custom challenge - * response required to continue. - * @param {authSuccess} callback.onSuccess Called on success with the new session. - * @returns {void} - */ - - - CognitoUser.prototype.authenticateUserDefaultAuth = function authenticateUserDefaultAuth(authDetails, callback) { - var _this2 = this; - - var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]); - var dateHelper = new _DateHelper2.default(); - - var serverBValue = void 0; - var salt = void 0; - var authParameters = {}; - - if (this.deviceKey != null) { - authParameters.DEVICE_KEY = this.deviceKey; - } - - authParameters.USERNAME = this.username; - authenticationHelper.getLargeAValue(function (errOnAValue, aValue) { - // getLargeAValue callback start - if (errOnAValue) { - callback.onFailure(errOnAValue); - } - - authParameters.SRP_A = aValue.toString(16); - - if (_this2.authenticationFlowType === 'CUSTOM_AUTH') { - authParameters.CHALLENGE_NAME = 'SRP_A'; - } - - var jsonReq = { - AuthFlow: _this2.authenticationFlowType, - ClientId: _this2.pool.getClientId(), - AuthParameters: authParameters, - ClientMetadata: authDetails.getValidationData() - }; - if (_this2.getUserContextData(_this2.username)) { - jsonReq.UserContextData = _this2.getUserContextData(_this2.username); - } - - _this2.client.request('InitiateAuth', jsonReq, function (err, data) { - if (err) { - return callback.onFailure(err); - } - - var challengeParameters = data.ChallengeParameters; - - _this2.username = challengeParameters.USER_ID_FOR_SRP; - serverBValue = new _BigInteger2.default(challengeParameters.SRP_B, 16); - salt = new _BigInteger2.default(challengeParameters.SALT, 16); - _this2.getCachedDeviceKeyAndPassword(); - - authenticationHelper.getPasswordAuthenticationKey(_this2.username, authDetails.getPassword(), serverBValue, salt, function (errOnHkdf, hkdf) { - // getPasswordAuthenticationKey callback start - if (errOnHkdf) { - callback.onFailure(errOnHkdf); - } - - var dateNow = dateHelper.getNowString(); - - var signatureString = createHmac('sha256', hkdf).update(_buffer.Buffer.concat([_buffer.Buffer.from(_this2.pool.getUserPoolId().split('_')[1], 'utf8'), _buffer.Buffer.from(_this2.username, 'utf8'), _buffer.Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'), _buffer.Buffer.from(dateNow, 'utf8')])).digest('base64'); - - var challengeResponses = {}; - - challengeResponses.USERNAME = _this2.username; - challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK; - challengeResponses.TIMESTAMP = dateNow; - challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString; - - if (_this2.deviceKey != null) { - challengeResponses.DEVICE_KEY = _this2.deviceKey; - } - - var respondToAuthChallenge = function respondToAuthChallenge(challenge, challengeCallback) { - return _this2.client.request('RespondToAuthChallenge', challenge, function (errChallenge, dataChallenge) { - if (errChallenge && errChallenge.code === 'ResourceNotFoundException' && errChallenge.message.toLowerCase().indexOf('device') !== -1) { - challengeResponses.DEVICE_KEY = null; - _this2.deviceKey = null; - _this2.randomPassword = null; - _this2.deviceGroupKey = null; - _this2.clearCachedDeviceKeyAndPassword(); - return respondToAuthChallenge(challenge, challengeCallback); - } - return challengeCallback(errChallenge, dataChallenge); - }); - }; - - var jsonReqResp = { - ChallengeName: 'PASSWORD_VERIFIER', - ClientId: _this2.pool.getClientId(), - ChallengeResponses: challengeResponses, - Session: data.Session - }; - if (_this2.getUserContextData()) { - jsonReqResp.UserContextData = _this2.getUserContextData(); - } - respondToAuthChallenge(jsonReqResp, function (errAuthenticate, dataAuthenticate) { - if (errAuthenticate) { - return callback.onFailure(errAuthenticate); - } - - var challengeName = dataAuthenticate.ChallengeName; - if (challengeName === 'NEW_PASSWORD_REQUIRED') { - _this2.Session = dataAuthenticate.Session; - var userAttributes = null; - var rawRequiredAttributes = null; - var requiredAttributes = []; - var userAttributesPrefix = authenticationHelper.getNewPasswordRequiredChallengeUserAttributePrefix(); - - if (dataAuthenticate.ChallengeParameters) { - userAttributes = JSON.parse(dataAuthenticate.ChallengeParameters.userAttributes); - rawRequiredAttributes = JSON.parse(dataAuthenticate.ChallengeParameters.requiredAttributes); - } - - if (rawRequiredAttributes) { - for (var i = 0; i < rawRequiredAttributes.length; i++) { - requiredAttributes[i] = rawRequiredAttributes[i].substr(userAttributesPrefix.length); - } - } - return callback.newPasswordRequired(userAttributes, requiredAttributes); - } - return _this2.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback); - }); - return undefined; - // getPasswordAuthenticationKey callback end - }); - return undefined; - }); - // getLargeAValue callback end - }); - }; - - /** - * PRIVATE ONLY: This is an internal only method and should not - * be directly called by the consumers. - * @param {AuthenticationDetails} authDetails Contains the authentication data. - * @param {object} callback Result callback map. - * @param {onFailure} callback.onFailure Called on any error. - * @param {mfaRequired} callback.mfaRequired MFA code - * required to continue. - * @param {authSuccess} callback.onSuccess Called on success with the new session. - * @returns {void} - */ - - - CognitoUser.prototype.authenticateUserPlainUsernamePassword = function authenticateUserPlainUsernamePassword(authDetails, callback) { - var _this3 = this; - - var authParameters = {}; - authParameters.USERNAME = this.username; - authParameters.PASSWORD = authDetails.getPassword(); - if (!authParameters.PASSWORD) { - callback.onFailure(new Error('PASSWORD parameter is required')); - return; - } - var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]); - this.getCachedDeviceKeyAndPassword(); - if (this.deviceKey != null) { - authParameters.DEVICE_KEY = this.deviceKey; - } - - var jsonReq = { - AuthFlow: 'USER_PASSWORD_AUTH', - ClientId: this.pool.getClientId(), - AuthParameters: authParameters, - ClientMetadata: authDetails.getValidationData() - }; - if (this.getUserContextData(this.username)) { - jsonReq.UserContextData = this.getUserContextData(this.username); - } - // USER_PASSWORD_AUTH happens in a single round-trip: client sends userName and password, - // Cognito UserPools verifies password and returns tokens. - this.client.request('InitiateAuth', jsonReq, function (err, authResult) { - if (err) { - return callback.onFailure(err); - } - return _this3.authenticateUserInternal(authResult, authenticationHelper, callback); - }); - }; - - /** - * PRIVATE ONLY: This is an internal only method and should not - * be directly called by the consumers. - * @param {object} dataAuthenticate authentication data - * @param {object} authenticationHelper helper created - * @param {callback} callback passed on from caller - * @returns {void} - */ - - - CognitoUser.prototype.authenticateUserInternal = function authenticateUserInternal(dataAuthenticate, authenticationHelper, callback) { - var _this4 = this; - - var challengeName = dataAuthenticate.ChallengeName; - var challengeParameters = dataAuthenticate.ChallengeParameters; - - if (challengeName === 'SMS_MFA') { - this.Session = dataAuthenticate.Session; - return callback.mfaRequired(challengeName, challengeParameters); - } - - if (challengeName === 'SELECT_MFA_TYPE') { - this.Session = dataAuthenticate.Session; - return callback.selectMFAType(challengeName, challengeParameters); - } - - if (challengeName === 'MFA_SETUP') { - this.Session = dataAuthenticate.Session; - return callback.mfaSetup(challengeName, challengeParameters); - } - - if (challengeName === 'SOFTWARE_TOKEN_MFA') { - this.Session = dataAuthenticate.Session; - return callback.totpRequired(challengeName, challengeParameters); - } - - if (challengeName === 'CUSTOM_CHALLENGE') { - this.Session = dataAuthenticate.Session; - return callback.customChallenge(challengeParameters); - } - - if (challengeName === 'DEVICE_SRP_AUTH') { - this.getDeviceResponse(callback); - return undefined; - } - - this.signInUserSession = this.getCognitoUserSession(dataAuthenticate.AuthenticationResult); - this.cacheTokens(); - - var newDeviceMetadata = dataAuthenticate.AuthenticationResult.NewDeviceMetadata; - if (newDeviceMetadata == null) { - return callback.onSuccess(this.signInUserSession); - } - - authenticationHelper.generateHashDevice(dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, function (errGenHash) { - if (errGenHash) { - return callback.onFailure(errGenHash); - } - - var deviceSecretVerifierConfig = { - Salt: _buffer.Buffer.from(authenticationHelper.getSaltDevices(), 'hex').toString('base64'), - PasswordVerifier: _buffer.Buffer.from(authenticationHelper.getVerifierDevices(), 'hex').toString('base64') - }; - - _this4.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier; - _this4.deviceGroupKey = newDeviceMetadata.DeviceGroupKey; - _this4.randomPassword = authenticationHelper.getRandomPassword(); - - _this4.client.request('ConfirmDevice', { - DeviceKey: newDeviceMetadata.DeviceKey, - AccessToken: _this4.signInUserSession.getAccessToken().getJwtToken(), - DeviceSecretVerifierConfig: deviceSecretVerifierConfig, - DeviceName: navigator.userAgent - }, function (errConfirm, dataConfirm) { - if (errConfirm) { - return callback.onFailure(errConfirm); - } - - _this4.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey; - _this4.cacheDeviceKeyAndPassword(); - if (dataConfirm.UserConfirmationNecessary === true) { - return callback.onSuccess(_this4.signInUserSession, dataConfirm.UserConfirmationNecessary); - } - return callback.onSuccess(_this4.signInUserSession); - }); - return undefined; - }); - return undefined; - }; - - /** - * This method is user to complete the NEW_PASSWORD_REQUIRED challenge. - * Pass the new password with any new user attributes to be updated. - * User attribute keys must be of format userAttributes.. - * @param {string} newPassword new password for this user - * @param {object} requiredAttributeData map with values for all required attributes - * @param {object} callback Result callback map. - * @param {onFailure} callback.onFailure Called on any error. - * @param {mfaRequired} callback.mfaRequired MFA code required to continue. - * @param {customChallenge} callback.customChallenge Custom challenge - * response required to continue. - * @param {authSuccess} callback.onSuccess Called on success with the new session. - * @returns {void} - */ - - - CognitoUser.prototype.completeNewPasswordChallenge = function completeNewPasswordChallenge(newPassword, requiredAttributeData, callback) { - var _this5 = this; - - if (!newPassword) { - return callback.onFailure(new Error('New password is required.')); - } - var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]); - var userAttributesPrefix = authenticationHelper.getNewPasswordRequiredChallengeUserAttributePrefix(); - - var finalUserAttributes = {}; - if (requiredAttributeData) { - Object.keys(requiredAttributeData).forEach(function (key) { - finalUserAttributes[userAttributesPrefix + key] = requiredAttributeData[key]; - }); - } - - finalUserAttributes.NEW_PASSWORD = newPassword; - finalUserAttributes.USERNAME = this.username; - var jsonReq = { - ChallengeName: 'NEW_PASSWORD_REQUIRED', - ClientId: this.pool.getClientId(), - ChallengeResponses: finalUserAttributes, - Session: this.Session - }; - if (this.getUserContextData()) { - jsonReq.UserContextData = this.getUserContextData(); - } - - this.client.request('RespondToAuthChallenge', jsonReq, function (errAuthenticate, dataAuthenticate) { - if (errAuthenticate) { - return callback.onFailure(errAuthenticate); - } - return _this5.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback); - }); - return undefined; - }; - - /** - * This is used to get a session using device authentication. It is called at the end of user - * authentication - * - * @param {object} callback Result callback map. - * @param {onFailure} callback.onFailure Called on any error. - * @param {authSuccess} callback.onSuccess Called on success with the new session. - * @returns {void} - * @private - */ - - - CognitoUser.prototype.getDeviceResponse = function getDeviceResponse(callback) { - var _this6 = this; - - var authenticationHelper = new _AuthenticationHelper2.default(this.deviceGroupKey); - var dateHelper = new _DateHelper2.default(); - - var authParameters = {}; - - authParameters.USERNAME = this.username; - authParameters.DEVICE_KEY = this.deviceKey; - authenticationHelper.getLargeAValue(function (errAValue, aValue) { - // getLargeAValue callback start - if (errAValue) { - callback.onFailure(errAValue); - } - - authParameters.SRP_A = aValue.toString(16); - - var jsonReq = { - ChallengeName: 'DEVICE_SRP_AUTH', - ClientId: _this6.pool.getClientId(), - ChallengeResponses: authParameters - }; - if (_this6.getUserContextData()) { - jsonReq.UserContextData = _this6.getUserContextData(); - } - _this6.client.request('RespondToAuthChallenge', jsonReq, function (err, data) { - if (err) { - return callback.onFailure(err); - } - - var challengeParameters = data.ChallengeParameters; - - var serverBValue = new _BigInteger2.default(challengeParameters.SRP_B, 16); - var salt = new _BigInteger2.default(challengeParameters.SALT, 16); - - authenticationHelper.getPasswordAuthenticationKey(_this6.deviceKey, _this6.randomPassword, serverBValue, salt, function (errHkdf, hkdf) { - // getPasswordAuthenticationKey callback start - if (errHkdf) { - return callback.onFailure(errHkdf); - } - - var dateNow = dateHelper.getNowString(); - - var signatureString = createHmac('sha256', hkdf).update(_buffer.Buffer.concat([_buffer.Buffer.from(_this6.deviceGroupKey, 'utf8'), _buffer.Buffer.from(_this6.deviceKey, 'utf8'), _buffer.Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'), _buffer.Buffer.from(dateNow, 'utf8')])).digest('base64'); - - var challengeResponses = {}; - - challengeResponses.USERNAME = _this6.username; - challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK; - challengeResponses.TIMESTAMP = dateNow; - challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString; - challengeResponses.DEVICE_KEY = _this6.deviceKey; - - var jsonReqResp = { - ChallengeName: 'DEVICE_PASSWORD_VERIFIER', - ClientId: _this6.pool.getClientId(), - ChallengeResponses: challengeResponses, - Session: data.Session - }; - if (_this6.getUserContextData()) { - jsonReqResp.UserContextData = _this6.getUserContextData(); - } - - _this6.client.request('RespondToAuthChallenge', jsonReqResp, function (errAuthenticate, dataAuthenticate) { - if (errAuthenticate) { - return callback.onFailure(errAuthenticate); - } - - _this6.signInUserSession = _this6.getCognitoUserSession(dataAuthenticate.AuthenticationResult); - _this6.cacheTokens(); - - return callback.onSuccess(_this6.signInUserSession); - }); - return undefined; - // getPasswordAuthenticationKey callback end - }); - return undefined; - }); - // getLargeAValue callback end - }); - }; - - /** - * This is used for a certain user to confirm the registration by using a confirmation code - * @param {string} confirmationCode Code entered by user. - * @param {bool} forceAliasCreation Allow migrating from an existing email / phone number. - * @param {nodeCallback} callback Called on success or error. - * @returns {void} - */ - - - CognitoUser.prototype.confirmRegistration = function confirmRegistration(confirmationCode, forceAliasCreation, callback) { - var jsonReq = { - ClientId: this.pool.getClientId(), - ConfirmationCode: confirmationCode, - Username: this.username, - ForceAliasCreation: forceAliasCreation - }; - if (this.getUserContextData()) { - jsonReq.UserContextData = this.getUserContextData(); - } - this.client.request('ConfirmSignUp', jsonReq, function (err) { - if (err) { - return callback(err, null); - } - return callback(null, 'SUCCESS'); - }); - }; - - /** - * This is used by the user once he has the responses to a custom challenge - * @param {string} answerChallenge The custom challange answer. - * @param {object} callback Result callback map. - * @param {onFailure} callback.onFailure Called on any error. - * @param {customChallenge} callback.customChallenge - * Custom challenge response required to continue. - * @param {authSuccess} callback.onSuccess Called on success with the new session. - * @returns {void} - */ - - - CognitoUser.prototype.sendCustomChallengeAnswer = function sendCustomChallengeAnswer(answerChallenge, callback) { - var _this7 = this; - - var challengeResponses = {}; - challengeResponses.USERNAME = this.username; - challengeResponses.ANSWER = answerChallenge; - - var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]); - this.getCachedDeviceKeyAndPassword(); - if (this.deviceKey != null) { - challengeResponses.DEVICE_KEY = this.deviceKey; - } - - var jsonReq = { - ChallengeName: 'CUSTOM_CHALLENGE', - ChallengeResponses: challengeResponses, - ClientId: this.pool.getClientId(), - Session: this.Session - }; - if (this.getUserContextData()) { - jsonReq.UserContextData = this.getUserContextData(); - } - this.client.request('RespondToAuthChallenge', jsonReq, function (err, data) { - if (err) { - return callback.onFailure(err); - } - - return _this7.authenticateUserInternal(data, authenticationHelper, callback); - }); - }; - - /** - * This is used by the user once he has an MFA code - * @param {string} confirmationCode The MFA code entered by the user. - * @param {object} callback Result callback map. - * @param {string} mfaType The mfa we are replying to. - * @param {onFailure} callback.onFailure Called on any error. - * @param {authSuccess} callback.onSuccess Called on success with the new session. - * @returns {void} - */ - - - CognitoUser.prototype.sendMFACode = function sendMFACode(confirmationCode, callback, mfaType) { - var _this8 = this; - - var challengeResponses = {}; - challengeResponses.USERNAME = this.username; - challengeResponses.SMS_MFA_CODE = confirmationCode; - var mfaTypeSelection = mfaType || 'SMS_MFA'; - if (mfaTypeSelection === 'SOFTWARE_TOKEN_MFA') { - challengeResponses.SOFTWARE_TOKEN_MFA_CODE = confirmationCode; - } - - if (this.deviceKey != null) { - challengeResponses.DEVICE_KEY = this.deviceKey; - } - - var jsonReq = { - ChallengeName: mfaTypeSelection, - ChallengeResponses: challengeResponses, - ClientId: this.pool.getClientId(), - Session: this.Session - }; - if (this.getUserContextData()) { - jsonReq.UserContextData = this.getUserContextData(); - } - - this.client.request('RespondToAuthChallenge', jsonReq, function (err, dataAuthenticate) { - if (err) { - return callback.onFailure(err); - } - - var challengeName = dataAuthenticate.ChallengeName; - - if (challengeName === 'DEVICE_SRP_AUTH') { - _this8.getDeviceResponse(callback); - return undefined; - } - - _this8.signInUserSession = _this8.getCognitoUserSession(dataAuthenticate.AuthenticationResult); - _this8.cacheTokens(); - - if (dataAuthenticate.AuthenticationResult.NewDeviceMetadata == null) { - return callback.onSuccess(_this8.signInUserSession); - } - - var authenticationHelper = new _AuthenticationHelper2.default(_this8.pool.getUserPoolId().split('_')[1]); - authenticationHelper.generateHashDevice(dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, function (errGenHash) { - if (errGenHash) { - return callback.onFailure(errGenHash); - } - - var deviceSecretVerifierConfig = { - Salt: _buffer.Buffer.from(authenticationHelper.getSaltDevices(), 'hex').toString('base64'), - PasswordVerifier: _buffer.Buffer.from(authenticationHelper.getVerifierDevices(), 'hex').toString('base64') - }; - - _this8.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier; - _this8.deviceGroupKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey; - _this8.randomPassword = authenticationHelper.getRandomPassword(); - - _this8.client.request('ConfirmDevice', { - DeviceKey: dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, - AccessToken: _this8.signInUserSession.getAccessToken().getJwtToken(), - DeviceSecretVerifierConfig: deviceSecretVerifierConfig, - DeviceName: navigator.userAgent - }, function (errConfirm, dataConfirm) { - if (errConfirm) { - return callback.onFailure(errConfirm); - } - - _this8.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey; - _this8.cacheDeviceKeyAndPassword(); - if (dataConfirm.UserConfirmationNecessary === true) { - return callback.onSuccess(_this8.signInUserSession, dataConfirm.UserConfirmationNecessary); - } - return callback.onSuccess(_this8.signInUserSession); - }); - return undefined; - }); - return undefined; - }); - }; - - /** - * This is used by an authenticated user to change the current password - * @param {string} oldUserPassword The current password. - * @param {string} newUserPassword The requested new password. - * @param {nodeCallback} callback Called on success or error. - * @returns {void} - */ - - - CognitoUser.prototype.changePassword = function changePassword(oldUserPassword, newUserPassword, callback) { - if (!(this.signInUserSession != null && this.signInUserSession.isValid())) { - return callback(new Error('User is not authenticated'), null); - } - - this.client.request('ChangePassword', { - PreviousPassword: oldUserPassword, - ProposedPassword: newUserPassword, - AccessToken: this.signInUserSession.getAccessToken().getJwtToken() - }, function (err) { - if (err) { - return callback(err, null); - } - return callback(null, 'SUCCESS'); - }); - return undefined; - }; - - /** - * This is used by an authenticated user to enable MFA for himself - * @param {nodeCallback} callback Called on success or error. - * @returns {void} - */ - - - CognitoUser.prototype.enableMFA = function enableMFA(callback) { - if (this.signInUserSession == null || !this.signInUserSession.isValid()) { - return callback(new Error('User is not authenticated'), null); - } - - var mfaOptions = []; - var mfaEnabled = { - DeliveryMedium: 'SMS', - AttributeName: 'phone_number' - }; - mfaOptions.push(mfaEnabled); - - this.client.request('SetUserSettings', { - MFAOptions: mfaOptions, - AccessToken: this.signInUserSession.getAccessToken().getJwtToken() - }, function (err) { - if (err) { - return callback(err, null); - } - return callback(null, 'SUCCESS'); - }); - return undefined; - }; - - /** - * This is used by an authenticated user to enable MFA for himself - * @param {string[]} smsMfaSettings the sms mfa settings - * @param {string[]} softwareTokenMfaSettings the software token mfa settings - * @param {nodeCallback} callback Called on success or error. - * @returns {void} - */ - - - CognitoUser.prototype.setUserMfaPreference = function setUserMfaPreference(smsMfaSettings, softwareTokenMfaSettings, callback) { - if (this.signInUserSession == null || !this.signInUserSession.isValid()) { - return callback(new Error('User is not authenticated'), null); - } - - this.client.request('SetUserMFAPreference', { - SMSMfaSettings: smsMfaSettings, - SoftwareTokenMfaSettings: softwareTokenMfaSettings, - AccessToken: this.signInUserSession.getAccessToken().getJwtToken() - }, function (err) { - if (err) { - return callback(err, null); - } - return callback(null, 'SUCCESS'); - }); - return undefined; - }; - - /** - * This is used by an authenticated user to disable MFA for himself - * @param {nodeCallback} callback Called on success or error. - * @returns {void} - */ - - - CognitoUser.prototype.disableMFA = function disableMFA(callback) { - if (this.signInUserSession == null || !this.signInUserSession.isValid()) { - return callback(new Error('User is not authenticated'), null); - } - - var mfaOptions = []; - - this.client.request('SetUserSettings', { - MFAOptions: mfaOptions, - AccessToken: this.signInUserSession.getAccessToken().getJwtToken() - }, function (err) { - if (err) { - return callback(err, null); - } - return callback(null, 'SUCCESS'); - }); - return undefined; - }; - - /** - * This is used by an authenticated user to delete himself - * @param {nodeCallback} callback Called on success or error. - * @returns {void} - */ - - - CognitoUser.prototype.deleteUser = function deleteUser(callback) { - var _this9 = this; - - if (this.signInUserSession == null || !this.signInUserSession.isValid()) { - return callback(new Error('User is not authenticated'), null); - } - - this.client.request('DeleteUser', { - AccessToken: this.signInUserSession.getAccessToken().getJwtToken() - }, function (err) { - if (err) { - return callback(err, null); - } - _this9.clearCachedTokens(); - return callback(null, 'SUCCESS'); - }); - return undefined; - }; - - /** - * @typedef {CognitoUserAttribute | { Name:string, Value:string }} AttributeArg - */ - /** - * This is used by an authenticated user to change a list of attributes - * @param {AttributeArg[]} attributes A list of the new user attributes. - * @param {nodeCallback} callback Called on success or error. - * @returns {void} - */ - - - CognitoUser.prototype.updateAttributes = function updateAttributes(attributes, callback) { - if (this.signInUserSession == null || !this.signInUserSession.isValid()) { - return callback(new Error('User is not authenticated'), null); - } - - this.client.request('UpdateUserAttributes', { - AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), - UserAttributes: attributes - }, function (err) { - if (err) { - return callback(err, null); - } - return callback(null, 'SUCCESS'); - }); - return undefined; - }; - - /** - * This is used by an authenticated user to get a list of attributes - * @param {nodeCallback} callback Called on success or error. - * @returns {void} - */ - - - CognitoUser.prototype.getUserAttributes = function getUserAttributes(callback) { - if (!(this.signInUserSession != null && this.signInUserSession.isValid())) { - return callback(new Error('User is not authenticated'), null); - } - - this.client.request('GetUser', { - AccessToken: this.signInUserSession.getAccessToken().getJwtToken() - }, function (err, userData) { - if (err) { - return callback(err, null); - } - - var attributeList = []; - - for (var i = 0; i < userData.UserAttributes.length; i++) { - var attribute = { - Name: userData.UserAttributes[i].Name, - Value: userData.UserAttributes[i].Value - }; - var userAttribute = new _CognitoUserAttribute2.default(attribute); - attributeList.push(userAttribute); - } - - return callback(null, attributeList); - }); - return undefined; - }; - - /** - * This is used by an authenticated user to get the MFAOptions - * @param {nodeCallback} callback Called on success or error. - * @returns {void} - */ - - - CognitoUser.prototype.getMFAOptions = function getMFAOptions(callback) { - if (!(this.signInUserSession != null && this.signInUserSession.isValid())) { - return callback(new Error('User is not authenticated'), null); - } - - this.client.request('GetUser', { - AccessToken: this.signInUserSession.getAccessToken().getJwtToken() - }, function (err, userData) { - if (err) { - return callback(err, null); - } - - return callback(null, userData.MFAOptions); - }); - return undefined; - }; - - /** - * This is used by an authenticated user to delete a list of attributes - * @param {string[]} attributeList Names of the attributes to delete. - * @param {nodeCallback} callback Called on success or error. - * @returns {void} - */ - - - CognitoUser.prototype.deleteAttributes = function deleteAttributes(attributeList, callback) { - if (!(this.signInUserSession != null && this.signInUserSession.isValid())) { - return callback(new Error('User is not authenticated'), null); - } - - this.client.request('DeleteUserAttributes', { - UserAttributeNames: attributeList, - AccessToken: this.signInUserSession.getAccessToken().getJwtToken() - }, function (err) { - if (err) { - return callback(err, null); - } - return callback(null, 'SUCCESS'); - }); - return undefined; - }; - - /** - * This is used by a user to resend a confirmation code - * @param {nodeCallback} callback Called on success or error. - * @returns {void} - */ - - - CognitoUser.prototype.resendConfirmationCode = function resendConfirmationCode(callback) { - var jsonReq = { - ClientId: this.pool.getClientId(), - Username: this.username - }; - - this.client.request('ResendConfirmationCode', jsonReq, function (err, result) { - if (err) { - return callback(err, null); - } - return callback(null, result); - }); - }; - - /** - * This is used to get a session, either from the session object - * or from the local storage, or by using a refresh token - * - * @param {nodeCallback} callback Called on success or error. - * @returns {void} - */ - - - CognitoUser.prototype.getSession = function getSession(callback) { - if (this.username == null) { - return callback(new Error('Username is null. Cannot retrieve a new session'), null); - } - - if (this.signInUserSession != null && this.signInUserSession.isValid()) { - return callback(null, this.signInUserSession); - } - - var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username; - var idTokenKey = keyPrefix + '.idToken'; - var accessTokenKey = keyPrefix + '.accessToken'; - var refreshTokenKey = keyPrefix + '.refreshToken'; - var clockDriftKey = keyPrefix + '.clockDrift'; - - if (this.storage.getItem(idTokenKey)) { - var idToken = new _CognitoIdToken2.default({ - IdToken: this.storage.getItem(idTokenKey) - }); - var accessToken = new _CognitoAccessToken2.default({ - AccessToken: this.storage.getItem(accessTokenKey) - }); - var refreshToken = new _CognitoRefreshToken2.default({ - RefreshToken: this.storage.getItem(refreshTokenKey) - }); - var clockDrift = parseInt(this.storage.getItem(clockDriftKey), 0) || 0; - - var sessionData = { - IdToken: idToken, - AccessToken: accessToken, - RefreshToken: refreshToken, - ClockDrift: clockDrift - }; - var cachedSession = new _CognitoUserSession2.default(sessionData); - if (cachedSession.isValid()) { - this.signInUserSession = cachedSession; - return callback(null, this.signInUserSession); - } - - if (refreshToken.getToken() == null) { - return callback(new Error('Cannot retrieve a new session. Please authenticate.'), null); - } - - this.refreshSession(refreshToken, callback); - } else { - callback(new Error('Local storage is missing an ID Token, Please authenticate'), null); - } - - return undefined; - }; - - /** - * This uses the refreshToken to retrieve a new session - * @param {CognitoRefreshToken} refreshToken A previous session's refresh token. - * @param {nodeCallback} callback Called on success or error. - * @returns {void} - */ - - - CognitoUser.prototype.refreshSession = function refreshSession(refreshToken, callback) { - var _this10 = this; - - var authParameters = {}; - authParameters.REFRESH_TOKEN = refreshToken.getToken(); - var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId(); - var lastUserKey = keyPrefix + '.LastAuthUser'; - - if (this.storage.getItem(lastUserKey)) { - this.username = this.storage.getItem(lastUserKey); - var deviceKeyKey = keyPrefix + '.' + this.username + '.deviceKey'; - this.deviceKey = this.storage.getItem(deviceKeyKey); - authParameters.DEVICE_KEY = this.deviceKey; - } - - var jsonReq = { - ClientId: this.pool.getClientId(), - AuthFlow: 'REFRESH_TOKEN_AUTH', - AuthParameters: authParameters - }; - if (this.getUserContextData()) { - jsonReq.UserContextData = this.getUserContextData(); - } - this.client.request('InitiateAuth', jsonReq, function (err, authResult) { - if (err) { - if (err.code === 'NotAuthorizedException') { - _this10.clearCachedTokens(); - } - return callback(err, null); - } - if (authResult) { - var authenticationResult = authResult.AuthenticationResult; - if (!Object.prototype.hasOwnProperty.call(authenticationResult, 'RefreshToken')) { - authenticationResult.RefreshToken = refreshToken.getToken(); - } - _this10.signInUserSession = _this10.getCognitoUserSession(authenticationResult); - _this10.cacheTokens(); - return callback(null, _this10.signInUserSession); - } - return undefined; - }); - }; - - /** - * This is used to save the session tokens to local storage - * @returns {void} - */ - - - CognitoUser.prototype.cacheTokens = function cacheTokens() { - var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId(); - var idTokenKey = keyPrefix + '.' + this.username + '.idToken'; - var accessTokenKey = keyPrefix + '.' + this.username + '.accessToken'; - var refreshTokenKey = keyPrefix + '.' + this.username + '.refreshToken'; - var clockDriftKey = keyPrefix + '.' + this.username + '.clockDrift'; - var lastUserKey = keyPrefix + '.LastAuthUser'; - - this.storage.setItem(idTokenKey, this.signInUserSession.getIdToken().getJwtToken()); - this.storage.setItem(accessTokenKey, this.signInUserSession.getAccessToken().getJwtToken()); - this.storage.setItem(refreshTokenKey, this.signInUserSession.getRefreshToken().getToken()); - this.storage.setItem(clockDriftKey, '' + this.signInUserSession.getClockDrift()); - this.storage.setItem(lastUserKey, this.username); - }; - - /** - * This is used to cache the device key and device group and device password - * @returns {void} - */ - - - CognitoUser.prototype.cacheDeviceKeyAndPassword = function cacheDeviceKeyAndPassword() { - var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username; - var deviceKeyKey = keyPrefix + '.deviceKey'; - var randomPasswordKey = keyPrefix + '.randomPasswordKey'; - var deviceGroupKeyKey = keyPrefix + '.deviceGroupKey'; - - this.storage.setItem(deviceKeyKey, this.deviceKey); - this.storage.setItem(randomPasswordKey, this.randomPassword); - this.storage.setItem(deviceGroupKeyKey, this.deviceGroupKey); - }; - - /** - * This is used to get current device key and device group and device password - * @returns {void} - */ - - - CognitoUser.prototype.getCachedDeviceKeyAndPassword = function getCachedDeviceKeyAndPassword() { - var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username; - var deviceKeyKey = keyPrefix + '.deviceKey'; - var randomPasswordKey = keyPrefix + '.randomPasswordKey'; - var deviceGroupKeyKey = keyPrefix + '.deviceGroupKey'; - - if (this.storage.getItem(deviceKeyKey)) { - this.deviceKey = this.storage.getItem(deviceKeyKey); - this.randomPassword = this.storage.getItem(randomPasswordKey); - this.deviceGroupKey = this.storage.getItem(deviceGroupKeyKey); - } - }; - - /** - * This is used to clear the device key info from local storage - * @returns {void} - */ - - - CognitoUser.prototype.clearCachedDeviceKeyAndPassword = function clearCachedDeviceKeyAndPassword() { - var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username; - var deviceKeyKey = keyPrefix + '.deviceKey'; - var randomPasswordKey = keyPrefix + '.randomPasswordKey'; - var deviceGroupKeyKey = keyPrefix + '.deviceGroupKey'; - - this.storage.removeItem(deviceKeyKey); - this.storage.removeItem(randomPasswordKey); - this.storage.removeItem(deviceGroupKeyKey); - }; - - /** - * This is used to clear the session tokens from local storage - * @returns {void} - */ - - - CognitoUser.prototype.clearCachedTokens = function clearCachedTokens() { - var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId(); - var idTokenKey = keyPrefix + '.' + this.username + '.idToken'; - var accessTokenKey = keyPrefix + '.' + this.username + '.accessToken'; - var refreshTokenKey = keyPrefix + '.' + this.username + '.refreshToken'; - var lastUserKey = keyPrefix + '.LastAuthUser'; - - this.storage.removeItem(idTokenKey); - this.storage.removeItem(accessTokenKey); - this.storage.removeItem(refreshTokenKey); - this.storage.removeItem(lastUserKey); - }; - - /** - * This is used to build a user session from tokens retrieved in the authentication result - * @param {object} authResult Successful auth response from server. - * @returns {CognitoUserSession} The new user session. - * @private - */ - - - CognitoUser.prototype.getCognitoUserSession = function getCognitoUserSession(authResult) { - var idToken = new _CognitoIdToken2.default(authResult); - var accessToken = new _CognitoAccessToken2.default(authResult); - var refreshToken = new _CognitoRefreshToken2.default(authResult); - - var sessionData = { - IdToken: idToken, - AccessToken: accessToken, - RefreshToken: refreshToken - }; - - return new _CognitoUserSession2.default(sessionData); - }; - - /** - * This is used to initiate a forgot password request - * @param {object} callback Result callback map. - * @param {onFailure} callback.onFailure Called on any error. - * @param {inputVerificationCode?} callback.inputVerificationCode - * Optional callback raised instead of onSuccess with response data. - * @param {onSuccess} callback.onSuccess Called on success. - * @returns {void} - */ - - - CognitoUser.prototype.forgotPassword = function forgotPassword(callback) { - var jsonReq = { - ClientId: this.pool.getClientId(), - Username: this.username - }; - if (this.getUserContextData()) { - jsonReq.UserContextData = this.getUserContextData(); - } - this.client.request('ForgotPassword', jsonReq, function (err, data) { - if (err) { - return callback.onFailure(err); - } - if (typeof callback.inputVerificationCode === 'function') { - return callback.inputVerificationCode(data); - } - return callback.onSuccess(data); - }); - }; - - /** - * This is used to confirm a new password using a confirmationCode - * @param {string} confirmationCode Code entered by user. - * @param {string} newPassword Confirm new password. - * @param {object} callback Result callback map. - * @param {onFailure} callback.onFailure Called on any error. - * @param {onSuccess} callback.onSuccess Called on success. - * @returns {void} - */ - - - CognitoUser.prototype.confirmPassword = function confirmPassword(confirmationCode, newPassword, callback) { - var jsonReq = { - ClientId: this.pool.getClientId(), - Username: this.username, - ConfirmationCode: confirmationCode, - Password: newPassword - }; - if (this.getUserContextData()) { - jsonReq.UserContextData = this.getUserContextData(); - } - this.client.request('ConfirmForgotPassword', jsonReq, function (err) { - if (err) { - return callback.onFailure(err); - } - return callback.onSuccess(); - }); - }; - - /** - * This is used to initiate an attribute confirmation request - * @param {string} attributeName User attribute that needs confirmation. - * @param {object} callback Result callback map. - * @param {onFailure} callback.onFailure Called on any error. - * @param {inputVerificationCode} callback.inputVerificationCode Called on success. - * @returns {void} - */ - - - CognitoUser.prototype.getAttributeVerificationCode = function getAttributeVerificationCode(attributeName, callback) { - if (this.signInUserSession == null || !this.signInUserSession.isValid()) { - return callback.onFailure(new Error('User is not authenticated')); - } - - this.client.request('GetUserAttributeVerificationCode', { - AttributeName: attributeName, - AccessToken: this.signInUserSession.getAccessToken().getJwtToken() - }, function (err, data) { - if (err) { - return callback.onFailure(err); - } - if (typeof callback.inputVerificationCode === 'function') { - return callback.inputVerificationCode(data); - } - return callback.onSuccess(); - }); - return undefined; - }; - - /** - * This is used to confirm an attribute using a confirmation code - * @param {string} attributeName Attribute being confirmed. - * @param {string} confirmationCode Code entered by user. - * @param {object} callback Result callback map. - * @param {onFailure} callback.onFailure Called on any error. - * @param {onSuccess} callback.onSuccess Called on success. - * @returns {void} - */ - - - CognitoUser.prototype.verifyAttribute = function verifyAttribute(attributeName, confirmationCode, callback) { - if (this.signInUserSession == null || !this.signInUserSession.isValid()) { - return callback.onFailure(new Error('User is not authenticated')); - } - - this.client.request('VerifyUserAttribute', { - AttributeName: attributeName, - Code: confirmationCode, - AccessToken: this.signInUserSession.getAccessToken().getJwtToken() - }, function (err) { - if (err) { - return callback.onFailure(err); - } - return callback.onSuccess('SUCCESS'); - }); - return undefined; - }; - - /** - * This is used to get the device information using the current device key - * @param {object} callback Result callback map. - * @param {onFailure} callback.onFailure Called on any error. - * @param {onSuccess<*>} callback.onSuccess Called on success with device data. - * @returns {void} - */ - - - CognitoUser.prototype.getDevice = function getDevice(callback) { - if (this.signInUserSession == null || !this.signInUserSession.isValid()) { - return callback.onFailure(new Error('User is not authenticated')); - } - - this.client.request('GetDevice', { - AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), - DeviceKey: this.deviceKey - }, function (err, data) { - if (err) { - return callback.onFailure(err); - } - return callback.onSuccess(data); - }); - return undefined; - }; - - /** - * This is used to forget a specific device - * @param {string} deviceKey Device key. - * @param {object} callback Result callback map. - * @param {onFailure} callback.onFailure Called on any error. - * @param {onSuccess} callback.onSuccess Called on success. - * @returns {void} - */ - - - CognitoUser.prototype.forgetSpecificDevice = function forgetSpecificDevice(deviceKey, callback) { - if (this.signInUserSession == null || !this.signInUserSession.isValid()) { - return callback.onFailure(new Error('User is not authenticated')); - } - - this.client.request('ForgetDevice', { - AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), - DeviceKey: deviceKey - }, function (err) { - if (err) { - return callback.onFailure(err); - } - return callback.onSuccess('SUCCESS'); - }); - return undefined; - }; - - /** - * This is used to forget the current device - * @param {object} callback Result callback map. - * @param {onFailure} callback.onFailure Called on any error. - * @param {onSuccess} callback.onSuccess Called on success. - * @returns {void} - */ - - - CognitoUser.prototype.forgetDevice = function forgetDevice(callback) { - var _this11 = this; - - this.forgetSpecificDevice(this.deviceKey, { - onFailure: callback.onFailure, - onSuccess: function onSuccess(result) { - _this11.deviceKey = null; - _this11.deviceGroupKey = null; - _this11.randomPassword = null; - _this11.clearCachedDeviceKeyAndPassword(); - return callback.onSuccess(result); - } - }); - }; - - /** - * This is used to set the device status as remembered - * @param {object} callback Result callback map. - * @param {onFailure} callback.onFailure Called on any error. - * @param {onSuccess} callback.onSuccess Called on success. - * @returns {void} - */ - - - CognitoUser.prototype.setDeviceStatusRemembered = function setDeviceStatusRemembered(callback) { - if (this.signInUserSession == null || !this.signInUserSession.isValid()) { - return callback.onFailure(new Error('User is not authenticated')); - } - - this.client.request('UpdateDeviceStatus', { - AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), - DeviceKey: this.deviceKey, - DeviceRememberedStatus: 'remembered' - }, function (err) { - if (err) { - return callback.onFailure(err); - } - return callback.onSuccess('SUCCESS'); - }); - return undefined; - }; - - /** - * This is used to set the device status as not remembered - * @param {object} callback Result callback map. - * @param {onFailure} callback.onFailure Called on any error. - * @param {onSuccess} callback.onSuccess Called on success. - * @returns {void} - */ - - - CognitoUser.prototype.setDeviceStatusNotRemembered = function setDeviceStatusNotRemembered(callback) { - if (this.signInUserSession == null || !this.signInUserSession.isValid()) { - return callback.onFailure(new Error('User is not authenticated')); - } - - this.client.request('UpdateDeviceStatus', { - AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), - DeviceKey: this.deviceKey, - DeviceRememberedStatus: 'not_remembered' - }, function (err) { - if (err) { - return callback.onFailure(err); - } - return callback.onSuccess('SUCCESS'); - }); - return undefined; - }; - - /** - * This is used to list all devices for a user - * - * @param {int} limit the number of devices returned in a call - * @param {string} paginationToken the pagination token in case any was returned before - * @param {object} callback Result callback map. - * @param {onFailure} callback.onFailure Called on any error. - * @param {onSuccess<*>} callback.onSuccess Called on success with device list. - * @returns {void} - */ - - - CognitoUser.prototype.listDevices = function listDevices(limit, paginationToken, callback) { - if (this.signInUserSession == null || !this.signInUserSession.isValid()) { - return callback.onFailure(new Error('User is not authenticated')); - } - - this.client.request('ListDevices', { - AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), - Limit: limit, - PaginationToken: paginationToken - }, function (err, data) { - if (err) { - return callback.onFailure(err); - } - return callback.onSuccess(data); - }); - return undefined; - }; - - /** - * This is used to globally revoke all tokens issued to a user - * @param {object} callback Result callback map. - * @param {onFailure} callback.onFailure Called on any error. - * @param {onSuccess} callback.onSuccess Called on success. - * @returns {void} - */ - - - CognitoUser.prototype.globalSignOut = function globalSignOut(callback) { - var _this12 = this; - - if (this.signInUserSession == null || !this.signInUserSession.isValid()) { - return callback.onFailure(new Error('User is not authenticated')); - } - - this.client.request('GlobalSignOut', { - AccessToken: this.signInUserSession.getAccessToken().getJwtToken() - }, function (err) { - if (err) { - return callback.onFailure(err); - } - _this12.clearCachedTokens(); - return callback.onSuccess('SUCCESS'); - }); - return undefined; - }; - - /** - * This is used for the user to signOut of the application and clear the cached tokens. - * @returns {void} - */ - - - CognitoUser.prototype.signOut = function signOut() { - this.signInUserSession = null; - this.clearCachedTokens(); - }; - - /** - * This is used by a user trying to select a given MFA - * @param {string} answerChallenge the mfa the user wants - * @param {nodeCallback} callback Called on success or error. - * @returns {void} - */ - - - CognitoUser.prototype.sendMFASelectionAnswer = function sendMFASelectionAnswer(answerChallenge, callback) { - var _this13 = this; - - var challengeResponses = {}; - challengeResponses.USERNAME = this.username; - challengeResponses.ANSWER = answerChallenge; - - var jsonReq = { - ChallengeName: 'SELECT_MFA_TYPE', - ChallengeResponses: challengeResponses, - ClientId: this.pool.getClientId(), - Session: this.Session - }; - if (this.getUserContextData()) { - jsonReq.UserContextData = this.getUserContextData(); - } - this.client.request('RespondToAuthChallenge', jsonReq, function (err, data) { - if (err) { - return callback.onFailure(err); - } - _this13.Session = data.Session; - if (answerChallenge === 'SMS_MFA') { - return callback.mfaRequired(data.challengeName, data.challengeParameters); - } - if (answerChallenge === 'SOFTWARE_TOKEN_MFA') { - return callback.totpRequired(data.challengeName, data.challengeParameters); - } - return undefined; - }); - }; - - /** - * This returns the user context data for advanced security feature. - * @returns {void} - */ - - - CognitoUser.prototype.getUserContextData = function getUserContextData() { - var pool = this.pool; - return pool.getUserContextData(this.username); - }; - - /** - * This is used by an authenticated or a user trying to authenticate to associate a TOTP MFA - * @param {nodeCallback} callback Called on success or error. - * @returns {void} - */ - - - CognitoUser.prototype.associateSoftwareToken = function associateSoftwareToken(callback) { - var _this14 = this; - - if (!(this.signInUserSession != null && this.signInUserSession.isValid())) { - this.client.request('AssociateSoftwareToken', { - Session: this.Session - }, function (err, data) { - if (err) { - return callback.onFailure(err); - } - _this14.Session = data.Session; - return callback.associateSecretCode(data.SecretCode); - }); - } else { - this.client.request('AssociateSoftwareToken', { - AccessToken: this.signInUserSession.getAccessToken().getJwtToken() - }, function (err, data) { - if (err) { - return callback.onFailure(err); - } - return callback.associateSecretCode(data.SecretCode); - }); - } - }; - - /** - * This is used by an authenticated or a user trying to authenticate to verify a TOTP MFA - * @param {string} totpCode The MFA code entered by the user. - * @param {string} friendlyDeviceName The device name we are assigning to the device. - * @param {nodeCallback} callback Called on success or error. - * @returns {void} - */ - - - CognitoUser.prototype.verifySoftwareToken = function verifySoftwareToken(totpCode, friendlyDeviceName, callback) { - var _this15 = this; - - if (!(this.signInUserSession != null && this.signInUserSession.isValid())) { - this.client.request('VerifySoftwareToken', { - Session: this.Session, - UserCode: totpCode, - FriendlyDeviceName: friendlyDeviceName - }, function (err, data) { - if (err) { - return callback.onFailure(err); - } - _this15.Session = data.Session; - var challengeResponses = {}; - challengeResponses.USERNAME = _this15.username; - var jsonReq = { - ChallengeName: 'MFA_SETUP', - ClientId: _this15.pool.getClientId(), - ChallengeResponses: challengeResponses, - Session: _this15.Session - }; - if (_this15.getUserContextData()) { - jsonReq.UserContextData = _this15.getUserContextData(); - } - _this15.client.request('RespondToAuthChallenge', jsonReq, function (errRespond, dataRespond) { - if (errRespond) { - return callback.onFailure(errRespond); - } - _this15.signInUserSession = _this15.getCognitoUserSession(dataRespond.AuthenticationResult); - _this15.cacheTokens(); - return callback.onSuccess(_this15.signInUserSession); - }); - return undefined; - }); - } else { - this.client.request('VerifySoftwareToken', { - AccessToken: this.signInUserSession.getAccessToken().getJwtToken(), - UserCode: totpCode, - FriendlyDeviceName: friendlyDeviceName - }, function (err, data) { - if (err) { - return callback.onFailure(err); - } - return callback.onSuccess(data); - }); - } - }; - - return CognitoUser; - }(); - - exports.default = CognitoUser; +exports.default = AuthenticationDetails; /***/ }), -/* 10 */ -/***/ (function(module, exports) { - - 'use strict'; - - exports.__esModule = true; - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - /*! - * Copyright 2016 Amazon.com, - * Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Amazon Software License (the "License"). - * You may not use this file except in compliance with the - * License. A copy of the License is located at - * - * http://aws.amazon.com/asl/ - * - * or in the "license" file accompanying this file. This file is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, express or implied. See the License - * for the specific language governing permissions and - * limitations under the License. - */ - - /** @class */ - var CognitoUserAttribute = function () { - /** - * Constructs a new CognitoUserAttribute object - * @param {string=} Name The record's name - * @param {string=} Value The record's value - */ - function CognitoUserAttribute() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - Name = _ref.Name, - Value = _ref.Value; - - _classCallCheck(this, CognitoUserAttribute); - - this.Name = Name || ''; - this.Value = Value || ''; - } - - /** - * @returns {string} the record's value. - */ - - - CognitoUserAttribute.prototype.getValue = function getValue() { - return this.Value; - }; - - /** - * Sets the record's value. - * @param {string} value The new value. - * @returns {CognitoUserAttribute} The record for method chaining. - */ - - - CognitoUserAttribute.prototype.setValue = function setValue(value) { - this.Value = value; - return this; - }; - - /** - * @returns {string} the record's name. - */ - +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { - CognitoUserAttribute.prototype.getName = function getName() { - return this.Name; - }; +"use strict"; - /** - * Sets the record's name - * @param {string} name The new name. - * @returns {CognitoUserAttribute} The record for method chaining. - */ +exports.__esModule = true; + +var _Client = __webpack_require__(17); + +var _Client2 = _interopRequireDefault(_Client); + +var _CognitoUser = __webpack_require__(6); + +var _CognitoUser2 = _interopRequireDefault(_CognitoUser); + +var _StorageHelper = __webpack_require__(12); + +var _StorageHelper2 = _interopRequireDefault(_StorageHelper); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /*! + * Copyright 2016 Amazon.com, + * Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Amazon Software License (the "License"). + * You may not use this file except in compliance with the + * License. A copy of the License is located at + * + * http://aws.amazon.com/asl/ + * + * or in the "license" file accompanying this file. This file is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, express or implied. See the License + * for the specific language governing permissions and + * limitations under the License. + */ + +/** @class */ +var CognitoUserPool = function () { + /** + * Constructs a new CognitoUserPool object + * @param {object} data Creation options. + * @param {string} data.UserPoolId Cognito user pool id. + * @param {string} data.ClientId User pool application client id. + * @param {object} data.Storage Optional storage object. + * @param {boolean} data.AdvancedSecurityDataCollectionFlag Optional: + * boolean flag indicating if the data collection is enabled + * to support cognito advanced security features. By default, this + * flag is set to true. + */ + function CognitoUserPool(data) { + _classCallCheck(this, CognitoUserPool); + + var _ref = data || {}, + UserPoolId = _ref.UserPoolId, + ClientId = _ref.ClientId, + endpoint = _ref.endpoint, + AdvancedSecurityDataCollectionFlag = _ref.AdvancedSecurityDataCollectionFlag; + + if (!UserPoolId || !ClientId) { + throw new Error('Both UserPoolId and ClientId are required.'); + } + if (!/^[\w-]+_.+$/.test(UserPoolId)) { + throw new Error('Invalid UserPoolId format.'); + } + var region = UserPoolId.split('_')[0]; + + this.userPoolId = UserPoolId; + this.clientId = ClientId; + + this.client = new _Client2.default(region, endpoint); + + /** + * By default, AdvancedSecurityDataCollectionFlag is set to true, + * if no input value is provided. + */ + this.advancedSecurityDataCollectionFlag = AdvancedSecurityDataCollectionFlag !== false; + + this.storage = data.Storage || new _StorageHelper2.default().getStorage(); + } + + /** + * @returns {string} the user pool id + */ + + + CognitoUserPool.prototype.getUserPoolId = function getUserPoolId() { + return this.userPoolId; + }; + + /** + * @returns {string} the client id + */ + + + CognitoUserPool.prototype.getClientId = function getClientId() { + return this.clientId; + }; + + /** + * @typedef {object} SignUpResult + * @property {CognitoUser} user New user. + * @property {bool} userConfirmed If the user is already confirmed. + */ + /** + * method for signing up a user + * @param {string} username User's username. + * @param {string} password Plain-text initial password entered by user. + * @param {(AttributeArg[])=} userAttributes New user attributes. + * @param {(AttributeArg[])=} validationData Application metadata. + * @param {nodeCallback} callback Called on error or with the new user. + * @returns {void} + */ + + + CognitoUserPool.prototype.signUp = function signUp(username, password, userAttributes, validationData, callback) { + var _this = this; + + var jsonReq = { + ClientId: this.clientId, + Username: username, + Password: password, + UserAttributes: userAttributes, + ValidationData: validationData + }; + if (this.getUserContextData(username)) { + jsonReq.UserContextData = this.getUserContextData(username); + } + this.client.request('SignUp', jsonReq, function (err, data) { + if (err) { + return callback(err, null); + } + + var cognitoUser = { + Username: username, + Pool: _this, + Storage: _this.storage + }; + + var returnData = { + user: new _CognitoUser2.default(cognitoUser), + userConfirmed: data.UserConfirmed, + userSub: data.UserSub + }; + + return callback(null, returnData); + }); + }; + + /** + * method for getting the current user of the application from the local storage + * + * @returns {CognitoUser} the user retrieved from storage + */ + + + CognitoUserPool.prototype.getCurrentUser = function getCurrentUser() { + var lastUserKey = 'CognitoIdentityServiceProvider.' + this.clientId + '.LastAuthUser'; + + var lastAuthUser = this.storage.getItem(lastUserKey); + if (lastAuthUser) { + var cognitoUser = { + Username: lastAuthUser, + Pool: this, + Storage: this.storage + }; + + return new _CognitoUser2.default(cognitoUser); + } + + return null; + }; + + /** + * This method returns the encoded data string used for cognito advanced security feature. + * This would be generated only when developer has included the JS used for collecting the + * data on their client. Please refer to documentation to know more about using AdvancedSecurity + * features + * @param {string} username the username for the context data + * @returns {string} the user context data + **/ + + + CognitoUserPool.prototype.getUserContextData = function getUserContextData(username) { + if (typeof AmazonCognitoAdvancedSecurityData === 'undefined') { + return undefined; + } + /* eslint-disable */ + var amazonCognitoAdvancedSecurityDataConst = AmazonCognitoAdvancedSecurityData; + /* eslint-enable */ + + if (this.advancedSecurityDataCollectionFlag) { + var advancedSecurityData = amazonCognitoAdvancedSecurityDataConst.getData(username, this.userPoolId, this.clientId); + if (advancedSecurityData) { + var userContextData = { + EncodedData: advancedSecurityData + }; + return userContextData; + } + } + return {}; + }; + + return CognitoUserPool; +}(); + +exports.default = CognitoUserPool; + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { - CognitoUserAttribute.prototype.setName = function setName(name) { - this.Name = name; - return this; - }; +"use strict"; + + +exports.__esModule = true; + +var _jsCookie = __webpack_require__(27); + +var Cookies = _interopRequireWildcard(_jsCookie); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** @class */ +var CookieStorage = function () { + + /** + * Constructs a new CookieStorage object + * @param {object} data Creation options. + * @param {string} data.domain Cookies domain (mandatory). + * @param {string} data.path Cookies path (default: '/') + * @param {integer} data.expires Cookie expiration (in days, default: 365) + * @param {boolean} data.secure Cookie secure flag (default: true) + */ + function CookieStorage(data) { + _classCallCheck(this, CookieStorage); + + this.domain = data.domain; + if (data.path) { + this.path = data.path; + } else { + this.path = '/'; + } + if (Object.prototype.hasOwnProperty.call(data, 'expires')) { + this.expires = data.expires; + } else { + this.expires = 365; + } + if (Object.prototype.hasOwnProperty.call(data, 'secure')) { + this.secure = data.secure; + } else { + this.secure = true; + } + } + + /** + * This is used to set a specific item in storage + * @param {string} key - the key for the item + * @param {object} value - the value + * @returns {string} value that was set + */ + + + CookieStorage.prototype.setItem = function setItem(key, value) { + Cookies.set(key, value, { + path: this.path, + expires: this.expires, + domain: this.domain, + secure: this.secure + }); + return Cookies.get(key); + }; + + /** + * This is used to get a specific key from storage + * @param {string} key - the key for the item + * This is used to clear the storage + * @returns {string} the data item + */ + + + CookieStorage.prototype.getItem = function getItem(key) { + return Cookies.get(key); + }; + + /** + * This is used to remove an item from storage + * @param {string} key - the key being set + * @returns {string} value - value that was deleted + */ + + + CookieStorage.prototype.removeItem = function removeItem(key) { + return Cookies.remove(key, { + path: this.path, + domain: this.domain, + secure: this.secure + }); + }; + + /** + * This is used to clear the storage + * @returns {string} nothing + */ + + + CookieStorage.prototype.clear = function clear() { + var cookies = Cookies.get(); + var index = void 0; + for (index = 0; index < cookies.length; ++index) { + Cookies.remove(cookies[index]); + } + return {}; + }; + + return CookieStorage; +}(); + +exports.default = CookieStorage; - /** - * @returns {string} a string representation of the record. - */ +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { +"use strict"; + + +exports.__esModule = true; + +var _UserAgent = __webpack_require__(18); + +var _UserAgent2 = _interopRequireDefault(_UserAgent); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** @class */ +var Client = function () { + /** + * Constructs a new AWS Cognito Identity Provider client object + * @param {string} region AWS region + * @param {string} endpoint endpoint + */ + function Client(region, endpoint) { + _classCallCheck(this, Client); + + this.endpoint = endpoint || 'https://cognito-idp.' + region + '.amazonaws.com/'; + this.userAgent = _UserAgent2.default.prototype.userAgent || 'aws-amplify/0.1.x js'; + } + + /** + * Makes an unauthenticated request on AWS Cognito Identity Provider API + * using fetch + * @param {string} operation API operation + * @param {object} params Input parameters + * @param {function} callback Callback called when a response is returned + * @returns {void} + */ + + + Client.prototype.request = function request(operation, params, callback) { + var headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSCognitoIdentityProviderService.' + operation, + 'X-Amz-User-Agent': this.userAgent + }; + + var options = { + headers: headers, + method: 'POST', + mode: 'cors', + cache: 'no-cache', + body: JSON.stringify(params) + }; + + var response = void 0; + + fetch(this.endpoint, options).then(function (resp) { + response = resp; + return resp; + }).then(function (resp) { + return resp.json().catch(function () { + return {}; + }); + }).then(function (data) { + if (response.ok) return callback(null, data); + + // Taken from aws-sdk-js/lib/protocol/json.js + // eslint-disable-next-line no-underscore-dangle + var code = (data.__type || data.code).split('#').pop(); + var error = { + code: code, + name: code, + message: data.message || data.Message || null + }; + return callback(error); + }).catch(function () { + // Taken from aws-sdk-js/lib/protocol/json.js + var code = (response.headers.get('x-amzn-errortype') || 'UnknownError').split(':')[0]; + var error = { + code: code, + name: code, + statusCode: response.status, + message: response.status.toString() + }; + return callback(error); + }); + }; + + return Client; +}(); + +exports.default = Client; - CognitoUserAttribute.prototype.toString = function toString() { - return JSON.stringify(this); - }; +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * @returns {object} a flat object representing the record. - */ +"use strict"; - CognitoUserAttribute.prototype.toJSON = function toJSON() { - return { - Name: this.Name, - Value: this.Value - }; - }; +exports.__esModule = true; +// class for defining the amzn user-agent +exports.default = UserAgent; +// constructor - return CognitoUserAttribute; - }(); - - exports.default = CognitoUserAttribute; +function UserAgent() {} +// public +UserAgent.prototype.userAgent = 'aws-amplify/0.1.x js'; /***/ }), -/* 11 */ -/***/ (function(module, exports) { - - 'use strict'; - - exports.__esModule = true; - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - /*! - * Copyright 2016 Amazon.com, - * Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Amazon Software License (the "License"). - * You may not use this file except in compliance with the - * License. A copy of the License is located at - * - * http://aws.amazon.com/asl/ - * - * or in the "license" file accompanying this file. This file is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, express or implied. See the License - * for the specific language governing permissions and - * limitations under the License. - */ +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { - /** @class */ - var CognitoUserSession = function () { - /** - * Constructs a new CognitoUserSession object - * @param {CognitoIdToken} IdToken The session's Id token. - * @param {CognitoRefreshToken=} RefreshToken The session's refresh token. - * @param {CognitoAccessToken} AccessToken The session's access token. - * @param {int} ClockDrift The saved computer's clock drift or undefined to force calculation. - */ - function CognitoUserSession() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - IdToken = _ref.IdToken, - RefreshToken = _ref.RefreshToken, - AccessToken = _ref.AccessToken, - ClockDrift = _ref.ClockDrift; +"use strict"; - _classCallCheck(this, CognitoUserSession); - if (AccessToken == null || IdToken == null) { - throw new Error('Id token and Access Token must be present.'); - } +exports.__esModule = true; - this.idToken = IdToken; - this.refreshToken = RefreshToken; - this.accessToken = AccessToken; - this.clockDrift = ClockDrift === undefined ? this.calculateClockDrift() : ClockDrift; - } +var _AuthenticationDetails = __webpack_require__(14); - /** - * @returns {CognitoIdToken} the session's Id token - */ +Object.defineProperty(exports, 'AuthenticationDetails', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_AuthenticationDetails).default; + } +}); +var _AuthenticationHelper = __webpack_require__(2); - CognitoUserSession.prototype.getIdToken = function getIdToken() { - return this.idToken; - }; +Object.defineProperty(exports, 'AuthenticationHelper', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_AuthenticationHelper).default; + } +}); - /** - * @returns {CognitoRefreshToken} the session's refresh token - */ +var _CognitoAccessToken = __webpack_require__(3); +Object.defineProperty(exports, 'CognitoAccessToken', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_CognitoAccessToken).default; + } +}); - CognitoUserSession.prototype.getRefreshToken = function getRefreshToken() { - return this.refreshToken; - }; +var _CognitoIdToken = __webpack_require__(4); - /** - * @returns {CognitoAccessToken} the session's access token - */ +Object.defineProperty(exports, 'CognitoIdToken', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_CognitoIdToken).default; + } +}); +var _CognitoRefreshToken = __webpack_require__(5); - CognitoUserSession.prototype.getAccessToken = function getAccessToken() { - return this.accessToken; - }; +Object.defineProperty(exports, 'CognitoRefreshToken', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_CognitoRefreshToken).default; + } +}); - /** - * @returns {int} the session's clock drift - */ +var _CognitoUser = __webpack_require__(6); +Object.defineProperty(exports, 'CognitoUser', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_CognitoUser).default; + } +}); - CognitoUserSession.prototype.getClockDrift = function getClockDrift() { - return this.clockDrift; - }; +var _CognitoUserAttribute = __webpack_require__(7); - /** - * @returns {int} the computer's clock drift - */ +Object.defineProperty(exports, 'CognitoUserAttribute', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_CognitoUserAttribute).default; + } +}); +var _CognitoUserPool = __webpack_require__(15); - CognitoUserSession.prototype.calculateClockDrift = function calculateClockDrift() { - var now = Math.floor(new Date() / 1000); - var iat = Math.min(this.accessToken.getIssuedAt(), this.idToken.getIssuedAt()); +Object.defineProperty(exports, 'CognitoUserPool', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_CognitoUserPool).default; + } +}); - return now - iat; - }; +var _CognitoUserSession = __webpack_require__(8); - /** - * Checks to see if the session is still valid based on session expiry information found - * in tokens and the current time (adjusted with clock drift) - * @returns {boolean} if the session is still valid - */ +Object.defineProperty(exports, 'CognitoUserSession', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_CognitoUserSession).default; + } +}); +var _CookieStorage = __webpack_require__(16); - CognitoUserSession.prototype.isValid = function isValid() { - var now = Math.floor(new Date() / 1000); - var adjusted = now - this.clockDrift; +Object.defineProperty(exports, 'CookieStorage', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_CookieStorage).default; + } +}); - return adjusted < this.accessToken.getExpiration() && adjusted < this.idToken.getExpiration(); - }; +var _DateHelper = __webpack_require__(9); - return CognitoUserSession; - }(); +Object.defineProperty(exports, 'DateHelper', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_DateHelper).default; + } +}); - exports.default = CognitoUserSession; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), -/* 12 */ -/***/ (function(module, exports) { - - 'use strict'; - - exports.__esModule = true; - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - /*! - * Copyright 2016 Amazon.com, - * Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Amazon Software License (the "License"). - * You may not use this file except in compliance with the - * License. A copy of the License is located at - * - * http://aws.amazon.com/asl/ - * - * or in the "license" file accompanying this file. This file is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, express or implied. See the License - * for the specific language governing permissions and - * limitations under the License. - */ - - var monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; - var weekNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; - - /** @class */ - - var DateHelper = function () { - function DateHelper() { - _classCallCheck(this, DateHelper); - } - - /** - * @returns {string} The current time in "ddd MMM D HH:mm:ss UTC YYYY" format. - */ - DateHelper.prototype.getNowString = function getNowString() { - var now = new Date(); - - var weekDay = weekNames[now.getUTCDay()]; - var month = monthNames[now.getUTCMonth()]; - var day = now.getUTCDate(); - - var hours = now.getUTCHours(); - if (hours < 10) { - hours = '0' + hours; - } - - var minutes = now.getUTCMinutes(); - if (minutes < 10) { - minutes = '0' + minutes; - } - - var seconds = now.getUTCSeconds(); - if (seconds < 10) { - seconds = '0' + seconds; - } +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { - var year = now.getUTCFullYear(); +"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 placeHoldersCount (b64) { + var len = b64.length + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // the number of equal signs (place holders) + // if there are two placeholders, than the two characters before it + // represent one byte + // if there is only one, then the three characters before it represent 2 bytes + // this is just a cheap hack to not do indexOf twice + return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0 +} + +function byteLength (b64) { + // base64 is 4/3 + up to two characters of the original data + return (b64.length * 3 / 4) - placeHoldersCount(b64) +} + +function toByteArray (b64) { + var i, l, tmp, placeHolders, arr + var len = b64.length + placeHolders = placeHoldersCount(b64) + + arr = new Arr((len * 3 / 4) - placeHolders) + + // if there are placeholders, only get up to the last complete 4 chars + l = placeHolders > 0 ? len - 4 : len + + var L = 0 + + for (i = 0; i < l; 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[L++] = (tmp >> 16) & 0xFF + arr[L++] = (tmp >> 8) & 0xFF + arr[L++] = tmp & 0xFF + } + + if (placeHolders === 2) { + tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[L++] = tmp & 0xFF + } else if (placeHolders === 1) { + tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[L++] = (tmp >> 8) & 0xFF + arr[L++] = 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 output = '' + 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] + output += lookup[tmp >> 2] + output += lookup[(tmp << 4) & 0x3F] + output += '==' + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + (uint8[len - 1]) + output += lookup[tmp >> 10] + output += lookup[(tmp >> 4) & 0x3F] + output += lookup[(tmp << 2) & 0x3F] + output += '=' + } + + parts.push(output) + + return parts.join('') +} - // ddd MMM D HH:mm:ss UTC YYYY - var dateNow = weekDay + ' ' + month + ' ' + day + ' ' + hours + ':' + minutes + ':' + seconds + ' UTC ' + year; - return dateNow; - }; +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { - return DateHelper; - }(); +/* + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for more info. + */ + +var helpers = __webpack_require__(1); + +/* + * Perform a simple self-test to see if the VM is working + */ +function md5_vm_test() +{ + return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"; +} + +/* + * Calculate the MD5 of an array of little-endian words, and a bit length + */ +function core_md5(x, len) +{ + /* append padding */ + x[len >> 5] |= 0x80 << ((len) % 32); + x[(((len + 64) >>> 9) << 4) + 14] = len; + + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + + for(var i = 0; i < x.length; i += 16) + { + var olda = a; + var oldb = b; + var oldc = c; + var oldd = d; + + a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936); + d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586); + c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819); + b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330); + a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897); + d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426); + c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341); + b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983); + a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416); + d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417); + c = md5_ff(c, d, a, b, x[i+10], 17, -42063); + b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162); + a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682); + d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); + c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290); + b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329); + + a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510); + d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632); + c = md5_gg(c, d, a, b, x[i+11], 14, 643717713); + b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302); + a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691); + d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083); + c = md5_gg(c, d, a, b, x[i+15], 14, -660478335); + b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848); + a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438); + d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690); + c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961); + b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501); + a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467); + d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784); + c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473); + b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734); + + a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558); + d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); + c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562); + b = md5_hh(b, c, d, a, x[i+14], 23, -35309556); + a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060); + d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353); + c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632); + b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640); + a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174); + d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222); + c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979); + b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189); + a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487); + d = md5_hh(d, a, b, c, x[i+12], 11, -421815835); + c = md5_hh(c, d, a, b, x[i+15], 16, 530742520); + b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651); + + a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844); + d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415); + c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905); + b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055); + a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571); + d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606); + c = md5_ii(c, d, a, b, x[i+10], 15, -1051523); + b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799); + a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359); + d = md5_ii(d, a, b, c, x[i+15], 10, -30611744); + c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380); + b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649); + a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070); + d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379); + c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259); + b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551); + + a = safe_add(a, olda); + b = safe_add(b, oldb); + c = safe_add(c, oldc); + d = safe_add(d, oldd); + } + return Array(a, b, c, d); + +} + +/* + * These functions implement the four basic operations the algorithm uses. + */ +function md5_cmn(q, a, b, x, s, t) +{ + return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); +} +function md5_ff(a, b, c, d, x, s, t) +{ + return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); +} +function md5_gg(a, b, c, d, x, s, t) +{ + return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); +} +function md5_hh(a, b, c, d, x, s, t) +{ + return md5_cmn(b ^ c ^ d, a, b, x, s, t); +} +function md5_ii(a, b, c, d, x, s, t) +{ + return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); +} + +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ +function safe_add(x, y) +{ + var lsw = (x & 0xFFFF) + (y & 0xFFFF); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); +} + +/* + * Bitwise rotate a 32-bit number to the left. + */ +function bit_rol(num, cnt) +{ + return (num << cnt) | (num >>> (32 - cnt)); +} + +module.exports = function md5(buf) { + return helpers.hash(buf, core_md5, 16); +}; - exports.default = DateHelper; /***/ }), -/* 13 */ +/* 22 */ /***/ (function(module, exports) { - 'use strict'; - - exports.__esModule = true; - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - /*! - * Copyright 2016 Amazon.com, - * Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Amazon Software License (the "License"). - * You may not use this file except in compliance with the - * License. A copy of the License is located at - * - * http://aws.amazon.com/asl/ - * - * or in the "license" file accompanying this file. This file is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, express or implied. See the License - * for the specific language governing permissions and - * limitations under the License. - */ - - var dataMemory = {}; - - /** @class */ - - var MemoryStorage = function () { - function MemoryStorage() { - _classCallCheck(this, MemoryStorage); - } - - /** - * This is used to set a specific item in storage - * @param {string} key - the key for the item - * @param {object} value - the value - * @returns {string} value that was set - */ - MemoryStorage.setItem = function setItem(key, value) { - dataMemory[key] = value; - return dataMemory[key]; - }; - - /** - * This is used to get a specific key from storage - * @param {string} key - the key for the item - * This is used to clear the storage - * @returns {string} the data item - */ - - - MemoryStorage.getItem = function getItem(key) { - return Object.prototype.hasOwnProperty.call(dataMemory, key) ? dataMemory[key] : undefined; - }; - - /** - * This is used to remove an item from storage - * @param {string} key - the key being set - * @returns {string} value - value that was deleted - */ - - - MemoryStorage.removeItem = function removeItem(key) { - return delete dataMemory[key]; - }; - - /** - * This is used to clear the storage - * @returns {string} nothing - */ +// Original code adapted from Robert Kieffer. +// details at https://github.com/broofa/node-uuid +(function() { + var _global = this; + var mathRNG, whatwgRNG; - MemoryStorage.clear = function clear() { - dataMemory = {}; - return dataMemory; - }; + // NOTE: Math.random() does not guarantee "cryptographic quality" + mathRNG = function(size) { + var bytes = new Array(size); + var r; - return MemoryStorage; - }(); + for (var i = 0, r; i < size; i++) { + if ((i & 0x03) == 0) r = Math.random() * 0x100000000; + bytes[i] = r >>> ((i & 0x03) << 3) & 0xff; + } - /** @class */ + return bytes; + } + if (_global.crypto && crypto.getRandomValues) { + whatwgRNG = function(size) { + var bytes = new Uint8Array(size); + crypto.getRandomValues(bytes); + return bytes; + } + } - var StorageHelper = function () { + module.exports = whatwgRNG || mathRNG; - /** - * This is used to get a storage object - * @returns {object} the storage - */ - function StorageHelper() { - _classCallCheck(this, StorageHelper); +}()) - try { - this.storageWindow = window.localStorage; - this.storageWindow.setItem('aws.cognito.test-ls', 1); - this.storageWindow.removeItem('aws.cognito.test-ls'); - } catch (exception) { - this.storageWindow = MemoryStorage; - } - } - - /** - * This is used to return the storage - * @returns {object} the storage - */ - - - StorageHelper.prototype.getStorage = function getStorage() { - return this.storageWindow; - }; - - return StorageHelper; - }(); - - exports.default = StorageHelper; /***/ }), -/* 14 */ +/* 23 */ /***/ (function(module, exports, __webpack_require__) { - var Buffer = __webpack_require__(1).Buffer - var sha = __webpack_require__(26) - var sha256 = __webpack_require__(27) - var rng = __webpack_require__(25) - var md5 = __webpack_require__(24) - - var algorithms = { - sha1: sha, - sha256: sha256, - md5: md5 - } - - var blocksize = 64 - var zeroBuffer = new Buffer(blocksize); zeroBuffer.fill(0) - function hmac(fn, key, data) { - if(!Buffer.isBuffer(key)) key = new Buffer(key) - if(!Buffer.isBuffer(data)) data = new Buffer(data) - - if(key.length > blocksize) { - key = fn(key) - } else if(key.length < blocksize) { - key = Buffer.concat([key, zeroBuffer], blocksize) - } - - var ipad = new Buffer(blocksize), opad = new Buffer(blocksize) - for(var i = 0; i < blocksize; i++) { - ipad[i] = key[i] ^ 0x36 - opad[i] = key[i] ^ 0x5C - } - - var hash = fn(Buffer.concat([ipad, data])) - return fn(Buffer.concat([opad, hash])) - } - - function hash(alg, key) { - alg = alg || 'sha1' - var fn = algorithms[alg] - var bufs = [] - var length = 0 - if(!fn) error('algorithm:', alg, 'is not yet supported') - return { - update: function (data) { - if(!Buffer.isBuffer(data)) data = new Buffer(data) - - bufs.push(data) - length += data.length - return this - }, - digest: function (enc) { - var buf = Buffer.concat(bufs) - var r = key ? hmac(fn, key, buf) : fn(buf) - bufs = null - return enc ? r.toString(enc) : r - } - } - } - - function error () { - var m = [].slice.call(arguments).join(' ') - throw new Error([ - m, - 'we accept pull requests', - 'http://github.com/dominictarr/crypto-browserify' - ].join('\n')) - } +/* + * 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. + */ - exports.createHash = function (alg) { return hash(alg) } - exports.createHmac = function (alg, key) { return hash(alg, key) } - exports.randomBytes = function(size, callback) { - if (callback && callback.call) { - try { - callback.call(this, undefined, new Buffer(rng(size))) - } catch (err) { callback(err) } - } else { - return new Buffer(rng(size)) - } - } +var helpers = __webpack_require__(1); - function each(a, f) { - for(var i in a) - f(a[i], i) - } +/* + * Calculate the SHA-1 of an array of big-endian words, and a bit length + */ +function core_sha1(x, len) +{ + /* append padding */ + x[len >> 5] |= 0x80 << (24 - len % 32); + x[((len + 64 >> 9) << 4) + 15] = len; + + var w = Array(80); + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + var e = -1009589776; + + for(var i = 0; i < x.length; i += 16) + { + var olda = a; + var oldb = b; + var oldc = c; + var oldd = d; + var olde = e; + + for(var j = 0; j < 80; j++) + { + if(j < 16) w[j] = x[i + j]; + else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1); + var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)), + safe_add(safe_add(e, w[j]), sha1_kt(j))); + e = d; + d = c; + c = rol(b, 30); + b = a; + a = t; + } + + a = safe_add(a, olda); + b = safe_add(b, oldb); + c = safe_add(c, oldc); + d = safe_add(d, oldd); + e = safe_add(e, olde); + } + return Array(a, b, c, d, e); + +} + +/* + * Perform the appropriate triplet combination function for the current + * iteration + */ +function sha1_ft(t, b, c, d) +{ + if(t < 20) return (b & c) | ((~b) & d); + if(t < 40) return b ^ c ^ d; + if(t < 60) return (b & c) | (b & d) | (c & d); + return b ^ c ^ d; +} + +/* + * Determine the appropriate additive constant for the current iteration + */ +function sha1_kt(t) +{ + return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : + (t < 60) ? -1894007588 : -899497514; +} + +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ +function safe_add(x, y) +{ + var lsw = (x & 0xFFFF) + (y & 0xFFFF); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); +} + +/* + * Bitwise rotate a 32-bit number to the left. + */ +function rol(num, cnt) +{ + return (num << cnt) | (num >>> (32 - cnt)); +} - // the least I can do is make error messages for the rest of the node.js/crypto api. - each(['createCredentials' - , 'createCipher' - , 'createCipheriv' - , 'createDecipher' - , 'createDecipheriv' - , 'createSign' - , 'createVerify' - , 'createDiffieHellman' - , 'pbkdf2'], function (name) { - exports[name] = function () { - error('sorry,', name, 'is not implemented yet') - } - }) +module.exports = function sha1(buf) { + return helpers.hash(buf, core_sha1, 20, true); +}; /***/ }), -/* 15 */ -/***/ (function(module, exports) { - - '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 - } - - revLookup['-'.charCodeAt(0)] = 62 - revLookup['_'.charCodeAt(0)] = 63 - - function placeHoldersCount (b64) { - var len = b64.length - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // the number of equal signs (place holders) - // if there are two placeholders, than the two characters before it - // represent one byte - // if there is only one, then the three characters before it represent 2 bytes - // this is just a cheap hack to not do indexOf twice - return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0 - } - - function byteLength (b64) { - // base64 is 4/3 + up to two characters of the original data - return (b64.length * 3 / 4) - placeHoldersCount(b64) - } - - function toByteArray (b64) { - var i, l, tmp, placeHolders, arr - var len = b64.length - placeHolders = placeHoldersCount(b64) - - arr = new Arr((len * 3 / 4) - placeHolders) - - // if there are placeholders, only get up to the last complete 4 chars - l = placeHolders > 0 ? len - 4 : len - - var L = 0 - - for (i = 0; i < l; 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[L++] = (tmp >> 16) & 0xFF - arr[L++] = (tmp >> 8) & 0xFF - arr[L++] = tmp & 0xFF - } - - if (placeHolders === 2) { - tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) - arr[L++] = tmp & 0xFF - } else if (placeHolders === 1) { - tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) - arr[L++] = (tmp >> 8) & 0xFF - arr[L++] = tmp & 0xFF - } - - return arr - } +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { - 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) + (uint8[i + 1] << 8) + (uint8[i + 2]) - output.push(tripletToBase64(tmp)) - } - return output.join('') - } +/** + * 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 + * + */ - function fromByteArray (uint8) { - var tmp - var len = uint8.length - var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes - var output = '' - 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] - output += lookup[tmp >> 2] - output += lookup[(tmp << 4) & 0x3F] - output += '==' - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + (uint8[len - 1]) - output += lookup[tmp >> 10] - output += lookup[(tmp >> 4) & 0x3F] - output += lookup[(tmp << 2) & 0x3F] - output += '=' - } - - parts.push(output) - - return parts.join('') - } +var helpers = __webpack_require__(1); + +var safe_add = function(x, y) { + var lsw = (x & 0xFFFF) + (y & 0xFFFF); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); +}; + +var S = function(X, n) { + return (X >>> n) | (X << (32 - n)); +}; + +var R = function(X, n) { + return (X >>> n); +}; + +var Ch = function(x, y, z) { + return ((x & y) ^ ((~x) & z)); +}; + +var Maj = function(x, y, z) { + return ((x & y) ^ (x & z) ^ (y & z)); +}; + +var Sigma0256 = function(x) { + return (S(x, 2) ^ S(x, 13) ^ S(x, 22)); +}; + +var Sigma1256 = function(x) { + return (S(x, 6) ^ S(x, 11) ^ S(x, 25)); +}; + +var Gamma0256 = function(x) { + return (S(x, 7) ^ S(x, 18) ^ R(x, 3)); +}; + +var Gamma1256 = function(x) { + return (S(x, 17) ^ S(x, 19) ^ R(x, 10)); +}; + +var core_sha256 = function(m, l) { + var K = new Array(0x428A2F98,0x71374491,0xB5C0FBCF,0xE9B5DBA5,0x3956C25B,0x59F111F1,0x923F82A4,0xAB1C5ED5,0xD807AA98,0x12835B01,0x243185BE,0x550C7DC3,0x72BE5D74,0x80DEB1FE,0x9BDC06A7,0xC19BF174,0xE49B69C1,0xEFBE4786,0xFC19DC6,0x240CA1CC,0x2DE92C6F,0x4A7484AA,0x5CB0A9DC,0x76F988DA,0x983E5152,0xA831C66D,0xB00327C8,0xBF597FC7,0xC6E00BF3,0xD5A79147,0x6CA6351,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 HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19); + var W = new Array(64); + var a, b, c, d, e, f, g, h, i, j; + var T1, T2; + /* append padding */ + m[l >> 5] |= 0x80 << (24 - l % 32); + m[((l + 64 >> 9) << 4) + 15] = l; + for (var i = 0; i < m.length; i += 16) { + a = HASH[0]; b = HASH[1]; c = HASH[2]; d = HASH[3]; e = HASH[4]; f = HASH[5]; g = HASH[6]; h = HASH[7]; + for (var j = 0; j < 64; j++) { + if (j < 16) { + W[j] = m[j + i]; + } else { + W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]); + } + T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]); + T2 = safe_add(Sigma0256(a), Maj(a, b, c)); + h = g; g = f; f = e; e = safe_add(d, T1); d = c; c = b; b = a; a = safe_add(T1, T2); + } + HASH[0] = safe_add(a, HASH[0]); HASH[1] = safe_add(b, HASH[1]); HASH[2] = safe_add(c, HASH[2]); HASH[3] = safe_add(d, HASH[3]); + HASH[4] = safe_add(e, HASH[4]); HASH[5] = safe_add(f, HASH[5]); HASH[6] = safe_add(g, HASH[6]); HASH[7] = safe_add(h, HASH[7]); + } + return HASH; +}; + +module.exports = function sha256(buf) { + return helpers.hash(buf, core_sha256, 32, true); +}; /***/ }), -/* 16 */ +/* 25 */ /***/ (function(module, exports) { - 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 - } +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 +} /***/ }), -/* 17 */ +/* 26 */ /***/ (function(module, exports) { - var toString = {}.toString; +var toString = {}.toString; - module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; - }; +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; /***/ }), -/* 18 */ +/* 27 */ /***/ (function(module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! - * JavaScript Cookie v2.2.0 - * https://github.com/js-cookie/js-cookie - * - * Copyright 2006, 2015 Klaus Hartl & Fagner Brack - * Released under the MIT license - */ - ;(function (factory) { - var registeredInModuleLoader = false; - if (true) { - !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - registeredInModuleLoader = true; - } - if (true) { - module.exports = factory(); - registeredInModuleLoader = true; - } - if (!registeredInModuleLoader) { - var OldCookies = window.Cookies; - var api = window.Cookies = factory(); - api.noConflict = function () { - window.Cookies = OldCookies; - return api; - }; - } - }(function () { - function extend () { - var i = 0; - var result = {}; - for (; i < arguments.length; i++) { - var attributes = arguments[ i ]; - for (var key in attributes) { - result[key] = attributes[key]; - } +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * JavaScript Cookie v2.2.0 + * https://github.com/js-cookie/js-cookie + * + * Copyright 2006, 2015 Klaus Hartl & Fagner Brack + * Released under the MIT license + */ +;(function (factory) { + var registeredInModuleLoader = false; + if (true) { + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + registeredInModuleLoader = true; + } + if (true) { + module.exports = factory(); + registeredInModuleLoader = true; + } + if (!registeredInModuleLoader) { + var OldCookies = window.Cookies; + var api = window.Cookies = factory(); + api.noConflict = function () { + window.Cookies = OldCookies; + return api; + }; + } +}(function () { + function extend () { + var i = 0; + var result = {}; + for (; i < arguments.length; i++) { + var attributes = arguments[ i ]; + for (var key in attributes) { + result[key] = attributes[key]; } - return result; } + return result; + } - function init (converter) { - function api (key, value, attributes) { - var result; - if (typeof document === 'undefined') { - return; - } + function init (converter) { + function api (key, value, attributes) { + var result; + if (typeof document === 'undefined') { + return; + } - // Write + // Write - if (arguments.length > 1) { - attributes = extend({ - path: '/' - }, api.defaults, attributes); + if (arguments.length > 1) { + attributes = extend({ + path: '/' + }, api.defaults, attributes); - if (typeof attributes.expires === 'number') { - var expires = new Date(); - expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5); - attributes.expires = expires; - } + if (typeof attributes.expires === 'number') { + var expires = new Date(); + expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5); + attributes.expires = expires; + } - // We're using "expires" because "max-age" is not supported by IE - attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; - - try { - result = JSON.stringify(value); - if (/^[\{\[]/.test(result)) { - value = result; - } - } catch (e) {} - - if (!converter.write) { - value = encodeURIComponent(String(value)) - .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); - } else { - value = converter.write(value, key); - } + // We're using "expires" because "max-age" is not supported by IE + attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; - key = encodeURIComponent(String(key)); - key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent); - key = key.replace(/[\(\)]/g, escape); - - var stringifiedAttributes = ''; - - for (var attributeName in attributes) { - if (!attributes[attributeName]) { - continue; - } - stringifiedAttributes += '; ' + attributeName; - if (attributes[attributeName] === true) { - continue; - } - stringifiedAttributes += '=' + attributes[attributeName]; + try { + result = JSON.stringify(value); + if (/^[\{\[]/.test(result)) { + value = result; } - return (document.cookie = key + '=' + value + stringifiedAttributes); - } + } catch (e) {} - // Read - - if (!key) { - result = {}; + if (!converter.write) { + value = encodeURIComponent(String(value)) + .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); + } else { + value = converter.write(value, key); } - // To prevent the for loop in the first place assign an empty array - // in case there are no cookies at all. Also prevents odd result when - // calling "get()" - var cookies = document.cookie ? document.cookie.split('; ') : []; - var rdecode = /(%[0-9A-Z]{2})+/g; - var i = 0; + key = encodeURIComponent(String(key)); + key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent); + key = key.replace(/[\(\)]/g, escape); - for (; i < cookies.length; i++) { - var parts = cookies[i].split('='); - var cookie = parts.slice(1).join('='); + var stringifiedAttributes = ''; - if (!this.json && cookie.charAt(0) === '"') { - cookie = cookie.slice(1, -1); + for (var attributeName in attributes) { + if (!attributes[attributeName]) { + continue; } - - try { - var name = parts[0].replace(rdecode, decodeURIComponent); - cookie = converter.read ? - converter.read(cookie, name) : converter(cookie, name) || - cookie.replace(rdecode, decodeURIComponent); - - if (this.json) { - try { - cookie = JSON.parse(cookie); - } catch (e) {} - } - - if (key === name) { - result = cookie; - break; - } - - if (!key) { - result[name] = cookie; - } - } catch (e) {} + stringifiedAttributes += '; ' + attributeName; + if (attributes[attributeName] === true) { + continue; + } + stringifiedAttributes += '=' + attributes[attributeName]; } - - return result; + return (document.cookie = key + '=' + value + stringifiedAttributes); } - api.set = api; - api.get = function (key) { - return api.call(api, key); - }; - api.getJSON = function () { - return api.apply({ - json: true - }, [].slice.call(arguments)); - }; - api.defaults = {}; - - api.remove = function (key, attributes) { - api(key, '', extend(attributes, { - expires: -1 - })); - }; - - api.withConverter = init; - - return api; - } - - return init(function () {}); - })); - - -/***/ }), -/* 19 */ -/***/ (function(module, exports) { - - "use strict"; - - exports.__esModule = true; - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + // Read - /*! - * Copyright 2016 Amazon.com, - * Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Amazon Software License (the "License"). - * You may not use this file except in compliance with the - * License. A copy of the License is located at - * - * http://aws.amazon.com/asl/ - * - * or in the "license" file accompanying this file. This file is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, express or implied. See the License - * for the specific language governing permissions and - * limitations under the License. - */ - - /** @class */ - var AuthenticationDetails = function () { - /** - * Constructs a new AuthenticationDetails object - * @param {object=} data Creation options. - * @param {string} data.Username User being authenticated. - * @param {string} data.Password Plain-text password to authenticate with. - * @param {(AttributeArg[])?} data.ValidationData Application extra metadata. - * @param {(AttributeArg[])?} data.AuthParamaters Authentication paramaters for custom auth. - */ - function AuthenticationDetails(data) { - _classCallCheck(this, AuthenticationDetails); - - var _ref = data || {}, - ValidationData = _ref.ValidationData, - Username = _ref.Username, - Password = _ref.Password, - AuthParameters = _ref.AuthParameters; - - this.validationData = ValidationData || {}; - this.authParameters = AuthParameters || {}; - this.username = Username; - this.password = Password; - } - - /** - * @returns {string} the record's username - */ - - - AuthenticationDetails.prototype.getUsername = function getUsername() { - return this.username; - }; - - /** - * @returns {string} the record's password - */ - - - AuthenticationDetails.prototype.getPassword = function getPassword() { - return this.password; - }; + if (!key) { + result = {}; + } - /** - * @returns {Array} the record's validationData - */ + // To prevent the for loop in the first place assign an empty array + // in case there are no cookies at all. Also prevents odd result when + // calling "get()" + var cookies = document.cookie ? document.cookie.split('; ') : []; + var rdecode = /(%[0-9A-Z]{2})+/g; + var i = 0; + for (; i < cookies.length; i++) { + var parts = cookies[i].split('='); + var cookie = parts.slice(1).join('='); - AuthenticationDetails.prototype.getValidationData = function getValidationData() { - return this.validationData; - }; + if (!this.json && cookie.charAt(0) === '"') { + cookie = cookie.slice(1, -1); + } - /** - * @returns {Array} the record's authParameters - */ + try { + var name = parts[0].replace(rdecode, decodeURIComponent); + cookie = converter.read ? + converter.read(cookie, name) : converter(cookie, name) || + cookie.replace(rdecode, decodeURIComponent); + if (this.json) { + try { + cookie = JSON.parse(cookie); + } catch (e) {} + } - AuthenticationDetails.prototype.getAuthParameters = function getAuthParameters() { - return this.authParameters; - }; + if (key === name) { + result = cookie; + break; + } - return AuthenticationDetails; - }(); + if (!key) { + result[name] = cookie; + } + } catch (e) {} + } - exports.default = AuthenticationDetails; + return result; + } -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { + api.set = api; + api.get = function (key) { + return api.call(api, key); + }; + api.getJSON = function () { + return api.apply({ + json: true + }, [].slice.call(arguments)); + }; + api.defaults = {}; - 'use strict'; - - exports.__esModule = true; - - var _UserAgent = __webpack_require__(23); - - var _UserAgent2 = _interopRequireDefault(_UserAgent); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - /** @class */ - var Client = function () { - /** - * Constructs a new AWS Cognito Identity Provider client object - * @param {string} region AWS region - * @param {string} endpoint endpoint - */ - function Client(region, endpoint) { - _classCallCheck(this, Client); - - this.endpoint = endpoint || 'https://cognito-idp.' + region + '.amazonaws.com/'; - this.userAgent = _UserAgent2.default.prototype.userAgent || 'aws-amplify/0.1.x js'; - } - - /** - * Makes an unauthenticated request on AWS Cognito Identity Provider API - * using fetch - * @param {string} operation API operation - * @param {object} params Input parameters - * @param {function} callback Callback called when a response is returned - * @returns {void} - */ - - - Client.prototype.request = function request(operation, params, callback) { - var headers = { - 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AWSCognitoIdentityProviderService.' + operation, - 'X-Amz-User-Agent': this.userAgent - }; - - var options = { - headers: headers, - method: 'POST', - mode: 'cors', - cache: 'no-cache', - body: JSON.stringify(params) - }; - - var response = void 0; - - fetch(this.endpoint, options).then(function (resp) { - response = resp; - return resp; - }).then(function (resp) { - return resp.json().catch(function () { - return {}; - }); - }).then(function (data) { - if (response.ok) return callback(null, data); - - // Taken from aws-sdk-js/lib/protocol/json.js - // eslint-disable-next-line no-underscore-dangle - var code = (data.__type || data.code).split('#').pop(); - var error = { - code: code, - name: code, - message: data.message || data.Message || null - }; - return callback(error); - }).catch(function () { - // Taken from aws-sdk-js/lib/protocol/json.js - var code = (response.headers.get('x-amzn-errortype') || 'UnknownError').split(':')[0]; - var error = { - code: code, - name: code, - statusCode: response.status, - message: response.status.toString() - }; - return callback(error); - }); - }; - - return Client; - }(); - - exports.default = Client; + api.remove = function (key, attributes) { + api(key, '', extend(attributes, { + expires: -1 + })); + }; -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { + api.withConverter = init; - 'use strict'; - - exports.__esModule = true; - - var _Client = __webpack_require__(20); - - var _Client2 = _interopRequireDefault(_Client); - - var _CognitoUser = __webpack_require__(9); - - var _CognitoUser2 = _interopRequireDefault(_CognitoUser); - - var _StorageHelper = __webpack_require__(13); - - var _StorageHelper2 = _interopRequireDefault(_StorageHelper); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /*! - * Copyright 2016 Amazon.com, - * Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Amazon Software License (the "License"). - * You may not use this file except in compliance with the - * License. A copy of the License is located at - * - * http://aws.amazon.com/asl/ - * - * or in the "license" file accompanying this file. This file is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, express or implied. See the License - * for the specific language governing permissions and - * limitations under the License. - */ - - /** @class */ - var CognitoUserPool = function () { - /** - * Constructs a new CognitoUserPool object - * @param {object} data Creation options. - * @param {string} data.UserPoolId Cognito user pool id. - * @param {string} data.ClientId User pool application client id. - * @param {object} data.Storage Optional storage object. - * @param {boolean} data.AdvancedSecurityDataCollectionFlag Optional: - * boolean flag indicating if the data collection is enabled - * to support cognito advanced security features. By default, this - * flag is set to true. - */ - function CognitoUserPool(data) { - _classCallCheck(this, CognitoUserPool); - - var _ref = data || {}, - UserPoolId = _ref.UserPoolId, - ClientId = _ref.ClientId, - endpoint = _ref.endpoint, - AdvancedSecurityDataCollectionFlag = _ref.AdvancedSecurityDataCollectionFlag; - - if (!UserPoolId || !ClientId) { - throw new Error('Both UserPoolId and ClientId are required.'); - } - if (!/^[\w-]+_.+$/.test(UserPoolId)) { - throw new Error('Invalid UserPoolId format.'); - } - var region = UserPoolId.split('_')[0]; - - this.userPoolId = UserPoolId; - this.clientId = ClientId; - - this.client = new _Client2.default(region, endpoint); - - /** - * By default, AdvancedSecurityDataCollectionFlag is set to true, - * if no input value is provided. - */ - this.advancedSecurityDataCollectionFlag = AdvancedSecurityDataCollectionFlag !== false; - - this.storage = data.Storage || new _StorageHelper2.default().getStorage(); - } - - /** - * @returns {string} the user pool id - */ - - - CognitoUserPool.prototype.getUserPoolId = function getUserPoolId() { - return this.userPoolId; - }; - - /** - * @returns {string} the client id - */ - - - CognitoUserPool.prototype.getClientId = function getClientId() { - return this.clientId; - }; - - /** - * @typedef {object} SignUpResult - * @property {CognitoUser} user New user. - * @property {bool} userConfirmed If the user is already confirmed. - */ - /** - * method for signing up a user - * @param {string} username User's username. - * @param {string} password Plain-text initial password entered by user. - * @param {(AttributeArg[])=} userAttributes New user attributes. - * @param {(AttributeArg[])=} validationData Application metadata. - * @param {nodeCallback} callback Called on error or with the new user. - * @returns {void} - */ - - - CognitoUserPool.prototype.signUp = function signUp(username, password, userAttributes, validationData, callback) { - var _this = this; - - var jsonReq = { - ClientId: this.clientId, - Username: username, - Password: password, - UserAttributes: userAttributes, - ValidationData: validationData - }; - if (this.getUserContextData(username)) { - jsonReq.UserContextData = this.getUserContextData(username); - } - this.client.request('SignUp', jsonReq, function (err, data) { - if (err) { - return callback(err, null); - } - - var cognitoUser = { - Username: username, - Pool: _this, - Storage: _this.storage - }; - - var returnData = { - user: new _CognitoUser2.default(cognitoUser), - userConfirmed: data.UserConfirmed, - userSub: data.UserSub - }; - - return callback(null, returnData); - }); - }; - - /** - * method for getting the current user of the application from the local storage - * - * @returns {CognitoUser} the user retrieved from storage - */ - - - CognitoUserPool.prototype.getCurrentUser = function getCurrentUser() { - var lastUserKey = 'CognitoIdentityServiceProvider.' + this.clientId + '.LastAuthUser'; - - var lastAuthUser = this.storage.getItem(lastUserKey); - if (lastAuthUser) { - var cognitoUser = { - Username: lastAuthUser, - Pool: this, - Storage: this.storage - }; - - return new _CognitoUser2.default(cognitoUser); - } - - return null; - }; - - /** - * This method returns the encoded data string used for cognito advanced security feature. - * This would be generated only when developer has included the JS used for collecting the - * data on their client. Please refer to documentation to know more about using AdvancedSecurity - * features - * @param {string} username the username for the context data - * @returns {string} the user context data - **/ - - - CognitoUserPool.prototype.getUserContextData = function getUserContextData(username) { - if (typeof AmazonCognitoAdvancedSecurityData === 'undefined') { - return undefined; - } - /* eslint-disable */ - var amazonCognitoAdvancedSecurityDataConst = AmazonCognitoAdvancedSecurityData; - /* eslint-enable */ - - if (this.advancedSecurityDataCollectionFlag) { - var advancedSecurityData = amazonCognitoAdvancedSecurityDataConst.getData(username, this.userPoolId, this.clientId); - if (advancedSecurityData) { - var userContextData = { - EncodedData: advancedSecurityData - }; - return userContextData; - } - } - return {}; - }; - - return CognitoUserPool; - }(); - - exports.default = CognitoUserPool; + return api; + } -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { + return init(function () {}); +})); - 'use strict'; - - exports.__esModule = true; - - var _jsCookie = __webpack_require__(18); - - var Cookies = _interopRequireWildcard(_jsCookie); - - function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - /** @class */ - var CookieStorage = function () { - - /** - * Constructs a new CookieStorage object - * @param {object} data Creation options. - * @param {string} data.domain Cookies domain (mandatory). - * @param {string} data.path Cookies path (default: '/') - * @param {integer} data.expires Cookie expiration (in days, default: 365) - * @param {boolean} data.secure Cookie secure flag (default: true) - */ - function CookieStorage(data) { - _classCallCheck(this, CookieStorage); - - this.domain = data.domain; - if (data.path) { - this.path = data.path; - } else { - this.path = '/'; - } - if (Object.prototype.hasOwnProperty.call(data, 'expires')) { - this.expires = data.expires; - } else { - this.expires = 365; - } - if (Object.prototype.hasOwnProperty.call(data, 'secure')) { - this.secure = data.secure; - } else { - this.secure = true; - } - } - - /** - * This is used to set a specific item in storage - * @param {string} key - the key for the item - * @param {object} value - the value - * @returns {string} value that was set - */ - - - CookieStorage.prototype.setItem = function setItem(key, value) { - Cookies.set(key, value, { - path: this.path, - expires: this.expires, - domain: this.domain, - secure: this.secure - }); - return Cookies.get(key); - }; - - /** - * This is used to get a specific key from storage - * @param {string} key - the key for the item - * This is used to clear the storage - * @returns {string} the data item - */ - - - CookieStorage.prototype.getItem = function getItem(key) { - return Cookies.get(key); - }; - - /** - * This is used to remove an item from storage - * @param {string} key - the key being set - * @returns {string} value - value that was deleted - */ - - - CookieStorage.prototype.removeItem = function removeItem(key) { - return Cookies.remove(key, { - path: this.path, - domain: this.domain, - secure: this.secure - }); - }; - - /** - * This is used to clear the storage - * @returns {string} nothing - */ - - - CookieStorage.prototype.clear = function clear() { - var cookies = Cookies.get(); - var index = void 0; - for (index = 0; index < cookies.length; ++index) { - Cookies.remove(cookies[index]); - } - return {}; - }; - - return CookieStorage; - }(); - - exports.default = CookieStorage; /***/ }), -/* 23 */ +/* 28 */ /***/ (function(module, exports) { - 'use strict'; - - exports.__esModule = true; - // class for defining the amzn user-agent - exports.default = UserAgent; - // constructor - - function UserAgent() {} - // public - UserAgent.prototype.userAgent = 'aws-amplify/0.1.x js'; - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - - /* - * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message - * Digest Algorithm, as defined in RFC 1321. - * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002. - * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet - * Distributed under the BSD License - * See http://pajhome.org.uk/crypt/md5 for more info. - */ +var g; - var helpers = __webpack_require__(2); +// This works in non-strict mode +g = (function() { + return this; +})(); - /* - * Perform a simple self-test to see if the VM is working - */ - function md5_vm_test() - { - return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"; - } +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} - /* - * Calculate the MD5 of an array of little-endian words, and a bit length - */ - function core_md5(x, len) - { - /* append padding */ - x[len >> 5] |= 0x80 << ((len) % 32); - x[(((len + 64) >>> 9) << 4) + 14] = len; +// 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) { ...} - var a = 1732584193; - var b = -271733879; - var c = -1732584194; - var d = 271733878; - - for(var i = 0; i < x.length; i += 16) - { - var olda = a; - var oldb = b; - var oldc = c; - var oldd = d; - - a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936); - d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586); - c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819); - b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330); - a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897); - d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426); - c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341); - b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983); - a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416); - d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417); - c = md5_ff(c, d, a, b, x[i+10], 17, -42063); - b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162); - a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682); - d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); - c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290); - b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329); - - a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510); - d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632); - c = md5_gg(c, d, a, b, x[i+11], 14, 643717713); - b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302); - a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691); - d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083); - c = md5_gg(c, d, a, b, x[i+15], 14, -660478335); - b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848); - a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438); - d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690); - c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961); - b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501); - a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467); - d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784); - c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473); - b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734); - - a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558); - d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); - c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562); - b = md5_hh(b, c, d, a, x[i+14], 23, -35309556); - a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060); - d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353); - c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632); - b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640); - a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174); - d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222); - c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979); - b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189); - a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487); - d = md5_hh(d, a, b, c, x[i+12], 11, -421815835); - c = md5_hh(c, d, a, b, x[i+15], 16, 530742520); - b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651); - - a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844); - d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415); - c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905); - b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055); - a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571); - d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606); - c = md5_ii(c, d, a, b, x[i+10], 15, -1051523); - b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799); - a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359); - d = md5_ii(d, a, b, c, x[i+15], 10, -30611744); - c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380); - b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649); - a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070); - d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379); - c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259); - b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551); - - a = safe_add(a, olda); - b = safe_add(b, oldb); - c = safe_add(c, oldc); - d = safe_add(d, oldd); - } - return Array(a, b, c, d); - - } - - /* - * These functions implement the four basic operations the algorithm uses. - */ - function md5_cmn(q, a, b, x, s, t) - { - return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); - } - function md5_ff(a, b, c, d, x, s, t) - { - return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); - } - function md5_gg(a, b, c, d, x, s, t) - { - return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); - } - function md5_hh(a, b, c, d, x, s, t) - { - return md5_cmn(b ^ c ^ d, a, b, x, s, t); - } - function md5_ii(a, b, c, d, x, s, t) - { - return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); - } - - /* - * Add integers, wrapping at 2^32. This uses 16-bit operations internally - * to work around bugs in some JS interpreters. - */ - function safe_add(x, y) - { - var lsw = (x & 0xFFFF) + (y & 0xFFFF); - var msw = (x >> 16) + (y >> 16) + (lsw >> 16); - return (msw << 16) | (lsw & 0xFFFF); - } - - /* - * Bitwise rotate a 32-bit number to the left. - */ - function bit_rol(num, cnt) - { - return (num << cnt) | (num >>> (32 - cnt)); - } - - module.exports = function md5(buf) { - return helpers.hash(buf, core_md5, 16); - }; - - -/***/ }), -/* 25 */ -/***/ (function(module, exports) { - - // Original code adapted from Robert Kieffer. - // details at https://github.com/broofa/node-uuid - (function() { - var _global = this; - - var mathRNG, whatwgRNG; - - // NOTE: Math.random() does not guarantee "cryptographic quality" - mathRNG = function(size) { - var bytes = new Array(size); - var r; - - for (var i = 0, r; i < size; i++) { - if ((i & 0x03) == 0) r = Math.random() * 0x100000000; - bytes[i] = r >>> ((i & 0x03) << 3) & 0xff; - } - - return bytes; - } - - if (_global.crypto && crypto.getRandomValues) { - whatwgRNG = function(size) { - var bytes = new Uint8Array(size); - crypto.getRandomValues(bytes); - return bytes; - } - } - - module.exports = whatwgRNG || mathRNG; - - }()) - - -/***/ }), -/* 26 */ -/***/ (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 helpers = __webpack_require__(2); - - /* - * Calculate the SHA-1 of an array of big-endian words, and a bit length - */ - function core_sha1(x, len) - { - /* append padding */ - x[len >> 5] |= 0x80 << (24 - len % 32); - x[((len + 64 >> 9) << 4) + 15] = len; - - var w = Array(80); - var a = 1732584193; - var b = -271733879; - var c = -1732584194; - var d = 271733878; - var e = -1009589776; - - for(var i = 0; i < x.length; i += 16) - { - var olda = a; - var oldb = b; - var oldc = c; - var oldd = d; - var olde = e; - - for(var j = 0; j < 80; j++) - { - if(j < 16) w[j] = x[i + j]; - else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1); - var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)), - safe_add(safe_add(e, w[j]), sha1_kt(j))); - e = d; - d = c; - c = rol(b, 30); - b = a; - a = t; - } - - a = safe_add(a, olda); - b = safe_add(b, oldb); - c = safe_add(c, oldc); - d = safe_add(d, oldd); - e = safe_add(e, olde); - } - return Array(a, b, c, d, e); - - } - - /* - * Perform the appropriate triplet combination function for the current - * iteration - */ - function sha1_ft(t, b, c, d) - { - if(t < 20) return (b & c) | ((~b) & d); - if(t < 40) return b ^ c ^ d; - if(t < 60) return (b & c) | (b & d) | (c & d); - return b ^ c ^ d; - } - - /* - * Determine the appropriate additive constant for the current iteration - */ - function sha1_kt(t) - { - return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : - (t < 60) ? -1894007588 : -899497514; - } - - /* - * Add integers, wrapping at 2^32. This uses 16-bit operations internally - * to work around bugs in some JS interpreters. - */ - function safe_add(x, y) - { - var lsw = (x & 0xFFFF) + (y & 0xFFFF); - var msw = (x >> 16) + (y >> 16) + (lsw >> 16); - return (msw << 16) | (lsw & 0xFFFF); - } - - /* - * Bitwise rotate a 32-bit number to the left. - */ - function rol(num, cnt) - { - return (num << cnt) | (num >>> (32 - cnt)); - } - - module.exports = function sha1(buf) { - return helpers.hash(buf, core_sha1, 20, true); - }; - - -/***/ }), -/* 27 */ -/***/ (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 helpers = __webpack_require__(2); - - var safe_add = function(x, y) { - var lsw = (x & 0xFFFF) + (y & 0xFFFF); - var msw = (x >> 16) + (y >> 16) + (lsw >> 16); - return (msw << 16) | (lsw & 0xFFFF); - }; - - var S = function(X, n) { - return (X >>> n) | (X << (32 - n)); - }; - - var R = function(X, n) { - return (X >>> n); - }; - - var Ch = function(x, y, z) { - return ((x & y) ^ ((~x) & z)); - }; - - var Maj = function(x, y, z) { - return ((x & y) ^ (x & z) ^ (y & z)); - }; - - var Sigma0256 = function(x) { - return (S(x, 2) ^ S(x, 13) ^ S(x, 22)); - }; - - var Sigma1256 = function(x) { - return (S(x, 6) ^ S(x, 11) ^ S(x, 25)); - }; - - var Gamma0256 = function(x) { - return (S(x, 7) ^ S(x, 18) ^ R(x, 3)); - }; - - var Gamma1256 = function(x) { - return (S(x, 17) ^ S(x, 19) ^ R(x, 10)); - }; - - var core_sha256 = function(m, l) { - var K = new Array(0x428A2F98,0x71374491,0xB5C0FBCF,0xE9B5DBA5,0x3956C25B,0x59F111F1,0x923F82A4,0xAB1C5ED5,0xD807AA98,0x12835B01,0x243185BE,0x550C7DC3,0x72BE5D74,0x80DEB1FE,0x9BDC06A7,0xC19BF174,0xE49B69C1,0xEFBE4786,0xFC19DC6,0x240CA1CC,0x2DE92C6F,0x4A7484AA,0x5CB0A9DC,0x76F988DA,0x983E5152,0xA831C66D,0xB00327C8,0xBF597FC7,0xC6E00BF3,0xD5A79147,0x6CA6351,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 HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19); - var W = new Array(64); - var a, b, c, d, e, f, g, h, i, j; - var T1, T2; - /* append padding */ - m[l >> 5] |= 0x80 << (24 - l % 32); - m[((l + 64 >> 9) << 4) + 15] = l; - for (var i = 0; i < m.length; i += 16) { - a = HASH[0]; b = HASH[1]; c = HASH[2]; d = HASH[3]; e = HASH[4]; f = HASH[5]; g = HASH[6]; h = HASH[7]; - for (var j = 0; j < 64; j++) { - if (j < 16) { - W[j] = m[j + i]; - } else { - W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]); - } - T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]); - T2 = safe_add(Sigma0256(a), Maj(a, b, c)); - h = g; g = f; f = e; e = safe_add(d, T1); d = c; c = b; b = a; a = safe_add(T1, T2); - } - HASH[0] = safe_add(a, HASH[0]); HASH[1] = safe_add(b, HASH[1]); HASH[2] = safe_add(c, HASH[2]); HASH[3] = safe_add(d, HASH[3]); - HASH[4] = safe_add(e, HASH[4]); HASH[5] = safe_add(f, HASH[5]); HASH[6] = safe_add(g, HASH[6]); HASH[7] = safe_add(h, HASH[7]); - } - return HASH; - }; - - module.exports = function sha256(buf) { - return helpers.hash(buf, core_sha256, 32, true); - }; +module.exports = g; /***/ }) -/******/ ]) -}); -; \ No newline at end of file +/******/ ]); +}); \ No newline at end of file diff --git a/packages/amazon-cognito-identity-js/dist/amazon-cognito-identity.min.js b/packages/amazon-cognito-identity-js/dist/amazon-cognito-identity.min.js index 4782258d7a3..2af34f1cb5b 100644 --- a/packages/amazon-cognito-identity-js/dist/amazon-cognito-identity.min.js +++ b/packages/amazon-cognito-identity-js/dist/amazon-cognito-identity.min.js @@ -14,108 +14,107 @@ * for the specific language governing permissions and * limitations under the License. */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AmazonCognitoIdentity=t():e.AmazonCognitoIdentity=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(19);Object.defineProperty(t,"AuthenticationDetails",{enumerable:!0,get:function(){return r(i).default}});var o=n(3);Object.defineProperty(t,"AuthenticationHelper",{enumerable:!0,get:function(){return r(o).default}});var s=n(5);Object.defineProperty(t,"CognitoAccessToken",{enumerable:!0,get:function(){return r(s).default}});var a=n(6);Object.defineProperty(t,"CognitoIdToken",{enumerable:!0,get:function(){return r(a).default}});var u=n(8);Object.defineProperty(t,"CognitoRefreshToken",{enumerable:!0,get:function(){return r(u).default}});var c=n(9);Object.defineProperty(t,"CognitoUser",{enumerable:!0,get:function(){return r(c).default}});var h=n(10);Object.defineProperty(t,"CognitoUserAttribute",{enumerable:!0,get:function(){return r(h).default}});var f=n(21);Object.defineProperty(t,"CognitoUserPool",{enumerable:!0,get:function(){return r(f).default}});var l=n(11);Object.defineProperty(t,"CognitoUserSession",{enumerable:!0,get:function(){return r(l).default}});var p=n(22);Object.defineProperty(t,"CookieStorage",{enumerable:!0,get:function(){return r(p).default}});var d=n(12);Object.defineProperty(t,"DateHelper",{enumerable:!0,get:function(){return r(d).default}})},function(e,t,n){(function(e){/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -"use strict";function r(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function i(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(i()=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function v(e){return+e!=e&&(e=0),s.alloc(+e)}function y(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return G(e).length;default:if(r)return H(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,n);case"utf8":case"utf-8":return P(this,t,n);case"ascii":return b(this,t,n);case"latin1":case"binary":return F(this,t,n);case"base64":return R(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function S(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function w(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:A(e,t,n,r,i);if("number"==typeof t)return t&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):A(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function A(e,t,n,r,i){function o(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,a=e.length,u=t.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}var c;if(i){var h=-1;for(c=n;ca&&(n=a-u),c=n;c>=0;c--){for(var f=!0,l=0;li&&(r=i)):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s239?4:o>223?3:o>191?2:1;if(i+a<=n){var u,c,h,f;switch(a){case 1:o<128&&(s=o);break;case 2:u=e[i+1],128===(192&u)&&(f=(31&o)<<6|63&u,f>127&&(s=f));break;case 3:u=e[i+1],c=e[i+2],128===(192&u)&&128===(192&c)&&(f=(15&o)<<12|(63&u)<<6|63&c,f>2047&&(f<55296||f>57343)&&(s=f));break;case 4:u=e[i+1],c=e[i+2],h=e[i+3],128===(192&u)&&128===(192&c)&&128===(192&h)&&(f=(15&o)<<18|(63&u)<<12|(63&c)<<6|63&h,f>65535&&f<1114112&&(s=f))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=a}return _(r)}function _(e){var t=e.length;if(t<=ee)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,n,r,i,o){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function O(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function N(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function V(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function K(e,t,n,r,i){return i||V(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(e,t,n,r,23,4),n+4}function q(e,t,n,r,i){return i||V(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(e,t,n,r,52,8),n+8}function L(e){if(e=Y(e).replace(te,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function Y(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function j(e){return e<16?"0"+e.toString(16):e.toString(16)}function H(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],s=0;s55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function J(e){for(var t=[],n=0;n>8,i=n%256,o.push(i),o.push(r);return o}function G(e){return X.toByteArray(L(e))}function z(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Z(e){return e!==e}var X=n(15),Q=n(16),$=n(17);t.Buffer=s,t.SlowBuffer=v,t.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:r(),t.kMaxLength=i(),s.poolSize=8192,s._augment=function(e){return e.__proto__=s.prototype,e},s.from=function(e,t,n){return a(null,e,t,n)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(e,t,n){return c(null,e,t,n)},s.allocUnsafe=function(e){return h(null,e)},s.allocUnsafeSlow=function(e){return h(null,e)},s.isBuffer=function(e){return!(null==e||!e._isBuffer)},s.compare=function(e,t){if(!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},s.prototype.compare=function(e,t,n,r,i){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var o=i-r,a=n-t,u=Math.min(o,a),c=this.slice(r,i),h=e.slice(t,n),f=0;fi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return C(this,e,t,n);case"utf8":case"utf-8":return U(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return T(this,e,t,n);case"base64":return D(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ee=4096;s.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUInt8=function(e,t){return t||M(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return t||M(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return t||M(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||M(e,t,this.length);for(var r=this[e],i=1,o=0;++o=i&&(r-=Math.pow(2,8*t)),r},s.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||M(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return t||M(e,1,this.length),128&this[e]?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){t||M(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){t||M(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||M(e,4,this.length),Q.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return t||M(e,4,this.length),Q.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||M(e,8,this.length),Q.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||M(e,8,this.length),Q.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){var i=Math.pow(2,8*n)-1;x(this,e,t,n,i,0)}var o=1,s=0;for(this[t]=255&e;++s=0&&(s*=256);)this[t+o]=e/s&255;return t+n},s.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||x(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||x(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||x(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||x(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||x(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);x(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);x(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||x(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||x(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||x(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||x(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,n){return K(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return K(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return q(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return q(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;o=0;){var s=t*this[e++]+n[r]+i;i=Math.floor(s/67108864),n[r++]=67108863&s}return i}function o(e,t,n,r,i,o){for(var s=32767&t,a=t>>15;--o>=0;){var u=32767&this[e],c=this[e++]>>15,h=a*u+c*s;u=s*u+((32767&h)<<15)+n[r]+(1073741823&i),i=(u>>>30)+(h>>>15)+a*c+(i>>>30),n[r++]=1073741823&u}return i}function s(e,t,n,r,i,o){for(var s=16383&t,a=t>>14;--o>=0;){var u=16383&this[e],c=this[e++]>>14,h=a*u+c*s;u=s*u+((16383&h)<<14)+n[r]+i,i=(u>>28)+(h>>14)+a*c,n[r++]=268435455&u}return i}function a(e){return Z.charAt(e)}function u(e,t){var n=X[e.charCodeAt(t)];return null==n?-1:n}function c(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function h(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}function f(e){var t=r();return t.fromInt(e),t}function l(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");r=2}this.t=0,this.s=0;for(var i=e.length,o=!1,s=0;--i>=0;){var a=u(e,i);a<0?"-"==e.charAt(i)&&(o=!0):(o=!1,0==s?this[this.t++]=a:s+r>this.DB?(this[this.t-1]|=(a&(1<>this.DB-s):this[this.t-1]|=a<=this.DB&&(s-=this.DB))}this.clamp(),o&&n.ZERO.subTo(this,this)}function p(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}function d(e){if(this.s<0)return"-"+this.negate().toString();var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");t=2}var n,r=(1<0)for(u>u)>0&&(i=!0,o=a(n));s>=0;)u>(u+=this.DB-t)):(n=this[s]>>(u-=t)&r,u<=0&&(u+=this.DB,--s)),n>0&&(i=!0),i&&(o+=a(n));return i?o:"0"}function g(){var e=r();return n.ZERO.subTo(this,e),e}function v(){return this.s<0?this.negate():this}function y(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(t=n-e.t,0!=t)return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0}function m(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function S(){return this.t<=0?0:this.DB*(this.t-1)+m(this[this.t-1]^this.s&this.DM)}function w(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s}function A(e,t){for(var n=e;n=0;--n)t[n+s+1]=this[n]>>i|a,a=(this[n]&o)<=0;--n)t[n]=0;t[s]=a,t.t=this.t+s+1,t.s=this.s,t.clamp()}function U(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)return void(t.t=0);var r=e%this.DB,i=this.DB-r,o=(1<>r;for(var s=n+1;s>r;r>0&&(t[this.t-n-1]|=(this.s&o)<>=this.DB;if(e.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()}function T(e,t){var r=this.abs(),i=e.abs(),o=r.t;for(t.t=o+i.t;--o>=0;)t[o]=0;for(o=0;o=0;)e[n]=0;for(n=0;n=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()}function I(e,t,i){var o=e.abs();if(!(o.t<=0)){var s=this.abs();if(s.t0?(o.lShiftTo(h,a),s.lShiftTo(h,i)):(o.copyTo(a),s.copyTo(i));var f=a.t,l=a[f-1];if(0!=l){var p=l*(1<1?a[f-2]>>this.F2:0),d=this.FV/p,g=(1<=0&&(i[i.t++]=1,i.subTo(w,i)),n.ONE.dlShiftTo(f,w),w.subTo(a,a);a.t=0;){var A=i[--y]==l?this.DM:Math.floor(i[y]*d+(i[y-1]+v)*g);if((i[y]+=a.am(0,A,i,S,0,f))0&&i.rShiftTo(h,i),u<0&&n.ZERO.subTo(i,i)}}}function R(e){var t=r();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(n.ZERO)>0&&e.subTo(t,t),t}function P(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return t=t*(2-(15&e)*t)&15,t=t*(2-(255&e)*t)&255,t=t*(2-((65535&e)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function _(e){return 0==this.compareTo(e)}function b(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n>=this.DB;if(e.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()}function F(e){var t=r();return this.addTo(e,t),t}function k(e){var t=r();return this.subTo(e,t),t}function B(e){var t=r();return this.multiplyTo(e,t),t}function M(e){var t=r();return this.divRemTo(e,t,null),t}function x(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(t,t),t}function N(e){var t=r();return e.copyTo(t),this.reduce(t),t}function V(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(n=t+this.m.t,e[n]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function K(e,t){e.squareTo(t),this.reduce(t)}function q(e,t,n){e.multiplyTo(t,n),this.reduce(n)}function L(e,t,n){var i,o=e.bitLength(),s=f(1),a=new x(t);if(o<=0)return s;i=o<18?1:o<48?3:o<144?4:o<768?5:6;var u=new Array,c=3,h=i-1,l=(1<1){var p=r();for(a.sqrTo(u[1],p);c<=l;)u[c]=r(),a.mulTo(p,u[c-2],u[c]),c+=2}var d,g,v=e.t-1,y=!0,S=r();for(o=m(e[v])-1;v>=0;){for(o>=h?d=e[v]>>o-h&l:(d=(e[v]&(1<0&&(d|=e[v-1]>>this.DB+o-h)),c=i;0==(1&d);)d>>=1,--c;if((o-=c)<0&&(o+=this.DB,--v),y)u[d].copyTo(s),y=!1;else{for(;c>1;)a.sqrTo(s,S),a.sqrTo(S,s),c-=2;c>0?a.sqrTo(s,S):(g=s,s=S,S=g),a.mulTo(S,u[d],s)}for(;v>=0&&0==(e[v]&1<0&&void 0!==arguments[0]?arguments[0]:{},r=n.AccessToken;return i(this,t),o(this,e.call(this,r||""))}return s(t,e),t}(u.default);t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var a=n(7),u=r(a),c=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.IdToken;return i(this,t),o(this,e.call(this,r||""))}return s(t,e),t}(u.default);t.default=c},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=n(1),o=function(){function e(t){r(this,e),this.jwtToken=t||"",this.payload=this.decodePayload()}return e.prototype.getJwtToken=function(){return this.jwtToken},e.prototype.getExpiration=function(){return this.payload.exp},e.prototype.getIssuedAt=function(){return this.payload.iat},e.prototype.decodePayload=function(){var e=this.jwtToken.split(".")[1];try{return JSON.parse(i.Buffer.from(e,"base64").toString("utf8"))}catch(e){return{}}},e}();t.default=o},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;/*! - * Copyright 2016 Amazon.com, - * Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Amazon Software License (the "License"). - * You may not use this file except in compliance with the - * License. A copy of the License is located at - * - * http://aws.amazon.com/asl/ - * - * or in the "license" file accompanying this file. This file is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, express or implied. See the License - * for the specific language governing permissions and - * limitations under the License. - */ -var r=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.RefreshToken;n(this,e),this.token=r||""}return e.prototype.getToken=function(){return this.token},e}();t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var s=n(1),a=n(14),u=i(a),c=n(4),h=r(c),f=n(3),l=r(f),p=n(5),d=r(p),g=n(6),v=r(g),y=n(8),m=r(y),S=n(11),w=r(S),A=n(12),C=r(A),U=n(10),E=r(U),T=n(13),D=r(T),I=u.createHmac,R=function(){function e(t){if(o(this,e),null==t||null==t.Username||null==t.Pool)throw new Error("Username and pool information are required.");this.username=t.Username||"",this.pool=t.Pool,this.Session=null,this.client=t.Pool.client,this.signInUserSession=null,this.authenticationFlowType="USER_SRP_AUTH",this.storage=t.Storage||(new D.default).getStorage()}return e.prototype.setSignInUserSession=function(e){this.clearCachedTokens(),this.signInUserSession=e,this.cacheTokens()},e.prototype.getSignInUserSession=function(){return this.signInUserSession},e.prototype.getUsername=function(){return this.username},e.prototype.getAuthenticationFlowType=function(){return this.authenticationFlowType},e.prototype.setAuthenticationFlowType=function(e){this.authenticationFlowType=e},e.prototype.initiateAuth=function(e,t){var n=this,r=e.getAuthParameters();r.USERNAME=this.username;var i={AuthFlow:"CUSTOM_AUTH",ClientId:this.pool.getClientId(),AuthParameters:r,ClientMetadata:e.getValidationData()};this.getUserContextData()&&(i.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",i,function(e,r){if(e)return t.onFailure(e);var i=r.ChallengeName,o=r.ChallengeParameters;return"CUSTOM_CHALLENGE"===i?(n.Session=r.Session,t.customChallenge(o)):(n.signInUserSession=n.getCognitoUserSession(r.AuthenticationResult),n.cacheTokens(),t.onSuccess(n.signInUserSession))})},e.prototype.authenticateUser=function(e,t){return"USER_PASSWORD_AUTH"===this.authenticationFlowType?this.authenticateUserPlainUsernamePassword(e,t):"USER_SRP_AUTH"===this.authenticationFlowType?this.authenticateUserDefaultAuth(e,t):t.onFailure(new Error("Authentication flow type is invalid."))},e.prototype.authenticateUserDefaultAuth=function(e,t){var n=this,r=new l.default(this.pool.getUserPoolId().split("_")[1]),i=new C.default,o=void 0,a=void 0,u={};null!=this.deviceKey&&(u.DEVICE_KEY=this.deviceKey),u.USERNAME=this.username,r.getLargeAValue(function(c,f){c&&t.onFailure(c),u.SRP_A=f.toString(16),"CUSTOM_AUTH"===n.authenticationFlowType&&(u.CHALLENGE_NAME="SRP_A");var l={AuthFlow:n.authenticationFlowType,ClientId:n.pool.getClientId(),AuthParameters:u,ClientMetadata:e.getValidationData()};n.getUserContextData(n.username)&&(l.UserContextData=n.getUserContextData(n.username)),n.client.request("InitiateAuth",l,function(u,c){if(u)return t.onFailure(u);var f=c.ChallengeParameters;n.username=f.USER_ID_FOR_SRP,o=new h.default(f.SRP_B,16),a=new h.default(f.SALT,16),n.getCachedDeviceKeyAndPassword(),r.getPasswordAuthenticationKey(n.username,e.getPassword(),o,a,function(e,o){e&&t.onFailure(e);var a=i.getNowString(),u=I("sha256",o).update(s.Buffer.concat([s.Buffer.from(n.pool.getUserPoolId().split("_")[1],"utf8"),s.Buffer.from(n.username,"utf8"),s.Buffer.from(f.SECRET_BLOCK,"base64"),s.Buffer.from(a,"utf8")])).digest("base64"),h={};h.USERNAME=n.username,h.PASSWORD_CLAIM_SECRET_BLOCK=f.SECRET_BLOCK,h.TIMESTAMP=a,h.PASSWORD_CLAIM_SIGNATURE=u,null!=n.deviceKey&&(h.DEVICE_KEY=n.deviceKey);var l=function e(t,r){return n.client.request("RespondToAuthChallenge",t,function(i,o){return i&&"ResourceNotFoundException"===i.code&&i.message.toLowerCase().indexOf("device")!==-1?(h.DEVICE_KEY=null,n.deviceKey=null,n.randomPassword=null,n.deviceGroupKey=null,n.clearCachedDeviceKeyAndPassword(),e(t,r)):r(i,o)})},p={ChallengeName:"PASSWORD_VERIFIER",ClientId:n.pool.getClientId(),ChallengeResponses:h,Session:c.Session};n.getUserContextData()&&(p.UserContextData=n.getUserContextData()),l(p,function(e,i){if(e)return t.onFailure(e);var o=i.ChallengeName;if("NEW_PASSWORD_REQUIRED"===o){n.Session=i.Session;var s=null,a=null,u=[],c=r.getNewPasswordRequiredChallengeUserAttributePrefix();if(i.ChallengeParameters&&(s=JSON.parse(i.ChallengeParameters.userAttributes),a=JSON.parse(i.ChallengeParameters.requiredAttributes)),a)for(var h=0;h0&&void 0!==arguments[0]?arguments[0]:{},r=t.Name,i=t.Value;n(this,e),this.Name=r||"",this.Value=i||""}return e.prototype.getValue=function(){return this.Value},e.prototype.setValue=function(e){return this.Value=e,this},e.prototype.getName=function(){return this.Name},e.prototype.setName=function(e){return this.Name=e,this},e.prototype.toString=function(){return JSON.stringify(this)},e.prototype.toJSON=function(){return{Name:this.Name,Value:this.Value}},e}();t.default=r},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;/*! - * Copyright 2016 Amazon.com, - * Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Amazon Software License (the "License"). - * You may not use this file except in compliance with the - * License. A copy of the License is located at - * - * http://aws.amazon.com/asl/ - * - * or in the "license" file accompanying this file. This file is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, express or implied. See the License - * for the specific language governing permissions and - * limitations under the License. - */ -var r=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.IdToken,i=t.RefreshToken,o=t.AccessToken,s=t.ClockDrift;if(n(this,e),null==o||null==r)throw new Error("Id token and Access Token must be present.");this.idToken=r,this.refreshToken=i,this.accessToken=o,this.clockDrift=void 0===s?this.calculateClockDrift():s}return e.prototype.getIdToken=function(){return this.idToken},e.prototype.getRefreshToken=function(){return this.refreshToken},e.prototype.getAccessToken=function(){return this.accessToken},e.prototype.getClockDrift=function(){return this.clockDrift},e.prototype.calculateClockDrift=function(){var e=Math.floor(new Date/1e3),t=Math.min(this.accessToken.getIssuedAt(),this.idToken.getIssuedAt());return e-t},e.prototype.isValid=function(){var e=Math.floor(new Date/1e3),t=e-this.clockDrift;return tp?t=e(t):t.length0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function r(e){return 3*e.length/4-n(e)}function i(e){var t,r,i,o,s,a=e.length;o=n(e),s=new h(3*a/4-o),r=o>0?a-4:a;var u=0;for(t=0;t>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,s[u++]=255&i):1===o&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}function o(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function s(e,t,n){for(var r,i=[],s=t;sh?h:c+a));return 1===r?(t=e[n-1],i+=u[t>>2],i+=u[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=u[t>>10],i+=u[t>>4&63],i+=u[t<<2&63],i+="="),o.push(i),o.join("")}t.byteLength=r,t.toByteArray=i,t.fromByteArray=a;for(var u=[],c=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,p=f.length;l>1,h=-7,f=n?i-1:0,l=n?-1:1,p=e[t+f];for(f+=l,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+e[t+f],f+=l,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=r;h>0;s=256*s+e[t+f],f+=l,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:(p?-1:1)*(1/0);s+=Math.pow(2,r),o-=c}return(p?-1:1)*s*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var s,a,u,c=8*o-i-1,h=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+f>=1?l/u:l*Math.pow(2,1-f),t*u>=2&&(s++,u/=2),s+f>=h?(a=0,s=h):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[n+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;e[n+p]=255&s,p+=d,s/=256,c-=8);e[n+p-d]|=128*g}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){var r,i;!function(o){var s=!1;if(r=o,i="function"==typeof r?r.call(t,n,t,e):r,!(void 0!==i&&(e.exports=i)),s=!0,e.exports=o(),s=!0,!s){var a=window.Cookies,u=window.Cookies=o();u.noConflict=function(){return window.Cookies=a,u}}}(function(){function e(){for(var e=0,t={};e1){if(o=e({path:"/"},r.defaults,o),"number"==typeof o.expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*o.expires),o.expires=a}o.expires=o.expires?o.expires.toUTCString():"";try{s=JSON.stringify(i),/^[\{\[]/.test(s)&&(i=s)}catch(e){}i=n.write?n.write(i,t):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)),t=t.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),t=t.replace(/[\(\)]/g,escape);var u="";for(var c in o)o[c]&&(u+="; "+c,o[c]!==!0&&(u+="="+o[c]));return document.cookie=t+"="+i+u}t||(s={});for(var h=document.cookie?document.cookie.split("; "):[],f=/(%[0-9A-Z]{2})+/g,l=0;l>5]|=128<>>9<<4)+14]=t;for(var n=1732584193,r=-271733879,i=-1732584194,h=271733878,f=0;f>16)+(t>>16)+(n>>16);return r<<16|65535&n}function h(e,t){return e<>>32-t}var f=n(2);e.exports=function(e){return f.hash(e,r,16)}},function(e,t){!function(){var t,n,r=this;t=function(e){for(var t,t,n=new Array(e),r=0;r>>((3&r)<<3)&255;return n},r.crypto&&crypto.getRandomValues&&(n=function(e){var t=new Uint8Array(e);return crypto.getRandomValues(t),t}),e.exports=n||t}()},function(e,t,n){function r(e,t){e[t>>5]|=128<<24-t%32,e[(t+64>>9<<4)+15]=t;for(var n=Array(80),r=1732584193,u=-271733879,c=-1732584194,h=271733878,f=-1009589776,l=0;l>16)+(t>>16)+(n>>16);return r<<16|65535&n}function a(e,t){return e<>>32-t}var u=n(2);e.exports=function(e){return u.hash(e,r,20,!0)}},function(e,t,n){var r=n(2),i=function(e,t){var n=(65535&e)+(65535&t),r=(e>>16)+(t>>16)+(n>>16);return r<<16|65535&n},o=function(e,t){return e>>>t|e<<32-t},s=function(e,t){return e>>>t},a=function(e,t,n){return e&t^~e&n},u=function(e,t,n){return e&t^e&n^t&n},c=function(e){return o(e,2)^o(e,13)^o(e,22)},h=function(e){return o(e,6)^o(e,11)^o(e,25)},f=function(e){return o(e,7)^o(e,18)^s(e,3)},l=function(e){return o(e,17)^o(e,19)^s(e,10)},p=function(e,t){var n,r,o,s,p,d,g,v,y,m,S,w,A=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),C=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),U=new Array(64);e[t>>5]|=128<<24-t%32,e[(t+64>>9<<4)+15]=t;for(var y=0;y=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function d(e){return+e!=e&&(e=0),o.alloc(+e)}function y(e,t){if(o.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(r)return j(e).length;t=(""+t).toLowerCase(),r=!0}}function v(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,n);case"utf8":case"utf-8":return R(this,t,n);case"ascii":return _(this,t,n);case"latin1":case"binary":return b(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function S(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:w(e,t,n,r,i);if("number"==typeof t)return t&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):w(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,n,r,i){function o(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}var c;if(i){var h=-1;for(c=n;ca&&(n=a-u),c=n;c>=0;c--){for(var f=!0,l=0;li&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s239?4:o>223?3:o>191?2:1;if(i+a<=n){var u,c,h,f;switch(a){case 1:o<128&&(s=o);break;case 2:u=e[i+1],128==(192&u)&&(f=(31&o)<<6|63&u)>127&&(s=f);break;case 3:u=e[i+1],c=e[i+2],128==(192&u)&&128==(192&c)&&(f=(15&o)<<12|(63&u)<<6|63&c)>2047&&(f<55296||f>57343)&&(s=f);break;case 4:u=e[i+1],c=e[i+2],h=e[i+3],128==(192&u)&&128==(192&c)&&128==(192&h)&&(f=(15&o)<<18|(63&u)<<12|(63&c)<<6|63&h)>65535&&f<1114112&&(s=f)}}null===s?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=a}return P(r)}function P(e){var t=e.length;if(t<=$)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,i,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function x(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function O(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function N(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function V(e,t,n,r,i){return i||N(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(e,t,n,r,23,4),n+4}function K(e,t,n,r,i){return i||N(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(e,t,n,r,52,8),n+8}function q(e){if(e=L(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function L(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Y(e){return e<16?"0"+e.toString(16):e.toString(16)}function j(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],s=0;s55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function H(e){for(var t=[],n=0;n>8,i=n%256,o.push(i),o.push(r);return o}function W(e){return Z.toByteArray(q(e))}function G(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function z(e){return e!==e}/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +var Z=n(20),X=n(25),Q=n(26);t.Buffer=o,t.SlowBuffer=d,t.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=r(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,n){return s(null,e,t,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,n){return u(null,e,t,n)},o.allocUnsafe=function(e){return c(null,e)},o.allocUnsafeSlow=function(e){return c(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,s=Math.min(n,r);i0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},o.prototype.compare=function(e,t,n,r,i){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var s=i-r,a=n-t,u=Math.min(s,a),c=this.slice(r,i),h=e.slice(t,n),f=0;fi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return A(this,e,t,n);case"utf8":case"utf-8":return C(this,e,t,n);case"ascii":return U(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return T(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;o.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||B(e,t,this.length);for(var r=this[e],i=1,o=0;++o=i&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||B(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),X.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),X.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),X.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),X.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){M(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):x(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):x(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):O(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):O(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):x(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):x(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):O(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):O(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,n){return V(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return V(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return K(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return K(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(s<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var s;if("number"==typeof e)for(s=t;s0&&void 0!==arguments[0]?arguments[0]:{},o=n.AccessToken;return r(this,t),i(this,e.call(this,o||""))}return o(t,e),t}(a.default);t.default=u},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var s=n(11),a=function(e){return e&&e.__esModule?e:{default:e}}(s),u=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=n.IdToken;return r(this,t),i(this,e.call(this,o||""))}return o(t,e),t}(a.default);t.default=u},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;/*! + * Copyright 2016 Amazon.com, + * Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Amazon Software License (the "License"). + * You may not use this file except in compliance with the + * License. A copy of the License is located at + * + * http://aws.amazon.com/asl/ + * + * or in the "license" file accompanying this file. This file is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, express or implied. See the License + * for the specific language governing permissions and + * limitations under the License. + */ +var i=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.RefreshToken;r(this,e),this.token=n||""}return e.prototype.getToken=function(){return this.token},e}();t.default=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=n(0),s=n(13),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(s),u=n(10),c=r(u),h=n(2),f=r(h),l=n(3),p=r(l),g=n(4),d=r(g),y=n(5),v=r(y),m=n(8),S=r(m),w=n(9),A=r(w),C=n(7),U=r(C),E=n(12),T=r(E),D=a.createHmac,I=function(){function e(t){if(i(this,e),null==t||null==t.Username||null==t.Pool)throw new Error("Username and pool information are required.");this.username=t.Username||"",this.pool=t.Pool,this.Session=null,this.client=t.Pool.client,this.signInUserSession=null,this.authenticationFlowType="USER_SRP_AUTH",this.storage=t.Storage||(new T.default).getStorage()}return e.prototype.setSignInUserSession=function(e){this.clearCachedTokens(),this.signInUserSession=e,this.cacheTokens()},e.prototype.getSignInUserSession=function(){return this.signInUserSession},e.prototype.getUsername=function(){return this.username},e.prototype.getAuthenticationFlowType=function(){return this.authenticationFlowType},e.prototype.setAuthenticationFlowType=function(e){this.authenticationFlowType=e},e.prototype.initiateAuth=function(e,t){var n=this,r=e.getAuthParameters();r.USERNAME=this.username;var i={AuthFlow:"CUSTOM_AUTH",ClientId:this.pool.getClientId(),AuthParameters:r,ClientMetadata:e.getValidationData()};this.getUserContextData()&&(i.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",i,function(e,r){if(e)return t.onFailure(e);var i=r.ChallengeName,o=r.ChallengeParameters;return"CUSTOM_CHALLENGE"===i?(n.Session=r.Session,t.customChallenge(o)):(n.signInUserSession=n.getCognitoUserSession(r.AuthenticationResult),n.cacheTokens(),t.onSuccess(n.signInUserSession))})},e.prototype.authenticateUser=function(e,t){return"USER_PASSWORD_AUTH"===this.authenticationFlowType?this.authenticateUserPlainUsernamePassword(e,t):"USER_SRP_AUTH"===this.authenticationFlowType?this.authenticateUserDefaultAuth(e,t):t.onFailure(new Error("Authentication flow type is invalid."))},e.prototype.authenticateUserDefaultAuth=function(e,t){var n=this,r=new f.default(this.pool.getUserPoolId().split("_")[1]),i=new A.default,s=void 0,a=void 0,u={};null!=this.deviceKey&&(u.DEVICE_KEY=this.deviceKey),u.USERNAME=this.username,r.getLargeAValue(function(h,f){h&&t.onFailure(h),u.SRP_A=f.toString(16),"CUSTOM_AUTH"===n.authenticationFlowType&&(u.CHALLENGE_NAME="SRP_A");var l={AuthFlow:n.authenticationFlowType,ClientId:n.pool.getClientId(),AuthParameters:u,ClientMetadata:e.getValidationData()};n.getUserContextData(n.username)&&(l.UserContextData=n.getUserContextData(n.username)),n.client.request("InitiateAuth",l,function(u,h){if(u)return t.onFailure(u);var f=h.ChallengeParameters;n.username=f.USER_ID_FOR_SRP,s=new c.default(f.SRP_B,16),a=new c.default(f.SALT,16),n.getCachedDeviceKeyAndPassword(),r.getPasswordAuthenticationKey(n.username,e.getPassword(),s,a,function(e,s){e&&t.onFailure(e);var a=i.getNowString(),u=D("sha256",s).update(o.Buffer.concat([o.Buffer.from(n.pool.getUserPoolId().split("_")[1],"utf8"),o.Buffer.from(n.username,"utf8"),o.Buffer.from(f.SECRET_BLOCK,"base64"),o.Buffer.from(a,"utf8")])).digest("base64"),c={};c.USERNAME=n.username,c.PASSWORD_CLAIM_SECRET_BLOCK=f.SECRET_BLOCK,c.TIMESTAMP=a,c.PASSWORD_CLAIM_SIGNATURE=u,null!=n.deviceKey&&(c.DEVICE_KEY=n.deviceKey);var l={ChallengeName:"PASSWORD_VERIFIER",ClientId:n.pool.getClientId(),ChallengeResponses:c,Session:h.Session};n.getUserContextData()&&(l.UserContextData=n.getUserContextData()),function e(t,r){return n.client.request("RespondToAuthChallenge",t,function(i,o){return i&&"ResourceNotFoundException"===i.code&&-1!==i.message.toLowerCase().indexOf("device")?(c.DEVICE_KEY=null,n.deviceKey=null,n.randomPassword=null,n.deviceGroupKey=null,n.clearCachedDeviceKeyAndPassword(),e(t,r)):r(i,o)})}(l,function(e,i){if(e)return t.onFailure(e);if("NEW_PASSWORD_REQUIRED"===i.ChallengeName){n.Session=i.Session;var o=null,s=null,a=[],u=r.getNewPasswordRequiredChallengeUserAttributePrefix();if(i.ChallengeParameters&&(o=JSON.parse(i.ChallengeParameters.userAttributes),s=JSON.parse(i.ChallengeParameters.requiredAttributes)),s)for(var c=0;c0&&void 0!==arguments[0]?arguments[0]:{},n=t.Name,i=t.Value;r(this,e),this.Name=n||"",this.Value=i||""}return e.prototype.getValue=function(){return this.Value},e.prototype.setValue=function(e){return this.Value=e,this},e.prototype.getName=function(){return this.Name},e.prototype.setName=function(e){return this.Name=e,this},e.prototype.toString=function(){return JSON.stringify(this)},e.prototype.toJSON=function(){return{Name:this.Name,Value:this.Value}},e}();t.default=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;/*! + * Copyright 2016 Amazon.com, + * Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Amazon Software License (the "License"). + * You may not use this file except in compliance with the + * License. A copy of the License is located at + * + * http://aws.amazon.com/asl/ + * + * or in the "license" file accompanying this file. This file is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, express or implied. See the License + * for the specific language governing permissions and + * limitations under the License. + */ +var i=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.IdToken,i=t.RefreshToken,o=t.AccessToken,s=t.ClockDrift;if(r(this,e),null==o||null==n)throw new Error("Id token and Access Token must be present.");this.idToken=n,this.refreshToken=i,this.accessToken=o,this.clockDrift=void 0===s?this.calculateClockDrift():s}return e.prototype.getIdToken=function(){return this.idToken},e.prototype.getRefreshToken=function(){return this.refreshToken},e.prototype.getAccessToken=function(){return this.accessToken},e.prototype.getClockDrift=function(){return this.clockDrift},e.prototype.calculateClockDrift=function(){return Math.floor(new Date/1e3)-Math.min(this.accessToken.getIssuedAt(),this.idToken.getIssuedAt())},e.prototype.isValid=function(){var e=Math.floor(new Date/1e3),t=e-this.clockDrift;return t=0;){var s=t*this[e++]+n[r]+i;i=Math.floor(s/67108864),n[r++]=67108863&s}return i}function s(e,t,n,r,i,o){for(var s=32767&t,a=t>>15;--o>=0;){var u=32767&this[e],c=this[e++]>>15,h=a*u+c*s;u=s*u+((32767&h)<<15)+n[r]+(1073741823&i),i=(u>>>30)+(h>>>15)+a*c+(i>>>30),n[r++]=1073741823&u}return i}function a(e,t,n,r,i,o){for(var s=16383&t,a=t>>14;--o>=0;){var u=16383&this[e],c=this[e++]>>14,h=a*u+c*s;u=s*u+((16383&h)<<14)+n[r]+i,i=(u>>28)+(h>>14)+a*c,n[r++]=268435455&u}return i}function u(e){return G.charAt(e)}function c(e,t){var n=z[e.charCodeAt(t)];return null==n?-1:n}function h(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function f(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}function l(e){var t=i();return t.fromInt(e),t}function p(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");n=2}this.t=0,this.s=0;for(var i=e.length,o=!1,s=0;--i>=0;){var a=c(e,i);a<0?"-"==e.charAt(i)&&(o=!0):(o=!1,0==s?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<>this.DB-s):this[this.t-1]|=a<=this.DB&&(s-=this.DB))}this.clamp(),o&&r.ZERO.subTo(this,this)}function g(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}function d(e){if(this.s<0)return"-"+this.negate().toString();var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");t=2}var n,r=(1<0)for(a>a)>0&&(i=!0,o=u(n));s>=0;)a>(a+=this.DB-t)):(n=this[s]>>(a-=t)&r,a<=0&&(a+=this.DB,--s)),n>0&&(i=!0),i&&(o+=u(n));return i?o:"0"}function y(){var e=i();return r.ZERO.subTo(this,e),e}function v(){return this.s<0?this.negate():this}function m(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0}function S(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function w(){return this.t<=0?0:this.DB*(this.t-1)+S(this[this.t-1]^this.s&this.DM)}function A(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s}function C(e,t){for(var n=e;n=0;--n)t[n+s+1]=this[n]>>i|a,a=(this[n]&o)<=0;--n)t[n]=0;t[s]=a,t.t=this.t+s+1,t.s=this.s,t.clamp()}function E(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)return void(t.t=0);var r=e%this.DB,i=this.DB-r,o=(1<>r;for(var s=n+1;s>r;r>0&&(t[this.t-n-1]|=(this.s&o)<>=this.DB;if(e.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()}function D(e,t){var n=this.abs(),i=e.abs(),o=n.t;for(t.t=o+i.t;--o>=0;)t[o]=0;for(o=0;o=0;)e[n]=0;for(n=0;n=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()}function R(e,t,n){var o=e.abs();if(!(o.t<=0)){var s=this.abs();if(s.t0?(o.lShiftTo(h,a),s.lShiftTo(h,n)):(o.copyTo(a),s.copyTo(n));var f=a.t,l=a[f-1];if(0!=l){var p=l*(1<1?a[f-2]>>this.F2:0),g=this.FV/p,d=(1<=0&&(n[n.t++]=1,n.subTo(w,n)),r.ONE.dlShiftTo(f,w),w.subTo(a,a);a.t=0;){var A=n[--v]==l?this.DM:Math.floor(n[v]*g+(n[v-1]+y)*d);if((n[v]+=a.am(0,A,n,m,0,f))0&&n.rShiftTo(h,n),u<0&&r.ZERO.subTo(n,n)}}}function P(e){var t=i();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(r.ZERO)>0&&e.subTo(t,t),t}function _(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return t=t*(2-(15&e)*t)&15,t=t*(2-(255&e)*t)&255,t=t*(2-((65535&e)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function b(e){return 0==this.compareTo(e)}function F(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n>=this.DB;if(e.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()}function k(e){var t=i();return this.addTo(e,t),t}function B(e){var t=i();return this.subTo(e,t),t}function M(e){var t=i();return this.multiplyTo(e,t),t}function x(e){var t=i();return this.divRemTo(e,t,null),t}function O(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(t,t),t}function V(e){var t=i();return e.copyTo(t),this.reduce(t),t}function K(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(n=t+this.m.t,e[n]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function q(e,t){e.squareTo(t),this.reduce(t)}function L(e,t,n){e.multiplyTo(t,n),this.reduce(n)}function Y(e,t,n){var r,o=e.bitLength(),s=l(1),a=new O(t);if(o<=0)return s;r=o<18?1:o<48?3:o<144?4:o<768?5:6;var u=new Array,c=3,h=r-1,f=(1<1){var p=i();for(a.sqrTo(u[1],p);c<=f;)u[c]=i(),a.mulTo(p,u[c-2],u[c]),c+=2}var g,d,y=e.t-1,v=!0,m=i();for(o=S(e[y])-1;y>=0;){for(o>=h?g=e[y]>>o-h&f:(g=(e[y]&(1<0&&(g|=e[y-1]>>this.DB+o-h)),c=r;0==(1&g);)g>>=1,--c;if((o-=c)<0&&(o+=this.DB,--y),v)u[g].copyTo(s),v=!1;else{for(;c>1;)a.sqrTo(s,m),a.sqrTo(m,s),c-=2;c>0?a.sqrTo(s,m):(d=s,s=m,m=d),a.mulTo(m,u[g],s)}for(;y>=0&&0==(e[y]&1<l?t=e(t):t.length0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-r(e)}function o(e){var t,n,i,o,s,a=e.length;o=r(e),s=new f(3*a/4-o),n=o>0?a-4:a;var u=0;for(t=0;t>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=h[e.charCodeAt(t)]<<2|h[e.charCodeAt(t+1)]>>4,s[u++]=255&i):1===o&&(i=h[e.charCodeAt(t)]<<10|h[e.charCodeAt(t+1)]<<4|h[e.charCodeAt(t+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}function s(e){return c[e>>18&63]+c[e>>12&63]+c[e>>6&63]+c[63&e]}function a(e,t,n){for(var r,i=[],o=t;ou?u:s+16383));return 1===r?(t=e[n-1],i+=c[t>>2],i+=c[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=c[t>>10],i+=c[t>>4&63],i+=c[t<<2&63],i+="="),o.push(i),o.join("")}t.byteLength=i,t.toByteArray=o,t.fromByteArray=u;for(var c=[],h=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,g=l.length;p>5]|=128<>>9<<4)]=t;for(var n=1732584193,r=-271733879,i=-1732584194,h=271733878,f=0;f>16)+(t>>16)+(n>>16)<<16|65535&n}function h(e,t){return e<>>32-t}var f=n(1);e.exports=function(e){return f.hash(e,r,16)}},function(e,t){!function(){var t,n,r=this;t=function(e){for(var t,t,n=new Array(e),r=0;r>>((3&r)<<3)&255;return n},r.crypto&&crypto.getRandomValues&&(n=function(e){var t=new Uint8Array(e);return crypto.getRandomValues(t),t}),e.exports=n||t}()},function(e,t,n){function r(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var n=Array(80),r=1732584193,u=-271733879,c=-1732584194,h=271733878,f=-1009589776,l=0;l>16)+(t>>16)+(n>>16)<<16|65535&n}function a(e,t){return e<>>32-t}var u=n(1);e.exports=function(e){return u.hash(e,r,20,!0)}},function(e,t,n){var r=n(1),i=function(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n},o=function(e,t){return e>>>t|e<<32-t},s=function(e,t){return e>>>t},a=function(e,t,n){return e&t^~e&n},u=function(e,t,n){return e&t^e&n^t&n},c=function(e){return o(e,2)^o(e,13)^o(e,22)},h=function(e){return o(e,6)^o(e,11)^o(e,25)},f=function(e){return o(e,7)^o(e,18)^s(e,3)},l=function(e){return o(e,17)^o(e,19)^s(e,10)},p=function(e,t){var n,r,o,s,p,g,d,y,v,m,S,w,A=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),C=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),U=new Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var v=0;v>1,h=-7,f=n?i-1:0,l=n?-1:1,p=e[t+f];for(f+=l,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+e[t+f],f+=l,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=r;h>0;s=256*s+e[t+f],f+=l,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=c}return(p?-1:1)*s*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var s,a,u,c=8*o-i-1,h=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,g=r?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+f>=1?l/u:l*Math.pow(2,1-f),t*u>=2&&(s++,u/=2),s+f>=h?(a=0,s=h):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[n+p]=255&a,p+=g,a/=256,i-=8);for(s=s<0;e[n+p]=255&s,p+=g,s/=256,c-=8);e[n+p-g]|=128*d}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){var r,i;!function(o){var s=!1;if(r=o,void 0!==(i="function"==typeof r?r.call(t,n,t,e):r)&&(e.exports=i),s=!0,e.exports=o(),s=!0,!s){var a=window.Cookies,u=window.Cookies=o();u.noConflict=function(){return window.Cookies=a,u}}}(function(){function e(){for(var e=0,t={};e1){if(o=e({path:"/"},r.defaults,o),"number"==typeof o.expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*o.expires),o.expires=a}o.expires=o.expires?o.expires.toUTCString():"";try{s=JSON.stringify(i),/^[\{\[]/.test(s)&&(i=s)}catch(e){}i=n.write?n.write(i,t):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)),t=t.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),t=t.replace(/[\(\)]/g,escape);var u="";for(var c in o)o[c]&&(u+="; "+c,!0!==o[c]&&(u+="="+o[c]));return document.cookie=t+"="+i+u}t||(s={});for(var h=document.cookie?document.cookie.split("; "):[],f=/(%[0-9A-Z]{2})+/g,l=0;l \n\t * @license MIT\n\t */\n\t/* eslint-disable no-proto */\n\t\n\t'use strict'\n\t\n\tvar base64 = __webpack_require__(15)\n\tvar ieee754 = __webpack_require__(16)\n\tvar isArray = __webpack_require__(17)\n\t\n\texports.Buffer = Buffer\n\texports.SlowBuffer = SlowBuffer\n\texports.INSPECT_MAX_BYTES = 50\n\t\n\t/**\n\t * If `Buffer.TYPED_ARRAY_SUPPORT`:\n\t * === true Use Uint8Array implementation (fastest)\n\t * === false Use Object implementation (most compatible, even IE6)\n\t *\n\t * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n\t * Opera 11.6+, iOS 4.2+.\n\t *\n\t * Due to various browser bugs, sometimes the Object implementation will be used even\n\t * when the browser supports typed arrays.\n\t *\n\t * Note:\n\t *\n\t * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n\t * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n\t *\n\t * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n\t *\n\t * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n\t * incorrect length in some situations.\n\t\n\t * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n\t * get the Object implementation, which is slower but behaves correctly.\n\t */\n\tBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n\t ? global.TYPED_ARRAY_SUPPORT\n\t : typedArraySupport()\n\t\n\t/*\n\t * Export kMaxLength after typed array support is determined.\n\t */\n\texports.kMaxLength = kMaxLength()\n\t\n\tfunction typedArraySupport () {\n\t try {\n\t var arr = new Uint8Array(1)\n\t arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n\t return arr.foo() === 42 && // typed array instances can be augmented\n\t typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n\t arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n\t } catch (e) {\n\t return false\n\t }\n\t}\n\t\n\tfunction kMaxLength () {\n\t return Buffer.TYPED_ARRAY_SUPPORT\n\t ? 0x7fffffff\n\t : 0x3fffffff\n\t}\n\t\n\tfunction createBuffer (that, length) {\n\t if (kMaxLength() < length) {\n\t throw new RangeError('Invalid typed array length')\n\t }\n\t if (Buffer.TYPED_ARRAY_SUPPORT) {\n\t // Return an augmented `Uint8Array` instance, for best performance\n\t that = new Uint8Array(length)\n\t that.__proto__ = Buffer.prototype\n\t } else {\n\t // Fallback: Return an object instance of the Buffer class\n\t if (that === null) {\n\t that = new Buffer(length)\n\t }\n\t that.length = length\n\t }\n\t\n\t return that\n\t}\n\t\n\t/**\n\t * The Buffer constructor returns instances of `Uint8Array` that have their\n\t * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n\t * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n\t * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n\t * returns a single octet.\n\t *\n\t * The `Uint8Array` prototype remains unmodified.\n\t */\n\t\n\tfunction Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}\n\t\n\tBuffer.poolSize = 8192 // not used by this implementation\n\t\n\t// TODO: Legacy, not needed anymore. Remove in next major version.\n\tBuffer._augment = function (arr) {\n\t arr.__proto__ = Buffer.prototype\n\t return arr\n\t}\n\t\n\tfunction from (that, value, encodingOrOffset, length) {\n\t if (typeof value === 'number') {\n\t throw new TypeError('\"value\" argument must not be a number')\n\t }\n\t\n\t if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n\t return fromArrayBuffer(that, value, encodingOrOffset, length)\n\t }\n\t\n\t if (typeof value === 'string') {\n\t return fromString(that, value, encodingOrOffset)\n\t }\n\t\n\t return fromObject(that, value)\n\t}\n\t\n\t/**\n\t * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n\t * if value is a number.\n\t * Buffer.from(str[, encoding])\n\t * Buffer.from(array)\n\t * Buffer.from(buffer)\n\t * Buffer.from(arrayBuffer[, byteOffset[, length]])\n\t **/\n\tBuffer.from = function (value, encodingOrOffset, length) {\n\t return from(null, value, encodingOrOffset, length)\n\t}\n\t\n\tif (Buffer.TYPED_ARRAY_SUPPORT) {\n\t Buffer.prototype.__proto__ = Uint8Array.prototype\n\t Buffer.__proto__ = Uint8Array\n\t if (typeof Symbol !== 'undefined' && Symbol.species &&\n\t Buffer[Symbol.species] === Buffer) {\n\t // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n\t Object.defineProperty(Buffer, Symbol.species, {\n\t value: null,\n\t configurable: true\n\t })\n\t }\n\t}\n\t\n\tfunction assertSize (size) {\n\t if (typeof size !== 'number') {\n\t throw new TypeError('\"size\" argument must be a number')\n\t } else if (size < 0) {\n\t throw new RangeError('\"size\" argument must not be negative')\n\t }\n\t}\n\t\n\tfunction alloc (that, size, fill, encoding) {\n\t assertSize(size)\n\t if (size <= 0) {\n\t return createBuffer(that, size)\n\t }\n\t if (fill !== undefined) {\n\t // Only pay attention to encoding if it's a string. This\n\t // prevents accidentally sending in a number that would\n\t // be interpretted as a start offset.\n\t return typeof encoding === 'string'\n\t ? createBuffer(that, size).fill(fill, encoding)\n\t : createBuffer(that, size).fill(fill)\n\t }\n\t return createBuffer(that, size)\n\t}\n\t\n\t/**\n\t * Creates a new filled Buffer instance.\n\t * alloc(size[, fill[, encoding]])\n\t **/\n\tBuffer.alloc = function (size, fill, encoding) {\n\t return alloc(null, size, fill, encoding)\n\t}\n\t\n\tfunction allocUnsafe (that, size) {\n\t assertSize(size)\n\t that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t for (var i = 0; i < size; ++i) {\n\t that[i] = 0\n\t }\n\t }\n\t return that\n\t}\n\t\n\t/**\n\t * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n\t * */\n\tBuffer.allocUnsafe = function (size) {\n\t return allocUnsafe(null, size)\n\t}\n\t/**\n\t * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n\t */\n\tBuffer.allocUnsafeSlow = function (size) {\n\t return allocUnsafe(null, size)\n\t}\n\t\n\tfunction fromString (that, string, encoding) {\n\t if (typeof encoding !== 'string' || encoding === '') {\n\t encoding = 'utf8'\n\t }\n\t\n\t if (!Buffer.isEncoding(encoding)) {\n\t throw new TypeError('\"encoding\" must be a valid string encoding')\n\t }\n\t\n\t var length = byteLength(string, encoding) | 0\n\t that = createBuffer(that, length)\n\t\n\t var actual = that.write(string, encoding)\n\t\n\t if (actual !== length) {\n\t // Writing a hex string, for example, that contains invalid characters will\n\t // cause everything after the first invalid character to be ignored. (e.g.\n\t // 'abxxcd' will be treated as 'ab')\n\t that = that.slice(0, actual)\n\t }\n\t\n\t return that\n\t}\n\t\n\tfunction fromArrayLike (that, array) {\n\t var length = array.length < 0 ? 0 : checked(array.length) | 0\n\t that = createBuffer(that, length)\n\t for (var i = 0; i < length; i += 1) {\n\t that[i] = array[i] & 255\n\t }\n\t return that\n\t}\n\t\n\tfunction fromArrayBuffer (that, array, byteOffset, length) {\n\t array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\t\n\t if (byteOffset < 0 || array.byteLength < byteOffset) {\n\t throw new RangeError('\\'offset\\' is out of bounds')\n\t }\n\t\n\t if (array.byteLength < byteOffset + (length || 0)) {\n\t throw new RangeError('\\'length\\' is out of bounds')\n\t }\n\t\n\t if (byteOffset === undefined && length === undefined) {\n\t array = new Uint8Array(array)\n\t } else if (length === undefined) {\n\t array = new Uint8Array(array, byteOffset)\n\t } else {\n\t array = new Uint8Array(array, byteOffset, length)\n\t }\n\t\n\t if (Buffer.TYPED_ARRAY_SUPPORT) {\n\t // Return an augmented `Uint8Array` instance, for best performance\n\t that = array\n\t that.__proto__ = Buffer.prototype\n\t } else {\n\t // Fallback: Return an object instance of the Buffer class\n\t that = fromArrayLike(that, array)\n\t }\n\t return that\n\t}\n\t\n\tfunction fromObject (that, obj) {\n\t if (Buffer.isBuffer(obj)) {\n\t var len = checked(obj.length) | 0\n\t that = createBuffer(that, len)\n\t\n\t if (that.length === 0) {\n\t return that\n\t }\n\t\n\t obj.copy(that, 0, 0, len)\n\t return that\n\t }\n\t\n\t if (obj) {\n\t if ((typeof ArrayBuffer !== 'undefined' &&\n\t obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n\t if (typeof obj.length !== 'number' || isnan(obj.length)) {\n\t return createBuffer(that, 0)\n\t }\n\t return fromArrayLike(that, obj)\n\t }\n\t\n\t if (obj.type === 'Buffer' && isArray(obj.data)) {\n\t return fromArrayLike(that, obj.data)\n\t }\n\t }\n\t\n\t throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n\t}\n\t\n\tfunction checked (length) {\n\t // Note: cannot use `length < kMaxLength()` here because that fails when\n\t // length is NaN (which is otherwise coerced to zero.)\n\t if (length >= kMaxLength()) {\n\t throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n\t 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n\t }\n\t return length | 0\n\t}\n\t\n\tfunction SlowBuffer (length) {\n\t if (+length != length) { // eslint-disable-line eqeqeq\n\t length = 0\n\t }\n\t return Buffer.alloc(+length)\n\t}\n\t\n\tBuffer.isBuffer = function isBuffer (b) {\n\t return !!(b != null && b._isBuffer)\n\t}\n\t\n\tBuffer.compare = function compare (a, b) {\n\t if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n\t throw new TypeError('Arguments must be Buffers')\n\t }\n\t\n\t if (a === b) return 0\n\t\n\t var x = a.length\n\t var y = b.length\n\t\n\t for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n\t if (a[i] !== b[i]) {\n\t x = a[i]\n\t y = b[i]\n\t break\n\t }\n\t }\n\t\n\t if (x < y) return -1\n\t if (y < x) return 1\n\t return 0\n\t}\n\t\n\tBuffer.isEncoding = function isEncoding (encoding) {\n\t switch (String(encoding).toLowerCase()) {\n\t case 'hex':\n\t case 'utf8':\n\t case 'utf-8':\n\t case 'ascii':\n\t case 'latin1':\n\t case 'binary':\n\t case 'base64':\n\t case 'ucs2':\n\t case 'ucs-2':\n\t case 'utf16le':\n\t case 'utf-16le':\n\t return true\n\t default:\n\t return false\n\t }\n\t}\n\t\n\tBuffer.concat = function concat (list, length) {\n\t if (!isArray(list)) {\n\t throw new TypeError('\"list\" argument must be an Array of Buffers')\n\t }\n\t\n\t if (list.length === 0) {\n\t return Buffer.alloc(0)\n\t }\n\t\n\t var i\n\t if (length === undefined) {\n\t length = 0\n\t for (i = 0; i < list.length; ++i) {\n\t length += list[i].length\n\t }\n\t }\n\t\n\t var buffer = Buffer.allocUnsafe(length)\n\t var pos = 0\n\t for (i = 0; i < list.length; ++i) {\n\t var buf = list[i]\n\t if (!Buffer.isBuffer(buf)) {\n\t throw new TypeError('\"list\" argument must be an Array of Buffers')\n\t }\n\t buf.copy(buffer, pos)\n\t pos += buf.length\n\t }\n\t return buffer\n\t}\n\t\n\tfunction byteLength (string, encoding) {\n\t if (Buffer.isBuffer(string)) {\n\t return string.length\n\t }\n\t if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n\t (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n\t return string.byteLength\n\t }\n\t if (typeof string !== 'string') {\n\t string = '' + string\n\t }\n\t\n\t var len = string.length\n\t if (len === 0) return 0\n\t\n\t // Use a for loop to avoid recursion\n\t var loweredCase = false\n\t for (;;) {\n\t switch (encoding) {\n\t case 'ascii':\n\t case 'latin1':\n\t case 'binary':\n\t return len\n\t case 'utf8':\n\t case 'utf-8':\n\t case undefined:\n\t return utf8ToBytes(string).length\n\t case 'ucs2':\n\t case 'ucs-2':\n\t case 'utf16le':\n\t case 'utf-16le':\n\t return len * 2\n\t case 'hex':\n\t return len >>> 1\n\t case 'base64':\n\t return base64ToBytes(string).length\n\t default:\n\t if (loweredCase) return utf8ToBytes(string).length // assume utf8\n\t encoding = ('' + encoding).toLowerCase()\n\t loweredCase = true\n\t }\n\t }\n\t}\n\tBuffer.byteLength = byteLength\n\t\n\tfunction slowToString (encoding, start, end) {\n\t var loweredCase = false\n\t\n\t // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n\t // property of a typed array.\n\t\n\t // This behaves neither like String nor Uint8Array in that we set start/end\n\t // to their upper/lower bounds if the value passed is out of range.\n\t // undefined is handled specially as per ECMA-262 6th Edition,\n\t // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n\t if (start === undefined || start < 0) {\n\t start = 0\n\t }\n\t // Return early if start > this.length. Done here to prevent potential uint32\n\t // coercion fail below.\n\t if (start > this.length) {\n\t return ''\n\t }\n\t\n\t if (end === undefined || end > this.length) {\n\t end = this.length\n\t }\n\t\n\t if (end <= 0) {\n\t return ''\n\t }\n\t\n\t // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n\t end >>>= 0\n\t start >>>= 0\n\t\n\t if (end <= start) {\n\t return ''\n\t }\n\t\n\t if (!encoding) encoding = 'utf8'\n\t\n\t while (true) {\n\t switch (encoding) {\n\t case 'hex':\n\t return hexSlice(this, start, end)\n\t\n\t case 'utf8':\n\t case 'utf-8':\n\t return utf8Slice(this, start, end)\n\t\n\t case 'ascii':\n\t return asciiSlice(this, start, end)\n\t\n\t case 'latin1':\n\t case 'binary':\n\t return latin1Slice(this, start, end)\n\t\n\t case 'base64':\n\t return base64Slice(this, start, end)\n\t\n\t case 'ucs2':\n\t case 'ucs-2':\n\t case 'utf16le':\n\t case 'utf-16le':\n\t return utf16leSlice(this, start, end)\n\t\n\t default:\n\t if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n\t encoding = (encoding + '').toLowerCase()\n\t loweredCase = true\n\t }\n\t }\n\t}\n\t\n\t// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n\t// Buffer instances.\n\tBuffer.prototype._isBuffer = true\n\t\n\tfunction swap (b, n, m) {\n\t var i = b[n]\n\t b[n] = b[m]\n\t b[m] = i\n\t}\n\t\n\tBuffer.prototype.swap16 = function swap16 () {\n\t var len = this.length\n\t if (len % 2 !== 0) {\n\t throw new RangeError('Buffer size must be a multiple of 16-bits')\n\t }\n\t for (var i = 0; i < len; i += 2) {\n\t swap(this, i, i + 1)\n\t }\n\t return this\n\t}\n\t\n\tBuffer.prototype.swap32 = function swap32 () {\n\t var len = this.length\n\t if (len % 4 !== 0) {\n\t throw new RangeError('Buffer size must be a multiple of 32-bits')\n\t }\n\t for (var i = 0; i < len; i += 4) {\n\t swap(this, i, i + 3)\n\t swap(this, i + 1, i + 2)\n\t }\n\t return this\n\t}\n\t\n\tBuffer.prototype.swap64 = function swap64 () {\n\t var len = this.length\n\t if (len % 8 !== 0) {\n\t throw new RangeError('Buffer size must be a multiple of 64-bits')\n\t }\n\t for (var i = 0; i < len; i += 8) {\n\t swap(this, i, i + 7)\n\t swap(this, i + 1, i + 6)\n\t swap(this, i + 2, i + 5)\n\t swap(this, i + 3, i + 4)\n\t }\n\t return this\n\t}\n\t\n\tBuffer.prototype.toString = function toString () {\n\t var length = this.length | 0\n\t if (length === 0) return ''\n\t if (arguments.length === 0) return utf8Slice(this, 0, length)\n\t return slowToString.apply(this, arguments)\n\t}\n\t\n\tBuffer.prototype.equals = function equals (b) {\n\t if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n\t if (this === b) return true\n\t return Buffer.compare(this, b) === 0\n\t}\n\t\n\tBuffer.prototype.inspect = function inspect () {\n\t var str = ''\n\t var max = exports.INSPECT_MAX_BYTES\n\t if (this.length > 0) {\n\t str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n\t if (this.length > max) str += ' ... '\n\t }\n\t return ''\n\t}\n\t\n\tBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n\t if (!Buffer.isBuffer(target)) {\n\t throw new TypeError('Argument must be a Buffer')\n\t }\n\t\n\t if (start === undefined) {\n\t start = 0\n\t }\n\t if (end === undefined) {\n\t end = target ? target.length : 0\n\t }\n\t if (thisStart === undefined) {\n\t thisStart = 0\n\t }\n\t if (thisEnd === undefined) {\n\t thisEnd = this.length\n\t }\n\t\n\t if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n\t throw new RangeError('out of range index')\n\t }\n\t\n\t if (thisStart >= thisEnd && start >= end) {\n\t return 0\n\t }\n\t if (thisStart >= thisEnd) {\n\t return -1\n\t }\n\t if (start >= end) {\n\t return 1\n\t }\n\t\n\t start >>>= 0\n\t end >>>= 0\n\t thisStart >>>= 0\n\t thisEnd >>>= 0\n\t\n\t if (this === target) return 0\n\t\n\t var x = thisEnd - thisStart\n\t var y = end - start\n\t var len = Math.min(x, y)\n\t\n\t var thisCopy = this.slice(thisStart, thisEnd)\n\t var targetCopy = target.slice(start, end)\n\t\n\t for (var i = 0; i < len; ++i) {\n\t if (thisCopy[i] !== targetCopy[i]) {\n\t x = thisCopy[i]\n\t y = targetCopy[i]\n\t break\n\t }\n\t }\n\t\n\t if (x < y) return -1\n\t if (y < x) return 1\n\t return 0\n\t}\n\t\n\t// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n\t// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n\t//\n\t// Arguments:\n\t// - buffer - a Buffer to search\n\t// - val - a string, Buffer, or number\n\t// - byteOffset - an index into `buffer`; will be clamped to an int32\n\t// - encoding - an optional encoding, relevant is val is a string\n\t// - dir - true for indexOf, false for lastIndexOf\n\tfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n\t // Empty buffer means no match\n\t if (buffer.length === 0) return -1\n\t\n\t // Normalize byteOffset\n\t if (typeof byteOffset === 'string') {\n\t encoding = byteOffset\n\t byteOffset = 0\n\t } else if (byteOffset > 0x7fffffff) {\n\t byteOffset = 0x7fffffff\n\t } else if (byteOffset < -0x80000000) {\n\t byteOffset = -0x80000000\n\t }\n\t byteOffset = +byteOffset // Coerce to Number.\n\t if (isNaN(byteOffset)) {\n\t // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n\t byteOffset = dir ? 0 : (buffer.length - 1)\n\t }\n\t\n\t // Normalize byteOffset: negative offsets start from the end of the buffer\n\t if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n\t if (byteOffset >= buffer.length) {\n\t if (dir) return -1\n\t else byteOffset = buffer.length - 1\n\t } else if (byteOffset < 0) {\n\t if (dir) byteOffset = 0\n\t else return -1\n\t }\n\t\n\t // Normalize val\n\t if (typeof val === 'string') {\n\t val = Buffer.from(val, encoding)\n\t }\n\t\n\t // Finally, search either indexOf (if dir is true) or lastIndexOf\n\t if (Buffer.isBuffer(val)) {\n\t // Special case: looking for empty string/buffer always fails\n\t if (val.length === 0) {\n\t return -1\n\t }\n\t return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n\t } else if (typeof val === 'number') {\n\t val = val & 0xFF // Search for a byte value [0-255]\n\t if (Buffer.TYPED_ARRAY_SUPPORT &&\n\t typeof Uint8Array.prototype.indexOf === 'function') {\n\t if (dir) {\n\t return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n\t } else {\n\t return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n\t }\n\t }\n\t return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n\t }\n\t\n\t throw new TypeError('val must be string, number or Buffer')\n\t}\n\t\n\tfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n\t var indexSize = 1\n\t var arrLength = arr.length\n\t var valLength = val.length\n\t\n\t if (encoding !== undefined) {\n\t encoding = String(encoding).toLowerCase()\n\t if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n\t encoding === 'utf16le' || encoding === 'utf-16le') {\n\t if (arr.length < 2 || val.length < 2) {\n\t return -1\n\t }\n\t indexSize = 2\n\t arrLength /= 2\n\t valLength /= 2\n\t byteOffset /= 2\n\t }\n\t }\n\t\n\t function read (buf, i) {\n\t if (indexSize === 1) {\n\t return buf[i]\n\t } else {\n\t return buf.readUInt16BE(i * indexSize)\n\t }\n\t }\n\t\n\t var i\n\t if (dir) {\n\t var foundIndex = -1\n\t for (i = byteOffset; i < arrLength; i++) {\n\t if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n\t if (foundIndex === -1) foundIndex = i\n\t if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n\t } else {\n\t if (foundIndex !== -1) i -= i - foundIndex\n\t foundIndex = -1\n\t }\n\t }\n\t } else {\n\t if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n\t for (i = byteOffset; i >= 0; i--) {\n\t var found = true\n\t for (var j = 0; j < valLength; j++) {\n\t if (read(arr, i + j) !== read(val, j)) {\n\t found = false\n\t break\n\t }\n\t }\n\t if (found) return i\n\t }\n\t }\n\t\n\t return -1\n\t}\n\t\n\tBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n\t return this.indexOf(val, byteOffset, encoding) !== -1\n\t}\n\t\n\tBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n\t return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n\t}\n\t\n\tBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n\t return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n\t}\n\t\n\tfunction hexWrite (buf, string, offset, length) {\n\t offset = Number(offset) || 0\n\t var remaining = buf.length - offset\n\t if (!length) {\n\t length = remaining\n\t } else {\n\t length = Number(length)\n\t if (length > remaining) {\n\t length = remaining\n\t }\n\t }\n\t\n\t // must be an even number of digits\n\t var strLen = string.length\n\t if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\t\n\t if (length > strLen / 2) {\n\t length = strLen / 2\n\t }\n\t for (var i = 0; i < length; ++i) {\n\t var parsed = parseInt(string.substr(i * 2, 2), 16)\n\t if (isNaN(parsed)) return i\n\t buf[offset + i] = parsed\n\t }\n\t return i\n\t}\n\t\n\tfunction utf8Write (buf, string, offset, length) {\n\t return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n\t}\n\t\n\tfunction asciiWrite (buf, string, offset, length) {\n\t return blitBuffer(asciiToBytes(string), buf, offset, length)\n\t}\n\t\n\tfunction latin1Write (buf, string, offset, length) {\n\t return asciiWrite(buf, string, offset, length)\n\t}\n\t\n\tfunction base64Write (buf, string, offset, length) {\n\t return blitBuffer(base64ToBytes(string), buf, offset, length)\n\t}\n\t\n\tfunction ucs2Write (buf, string, offset, length) {\n\t return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n\t}\n\t\n\tBuffer.prototype.write = function write (string, offset, length, encoding) {\n\t // Buffer#write(string)\n\t if (offset === undefined) {\n\t encoding = 'utf8'\n\t length = this.length\n\t offset = 0\n\t // Buffer#write(string, encoding)\n\t } else if (length === undefined && typeof offset === 'string') {\n\t encoding = offset\n\t length = this.length\n\t offset = 0\n\t // Buffer#write(string, offset[, length][, encoding])\n\t } else if (isFinite(offset)) {\n\t offset = offset | 0\n\t if (isFinite(length)) {\n\t length = length | 0\n\t if (encoding === undefined) encoding = 'utf8'\n\t } else {\n\t encoding = length\n\t length = undefined\n\t }\n\t // legacy write(string, encoding, offset, length) - remove in v0.13\n\t } else {\n\t throw new Error(\n\t 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n\t )\n\t }\n\t\n\t var remaining = this.length - offset\n\t if (length === undefined || length > remaining) length = remaining\n\t\n\t if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n\t throw new RangeError('Attempt to write outside buffer bounds')\n\t }\n\t\n\t if (!encoding) encoding = 'utf8'\n\t\n\t var loweredCase = false\n\t for (;;) {\n\t switch (encoding) {\n\t case 'hex':\n\t return hexWrite(this, string, offset, length)\n\t\n\t case 'utf8':\n\t case 'utf-8':\n\t return utf8Write(this, string, offset, length)\n\t\n\t case 'ascii':\n\t return asciiWrite(this, string, offset, length)\n\t\n\t case 'latin1':\n\t case 'binary':\n\t return latin1Write(this, string, offset, length)\n\t\n\t case 'base64':\n\t // Warning: maxLength not taken into account in base64Write\n\t return base64Write(this, string, offset, length)\n\t\n\t case 'ucs2':\n\t case 'ucs-2':\n\t case 'utf16le':\n\t case 'utf-16le':\n\t return ucs2Write(this, string, offset, length)\n\t\n\t default:\n\t if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n\t encoding = ('' + encoding).toLowerCase()\n\t loweredCase = true\n\t }\n\t }\n\t}\n\t\n\tBuffer.prototype.toJSON = function toJSON () {\n\t return {\n\t type: 'Buffer',\n\t data: Array.prototype.slice.call(this._arr || this, 0)\n\t }\n\t}\n\t\n\tfunction base64Slice (buf, start, end) {\n\t if (start === 0 && end === buf.length) {\n\t return base64.fromByteArray(buf)\n\t } else {\n\t return base64.fromByteArray(buf.slice(start, end))\n\t }\n\t}\n\t\n\tfunction utf8Slice (buf, start, end) {\n\t end = Math.min(buf.length, end)\n\t var res = []\n\t\n\t var i = start\n\t while (i < end) {\n\t var firstByte = buf[i]\n\t var codePoint = null\n\t var bytesPerSequence = (firstByte > 0xEF) ? 4\n\t : (firstByte > 0xDF) ? 3\n\t : (firstByte > 0xBF) ? 2\n\t : 1\n\t\n\t if (i + bytesPerSequence <= end) {\n\t var secondByte, thirdByte, fourthByte, tempCodePoint\n\t\n\t switch (bytesPerSequence) {\n\t case 1:\n\t if (firstByte < 0x80) {\n\t codePoint = firstByte\n\t }\n\t break\n\t case 2:\n\t secondByte = buf[i + 1]\n\t if ((secondByte & 0xC0) === 0x80) {\n\t tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n\t if (tempCodePoint > 0x7F) {\n\t codePoint = tempCodePoint\n\t }\n\t }\n\t break\n\t case 3:\n\t secondByte = buf[i + 1]\n\t thirdByte = buf[i + 2]\n\t if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n\t tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n\t if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n\t codePoint = tempCodePoint\n\t }\n\t }\n\t break\n\t case 4:\n\t secondByte = buf[i + 1]\n\t thirdByte = buf[i + 2]\n\t fourthByte = buf[i + 3]\n\t if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n\t tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n\t if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n\t codePoint = tempCodePoint\n\t }\n\t }\n\t }\n\t }\n\t\n\t if (codePoint === null) {\n\t // we did not generate a valid codePoint so insert a\n\t // replacement char (U+FFFD) and advance only 1 byte\n\t codePoint = 0xFFFD\n\t bytesPerSequence = 1\n\t } else if (codePoint > 0xFFFF) {\n\t // encode to utf16 (surrogate pair dance)\n\t codePoint -= 0x10000\n\t res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n\t codePoint = 0xDC00 | codePoint & 0x3FF\n\t }\n\t\n\t res.push(codePoint)\n\t i += bytesPerSequence\n\t }\n\t\n\t return decodeCodePointsArray(res)\n\t}\n\t\n\t// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n\t// the lowest limit is Chrome, with 0x10000 args.\n\t// We go 1 magnitude less, for safety\n\tvar MAX_ARGUMENTS_LENGTH = 0x1000\n\t\n\tfunction decodeCodePointsArray (codePoints) {\n\t var len = codePoints.length\n\t if (len <= MAX_ARGUMENTS_LENGTH) {\n\t return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n\t }\n\t\n\t // Decode in chunks to avoid \"call stack size exceeded\".\n\t var res = ''\n\t var i = 0\n\t while (i < len) {\n\t res += String.fromCharCode.apply(\n\t String,\n\t codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n\t )\n\t }\n\t return res\n\t}\n\t\n\tfunction asciiSlice (buf, start, end) {\n\t var ret = ''\n\t end = Math.min(buf.length, end)\n\t\n\t for (var i = start; i < end; ++i) {\n\t ret += String.fromCharCode(buf[i] & 0x7F)\n\t }\n\t return ret\n\t}\n\t\n\tfunction latin1Slice (buf, start, end) {\n\t var ret = ''\n\t end = Math.min(buf.length, end)\n\t\n\t for (var i = start; i < end; ++i) {\n\t ret += String.fromCharCode(buf[i])\n\t }\n\t return ret\n\t}\n\t\n\tfunction hexSlice (buf, start, end) {\n\t var len = buf.length\n\t\n\t if (!start || start < 0) start = 0\n\t if (!end || end < 0 || end > len) end = len\n\t\n\t var out = ''\n\t for (var i = start; i < end; ++i) {\n\t out += toHex(buf[i])\n\t }\n\t return out\n\t}\n\t\n\tfunction utf16leSlice (buf, start, end) {\n\t var bytes = buf.slice(start, end)\n\t var res = ''\n\t for (var i = 0; i < bytes.length; i += 2) {\n\t res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n\t }\n\t return res\n\t}\n\t\n\tBuffer.prototype.slice = function slice (start, end) {\n\t var len = this.length\n\t start = ~~start\n\t end = end === undefined ? len : ~~end\n\t\n\t if (start < 0) {\n\t start += len\n\t if (start < 0) start = 0\n\t } else if (start > len) {\n\t start = len\n\t }\n\t\n\t if (end < 0) {\n\t end += len\n\t if (end < 0) end = 0\n\t } else if (end > len) {\n\t end = len\n\t }\n\t\n\t if (end < start) end = start\n\t\n\t var newBuf\n\t if (Buffer.TYPED_ARRAY_SUPPORT) {\n\t newBuf = this.subarray(start, end)\n\t newBuf.__proto__ = Buffer.prototype\n\t } else {\n\t var sliceLen = end - start\n\t newBuf = new Buffer(sliceLen, undefined)\n\t for (var i = 0; i < sliceLen; ++i) {\n\t newBuf[i] = this[i + start]\n\t }\n\t }\n\t\n\t return newBuf\n\t}\n\t\n\t/*\n\t * Need to make sure that buffer isn't trying to write out of bounds.\n\t */\n\tfunction checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}\n\t\n\tBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n\t offset = offset | 0\n\t byteLength = byteLength | 0\n\t if (!noAssert) checkOffset(offset, byteLength, this.length)\n\t\n\t var val = this[offset]\n\t var mul = 1\n\t var i = 0\n\t while (++i < byteLength && (mul *= 0x100)) {\n\t val += this[offset + i] * mul\n\t }\n\t\n\t return val\n\t}\n\t\n\tBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n\t offset = offset | 0\n\t byteLength = byteLength | 0\n\t if (!noAssert) {\n\t checkOffset(offset, byteLength, this.length)\n\t }\n\t\n\t var val = this[offset + --byteLength]\n\t var mul = 1\n\t while (byteLength > 0 && (mul *= 0x100)) {\n\t val += this[offset + --byteLength] * mul\n\t }\n\t\n\t return val\n\t}\n\t\n\tBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n\t if (!noAssert) checkOffset(offset, 1, this.length)\n\t return this[offset]\n\t}\n\t\n\tBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n\t if (!noAssert) checkOffset(offset, 2, this.length)\n\t return this[offset] | (this[offset + 1] << 8)\n\t}\n\t\n\tBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n\t if (!noAssert) checkOffset(offset, 2, this.length)\n\t return (this[offset] << 8) | this[offset + 1]\n\t}\n\t\n\tBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n\t if (!noAssert) checkOffset(offset, 4, this.length)\n\t\n\t return ((this[offset]) |\n\t (this[offset + 1] << 8) |\n\t (this[offset + 2] << 16)) +\n\t (this[offset + 3] * 0x1000000)\n\t}\n\t\n\tBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n\t if (!noAssert) checkOffset(offset, 4, this.length)\n\t\n\t return (this[offset] * 0x1000000) +\n\t ((this[offset + 1] << 16) |\n\t (this[offset + 2] << 8) |\n\t this[offset + 3])\n\t}\n\t\n\tBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n\t offset = offset | 0\n\t byteLength = byteLength | 0\n\t if (!noAssert) checkOffset(offset, byteLength, this.length)\n\t\n\t var val = this[offset]\n\t var mul = 1\n\t var i = 0\n\t while (++i < byteLength && (mul *= 0x100)) {\n\t val += this[offset + i] * mul\n\t }\n\t mul *= 0x80\n\t\n\t if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\t\n\t return val\n\t}\n\t\n\tBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n\t offset = offset | 0\n\t byteLength = byteLength | 0\n\t if (!noAssert) checkOffset(offset, byteLength, this.length)\n\t\n\t var i = byteLength\n\t var mul = 1\n\t var val = this[offset + --i]\n\t while (i > 0 && (mul *= 0x100)) {\n\t val += this[offset + --i] * mul\n\t }\n\t mul *= 0x80\n\t\n\t if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\t\n\t return val\n\t}\n\t\n\tBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n\t if (!noAssert) checkOffset(offset, 1, this.length)\n\t if (!(this[offset] & 0x80)) return (this[offset])\n\t return ((0xff - this[offset] + 1) * -1)\n\t}\n\t\n\tBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n\t if (!noAssert) checkOffset(offset, 2, this.length)\n\t var val = this[offset] | (this[offset + 1] << 8)\n\t return (val & 0x8000) ? val | 0xFFFF0000 : val\n\t}\n\t\n\tBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n\t if (!noAssert) checkOffset(offset, 2, this.length)\n\t var val = this[offset + 1] | (this[offset] << 8)\n\t return (val & 0x8000) ? val | 0xFFFF0000 : val\n\t}\n\t\n\tBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n\t if (!noAssert) checkOffset(offset, 4, this.length)\n\t\n\t return (this[offset]) |\n\t (this[offset + 1] << 8) |\n\t (this[offset + 2] << 16) |\n\t (this[offset + 3] << 24)\n\t}\n\t\n\tBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n\t if (!noAssert) checkOffset(offset, 4, this.length)\n\t\n\t return (this[offset] << 24) |\n\t (this[offset + 1] << 16) |\n\t (this[offset + 2] << 8) |\n\t (this[offset + 3])\n\t}\n\t\n\tBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n\t if (!noAssert) checkOffset(offset, 4, this.length)\n\t return ieee754.read(this, offset, true, 23, 4)\n\t}\n\t\n\tBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n\t if (!noAssert) checkOffset(offset, 4, this.length)\n\t return ieee754.read(this, offset, false, 23, 4)\n\t}\n\t\n\tBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n\t if (!noAssert) checkOffset(offset, 8, this.length)\n\t return ieee754.read(this, offset, true, 52, 8)\n\t}\n\t\n\tBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n\t if (!noAssert) checkOffset(offset, 8, this.length)\n\t return ieee754.read(this, offset, false, 52, 8)\n\t}\n\t\n\tfunction checkInt (buf, value, offset, ext, max, min) {\n\t if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n\t if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n\t if (offset + ext > buf.length) throw new RangeError('Index out of range')\n\t}\n\t\n\tBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n\t value = +value\n\t offset = offset | 0\n\t byteLength = byteLength | 0\n\t if (!noAssert) {\n\t var maxBytes = Math.pow(2, 8 * byteLength) - 1\n\t checkInt(this, value, offset, byteLength, maxBytes, 0)\n\t }\n\t\n\t var mul = 1\n\t var i = 0\n\t this[offset] = value & 0xFF\n\t while (++i < byteLength && (mul *= 0x100)) {\n\t this[offset + i] = (value / mul) & 0xFF\n\t }\n\t\n\t return offset + byteLength\n\t}\n\t\n\tBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n\t value = +value\n\t offset = offset | 0\n\t byteLength = byteLength | 0\n\t if (!noAssert) {\n\t var maxBytes = Math.pow(2, 8 * byteLength) - 1\n\t checkInt(this, value, offset, byteLength, maxBytes, 0)\n\t }\n\t\n\t var i = byteLength - 1\n\t var mul = 1\n\t this[offset + i] = value & 0xFF\n\t while (--i >= 0 && (mul *= 0x100)) {\n\t this[offset + i] = (value / mul) & 0xFF\n\t }\n\t\n\t return offset + byteLength\n\t}\n\t\n\tBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n\t value = +value\n\t offset = offset | 0\n\t if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n\t this[offset] = (value & 0xff)\n\t return offset + 1\n\t}\n\t\n\tfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n\t if (value < 0) value = 0xffff + value + 1\n\t for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n\t buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n\t (littleEndian ? i : 1 - i) * 8\n\t }\n\t}\n\t\n\tBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n\t value = +value\n\t offset = offset | 0\n\t if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n\t if (Buffer.TYPED_ARRAY_SUPPORT) {\n\t this[offset] = (value & 0xff)\n\t this[offset + 1] = (value >>> 8)\n\t } else {\n\t objectWriteUInt16(this, value, offset, true)\n\t }\n\t return offset + 2\n\t}\n\t\n\tBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n\t value = +value\n\t offset = offset | 0\n\t if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n\t if (Buffer.TYPED_ARRAY_SUPPORT) {\n\t this[offset] = (value >>> 8)\n\t this[offset + 1] = (value & 0xff)\n\t } else {\n\t objectWriteUInt16(this, value, offset, false)\n\t }\n\t return offset + 2\n\t}\n\t\n\tfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n\t if (value < 0) value = 0xffffffff + value + 1\n\t for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n\t buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n\t }\n\t}\n\t\n\tBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n\t value = +value\n\t offset = offset | 0\n\t if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n\t if (Buffer.TYPED_ARRAY_SUPPORT) {\n\t this[offset + 3] = (value >>> 24)\n\t this[offset + 2] = (value >>> 16)\n\t this[offset + 1] = (value >>> 8)\n\t this[offset] = (value & 0xff)\n\t } else {\n\t objectWriteUInt32(this, value, offset, true)\n\t }\n\t return offset + 4\n\t}\n\t\n\tBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n\t value = +value\n\t offset = offset | 0\n\t if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n\t if (Buffer.TYPED_ARRAY_SUPPORT) {\n\t this[offset] = (value >>> 24)\n\t this[offset + 1] = (value >>> 16)\n\t this[offset + 2] = (value >>> 8)\n\t this[offset + 3] = (value & 0xff)\n\t } else {\n\t objectWriteUInt32(this, value, offset, false)\n\t }\n\t return offset + 4\n\t}\n\t\n\tBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n\t value = +value\n\t offset = offset | 0\n\t if (!noAssert) {\n\t var limit = Math.pow(2, 8 * byteLength - 1)\n\t\n\t checkInt(this, value, offset, byteLength, limit - 1, -limit)\n\t }\n\t\n\t var i = 0\n\t var mul = 1\n\t var sub = 0\n\t this[offset] = value & 0xFF\n\t while (++i < byteLength && (mul *= 0x100)) {\n\t if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n\t sub = 1\n\t }\n\t this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n\t }\n\t\n\t return offset + byteLength\n\t}\n\t\n\tBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n\t value = +value\n\t offset = offset | 0\n\t if (!noAssert) {\n\t var limit = Math.pow(2, 8 * byteLength - 1)\n\t\n\t checkInt(this, value, offset, byteLength, limit - 1, -limit)\n\t }\n\t\n\t var i = byteLength - 1\n\t var mul = 1\n\t var sub = 0\n\t this[offset + i] = value & 0xFF\n\t while (--i >= 0 && (mul *= 0x100)) {\n\t if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n\t sub = 1\n\t }\n\t this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n\t }\n\t\n\t return offset + byteLength\n\t}\n\t\n\tBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n\t value = +value\n\t offset = offset | 0\n\t if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n\t if (value < 0) value = 0xff + value + 1\n\t this[offset] = (value & 0xff)\n\t return offset + 1\n\t}\n\t\n\tBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n\t value = +value\n\t offset = offset | 0\n\t if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n\t if (Buffer.TYPED_ARRAY_SUPPORT) {\n\t this[offset] = (value & 0xff)\n\t this[offset + 1] = (value >>> 8)\n\t } else {\n\t objectWriteUInt16(this, value, offset, true)\n\t }\n\t return offset + 2\n\t}\n\t\n\tBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n\t value = +value\n\t offset = offset | 0\n\t if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n\t if (Buffer.TYPED_ARRAY_SUPPORT) {\n\t this[offset] = (value >>> 8)\n\t this[offset + 1] = (value & 0xff)\n\t } else {\n\t objectWriteUInt16(this, value, offset, false)\n\t }\n\t return offset + 2\n\t}\n\t\n\tBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n\t value = +value\n\t offset = offset | 0\n\t if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n\t if (Buffer.TYPED_ARRAY_SUPPORT) {\n\t this[offset] = (value & 0xff)\n\t this[offset + 1] = (value >>> 8)\n\t this[offset + 2] = (value >>> 16)\n\t this[offset + 3] = (value >>> 24)\n\t } else {\n\t objectWriteUInt32(this, value, offset, true)\n\t }\n\t return offset + 4\n\t}\n\t\n\tBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n\t value = +value\n\t offset = offset | 0\n\t if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n\t if (value < 0) value = 0xffffffff + value + 1\n\t if (Buffer.TYPED_ARRAY_SUPPORT) {\n\t this[offset] = (value >>> 24)\n\t this[offset + 1] = (value >>> 16)\n\t this[offset + 2] = (value >>> 8)\n\t this[offset + 3] = (value & 0xff)\n\t } else {\n\t objectWriteUInt32(this, value, offset, false)\n\t }\n\t return offset + 4\n\t}\n\t\n\tfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n\t if (offset + ext > buf.length) throw new RangeError('Index out of range')\n\t if (offset < 0) throw new RangeError('Index out of range')\n\t}\n\t\n\tfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n\t if (!noAssert) {\n\t checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n\t }\n\t ieee754.write(buf, value, offset, littleEndian, 23, 4)\n\t return offset + 4\n\t}\n\t\n\tBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n\t return writeFloat(this, value, offset, true, noAssert)\n\t}\n\t\n\tBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n\t return writeFloat(this, value, offset, false, noAssert)\n\t}\n\t\n\tfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n\t if (!noAssert) {\n\t checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n\t }\n\t ieee754.write(buf, value, offset, littleEndian, 52, 8)\n\t return offset + 8\n\t}\n\t\n\tBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n\t return writeDouble(this, value, offset, true, noAssert)\n\t}\n\t\n\tBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n\t return writeDouble(this, value, offset, false, noAssert)\n\t}\n\t\n\t// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\n\tBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n\t if (!start) start = 0\n\t if (!end && end !== 0) end = this.length\n\t if (targetStart >= target.length) targetStart = target.length\n\t if (!targetStart) targetStart = 0\n\t if (end > 0 && end < start) end = start\n\t\n\t // Copy 0 bytes; we're done\n\t if (end === start) return 0\n\t if (target.length === 0 || this.length === 0) return 0\n\t\n\t // Fatal error conditions\n\t if (targetStart < 0) {\n\t throw new RangeError('targetStart out of bounds')\n\t }\n\t if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n\t if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\t\n\t // Are we oob?\n\t if (end > this.length) end = this.length\n\t if (target.length - targetStart < end - start) {\n\t end = target.length - targetStart + start\n\t }\n\t\n\t var len = end - start\n\t var i\n\t\n\t if (this === target && start < targetStart && targetStart < end) {\n\t // descending copy from end\n\t for (i = len - 1; i >= 0; --i) {\n\t target[i + targetStart] = this[i + start]\n\t }\n\t } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n\t // ascending copy from start\n\t for (i = 0; i < len; ++i) {\n\t target[i + targetStart] = this[i + start]\n\t }\n\t } else {\n\t Uint8Array.prototype.set.call(\n\t target,\n\t this.subarray(start, start + len),\n\t targetStart\n\t )\n\t }\n\t\n\t return len\n\t}\n\t\n\t// Usage:\n\t// buffer.fill(number[, offset[, end]])\n\t// buffer.fill(buffer[, offset[, end]])\n\t// buffer.fill(string[, offset[, end]][, encoding])\n\tBuffer.prototype.fill = function fill (val, start, end, encoding) {\n\t // Handle string cases:\n\t if (typeof val === 'string') {\n\t if (typeof start === 'string') {\n\t encoding = start\n\t start = 0\n\t end = this.length\n\t } else if (typeof end === 'string') {\n\t encoding = end\n\t end = this.length\n\t }\n\t if (val.length === 1) {\n\t var code = val.charCodeAt(0)\n\t if (code < 256) {\n\t val = code\n\t }\n\t }\n\t if (encoding !== undefined && typeof encoding !== 'string') {\n\t throw new TypeError('encoding must be a string')\n\t }\n\t if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n\t throw new TypeError('Unknown encoding: ' + encoding)\n\t }\n\t } else if (typeof val === 'number') {\n\t val = val & 255\n\t }\n\t\n\t // Invalid ranges are not set to a default, so can range check early.\n\t if (start < 0 || this.length < start || this.length < end) {\n\t throw new RangeError('Out of range index')\n\t }\n\t\n\t if (end <= start) {\n\t return this\n\t }\n\t\n\t start = start >>> 0\n\t end = end === undefined ? this.length : end >>> 0\n\t\n\t if (!val) val = 0\n\t\n\t var i\n\t if (typeof val === 'number') {\n\t for (i = start; i < end; ++i) {\n\t this[i] = val\n\t }\n\t } else {\n\t var bytes = Buffer.isBuffer(val)\n\t ? val\n\t : utf8ToBytes(new Buffer(val, encoding).toString())\n\t var len = bytes.length\n\t for (i = 0; i < end - start; ++i) {\n\t this[i + start] = bytes[i % len]\n\t }\n\t }\n\t\n\t return this\n\t}\n\t\n\t// HELPER FUNCTIONS\n\t// ================\n\t\n\tvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\t\n\tfunction base64clean (str) {\n\t // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n\t str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n\t // Node converts strings with length < 2 to ''\n\t if (str.length < 2) return ''\n\t // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n\t while (str.length % 4 !== 0) {\n\t str = str + '='\n\t }\n\t return str\n\t}\n\t\n\tfunction stringtrim (str) {\n\t if (str.trim) return str.trim()\n\t return str.replace(/^\\s+|\\s+$/g, '')\n\t}\n\t\n\tfunction toHex (n) {\n\t if (n < 16) return '0' + n.toString(16)\n\t return n.toString(16)\n\t}\n\t\n\tfunction utf8ToBytes (string, units) {\n\t units = units || Infinity\n\t var codePoint\n\t var length = string.length\n\t var leadSurrogate = null\n\t var bytes = []\n\t\n\t for (var i = 0; i < length; ++i) {\n\t codePoint = string.charCodeAt(i)\n\t\n\t // is surrogate component\n\t if (codePoint > 0xD7FF && codePoint < 0xE000) {\n\t // last char was a lead\n\t if (!leadSurrogate) {\n\t // no lead yet\n\t if (codePoint > 0xDBFF) {\n\t // unexpected trail\n\t if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n\t continue\n\t } else if (i + 1 === length) {\n\t // unpaired lead\n\t if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n\t continue\n\t }\n\t\n\t // valid lead\n\t leadSurrogate = codePoint\n\t\n\t continue\n\t }\n\t\n\t // 2 leads in a row\n\t if (codePoint < 0xDC00) {\n\t if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n\t leadSurrogate = codePoint\n\t continue\n\t }\n\t\n\t // valid surrogate pair\n\t codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n\t } else if (leadSurrogate) {\n\t // valid bmp char, but last char was a lead\n\t if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n\t }\n\t\n\t leadSurrogate = null\n\t\n\t // encode utf8\n\t if (codePoint < 0x80) {\n\t if ((units -= 1) < 0) break\n\t bytes.push(codePoint)\n\t } else if (codePoint < 0x800) {\n\t if ((units -= 2) < 0) break\n\t bytes.push(\n\t codePoint >> 0x6 | 0xC0,\n\t codePoint & 0x3F | 0x80\n\t )\n\t } else if (codePoint < 0x10000) {\n\t if ((units -= 3) < 0) break\n\t bytes.push(\n\t codePoint >> 0xC | 0xE0,\n\t codePoint >> 0x6 & 0x3F | 0x80,\n\t codePoint & 0x3F | 0x80\n\t )\n\t } else if (codePoint < 0x110000) {\n\t if ((units -= 4) < 0) break\n\t bytes.push(\n\t codePoint >> 0x12 | 0xF0,\n\t codePoint >> 0xC & 0x3F | 0x80,\n\t codePoint >> 0x6 & 0x3F | 0x80,\n\t codePoint & 0x3F | 0x80\n\t )\n\t } else {\n\t throw new Error('Invalid code point')\n\t }\n\t }\n\t\n\t return bytes\n\t}\n\t\n\tfunction asciiToBytes (str) {\n\t var byteArray = []\n\t for (var i = 0; i < str.length; ++i) {\n\t // Node's code seems to be doing this and not & 0x7F..\n\t byteArray.push(str.charCodeAt(i) & 0xFF)\n\t }\n\t return byteArray\n\t}\n\t\n\tfunction utf16leToBytes (str, units) {\n\t var c, hi, lo\n\t var byteArray = []\n\t for (var i = 0; i < str.length; ++i) {\n\t if ((units -= 2) < 0) break\n\t\n\t c = str.charCodeAt(i)\n\t hi = c >> 8\n\t lo = c % 256\n\t byteArray.push(lo)\n\t byteArray.push(hi)\n\t }\n\t\n\t return byteArray\n\t}\n\t\n\tfunction base64ToBytes (str) {\n\t return base64.toByteArray(base64clean(str))\n\t}\n\t\n\tfunction blitBuffer (src, dst, offset, length) {\n\t for (var i = 0; i < length; ++i) {\n\t if ((i + offset >= dst.length) || (i >= src.length)) break\n\t dst[i + offset] = src[i]\n\t }\n\t return i\n\t}\n\t\n\tfunction isnan (val) {\n\t return val !== val // eslint-disable-line no-self-compare\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar Buffer = __webpack_require__(1).Buffer;\n\tvar intSize = 4;\n\tvar zeroBuffer = new Buffer(intSize); zeroBuffer.fill(0);\n\tvar chrsz = 8;\n\t\n\tfunction toArray(buf, bigEndian) {\n\t if ((buf.length % intSize) !== 0) {\n\t var len = buf.length + (intSize - (buf.length % intSize));\n\t buf = Buffer.concat([buf, zeroBuffer], len);\n\t }\n\t\n\t var arr = [];\n\t var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE;\n\t for (var i = 0; i < buf.length; i += intSize) {\n\t arr.push(fn.call(buf, i));\n\t }\n\t return arr;\n\t}\n\t\n\tfunction toBuffer(arr, size, bigEndian) {\n\t var buf = new Buffer(size);\n\t var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE;\n\t for (var i = 0; i < arr.length; i++) {\n\t fn.call(buf, arr[i], i * 4, true);\n\t }\n\t return buf;\n\t}\n\t\n\tfunction hash(buf, fn, hashSize, bigEndian) {\n\t if (!Buffer.isBuffer(buf)) buf = new Buffer(buf);\n\t var arr = fn(toArray(buf, bigEndian), buf.length * chrsz);\n\t return toBuffer(arr, hashSize, bigEndian);\n\t}\n\t\n\tmodule.exports = { hash: hash };\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _buffer = __webpack_require__(1);\n\t\n\tvar _cryptoBrowserify = __webpack_require__(14);\n\t\n\tvar crypto = _interopRequireWildcard(_cryptoBrowserify);\n\t\n\tvar _BigInteger = __webpack_require__(4);\n\t\n\tvar _BigInteger2 = _interopRequireDefault(_BigInteger);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } /*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\tvar createHash = crypto.createHash;\n\tvar createHmac = crypto.createHmac;\n\tvar randomBytes = crypto.randomBytes;\n\t\n\tvar initN = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1' + '29024E088A67CC74020BBEA63B139B22514A08798E3404DD' + 'EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245' + 'E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' + 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D' + 'C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F' + '83655D23DCA3AD961C62F356208552BB9ED529077096966D' + '670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B' + 'E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9' + 'DE2BCBF6955817183995497CEA956AE515D2261898FA0510' + '15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64' + 'ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7' + 'ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B' + 'F12FFA06D98A0864D87602733EC86A64521F2B18177B200C' + 'BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31' + '43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF';\n\t\n\tvar newPasswordRequiredChallengeUserAttributePrefix = 'userAttributes.';\n\t\n\t/** @class */\n\t\n\tvar AuthenticationHelper = function () {\n\t /**\n\t * Constructs a new AuthenticationHelper object\n\t * @param {string} PoolName Cognito user pool name.\n\t */\n\t function AuthenticationHelper(PoolName) {\n\t _classCallCheck(this, AuthenticationHelper);\n\t\n\t this.N = new _BigInteger2.default(initN, 16);\n\t this.g = new _BigInteger2.default('2', 16);\n\t this.k = new _BigInteger2.default(this.hexHash('00' + this.N.toString(16) + '0' + this.g.toString(16)), 16);\n\t\n\t this.smallAValue = this.generateRandomSmallA();\n\t this.getLargeAValue(function () {});\n\t\n\t this.infoBits = _buffer.Buffer.from('Caldera Derived Key', 'utf8');\n\t\n\t this.poolName = PoolName;\n\t }\n\t\n\t /**\n\t * @returns {BigInteger} small A, a random number\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.getSmallAValue = function getSmallAValue() {\n\t return this.smallAValue;\n\t };\n\t\n\t /**\n\t * @param {nodeCallback} callback Called with (err, largeAValue)\n\t * @returns {void}\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.getLargeAValue = function getLargeAValue(callback) {\n\t var _this = this;\n\t\n\t if (this.largeAValue) {\n\t callback(null, this.largeAValue);\n\t } else {\n\t this.calculateA(this.smallAValue, function (err, largeAValue) {\n\t if (err) {\n\t callback(err, null);\n\t }\n\t\n\t _this.largeAValue = largeAValue;\n\t callback(null, _this.largeAValue);\n\t });\n\t }\n\t };\n\t\n\t /**\n\t * helper function to generate a random big integer\n\t * @returns {BigInteger} a random value.\n\t * @private\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.generateRandomSmallA = function generateRandomSmallA() {\n\t var hexRandom = randomBytes(128).toString('hex');\n\t\n\t var randomBigInt = new _BigInteger2.default(hexRandom, 16);\n\t var smallABigInt = randomBigInt.mod(this.N);\n\t\n\t return smallABigInt;\n\t };\n\t\n\t /**\n\t * helper function to generate a random string\n\t * @returns {string} a random value.\n\t * @private\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.generateRandomString = function generateRandomString() {\n\t return randomBytes(40).toString('base64');\n\t };\n\t\n\t /**\n\t * @returns {string} Generated random value included in password hash.\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.getRandomPassword = function getRandomPassword() {\n\t return this.randomPassword;\n\t };\n\t\n\t /**\n\t * @returns {string} Generated random value included in devices hash.\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.getSaltDevices = function getSaltDevices() {\n\t return this.SaltToHashDevices;\n\t };\n\t\n\t /**\n\t * @returns {string} Value used to verify devices.\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.getVerifierDevices = function getVerifierDevices() {\n\t return this.verifierDevices;\n\t };\n\t\n\t /**\n\t * Generate salts and compute verifier.\n\t * @param {string} deviceGroupKey Devices to generate verifier for.\n\t * @param {string} username User to generate verifier for.\n\t * @param {nodeCallback} callback Called with (err, null)\n\t * @returns {void}\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.generateHashDevice = function generateHashDevice(deviceGroupKey, username, callback) {\n\t var _this2 = this;\n\t\n\t this.randomPassword = this.generateRandomString();\n\t var combinedString = '' + deviceGroupKey + username + ':' + this.randomPassword;\n\t var hashedString = this.hash(combinedString);\n\t\n\t var hexRandom = randomBytes(16).toString('hex');\n\t this.SaltToHashDevices = this.padHex(new _BigInteger2.default(hexRandom, 16));\n\t\n\t this.g.modPow(new _BigInteger2.default(this.hexHash(this.SaltToHashDevices + hashedString), 16), this.N, function (err, verifierDevicesNotPadded) {\n\t if (err) {\n\t callback(err, null);\n\t }\n\t\n\t _this2.verifierDevices = _this2.padHex(verifierDevicesNotPadded);\n\t callback(null, null);\n\t });\n\t };\n\t\n\t /**\n\t * Calculate the client's public value A = g^a%N\n\t * with the generated random number a\n\t * @param {BigInteger} a Randomly generated small A.\n\t * @param {nodeCallback} callback Called with (err, largeAValue)\n\t * @returns {void}\n\t * @private\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.calculateA = function calculateA(a, callback) {\n\t var _this3 = this;\n\t\n\t this.g.modPow(a, this.N, function (err, A) {\n\t if (err) {\n\t callback(err, null);\n\t }\n\t\n\t if (A.mod(_this3.N).equals(_BigInteger2.default.ZERO)) {\n\t callback(new Error('Illegal paramater. A mod N cannot be 0.'), null);\n\t }\n\t\n\t callback(null, A);\n\t });\n\t };\n\t\n\t /**\n\t * Calculate the client's value U which is the hash of A and B\n\t * @param {BigInteger} A Large A value.\n\t * @param {BigInteger} B Server B value.\n\t * @returns {BigInteger} Computed U value.\n\t * @private\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.calculateU = function calculateU(A, B) {\n\t this.UHexHash = this.hexHash(this.padHex(A) + this.padHex(B));\n\t var finalU = new _BigInteger2.default(this.UHexHash, 16);\n\t\n\t return finalU;\n\t };\n\t\n\t /**\n\t * Calculate a hash from a bitArray\n\t * @param {Buffer} buf Value to hash.\n\t * @returns {String} Hex-encoded hash.\n\t * @private\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.hash = function hash(buf) {\n\t var hashHex = createHash('sha256').update(buf).digest('hex');\n\t return new Array(64 - hashHex.length).join('0') + hashHex;\n\t };\n\t\n\t /**\n\t * Calculate a hash from a hex string\n\t * @param {String} hexStr Value to hash.\n\t * @returns {String} Hex-encoded hash.\n\t * @private\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.hexHash = function hexHash(hexStr) {\n\t return this.hash(_buffer.Buffer.from(hexStr, 'hex'));\n\t };\n\t\n\t /**\n\t * Standard hkdf algorithm\n\t * @param {Buffer} ikm Input key material.\n\t * @param {Buffer} salt Salt value.\n\t * @returns {Buffer} Strong key material.\n\t * @private\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.computehkdf = function computehkdf(ikm, salt) {\n\t var prk = createHmac('sha256', salt).update(ikm).digest();\n\t var infoBitsUpdate = _buffer.Buffer.concat([this.infoBits, _buffer.Buffer.from(String.fromCharCode(1), 'utf8')]);\n\t var hmac = createHmac('sha256', prk).update(infoBitsUpdate).digest();\n\t return hmac.slice(0, 16);\n\t };\n\t\n\t /**\n\t * Calculates the final hkdf based on computed S value, and computed U value and the key\n\t * @param {String} username Username.\n\t * @param {String} password Password.\n\t * @param {BigInteger} serverBValue Server B value.\n\t * @param {BigInteger} salt Generated salt.\n\t * @param {nodeCallback} callback Called with (err, hkdfValue)\n\t * @returns {void}\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.getPasswordAuthenticationKey = function getPasswordAuthenticationKey(username, password, serverBValue, salt, callback) {\n\t var _this4 = this;\n\t\n\t if (serverBValue.mod(this.N).equals(_BigInteger2.default.ZERO)) {\n\t throw new Error('B cannot be zero.');\n\t }\n\t\n\t this.UValue = this.calculateU(this.largeAValue, serverBValue);\n\t\n\t if (this.UValue.equals(_BigInteger2.default.ZERO)) {\n\t throw new Error('U cannot be zero.');\n\t }\n\t\n\t var usernamePassword = '' + this.poolName + username + ':' + password;\n\t var usernamePasswordHash = this.hash(usernamePassword);\n\t\n\t var xValue = new _BigInteger2.default(this.hexHash(this.padHex(salt) + usernamePasswordHash), 16);\n\t this.calculateS(xValue, serverBValue, function (err, sValue) {\n\t if (err) {\n\t callback(err, null);\n\t }\n\t\n\t var hkdf = _this4.computehkdf(_buffer.Buffer.from(_this4.padHex(sValue), 'hex'), _buffer.Buffer.from(_this4.padHex(_this4.UValue.toString(16)), 'hex'));\n\t\n\t callback(null, hkdf);\n\t });\n\t };\n\t\n\t /**\n\t * Calculates the S value used in getPasswordAuthenticationKey\n\t * @param {BigInteger} xValue Salted password hash value.\n\t * @param {BigInteger} serverBValue Server B value.\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.calculateS = function calculateS(xValue, serverBValue, callback) {\n\t var _this5 = this;\n\t\n\t this.g.modPow(xValue, this.N, function (err, gModPowXN) {\n\t if (err) {\n\t callback(err, null);\n\t }\n\t\n\t var intValue2 = serverBValue.subtract(_this5.k.multiply(gModPowXN));\n\t intValue2.modPow(_this5.smallAValue.add(_this5.UValue.multiply(xValue)), _this5.N, function (err2, result) {\n\t if (err2) {\n\t callback(err2, null);\n\t }\n\t\n\t callback(null, result.mod(_this5.N));\n\t });\n\t });\n\t };\n\t\n\t /**\n\t * Return constant newPasswordRequiredChallengeUserAttributePrefix\n\t * @return {newPasswordRequiredChallengeUserAttributePrefix} constant prefix value\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.getNewPasswordRequiredChallengeUserAttributePrefix = function getNewPasswordRequiredChallengeUserAttributePrefix() {\n\t return newPasswordRequiredChallengeUserAttributePrefix;\n\t };\n\t\n\t /**\n\t * Converts a BigInteger (or hex string) to hex format padded with zeroes for hashing\n\t * @param {BigInteger|String} bigInt Number or string to pad.\n\t * @returns {String} Padded hex string.\n\t */\n\t\n\t\n\t AuthenticationHelper.prototype.padHex = function padHex(bigInt) {\n\t var hashStr = bigInt.toString(16);\n\t if (hashStr.length % 2 === 1) {\n\t hashStr = '0' + hashStr;\n\t } else if ('89ABCDEFabcdef'.indexOf(hashStr[0]) !== -1) {\n\t hashStr = '00' + hashStr;\n\t }\n\t return hashStr;\n\t };\n\t\n\t return AuthenticationHelper;\n\t}();\n\t\n\texports.default = AuthenticationHelper;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\n\t\"use strict\";\n\t\n\texports.__esModule = true;\n\t// A small implementation of BigInteger based on http://www-cs-students.stanford.edu/~tjw/jsbn/\n\t//\n\t// All public methods have been removed except the following:\n\t// new BigInteger(a, b) (only radix 2, 4, 8, 16 and 32 supported)\n\t// toString (only radix 2, 4, 8, 16 and 32 supported)\n\t// negate\n\t// abs\n\t// compareTo\n\t// bitLength\n\t// mod\n\t// equals\n\t// add\n\t// subtract\n\t// multiply\n\t// divide\n\t// modPow\n\t\n\texports.default = BigInteger;\n\t\n\t/*\n\t * Copyright (c) 2003-2005 Tom Wu\n\t * All Rights Reserved.\n\t *\n\t * Permission is hereby granted, free of charge, to any person obtaining\n\t * a copy of this software and associated documentation files (the\n\t * \"Software\"), to deal in the Software without restriction, including\n\t * without limitation the rights to use, copy, modify, merge, publish,\n\t * distribute, sublicense, and/or sell copies of the Software, and to\n\t * permit persons to whom the Software is furnished to do so, subject to\n\t * the following conditions:\n\t *\n\t * The above copyright notice and this permission notice shall be\n\t * included in all copies or substantial portions of the Software.\n\t *\n\t * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND,\n\t * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\n\t * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n\t *\n\t * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,\n\t * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER\n\t * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF\n\t * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT\n\t * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\t *\n\t * In addition, the following condition applies:\n\t *\n\t * All redistributions must retain an intact copy of this copyright notice\n\t * and disclaimer.\n\t */\n\t\n\t// (public) Constructor\n\t\n\tfunction BigInteger(a, b) {\n\t if (a != null) this.fromString(a, b);\n\t}\n\t\n\t// return new, unset BigInteger\n\tfunction nbi() {\n\t return new BigInteger(null);\n\t}\n\t\n\t// Bits per digit\n\tvar dbits;\n\t\n\t// JavaScript engine analysis\n\tvar canary = 0xdeadbeefcafe;\n\tvar j_lm = (canary & 0xffffff) == 0xefcafe;\n\t\n\t// am: Compute w_j += (x*this_i), propagate carries,\n\t// c is initial carry, returns final carry.\n\t// c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n\t// We need to select the fastest one that works in this environment.\n\t\n\t// am1: use a single mult and divide to get the high bits,\n\t// max digit bits should be 26 because\n\t// max internal value = 2*dvalue^2-2*dvalue (< 2^53)\n\tfunction am1(i, x, w, j, c, n) {\n\t while (--n >= 0) {\n\t var v = x * this[i++] + w[j] + c;\n\t c = Math.floor(v / 0x4000000);\n\t w[j++] = v & 0x3ffffff;\n\t }\n\t return c;\n\t}\n\t// am2 avoids a big mult-and-extract completely.\n\t// Max digit bits should be <= 30 because we do bitwise ops\n\t// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\n\tfunction am2(i, x, w, j, c, n) {\n\t var xl = x & 0x7fff,\n\t xh = x >> 15;\n\t while (--n >= 0) {\n\t var l = this[i] & 0x7fff;\n\t var h = this[i++] >> 15;\n\t var m = xh * l + h * xl;\n\t l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n\t c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n\t w[j++] = l & 0x3fffffff;\n\t }\n\t return c;\n\t}\n\t// Alternately, set max digit bits to 28 since some\n\t// browsers slow down when dealing with 32-bit numbers.\n\tfunction am3(i, x, w, j, c, n) {\n\t var xl = x & 0x3fff,\n\t xh = x >> 14;\n\t while (--n >= 0) {\n\t var l = this[i] & 0x3fff;\n\t var h = this[i++] >> 14;\n\t var m = xh * l + h * xl;\n\t l = xl * l + ((m & 0x3fff) << 14) + w[j] + c;\n\t c = (l >> 28) + (m >> 14) + xh * h;\n\t w[j++] = l & 0xfffffff;\n\t }\n\t return c;\n\t}\n\tvar inBrowser = typeof navigator !== \"undefined\";\n\tif (inBrowser && j_lm && navigator.appName == \"Microsoft Internet Explorer\") {\n\t BigInteger.prototype.am = am2;\n\t dbits = 30;\n\t} else if (inBrowser && j_lm && navigator.appName != \"Netscape\") {\n\t BigInteger.prototype.am = am1;\n\t dbits = 26;\n\t} else {\n\t // Mozilla/Netscape seems to prefer am3\n\t BigInteger.prototype.am = am3;\n\t dbits = 28;\n\t}\n\t\n\tBigInteger.prototype.DB = dbits;\n\tBigInteger.prototype.DM = (1 << dbits) - 1;\n\tBigInteger.prototype.DV = 1 << dbits;\n\t\n\tvar BI_FP = 52;\n\tBigInteger.prototype.FV = Math.pow(2, BI_FP);\n\tBigInteger.prototype.F1 = BI_FP - dbits;\n\tBigInteger.prototype.F2 = 2 * dbits - BI_FP;\n\t\n\t// Digit conversions\n\tvar BI_RM = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n\tvar BI_RC = new Array();\n\tvar rr, vv;\n\trr = \"0\".charCodeAt(0);\n\tfor (vv = 0; vv <= 9; ++vv) {\n\t BI_RC[rr++] = vv;\n\t}rr = \"a\".charCodeAt(0);\n\tfor (vv = 10; vv < 36; ++vv) {\n\t BI_RC[rr++] = vv;\n\t}rr = \"A\".charCodeAt(0);\n\tfor (vv = 10; vv < 36; ++vv) {\n\t BI_RC[rr++] = vv;\n\t}function int2char(n) {\n\t return BI_RM.charAt(n);\n\t}\n\tfunction intAt(s, i) {\n\t var c = BI_RC[s.charCodeAt(i)];\n\t return c == null ? -1 : c;\n\t}\n\t\n\t// (protected) copy this to r\n\tfunction bnpCopyTo(r) {\n\t for (var i = this.t - 1; i >= 0; --i) {\n\t r[i] = this[i];\n\t }r.t = this.t;\n\t r.s = this.s;\n\t}\n\t\n\t// (protected) set from integer value x, -DV <= x < DV\n\tfunction bnpFromInt(x) {\n\t this.t = 1;\n\t this.s = x < 0 ? -1 : 0;\n\t if (x > 0) this[0] = x;else if (x < -1) this[0] = x + this.DV;else this.t = 0;\n\t}\n\t\n\t// return bigint initialized to value\n\tfunction nbv(i) {\n\t var r = nbi();\n\t\n\t r.fromInt(i);\n\t\n\t return r;\n\t}\n\t\n\t// (protected) set from string and radix\n\tfunction bnpFromString(s, b) {\n\t var k;\n\t if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else throw new Error(\"Only radix 2, 4, 8, 16, 32 are supported\");\n\t this.t = 0;\n\t this.s = 0;\n\t var i = s.length,\n\t mi = false,\n\t sh = 0;\n\t while (--i >= 0) {\n\t var x = intAt(s, i);\n\t if (x < 0) {\n\t if (s.charAt(i) == \"-\") mi = true;\n\t continue;\n\t }\n\t mi = false;\n\t if (sh == 0) this[this.t++] = x;else if (sh + k > this.DB) {\n\t this[this.t - 1] |= (x & (1 << this.DB - sh) - 1) << sh;\n\t this[this.t++] = x >> this.DB - sh;\n\t } else this[this.t - 1] |= x << sh;\n\t sh += k;\n\t if (sh >= this.DB) sh -= this.DB;\n\t }\n\t this.clamp();\n\t if (mi) BigInteger.ZERO.subTo(this, this);\n\t}\n\t\n\t// (protected) clamp off excess high words\n\tfunction bnpClamp() {\n\t var c = this.s & this.DM;\n\t while (this.t > 0 && this[this.t - 1] == c) {\n\t --this.t;\n\t }\n\t}\n\t\n\t// (public) return string representation in given radix\n\tfunction bnToString(b) {\n\t if (this.s < 0) return \"-\" + this.negate().toString();\n\t var k;\n\t if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else throw new Error(\"Only radix 2, 4, 8, 16, 32 are supported\");\n\t var km = (1 << k) - 1,\n\t d,\n\t m = false,\n\t r = \"\",\n\t i = this.t;\n\t var p = this.DB - i * this.DB % k;\n\t if (i-- > 0) {\n\t if (p < this.DB && (d = this[i] >> p) > 0) {\n\t m = true;\n\t r = int2char(d);\n\t }\n\t while (i >= 0) {\n\t if (p < k) {\n\t d = (this[i] & (1 << p) - 1) << k - p;\n\t d |= this[--i] >> (p += this.DB - k);\n\t } else {\n\t d = this[i] >> (p -= k) & km;\n\t if (p <= 0) {\n\t p += this.DB;\n\t --i;\n\t }\n\t }\n\t if (d > 0) m = true;\n\t if (m) r += int2char(d);\n\t }\n\t }\n\t return m ? r : \"0\";\n\t}\n\t\n\t// (public) -this\n\tfunction bnNegate() {\n\t var r = nbi();\n\t\n\t BigInteger.ZERO.subTo(this, r);\n\t\n\t return r;\n\t}\n\t\n\t// (public) |this|\n\tfunction bnAbs() {\n\t return this.s < 0 ? this.negate() : this;\n\t}\n\t\n\t// (public) return + if this > a, - if this < a, 0 if equal\n\tfunction bnCompareTo(a) {\n\t var r = this.s - a.s;\n\t if (r != 0) return r;\n\t var i = this.t;\n\t r = i - a.t;\n\t if (r != 0) return this.s < 0 ? -r : r;\n\t while (--i >= 0) {\n\t if ((r = this[i] - a[i]) != 0) return r;\n\t }return 0;\n\t}\n\t\n\t// returns bit length of the integer x\n\tfunction nbits(x) {\n\t var r = 1,\n\t t;\n\t if ((t = x >>> 16) != 0) {\n\t x = t;\n\t r += 16;\n\t }\n\t if ((t = x >> 8) != 0) {\n\t x = t;\n\t r += 8;\n\t }\n\t if ((t = x >> 4) != 0) {\n\t x = t;\n\t r += 4;\n\t }\n\t if ((t = x >> 2) != 0) {\n\t x = t;\n\t r += 2;\n\t }\n\t if ((t = x >> 1) != 0) {\n\t x = t;\n\t r += 1;\n\t }\n\t return r;\n\t}\n\t\n\t// (public) return the number of bits in \"this\"\n\tfunction bnBitLength() {\n\t if (this.t <= 0) return 0;\n\t return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n\t}\n\t\n\t// (protected) r = this << n*DB\n\tfunction bnpDLShiftTo(n, r) {\n\t var i;\n\t for (i = this.t - 1; i >= 0; --i) {\n\t r[i + n] = this[i];\n\t }for (i = n - 1; i >= 0; --i) {\n\t r[i] = 0;\n\t }r.t = this.t + n;\n\t r.s = this.s;\n\t}\n\t\n\t// (protected) r = this >> n*DB\n\tfunction bnpDRShiftTo(n, r) {\n\t for (var i = n; i < this.t; ++i) {\n\t r[i - n] = this[i];\n\t }r.t = Math.max(this.t - n, 0);\n\t r.s = this.s;\n\t}\n\t\n\t// (protected) r = this << n\n\tfunction bnpLShiftTo(n, r) {\n\t var bs = n % this.DB;\n\t var cbs = this.DB - bs;\n\t var bm = (1 << cbs) - 1;\n\t var ds = Math.floor(n / this.DB),\n\t c = this.s << bs & this.DM,\n\t i;\n\t for (i = this.t - 1; i >= 0; --i) {\n\t r[i + ds + 1] = this[i] >> cbs | c;\n\t c = (this[i] & bm) << bs;\n\t }\n\t for (i = ds - 1; i >= 0; --i) {\n\t r[i] = 0;\n\t }r[ds] = c;\n\t r.t = this.t + ds + 1;\n\t r.s = this.s;\n\t r.clamp();\n\t}\n\t\n\t// (protected) r = this >> n\n\tfunction bnpRShiftTo(n, r) {\n\t r.s = this.s;\n\t var ds = Math.floor(n / this.DB);\n\t if (ds >= this.t) {\n\t r.t = 0;\n\t return;\n\t }\n\t var bs = n % this.DB;\n\t var cbs = this.DB - bs;\n\t var bm = (1 << bs) - 1;\n\t r[0] = this[ds] >> bs;\n\t for (var i = ds + 1; i < this.t; ++i) {\n\t r[i - ds - 1] |= (this[i] & bm) << cbs;\n\t r[i - ds] = this[i] >> bs;\n\t }\n\t if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n\t r.t = this.t - ds;\n\t r.clamp();\n\t}\n\t\n\t// (protected) r = this - a\n\tfunction bnpSubTo(a, r) {\n\t var i = 0,\n\t c = 0,\n\t m = Math.min(a.t, this.t);\n\t while (i < m) {\n\t c += this[i] - a[i];\n\t r[i++] = c & this.DM;\n\t c >>= this.DB;\n\t }\n\t if (a.t < this.t) {\n\t c -= a.s;\n\t while (i < this.t) {\n\t c += this[i];\n\t r[i++] = c & this.DM;\n\t c >>= this.DB;\n\t }\n\t c += this.s;\n\t } else {\n\t c += this.s;\n\t while (i < a.t) {\n\t c -= a[i];\n\t r[i++] = c & this.DM;\n\t c >>= this.DB;\n\t }\n\t c -= a.s;\n\t }\n\t r.s = c < 0 ? -1 : 0;\n\t if (c < -1) r[i++] = this.DV + c;else if (c > 0) r[i++] = c;\n\t r.t = i;\n\t r.clamp();\n\t}\n\t\n\t// (protected) r = this * a, r != this,a (HAC 14.12)\n\t// \"this\" should be the larger one if appropriate.\n\tfunction bnpMultiplyTo(a, r) {\n\t var x = this.abs(),\n\t y = a.abs();\n\t var i = x.t;\n\t r.t = i + y.t;\n\t while (--i >= 0) {\n\t r[i] = 0;\n\t }for (i = 0; i < y.t; ++i) {\n\t r[i + x.t] = x.am(0, y[i], r, i, 0, x.t);\n\t }r.s = 0;\n\t r.clamp();\n\t if (this.s != a.s) BigInteger.ZERO.subTo(r, r);\n\t}\n\t\n\t// (protected) r = this^2, r != this (HAC 14.16)\n\tfunction bnpSquareTo(r) {\n\t var x = this.abs();\n\t var i = r.t = 2 * x.t;\n\t while (--i >= 0) {\n\t r[i] = 0;\n\t }for (i = 0; i < x.t - 1; ++i) {\n\t var c = x.am(i, x[i], r, 2 * i, 0, 1);\n\t if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) {\n\t r[i + x.t] -= x.DV;\n\t r[i + x.t + 1] = 1;\n\t }\n\t }\n\t if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1);\n\t r.s = 0;\n\t r.clamp();\n\t}\n\t\n\t// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n\t// r != q, this != m. q or r may be null.\n\tfunction bnpDivRemTo(m, q, r) {\n\t var pm = m.abs();\n\t if (pm.t <= 0) return;\n\t var pt = this.abs();\n\t if (pt.t < pm.t) {\n\t if (q != null) q.fromInt(0);\n\t if (r != null) this.copyTo(r);\n\t return;\n\t }\n\t if (r == null) r = nbi();\n\t var y = nbi(),\n\t ts = this.s,\n\t ms = m.s;\n\t var nsh = this.DB - nbits(pm[pm.t - 1]);\n\t // normalize modulus\n\t if (nsh > 0) {\n\t pm.lShiftTo(nsh, y);\n\t pt.lShiftTo(nsh, r);\n\t } else {\n\t pm.copyTo(y);\n\t pt.copyTo(r);\n\t }\n\t var ys = y.t;\n\t var y0 = y[ys - 1];\n\t if (y0 == 0) return;\n\t var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n\t var d1 = this.FV / yt,\n\t d2 = (1 << this.F1) / yt,\n\t e = 1 << this.F2;\n\t var i = r.t,\n\t j = i - ys,\n\t t = q == null ? nbi() : q;\n\t y.dlShiftTo(j, t);\n\t if (r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t, r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys, t);\n\t t.subTo(y, y);\n\t // \"negative\" y so we can replace sub with am later\n\t while (y.t < ys) {\n\t y[y.t++] = 0;\n\t }while (--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n\t if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n\t // Try it out\n\t y.dlShiftTo(j, t);\n\t r.subTo(t, r);\n\t while (r[i] < --qd) {\n\t r.subTo(t, r);\n\t }\n\t }\n\t }\n\t if (q != null) {\n\t r.drShiftTo(ys, q);\n\t if (ts != ms) BigInteger.ZERO.subTo(q, q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if (nsh > 0) r.rShiftTo(nsh, r);\n\t // Denormalize remainder\n\t if (ts < 0) BigInteger.ZERO.subTo(r, r);\n\t}\n\t\n\t// (public) this mod a\n\tfunction bnMod(a) {\n\t var r = nbi();\n\t this.abs().divRemTo(a, null, r);\n\t if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r);\n\t return r;\n\t}\n\t\n\t// (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n\t// justification:\n\t// xy == 1 (mod m)\n\t// xy = 1+km\n\t// xy(2-xy) = (1+km)(1-km)\n\t// x[y(2-xy)] = 1-k^2m^2\n\t// x[y(2-xy)] == 1 (mod m^2)\n\t// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n\t// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n\t// JS multiply \"overflows\" differently from C/C++, so care is needed here.\n\tfunction bnpInvDigit() {\n\t if (this.t < 1) return 0;\n\t var x = this[0];\n\t if ((x & 1) == 0) return 0;\n\t var y = x & 3;\n\t // y == 1/x mod 2^2\n\t y = y * (2 - (x & 0xf) * y) & 0xf;\n\t // y == 1/x mod 2^4\n\t y = y * (2 - (x & 0xff) * y) & 0xff;\n\t // y == 1/x mod 2^8\n\t y = y * (2 - ((x & 0xffff) * y & 0xffff)) & 0xffff;\n\t // y == 1/x mod 2^16\n\t // last step - calculate inverse mod DV directly;\n\t // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n\t y = y * (2 - x * y % this.DV) % this.DV;\n\t // y == 1/x mod 2^dbits\n\t // we really want the negative inverse, and -DV < y < DV\n\t return y > 0 ? this.DV - y : -y;\n\t}\n\t\n\tfunction bnEquals(a) {\n\t return this.compareTo(a) == 0;\n\t}\n\t\n\t// (protected) r = this + a\n\tfunction bnpAddTo(a, r) {\n\t var i = 0,\n\t c = 0,\n\t m = Math.min(a.t, this.t);\n\t while (i < m) {\n\t c += this[i] + a[i];\n\t r[i++] = c & this.DM;\n\t c >>= this.DB;\n\t }\n\t if (a.t < this.t) {\n\t c += a.s;\n\t while (i < this.t) {\n\t c += this[i];\n\t r[i++] = c & this.DM;\n\t c >>= this.DB;\n\t }\n\t c += this.s;\n\t } else {\n\t c += this.s;\n\t while (i < a.t) {\n\t c += a[i];\n\t r[i++] = c & this.DM;\n\t c >>= this.DB;\n\t }\n\t c += a.s;\n\t }\n\t r.s = c < 0 ? -1 : 0;\n\t if (c > 0) r[i++] = c;else if (c < -1) r[i++] = this.DV + c;\n\t r.t = i;\n\t r.clamp();\n\t}\n\t\n\t// (public) this + a\n\tfunction bnAdd(a) {\n\t var r = nbi();\n\t\n\t this.addTo(a, r);\n\t\n\t return r;\n\t}\n\t\n\t// (public) this - a\n\tfunction bnSubtract(a) {\n\t var r = nbi();\n\t\n\t this.subTo(a, r);\n\t\n\t return r;\n\t}\n\t\n\t// (public) this * a\n\tfunction bnMultiply(a) {\n\t var r = nbi();\n\t\n\t this.multiplyTo(a, r);\n\t\n\t return r;\n\t}\n\t\n\t// (public) this / a\n\tfunction bnDivide(a) {\n\t var r = nbi();\n\t\n\t this.divRemTo(a, r, null);\n\t\n\t return r;\n\t}\n\t\n\t// Montgomery reduction\n\tfunction Montgomery(m) {\n\t this.m = m;\n\t this.mp = m.invDigit();\n\t this.mpl = this.mp & 0x7fff;\n\t this.mph = this.mp >> 15;\n\t this.um = (1 << m.DB - 15) - 1;\n\t this.mt2 = 2 * m.t;\n\t}\n\t\n\t// xR mod m\n\tfunction montConvert(x) {\n\t var r = nbi();\n\t x.abs().dlShiftTo(this.m.t, r);\n\t r.divRemTo(this.m, null, r);\n\t if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r);\n\t return r;\n\t}\n\t\n\t// x/R mod m\n\tfunction montRevert(x) {\n\t var r = nbi();\n\t x.copyTo(r);\n\t this.reduce(r);\n\t return r;\n\t}\n\t\n\t// x = x/R mod m (HAC 14.32)\n\tfunction montReduce(x) {\n\t while (x.t <= this.mt2) {\n\t // pad x so am has enough room later\n\t x[x.t++] = 0;\n\t }for (var i = 0; i < this.m.t; ++i) {\n\t // faster way of calculating u0 = x[i]*mp mod DV\n\t var j = x[i] & 0x7fff;\n\t var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM;\n\t // use am to combine the multiply-shift-add into one call\n\t j = i + this.m.t;\n\t x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n\t // propagate carry\n\t while (x[j] >= x.DV) {\n\t x[j] -= x.DV;\n\t x[++j]++;\n\t }\n\t }\n\t x.clamp();\n\t x.drShiftTo(this.m.t, x);\n\t if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n\t}\n\t\n\t// r = \"x^2/R mod m\"; x != r\n\tfunction montSqrTo(x, r) {\n\t x.squareTo(r);\n\t\n\t this.reduce(r);\n\t}\n\t\n\t// r = \"xy/R mod m\"; x,y != r\n\tfunction montMulTo(x, y, r) {\n\t x.multiplyTo(y, r);\n\t\n\t this.reduce(r);\n\t}\n\t\n\tMontgomery.prototype.convert = montConvert;\n\tMontgomery.prototype.revert = montRevert;\n\tMontgomery.prototype.reduce = montReduce;\n\tMontgomery.prototype.mulTo = montMulTo;\n\tMontgomery.prototype.sqrTo = montSqrTo;\n\t\n\t// (public) this^e % m (HAC 14.85)\n\tfunction bnModPow(e, m, callback) {\n\t var i = e.bitLength(),\n\t k,\n\t r = nbv(1),\n\t z = new Montgomery(m);\n\t if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6;\n\t\n\t // precomputation\n\t var g = new Array(),\n\t n = 3,\n\t k1 = k - 1,\n\t km = (1 << k) - 1;\n\t g[1] = z.convert(this);\n\t if (k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1], g2);\n\t while (n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2, g[n - 2], g[n]);\n\t n += 2;\n\t }\n\t }\n\t\n\t var j = e.t - 1,\n\t w,\n\t is1 = true,\n\t r2 = nbi(),\n\t t;\n\t i = nbits(e[j]) - 1;\n\t while (j >= 0) {\n\t if (i >= k1) w = e[j] >> i - k1 & km;else {\n\t w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n\t if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n\t }\n\t\n\t n = k;\n\t while ((w & 1) == 0) {\n\t w >>= 1;\n\t --n;\n\t }\n\t if ((i -= n) < 0) {\n\t i += this.DB;\n\t --j;\n\t }\n\t if (is1) {\n\t // ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t } else {\n\t while (n > 1) {\n\t z.sqrTo(r, r2);\n\t z.sqrTo(r2, r);\n\t n -= 2;\n\t }\n\t if (n > 0) z.sqrTo(r, r2);else {\n\t t = r;\n\t r = r2;\n\t r2 = t;\n\t }\n\t z.mulTo(r2, g[w], r);\n\t }\n\t\n\t while (j >= 0 && (e[j] & 1 << i) == 0) {\n\t z.sqrTo(r, r2);\n\t t = r;\n\t r = r2;\n\t r2 = t;\n\t if (--i < 0) {\n\t i = this.DB - 1;\n\t --j;\n\t }\n\t }\n\t }\n\t var result = z.revert(r);\n\t callback(null, result);\n\t return result;\n\t}\n\t\n\t// protected\n\tBigInteger.prototype.copyTo = bnpCopyTo;\n\tBigInteger.prototype.fromInt = bnpFromInt;\n\tBigInteger.prototype.fromString = bnpFromString;\n\tBigInteger.prototype.clamp = bnpClamp;\n\tBigInteger.prototype.dlShiftTo = bnpDLShiftTo;\n\tBigInteger.prototype.drShiftTo = bnpDRShiftTo;\n\tBigInteger.prototype.lShiftTo = bnpLShiftTo;\n\tBigInteger.prototype.rShiftTo = bnpRShiftTo;\n\tBigInteger.prototype.subTo = bnpSubTo;\n\tBigInteger.prototype.multiplyTo = bnpMultiplyTo;\n\tBigInteger.prototype.squareTo = bnpSquareTo;\n\tBigInteger.prototype.divRemTo = bnpDivRemTo;\n\tBigInteger.prototype.invDigit = bnpInvDigit;\n\tBigInteger.prototype.addTo = bnpAddTo;\n\t\n\t// public\n\tBigInteger.prototype.toString = bnToString;\n\tBigInteger.prototype.negate = bnNegate;\n\tBigInteger.prototype.abs = bnAbs;\n\tBigInteger.prototype.compareTo = bnCompareTo;\n\tBigInteger.prototype.bitLength = bnBitLength;\n\tBigInteger.prototype.mod = bnMod;\n\tBigInteger.prototype.equals = bnEquals;\n\tBigInteger.prototype.add = bnAdd;\n\tBigInteger.prototype.subtract = bnSubtract;\n\tBigInteger.prototype.multiply = bnMultiply;\n\tBigInteger.prototype.divide = bnDivide;\n\tBigInteger.prototype.modPow = bnModPow;\n\t\n\t// \"constants\"\n\tBigInteger.ZERO = nbv(0);\n\tBigInteger.ONE = nbv(1);\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _CognitoJwtToken2 = __webpack_require__(7);\n\t\n\tvar _CognitoJwtToken3 = _interopRequireDefault(_CognitoJwtToken2);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t/** @class */\n\tvar CognitoAccessToken = function (_CognitoJwtToken) {\n\t _inherits(CognitoAccessToken, _CognitoJwtToken);\n\t\n\t /**\n\t * Constructs a new CognitoAccessToken object\n\t * @param {string=} AccessToken The JWT access token.\n\t */\n\t function CognitoAccessToken() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t AccessToken = _ref.AccessToken;\n\t\n\t _classCallCheck(this, CognitoAccessToken);\n\t\n\t return _possibleConstructorReturn(this, _CognitoJwtToken.call(this, AccessToken || ''));\n\t }\n\t\n\t return CognitoAccessToken;\n\t}(_CognitoJwtToken3.default);\n\t\n\texports.default = CognitoAccessToken;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _CognitoJwtToken2 = __webpack_require__(7);\n\t\n\tvar _CognitoJwtToken3 = _interopRequireDefault(_CognitoJwtToken2);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t/** @class */\n\tvar CognitoIdToken = function (_CognitoJwtToken) {\n\t _inherits(CognitoIdToken, _CognitoJwtToken);\n\t\n\t /**\n\t * Constructs a new CognitoIdToken object\n\t * @param {string=} IdToken The JWT Id token\n\t */\n\t function CognitoIdToken() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t IdToken = _ref.IdToken;\n\t\n\t _classCallCheck(this, CognitoIdToken);\n\t\n\t return _possibleConstructorReturn(this, _CognitoJwtToken.call(this, IdToken || ''));\n\t }\n\t\n\t return CognitoIdToken;\n\t}(_CognitoJwtToken3.default);\n\t\n\texports.default = CognitoIdToken;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _buffer = __webpack_require__(1);\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } /*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t/** @class */\n\tvar CognitoJwtToken = function () {\n\t /**\n\t * Constructs a new CognitoJwtToken object\n\t * @param {string=} token The JWT token.\n\t */\n\t function CognitoJwtToken(token) {\n\t _classCallCheck(this, CognitoJwtToken);\n\t\n\t // Assign object\n\t this.jwtToken = token || '';\n\t this.payload = this.decodePayload();\n\t }\n\t\n\t /**\n\t * @returns {string} the record's token.\n\t */\n\t\n\t\n\t CognitoJwtToken.prototype.getJwtToken = function getJwtToken() {\n\t return this.jwtToken;\n\t };\n\t\n\t /**\n\t * @returns {int} the token's expiration (exp member).\n\t */\n\t\n\t\n\t CognitoJwtToken.prototype.getExpiration = function getExpiration() {\n\t return this.payload.exp;\n\t };\n\t\n\t /**\n\t * @returns {int} the token's \"issued at\" (iat member).\n\t */\n\t\n\t\n\t CognitoJwtToken.prototype.getIssuedAt = function getIssuedAt() {\n\t return this.payload.iat;\n\t };\n\t\n\t /**\n\t * @returns {object} the token's payload.\n\t */\n\t\n\t\n\t CognitoJwtToken.prototype.decodePayload = function decodePayload() {\n\t var payload = this.jwtToken.split('.')[1];\n\t try {\n\t return JSON.parse(_buffer.Buffer.from(payload, 'base64').toString('utf8'));\n\t } catch (err) {\n\t return {};\n\t }\n\t };\n\t\n\t return CognitoJwtToken;\n\t}();\n\t\n\texports.default = CognitoJwtToken;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t/** @class */\n\tvar CognitoRefreshToken = function () {\n\t /**\n\t * Constructs a new CognitoRefreshToken object\n\t * @param {string=} RefreshToken The JWT refresh token.\n\t */\n\t function CognitoRefreshToken() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t RefreshToken = _ref.RefreshToken;\n\t\n\t _classCallCheck(this, CognitoRefreshToken);\n\t\n\t // Assign object\n\t this.token = RefreshToken || '';\n\t }\n\t\n\t /**\n\t * @returns {string} the record's token.\n\t */\n\t\n\t\n\t CognitoRefreshToken.prototype.getToken = function getToken() {\n\t return this.token;\n\t };\n\t\n\t return CognitoRefreshToken;\n\t}();\n\t\n\texports.default = CognitoRefreshToken;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _buffer = __webpack_require__(1);\n\t\n\tvar _cryptoBrowserify = __webpack_require__(14);\n\t\n\tvar crypto = _interopRequireWildcard(_cryptoBrowserify);\n\t\n\tvar _BigInteger = __webpack_require__(4);\n\t\n\tvar _BigInteger2 = _interopRequireDefault(_BigInteger);\n\t\n\tvar _AuthenticationHelper = __webpack_require__(3);\n\t\n\tvar _AuthenticationHelper2 = _interopRequireDefault(_AuthenticationHelper);\n\t\n\tvar _CognitoAccessToken = __webpack_require__(5);\n\t\n\tvar _CognitoAccessToken2 = _interopRequireDefault(_CognitoAccessToken);\n\t\n\tvar _CognitoIdToken = __webpack_require__(6);\n\t\n\tvar _CognitoIdToken2 = _interopRequireDefault(_CognitoIdToken);\n\t\n\tvar _CognitoRefreshToken = __webpack_require__(8);\n\t\n\tvar _CognitoRefreshToken2 = _interopRequireDefault(_CognitoRefreshToken);\n\t\n\tvar _CognitoUserSession = __webpack_require__(11);\n\t\n\tvar _CognitoUserSession2 = _interopRequireDefault(_CognitoUserSession);\n\t\n\tvar _DateHelper = __webpack_require__(12);\n\t\n\tvar _DateHelper2 = _interopRequireDefault(_DateHelper);\n\t\n\tvar _CognitoUserAttribute = __webpack_require__(10);\n\t\n\tvar _CognitoUserAttribute2 = _interopRequireDefault(_CognitoUserAttribute);\n\t\n\tvar _StorageHelper = __webpack_require__(13);\n\t\n\tvar _StorageHelper2 = _interopRequireDefault(_StorageHelper);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } /*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t//import createHmac from 'create-hmac';\n\t\n\t\n\tvar createHmac = crypto.createHmac;\n\t\n\t/**\n\t * @callback nodeCallback\n\t * @template T result\n\t * @param {*} err The operation failure reason, or null.\n\t * @param {T} result The operation result.\n\t */\n\t\n\t/**\n\t * @callback onFailure\n\t * @param {*} err Failure reason.\n\t */\n\t\n\t/**\n\t * @callback onSuccess\n\t * @template T result\n\t * @param {T} result The operation result.\n\t */\n\t\n\t/**\n\t * @callback mfaRequired\n\t * @param {*} details MFA challenge details.\n\t */\n\t\n\t/**\n\t * @callback customChallenge\n\t * @param {*} details Custom challenge details.\n\t */\n\t\n\t/**\n\t * @callback inputVerificationCode\n\t * @param {*} data Server response.\n\t */\n\t\n\t/**\n\t * @callback authSuccess\n\t * @param {CognitoUserSession} session The new session.\n\t * @param {bool=} userConfirmationNecessary User must be confirmed.\n\t */\n\t\n\t/** @class */\n\tvar CognitoUser = function () {\n\t /**\n\t * Constructs a new CognitoUser object\n\t * @param {object} data Creation options\n\t * @param {string} data.Username The user's username.\n\t * @param {CognitoUserPool} data.Pool Pool containing the user.\n\t * @param {object} data.Storage Optional storage object.\n\t */\n\t function CognitoUser(data) {\n\t _classCallCheck(this, CognitoUser);\n\t\n\t if (data == null || data.Username == null || data.Pool == null) {\n\t throw new Error('Username and pool information are required.');\n\t }\n\t\n\t this.username = data.Username || '';\n\t this.pool = data.Pool;\n\t this.Session = null;\n\t\n\t this.client = data.Pool.client;\n\t\n\t this.signInUserSession = null;\n\t this.authenticationFlowType = 'USER_SRP_AUTH';\n\t\n\t this.storage = data.Storage || new _StorageHelper2.default().getStorage();\n\t }\n\t\n\t /**\n\t * Sets the session for this user\n\t * @param {CognitoUserSession} signInUserSession the session\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.setSignInUserSession = function setSignInUserSession(signInUserSession) {\n\t this.clearCachedTokens();\n\t this.signInUserSession = signInUserSession;\n\t this.cacheTokens();\n\t };\n\t\n\t /**\n\t * @returns {CognitoUserSession} the current session for this user\n\t */\n\t\n\t\n\t CognitoUser.prototype.getSignInUserSession = function getSignInUserSession() {\n\t return this.signInUserSession;\n\t };\n\t\n\t /**\n\t * @returns {string} the user's username\n\t */\n\t\n\t\n\t CognitoUser.prototype.getUsername = function getUsername() {\n\t return this.username;\n\t };\n\t\n\t /**\n\t * @returns {String} the authentication flow type\n\t */\n\t\n\t\n\t CognitoUser.prototype.getAuthenticationFlowType = function getAuthenticationFlowType() {\n\t return this.authenticationFlowType;\n\t };\n\t\n\t /**\n\t * sets authentication flow type\n\t * @param {string} authenticationFlowType New value.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.setAuthenticationFlowType = function setAuthenticationFlowType(authenticationFlowType) {\n\t this.authenticationFlowType = authenticationFlowType;\n\t };\n\t\n\t /**\n\t * This is used for authenticating the user through the custom authentication flow.\n\t * @param {AuthenticationDetails} authDetails Contains the authentication data\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {customChallenge} callback.customChallenge Custom challenge\n\t * response required to continue.\n\t * @param {authSuccess} callback.onSuccess Called on success with the new session.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.initiateAuth = function initiateAuth(authDetails, callback) {\n\t var _this = this;\n\t\n\t var authParameters = authDetails.getAuthParameters();\n\t authParameters.USERNAME = this.username;\n\t\n\t var jsonReq = {\n\t AuthFlow: 'CUSTOM_AUTH',\n\t ClientId: this.pool.getClientId(),\n\t AuthParameters: authParameters,\n\t ClientMetadata: authDetails.getValidationData()\n\t };\n\t if (this.getUserContextData()) {\n\t jsonReq.UserContextData = this.getUserContextData();\n\t }\n\t\n\t this.client.request('InitiateAuth', jsonReq, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t var challengeName = data.ChallengeName;\n\t var challengeParameters = data.ChallengeParameters;\n\t\n\t if (challengeName === 'CUSTOM_CHALLENGE') {\n\t _this.Session = data.Session;\n\t return callback.customChallenge(challengeParameters);\n\t }\n\t _this.signInUserSession = _this.getCognitoUserSession(data.AuthenticationResult);\n\t _this.cacheTokens();\n\t return callback.onSuccess(_this.signInUserSession);\n\t });\n\t };\n\t\n\t /**\n\t * This is used for authenticating the user.\n\t * stuff\n\t * @param {AuthenticationDetails} authDetails Contains the authentication data\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {newPasswordRequired} callback.newPasswordRequired new\n\t * password and any required attributes are required to continue\n\t * @param {mfaRequired} callback.mfaRequired MFA code\n\t * required to continue.\n\t * @param {customChallenge} callback.customChallenge Custom challenge\n\t * response required to continue.\n\t * @param {authSuccess} callback.onSuccess Called on success with the new session.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.authenticateUser = function authenticateUser(authDetails, callback) {\n\t if (this.authenticationFlowType === 'USER_PASSWORD_AUTH') {\n\t return this.authenticateUserPlainUsernamePassword(authDetails, callback);\n\t } else if (this.authenticationFlowType === 'USER_SRP_AUTH') {\n\t return this.authenticateUserDefaultAuth(authDetails, callback);\n\t }\n\t return callback.onFailure(new Error('Authentication flow type is invalid.'));\n\t };\n\t\n\t /**\n\t * This is used for authenticating the user. it calls the AuthenticationHelper for SRP related\n\t * stuff\n\t * @param {AuthenticationDetails} authDetails Contains the authentication data\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {newPasswordRequired} callback.newPasswordRequired new\n\t * password and any required attributes are required to continue\n\t * @param {mfaRequired} callback.mfaRequired MFA code\n\t * required to continue.\n\t * @param {customChallenge} callback.customChallenge Custom challenge\n\t * response required to continue.\n\t * @param {authSuccess} callback.onSuccess Called on success with the new session.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.authenticateUserDefaultAuth = function authenticateUserDefaultAuth(authDetails, callback) {\n\t var _this2 = this;\n\t\n\t var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]);\n\t var dateHelper = new _DateHelper2.default();\n\t\n\t var serverBValue = void 0;\n\t var salt = void 0;\n\t var authParameters = {};\n\t\n\t if (this.deviceKey != null) {\n\t authParameters.DEVICE_KEY = this.deviceKey;\n\t }\n\t\n\t authParameters.USERNAME = this.username;\n\t authenticationHelper.getLargeAValue(function (errOnAValue, aValue) {\n\t // getLargeAValue callback start\n\t if (errOnAValue) {\n\t callback.onFailure(errOnAValue);\n\t }\n\t\n\t authParameters.SRP_A = aValue.toString(16);\n\t\n\t if (_this2.authenticationFlowType === 'CUSTOM_AUTH') {\n\t authParameters.CHALLENGE_NAME = 'SRP_A';\n\t }\n\t\n\t var jsonReq = {\n\t AuthFlow: _this2.authenticationFlowType,\n\t ClientId: _this2.pool.getClientId(),\n\t AuthParameters: authParameters,\n\t ClientMetadata: authDetails.getValidationData()\n\t };\n\t if (_this2.getUserContextData(_this2.username)) {\n\t jsonReq.UserContextData = _this2.getUserContextData(_this2.username);\n\t }\n\t\n\t _this2.client.request('InitiateAuth', jsonReq, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t\n\t var challengeParameters = data.ChallengeParameters;\n\t\n\t _this2.username = challengeParameters.USER_ID_FOR_SRP;\n\t serverBValue = new _BigInteger2.default(challengeParameters.SRP_B, 16);\n\t salt = new _BigInteger2.default(challengeParameters.SALT, 16);\n\t _this2.getCachedDeviceKeyAndPassword();\n\t\n\t authenticationHelper.getPasswordAuthenticationKey(_this2.username, authDetails.getPassword(), serverBValue, salt, function (errOnHkdf, hkdf) {\n\t // getPasswordAuthenticationKey callback start\n\t if (errOnHkdf) {\n\t callback.onFailure(errOnHkdf);\n\t }\n\t\n\t var dateNow = dateHelper.getNowString();\n\t\n\t var signatureString = createHmac('sha256', hkdf).update(_buffer.Buffer.concat([_buffer.Buffer.from(_this2.pool.getUserPoolId().split('_')[1], 'utf8'), _buffer.Buffer.from(_this2.username, 'utf8'), _buffer.Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'), _buffer.Buffer.from(dateNow, 'utf8')])).digest('base64');\n\t\n\t var challengeResponses = {};\n\t\n\t challengeResponses.USERNAME = _this2.username;\n\t challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK;\n\t challengeResponses.TIMESTAMP = dateNow;\n\t challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString;\n\t\n\t if (_this2.deviceKey != null) {\n\t challengeResponses.DEVICE_KEY = _this2.deviceKey;\n\t }\n\t\n\t var respondToAuthChallenge = function respondToAuthChallenge(challenge, challengeCallback) {\n\t return _this2.client.request('RespondToAuthChallenge', challenge, function (errChallenge, dataChallenge) {\n\t if (errChallenge && errChallenge.code === 'ResourceNotFoundException' && errChallenge.message.toLowerCase().indexOf('device') !== -1) {\n\t challengeResponses.DEVICE_KEY = null;\n\t _this2.deviceKey = null;\n\t _this2.randomPassword = null;\n\t _this2.deviceGroupKey = null;\n\t _this2.clearCachedDeviceKeyAndPassword();\n\t return respondToAuthChallenge(challenge, challengeCallback);\n\t }\n\t return challengeCallback(errChallenge, dataChallenge);\n\t });\n\t };\n\t\n\t var jsonReqResp = {\n\t ChallengeName: 'PASSWORD_VERIFIER',\n\t ClientId: _this2.pool.getClientId(),\n\t ChallengeResponses: challengeResponses,\n\t Session: data.Session\n\t };\n\t if (_this2.getUserContextData()) {\n\t jsonReqResp.UserContextData = _this2.getUserContextData();\n\t }\n\t respondToAuthChallenge(jsonReqResp, function (errAuthenticate, dataAuthenticate) {\n\t if (errAuthenticate) {\n\t return callback.onFailure(errAuthenticate);\n\t }\n\t\n\t var challengeName = dataAuthenticate.ChallengeName;\n\t if (challengeName === 'NEW_PASSWORD_REQUIRED') {\n\t _this2.Session = dataAuthenticate.Session;\n\t var userAttributes = null;\n\t var rawRequiredAttributes = null;\n\t var requiredAttributes = [];\n\t var userAttributesPrefix = authenticationHelper.getNewPasswordRequiredChallengeUserAttributePrefix();\n\t\n\t if (dataAuthenticate.ChallengeParameters) {\n\t userAttributes = JSON.parse(dataAuthenticate.ChallengeParameters.userAttributes);\n\t rawRequiredAttributes = JSON.parse(dataAuthenticate.ChallengeParameters.requiredAttributes);\n\t }\n\t\n\t if (rawRequiredAttributes) {\n\t for (var i = 0; i < rawRequiredAttributes.length; i++) {\n\t requiredAttributes[i] = rawRequiredAttributes[i].substr(userAttributesPrefix.length);\n\t }\n\t }\n\t return callback.newPasswordRequired(userAttributes, requiredAttributes);\n\t }\n\t return _this2.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback);\n\t });\n\t return undefined;\n\t // getPasswordAuthenticationKey callback end\n\t });\n\t return undefined;\n\t });\n\t // getLargeAValue callback end\n\t });\n\t };\n\t\n\t /**\n\t * PRIVATE ONLY: This is an internal only method and should not\n\t * be directly called by the consumers.\n\t * @param {AuthenticationDetails} authDetails Contains the authentication data.\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {mfaRequired} callback.mfaRequired MFA code\n\t * required to continue.\n\t * @param {authSuccess} callback.onSuccess Called on success with the new session.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.authenticateUserPlainUsernamePassword = function authenticateUserPlainUsernamePassword(authDetails, callback) {\n\t var _this3 = this;\n\t\n\t var authParameters = {};\n\t authParameters.USERNAME = this.username;\n\t authParameters.PASSWORD = authDetails.getPassword();\n\t if (!authParameters.PASSWORD) {\n\t callback.onFailure(new Error('PASSWORD parameter is required'));\n\t return;\n\t }\n\t var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]);\n\t this.getCachedDeviceKeyAndPassword();\n\t if (this.deviceKey != null) {\n\t authParameters.DEVICE_KEY = this.deviceKey;\n\t }\n\t\n\t var jsonReq = {\n\t AuthFlow: 'USER_PASSWORD_AUTH',\n\t ClientId: this.pool.getClientId(),\n\t AuthParameters: authParameters,\n\t ClientMetadata: authDetails.getValidationData()\n\t };\n\t if (this.getUserContextData(this.username)) {\n\t jsonReq.UserContextData = this.getUserContextData(this.username);\n\t }\n\t // USER_PASSWORD_AUTH happens in a single round-trip: client sends userName and password,\n\t // Cognito UserPools verifies password and returns tokens.\n\t this.client.request('InitiateAuth', jsonReq, function (err, authResult) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return _this3.authenticateUserInternal(authResult, authenticationHelper, callback);\n\t });\n\t };\n\t\n\t /**\n\t * PRIVATE ONLY: This is an internal only method and should not\n\t * be directly called by the consumers.\n\t * @param {object} dataAuthenticate authentication data\n\t * @param {object} authenticationHelper helper created\n\t * @param {callback} callback passed on from caller\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.authenticateUserInternal = function authenticateUserInternal(dataAuthenticate, authenticationHelper, callback) {\n\t var _this4 = this;\n\t\n\t var challengeName = dataAuthenticate.ChallengeName;\n\t var challengeParameters = dataAuthenticate.ChallengeParameters;\n\t\n\t if (challengeName === 'SMS_MFA') {\n\t this.Session = dataAuthenticate.Session;\n\t return callback.mfaRequired(challengeName, challengeParameters);\n\t }\n\t\n\t if (challengeName === 'SELECT_MFA_TYPE') {\n\t this.Session = dataAuthenticate.Session;\n\t return callback.selectMFAType(challengeName, challengeParameters);\n\t }\n\t\n\t if (challengeName === 'MFA_SETUP') {\n\t this.Session = dataAuthenticate.Session;\n\t return callback.mfaSetup(challengeName, challengeParameters);\n\t }\n\t\n\t if (challengeName === 'SOFTWARE_TOKEN_MFA') {\n\t this.Session = dataAuthenticate.Session;\n\t return callback.totpRequired(challengeName, challengeParameters);\n\t }\n\t\n\t if (challengeName === 'CUSTOM_CHALLENGE') {\n\t this.Session = dataAuthenticate.Session;\n\t return callback.customChallenge(challengeParameters);\n\t }\n\t\n\t if (challengeName === 'DEVICE_SRP_AUTH') {\n\t this.getDeviceResponse(callback);\n\t return undefined;\n\t }\n\t\n\t this.signInUserSession = this.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n\t this.cacheTokens();\n\t\n\t var newDeviceMetadata = dataAuthenticate.AuthenticationResult.NewDeviceMetadata;\n\t if (newDeviceMetadata == null) {\n\t return callback.onSuccess(this.signInUserSession);\n\t }\n\t\n\t authenticationHelper.generateHashDevice(dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, function (errGenHash) {\n\t if (errGenHash) {\n\t return callback.onFailure(errGenHash);\n\t }\n\t\n\t var deviceSecretVerifierConfig = {\n\t Salt: _buffer.Buffer.from(authenticationHelper.getSaltDevices(), 'hex').toString('base64'),\n\t PasswordVerifier: _buffer.Buffer.from(authenticationHelper.getVerifierDevices(), 'hex').toString('base64')\n\t };\n\t\n\t _this4.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier;\n\t _this4.deviceGroupKey = newDeviceMetadata.DeviceGroupKey;\n\t _this4.randomPassword = authenticationHelper.getRandomPassword();\n\t\n\t _this4.client.request('ConfirmDevice', {\n\t DeviceKey: newDeviceMetadata.DeviceKey,\n\t AccessToken: _this4.signInUserSession.getAccessToken().getJwtToken(),\n\t DeviceSecretVerifierConfig: deviceSecretVerifierConfig,\n\t DeviceName: navigator.userAgent\n\t }, function (errConfirm, dataConfirm) {\n\t if (errConfirm) {\n\t return callback.onFailure(errConfirm);\n\t }\n\t\n\t _this4.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey;\n\t _this4.cacheDeviceKeyAndPassword();\n\t if (dataConfirm.UserConfirmationNecessary === true) {\n\t return callback.onSuccess(_this4.signInUserSession, dataConfirm.UserConfirmationNecessary);\n\t }\n\t return callback.onSuccess(_this4.signInUserSession);\n\t });\n\t return undefined;\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This method is user to complete the NEW_PASSWORD_REQUIRED challenge.\n\t * Pass the new password with any new user attributes to be updated.\n\t * User attribute keys must be of format userAttributes..\n\t * @param {string} newPassword new password for this user\n\t * @param {object} requiredAttributeData map with values for all required attributes\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {mfaRequired} callback.mfaRequired MFA code required to continue.\n\t * @param {customChallenge} callback.customChallenge Custom challenge\n\t * response required to continue.\n\t * @param {authSuccess} callback.onSuccess Called on success with the new session.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.completeNewPasswordChallenge = function completeNewPasswordChallenge(newPassword, requiredAttributeData, callback) {\n\t var _this5 = this;\n\t\n\t if (!newPassword) {\n\t return callback.onFailure(new Error('New password is required.'));\n\t }\n\t var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]);\n\t var userAttributesPrefix = authenticationHelper.getNewPasswordRequiredChallengeUserAttributePrefix();\n\t\n\t var finalUserAttributes = {};\n\t if (requiredAttributeData) {\n\t Object.keys(requiredAttributeData).forEach(function (key) {\n\t finalUserAttributes[userAttributesPrefix + key] = requiredAttributeData[key];\n\t });\n\t }\n\t\n\t finalUserAttributes.NEW_PASSWORD = newPassword;\n\t finalUserAttributes.USERNAME = this.username;\n\t var jsonReq = {\n\t ChallengeName: 'NEW_PASSWORD_REQUIRED',\n\t ClientId: this.pool.getClientId(),\n\t ChallengeResponses: finalUserAttributes,\n\t Session: this.Session\n\t };\n\t if (this.getUserContextData()) {\n\t jsonReq.UserContextData = this.getUserContextData();\n\t }\n\t\n\t this.client.request('RespondToAuthChallenge', jsonReq, function (errAuthenticate, dataAuthenticate) {\n\t if (errAuthenticate) {\n\t return callback.onFailure(errAuthenticate);\n\t }\n\t return _this5.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback);\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used to get a session using device authentication. It is called at the end of user\n\t * authentication\n\t *\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {authSuccess} callback.onSuccess Called on success with the new session.\n\t * @returns {void}\n\t * @private\n\t */\n\t\n\t\n\t CognitoUser.prototype.getDeviceResponse = function getDeviceResponse(callback) {\n\t var _this6 = this;\n\t\n\t var authenticationHelper = new _AuthenticationHelper2.default(this.deviceGroupKey);\n\t var dateHelper = new _DateHelper2.default();\n\t\n\t var authParameters = {};\n\t\n\t authParameters.USERNAME = this.username;\n\t authParameters.DEVICE_KEY = this.deviceKey;\n\t authenticationHelper.getLargeAValue(function (errAValue, aValue) {\n\t // getLargeAValue callback start\n\t if (errAValue) {\n\t callback.onFailure(errAValue);\n\t }\n\t\n\t authParameters.SRP_A = aValue.toString(16);\n\t\n\t var jsonReq = {\n\t ChallengeName: 'DEVICE_SRP_AUTH',\n\t ClientId: _this6.pool.getClientId(),\n\t ChallengeResponses: authParameters\n\t };\n\t if (_this6.getUserContextData()) {\n\t jsonReq.UserContextData = _this6.getUserContextData();\n\t }\n\t _this6.client.request('RespondToAuthChallenge', jsonReq, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t\n\t var challengeParameters = data.ChallengeParameters;\n\t\n\t var serverBValue = new _BigInteger2.default(challengeParameters.SRP_B, 16);\n\t var salt = new _BigInteger2.default(challengeParameters.SALT, 16);\n\t\n\t authenticationHelper.getPasswordAuthenticationKey(_this6.deviceKey, _this6.randomPassword, serverBValue, salt, function (errHkdf, hkdf) {\n\t // getPasswordAuthenticationKey callback start\n\t if (errHkdf) {\n\t return callback.onFailure(errHkdf);\n\t }\n\t\n\t var dateNow = dateHelper.getNowString();\n\t\n\t var signatureString = createHmac('sha256', hkdf).update(_buffer.Buffer.concat([_buffer.Buffer.from(_this6.deviceGroupKey, 'utf8'), _buffer.Buffer.from(_this6.deviceKey, 'utf8'), _buffer.Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'), _buffer.Buffer.from(dateNow, 'utf8')])).digest('base64');\n\t\n\t var challengeResponses = {};\n\t\n\t challengeResponses.USERNAME = _this6.username;\n\t challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK;\n\t challengeResponses.TIMESTAMP = dateNow;\n\t challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString;\n\t challengeResponses.DEVICE_KEY = _this6.deviceKey;\n\t\n\t var jsonReqResp = {\n\t ChallengeName: 'DEVICE_PASSWORD_VERIFIER',\n\t ClientId: _this6.pool.getClientId(),\n\t ChallengeResponses: challengeResponses,\n\t Session: data.Session\n\t };\n\t if (_this6.getUserContextData()) {\n\t jsonReqResp.UserContextData = _this6.getUserContextData();\n\t }\n\t\n\t _this6.client.request('RespondToAuthChallenge', jsonReqResp, function (errAuthenticate, dataAuthenticate) {\n\t if (errAuthenticate) {\n\t return callback.onFailure(errAuthenticate);\n\t }\n\t\n\t _this6.signInUserSession = _this6.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n\t _this6.cacheTokens();\n\t\n\t return callback.onSuccess(_this6.signInUserSession);\n\t });\n\t return undefined;\n\t // getPasswordAuthenticationKey callback end\n\t });\n\t return undefined;\n\t });\n\t // getLargeAValue callback end\n\t });\n\t };\n\t\n\t /**\n\t * This is used for a certain user to confirm the registration by using a confirmation code\n\t * @param {string} confirmationCode Code entered by user.\n\t * @param {bool} forceAliasCreation Allow migrating from an existing email / phone number.\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.confirmRegistration = function confirmRegistration(confirmationCode, forceAliasCreation, callback) {\n\t var jsonReq = {\n\t ClientId: this.pool.getClientId(),\n\t ConfirmationCode: confirmationCode,\n\t Username: this.username,\n\t ForceAliasCreation: forceAliasCreation\n\t };\n\t if (this.getUserContextData()) {\n\t jsonReq.UserContextData = this.getUserContextData();\n\t }\n\t this.client.request('ConfirmSignUp', jsonReq, function (err) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t return callback(null, 'SUCCESS');\n\t });\n\t };\n\t\n\t /**\n\t * This is used by the user once he has the responses to a custom challenge\n\t * @param {string} answerChallenge The custom challange answer.\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {customChallenge} callback.customChallenge\n\t * Custom challenge response required to continue.\n\t * @param {authSuccess} callback.onSuccess Called on success with the new session.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.sendCustomChallengeAnswer = function sendCustomChallengeAnswer(answerChallenge, callback) {\n\t var _this7 = this;\n\t\n\t var challengeResponses = {};\n\t challengeResponses.USERNAME = this.username;\n\t challengeResponses.ANSWER = answerChallenge;\n\t\n\t var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]);\n\t this.getCachedDeviceKeyAndPassword();\n\t if (this.deviceKey != null) {\n\t challengeResponses.DEVICE_KEY = this.deviceKey;\n\t }\n\t\n\t var jsonReq = {\n\t ChallengeName: 'CUSTOM_CHALLENGE',\n\t ChallengeResponses: challengeResponses,\n\t ClientId: this.pool.getClientId(),\n\t Session: this.Session\n\t };\n\t if (this.getUserContextData()) {\n\t jsonReq.UserContextData = this.getUserContextData();\n\t }\n\t this.client.request('RespondToAuthChallenge', jsonReq, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t\n\t return _this7.authenticateUserInternal(data, authenticationHelper, callback);\n\t });\n\t };\n\t\n\t /**\n\t * This is used by the user once he has an MFA code\n\t * @param {string} confirmationCode The MFA code entered by the user.\n\t * @param {object} callback Result callback map.\n\t * @param {string} mfaType The mfa we are replying to.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {authSuccess} callback.onSuccess Called on success with the new session.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.sendMFACode = function sendMFACode(confirmationCode, callback, mfaType) {\n\t var _this8 = this;\n\t\n\t var challengeResponses = {};\n\t challengeResponses.USERNAME = this.username;\n\t challengeResponses.SMS_MFA_CODE = confirmationCode;\n\t var mfaTypeSelection = mfaType || 'SMS_MFA';\n\t if (mfaTypeSelection === 'SOFTWARE_TOKEN_MFA') {\n\t challengeResponses.SOFTWARE_TOKEN_MFA_CODE = confirmationCode;\n\t }\n\t\n\t if (this.deviceKey != null) {\n\t challengeResponses.DEVICE_KEY = this.deviceKey;\n\t }\n\t\n\t var jsonReq = {\n\t ChallengeName: mfaTypeSelection,\n\t ChallengeResponses: challengeResponses,\n\t ClientId: this.pool.getClientId(),\n\t Session: this.Session\n\t };\n\t if (this.getUserContextData()) {\n\t jsonReq.UserContextData = this.getUserContextData();\n\t }\n\t\n\t this.client.request('RespondToAuthChallenge', jsonReq, function (err, dataAuthenticate) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t\n\t var challengeName = dataAuthenticate.ChallengeName;\n\t\n\t if (challengeName === 'DEVICE_SRP_AUTH') {\n\t _this8.getDeviceResponse(callback);\n\t return undefined;\n\t }\n\t\n\t _this8.signInUserSession = _this8.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n\t _this8.cacheTokens();\n\t\n\t if (dataAuthenticate.AuthenticationResult.NewDeviceMetadata == null) {\n\t return callback.onSuccess(_this8.signInUserSession);\n\t }\n\t\n\t var authenticationHelper = new _AuthenticationHelper2.default(_this8.pool.getUserPoolId().split('_')[1]);\n\t authenticationHelper.generateHashDevice(dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, function (errGenHash) {\n\t if (errGenHash) {\n\t return callback.onFailure(errGenHash);\n\t }\n\t\n\t var deviceSecretVerifierConfig = {\n\t Salt: _buffer.Buffer.from(authenticationHelper.getSaltDevices(), 'hex').toString('base64'),\n\t PasswordVerifier: _buffer.Buffer.from(authenticationHelper.getVerifierDevices(), 'hex').toString('base64')\n\t };\n\t\n\t _this8.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier;\n\t _this8.deviceGroupKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey;\n\t _this8.randomPassword = authenticationHelper.getRandomPassword();\n\t\n\t _this8.client.request('ConfirmDevice', {\n\t DeviceKey: dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey,\n\t AccessToken: _this8.signInUserSession.getAccessToken().getJwtToken(),\n\t DeviceSecretVerifierConfig: deviceSecretVerifierConfig,\n\t DeviceName: navigator.userAgent\n\t }, function (errConfirm, dataConfirm) {\n\t if (errConfirm) {\n\t return callback.onFailure(errConfirm);\n\t }\n\t\n\t _this8.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey;\n\t _this8.cacheDeviceKeyAndPassword();\n\t if (dataConfirm.UserConfirmationNecessary === true) {\n\t return callback.onSuccess(_this8.signInUserSession, dataConfirm.UserConfirmationNecessary);\n\t }\n\t return callback.onSuccess(_this8.signInUserSession);\n\t });\n\t return undefined;\n\t });\n\t return undefined;\n\t });\n\t };\n\t\n\t /**\n\t * This is used by an authenticated user to change the current password\n\t * @param {string} oldUserPassword The current password.\n\t * @param {string} newUserPassword The requested new password.\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.changePassword = function changePassword(oldUserPassword, newUserPassword, callback) {\n\t if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n\t return callback(new Error('User is not authenticated'), null);\n\t }\n\t\n\t this.client.request('ChangePassword', {\n\t PreviousPassword: oldUserPassword,\n\t ProposedPassword: newUserPassword,\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t return callback(null, 'SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used by an authenticated user to enable MFA for himself\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.enableMFA = function enableMFA(callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback(new Error('User is not authenticated'), null);\n\t }\n\t\n\t var mfaOptions = [];\n\t var mfaEnabled = {\n\t DeliveryMedium: 'SMS',\n\t AttributeName: 'phone_number'\n\t };\n\t mfaOptions.push(mfaEnabled);\n\t\n\t this.client.request('SetUserSettings', {\n\t MFAOptions: mfaOptions,\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t return callback(null, 'SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used by an authenticated user to enable MFA for himself\n\t * @param {string[]} smsMfaSettings the sms mfa settings\n\t * @param {string[]} softwareTokenMfaSettings the software token mfa settings\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.setUserMfaPreference = function setUserMfaPreference(smsMfaSettings, softwareTokenMfaSettings, callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback(new Error('User is not authenticated'), null);\n\t }\n\t\n\t this.client.request('SetUserMFAPreference', {\n\t SMSMfaSettings: smsMfaSettings,\n\t SoftwareTokenMfaSettings: softwareTokenMfaSettings,\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t return callback(null, 'SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used by an authenticated user to disable MFA for himself\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.disableMFA = function disableMFA(callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback(new Error('User is not authenticated'), null);\n\t }\n\t\n\t var mfaOptions = [];\n\t\n\t this.client.request('SetUserSettings', {\n\t MFAOptions: mfaOptions,\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t return callback(null, 'SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used by an authenticated user to delete himself\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.deleteUser = function deleteUser(callback) {\n\t var _this9 = this;\n\t\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback(new Error('User is not authenticated'), null);\n\t }\n\t\n\t this.client.request('DeleteUser', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t _this9.clearCachedTokens();\n\t return callback(null, 'SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * @typedef {CognitoUserAttribute | { Name:string, Value:string }} AttributeArg\n\t */\n\t /**\n\t * This is used by an authenticated user to change a list of attributes\n\t * @param {AttributeArg[]} attributes A list of the new user attributes.\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.updateAttributes = function updateAttributes(attributes, callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback(new Error('User is not authenticated'), null);\n\t }\n\t\n\t this.client.request('UpdateUserAttributes', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n\t UserAttributes: attributes\n\t }, function (err) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t return callback(null, 'SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used by an authenticated user to get a list of attributes\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.getUserAttributes = function getUserAttributes(callback) {\n\t if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n\t return callback(new Error('User is not authenticated'), null);\n\t }\n\t\n\t this.client.request('GetUser', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err, userData) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t\n\t var attributeList = [];\n\t\n\t for (var i = 0; i < userData.UserAttributes.length; i++) {\n\t var attribute = {\n\t Name: userData.UserAttributes[i].Name,\n\t Value: userData.UserAttributes[i].Value\n\t };\n\t var userAttribute = new _CognitoUserAttribute2.default(attribute);\n\t attributeList.push(userAttribute);\n\t }\n\t\n\t return callback(null, attributeList);\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used by an authenticated user to get the MFAOptions\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.getMFAOptions = function getMFAOptions(callback) {\n\t if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n\t return callback(new Error('User is not authenticated'), null);\n\t }\n\t\n\t this.client.request('GetUser', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err, userData) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t\n\t return callback(null, userData.MFAOptions);\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used by an authenticated user to delete a list of attributes\n\t * @param {string[]} attributeList Names of the attributes to delete.\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.deleteAttributes = function deleteAttributes(attributeList, callback) {\n\t if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n\t return callback(new Error('User is not authenticated'), null);\n\t }\n\t\n\t this.client.request('DeleteUserAttributes', {\n\t UserAttributeNames: attributeList,\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t return callback(null, 'SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used by a user to resend a confirmation code\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.resendConfirmationCode = function resendConfirmationCode(callback) {\n\t var jsonReq = {\n\t ClientId: this.pool.getClientId(),\n\t Username: this.username\n\t };\n\t\n\t this.client.request('ResendConfirmationCode', jsonReq, function (err, result) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t return callback(null, result);\n\t });\n\t };\n\t\n\t /**\n\t * This is used to get a session, either from the session object\n\t * or from the local storage, or by using a refresh token\n\t *\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.getSession = function getSession(callback) {\n\t if (this.username == null) {\n\t return callback(new Error('Username is null. Cannot retrieve a new session'), null);\n\t }\n\t\n\t if (this.signInUserSession != null && this.signInUserSession.isValid()) {\n\t return callback(null, this.signInUserSession);\n\t }\n\t\n\t var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username;\n\t var idTokenKey = keyPrefix + '.idToken';\n\t var accessTokenKey = keyPrefix + '.accessToken';\n\t var refreshTokenKey = keyPrefix + '.refreshToken';\n\t var clockDriftKey = keyPrefix + '.clockDrift';\n\t\n\t if (this.storage.getItem(idTokenKey)) {\n\t var idToken = new _CognitoIdToken2.default({\n\t IdToken: this.storage.getItem(idTokenKey)\n\t });\n\t var accessToken = new _CognitoAccessToken2.default({\n\t AccessToken: this.storage.getItem(accessTokenKey)\n\t });\n\t var refreshToken = new _CognitoRefreshToken2.default({\n\t RefreshToken: this.storage.getItem(refreshTokenKey)\n\t });\n\t var clockDrift = parseInt(this.storage.getItem(clockDriftKey), 0) || 0;\n\t\n\t var sessionData = {\n\t IdToken: idToken,\n\t AccessToken: accessToken,\n\t RefreshToken: refreshToken,\n\t ClockDrift: clockDrift\n\t };\n\t var cachedSession = new _CognitoUserSession2.default(sessionData);\n\t if (cachedSession.isValid()) {\n\t this.signInUserSession = cachedSession;\n\t return callback(null, this.signInUserSession);\n\t }\n\t\n\t if (refreshToken.getToken() == null) {\n\t return callback(new Error('Cannot retrieve a new session. Please authenticate.'), null);\n\t }\n\t\n\t this.refreshSession(refreshToken, callback);\n\t } else {\n\t callback(new Error('Local storage is missing an ID Token, Please authenticate'), null);\n\t }\n\t\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This uses the refreshToken to retrieve a new session\n\t * @param {CognitoRefreshToken} refreshToken A previous session's refresh token.\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.refreshSession = function refreshSession(refreshToken, callback) {\n\t var _this10 = this;\n\t\n\t var authParameters = {};\n\t authParameters.REFRESH_TOKEN = refreshToken.getToken();\n\t var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId();\n\t var lastUserKey = keyPrefix + '.LastAuthUser';\n\t\n\t if (this.storage.getItem(lastUserKey)) {\n\t this.username = this.storage.getItem(lastUserKey);\n\t var deviceKeyKey = keyPrefix + '.' + this.username + '.deviceKey';\n\t this.deviceKey = this.storage.getItem(deviceKeyKey);\n\t authParameters.DEVICE_KEY = this.deviceKey;\n\t }\n\t\n\t var jsonReq = {\n\t ClientId: this.pool.getClientId(),\n\t AuthFlow: 'REFRESH_TOKEN_AUTH',\n\t AuthParameters: authParameters\n\t };\n\t if (this.getUserContextData()) {\n\t jsonReq.UserContextData = this.getUserContextData();\n\t }\n\t this.client.request('InitiateAuth', jsonReq, function (err, authResult) {\n\t if (err) {\n\t if (err.code === 'NotAuthorizedException') {\n\t _this10.clearCachedTokens();\n\t }\n\t return callback(err, null);\n\t }\n\t if (authResult) {\n\t var authenticationResult = authResult.AuthenticationResult;\n\t if (!Object.prototype.hasOwnProperty.call(authenticationResult, 'RefreshToken')) {\n\t authenticationResult.RefreshToken = refreshToken.getToken();\n\t }\n\t _this10.signInUserSession = _this10.getCognitoUserSession(authenticationResult);\n\t _this10.cacheTokens();\n\t return callback(null, _this10.signInUserSession);\n\t }\n\t return undefined;\n\t });\n\t };\n\t\n\t /**\n\t * This is used to save the session tokens to local storage\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.cacheTokens = function cacheTokens() {\n\t var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId();\n\t var idTokenKey = keyPrefix + '.' + this.username + '.idToken';\n\t var accessTokenKey = keyPrefix + '.' + this.username + '.accessToken';\n\t var refreshTokenKey = keyPrefix + '.' + this.username + '.refreshToken';\n\t var clockDriftKey = keyPrefix + '.' + this.username + '.clockDrift';\n\t var lastUserKey = keyPrefix + '.LastAuthUser';\n\t\n\t this.storage.setItem(idTokenKey, this.signInUserSession.getIdToken().getJwtToken());\n\t this.storage.setItem(accessTokenKey, this.signInUserSession.getAccessToken().getJwtToken());\n\t this.storage.setItem(refreshTokenKey, this.signInUserSession.getRefreshToken().getToken());\n\t this.storage.setItem(clockDriftKey, '' + this.signInUserSession.getClockDrift());\n\t this.storage.setItem(lastUserKey, this.username);\n\t };\n\t\n\t /**\n\t * This is used to cache the device key and device group and device password\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.cacheDeviceKeyAndPassword = function cacheDeviceKeyAndPassword() {\n\t var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username;\n\t var deviceKeyKey = keyPrefix + '.deviceKey';\n\t var randomPasswordKey = keyPrefix + '.randomPasswordKey';\n\t var deviceGroupKeyKey = keyPrefix + '.deviceGroupKey';\n\t\n\t this.storage.setItem(deviceKeyKey, this.deviceKey);\n\t this.storage.setItem(randomPasswordKey, this.randomPassword);\n\t this.storage.setItem(deviceGroupKeyKey, this.deviceGroupKey);\n\t };\n\t\n\t /**\n\t * This is used to get current device key and device group and device password\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.getCachedDeviceKeyAndPassword = function getCachedDeviceKeyAndPassword() {\n\t var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username;\n\t var deviceKeyKey = keyPrefix + '.deviceKey';\n\t var randomPasswordKey = keyPrefix + '.randomPasswordKey';\n\t var deviceGroupKeyKey = keyPrefix + '.deviceGroupKey';\n\t\n\t if (this.storage.getItem(deviceKeyKey)) {\n\t this.deviceKey = this.storage.getItem(deviceKeyKey);\n\t this.randomPassword = this.storage.getItem(randomPasswordKey);\n\t this.deviceGroupKey = this.storage.getItem(deviceGroupKeyKey);\n\t }\n\t };\n\t\n\t /**\n\t * This is used to clear the device key info from local storage\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.clearCachedDeviceKeyAndPassword = function clearCachedDeviceKeyAndPassword() {\n\t var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username;\n\t var deviceKeyKey = keyPrefix + '.deviceKey';\n\t var randomPasswordKey = keyPrefix + '.randomPasswordKey';\n\t var deviceGroupKeyKey = keyPrefix + '.deviceGroupKey';\n\t\n\t this.storage.removeItem(deviceKeyKey);\n\t this.storage.removeItem(randomPasswordKey);\n\t this.storage.removeItem(deviceGroupKeyKey);\n\t };\n\t\n\t /**\n\t * This is used to clear the session tokens from local storage\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.clearCachedTokens = function clearCachedTokens() {\n\t var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId();\n\t var idTokenKey = keyPrefix + '.' + this.username + '.idToken';\n\t var accessTokenKey = keyPrefix + '.' + this.username + '.accessToken';\n\t var refreshTokenKey = keyPrefix + '.' + this.username + '.refreshToken';\n\t var lastUserKey = keyPrefix + '.LastAuthUser';\n\t\n\t this.storage.removeItem(idTokenKey);\n\t this.storage.removeItem(accessTokenKey);\n\t this.storage.removeItem(refreshTokenKey);\n\t this.storage.removeItem(lastUserKey);\n\t };\n\t\n\t /**\n\t * This is used to build a user session from tokens retrieved in the authentication result\n\t * @param {object} authResult Successful auth response from server.\n\t * @returns {CognitoUserSession} The new user session.\n\t * @private\n\t */\n\t\n\t\n\t CognitoUser.prototype.getCognitoUserSession = function getCognitoUserSession(authResult) {\n\t var idToken = new _CognitoIdToken2.default(authResult);\n\t var accessToken = new _CognitoAccessToken2.default(authResult);\n\t var refreshToken = new _CognitoRefreshToken2.default(authResult);\n\t\n\t var sessionData = {\n\t IdToken: idToken,\n\t AccessToken: accessToken,\n\t RefreshToken: refreshToken\n\t };\n\t\n\t return new _CognitoUserSession2.default(sessionData);\n\t };\n\t\n\t /**\n\t * This is used to initiate a forgot password request\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {inputVerificationCode?} callback.inputVerificationCode\n\t * Optional callback raised instead of onSuccess with response data.\n\t * @param {onSuccess} callback.onSuccess Called on success.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.forgotPassword = function forgotPassword(callback) {\n\t var jsonReq = {\n\t ClientId: this.pool.getClientId(),\n\t Username: this.username\n\t };\n\t if (this.getUserContextData()) {\n\t jsonReq.UserContextData = this.getUserContextData();\n\t }\n\t this.client.request('ForgotPassword', jsonReq, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t if (typeof callback.inputVerificationCode === 'function') {\n\t return callback.inputVerificationCode(data);\n\t }\n\t return callback.onSuccess(data);\n\t });\n\t };\n\t\n\t /**\n\t * This is used to confirm a new password using a confirmationCode\n\t * @param {string} confirmationCode Code entered by user.\n\t * @param {string} newPassword Confirm new password.\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {onSuccess} callback.onSuccess Called on success.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.confirmPassword = function confirmPassword(confirmationCode, newPassword, callback) {\n\t var jsonReq = {\n\t ClientId: this.pool.getClientId(),\n\t Username: this.username,\n\t ConfirmationCode: confirmationCode,\n\t Password: newPassword\n\t };\n\t if (this.getUserContextData()) {\n\t jsonReq.UserContextData = this.getUserContextData();\n\t }\n\t this.client.request('ConfirmForgotPassword', jsonReq, function (err) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return callback.onSuccess();\n\t });\n\t };\n\t\n\t /**\n\t * This is used to initiate an attribute confirmation request\n\t * @param {string} attributeName User attribute that needs confirmation.\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {inputVerificationCode} callback.inputVerificationCode Called on success.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.getAttributeVerificationCode = function getAttributeVerificationCode(attributeName, callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback.onFailure(new Error('User is not authenticated'));\n\t }\n\t\n\t this.client.request('GetUserAttributeVerificationCode', {\n\t AttributeName: attributeName,\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t if (typeof callback.inputVerificationCode === 'function') {\n\t return callback.inputVerificationCode(data);\n\t }\n\t return callback.onSuccess();\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used to confirm an attribute using a confirmation code\n\t * @param {string} attributeName Attribute being confirmed.\n\t * @param {string} confirmationCode Code entered by user.\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {onSuccess} callback.onSuccess Called on success.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.verifyAttribute = function verifyAttribute(attributeName, confirmationCode, callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback.onFailure(new Error('User is not authenticated'));\n\t }\n\t\n\t this.client.request('VerifyUserAttribute', {\n\t AttributeName: attributeName,\n\t Code: confirmationCode,\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return callback.onSuccess('SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used to get the device information using the current device key\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {onSuccess<*>} callback.onSuccess Called on success with device data.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.getDevice = function getDevice(callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback.onFailure(new Error('User is not authenticated'));\n\t }\n\t\n\t this.client.request('GetDevice', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n\t DeviceKey: this.deviceKey\n\t }, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return callback.onSuccess(data);\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used to forget a specific device\n\t * @param {string} deviceKey Device key.\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {onSuccess} callback.onSuccess Called on success.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.forgetSpecificDevice = function forgetSpecificDevice(deviceKey, callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback.onFailure(new Error('User is not authenticated'));\n\t }\n\t\n\t this.client.request('ForgetDevice', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n\t DeviceKey: deviceKey\n\t }, function (err) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return callback.onSuccess('SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used to forget the current device\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {onSuccess} callback.onSuccess Called on success.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.forgetDevice = function forgetDevice(callback) {\n\t var _this11 = this;\n\t\n\t this.forgetSpecificDevice(this.deviceKey, {\n\t onFailure: callback.onFailure,\n\t onSuccess: function onSuccess(result) {\n\t _this11.deviceKey = null;\n\t _this11.deviceGroupKey = null;\n\t _this11.randomPassword = null;\n\t _this11.clearCachedDeviceKeyAndPassword();\n\t return callback.onSuccess(result);\n\t }\n\t });\n\t };\n\t\n\t /**\n\t * This is used to set the device status as remembered\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {onSuccess} callback.onSuccess Called on success.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.setDeviceStatusRemembered = function setDeviceStatusRemembered(callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback.onFailure(new Error('User is not authenticated'));\n\t }\n\t\n\t this.client.request('UpdateDeviceStatus', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n\t DeviceKey: this.deviceKey,\n\t DeviceRememberedStatus: 'remembered'\n\t }, function (err) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return callback.onSuccess('SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used to set the device status as not remembered\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {onSuccess} callback.onSuccess Called on success.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.setDeviceStatusNotRemembered = function setDeviceStatusNotRemembered(callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback.onFailure(new Error('User is not authenticated'));\n\t }\n\t\n\t this.client.request('UpdateDeviceStatus', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n\t DeviceKey: this.deviceKey,\n\t DeviceRememberedStatus: 'not_remembered'\n\t }, function (err) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return callback.onSuccess('SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used to list all devices for a user\n\t *\n\t * @param {int} limit the number of devices returned in a call\n\t * @param {string} paginationToken the pagination token in case any was returned before\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {onSuccess<*>} callback.onSuccess Called on success with device list.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.listDevices = function listDevices(limit, paginationToken, callback) {\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback.onFailure(new Error('User is not authenticated'));\n\t }\n\t\n\t this.client.request('ListDevices', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n\t Limit: limit,\n\t PaginationToken: paginationToken\n\t }, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return callback.onSuccess(data);\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used to globally revoke all tokens issued to a user\n\t * @param {object} callback Result callback map.\n\t * @param {onFailure} callback.onFailure Called on any error.\n\t * @param {onSuccess} callback.onSuccess Called on success.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.globalSignOut = function globalSignOut(callback) {\n\t var _this12 = this;\n\t\n\t if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n\t return callback.onFailure(new Error('User is not authenticated'));\n\t }\n\t\n\t this.client.request('GlobalSignOut', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t _this12.clearCachedTokens();\n\t return callback.onSuccess('SUCCESS');\n\t });\n\t return undefined;\n\t };\n\t\n\t /**\n\t * This is used for the user to signOut of the application and clear the cached tokens.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.signOut = function signOut() {\n\t this.signInUserSession = null;\n\t this.clearCachedTokens();\n\t };\n\t\n\t /**\n\t * This is used by a user trying to select a given MFA\n\t * @param {string} answerChallenge the mfa the user wants\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.sendMFASelectionAnswer = function sendMFASelectionAnswer(answerChallenge, callback) {\n\t var _this13 = this;\n\t\n\t var challengeResponses = {};\n\t challengeResponses.USERNAME = this.username;\n\t challengeResponses.ANSWER = answerChallenge;\n\t\n\t var jsonReq = {\n\t ChallengeName: 'SELECT_MFA_TYPE',\n\t ChallengeResponses: challengeResponses,\n\t ClientId: this.pool.getClientId(),\n\t Session: this.Session\n\t };\n\t if (this.getUserContextData()) {\n\t jsonReq.UserContextData = this.getUserContextData();\n\t }\n\t this.client.request('RespondToAuthChallenge', jsonReq, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t _this13.Session = data.Session;\n\t if (answerChallenge === 'SMS_MFA') {\n\t return callback.mfaRequired(data.challengeName, data.challengeParameters);\n\t }\n\t if (answerChallenge === 'SOFTWARE_TOKEN_MFA') {\n\t return callback.totpRequired(data.challengeName, data.challengeParameters);\n\t }\n\t return undefined;\n\t });\n\t };\n\t\n\t /**\n\t * This returns the user context data for advanced security feature.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.getUserContextData = function getUserContextData() {\n\t var pool = this.pool;\n\t return pool.getUserContextData(this.username);\n\t };\n\t\n\t /**\n\t * This is used by an authenticated or a user trying to authenticate to associate a TOTP MFA\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.associateSoftwareToken = function associateSoftwareToken(callback) {\n\t var _this14 = this;\n\t\n\t if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n\t this.client.request('AssociateSoftwareToken', {\n\t Session: this.Session\n\t }, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t _this14.Session = data.Session;\n\t return callback.associateSecretCode(data.SecretCode);\n\t });\n\t } else {\n\t this.client.request('AssociateSoftwareToken', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n\t }, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return callback.associateSecretCode(data.SecretCode);\n\t });\n\t }\n\t };\n\t\n\t /**\n\t * This is used by an authenticated or a user trying to authenticate to verify a TOTP MFA\n\t * @param {string} totpCode The MFA code entered by the user.\n\t * @param {string} friendlyDeviceName The device name we are assigning to the device.\n\t * @param {nodeCallback} callback Called on success or error.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUser.prototype.verifySoftwareToken = function verifySoftwareToken(totpCode, friendlyDeviceName, callback) {\n\t var _this15 = this;\n\t\n\t if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n\t this.client.request('VerifySoftwareToken', {\n\t Session: this.Session,\n\t UserCode: totpCode,\n\t FriendlyDeviceName: friendlyDeviceName\n\t }, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t _this15.Session = data.Session;\n\t var challengeResponses = {};\n\t challengeResponses.USERNAME = _this15.username;\n\t var jsonReq = {\n\t ChallengeName: 'MFA_SETUP',\n\t ClientId: _this15.pool.getClientId(),\n\t ChallengeResponses: challengeResponses,\n\t Session: _this15.Session\n\t };\n\t if (_this15.getUserContextData()) {\n\t jsonReq.UserContextData = _this15.getUserContextData();\n\t }\n\t _this15.client.request('RespondToAuthChallenge', jsonReq, function (errRespond, dataRespond) {\n\t if (errRespond) {\n\t return callback.onFailure(errRespond);\n\t }\n\t _this15.signInUserSession = _this15.getCognitoUserSession(dataRespond.AuthenticationResult);\n\t _this15.cacheTokens();\n\t return callback.onSuccess(_this15.signInUserSession);\n\t });\n\t return undefined;\n\t });\n\t } else {\n\t this.client.request('VerifySoftwareToken', {\n\t AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n\t UserCode: totpCode,\n\t FriendlyDeviceName: friendlyDeviceName\n\t }, function (err, data) {\n\t if (err) {\n\t return callback.onFailure(err);\n\t }\n\t return callback.onSuccess(data);\n\t });\n\t }\n\t };\n\t\n\t return CognitoUser;\n\t}();\n\t\n\texports.default = CognitoUser;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t/** @class */\n\tvar CognitoUserAttribute = function () {\n\t /**\n\t * Constructs a new CognitoUserAttribute object\n\t * @param {string=} Name The record's name\n\t * @param {string=} Value The record's value\n\t */\n\t function CognitoUserAttribute() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t Name = _ref.Name,\n\t Value = _ref.Value;\n\t\n\t _classCallCheck(this, CognitoUserAttribute);\n\t\n\t this.Name = Name || '';\n\t this.Value = Value || '';\n\t }\n\t\n\t /**\n\t * @returns {string} the record's value.\n\t */\n\t\n\t\n\t CognitoUserAttribute.prototype.getValue = function getValue() {\n\t return this.Value;\n\t };\n\t\n\t /**\n\t * Sets the record's value.\n\t * @param {string} value The new value.\n\t * @returns {CognitoUserAttribute} The record for method chaining.\n\t */\n\t\n\t\n\t CognitoUserAttribute.prototype.setValue = function setValue(value) {\n\t this.Value = value;\n\t return this;\n\t };\n\t\n\t /**\n\t * @returns {string} the record's name.\n\t */\n\t\n\t\n\t CognitoUserAttribute.prototype.getName = function getName() {\n\t return this.Name;\n\t };\n\t\n\t /**\n\t * Sets the record's name\n\t * @param {string} name The new name.\n\t * @returns {CognitoUserAttribute} The record for method chaining.\n\t */\n\t\n\t\n\t CognitoUserAttribute.prototype.setName = function setName(name) {\n\t this.Name = name;\n\t return this;\n\t };\n\t\n\t /**\n\t * @returns {string} a string representation of the record.\n\t */\n\t\n\t\n\t CognitoUserAttribute.prototype.toString = function toString() {\n\t return JSON.stringify(this);\n\t };\n\t\n\t /**\n\t * @returns {object} a flat object representing the record.\n\t */\n\t\n\t\n\t CognitoUserAttribute.prototype.toJSON = function toJSON() {\n\t return {\n\t Name: this.Name,\n\t Value: this.Value\n\t };\n\t };\n\t\n\t return CognitoUserAttribute;\n\t}();\n\t\n\texports.default = CognitoUserAttribute;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t/** @class */\n\tvar CognitoUserSession = function () {\n\t /**\n\t * Constructs a new CognitoUserSession object\n\t * @param {CognitoIdToken} IdToken The session's Id token.\n\t * @param {CognitoRefreshToken=} RefreshToken The session's refresh token.\n\t * @param {CognitoAccessToken} AccessToken The session's access token.\n\t * @param {int} ClockDrift The saved computer's clock drift or undefined to force calculation.\n\t */\n\t function CognitoUserSession() {\n\t var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t IdToken = _ref.IdToken,\n\t RefreshToken = _ref.RefreshToken,\n\t AccessToken = _ref.AccessToken,\n\t ClockDrift = _ref.ClockDrift;\n\t\n\t _classCallCheck(this, CognitoUserSession);\n\t\n\t if (AccessToken == null || IdToken == null) {\n\t throw new Error('Id token and Access Token must be present.');\n\t }\n\t\n\t this.idToken = IdToken;\n\t this.refreshToken = RefreshToken;\n\t this.accessToken = AccessToken;\n\t this.clockDrift = ClockDrift === undefined ? this.calculateClockDrift() : ClockDrift;\n\t }\n\t\n\t /**\n\t * @returns {CognitoIdToken} the session's Id token\n\t */\n\t\n\t\n\t CognitoUserSession.prototype.getIdToken = function getIdToken() {\n\t return this.idToken;\n\t };\n\t\n\t /**\n\t * @returns {CognitoRefreshToken} the session's refresh token\n\t */\n\t\n\t\n\t CognitoUserSession.prototype.getRefreshToken = function getRefreshToken() {\n\t return this.refreshToken;\n\t };\n\t\n\t /**\n\t * @returns {CognitoAccessToken} the session's access token\n\t */\n\t\n\t\n\t CognitoUserSession.prototype.getAccessToken = function getAccessToken() {\n\t return this.accessToken;\n\t };\n\t\n\t /**\n\t * @returns {int} the session's clock drift\n\t */\n\t\n\t\n\t CognitoUserSession.prototype.getClockDrift = function getClockDrift() {\n\t return this.clockDrift;\n\t };\n\t\n\t /**\n\t * @returns {int} the computer's clock drift\n\t */\n\t\n\t\n\t CognitoUserSession.prototype.calculateClockDrift = function calculateClockDrift() {\n\t var now = Math.floor(new Date() / 1000);\n\t var iat = Math.min(this.accessToken.getIssuedAt(), this.idToken.getIssuedAt());\n\t\n\t return now - iat;\n\t };\n\t\n\t /**\n\t * Checks to see if the session is still valid based on session expiry information found\n\t * in tokens and the current time (adjusted with clock drift)\n\t * @returns {boolean} if the session is still valid\n\t */\n\t\n\t\n\t CognitoUserSession.prototype.isValid = function isValid() {\n\t var now = Math.floor(new Date() / 1000);\n\t var adjusted = now - this.clockDrift;\n\t\n\t return adjusted < this.accessToken.getExpiration() && adjusted < this.idToken.getExpiration();\n\t };\n\t\n\t return CognitoUserSession;\n\t}();\n\t\n\texports.default = CognitoUserSession;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\tvar monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n\tvar weekNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n\t\n\t/** @class */\n\t\n\tvar DateHelper = function () {\n\t function DateHelper() {\n\t _classCallCheck(this, DateHelper);\n\t }\n\t\n\t /**\n\t * @returns {string} The current time in \"ddd MMM D HH:mm:ss UTC YYYY\" format.\n\t */\n\t DateHelper.prototype.getNowString = function getNowString() {\n\t var now = new Date();\n\t\n\t var weekDay = weekNames[now.getUTCDay()];\n\t var month = monthNames[now.getUTCMonth()];\n\t var day = now.getUTCDate();\n\t\n\t var hours = now.getUTCHours();\n\t if (hours < 10) {\n\t hours = '0' + hours;\n\t }\n\t\n\t var minutes = now.getUTCMinutes();\n\t if (minutes < 10) {\n\t minutes = '0' + minutes;\n\t }\n\t\n\t var seconds = now.getUTCSeconds();\n\t if (seconds < 10) {\n\t seconds = '0' + seconds;\n\t }\n\t\n\t var year = now.getUTCFullYear();\n\t\n\t // ddd MMM D HH:mm:ss UTC YYYY\n\t var dateNow = weekDay + ' ' + month + ' ' + day + ' ' + hours + ':' + minutes + ':' + seconds + ' UTC ' + year;\n\t\n\t return dateNow;\n\t };\n\t\n\t return DateHelper;\n\t}();\n\t\n\texports.default = DateHelper;\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\tvar dataMemory = {};\n\t\n\t/** @class */\n\t\n\tvar MemoryStorage = function () {\n\t function MemoryStorage() {\n\t _classCallCheck(this, MemoryStorage);\n\t }\n\t\n\t /**\n\t * This is used to set a specific item in storage\n\t * @param {string} key - the key for the item\n\t * @param {object} value - the value\n\t * @returns {string} value that was set\n\t */\n\t MemoryStorage.setItem = function setItem(key, value) {\n\t dataMemory[key] = value;\n\t return dataMemory[key];\n\t };\n\t\n\t /**\n\t * This is used to get a specific key from storage\n\t * @param {string} key - the key for the item\n\t * This is used to clear the storage\n\t * @returns {string} the data item\n\t */\n\t\n\t\n\t MemoryStorage.getItem = function getItem(key) {\n\t return Object.prototype.hasOwnProperty.call(dataMemory, key) ? dataMemory[key] : undefined;\n\t };\n\t\n\t /**\n\t * This is used to remove an item from storage\n\t * @param {string} key - the key being set\n\t * @returns {string} value - value that was deleted\n\t */\n\t\n\t\n\t MemoryStorage.removeItem = function removeItem(key) {\n\t return delete dataMemory[key];\n\t };\n\t\n\t /**\n\t * This is used to clear the storage\n\t * @returns {string} nothing\n\t */\n\t\n\t\n\t MemoryStorage.clear = function clear() {\n\t dataMemory = {};\n\t return dataMemory;\n\t };\n\t\n\t return MemoryStorage;\n\t}();\n\t\n\t/** @class */\n\t\n\t\n\tvar StorageHelper = function () {\n\t\n\t /**\n\t * This is used to get a storage object\n\t * @returns {object} the storage\n\t */\n\t function StorageHelper() {\n\t _classCallCheck(this, StorageHelper);\n\t\n\t try {\n\t this.storageWindow = window.localStorage;\n\t this.storageWindow.setItem('aws.cognito.test-ls', 1);\n\t this.storageWindow.removeItem('aws.cognito.test-ls');\n\t } catch (exception) {\n\t this.storageWindow = MemoryStorage;\n\t }\n\t }\n\t\n\t /**\n\t * This is used to return the storage\n\t * @returns {object} the storage\n\t */\n\t\n\t\n\t StorageHelper.prototype.getStorage = function getStorage() {\n\t return this.storageWindow;\n\t };\n\t\n\t return StorageHelper;\n\t}();\n\t\n\texports.default = StorageHelper;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar Buffer = __webpack_require__(1).Buffer\n\tvar sha = __webpack_require__(26)\n\tvar sha256 = __webpack_require__(27)\n\tvar rng = __webpack_require__(25)\n\tvar md5 = __webpack_require__(24)\n\t\n\tvar algorithms = {\n\t sha1: sha,\n\t sha256: sha256,\n\t md5: md5\n\t}\n\t\n\tvar blocksize = 64\n\tvar zeroBuffer = new Buffer(blocksize); zeroBuffer.fill(0)\n\tfunction hmac(fn, key, data) {\n\t if(!Buffer.isBuffer(key)) key = new Buffer(key)\n\t if(!Buffer.isBuffer(data)) data = new Buffer(data)\n\t\n\t if(key.length > blocksize) {\n\t key = fn(key)\n\t } else if(key.length < blocksize) {\n\t key = Buffer.concat([key, zeroBuffer], blocksize)\n\t }\n\t\n\t var ipad = new Buffer(blocksize), opad = new Buffer(blocksize)\n\t for(var i = 0; i < blocksize; i++) {\n\t ipad[i] = key[i] ^ 0x36\n\t opad[i] = key[i] ^ 0x5C\n\t }\n\t\n\t var hash = fn(Buffer.concat([ipad, data]))\n\t return fn(Buffer.concat([opad, hash]))\n\t}\n\t\n\tfunction hash(alg, key) {\n\t alg = alg || 'sha1'\n\t var fn = algorithms[alg]\n\t var bufs = []\n\t var length = 0\n\t if(!fn) error('algorithm:', alg, 'is not yet supported')\n\t return {\n\t update: function (data) {\n\t if(!Buffer.isBuffer(data)) data = new Buffer(data)\n\t \n\t bufs.push(data)\n\t length += data.length\n\t return this\n\t },\n\t digest: function (enc) {\n\t var buf = Buffer.concat(bufs)\n\t var r = key ? hmac(fn, key, buf) : fn(buf)\n\t bufs = null\n\t return enc ? r.toString(enc) : r\n\t }\n\t }\n\t}\n\t\n\tfunction error () {\n\t var m = [].slice.call(arguments).join(' ')\n\t throw new Error([\n\t m,\n\t 'we accept pull requests',\n\t 'http://github.com/dominictarr/crypto-browserify'\n\t ].join('\\n'))\n\t}\n\t\n\texports.createHash = function (alg) { return hash(alg) }\n\texports.createHmac = function (alg, key) { return hash(alg, key) }\n\texports.randomBytes = function(size, callback) {\n\t if (callback && callback.call) {\n\t try {\n\t callback.call(this, undefined, new Buffer(rng(size)))\n\t } catch (err) { callback(err) }\n\t } else {\n\t return new Buffer(rng(size))\n\t }\n\t}\n\t\n\tfunction each(a, f) {\n\t for(var i in a)\n\t f(a[i], i)\n\t}\n\t\n\t// the least I can do is make error messages for the rest of the node.js/crypto api.\n\teach(['createCredentials'\n\t, 'createCipher'\n\t, 'createCipheriv'\n\t, 'createDecipher'\n\t, 'createDecipheriv'\n\t, 'createSign'\n\t, 'createVerify'\n\t, 'createDiffieHellman'\n\t, 'pbkdf2'], function (name) {\n\t exports[name] = function () {\n\t error('sorry,', name, 'is not implemented yet')\n\t }\n\t})\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports) {\n\n\t'use strict'\n\t\n\texports.byteLength = byteLength\n\texports.toByteArray = toByteArray\n\texports.fromByteArray = fromByteArray\n\t\n\tvar lookup = []\n\tvar revLookup = []\n\tvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\t\n\tvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\n\tfor (var i = 0, len = code.length; i < len; ++i) {\n\t lookup[i] = code[i]\n\t revLookup[code.charCodeAt(i)] = i\n\t}\n\t\n\trevLookup['-'.charCodeAt(0)] = 62\n\trevLookup['_'.charCodeAt(0)] = 63\n\t\n\tfunction placeHoldersCount (b64) {\n\t var len = b64.length\n\t if (len % 4 > 0) {\n\t throw new Error('Invalid string. Length must be a multiple of 4')\n\t }\n\t\n\t // the number of equal signs (place holders)\n\t // if there are two placeholders, than the two characters before it\n\t // represent one byte\n\t // if there is only one, then the three characters before it represent 2 bytes\n\t // this is just a cheap hack to not do indexOf twice\n\t return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n\t}\n\t\n\tfunction byteLength (b64) {\n\t // base64 is 4/3 + up to two characters of the original data\n\t return (b64.length * 3 / 4) - placeHoldersCount(b64)\n\t}\n\t\n\tfunction toByteArray (b64) {\n\t var i, l, tmp, placeHolders, arr\n\t var len = b64.length\n\t placeHolders = placeHoldersCount(b64)\n\t\n\t arr = new Arr((len * 3 / 4) - placeHolders)\n\t\n\t // if there are placeholders, only get up to the last complete 4 chars\n\t l = placeHolders > 0 ? len - 4 : len\n\t\n\t var L = 0\n\t\n\t for (i = 0; i < l; i += 4) {\n\t tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n\t arr[L++] = (tmp >> 16) & 0xFF\n\t arr[L++] = (tmp >> 8) & 0xFF\n\t arr[L++] = tmp & 0xFF\n\t }\n\t\n\t if (placeHolders === 2) {\n\t tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n\t arr[L++] = tmp & 0xFF\n\t } else if (placeHolders === 1) {\n\t tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n\t arr[L++] = (tmp >> 8) & 0xFF\n\t arr[L++] = tmp & 0xFF\n\t }\n\t\n\t return arr\n\t}\n\t\n\tfunction tripletToBase64 (num) {\n\t return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n\t}\n\t\n\tfunction encodeChunk (uint8, start, end) {\n\t var tmp\n\t var output = []\n\t for (var i = start; i < end; i += 3) {\n\t tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])\n\t output.push(tripletToBase64(tmp))\n\t }\n\t return output.join('')\n\t}\n\t\n\tfunction fromByteArray (uint8) {\n\t var tmp\n\t var len = uint8.length\n\t var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n\t var output = ''\n\t var parts = []\n\t var maxChunkLength = 16383 // must be multiple of 3\n\t\n\t // go through the array every three bytes, we'll deal with trailing stuff later\n\t for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n\t parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n\t }\n\t\n\t // pad the end with zeros, but make sure to not forget the extra bytes\n\t if (extraBytes === 1) {\n\t tmp = uint8[len - 1]\n\t output += lookup[tmp >> 2]\n\t output += lookup[(tmp << 4) & 0x3F]\n\t output += '=='\n\t } else if (extraBytes === 2) {\n\t tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n\t output += lookup[tmp >> 10]\n\t output += lookup[(tmp >> 4) & 0x3F]\n\t output += lookup[(tmp << 2) & 0x3F]\n\t output += '='\n\t }\n\t\n\t parts.push(output)\n\t\n\t return parts.join('')\n\t}\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports) {\n\n\texports.read = function (buffer, offset, isLE, mLen, nBytes) {\n\t var e, m\n\t var eLen = nBytes * 8 - mLen - 1\n\t var eMax = (1 << eLen) - 1\n\t var eBias = eMax >> 1\n\t var nBits = -7\n\t var i = isLE ? (nBytes - 1) : 0\n\t var d = isLE ? -1 : 1\n\t var s = buffer[offset + i]\n\t\n\t i += d\n\t\n\t e = s & ((1 << (-nBits)) - 1)\n\t s >>= (-nBits)\n\t nBits += eLen\n\t for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\t\n\t m = e & ((1 << (-nBits)) - 1)\n\t e >>= (-nBits)\n\t nBits += mLen\n\t for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\t\n\t if (e === 0) {\n\t e = 1 - eBias\n\t } else if (e === eMax) {\n\t return m ? NaN : ((s ? -1 : 1) * Infinity)\n\t } else {\n\t m = m + Math.pow(2, mLen)\n\t e = e - eBias\n\t }\n\t return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n\t}\n\t\n\texports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n\t var e, m, c\n\t var eLen = nBytes * 8 - mLen - 1\n\t var eMax = (1 << eLen) - 1\n\t var eBias = eMax >> 1\n\t var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n\t var i = isLE ? 0 : (nBytes - 1)\n\t var d = isLE ? 1 : -1\n\t var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\t\n\t value = Math.abs(value)\n\t\n\t if (isNaN(value) || value === Infinity) {\n\t m = isNaN(value) ? 1 : 0\n\t e = eMax\n\t } else {\n\t e = Math.floor(Math.log(value) / Math.LN2)\n\t if (value * (c = Math.pow(2, -e)) < 1) {\n\t e--\n\t c *= 2\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c\n\t } else {\n\t value += rt * Math.pow(2, 1 - eBias)\n\t }\n\t if (value * c >= 2) {\n\t e++\n\t c /= 2\n\t }\n\t\n\t if (e + eBias >= eMax) {\n\t m = 0\n\t e = eMax\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * Math.pow(2, mLen)\n\t e = e + eBias\n\t } else {\n\t m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n\t e = 0\n\t }\n\t }\n\t\n\t for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\t\n\t e = (e << mLen) | m\n\t eLen += mLen\n\t for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\t\n\t buffer[offset + i - d] |= s * 128\n\t}\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports) {\n\n\tvar toString = {}.toString;\n\t\n\tmodule.exports = Array.isArray || function (arr) {\n\t return toString.call(arr) == '[object Array]';\n\t};\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n\t * JavaScript Cookie v2.2.0\n\t * https://github.com/js-cookie/js-cookie\n\t *\n\t * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n\t * Released under the MIT license\n\t */\n\t;(function (factory) {\n\t\tvar registeredInModuleLoader = false;\n\t\tif (true) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t\tregisteredInModuleLoader = true;\n\t\t}\n\t\tif (true) {\n\t\t\tmodule.exports = factory();\n\t\t\tregisteredInModuleLoader = true;\n\t\t}\n\t\tif (!registeredInModuleLoader) {\n\t\t\tvar OldCookies = window.Cookies;\n\t\t\tvar api = window.Cookies = factory();\n\t\t\tapi.noConflict = function () {\n\t\t\t\twindow.Cookies = OldCookies;\n\t\t\t\treturn api;\n\t\t\t};\n\t\t}\n\t}(function () {\n\t\tfunction extend () {\n\t\t\tvar i = 0;\n\t\t\tvar result = {};\n\t\t\tfor (; i < arguments.length; i++) {\n\t\t\t\tvar attributes = arguments[ i ];\n\t\t\t\tfor (var key in attributes) {\n\t\t\t\t\tresult[key] = attributes[key];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\n\t\tfunction init (converter) {\n\t\t\tfunction api (key, value, attributes) {\n\t\t\t\tvar result;\n\t\t\t\tif (typeof document === 'undefined') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\n\t\t\t\t// Write\n\t\n\t\t\t\tif (arguments.length > 1) {\n\t\t\t\t\tattributes = extend({\n\t\t\t\t\t\tpath: '/'\n\t\t\t\t\t}, api.defaults, attributes);\n\t\n\t\t\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\t\t\tvar expires = new Date();\n\t\t\t\t\t\texpires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);\n\t\t\t\t\t\tattributes.expires = expires;\n\t\t\t\t\t}\n\t\n\t\t\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\n\t\t\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\tresult = JSON.stringify(value);\n\t\t\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\t\t\tvalue = result;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {}\n\t\n\t\t\t\t\tif (!converter.write) {\n\t\t\t\t\t\tvalue = encodeURIComponent(String(value))\n\t\t\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue = converter.write(value, key);\n\t\t\t\t\t}\n\t\n\t\t\t\t\tkey = encodeURIComponent(String(key));\n\t\t\t\t\tkey = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);\n\t\t\t\t\tkey = key.replace(/[\\(\\)]/g, escape);\n\t\n\t\t\t\t\tvar stringifiedAttributes = '';\n\t\n\t\t\t\t\tfor (var attributeName in attributes) {\n\t\t\t\t\t\tif (!attributes[attributeName]) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstringifiedAttributes += '; ' + attributeName;\n\t\t\t\t\t\tif (attributes[attributeName] === true) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName];\n\t\t\t\t\t}\n\t\t\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\n\t\t\t\t}\n\t\n\t\t\t\t// Read\n\t\n\t\t\t\tif (!key) {\n\t\t\t\t\tresult = {};\n\t\t\t\t}\n\t\n\t\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t\t// in case there are no cookies at all. Also prevents odd result when\n\t\t\t\t// calling \"get()\"\n\t\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\t\tvar rdecode = /(%[0-9A-Z]{2})+/g;\n\t\t\t\tvar i = 0;\n\t\n\t\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\t\tvar cookie = parts.slice(1).join('=');\n\t\n\t\t\t\t\tif (!this.json && cookie.charAt(0) === '\"') {\n\t\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t\t}\n\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar name = parts[0].replace(rdecode, decodeURIComponent);\n\t\t\t\t\t\tcookie = converter.read ?\n\t\t\t\t\t\t\tconverter.read(cookie, name) : converter(cookie, name) ||\n\t\t\t\t\t\t\tcookie.replace(rdecode, decodeURIComponent);\n\t\n\t\t\t\t\t\tif (this.json) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\t\tresult = cookie;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tif (!key) {\n\t\t\t\t\t\t\tresult[name] = cookie;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {}\n\t\t\t\t}\n\t\n\t\t\t\treturn result;\n\t\t\t}\n\t\n\t\t\tapi.set = api;\n\t\t\tapi.get = function (key) {\n\t\t\t\treturn api.call(api, key);\n\t\t\t};\n\t\t\tapi.getJSON = function () {\n\t\t\t\treturn api.apply({\n\t\t\t\t\tjson: true\n\t\t\t\t}, [].slice.call(arguments));\n\t\t\t};\n\t\t\tapi.defaults = {};\n\t\n\t\t\tapi.remove = function (key, attributes) {\n\t\t\t\tapi(key, '', extend(attributes, {\n\t\t\t\t\texpires: -1\n\t\t\t\t}));\n\t\t\t};\n\t\n\t\t\tapi.withConverter = init;\n\t\n\t\t\treturn api;\n\t\t}\n\t\n\t\treturn init(function () {});\n\t}));\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports) {\n\n\t\"use strict\";\n\t\n\texports.__esModule = true;\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t/** @class */\n\tvar AuthenticationDetails = function () {\n\t /**\n\t * Constructs a new AuthenticationDetails object\n\t * @param {object=} data Creation options.\n\t * @param {string} data.Username User being authenticated.\n\t * @param {string} data.Password Plain-text password to authenticate with.\n\t * @param {(AttributeArg[])?} data.ValidationData Application extra metadata.\n\t * @param {(AttributeArg[])?} data.AuthParamaters Authentication paramaters for custom auth.\n\t */\n\t function AuthenticationDetails(data) {\n\t _classCallCheck(this, AuthenticationDetails);\n\t\n\t var _ref = data || {},\n\t ValidationData = _ref.ValidationData,\n\t Username = _ref.Username,\n\t Password = _ref.Password,\n\t AuthParameters = _ref.AuthParameters;\n\t\n\t this.validationData = ValidationData || {};\n\t this.authParameters = AuthParameters || {};\n\t this.username = Username;\n\t this.password = Password;\n\t }\n\t\n\t /**\n\t * @returns {string} the record's username\n\t */\n\t\n\t\n\t AuthenticationDetails.prototype.getUsername = function getUsername() {\n\t return this.username;\n\t };\n\t\n\t /**\n\t * @returns {string} the record's password\n\t */\n\t\n\t\n\t AuthenticationDetails.prototype.getPassword = function getPassword() {\n\t return this.password;\n\t };\n\t\n\t /**\n\t * @returns {Array} the record's validationData\n\t */\n\t\n\t\n\t AuthenticationDetails.prototype.getValidationData = function getValidationData() {\n\t return this.validationData;\n\t };\n\t\n\t /**\n\t * @returns {Array} the record's authParameters\n\t */\n\t\n\t\n\t AuthenticationDetails.prototype.getAuthParameters = function getAuthParameters() {\n\t return this.authParameters;\n\t };\n\t\n\t return AuthenticationDetails;\n\t}();\n\t\n\texports.default = AuthenticationDetails;\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _UserAgent = __webpack_require__(23);\n\t\n\tvar _UserAgent2 = _interopRequireDefault(_UserAgent);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/** @class */\n\tvar Client = function () {\n\t /**\n\t * Constructs a new AWS Cognito Identity Provider client object\n\t * @param {string} region AWS region\n\t * @param {string} endpoint endpoint\n\t */\n\t function Client(region, endpoint) {\n\t _classCallCheck(this, Client);\n\t\n\t this.endpoint = endpoint || 'https://cognito-idp.' + region + '.amazonaws.com/';\n\t this.userAgent = _UserAgent2.default.prototype.userAgent || 'aws-amplify/0.1.x js';\n\t }\n\t\n\t /**\n\t * Makes an unauthenticated request on AWS Cognito Identity Provider API\n\t * using fetch\n\t * @param {string} operation API operation\n\t * @param {object} params Input parameters\n\t * @param {function} callback Callback called when a response is returned\n\t * @returns {void}\n\t */\n\t\n\t\n\t Client.prototype.request = function request(operation, params, callback) {\n\t var headers = {\n\t 'Content-Type': 'application/x-amz-json-1.1',\n\t 'X-Amz-Target': 'AWSCognitoIdentityProviderService.' + operation,\n\t 'X-Amz-User-Agent': this.userAgent\n\t };\n\t\n\t var options = {\n\t headers: headers,\n\t method: 'POST',\n\t mode: 'cors',\n\t cache: 'no-cache',\n\t body: JSON.stringify(params)\n\t };\n\t\n\t var response = void 0;\n\t\n\t fetch(this.endpoint, options).then(function (resp) {\n\t response = resp;\n\t return resp;\n\t }).then(function (resp) {\n\t return resp.json().catch(function () {\n\t return {};\n\t });\n\t }).then(function (data) {\n\t if (response.ok) return callback(null, data);\n\t\n\t // Taken from aws-sdk-js/lib/protocol/json.js\n\t // eslint-disable-next-line no-underscore-dangle\n\t var code = (data.__type || data.code).split('#').pop();\n\t var error = {\n\t code: code,\n\t name: code,\n\t message: data.message || data.Message || null\n\t };\n\t return callback(error);\n\t }).catch(function () {\n\t // Taken from aws-sdk-js/lib/protocol/json.js\n\t var code = (response.headers.get('x-amzn-errortype') || 'UnknownError').split(':')[0];\n\t var error = {\n\t code: code,\n\t name: code,\n\t statusCode: response.status,\n\t message: response.status.toString()\n\t };\n\t return callback(error);\n\t });\n\t };\n\t\n\t return Client;\n\t}();\n\t\n\texports.default = Client;\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _Client = __webpack_require__(20);\n\t\n\tvar _Client2 = _interopRequireDefault(_Client);\n\t\n\tvar _CognitoUser = __webpack_require__(9);\n\t\n\tvar _CognitoUser2 = _interopRequireDefault(_CognitoUser);\n\t\n\tvar _StorageHelper = __webpack_require__(13);\n\t\n\tvar _StorageHelper2 = _interopRequireDefault(_StorageHelper);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } /*!\n\t * Copyright 2016 Amazon.com,\n\t * Inc. or its affiliates. All Rights Reserved.\n\t *\n\t * Licensed under the Amazon Software License (the \"License\").\n\t * You may not use this file except in compliance with the\n\t * License. A copy of the License is located at\n\t *\n\t * http://aws.amazon.com/asl/\n\t *\n\t * or in the \"license\" file accompanying this file. This file is\n\t * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n\t * CONDITIONS OF ANY KIND, express or implied. See the License\n\t * for the specific language governing permissions and\n\t * limitations under the License.\n\t */\n\t\n\t/** @class */\n\tvar CognitoUserPool = function () {\n\t /**\n\t * Constructs a new CognitoUserPool object\n\t * @param {object} data Creation options.\n\t * @param {string} data.UserPoolId Cognito user pool id.\n\t * @param {string} data.ClientId User pool application client id.\n\t * @param {object} data.Storage Optional storage object.\n\t * @param {boolean} data.AdvancedSecurityDataCollectionFlag Optional:\n\t * boolean flag indicating if the data collection is enabled\n\t * to support cognito advanced security features. By default, this\n\t * flag is set to true.\n\t */\n\t function CognitoUserPool(data) {\n\t _classCallCheck(this, CognitoUserPool);\n\t\n\t var _ref = data || {},\n\t UserPoolId = _ref.UserPoolId,\n\t ClientId = _ref.ClientId,\n\t endpoint = _ref.endpoint,\n\t AdvancedSecurityDataCollectionFlag = _ref.AdvancedSecurityDataCollectionFlag;\n\t\n\t if (!UserPoolId || !ClientId) {\n\t throw new Error('Both UserPoolId and ClientId are required.');\n\t }\n\t if (!/^[\\w-]+_.+$/.test(UserPoolId)) {\n\t throw new Error('Invalid UserPoolId format.');\n\t }\n\t var region = UserPoolId.split('_')[0];\n\t\n\t this.userPoolId = UserPoolId;\n\t this.clientId = ClientId;\n\t\n\t this.client = new _Client2.default(region, endpoint);\n\t\n\t /**\n\t * By default, AdvancedSecurityDataCollectionFlag is set to true,\n\t * if no input value is provided.\n\t */\n\t this.advancedSecurityDataCollectionFlag = AdvancedSecurityDataCollectionFlag !== false;\n\t\n\t this.storage = data.Storage || new _StorageHelper2.default().getStorage();\n\t }\n\t\n\t /**\n\t * @returns {string} the user pool id\n\t */\n\t\n\t\n\t CognitoUserPool.prototype.getUserPoolId = function getUserPoolId() {\n\t return this.userPoolId;\n\t };\n\t\n\t /**\n\t * @returns {string} the client id\n\t */\n\t\n\t\n\t CognitoUserPool.prototype.getClientId = function getClientId() {\n\t return this.clientId;\n\t };\n\t\n\t /**\n\t * @typedef {object} SignUpResult\n\t * @property {CognitoUser} user New user.\n\t * @property {bool} userConfirmed If the user is already confirmed.\n\t */\n\t /**\n\t * method for signing up a user\n\t * @param {string} username User's username.\n\t * @param {string} password Plain-text initial password entered by user.\n\t * @param {(AttributeArg[])=} userAttributes New user attributes.\n\t * @param {(AttributeArg[])=} validationData Application metadata.\n\t * @param {nodeCallback} callback Called on error or with the new user.\n\t * @returns {void}\n\t */\n\t\n\t\n\t CognitoUserPool.prototype.signUp = function signUp(username, password, userAttributes, validationData, callback) {\n\t var _this = this;\n\t\n\t var jsonReq = {\n\t ClientId: this.clientId,\n\t Username: username,\n\t Password: password,\n\t UserAttributes: userAttributes,\n\t ValidationData: validationData\n\t };\n\t if (this.getUserContextData(username)) {\n\t jsonReq.UserContextData = this.getUserContextData(username);\n\t }\n\t this.client.request('SignUp', jsonReq, function (err, data) {\n\t if (err) {\n\t return callback(err, null);\n\t }\n\t\n\t var cognitoUser = {\n\t Username: username,\n\t Pool: _this,\n\t Storage: _this.storage\n\t };\n\t\n\t var returnData = {\n\t user: new _CognitoUser2.default(cognitoUser),\n\t userConfirmed: data.UserConfirmed,\n\t userSub: data.UserSub\n\t };\n\t\n\t return callback(null, returnData);\n\t });\n\t };\n\t\n\t /**\n\t * method for getting the current user of the application from the local storage\n\t *\n\t * @returns {CognitoUser} the user retrieved from storage\n\t */\n\t\n\t\n\t CognitoUserPool.prototype.getCurrentUser = function getCurrentUser() {\n\t var lastUserKey = 'CognitoIdentityServiceProvider.' + this.clientId + '.LastAuthUser';\n\t\n\t var lastAuthUser = this.storage.getItem(lastUserKey);\n\t if (lastAuthUser) {\n\t var cognitoUser = {\n\t Username: lastAuthUser,\n\t Pool: this,\n\t Storage: this.storage\n\t };\n\t\n\t return new _CognitoUser2.default(cognitoUser);\n\t }\n\t\n\t return null;\n\t };\n\t\n\t /**\n\t * This method returns the encoded data string used for cognito advanced security feature.\n\t * This would be generated only when developer has included the JS used for collecting the\n\t * data on their client. Please refer to documentation to know more about using AdvancedSecurity\n\t * features\n\t * @param {string} username the username for the context data\n\t * @returns {string} the user context data\n\t **/\n\t\n\t\n\t CognitoUserPool.prototype.getUserContextData = function getUserContextData(username) {\n\t if (typeof AmazonCognitoAdvancedSecurityData === 'undefined') {\n\t return undefined;\n\t }\n\t /* eslint-disable */\n\t var amazonCognitoAdvancedSecurityDataConst = AmazonCognitoAdvancedSecurityData;\n\t /* eslint-enable */\n\t\n\t if (this.advancedSecurityDataCollectionFlag) {\n\t var advancedSecurityData = amazonCognitoAdvancedSecurityDataConst.getData(username, this.userPoolId, this.clientId);\n\t if (advancedSecurityData) {\n\t var userContextData = {\n\t EncodedData: advancedSecurityData\n\t };\n\t return userContextData;\n\t }\n\t }\n\t return {};\n\t };\n\t\n\t return CognitoUserPool;\n\t}();\n\t\n\texports.default = CognitoUserPool;\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _jsCookie = __webpack_require__(18);\n\t\n\tvar Cookies = _interopRequireWildcard(_jsCookie);\n\t\n\tfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/** @class */\n\tvar CookieStorage = function () {\n\t\n\t /**\n\t * Constructs a new CookieStorage object\n\t * @param {object} data Creation options.\n\t * @param {string} data.domain Cookies domain (mandatory).\n\t * @param {string} data.path Cookies path (default: '/')\n\t * @param {integer} data.expires Cookie expiration (in days, default: 365)\n\t * @param {boolean} data.secure Cookie secure flag (default: true)\n\t */\n\t function CookieStorage(data) {\n\t _classCallCheck(this, CookieStorage);\n\t\n\t this.domain = data.domain;\n\t if (data.path) {\n\t this.path = data.path;\n\t } else {\n\t this.path = '/';\n\t }\n\t if (Object.prototype.hasOwnProperty.call(data, 'expires')) {\n\t this.expires = data.expires;\n\t } else {\n\t this.expires = 365;\n\t }\n\t if (Object.prototype.hasOwnProperty.call(data, 'secure')) {\n\t this.secure = data.secure;\n\t } else {\n\t this.secure = true;\n\t }\n\t }\n\t\n\t /**\n\t * This is used to set a specific item in storage\n\t * @param {string} key - the key for the item\n\t * @param {object} value - the value\n\t * @returns {string} value that was set\n\t */\n\t\n\t\n\t CookieStorage.prototype.setItem = function setItem(key, value) {\n\t Cookies.set(key, value, {\n\t path: this.path,\n\t expires: this.expires,\n\t domain: this.domain,\n\t secure: this.secure\n\t });\n\t return Cookies.get(key);\n\t };\n\t\n\t /**\n\t * This is used to get a specific key from storage\n\t * @param {string} key - the key for the item\n\t * This is used to clear the storage\n\t * @returns {string} the data item\n\t */\n\t\n\t\n\t CookieStorage.prototype.getItem = function getItem(key) {\n\t return Cookies.get(key);\n\t };\n\t\n\t /**\n\t * This is used to remove an item from storage\n\t * @param {string} key - the key being set\n\t * @returns {string} value - value that was deleted\n\t */\n\t\n\t\n\t CookieStorage.prototype.removeItem = function removeItem(key) {\n\t return Cookies.remove(key, {\n\t path: this.path,\n\t domain: this.domain,\n\t secure: this.secure\n\t });\n\t };\n\t\n\t /**\n\t * This is used to clear the storage\n\t * @returns {string} nothing\n\t */\n\t\n\t\n\t CookieStorage.prototype.clear = function clear() {\n\t var cookies = Cookies.get();\n\t var index = void 0;\n\t for (index = 0; index < cookies.length; ++index) {\n\t Cookies.remove(cookies[index]);\n\t }\n\t return {};\n\t };\n\t\n\t return CookieStorage;\n\t}();\n\t\n\texports.default = CookieStorage;\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t// class for defining the amzn user-agent\n\texports.default = UserAgent;\n\t// constructor\n\t\n\tfunction UserAgent() {}\n\t// public\n\tUserAgent.prototype.userAgent = 'aws-amplify/0.1.x js';\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/*\r\n\t * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\r\n\t * Digest Algorithm, as defined in RFC 1321.\r\n\t * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.\r\n\t * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\r\n\t * Distributed under the BSD License\r\n\t * See http://pajhome.org.uk/crypt/md5 for more info.\r\n\t */\r\n\t\r\n\tvar helpers = __webpack_require__(2);\r\n\t\r\n\t/*\r\n\t * Perform a simple self-test to see if the VM is working\r\n\t */\r\n\tfunction md5_vm_test()\r\n\t{\r\n\t return hex_md5(\"abc\") == \"900150983cd24fb0d6963f7d28e17f72\";\r\n\t}\r\n\t\r\n\t/*\r\n\t * Calculate the MD5 of an array of little-endian words, and a bit length\r\n\t */\r\n\tfunction core_md5(x, len)\r\n\t{\r\n\t /* append padding */\r\n\t x[len >> 5] |= 0x80 << ((len) % 32);\r\n\t x[(((len + 64) >>> 9) << 4) + 14] = len;\r\n\t\r\n\t var a = 1732584193;\r\n\t var b = -271733879;\r\n\t var c = -1732584194;\r\n\t var d = 271733878;\r\n\t\r\n\t for(var i = 0; i < x.length; i += 16)\r\n\t {\r\n\t var olda = a;\r\n\t var oldb = b;\r\n\t var oldc = c;\r\n\t var oldd = d;\r\n\t\r\n\t a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);\r\n\t d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);\r\n\t c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);\r\n\t b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);\r\n\t a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);\r\n\t d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);\r\n\t c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);\r\n\t b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);\r\n\t a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);\r\n\t d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);\r\n\t c = md5_ff(c, d, a, b, x[i+10], 17, -42063);\r\n\t b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);\r\n\t a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);\r\n\t d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);\r\n\t c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);\r\n\t b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);\r\n\t\r\n\t a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);\r\n\t d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);\r\n\t c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);\r\n\t b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);\r\n\t a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);\r\n\t d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);\r\n\t c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);\r\n\t b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);\r\n\t a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);\r\n\t d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);\r\n\t c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);\r\n\t b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);\r\n\t a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);\r\n\t d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);\r\n\t c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);\r\n\t b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);\r\n\t\r\n\t a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);\r\n\t d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);\r\n\t c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);\r\n\t b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);\r\n\t a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);\r\n\t d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);\r\n\t c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);\r\n\t b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);\r\n\t a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);\r\n\t d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);\r\n\t c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);\r\n\t b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);\r\n\t a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);\r\n\t d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);\r\n\t c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);\r\n\t b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);\r\n\t\r\n\t a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);\r\n\t d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);\r\n\t c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);\r\n\t b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);\r\n\t a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);\r\n\t d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);\r\n\t c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);\r\n\t b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);\r\n\t a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);\r\n\t d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);\r\n\t c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);\r\n\t b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);\r\n\t a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);\r\n\t d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);\r\n\t c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);\r\n\t b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);\r\n\t\r\n\t a = safe_add(a, olda);\r\n\t b = safe_add(b, oldb);\r\n\t c = safe_add(c, oldc);\r\n\t d = safe_add(d, oldd);\r\n\t }\r\n\t return Array(a, b, c, d);\r\n\t\r\n\t}\r\n\t\r\n\t/*\r\n\t * These functions implement the four basic operations the algorithm uses.\r\n\t */\r\n\tfunction md5_cmn(q, a, b, x, s, t)\r\n\t{\r\n\t return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);\r\n\t}\r\n\tfunction md5_ff(a, b, c, d, x, s, t)\r\n\t{\r\n\t return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\r\n\t}\r\n\tfunction md5_gg(a, b, c, d, x, s, t)\r\n\t{\r\n\t return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\r\n\t}\r\n\tfunction md5_hh(a, b, c, d, x, s, t)\r\n\t{\r\n\t return md5_cmn(b ^ c ^ d, a, b, x, s, t);\r\n\t}\r\n\tfunction md5_ii(a, b, c, d, x, s, t)\r\n\t{\r\n\t return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\r\n\t}\r\n\t\r\n\t/*\r\n\t * Add integers, wrapping at 2^32. This uses 16-bit operations internally\r\n\t * to work around bugs in some JS interpreters.\r\n\t */\r\n\tfunction safe_add(x, y)\r\n\t{\r\n\t var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n\t var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n\t return (msw << 16) | (lsw & 0xFFFF);\r\n\t}\r\n\t\r\n\t/*\r\n\t * Bitwise rotate a 32-bit number to the left.\r\n\t */\r\n\tfunction bit_rol(num, cnt)\r\n\t{\r\n\t return (num << cnt) | (num >>> (32 - cnt));\r\n\t}\r\n\t\r\n\tmodule.exports = function md5(buf) {\r\n\t return helpers.hash(buf, core_md5, 16);\r\n\t};\r\n\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports) {\n\n\t// Original code adapted from Robert Kieffer.\n\t// details at https://github.com/broofa/node-uuid\n\t(function() {\n\t var _global = this;\n\t\n\t var mathRNG, whatwgRNG;\n\t\n\t // NOTE: Math.random() does not guarantee \"cryptographic quality\"\n\t mathRNG = function(size) {\n\t var bytes = new Array(size);\n\t var r;\n\t\n\t for (var i = 0, r; i < size; i++) {\n\t if ((i & 0x03) == 0) r = Math.random() * 0x100000000;\n\t bytes[i] = r >>> ((i & 0x03) << 3) & 0xff;\n\t }\n\t\n\t return bytes;\n\t }\n\t\n\t if (_global.crypto && crypto.getRandomValues) {\n\t whatwgRNG = function(size) {\n\t var bytes = new Uint8Array(size);\n\t crypto.getRandomValues(bytes);\n\t return bytes;\n\t }\n\t }\n\t\n\t module.exports = whatwgRNG || mathRNG;\n\t\n\t}())\n\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/*\n\t * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined\n\t * in FIPS PUB 180-1\n\t * Version 2.1a Copyright Paul Johnston 2000 - 2002.\n\t * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n\t * Distributed under the BSD License\n\t * See http://pajhome.org.uk/crypt/md5 for details.\n\t */\n\t\n\tvar helpers = __webpack_require__(2);\n\t\n\t/*\n\t * Calculate the SHA-1 of an array of big-endian words, and a bit length\n\t */\n\tfunction core_sha1(x, len)\n\t{\n\t /* append padding */\n\t x[len >> 5] |= 0x80 << (24 - len % 32);\n\t x[((len + 64 >> 9) << 4) + 15] = len;\n\t\n\t var w = Array(80);\n\t var a = 1732584193;\n\t var b = -271733879;\n\t var c = -1732584194;\n\t var d = 271733878;\n\t var e = -1009589776;\n\t\n\t for(var i = 0; i < x.length; i += 16)\n\t {\n\t var olda = a;\n\t var oldb = b;\n\t var oldc = c;\n\t var oldd = d;\n\t var olde = e;\n\t\n\t for(var j = 0; j < 80; j++)\n\t {\n\t if(j < 16) w[j] = x[i + j];\n\t else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\n\t var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n\t safe_add(safe_add(e, w[j]), sha1_kt(j)));\n\t e = d;\n\t d = c;\n\t c = rol(b, 30);\n\t b = a;\n\t a = t;\n\t }\n\t\n\t a = safe_add(a, olda);\n\t b = safe_add(b, oldb);\n\t c = safe_add(c, oldc);\n\t d = safe_add(d, oldd);\n\t e = safe_add(e, olde);\n\t }\n\t return Array(a, b, c, d, e);\n\t\n\t}\n\t\n\t/*\n\t * Perform the appropriate triplet combination function for the current\n\t * iteration\n\t */\n\tfunction sha1_ft(t, b, c, d)\n\t{\n\t if(t < 20) return (b & c) | ((~b) & d);\n\t if(t < 40) return b ^ c ^ d;\n\t if(t < 60) return (b & c) | (b & d) | (c & d);\n\t return b ^ c ^ d;\n\t}\n\t\n\t/*\n\t * Determine the appropriate additive constant for the current iteration\n\t */\n\tfunction sha1_kt(t)\n\t{\n\t return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :\n\t (t < 60) ? -1894007588 : -899497514;\n\t}\n\t\n\t/*\n\t * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n\t * to work around bugs in some JS interpreters.\n\t */\n\tfunction safe_add(x, y)\n\t{\n\t var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t return (msw << 16) | (lsw & 0xFFFF);\n\t}\n\t\n\t/*\n\t * Bitwise rotate a 32-bit number to the left.\n\t */\n\tfunction rol(num, cnt)\n\t{\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t}\n\t\n\tmodule.exports = function sha1(buf) {\n\t return helpers.hash(buf, core_sha1, 20, true);\n\t};\n\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t\n\t/**\n\t * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n\t * in FIPS 180-2\n\t * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n\t * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n\t *\n\t */\n\t\n\tvar helpers = __webpack_require__(2);\n\t\n\tvar safe_add = function(x, y) {\n\t var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n\t var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n\t return (msw << 16) | (lsw & 0xFFFF);\n\t};\n\t\n\tvar S = function(X, n) {\n\t return (X >>> n) | (X << (32 - n));\n\t};\n\t\n\tvar R = function(X, n) {\n\t return (X >>> n);\n\t};\n\t\n\tvar Ch = function(x, y, z) {\n\t return ((x & y) ^ ((~x) & z));\n\t};\n\t\n\tvar Maj = function(x, y, z) {\n\t return ((x & y) ^ (x & z) ^ (y & z));\n\t};\n\t\n\tvar Sigma0256 = function(x) {\n\t return (S(x, 2) ^ S(x, 13) ^ S(x, 22));\n\t};\n\t\n\tvar Sigma1256 = function(x) {\n\t return (S(x, 6) ^ S(x, 11) ^ S(x, 25));\n\t};\n\t\n\tvar Gamma0256 = function(x) {\n\t return (S(x, 7) ^ S(x, 18) ^ R(x, 3));\n\t};\n\t\n\tvar Gamma1256 = function(x) {\n\t return (S(x, 17) ^ S(x, 19) ^ R(x, 10));\n\t};\n\t\n\tvar core_sha256 = function(m, l) {\n\t var K = new Array(0x428A2F98,0x71374491,0xB5C0FBCF,0xE9B5DBA5,0x3956C25B,0x59F111F1,0x923F82A4,0xAB1C5ED5,0xD807AA98,0x12835B01,0x243185BE,0x550C7DC3,0x72BE5D74,0x80DEB1FE,0x9BDC06A7,0xC19BF174,0xE49B69C1,0xEFBE4786,0xFC19DC6,0x240CA1CC,0x2DE92C6F,0x4A7484AA,0x5CB0A9DC,0x76F988DA,0x983E5152,0xA831C66D,0xB00327C8,0xBF597FC7,0xC6E00BF3,0xD5A79147,0x6CA6351,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);\n\t var HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19);\n\t var W = new Array(64);\n\t var a, b, c, d, e, f, g, h, i, j;\n\t var T1, T2;\n\t /* append padding */\n\t m[l >> 5] |= 0x80 << (24 - l % 32);\n\t m[((l + 64 >> 9) << 4) + 15] = l;\n\t for (var i = 0; i < m.length; i += 16) {\n\t a = HASH[0]; b = HASH[1]; c = HASH[2]; d = HASH[3]; e = HASH[4]; f = HASH[5]; g = HASH[6]; h = HASH[7];\n\t for (var j = 0; j < 64; j++) {\n\t if (j < 16) {\n\t W[j] = m[j + i];\n\t } else {\n\t W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]);\n\t }\n\t T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]);\n\t T2 = safe_add(Sigma0256(a), Maj(a, b, c));\n\t h = g; g = f; f = e; e = safe_add(d, T1); d = c; c = b; b = a; a = safe_add(T1, T2);\n\t }\n\t HASH[0] = safe_add(a, HASH[0]); HASH[1] = safe_add(b, HASH[1]); HASH[2] = safe_add(c, HASH[2]); HASH[3] = safe_add(d, HASH[3]);\n\t HASH[4] = safe_add(e, HASH[4]); HASH[5] = safe_add(f, HASH[5]); HASH[6] = safe_add(g, HASH[6]); HASH[7] = safe_add(h, HASH[7]);\n\t }\n\t return HASH;\n\t};\n\t\n\tmodule.exports = function sha256(buf) {\n\t return helpers.hash(buf, core_sha256, 32, true);\n\t};\n\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// amazon-cognito-identity.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap fffd85ae780a6ea59b21","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { default as AuthenticationDetails } from './AuthenticationDetails';\nexport { default as AuthenticationHelper } from './AuthenticationHelper';\nexport { default as CognitoAccessToken } from './CognitoAccessToken';\nexport { default as CognitoIdToken } from './CognitoIdToken';\nexport { default as CognitoRefreshToken } from './CognitoRefreshToken';\nexport { default as CognitoUser } from './CognitoUser';\nexport { default as CognitoUserAttribute } from './CognitoUserAttribute';\nexport { default as CognitoUserPool } from './CognitoUserPool';\nexport { default as CognitoUserSession } from './CognitoUserSession';\nexport { default as CookieStorage } from './CookieStorage';\nexport { default as DateHelper } from './DateHelper';\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// /Users/wezhuo/workplace/aws-amplify/~/buffer/index.js\n// module id = 1\n// module chunks = 0","var Buffer = require('buffer').Buffer;\nvar intSize = 4;\nvar zeroBuffer = new Buffer(intSize); zeroBuffer.fill(0);\nvar chrsz = 8;\n\nfunction toArray(buf, bigEndian) {\n if ((buf.length % intSize) !== 0) {\n var len = buf.length + (intSize - (buf.length % intSize));\n buf = Buffer.concat([buf, zeroBuffer], len);\n }\n\n var arr = [];\n var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE;\n for (var i = 0; i < buf.length; i += intSize) {\n arr.push(fn.call(buf, i));\n }\n return arr;\n}\n\nfunction toBuffer(arr, size, bigEndian) {\n var buf = new Buffer(size);\n var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE;\n for (var i = 0; i < arr.length; i++) {\n fn.call(buf, arr[i], i * 4, true);\n }\n return buf;\n}\n\nfunction hash(buf, fn, hashSize, bigEndian) {\n if (!Buffer.isBuffer(buf)) buf = new Buffer(buf);\n var arr = fn(toArray(buf, bigEndian), buf.length * chrsz);\n return toBuffer(arr, hashSize, bigEndian);\n}\n\nmodule.exports = { hash: hash };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/crypto-browserify/helpers.js\n// module id = 2\n// module chunks = 0","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Buffer } from 'buffer/';\nimport * as crypto from 'crypto-browserify';\nconst createHash = crypto.createHash;\nconst createHmac = crypto.createHmac;\nconst randomBytes = crypto.randomBytes;\n\nimport BigInteger from './BigInteger';\n\nconst initN = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1'\n + '29024E088A67CC74020BBEA63B139B22514A08798E3404DD'\n + 'EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245'\n + 'E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED'\n + 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D'\n + 'C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F'\n + '83655D23DCA3AD961C62F356208552BB9ED529077096966D'\n + '670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B'\n + 'E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9'\n + 'DE2BCBF6955817183995497CEA956AE515D2261898FA0510'\n + '15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64'\n + 'ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7'\n + 'ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B'\n + 'F12FFA06D98A0864D87602733EC86A64521F2B18177B200C'\n + 'BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31'\n + '43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF';\n\nconst newPasswordRequiredChallengeUserAttributePrefix = 'userAttributes.';\n\n/** @class */\nexport default class AuthenticationHelper {\n /**\n * Constructs a new AuthenticationHelper object\n * @param {string} PoolName Cognito user pool name.\n */\n constructor(PoolName) {\n this.N = new BigInteger(initN, 16);\n this.g = new BigInteger('2', 16);\n this.k = new BigInteger(this.hexHash(`00${this.N.toString(16)}0${this.g.toString(16)}`), 16);\n\n this.smallAValue = this.generateRandomSmallA();\n this.getLargeAValue(() => {});\n\n this.infoBits = Buffer.from('Caldera Derived Key', 'utf8');\n\n this.poolName = PoolName;\n }\n\n /**\n * @returns {BigInteger} small A, a random number\n */\n getSmallAValue() {\n return this.smallAValue;\n }\n\n /**\n * @param {nodeCallback} callback Called with (err, largeAValue)\n * @returns {void}\n */\n getLargeAValue(callback) {\n if (this.largeAValue) {\n callback(null, this.largeAValue);\n } else {\n this.calculateA(this.smallAValue, (err, largeAValue) => {\n if (err) {\n callback(err, null);\n }\n\n this.largeAValue = largeAValue;\n callback(null, this.largeAValue);\n });\n }\n }\n\n /**\n * helper function to generate a random big integer\n * @returns {BigInteger} a random value.\n * @private\n */\n generateRandomSmallA() {\n const hexRandom = randomBytes(128).toString('hex');\n\n const randomBigInt = new BigInteger(hexRandom, 16);\n const smallABigInt = randomBigInt.mod(this.N);\n\n return smallABigInt;\n }\n\n /**\n * helper function to generate a random string\n * @returns {string} a random value.\n * @private\n */\n generateRandomString() {\n return randomBytes(40).toString('base64');\n }\n\n /**\n * @returns {string} Generated random value included in password hash.\n */\n getRandomPassword() {\n return this.randomPassword;\n }\n\n /**\n * @returns {string} Generated random value included in devices hash.\n */\n getSaltDevices() {\n return this.SaltToHashDevices;\n }\n\n /**\n * @returns {string} Value used to verify devices.\n */\n getVerifierDevices() {\n return this.verifierDevices;\n }\n\n /**\n * Generate salts and compute verifier.\n * @param {string} deviceGroupKey Devices to generate verifier for.\n * @param {string} username User to generate verifier for.\n * @param {nodeCallback} callback Called with (err, null)\n * @returns {void}\n */\n generateHashDevice(deviceGroupKey, username, callback) {\n this.randomPassword = this.generateRandomString();\n const combinedString = `${deviceGroupKey}${username}:${this.randomPassword}`;\n const hashedString = this.hash(combinedString);\n\n const hexRandom = randomBytes(16).toString('hex');\n this.SaltToHashDevices = this.padHex(new BigInteger(hexRandom, 16));\n\n this.g.modPow(\n new BigInteger(this.hexHash(this.SaltToHashDevices + hashedString), 16),\n this.N,\n (err, verifierDevicesNotPadded) => {\n if (err) {\n callback(err, null);\n }\n\n this.verifierDevices = this.padHex(verifierDevicesNotPadded);\n callback(null, null);\n });\n }\n\n /**\n * Calculate the client's public value A = g^a%N\n * with the generated random number a\n * @param {BigInteger} a Randomly generated small A.\n * @param {nodeCallback} callback Called with (err, largeAValue)\n * @returns {void}\n * @private\n */\n calculateA(a, callback) {\n this.g.modPow(a, this.N, (err, A) => {\n if (err) {\n callback(err, null);\n }\n\n if (A.mod(this.N).equals(BigInteger.ZERO)) {\n callback(new Error('Illegal paramater. A mod N cannot be 0.'), null);\n }\n\n callback(null, A);\n });\n }\n\n /**\n * Calculate the client's value U which is the hash of A and B\n * @param {BigInteger} A Large A value.\n * @param {BigInteger} B Server B value.\n * @returns {BigInteger} Computed U value.\n * @private\n */\n calculateU(A, B) {\n this.UHexHash = this.hexHash(this.padHex(A) + this.padHex(B));\n const finalU = new BigInteger(this.UHexHash, 16);\n\n return finalU;\n }\n\n /**\n * Calculate a hash from a bitArray\n * @param {Buffer} buf Value to hash.\n * @returns {String} Hex-encoded hash.\n * @private\n */\n hash(buf) {\n const hashHex = createHash('sha256').update(buf).digest('hex');\n return (new Array(64 - hashHex.length).join('0')) + hashHex;\n }\n\n /**\n * Calculate a hash from a hex string\n * @param {String} hexStr Value to hash.\n * @returns {String} Hex-encoded hash.\n * @private\n */\n hexHash(hexStr) {\n return this.hash(Buffer.from(hexStr, 'hex'));\n }\n\n /**\n * Standard hkdf algorithm\n * @param {Buffer} ikm Input key material.\n * @param {Buffer} salt Salt value.\n * @returns {Buffer} Strong key material.\n * @private\n */\n computehkdf(ikm, salt) {\n const prk = createHmac('sha256', salt).update(ikm).digest();\n const infoBitsUpdate = Buffer.concat([\n this.infoBits,\n Buffer.from(String.fromCharCode(1), 'utf8'),\n ]);\n const hmac = createHmac('sha256', prk).update(infoBitsUpdate).digest();\n return hmac.slice(0, 16);\n }\n\n /**\n * Calculates the final hkdf based on computed S value, and computed U value and the key\n * @param {String} username Username.\n * @param {String} password Password.\n * @param {BigInteger} serverBValue Server B value.\n * @param {BigInteger} salt Generated salt.\n * @param {nodeCallback} callback Called with (err, hkdfValue)\n * @returns {void}\n */\n getPasswordAuthenticationKey(username, password, serverBValue, salt, callback) {\n if (serverBValue.mod(this.N).equals(BigInteger.ZERO)) {\n throw new Error('B cannot be zero.');\n }\n\n this.UValue = this.calculateU(this.largeAValue, serverBValue);\n\n if (this.UValue.equals(BigInteger.ZERO)) {\n throw new Error('U cannot be zero.');\n }\n\n const usernamePassword = `${this.poolName}${username}:${password}`;\n const usernamePasswordHash = this.hash(usernamePassword);\n\n const xValue = new BigInteger(this.hexHash(this.padHex(salt) + usernamePasswordHash), 16);\n this.calculateS(xValue, serverBValue, (err, sValue) => {\n if (err) {\n callback(err, null);\n }\n\n const hkdf = this.computehkdf(\n Buffer.from(this.padHex(sValue), 'hex'),\n Buffer.from(this.padHex(this.UValue.toString(16)), 'hex'));\n\n callback(null, hkdf);\n });\n }\n\n /**\n * Calculates the S value used in getPasswordAuthenticationKey\n * @param {BigInteger} xValue Salted password hash value.\n * @param {BigInteger} serverBValue Server B value.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n calculateS(xValue, serverBValue, callback) {\n this.g.modPow(xValue, this.N, (err, gModPowXN) => {\n if (err) {\n callback(err, null);\n }\n\n const intValue2 = serverBValue.subtract(this.k.multiply(gModPowXN));\n intValue2.modPow(\n this.smallAValue.add(this.UValue.multiply(xValue)),\n this.N,\n (err2, result) => {\n if (err2) {\n callback(err2, null);\n }\n\n callback(null, result.mod(this.N));\n }\n );\n });\n }\n\n /**\n * Return constant newPasswordRequiredChallengeUserAttributePrefix\n * @return {newPasswordRequiredChallengeUserAttributePrefix} constant prefix value\n */\n getNewPasswordRequiredChallengeUserAttributePrefix() {\n return newPasswordRequiredChallengeUserAttributePrefix;\n }\n\n /**\n * Converts a BigInteger (or hex string) to hex format padded with zeroes for hashing\n * @param {BigInteger|String} bigInt Number or string to pad.\n * @returns {String} Padded hex string.\n */\n padHex(bigInt) {\n let hashStr = bigInt.toString(16);\n if (hashStr.length % 2 === 1) {\n hashStr = `0${hashStr}`;\n } else if ('89ABCDEFabcdef'.indexOf(hashStr[0]) !== -1) {\n hashStr = `00${hashStr}`;\n }\n return hashStr;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/AuthenticationHelper.js","// A small implementation of BigInteger based on http://www-cs-students.stanford.edu/~tjw/jsbn/\n//\n// All public methods have been removed except the following:\n// new BigInteger(a, b) (only radix 2, 4, 8, 16 and 32 supported)\n// toString (only radix 2, 4, 8, 16 and 32 supported)\n// negate\n// abs\n// compareTo\n// bitLength\n// mod\n// equals\n// add\n// subtract\n// multiply\n// divide\n// modPow\n\nexport default BigInteger;\n\n/*\n * Copyright (c) 2003-2005 Tom Wu\n * All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n *\n * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,\n * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER\n * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF\n * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT\n * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * In addition, the following condition applies:\n *\n * All redistributions must retain an intact copy of this copyright notice\n * and disclaimer.\n */\n\n// (public) Constructor\nfunction BigInteger(a, b) {\n if (a != null) this.fromString(a, b);\n}\n\n// return new, unset BigInteger\nfunction nbi() {\n return new BigInteger(null);\n}\n\n// Bits per digit\nvar dbits;\n\n// JavaScript engine analysis\nvar canary = 0xdeadbeefcafe;\nvar j_lm = ((canary&0xffffff)==0xefcafe);\n\n// am: Compute w_j += (x*this_i), propagate carries,\n// c is initial carry, returns final carry.\n// c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n// We need to select the fastest one that works in this environment.\n\n// am1: use a single mult and divide to get the high bits,\n// max digit bits should be 26 because\n// max internal value = 2*dvalue^2-2*dvalue (< 2^53)\nfunction am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this[i++]+w[j]+c;\n c = Math.floor(v/0x4000000);\n w[j++] = v&0x3ffffff;\n }\n return c;\n}\n// am2 avoids a big mult-and-extract completely.\n// Max digit bits should be <= 30 because we do bitwise ops\n// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\nfunction am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n}\n// Alternately, set max digit bits to 28 since some\n// browsers slow down when dealing with 32-bit numbers.\nfunction am3(i,x,w,j,c,n) {\n var xl = x&0x3fff, xh = x>>14;\n while(--n >= 0) {\n var l = this[i]&0x3fff;\n var h = this[i++]>>14;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x3fff)<<14)+w[j]+c;\n c = (l>>28)+(m>>14)+xh*h;\n w[j++] = l&0xfffffff;\n }\n return c;\n}\nvar inBrowser = typeof navigator !== \"undefined\";\nif(inBrowser && j_lm && (navigator.appName == \"Microsoft Internet Explorer\")) {\n BigInteger.prototype.am = am2;\n dbits = 30;\n}\nelse if(inBrowser && j_lm && (navigator.appName != \"Netscape\")) {\n BigInteger.prototype.am = am1;\n dbits = 26;\n}\nelse { // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n}\n\nBigInteger.prototype.DB = dbits;\nBigInteger.prototype.DM = (1 << dbits) - 1;\nBigInteger.prototype.DV = 1 << dbits;\n\nvar BI_FP = 52;\nBigInteger.prototype.FV = Math.pow(2, BI_FP);\nBigInteger.prototype.F1 = BI_FP - dbits;\nBigInteger.prototype.F2 = 2 * dbits - BI_FP;\n\n// Digit conversions\nvar BI_RM = \"0123456789abcdefghijklmnopqrstuvwxyz\";\nvar BI_RC = new Array();\nvar rr, vv;\nrr = \"0\".charCodeAt(0);\nfor (vv = 0; vv <= 9; ++vv)\n BI_RC[rr++] = vv;\nrr = \"a\".charCodeAt(0);\nfor (vv = 10; vv < 36; ++vv)\n BI_RC[rr++] = vv;\nrr = \"A\".charCodeAt(0);\nfor (vv = 10; vv < 36; ++vv)\n BI_RC[rr++] = vv;\n\nfunction int2char(n) {\n return BI_RM.charAt(n);\n}\nfunction intAt(s, i) {\n var c = BI_RC[s.charCodeAt(i)];\n return c == null ? -1 : c;\n}\n\n// (protected) copy this to r\nfunction bnpCopyTo(r) {\n for (var i = this.t - 1; i >= 0; --i)\n r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n}\n\n// (protected) set from integer value x, -DV <= x < DV\nfunction bnpFromInt(x) {\n this.t = 1;\n this.s = x < 0 ? -1 : 0;\n if (x > 0) this[0] = x;\n else if (x < -1) this[0] = x + this.DV;\n else this.t = 0;\n}\n\n// return bigint initialized to value\nfunction nbv(i) {\n var r = nbi();\n\n r.fromInt(i);\n\n return r;\n}\n\n// (protected) set from string and radix\nfunction bnpFromString(s, b) {\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else throw new Error(\"Only radix 2, 4, 8, 16, 32 are supported\");\n this.t = 0;\n this.s = 0;\n var i = s.length, mi = false, sh = 0;\n while (--i >= 0) {\n var x = intAt(s, i);\n if (x < 0) {\n if (s.charAt(i) == \"-\") mi = true;\n continue;\n }\n mi = false;\n if (sh == 0) this[this.t++] = x;\n else if (sh + k > this.DB) {\n this[this.t - 1] |= (x & (1 << this.DB - sh) - 1) << sh;\n this[this.t++] = x >> this.DB - sh;\n } else this[this.t - 1] |= x << sh;\n sh += k;\n if (sh >= this.DB) sh -= this.DB;\n }\n this.clamp();\n if (mi) BigInteger.ZERO.subTo(this, this);\n}\n\n// (protected) clamp off excess high words\nfunction bnpClamp() {\n var c = this.s & this.DM;\n while (this.t > 0 && this[this.t - 1] == c)\n --this.t;\n}\n\n// (public) return string representation in given radix\nfunction bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString();\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else throw new Error(\"Only radix 2, 4, 8, 16, 32 are supported\");\n var km = (1 << k) - 1, d, m = false, r = \"\", i = this.t;\n var p = this.DB - i * this.DB % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & (1 << p) - 1) << k - p;\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = this[i] >> (p -= k) & km;\n if (p <= 0) {\n p += this.DB;\n --i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n}\n\n// (public) -this\nfunction bnNegate() {\n var r = nbi();\n\n BigInteger.ZERO.subTo(this, r);\n\n return r;\n}\n\n// (public) |this|\nfunction bnAbs() {\n return this.s < 0 ? this.negate() : this;\n}\n\n// (public) return + if this > a, - if this < a, 0 if equal\nfunction bnCompareTo(a) {\n var r = this.s - a.s;\n if (r != 0) return r;\n var i = this.t;\n r = i - a.t;\n if (r != 0) return this.s < 0 ? -r : r;\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0) return r;\n return 0;\n}\n\n// returns bit length of the integer x\nfunction nbits(x) {\n var r = 1, t;\n if ((t = x >>> 16) != 0) {\n x = t;\n r += 16;\n }\n if ((t = x >> 8) != 0) {\n x = t;\n r += 8;\n }\n if ((t = x >> 4) != 0) {\n x = t;\n r += 4;\n }\n if ((t = x >> 2) != 0) {\n x = t;\n r += 2;\n }\n if ((t = x >> 1) != 0) {\n x = t;\n r += 1;\n }\n return r;\n}\n\n// (public) return the number of bits in \"this\"\nfunction bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n}\n\n// (protected) r = this << n*DB\nfunction bnpDLShiftTo(n, r) {\n var i;\n for (i = this.t - 1; i >= 0; --i)\n r[i + n] = this[i];\n for (i = n - 1; i >= 0; --i)\n r[i] = 0;\n r.t = this.t + n;\n r.s = this.s;\n}\n\n// (protected) r = this >> n*DB\nfunction bnpDRShiftTo(n, r) {\n for (var i = n; i < this.t; ++i)\n r[i - n] = this[i];\n r.t = Math.max(this.t - n, 0);\n r.s = this.s;\n}\n\n// (protected) r = this << n\nfunction bnpLShiftTo(n, r) {\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << cbs) - 1;\n var ds = Math.floor(n / this.DB), c = this.s << bs & this.DM, i;\n for (i = this.t - 1; i >= 0; --i) {\n r[i + ds + 1] = this[i] >> cbs | c;\n c = (this[i] & bm) << bs;\n }\n for (i = ds - 1; i >= 0; --i)\n r[i] = 0;\n r[ds] = c;\n r.t = this.t + ds + 1;\n r.s = this.s;\n r.clamp();\n}\n\n// (protected) r = this >> n\nfunction bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n}\n\n// (protected) r = this - a\nfunction bnpSubTo(a, r) {\n var i = 0, c = 0, m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] - a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c -= a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c -= a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c -= a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c < -1) r[i++] = this.DV + c;\n else if (c > 0) r[i++] = c;\n r.t = i;\n r.clamp();\n}\n\n// (protected) r = this * a, r != this,a (HAC 14.12)\n// \"this\" should be the larger one if appropriate.\nfunction bnpMultiplyTo(a, r) {\n var x = this.abs(), y = a.abs();\n var i = x.t;\n r.t = i + y.t;\n while (--i >= 0)\n r[i] = 0;\n for (i = 0; i < y.t; ++i)\n r[i + x.t] = x.am(0, y[i], r, i, 0, x.t);\n r.s = 0;\n r.clamp();\n if (this.s != a.s) BigInteger.ZERO.subTo(r, r);\n}\n\n// (protected) r = this^2, r != this (HAC 14.16)\nfunction bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2 * x.t;\n while (--i >= 0)\n r[i] = 0;\n for (i = 0; i < x.t - 1; ++i) {\n var c = x.am(i, x[i], r, 2 * i, 0, 1);\n if (\n (r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >=\n x.DV\n ) {\n r[i + x.t] -= x.DV;\n r[i + x.t + 1] = 1;\n }\n }\n if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1);\n r.s = 0;\n r.clamp();\n}\n\n// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n// r != q, this != m. q or r may be null.\nfunction bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]);\n // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;\n var i = r.t, j = i - ys, t = q == null ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y);\n // \"negative\" y so we can replace sub with am later\n while (y.t < ys)\n y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = r[--i] == y0\n ? this.DM\n : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r);\n // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n}\n\n// (public) this mod a\nfunction bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a, null, r);\n if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r);\n return r;\n}\n\n// (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n// justification:\n// xy == 1 (mod m)\n// xy = 1+km\n// xy(2-xy) = (1+km)(1-km)\n// x[y(2-xy)] = 1-k^2m^2\n// x[y(2-xy)] == 1 (mod m^2)\n// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n// JS multiply \"overflows\" differently from C/C++, so care is needed here.\nfunction bnpInvDigit() {\n if (this.t < 1) return 0;\n var x = this[0];\n if ((x & 1) == 0) return 0;\n var y = x & 3;\n // y == 1/x mod 2^2\n y = y * (2 - (x & 0xf) * y) & 0xf;\n // y == 1/x mod 2^4\n y = y * (2 - (x & 0xff) * y) & 0xff;\n // y == 1/x mod 2^8\n y = y * (2 - ((x & 0xffff) * y & 0xffff)) & 0xffff;\n // y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n y = y * (2 - x * y % this.DV) % this.DV;\n // y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n return y > 0 ? this.DV - y : -y;\n}\n\nfunction bnEquals(a) {\n return this.compareTo(a) == 0;\n}\n\n// (protected) r = this + a\nfunction bnpAddTo(a, r) {\n var i = 0, c = 0, m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c > 0) r[i++] = c;\n else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n}\n\n// (public) this + a\nfunction bnAdd(a) {\n var r = nbi();\n\n this.addTo(a, r);\n\n return r;\n}\n\n// (public) this - a\nfunction bnSubtract(a) {\n var r = nbi();\n\n this.subTo(a, r);\n\n return r;\n}\n\n// (public) this * a\nfunction bnMultiply(a) {\n var r = nbi();\n\n this.multiplyTo(a, r);\n\n return r;\n}\n\n// (public) this / a\nfunction bnDivide(a) {\n var r = nbi();\n\n this.divRemTo(a, r, null);\n\n return r;\n}\n\n// Montgomery reduction\nfunction Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp & 0x7fff;\n this.mph = this.mp >> 15;\n this.um = (1 << m.DB - 15) - 1;\n this.mt2 = 2 * m.t;\n}\n\n// xR mod m\nfunction montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t, r);\n r.divRemTo(this.m, null, r);\n if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r);\n return r;\n}\n\n// x/R mod m\nfunction montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n}\n\n// x = x/R mod m (HAC 14.32)\nfunction montReduce(x) {\n while (x.t <= this.mt2)\n // pad x so am has enough room later\n x[x.t++] = 0;\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = j * this.mpl +\n ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) &\n x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n}\n\n// r = \"x^2/R mod m\"; x != r\nfunction montSqrTo(x, r) {\n x.squareTo(r);\n\n this.reduce(r);\n}\n\n// r = \"xy/R mod m\"; x,y != r\nfunction montMulTo(x, y, r) {\n x.multiplyTo(y, r);\n\n this.reduce(r);\n}\n\nMontgomery.prototype.convert = montConvert;\nMontgomery.prototype.revert = montRevert;\nMontgomery.prototype.reduce = montReduce;\nMontgomery.prototype.mulTo = montMulTo;\nMontgomery.prototype.sqrTo = montSqrTo;\n\n// (public) this^e % m (HAC 14.85)\nfunction bnModPow(e, m, callback) {\n var i = e.bitLength(), k, r = nbv(1), z = new Montgomery(m);\n if (i <= 0) return r;\n else if (i < 18) k = 1;\n else if (i < 48) k = 3;\n else if (i < 144) k = 4;\n else if (i < 768) k = 5;\n else k = 6;\n\n // precomputation\n var g = new Array(), n = 3, k1 = k - 1, km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;\n else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);\n else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n var result = z.revert(r);\n callback(null, result);\n return result;\n}\n\n// protected\nBigInteger.prototype.copyTo = bnpCopyTo;\nBigInteger.prototype.fromInt = bnpFromInt;\nBigInteger.prototype.fromString = bnpFromString;\nBigInteger.prototype.clamp = bnpClamp;\nBigInteger.prototype.dlShiftTo = bnpDLShiftTo;\nBigInteger.prototype.drShiftTo = bnpDRShiftTo;\nBigInteger.prototype.lShiftTo = bnpLShiftTo;\nBigInteger.prototype.rShiftTo = bnpRShiftTo;\nBigInteger.prototype.subTo = bnpSubTo;\nBigInteger.prototype.multiplyTo = bnpMultiplyTo;\nBigInteger.prototype.squareTo = bnpSquareTo;\nBigInteger.prototype.divRemTo = bnpDivRemTo;\nBigInteger.prototype.invDigit = bnpInvDigit;\nBigInteger.prototype.addTo = bnpAddTo;\n\n// public\nBigInteger.prototype.toString = bnToString;\nBigInteger.prototype.negate = bnNegate;\nBigInteger.prototype.abs = bnAbs;\nBigInteger.prototype.compareTo = bnCompareTo;\nBigInteger.prototype.bitLength = bnBitLength;\nBigInteger.prototype.mod = bnMod;\nBigInteger.prototype.equals = bnEquals;\nBigInteger.prototype.add = bnAdd;\nBigInteger.prototype.subtract = bnSubtract;\nBigInteger.prototype.multiply = bnMultiply;\nBigInteger.prototype.divide = bnDivide;\nBigInteger.prototype.modPow = bnModPow;\n\n// \"constants\"\nBigInteger.ZERO = nbv(0);\nBigInteger.ONE = nbv(1);\n\n\n\n\n// WEBPACK FOOTER //\n// ./src/BigInteger.js","/*\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport CognitoJwtToken from './CognitoJwtToken';\n\n/** @class */\nexport default class CognitoAccessToken extends CognitoJwtToken {\n /**\n * Constructs a new CognitoAccessToken object\n * @param {string=} AccessToken The JWT access token.\n */\n constructor({ AccessToken } = {}) {\n super(AccessToken || '');\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoAccessToken.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport CognitoJwtToken from './CognitoJwtToken';\n\n/** @class */\nexport default class CognitoIdToken extends CognitoJwtToken {\n /**\n * Constructs a new CognitoIdToken object\n * @param {string=} IdToken The JWT Id token\n */\n constructor({ IdToken } = {}) {\n super(IdToken || '');\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoIdToken.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Buffer } from 'buffer/';\n\n/** @class */\nexport default class CognitoJwtToken {\n /**\n * Constructs a new CognitoJwtToken object\n * @param {string=} token The JWT token.\n */\n constructor(token) {\n // Assign object\n this.jwtToken = token || '';\n this.payload = this.decodePayload();\n }\n\n /**\n * @returns {string} the record's token.\n */\n getJwtToken() {\n return this.jwtToken;\n }\n\n /**\n * @returns {int} the token's expiration (exp member).\n */\n getExpiration() {\n return this.payload.exp;\n }\n\n /**\n * @returns {int} the token's \"issued at\" (iat member).\n */\n getIssuedAt() {\n return this.payload.iat;\n }\n\n /**\n * @returns {object} the token's payload.\n */\n decodePayload() {\n const payload = this.jwtToken.split('.')[1];\n try {\n return JSON.parse(Buffer.from(payload, 'base64').toString('utf8'));\n } catch (err) {\n return {};\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoJwtToken.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nexport default class CognitoRefreshToken {\n /**\n * Constructs a new CognitoRefreshToken object\n * @param {string=} RefreshToken The JWT refresh token.\n */\n constructor({ RefreshToken } = {}) {\n // Assign object\n this.token = RefreshToken || '';\n }\n\n /**\n * @returns {string} the record's token.\n */\n getToken() {\n return this.token;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoRefreshToken.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Buffer } from 'buffer/';\n//import createHmac from 'create-hmac';\nimport * as crypto from 'crypto-browserify';\nconst createHmac = crypto.createHmac;\n\nimport BigInteger from './BigInteger';\nimport AuthenticationHelper from './AuthenticationHelper';\nimport CognitoAccessToken from './CognitoAccessToken';\nimport CognitoIdToken from './CognitoIdToken';\nimport CognitoRefreshToken from './CognitoRefreshToken';\nimport CognitoUserSession from './CognitoUserSession';\nimport DateHelper from './DateHelper';\nimport CognitoUserAttribute from './CognitoUserAttribute';\nimport StorageHelper from './StorageHelper';\n\n/**\n * @callback nodeCallback\n * @template T result\n * @param {*} err The operation failure reason, or null.\n * @param {T} result The operation result.\n */\n\n/**\n * @callback onFailure\n * @param {*} err Failure reason.\n */\n\n/**\n * @callback onSuccess\n * @template T result\n * @param {T} result The operation result.\n */\n\n/**\n * @callback mfaRequired\n * @param {*} details MFA challenge details.\n */\n\n/**\n * @callback customChallenge\n * @param {*} details Custom challenge details.\n */\n\n/**\n * @callback inputVerificationCode\n * @param {*} data Server response.\n */\n\n/**\n * @callback authSuccess\n * @param {CognitoUserSession} session The new session.\n * @param {bool=} userConfirmationNecessary User must be confirmed.\n */\n\n\n/** @class */\nexport default class CognitoUser {\n /**\n * Constructs a new CognitoUser object\n * @param {object} data Creation options\n * @param {string} data.Username The user's username.\n * @param {CognitoUserPool} data.Pool Pool containing the user.\n * @param {object} data.Storage Optional storage object.\n */\n constructor(data) {\n if (data == null || data.Username == null || data.Pool == null) {\n throw new Error('Username and pool information are required.');\n }\n\n this.username = data.Username || '';\n this.pool = data.Pool;\n this.Session = null;\n\n this.client = data.Pool.client;\n\n this.signInUserSession = null;\n this.authenticationFlowType = 'USER_SRP_AUTH';\n\n this.storage = data.Storage || new StorageHelper().getStorage();\n }\n\n /**\n * Sets the session for this user\n * @param {CognitoUserSession} signInUserSession the session\n * @returns {void}\n */\n setSignInUserSession(signInUserSession) {\n this.clearCachedTokens();\n this.signInUserSession = signInUserSession;\n this.cacheTokens();\n }\n\n /**\n * @returns {CognitoUserSession} the current session for this user\n */\n getSignInUserSession() {\n return this.signInUserSession;\n }\n\n /**\n * @returns {string} the user's username\n */\n getUsername() {\n return this.username;\n }\n\n /**\n * @returns {String} the authentication flow type\n */\n getAuthenticationFlowType() {\n return this.authenticationFlowType;\n }\n\n /**\n * sets authentication flow type\n * @param {string} authenticationFlowType New value.\n * @returns {void}\n */\n setAuthenticationFlowType(authenticationFlowType) {\n this.authenticationFlowType = authenticationFlowType;\n }\n\n\n /**\n * This is used for authenticating the user through the custom authentication flow.\n * @param {AuthenticationDetails} authDetails Contains the authentication data\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n initiateAuth(authDetails, callback) {\n const authParameters = authDetails.getAuthParameters();\n authParameters.USERNAME = this.username;\n\n const jsonReq = {\n AuthFlow: 'CUSTOM_AUTH',\n ClientId: this.pool.getClientId(),\n AuthParameters: authParameters,\n ClientMetadata: authDetails.getValidationData(),\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.request('InitiateAuth', jsonReq, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n const challengeName = data.ChallengeName;\n const challengeParameters = data.ChallengeParameters;\n\n if (challengeName === 'CUSTOM_CHALLENGE') {\n this.Session = data.Session;\n return callback.customChallenge(challengeParameters);\n }\n this.signInUserSession = this.getCognitoUserSession(data.AuthenticationResult);\n this.cacheTokens();\n return callback.onSuccess(this.signInUserSession);\n });\n }\n\n /**\n * This is used for authenticating the user.\n * stuff\n * @param {AuthenticationDetails} authDetails Contains the authentication data\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {newPasswordRequired} callback.newPasswordRequired new\n * password and any required attributes are required to continue\n * @param {mfaRequired} callback.mfaRequired MFA code\n * required to continue.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n authenticateUser(authDetails, callback) {\n if (this.authenticationFlowType === 'USER_PASSWORD_AUTH') {\n return this.authenticateUserPlainUsernamePassword(authDetails, callback);\n } else if (this.authenticationFlowType === 'USER_SRP_AUTH') {\n return this.authenticateUserDefaultAuth(authDetails, callback);\n }\n return callback.onFailure(new Error('Authentication flow type is invalid.'));\n }\n\n /**\n * This is used for authenticating the user. it calls the AuthenticationHelper for SRP related\n * stuff\n * @param {AuthenticationDetails} authDetails Contains the authentication data\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {newPasswordRequired} callback.newPasswordRequired new\n * password and any required attributes are required to continue\n * @param {mfaRequired} callback.mfaRequired MFA code\n * required to continue.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n authenticateUserDefaultAuth(authDetails, callback) {\n const authenticationHelper = new AuthenticationHelper(\n this.pool.getUserPoolId().split('_')[1]);\n const dateHelper = new DateHelper();\n\n let serverBValue;\n let salt;\n const authParameters = {};\n\n if (this.deviceKey != null) {\n authParameters.DEVICE_KEY = this.deviceKey;\n }\n\n authParameters.USERNAME = this.username;\n authenticationHelper.getLargeAValue((errOnAValue, aValue) => {\n // getLargeAValue callback start\n if (errOnAValue) {\n callback.onFailure(errOnAValue);\n }\n\n authParameters.SRP_A = aValue.toString(16);\n\n if (this.authenticationFlowType === 'CUSTOM_AUTH') {\n authParameters.CHALLENGE_NAME = 'SRP_A';\n }\n\n const jsonReq = {\n AuthFlow: this.authenticationFlowType,\n ClientId: this.pool.getClientId(),\n AuthParameters: authParameters,\n ClientMetadata: authDetails.getValidationData(),\n };\n if (this.getUserContextData(this.username)) {\n jsonReq.UserContextData = this.getUserContextData(this.username);\n }\n\n this.client.request('InitiateAuth', jsonReq, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n\n const challengeParameters = data.ChallengeParameters;\n\n this.username = challengeParameters.USER_ID_FOR_SRP;\n serverBValue = new BigInteger(challengeParameters.SRP_B, 16);\n salt = new BigInteger(challengeParameters.SALT, 16);\n this.getCachedDeviceKeyAndPassword();\n\n authenticationHelper.getPasswordAuthenticationKey(\n this.username,\n authDetails.getPassword(),\n serverBValue,\n salt,\n (errOnHkdf, hkdf) => {\n // getPasswordAuthenticationKey callback start\n if (errOnHkdf) {\n callback.onFailure(errOnHkdf);\n }\n\n const dateNow = dateHelper.getNowString();\n\n const signatureString = createHmac('sha256', hkdf)\n .update(Buffer.concat([\n Buffer.from(this.pool.getUserPoolId().split('_')[1], 'utf8'),\n Buffer.from(this.username, 'utf8'),\n Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'),\n Buffer.from(dateNow, 'utf8'),\n ]))\n .digest('base64');\n\n const challengeResponses = {};\n\n challengeResponses.USERNAME = this.username;\n challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK;\n challengeResponses.TIMESTAMP = dateNow;\n challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString;\n\n if (this.deviceKey != null) {\n challengeResponses.DEVICE_KEY = this.deviceKey;\n }\n\n const respondToAuthChallenge = (challenge, challengeCallback) =>\n this.client.request('RespondToAuthChallenge', challenge,\n (errChallenge, dataChallenge) => {\n if (errChallenge && errChallenge.code === 'ResourceNotFoundException' &&\n errChallenge.message.toLowerCase().indexOf('device') !== -1) {\n challengeResponses.DEVICE_KEY = null;\n this.deviceKey = null;\n this.randomPassword = null;\n this.deviceGroupKey = null;\n this.clearCachedDeviceKeyAndPassword();\n return respondToAuthChallenge(challenge, challengeCallback);\n }\n return challengeCallback(errChallenge, dataChallenge);\n });\n\n const jsonReqResp = {\n ChallengeName: 'PASSWORD_VERIFIER',\n ClientId: this.pool.getClientId(),\n ChallengeResponses: challengeResponses,\n Session: data.Session,\n };\n if (this.getUserContextData()) {\n jsonReqResp.UserContextData = this.getUserContextData();\n }\n respondToAuthChallenge(jsonReqResp, (errAuthenticate, dataAuthenticate) => {\n if (errAuthenticate) {\n return callback.onFailure(errAuthenticate);\n }\n\n const challengeName = dataAuthenticate.ChallengeName;\n if (challengeName === 'NEW_PASSWORD_REQUIRED') {\n this.Session = dataAuthenticate.Session;\n let userAttributes = null;\n let rawRequiredAttributes = null;\n const requiredAttributes = [];\n const userAttributesPrefix = authenticationHelper\n .getNewPasswordRequiredChallengeUserAttributePrefix();\n\n if (dataAuthenticate.ChallengeParameters) {\n userAttributes = JSON.parse(\n dataAuthenticate.ChallengeParameters.userAttributes);\n rawRequiredAttributes = JSON.parse(\n dataAuthenticate.ChallengeParameters.requiredAttributes);\n }\n\n if (rawRequiredAttributes) {\n for (let i = 0; i < rawRequiredAttributes.length; i++) {\n requiredAttributes[i] = rawRequiredAttributes[i].substr(\n userAttributesPrefix.length\n );\n }\n }\n return callback.newPasswordRequired(userAttributes, requiredAttributes);\n }\n return this.authenticateUserInternal(\n dataAuthenticate,\n authenticationHelper,\n callback\n );\n });\n return undefined;\n // getPasswordAuthenticationKey callback end\n });\n return undefined;\n });\n // getLargeAValue callback end\n });\n }\n\n /**\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n * @param {AuthenticationDetails} authDetails Contains the authentication data.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {mfaRequired} callback.mfaRequired MFA code\n * required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n authenticateUserPlainUsernamePassword(authDetails, callback) {\n const authParameters = {};\n authParameters.USERNAME = this.username;\n authParameters.PASSWORD = authDetails.getPassword();\n if (!authParameters.PASSWORD) {\n callback.onFailure(new Error('PASSWORD parameter is required'));\n return;\n }\n const authenticationHelper = new AuthenticationHelper(\n this.pool.getUserPoolId().split('_')[1]);\n this.getCachedDeviceKeyAndPassword();\n if (this.deviceKey != null) {\n authParameters.DEVICE_KEY = this.deviceKey;\n }\n\n const jsonReq = {\n AuthFlow: 'USER_PASSWORD_AUTH',\n ClientId: this.pool.getClientId(),\n AuthParameters: authParameters,\n ClientMetadata: authDetails.getValidationData(),\n };\n if (this.getUserContextData(this.username)) {\n jsonReq.UserContextData = this.getUserContextData(this.username);\n }\n // USER_PASSWORD_AUTH happens in a single round-trip: client sends userName and password,\n // Cognito UserPools verifies password and returns tokens.\n this.client.request('InitiateAuth', jsonReq, (err, authResult) => {\n if (err) {\n return callback.onFailure(err);\n }\n return this.authenticateUserInternal(authResult, authenticationHelper, callback);\n });\n }\n\n /**\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n * @param {object} dataAuthenticate authentication data\n * @param {object} authenticationHelper helper created\n * @param {callback} callback passed on from caller\n * @returns {void}\n */\n authenticateUserInternal(dataAuthenticate, authenticationHelper, callback) {\n const challengeName = dataAuthenticate.ChallengeName;\n const challengeParameters = dataAuthenticate.ChallengeParameters;\n\n if (challengeName === 'SMS_MFA') {\n this.Session = dataAuthenticate.Session;\n return callback.mfaRequired(challengeName, challengeParameters);\n }\n\n if (challengeName === 'SELECT_MFA_TYPE') {\n this.Session = dataAuthenticate.Session;\n return callback.selectMFAType(challengeName, challengeParameters);\n }\n\n if (challengeName === 'MFA_SETUP') {\n this.Session = dataAuthenticate.Session;\n return callback.mfaSetup(challengeName, challengeParameters);\n }\n\n if (challengeName === 'SOFTWARE_TOKEN_MFA') {\n this.Session = dataAuthenticate.Session;\n return callback.totpRequired(challengeName, challengeParameters);\n }\n\n if (challengeName === 'CUSTOM_CHALLENGE') {\n this.Session = dataAuthenticate.Session;\n return callback.customChallenge(challengeParameters);\n }\n\n if (challengeName === 'DEVICE_SRP_AUTH') {\n this.getDeviceResponse(callback);\n return undefined;\n }\n\n this.signInUserSession = this.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n this.cacheTokens();\n\n const newDeviceMetadata = dataAuthenticate.AuthenticationResult.NewDeviceMetadata;\n if (newDeviceMetadata == null) {\n return callback.onSuccess(this.signInUserSession);\n }\n\n authenticationHelper.generateHashDevice(\n dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,\n dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey,\n (errGenHash) => {\n if (errGenHash) {\n return callback.onFailure(errGenHash);\n }\n\n const deviceSecretVerifierConfig = {\n Salt: Buffer.from(\n authenticationHelper.getSaltDevices(), 'hex'\n ).toString('base64'),\n PasswordVerifier: Buffer.from(\n authenticationHelper.getVerifierDevices(), 'hex'\n ).toString('base64'),\n };\n\n this.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier;\n this.deviceGroupKey = newDeviceMetadata.DeviceGroupKey;\n this.randomPassword = authenticationHelper.getRandomPassword();\n\n this.client.request('ConfirmDevice', {\n DeviceKey: newDeviceMetadata.DeviceKey,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceSecretVerifierConfig: deviceSecretVerifierConfig,\n DeviceName: navigator.userAgent,\n }, (errConfirm, dataConfirm) => {\n if (errConfirm) {\n return callback.onFailure(errConfirm);\n }\n\n this.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey;\n this.cacheDeviceKeyAndPassword();\n if (dataConfirm.UserConfirmationNecessary === true) {\n return callback.onSuccess(\n this.signInUserSession, dataConfirm.UserConfirmationNecessary);\n }\n return callback.onSuccess(this.signInUserSession);\n });\n return undefined;\n });\n return undefined;\n }\n\n /**\n * This method is user to complete the NEW_PASSWORD_REQUIRED challenge.\n * Pass the new password with any new user attributes to be updated.\n * User attribute keys must be of format userAttributes..\n * @param {string} newPassword new password for this user\n * @param {object} requiredAttributeData map with values for all required attributes\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {mfaRequired} callback.mfaRequired MFA code required to continue.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n completeNewPasswordChallenge(newPassword, requiredAttributeData, callback) {\n if (!newPassword) {\n return callback.onFailure(new Error('New password is required.'));\n }\n const authenticationHelper = new AuthenticationHelper(\n this.pool.getUserPoolId().split('_')[1]);\n const userAttributesPrefix = authenticationHelper\n .getNewPasswordRequiredChallengeUserAttributePrefix();\n\n const finalUserAttributes = {};\n if (requiredAttributeData) {\n Object.keys(requiredAttributeData).forEach((key) => {\n finalUserAttributes[userAttributesPrefix + key] = requiredAttributeData[key];\n });\n }\n\n finalUserAttributes.NEW_PASSWORD = newPassword;\n finalUserAttributes.USERNAME = this.username;\n const jsonReq = {\n ChallengeName: 'NEW_PASSWORD_REQUIRED',\n ClientId: this.pool.getClientId(),\n ChallengeResponses: finalUserAttributes,\n Session: this.Session,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.request('RespondToAuthChallenge',\n jsonReq, (errAuthenticate, dataAuthenticate) => {\n if (errAuthenticate) {\n return callback.onFailure(errAuthenticate);\n }\n return this.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback);\n });\n return undefined;\n }\n\n /**\n * This is used to get a session using device authentication. It is called at the end of user\n * authentication\n *\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n * @private\n */\n getDeviceResponse(callback) {\n const authenticationHelper = new AuthenticationHelper(\n this.deviceGroupKey);\n const dateHelper = new DateHelper();\n\n const authParameters = {};\n\n authParameters.USERNAME = this.username;\n authParameters.DEVICE_KEY = this.deviceKey;\n authenticationHelper.getLargeAValue((errAValue, aValue) => {\n // getLargeAValue callback start\n if (errAValue) {\n callback.onFailure(errAValue);\n }\n\n authParameters.SRP_A = aValue.toString(16);\n\n const jsonReq = {\n ChallengeName: 'DEVICE_SRP_AUTH',\n ClientId: this.pool.getClientId(),\n ChallengeResponses: authParameters,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('RespondToAuthChallenge', jsonReq, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n\n const challengeParameters = data.ChallengeParameters;\n\n const serverBValue = new BigInteger(challengeParameters.SRP_B, 16);\n const salt = new BigInteger(challengeParameters.SALT, 16);\n\n authenticationHelper.getPasswordAuthenticationKey(\n this.deviceKey,\n this.randomPassword,\n serverBValue,\n salt,\n (errHkdf, hkdf) => {\n // getPasswordAuthenticationKey callback start\n if (errHkdf) {\n return callback.onFailure(errHkdf);\n }\n\n const dateNow = dateHelper.getNowString();\n\n const signatureString = createHmac('sha256', hkdf)\n .update(Buffer.concat([\n Buffer.from(this.deviceGroupKey, 'utf8'),\n Buffer.from(this.deviceKey, 'utf8'),\n Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'),\n Buffer.from(dateNow, 'utf8'),\n ]))\n .digest('base64');\n\n const challengeResponses = {};\n\n challengeResponses.USERNAME = this.username;\n challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK;\n challengeResponses.TIMESTAMP = dateNow;\n challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString;\n challengeResponses.DEVICE_KEY = this.deviceKey;\n\n const jsonReqResp = {\n ChallengeName: 'DEVICE_PASSWORD_VERIFIER',\n ClientId: this.pool.getClientId(),\n ChallengeResponses: challengeResponses,\n Session: data.Session,\n };\n if (this.getUserContextData()) {\n jsonReqResp.UserContextData = this.getUserContextData();\n }\n\n this.client.request('RespondToAuthChallenge',\n jsonReqResp, (errAuthenticate, dataAuthenticate) => {\n if (errAuthenticate) {\n return callback.onFailure(errAuthenticate);\n }\n\n this.signInUserSession = this.getCognitoUserSession(\n dataAuthenticate.AuthenticationResult\n );\n this.cacheTokens();\n\n return callback.onSuccess(this.signInUserSession);\n });\n return undefined;\n // getPasswordAuthenticationKey callback end\n });\n return undefined;\n });\n // getLargeAValue callback end\n });\n }\n\n /**\n * This is used for a certain user to confirm the registration by using a confirmation code\n * @param {string} confirmationCode Code entered by user.\n * @param {bool} forceAliasCreation Allow migrating from an existing email / phone number.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n confirmRegistration(confirmationCode, forceAliasCreation, callback) {\n const jsonReq = {\n ClientId: this.pool.getClientId(),\n ConfirmationCode: confirmationCode,\n Username: this.username,\n ForceAliasCreation: forceAliasCreation,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('ConfirmSignUp', jsonReq, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n }\n\n /**\n * This is used by the user once he has the responses to a custom challenge\n * @param {string} answerChallenge The custom challange answer.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {customChallenge} callback.customChallenge\n * Custom challenge response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n sendCustomChallengeAnswer(answerChallenge, callback) {\n const challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n challengeResponses.ANSWER = answerChallenge;\n\n const authenticationHelper = new AuthenticationHelper(\n this.pool.getUserPoolId().split('_')[1]\n );\n this.getCachedDeviceKeyAndPassword();\n if (this.deviceKey != null) {\n challengeResponses.DEVICE_KEY = this.deviceKey;\n }\n\n const jsonReq = {\n ChallengeName: 'CUSTOM_CHALLENGE',\n ChallengeResponses: challengeResponses,\n ClientId: this.pool.getClientId(),\n Session: this.Session,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('RespondToAuthChallenge', jsonReq, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n\n return this.authenticateUserInternal(data, authenticationHelper, callback);\n });\n }\n\n /**\n * This is used by the user once he has an MFA code\n * @param {string} confirmationCode The MFA code entered by the user.\n * @param {object} callback Result callback map.\n * @param {string} mfaType The mfa we are replying to.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n sendMFACode(confirmationCode, callback, mfaType) {\n const challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n challengeResponses.SMS_MFA_CODE = confirmationCode;\n const mfaTypeSelection = mfaType || 'SMS_MFA';\n if (mfaTypeSelection === 'SOFTWARE_TOKEN_MFA') {\n challengeResponses.SOFTWARE_TOKEN_MFA_CODE = confirmationCode;\n }\n\n if (this.deviceKey != null) {\n challengeResponses.DEVICE_KEY = this.deviceKey;\n }\n\n const jsonReq = {\n ChallengeName: mfaTypeSelection,\n ChallengeResponses: challengeResponses,\n ClientId: this.pool.getClientId(),\n Session: this.Session,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.request('RespondToAuthChallenge',\n jsonReq, (err, dataAuthenticate) => {\n if (err) {\n return callback.onFailure(err);\n }\n\n const challengeName = dataAuthenticate.ChallengeName;\n\n if (challengeName === 'DEVICE_SRP_AUTH') {\n this.getDeviceResponse(callback);\n return undefined;\n }\n\n this.signInUserSession =\n this.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n this.cacheTokens();\n\n if (dataAuthenticate.AuthenticationResult.NewDeviceMetadata == null) {\n return callback.onSuccess(this.signInUserSession);\n }\n\n const authenticationHelper = new AuthenticationHelper(\n this.pool.getUserPoolId().split('_')[1]);\n authenticationHelper.generateHashDevice(\n dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,\n dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey,\n (errGenHash) => {\n if (errGenHash) {\n return callback.onFailure(errGenHash);\n }\n\n const deviceSecretVerifierConfig = {\n Salt: Buffer.from(\n authenticationHelper.getSaltDevices(), 'hex'\n ).toString('base64'),\n PasswordVerifier: Buffer.from(\n authenticationHelper.getVerifierDevices(), 'hex'\n ).toString('base64'),\n };\n\n this.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier;\n this.deviceGroupKey = dataAuthenticate.AuthenticationResult\n .NewDeviceMetadata.DeviceGroupKey;\n this.randomPassword = authenticationHelper.getRandomPassword();\n\n this.client.request('ConfirmDevice', {\n DeviceKey: dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceSecretVerifierConfig: deviceSecretVerifierConfig,\n DeviceName: navigator.userAgent,\n }, (errConfirm, dataConfirm) => {\n if (errConfirm) {\n return callback.onFailure(errConfirm);\n }\n\n this.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey;\n this.cacheDeviceKeyAndPassword();\n if (dataConfirm.UserConfirmationNecessary === true) {\n return callback.onSuccess(\n this.signInUserSession,\n dataConfirm.UserConfirmationNecessary);\n }\n return callback.onSuccess(this.signInUserSession);\n });\n return undefined;\n });\n return undefined;\n });\n }\n\n /**\n * This is used by an authenticated user to change the current password\n * @param {string} oldUserPassword The current password.\n * @param {string} newUserPassword The requested new password.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n changePassword(oldUserPassword, newUserPassword, callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('ChangePassword', {\n PreviousPassword: oldUserPassword,\n ProposedPassword: newUserPassword,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to enable MFA for himself\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n enableMFA(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n const mfaOptions = [];\n const mfaEnabled = {\n DeliveryMedium: 'SMS',\n AttributeName: 'phone_number',\n };\n mfaOptions.push(mfaEnabled);\n\n this.client.request('SetUserSettings', {\n MFAOptions: mfaOptions,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to enable MFA for himself\n * @param {string[]} smsMfaSettings the sms mfa settings\n * @param {string[]} softwareTokenMfaSettings the software token mfa settings\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n setUserMfaPreference(smsMfaSettings, softwareTokenMfaSettings, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('SetUserMFAPreference', {\n SMSMfaSettings: smsMfaSettings,\n SoftwareTokenMfaSettings: softwareTokenMfaSettings,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to disable MFA for himself\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n disableMFA(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n const mfaOptions = [];\n\n this.client.request('SetUserSettings', {\n MFAOptions: mfaOptions,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n\n /**\n * This is used by an authenticated user to delete himself\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n deleteUser(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('DeleteUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback(err, null);\n }\n this.clearCachedTokens();\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * @typedef {CognitoUserAttribute | { Name:string, Value:string }} AttributeArg\n */\n /**\n * This is used by an authenticated user to change a list of attributes\n * @param {AttributeArg[]} attributes A list of the new user attributes.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n updateAttributes(attributes, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('UpdateUserAttributes', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n UserAttributes: attributes,\n }, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to get a list of attributes\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n getUserAttributes(callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('GetUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, (err, userData) => {\n if (err) {\n return callback(err, null);\n }\n\n const attributeList = [];\n\n for (let i = 0; i < userData.UserAttributes.length; i++) {\n const attribute = {\n Name: userData.UserAttributes[i].Name,\n Value: userData.UserAttributes[i].Value,\n };\n const userAttribute = new CognitoUserAttribute(attribute);\n attributeList.push(userAttribute);\n }\n\n return callback(null, attributeList);\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to get the MFAOptions\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n getMFAOptions(callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('GetUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, (err, userData) => {\n if (err) {\n return callback(err, null);\n }\n\n return callback(null, userData.MFAOptions);\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to delete a list of attributes\n * @param {string[]} attributeList Names of the attributes to delete.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n deleteAttributes(attributeList, callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('DeleteUserAttributes', {\n UserAttributeNames: attributeList,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by a user to resend a confirmation code\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n resendConfirmationCode(callback) {\n const jsonReq = {\n ClientId: this.pool.getClientId(),\n Username: this.username,\n };\n\n this.client.request('ResendConfirmationCode', jsonReq, (err, result) => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, result);\n });\n }\n\n /**\n * This is used to get a session, either from the session object\n * or from the local storage, or by using a refresh token\n *\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n getSession(callback) {\n if (this.username == null) {\n return callback(new Error('Username is null. Cannot retrieve a new session'), null);\n }\n\n if (this.signInUserSession != null && this.signInUserSession.isValid()) {\n return callback(null, this.signInUserSession);\n }\n\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}.${this.username}`;\n const idTokenKey = `${keyPrefix}.idToken`;\n const accessTokenKey = `${keyPrefix}.accessToken`;\n const refreshTokenKey = `${keyPrefix}.refreshToken`;\n const clockDriftKey = `${keyPrefix}.clockDrift`;\n\n if (this.storage.getItem(idTokenKey)) {\n const idToken = new CognitoIdToken({\n IdToken: this.storage.getItem(idTokenKey),\n });\n const accessToken = new CognitoAccessToken({\n AccessToken: this.storage.getItem(accessTokenKey),\n });\n const refreshToken = new CognitoRefreshToken({\n RefreshToken: this.storage.getItem(refreshTokenKey),\n });\n const clockDrift = parseInt(this.storage.getItem(clockDriftKey), 0) || 0;\n\n const sessionData = {\n IdToken: idToken,\n AccessToken: accessToken,\n RefreshToken: refreshToken,\n ClockDrift: clockDrift,\n };\n const cachedSession = new CognitoUserSession(sessionData);\n if (cachedSession.isValid()) {\n this.signInUserSession = cachedSession;\n return callback(null, this.signInUserSession);\n }\n\n if (refreshToken.getToken() == null) {\n return callback(new Error('Cannot retrieve a new session. Please authenticate.'), null);\n }\n\n this.refreshSession(refreshToken, callback);\n } else {\n callback(new Error('Local storage is missing an ID Token, Please authenticate'), null);\n }\n\n return undefined;\n }\n\n\n /**\n * This uses the refreshToken to retrieve a new session\n * @param {CognitoRefreshToken} refreshToken A previous session's refresh token.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n refreshSession(refreshToken, callback) {\n const authParameters = {};\n authParameters.REFRESH_TOKEN = refreshToken.getToken();\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}`;\n const lastUserKey = `${keyPrefix}.LastAuthUser`;\n\n if (this.storage.getItem(lastUserKey)) {\n this.username = this.storage.getItem(lastUserKey);\n const deviceKeyKey = `${keyPrefix}.${this.username}.deviceKey`;\n this.deviceKey = this.storage.getItem(deviceKeyKey);\n authParameters.DEVICE_KEY = this.deviceKey;\n }\n\n const jsonReq = {\n ClientId: this.pool.getClientId(),\n AuthFlow: 'REFRESH_TOKEN_AUTH',\n AuthParameters: authParameters,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('InitiateAuth', jsonReq, (err, authResult) => {\n if (err) {\n if (err.code === 'NotAuthorizedException') {\n this.clearCachedTokens();\n }\n return callback(err, null);\n }\n if (authResult) {\n const authenticationResult = authResult.AuthenticationResult;\n if (!Object.prototype.hasOwnProperty.call(authenticationResult, 'RefreshToken')) {\n authenticationResult.RefreshToken = refreshToken.getToken();\n }\n this.signInUserSession = this.getCognitoUserSession(authenticationResult);\n this.cacheTokens();\n return callback(null, this.signInUserSession);\n }\n return undefined;\n });\n }\n\n /**\n * This is used to save the session tokens to local storage\n * @returns {void}\n */\n cacheTokens() {\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}`;\n const idTokenKey = `${keyPrefix}.${this.username}.idToken`;\n const accessTokenKey = `${keyPrefix}.${this.username}.accessToken`;\n const refreshTokenKey = `${keyPrefix}.${this.username}.refreshToken`;\n const clockDriftKey = `${keyPrefix}.${this.username}.clockDrift`;\n const lastUserKey = `${keyPrefix}.LastAuthUser`;\n\n this.storage.setItem(idTokenKey, this.signInUserSession.getIdToken().getJwtToken());\n this.storage.setItem(accessTokenKey, this.signInUserSession.getAccessToken().getJwtToken());\n this.storage.setItem(refreshTokenKey, this.signInUserSession.getRefreshToken().getToken());\n this.storage.setItem(clockDriftKey, `${this.signInUserSession.getClockDrift()}`);\n this.storage.setItem(lastUserKey, this.username);\n }\n\n /**\n * This is used to cache the device key and device group and device password\n * @returns {void}\n */\n cacheDeviceKeyAndPassword() {\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}.${this.username}`;\n const deviceKeyKey = `${keyPrefix}.deviceKey`;\n const randomPasswordKey = `${keyPrefix}.randomPasswordKey`;\n const deviceGroupKeyKey = `${keyPrefix}.deviceGroupKey`;\n\n this.storage.setItem(deviceKeyKey, this.deviceKey);\n this.storage.setItem(randomPasswordKey, this.randomPassword);\n this.storage.setItem(deviceGroupKeyKey, this.deviceGroupKey);\n }\n\n /**\n * This is used to get current device key and device group and device password\n * @returns {void}\n */\n getCachedDeviceKeyAndPassword() {\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}.${this.username}`;\n const deviceKeyKey = `${keyPrefix}.deviceKey`;\n const randomPasswordKey = `${keyPrefix}.randomPasswordKey`;\n const deviceGroupKeyKey = `${keyPrefix}.deviceGroupKey`;\n\n if (this.storage.getItem(deviceKeyKey)) {\n this.deviceKey = this.storage.getItem(deviceKeyKey);\n this.randomPassword = this.storage.getItem(randomPasswordKey);\n this.deviceGroupKey = this.storage.getItem(deviceGroupKeyKey);\n }\n }\n\n /**\n * This is used to clear the device key info from local storage\n * @returns {void}\n */\n clearCachedDeviceKeyAndPassword() {\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}.${this.username}`;\n const deviceKeyKey = `${keyPrefix}.deviceKey`;\n const randomPasswordKey = `${keyPrefix}.randomPasswordKey`;\n const deviceGroupKeyKey = `${keyPrefix}.deviceGroupKey`;\n\n this.storage.removeItem(deviceKeyKey);\n this.storage.removeItem(randomPasswordKey);\n this.storage.removeItem(deviceGroupKeyKey);\n }\n\n /**\n * This is used to clear the session tokens from local storage\n * @returns {void}\n */\n clearCachedTokens() {\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}`;\n const idTokenKey = `${keyPrefix}.${this.username}.idToken`;\n const accessTokenKey = `${keyPrefix}.${this.username}.accessToken`;\n const refreshTokenKey = `${keyPrefix}.${this.username}.refreshToken`;\n const lastUserKey = `${keyPrefix}.LastAuthUser`;\n\n this.storage.removeItem(idTokenKey);\n this.storage.removeItem(accessTokenKey);\n this.storage.removeItem(refreshTokenKey);\n this.storage.removeItem(lastUserKey);\n }\n\n /**\n * This is used to build a user session from tokens retrieved in the authentication result\n * @param {object} authResult Successful auth response from server.\n * @returns {CognitoUserSession} The new user session.\n * @private\n */\n getCognitoUserSession(authResult) {\n const idToken = new CognitoIdToken(authResult);\n const accessToken = new CognitoAccessToken(authResult);\n const refreshToken = new CognitoRefreshToken(authResult);\n\n const sessionData = {\n IdToken: idToken,\n AccessToken: accessToken,\n RefreshToken: refreshToken,\n };\n\n return new CognitoUserSession(sessionData);\n }\n\n /**\n * This is used to initiate a forgot password request\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {inputVerificationCode?} callback.inputVerificationCode\n * Optional callback raised instead of onSuccess with response data.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n forgotPassword(callback) {\n const jsonReq = {\n ClientId: this.pool.getClientId(),\n Username: this.username,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('ForgotPassword', jsonReq, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n if (typeof callback.inputVerificationCode === 'function') {\n return callback.inputVerificationCode(data);\n }\n return callback.onSuccess(data);\n });\n }\n\n /**\n * This is used to confirm a new password using a confirmationCode\n * @param {string} confirmationCode Code entered by user.\n * @param {string} newPassword Confirm new password.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n confirmPassword(confirmationCode, newPassword, callback) {\n const jsonReq = {\n ClientId: this.pool.getClientId(),\n Username: this.username,\n ConfirmationCode: confirmationCode,\n Password: newPassword,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('ConfirmForgotPassword', jsonReq, err => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess();\n });\n }\n\n /**\n * This is used to initiate an attribute confirmation request\n * @param {string} attributeName User attribute that needs confirmation.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {inputVerificationCode} callback.inputVerificationCode Called on success.\n * @returns {void}\n */\n getAttributeVerificationCode(attributeName, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('GetUserAttributeVerificationCode', {\n AttributeName: attributeName,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n if (typeof callback.inputVerificationCode === 'function') {\n return callback.inputVerificationCode(data);\n }\n return callback.onSuccess();\n });\n return undefined;\n }\n\n /**\n * This is used to confirm an attribute using a confirmation code\n * @param {string} attributeName Attribute being confirmed.\n * @param {string} confirmationCode Code entered by user.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n verifyAttribute(attributeName, confirmationCode, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('VerifyUserAttribute', {\n AttributeName: attributeName,\n Code: confirmationCode,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used to get the device information using the current device key\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess<*>} callback.onSuccess Called on success with device data.\n * @returns {void}\n */\n getDevice(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('GetDevice', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: this.deviceKey,\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess(data);\n });\n return undefined;\n }\n\n /**\n * This is used to forget a specific device\n * @param {string} deviceKey Device key.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n forgetSpecificDevice(deviceKey, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('ForgetDevice', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: deviceKey,\n }, err => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used to forget the current device\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n forgetDevice(callback) {\n this.forgetSpecificDevice(this.deviceKey, {\n onFailure: callback.onFailure,\n onSuccess: result => {\n this.deviceKey = null;\n this.deviceGroupKey = null;\n this.randomPassword = null;\n this.clearCachedDeviceKeyAndPassword();\n return callback.onSuccess(result);\n },\n });\n }\n\n /**\n * This is used to set the device status as remembered\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n setDeviceStatusRemembered(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('UpdateDeviceStatus', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: this.deviceKey,\n DeviceRememberedStatus: 'remembered',\n }, err => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used to set the device status as not remembered\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n setDeviceStatusNotRemembered(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('UpdateDeviceStatus', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: this.deviceKey,\n DeviceRememberedStatus: 'not_remembered',\n }, err => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used to list all devices for a user\n *\n * @param {int} limit the number of devices returned in a call\n * @param {string} paginationToken the pagination token in case any was returned before\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess<*>} callback.onSuccess Called on success with device list.\n * @returns {void}\n */\n listDevices(limit, paginationToken, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('ListDevices', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n Limit: limit,\n PaginationToken: paginationToken,\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess(data);\n });\n return undefined;\n }\n\n /**\n * This is used to globally revoke all tokens issued to a user\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n globalSignOut(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('GlobalSignOut', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback.onFailure(err);\n }\n this.clearCachedTokens();\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used for the user to signOut of the application and clear the cached tokens.\n * @returns {void}\n */\n signOut() {\n this.signInUserSession = null;\n this.clearCachedTokens();\n }\n\n /**\n * This is used by a user trying to select a given MFA\n * @param {string} answerChallenge the mfa the user wants\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n sendMFASelectionAnswer(answerChallenge, callback) {\n const challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n challengeResponses.ANSWER = answerChallenge;\n\n const jsonReq = {\n ChallengeName: 'SELECT_MFA_TYPE',\n ChallengeResponses: challengeResponses,\n ClientId: this.pool.getClientId(),\n Session: this.Session,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('RespondToAuthChallenge', jsonReq, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n this.Session = data.Session;\n if (answerChallenge === 'SMS_MFA') {\n return callback.mfaRequired(data.challengeName, data.challengeParameters);\n }\n if (answerChallenge === 'SOFTWARE_TOKEN_MFA') {\n return callback.totpRequired(data.challengeName, data.challengeParameters);\n }\n return undefined;\n });\n }\n\n /**\n * This returns the user context data for advanced security feature.\n * @returns {void}\n */\n getUserContextData() {\n const pool = this.pool;\n return pool.getUserContextData(this.username);\n }\n\n /**\n * This is used by an authenticated or a user trying to authenticate to associate a TOTP MFA\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n associateSoftwareToken(callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n this.client.request('AssociateSoftwareToken', {\n Session: this.Session,\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n this.Session = data.Session;\n return callback.associateSecretCode(data.SecretCode);\n });\n } else {\n this.client.request('AssociateSoftwareToken', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.associateSecretCode(data.SecretCode);\n });\n }\n }\n\n /**\n * This is used by an authenticated or a user trying to authenticate to verify a TOTP MFA\n * @param {string} totpCode The MFA code entered by the user.\n * @param {string} friendlyDeviceName The device name we are assigning to the device.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n verifySoftwareToken(totpCode, friendlyDeviceName, callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n this.client.request('VerifySoftwareToken', {\n Session: this.Session,\n UserCode: totpCode,\n FriendlyDeviceName: friendlyDeviceName,\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n this.Session = data.Session;\n const challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n const jsonReq = {\n ChallengeName: 'MFA_SETUP',\n ClientId: this.pool.getClientId(),\n ChallengeResponses: challengeResponses,\n Session: this.Session,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('RespondToAuthChallenge',\n jsonReq, (errRespond, dataRespond) => {\n if (errRespond) {\n return callback.onFailure(errRespond);\n }\n this.signInUserSession = this.getCognitoUserSession(dataRespond.AuthenticationResult);\n this.cacheTokens();\n return callback.onSuccess(this.signInUserSession);\n });\n return undefined;\n });\n } else {\n this.client.request('VerifySoftwareToken', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n UserCode: totpCode,\n FriendlyDeviceName: friendlyDeviceName,\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess(data);\n });\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoUser.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nexport default class CognitoUserAttribute {\n /**\n * Constructs a new CognitoUserAttribute object\n * @param {string=} Name The record's name\n * @param {string=} Value The record's value\n */\n constructor({ Name, Value } = {}) {\n this.Name = Name || '';\n this.Value = Value || '';\n }\n\n /**\n * @returns {string} the record's value.\n */\n getValue() {\n return this.Value;\n }\n\n /**\n * Sets the record's value.\n * @param {string} value The new value.\n * @returns {CognitoUserAttribute} The record for method chaining.\n */\n setValue(value) {\n this.Value = value;\n return this;\n }\n\n /**\n * @returns {string} the record's name.\n */\n getName() {\n return this.Name;\n }\n\n /**\n * Sets the record's name\n * @param {string} name The new name.\n * @returns {CognitoUserAttribute} The record for method chaining.\n */\n setName(name) {\n this.Name = name;\n return this;\n }\n\n /**\n * @returns {string} a string representation of the record.\n */\n toString() {\n return JSON.stringify(this);\n }\n\n /**\n * @returns {object} a flat object representing the record.\n */\n toJSON() {\n return {\n Name: this.Name,\n Value: this.Value,\n };\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoUserAttribute.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nexport default class CognitoUserSession {\n /**\n * Constructs a new CognitoUserSession object\n * @param {CognitoIdToken} IdToken The session's Id token.\n * @param {CognitoRefreshToken=} RefreshToken The session's refresh token.\n * @param {CognitoAccessToken} AccessToken The session's access token.\n * @param {int} ClockDrift The saved computer's clock drift or undefined to force calculation.\n */\n constructor({ IdToken, RefreshToken, AccessToken, ClockDrift } = {}) {\n if (AccessToken == null || IdToken == null) {\n throw new Error('Id token and Access Token must be present.');\n }\n\n this.idToken = IdToken;\n this.refreshToken = RefreshToken;\n this.accessToken = AccessToken;\n this.clockDrift = ClockDrift === undefined ? this.calculateClockDrift() : ClockDrift;\n }\n\n /**\n * @returns {CognitoIdToken} the session's Id token\n */\n getIdToken() {\n return this.idToken;\n }\n\n /**\n * @returns {CognitoRefreshToken} the session's refresh token\n */\n getRefreshToken() {\n return this.refreshToken;\n }\n\n /**\n * @returns {CognitoAccessToken} the session's access token\n */\n getAccessToken() {\n return this.accessToken;\n }\n\n /**\n * @returns {int} the session's clock drift\n */\n getClockDrift() {\n return this.clockDrift;\n }\n\n /**\n * @returns {int} the computer's clock drift\n */\n calculateClockDrift() {\n const now = Math.floor(new Date() / 1000);\n const iat = Math.min(this.accessToken.getIssuedAt(), this.idToken.getIssuedAt());\n\n return now - iat;\n }\n\n /**\n * Checks to see if the session is still valid based on session expiry information found\n * in tokens and the current time (adjusted with clock drift)\n * @returns {boolean} if the session is still valid\n */\n isValid() {\n const now = Math.floor(new Date() / 1000);\n const adjusted = now - this.clockDrift;\n\n return adjusted < this.accessToken.getExpiration() && adjusted < this.idToken.getExpiration();\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoUserSession.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst monthNames =\n ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\nconst weekNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n\n/** @class */\nexport default class DateHelper {\n /**\n * @returns {string} The current time in \"ddd MMM D HH:mm:ss UTC YYYY\" format.\n */\n getNowString() {\n const now = new Date();\n\n const weekDay = weekNames[now.getUTCDay()];\n const month = monthNames[now.getUTCMonth()];\n const day = now.getUTCDate();\n\n let hours = now.getUTCHours();\n if (hours < 10) {\n hours = `0${hours}`;\n }\n\n let minutes = now.getUTCMinutes();\n if (minutes < 10) {\n minutes = `0${minutes}`;\n }\n\n let seconds = now.getUTCSeconds();\n if (seconds < 10) {\n seconds = `0${seconds}`;\n }\n\n const year = now.getUTCFullYear();\n\n // ddd MMM D HH:mm:ss UTC YYYY\n const dateNow = `${weekDay} ${month} ${day} ${hours}:${minutes}:${seconds} UTC ${year}`;\n\n return dateNow;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/DateHelper.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nlet dataMemory = {};\n\n/** @class */\nclass MemoryStorage {\n\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n static setItem(key, value) {\n dataMemory[key] = value;\n return dataMemory[key];\n }\n\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */\n static getItem(key) {\n return Object.prototype.hasOwnProperty.call(dataMemory, key) ? dataMemory[key] : undefined;\n }\n\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {string} value - value that was deleted\n */\n static removeItem(key) {\n return delete dataMemory[key];\n }\n\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */\n static clear() {\n dataMemory = {};\n return dataMemory;\n }\n}\n\n/** @class */\nexport default class StorageHelper {\n\n /**\n * This is used to get a storage object\n * @returns {object} the storage\n */\n constructor() {\n try {\n this.storageWindow = window.localStorage;\n this.storageWindow.setItem('aws.cognito.test-ls', 1);\n this.storageWindow.removeItem('aws.cognito.test-ls');\n } catch (exception) {\n this.storageWindow = MemoryStorage;\n }\n }\n\n /**\n * This is used to return the storage\n * @returns {object} the storage\n */\n getStorage() {\n return this.storageWindow;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/StorageHelper.js","var Buffer = require('buffer').Buffer\nvar sha = require('./sha')\nvar sha256 = require('./sha256')\nvar rng = require('./rng')\nvar md5 = require('./md5')\n\nvar algorithms = {\n sha1: sha,\n sha256: sha256,\n md5: md5\n}\n\nvar blocksize = 64\nvar zeroBuffer = new Buffer(blocksize); zeroBuffer.fill(0)\nfunction hmac(fn, key, data) {\n if(!Buffer.isBuffer(key)) key = new Buffer(key)\n if(!Buffer.isBuffer(data)) data = new Buffer(data)\n\n if(key.length > blocksize) {\n key = fn(key)\n } else if(key.length < blocksize) {\n key = Buffer.concat([key, zeroBuffer], blocksize)\n }\n\n var ipad = new Buffer(blocksize), opad = new Buffer(blocksize)\n for(var i = 0; i < blocksize; i++) {\n ipad[i] = key[i] ^ 0x36\n opad[i] = key[i] ^ 0x5C\n }\n\n var hash = fn(Buffer.concat([ipad, data]))\n return fn(Buffer.concat([opad, hash]))\n}\n\nfunction hash(alg, key) {\n alg = alg || 'sha1'\n var fn = algorithms[alg]\n var bufs = []\n var length = 0\n if(!fn) error('algorithm:', alg, 'is not yet supported')\n return {\n update: function (data) {\n if(!Buffer.isBuffer(data)) data = new Buffer(data)\n \n bufs.push(data)\n length += data.length\n return this\n },\n digest: function (enc) {\n var buf = Buffer.concat(bufs)\n var r = key ? hmac(fn, key, buf) : fn(buf)\n bufs = null\n return enc ? r.toString(enc) : r\n }\n }\n}\n\nfunction error () {\n var m = [].slice.call(arguments).join(' ')\n throw new Error([\n m,\n 'we accept pull requests',\n 'http://github.com/dominictarr/crypto-browserify'\n ].join('\\n'))\n}\n\nexports.createHash = function (alg) { return hash(alg) }\nexports.createHmac = function (alg, key) { return hash(alg, key) }\nexports.randomBytes = function(size, callback) {\n if (callback && callback.call) {\n try {\n callback.call(this, undefined, new Buffer(rng(size)))\n } catch (err) { callback(err) }\n } else {\n return new Buffer(rng(size))\n }\n}\n\nfunction each(a, f) {\n for(var i in a)\n f(a[i], i)\n}\n\n// the least I can do is make error messages for the rest of the node.js/crypto api.\neach(['createCredentials'\n, 'createCipher'\n, 'createCipheriv'\n, 'createDecipher'\n, 'createDecipheriv'\n, 'createSign'\n, 'createVerify'\n, 'createDiffieHellman'\n, 'pbkdf2'], function (name) {\n exports[name] = function () {\n error('sorry,', name, 'is not implemented yet')\n }\n})\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/crypto-browserify/index.js\n// module id = 14\n// module chunks = 0","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction placeHoldersCount (b64) {\n var len = b64.length\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n}\n\nfunction byteLength (b64) {\n // base64 is 4/3 + up to two characters of the original data\n return (b64.length * 3 / 4) - placeHoldersCount(b64)\n}\n\nfunction toByteArray (b64) {\n var i, l, tmp, placeHolders, arr\n var len = b64.length\n placeHolders = placeHoldersCount(b64)\n\n arr = new Arr((len * 3 / 4) - placeHolders)\n\n // if there are placeholders, only get up to the last complete 4 chars\n l = placeHolders > 0 ? len - 4 : len\n\n var L = 0\n\n for (i = 0; i < l; i += 4) {\n tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n arr[L++] = (tmp >> 16) & 0xFF\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n if (placeHolders === 2) {\n tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[L++] = tmp & 0xFF\n } else if (placeHolders === 1) {\n tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var output = ''\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n output += lookup[tmp >> 2]\n output += lookup[(tmp << 4) & 0x3F]\n output += '=='\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n output += lookup[tmp >> 10]\n output += lookup[(tmp >> 4) & 0x3F]\n output += lookup[(tmp << 2) & 0x3F]\n output += '='\n }\n\n parts.push(output)\n\n return parts.join('')\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// /Users/wezhuo/workplace/aws-amplify/~/base64-js/index.js\n// module id = 15\n// module chunks = 0","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// /Users/wezhuo/workplace/aws-amplify/~/ieee754/index.js\n// module id = 16\n// module chunks = 0","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// /Users/wezhuo/workplace/aws-amplify/~/isarray/index.js\n// module id = 17\n// module chunks = 0","/*!\n * JavaScript Cookie v2.2.0\n * https://github.com/js-cookie/js-cookie\n *\n * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n * Released under the MIT license\n */\n;(function (factory) {\n\tvar registeredInModuleLoader = false;\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (!registeredInModuleLoader) {\n\t\tvar OldCookies = window.Cookies;\n\t\tvar api = window.Cookies = factory();\n\t\tapi.noConflict = function () {\n\t\t\twindow.Cookies = OldCookies;\n\t\t\treturn api;\n\t\t};\n\t}\n}(function () {\n\tfunction extend () {\n\t\tvar i = 0;\n\t\tvar result = {};\n\t\tfor (; i < arguments.length; i++) {\n\t\t\tvar attributes = arguments[ i ];\n\t\t\tfor (var key in attributes) {\n\t\t\t\tresult[key] = attributes[key];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction init (converter) {\n\t\tfunction api (key, value, attributes) {\n\t\t\tvar result;\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Write\n\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tattributes = extend({\n\t\t\t\t\tpath: '/'\n\t\t\t\t}, api.defaults, attributes);\n\n\t\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\t\tvar expires = new Date();\n\t\t\t\t\texpires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);\n\t\t\t\t\tattributes.expires = expires;\n\t\t\t\t}\n\n\t\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\n\t\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\n\t\t\t\ttry {\n\t\t\t\t\tresult = JSON.stringify(value);\n\t\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\t\tvalue = result;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\n\t\t\t\tif (!converter.write) {\n\t\t\t\t\tvalue = encodeURIComponent(String(value))\n\t\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\t\t\t\t} else {\n\t\t\t\t\tvalue = converter.write(value, key);\n\t\t\t\t}\n\n\t\t\t\tkey = encodeURIComponent(String(key));\n\t\t\t\tkey = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);\n\t\t\t\tkey = key.replace(/[\\(\\)]/g, escape);\n\n\t\t\t\tvar stringifiedAttributes = '';\n\n\t\t\t\tfor (var attributeName in attributes) {\n\t\t\t\t\tif (!attributes[attributeName]) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstringifiedAttributes += '; ' + attributeName;\n\t\t\t\t\tif (attributes[attributeName] === true) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName];\n\t\t\t\t}\n\t\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\n\t\t\t}\n\n\t\t\t// Read\n\n\t\t\tif (!key) {\n\t\t\t\tresult = {};\n\t\t\t}\n\n\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t// in case there are no cookies at all. Also prevents odd result when\n\t\t\t// calling \"get()\"\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\tvar rdecode = /(%[0-9A-Z]{2})+/g;\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\tvar cookie = parts.slice(1).join('=');\n\n\t\t\t\tif (!this.json && cookie.charAt(0) === '\"') {\n\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvar name = parts[0].replace(rdecode, decodeURIComponent);\n\t\t\t\t\tcookie = converter.read ?\n\t\t\t\t\t\tconverter.read(cookie, name) : converter(cookie, name) ||\n\t\t\t\t\t\tcookie.replace(rdecode, decodeURIComponent);\n\n\t\t\t\t\tif (this.json) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\tresult = cookie;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!key) {\n\t\t\t\t\t\tresult[name] = cookie;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\tapi.set = api;\n\t\tapi.get = function (key) {\n\t\t\treturn api.call(api, key);\n\t\t};\n\t\tapi.getJSON = function () {\n\t\t\treturn api.apply({\n\t\t\t\tjson: true\n\t\t\t}, [].slice.call(arguments));\n\t\t};\n\t\tapi.defaults = {};\n\n\t\tapi.remove = function (key, attributes) {\n\t\t\tapi(key, '', extend(attributes, {\n\t\t\t\texpires: -1\n\t\t\t}));\n\t\t};\n\n\t\tapi.withConverter = init;\n\n\t\treturn api;\n\t}\n\n\treturn init(function () {});\n}));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// /Users/wezhuo/workplace/aws-amplify/~/js-cookie/src/js.cookie.js\n// module id = 18\n// module chunks = 0","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nexport default class AuthenticationDetails {\n /**\n * Constructs a new AuthenticationDetails object\n * @param {object=} data Creation options.\n * @param {string} data.Username User being authenticated.\n * @param {string} data.Password Plain-text password to authenticate with.\n * @param {(AttributeArg[])?} data.ValidationData Application extra metadata.\n * @param {(AttributeArg[])?} data.AuthParamaters Authentication paramaters for custom auth.\n */\n constructor(data) {\n const { ValidationData, Username, Password, AuthParameters } = data || {};\n this.validationData = ValidationData || {};\n this.authParameters = AuthParameters || {};\n this.username = Username;\n this.password = Password;\n }\n\n /**\n * @returns {string} the record's username\n */\n getUsername() {\n return this.username;\n }\n\n /**\n * @returns {string} the record's password\n */\n getPassword() {\n return this.password;\n }\n\n /**\n * @returns {Array} the record's validationData\n */\n getValidationData() {\n return this.validationData;\n }\n\n /**\n * @returns {Array} the record's authParameters\n */\n getAuthParameters() {\n return this.authParameters;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/AuthenticationDetails.js","import UserAgent from './UserAgent';\n/** @class */\nexport default class Client {\n /**\n * Constructs a new AWS Cognito Identity Provider client object\n * @param {string} region AWS region\n * @param {string} endpoint endpoint\n */\n constructor(region, endpoint) {\n this.endpoint = endpoint || `https://cognito-idp.${region}.amazonaws.com/`;\n this.userAgent = UserAgent.prototype.userAgent || 'aws-amplify/0.1.x js';\n }\n\n /**\n * Makes an unauthenticated request on AWS Cognito Identity Provider API\n * using fetch\n * @param {string} operation API operation\n * @param {object} params Input parameters\n * @param {function} callback Callback called when a response is returned\n * @returns {void}\n */\n request(operation, params, callback) {\n const headers = {\n 'Content-Type': 'application/x-amz-json-1.1',\n 'X-Amz-Target': `AWSCognitoIdentityProviderService.${operation}`,\n 'X-Amz-User-Agent': this.userAgent\n };\n\n const options = {\n headers,\n method: 'POST',\n mode: 'cors',\n cache: 'no-cache',\n body: JSON.stringify(params),\n };\n\n let response;\n\n fetch(this.endpoint, options)\n .then(resp => {\n response = resp;\n return resp;\n })\n .then(resp => resp.json().catch(() => ({})))\n .then(data => {\n if (response.ok) return callback(null, data);\n\n // Taken from aws-sdk-js/lib/protocol/json.js\n // eslint-disable-next-line no-underscore-dangle\n const code = (data.__type || data.code).split('#').pop();\n const error = {\n code,\n name: code,\n message: (data.message || data.Message || null),\n };\n return callback(error);\n })\n .catch(() => {\n // Taken from aws-sdk-js/lib/protocol/json.js\n const code = (response.headers.get('x-amzn-errortype') || 'UnknownError').split(':')[0];\n const error = {\n code,\n name: code,\n statusCode: response.status,\n message: response.status.toString(),\n };\n return callback(error);\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/Client.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Client from './Client';\nimport CognitoUser from './CognitoUser';\nimport StorageHelper from './StorageHelper';\n\n/** @class */\nexport default class CognitoUserPool {\n /**\n * Constructs a new CognitoUserPool object\n * @param {object} data Creation options.\n * @param {string} data.UserPoolId Cognito user pool id.\n * @param {string} data.ClientId User pool application client id.\n * @param {object} data.Storage Optional storage object.\n * @param {boolean} data.AdvancedSecurityDataCollectionFlag Optional:\n * boolean flag indicating if the data collection is enabled\n * to support cognito advanced security features. By default, this\n * flag is set to true.\n */\n constructor(data) {\n const { UserPoolId, ClientId, endpoint, AdvancedSecurityDataCollectionFlag } = data || {};\n if (!UserPoolId || !ClientId) {\n throw new Error('Both UserPoolId and ClientId are required.');\n }\n if (!/^[\\w-]+_.+$/.test(UserPoolId)) {\n throw new Error('Invalid UserPoolId format.');\n }\n const region = UserPoolId.split('_')[0];\n\n this.userPoolId = UserPoolId;\n this.clientId = ClientId;\n\n this.client = new Client(region, endpoint);\n\n /**\n * By default, AdvancedSecurityDataCollectionFlag is set to true,\n * if no input value is provided.\n */\n this.advancedSecurityDataCollectionFlag = AdvancedSecurityDataCollectionFlag !== false;\n\n this.storage = data.Storage || new StorageHelper().getStorage();\n }\n\n /**\n * @returns {string} the user pool id\n */\n getUserPoolId() {\n return this.userPoolId;\n }\n\n /**\n * @returns {string} the client id\n */\n getClientId() {\n return this.clientId;\n }\n\n /**\n * @typedef {object} SignUpResult\n * @property {CognitoUser} user New user.\n * @property {bool} userConfirmed If the user is already confirmed.\n */\n /**\n * method for signing up a user\n * @param {string} username User's username.\n * @param {string} password Plain-text initial password entered by user.\n * @param {(AttributeArg[])=} userAttributes New user attributes.\n * @param {(AttributeArg[])=} validationData Application metadata.\n * @param {nodeCallback} callback Called on error or with the new user.\n * @returns {void}\n */\n signUp(username, password, userAttributes, validationData, callback) {\n const jsonReq = {\n ClientId: this.clientId,\n Username: username,\n Password: password,\n UserAttributes: userAttributes,\n ValidationData: validationData,\n };\n if (this.getUserContextData(username)) {\n jsonReq.UserContextData = this.getUserContextData(username);\n }\n this.client.request('SignUp', jsonReq, (err, data) => {\n if (err) {\n return callback(err, null);\n }\n\n const cognitoUser = {\n Username: username,\n Pool: this,\n Storage: this.storage,\n };\n\n const returnData = {\n user: new CognitoUser(cognitoUser),\n userConfirmed: data.UserConfirmed,\n userSub: data.UserSub,\n };\n\n return callback(null, returnData);\n });\n }\n\n\n /**\n * method for getting the current user of the application from the local storage\n *\n * @returns {CognitoUser} the user retrieved from storage\n */\n getCurrentUser() {\n const lastUserKey = `CognitoIdentityServiceProvider.${this.clientId}.LastAuthUser`;\n\n const lastAuthUser = this.storage.getItem(lastUserKey);\n if (lastAuthUser) {\n const cognitoUser = {\n Username: lastAuthUser,\n Pool: this,\n Storage: this.storage,\n };\n\n return new CognitoUser(cognitoUser);\n }\n\n return null;\n }\n\n /**\n * This method returns the encoded data string used for cognito advanced security feature.\n * This would be generated only when developer has included the JS used for collecting the\n * data on their client. Please refer to documentation to know more about using AdvancedSecurity\n * features\n * @param {string} username the username for the context data\n * @returns {string} the user context data\n **/\n getUserContextData(username) {\n if (typeof AmazonCognitoAdvancedSecurityData === 'undefined') {\n return undefined;\n }\n /* eslint-disable */\n const amazonCognitoAdvancedSecurityDataConst = AmazonCognitoAdvancedSecurityData;\n /* eslint-enable */\n\n if (this.advancedSecurityDataCollectionFlag) {\n const advancedSecurityData = amazonCognitoAdvancedSecurityDataConst.getData(username,\n this.userPoolId, this.clientId);\n if (advancedSecurityData) {\n const userContextData = {\n EncodedData: advancedSecurityData,\n };\n return userContextData;\n }\n }\n return {};\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoUserPool.js","\nimport * as Cookies from 'js-cookie';\n\n/** @class */\nexport default class CookieStorage {\n\n /**\n * Constructs a new CookieStorage object\n * @param {object} data Creation options.\n * @param {string} data.domain Cookies domain (mandatory).\n * @param {string} data.path Cookies path (default: '/')\n * @param {integer} data.expires Cookie expiration (in days, default: 365)\n * @param {boolean} data.secure Cookie secure flag (default: true)\n */\n constructor(data) {\n this.domain = data.domain;\n if (data.path) {\n this.path = data.path;\n } else {\n this.path = '/';\n }\n if (Object.prototype.hasOwnProperty.call(data, 'expires')) {\n this.expires = data.expires;\n } else {\n this.expires = 365;\n }\n if (Object.prototype.hasOwnProperty.call(data, 'secure')) {\n this.secure = data.secure;\n } else {\n this.secure = true;\n }\n }\n\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n setItem(key, value) {\n Cookies.set(key, value, {\n path: this.path,\n expires: this.expires,\n domain: this.domain,\n secure: this.secure,\n }\n );\n return Cookies.get(key);\n }\n\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */\n getItem(key) {\n return Cookies.get(key);\n }\n\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {string} value - value that was deleted\n */\n removeItem(key) {\n return Cookies.remove(key, {\n path: this.path,\n domain: this.domain,\n secure: this.secure,\n }\n );\n }\n\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */\n clear() {\n const cookies = Cookies.get();\n let index;\n for (index = 0; index < cookies.length; ++index) {\n Cookies.remove(cookies[index]);\n }\n return {};\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CookieStorage.js","// class for defining the amzn user-agent\nexport default UserAgent;\n// constructor\nfunction UserAgent() {}\n// public\nUserAgent.prototype.userAgent = 'aws-amplify/0.1.x js';\n\n\n// WEBPACK FOOTER //\n// ./src/UserAgent.js","/*\r\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\r\n * Digest Algorithm, as defined in RFC 1321.\r\n * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.\r\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\r\n * Distributed under the BSD License\r\n * See http://pajhome.org.uk/crypt/md5 for more info.\r\n */\r\n\r\nvar helpers = require('./helpers');\r\n\r\n/*\r\n * Perform a simple self-test to see if the VM is working\r\n */\r\nfunction md5_vm_test()\r\n{\r\n return hex_md5(\"abc\") == \"900150983cd24fb0d6963f7d28e17f72\";\r\n}\r\n\r\n/*\r\n * Calculate the MD5 of an array of little-endian words, and a bit length\r\n */\r\nfunction core_md5(x, len)\r\n{\r\n /* append padding */\r\n x[len >> 5] |= 0x80 << ((len) % 32);\r\n x[(((len + 64) >>> 9) << 4) + 14] = len;\r\n\r\n var a = 1732584193;\r\n var b = -271733879;\r\n var c = -1732584194;\r\n var d = 271733878;\r\n\r\n for(var i = 0; i < x.length; i += 16)\r\n {\r\n var olda = a;\r\n var oldb = b;\r\n var oldc = c;\r\n var oldd = d;\r\n\r\n a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);\r\n d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);\r\n c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);\r\n b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);\r\n a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);\r\n d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);\r\n c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);\r\n b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);\r\n a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);\r\n d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);\r\n c = md5_ff(c, d, a, b, x[i+10], 17, -42063);\r\n b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);\r\n a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);\r\n d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);\r\n c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);\r\n b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);\r\n\r\n a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);\r\n d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);\r\n c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);\r\n b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);\r\n a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);\r\n d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);\r\n c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);\r\n b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);\r\n a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);\r\n d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);\r\n c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);\r\n b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);\r\n a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);\r\n d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);\r\n c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);\r\n b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);\r\n\r\n a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);\r\n d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);\r\n c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);\r\n b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);\r\n a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);\r\n d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);\r\n c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);\r\n b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);\r\n a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);\r\n d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);\r\n c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);\r\n b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);\r\n a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);\r\n d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);\r\n c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);\r\n b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);\r\n\r\n a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);\r\n d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);\r\n c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);\r\n b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);\r\n a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);\r\n d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);\r\n c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);\r\n b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);\r\n a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);\r\n d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);\r\n c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);\r\n b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);\r\n a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);\r\n d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);\r\n c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);\r\n b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);\r\n\r\n a = safe_add(a, olda);\r\n b = safe_add(b, oldb);\r\n c = safe_add(c, oldc);\r\n d = safe_add(d, oldd);\r\n }\r\n return Array(a, b, c, d);\r\n\r\n}\r\n\r\n/*\r\n * These functions implement the four basic operations the algorithm uses.\r\n */\r\nfunction md5_cmn(q, a, b, x, s, t)\r\n{\r\n return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);\r\n}\r\nfunction md5_ff(a, b, c, d, x, s, t)\r\n{\r\n return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\r\n}\r\nfunction md5_gg(a, b, c, d, x, s, t)\r\n{\r\n return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\r\n}\r\nfunction md5_hh(a, b, c, d, x, s, t)\r\n{\r\n return md5_cmn(b ^ c ^ d, a, b, x, s, t);\r\n}\r\nfunction md5_ii(a, b, c, d, x, s, t)\r\n{\r\n return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\r\n}\r\n\r\n/*\r\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\r\n * to work around bugs in some JS interpreters.\r\n */\r\nfunction safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}\r\n\r\n/*\r\n * Bitwise rotate a 32-bit number to the left.\r\n */\r\nfunction bit_rol(num, cnt)\r\n{\r\n return (num << cnt) | (num >>> (32 - cnt));\r\n}\r\n\r\nmodule.exports = function md5(buf) {\r\n return helpers.hash(buf, core_md5, 16);\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/crypto-browserify/md5.js\n// module id = 24\n// module chunks = 0","// Original code adapted from Robert Kieffer.\n// details at https://github.com/broofa/node-uuid\n(function() {\n var _global = this;\n\n var mathRNG, whatwgRNG;\n\n // NOTE: Math.random() does not guarantee \"cryptographic quality\"\n mathRNG = function(size) {\n var bytes = new Array(size);\n var r;\n\n for (var i = 0, r; i < size; i++) {\n if ((i & 0x03) == 0) r = Math.random() * 0x100000000;\n bytes[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return bytes;\n }\n\n if (_global.crypto && crypto.getRandomValues) {\n whatwgRNG = function(size) {\n var bytes = new Uint8Array(size);\n crypto.getRandomValues(bytes);\n return bytes;\n }\n }\n\n module.exports = whatwgRNG || mathRNG;\n\n}())\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/crypto-browserify/rng.js\n// module id = 25\n// module chunks = 0","/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined\n * in FIPS PUB 180-1\n * Version 2.1a Copyright Paul Johnston 2000 - 2002.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for details.\n */\n\nvar helpers = require('./helpers');\n\n/*\n * Calculate the SHA-1 of an array of big-endian words, and a bit length\n */\nfunction core_sha1(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n\n var w = Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n for(var i = 0; i < x.length; i += 16)\n {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n var olde = e;\n\n for(var j = 0; j < 80; j++)\n {\n if(j < 16) w[j] = x[i + j];\n else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\n var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return Array(a, b, c, d, e);\n\n}\n\n/*\n * Perform the appropriate triplet combination function for the current\n * iteration\n */\nfunction sha1_ft(t, b, c, d)\n{\n if(t < 20) return (b & c) | ((~b) & d);\n if(t < 40) return b ^ c ^ d;\n if(t < 60) return (b & c) | (b & d) | (c & d);\n return b ^ c ^ d;\n}\n\n/*\n * Determine the appropriate additive constant for the current iteration\n */\nfunction sha1_kt(t)\n{\n return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :\n (t < 60) ? -1894007588 : -899497514;\n}\n\n/*\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n * to work around bugs in some JS interpreters.\n */\nfunction safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}\n\n/*\n * Bitwise rotate a 32-bit number to the left.\n */\nfunction rol(num, cnt)\n{\n return (num << cnt) | (num >>> (32 - cnt));\n}\n\nmodule.exports = function sha1(buf) {\n return helpers.hash(buf, core_sha1, 20, true);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/crypto-browserify/sha.js\n// module id = 26\n// module chunks = 0","\n/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar helpers = require('./helpers');\n\nvar safe_add = function(x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n};\n\nvar S = function(X, n) {\n return (X >>> n) | (X << (32 - n));\n};\n\nvar R = function(X, n) {\n return (X >>> n);\n};\n\nvar Ch = function(x, y, z) {\n return ((x & y) ^ ((~x) & z));\n};\n\nvar Maj = function(x, y, z) {\n return ((x & y) ^ (x & z) ^ (y & z));\n};\n\nvar Sigma0256 = function(x) {\n return (S(x, 2) ^ S(x, 13) ^ S(x, 22));\n};\n\nvar Sigma1256 = function(x) {\n return (S(x, 6) ^ S(x, 11) ^ S(x, 25));\n};\n\nvar Gamma0256 = function(x) {\n return (S(x, 7) ^ S(x, 18) ^ R(x, 3));\n};\n\nvar Gamma1256 = function(x) {\n return (S(x, 17) ^ S(x, 19) ^ R(x, 10));\n};\n\nvar core_sha256 = function(m, l) {\n var K = new Array(0x428A2F98,0x71374491,0xB5C0FBCF,0xE9B5DBA5,0x3956C25B,0x59F111F1,0x923F82A4,0xAB1C5ED5,0xD807AA98,0x12835B01,0x243185BE,0x550C7DC3,0x72BE5D74,0x80DEB1FE,0x9BDC06A7,0xC19BF174,0xE49B69C1,0xEFBE4786,0xFC19DC6,0x240CA1CC,0x2DE92C6F,0x4A7484AA,0x5CB0A9DC,0x76F988DA,0x983E5152,0xA831C66D,0xB00327C8,0xBF597FC7,0xC6E00BF3,0xD5A79147,0x6CA6351,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);\n var HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19);\n var W = new Array(64);\n var a, b, c, d, e, f, g, h, i, j;\n var T1, T2;\n /* append padding */\n m[l >> 5] |= 0x80 << (24 - l % 32);\n m[((l + 64 >> 9) << 4) + 15] = l;\n for (var i = 0; i < m.length; i += 16) {\n a = HASH[0]; b = HASH[1]; c = HASH[2]; d = HASH[3]; e = HASH[4]; f = HASH[5]; g = HASH[6]; h = HASH[7];\n for (var j = 0; j < 64; j++) {\n if (j < 16) {\n W[j] = m[j + i];\n } else {\n W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]);\n }\n T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]);\n T2 = safe_add(Sigma0256(a), Maj(a, b, c));\n h = g; g = f; f = e; e = safe_add(d, T1); d = c; c = b; b = a; a = safe_add(T1, T2);\n }\n HASH[0] = safe_add(a, HASH[0]); HASH[1] = safe_add(b, HASH[1]); HASH[2] = safe_add(c, HASH[2]); HASH[3] = safe_add(d, HASH[3]);\n HASH[4] = safe_add(e, HASH[4]); HASH[5] = safe_add(f, HASH[5]); HASH[6] = safe_add(g, HASH[6]); HASH[7] = safe_add(h, HASH[7]);\n }\n return HASH;\n};\n\nmodule.exports = function sha256(buf) {\n return helpers.hash(buf, core_sha256, 32, true);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/crypto-browserify/sha256.js\n// module id = 27\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///amazon-cognito-identity.min.js","webpack:///webpack/bootstrap 2e8d2279cc1c9a9f6b5f","webpack:///./~/buffer/index.js","webpack:///./~/crypto-browserify/helpers.js","webpack:///./src/AuthenticationHelper.js","webpack:///./src/CognitoAccessToken.js","webpack:///./src/CognitoIdToken.js","webpack:///./src/CognitoRefreshToken.js","webpack:///./src/CognitoUser.js","webpack:///./src/CognitoUserAttribute.js","webpack:///./src/CognitoUserSession.js","webpack:///./src/DateHelper.js","webpack:///./src/BigInteger.js","webpack:///./src/CognitoJwtToken.js","webpack:///./src/StorageHelper.js","webpack:///./~/crypto-browserify/index.js","webpack:///./src/AuthenticationDetails.js","webpack:///./src/CognitoUserPool.js","webpack:///./src/CookieStorage.js","webpack:///./src/Client.js","webpack:///./src/UserAgent.js","webpack:///./src/index.js","webpack:///./~/base64-js/index.js","webpack:///./~/crypto-browserify/md5.js","webpack:///./~/crypto-browserify/rng.js","webpack:///./~/crypto-browserify/sha.js","webpack:///./~/crypto-browserify/sha256.js","webpack:///./~/ieee754/index.js","webpack:///./~/isarray/index.js","webpack:///./~/js-cookie/src/js.cookie.js","webpack:///(webpack)/buildin/global.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","global","kMaxLength","Buffer","TYPED_ARRAY_SUPPORT","createBuffer","that","length","RangeError","Uint8Array","__proto__","arg","encodingOrOffset","Error","allocUnsafe","from","TypeError","ArrayBuffer","fromArrayBuffer","fromString","fromObject","assertSize","size","alloc","fill","encoding","undefined","checked","string","isEncoding","byteLength","actual","write","slice","fromArrayLike","array","byteOffset","obj","isBuffer","len","copy","buffer","isnan","type","isArray","data","toString","SlowBuffer","isView","loweredCase","utf8ToBytes","base64ToBytes","toLowerCase","slowToString","start","end","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","b","bidirectionalIndexOf","val","dir","isNaN","arrayIndexOf","indexOf","lastIndexOf","arr","read","buf","indexSize","readUInt16BE","arrLength","valLength","String","foundIndex","found","j","hexWrite","offset","Number","remaining","strLen","parsed","parseInt","substr","utf8Write","blitBuffer","asciiWrite","asciiToBytes","latin1Write","base64Write","ucs2Write","utf16leToBytes","base64","fromByteArray","Math","min","res","firstByte","codePoint","bytesPerSequence","secondByte","thirdByte","fourthByte","tempCodePoint","push","decodeCodePointsArray","codePoints","MAX_ARGUMENTS_LENGTH","fromCharCode","apply","ret","out","toHex","bytes","checkOffset","ext","checkInt","max","objectWriteUInt16","littleEndian","objectWriteUInt32","checkIEEE754","writeFloat","noAssert","ieee754","writeDouble","base64clean","str","stringtrim","replace","INVALID_BASE64_RE","trim","units","Infinity","leadSurrogate","charCodeAt","byteArray","hi","lo","toByteArray","src","dst","INSPECT_MAX_BYTES","foo","subarray","e","poolSize","_augment","Symbol","species","allocUnsafeSlow","_isBuffer","compare","a","x","y","concat","list","pos","swap16","swap32","swap64","arguments","equals","inspect","match","join","target","thisStart","thisEnd","thisCopy","targetCopy","includes","isFinite","toJSON","Array","_arr","newBuf","sliceLen","readUIntLE","mul","readUIntBE","readUInt8","readUInt16LE","readUInt32LE","readUInt32BE","readIntLE","pow","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","readFloatBE","readDoubleLE","readDoubleBE","writeUIntLE","writeUIntBE","writeUInt8","floor","writeUInt16LE","writeUInt16BE","writeUInt32LE","writeUInt32BE","writeIntLE","limit","sub","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE","targetStart","set","code","toArray","bigEndian","intSize","zeroBuffer","fn","toBuffer","hash","hashSize","chrsz","_classCallCheck","instance","Constructor","_buffer","_cryptoBrowserify","crypto","newObj","key","default","_BigInteger","_BigInteger2","createHash","createHmac","randomBytes","initN","AuthenticationHelper","PoolName","N","g","k","hexHash","smallAValue","generateRandomSmallA","getLargeAValue","infoBits","poolName","getSmallAValue","callback","_this","largeAValue","calculateA","err","hexRandom","mod","generateRandomString","getRandomPassword","randomPassword","getSaltDevices","SaltToHashDevices","getVerifierDevices","verifierDevices","generateHashDevice","deviceGroupKey","username","_this2","combinedString","hashedString","padHex","modPow","verifierDevicesNotPadded","_this3","A","ZERO","calculateU","B","UHexHash","hashHex","update","digest","hexStr","computehkdf","ikm","salt","prk","infoBitsUpdate","getPasswordAuthenticationKey","password","serverBValue","_this4","UValue","usernamePassword","usernamePasswordHash","xValue","calculateS","sValue","hkdf","_this5","gModPowXN","subtract","multiply","add","err2","result","getNewPasswordRequiredChallengeUserAttributePrefix","bigInt","hashStr","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","constructor","writable","setPrototypeOf","_CognitoJwtToken2","_CognitoJwtToken3","CognitoAccessToken","_CognitoJwtToken","_ref","AccessToken","CognitoIdToken","IdToken","CognitoRefreshToken","RefreshToken","token","getToken","_interopRequireDefault","_AuthenticationHelper","_AuthenticationHelper2","_CognitoAccessToken","_CognitoAccessToken2","_CognitoIdToken","_CognitoIdToken2","_CognitoRefreshToken","_CognitoRefreshToken2","_CognitoUserSession","_CognitoUserSession2","_DateHelper","_DateHelper2","_CognitoUserAttribute","_CognitoUserAttribute2","_StorageHelper","_StorageHelper2","CognitoUser","Username","Pool","pool","Session","client","signInUserSession","authenticationFlowType","storage","Storage","getStorage","setSignInUserSession","clearCachedTokens","cacheTokens","getSignInUserSession","getUsername","getAuthenticationFlowType","setAuthenticationFlowType","initiateAuth","authDetails","authParameters","getAuthParameters","USERNAME","jsonReq","AuthFlow","ClientId","getClientId","AuthParameters","ClientMetadata","getValidationData","getUserContextData","UserContextData","request","onFailure","challengeName","ChallengeName","challengeParameters","ChallengeParameters","customChallenge","getCognitoUserSession","AuthenticationResult","onSuccess","authenticateUser","authenticateUserPlainUsernamePassword","authenticateUserDefaultAuth","authenticationHelper","getUserPoolId","split","dateHelper","deviceKey","DEVICE_KEY","errOnAValue","aValue","SRP_A","CHALLENGE_NAME","USER_ID_FOR_SRP","SRP_B","SALT","getCachedDeviceKeyAndPassword","getPassword","errOnHkdf","dateNow","getNowString","signatureString","SECRET_BLOCK","challengeResponses","PASSWORD_CLAIM_SECRET_BLOCK","TIMESTAMP","PASSWORD_CLAIM_SIGNATURE","jsonReqResp","ChallengeResponses","respondToAuthChallenge","challenge","challengeCallback","errChallenge","dataChallenge","message","clearCachedDeviceKeyAndPassword","errAuthenticate","dataAuthenticate","userAttributes","rawRequiredAttributes","requiredAttributes","userAttributesPrefix","JSON","parse","newPasswordRequired","authenticateUserInternal","PASSWORD","authResult","mfaRequired","selectMFAType","mfaSetup","totpRequired","getDeviceResponse","newDeviceMetadata","NewDeviceMetadata","DeviceGroupKey","DeviceKey","errGenHash","deviceSecretVerifierConfig","Salt","PasswordVerifier","getAccessToken","getJwtToken","DeviceSecretVerifierConfig","DeviceName","navigator","userAgent","errConfirm","dataConfirm","cacheDeviceKeyAndPassword","UserConfirmationNecessary","completeNewPasswordChallenge","newPassword","requiredAttributeData","finalUserAttributes","keys","forEach","NEW_PASSWORD","_this6","errAValue","errHkdf","confirmRegistration","confirmationCode","forceAliasCreation","ConfirmationCode","ForceAliasCreation","sendCustomChallengeAnswer","answerChallenge","_this7","ANSWER","sendMFACode","mfaType","_this8","SMS_MFA_CODE","mfaTypeSelection","SOFTWARE_TOKEN_MFA_CODE","changePassword","oldUserPassword","newUserPassword","isValid","PreviousPassword","ProposedPassword","enableMFA","mfaOptions","mfaEnabled","DeliveryMedium","AttributeName","MFAOptions","setUserMfaPreference","smsMfaSettings","softwareTokenMfaSettings","SMSMfaSettings","SoftwareTokenMfaSettings","disableMFA","deleteUser","_this9","updateAttributes","attributes","UserAttributes","getUserAttributes","userData","attributeList","attribute","Name","Value","userAttribute","getMFAOptions","deleteAttributes","UserAttributeNames","resendConfirmationCode","getSession","keyPrefix","idTokenKey","accessTokenKey","refreshTokenKey","clockDriftKey","getItem","idToken","accessToken","refreshToken","clockDrift","sessionData","ClockDrift","cachedSession","refreshSession","_this10","REFRESH_TOKEN","lastUserKey","deviceKeyKey","authenticationResult","setItem","getIdToken","getRefreshToken","getClockDrift","randomPasswordKey","deviceGroupKeyKey","removeItem","forgotPassword","inputVerificationCode","confirmPassword","Password","getAttributeVerificationCode","attributeName","verifyAttribute","Code","getDevice","forgetSpecificDevice","forgetDevice","_this11","setDeviceStatusRemembered","DeviceRememberedStatus","setDeviceStatusNotRemembered","listDevices","paginationToken","Limit","PaginationToken","globalSignOut","_this12","signOut","sendMFASelectionAnswer","_this13","associateSoftwareToken","_this14","associateSecretCode","SecretCode","verifySoftwareToken","totpCode","friendlyDeviceName","_this15","UserCode","FriendlyDeviceName","errRespond","dataRespond","CognitoUserAttribute","getValue","setValue","getName","setName","stringify","CognitoUserSession","calculateClockDrift","Date","getIssuedAt","now","adjusted","getExpiration","monthNames","weekNames","DateHelper","weekDay","getUTCDay","month","getUTCMonth","day","getUTCDate","hours","getUTCHours","minutes","getUTCMinutes","seconds","getUTCSeconds","getUTCFullYear","BigInteger","nbi","am1","w","v","am2","xl","xh","h","am3","int2char","BI_RM","charAt","intAt","BI_RC","bnpCopyTo","r","t","bnpFromInt","DV","nbv","fromInt","bnpFromString","mi","sh","DB","clamp","subTo","bnpClamp","DM","bnToString","negate","km","bnNegate","bnAbs","bnCompareTo","nbits","bnBitLength","bnpDLShiftTo","bnpDRShiftTo","bnpLShiftTo","bs","cbs","bm","ds","bnpRShiftTo","bnpSubTo","bnpMultiplyTo","abs","am","bnpSquareTo","bnpDivRemTo","q","pm","pt","copyTo","ts","ms","nsh","lShiftTo","ys","y0","yt","F1","F2","d1","FV","d2","dlShiftTo","compareTo","ONE","qd","drShiftTo","rShiftTo","bnMod","divRemTo","bnpInvDigit","bnEquals","bnpAddTo","bnAdd","addTo","bnSubtract","bnMultiply","multiplyTo","bnDivide","Montgomery","mp","invDigit","mpl","mph","um","mt2","montConvert","montRevert","reduce","montReduce","u0","montSqrTo","squareTo","montMulTo","bnModPow","bitLength","z","k1","convert","g2","sqrTo","mulTo","is1","r2","revert","dbits","inBrowser","appName","rr","vv","divide","CognitoJwtToken","jwtToken","payload","decodePayload","exp","iat","dataMemory","MemoryStorage","clear","StorageHelper","storageWindow","window","localStorage","exception","hmac","blocksize","ipad","opad","alg","algorithms","bufs","error","enc","sha","sha256","rng","md5","sha1","f","AuthenticationDetails","ValidationData","validationData","_Client","_Client2","_CognitoUser","_CognitoUser2","CognitoUserPool","UserPoolId","endpoint","AdvancedSecurityDataCollectionFlag","test","region","userPoolId","clientId","advancedSecurityDataCollectionFlag","signUp","cognitoUser","returnData","user","userConfirmed","UserConfirmed","userSub","UserSub","getCurrentUser","lastAuthUser","AmazonCognitoAdvancedSecurityData","amazonCognitoAdvancedSecurityDataConst","advancedSecurityData","getData","EncodedData","_jsCookie","Cookies","CookieStorage","domain","path","expires","secure","remove","cookies","index","_UserAgent","_UserAgent2","Client","operation","params","headers","Content-Type","X-Amz-Target","X-Amz-User-Agent","options","method","mode","cache","body","response","fetch","then","resp","json","catch","ok","__type","pop","Message","statusCode","status","UserAgent","_AuthenticationDetails","_CognitoUserPool","_CookieStorage","placeHoldersCount","b64","tmp","placeHolders","Arr","L","revLookup","tripletToBase64","num","lookup","encodeChunk","uint8","output","extraBytes","parts","len2","core_md5","olda","oldb","oldc","oldd","md5_ff","md5_gg","md5_hh","md5_ii","safe_add","md5_cmn","bit_rol","lsw","cnt","helpers","mathRNG","whatwgRNG","_global","random","getRandomValues","core_sha1","olde","rol","sha1_ft","sha1_kt","S","X","R","Ch","Maj","Sigma0256","Sigma1256","Gamma0256","Gamma1256","core_sha256","T1","T2","K","HASH","W","isLE","mLen","nBytes","eLen","eMax","eBias","nBits","NaN","rt","log","LN2","__WEBPACK_AMD_DEFINE_FACTORY__","__WEBPACK_AMD_DEFINE_RESULT__","registeredInModuleLoader","OldCookies","api","noConflict","extend","init","converter","document","defaults","setMilliseconds","getMilliseconds","toUTCString","encodeURIComponent","decodeURIComponent","escape","stringifiedAttributes","cookie","rdecode","getJSON","withConverter","Function","eval"],"mappings":";;;;;;;;;;;;;;;;CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,sBAAAD,IAEAD,EAAA,sBAAAC,KACCK,KAAA,WACD,MCkBgB,UAAUC,GCxB1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAV,WAUA,OANAK,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,GAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KA+DA,OAnCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAG,EAAA,SAAAK,GAA2C,MAAAA,IAG3CR,EAAAS,EAAA,SAAAf,EAAAgB,EAAAC,GACAX,EAAAY,EAAAlB,EAAAgB,IACAG,OAAAC,eAAApB,EAAAgB,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAX,EAAAkB,EAAA,SAAAvB,GACA,GAAAgB,GAAAhB,KAAAwB,WACA,WAA2B,MAAAxB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAK,GAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QA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EAAAxG,OAAA,SAAAtjB,EAAAqR,GACAyY,EAAA9pB,EAAA,GAAAgqB,EAAA3Y,GACA+R,SAAA,MAIA0G,EAAAiB,cAAAd,EAEAH,EAGA,MAAAG,GAAA,iB7By1NM,SAAUn7B,EAAQD,G8B5/NxB,GAAA8R,EAGAA,GAAA,WACA,MAAA1R,QAGA,KAEA0R,KAAAqqB,SAAA,qBAAAC,MAAA,QACC,MAAA9wB,GAED,gBAAA2lB,UACAnf,EAAAmf,QAOAhxB,EAAAD,QAAA8R","file":"amazon-cognito-identity.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AmazonCognitoIdentity\"] = factory();\n\telse\n\t\troot[\"AmazonCognitoIdentity\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n * \n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n * \n * http://aws.amazon.com/asl/\n * \n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License. \n */\n\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AmazonCognitoIdentity\"] = factory();\n\telse\n\t\troot[\"AmazonCognitoIdentity\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 19);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(global) {/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n\n\nvar base64 = __webpack_require__(20)\nvar ieee754 = __webpack_require__(25)\nvar isArray = __webpack_require__(26)\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(28)))\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Buffer = __webpack_require__(0).Buffer;\nvar intSize = 4;\nvar zeroBuffer = new Buffer(intSize); zeroBuffer.fill(0);\nvar chrsz = 8;\n\nfunction toArray(buf, bigEndian) {\n if ((buf.length % intSize) !== 0) {\n var len = buf.length + (intSize - (buf.length % intSize));\n buf = Buffer.concat([buf, zeroBuffer], len);\n }\n\n var arr = [];\n var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE;\n for (var i = 0; i < buf.length; i += intSize) {\n arr.push(fn.call(buf, i));\n }\n return arr;\n}\n\nfunction toBuffer(arr, size, bigEndian) {\n var buf = new Buffer(size);\n var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE;\n for (var i = 0; i < arr.length; i++) {\n fn.call(buf, arr[i], i * 4, true);\n }\n return buf;\n}\n\nfunction hash(buf, fn, hashSize, bigEndian) {\n if (!Buffer.isBuffer(buf)) buf = new Buffer(buf);\n var arr = fn(toArray(buf, bigEndian), buf.length * chrsz);\n return toBuffer(arr, hashSize, bigEndian);\n}\n\nmodule.exports = { hash: hash };\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _buffer = __webpack_require__(0);\n\nvar _cryptoBrowserify = __webpack_require__(13);\n\nvar crypto = _interopRequireWildcard(_cryptoBrowserify);\n\nvar _BigInteger = __webpack_require__(10);\n\nvar _BigInteger2 = _interopRequireDefault(_BigInteger);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } /*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar createHash = crypto.createHash;\nvar createHmac = crypto.createHmac;\nvar randomBytes = crypto.randomBytes;\n\nvar initN = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1' + '29024E088A67CC74020BBEA63B139B22514A08798E3404DD' + 'EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245' + 'E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' + 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D' + 'C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F' + '83655D23DCA3AD961C62F356208552BB9ED529077096966D' + '670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B' + 'E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9' + 'DE2BCBF6955817183995497CEA956AE515D2261898FA0510' + '15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64' + 'ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7' + 'ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B' + 'F12FFA06D98A0864D87602733EC86A64521F2B18177B200C' + 'BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31' + '43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF';\n\nvar newPasswordRequiredChallengeUserAttributePrefix = 'userAttributes.';\n\n/** @class */\n\nvar AuthenticationHelper = function () {\n /**\n * Constructs a new AuthenticationHelper object\n * @param {string} PoolName Cognito user pool name.\n */\n function AuthenticationHelper(PoolName) {\n _classCallCheck(this, AuthenticationHelper);\n\n this.N = new _BigInteger2.default(initN, 16);\n this.g = new _BigInteger2.default('2', 16);\n this.k = new _BigInteger2.default(this.hexHash('00' + this.N.toString(16) + '0' + this.g.toString(16)), 16);\n\n this.smallAValue = this.generateRandomSmallA();\n this.getLargeAValue(function () {});\n\n this.infoBits = _buffer.Buffer.from('Caldera Derived Key', 'utf8');\n\n this.poolName = PoolName;\n }\n\n /**\n * @returns {BigInteger} small A, a random number\n */\n\n\n AuthenticationHelper.prototype.getSmallAValue = function getSmallAValue() {\n return this.smallAValue;\n };\n\n /**\n * @param {nodeCallback} callback Called with (err, largeAValue)\n * @returns {void}\n */\n\n\n AuthenticationHelper.prototype.getLargeAValue = function getLargeAValue(callback) {\n var _this = this;\n\n if (this.largeAValue) {\n callback(null, this.largeAValue);\n } else {\n this.calculateA(this.smallAValue, function (err, largeAValue) {\n if (err) {\n callback(err, null);\n }\n\n _this.largeAValue = largeAValue;\n callback(null, _this.largeAValue);\n });\n }\n };\n\n /**\n * helper function to generate a random big integer\n * @returns {BigInteger} a random value.\n * @private\n */\n\n\n AuthenticationHelper.prototype.generateRandomSmallA = function generateRandomSmallA() {\n var hexRandom = randomBytes(128).toString('hex');\n\n var randomBigInt = new _BigInteger2.default(hexRandom, 16);\n var smallABigInt = randomBigInt.mod(this.N);\n\n return smallABigInt;\n };\n\n /**\n * helper function to generate a random string\n * @returns {string} a random value.\n * @private\n */\n\n\n AuthenticationHelper.prototype.generateRandomString = function generateRandomString() {\n return randomBytes(40).toString('base64');\n };\n\n /**\n * @returns {string} Generated random value included in password hash.\n */\n\n\n AuthenticationHelper.prototype.getRandomPassword = function getRandomPassword() {\n return this.randomPassword;\n };\n\n /**\n * @returns {string} Generated random value included in devices hash.\n */\n\n\n AuthenticationHelper.prototype.getSaltDevices = function getSaltDevices() {\n return this.SaltToHashDevices;\n };\n\n /**\n * @returns {string} Value used to verify devices.\n */\n\n\n AuthenticationHelper.prototype.getVerifierDevices = function getVerifierDevices() {\n return this.verifierDevices;\n };\n\n /**\n * Generate salts and compute verifier.\n * @param {string} deviceGroupKey Devices to generate verifier for.\n * @param {string} username User to generate verifier for.\n * @param {nodeCallback} callback Called with (err, null)\n * @returns {void}\n */\n\n\n AuthenticationHelper.prototype.generateHashDevice = function generateHashDevice(deviceGroupKey, username, callback) {\n var _this2 = this;\n\n this.randomPassword = this.generateRandomString();\n var combinedString = '' + deviceGroupKey + username + ':' + this.randomPassword;\n var hashedString = this.hash(combinedString);\n\n var hexRandom = randomBytes(16).toString('hex');\n this.SaltToHashDevices = this.padHex(new _BigInteger2.default(hexRandom, 16));\n\n this.g.modPow(new _BigInteger2.default(this.hexHash(this.SaltToHashDevices + hashedString), 16), this.N, function (err, verifierDevicesNotPadded) {\n if (err) {\n callback(err, null);\n }\n\n _this2.verifierDevices = _this2.padHex(verifierDevicesNotPadded);\n callback(null, null);\n });\n };\n\n /**\n * Calculate the client's public value A = g^a%N\n * with the generated random number a\n * @param {BigInteger} a Randomly generated small A.\n * @param {nodeCallback} callback Called with (err, largeAValue)\n * @returns {void}\n * @private\n */\n\n\n AuthenticationHelper.prototype.calculateA = function calculateA(a, callback) {\n var _this3 = this;\n\n this.g.modPow(a, this.N, function (err, A) {\n if (err) {\n callback(err, null);\n }\n\n if (A.mod(_this3.N).equals(_BigInteger2.default.ZERO)) {\n callback(new Error('Illegal paramater. A mod N cannot be 0.'), null);\n }\n\n callback(null, A);\n });\n };\n\n /**\n * Calculate the client's value U which is the hash of A and B\n * @param {BigInteger} A Large A value.\n * @param {BigInteger} B Server B value.\n * @returns {BigInteger} Computed U value.\n * @private\n */\n\n\n AuthenticationHelper.prototype.calculateU = function calculateU(A, B) {\n this.UHexHash = this.hexHash(this.padHex(A) + this.padHex(B));\n var finalU = new _BigInteger2.default(this.UHexHash, 16);\n\n return finalU;\n };\n\n /**\n * Calculate a hash from a bitArray\n * @param {Buffer} buf Value to hash.\n * @returns {String} Hex-encoded hash.\n * @private\n */\n\n\n AuthenticationHelper.prototype.hash = function hash(buf) {\n var hashHex = createHash('sha256').update(buf).digest('hex');\n return new Array(64 - hashHex.length).join('0') + hashHex;\n };\n\n /**\n * Calculate a hash from a hex string\n * @param {String} hexStr Value to hash.\n * @returns {String} Hex-encoded hash.\n * @private\n */\n\n\n AuthenticationHelper.prototype.hexHash = function hexHash(hexStr) {\n return this.hash(_buffer.Buffer.from(hexStr, 'hex'));\n };\n\n /**\n * Standard hkdf algorithm\n * @param {Buffer} ikm Input key material.\n * @param {Buffer} salt Salt value.\n * @returns {Buffer} Strong key material.\n * @private\n */\n\n\n AuthenticationHelper.prototype.computehkdf = function computehkdf(ikm, salt) {\n var prk = createHmac('sha256', salt).update(ikm).digest();\n var infoBitsUpdate = _buffer.Buffer.concat([this.infoBits, _buffer.Buffer.from(String.fromCharCode(1), 'utf8')]);\n var hmac = createHmac('sha256', prk).update(infoBitsUpdate).digest();\n return hmac.slice(0, 16);\n };\n\n /**\n * Calculates the final hkdf based on computed S value, and computed U value and the key\n * @param {String} username Username.\n * @param {String} password Password.\n * @param {BigInteger} serverBValue Server B value.\n * @param {BigInteger} salt Generated salt.\n * @param {nodeCallback} callback Called with (err, hkdfValue)\n * @returns {void}\n */\n\n\n AuthenticationHelper.prototype.getPasswordAuthenticationKey = function getPasswordAuthenticationKey(username, password, serverBValue, salt, callback) {\n var _this4 = this;\n\n if (serverBValue.mod(this.N).equals(_BigInteger2.default.ZERO)) {\n throw new Error('B cannot be zero.');\n }\n\n this.UValue = this.calculateU(this.largeAValue, serverBValue);\n\n if (this.UValue.equals(_BigInteger2.default.ZERO)) {\n throw new Error('U cannot be zero.');\n }\n\n var usernamePassword = '' + this.poolName + username + ':' + password;\n var usernamePasswordHash = this.hash(usernamePassword);\n\n var xValue = new _BigInteger2.default(this.hexHash(this.padHex(salt) + usernamePasswordHash), 16);\n this.calculateS(xValue, serverBValue, function (err, sValue) {\n if (err) {\n callback(err, null);\n }\n\n var hkdf = _this4.computehkdf(_buffer.Buffer.from(_this4.padHex(sValue), 'hex'), _buffer.Buffer.from(_this4.padHex(_this4.UValue.toString(16)), 'hex'));\n\n callback(null, hkdf);\n });\n };\n\n /**\n * Calculates the S value used in getPasswordAuthenticationKey\n * @param {BigInteger} xValue Salted password hash value.\n * @param {BigInteger} serverBValue Server B value.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n\n\n AuthenticationHelper.prototype.calculateS = function calculateS(xValue, serverBValue, callback) {\n var _this5 = this;\n\n this.g.modPow(xValue, this.N, function (err, gModPowXN) {\n if (err) {\n callback(err, null);\n }\n\n var intValue2 = serverBValue.subtract(_this5.k.multiply(gModPowXN));\n intValue2.modPow(_this5.smallAValue.add(_this5.UValue.multiply(xValue)), _this5.N, function (err2, result) {\n if (err2) {\n callback(err2, null);\n }\n\n callback(null, result.mod(_this5.N));\n });\n });\n };\n\n /**\n * Return constant newPasswordRequiredChallengeUserAttributePrefix\n * @return {newPasswordRequiredChallengeUserAttributePrefix} constant prefix value\n */\n\n\n AuthenticationHelper.prototype.getNewPasswordRequiredChallengeUserAttributePrefix = function getNewPasswordRequiredChallengeUserAttributePrefix() {\n return newPasswordRequiredChallengeUserAttributePrefix;\n };\n\n /**\n * Converts a BigInteger (or hex string) to hex format padded with zeroes for hashing\n * @param {BigInteger|String} bigInt Number or string to pad.\n * @returns {String} Padded hex string.\n */\n\n\n AuthenticationHelper.prototype.padHex = function padHex(bigInt) {\n var hashStr = bigInt.toString(16);\n if (hashStr.length % 2 === 1) {\n hashStr = '0' + hashStr;\n } else if ('89ABCDEFabcdef'.indexOf(hashStr[0]) !== -1) {\n hashStr = '00' + hashStr;\n }\n return hashStr;\n };\n\n return AuthenticationHelper;\n}();\n\nexports.default = AuthenticationHelper;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _CognitoJwtToken2 = __webpack_require__(11);\n\nvar _CognitoJwtToken3 = _interopRequireDefault(_CognitoJwtToken2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nvar CognitoAccessToken = function (_CognitoJwtToken) {\n _inherits(CognitoAccessToken, _CognitoJwtToken);\n\n /**\n * Constructs a new CognitoAccessToken object\n * @param {string=} AccessToken The JWT access token.\n */\n function CognitoAccessToken() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n AccessToken = _ref.AccessToken;\n\n _classCallCheck(this, CognitoAccessToken);\n\n return _possibleConstructorReturn(this, _CognitoJwtToken.call(this, AccessToken || ''));\n }\n\n return CognitoAccessToken;\n}(_CognitoJwtToken3.default);\n\nexports.default = CognitoAccessToken;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _CognitoJwtToken2 = __webpack_require__(11);\n\nvar _CognitoJwtToken3 = _interopRequireDefault(_CognitoJwtToken2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nvar CognitoIdToken = function (_CognitoJwtToken) {\n _inherits(CognitoIdToken, _CognitoJwtToken);\n\n /**\n * Constructs a new CognitoIdToken object\n * @param {string=} IdToken The JWT Id token\n */\n function CognitoIdToken() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n IdToken = _ref.IdToken;\n\n _classCallCheck(this, CognitoIdToken);\n\n return _possibleConstructorReturn(this, _CognitoJwtToken.call(this, IdToken || ''));\n }\n\n return CognitoIdToken;\n}(_CognitoJwtToken3.default);\n\nexports.default = CognitoIdToken;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nvar CognitoRefreshToken = function () {\n /**\n * Constructs a new CognitoRefreshToken object\n * @param {string=} RefreshToken The JWT refresh token.\n */\n function CognitoRefreshToken() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n RefreshToken = _ref.RefreshToken;\n\n _classCallCheck(this, CognitoRefreshToken);\n\n // Assign object\n this.token = RefreshToken || '';\n }\n\n /**\n * @returns {string} the record's token.\n */\n\n\n CognitoRefreshToken.prototype.getToken = function getToken() {\n return this.token;\n };\n\n return CognitoRefreshToken;\n}();\n\nexports.default = CognitoRefreshToken;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _buffer = __webpack_require__(0);\n\nvar _cryptoBrowserify = __webpack_require__(13);\n\nvar crypto = _interopRequireWildcard(_cryptoBrowserify);\n\nvar _BigInteger = __webpack_require__(10);\n\nvar _BigInteger2 = _interopRequireDefault(_BigInteger);\n\nvar _AuthenticationHelper = __webpack_require__(2);\n\nvar _AuthenticationHelper2 = _interopRequireDefault(_AuthenticationHelper);\n\nvar _CognitoAccessToken = __webpack_require__(3);\n\nvar _CognitoAccessToken2 = _interopRequireDefault(_CognitoAccessToken);\n\nvar _CognitoIdToken = __webpack_require__(4);\n\nvar _CognitoIdToken2 = _interopRequireDefault(_CognitoIdToken);\n\nvar _CognitoRefreshToken = __webpack_require__(5);\n\nvar _CognitoRefreshToken2 = _interopRequireDefault(_CognitoRefreshToken);\n\nvar _CognitoUserSession = __webpack_require__(8);\n\nvar _CognitoUserSession2 = _interopRequireDefault(_CognitoUserSession);\n\nvar _DateHelper = __webpack_require__(9);\n\nvar _DateHelper2 = _interopRequireDefault(_DateHelper);\n\nvar _CognitoUserAttribute = __webpack_require__(7);\n\nvar _CognitoUserAttribute2 = _interopRequireDefault(_CognitoUserAttribute);\n\nvar _StorageHelper = __webpack_require__(12);\n\nvar _StorageHelper2 = _interopRequireDefault(_StorageHelper);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } /*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n//import createHmac from 'create-hmac';\n\n\nvar createHmac = crypto.createHmac;\n\n/**\n * @callback nodeCallback\n * @template T result\n * @param {*} err The operation failure reason, or null.\n * @param {T} result The operation result.\n */\n\n/**\n * @callback onFailure\n * @param {*} err Failure reason.\n */\n\n/**\n * @callback onSuccess\n * @template T result\n * @param {T} result The operation result.\n */\n\n/**\n * @callback mfaRequired\n * @param {*} details MFA challenge details.\n */\n\n/**\n * @callback customChallenge\n * @param {*} details Custom challenge details.\n */\n\n/**\n * @callback inputVerificationCode\n * @param {*} data Server response.\n */\n\n/**\n * @callback authSuccess\n * @param {CognitoUserSession} session The new session.\n * @param {bool=} userConfirmationNecessary User must be confirmed.\n */\n\n/** @class */\nvar CognitoUser = function () {\n /**\n * Constructs a new CognitoUser object\n * @param {object} data Creation options\n * @param {string} data.Username The user's username.\n * @param {CognitoUserPool} data.Pool Pool containing the user.\n * @param {object} data.Storage Optional storage object.\n */\n function CognitoUser(data) {\n _classCallCheck(this, CognitoUser);\n\n if (data == null || data.Username == null || data.Pool == null) {\n throw new Error('Username and pool information are required.');\n }\n\n this.username = data.Username || '';\n this.pool = data.Pool;\n this.Session = null;\n\n this.client = data.Pool.client;\n\n this.signInUserSession = null;\n this.authenticationFlowType = 'USER_SRP_AUTH';\n\n this.storage = data.Storage || new _StorageHelper2.default().getStorage();\n }\n\n /**\n * Sets the session for this user\n * @param {CognitoUserSession} signInUserSession the session\n * @returns {void}\n */\n\n\n CognitoUser.prototype.setSignInUserSession = function setSignInUserSession(signInUserSession) {\n this.clearCachedTokens();\n this.signInUserSession = signInUserSession;\n this.cacheTokens();\n };\n\n /**\n * @returns {CognitoUserSession} the current session for this user\n */\n\n\n CognitoUser.prototype.getSignInUserSession = function getSignInUserSession() {\n return this.signInUserSession;\n };\n\n /**\n * @returns {string} the user's username\n */\n\n\n CognitoUser.prototype.getUsername = function getUsername() {\n return this.username;\n };\n\n /**\n * @returns {String} the authentication flow type\n */\n\n\n CognitoUser.prototype.getAuthenticationFlowType = function getAuthenticationFlowType() {\n return this.authenticationFlowType;\n };\n\n /**\n * sets authentication flow type\n * @param {string} authenticationFlowType New value.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.setAuthenticationFlowType = function setAuthenticationFlowType(authenticationFlowType) {\n this.authenticationFlowType = authenticationFlowType;\n };\n\n /**\n * This is used for authenticating the user through the custom authentication flow.\n * @param {AuthenticationDetails} authDetails Contains the authentication data\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.initiateAuth = function initiateAuth(authDetails, callback) {\n var _this = this;\n\n var authParameters = authDetails.getAuthParameters();\n authParameters.USERNAME = this.username;\n\n var jsonReq = {\n AuthFlow: 'CUSTOM_AUTH',\n ClientId: this.pool.getClientId(),\n AuthParameters: authParameters,\n ClientMetadata: authDetails.getValidationData()\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.request('InitiateAuth', jsonReq, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n var challengeName = data.ChallengeName;\n var challengeParameters = data.ChallengeParameters;\n\n if (challengeName === 'CUSTOM_CHALLENGE') {\n _this.Session = data.Session;\n return callback.customChallenge(challengeParameters);\n }\n _this.signInUserSession = _this.getCognitoUserSession(data.AuthenticationResult);\n _this.cacheTokens();\n return callback.onSuccess(_this.signInUserSession);\n });\n };\n\n /**\n * This is used for authenticating the user.\n * stuff\n * @param {AuthenticationDetails} authDetails Contains the authentication data\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {newPasswordRequired} callback.newPasswordRequired new\n * password and any required attributes are required to continue\n * @param {mfaRequired} callback.mfaRequired MFA code\n * required to continue.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.authenticateUser = function authenticateUser(authDetails, callback) {\n if (this.authenticationFlowType === 'USER_PASSWORD_AUTH') {\n return this.authenticateUserPlainUsernamePassword(authDetails, callback);\n } else if (this.authenticationFlowType === 'USER_SRP_AUTH') {\n return this.authenticateUserDefaultAuth(authDetails, callback);\n }\n return callback.onFailure(new Error('Authentication flow type is invalid.'));\n };\n\n /**\n * This is used for authenticating the user. it calls the AuthenticationHelper for SRP related\n * stuff\n * @param {AuthenticationDetails} authDetails Contains the authentication data\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {newPasswordRequired} callback.newPasswordRequired new\n * password and any required attributes are required to continue\n * @param {mfaRequired} callback.mfaRequired MFA code\n * required to continue.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.authenticateUserDefaultAuth = function authenticateUserDefaultAuth(authDetails, callback) {\n var _this2 = this;\n\n var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]);\n var dateHelper = new _DateHelper2.default();\n\n var serverBValue = void 0;\n var salt = void 0;\n var authParameters = {};\n\n if (this.deviceKey != null) {\n authParameters.DEVICE_KEY = this.deviceKey;\n }\n\n authParameters.USERNAME = this.username;\n authenticationHelper.getLargeAValue(function (errOnAValue, aValue) {\n // getLargeAValue callback start\n if (errOnAValue) {\n callback.onFailure(errOnAValue);\n }\n\n authParameters.SRP_A = aValue.toString(16);\n\n if (_this2.authenticationFlowType === 'CUSTOM_AUTH') {\n authParameters.CHALLENGE_NAME = 'SRP_A';\n }\n\n var jsonReq = {\n AuthFlow: _this2.authenticationFlowType,\n ClientId: _this2.pool.getClientId(),\n AuthParameters: authParameters,\n ClientMetadata: authDetails.getValidationData()\n };\n if (_this2.getUserContextData(_this2.username)) {\n jsonReq.UserContextData = _this2.getUserContextData(_this2.username);\n }\n\n _this2.client.request('InitiateAuth', jsonReq, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n\n var challengeParameters = data.ChallengeParameters;\n\n _this2.username = challengeParameters.USER_ID_FOR_SRP;\n serverBValue = new _BigInteger2.default(challengeParameters.SRP_B, 16);\n salt = new _BigInteger2.default(challengeParameters.SALT, 16);\n _this2.getCachedDeviceKeyAndPassword();\n\n authenticationHelper.getPasswordAuthenticationKey(_this2.username, authDetails.getPassword(), serverBValue, salt, function (errOnHkdf, hkdf) {\n // getPasswordAuthenticationKey callback start\n if (errOnHkdf) {\n callback.onFailure(errOnHkdf);\n }\n\n var dateNow = dateHelper.getNowString();\n\n var signatureString = createHmac('sha256', hkdf).update(_buffer.Buffer.concat([_buffer.Buffer.from(_this2.pool.getUserPoolId().split('_')[1], 'utf8'), _buffer.Buffer.from(_this2.username, 'utf8'), _buffer.Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'), _buffer.Buffer.from(dateNow, 'utf8')])).digest('base64');\n\n var challengeResponses = {};\n\n challengeResponses.USERNAME = _this2.username;\n challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK;\n challengeResponses.TIMESTAMP = dateNow;\n challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString;\n\n if (_this2.deviceKey != null) {\n challengeResponses.DEVICE_KEY = _this2.deviceKey;\n }\n\n var respondToAuthChallenge = function respondToAuthChallenge(challenge, challengeCallback) {\n return _this2.client.request('RespondToAuthChallenge', challenge, function (errChallenge, dataChallenge) {\n if (errChallenge && errChallenge.code === 'ResourceNotFoundException' && errChallenge.message.toLowerCase().indexOf('device') !== -1) {\n challengeResponses.DEVICE_KEY = null;\n _this2.deviceKey = null;\n _this2.randomPassword = null;\n _this2.deviceGroupKey = null;\n _this2.clearCachedDeviceKeyAndPassword();\n return respondToAuthChallenge(challenge, challengeCallback);\n }\n return challengeCallback(errChallenge, dataChallenge);\n });\n };\n\n var jsonReqResp = {\n ChallengeName: 'PASSWORD_VERIFIER',\n ClientId: _this2.pool.getClientId(),\n ChallengeResponses: challengeResponses,\n Session: data.Session\n };\n if (_this2.getUserContextData()) {\n jsonReqResp.UserContextData = _this2.getUserContextData();\n }\n respondToAuthChallenge(jsonReqResp, function (errAuthenticate, dataAuthenticate) {\n if (errAuthenticate) {\n return callback.onFailure(errAuthenticate);\n }\n\n var challengeName = dataAuthenticate.ChallengeName;\n if (challengeName === 'NEW_PASSWORD_REQUIRED') {\n _this2.Session = dataAuthenticate.Session;\n var userAttributes = null;\n var rawRequiredAttributes = null;\n var requiredAttributes = [];\n var userAttributesPrefix = authenticationHelper.getNewPasswordRequiredChallengeUserAttributePrefix();\n\n if (dataAuthenticate.ChallengeParameters) {\n userAttributes = JSON.parse(dataAuthenticate.ChallengeParameters.userAttributes);\n rawRequiredAttributes = JSON.parse(dataAuthenticate.ChallengeParameters.requiredAttributes);\n }\n\n if (rawRequiredAttributes) {\n for (var i = 0; i < rawRequiredAttributes.length; i++) {\n requiredAttributes[i] = rawRequiredAttributes[i].substr(userAttributesPrefix.length);\n }\n }\n return callback.newPasswordRequired(userAttributes, requiredAttributes);\n }\n return _this2.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback);\n });\n return undefined;\n // getPasswordAuthenticationKey callback end\n });\n return undefined;\n });\n // getLargeAValue callback end\n });\n };\n\n /**\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n * @param {AuthenticationDetails} authDetails Contains the authentication data.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {mfaRequired} callback.mfaRequired MFA code\n * required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.authenticateUserPlainUsernamePassword = function authenticateUserPlainUsernamePassword(authDetails, callback) {\n var _this3 = this;\n\n var authParameters = {};\n authParameters.USERNAME = this.username;\n authParameters.PASSWORD = authDetails.getPassword();\n if (!authParameters.PASSWORD) {\n callback.onFailure(new Error('PASSWORD parameter is required'));\n return;\n }\n var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]);\n this.getCachedDeviceKeyAndPassword();\n if (this.deviceKey != null) {\n authParameters.DEVICE_KEY = this.deviceKey;\n }\n\n var jsonReq = {\n AuthFlow: 'USER_PASSWORD_AUTH',\n ClientId: this.pool.getClientId(),\n AuthParameters: authParameters,\n ClientMetadata: authDetails.getValidationData()\n };\n if (this.getUserContextData(this.username)) {\n jsonReq.UserContextData = this.getUserContextData(this.username);\n }\n // USER_PASSWORD_AUTH happens in a single round-trip: client sends userName and password,\n // Cognito UserPools verifies password and returns tokens.\n this.client.request('InitiateAuth', jsonReq, function (err, authResult) {\n if (err) {\n return callback.onFailure(err);\n }\n return _this3.authenticateUserInternal(authResult, authenticationHelper, callback);\n });\n };\n\n /**\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n * @param {object} dataAuthenticate authentication data\n * @param {object} authenticationHelper helper created\n * @param {callback} callback passed on from caller\n * @returns {void}\n */\n\n\n CognitoUser.prototype.authenticateUserInternal = function authenticateUserInternal(dataAuthenticate, authenticationHelper, callback) {\n var _this4 = this;\n\n var challengeName = dataAuthenticate.ChallengeName;\n var challengeParameters = dataAuthenticate.ChallengeParameters;\n\n if (challengeName === 'SMS_MFA') {\n this.Session = dataAuthenticate.Session;\n return callback.mfaRequired(challengeName, challengeParameters);\n }\n\n if (challengeName === 'SELECT_MFA_TYPE') {\n this.Session = dataAuthenticate.Session;\n return callback.selectMFAType(challengeName, challengeParameters);\n }\n\n if (challengeName === 'MFA_SETUP') {\n this.Session = dataAuthenticate.Session;\n return callback.mfaSetup(challengeName, challengeParameters);\n }\n\n if (challengeName === 'SOFTWARE_TOKEN_MFA') {\n this.Session = dataAuthenticate.Session;\n return callback.totpRequired(challengeName, challengeParameters);\n }\n\n if (challengeName === 'CUSTOM_CHALLENGE') {\n this.Session = dataAuthenticate.Session;\n return callback.customChallenge(challengeParameters);\n }\n\n if (challengeName === 'DEVICE_SRP_AUTH') {\n this.getDeviceResponse(callback);\n return undefined;\n }\n\n this.signInUserSession = this.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n this.cacheTokens();\n\n var newDeviceMetadata = dataAuthenticate.AuthenticationResult.NewDeviceMetadata;\n if (newDeviceMetadata == null) {\n return callback.onSuccess(this.signInUserSession);\n }\n\n authenticationHelper.generateHashDevice(dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, function (errGenHash) {\n if (errGenHash) {\n return callback.onFailure(errGenHash);\n }\n\n var deviceSecretVerifierConfig = {\n Salt: _buffer.Buffer.from(authenticationHelper.getSaltDevices(), 'hex').toString('base64'),\n PasswordVerifier: _buffer.Buffer.from(authenticationHelper.getVerifierDevices(), 'hex').toString('base64')\n };\n\n _this4.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier;\n _this4.deviceGroupKey = newDeviceMetadata.DeviceGroupKey;\n _this4.randomPassword = authenticationHelper.getRandomPassword();\n\n _this4.client.request('ConfirmDevice', {\n DeviceKey: newDeviceMetadata.DeviceKey,\n AccessToken: _this4.signInUserSession.getAccessToken().getJwtToken(),\n DeviceSecretVerifierConfig: deviceSecretVerifierConfig,\n DeviceName: navigator.userAgent\n }, function (errConfirm, dataConfirm) {\n if (errConfirm) {\n return callback.onFailure(errConfirm);\n }\n\n _this4.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey;\n _this4.cacheDeviceKeyAndPassword();\n if (dataConfirm.UserConfirmationNecessary === true) {\n return callback.onSuccess(_this4.signInUserSession, dataConfirm.UserConfirmationNecessary);\n }\n return callback.onSuccess(_this4.signInUserSession);\n });\n return undefined;\n });\n return undefined;\n };\n\n /**\n * This method is user to complete the NEW_PASSWORD_REQUIRED challenge.\n * Pass the new password with any new user attributes to be updated.\n * User attribute keys must be of format userAttributes..\n * @param {string} newPassword new password for this user\n * @param {object} requiredAttributeData map with values for all required attributes\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {mfaRequired} callback.mfaRequired MFA code required to continue.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.completeNewPasswordChallenge = function completeNewPasswordChallenge(newPassword, requiredAttributeData, callback) {\n var _this5 = this;\n\n if (!newPassword) {\n return callback.onFailure(new Error('New password is required.'));\n }\n var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]);\n var userAttributesPrefix = authenticationHelper.getNewPasswordRequiredChallengeUserAttributePrefix();\n\n var finalUserAttributes = {};\n if (requiredAttributeData) {\n Object.keys(requiredAttributeData).forEach(function (key) {\n finalUserAttributes[userAttributesPrefix + key] = requiredAttributeData[key];\n });\n }\n\n finalUserAttributes.NEW_PASSWORD = newPassword;\n finalUserAttributes.USERNAME = this.username;\n var jsonReq = {\n ChallengeName: 'NEW_PASSWORD_REQUIRED',\n ClientId: this.pool.getClientId(),\n ChallengeResponses: finalUserAttributes,\n Session: this.Session\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.request('RespondToAuthChallenge', jsonReq, function (errAuthenticate, dataAuthenticate) {\n if (errAuthenticate) {\n return callback.onFailure(errAuthenticate);\n }\n return _this5.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback);\n });\n return undefined;\n };\n\n /**\n * This is used to get a session using device authentication. It is called at the end of user\n * authentication\n *\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n * @private\n */\n\n\n CognitoUser.prototype.getDeviceResponse = function getDeviceResponse(callback) {\n var _this6 = this;\n\n var authenticationHelper = new _AuthenticationHelper2.default(this.deviceGroupKey);\n var dateHelper = new _DateHelper2.default();\n\n var authParameters = {};\n\n authParameters.USERNAME = this.username;\n authParameters.DEVICE_KEY = this.deviceKey;\n authenticationHelper.getLargeAValue(function (errAValue, aValue) {\n // getLargeAValue callback start\n if (errAValue) {\n callback.onFailure(errAValue);\n }\n\n authParameters.SRP_A = aValue.toString(16);\n\n var jsonReq = {\n ChallengeName: 'DEVICE_SRP_AUTH',\n ClientId: _this6.pool.getClientId(),\n ChallengeResponses: authParameters\n };\n if (_this6.getUserContextData()) {\n jsonReq.UserContextData = _this6.getUserContextData();\n }\n _this6.client.request('RespondToAuthChallenge', jsonReq, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n\n var challengeParameters = data.ChallengeParameters;\n\n var serverBValue = new _BigInteger2.default(challengeParameters.SRP_B, 16);\n var salt = new _BigInteger2.default(challengeParameters.SALT, 16);\n\n authenticationHelper.getPasswordAuthenticationKey(_this6.deviceKey, _this6.randomPassword, serverBValue, salt, function (errHkdf, hkdf) {\n // getPasswordAuthenticationKey callback start\n if (errHkdf) {\n return callback.onFailure(errHkdf);\n }\n\n var dateNow = dateHelper.getNowString();\n\n var signatureString = createHmac('sha256', hkdf).update(_buffer.Buffer.concat([_buffer.Buffer.from(_this6.deviceGroupKey, 'utf8'), _buffer.Buffer.from(_this6.deviceKey, 'utf8'), _buffer.Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'), _buffer.Buffer.from(dateNow, 'utf8')])).digest('base64');\n\n var challengeResponses = {};\n\n challengeResponses.USERNAME = _this6.username;\n challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK;\n challengeResponses.TIMESTAMP = dateNow;\n challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString;\n challengeResponses.DEVICE_KEY = _this6.deviceKey;\n\n var jsonReqResp = {\n ChallengeName: 'DEVICE_PASSWORD_VERIFIER',\n ClientId: _this6.pool.getClientId(),\n ChallengeResponses: challengeResponses,\n Session: data.Session\n };\n if (_this6.getUserContextData()) {\n jsonReqResp.UserContextData = _this6.getUserContextData();\n }\n\n _this6.client.request('RespondToAuthChallenge', jsonReqResp, function (errAuthenticate, dataAuthenticate) {\n if (errAuthenticate) {\n return callback.onFailure(errAuthenticate);\n }\n\n _this6.signInUserSession = _this6.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n _this6.cacheTokens();\n\n return callback.onSuccess(_this6.signInUserSession);\n });\n return undefined;\n // getPasswordAuthenticationKey callback end\n });\n return undefined;\n });\n // getLargeAValue callback end\n });\n };\n\n /**\n * This is used for a certain user to confirm the registration by using a confirmation code\n * @param {string} confirmationCode Code entered by user.\n * @param {bool} forceAliasCreation Allow migrating from an existing email / phone number.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.confirmRegistration = function confirmRegistration(confirmationCode, forceAliasCreation, callback) {\n var jsonReq = {\n ClientId: this.pool.getClientId(),\n ConfirmationCode: confirmationCode,\n Username: this.username,\n ForceAliasCreation: forceAliasCreation\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('ConfirmSignUp', jsonReq, function (err) {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n };\n\n /**\n * This is used by the user once he has the responses to a custom challenge\n * @param {string} answerChallenge The custom challange answer.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {customChallenge} callback.customChallenge\n * Custom challenge response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.sendCustomChallengeAnswer = function sendCustomChallengeAnswer(answerChallenge, callback) {\n var _this7 = this;\n\n var challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n challengeResponses.ANSWER = answerChallenge;\n\n var authenticationHelper = new _AuthenticationHelper2.default(this.pool.getUserPoolId().split('_')[1]);\n this.getCachedDeviceKeyAndPassword();\n if (this.deviceKey != null) {\n challengeResponses.DEVICE_KEY = this.deviceKey;\n }\n\n var jsonReq = {\n ChallengeName: 'CUSTOM_CHALLENGE',\n ChallengeResponses: challengeResponses,\n ClientId: this.pool.getClientId(),\n Session: this.Session\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('RespondToAuthChallenge', jsonReq, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n\n return _this7.authenticateUserInternal(data, authenticationHelper, callback);\n });\n };\n\n /**\n * This is used by the user once he has an MFA code\n * @param {string} confirmationCode The MFA code entered by the user.\n * @param {object} callback Result callback map.\n * @param {string} mfaType The mfa we are replying to.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.sendMFACode = function sendMFACode(confirmationCode, callback, mfaType) {\n var _this8 = this;\n\n var challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n challengeResponses.SMS_MFA_CODE = confirmationCode;\n var mfaTypeSelection = mfaType || 'SMS_MFA';\n if (mfaTypeSelection === 'SOFTWARE_TOKEN_MFA') {\n challengeResponses.SOFTWARE_TOKEN_MFA_CODE = confirmationCode;\n }\n\n if (this.deviceKey != null) {\n challengeResponses.DEVICE_KEY = this.deviceKey;\n }\n\n var jsonReq = {\n ChallengeName: mfaTypeSelection,\n ChallengeResponses: challengeResponses,\n ClientId: this.pool.getClientId(),\n Session: this.Session\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.request('RespondToAuthChallenge', jsonReq, function (err, dataAuthenticate) {\n if (err) {\n return callback.onFailure(err);\n }\n\n var challengeName = dataAuthenticate.ChallengeName;\n\n if (challengeName === 'DEVICE_SRP_AUTH') {\n _this8.getDeviceResponse(callback);\n return undefined;\n }\n\n _this8.signInUserSession = _this8.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n _this8.cacheTokens();\n\n if (dataAuthenticate.AuthenticationResult.NewDeviceMetadata == null) {\n return callback.onSuccess(_this8.signInUserSession);\n }\n\n var authenticationHelper = new _AuthenticationHelper2.default(_this8.pool.getUserPoolId().split('_')[1]);\n authenticationHelper.generateHashDevice(dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, function (errGenHash) {\n if (errGenHash) {\n return callback.onFailure(errGenHash);\n }\n\n var deviceSecretVerifierConfig = {\n Salt: _buffer.Buffer.from(authenticationHelper.getSaltDevices(), 'hex').toString('base64'),\n PasswordVerifier: _buffer.Buffer.from(authenticationHelper.getVerifierDevices(), 'hex').toString('base64')\n };\n\n _this8.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier;\n _this8.deviceGroupKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey;\n _this8.randomPassword = authenticationHelper.getRandomPassword();\n\n _this8.client.request('ConfirmDevice', {\n DeviceKey: dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey,\n AccessToken: _this8.signInUserSession.getAccessToken().getJwtToken(),\n DeviceSecretVerifierConfig: deviceSecretVerifierConfig,\n DeviceName: navigator.userAgent\n }, function (errConfirm, dataConfirm) {\n if (errConfirm) {\n return callback.onFailure(errConfirm);\n }\n\n _this8.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey;\n _this8.cacheDeviceKeyAndPassword();\n if (dataConfirm.UserConfirmationNecessary === true) {\n return callback.onSuccess(_this8.signInUserSession, dataConfirm.UserConfirmationNecessary);\n }\n return callback.onSuccess(_this8.signInUserSession);\n });\n return undefined;\n });\n return undefined;\n });\n };\n\n /**\n * This is used by an authenticated user to change the current password\n * @param {string} oldUserPassword The current password.\n * @param {string} newUserPassword The requested new password.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.changePassword = function changePassword(oldUserPassword, newUserPassword, callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('ChangePassword', {\n PreviousPassword: oldUserPassword,\n ProposedPassword: newUserPassword,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n };\n\n /**\n * This is used by an authenticated user to enable MFA for himself\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.enableMFA = function enableMFA(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n var mfaOptions = [];\n var mfaEnabled = {\n DeliveryMedium: 'SMS',\n AttributeName: 'phone_number'\n };\n mfaOptions.push(mfaEnabled);\n\n this.client.request('SetUserSettings', {\n MFAOptions: mfaOptions,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n };\n\n /**\n * This is used by an authenticated user to enable MFA for himself\n * @param {string[]} smsMfaSettings the sms mfa settings\n * @param {string[]} softwareTokenMfaSettings the software token mfa settings\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.setUserMfaPreference = function setUserMfaPreference(smsMfaSettings, softwareTokenMfaSettings, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('SetUserMFAPreference', {\n SMSMfaSettings: smsMfaSettings,\n SoftwareTokenMfaSettings: softwareTokenMfaSettings,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n };\n\n /**\n * This is used by an authenticated user to disable MFA for himself\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.disableMFA = function disableMFA(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n var mfaOptions = [];\n\n this.client.request('SetUserSettings', {\n MFAOptions: mfaOptions,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n };\n\n /**\n * This is used by an authenticated user to delete himself\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.deleteUser = function deleteUser(callback) {\n var _this9 = this;\n\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('DeleteUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback(err, null);\n }\n _this9.clearCachedTokens();\n return callback(null, 'SUCCESS');\n });\n return undefined;\n };\n\n /**\n * @typedef {CognitoUserAttribute | { Name:string, Value:string }} AttributeArg\n */\n /**\n * This is used by an authenticated user to change a list of attributes\n * @param {AttributeArg[]} attributes A list of the new user attributes.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.updateAttributes = function updateAttributes(attributes, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('UpdateUserAttributes', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n UserAttributes: attributes\n }, function (err) {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n };\n\n /**\n * This is used by an authenticated user to get a list of attributes\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.getUserAttributes = function getUserAttributes(callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('GetUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err, userData) {\n if (err) {\n return callback(err, null);\n }\n\n var attributeList = [];\n\n for (var i = 0; i < userData.UserAttributes.length; i++) {\n var attribute = {\n Name: userData.UserAttributes[i].Name,\n Value: userData.UserAttributes[i].Value\n };\n var userAttribute = new _CognitoUserAttribute2.default(attribute);\n attributeList.push(userAttribute);\n }\n\n return callback(null, attributeList);\n });\n return undefined;\n };\n\n /**\n * This is used by an authenticated user to get the MFAOptions\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.getMFAOptions = function getMFAOptions(callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('GetUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err, userData) {\n if (err) {\n return callback(err, null);\n }\n\n return callback(null, userData.MFAOptions);\n });\n return undefined;\n };\n\n /**\n * This is used by an authenticated user to delete a list of attributes\n * @param {string[]} attributeList Names of the attributes to delete.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.deleteAttributes = function deleteAttributes(attributeList, callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('DeleteUserAttributes', {\n UserAttributeNames: attributeList,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n };\n\n /**\n * This is used by a user to resend a confirmation code\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.resendConfirmationCode = function resendConfirmationCode(callback) {\n var jsonReq = {\n ClientId: this.pool.getClientId(),\n Username: this.username\n };\n\n this.client.request('ResendConfirmationCode', jsonReq, function (err, result) {\n if (err) {\n return callback(err, null);\n }\n return callback(null, result);\n });\n };\n\n /**\n * This is used to get a session, either from the session object\n * or from the local storage, or by using a refresh token\n *\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.getSession = function getSession(callback) {\n if (this.username == null) {\n return callback(new Error('Username is null. Cannot retrieve a new session'), null);\n }\n\n if (this.signInUserSession != null && this.signInUserSession.isValid()) {\n return callback(null, this.signInUserSession);\n }\n\n var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username;\n var idTokenKey = keyPrefix + '.idToken';\n var accessTokenKey = keyPrefix + '.accessToken';\n var refreshTokenKey = keyPrefix + '.refreshToken';\n var clockDriftKey = keyPrefix + '.clockDrift';\n\n if (this.storage.getItem(idTokenKey)) {\n var idToken = new _CognitoIdToken2.default({\n IdToken: this.storage.getItem(idTokenKey)\n });\n var accessToken = new _CognitoAccessToken2.default({\n AccessToken: this.storage.getItem(accessTokenKey)\n });\n var refreshToken = new _CognitoRefreshToken2.default({\n RefreshToken: this.storage.getItem(refreshTokenKey)\n });\n var clockDrift = parseInt(this.storage.getItem(clockDriftKey), 0) || 0;\n\n var sessionData = {\n IdToken: idToken,\n AccessToken: accessToken,\n RefreshToken: refreshToken,\n ClockDrift: clockDrift\n };\n var cachedSession = new _CognitoUserSession2.default(sessionData);\n if (cachedSession.isValid()) {\n this.signInUserSession = cachedSession;\n return callback(null, this.signInUserSession);\n }\n\n if (refreshToken.getToken() == null) {\n return callback(new Error('Cannot retrieve a new session. Please authenticate.'), null);\n }\n\n this.refreshSession(refreshToken, callback);\n } else {\n callback(new Error('Local storage is missing an ID Token, Please authenticate'), null);\n }\n\n return undefined;\n };\n\n /**\n * This uses the refreshToken to retrieve a new session\n * @param {CognitoRefreshToken} refreshToken A previous session's refresh token.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.refreshSession = function refreshSession(refreshToken, callback) {\n var _this10 = this;\n\n var authParameters = {};\n authParameters.REFRESH_TOKEN = refreshToken.getToken();\n var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId();\n var lastUserKey = keyPrefix + '.LastAuthUser';\n\n if (this.storage.getItem(lastUserKey)) {\n this.username = this.storage.getItem(lastUserKey);\n var deviceKeyKey = keyPrefix + '.' + this.username + '.deviceKey';\n this.deviceKey = this.storage.getItem(deviceKeyKey);\n authParameters.DEVICE_KEY = this.deviceKey;\n }\n\n var jsonReq = {\n ClientId: this.pool.getClientId(),\n AuthFlow: 'REFRESH_TOKEN_AUTH',\n AuthParameters: authParameters\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('InitiateAuth', jsonReq, function (err, authResult) {\n if (err) {\n if (err.code === 'NotAuthorizedException') {\n _this10.clearCachedTokens();\n }\n return callback(err, null);\n }\n if (authResult) {\n var authenticationResult = authResult.AuthenticationResult;\n if (!Object.prototype.hasOwnProperty.call(authenticationResult, 'RefreshToken')) {\n authenticationResult.RefreshToken = refreshToken.getToken();\n }\n _this10.signInUserSession = _this10.getCognitoUserSession(authenticationResult);\n _this10.cacheTokens();\n return callback(null, _this10.signInUserSession);\n }\n return undefined;\n });\n };\n\n /**\n * This is used to save the session tokens to local storage\n * @returns {void}\n */\n\n\n CognitoUser.prototype.cacheTokens = function cacheTokens() {\n var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId();\n var idTokenKey = keyPrefix + '.' + this.username + '.idToken';\n var accessTokenKey = keyPrefix + '.' + this.username + '.accessToken';\n var refreshTokenKey = keyPrefix + '.' + this.username + '.refreshToken';\n var clockDriftKey = keyPrefix + '.' + this.username + '.clockDrift';\n var lastUserKey = keyPrefix + '.LastAuthUser';\n\n this.storage.setItem(idTokenKey, this.signInUserSession.getIdToken().getJwtToken());\n this.storage.setItem(accessTokenKey, this.signInUserSession.getAccessToken().getJwtToken());\n this.storage.setItem(refreshTokenKey, this.signInUserSession.getRefreshToken().getToken());\n this.storage.setItem(clockDriftKey, '' + this.signInUserSession.getClockDrift());\n this.storage.setItem(lastUserKey, this.username);\n };\n\n /**\n * This is used to cache the device key and device group and device password\n * @returns {void}\n */\n\n\n CognitoUser.prototype.cacheDeviceKeyAndPassword = function cacheDeviceKeyAndPassword() {\n var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username;\n var deviceKeyKey = keyPrefix + '.deviceKey';\n var randomPasswordKey = keyPrefix + '.randomPasswordKey';\n var deviceGroupKeyKey = keyPrefix + '.deviceGroupKey';\n\n this.storage.setItem(deviceKeyKey, this.deviceKey);\n this.storage.setItem(randomPasswordKey, this.randomPassword);\n this.storage.setItem(deviceGroupKeyKey, this.deviceGroupKey);\n };\n\n /**\n * This is used to get current device key and device group and device password\n * @returns {void}\n */\n\n\n CognitoUser.prototype.getCachedDeviceKeyAndPassword = function getCachedDeviceKeyAndPassword() {\n var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username;\n var deviceKeyKey = keyPrefix + '.deviceKey';\n var randomPasswordKey = keyPrefix + '.randomPasswordKey';\n var deviceGroupKeyKey = keyPrefix + '.deviceGroupKey';\n\n if (this.storage.getItem(deviceKeyKey)) {\n this.deviceKey = this.storage.getItem(deviceKeyKey);\n this.randomPassword = this.storage.getItem(randomPasswordKey);\n this.deviceGroupKey = this.storage.getItem(deviceGroupKeyKey);\n }\n };\n\n /**\n * This is used to clear the device key info from local storage\n * @returns {void}\n */\n\n\n CognitoUser.prototype.clearCachedDeviceKeyAndPassword = function clearCachedDeviceKeyAndPassword() {\n var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId() + '.' + this.username;\n var deviceKeyKey = keyPrefix + '.deviceKey';\n var randomPasswordKey = keyPrefix + '.randomPasswordKey';\n var deviceGroupKeyKey = keyPrefix + '.deviceGroupKey';\n\n this.storage.removeItem(deviceKeyKey);\n this.storage.removeItem(randomPasswordKey);\n this.storage.removeItem(deviceGroupKeyKey);\n };\n\n /**\n * This is used to clear the session tokens from local storage\n * @returns {void}\n */\n\n\n CognitoUser.prototype.clearCachedTokens = function clearCachedTokens() {\n var keyPrefix = 'CognitoIdentityServiceProvider.' + this.pool.getClientId();\n var idTokenKey = keyPrefix + '.' + this.username + '.idToken';\n var accessTokenKey = keyPrefix + '.' + this.username + '.accessToken';\n var refreshTokenKey = keyPrefix + '.' + this.username + '.refreshToken';\n var lastUserKey = keyPrefix + '.LastAuthUser';\n\n this.storage.removeItem(idTokenKey);\n this.storage.removeItem(accessTokenKey);\n this.storage.removeItem(refreshTokenKey);\n this.storage.removeItem(lastUserKey);\n };\n\n /**\n * This is used to build a user session from tokens retrieved in the authentication result\n * @param {object} authResult Successful auth response from server.\n * @returns {CognitoUserSession} The new user session.\n * @private\n */\n\n\n CognitoUser.prototype.getCognitoUserSession = function getCognitoUserSession(authResult) {\n var idToken = new _CognitoIdToken2.default(authResult);\n var accessToken = new _CognitoAccessToken2.default(authResult);\n var refreshToken = new _CognitoRefreshToken2.default(authResult);\n\n var sessionData = {\n IdToken: idToken,\n AccessToken: accessToken,\n RefreshToken: refreshToken\n };\n\n return new _CognitoUserSession2.default(sessionData);\n };\n\n /**\n * This is used to initiate a forgot password request\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {inputVerificationCode?} callback.inputVerificationCode\n * Optional callback raised instead of onSuccess with response data.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.forgotPassword = function forgotPassword(callback) {\n var jsonReq = {\n ClientId: this.pool.getClientId(),\n Username: this.username\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('ForgotPassword', jsonReq, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n if (typeof callback.inputVerificationCode === 'function') {\n return callback.inputVerificationCode(data);\n }\n return callback.onSuccess(data);\n });\n };\n\n /**\n * This is used to confirm a new password using a confirmationCode\n * @param {string} confirmationCode Code entered by user.\n * @param {string} newPassword Confirm new password.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.confirmPassword = function confirmPassword(confirmationCode, newPassword, callback) {\n var jsonReq = {\n ClientId: this.pool.getClientId(),\n Username: this.username,\n ConfirmationCode: confirmationCode,\n Password: newPassword\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('ConfirmForgotPassword', jsonReq, function (err) {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess();\n });\n };\n\n /**\n * This is used to initiate an attribute confirmation request\n * @param {string} attributeName User attribute that needs confirmation.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {inputVerificationCode} callback.inputVerificationCode Called on success.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.getAttributeVerificationCode = function getAttributeVerificationCode(attributeName, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('GetUserAttributeVerificationCode', {\n AttributeName: attributeName,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n if (typeof callback.inputVerificationCode === 'function') {\n return callback.inputVerificationCode(data);\n }\n return callback.onSuccess();\n });\n return undefined;\n };\n\n /**\n * This is used to confirm an attribute using a confirmation code\n * @param {string} attributeName Attribute being confirmed.\n * @param {string} confirmationCode Code entered by user.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.verifyAttribute = function verifyAttribute(attributeName, confirmationCode, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('VerifyUserAttribute', {\n AttributeName: attributeName,\n Code: confirmationCode,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n };\n\n /**\n * This is used to get the device information using the current device key\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess<*>} callback.onSuccess Called on success with device data.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.getDevice = function getDevice(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('GetDevice', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: this.deviceKey\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess(data);\n });\n return undefined;\n };\n\n /**\n * This is used to forget a specific device\n * @param {string} deviceKey Device key.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.forgetSpecificDevice = function forgetSpecificDevice(deviceKey, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('ForgetDevice', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: deviceKey\n }, function (err) {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n };\n\n /**\n * This is used to forget the current device\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.forgetDevice = function forgetDevice(callback) {\n var _this11 = this;\n\n this.forgetSpecificDevice(this.deviceKey, {\n onFailure: callback.onFailure,\n onSuccess: function onSuccess(result) {\n _this11.deviceKey = null;\n _this11.deviceGroupKey = null;\n _this11.randomPassword = null;\n _this11.clearCachedDeviceKeyAndPassword();\n return callback.onSuccess(result);\n }\n });\n };\n\n /**\n * This is used to set the device status as remembered\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.setDeviceStatusRemembered = function setDeviceStatusRemembered(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('UpdateDeviceStatus', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: this.deviceKey,\n DeviceRememberedStatus: 'remembered'\n }, function (err) {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n };\n\n /**\n * This is used to set the device status as not remembered\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.setDeviceStatusNotRemembered = function setDeviceStatusNotRemembered(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('UpdateDeviceStatus', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: this.deviceKey,\n DeviceRememberedStatus: 'not_remembered'\n }, function (err) {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n };\n\n /**\n * This is used to list all devices for a user\n *\n * @param {int} limit the number of devices returned in a call\n * @param {string} paginationToken the pagination token in case any was returned before\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess<*>} callback.onSuccess Called on success with device list.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.listDevices = function listDevices(limit, paginationToken, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('ListDevices', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n Limit: limit,\n PaginationToken: paginationToken\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess(data);\n });\n return undefined;\n };\n\n /**\n * This is used to globally revoke all tokens issued to a user\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.globalSignOut = function globalSignOut(callback) {\n var _this12 = this;\n\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('GlobalSignOut', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback.onFailure(err);\n }\n _this12.clearCachedTokens();\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n };\n\n /**\n * This is used for the user to signOut of the application and clear the cached tokens.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.signOut = function signOut() {\n this.signInUserSession = null;\n this.clearCachedTokens();\n };\n\n /**\n * This is used by a user trying to select a given MFA\n * @param {string} answerChallenge the mfa the user wants\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.sendMFASelectionAnswer = function sendMFASelectionAnswer(answerChallenge, callback) {\n var _this13 = this;\n\n var challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n challengeResponses.ANSWER = answerChallenge;\n\n var jsonReq = {\n ChallengeName: 'SELECT_MFA_TYPE',\n ChallengeResponses: challengeResponses,\n ClientId: this.pool.getClientId(),\n Session: this.Session\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('RespondToAuthChallenge', jsonReq, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n _this13.Session = data.Session;\n if (answerChallenge === 'SMS_MFA') {\n return callback.mfaRequired(data.challengeName, data.challengeParameters);\n }\n if (answerChallenge === 'SOFTWARE_TOKEN_MFA') {\n return callback.totpRequired(data.challengeName, data.challengeParameters);\n }\n return undefined;\n });\n };\n\n /**\n * This returns the user context data for advanced security feature.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.getUserContextData = function getUserContextData() {\n var pool = this.pool;\n return pool.getUserContextData(this.username);\n };\n\n /**\n * This is used by an authenticated or a user trying to authenticate to associate a TOTP MFA\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.associateSoftwareToken = function associateSoftwareToken(callback) {\n var _this14 = this;\n\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n this.client.request('AssociateSoftwareToken', {\n Session: this.Session\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n _this14.Session = data.Session;\n return callback.associateSecretCode(data.SecretCode);\n });\n } else {\n this.client.request('AssociateSoftwareToken', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.associateSecretCode(data.SecretCode);\n });\n }\n };\n\n /**\n * This is used by an authenticated or a user trying to authenticate to verify a TOTP MFA\n * @param {string} totpCode The MFA code entered by the user.\n * @param {string} friendlyDeviceName The device name we are assigning to the device.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n\n\n CognitoUser.prototype.verifySoftwareToken = function verifySoftwareToken(totpCode, friendlyDeviceName, callback) {\n var _this15 = this;\n\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n this.client.request('VerifySoftwareToken', {\n Session: this.Session,\n UserCode: totpCode,\n FriendlyDeviceName: friendlyDeviceName\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n _this15.Session = data.Session;\n var challengeResponses = {};\n challengeResponses.USERNAME = _this15.username;\n var jsonReq = {\n ChallengeName: 'MFA_SETUP',\n ClientId: _this15.pool.getClientId(),\n ChallengeResponses: challengeResponses,\n Session: _this15.Session\n };\n if (_this15.getUserContextData()) {\n jsonReq.UserContextData = _this15.getUserContextData();\n }\n _this15.client.request('RespondToAuthChallenge', jsonReq, function (errRespond, dataRespond) {\n if (errRespond) {\n return callback.onFailure(errRespond);\n }\n _this15.signInUserSession = _this15.getCognitoUserSession(dataRespond.AuthenticationResult);\n _this15.cacheTokens();\n return callback.onSuccess(_this15.signInUserSession);\n });\n return undefined;\n });\n } else {\n this.client.request('VerifySoftwareToken', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n UserCode: totpCode,\n FriendlyDeviceName: friendlyDeviceName\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess(data);\n });\n }\n };\n\n return CognitoUser;\n}();\n\nexports.default = CognitoUser;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nvar CognitoUserAttribute = function () {\n /**\n * Constructs a new CognitoUserAttribute object\n * @param {string=} Name The record's name\n * @param {string=} Value The record's value\n */\n function CognitoUserAttribute() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n Name = _ref.Name,\n Value = _ref.Value;\n\n _classCallCheck(this, CognitoUserAttribute);\n\n this.Name = Name || '';\n this.Value = Value || '';\n }\n\n /**\n * @returns {string} the record's value.\n */\n\n\n CognitoUserAttribute.prototype.getValue = function getValue() {\n return this.Value;\n };\n\n /**\n * Sets the record's value.\n * @param {string} value The new value.\n * @returns {CognitoUserAttribute} The record for method chaining.\n */\n\n\n CognitoUserAttribute.prototype.setValue = function setValue(value) {\n this.Value = value;\n return this;\n };\n\n /**\n * @returns {string} the record's name.\n */\n\n\n CognitoUserAttribute.prototype.getName = function getName() {\n return this.Name;\n };\n\n /**\n * Sets the record's name\n * @param {string} name The new name.\n * @returns {CognitoUserAttribute} The record for method chaining.\n */\n\n\n CognitoUserAttribute.prototype.setName = function setName(name) {\n this.Name = name;\n return this;\n };\n\n /**\n * @returns {string} a string representation of the record.\n */\n\n\n CognitoUserAttribute.prototype.toString = function toString() {\n return JSON.stringify(this);\n };\n\n /**\n * @returns {object} a flat object representing the record.\n */\n\n\n CognitoUserAttribute.prototype.toJSON = function toJSON() {\n return {\n Name: this.Name,\n Value: this.Value\n };\n };\n\n return CognitoUserAttribute;\n}();\n\nexports.default = CognitoUserAttribute;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nvar CognitoUserSession = function () {\n /**\n * Constructs a new CognitoUserSession object\n * @param {CognitoIdToken} IdToken The session's Id token.\n * @param {CognitoRefreshToken=} RefreshToken The session's refresh token.\n * @param {CognitoAccessToken} AccessToken The session's access token.\n * @param {int} ClockDrift The saved computer's clock drift or undefined to force calculation.\n */\n function CognitoUserSession() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n IdToken = _ref.IdToken,\n RefreshToken = _ref.RefreshToken,\n AccessToken = _ref.AccessToken,\n ClockDrift = _ref.ClockDrift;\n\n _classCallCheck(this, CognitoUserSession);\n\n if (AccessToken == null || IdToken == null) {\n throw new Error('Id token and Access Token must be present.');\n }\n\n this.idToken = IdToken;\n this.refreshToken = RefreshToken;\n this.accessToken = AccessToken;\n this.clockDrift = ClockDrift === undefined ? this.calculateClockDrift() : ClockDrift;\n }\n\n /**\n * @returns {CognitoIdToken} the session's Id token\n */\n\n\n CognitoUserSession.prototype.getIdToken = function getIdToken() {\n return this.idToken;\n };\n\n /**\n * @returns {CognitoRefreshToken} the session's refresh token\n */\n\n\n CognitoUserSession.prototype.getRefreshToken = function getRefreshToken() {\n return this.refreshToken;\n };\n\n /**\n * @returns {CognitoAccessToken} the session's access token\n */\n\n\n CognitoUserSession.prototype.getAccessToken = function getAccessToken() {\n return this.accessToken;\n };\n\n /**\n * @returns {int} the session's clock drift\n */\n\n\n CognitoUserSession.prototype.getClockDrift = function getClockDrift() {\n return this.clockDrift;\n };\n\n /**\n * @returns {int} the computer's clock drift\n */\n\n\n CognitoUserSession.prototype.calculateClockDrift = function calculateClockDrift() {\n var now = Math.floor(new Date() / 1000);\n var iat = Math.min(this.accessToken.getIssuedAt(), this.idToken.getIssuedAt());\n\n return now - iat;\n };\n\n /**\n * Checks to see if the session is still valid based on session expiry information found\n * in tokens and the current time (adjusted with clock drift)\n * @returns {boolean} if the session is still valid\n */\n\n\n CognitoUserSession.prototype.isValid = function isValid() {\n var now = Math.floor(new Date() / 1000);\n var adjusted = now - this.clockDrift;\n\n return adjusted < this.accessToken.getExpiration() && adjusted < this.idToken.getExpiration();\n };\n\n return CognitoUserSession;\n}();\n\nexports.default = CognitoUserSession;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\nvar weekNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n\n/** @class */\n\nvar DateHelper = function () {\n function DateHelper() {\n _classCallCheck(this, DateHelper);\n }\n\n /**\n * @returns {string} The current time in \"ddd MMM D HH:mm:ss UTC YYYY\" format.\n */\n DateHelper.prototype.getNowString = function getNowString() {\n var now = new Date();\n\n var weekDay = weekNames[now.getUTCDay()];\n var month = monthNames[now.getUTCMonth()];\n var day = now.getUTCDate();\n\n var hours = now.getUTCHours();\n if (hours < 10) {\n hours = '0' + hours;\n }\n\n var minutes = now.getUTCMinutes();\n if (minutes < 10) {\n minutes = '0' + minutes;\n }\n\n var seconds = now.getUTCSeconds();\n if (seconds < 10) {\n seconds = '0' + seconds;\n }\n\n var year = now.getUTCFullYear();\n\n // ddd MMM D HH:mm:ss UTC YYYY\n var dateNow = weekDay + ' ' + month + ' ' + day + ' ' + hours + ':' + minutes + ':' + seconds + ' UTC ' + year;\n\n return dateNow;\n };\n\n return DateHelper;\n}();\n\nexports.default = DateHelper;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n// A small implementation of BigInteger based on http://www-cs-students.stanford.edu/~tjw/jsbn/\n//\n// All public methods have been removed except the following:\n// new BigInteger(a, b) (only radix 2, 4, 8, 16 and 32 supported)\n// toString (only radix 2, 4, 8, 16 and 32 supported)\n// negate\n// abs\n// compareTo\n// bitLength\n// mod\n// equals\n// add\n// subtract\n// multiply\n// divide\n// modPow\n\nexports.default = BigInteger;\n\n/*\n * Copyright (c) 2003-2005 Tom Wu\n * All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n *\n * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,\n * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER\n * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF\n * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT\n * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * In addition, the following condition applies:\n *\n * All redistributions must retain an intact copy of this copyright notice\n * and disclaimer.\n */\n\n// (public) Constructor\n\nfunction BigInteger(a, b) {\n if (a != null) this.fromString(a, b);\n}\n\n// return new, unset BigInteger\nfunction nbi() {\n return new BigInteger(null);\n}\n\n// Bits per digit\nvar dbits;\n\n// JavaScript engine analysis\nvar canary = 0xdeadbeefcafe;\nvar j_lm = (canary & 0xffffff) == 0xefcafe;\n\n// am: Compute w_j += (x*this_i), propagate carries,\n// c is initial carry, returns final carry.\n// c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n// We need to select the fastest one that works in this environment.\n\n// am1: use a single mult and divide to get the high bits,\n// max digit bits should be 26 because\n// max internal value = 2*dvalue^2-2*dvalue (< 2^53)\nfunction am1(i, x, w, j, c, n) {\n while (--n >= 0) {\n var v = x * this[i++] + w[j] + c;\n c = Math.floor(v / 0x4000000);\n w[j++] = v & 0x3ffffff;\n }\n return c;\n}\n// am2 avoids a big mult-and-extract completely.\n// Max digit bits should be <= 30 because we do bitwise ops\n// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\nfunction am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15;\n while (--n >= 0) {\n var l = this[i] & 0x7fff;\n var h = this[i++] >> 15;\n var m = xh * l + h * xl;\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n w[j++] = l & 0x3fffffff;\n }\n return c;\n}\n// Alternately, set max digit bits to 28 since some\n// browsers slow down when dealing with 32-bit numbers.\nfunction am3(i, x, w, j, c, n) {\n var xl = x & 0x3fff,\n xh = x >> 14;\n while (--n >= 0) {\n var l = this[i] & 0x3fff;\n var h = this[i++] >> 14;\n var m = xh * l + h * xl;\n l = xl * l + ((m & 0x3fff) << 14) + w[j] + c;\n c = (l >> 28) + (m >> 14) + xh * h;\n w[j++] = l & 0xfffffff;\n }\n return c;\n}\nvar inBrowser = typeof navigator !== \"undefined\";\nif (inBrowser && j_lm && navigator.appName == \"Microsoft Internet Explorer\") {\n BigInteger.prototype.am = am2;\n dbits = 30;\n} else if (inBrowser && j_lm && navigator.appName != \"Netscape\") {\n BigInteger.prototype.am = am1;\n dbits = 26;\n} else {\n // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n}\n\nBigInteger.prototype.DB = dbits;\nBigInteger.prototype.DM = (1 << dbits) - 1;\nBigInteger.prototype.DV = 1 << dbits;\n\nvar BI_FP = 52;\nBigInteger.prototype.FV = Math.pow(2, BI_FP);\nBigInteger.prototype.F1 = BI_FP - dbits;\nBigInteger.prototype.F2 = 2 * dbits - BI_FP;\n\n// Digit conversions\nvar BI_RM = \"0123456789abcdefghijklmnopqrstuvwxyz\";\nvar BI_RC = new Array();\nvar rr, vv;\nrr = \"0\".charCodeAt(0);\nfor (vv = 0; vv <= 9; ++vv) {\n BI_RC[rr++] = vv;\n}rr = \"a\".charCodeAt(0);\nfor (vv = 10; vv < 36; ++vv) {\n BI_RC[rr++] = vv;\n}rr = \"A\".charCodeAt(0);\nfor (vv = 10; vv < 36; ++vv) {\n BI_RC[rr++] = vv;\n}function int2char(n) {\n return BI_RM.charAt(n);\n}\nfunction intAt(s, i) {\n var c = BI_RC[s.charCodeAt(i)];\n return c == null ? -1 : c;\n}\n\n// (protected) copy this to r\nfunction bnpCopyTo(r) {\n for (var i = this.t - 1; i >= 0; --i) {\n r[i] = this[i];\n }r.t = this.t;\n r.s = this.s;\n}\n\n// (protected) set from integer value x, -DV <= x < DV\nfunction bnpFromInt(x) {\n this.t = 1;\n this.s = x < 0 ? -1 : 0;\n if (x > 0) this[0] = x;else if (x < -1) this[0] = x + this.DV;else this.t = 0;\n}\n\n// return bigint initialized to value\nfunction nbv(i) {\n var r = nbi();\n\n r.fromInt(i);\n\n return r;\n}\n\n// (protected) set from string and radix\nfunction bnpFromString(s, b) {\n var k;\n if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else throw new Error(\"Only radix 2, 4, 8, 16, 32 are supported\");\n this.t = 0;\n this.s = 0;\n var i = s.length,\n mi = false,\n sh = 0;\n while (--i >= 0) {\n var x = intAt(s, i);\n if (x < 0) {\n if (s.charAt(i) == \"-\") mi = true;\n continue;\n }\n mi = false;\n if (sh == 0) this[this.t++] = x;else if (sh + k > this.DB) {\n this[this.t - 1] |= (x & (1 << this.DB - sh) - 1) << sh;\n this[this.t++] = x >> this.DB - sh;\n } else this[this.t - 1] |= x << sh;\n sh += k;\n if (sh >= this.DB) sh -= this.DB;\n }\n this.clamp();\n if (mi) BigInteger.ZERO.subTo(this, this);\n}\n\n// (protected) clamp off excess high words\nfunction bnpClamp() {\n var c = this.s & this.DM;\n while (this.t > 0 && this[this.t - 1] == c) {\n --this.t;\n }\n}\n\n// (public) return string representation in given radix\nfunction bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString();\n var k;\n if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else throw new Error(\"Only radix 2, 4, 8, 16, 32 are supported\");\n var km = (1 << k) - 1,\n d,\n m = false,\n r = \"\",\n i = this.t;\n var p = this.DB - i * this.DB % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & (1 << p) - 1) << k - p;\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = this[i] >> (p -= k) & km;\n if (p <= 0) {\n p += this.DB;\n --i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n}\n\n// (public) -this\nfunction bnNegate() {\n var r = nbi();\n\n BigInteger.ZERO.subTo(this, r);\n\n return r;\n}\n\n// (public) |this|\nfunction bnAbs() {\n return this.s < 0 ? this.negate() : this;\n}\n\n// (public) return + if this > a, - if this < a, 0 if equal\nfunction bnCompareTo(a) {\n var r = this.s - a.s;\n if (r != 0) return r;\n var i = this.t;\n r = i - a.t;\n if (r != 0) return this.s < 0 ? -r : r;\n while (--i >= 0) {\n if ((r = this[i] - a[i]) != 0) return r;\n }return 0;\n}\n\n// returns bit length of the integer x\nfunction nbits(x) {\n var r = 1,\n t;\n if ((t = x >>> 16) != 0) {\n x = t;\n r += 16;\n }\n if ((t = x >> 8) != 0) {\n x = t;\n r += 8;\n }\n if ((t = x >> 4) != 0) {\n x = t;\n r += 4;\n }\n if ((t = x >> 2) != 0) {\n x = t;\n r += 2;\n }\n if ((t = x >> 1) != 0) {\n x = t;\n r += 1;\n }\n return r;\n}\n\n// (public) return the number of bits in \"this\"\nfunction bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n}\n\n// (protected) r = this << n*DB\nfunction bnpDLShiftTo(n, r) {\n var i;\n for (i = this.t - 1; i >= 0; --i) {\n r[i + n] = this[i];\n }for (i = n - 1; i >= 0; --i) {\n r[i] = 0;\n }r.t = this.t + n;\n r.s = this.s;\n}\n\n// (protected) r = this >> n*DB\nfunction bnpDRShiftTo(n, r) {\n for (var i = n; i < this.t; ++i) {\n r[i - n] = this[i];\n }r.t = Math.max(this.t - n, 0);\n r.s = this.s;\n}\n\n// (protected) r = this << n\nfunction bnpLShiftTo(n, r) {\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << cbs) - 1;\n var ds = Math.floor(n / this.DB),\n c = this.s << bs & this.DM,\n i;\n for (i = this.t - 1; i >= 0; --i) {\n r[i + ds + 1] = this[i] >> cbs | c;\n c = (this[i] & bm) << bs;\n }\n for (i = ds - 1; i >= 0; --i) {\n r[i] = 0;\n }r[ds] = c;\n r.t = this.t + ds + 1;\n r.s = this.s;\n r.clamp();\n}\n\n// (protected) r = this >> n\nfunction bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n}\n\n// (protected) r = this - a\nfunction bnpSubTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] - a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c -= a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c -= a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c -= a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c < -1) r[i++] = this.DV + c;else if (c > 0) r[i++] = c;\n r.t = i;\n r.clamp();\n}\n\n// (protected) r = this * a, r != this,a (HAC 14.12)\n// \"this\" should be the larger one if appropriate.\nfunction bnpMultiplyTo(a, r) {\n var x = this.abs(),\n y = a.abs();\n var i = x.t;\n r.t = i + y.t;\n while (--i >= 0) {\n r[i] = 0;\n }for (i = 0; i < y.t; ++i) {\n r[i + x.t] = x.am(0, y[i], r, i, 0, x.t);\n }r.s = 0;\n r.clamp();\n if (this.s != a.s) BigInteger.ZERO.subTo(r, r);\n}\n\n// (protected) r = this^2, r != this (HAC 14.16)\nfunction bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2 * x.t;\n while (--i >= 0) {\n r[i] = 0;\n }for (i = 0; i < x.t - 1; ++i) {\n var c = x.am(i, x[i], r, 2 * i, 0, 1);\n if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) {\n r[i + x.t] -= x.DV;\n r[i + x.t + 1] = 1;\n }\n }\n if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1);\n r.s = 0;\n r.clamp();\n}\n\n// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n// r != q, this != m. q or r may be null.\nfunction bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]);\n // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = q == null ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y);\n // \"negative\" y so we can replace sub with am later\n while (y.t < ys) {\n y[y.t++] = 0;\n }while (--j >= 0) {\n // Estimate quotient digit\n var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) {\n r.subTo(t, r);\n }\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r);\n // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n}\n\n// (public) this mod a\nfunction bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a, null, r);\n if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r);\n return r;\n}\n\n// (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n// justification:\n// xy == 1 (mod m)\n// xy = 1+km\n// xy(2-xy) = (1+km)(1-km)\n// x[y(2-xy)] = 1-k^2m^2\n// x[y(2-xy)] == 1 (mod m^2)\n// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n// JS multiply \"overflows\" differently from C/C++, so care is needed here.\nfunction bnpInvDigit() {\n if (this.t < 1) return 0;\n var x = this[0];\n if ((x & 1) == 0) return 0;\n var y = x & 3;\n // y == 1/x mod 2^2\n y = y * (2 - (x & 0xf) * y) & 0xf;\n // y == 1/x mod 2^4\n y = y * (2 - (x & 0xff) * y) & 0xff;\n // y == 1/x mod 2^8\n y = y * (2 - ((x & 0xffff) * y & 0xffff)) & 0xffff;\n // y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n y = y * (2 - x * y % this.DV) % this.DV;\n // y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n return y > 0 ? this.DV - y : -y;\n}\n\nfunction bnEquals(a) {\n return this.compareTo(a) == 0;\n}\n\n// (protected) r = this + a\nfunction bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c > 0) r[i++] = c;else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n}\n\n// (public) this + a\nfunction bnAdd(a) {\n var r = nbi();\n\n this.addTo(a, r);\n\n return r;\n}\n\n// (public) this - a\nfunction bnSubtract(a) {\n var r = nbi();\n\n this.subTo(a, r);\n\n return r;\n}\n\n// (public) this * a\nfunction bnMultiply(a) {\n var r = nbi();\n\n this.multiplyTo(a, r);\n\n return r;\n}\n\n// (public) this / a\nfunction bnDivide(a) {\n var r = nbi();\n\n this.divRemTo(a, r, null);\n\n return r;\n}\n\n// Montgomery reduction\nfunction Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp & 0x7fff;\n this.mph = this.mp >> 15;\n this.um = (1 << m.DB - 15) - 1;\n this.mt2 = 2 * m.t;\n}\n\n// xR mod m\nfunction montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t, r);\n r.divRemTo(this.m, null, r);\n if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r);\n return r;\n}\n\n// x/R mod m\nfunction montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n}\n\n// x = x/R mod m (HAC 14.32)\nfunction montReduce(x) {\n while (x.t <= this.mt2) {\n // pad x so am has enough room later\n x[x.t++] = 0;\n }for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n}\n\n// r = \"x^2/R mod m\"; x != r\nfunction montSqrTo(x, r) {\n x.squareTo(r);\n\n this.reduce(r);\n}\n\n// r = \"xy/R mod m\"; x,y != r\nfunction montMulTo(x, y, r) {\n x.multiplyTo(y, r);\n\n this.reduce(r);\n}\n\nMontgomery.prototype.convert = montConvert;\nMontgomery.prototype.revert = montRevert;\nMontgomery.prototype.reduce = montReduce;\nMontgomery.prototype.mulTo = montMulTo;\nMontgomery.prototype.sqrTo = montSqrTo;\n\n// (public) this^e % m (HAC 14.85)\nfunction bnModPow(e, m, callback) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z = new Montgomery(m);\n if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6;\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n var result = z.revert(r);\n callback(null, result);\n return result;\n}\n\n// protected\nBigInteger.prototype.copyTo = bnpCopyTo;\nBigInteger.prototype.fromInt = bnpFromInt;\nBigInteger.prototype.fromString = bnpFromString;\nBigInteger.prototype.clamp = bnpClamp;\nBigInteger.prototype.dlShiftTo = bnpDLShiftTo;\nBigInteger.prototype.drShiftTo = bnpDRShiftTo;\nBigInteger.prototype.lShiftTo = bnpLShiftTo;\nBigInteger.prototype.rShiftTo = bnpRShiftTo;\nBigInteger.prototype.subTo = bnpSubTo;\nBigInteger.prototype.multiplyTo = bnpMultiplyTo;\nBigInteger.prototype.squareTo = bnpSquareTo;\nBigInteger.prototype.divRemTo = bnpDivRemTo;\nBigInteger.prototype.invDigit = bnpInvDigit;\nBigInteger.prototype.addTo = bnpAddTo;\n\n// public\nBigInteger.prototype.toString = bnToString;\nBigInteger.prototype.negate = bnNegate;\nBigInteger.prototype.abs = bnAbs;\nBigInteger.prototype.compareTo = bnCompareTo;\nBigInteger.prototype.bitLength = bnBitLength;\nBigInteger.prototype.mod = bnMod;\nBigInteger.prototype.equals = bnEquals;\nBigInteger.prototype.add = bnAdd;\nBigInteger.prototype.subtract = bnSubtract;\nBigInteger.prototype.multiply = bnMultiply;\nBigInteger.prototype.divide = bnDivide;\nBigInteger.prototype.modPow = bnModPow;\n\n// \"constants\"\nBigInteger.ZERO = nbv(0);\nBigInteger.ONE = nbv(1);\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _buffer = __webpack_require__(0);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } /*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nvar CognitoJwtToken = function () {\n /**\n * Constructs a new CognitoJwtToken object\n * @param {string=} token The JWT token.\n */\n function CognitoJwtToken(token) {\n _classCallCheck(this, CognitoJwtToken);\n\n // Assign object\n this.jwtToken = token || '';\n this.payload = this.decodePayload();\n }\n\n /**\n * @returns {string} the record's token.\n */\n\n\n CognitoJwtToken.prototype.getJwtToken = function getJwtToken() {\n return this.jwtToken;\n };\n\n /**\n * @returns {int} the token's expiration (exp member).\n */\n\n\n CognitoJwtToken.prototype.getExpiration = function getExpiration() {\n return this.payload.exp;\n };\n\n /**\n * @returns {int} the token's \"issued at\" (iat member).\n */\n\n\n CognitoJwtToken.prototype.getIssuedAt = function getIssuedAt() {\n return this.payload.iat;\n };\n\n /**\n * @returns {object} the token's payload.\n */\n\n\n CognitoJwtToken.prototype.decodePayload = function decodePayload() {\n var payload = this.jwtToken.split('.')[1];\n try {\n return JSON.parse(_buffer.Buffer.from(payload, 'base64').toString('utf8'));\n } catch (err) {\n return {};\n }\n };\n\n return CognitoJwtToken;\n}();\n\nexports.default = CognitoJwtToken;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar dataMemory = {};\n\n/** @class */\n\nvar MemoryStorage = function () {\n function MemoryStorage() {\n _classCallCheck(this, MemoryStorage);\n }\n\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n MemoryStorage.setItem = function setItem(key, value) {\n dataMemory[key] = value;\n return dataMemory[key];\n };\n\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */\n\n\n MemoryStorage.getItem = function getItem(key) {\n return Object.prototype.hasOwnProperty.call(dataMemory, key) ? dataMemory[key] : undefined;\n };\n\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {string} value - value that was deleted\n */\n\n\n MemoryStorage.removeItem = function removeItem(key) {\n return delete dataMemory[key];\n };\n\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */\n\n\n MemoryStorage.clear = function clear() {\n dataMemory = {};\n return dataMemory;\n };\n\n return MemoryStorage;\n}();\n\n/** @class */\n\n\nvar StorageHelper = function () {\n\n /**\n * This is used to get a storage object\n * @returns {object} the storage\n */\n function StorageHelper() {\n _classCallCheck(this, StorageHelper);\n\n try {\n this.storageWindow = window.localStorage;\n this.storageWindow.setItem('aws.cognito.test-ls', 1);\n this.storageWindow.removeItem('aws.cognito.test-ls');\n } catch (exception) {\n this.storageWindow = MemoryStorage;\n }\n }\n\n /**\n * This is used to return the storage\n * @returns {object} the storage\n */\n\n\n StorageHelper.prototype.getStorage = function getStorage() {\n return this.storageWindow;\n };\n\n return StorageHelper;\n}();\n\nexports.default = StorageHelper;\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Buffer = __webpack_require__(0).Buffer\nvar sha = __webpack_require__(23)\nvar sha256 = __webpack_require__(24)\nvar rng = __webpack_require__(22)\nvar md5 = __webpack_require__(21)\n\nvar algorithms = {\n sha1: sha,\n sha256: sha256,\n md5: md5\n}\n\nvar blocksize = 64\nvar zeroBuffer = new Buffer(blocksize); zeroBuffer.fill(0)\nfunction hmac(fn, key, data) {\n if(!Buffer.isBuffer(key)) key = new Buffer(key)\n if(!Buffer.isBuffer(data)) data = new Buffer(data)\n\n if(key.length > blocksize) {\n key = fn(key)\n } else if(key.length < blocksize) {\n key = Buffer.concat([key, zeroBuffer], blocksize)\n }\n\n var ipad = new Buffer(blocksize), opad = new Buffer(blocksize)\n for(var i = 0; i < blocksize; i++) {\n ipad[i] = key[i] ^ 0x36\n opad[i] = key[i] ^ 0x5C\n }\n\n var hash = fn(Buffer.concat([ipad, data]))\n return fn(Buffer.concat([opad, hash]))\n}\n\nfunction hash(alg, key) {\n alg = alg || 'sha1'\n var fn = algorithms[alg]\n var bufs = []\n var length = 0\n if(!fn) error('algorithm:', alg, 'is not yet supported')\n return {\n update: function (data) {\n if(!Buffer.isBuffer(data)) data = new Buffer(data)\n \n bufs.push(data)\n length += data.length\n return this\n },\n digest: function (enc) {\n var buf = Buffer.concat(bufs)\n var r = key ? hmac(fn, key, buf) : fn(buf)\n bufs = null\n return enc ? r.toString(enc) : r\n }\n }\n}\n\nfunction error () {\n var m = [].slice.call(arguments).join(' ')\n throw new Error([\n m,\n 'we accept pull requests',\n 'http://github.com/dominictarr/crypto-browserify'\n ].join('\\n'))\n}\n\nexports.createHash = function (alg) { return hash(alg) }\nexports.createHmac = function (alg, key) { return hash(alg, key) }\nexports.randomBytes = function(size, callback) {\n if (callback && callback.call) {\n try {\n callback.call(this, undefined, new Buffer(rng(size)))\n } catch (err) { callback(err) }\n } else {\n return new Buffer(rng(size))\n }\n}\n\nfunction each(a, f) {\n for(var i in a)\n f(a[i], i)\n}\n\n// the least I can do is make error messages for the rest of the node.js/crypto api.\neach(['createCredentials'\n, 'createCipher'\n, 'createCipheriv'\n, 'createDecipher'\n, 'createDecipheriv'\n, 'createSign'\n, 'createVerify'\n, 'createDiffieHellman'\n, 'pbkdf2'], function (name) {\n exports[name] = function () {\n error('sorry,', name, 'is not implemented yet')\n }\n})\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nvar AuthenticationDetails = function () {\n /**\n * Constructs a new AuthenticationDetails object\n * @param {object=} data Creation options.\n * @param {string} data.Username User being authenticated.\n * @param {string} data.Password Plain-text password to authenticate with.\n * @param {(AttributeArg[])?} data.ValidationData Application extra metadata.\n * @param {(AttributeArg[])?} data.AuthParamaters Authentication paramaters for custom auth.\n */\n function AuthenticationDetails(data) {\n _classCallCheck(this, AuthenticationDetails);\n\n var _ref = data || {},\n ValidationData = _ref.ValidationData,\n Username = _ref.Username,\n Password = _ref.Password,\n AuthParameters = _ref.AuthParameters;\n\n this.validationData = ValidationData || {};\n this.authParameters = AuthParameters || {};\n this.username = Username;\n this.password = Password;\n }\n\n /**\n * @returns {string} the record's username\n */\n\n\n AuthenticationDetails.prototype.getUsername = function getUsername() {\n return this.username;\n };\n\n /**\n * @returns {string} the record's password\n */\n\n\n AuthenticationDetails.prototype.getPassword = function getPassword() {\n return this.password;\n };\n\n /**\n * @returns {Array} the record's validationData\n */\n\n\n AuthenticationDetails.prototype.getValidationData = function getValidationData() {\n return this.validationData;\n };\n\n /**\n * @returns {Array} the record's authParameters\n */\n\n\n AuthenticationDetails.prototype.getAuthParameters = function getAuthParameters() {\n return this.authParameters;\n };\n\n return AuthenticationDetails;\n}();\n\nexports.default = AuthenticationDetails;\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _Client = __webpack_require__(17);\n\nvar _Client2 = _interopRequireDefault(_Client);\n\nvar _CognitoUser = __webpack_require__(6);\n\nvar _CognitoUser2 = _interopRequireDefault(_CognitoUser);\n\nvar _StorageHelper = __webpack_require__(12);\n\nvar _StorageHelper2 = _interopRequireDefault(_StorageHelper);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } /*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nvar CognitoUserPool = function () {\n /**\n * Constructs a new CognitoUserPool object\n * @param {object} data Creation options.\n * @param {string} data.UserPoolId Cognito user pool id.\n * @param {string} data.ClientId User pool application client id.\n * @param {object} data.Storage Optional storage object.\n * @param {boolean} data.AdvancedSecurityDataCollectionFlag Optional:\n * boolean flag indicating if the data collection is enabled\n * to support cognito advanced security features. By default, this\n * flag is set to true.\n */\n function CognitoUserPool(data) {\n _classCallCheck(this, CognitoUserPool);\n\n var _ref = data || {},\n UserPoolId = _ref.UserPoolId,\n ClientId = _ref.ClientId,\n endpoint = _ref.endpoint,\n AdvancedSecurityDataCollectionFlag = _ref.AdvancedSecurityDataCollectionFlag;\n\n if (!UserPoolId || !ClientId) {\n throw new Error('Both UserPoolId and ClientId are required.');\n }\n if (!/^[\\w-]+_.+$/.test(UserPoolId)) {\n throw new Error('Invalid UserPoolId format.');\n }\n var region = UserPoolId.split('_')[0];\n\n this.userPoolId = UserPoolId;\n this.clientId = ClientId;\n\n this.client = new _Client2.default(region, endpoint);\n\n /**\n * By default, AdvancedSecurityDataCollectionFlag is set to true,\n * if no input value is provided.\n */\n this.advancedSecurityDataCollectionFlag = AdvancedSecurityDataCollectionFlag !== false;\n\n this.storage = data.Storage || new _StorageHelper2.default().getStorage();\n }\n\n /**\n * @returns {string} the user pool id\n */\n\n\n CognitoUserPool.prototype.getUserPoolId = function getUserPoolId() {\n return this.userPoolId;\n };\n\n /**\n * @returns {string} the client id\n */\n\n\n CognitoUserPool.prototype.getClientId = function getClientId() {\n return this.clientId;\n };\n\n /**\n * @typedef {object} SignUpResult\n * @property {CognitoUser} user New user.\n * @property {bool} userConfirmed If the user is already confirmed.\n */\n /**\n * method for signing up a user\n * @param {string} username User's username.\n * @param {string} password Plain-text initial password entered by user.\n * @param {(AttributeArg[])=} userAttributes New user attributes.\n * @param {(AttributeArg[])=} validationData Application metadata.\n * @param {nodeCallback} callback Called on error or with the new user.\n * @returns {void}\n */\n\n\n CognitoUserPool.prototype.signUp = function signUp(username, password, userAttributes, validationData, callback) {\n var _this = this;\n\n var jsonReq = {\n ClientId: this.clientId,\n Username: username,\n Password: password,\n UserAttributes: userAttributes,\n ValidationData: validationData\n };\n if (this.getUserContextData(username)) {\n jsonReq.UserContextData = this.getUserContextData(username);\n }\n this.client.request('SignUp', jsonReq, function (err, data) {\n if (err) {\n return callback(err, null);\n }\n\n var cognitoUser = {\n Username: username,\n Pool: _this,\n Storage: _this.storage\n };\n\n var returnData = {\n user: new _CognitoUser2.default(cognitoUser),\n userConfirmed: data.UserConfirmed,\n userSub: data.UserSub\n };\n\n return callback(null, returnData);\n });\n };\n\n /**\n * method for getting the current user of the application from the local storage\n *\n * @returns {CognitoUser} the user retrieved from storage\n */\n\n\n CognitoUserPool.prototype.getCurrentUser = function getCurrentUser() {\n var lastUserKey = 'CognitoIdentityServiceProvider.' + this.clientId + '.LastAuthUser';\n\n var lastAuthUser = this.storage.getItem(lastUserKey);\n if (lastAuthUser) {\n var cognitoUser = {\n Username: lastAuthUser,\n Pool: this,\n Storage: this.storage\n };\n\n return new _CognitoUser2.default(cognitoUser);\n }\n\n return null;\n };\n\n /**\n * This method returns the encoded data string used for cognito advanced security feature.\n * This would be generated only when developer has included the JS used for collecting the\n * data on their client. Please refer to documentation to know more about using AdvancedSecurity\n * features\n * @param {string} username the username for the context data\n * @returns {string} the user context data\n **/\n\n\n CognitoUserPool.prototype.getUserContextData = function getUserContextData(username) {\n if (typeof AmazonCognitoAdvancedSecurityData === 'undefined') {\n return undefined;\n }\n /* eslint-disable */\n var amazonCognitoAdvancedSecurityDataConst = AmazonCognitoAdvancedSecurityData;\n /* eslint-enable */\n\n if (this.advancedSecurityDataCollectionFlag) {\n var advancedSecurityData = amazonCognitoAdvancedSecurityDataConst.getData(username, this.userPoolId, this.clientId);\n if (advancedSecurityData) {\n var userContextData = {\n EncodedData: advancedSecurityData\n };\n return userContextData;\n }\n }\n return {};\n };\n\n return CognitoUserPool;\n}();\n\nexports.default = CognitoUserPool;\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _jsCookie = __webpack_require__(27);\n\nvar Cookies = _interopRequireWildcard(_jsCookie);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/** @class */\nvar CookieStorage = function () {\n\n /**\n * Constructs a new CookieStorage object\n * @param {object} data Creation options.\n * @param {string} data.domain Cookies domain (mandatory).\n * @param {string} data.path Cookies path (default: '/')\n * @param {integer} data.expires Cookie expiration (in days, default: 365)\n * @param {boolean} data.secure Cookie secure flag (default: true)\n */\n function CookieStorage(data) {\n _classCallCheck(this, CookieStorage);\n\n this.domain = data.domain;\n if (data.path) {\n this.path = data.path;\n } else {\n this.path = '/';\n }\n if (Object.prototype.hasOwnProperty.call(data, 'expires')) {\n this.expires = data.expires;\n } else {\n this.expires = 365;\n }\n if (Object.prototype.hasOwnProperty.call(data, 'secure')) {\n this.secure = data.secure;\n } else {\n this.secure = true;\n }\n }\n\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n\n\n CookieStorage.prototype.setItem = function setItem(key, value) {\n Cookies.set(key, value, {\n path: this.path,\n expires: this.expires,\n domain: this.domain,\n secure: this.secure\n });\n return Cookies.get(key);\n };\n\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */\n\n\n CookieStorage.prototype.getItem = function getItem(key) {\n return Cookies.get(key);\n };\n\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {string} value - value that was deleted\n */\n\n\n CookieStorage.prototype.removeItem = function removeItem(key) {\n return Cookies.remove(key, {\n path: this.path,\n domain: this.domain,\n secure: this.secure\n });\n };\n\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */\n\n\n CookieStorage.prototype.clear = function clear() {\n var cookies = Cookies.get();\n var index = void 0;\n for (index = 0; index < cookies.length; ++index) {\n Cookies.remove(cookies[index]);\n }\n return {};\n };\n\n return CookieStorage;\n}();\n\nexports.default = CookieStorage;\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _UserAgent = __webpack_require__(18);\n\nvar _UserAgent2 = _interopRequireDefault(_UserAgent);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/** @class */\nvar Client = function () {\n /**\n * Constructs a new AWS Cognito Identity Provider client object\n * @param {string} region AWS region\n * @param {string} endpoint endpoint\n */\n function Client(region, endpoint) {\n _classCallCheck(this, Client);\n\n this.endpoint = endpoint || 'https://cognito-idp.' + region + '.amazonaws.com/';\n this.userAgent = _UserAgent2.default.prototype.userAgent || 'aws-amplify/0.1.x js';\n }\n\n /**\n * Makes an unauthenticated request on AWS Cognito Identity Provider API\n * using fetch\n * @param {string} operation API operation\n * @param {object} params Input parameters\n * @param {function} callback Callback called when a response is returned\n * @returns {void}\n */\n\n\n Client.prototype.request = function request(operation, params, callback) {\n var headers = {\n 'Content-Type': 'application/x-amz-json-1.1',\n 'X-Amz-Target': 'AWSCognitoIdentityProviderService.' + operation,\n 'X-Amz-User-Agent': this.userAgent\n };\n\n var options = {\n headers: headers,\n method: 'POST',\n mode: 'cors',\n cache: 'no-cache',\n body: JSON.stringify(params)\n };\n\n var response = void 0;\n\n fetch(this.endpoint, options).then(function (resp) {\n response = resp;\n return resp;\n }).then(function (resp) {\n return resp.json().catch(function () {\n return {};\n });\n }).then(function (data) {\n if (response.ok) return callback(null, data);\n\n // Taken from aws-sdk-js/lib/protocol/json.js\n // eslint-disable-next-line no-underscore-dangle\n var code = (data.__type || data.code).split('#').pop();\n var error = {\n code: code,\n name: code,\n message: data.message || data.Message || null\n };\n return callback(error);\n }).catch(function () {\n // Taken from aws-sdk-js/lib/protocol/json.js\n var code = (response.headers.get('x-amzn-errortype') || 'UnknownError').split(':')[0];\n var error = {\n code: code,\n name: code,\n statusCode: response.status,\n message: response.status.toString()\n };\n return callback(error);\n });\n };\n\n return Client;\n}();\n\nexports.default = Client;\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n// class for defining the amzn user-agent\nexports.default = UserAgent;\n// constructor\n\nfunction UserAgent() {}\n// public\nUserAgent.prototype.userAgent = 'aws-amplify/0.1.x js';\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _AuthenticationDetails = __webpack_require__(14);\n\nObject.defineProperty(exports, 'AuthenticationDetails', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_AuthenticationDetails).default;\n }\n});\n\nvar _AuthenticationHelper = __webpack_require__(2);\n\nObject.defineProperty(exports, 'AuthenticationHelper', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_AuthenticationHelper).default;\n }\n});\n\nvar _CognitoAccessToken = __webpack_require__(3);\n\nObject.defineProperty(exports, 'CognitoAccessToken', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CognitoAccessToken).default;\n }\n});\n\nvar _CognitoIdToken = __webpack_require__(4);\n\nObject.defineProperty(exports, 'CognitoIdToken', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CognitoIdToken).default;\n }\n});\n\nvar _CognitoRefreshToken = __webpack_require__(5);\n\nObject.defineProperty(exports, 'CognitoRefreshToken', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CognitoRefreshToken).default;\n }\n});\n\nvar _CognitoUser = __webpack_require__(6);\n\nObject.defineProperty(exports, 'CognitoUser', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CognitoUser).default;\n }\n});\n\nvar _CognitoUserAttribute = __webpack_require__(7);\n\nObject.defineProperty(exports, 'CognitoUserAttribute', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CognitoUserAttribute).default;\n }\n});\n\nvar _CognitoUserPool = __webpack_require__(15);\n\nObject.defineProperty(exports, 'CognitoUserPool', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CognitoUserPool).default;\n }\n});\n\nvar _CognitoUserSession = __webpack_require__(8);\n\nObject.defineProperty(exports, 'CognitoUserSession', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CognitoUserSession).default;\n }\n});\n\nvar _CookieStorage = __webpack_require__(16);\n\nObject.defineProperty(exports, 'CookieStorage', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CookieStorage).default;\n }\n});\n\nvar _DateHelper = __webpack_require__(9);\n\nObject.defineProperty(exports, 'DateHelper', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_DateHelper).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction placeHoldersCount (b64) {\n var len = b64.length\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n}\n\nfunction byteLength (b64) {\n // base64 is 4/3 + up to two characters of the original data\n return (b64.length * 3 / 4) - placeHoldersCount(b64)\n}\n\nfunction toByteArray (b64) {\n var i, l, tmp, placeHolders, arr\n var len = b64.length\n placeHolders = placeHoldersCount(b64)\n\n arr = new Arr((len * 3 / 4) - placeHolders)\n\n // if there are placeholders, only get up to the last complete 4 chars\n l = placeHolders > 0 ? len - 4 : len\n\n var L = 0\n\n for (i = 0; i < l; i += 4) {\n tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n arr[L++] = (tmp >> 16) & 0xFF\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n if (placeHolders === 2) {\n tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[L++] = tmp & 0xFF\n } else if (placeHolders === 1) {\n tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp = ((uint8[i] << 16) & 0xFF0000) + ((uint8[i + 1] << 8) & 0xFF00) + (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var output = ''\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n output += lookup[tmp >> 2]\n output += lookup[(tmp << 4) & 0x3F]\n output += '=='\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n output += lookup[tmp >> 10]\n output += lookup[(tmp >> 4) & 0x3F]\n output += lookup[(tmp << 2) & 0x3F]\n output += '='\n }\n\n parts.push(output)\n\n return parts.join('')\n}\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/*\r\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\r\n * Digest Algorithm, as defined in RFC 1321.\r\n * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.\r\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\r\n * Distributed under the BSD License\r\n * See http://pajhome.org.uk/crypt/md5 for more info.\r\n */\r\n\r\nvar helpers = __webpack_require__(1);\r\n\r\n/*\r\n * Perform a simple self-test to see if the VM is working\r\n */\r\nfunction md5_vm_test()\r\n{\r\n return hex_md5(\"abc\") == \"900150983cd24fb0d6963f7d28e17f72\";\r\n}\r\n\r\n/*\r\n * Calculate the MD5 of an array of little-endian words, and a bit length\r\n */\r\nfunction core_md5(x, len)\r\n{\r\n /* append padding */\r\n x[len >> 5] |= 0x80 << ((len) % 32);\r\n x[(((len + 64) >>> 9) << 4) + 14] = len;\r\n\r\n var a = 1732584193;\r\n var b = -271733879;\r\n var c = -1732584194;\r\n var d = 271733878;\r\n\r\n for(var i = 0; i < x.length; i += 16)\r\n {\r\n var olda = a;\r\n var oldb = b;\r\n var oldc = c;\r\n var oldd = d;\r\n\r\n a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);\r\n d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);\r\n c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);\r\n b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);\r\n a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);\r\n d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);\r\n c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);\r\n b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);\r\n a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);\r\n d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);\r\n c = md5_ff(c, d, a, b, x[i+10], 17, -42063);\r\n b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);\r\n a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);\r\n d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);\r\n c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);\r\n b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);\r\n\r\n a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);\r\n d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);\r\n c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);\r\n b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);\r\n a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);\r\n d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);\r\n c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);\r\n b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);\r\n a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);\r\n d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);\r\n c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);\r\n b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);\r\n a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);\r\n d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);\r\n c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);\r\n b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);\r\n\r\n a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);\r\n d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);\r\n c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);\r\n b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);\r\n a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);\r\n d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);\r\n c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);\r\n b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);\r\n a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);\r\n d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);\r\n c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);\r\n b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);\r\n a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);\r\n d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);\r\n c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);\r\n b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);\r\n\r\n a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);\r\n d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);\r\n c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);\r\n b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);\r\n a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);\r\n d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);\r\n c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);\r\n b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);\r\n a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);\r\n d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);\r\n c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);\r\n b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);\r\n a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);\r\n d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);\r\n c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);\r\n b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);\r\n\r\n a = safe_add(a, olda);\r\n b = safe_add(b, oldb);\r\n c = safe_add(c, oldc);\r\n d = safe_add(d, oldd);\r\n }\r\n return Array(a, b, c, d);\r\n\r\n}\r\n\r\n/*\r\n * These functions implement the four basic operations the algorithm uses.\r\n */\r\nfunction md5_cmn(q, a, b, x, s, t)\r\n{\r\n return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);\r\n}\r\nfunction md5_ff(a, b, c, d, x, s, t)\r\n{\r\n return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\r\n}\r\nfunction md5_gg(a, b, c, d, x, s, t)\r\n{\r\n return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\r\n}\r\nfunction md5_hh(a, b, c, d, x, s, t)\r\n{\r\n return md5_cmn(b ^ c ^ d, a, b, x, s, t);\r\n}\r\nfunction md5_ii(a, b, c, d, x, s, t)\r\n{\r\n return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\r\n}\r\n\r\n/*\r\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\r\n * to work around bugs in some JS interpreters.\r\n */\r\nfunction safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}\r\n\r\n/*\r\n * Bitwise rotate a 32-bit number to the left.\r\n */\r\nfunction bit_rol(num, cnt)\r\n{\r\n return (num << cnt) | (num >>> (32 - cnt));\r\n}\r\n\r\nmodule.exports = function md5(buf) {\r\n return helpers.hash(buf, core_md5, 16);\r\n};\r\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports) {\n\n// Original code adapted from Robert Kieffer.\n// details at https://github.com/broofa/node-uuid\n(function() {\n var _global = this;\n\n var mathRNG, whatwgRNG;\n\n // NOTE: Math.random() does not guarantee \"cryptographic quality\"\n mathRNG = function(size) {\n var bytes = new Array(size);\n var r;\n\n for (var i = 0, r; i < size; i++) {\n if ((i & 0x03) == 0) r = Math.random() * 0x100000000;\n bytes[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return bytes;\n }\n\n if (_global.crypto && crypto.getRandomValues) {\n whatwgRNG = function(size) {\n var bytes = new Uint8Array(size);\n crypto.getRandomValues(bytes);\n return bytes;\n }\n }\n\n module.exports = whatwgRNG || mathRNG;\n\n}())\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined\n * in FIPS PUB 180-1\n * Version 2.1a Copyright Paul Johnston 2000 - 2002.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for details.\n */\n\nvar helpers = __webpack_require__(1);\n\n/*\n * Calculate the SHA-1 of an array of big-endian words, and a bit length\n */\nfunction core_sha1(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n\n var w = Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n for(var i = 0; i < x.length; i += 16)\n {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n var olde = e;\n\n for(var j = 0; j < 80; j++)\n {\n if(j < 16) w[j] = x[i + j];\n else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\n var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return Array(a, b, c, d, e);\n\n}\n\n/*\n * Perform the appropriate triplet combination function for the current\n * iteration\n */\nfunction sha1_ft(t, b, c, d)\n{\n if(t < 20) return (b & c) | ((~b) & d);\n if(t < 40) return b ^ c ^ d;\n if(t < 60) return (b & c) | (b & d) | (c & d);\n return b ^ c ^ d;\n}\n\n/*\n * Determine the appropriate additive constant for the current iteration\n */\nfunction sha1_kt(t)\n{\n return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :\n (t < 60) ? -1894007588 : -899497514;\n}\n\n/*\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n * to work around bugs in some JS interpreters.\n */\nfunction safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}\n\n/*\n * Bitwise rotate a 32-bit number to the left.\n */\nfunction rol(num, cnt)\n{\n return (num << cnt) | (num >>> (32 - cnt));\n}\n\nmodule.exports = function sha1(buf) {\n return helpers.hash(buf, core_sha1, 20, true);\n};\n\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar helpers = __webpack_require__(1);\n\nvar safe_add = function(x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n};\n\nvar S = function(X, n) {\n return (X >>> n) | (X << (32 - n));\n};\n\nvar R = function(X, n) {\n return (X >>> n);\n};\n\nvar Ch = function(x, y, z) {\n return ((x & y) ^ ((~x) & z));\n};\n\nvar Maj = function(x, y, z) {\n return ((x & y) ^ (x & z) ^ (y & z));\n};\n\nvar Sigma0256 = function(x) {\n return (S(x, 2) ^ S(x, 13) ^ S(x, 22));\n};\n\nvar Sigma1256 = function(x) {\n return (S(x, 6) ^ S(x, 11) ^ S(x, 25));\n};\n\nvar Gamma0256 = function(x) {\n return (S(x, 7) ^ S(x, 18) ^ R(x, 3));\n};\n\nvar Gamma1256 = function(x) {\n return (S(x, 17) ^ S(x, 19) ^ R(x, 10));\n};\n\nvar core_sha256 = function(m, l) {\n var K = new Array(0x428A2F98,0x71374491,0xB5C0FBCF,0xE9B5DBA5,0x3956C25B,0x59F111F1,0x923F82A4,0xAB1C5ED5,0xD807AA98,0x12835B01,0x243185BE,0x550C7DC3,0x72BE5D74,0x80DEB1FE,0x9BDC06A7,0xC19BF174,0xE49B69C1,0xEFBE4786,0xFC19DC6,0x240CA1CC,0x2DE92C6F,0x4A7484AA,0x5CB0A9DC,0x76F988DA,0x983E5152,0xA831C66D,0xB00327C8,0xBF597FC7,0xC6E00BF3,0xD5A79147,0x6CA6351,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);\n var HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19);\n var W = new Array(64);\n var a, b, c, d, e, f, g, h, i, j;\n var T1, T2;\n /* append padding */\n m[l >> 5] |= 0x80 << (24 - l % 32);\n m[((l + 64 >> 9) << 4) + 15] = l;\n for (var i = 0; i < m.length; i += 16) {\n a = HASH[0]; b = HASH[1]; c = HASH[2]; d = HASH[3]; e = HASH[4]; f = HASH[5]; g = HASH[6]; h = HASH[7];\n for (var j = 0; j < 64; j++) {\n if (j < 16) {\n W[j] = m[j + i];\n } else {\n W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]);\n }\n T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]);\n T2 = safe_add(Sigma0256(a), Maj(a, b, c));\n h = g; g = f; f = e; e = safe_add(d, T1); d = c; c = b; b = a; a = safe_add(T1, T2);\n }\n HASH[0] = safe_add(a, HASH[0]); HASH[1] = safe_add(b, HASH[1]); HASH[2] = safe_add(c, HASH[2]); HASH[3] = safe_add(d, HASH[3]);\n HASH[4] = safe_add(e, HASH[4]); HASH[5] = safe_add(f, HASH[5]); HASH[6] = safe_add(g, HASH[6]); HASH[7] = safe_add(h, HASH[7]);\n }\n return HASH;\n};\n\nmodule.exports = function sha256(buf) {\n return helpers.hash(buf, core_sha256, 32, true);\n};\n\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports) {\n\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports) {\n\nvar toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * JavaScript Cookie v2.2.0\n * https://github.com/js-cookie/js-cookie\n *\n * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n * Released under the MIT license\n */\n;(function (factory) {\n\tvar registeredInModuleLoader = false;\n\tif (true) {\n\t\t!(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (true) {\n\t\tmodule.exports = factory();\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (!registeredInModuleLoader) {\n\t\tvar OldCookies = window.Cookies;\n\t\tvar api = window.Cookies = factory();\n\t\tapi.noConflict = function () {\n\t\t\twindow.Cookies = OldCookies;\n\t\t\treturn api;\n\t\t};\n\t}\n}(function () {\n\tfunction extend () {\n\t\tvar i = 0;\n\t\tvar result = {};\n\t\tfor (; i < arguments.length; i++) {\n\t\t\tvar attributes = arguments[ i ];\n\t\t\tfor (var key in attributes) {\n\t\t\t\tresult[key] = attributes[key];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction init (converter) {\n\t\tfunction api (key, value, attributes) {\n\t\t\tvar result;\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Write\n\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tattributes = extend({\n\t\t\t\t\tpath: '/'\n\t\t\t\t}, api.defaults, attributes);\n\n\t\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\t\tvar expires = new Date();\n\t\t\t\t\texpires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);\n\t\t\t\t\tattributes.expires = expires;\n\t\t\t\t}\n\n\t\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\n\t\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\n\t\t\t\ttry {\n\t\t\t\t\tresult = JSON.stringify(value);\n\t\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\t\tvalue = result;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\n\t\t\t\tif (!converter.write) {\n\t\t\t\t\tvalue = encodeURIComponent(String(value))\n\t\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\t\t\t\t} else {\n\t\t\t\t\tvalue = converter.write(value, key);\n\t\t\t\t}\n\n\t\t\t\tkey = encodeURIComponent(String(key));\n\t\t\t\tkey = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);\n\t\t\t\tkey = key.replace(/[\\(\\)]/g, escape);\n\n\t\t\t\tvar stringifiedAttributes = '';\n\n\t\t\t\tfor (var attributeName in attributes) {\n\t\t\t\t\tif (!attributes[attributeName]) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstringifiedAttributes += '; ' + attributeName;\n\t\t\t\t\tif (attributes[attributeName] === true) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName];\n\t\t\t\t}\n\t\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\n\t\t\t}\n\n\t\t\t// Read\n\n\t\t\tif (!key) {\n\t\t\t\tresult = {};\n\t\t\t}\n\n\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t// in case there are no cookies at all. Also prevents odd result when\n\t\t\t// calling \"get()\"\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\tvar rdecode = /(%[0-9A-Z]{2})+/g;\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\tvar cookie = parts.slice(1).join('=');\n\n\t\t\t\tif (!this.json && cookie.charAt(0) === '\"') {\n\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvar name = parts[0].replace(rdecode, decodeURIComponent);\n\t\t\t\t\tcookie = converter.read ?\n\t\t\t\t\t\tconverter.read(cookie, name) : converter(cookie, name) ||\n\t\t\t\t\t\tcookie.replace(rdecode, decodeURIComponent);\n\n\t\t\t\t\tif (this.json) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\tresult = cookie;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!key) {\n\t\t\t\t\t\tresult[name] = cookie;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\tapi.set = api;\n\t\tapi.get = function (key) {\n\t\t\treturn api.call(api, key);\n\t\t};\n\t\tapi.getJSON = function () {\n\t\t\treturn api.apply({\n\t\t\t\tjson: true\n\t\t\t}, [].slice.call(arguments));\n\t\t};\n\t\tapi.defaults = {};\n\n\t\tapi.remove = function (key, attributes) {\n\t\t\tapi(key, '', extend(attributes, {\n\t\t\t\texpires: -1\n\t\t\t}));\n\t\t};\n\n\t\tapi.withConverter = init;\n\n\t\treturn api;\n\t}\n\n\treturn init(function () {});\n}));\n\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports) {\n\nvar g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// amazon-cognito-identity.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 19);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 2e8d2279cc1c9a9f6b5f","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/buffer/index.js\n// module id = 0\n// module chunks = 0","var Buffer = require('buffer').Buffer;\nvar intSize = 4;\nvar zeroBuffer = new Buffer(intSize); zeroBuffer.fill(0);\nvar chrsz = 8;\n\nfunction toArray(buf, bigEndian) {\n if ((buf.length % intSize) !== 0) {\n var len = buf.length + (intSize - (buf.length % intSize));\n buf = Buffer.concat([buf, zeroBuffer], len);\n }\n\n var arr = [];\n var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE;\n for (var i = 0; i < buf.length; i += intSize) {\n arr.push(fn.call(buf, i));\n }\n return arr;\n}\n\nfunction toBuffer(arr, size, bigEndian) {\n var buf = new Buffer(size);\n var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE;\n for (var i = 0; i < arr.length; i++) {\n fn.call(buf, arr[i], i * 4, true);\n }\n return buf;\n}\n\nfunction hash(buf, fn, hashSize, bigEndian) {\n if (!Buffer.isBuffer(buf)) buf = new Buffer(buf);\n var arr = fn(toArray(buf, bigEndian), buf.length * chrsz);\n return toBuffer(arr, hashSize, bigEndian);\n}\n\nmodule.exports = { hash: hash };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/crypto-browserify/helpers.js\n// module id = 1\n// module chunks = 0","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Buffer } from 'buffer/';\nimport * as crypto from 'crypto-browserify';\nconst createHash = crypto.createHash;\nconst createHmac = crypto.createHmac;\nconst randomBytes = crypto.randomBytes;\n\nimport BigInteger from './BigInteger';\n\nconst initN = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1'\n + '29024E088A67CC74020BBEA63B139B22514A08798E3404DD'\n + 'EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245'\n + 'E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED'\n + 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D'\n + 'C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F'\n + '83655D23DCA3AD961C62F356208552BB9ED529077096966D'\n + '670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B'\n + 'E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9'\n + 'DE2BCBF6955817183995497CEA956AE515D2261898FA0510'\n + '15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64'\n + 'ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7'\n + 'ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B'\n + 'F12FFA06D98A0864D87602733EC86A64521F2B18177B200C'\n + 'BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31'\n + '43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF';\n\nconst newPasswordRequiredChallengeUserAttributePrefix = 'userAttributes.';\n\n/** @class */\nexport default class AuthenticationHelper {\n /**\n * Constructs a new AuthenticationHelper object\n * @param {string} PoolName Cognito user pool name.\n */\n constructor(PoolName) {\n this.N = new BigInteger(initN, 16);\n this.g = new BigInteger('2', 16);\n this.k = new BigInteger(this.hexHash(`00${this.N.toString(16)}0${this.g.toString(16)}`), 16);\n\n this.smallAValue = this.generateRandomSmallA();\n this.getLargeAValue(() => {});\n\n this.infoBits = Buffer.from('Caldera Derived Key', 'utf8');\n\n this.poolName = PoolName;\n }\n\n /**\n * @returns {BigInteger} small A, a random number\n */\n getSmallAValue() {\n return this.smallAValue;\n }\n\n /**\n * @param {nodeCallback} callback Called with (err, largeAValue)\n * @returns {void}\n */\n getLargeAValue(callback) {\n if (this.largeAValue) {\n callback(null, this.largeAValue);\n } else {\n this.calculateA(this.smallAValue, (err, largeAValue) => {\n if (err) {\n callback(err, null);\n }\n\n this.largeAValue = largeAValue;\n callback(null, this.largeAValue);\n });\n }\n }\n\n /**\n * helper function to generate a random big integer\n * @returns {BigInteger} a random value.\n * @private\n */\n generateRandomSmallA() {\n const hexRandom = randomBytes(128).toString('hex');\n\n const randomBigInt = new BigInteger(hexRandom, 16);\n const smallABigInt = randomBigInt.mod(this.N);\n\n return smallABigInt;\n }\n\n /**\n * helper function to generate a random string\n * @returns {string} a random value.\n * @private\n */\n generateRandomString() {\n return randomBytes(40).toString('base64');\n }\n\n /**\n * @returns {string} Generated random value included in password hash.\n */\n getRandomPassword() {\n return this.randomPassword;\n }\n\n /**\n * @returns {string} Generated random value included in devices hash.\n */\n getSaltDevices() {\n return this.SaltToHashDevices;\n }\n\n /**\n * @returns {string} Value used to verify devices.\n */\n getVerifierDevices() {\n return this.verifierDevices;\n }\n\n /**\n * Generate salts and compute verifier.\n * @param {string} deviceGroupKey Devices to generate verifier for.\n * @param {string} username User to generate verifier for.\n * @param {nodeCallback} callback Called with (err, null)\n * @returns {void}\n */\n generateHashDevice(deviceGroupKey, username, callback) {\n this.randomPassword = this.generateRandomString();\n const combinedString = `${deviceGroupKey}${username}:${this.randomPassword}`;\n const hashedString = this.hash(combinedString);\n\n const hexRandom = randomBytes(16).toString('hex');\n this.SaltToHashDevices = this.padHex(new BigInteger(hexRandom, 16));\n\n this.g.modPow(\n new BigInteger(this.hexHash(this.SaltToHashDevices + hashedString), 16),\n this.N,\n (err, verifierDevicesNotPadded) => {\n if (err) {\n callback(err, null);\n }\n\n this.verifierDevices = this.padHex(verifierDevicesNotPadded);\n callback(null, null);\n });\n }\n\n /**\n * Calculate the client's public value A = g^a%N\n * with the generated random number a\n * @param {BigInteger} a Randomly generated small A.\n * @param {nodeCallback} callback Called with (err, largeAValue)\n * @returns {void}\n * @private\n */\n calculateA(a, callback) {\n this.g.modPow(a, this.N, (err, A) => {\n if (err) {\n callback(err, null);\n }\n\n if (A.mod(this.N).equals(BigInteger.ZERO)) {\n callback(new Error('Illegal paramater. A mod N cannot be 0.'), null);\n }\n\n callback(null, A);\n });\n }\n\n /**\n * Calculate the client's value U which is the hash of A and B\n * @param {BigInteger} A Large A value.\n * @param {BigInteger} B Server B value.\n * @returns {BigInteger} Computed U value.\n * @private\n */\n calculateU(A, B) {\n this.UHexHash = this.hexHash(this.padHex(A) + this.padHex(B));\n const finalU = new BigInteger(this.UHexHash, 16);\n\n return finalU;\n }\n\n /**\n * Calculate a hash from a bitArray\n * @param {Buffer} buf Value to hash.\n * @returns {String} Hex-encoded hash.\n * @private\n */\n hash(buf) {\n const hashHex = createHash('sha256').update(buf).digest('hex');\n return (new Array(64 - hashHex.length).join('0')) + hashHex;\n }\n\n /**\n * Calculate a hash from a hex string\n * @param {String} hexStr Value to hash.\n * @returns {String} Hex-encoded hash.\n * @private\n */\n hexHash(hexStr) {\n return this.hash(Buffer.from(hexStr, 'hex'));\n }\n\n /**\n * Standard hkdf algorithm\n * @param {Buffer} ikm Input key material.\n * @param {Buffer} salt Salt value.\n * @returns {Buffer} Strong key material.\n * @private\n */\n computehkdf(ikm, salt) {\n const prk = createHmac('sha256', salt).update(ikm).digest();\n const infoBitsUpdate = Buffer.concat([\n this.infoBits,\n Buffer.from(String.fromCharCode(1), 'utf8'),\n ]);\n const hmac = createHmac('sha256', prk).update(infoBitsUpdate).digest();\n return hmac.slice(0, 16);\n }\n\n /**\n * Calculates the final hkdf based on computed S value, and computed U value and the key\n * @param {String} username Username.\n * @param {String} password Password.\n * @param {BigInteger} serverBValue Server B value.\n * @param {BigInteger} salt Generated salt.\n * @param {nodeCallback} callback Called with (err, hkdfValue)\n * @returns {void}\n */\n getPasswordAuthenticationKey(username, password, serverBValue, salt, callback) {\n if (serverBValue.mod(this.N).equals(BigInteger.ZERO)) {\n throw new Error('B cannot be zero.');\n }\n\n this.UValue = this.calculateU(this.largeAValue, serverBValue);\n\n if (this.UValue.equals(BigInteger.ZERO)) {\n throw new Error('U cannot be zero.');\n }\n\n const usernamePassword = `${this.poolName}${username}:${password}`;\n const usernamePasswordHash = this.hash(usernamePassword);\n\n const xValue = new BigInteger(this.hexHash(this.padHex(salt) + usernamePasswordHash), 16);\n this.calculateS(xValue, serverBValue, (err, sValue) => {\n if (err) {\n callback(err, null);\n }\n\n const hkdf = this.computehkdf(\n Buffer.from(this.padHex(sValue), 'hex'),\n Buffer.from(this.padHex(this.UValue.toString(16)), 'hex'));\n\n callback(null, hkdf);\n });\n }\n\n /**\n * Calculates the S value used in getPasswordAuthenticationKey\n * @param {BigInteger} xValue Salted password hash value.\n * @param {BigInteger} serverBValue Server B value.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n calculateS(xValue, serverBValue, callback) {\n this.g.modPow(xValue, this.N, (err, gModPowXN) => {\n if (err) {\n callback(err, null);\n }\n\n const intValue2 = serverBValue.subtract(this.k.multiply(gModPowXN));\n intValue2.modPow(\n this.smallAValue.add(this.UValue.multiply(xValue)),\n this.N,\n (err2, result) => {\n if (err2) {\n callback(err2, null);\n }\n\n callback(null, result.mod(this.N));\n }\n );\n });\n }\n\n /**\n * Return constant newPasswordRequiredChallengeUserAttributePrefix\n * @return {newPasswordRequiredChallengeUserAttributePrefix} constant prefix value\n */\n getNewPasswordRequiredChallengeUserAttributePrefix() {\n return newPasswordRequiredChallengeUserAttributePrefix;\n }\n\n /**\n * Converts a BigInteger (or hex string) to hex format padded with zeroes for hashing\n * @param {BigInteger|String} bigInt Number or string to pad.\n * @returns {String} Padded hex string.\n */\n padHex(bigInt) {\n let hashStr = bigInt.toString(16);\n if (hashStr.length % 2 === 1) {\n hashStr = `0${hashStr}`;\n } else if ('89ABCDEFabcdef'.indexOf(hashStr[0]) !== -1) {\n hashStr = `00${hashStr}`;\n }\n return hashStr;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/AuthenticationHelper.js","/*\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport CognitoJwtToken from './CognitoJwtToken';\n\n/** @class */\nexport default class CognitoAccessToken extends CognitoJwtToken {\n /**\n * Constructs a new CognitoAccessToken object\n * @param {string=} AccessToken The JWT access token.\n */\n constructor({ AccessToken } = {}) {\n super(AccessToken || '');\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoAccessToken.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport CognitoJwtToken from './CognitoJwtToken';\n\n/** @class */\nexport default class CognitoIdToken extends CognitoJwtToken {\n /**\n * Constructs a new CognitoIdToken object\n * @param {string=} IdToken The JWT Id token\n */\n constructor({ IdToken } = {}) {\n super(IdToken || '');\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoIdToken.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nexport default class CognitoRefreshToken {\n /**\n * Constructs a new CognitoRefreshToken object\n * @param {string=} RefreshToken The JWT refresh token.\n */\n constructor({ RefreshToken } = {}) {\n // Assign object\n this.token = RefreshToken || '';\n }\n\n /**\n * @returns {string} the record's token.\n */\n getToken() {\n return this.token;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoRefreshToken.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Buffer } from 'buffer/';\n//import createHmac from 'create-hmac';\nimport * as crypto from 'crypto-browserify';\nconst createHmac = crypto.createHmac;\n\nimport BigInteger from './BigInteger';\nimport AuthenticationHelper from './AuthenticationHelper';\nimport CognitoAccessToken from './CognitoAccessToken';\nimport CognitoIdToken from './CognitoIdToken';\nimport CognitoRefreshToken from './CognitoRefreshToken';\nimport CognitoUserSession from './CognitoUserSession';\nimport DateHelper from './DateHelper';\nimport CognitoUserAttribute from './CognitoUserAttribute';\nimport StorageHelper from './StorageHelper';\n\n/**\n * @callback nodeCallback\n * @template T result\n * @param {*} err The operation failure reason, or null.\n * @param {T} result The operation result.\n */\n\n/**\n * @callback onFailure\n * @param {*} err Failure reason.\n */\n\n/**\n * @callback onSuccess\n * @template T result\n * @param {T} result The operation result.\n */\n\n/**\n * @callback mfaRequired\n * @param {*} details MFA challenge details.\n */\n\n/**\n * @callback customChallenge\n * @param {*} details Custom challenge details.\n */\n\n/**\n * @callback inputVerificationCode\n * @param {*} data Server response.\n */\n\n/**\n * @callback authSuccess\n * @param {CognitoUserSession} session The new session.\n * @param {bool=} userConfirmationNecessary User must be confirmed.\n */\n\n\n/** @class */\nexport default class CognitoUser {\n /**\n * Constructs a new CognitoUser object\n * @param {object} data Creation options\n * @param {string} data.Username The user's username.\n * @param {CognitoUserPool} data.Pool Pool containing the user.\n * @param {object} data.Storage Optional storage object.\n */\n constructor(data) {\n if (data == null || data.Username == null || data.Pool == null) {\n throw new Error('Username and pool information are required.');\n }\n\n this.username = data.Username || '';\n this.pool = data.Pool;\n this.Session = null;\n\n this.client = data.Pool.client;\n\n this.signInUserSession = null;\n this.authenticationFlowType = 'USER_SRP_AUTH';\n\n this.storage = data.Storage || new StorageHelper().getStorage();\n }\n\n /**\n * Sets the session for this user\n * @param {CognitoUserSession} signInUserSession the session\n * @returns {void}\n */\n setSignInUserSession(signInUserSession) {\n this.clearCachedTokens();\n this.signInUserSession = signInUserSession;\n this.cacheTokens();\n }\n\n /**\n * @returns {CognitoUserSession} the current session for this user\n */\n getSignInUserSession() {\n return this.signInUserSession;\n }\n\n /**\n * @returns {string} the user's username\n */\n getUsername() {\n return this.username;\n }\n\n /**\n * @returns {String} the authentication flow type\n */\n getAuthenticationFlowType() {\n return this.authenticationFlowType;\n }\n\n /**\n * sets authentication flow type\n * @param {string} authenticationFlowType New value.\n * @returns {void}\n */\n setAuthenticationFlowType(authenticationFlowType) {\n this.authenticationFlowType = authenticationFlowType;\n }\n\n\n /**\n * This is used for authenticating the user through the custom authentication flow.\n * @param {AuthenticationDetails} authDetails Contains the authentication data\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n initiateAuth(authDetails, callback) {\n const authParameters = authDetails.getAuthParameters();\n authParameters.USERNAME = this.username;\n\n const jsonReq = {\n AuthFlow: 'CUSTOM_AUTH',\n ClientId: this.pool.getClientId(),\n AuthParameters: authParameters,\n ClientMetadata: authDetails.getValidationData(),\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.request('InitiateAuth', jsonReq, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n const challengeName = data.ChallengeName;\n const challengeParameters = data.ChallengeParameters;\n\n if (challengeName === 'CUSTOM_CHALLENGE') {\n this.Session = data.Session;\n return callback.customChallenge(challengeParameters);\n }\n this.signInUserSession = this.getCognitoUserSession(data.AuthenticationResult);\n this.cacheTokens();\n return callback.onSuccess(this.signInUserSession);\n });\n }\n\n /**\n * This is used for authenticating the user.\n * stuff\n * @param {AuthenticationDetails} authDetails Contains the authentication data\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {newPasswordRequired} callback.newPasswordRequired new\n * password and any required attributes are required to continue\n * @param {mfaRequired} callback.mfaRequired MFA code\n * required to continue.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n authenticateUser(authDetails, callback) {\n if (this.authenticationFlowType === 'USER_PASSWORD_AUTH') {\n return this.authenticateUserPlainUsernamePassword(authDetails, callback);\n } else if (this.authenticationFlowType === 'USER_SRP_AUTH') {\n return this.authenticateUserDefaultAuth(authDetails, callback);\n }\n return callback.onFailure(new Error('Authentication flow type is invalid.'));\n }\n\n /**\n * This is used for authenticating the user. it calls the AuthenticationHelper for SRP related\n * stuff\n * @param {AuthenticationDetails} authDetails Contains the authentication data\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {newPasswordRequired} callback.newPasswordRequired new\n * password and any required attributes are required to continue\n * @param {mfaRequired} callback.mfaRequired MFA code\n * required to continue.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n authenticateUserDefaultAuth(authDetails, callback) {\n const authenticationHelper = new AuthenticationHelper(\n this.pool.getUserPoolId().split('_')[1]);\n const dateHelper = new DateHelper();\n\n let serverBValue;\n let salt;\n const authParameters = {};\n\n if (this.deviceKey != null) {\n authParameters.DEVICE_KEY = this.deviceKey;\n }\n\n authParameters.USERNAME = this.username;\n authenticationHelper.getLargeAValue((errOnAValue, aValue) => {\n // getLargeAValue callback start\n if (errOnAValue) {\n callback.onFailure(errOnAValue);\n }\n\n authParameters.SRP_A = aValue.toString(16);\n\n if (this.authenticationFlowType === 'CUSTOM_AUTH') {\n authParameters.CHALLENGE_NAME = 'SRP_A';\n }\n\n const jsonReq = {\n AuthFlow: this.authenticationFlowType,\n ClientId: this.pool.getClientId(),\n AuthParameters: authParameters,\n ClientMetadata: authDetails.getValidationData(),\n };\n if (this.getUserContextData(this.username)) {\n jsonReq.UserContextData = this.getUserContextData(this.username);\n }\n\n this.client.request('InitiateAuth', jsonReq, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n\n const challengeParameters = data.ChallengeParameters;\n\n this.username = challengeParameters.USER_ID_FOR_SRP;\n serverBValue = new BigInteger(challengeParameters.SRP_B, 16);\n salt = new BigInteger(challengeParameters.SALT, 16);\n this.getCachedDeviceKeyAndPassword();\n\n authenticationHelper.getPasswordAuthenticationKey(\n this.username,\n authDetails.getPassword(),\n serverBValue,\n salt,\n (errOnHkdf, hkdf) => {\n // getPasswordAuthenticationKey callback start\n if (errOnHkdf) {\n callback.onFailure(errOnHkdf);\n }\n\n const dateNow = dateHelper.getNowString();\n\n const signatureString = createHmac('sha256', hkdf)\n .update(Buffer.concat([\n Buffer.from(this.pool.getUserPoolId().split('_')[1], 'utf8'),\n Buffer.from(this.username, 'utf8'),\n Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'),\n Buffer.from(dateNow, 'utf8'),\n ]))\n .digest('base64');\n\n const challengeResponses = {};\n\n challengeResponses.USERNAME = this.username;\n challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK;\n challengeResponses.TIMESTAMP = dateNow;\n challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString;\n\n if (this.deviceKey != null) {\n challengeResponses.DEVICE_KEY = this.deviceKey;\n }\n\n const respondToAuthChallenge = (challenge, challengeCallback) =>\n this.client.request('RespondToAuthChallenge', challenge,\n (errChallenge, dataChallenge) => {\n if (errChallenge && errChallenge.code === 'ResourceNotFoundException' &&\n errChallenge.message.toLowerCase().indexOf('device') !== -1) {\n challengeResponses.DEVICE_KEY = null;\n this.deviceKey = null;\n this.randomPassword = null;\n this.deviceGroupKey = null;\n this.clearCachedDeviceKeyAndPassword();\n return respondToAuthChallenge(challenge, challengeCallback);\n }\n return challengeCallback(errChallenge, dataChallenge);\n });\n\n const jsonReqResp = {\n ChallengeName: 'PASSWORD_VERIFIER',\n ClientId: this.pool.getClientId(),\n ChallengeResponses: challengeResponses,\n Session: data.Session,\n };\n if (this.getUserContextData()) {\n jsonReqResp.UserContextData = this.getUserContextData();\n }\n respondToAuthChallenge(jsonReqResp, (errAuthenticate, dataAuthenticate) => {\n if (errAuthenticate) {\n return callback.onFailure(errAuthenticate);\n }\n\n const challengeName = dataAuthenticate.ChallengeName;\n if (challengeName === 'NEW_PASSWORD_REQUIRED') {\n this.Session = dataAuthenticate.Session;\n let userAttributes = null;\n let rawRequiredAttributes = null;\n const requiredAttributes = [];\n const userAttributesPrefix = authenticationHelper\n .getNewPasswordRequiredChallengeUserAttributePrefix();\n\n if (dataAuthenticate.ChallengeParameters) {\n userAttributes = JSON.parse(\n dataAuthenticate.ChallengeParameters.userAttributes);\n rawRequiredAttributes = JSON.parse(\n dataAuthenticate.ChallengeParameters.requiredAttributes);\n }\n\n if (rawRequiredAttributes) {\n for (let i = 0; i < rawRequiredAttributes.length; i++) {\n requiredAttributes[i] = rawRequiredAttributes[i].substr(\n userAttributesPrefix.length\n );\n }\n }\n return callback.newPasswordRequired(userAttributes, requiredAttributes);\n }\n return this.authenticateUserInternal(\n dataAuthenticate,\n authenticationHelper,\n callback\n );\n });\n return undefined;\n // getPasswordAuthenticationKey callback end\n });\n return undefined;\n });\n // getLargeAValue callback end\n });\n }\n\n /**\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n * @param {AuthenticationDetails} authDetails Contains the authentication data.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {mfaRequired} callback.mfaRequired MFA code\n * required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n authenticateUserPlainUsernamePassword(authDetails, callback) {\n const authParameters = {};\n authParameters.USERNAME = this.username;\n authParameters.PASSWORD = authDetails.getPassword();\n if (!authParameters.PASSWORD) {\n callback.onFailure(new Error('PASSWORD parameter is required'));\n return;\n }\n const authenticationHelper = new AuthenticationHelper(\n this.pool.getUserPoolId().split('_')[1]);\n this.getCachedDeviceKeyAndPassword();\n if (this.deviceKey != null) {\n authParameters.DEVICE_KEY = this.deviceKey;\n }\n\n const jsonReq = {\n AuthFlow: 'USER_PASSWORD_AUTH',\n ClientId: this.pool.getClientId(),\n AuthParameters: authParameters,\n ClientMetadata: authDetails.getValidationData(),\n };\n if (this.getUserContextData(this.username)) {\n jsonReq.UserContextData = this.getUserContextData(this.username);\n }\n // USER_PASSWORD_AUTH happens in a single round-trip: client sends userName and password,\n // Cognito UserPools verifies password and returns tokens.\n this.client.request('InitiateAuth', jsonReq, (err, authResult) => {\n if (err) {\n return callback.onFailure(err);\n }\n return this.authenticateUserInternal(authResult, authenticationHelper, callback);\n });\n }\n\n /**\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n * @param {object} dataAuthenticate authentication data\n * @param {object} authenticationHelper helper created\n * @param {callback} callback passed on from caller\n * @returns {void}\n */\n authenticateUserInternal(dataAuthenticate, authenticationHelper, callback) {\n const challengeName = dataAuthenticate.ChallengeName;\n const challengeParameters = dataAuthenticate.ChallengeParameters;\n\n if (challengeName === 'SMS_MFA') {\n this.Session = dataAuthenticate.Session;\n return callback.mfaRequired(challengeName, challengeParameters);\n }\n\n if (challengeName === 'SELECT_MFA_TYPE') {\n this.Session = dataAuthenticate.Session;\n return callback.selectMFAType(challengeName, challengeParameters);\n }\n\n if (challengeName === 'MFA_SETUP') {\n this.Session = dataAuthenticate.Session;\n return callback.mfaSetup(challengeName, challengeParameters);\n }\n\n if (challengeName === 'SOFTWARE_TOKEN_MFA') {\n this.Session = dataAuthenticate.Session;\n return callback.totpRequired(challengeName, challengeParameters);\n }\n\n if (challengeName === 'CUSTOM_CHALLENGE') {\n this.Session = dataAuthenticate.Session;\n return callback.customChallenge(challengeParameters);\n }\n\n if (challengeName === 'DEVICE_SRP_AUTH') {\n this.getDeviceResponse(callback);\n return undefined;\n }\n\n this.signInUserSession = this.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n this.cacheTokens();\n\n const newDeviceMetadata = dataAuthenticate.AuthenticationResult.NewDeviceMetadata;\n if (newDeviceMetadata == null) {\n return callback.onSuccess(this.signInUserSession);\n }\n\n authenticationHelper.generateHashDevice(\n dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,\n dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey,\n (errGenHash) => {\n if (errGenHash) {\n return callback.onFailure(errGenHash);\n }\n\n const deviceSecretVerifierConfig = {\n Salt: Buffer.from(\n authenticationHelper.getSaltDevices(), 'hex'\n ).toString('base64'),\n PasswordVerifier: Buffer.from(\n authenticationHelper.getVerifierDevices(), 'hex'\n ).toString('base64'),\n };\n\n this.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier;\n this.deviceGroupKey = newDeviceMetadata.DeviceGroupKey;\n this.randomPassword = authenticationHelper.getRandomPassword();\n\n this.client.request('ConfirmDevice', {\n DeviceKey: newDeviceMetadata.DeviceKey,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceSecretVerifierConfig: deviceSecretVerifierConfig,\n DeviceName: navigator.userAgent,\n }, (errConfirm, dataConfirm) => {\n if (errConfirm) {\n return callback.onFailure(errConfirm);\n }\n\n this.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey;\n this.cacheDeviceKeyAndPassword();\n if (dataConfirm.UserConfirmationNecessary === true) {\n return callback.onSuccess(\n this.signInUserSession, dataConfirm.UserConfirmationNecessary);\n }\n return callback.onSuccess(this.signInUserSession);\n });\n return undefined;\n });\n return undefined;\n }\n\n /**\n * This method is user to complete the NEW_PASSWORD_REQUIRED challenge.\n * Pass the new password with any new user attributes to be updated.\n * User attribute keys must be of format userAttributes..\n * @param {string} newPassword new password for this user\n * @param {object} requiredAttributeData map with values for all required attributes\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {mfaRequired} callback.mfaRequired MFA code required to continue.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n completeNewPasswordChallenge(newPassword, requiredAttributeData, callback) {\n if (!newPassword) {\n return callback.onFailure(new Error('New password is required.'));\n }\n const authenticationHelper = new AuthenticationHelper(\n this.pool.getUserPoolId().split('_')[1]);\n const userAttributesPrefix = authenticationHelper\n .getNewPasswordRequiredChallengeUserAttributePrefix();\n\n const finalUserAttributes = {};\n if (requiredAttributeData) {\n Object.keys(requiredAttributeData).forEach((key) => {\n finalUserAttributes[userAttributesPrefix + key] = requiredAttributeData[key];\n });\n }\n\n finalUserAttributes.NEW_PASSWORD = newPassword;\n finalUserAttributes.USERNAME = this.username;\n const jsonReq = {\n ChallengeName: 'NEW_PASSWORD_REQUIRED',\n ClientId: this.pool.getClientId(),\n ChallengeResponses: finalUserAttributes,\n Session: this.Session,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.request('RespondToAuthChallenge',\n jsonReq, (errAuthenticate, dataAuthenticate) => {\n if (errAuthenticate) {\n return callback.onFailure(errAuthenticate);\n }\n return this.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback);\n });\n return undefined;\n }\n\n /**\n * This is used to get a session using device authentication. It is called at the end of user\n * authentication\n *\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n * @private\n */\n getDeviceResponse(callback) {\n const authenticationHelper = new AuthenticationHelper(\n this.deviceGroupKey);\n const dateHelper = new DateHelper();\n\n const authParameters = {};\n\n authParameters.USERNAME = this.username;\n authParameters.DEVICE_KEY = this.deviceKey;\n authenticationHelper.getLargeAValue((errAValue, aValue) => {\n // getLargeAValue callback start\n if (errAValue) {\n callback.onFailure(errAValue);\n }\n\n authParameters.SRP_A = aValue.toString(16);\n\n const jsonReq = {\n ChallengeName: 'DEVICE_SRP_AUTH',\n ClientId: this.pool.getClientId(),\n ChallengeResponses: authParameters,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('RespondToAuthChallenge', jsonReq, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n\n const challengeParameters = data.ChallengeParameters;\n\n const serverBValue = new BigInteger(challengeParameters.SRP_B, 16);\n const salt = new BigInteger(challengeParameters.SALT, 16);\n\n authenticationHelper.getPasswordAuthenticationKey(\n this.deviceKey,\n this.randomPassword,\n serverBValue,\n salt,\n (errHkdf, hkdf) => {\n // getPasswordAuthenticationKey callback start\n if (errHkdf) {\n return callback.onFailure(errHkdf);\n }\n\n const dateNow = dateHelper.getNowString();\n\n const signatureString = createHmac('sha256', hkdf)\n .update(Buffer.concat([\n Buffer.from(this.deviceGroupKey, 'utf8'),\n Buffer.from(this.deviceKey, 'utf8'),\n Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'),\n Buffer.from(dateNow, 'utf8'),\n ]))\n .digest('base64');\n\n const challengeResponses = {};\n\n challengeResponses.USERNAME = this.username;\n challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK;\n challengeResponses.TIMESTAMP = dateNow;\n challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString;\n challengeResponses.DEVICE_KEY = this.deviceKey;\n\n const jsonReqResp = {\n ChallengeName: 'DEVICE_PASSWORD_VERIFIER',\n ClientId: this.pool.getClientId(),\n ChallengeResponses: challengeResponses,\n Session: data.Session,\n };\n if (this.getUserContextData()) {\n jsonReqResp.UserContextData = this.getUserContextData();\n }\n\n this.client.request('RespondToAuthChallenge',\n jsonReqResp, (errAuthenticate, dataAuthenticate) => {\n if (errAuthenticate) {\n return callback.onFailure(errAuthenticate);\n }\n\n this.signInUserSession = this.getCognitoUserSession(\n dataAuthenticate.AuthenticationResult\n );\n this.cacheTokens();\n\n return callback.onSuccess(this.signInUserSession);\n });\n return undefined;\n // getPasswordAuthenticationKey callback end\n });\n return undefined;\n });\n // getLargeAValue callback end\n });\n }\n\n /**\n * This is used for a certain user to confirm the registration by using a confirmation code\n * @param {string} confirmationCode Code entered by user.\n * @param {bool} forceAliasCreation Allow migrating from an existing email / phone number.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n confirmRegistration(confirmationCode, forceAliasCreation, callback) {\n const jsonReq = {\n ClientId: this.pool.getClientId(),\n ConfirmationCode: confirmationCode,\n Username: this.username,\n ForceAliasCreation: forceAliasCreation,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('ConfirmSignUp', jsonReq, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n }\n\n /**\n * This is used by the user once he has the responses to a custom challenge\n * @param {string} answerChallenge The custom challange answer.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {customChallenge} callback.customChallenge\n * Custom challenge response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n sendCustomChallengeAnswer(answerChallenge, callback) {\n const challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n challengeResponses.ANSWER = answerChallenge;\n\n const authenticationHelper = new AuthenticationHelper(\n this.pool.getUserPoolId().split('_')[1]\n );\n this.getCachedDeviceKeyAndPassword();\n if (this.deviceKey != null) {\n challengeResponses.DEVICE_KEY = this.deviceKey;\n }\n\n const jsonReq = {\n ChallengeName: 'CUSTOM_CHALLENGE',\n ChallengeResponses: challengeResponses,\n ClientId: this.pool.getClientId(),\n Session: this.Session,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('RespondToAuthChallenge', jsonReq, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n\n return this.authenticateUserInternal(data, authenticationHelper, callback);\n });\n }\n\n /**\n * This is used by the user once he has an MFA code\n * @param {string} confirmationCode The MFA code entered by the user.\n * @param {object} callback Result callback map.\n * @param {string} mfaType The mfa we are replying to.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */\n sendMFACode(confirmationCode, callback, mfaType) {\n const challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n challengeResponses.SMS_MFA_CODE = confirmationCode;\n const mfaTypeSelection = mfaType || 'SMS_MFA';\n if (mfaTypeSelection === 'SOFTWARE_TOKEN_MFA') {\n challengeResponses.SOFTWARE_TOKEN_MFA_CODE = confirmationCode;\n }\n\n if (this.deviceKey != null) {\n challengeResponses.DEVICE_KEY = this.deviceKey;\n }\n\n const jsonReq = {\n ChallengeName: mfaTypeSelection,\n ChallengeResponses: challengeResponses,\n ClientId: this.pool.getClientId(),\n Session: this.Session,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n\n this.client.request('RespondToAuthChallenge',\n jsonReq, (err, dataAuthenticate) => {\n if (err) {\n return callback.onFailure(err);\n }\n\n const challengeName = dataAuthenticate.ChallengeName;\n\n if (challengeName === 'DEVICE_SRP_AUTH') {\n this.getDeviceResponse(callback);\n return undefined;\n }\n\n this.signInUserSession =\n this.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n this.cacheTokens();\n\n if (dataAuthenticate.AuthenticationResult.NewDeviceMetadata == null) {\n return callback.onSuccess(this.signInUserSession);\n }\n\n const authenticationHelper = new AuthenticationHelper(\n this.pool.getUserPoolId().split('_')[1]);\n authenticationHelper.generateHashDevice(\n dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,\n dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey,\n (errGenHash) => {\n if (errGenHash) {\n return callback.onFailure(errGenHash);\n }\n\n const deviceSecretVerifierConfig = {\n Salt: Buffer.from(\n authenticationHelper.getSaltDevices(), 'hex'\n ).toString('base64'),\n PasswordVerifier: Buffer.from(\n authenticationHelper.getVerifierDevices(), 'hex'\n ).toString('base64'),\n };\n\n this.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier;\n this.deviceGroupKey = dataAuthenticate.AuthenticationResult\n .NewDeviceMetadata.DeviceGroupKey;\n this.randomPassword = authenticationHelper.getRandomPassword();\n\n this.client.request('ConfirmDevice', {\n DeviceKey: dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceSecretVerifierConfig: deviceSecretVerifierConfig,\n DeviceName: navigator.userAgent,\n }, (errConfirm, dataConfirm) => {\n if (errConfirm) {\n return callback.onFailure(errConfirm);\n }\n\n this.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey;\n this.cacheDeviceKeyAndPassword();\n if (dataConfirm.UserConfirmationNecessary === true) {\n return callback.onSuccess(\n this.signInUserSession,\n dataConfirm.UserConfirmationNecessary);\n }\n return callback.onSuccess(this.signInUserSession);\n });\n return undefined;\n });\n return undefined;\n });\n }\n\n /**\n * This is used by an authenticated user to change the current password\n * @param {string} oldUserPassword The current password.\n * @param {string} newUserPassword The requested new password.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n changePassword(oldUserPassword, newUserPassword, callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('ChangePassword', {\n PreviousPassword: oldUserPassword,\n ProposedPassword: newUserPassword,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to enable MFA for himself\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n enableMFA(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n const mfaOptions = [];\n const mfaEnabled = {\n DeliveryMedium: 'SMS',\n AttributeName: 'phone_number',\n };\n mfaOptions.push(mfaEnabled);\n\n this.client.request('SetUserSettings', {\n MFAOptions: mfaOptions,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to enable MFA for himself\n * @param {string[]} smsMfaSettings the sms mfa settings\n * @param {string[]} softwareTokenMfaSettings the software token mfa settings\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n setUserMfaPreference(smsMfaSettings, softwareTokenMfaSettings, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('SetUserMFAPreference', {\n SMSMfaSettings: smsMfaSettings,\n SoftwareTokenMfaSettings: softwareTokenMfaSettings,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to disable MFA for himself\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n disableMFA(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n const mfaOptions = [];\n\n this.client.request('SetUserSettings', {\n MFAOptions: mfaOptions,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n\n /**\n * This is used by an authenticated user to delete himself\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n deleteUser(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('DeleteUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback(err, null);\n }\n this.clearCachedTokens();\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * @typedef {CognitoUserAttribute | { Name:string, Value:string }} AttributeArg\n */\n /**\n * This is used by an authenticated user to change a list of attributes\n * @param {AttributeArg[]} attributes A list of the new user attributes.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n updateAttributes(attributes, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('UpdateUserAttributes', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n UserAttributes: attributes,\n }, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to get a list of attributes\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n getUserAttributes(callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('GetUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, (err, userData) => {\n if (err) {\n return callback(err, null);\n }\n\n const attributeList = [];\n\n for (let i = 0; i < userData.UserAttributes.length; i++) {\n const attribute = {\n Name: userData.UserAttributes[i].Name,\n Value: userData.UserAttributes[i].Value,\n };\n const userAttribute = new CognitoUserAttribute(attribute);\n attributeList.push(userAttribute);\n }\n\n return callback(null, attributeList);\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to get the MFAOptions\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n getMFAOptions(callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('GetUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, (err, userData) => {\n if (err) {\n return callback(err, null);\n }\n\n return callback(null, userData.MFAOptions);\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to delete a list of attributes\n * @param {string[]} attributeList Names of the attributes to delete.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n deleteAttributes(attributeList, callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n\n this.client.request('DeleteUserAttributes', {\n UserAttributeNames: attributeList,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by a user to resend a confirmation code\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n resendConfirmationCode(callback) {\n const jsonReq = {\n ClientId: this.pool.getClientId(),\n Username: this.username,\n };\n\n this.client.request('ResendConfirmationCode', jsonReq, (err, result) => {\n if (err) {\n return callback(err, null);\n }\n return callback(null, result);\n });\n }\n\n /**\n * This is used to get a session, either from the session object\n * or from the local storage, or by using a refresh token\n *\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n getSession(callback) {\n if (this.username == null) {\n return callback(new Error('Username is null. Cannot retrieve a new session'), null);\n }\n\n if (this.signInUserSession != null && this.signInUserSession.isValid()) {\n return callback(null, this.signInUserSession);\n }\n\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}.${this.username}`;\n const idTokenKey = `${keyPrefix}.idToken`;\n const accessTokenKey = `${keyPrefix}.accessToken`;\n const refreshTokenKey = `${keyPrefix}.refreshToken`;\n const clockDriftKey = `${keyPrefix}.clockDrift`;\n\n if (this.storage.getItem(idTokenKey)) {\n const idToken = new CognitoIdToken({\n IdToken: this.storage.getItem(idTokenKey),\n });\n const accessToken = new CognitoAccessToken({\n AccessToken: this.storage.getItem(accessTokenKey),\n });\n const refreshToken = new CognitoRefreshToken({\n RefreshToken: this.storage.getItem(refreshTokenKey),\n });\n const clockDrift = parseInt(this.storage.getItem(clockDriftKey), 0) || 0;\n\n const sessionData = {\n IdToken: idToken,\n AccessToken: accessToken,\n RefreshToken: refreshToken,\n ClockDrift: clockDrift,\n };\n const cachedSession = new CognitoUserSession(sessionData);\n if (cachedSession.isValid()) {\n this.signInUserSession = cachedSession;\n return callback(null, this.signInUserSession);\n }\n\n if (refreshToken.getToken() == null) {\n return callback(new Error('Cannot retrieve a new session. Please authenticate.'), null);\n }\n\n this.refreshSession(refreshToken, callback);\n } else {\n callback(new Error('Local storage is missing an ID Token, Please authenticate'), null);\n }\n\n return undefined;\n }\n\n\n /**\n * This uses the refreshToken to retrieve a new session\n * @param {CognitoRefreshToken} refreshToken A previous session's refresh token.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n refreshSession(refreshToken, callback) {\n const authParameters = {};\n authParameters.REFRESH_TOKEN = refreshToken.getToken();\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}`;\n const lastUserKey = `${keyPrefix}.LastAuthUser`;\n\n if (this.storage.getItem(lastUserKey)) {\n this.username = this.storage.getItem(lastUserKey);\n const deviceKeyKey = `${keyPrefix}.${this.username}.deviceKey`;\n this.deviceKey = this.storage.getItem(deviceKeyKey);\n authParameters.DEVICE_KEY = this.deviceKey;\n }\n\n const jsonReq = {\n ClientId: this.pool.getClientId(),\n AuthFlow: 'REFRESH_TOKEN_AUTH',\n AuthParameters: authParameters,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('InitiateAuth', jsonReq, (err, authResult) => {\n if (err) {\n if (err.code === 'NotAuthorizedException') {\n this.clearCachedTokens();\n }\n return callback(err, null);\n }\n if (authResult) {\n const authenticationResult = authResult.AuthenticationResult;\n if (!Object.prototype.hasOwnProperty.call(authenticationResult, 'RefreshToken')) {\n authenticationResult.RefreshToken = refreshToken.getToken();\n }\n this.signInUserSession = this.getCognitoUserSession(authenticationResult);\n this.cacheTokens();\n return callback(null, this.signInUserSession);\n }\n return undefined;\n });\n }\n\n /**\n * This is used to save the session tokens to local storage\n * @returns {void}\n */\n cacheTokens() {\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}`;\n const idTokenKey = `${keyPrefix}.${this.username}.idToken`;\n const accessTokenKey = `${keyPrefix}.${this.username}.accessToken`;\n const refreshTokenKey = `${keyPrefix}.${this.username}.refreshToken`;\n const clockDriftKey = `${keyPrefix}.${this.username}.clockDrift`;\n const lastUserKey = `${keyPrefix}.LastAuthUser`;\n\n this.storage.setItem(idTokenKey, this.signInUserSession.getIdToken().getJwtToken());\n this.storage.setItem(accessTokenKey, this.signInUserSession.getAccessToken().getJwtToken());\n this.storage.setItem(refreshTokenKey, this.signInUserSession.getRefreshToken().getToken());\n this.storage.setItem(clockDriftKey, `${this.signInUserSession.getClockDrift()}`);\n this.storage.setItem(lastUserKey, this.username);\n }\n\n /**\n * This is used to cache the device key and device group and device password\n * @returns {void}\n */\n cacheDeviceKeyAndPassword() {\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}.${this.username}`;\n const deviceKeyKey = `${keyPrefix}.deviceKey`;\n const randomPasswordKey = `${keyPrefix}.randomPasswordKey`;\n const deviceGroupKeyKey = `${keyPrefix}.deviceGroupKey`;\n\n this.storage.setItem(deviceKeyKey, this.deviceKey);\n this.storage.setItem(randomPasswordKey, this.randomPassword);\n this.storage.setItem(deviceGroupKeyKey, this.deviceGroupKey);\n }\n\n /**\n * This is used to get current device key and device group and device password\n * @returns {void}\n */\n getCachedDeviceKeyAndPassword() {\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}.${this.username}`;\n const deviceKeyKey = `${keyPrefix}.deviceKey`;\n const randomPasswordKey = `${keyPrefix}.randomPasswordKey`;\n const deviceGroupKeyKey = `${keyPrefix}.deviceGroupKey`;\n\n if (this.storage.getItem(deviceKeyKey)) {\n this.deviceKey = this.storage.getItem(deviceKeyKey);\n this.randomPassword = this.storage.getItem(randomPasswordKey);\n this.deviceGroupKey = this.storage.getItem(deviceGroupKeyKey);\n }\n }\n\n /**\n * This is used to clear the device key info from local storage\n * @returns {void}\n */\n clearCachedDeviceKeyAndPassword() {\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}.${this.username}`;\n const deviceKeyKey = `${keyPrefix}.deviceKey`;\n const randomPasswordKey = `${keyPrefix}.randomPasswordKey`;\n const deviceGroupKeyKey = `${keyPrefix}.deviceGroupKey`;\n\n this.storage.removeItem(deviceKeyKey);\n this.storage.removeItem(randomPasswordKey);\n this.storage.removeItem(deviceGroupKeyKey);\n }\n\n /**\n * This is used to clear the session tokens from local storage\n * @returns {void}\n */\n clearCachedTokens() {\n const keyPrefix = `CognitoIdentityServiceProvider.${this.pool.getClientId()}`;\n const idTokenKey = `${keyPrefix}.${this.username}.idToken`;\n const accessTokenKey = `${keyPrefix}.${this.username}.accessToken`;\n const refreshTokenKey = `${keyPrefix}.${this.username}.refreshToken`;\n const lastUserKey = `${keyPrefix}.LastAuthUser`;\n\n this.storage.removeItem(idTokenKey);\n this.storage.removeItem(accessTokenKey);\n this.storage.removeItem(refreshTokenKey);\n this.storage.removeItem(lastUserKey);\n }\n\n /**\n * This is used to build a user session from tokens retrieved in the authentication result\n * @param {object} authResult Successful auth response from server.\n * @returns {CognitoUserSession} The new user session.\n * @private\n */\n getCognitoUserSession(authResult) {\n const idToken = new CognitoIdToken(authResult);\n const accessToken = new CognitoAccessToken(authResult);\n const refreshToken = new CognitoRefreshToken(authResult);\n\n const sessionData = {\n IdToken: idToken,\n AccessToken: accessToken,\n RefreshToken: refreshToken,\n };\n\n return new CognitoUserSession(sessionData);\n }\n\n /**\n * This is used to initiate a forgot password request\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {inputVerificationCode?} callback.inputVerificationCode\n * Optional callback raised instead of onSuccess with response data.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n forgotPassword(callback) {\n const jsonReq = {\n ClientId: this.pool.getClientId(),\n Username: this.username,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('ForgotPassword', jsonReq, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n if (typeof callback.inputVerificationCode === 'function') {\n return callback.inputVerificationCode(data);\n }\n return callback.onSuccess(data);\n });\n }\n\n /**\n * This is used to confirm a new password using a confirmationCode\n * @param {string} confirmationCode Code entered by user.\n * @param {string} newPassword Confirm new password.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n confirmPassword(confirmationCode, newPassword, callback) {\n const jsonReq = {\n ClientId: this.pool.getClientId(),\n Username: this.username,\n ConfirmationCode: confirmationCode,\n Password: newPassword,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('ConfirmForgotPassword', jsonReq, err => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess();\n });\n }\n\n /**\n * This is used to initiate an attribute confirmation request\n * @param {string} attributeName User attribute that needs confirmation.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {inputVerificationCode} callback.inputVerificationCode Called on success.\n * @returns {void}\n */\n getAttributeVerificationCode(attributeName, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('GetUserAttributeVerificationCode', {\n AttributeName: attributeName,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n if (typeof callback.inputVerificationCode === 'function') {\n return callback.inputVerificationCode(data);\n }\n return callback.onSuccess();\n });\n return undefined;\n }\n\n /**\n * This is used to confirm an attribute using a confirmation code\n * @param {string} attributeName Attribute being confirmed.\n * @param {string} confirmationCode Code entered by user.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n verifyAttribute(attributeName, confirmationCode, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('VerifyUserAttribute', {\n AttributeName: attributeName,\n Code: confirmationCode,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used to get the device information using the current device key\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess<*>} callback.onSuccess Called on success with device data.\n * @returns {void}\n */\n getDevice(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('GetDevice', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: this.deviceKey,\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess(data);\n });\n return undefined;\n }\n\n /**\n * This is used to forget a specific device\n * @param {string} deviceKey Device key.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n forgetSpecificDevice(deviceKey, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('ForgetDevice', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: deviceKey,\n }, err => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used to forget the current device\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n forgetDevice(callback) {\n this.forgetSpecificDevice(this.deviceKey, {\n onFailure: callback.onFailure,\n onSuccess: result => {\n this.deviceKey = null;\n this.deviceGroupKey = null;\n this.randomPassword = null;\n this.clearCachedDeviceKeyAndPassword();\n return callback.onSuccess(result);\n },\n });\n }\n\n /**\n * This is used to set the device status as remembered\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n setDeviceStatusRemembered(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('UpdateDeviceStatus', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: this.deviceKey,\n DeviceRememberedStatus: 'remembered',\n }, err => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used to set the device status as not remembered\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n setDeviceStatusNotRemembered(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('UpdateDeviceStatus', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: this.deviceKey,\n DeviceRememberedStatus: 'not_remembered',\n }, err => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used to list all devices for a user\n *\n * @param {int} limit the number of devices returned in a call\n * @param {string} paginationToken the pagination token in case any was returned before\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess<*>} callback.onSuccess Called on success with device list.\n * @returns {void}\n */\n listDevices(limit, paginationToken, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('ListDevices', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n Limit: limit,\n PaginationToken: paginationToken,\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess(data);\n });\n return undefined;\n }\n\n /**\n * This is used to globally revoke all tokens issued to a user\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */\n globalSignOut(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n\n this.client.request('GlobalSignOut', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, err => {\n if (err) {\n return callback.onFailure(err);\n }\n this.clearCachedTokens();\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used for the user to signOut of the application and clear the cached tokens.\n * @returns {void}\n */\n signOut() {\n this.signInUserSession = null;\n this.clearCachedTokens();\n }\n\n /**\n * This is used by a user trying to select a given MFA\n * @param {string} answerChallenge the mfa the user wants\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n sendMFASelectionAnswer(answerChallenge, callback) {\n const challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n challengeResponses.ANSWER = answerChallenge;\n\n const jsonReq = {\n ChallengeName: 'SELECT_MFA_TYPE',\n ChallengeResponses: challengeResponses,\n ClientId: this.pool.getClientId(),\n Session: this.Session,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('RespondToAuthChallenge', jsonReq, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n this.Session = data.Session;\n if (answerChallenge === 'SMS_MFA') {\n return callback.mfaRequired(data.challengeName, data.challengeParameters);\n }\n if (answerChallenge === 'SOFTWARE_TOKEN_MFA') {\n return callback.totpRequired(data.challengeName, data.challengeParameters);\n }\n return undefined;\n });\n }\n\n /**\n * This returns the user context data for advanced security feature.\n * @returns {void}\n */\n getUserContextData() {\n const pool = this.pool;\n return pool.getUserContextData(this.username);\n }\n\n /**\n * This is used by an authenticated or a user trying to authenticate to associate a TOTP MFA\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n associateSoftwareToken(callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n this.client.request('AssociateSoftwareToken', {\n Session: this.Session,\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n this.Session = data.Session;\n return callback.associateSecretCode(data.SecretCode);\n });\n } else {\n this.client.request('AssociateSoftwareToken', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.associateSecretCode(data.SecretCode);\n });\n }\n }\n\n /**\n * This is used by an authenticated or a user trying to authenticate to verify a TOTP MFA\n * @param {string} totpCode The MFA code entered by the user.\n * @param {string} friendlyDeviceName The device name we are assigning to the device.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */\n verifySoftwareToken(totpCode, friendlyDeviceName, callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n this.client.request('VerifySoftwareToken', {\n Session: this.Session,\n UserCode: totpCode,\n FriendlyDeviceName: friendlyDeviceName,\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n this.Session = data.Session;\n const challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n const jsonReq = {\n ChallengeName: 'MFA_SETUP',\n ClientId: this.pool.getClientId(),\n ChallengeResponses: challengeResponses,\n Session: this.Session,\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('RespondToAuthChallenge',\n jsonReq, (errRespond, dataRespond) => {\n if (errRespond) {\n return callback.onFailure(errRespond);\n }\n this.signInUserSession = this.getCognitoUserSession(dataRespond.AuthenticationResult);\n this.cacheTokens();\n return callback.onSuccess(this.signInUserSession);\n });\n return undefined;\n });\n } else {\n this.client.request('VerifySoftwareToken', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n UserCode: totpCode,\n FriendlyDeviceName: friendlyDeviceName,\n }, (err, data) => {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess(data);\n });\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoUser.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nexport default class CognitoUserAttribute {\n /**\n * Constructs a new CognitoUserAttribute object\n * @param {string=} Name The record's name\n * @param {string=} Value The record's value\n */\n constructor({ Name, Value } = {}) {\n this.Name = Name || '';\n this.Value = Value || '';\n }\n\n /**\n * @returns {string} the record's value.\n */\n getValue() {\n return this.Value;\n }\n\n /**\n * Sets the record's value.\n * @param {string} value The new value.\n * @returns {CognitoUserAttribute} The record for method chaining.\n */\n setValue(value) {\n this.Value = value;\n return this;\n }\n\n /**\n * @returns {string} the record's name.\n */\n getName() {\n return this.Name;\n }\n\n /**\n * Sets the record's name\n * @param {string} name The new name.\n * @returns {CognitoUserAttribute} The record for method chaining.\n */\n setName(name) {\n this.Name = name;\n return this;\n }\n\n /**\n * @returns {string} a string representation of the record.\n */\n toString() {\n return JSON.stringify(this);\n }\n\n /**\n * @returns {object} a flat object representing the record.\n */\n toJSON() {\n return {\n Name: this.Name,\n Value: this.Value,\n };\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoUserAttribute.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nexport default class CognitoUserSession {\n /**\n * Constructs a new CognitoUserSession object\n * @param {CognitoIdToken} IdToken The session's Id token.\n * @param {CognitoRefreshToken=} RefreshToken The session's refresh token.\n * @param {CognitoAccessToken} AccessToken The session's access token.\n * @param {int} ClockDrift The saved computer's clock drift or undefined to force calculation.\n */\n constructor({ IdToken, RefreshToken, AccessToken, ClockDrift } = {}) {\n if (AccessToken == null || IdToken == null) {\n throw new Error('Id token and Access Token must be present.');\n }\n\n this.idToken = IdToken;\n this.refreshToken = RefreshToken;\n this.accessToken = AccessToken;\n this.clockDrift = ClockDrift === undefined ? this.calculateClockDrift() : ClockDrift;\n }\n\n /**\n * @returns {CognitoIdToken} the session's Id token\n */\n getIdToken() {\n return this.idToken;\n }\n\n /**\n * @returns {CognitoRefreshToken} the session's refresh token\n */\n getRefreshToken() {\n return this.refreshToken;\n }\n\n /**\n * @returns {CognitoAccessToken} the session's access token\n */\n getAccessToken() {\n return this.accessToken;\n }\n\n /**\n * @returns {int} the session's clock drift\n */\n getClockDrift() {\n return this.clockDrift;\n }\n\n /**\n * @returns {int} the computer's clock drift\n */\n calculateClockDrift() {\n const now = Math.floor(new Date() / 1000);\n const iat = Math.min(this.accessToken.getIssuedAt(), this.idToken.getIssuedAt());\n\n return now - iat;\n }\n\n /**\n * Checks to see if the session is still valid based on session expiry information found\n * in tokens and the current time (adjusted with clock drift)\n * @returns {boolean} if the session is still valid\n */\n isValid() {\n const now = Math.floor(new Date() / 1000);\n const adjusted = now - this.clockDrift;\n\n return adjusted < this.accessToken.getExpiration() && adjusted < this.idToken.getExpiration();\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoUserSession.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst monthNames =\n ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\nconst weekNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n\n/** @class */\nexport default class DateHelper {\n /**\n * @returns {string} The current time in \"ddd MMM D HH:mm:ss UTC YYYY\" format.\n */\n getNowString() {\n const now = new Date();\n\n const weekDay = weekNames[now.getUTCDay()];\n const month = monthNames[now.getUTCMonth()];\n const day = now.getUTCDate();\n\n let hours = now.getUTCHours();\n if (hours < 10) {\n hours = `0${hours}`;\n }\n\n let minutes = now.getUTCMinutes();\n if (minutes < 10) {\n minutes = `0${minutes}`;\n }\n\n let seconds = now.getUTCSeconds();\n if (seconds < 10) {\n seconds = `0${seconds}`;\n }\n\n const year = now.getUTCFullYear();\n\n // ddd MMM D HH:mm:ss UTC YYYY\n const dateNow = `${weekDay} ${month} ${day} ${hours}:${minutes}:${seconds} UTC ${year}`;\n\n return dateNow;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/DateHelper.js","// A small implementation of BigInteger based on http://www-cs-students.stanford.edu/~tjw/jsbn/\n//\n// All public methods have been removed except the following:\n// new BigInteger(a, b) (only radix 2, 4, 8, 16 and 32 supported)\n// toString (only radix 2, 4, 8, 16 and 32 supported)\n// negate\n// abs\n// compareTo\n// bitLength\n// mod\n// equals\n// add\n// subtract\n// multiply\n// divide\n// modPow\n\nexport default BigInteger;\n\n/*\n * Copyright (c) 2003-2005 Tom Wu\n * All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n *\n * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,\n * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER\n * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF\n * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT\n * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * In addition, the following condition applies:\n *\n * All redistributions must retain an intact copy of this copyright notice\n * and disclaimer.\n */\n\n// (public) Constructor\nfunction BigInteger(a, b) {\n if (a != null) this.fromString(a, b);\n}\n\n// return new, unset BigInteger\nfunction nbi() {\n return new BigInteger(null);\n}\n\n// Bits per digit\nvar dbits;\n\n// JavaScript engine analysis\nvar canary = 0xdeadbeefcafe;\nvar j_lm = ((canary&0xffffff)==0xefcafe);\n\n// am: Compute w_j += (x*this_i), propagate carries,\n// c is initial carry, returns final carry.\n// c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n// We need to select the fastest one that works in this environment.\n\n// am1: use a single mult and divide to get the high bits,\n// max digit bits should be 26 because\n// max internal value = 2*dvalue^2-2*dvalue (< 2^53)\nfunction am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this[i++]+w[j]+c;\n c = Math.floor(v/0x4000000);\n w[j++] = v&0x3ffffff;\n }\n return c;\n}\n// am2 avoids a big mult-and-extract completely.\n// Max digit bits should be <= 30 because we do bitwise ops\n// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\nfunction am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n}\n// Alternately, set max digit bits to 28 since some\n// browsers slow down when dealing with 32-bit numbers.\nfunction am3(i,x,w,j,c,n) {\n var xl = x&0x3fff, xh = x>>14;\n while(--n >= 0) {\n var l = this[i]&0x3fff;\n var h = this[i++]>>14;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x3fff)<<14)+w[j]+c;\n c = (l>>28)+(m>>14)+xh*h;\n w[j++] = l&0xfffffff;\n }\n return c;\n}\nvar inBrowser = typeof navigator !== \"undefined\";\nif(inBrowser && j_lm && (navigator.appName == \"Microsoft Internet Explorer\")) {\n BigInteger.prototype.am = am2;\n dbits = 30;\n}\nelse if(inBrowser && j_lm && (navigator.appName != \"Netscape\")) {\n BigInteger.prototype.am = am1;\n dbits = 26;\n}\nelse { // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n}\n\nBigInteger.prototype.DB = dbits;\nBigInteger.prototype.DM = (1 << dbits) - 1;\nBigInteger.prototype.DV = 1 << dbits;\n\nvar BI_FP = 52;\nBigInteger.prototype.FV = Math.pow(2, BI_FP);\nBigInteger.prototype.F1 = BI_FP - dbits;\nBigInteger.prototype.F2 = 2 * dbits - BI_FP;\n\n// Digit conversions\nvar BI_RM = \"0123456789abcdefghijklmnopqrstuvwxyz\";\nvar BI_RC = new Array();\nvar rr, vv;\nrr = \"0\".charCodeAt(0);\nfor (vv = 0; vv <= 9; ++vv)\n BI_RC[rr++] = vv;\nrr = \"a\".charCodeAt(0);\nfor (vv = 10; vv < 36; ++vv)\n BI_RC[rr++] = vv;\nrr = \"A\".charCodeAt(0);\nfor (vv = 10; vv < 36; ++vv)\n BI_RC[rr++] = vv;\n\nfunction int2char(n) {\n return BI_RM.charAt(n);\n}\nfunction intAt(s, i) {\n var c = BI_RC[s.charCodeAt(i)];\n return c == null ? -1 : c;\n}\n\n// (protected) copy this to r\nfunction bnpCopyTo(r) {\n for (var i = this.t - 1; i >= 0; --i)\n r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n}\n\n// (protected) set from integer value x, -DV <= x < DV\nfunction bnpFromInt(x) {\n this.t = 1;\n this.s = x < 0 ? -1 : 0;\n if (x > 0) this[0] = x;\n else if (x < -1) this[0] = x + this.DV;\n else this.t = 0;\n}\n\n// return bigint initialized to value\nfunction nbv(i) {\n var r = nbi();\n\n r.fromInt(i);\n\n return r;\n}\n\n// (protected) set from string and radix\nfunction bnpFromString(s, b) {\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else throw new Error(\"Only radix 2, 4, 8, 16, 32 are supported\");\n this.t = 0;\n this.s = 0;\n var i = s.length, mi = false, sh = 0;\n while (--i >= 0) {\n var x = intAt(s, i);\n if (x < 0) {\n if (s.charAt(i) == \"-\") mi = true;\n continue;\n }\n mi = false;\n if (sh == 0) this[this.t++] = x;\n else if (sh + k > this.DB) {\n this[this.t - 1] |= (x & (1 << this.DB - sh) - 1) << sh;\n this[this.t++] = x >> this.DB - sh;\n } else this[this.t - 1] |= x << sh;\n sh += k;\n if (sh >= this.DB) sh -= this.DB;\n }\n this.clamp();\n if (mi) BigInteger.ZERO.subTo(this, this);\n}\n\n// (protected) clamp off excess high words\nfunction bnpClamp() {\n var c = this.s & this.DM;\n while (this.t > 0 && this[this.t - 1] == c)\n --this.t;\n}\n\n// (public) return string representation in given radix\nfunction bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString();\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else throw new Error(\"Only radix 2, 4, 8, 16, 32 are supported\");\n var km = (1 << k) - 1, d, m = false, r = \"\", i = this.t;\n var p = this.DB - i * this.DB % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & (1 << p) - 1) << k - p;\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = this[i] >> (p -= k) & km;\n if (p <= 0) {\n p += this.DB;\n --i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n}\n\n// (public) -this\nfunction bnNegate() {\n var r = nbi();\n\n BigInteger.ZERO.subTo(this, r);\n\n return r;\n}\n\n// (public) |this|\nfunction bnAbs() {\n return this.s < 0 ? this.negate() : this;\n}\n\n// (public) return + if this > a, - if this < a, 0 if equal\nfunction bnCompareTo(a) {\n var r = this.s - a.s;\n if (r != 0) return r;\n var i = this.t;\n r = i - a.t;\n if (r != 0) return this.s < 0 ? -r : r;\n while (--i >= 0)\n if ((r = this[i] - a[i]) != 0) return r;\n return 0;\n}\n\n// returns bit length of the integer x\nfunction nbits(x) {\n var r = 1, t;\n if ((t = x >>> 16) != 0) {\n x = t;\n r += 16;\n }\n if ((t = x >> 8) != 0) {\n x = t;\n r += 8;\n }\n if ((t = x >> 4) != 0) {\n x = t;\n r += 4;\n }\n if ((t = x >> 2) != 0) {\n x = t;\n r += 2;\n }\n if ((t = x >> 1) != 0) {\n x = t;\n r += 1;\n }\n return r;\n}\n\n// (public) return the number of bits in \"this\"\nfunction bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n}\n\n// (protected) r = this << n*DB\nfunction bnpDLShiftTo(n, r) {\n var i;\n for (i = this.t - 1; i >= 0; --i)\n r[i + n] = this[i];\n for (i = n - 1; i >= 0; --i)\n r[i] = 0;\n r.t = this.t + n;\n r.s = this.s;\n}\n\n// (protected) r = this >> n*DB\nfunction bnpDRShiftTo(n, r) {\n for (var i = n; i < this.t; ++i)\n r[i - n] = this[i];\n r.t = Math.max(this.t - n, 0);\n r.s = this.s;\n}\n\n// (protected) r = this << n\nfunction bnpLShiftTo(n, r) {\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << cbs) - 1;\n var ds = Math.floor(n / this.DB), c = this.s << bs & this.DM, i;\n for (i = this.t - 1; i >= 0; --i) {\n r[i + ds + 1] = this[i] >> cbs | c;\n c = (this[i] & bm) << bs;\n }\n for (i = ds - 1; i >= 0; --i)\n r[i] = 0;\n r[ds] = c;\n r.t = this.t + ds + 1;\n r.s = this.s;\n r.clamp();\n}\n\n// (protected) r = this >> n\nfunction bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n}\n\n// (protected) r = this - a\nfunction bnpSubTo(a, r) {\n var i = 0, c = 0, m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] - a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c -= a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c -= a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c -= a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c < -1) r[i++] = this.DV + c;\n else if (c > 0) r[i++] = c;\n r.t = i;\n r.clamp();\n}\n\n// (protected) r = this * a, r != this,a (HAC 14.12)\n// \"this\" should be the larger one if appropriate.\nfunction bnpMultiplyTo(a, r) {\n var x = this.abs(), y = a.abs();\n var i = x.t;\n r.t = i + y.t;\n while (--i >= 0)\n r[i] = 0;\n for (i = 0; i < y.t; ++i)\n r[i + x.t] = x.am(0, y[i], r, i, 0, x.t);\n r.s = 0;\n r.clamp();\n if (this.s != a.s) BigInteger.ZERO.subTo(r, r);\n}\n\n// (protected) r = this^2, r != this (HAC 14.16)\nfunction bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2 * x.t;\n while (--i >= 0)\n r[i] = 0;\n for (i = 0; i < x.t - 1; ++i) {\n var c = x.am(i, x[i], r, 2 * i, 0, 1);\n if (\n (r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >=\n x.DV\n ) {\n r[i + x.t] -= x.DV;\n r[i + x.t + 1] = 1;\n }\n }\n if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1);\n r.s = 0;\n r.clamp();\n}\n\n// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n// r != q, this != m. q or r may be null.\nfunction bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]);\n // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;\n var i = r.t, j = i - ys, t = q == null ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y);\n // \"negative\" y so we can replace sub with am later\n while (y.t < ys)\n y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = r[--i] == y0\n ? this.DM\n : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r);\n // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n}\n\n// (public) this mod a\nfunction bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a, null, r);\n if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r);\n return r;\n}\n\n// (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n// justification:\n// xy == 1 (mod m)\n// xy = 1+km\n// xy(2-xy) = (1+km)(1-km)\n// x[y(2-xy)] = 1-k^2m^2\n// x[y(2-xy)] == 1 (mod m^2)\n// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n// JS multiply \"overflows\" differently from C/C++, so care is needed here.\nfunction bnpInvDigit() {\n if (this.t < 1) return 0;\n var x = this[0];\n if ((x & 1) == 0) return 0;\n var y = x & 3;\n // y == 1/x mod 2^2\n y = y * (2 - (x & 0xf) * y) & 0xf;\n // y == 1/x mod 2^4\n y = y * (2 - (x & 0xff) * y) & 0xff;\n // y == 1/x mod 2^8\n y = y * (2 - ((x & 0xffff) * y & 0xffff)) & 0xffff;\n // y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n y = y * (2 - x * y % this.DV) % this.DV;\n // y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n return y > 0 ? this.DV - y : -y;\n}\n\nfunction bnEquals(a) {\n return this.compareTo(a) == 0;\n}\n\n// (protected) r = this + a\nfunction bnpAddTo(a, r) {\n var i = 0, c = 0, m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c > 0) r[i++] = c;\n else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n}\n\n// (public) this + a\nfunction bnAdd(a) {\n var r = nbi();\n\n this.addTo(a, r);\n\n return r;\n}\n\n// (public) this - a\nfunction bnSubtract(a) {\n var r = nbi();\n\n this.subTo(a, r);\n\n return r;\n}\n\n// (public) this * a\nfunction bnMultiply(a) {\n var r = nbi();\n\n this.multiplyTo(a, r);\n\n return r;\n}\n\n// (public) this / a\nfunction bnDivide(a) {\n var r = nbi();\n\n this.divRemTo(a, r, null);\n\n return r;\n}\n\n// Montgomery reduction\nfunction Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp & 0x7fff;\n this.mph = this.mp >> 15;\n this.um = (1 << m.DB - 15) - 1;\n this.mt2 = 2 * m.t;\n}\n\n// xR mod m\nfunction montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t, r);\n r.divRemTo(this.m, null, r);\n if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r);\n return r;\n}\n\n// x/R mod m\nfunction montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n}\n\n// x = x/R mod m (HAC 14.32)\nfunction montReduce(x) {\n while (x.t <= this.mt2)\n // pad x so am has enough room later\n x[x.t++] = 0;\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = j * this.mpl +\n ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) &\n x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n}\n\n// r = \"x^2/R mod m\"; x != r\nfunction montSqrTo(x, r) {\n x.squareTo(r);\n\n this.reduce(r);\n}\n\n// r = \"xy/R mod m\"; x,y != r\nfunction montMulTo(x, y, r) {\n x.multiplyTo(y, r);\n\n this.reduce(r);\n}\n\nMontgomery.prototype.convert = montConvert;\nMontgomery.prototype.revert = montRevert;\nMontgomery.prototype.reduce = montReduce;\nMontgomery.prototype.mulTo = montMulTo;\nMontgomery.prototype.sqrTo = montSqrTo;\n\n// (public) this^e % m (HAC 14.85)\nfunction bnModPow(e, m, callback) {\n var i = e.bitLength(), k, r = nbv(1), z = new Montgomery(m);\n if (i <= 0) return r;\n else if (i < 18) k = 1;\n else if (i < 48) k = 3;\n else if (i < 144) k = 4;\n else if (i < 768) k = 5;\n else k = 6;\n\n // precomputation\n var g = new Array(), n = 3, k1 = k - 1, km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;\n else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);\n else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n var result = z.revert(r);\n callback(null, result);\n return result;\n}\n\n// protected\nBigInteger.prototype.copyTo = bnpCopyTo;\nBigInteger.prototype.fromInt = bnpFromInt;\nBigInteger.prototype.fromString = bnpFromString;\nBigInteger.prototype.clamp = bnpClamp;\nBigInteger.prototype.dlShiftTo = bnpDLShiftTo;\nBigInteger.prototype.drShiftTo = bnpDRShiftTo;\nBigInteger.prototype.lShiftTo = bnpLShiftTo;\nBigInteger.prototype.rShiftTo = bnpRShiftTo;\nBigInteger.prototype.subTo = bnpSubTo;\nBigInteger.prototype.multiplyTo = bnpMultiplyTo;\nBigInteger.prototype.squareTo = bnpSquareTo;\nBigInteger.prototype.divRemTo = bnpDivRemTo;\nBigInteger.prototype.invDigit = bnpInvDigit;\nBigInteger.prototype.addTo = bnpAddTo;\n\n// public\nBigInteger.prototype.toString = bnToString;\nBigInteger.prototype.negate = bnNegate;\nBigInteger.prototype.abs = bnAbs;\nBigInteger.prototype.compareTo = bnCompareTo;\nBigInteger.prototype.bitLength = bnBitLength;\nBigInteger.prototype.mod = bnMod;\nBigInteger.prototype.equals = bnEquals;\nBigInteger.prototype.add = bnAdd;\nBigInteger.prototype.subtract = bnSubtract;\nBigInteger.prototype.multiply = bnMultiply;\nBigInteger.prototype.divide = bnDivide;\nBigInteger.prototype.modPow = bnModPow;\n\n// \"constants\"\nBigInteger.ZERO = nbv(0);\nBigInteger.ONE = nbv(1);\n\n\n\n\n// WEBPACK FOOTER //\n// ./src/BigInteger.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Buffer } from 'buffer/';\n\n/** @class */\nexport default class CognitoJwtToken {\n /**\n * Constructs a new CognitoJwtToken object\n * @param {string=} token The JWT token.\n */\n constructor(token) {\n // Assign object\n this.jwtToken = token || '';\n this.payload = this.decodePayload();\n }\n\n /**\n * @returns {string} the record's token.\n */\n getJwtToken() {\n return this.jwtToken;\n }\n\n /**\n * @returns {int} the token's expiration (exp member).\n */\n getExpiration() {\n return this.payload.exp;\n }\n\n /**\n * @returns {int} the token's \"issued at\" (iat member).\n */\n getIssuedAt() {\n return this.payload.iat;\n }\n\n /**\n * @returns {object} the token's payload.\n */\n decodePayload() {\n const payload = this.jwtToken.split('.')[1];\n try {\n return JSON.parse(Buffer.from(payload, 'base64').toString('utf8'));\n } catch (err) {\n return {};\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoJwtToken.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nlet dataMemory = {};\n\n/** @class */\nclass MemoryStorage {\n\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n static setItem(key, value) {\n dataMemory[key] = value;\n return dataMemory[key];\n }\n\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */\n static getItem(key) {\n return Object.prototype.hasOwnProperty.call(dataMemory, key) ? dataMemory[key] : undefined;\n }\n\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {string} value - value that was deleted\n */\n static removeItem(key) {\n return delete dataMemory[key];\n }\n\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */\n static clear() {\n dataMemory = {};\n return dataMemory;\n }\n}\n\n/** @class */\nexport default class StorageHelper {\n\n /**\n * This is used to get a storage object\n * @returns {object} the storage\n */\n constructor() {\n try {\n this.storageWindow = window.localStorage;\n this.storageWindow.setItem('aws.cognito.test-ls', 1);\n this.storageWindow.removeItem('aws.cognito.test-ls');\n } catch (exception) {\n this.storageWindow = MemoryStorage;\n }\n }\n\n /**\n * This is used to return the storage\n * @returns {object} the storage\n */\n getStorage() {\n return this.storageWindow;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/StorageHelper.js","var Buffer = require('buffer').Buffer\nvar sha = require('./sha')\nvar sha256 = require('./sha256')\nvar rng = require('./rng')\nvar md5 = require('./md5')\n\nvar algorithms = {\n sha1: sha,\n sha256: sha256,\n md5: md5\n}\n\nvar blocksize = 64\nvar zeroBuffer = new Buffer(blocksize); zeroBuffer.fill(0)\nfunction hmac(fn, key, data) {\n if(!Buffer.isBuffer(key)) key = new Buffer(key)\n if(!Buffer.isBuffer(data)) data = new Buffer(data)\n\n if(key.length > blocksize) {\n key = fn(key)\n } else if(key.length < blocksize) {\n key = Buffer.concat([key, zeroBuffer], blocksize)\n }\n\n var ipad = new Buffer(blocksize), opad = new Buffer(blocksize)\n for(var i = 0; i < blocksize; i++) {\n ipad[i] = key[i] ^ 0x36\n opad[i] = key[i] ^ 0x5C\n }\n\n var hash = fn(Buffer.concat([ipad, data]))\n return fn(Buffer.concat([opad, hash]))\n}\n\nfunction hash(alg, key) {\n alg = alg || 'sha1'\n var fn = algorithms[alg]\n var bufs = []\n var length = 0\n if(!fn) error('algorithm:', alg, 'is not yet supported')\n return {\n update: function (data) {\n if(!Buffer.isBuffer(data)) data = new Buffer(data)\n \n bufs.push(data)\n length += data.length\n return this\n },\n digest: function (enc) {\n var buf = Buffer.concat(bufs)\n var r = key ? hmac(fn, key, buf) : fn(buf)\n bufs = null\n return enc ? r.toString(enc) : r\n }\n }\n}\n\nfunction error () {\n var m = [].slice.call(arguments).join(' ')\n throw new Error([\n m,\n 'we accept pull requests',\n 'http://github.com/dominictarr/crypto-browserify'\n ].join('\\n'))\n}\n\nexports.createHash = function (alg) { return hash(alg) }\nexports.createHmac = function (alg, key) { return hash(alg, key) }\nexports.randomBytes = function(size, callback) {\n if (callback && callback.call) {\n try {\n callback.call(this, undefined, new Buffer(rng(size)))\n } catch (err) { callback(err) }\n } else {\n return new Buffer(rng(size))\n }\n}\n\nfunction each(a, f) {\n for(var i in a)\n f(a[i], i)\n}\n\n// the least I can do is make error messages for the rest of the node.js/crypto api.\neach(['createCredentials'\n, 'createCipher'\n, 'createCipheriv'\n, 'createDecipher'\n, 'createDecipheriv'\n, 'createSign'\n, 'createVerify'\n, 'createDiffieHellman'\n, 'pbkdf2'], function (name) {\n exports[name] = function () {\n error('sorry,', name, 'is not implemented yet')\n }\n})\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/crypto-browserify/index.js\n// module id = 13\n// module chunks = 0","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @class */\nexport default class AuthenticationDetails {\n /**\n * Constructs a new AuthenticationDetails object\n * @param {object=} data Creation options.\n * @param {string} data.Username User being authenticated.\n * @param {string} data.Password Plain-text password to authenticate with.\n * @param {(AttributeArg[])?} data.ValidationData Application extra metadata.\n * @param {(AttributeArg[])?} data.AuthParamaters Authentication paramaters for custom auth.\n */\n constructor(data) {\n const { ValidationData, Username, Password, AuthParameters } = data || {};\n this.validationData = ValidationData || {};\n this.authParameters = AuthParameters || {};\n this.username = Username;\n this.password = Password;\n }\n\n /**\n * @returns {string} the record's username\n */\n getUsername() {\n return this.username;\n }\n\n /**\n * @returns {string} the record's password\n */\n getPassword() {\n return this.password;\n }\n\n /**\n * @returns {Array} the record's validationData\n */\n getValidationData() {\n return this.validationData;\n }\n\n /**\n * @returns {Array} the record's authParameters\n */\n getAuthParameters() {\n return this.authParameters;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/AuthenticationDetails.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Client from './Client';\nimport CognitoUser from './CognitoUser';\nimport StorageHelper from './StorageHelper';\n\n/** @class */\nexport default class CognitoUserPool {\n /**\n * Constructs a new CognitoUserPool object\n * @param {object} data Creation options.\n * @param {string} data.UserPoolId Cognito user pool id.\n * @param {string} data.ClientId User pool application client id.\n * @param {object} data.Storage Optional storage object.\n * @param {boolean} data.AdvancedSecurityDataCollectionFlag Optional:\n * boolean flag indicating if the data collection is enabled\n * to support cognito advanced security features. By default, this\n * flag is set to true.\n */\n constructor(data) {\n const { UserPoolId, ClientId, endpoint, AdvancedSecurityDataCollectionFlag } = data || {};\n if (!UserPoolId || !ClientId) {\n throw new Error('Both UserPoolId and ClientId are required.');\n }\n if (!/^[\\w-]+_.+$/.test(UserPoolId)) {\n throw new Error('Invalid UserPoolId format.');\n }\n const region = UserPoolId.split('_')[0];\n\n this.userPoolId = UserPoolId;\n this.clientId = ClientId;\n\n this.client = new Client(region, endpoint);\n\n /**\n * By default, AdvancedSecurityDataCollectionFlag is set to true,\n * if no input value is provided.\n */\n this.advancedSecurityDataCollectionFlag = AdvancedSecurityDataCollectionFlag !== false;\n\n this.storage = data.Storage || new StorageHelper().getStorage();\n }\n\n /**\n * @returns {string} the user pool id\n */\n getUserPoolId() {\n return this.userPoolId;\n }\n\n /**\n * @returns {string} the client id\n */\n getClientId() {\n return this.clientId;\n }\n\n /**\n * @typedef {object} SignUpResult\n * @property {CognitoUser} user New user.\n * @property {bool} userConfirmed If the user is already confirmed.\n */\n /**\n * method for signing up a user\n * @param {string} username User's username.\n * @param {string} password Plain-text initial password entered by user.\n * @param {(AttributeArg[])=} userAttributes New user attributes.\n * @param {(AttributeArg[])=} validationData Application metadata.\n * @param {nodeCallback} callback Called on error or with the new user.\n * @returns {void}\n */\n signUp(username, password, userAttributes, validationData, callback) {\n const jsonReq = {\n ClientId: this.clientId,\n Username: username,\n Password: password,\n UserAttributes: userAttributes,\n ValidationData: validationData,\n };\n if (this.getUserContextData(username)) {\n jsonReq.UserContextData = this.getUserContextData(username);\n }\n this.client.request('SignUp', jsonReq, (err, data) => {\n if (err) {\n return callback(err, null);\n }\n\n const cognitoUser = {\n Username: username,\n Pool: this,\n Storage: this.storage,\n };\n\n const returnData = {\n user: new CognitoUser(cognitoUser),\n userConfirmed: data.UserConfirmed,\n userSub: data.UserSub,\n };\n\n return callback(null, returnData);\n });\n }\n\n\n /**\n * method for getting the current user of the application from the local storage\n *\n * @returns {CognitoUser} the user retrieved from storage\n */\n getCurrentUser() {\n const lastUserKey = `CognitoIdentityServiceProvider.${this.clientId}.LastAuthUser`;\n\n const lastAuthUser = this.storage.getItem(lastUserKey);\n if (lastAuthUser) {\n const cognitoUser = {\n Username: lastAuthUser,\n Pool: this,\n Storage: this.storage,\n };\n\n return new CognitoUser(cognitoUser);\n }\n\n return null;\n }\n\n /**\n * This method returns the encoded data string used for cognito advanced security feature.\n * This would be generated only when developer has included the JS used for collecting the\n * data on their client. Please refer to documentation to know more about using AdvancedSecurity\n * features\n * @param {string} username the username for the context data\n * @returns {string} the user context data\n **/\n getUserContextData(username) {\n if (typeof AmazonCognitoAdvancedSecurityData === 'undefined') {\n return undefined;\n }\n /* eslint-disable */\n const amazonCognitoAdvancedSecurityDataConst = AmazonCognitoAdvancedSecurityData;\n /* eslint-enable */\n\n if (this.advancedSecurityDataCollectionFlag) {\n const advancedSecurityData = amazonCognitoAdvancedSecurityDataConst.getData(username,\n this.userPoolId, this.clientId);\n if (advancedSecurityData) {\n const userContextData = {\n EncodedData: advancedSecurityData,\n };\n return userContextData;\n }\n }\n return {};\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CognitoUserPool.js","\nimport * as Cookies from 'js-cookie';\n\n/** @class */\nexport default class CookieStorage {\n\n /**\n * Constructs a new CookieStorage object\n * @param {object} data Creation options.\n * @param {string} data.domain Cookies domain (mandatory).\n * @param {string} data.path Cookies path (default: '/')\n * @param {integer} data.expires Cookie expiration (in days, default: 365)\n * @param {boolean} data.secure Cookie secure flag (default: true)\n */\n constructor(data) {\n this.domain = data.domain;\n if (data.path) {\n this.path = data.path;\n } else {\n this.path = '/';\n }\n if (Object.prototype.hasOwnProperty.call(data, 'expires')) {\n this.expires = data.expires;\n } else {\n this.expires = 365;\n }\n if (Object.prototype.hasOwnProperty.call(data, 'secure')) {\n this.secure = data.secure;\n } else {\n this.secure = true;\n }\n }\n\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n setItem(key, value) {\n Cookies.set(key, value, {\n path: this.path,\n expires: this.expires,\n domain: this.domain,\n secure: this.secure,\n }\n );\n return Cookies.get(key);\n }\n\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */\n getItem(key) {\n return Cookies.get(key);\n }\n\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {string} value - value that was deleted\n */\n removeItem(key) {\n return Cookies.remove(key, {\n path: this.path,\n domain: this.domain,\n secure: this.secure,\n }\n );\n }\n\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */\n clear() {\n const cookies = Cookies.get();\n let index;\n for (index = 0; index < cookies.length; ++index) {\n Cookies.remove(cookies[index]);\n }\n return {};\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/CookieStorage.js","import UserAgent from './UserAgent';\n/** @class */\nexport default class Client {\n /**\n * Constructs a new AWS Cognito Identity Provider client object\n * @param {string} region AWS region\n * @param {string} endpoint endpoint\n */\n constructor(region, endpoint) {\n this.endpoint = endpoint || `https://cognito-idp.${region}.amazonaws.com/`;\n this.userAgent = UserAgent.prototype.userAgent || 'aws-amplify/0.1.x js';\n }\n\n /**\n * Makes an unauthenticated request on AWS Cognito Identity Provider API\n * using fetch\n * @param {string} operation API operation\n * @param {object} params Input parameters\n * @param {function} callback Callback called when a response is returned\n * @returns {void}\n */\n request(operation, params, callback) {\n const headers = {\n 'Content-Type': 'application/x-amz-json-1.1',\n 'X-Amz-Target': `AWSCognitoIdentityProviderService.${operation}`,\n 'X-Amz-User-Agent': this.userAgent\n };\n\n const options = {\n headers,\n method: 'POST',\n mode: 'cors',\n cache: 'no-cache',\n body: JSON.stringify(params),\n };\n\n let response;\n\n fetch(this.endpoint, options)\n .then(resp => {\n response = resp;\n return resp;\n })\n .then(resp => resp.json().catch(() => ({})))\n .then(data => {\n if (response.ok) return callback(null, data);\n\n // Taken from aws-sdk-js/lib/protocol/json.js\n // eslint-disable-next-line no-underscore-dangle\n const code = (data.__type || data.code).split('#').pop();\n const error = {\n code,\n name: code,\n message: (data.message || data.Message || null),\n };\n return callback(error);\n })\n .catch(() => {\n // Taken from aws-sdk-js/lib/protocol/json.js\n const code = (response.headers.get('x-amzn-errortype') || 'UnknownError').split(':')[0];\n const error = {\n code,\n name: code,\n statusCode: response.status,\n message: response.status.toString(),\n };\n return callback(error);\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/Client.js","// class for defining the amzn user-agent\nexport default UserAgent;\n// constructor\nfunction UserAgent() {}\n// public\nUserAgent.prototype.userAgent = 'aws-amplify/0.1.x js';\n\n\n// WEBPACK FOOTER //\n// ./src/UserAgent.js","/*!\n * Copyright 2016 Amazon.com,\n * Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Amazon Software License (the \"License\").\n * You may not use this file except in compliance with the\n * License. A copy of the License is located at\n *\n * http://aws.amazon.com/asl/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, express or implied. See the License\n * for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { default as AuthenticationDetails } from './AuthenticationDetails';\nexport { default as AuthenticationHelper } from './AuthenticationHelper';\nexport { default as CognitoAccessToken } from './CognitoAccessToken';\nexport { default as CognitoIdToken } from './CognitoIdToken';\nexport { default as CognitoRefreshToken } from './CognitoRefreshToken';\nexport { default as CognitoUser } from './CognitoUser';\nexport { default as CognitoUserAttribute } from './CognitoUserAttribute';\nexport { default as CognitoUserPool } from './CognitoUserPool';\nexport { default as CognitoUserSession } from './CognitoUserSession';\nexport { default as CookieStorage } from './CookieStorage';\nexport { default as DateHelper } from './DateHelper';\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction placeHoldersCount (b64) {\n var len = b64.length\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n}\n\nfunction byteLength (b64) {\n // base64 is 4/3 + up to two characters of the original data\n return (b64.length * 3 / 4) - placeHoldersCount(b64)\n}\n\nfunction toByteArray (b64) {\n var i, l, tmp, placeHolders, arr\n var len = b64.length\n placeHolders = placeHoldersCount(b64)\n\n arr = new Arr((len * 3 / 4) - placeHolders)\n\n // if there are placeholders, only get up to the last complete 4 chars\n l = placeHolders > 0 ? len - 4 : len\n\n var L = 0\n\n for (i = 0; i < l; i += 4) {\n tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n arr[L++] = (tmp >> 16) & 0xFF\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n if (placeHolders === 2) {\n tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[L++] = tmp & 0xFF\n } else if (placeHolders === 1) {\n tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp = ((uint8[i] << 16) & 0xFF0000) + ((uint8[i + 1] << 8) & 0xFF00) + (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var output = ''\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n output += lookup[tmp >> 2]\n output += lookup[(tmp << 4) & 0x3F]\n output += '=='\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n output += lookup[tmp >> 10]\n output += lookup[(tmp >> 4) & 0x3F]\n output += lookup[(tmp << 2) & 0x3F]\n output += '='\n }\n\n parts.push(output)\n\n return parts.join('')\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/base64-js/index.js\n// module id = 20\n// module chunks = 0","/*\r\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\r\n * Digest Algorithm, as defined in RFC 1321.\r\n * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.\r\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\r\n * Distributed under the BSD License\r\n * See http://pajhome.org.uk/crypt/md5 for more info.\r\n */\r\n\r\nvar helpers = require('./helpers');\r\n\r\n/*\r\n * Perform a simple self-test to see if the VM is working\r\n */\r\nfunction md5_vm_test()\r\n{\r\n return hex_md5(\"abc\") == \"900150983cd24fb0d6963f7d28e17f72\";\r\n}\r\n\r\n/*\r\n * Calculate the MD5 of an array of little-endian words, and a bit length\r\n */\r\nfunction core_md5(x, len)\r\n{\r\n /* append padding */\r\n x[len >> 5] |= 0x80 << ((len) % 32);\r\n x[(((len + 64) >>> 9) << 4) + 14] = len;\r\n\r\n var a = 1732584193;\r\n var b = -271733879;\r\n var c = -1732584194;\r\n var d = 271733878;\r\n\r\n for(var i = 0; i < x.length; i += 16)\r\n {\r\n var olda = a;\r\n var oldb = b;\r\n var oldc = c;\r\n var oldd = d;\r\n\r\n a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);\r\n d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);\r\n c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);\r\n b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);\r\n a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);\r\n d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);\r\n c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);\r\n b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);\r\n a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);\r\n d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);\r\n c = md5_ff(c, d, a, b, x[i+10], 17, -42063);\r\n b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);\r\n a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);\r\n d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);\r\n c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);\r\n b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);\r\n\r\n a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);\r\n d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);\r\n c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);\r\n b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);\r\n a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);\r\n d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);\r\n c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);\r\n b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);\r\n a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);\r\n d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);\r\n c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);\r\n b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);\r\n a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);\r\n d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);\r\n c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);\r\n b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);\r\n\r\n a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);\r\n d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);\r\n c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);\r\n b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);\r\n a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);\r\n d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);\r\n c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);\r\n b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);\r\n a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);\r\n d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);\r\n c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);\r\n b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);\r\n a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);\r\n d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);\r\n c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);\r\n b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);\r\n\r\n a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);\r\n d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);\r\n c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);\r\n b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);\r\n a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);\r\n d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);\r\n c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);\r\n b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);\r\n a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);\r\n d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);\r\n c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);\r\n b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);\r\n a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);\r\n d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);\r\n c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);\r\n b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);\r\n\r\n a = safe_add(a, olda);\r\n b = safe_add(b, oldb);\r\n c = safe_add(c, oldc);\r\n d = safe_add(d, oldd);\r\n }\r\n return Array(a, b, c, d);\r\n\r\n}\r\n\r\n/*\r\n * These functions implement the four basic operations the algorithm uses.\r\n */\r\nfunction md5_cmn(q, a, b, x, s, t)\r\n{\r\n return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);\r\n}\r\nfunction md5_ff(a, b, c, d, x, s, t)\r\n{\r\n return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\r\n}\r\nfunction md5_gg(a, b, c, d, x, s, t)\r\n{\r\n return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\r\n}\r\nfunction md5_hh(a, b, c, d, x, s, t)\r\n{\r\n return md5_cmn(b ^ c ^ d, a, b, x, s, t);\r\n}\r\nfunction md5_ii(a, b, c, d, x, s, t)\r\n{\r\n return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\r\n}\r\n\r\n/*\r\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\r\n * to work around bugs in some JS interpreters.\r\n */\r\nfunction safe_add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}\r\n\r\n/*\r\n * Bitwise rotate a 32-bit number to the left.\r\n */\r\nfunction bit_rol(num, cnt)\r\n{\r\n return (num << cnt) | (num >>> (32 - cnt));\r\n}\r\n\r\nmodule.exports = function md5(buf) {\r\n return helpers.hash(buf, core_md5, 16);\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/crypto-browserify/md5.js\n// module id = 21\n// module chunks = 0","// Original code adapted from Robert Kieffer.\n// details at https://github.com/broofa/node-uuid\n(function() {\n var _global = this;\n\n var mathRNG, whatwgRNG;\n\n // NOTE: Math.random() does not guarantee \"cryptographic quality\"\n mathRNG = function(size) {\n var bytes = new Array(size);\n var r;\n\n for (var i = 0, r; i < size; i++) {\n if ((i & 0x03) == 0) r = Math.random() * 0x100000000;\n bytes[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return bytes;\n }\n\n if (_global.crypto && crypto.getRandomValues) {\n whatwgRNG = function(size) {\n var bytes = new Uint8Array(size);\n crypto.getRandomValues(bytes);\n return bytes;\n }\n }\n\n module.exports = whatwgRNG || mathRNG;\n\n}())\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/crypto-browserify/rng.js\n// module id = 22\n// module chunks = 0","/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined\n * in FIPS PUB 180-1\n * Version 2.1a Copyright Paul Johnston 2000 - 2002.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for details.\n */\n\nvar helpers = require('./helpers');\n\n/*\n * Calculate the SHA-1 of an array of big-endian words, and a bit length\n */\nfunction core_sha1(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << (24 - len % 32);\n x[((len + 64 >> 9) << 4) + 15] = len;\n\n var w = Array(80);\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n var e = -1009589776;\n\n for(var i = 0; i < x.length; i += 16)\n {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n var olde = e;\n\n for(var j = 0; j < 80; j++)\n {\n if(j < 16) w[j] = x[i + j];\n else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\n var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),\n safe_add(safe_add(e, w[j]), sha1_kt(j)));\n e = d;\n d = c;\n c = rol(b, 30);\n b = a;\n a = t;\n }\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n e = safe_add(e, olde);\n }\n return Array(a, b, c, d, e);\n\n}\n\n/*\n * Perform the appropriate triplet combination function for the current\n * iteration\n */\nfunction sha1_ft(t, b, c, d)\n{\n if(t < 20) return (b & c) | ((~b) & d);\n if(t < 40) return b ^ c ^ d;\n if(t < 60) return (b & c) | (b & d) | (c & d);\n return b ^ c ^ d;\n}\n\n/*\n * Determine the appropriate additive constant for the current iteration\n */\nfunction sha1_kt(t)\n{\n return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :\n (t < 60) ? -1894007588 : -899497514;\n}\n\n/*\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n * to work around bugs in some JS interpreters.\n */\nfunction safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}\n\n/*\n * Bitwise rotate a 32-bit number to the left.\n */\nfunction rol(num, cnt)\n{\n return (num << cnt) | (num >>> (32 - cnt));\n}\n\nmodule.exports = function sha1(buf) {\n return helpers.hash(buf, core_sha1, 20, true);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/crypto-browserify/sha.js\n// module id = 23\n// module chunks = 0","\n/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar helpers = require('./helpers');\n\nvar safe_add = function(x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n};\n\nvar S = function(X, n) {\n return (X >>> n) | (X << (32 - n));\n};\n\nvar R = function(X, n) {\n return (X >>> n);\n};\n\nvar Ch = function(x, y, z) {\n return ((x & y) ^ ((~x) & z));\n};\n\nvar Maj = function(x, y, z) {\n return ((x & y) ^ (x & z) ^ (y & z));\n};\n\nvar Sigma0256 = function(x) {\n return (S(x, 2) ^ S(x, 13) ^ S(x, 22));\n};\n\nvar Sigma1256 = function(x) {\n return (S(x, 6) ^ S(x, 11) ^ S(x, 25));\n};\n\nvar Gamma0256 = function(x) {\n return (S(x, 7) ^ S(x, 18) ^ R(x, 3));\n};\n\nvar Gamma1256 = function(x) {\n return (S(x, 17) ^ S(x, 19) ^ R(x, 10));\n};\n\nvar core_sha256 = function(m, l) {\n var K = new Array(0x428A2F98,0x71374491,0xB5C0FBCF,0xE9B5DBA5,0x3956C25B,0x59F111F1,0x923F82A4,0xAB1C5ED5,0xD807AA98,0x12835B01,0x243185BE,0x550C7DC3,0x72BE5D74,0x80DEB1FE,0x9BDC06A7,0xC19BF174,0xE49B69C1,0xEFBE4786,0xFC19DC6,0x240CA1CC,0x2DE92C6F,0x4A7484AA,0x5CB0A9DC,0x76F988DA,0x983E5152,0xA831C66D,0xB00327C8,0xBF597FC7,0xC6E00BF3,0xD5A79147,0x6CA6351,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);\n var HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19);\n var W = new Array(64);\n var a, b, c, d, e, f, g, h, i, j;\n var T1, T2;\n /* append padding */\n m[l >> 5] |= 0x80 << (24 - l % 32);\n m[((l + 64 >> 9) << 4) + 15] = l;\n for (var i = 0; i < m.length; i += 16) {\n a = HASH[0]; b = HASH[1]; c = HASH[2]; d = HASH[3]; e = HASH[4]; f = HASH[5]; g = HASH[6]; h = HASH[7];\n for (var j = 0; j < 64; j++) {\n if (j < 16) {\n W[j] = m[j + i];\n } else {\n W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]);\n }\n T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]);\n T2 = safe_add(Sigma0256(a), Maj(a, b, c));\n h = g; g = f; f = e; e = safe_add(d, T1); d = c; c = b; b = a; a = safe_add(T1, T2);\n }\n HASH[0] = safe_add(a, HASH[0]); HASH[1] = safe_add(b, HASH[1]); HASH[2] = safe_add(c, HASH[2]); HASH[3] = safe_add(d, HASH[3]);\n HASH[4] = safe_add(e, HASH[4]); HASH[5] = safe_add(f, HASH[5]); HASH[6] = safe_add(g, HASH[6]); HASH[7] = safe_add(h, HASH[7]);\n }\n return HASH;\n};\n\nmodule.exports = function sha256(buf) {\n return helpers.hash(buf, core_sha256, 32, true);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/crypto-browserify/sha256.js\n// module id = 24\n// module chunks = 0","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ieee754/index.js\n// module id = 25\n// module chunks = 0","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/isarray/index.js\n// module id = 26\n// module chunks = 0","/*!\n * JavaScript Cookie v2.2.0\n * https://github.com/js-cookie/js-cookie\n *\n * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n * Released under the MIT license\n */\n;(function (factory) {\n\tvar registeredInModuleLoader = false;\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (!registeredInModuleLoader) {\n\t\tvar OldCookies = window.Cookies;\n\t\tvar api = window.Cookies = factory();\n\t\tapi.noConflict = function () {\n\t\t\twindow.Cookies = OldCookies;\n\t\t\treturn api;\n\t\t};\n\t}\n}(function () {\n\tfunction extend () {\n\t\tvar i = 0;\n\t\tvar result = {};\n\t\tfor (; i < arguments.length; i++) {\n\t\t\tvar attributes = arguments[ i ];\n\t\t\tfor (var key in attributes) {\n\t\t\t\tresult[key] = attributes[key];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction init (converter) {\n\t\tfunction api (key, value, attributes) {\n\t\t\tvar result;\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Write\n\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tattributes = extend({\n\t\t\t\t\tpath: '/'\n\t\t\t\t}, api.defaults, attributes);\n\n\t\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\t\tvar expires = new Date();\n\t\t\t\t\texpires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);\n\t\t\t\t\tattributes.expires = expires;\n\t\t\t\t}\n\n\t\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\n\t\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\n\t\t\t\ttry {\n\t\t\t\t\tresult = JSON.stringify(value);\n\t\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\t\tvalue = result;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\n\t\t\t\tif (!converter.write) {\n\t\t\t\t\tvalue = encodeURIComponent(String(value))\n\t\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\t\t\t\t} else {\n\t\t\t\t\tvalue = converter.write(value, key);\n\t\t\t\t}\n\n\t\t\t\tkey = encodeURIComponent(String(key));\n\t\t\t\tkey = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);\n\t\t\t\tkey = key.replace(/[\\(\\)]/g, escape);\n\n\t\t\t\tvar stringifiedAttributes = '';\n\n\t\t\t\tfor (var attributeName in attributes) {\n\t\t\t\t\tif (!attributes[attributeName]) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstringifiedAttributes += '; ' + attributeName;\n\t\t\t\t\tif (attributes[attributeName] === true) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName];\n\t\t\t\t}\n\t\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\n\t\t\t}\n\n\t\t\t// Read\n\n\t\t\tif (!key) {\n\t\t\t\tresult = {};\n\t\t\t}\n\n\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t// in case there are no cookies at all. Also prevents odd result when\n\t\t\t// calling \"get()\"\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\tvar rdecode = /(%[0-9A-Z]{2})+/g;\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\tvar cookie = parts.slice(1).join('=');\n\n\t\t\t\tif (!this.json && cookie.charAt(0) === '\"') {\n\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvar name = parts[0].replace(rdecode, decodeURIComponent);\n\t\t\t\t\tcookie = converter.read ?\n\t\t\t\t\t\tconverter.read(cookie, name) : converter(cookie, name) ||\n\t\t\t\t\t\tcookie.replace(rdecode, decodeURIComponent);\n\n\t\t\t\t\tif (this.json) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\tresult = cookie;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!key) {\n\t\t\t\t\t\tresult[name] = cookie;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\tapi.set = api;\n\t\tapi.get = function (key) {\n\t\t\treturn api.call(api, key);\n\t\t};\n\t\tapi.getJSON = function () {\n\t\t\treturn api.apply({\n\t\t\t\tjson: true\n\t\t\t}, [].slice.call(arguments));\n\t\t};\n\t\tapi.defaults = {};\n\n\t\tapi.remove = function (key, attributes) {\n\t\t\tapi(key, '', extend(attributes, {\n\t\t\t\texpires: -1\n\t\t\t}));\n\t\t};\n\n\t\tapi.withConverter = init;\n\n\t\treturn api;\n\t}\n\n\treturn init(function () {});\n}));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/js-cookie/src/js.cookie.js\n// module id = 27\n// module chunks = 0","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/global.js\n// module id = 28\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/packages/amazon-cognito-identity-js/package-lock.json b/packages/amazon-cognito-identity-js/package-lock.json index d1b15342a76..164177cfa42 100644 --- a/packages/amazon-cognito-identity-js/package-lock.json +++ b/packages/amazon-cognito-identity-js/package-lock.json @@ -1,13 +1,8305 @@ { "name": "amazon-cognito-identity-js", - "version": "1.29.0", + "version": "2.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { - "crypto-js": { - "version": "3.1.9-1", - "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.9-1.tgz", - "integrity": "sha1-/aGedh/Ad+Af+/3G6f38WeiAbNg=" + "absolute-path": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/absolute-path/-/absolute-path-0.0.0.tgz", + "integrity": "sha1-p4di+9rftSl76ZsV01p4Wy8JW/c=", + "dev": true + }, + "accepts": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.2.13.tgz", + "integrity": "sha1-5fHzkoxtlf2WVYw27D2dDeSm7Oo=", + "dev": true, + "requires": { + "mime-types": "2.1.11", + "negotiator": "0.5.3" + } + }, + "acorn": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.4.1.tgz", + "integrity": "sha512-XLmq3H/BVvW6/GbxKryGxWORz1ebilSsUDlyC27bXhWGWAZWkGwS6FLHjOlwFXNFoWFQEO/Df4u0YYd0K3BQgQ==", + "dev": true + }, + "acorn-dynamic-import": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz", + "integrity": "sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ=", + "dev": true, + "requires": { + "acorn": "4.0.13" + }, + "dependencies": { + "acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", + "dev": true + } + } + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "3.3.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "ajv": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", + "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "dev": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ajv-keywords": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", + "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", + "dev": true + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + } + }, + "ansi": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz", + "integrity": "sha1-DELU+xcWDVqa8eSEus4cZpIsGyE=", + "dev": true + }, + "ansi-escapes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", + "dev": true + }, + "ansi-gray": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", + "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=", + "dev": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "ansi-wrap": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", + "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", + "dev": true + }, + "anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "requires": { + "micromatch": "2.3.11", + "normalize-path": "2.1.1" + } + }, + "are-we-there-yet": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", + "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", + "dev": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.3.4" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "1.1.0" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "array-differ": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", + "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", + "dev": true + }, + "array-filter": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", + "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", + "dev": true + }, + "array-find": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-find/-/array-find-1.0.0.tgz", + "integrity": "sha1-bI4obRHtdoMn+OYuzuhzU8o+eLg=", + "dev": true + }, + "array-map": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", + "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", + "dev": true + }, + "array-reduce": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", + "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "art": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/art/-/art-0.10.1.tgz", + "integrity": "sha1-OFQYg+OZIlxeGT/yRujxV897IUY=", + "dev": true + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", + "dev": true + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", + "dev": true + }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" + } + }, + "assert": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "dev": true, + "requires": { + "util": "0.10.3" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "dev": true, + "requires": { + "lodash": "4.17.5" + } + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", + "dev": true + }, + "babel-cli": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-cli/-/babel-cli-6.26.0.tgz", + "integrity": "sha1-UCq1SHTX24itALiHoGODzgPQAvE=", + "dev": true, + "requires": { + "babel-core": "6.26.0", + "babel-polyfill": "6.26.0", + "babel-register": "6.26.0", + "babel-runtime": "6.26.0", + "chokidar": "1.7.0", + "commander": "2.14.1", + "convert-source-map": "1.5.1", + "fs-readdir-recursive": "1.1.0", + "glob": "7.1.2", + "lodash": "4.17.5", + "output-file-sync": "1.1.2", + "path-is-absolute": "1.0.1", + "slash": "1.0.0", + "source-map": "0.5.7", + "v8flags": "2.1.1" + } + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + } + }, + "babel-core": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz", + "integrity": "sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "babel-generator": "6.26.1", + "babel-helpers": "6.24.1", + "babel-messages": "6.23.0", + "babel-register": "6.26.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "convert-source-map": "1.5.1", + "debug": "2.6.9", + "json5": "0.5.1", + "lodash": "4.17.5", + "minimatch": "3.0.4", + "path-is-absolute": "1.0.1", + "private": "0.1.8", + "slash": "1.0.0", + "source-map": "0.5.7" + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "dev": true, + "requires": { + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "detect-indent": "4.0.0", + "jsesc": "1.3.0", + "lodash": "4.17.5", + "source-map": "0.5.7", + "trim-right": "1.0.1" + } + }, + "babel-helper-bindify-decorators": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz", + "integrity": "sha1-FMGeXxQte0fxmlJDHlKxzLxAozA=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-builder-binary-assignment-operator-visitor": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", + "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", + "dev": true, + "requires": { + "babel-helper-explode-assignable-expression": "6.24.1", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-builder-react-jsx": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.26.0.tgz", + "integrity": "sha1-Of+DE7dci2Xc7/HzHTg+D/KkCKA=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "esutils": "2.0.2" + } + }, + "babel-helper-call-delegate": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", + "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "6.24.1", + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-define-map": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", + "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", + "dev": true, + "requires": { + "babel-helper-function-name": "6.24.1", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "lodash": "4.17.5" + } + }, + "babel-helper-explode-assignable-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", + "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-explode-class": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz", + "integrity": "sha1-fcKjkQ3uAHBW4eMdZAztPVTqqes=", + "dev": true, + "requires": { + "babel-helper-bindify-decorators": "6.24.1", + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "dev": true, + "requires": { + "babel-helper-get-function-arity": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-get-function-arity": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-hoist-variables": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-optimise-call-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", + "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-regex": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", + "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "lodash": "4.17.5" + } + }, + "babel-helper-remap-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", + "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "dev": true, + "requires": { + "babel-helper-function-name": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-replace-supers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", + "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "dev": true, + "requires": { + "babel-helper-optimise-call-expression": "6.24.1", + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "babel-loader": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-6.4.1.tgz", + "integrity": "sha1-CzQRLVsHSKjc2/Uaz2+b1C1QuMo=", + "dev": true, + "requires": { + "find-cache-dir": "0.1.1", + "loader-utils": "0.2.17", + "mkdirp": "0.5.1", + "object-assign": "4.1.1" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-check-es2015-constants": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-external-helpers": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz", + "integrity": "sha1-IoX0iwK9Xe3oUXXK+MYuhq3M76E=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-react-transform": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/babel-plugin-react-transform/-/babel-plugin-react-transform-2.0.2.tgz", + "integrity": "sha1-UVu/qZaJOYEULZCx+bFjXeKZUQk=", + "dev": true, + "requires": { + "lodash": "4.17.5" + } + }, + "babel-plugin-syntax-async-functions": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", + "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", + "dev": true + }, + "babel-plugin-syntax-async-generators": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz", + "integrity": "sha1-a8lj67FuzLrmuStZbrfzXDQqi5o=", + "dev": true + }, + "babel-plugin-syntax-class-properties": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", + "integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=", + "dev": true + }, + "babel-plugin-syntax-decorators": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz", + "integrity": "sha1-MSVjtNvePMgGzuPkFszurd0RrAs=", + "dev": true + }, + "babel-plugin-syntax-dynamic-import": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz", + "integrity": "sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo=", + "dev": true + }, + "babel-plugin-syntax-exponentiation-operator": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", + "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", + "dev": true + }, + "babel-plugin-syntax-flow": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz", + "integrity": "sha1-TDqyCiryaqIM0lmVw5jE63AxDI0=", + "dev": true + }, + "babel-plugin-syntax-jsx": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", + "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=", + "dev": true + }, + "babel-plugin-syntax-object-rest-spread": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", + "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", + "dev": true + }, + "babel-plugin-syntax-trailing-function-commas": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", + "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", + "dev": true + }, + "babel-plugin-transform-async-generator-functions": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz", + "integrity": "sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds=", + "dev": true, + "requires": { + "babel-helper-remap-async-to-generator": "6.24.1", + "babel-plugin-syntax-async-generators": "6.13.0", + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", + "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", + "dev": true, + "requires": { + "babel-helper-remap-async-to-generator": "6.24.1", + "babel-plugin-syntax-async-functions": "6.13.0", + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-class-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz", + "integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=", + "dev": true, + "requires": { + "babel-helper-function-name": "6.24.1", + "babel-plugin-syntax-class-properties": "6.13.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "babel-plugin-transform-decorators": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz", + "integrity": "sha1-eIAT2PjGtSIr33s0Q5Df13Vp4k0=", + "dev": true, + "requires": { + "babel-helper-explode-class": "6.24.1", + "babel-plugin-syntax-decorators": "6.13.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-arrow-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", + "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-block-scoped-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", + "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-block-scoping": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", + "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "lodash": "4.17.5" + } + }, + "babel-plugin-transform-es2015-classes": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", + "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", + "dev": true, + "requires": { + "babel-helper-define-map": "6.26.0", + "babel-helper-function-name": "6.24.1", + "babel-helper-optimise-call-expression": "6.24.1", + "babel-helper-replace-supers": "6.24.1", + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-computed-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", + "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "babel-plugin-transform-es2015-destructuring": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-duplicate-keys": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", + "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-for-of": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", + "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "dev": true, + "requires": { + "babel-helper-function-name": "6.24.1", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", + "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-amd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", + "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz", + "integrity": "sha1-DYOUApt9xqvhqX7xgeAHWN0uXYo=", + "dev": true, + "requires": { + "babel-plugin-transform-strict-mode": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-systemjs": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", + "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-umd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", + "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-amd": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "babel-plugin-transform-es2015-object-super": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", + "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", + "dev": true, + "requires": { + "babel-helper-replace-supers": "6.24.1", + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-parameters": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", + "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", + "dev": true, + "requires": { + "babel-helper-call-delegate": "6.24.1", + "babel-helper-get-function-arity": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-shorthand-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", + "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-spread": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-sticky-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", + "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "dev": true, + "requires": { + "babel-helper-regex": "6.26.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-es2015-template-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", + "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-typeof-symbol": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", + "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es2015-unicode-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", + "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", + "dev": true, + "requires": { + "babel-helper-regex": "6.26.0", + "babel-runtime": "6.26.0", + "regexpu-core": "2.0.0" + } + }, + "babel-plugin-transform-es3-member-expression-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es3-member-expression-literals/-/babel-plugin-transform-es3-member-expression-literals-6.22.0.tgz", + "integrity": "sha1-cz00RPPsxBvvjtGmpOCWV7iWnrs=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-es3-property-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es3-property-literals/-/babel-plugin-transform-es3-property-literals-6.22.0.tgz", + "integrity": "sha1-sgeNWELiKr9A9z6M3pzTcRq9V1g=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-exponentiation-operator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", + "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", + "dev": true, + "requires": { + "babel-helper-builder-binary-assignment-operator-visitor": "6.24.1", + "babel-plugin-syntax-exponentiation-operator": "6.13.0", + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-flow-strip-types": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz", + "integrity": "sha1-hMtnKTXUNxT9wyvOhFaNh0Qc988=", + "dev": true, + "requires": { + "babel-plugin-syntax-flow": "6.18.0", + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-object-assign": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-assign/-/babel-plugin-transform-object-assign-6.22.0.tgz", + "integrity": "sha1-+Z0vZvGgsNSY40bFNZaEdAyqILo=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-object-rest-spread": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", + "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=", + "dev": true, + "requires": { + "babel-plugin-syntax-object-rest-spread": "6.13.0", + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-react-display-name": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.25.0.tgz", + "integrity": "sha1-Z+K/Hx6ck6sI25Z5LgU5K/LMKNE=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-react-jsx": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz", + "integrity": "sha1-hAoCjn30YN/DotKfDA2R9jduZqM=", + "dev": true, + "requires": { + "babel-helper-builder-react-jsx": "6.26.0", + "babel-plugin-syntax-jsx": "6.18.0", + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-react-jsx-self": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx-self/-/babel-plugin-transform-react-jsx-self-6.22.0.tgz", + "integrity": "sha1-322AqdomEqEh5t3XVYvL7PBuY24=", + "dev": true, + "requires": { + "babel-plugin-syntax-jsx": "6.18.0", + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-react-jsx-source": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx-source/-/babel-plugin-transform-react-jsx-source-6.22.0.tgz", + "integrity": "sha1-ZqwSFT9c0tF7PBkmj0vwGX9E7NY=", + "dev": true, + "requires": { + "babel-plugin-syntax-jsx": "6.18.0", + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-regenerator": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", + "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", + "dev": true, + "requires": { + "regenerator-transform": "0.10.1" + } + }, + "babel-plugin-transform-strict-mode": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", + "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-polyfill": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", + "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "core-js": "2.5.3", + "regenerator-runtime": "0.10.5" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", + "dev": true + } + } + }, + "babel-preset-es2015": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", + "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", + "dev": true, + "requires": { + "babel-plugin-check-es2015-constants": "6.22.0", + "babel-plugin-transform-es2015-arrow-functions": "6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "6.22.0", + "babel-plugin-transform-es2015-block-scoping": "6.26.0", + "babel-plugin-transform-es2015-classes": "6.24.1", + "babel-plugin-transform-es2015-computed-properties": "6.24.1", + "babel-plugin-transform-es2015-destructuring": "6.23.0", + "babel-plugin-transform-es2015-duplicate-keys": "6.24.1", + "babel-plugin-transform-es2015-for-of": "6.23.0", + "babel-plugin-transform-es2015-function-name": "6.24.1", + "babel-plugin-transform-es2015-literals": "6.22.0", + "babel-plugin-transform-es2015-modules-amd": "6.24.1", + "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", + "babel-plugin-transform-es2015-modules-systemjs": "6.24.1", + "babel-plugin-transform-es2015-modules-umd": "6.24.1", + "babel-plugin-transform-es2015-object-super": "6.24.1", + "babel-plugin-transform-es2015-parameters": "6.24.1", + "babel-plugin-transform-es2015-shorthand-properties": "6.24.1", + "babel-plugin-transform-es2015-spread": "6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "6.24.1", + "babel-plugin-transform-es2015-template-literals": "6.22.0", + "babel-plugin-transform-es2015-typeof-symbol": "6.23.0", + "babel-plugin-transform-es2015-unicode-regex": "6.24.1", + "babel-plugin-transform-regenerator": "6.26.0" + } + }, + "babel-preset-es2015-node": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-preset-es2015-node/-/babel-preset-es2015-node-6.1.1.tgz", + "integrity": "sha1-YLIxVwJLDP6/OmNVTLBe4DW05V8=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-destructuring": "6.23.0", + "babel-plugin-transform-es2015-function-name": "6.24.1", + "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", + "babel-plugin-transform-es2015-parameters": "6.24.1", + "babel-plugin-transform-es2015-shorthand-properties": "6.24.1", + "babel-plugin-transform-es2015-spread": "6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "6.24.1", + "babel-plugin-transform-es2015-unicode-regex": "6.24.1", + "semver": "5.5.0" + } + }, + "babel-preset-fbjs": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/babel-preset-fbjs/-/babel-preset-fbjs-2.1.4.tgz", + "integrity": "sha512-6XVQwlO26V5/0P9s2Eje8Epqkv/ihaMJ798+W98ktOA8fCn2IFM6wEi7CDW3fTbKFZ/8fDGvGZH01B6GSuNiWA==", + "dev": true, + "requires": { + "babel-plugin-check-es2015-constants": "6.22.0", + "babel-plugin-syntax-class-properties": "6.13.0", + "babel-plugin-syntax-flow": "6.18.0", + "babel-plugin-syntax-jsx": "6.18.0", + "babel-plugin-syntax-object-rest-spread": "6.13.0", + "babel-plugin-syntax-trailing-function-commas": "6.22.0", + "babel-plugin-transform-class-properties": "6.24.1", + "babel-plugin-transform-es2015-arrow-functions": "6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "6.22.0", + "babel-plugin-transform-es2015-block-scoping": "6.26.0", + "babel-plugin-transform-es2015-classes": "6.24.1", + "babel-plugin-transform-es2015-computed-properties": "6.24.1", + "babel-plugin-transform-es2015-destructuring": "6.23.0", + "babel-plugin-transform-es2015-for-of": "6.23.0", + "babel-plugin-transform-es2015-function-name": "6.24.1", + "babel-plugin-transform-es2015-literals": "6.22.0", + "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", + "babel-plugin-transform-es2015-object-super": "6.24.1", + "babel-plugin-transform-es2015-parameters": "6.24.1", + "babel-plugin-transform-es2015-shorthand-properties": "6.24.1", + "babel-plugin-transform-es2015-spread": "6.22.0", + "babel-plugin-transform-es2015-template-literals": "6.22.0", + "babel-plugin-transform-es3-member-expression-literals": "6.22.0", + "babel-plugin-transform-es3-property-literals": "6.22.0", + "babel-plugin-transform-flow-strip-types": "6.22.0", + "babel-plugin-transform-object-rest-spread": "6.26.0", + "babel-plugin-transform-react-display-name": "6.25.0", + "babel-plugin-transform-react-jsx": "6.24.1" + } + }, + "babel-preset-flow": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz", + "integrity": "sha1-5xIYiHCFrpoktb5Baa/7WZgWxJ0=", + "dev": true, + "requires": { + "babel-plugin-transform-flow-strip-types": "6.22.0" + } + }, + "babel-preset-react": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-react/-/babel-preset-react-6.24.1.tgz", + "integrity": "sha1-umnfrqRfw+xjm2pOzqbhdwLJE4A=", + "dev": true, + "requires": { + "babel-plugin-syntax-jsx": "6.18.0", + "babel-plugin-transform-react-display-name": "6.25.0", + "babel-plugin-transform-react-jsx": "6.24.1", + "babel-plugin-transform-react-jsx-self": "6.22.0", + "babel-plugin-transform-react-jsx-source": "6.22.0", + "babel-preset-flow": "6.23.0" + } + }, + "babel-preset-react-native": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/babel-preset-react-native/-/babel-preset-react-native-1.9.2.tgz", + "integrity": "sha1-sird0uNV/zs5Zxt5voB+Ut+hRfI=", + "dev": true, + "requires": { + "babel-plugin-check-es2015-constants": "6.22.0", + "babel-plugin-react-transform": "2.0.2", + "babel-plugin-syntax-async-functions": "6.13.0", + "babel-plugin-syntax-class-properties": "6.13.0", + "babel-plugin-syntax-flow": "6.18.0", + "babel-plugin-syntax-jsx": "6.18.0", + "babel-plugin-syntax-trailing-function-commas": "6.22.0", + "babel-plugin-transform-class-properties": "6.24.1", + "babel-plugin-transform-es2015-arrow-functions": "6.22.0", + "babel-plugin-transform-es2015-block-scoping": "6.26.0", + "babel-plugin-transform-es2015-classes": "6.24.1", + "babel-plugin-transform-es2015-computed-properties": "6.24.1", + "babel-plugin-transform-es2015-destructuring": "6.23.0", + "babel-plugin-transform-es2015-for-of": "6.23.0", + "babel-plugin-transform-es2015-function-name": "6.24.1", + "babel-plugin-transform-es2015-literals": "6.22.0", + "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", + "babel-plugin-transform-es2015-parameters": "6.24.1", + "babel-plugin-transform-es2015-shorthand-properties": "6.24.1", + "babel-plugin-transform-es2015-spread": "6.22.0", + "babel-plugin-transform-es2015-template-literals": "6.22.0", + "babel-plugin-transform-flow-strip-types": "6.22.0", + "babel-plugin-transform-object-assign": "6.22.0", + "babel-plugin-transform-object-rest-spread": "6.26.0", + "babel-plugin-transform-react-display-name": "6.25.0", + "babel-plugin-transform-react-jsx": "6.24.1", + "babel-plugin-transform-react-jsx-source": "6.22.0", + "babel-plugin-transform-regenerator": "6.26.0", + "react-transform-hmr": "1.0.4" + } + }, + "babel-preset-stage-2": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz", + "integrity": "sha1-2eKWD7PXEYfw5k7sYrwHdnIZvcE=", + "dev": true, + "requires": { + "babel-plugin-syntax-dynamic-import": "6.18.0", + "babel-plugin-transform-class-properties": "6.24.1", + "babel-plugin-transform-decorators": "6.24.1", + "babel-preset-stage-3": "6.24.1" + } + }, + "babel-preset-stage-3": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz", + "integrity": "sha1-g2raCp56f6N8sTj7kyb4eTSkg5U=", + "dev": true, + "requires": { + "babel-plugin-syntax-trailing-function-commas": "6.22.0", + "babel-plugin-transform-async-generator-functions": "6.24.1", + "babel-plugin-transform-async-to-generator": "6.24.1", + "babel-plugin-transform-exponentiation-operator": "6.24.1", + "babel-plugin-transform-object-rest-spread": "6.26.0" + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "dev": true, + "requires": { + "babel-core": "6.26.0", + "babel-runtime": "6.26.0", + "core-js": "2.5.3", + "home-or-tmp": "2.0.0", + "lodash": "4.17.5", + "mkdirp": "0.5.1", + "source-map-support": "0.4.18" + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "requires": { + "core-js": "2.5.3", + "regenerator-runtime": "0.11.1" + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "lodash": "4.17.5" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "debug": "2.6.9", + "globals": "9.18.0", + "invariant": "2.2.3", + "lodash": "4.17.5" + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "esutils": "2.0.2", + "lodash": "4.17.5", + "to-fast-properties": "1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base64-js": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.3.tgz", + "integrity": "sha512-MsAhsUW1GxCdgYSO6tAfZrNapmUKk7mWx/k5mFY/A1gBtkaCaNapTg+FExCw1r9yeaZhqx/xPg43xgTFH6KL5w==" + }, + "base64-url": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/base64-url/-/base64-url-1.2.1.tgz", + "integrity": "sha1-GZ/WYXAqDnt9yubgaYuwicUvbXg=", + "dev": true + }, + "basic-auth": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.0.4.tgz", + "integrity": "sha1-Awk1sB3nyblKgksp8/zLdQ06UpA=", + "dev": true + }, + "basic-auth-connect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/basic-auth-connect/-/basic-auth-connect-1.0.0.tgz", + "integrity": "sha1-/bC0OWLKe0BFanwrtI/hc9otISI=", + "dev": true + }, + "batch": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.5.3.tgz", + "integrity": "sha1-PzQU84AyF0O/wQQvmoP/HVgk1GQ=", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "beeper": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.1.tgz", + "integrity": "sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak=", + "dev": true + }, + "big-integer": { + "version": "1.6.26", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.26.tgz", + "integrity": "sha1-OvFnL6Ytry1eyvrPblqg0l4Cwcg=", + "dev": true + }, + "big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "dev": true + }, + "binary-extensions": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", + "dev": true + }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", + "dev": true + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "body-parser": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.13.3.tgz", + "integrity": "sha1-wIzzMMM1jhUQFqBXRvE/ApyX+pc=", + "dev": true, + "requires": { + "bytes": "2.1.0", + "content-type": "1.0.4", + "debug": "2.2.0", + "depd": "1.0.1", + "http-errors": "1.3.1", + "iconv-lite": "0.4.11", + "on-finished": "2.3.0", + "qs": "4.0.0", + "raw-body": "2.1.7", + "type-is": "1.6.16" + }, + "dependencies": { + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "0.7.1" + } + }, + "iconv-lite": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.11.tgz", + "integrity": "sha1-LstC/SlHRJIiCaLnxATayHk9it4=", + "dev": true + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + } + } + }, + "boom": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", + "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", + "dev": true, + "requires": { + "hoek": "4.2.1" + }, + "dependencies": { + "hoek": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", + "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==", + "dev": true + } + } + }, + "bplist-creator": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.0.7.tgz", + "integrity": "sha1-N98VNgkoJLh8QvlXsBNEEXNyrkU=", + "dev": true, + "requires": { + "stream-buffers": "2.2.0" + } + }, + "bplist-parser": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.1.1.tgz", + "integrity": "sha1-1g1dzCDLptx+HymbNdPh+V2vuuY=", + "dev": true, + "requires": { + "big-integer": "1.6.26" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browserify-aes": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.1.1.tgz", + "integrity": "sha512-UGnTYAnB2a3YuYKIRy1/4FB2HdM866E0qC46JXvVTYKlBlZlnvfpSfY6OKfXZAkv70eJ2a1SqzpAo5CRhZGDFg==", + "dev": true, + "requires": { + "buffer-xor": "1.0.3", + "cipher-base": "1.0.4", + "create-hash": "1.1.3", + "evp_bytestokey": "1.0.3", + "inherits": "2.0.3", + "safe-buffer": "5.1.1" + } + }, + "browserify-cipher": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", + "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=", + "dev": true, + "requires": { + "browserify-aes": "1.1.1", + "browserify-des": "1.0.0", + "evp_bytestokey": "1.0.3" + } + }, + "browserify-des": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", + "integrity": "sha1-2qJ3cXRwki7S/hhZQRihdUOXId0=", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "des.js": "1.0.0", + "inherits": "2.0.3" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "randombytes": "2.0.6" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "elliptic": "6.4.0", + "inherits": "2.0.3", + "parse-asn1": "5.1.0" + } + }, + "browserify-zlib": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", + "dev": true, + "requires": { + "pako": "0.2.9" + } + }, + "bser": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/bser/-/bser-1.0.3.tgz", + "integrity": "sha1-1j2hnuFzMKDiYNKjRCKyGolSAxc=", + "dev": true, + "requires": { + "node-int64": "0.4.0" + } + }, + "buffer": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", + "requires": { + "base64-js": "1.2.3", + "ieee754": "1.1.8", + "isarray": "1.0.0" + } + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "bytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.1.0.tgz", + "integrity": "sha1-rJPEEOL/ycx89LRks4KJBn9eR7Q=", + "dev": true + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "catharsis": { + "version": "0.8.9", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.9.tgz", + "integrity": "sha1-mMyJDKZS3S7w5ws3klMQ/56Q/Is=", + "dev": true, + "requires": { + "underscore-contrib": "0.3.0" + } + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "dev": true, + "requires": { + "anymatch": "1.3.2", + "async-each": "1.0.1", + "fsevents": "1.1.3", + "glob-parent": "2.0.0", + "inherits": "2.0.3", + "is-binary-path": "1.0.1", + "is-glob": "2.0.1", + "path-is-absolute": "1.0.1", + "readdirp": "2.1.0" + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.1" + } + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "1.0.1" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true + } + } + }, + "clone": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz", + "integrity": "sha1-KY1+IjFmD0DAA8LtMUDezz9TCF8=", + "dev": true + }, + "clone-stats": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", + "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=", + "dev": true + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "dev": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "commander": { + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz", + "integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "compressible": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.13.tgz", + "integrity": "sha1-DRAgq5JLL9tNYnmHXH1tq6a6p6k=", + "dev": true, + "requires": { + "mime-db": "1.33.0" + } + }, + "compression": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.5.2.tgz", + "integrity": "sha1-sDuNhub4rSloPLqN+R3cb/x3s5U=", + "dev": true, + "requires": { + "accepts": "1.2.13", + "bytes": "2.1.0", + "compressible": "2.0.13", + "debug": "2.2.0", + "on-headers": "1.0.1", + "vary": "1.0.1" + }, + "dependencies": { + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "0.7.1" + } + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + } + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.4", + "typedarray": "0.0.6" + } + }, + "connect": { + "version": "2.30.2", + "resolved": "https://registry.npmjs.org/connect/-/connect-2.30.2.tgz", + "integrity": "sha1-jam8vooFTT0xjXTf7JA7XDmhtgk=", + "dev": true, + "requires": { + "basic-auth-connect": "1.0.0", + "body-parser": "1.13.3", + "bytes": "2.1.0", + "compression": "1.5.2", + "connect-timeout": "1.6.2", + "content-type": "1.0.4", + "cookie": "0.1.3", + "cookie-parser": "1.3.5", + "cookie-signature": "1.0.6", + "csurf": "1.8.3", + "debug": "2.2.0", + "depd": "1.0.1", + "errorhandler": "1.4.3", + "express-session": "1.11.3", + "finalhandler": "0.4.0", + "fresh": "0.3.0", + "http-errors": "1.3.1", + "method-override": "2.3.10", + "morgan": "1.6.1", + "multiparty": "3.3.2", + "on-headers": "1.0.1", + "parseurl": "1.3.2", + "pause": "0.1.0", + "qs": "4.0.0", + "response-time": "2.3.2", + "serve-favicon": "2.3.2", + "serve-index": "1.7.3", + "serve-static": "1.10.3", + "type-is": "1.6.16", + "utils-merge": "1.0.0", + "vhost": "3.0.2" + }, + "dependencies": { + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "0.7.1" + } + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + } + } + }, + "connect-timeout": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/connect-timeout/-/connect-timeout-1.6.2.tgz", + "integrity": "sha1-3ppexh4zoStu2qt7XwYumMWZuI4=", + "dev": true, + "requires": { + "debug": "2.2.0", + "http-errors": "1.3.1", + "ms": "0.7.1", + "on-headers": "1.0.1" + }, + "dependencies": { + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "0.7.1" + } + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + } + } + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "0.1.4" + } + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "dev": true + }, + "convert-source-map": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", + "dev": true + }, + "cookie": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.3.tgz", + "integrity": "sha1-5zSlwUF/zkctWu+Cw4HKu2TRpDU=", + "dev": true + }, + "cookie-parser": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.3.5.tgz", + "integrity": "sha1-nXVVcPtdF4kHcSJ6AjFNm+fPg1Y=", + "dev": true, + "requires": { + "cookie": "0.1.3", + "cookie-signature": "1.0.6" + } + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", + "dev": true + }, + "core-js": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.3.tgz", + "integrity": "sha1-isw4NFgk8W2DZbfJtCWRaOjtYD4=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "crc": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/crc/-/crc-3.3.0.tgz", + "integrity": "sha1-+mIuG8OIvyVzCQgta2UgDOZwkLo=", + "dev": true + }, + "create-ecdh": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", + "integrity": "sha1-iIxyNZbN92EvZJgjPuvXo1MBc30=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.4.0" + } + }, + "create-hash": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", + "integrity": "sha1-YGBCrIuSYnUPSDyt2rD1gZFy2P0=", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "inherits": "2.0.3", + "ripemd160": "2.0.1", + "sha.js": "2.4.10" + } + }, + "create-hmac": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.6.tgz", + "integrity": "sha1-rLniIaThe9sHbpBlfEK5PjcmzwY=", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "create-hash": "1.1.3", + "inherits": "2.0.3", + "ripemd160": "2.0.1", + "safe-buffer": "5.1.1", + "sha.js": "2.4.10" + } + }, + "cross-env": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-3.2.4.tgz", + "integrity": "sha1-ngWF8neGTtQhznVvgamA/w1piro=", + "dev": true, + "requires": { + "cross-spawn": "5.1.0", + "is-windows": "1.0.2" + } + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "4.1.1", + "shebang-command": "1.2.0", + "which": "1.3.0" + } + }, + "cryptiles": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", + "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", + "dev": true, + "requires": { + "boom": "5.2.0" + }, + "dependencies": { + "boom": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", + "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", + "dev": true, + "requires": { + "hoek": "4.2.1" + } + }, + "hoek": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", + "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==", + "dev": true + } + } + }, + "crypto-browserify": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-1.0.9.tgz", + "integrity": "sha1-zFRJaF37hesRyYKKzHy4erW7/MA=" + }, + "csrf": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/csrf/-/csrf-3.0.6.tgz", + "integrity": "sha1-thEg3c7q/JHnbtUxO7XAsmZ7cQo=", + "dev": true, + "requires": { + "rndm": "1.2.0", + "tsscmp": "1.0.5", + "uid-safe": "2.1.4" + } + }, + "csurf": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/csurf/-/csurf-1.8.3.tgz", + "integrity": "sha1-I/KhO/HY/OHQyZZYg5RELLqGpWo=", + "dev": true, + "requires": { + "cookie": "0.1.3", + "cookie-signature": "1.0.6", + "csrf": "3.0.6", + "http-errors": "1.3.1" + } + }, + "d": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "dev": true, + "requires": { + "es5-ext": "0.10.39" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "1.0.0" + } + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "dateformat": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz", + "integrity": "sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI=", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.0", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.2" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true + }, + "denodeify": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/denodeify/-/denodeify-1.2.1.tgz", + "integrity": "sha1-OjYof1A05pnnV3kBBSwubJQlFjE=", + "dev": true + }, + "depd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.0.1.tgz", + "integrity": "sha1-gK7GTJ1tl+ZcwqnKqTwKpqv3Oqo=", + "dev": true + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" + } + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "requires": { + "repeating": "2.0.1" + } + }, + "diffie-hellman": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", + "integrity": "sha1-tYNXOScM/ias9jIJn97SoH8gnl4=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "miller-rabin": "4.0.1", + "randombytes": "2.0.6" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "2.0.2" + } + }, + "dom-walk": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz", + "integrity": "sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg=", + "dev": true + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true + }, + "duplexer2": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", + "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", + "dev": true, + "requires": { + "readable-stream": "1.1.14" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, + "elliptic": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", + "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "brorand": "1.1.0", + "hash.js": "1.1.3", + "hmac-drbg": "1.0.1", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0", + "minimalistic-crypto-utils": "1.0.1" + } + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "dev": true + }, + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "dev": true, + "requires": { + "iconv-lite": "0.4.19" + } + }, + "enhanced-resolve": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-0.9.1.tgz", + "integrity": "sha1-TW5omzcl+GCQknzMhs2fFjW4ni4=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "memory-fs": "0.2.0", + "tapable": "0.1.10" + } + }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "dev": true, + "requires": { + "prr": "1.0.1" + } + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "errorhandler": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/errorhandler/-/errorhandler-1.4.3.tgz", + "integrity": "sha1-t7cO2PNZ6duICS8tIMD4MUIK2D8=", + "dev": true, + "requires": { + "accepts": "1.3.4", + "escape-html": "1.0.3" + }, + "dependencies": { + "accepts": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz", + "integrity": "sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=", + "dev": true, + "requires": { + "mime-types": "2.1.18", + "negotiator": "0.6.1" + } + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "dev": true, + "requires": { + "mime-db": "1.33.0" + } + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", + "dev": true + } + } + }, + "es5-ext": { + "version": "0.10.39", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.39.tgz", + "integrity": "sha512-AlaXZhPHl0po/uxMx1tyrlt1O86M6D5iVaDH8UgLfgek4kXTX6vzsRfJQWC2Ku+aG8pkw1XWzh9eTkwfVrsD5g==", + "dev": true, + "requires": { + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.39", + "es6-symbol": "3.1.1" + } + }, + "es6-map": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", + "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.39", + "es6-iterator": "2.0.3", + "es6-set": "0.1.5", + "es6-symbol": "3.1.1", + "event-emitter": "0.3.5" + } + }, + "es6-set": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", + "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.39", + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1", + "event-emitter": "0.3.5" + } + }, + "es6-symbol": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.39" + } + }, + "es6-weak-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", + "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.39", + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escope": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", + "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", + "dev": true, + "requires": { + "es6-map": "0.1.5", + "es6-weak-map": "2.0.2", + "esrecurse": "4.2.0", + "estraverse": "4.2.0" + } + }, + "eslint": { + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-3.19.0.tgz", + "integrity": "sha1-yPxiAcf0DdCJQbh8CFdnOGpnmsw=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "chalk": "1.1.3", + "concat-stream": "1.6.0", + "debug": "2.6.9", + "doctrine": "2.1.0", + "escope": "3.6.0", + "espree": "3.5.3", + "esquery": "1.0.0", + "estraverse": "4.2.0", + "esutils": "2.0.2", + "file-entry-cache": "2.0.0", + "glob": "7.1.2", + "globals": "9.18.0", + "ignore": "3.3.7", + "imurmurhash": "0.1.4", + "inquirer": "0.12.0", + "is-my-json-valid": "2.17.2", + "is-resolvable": "1.1.0", + "js-yaml": "3.10.0", + "json-stable-stringify": "1.0.1", + "levn": "0.3.0", + "lodash": "4.17.5", + "mkdirp": "0.5.1", + "natural-compare": "1.4.0", + "optionator": "0.8.2", + "path-is-inside": "1.0.2", + "pluralize": "1.2.1", + "progress": "1.1.8", + "require-uncached": "1.0.3", + "shelljs": "0.7.8", + "strip-bom": "3.0.0", + "strip-json-comments": "2.0.1", + "table": "3.8.3", + "text-table": "0.2.0", + "user-home": "2.0.0" + }, + "dependencies": { + "user-home": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", + "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=", + "dev": true, + "requires": { + "os-homedir": "1.0.2" + } + } + } + }, + "eslint-config-airbnb-base": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-5.0.3.tgz", + "integrity": "sha1-lxSsNews1/qw1E0Uip+R2ylEB00=", + "dev": true + }, + "eslint-import-resolver-node": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", + "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", + "dev": true, + "requires": { + "debug": "2.6.9", + "resolve": "1.5.0" + } + }, + "eslint-import-resolver-webpack": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-webpack/-/eslint-import-resolver-webpack-0.5.1.tgz", + "integrity": "sha1-wYbXtC+qnTNSRV6EGldI8ZCQldA=", + "dev": true, + "requires": { + "array-find": "1.0.0", + "debug": "2.6.9", + "enhanced-resolve": "0.9.1", + "find-root": "0.1.2", + "interpret": "1.1.0", + "is-absolute": "0.2.6", + "lodash.get": "3.7.0", + "node-libs-browser": "1.1.1", + "object-assign": "4.1.1", + "resolve": "1.5.0", + "semver": "5.5.0" + } + }, + "eslint-module-utils": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz", + "integrity": "sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw==", + "dev": true, + "requires": { + "debug": "2.6.9", + "pkg-dir": "1.0.0" + } + }, + "eslint-plugin-import": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.8.0.tgz", + "integrity": "sha512-Rf7dfKJxZ16QuTgVv1OYNxkZcsu/hULFnC+e+w0Gzi6jMC3guQoWQgxYxc54IDRinlb6/0v5z/PxxIKmVctN+g==", + "dev": true, + "requires": { + "builtin-modules": "1.1.1", + "contains-path": "0.1.0", + "debug": "2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "0.3.2", + "eslint-module-utils": "2.1.1", + "has": "1.0.1", + "lodash.cond": "4.5.2", + "minimatch": "3.0.4", + "read-pkg-up": "2.0.0" + }, + "dependencies": { + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "2.0.2", + "isarray": "1.0.0" + } + } + } + }, + "eslint-plugin-node": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-5.2.1.tgz", + "integrity": "sha512-xhPXrh0Vl/b7870uEbaumb2Q+LxaEcOQ3kS1jtIXanBAwpMre1l5q/l2l/hESYJGEFKuI78bp6Uw50hlpr7B+g==", + "dev": true, + "requires": { + "ignore": "3.3.7", + "minimatch": "3.0.4", + "resolve": "1.5.0", + "semver": "5.3.0" + }, + "dependencies": { + "semver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "dev": true + } + } + }, + "eslint-plugin-promise": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.6.0.tgz", + "integrity": "sha512-YQzM6TLTlApAr7Li8vWKR+K3WghjwKcYzY0d2roWap4SLK+kzuagJX/leTetIDWsFcTFnKNJXWupDCD6aZkP2Q==", + "dev": true + }, + "eslint-plugin-standard": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz", + "integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=", + "dev": true + }, + "espree": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.3.tgz", + "integrity": "sha512-Zy3tAJDORxQZLl2baguiRU1syPERAIg0L+JB2MWorORgTu/CplzvxS9WWA7Xh4+Q+eOQihNs/1o1Xep8cvCxWQ==", + "dev": true, + "requires": { + "acorn": "5.4.1", + "acorn-jsx": "3.0.1" + } + }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + }, + "esquery": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", + "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "esrecurse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz", + "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", + "dev": true, + "requires": { + "estraverse": "4.2.0", + "object-assign": "4.1.1" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "etag": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.7.0.tgz", + "integrity": "sha1-A9MLX2fdbmMtKUXTDWZScxo01dg=", + "dev": true + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.39" + } + }, + "event-target-shim": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-1.1.1.tgz", + "integrity": "sha1-qG5e5r2qFgVEddp5fM3fDFVphJE=", + "dev": true + }, + "events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "1.3.4", + "safe-buffer": "5.1.1" + } + }, + "exec-sh": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.1.tgz", + "integrity": "sha512-aLt95pexaugVtQerpmE51+4QfWrNc304uez7jvj6fWnN8GeEHpttB8F36n8N7uVhUMbH/1enbxQ9HImZ4w/9qg==", + "dev": true, + "requires": { + "merge": "1.2.0" + } + }, + "exit-hook": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", + "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", + "dev": true + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "2.2.3" + } + }, + "express-session": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.11.3.tgz", + "integrity": "sha1-XMmPP1/4Ttg1+Ry/CqvQxxB0AK8=", + "dev": true, + "requires": { + "cookie": "0.1.3", + "cookie-signature": "1.0.6", + "crc": "3.3.0", + "debug": "2.2.0", + "depd": "1.0.1", + "on-headers": "1.0.1", + "parseurl": "1.3.2", + "uid-safe": "2.0.0", + "utils-merge": "1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "0.7.1" + } + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + }, + "uid-safe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.0.0.tgz", + "integrity": "sha1-p/PGymSh9qXQTsDvPkw9U2cxcTc=", + "dev": true, + "requires": { + "base64-url": "1.2.1" + } + } + } + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "dev": true + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fancy-log": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.2.tgz", + "integrity": "sha1-9BEl49hPLn2JpD0G2VjI94vha+E=", + "dev": true, + "requires": { + "ansi-gray": "0.1.1", + "color-support": "1.1.3", + "time-stamp": "1.1.0" + } + }, + "fast-deep-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", + "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fb-watchman": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.0.tgz", + "integrity": "sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg=", + "dev": true, + "requires": { + "bser": "2.0.0" + }, + "dependencies": { + "bser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.0.0.tgz", + "integrity": "sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk=", + "dev": true, + "requires": { + "node-int64": "0.4.0" + } + } + } + }, + "fbjs": { + "version": "0.8.16", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.16.tgz", + "integrity": "sha1-XmdDL1UNxBtXK/VYR7ispk5TN9s=", + "dev": true, + "requires": { + "core-js": "1.2.7", + "isomorphic-fetch": "2.2.1", + "loose-envify": "1.3.1", + "object-assign": "4.1.1", + "promise": "7.3.1", + "setimmediate": "1.0.5", + "ua-parser-js": "0.7.17" + }, + "dependencies": { + "core-js": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=", + "dev": true + } + } + }, + "fbjs-scripts": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/fbjs-scripts/-/fbjs-scripts-0.7.1.tgz", + "integrity": "sha1-TxFeIY4kPjrdvw7dqsHjxi9wP6w=", + "dev": true, + "requires": { + "babel-core": "6.26.0", + "babel-preset-fbjs": "1.0.0", + "core-js": "1.2.7", + "cross-spawn": "3.0.1", + "gulp-util": "3.0.8", + "object-assign": "4.1.1", + "semver": "5.5.0", + "through2": "2.0.3" + }, + "dependencies": { + "babel-preset-fbjs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/babel-preset-fbjs/-/babel-preset-fbjs-1.0.0.tgz", + "integrity": "sha1-yXLlybMB1OyeeXH0rsPhSsAXqLA=", + "dev": true, + "requires": { + "babel-plugin-check-es2015-constants": "6.22.0", + "babel-plugin-syntax-flow": "6.18.0", + "babel-plugin-syntax-object-rest-spread": "6.13.0", + "babel-plugin-syntax-trailing-function-commas": "6.22.0", + "babel-plugin-transform-class-properties": "6.24.1", + "babel-plugin-transform-es2015-arrow-functions": "6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "6.22.0", + "babel-plugin-transform-es2015-block-scoping": "6.26.0", + "babel-plugin-transform-es2015-classes": "6.24.1", + "babel-plugin-transform-es2015-computed-properties": "6.24.1", + "babel-plugin-transform-es2015-destructuring": "6.23.0", + "babel-plugin-transform-es2015-for-of": "6.23.0", + "babel-plugin-transform-es2015-literals": "6.22.0", + "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", + "babel-plugin-transform-es2015-object-super": "6.24.1", + "babel-plugin-transform-es2015-parameters": "6.24.1", + "babel-plugin-transform-es2015-shorthand-properties": "6.24.1", + "babel-plugin-transform-es2015-spread": "6.22.0", + "babel-plugin-transform-es2015-template-literals": "6.22.0", + "babel-plugin-transform-es3-member-expression-literals": "6.22.0", + "babel-plugin-transform-es3-property-literals": "6.22.0", + "babel-plugin-transform-flow-strip-types": "6.22.0", + "babel-plugin-transform-object-rest-spread": "6.26.0", + "object-assign": "4.1.1" + } + }, + "core-js": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=", + "dev": true + }, + "cross-spawn": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz", + "integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=", + "dev": true, + "requires": { + "lru-cache": "4.1.1", + "which": "1.3.0" + } + } + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5", + "object-assign": "4.1.1" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "1.3.0", + "object-assign": "4.1.1" + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fill-range": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", + "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "dev": true, + "requires": { + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "1.1.7", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" + } + }, + "finalhandler": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-0.4.0.tgz", + "integrity": "sha1-llpS2ejQXSuFdUhUH7ibU6JJfZs=", + "dev": true, + "requires": { + "debug": "2.2.0", + "escape-html": "1.0.2", + "on-finished": "2.3.0", + "unpipe": "1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "0.7.1" + } + }, + "escape-html": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.2.tgz", + "integrity": "sha1-130y+pjjjC9BroXpJ44ODmuhAiw=", + "dev": true + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + } + } + }, + "find-cache-dir": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz", + "integrity": "sha1-yN765XyKUqinhPnjHFfHQumToLk=", + "dev": true, + "requires": { + "commondir": "1.0.1", + "mkdirp": "0.5.1", + "pkg-dir": "1.0.0" + } + }, + "find-root": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/find-root/-/find-root-0.1.2.tgz", + "integrity": "sha1-mNImfP8ZFsyvJ0OzoO6oHXnX3NE=", + "dev": true + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, + "requires": { + "circular-json": "0.3.3", + "del": "2.2.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "1.0.2" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "dev": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.6", + "mime-types": "2.1.18" + }, + "dependencies": { + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "dev": true, + "requires": { + "mime-db": "1.33.0" + } + } + } + }, + "fresh": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.3.0.tgz", + "integrity": "sha1-ZR+DjiJCTnVm3hYdg1jKoZn4PU8=", + "dev": true + }, + "fs-extra": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", + "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "jsonfile": "2.4.0", + "klaw": "1.3.1" + }, + "dependencies": { + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11" + } + } + } + }, + "fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", + "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", + "dev": true, + "optional": true, + "requires": { + "nan": "2.8.0", + "node-pre-gyp": "0.6.39" + }, + "dependencies": { + "abbrev": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "ajv": { + "version": "4.11.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.2.9" + } + }, + "asn1": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "assert-plus": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws-sign2": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws4": { + "version": "1.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "balanced-match": { + "version": "0.4.2", + "bundled": true, + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "block-stream": { + "version": "0.0.9", + "bundled": true, + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "boom": { + "version": "2.10.1", + "bundled": true, + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.7", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "0.4.2", + "concat-map": "0.0.1" + } + }, + "buffer-shims": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "caseless": { + "version": "0.12.0", + "bundled": true, + "dev": true, + "optional": true + }, + "co": { + "version": "4.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "combined-stream": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "bundled": true, + "dev": true, + "requires": { + "boom": "2.10.1" + } + }, + "dashdash": { + "version": "1.14.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "debug": { + "version": "2.6.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "bundled": true, + "dev": true, + "optional": true + }, + "delayed-stream": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "extend": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "extsprintf": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "optional": true + }, + "form-data": { + "version": "2.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.15" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "fstream": { + "version": "1.0.11", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.1" + } + }, + "fstream-ignore": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fstream": "1.0.11", + "inherits": "2.0.3", + "minimatch": "3.0.4" + } + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "1.1.1", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "getpass": { + "version": "0.1.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true, + "dev": true + }, + "har-schema": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "har-validator": { + "version": "4.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ajv": "4.11.8", + "har-schema": "1.0.5" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "hawk": { + "version": "3.1.3", + "bundled": true, + "dev": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "bundled": true, + "dev": true + }, + "http-signature": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.0", + "sshpk": "1.13.0" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.4", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "isstream": { + "version": "0.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "jodid25519": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "jsonify": { + "version": "0.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "jsprim": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.0.2", + "json-schema": "0.2.3", + "verror": "1.3.6" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "mime-db": { + "version": "1.27.0", + "bundled": true, + "dev": true + }, + "mime-types": { + "version": "2.1.15", + "bundled": true, + "dev": true, + "requires": { + "mime-db": "1.27.0" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "node-pre-gyp": { + "version": "0.6.39", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "1.0.2", + "hawk": "3.1.3", + "mkdirp": "0.5.1", + "nopt": "4.0.1", + "npmlog": "4.1.0", + "rc": "1.2.1", + "request": "2.81.0", + "rimraf": "2.6.1", + "semver": "5.3.0", + "tar": "2.2.1", + "tar-pack": "3.4.0" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1.1.0", + "osenv": "0.1.4" + } + }, + "npmlog": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "oauth-sign": { + "version": "0.8.2", + "bundled": true, + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "performance-now": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "1.0.7", + "bundled": true, + "dev": true + }, + "punycode": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "optional": true + }, + "qs": { + "version": "6.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.2.9", + "bundled": true, + "dev": true, + "requires": { + "buffer-shims": "1.0.0", + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "1.0.1", + "util-deprecate": "1.0.2" + } + }, + "request": { + "version": "2.81.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.15", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.0.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.6.0", + "uuid": "3.0.1" + } + }, + "rimraf": { + "version": "2.6.1", + "bundled": true, + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.0.1", + "bundled": true, + "dev": true + }, + "semver": { + "version": "5.3.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sntp": { + "version": "1.0.9", + "bundled": true, + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "sshpk": { + "version": "1.13.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jodid25519": "1.0.2", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "stringstream": { + "version": "0.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "2.2.1", + "bundled": true, + "dev": true, + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-pack": { + "version": "3.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "2.6.8", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", + "once": "1.4.0", + "readable-stream": "2.2.9", + "rimraf": "2.6.1", + "tar": "2.2.1", + "uid-number": "0.0.6" + } + }, + "tough-cookie": { + "version": "2.3.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "punycode": "1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "bundled": true, + "dev": true, + "optional": true + }, + "uid-number": { + "version": "0.0.6", + "bundled": true, + "dev": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "uuid": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "verror": { + "version": "1.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "extsprintf": "1.0.2" + } + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + } + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "gauge": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.7.tgz", + "integrity": "sha1-6c7FSD09TuDvRLYKfZnkk14TbZM=", + "dev": true, + "requires": { + "ansi": "0.3.1", + "has-unicode": "2.0.1", + "lodash.pad": "4.5.1", + "lodash.padend": "4.6.1", + "lodash.padstart": "4.6.1" + } + }, + "generate-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", + "dev": true + }, + "generate-object-property": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", + "dev": true, + "requires": { + "is-property": "1.0.2" + } + }, + "get-caller-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "1.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "2.0.1" + } + }, + "global": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", + "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", + "dev": true, + "requires": { + "min-document": "2.19.0", + "process": "0.5.2" + }, + "dependencies": { + "process": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", + "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=", + "dev": true + } + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "glogg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.1.tgz", + "integrity": "sha512-ynYqXLoluBKf9XGR1gA59yEJisIL7YHEH4xr3ZziHB5/yl4qWfaK8Js9jGe6gBGCSCKVqiyO30WnRZADvemUNw==", + "dev": true, + "requires": { + "sparkles": "1.0.0" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "gulp-util": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.8.tgz", + "integrity": "sha1-AFTh50RQLifATBh8PsxQXdVLu08=", + "dev": true, + "requires": { + "array-differ": "1.0.0", + "array-uniq": "1.0.3", + "beeper": "1.1.1", + "chalk": "1.1.3", + "dateformat": "2.2.0", + "fancy-log": "1.3.2", + "gulplog": "1.0.0", + "has-gulplog": "0.1.0", + "lodash._reescape": "3.0.0", + "lodash._reevaluate": "3.0.0", + "lodash._reinterpolate": "3.0.0", + "lodash.template": "3.6.2", + "minimist": "1.2.0", + "multipipe": "0.1.2", + "object-assign": "3.0.0", + "replace-ext": "0.0.1", + "through2": "2.0.3", + "vinyl": "0.5.3" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", + "dev": true + } + } + }, + "gulplog": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", + "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", + "dev": true, + "requires": { + "glogg": "1.0.1" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "dev": true, + "requires": { + "ajv": "5.5.2", + "har-schema": "2.0.0" + }, + "dependencies": { + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.0.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + } + } + }, + "has": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "dev": true, + "requires": { + "function-bind": "1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "has-gulplog": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", + "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", + "dev": true, + "requires": { + "sparkles": "1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true + }, + "hash-base": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", + "integrity": "sha1-ZuodhW206KVHDK32/OI65SRO8uE=", + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" + } + }, + "hawk": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", + "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", + "dev": true, + "requires": { + "boom": "4.3.1", + "cryptiles": "3.1.2", + "hoek": "4.2.1", + "sntp": "2.1.0" + }, + "dependencies": { + "hoek": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", + "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==", + "dev": true + } + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "1.1.3", + "minimalistic-assert": "1.0.0", + "minimalistic-crypto-utils": "1.0.1" + } + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "dev": true + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "hosted-git-info": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", + "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", + "dev": true + }, + "http-errors": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.3.1.tgz", + "integrity": "sha1-GX4izevUGYWF6GlO9nhhl7ke2UI=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "statuses": "1.4.0" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "jsprim": "1.4.1", + "sshpk": "1.13.1" + } + }, + "https-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", + "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=", + "dev": true + }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", + "dev": true + }, + "ieee754": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", + "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=" + }, + "ignore": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", + "dev": true + }, + "image-size": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.3.5.tgz", + "integrity": "sha1-gyQOqy+1sAsEqrjHSwRx6cunrYw=", + "dev": true + }, + "immutable": { + "version": "3.7.6", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-3.7.6.tgz", + "integrity": "sha1-E7TTyxK++hVIKib+Gy665kAHHks=", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "inquirer": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", + "integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=", + "dev": true, + "requires": { + "ansi-escapes": "1.4.0", + "ansi-regex": "2.1.1", + "chalk": "1.1.3", + "cli-cursor": "1.0.2", + "cli-width": "2.2.0", + "figures": "1.7.0", + "lodash": "4.17.5", + "readline2": "1.0.1", + "run-async": "0.1.0", + "rx-lite": "3.1.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "through": "2.3.8" + } + }, + "interpret": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", + "dev": true + }, + "invariant": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.3.tgz", + "integrity": "sha512-7Z5PPegwDTyjbaeCnV0efcyS6vdKAU51kpEmS7QFib3P4822l8ICYyMn7qvJnc+WzLoDsuI9gPMKbJ8pCu8XtA==", + "dev": true, + "requires": { + "loose-envify": "1.3.1" + } + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "is-absolute": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.2.6.tgz", + "integrity": "sha1-IN5p89uULvLYe5wto28XIjWxtes=", + "dev": true, + "requires": { + "is-relative": "0.2.1", + "is-windows": "0.2.0" + }, + "dependencies": { + "is-windows": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-0.2.0.tgz", + "integrity": "sha1-3hqm1j6indJIc3tp8f+LgALSEIw=", + "dev": true + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "1.11.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "is-my-ip-valid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", + "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==", + "dev": true + }, + "is-my-json-valid": { + "version": "2.17.2", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz", + "integrity": "sha512-IBhBslgngMQN8DDSppmgDv7RNrlFotuuDsKcrCP3+HbFaVivIBU7u9oiiErw8sH4ynx3+gOGQ3q2otkgiSi6kg==", + "dev": true, + "requires": { + "generate-function": "2.0.0", + "generate-object-property": "1.2.0", + "is-my-ip-valid": "1.0.0", + "jsonpointer": "4.0.1", + "xtend": "4.0.1" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", + "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", + "dev": true, + "requires": { + "is-path-inside": "1.0.1" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "1.0.2" + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", + "dev": true + }, + "is-relative": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.2.1.tgz", + "integrity": "sha1-0n9MfVFtF1+2ENuEu+7yPDvJeqU=", + "dev": true, + "requires": { + "is-unc-path": "0.1.2" + } + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-unc-path": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-0.1.2.tgz", + "integrity": "sha1-arBTpyVzwQJQ/0FqOBTDUXivObk=", + "dev": true, + "requires": { + "unc-path-regex": "0.1.2" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isemail": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/isemail/-/isemail-1.2.0.tgz", + "integrity": "sha1-vgPfjMPineTSxd9lASY/H6RZXpo=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "isomorphic-fetch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", + "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", + "dev": true, + "requires": { + "node-fetch": "1.7.3", + "whatwg-fetch": "2.0.3" + } + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "jest-docblock": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-20.0.3.tgz", + "integrity": "sha1-F76phDQswz2DxQ++FUXqDvqkRxI=", + "dev": true + }, + "jest-haste-map": { + "version": "20.0.5", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-20.0.5.tgz", + "integrity": "sha512-0IKAQjUvuZjMCNi/0VNQQF74/H9KB67hsHJqGiwTWQC6XO5Azs7kLWm+6Q/dwuhvDUvABDOBMFK2/FwZ3sZ07Q==", + "dev": true, + "requires": { + "fb-watchman": "2.0.0", + "graceful-fs": "4.1.11", + "jest-docblock": "20.0.3", + "micromatch": "2.3.11", + "sane": "1.6.0", + "worker-farm": "1.5.2" + }, + "dependencies": { + "bser": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bser/-/bser-1.0.2.tgz", + "integrity": "sha1-OBEWlwsqbe6lZG3RXdcnhES1YWk=", + "dev": true, + "requires": { + "node-int64": "0.4.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "sane": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/sane/-/sane-1.6.0.tgz", + "integrity": "sha1-lhDEUjB6E10pwf3+JUcDQYDEZ3U=", + "dev": true, + "requires": { + "anymatch": "1.3.2", + "exec-sh": "0.2.1", + "fb-watchman": "1.9.2", + "minimatch": "3.0.4", + "minimist": "1.2.0", + "walker": "1.0.7", + "watch": "0.10.0" + }, + "dependencies": { + "fb-watchman": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-1.9.2.tgz", + "integrity": "sha1-okz0eCf4LTj7Waaa1wt247auc4M=", + "dev": true, + "requires": { + "bser": "1.0.2" + } + } + } + } + } + }, + "joi": { + "version": "6.10.1", + "resolved": "https://registry.npmjs.org/joi/-/joi-6.10.1.tgz", + "integrity": "sha1-TVDDGAeRIgAP5fFq8f+OGRe3fgY=", + "dev": true, + "requires": { + "hoek": "2.16.3", + "isemail": "1.2.0", + "moment": "2.20.1", + "topo": "1.1.0" + } + }, + "js-cookie": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-2.2.0.tgz", + "integrity": "sha1-Gywnmm7s44ChIWi5JIUmWzWx7/s=" + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "dev": true, + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.0" + } + }, + "js2xmlparser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-3.0.0.tgz", + "integrity": "sha1-P7YOqgicVED5MZ9RdgzNB+JJlzM=", + "dev": true, + "requires": { + "xmlcreate": "1.0.2" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true, + "optional": true + }, + "jsdoc": { + "version": "3.5.5", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.5.5.tgz", + "integrity": "sha512-6PxB65TAU4WO0Wzyr/4/YhlGovXl0EVYfpKbpSroSj0qBxT4/xod/l40Opkm38dRHRdQgdeY836M0uVnJQG7kg==", + "dev": true, + "requires": { + "babylon": "7.0.0-beta.19", + "bluebird": "3.5.1", + "catharsis": "0.8.9", + "escape-string-regexp": "1.0.5", + "js2xmlparser": "3.0.0", + "klaw": "2.0.0", + "marked": "0.3.15", + "mkdirp": "0.5.1", + "requizzle": "0.2.1", + "strip-json-comments": "2.0.1", + "taffydb": "2.6.2", + "underscore": "1.8.3" + }, + "dependencies": { + "babylon": { + "version": "7.0.0-beta.19", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.19.tgz", + "integrity": "sha512-Vg0C9s/REX6/WIXN37UKpv5ZhRi6A4pjHlpkE34+8/a6c2W1Q692n3hmc+SZG5lKRnaExLUbxtJ1SVT+KaCQ/A==", + "dev": true + } + } + }, + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + }, + "json-loader": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/json-loader/-/json-loader-0.5.7.tgz", + "integrity": "sha512-QLPs8Dj7lnf3e3QYS1zkCo+4ZwqOiF9d/nZnYozTISxXWCfNs9yuky5rJw4/W34s7POaNlbZmQGaB5NiXCbP4w==", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11" + } + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsonpointer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", + "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + }, + "klaw": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-2.0.0.tgz", + "integrity": "sha1-WcEo4Nxc5BAgEVEZTuucv4WGUPY=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "1.0.0" + } + }, + "left-pad": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.2.0.tgz", + "integrity": "sha1-0wpzxrggHY99jnlWupYWCHpo4O4=", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "strip-bom": "3.0.0" + } + }, + "loader-runner": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.0.tgz", + "integrity": "sha1-9IKuqC1UPgeSFwDVpG7yb9rGuKI=", + "dev": true + }, + "loader-utils": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "dev": true, + "requires": { + "big.js": "3.2.0", + "emojis-list": "2.1.0", + "json5": "0.5.1", + "object-assign": "4.1.1" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "2.0.0", + "path-exists": "3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + }, + "lodash._basecopy": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", + "dev": true + }, + "lodash._baseget": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/lodash._baseget/-/lodash._baseget-3.7.2.tgz", + "integrity": "sha1-G2rh1frPPCVTI1ChPBGXy4u2dPQ=", + "dev": true + }, + "lodash._basetostring": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz", + "integrity": "sha1-0YYdh3+CSlL2aYMtyvPuFVZqB9U=", + "dev": true + }, + "lodash._basevalues": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz", + "integrity": "sha1-W3dXYoAr3j0yl1A+JjAIIP32Ybc=", + "dev": true + }, + "lodash._getnative": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", + "dev": true + }, + "lodash._isiterateecall": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", + "dev": true + }, + "lodash._reescape": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reescape/-/lodash._reescape-3.0.0.tgz", + "integrity": "sha1-Kx1vXf4HyKNVdT5fJ/rH8c3hYWo=", + "dev": true + }, + "lodash._reevaluate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz", + "integrity": "sha1-WLx0xAZklTrgsSTYBpltrKQx4u0=", + "dev": true + }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", + "dev": true + }, + "lodash._root": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", + "integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=", + "dev": true + }, + "lodash._topath": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/lodash._topath/-/lodash._topath-3.8.1.tgz", + "integrity": "sha1-PsXiYGAU9MuX91X+aRTt2L/ADqw=", + "dev": true, + "requires": { + "lodash.isarray": "3.0.4" + } + }, + "lodash.cond": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz", + "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=", + "dev": true + }, + "lodash.escape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz", + "integrity": "sha1-mV7g3BjBtIzJLv+ucaEKq1tIdpg=", + "dev": true, + "requires": { + "lodash._root": "3.0.1" + } + }, + "lodash.get": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-3.7.0.tgz", + "integrity": "sha1-POaK4skWg7KBzFOUEoMDy/deaR8=", + "dev": true, + "requires": { + "lodash._baseget": "3.7.2", + "lodash._topath": "3.8.1" + } + }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", + "dev": true + }, + "lodash.isarray": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", + "dev": true + }, + "lodash.keys": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "dev": true, + "requires": { + "lodash._getnative": "3.9.1", + "lodash.isarguments": "3.1.0", + "lodash.isarray": "3.0.4" + } + }, + "lodash.pad": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-4.5.1.tgz", + "integrity": "sha1-QzCUmoM6fI2iLMIPaibE1Z3runA=", + "dev": true + }, + "lodash.padend": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.6.1.tgz", + "integrity": "sha1-U8y6BH0G4VjTEfRdpiX05J5vFm4=", + "dev": true + }, + "lodash.padstart": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.padstart/-/lodash.padstart-4.6.1.tgz", + "integrity": "sha1-0uPuv/DZ05rVD1y9G1KnvOa7YRs=", + "dev": true + }, + "lodash.restparam": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", + "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=", + "dev": true + }, + "lodash.template": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.2.tgz", + "integrity": "sha1-+M3sxhaaJVvpCYrosMU9N4kx0U8=", + "dev": true, + "requires": { + "lodash._basecopy": "3.0.1", + "lodash._basetostring": "3.0.1", + "lodash._basevalues": "3.0.0", + "lodash._isiterateecall": "3.0.9", + "lodash._reinterpolate": "3.0.0", + "lodash.escape": "3.2.0", + "lodash.keys": "3.1.2", + "lodash.restparam": "3.6.1", + "lodash.templatesettings": "3.1.1" + } + }, + "lodash.templatesettings": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz", + "integrity": "sha1-+zB4RHU7Zrnxr6VOJix0UwfbqOU=", + "dev": true, + "requires": { + "lodash._reinterpolate": "3.0.0", + "lodash.escape": "3.2.0" + } + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "loose-envify": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", + "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", + "dev": true, + "requires": { + "js-tokens": "3.0.2" + } + }, + "lru-cache": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", + "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "dev": true, + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "makeerror": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", + "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", + "dev": true, + "requires": { + "tmpl": "1.0.4" + } + }, + "marked": { + "version": "0.3.15", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.15.tgz", + "integrity": "sha512-PToZtmCYVf4mlkmfoDPpsg3VJhkEvCHeTXSxbG3FBBxEoLAlxAsYPCADWx4+XBebMXCowDW7vaOGfRVjmFDM5w==", + "dev": true + }, + "md5.js": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", + "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", + "dev": true, + "requires": { + "hash-base": "3.0.4", + "inherits": "2.0.3" + }, + "dependencies": { + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.1" + } + } + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "dev": true + }, + "memory-fs": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.2.0.tgz", + "integrity": "sha1-8rslNovBIeORwlIN6Slpyu4KApA=", + "dev": true + }, + "merge": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz", + "integrity": "sha1-dTHjnUlJwoGma4xabgJl6LBYlNo=", + "dev": true + }, + "method-override": { + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/method-override/-/method-override-2.3.10.tgz", + "integrity": "sha1-49r41d7hDdLc59SuiNYrvud0drQ=", + "dev": true, + "requires": { + "debug": "2.6.9", + "methods": "1.1.2", + "parseurl": "1.3.2", + "vary": "1.1.2" + }, + "dependencies": { + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true + } + } + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.4" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "brorand": "1.1.0" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + }, + "mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", + "dev": true + }, + "mime-types": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.11.tgz", + "integrity": "sha1-wlnEcb2oCKhdbNGTtDCl+uRHOzw=", + "dev": true, + "requires": { + "mime-db": "1.23.0" + }, + "dependencies": { + "mime-db": { + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.23.0.tgz", + "integrity": "sha1-oxtAcK2uon1zLqMzdApk0OyaZlk=", + "dev": true + } + } + }, + "min-document": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", + "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", + "dev": true, + "requires": { + "dom-walk": "0.1.1" + } + }, + "minimalistic-assert": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", + "integrity": "sha1-cCvi3aazf0g2vLP121ZkG2Sh09M=", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "moment": { + "version": "2.20.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.20.1.tgz", + "integrity": "sha512-Yh9y73JRljxW5QxN08Fner68eFLxM5ynNOAw2LbIB1YAGeQzZT8QFSUvkAz609Zf+IHhhaUxqZK8dG3W/+HEvg==", + "dev": true + }, + "morgan": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.6.1.tgz", + "integrity": "sha1-X9gYOYxoGcuiinzWZk8pL+HAu/I=", + "dev": true, + "requires": { + "basic-auth": "1.0.4", + "debug": "2.2.0", + "depd": "1.0.1", + "on-finished": "2.3.0", + "on-headers": "1.0.1" + }, + "dependencies": { + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "0.7.1" + } + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "multiparty": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/multiparty/-/multiparty-3.3.2.tgz", + "integrity": "sha1-Nd5oBNwZZD5SSfPT473GyM4wHT8=", + "dev": true, + "requires": { + "readable-stream": "1.1.14", + "stream-counter": "0.2.0" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "multipipe": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", + "integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=", + "dev": true, + "requires": { + "duplexer2": "0.0.2" + } + }, + "mute-stream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", + "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=", + "dev": true + }, + "nan": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", + "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=", + "dev": true, + "optional": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "negotiator": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.5.3.tgz", + "integrity": "sha1-Jp1cR2gQ7JLtvntsLygxY4T5p+g=", + "dev": true + }, + "node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "dev": true, + "requires": { + "encoding": "0.1.12", + "is-stream": "1.1.0" + } + }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "dev": true + }, + "node-libs-browser": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-1.1.1.tgz", + "integrity": "sha1-KjgkOr7dff/NB6l8mspWaJdab+o=", + "dev": true, + "requires": { + "assert": "1.4.1", + "browserify-zlib": "0.1.4", + "buffer": "4.9.1", + "console-browserify": "1.1.0", + "constants-browserify": "1.0.0", + "crypto-browserify": "3.12.0", + "domain-browser": "1.2.0", + "events": "1.1.1", + "https-browserify": "0.0.1", + "os-browserify": "0.2.1", + "path-browserify": "0.0.0", + "process": "0.11.10", + "punycode": "1.4.1", + "querystring-es3": "0.2.1", + "readable-stream": "2.3.4", + "stream-browserify": "2.0.1", + "stream-http": "2.8.0", + "string_decoder": "0.10.31", + "timers-browserify": "1.4.2", + "tty-browserify": "0.0.0", + "url": "0.11.0", + "util": "0.10.3", + "vm-browserify": "0.0.4" + }, + "dependencies": { + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "1.0.0", + "browserify-sign": "4.0.4", + "create-ecdh": "4.0.0", + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "diffie-hellman": "5.0.2", + "inherits": "2.0.3", + "pbkdf2": "3.0.14", + "public-encrypt": "4.0.0", + "randombytes": "2.0.6", + "randomfill": "1.0.4" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "2.5.0", + "is-builtin-module": "1.0.0", + "semver": "5.5.0", + "validate-npm-package-license": "3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "1.1.0" + } + }, + "npmlog": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-2.0.4.tgz", + "integrity": "sha1-mLUlMPJRTKkNCexbIsiEZyI3VpI=", + "dev": true, + "requires": { + "ansi": "0.3.1", + "are-we-there-yet": "1.1.4", + "gauge": "1.2.7" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "0.1.5", + "is-extendable": "0.1.1" + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", + "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "opn": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/opn/-/opn-3.0.3.tgz", + "integrity": "sha1-ttmec5n3jWXDuq/+8fsojpuFJDo=", + "dev": true, + "requires": { + "object-assign": "4.1.1" + } + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "0.0.8", + "wordwrap": "0.0.3" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + } + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + } + }, + "options": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz", + "integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8=", + "dev": true + }, + "os-browserify": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.2.1.tgz", + "integrity": "sha1-Y/xMzuXS13Y9Jrv4YBB45sLgBE8=", + "dev": true + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "output-file-sync": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-1.1.2.tgz", + "integrity": "sha1-0KM+7+YaIF+suQCS6CZZjVJFznY=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "mkdirp": "0.5.1", + "object-assign": "4.1.1" + } + }, + "p-limit": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", + "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", + "dev": true, + "requires": { + "p-try": "1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "1.2.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", + "dev": true + }, + "parse-asn1": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz", + "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=", + "dev": true, + "requires": { + "asn1.js": "4.10.1", + "browserify-aes": "1.1.1", + "create-hash": "1.1.3", + "evp_bytestokey": "1.0.3", + "pbkdf2": "3.0.14" + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "0.3.0", + "is-dotfile": "1.0.3", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "1.3.1" + } + }, + "parseurl": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=", + "dev": true + }, + "path-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", + "dev": true + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "2.0.1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "2.3.0" + } + }, + "pause": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/pause/-/pause-0.1.0.tgz", + "integrity": "sha1-68ikqGGf8LioGsFRPDQ0/0af23Q=", + "dev": true + }, + "pbkdf2": { + "version": "3.0.14", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.14.tgz", + "integrity": "sha512-gjsZW9O34fm0R7PaLHRJmLLVfSoesxztjPjE9o6R+qtVJij90ltg1joIovN9GKrRW3t1PzhDDG3UMEMFfZ+1wA==", + "dev": true, + "requires": { + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "ripemd160": "2.0.1", + "safe-buffer": "5.1.1", + "sha.js": "2.4.10" + } + }, + "pegjs": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz", + "integrity": "sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0=", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "pkg-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", + "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "dev": true, + "requires": { + "find-up": "1.1.2" + } + }, + "plist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/plist/-/plist-1.2.0.tgz", + "integrity": "sha1-CEtQk93JJQbiWfh0uNmxr7jHlZM=", + "dev": true, + "requires": { + "base64-js": "0.0.8", + "util-deprecate": "1.0.2", + "xmlbuilder": "4.0.0", + "xmldom": "0.1.27" + }, + "dependencies": { + "base64-js": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz", + "integrity": "sha1-EQHpVE9KdrG8OybUUsqW16NeeXg=", + "dev": true + } + } + }, + "pluralize": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", + "integrity": "sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU=", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "pretty-format": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-4.3.1.tgz", + "integrity": "sha1-UwvlxCs8BbNkFKeipDN6qArNDo0=", + "dev": true + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "progress": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", + "dev": true + }, + "promise": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "dev": true, + "requires": { + "asap": "2.0.6" + } + }, + "prop-types": { + "version": "15.6.0", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.0.tgz", + "integrity": "sha1-zq8IMCL8RrSjX2nhPvda7Q1jmFY=", + "dev": true, + "requires": { + "fbjs": "0.8.16", + "loose-envify": "1.3.1", + "object-assign": "4.1.1" + } + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "public-encrypt": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", + "integrity": "sha1-OfaZ86RlYN1eusvKaTyvfGXBjMY=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.1.3", + "parse-asn1": "5.1.0", + "randombytes": "2.0.6" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "qs": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-4.0.0.tgz", + "integrity": "sha1-wx2bdOwn33XlQ6hseHKO2NRiNgc=", + "dev": true + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "random-bytes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", + "integrity": "sha1-T2ih3Arli9P7lYSMMDJNt11kNgs=", + "dev": true + }, + "randomatic": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", + "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "dev": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "randombytes": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", + "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "2.0.6", + "safe-buffer": "5.1.1" + } + }, + "range-parser": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.0.3.tgz", + "integrity": "sha1-aHKCNTXGkuLCoBA4Jq/YLC4P8XU=", + "dev": true + }, + "raw-body": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.1.7.tgz", + "integrity": "sha1-rf6s4uT7MJgFgBTQjActzFl1h3Q=", + "dev": true, + "requires": { + "bytes": "2.4.0", + "iconv-lite": "0.4.13", + "unpipe": "1.0.0" + }, + "dependencies": { + "bytes": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.4.0.tgz", + "integrity": "sha1-fZcZb51br39pNeJZhVSe3SpsIzk=", + "dev": true + }, + "iconv-lite": { + "version": "0.4.13", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.13.tgz", + "integrity": "sha1-H4irpKsLFQjoMSrMOTRfNumS4vI=", + "dev": true + } + } + }, + "react": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-16.2.0.tgz", + "integrity": "sha512-ZmIomM7EE1DvPEnSFAHZn9Vs9zJl5A9H7el0EGTE6ZbW9FKe/14IYAlPbC8iH25YarEQxZL+E8VW7Mi7kfQrDQ==", + "dev": true, + "requires": { + "fbjs": "0.8.16", + "loose-envify": "1.3.1", + "object-assign": "4.1.1", + "prop-types": "15.6.0" + } + }, + "react-clone-referenced-element": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/react-clone-referenced-element/-/react-clone-referenced-element-1.0.1.tgz", + "integrity": "sha1-K7qMaUBMXkqUQ5hgC8xMlB+GBoI=", + "dev": true + }, + "react-deep-force-update": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/react-deep-force-update/-/react-deep-force-update-1.1.1.tgz", + "integrity": "sha1-vNMUeAJ7ZLMznxCJIatSC0MT3Cw=", + "dev": true + }, + "react-devtools-core": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-2.5.2.tgz", + "integrity": "sha1-+XvsWvrl2TGNFneAZeDCFMTVcUw=", + "dev": true, + "requires": { + "shell-quote": "1.6.1", + "ws": "2.3.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", + "integrity": "sha1-0mPKVGls2KMGtcplUekt5XkY++c=", + "dev": true + }, + "ws": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-2.3.1.tgz", + "integrity": "sha1-a5Sz5EfLajY/eF6vlK9jWejoHIA=", + "dev": true, + "requires": { + "safe-buffer": "5.0.1", + "ultron": "1.1.1" + } + } + } + }, + "react-native": { + "version": "0.44.3", + "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.44.3.tgz", + "integrity": "sha1-BFUOHN/GGacS8/WWnWjNfC3EwHM=", + "dev": true, + "requires": { + "absolute-path": "0.0.0", + "art": "0.10.1", + "async": "2.6.0", + "babel-core": "6.26.0", + "babel-generator": "6.26.1", + "babel-plugin-external-helpers": "6.22.0", + "babel-plugin-syntax-trailing-function-commas": "6.22.0", + "babel-plugin-transform-async-to-generator": "6.16.0", + "babel-plugin-transform-flow-strip-types": "6.22.0", + "babel-plugin-transform-object-rest-spread": "6.26.0", + "babel-polyfill": "6.26.0", + "babel-preset-es2015-node": "6.1.1", + "babel-preset-fbjs": "2.1.4", + "babel-preset-react-native": "1.9.2", + "babel-register": "6.26.0", + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "base64-js": "1.2.3", + "bser": "1.0.3", + "chalk": "1.1.3", + "commander": "2.14.1", + "concat-stream": "1.6.0", + "connect": "2.30.2", + "core-js": "2.5.3", + "debug": "2.6.9", + "denodeify": "1.2.1", + "event-target-shim": "1.1.1", + "fbjs": "0.8.16", + "fbjs-scripts": "0.7.1", + "form-data": "2.3.2", + "fs-extra": "1.0.0", + "glob": "7.1.2", + "graceful-fs": "4.1.11", + "image-size": "0.3.5", + "immutable": "3.7.6", + "imurmurhash": "0.1.4", + "inquirer": "0.12.0", + "jest-haste-map": "20.0.5", + "joi": "6.10.1", + "json-stable-stringify": "1.0.1", + "json5": "0.4.0", + "left-pad": "1.2.0", + "lodash": "4.17.5", + "mime": "1.6.0", + "mime-types": "2.1.11", + "minimist": "1.2.0", + "mkdirp": "0.5.1", + "node-fetch": "1.7.3", + "npmlog": "2.0.4", + "opn": "3.0.3", + "optimist": "0.6.1", + "plist": "1.2.0", + "pretty-format": "4.3.1", + "promise": "7.3.1", + "react-clone-referenced-element": "1.0.1", + "react-devtools-core": "2.5.2", + "react-timer-mixin": "0.13.3", + "react-transform-hmr": "1.0.4", + "rebound": "0.0.13", + "regenerator-runtime": "0.9.6", + "request": "2.83.0", + "rimraf": "2.6.2", + "sane": "1.4.1", + "semver": "5.5.0", + "shell-quote": "1.6.1", + "source-map": "0.5.7", + "stacktrace-parser": "0.1.4", + "temp": "0.8.3", + "throat": "3.2.0", + "uglify-js": "2.7.5", + "whatwg-fetch": "1.1.1", + "wordwrap": "1.0.0", + "worker-farm": "1.5.2", + "write-file-atomic": "1.3.4", + "ws": "1.1.5", + "xcode": "0.9.3", + "xmldoc": "0.4.0", + "xpipe": "1.0.5", + "yargs": "6.6.0" + }, + "dependencies": { + "babel-plugin-transform-async-to-generator": { + "version": "6.16.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.16.0.tgz", + "integrity": "sha1-Gew2yxSGtZ+fRorfpCzhOQjKKZk=", + "dev": true, + "requires": { + "babel-helper-remap-async-to-generator": "6.24.1", + "babel-plugin-syntax-async-functions": "6.13.0", + "babel-runtime": "6.26.0" + } + }, + "json5": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.4.0.tgz", + "integrity": "sha1-BUNS5MTIDIbAkjh31EneF2pzLI0=", + "dev": true + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "regenerator-runtime": { + "version": "0.9.6", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.9.6.tgz", + "integrity": "sha1-0z65XQ0gAaS+OWWXB8UbDLcc4Ck=", + "dev": true + }, + "whatwg-fetch": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-1.1.1.tgz", + "integrity": "sha1-rDydOfMgxtzlM5lp0FTvQ90zMxk=", + "dev": true + } + } + }, + "react-proxy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/react-proxy/-/react-proxy-1.1.8.tgz", + "integrity": "sha1-nb/Z2SdSjDqp9ETkVYw3gwq4wmo=", + "dev": true, + "requires": { + "lodash": "4.17.5", + "react-deep-force-update": "1.1.1" + } + }, + "react-timer-mixin": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/react-timer-mixin/-/react-timer-mixin-0.13.3.tgz", + "integrity": "sha1-Dai5+AfsB9w+hU0ILHN8ZWBbPSI=", + "dev": true + }, + "react-transform-hmr": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/react-transform-hmr/-/react-transform-hmr-1.0.4.tgz", + "integrity": "sha1-4aQL0Krvxy6N/Xp82gmvhQZjl7s=", + "dev": true, + "requires": { + "global": "4.3.2", + "react-proxy": "1.1.8" + } + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "2.0.0", + "normalize-package-data": "2.4.0", + "path-type": "2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "2.1.0", + "read-pkg": "2.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + } + } + }, + "readable-stream": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.4.tgz", + "integrity": "sha512-vuYxeWYM+fde14+rajzqgeohAI7YoJcHE7kXDAc4Nk0EbuKnJfqtY9YtRkLo/tqkuF7MsBQRhPnPeyjYITp3ZQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "readdirp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "minimatch": "3.0.4", + "readable-stream": "2.3.4", + "set-immediate-shim": "1.0.1" + } + }, + "readline2": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", + "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "mute-stream": "0.0.5" + } + }, + "rebound": { + "version": "0.0.13", + "resolved": "https://registry.npmjs.org/rebound/-/rebound-0.0.13.tgz", + "integrity": "sha1-SiJSVMr32nVnl7GcWBe/enlB+sE=", + "dev": true + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "1.5.0" + } + }, + "regenerate": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.3.tgz", + "integrity": "sha512-jVpo1GadrDAK59t/0jRx5VxYWQEDkkEKi6+HjE3joFVLfDOh9Xrdh0dF1eSq+BI/SwvTQ44gSscJ8N5zYL61sg==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + }, + "regenerator-transform": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", + "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "private": "0.1.8" + } + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "0.1.3" + } + }, + "regexpu-core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "dev": true, + "requires": { + "regenerate": "1.3.3", + "regjsgen": "0.2.0", + "regjsparser": "0.1.5" + } + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true, + "requires": { + "jsesc": "0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "1.0.2" + } + }, + "replace-ext": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", + "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", + "dev": true + }, + "request": { + "version": "2.83.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", + "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", + "dev": true, + "requires": { + "aws-sign2": "0.7.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.6", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.3.2", + "har-validator": "5.0.3", + "hawk": "6.0.2", + "http-signature": "1.2.0", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.18", + "oauth-sign": "0.8.2", + "performance-now": "2.1.0", + "qs": "6.5.1", + "safe-buffer": "5.1.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.3", + "tunnel-agent": "0.6.0", + "uuid": "3.2.1" + }, + "dependencies": { + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "dev": true, + "requires": { + "mime-db": "1.33.0" + } + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", + "dev": true + } + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "0.1.0", + "resolve-from": "1.0.1" + } + }, + "requizzle": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.1.tgz", + "integrity": "sha1-aUPDUwxNmn5G8c3dUcFY/GcM294=", + "dev": true, + "requires": { + "underscore": "1.6.0" + }, + "dependencies": { + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", + "dev": true + } + } + }, + "resolve": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", + "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "dev": true, + "requires": { + "path-parse": "1.0.5" + } + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "response-time": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/response-time/-/response-time-2.3.2.tgz", + "integrity": "sha1-/6cbq5UtYvfB1Jt0NDVfvGjf/Fo=", + "dev": true, + "requires": { + "depd": "1.1.2", + "on-headers": "1.0.1" + }, + "dependencies": { + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + } + } + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "1.1.1", + "onetime": "1.1.0" + } + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "requires": { + "align-text": "0.1.4" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "ripemd160": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz", + "integrity": "sha1-D0WEKVxTo2KK9+bXmsohzlfRxuc=", + "dev": true, + "requires": { + "hash-base": "2.0.2", + "inherits": "2.0.3" + } + }, + "rndm": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/rndm/-/rndm-1.2.0.tgz", + "integrity": "sha1-8z/pz7Urv9UgqhgyO8ZdsRCht2w=", + "dev": true + }, + "run-async": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", + "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=", + "dev": true, + "requires": { + "once": "1.4.0" + } + }, + "rx-lite": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", + "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=", + "dev": true + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + }, + "sane": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/sane/-/sane-1.4.1.tgz", + "integrity": "sha1-iPdj10BA9fDCVrYWPbOZvxEKxxU=", + "dev": true, + "requires": { + "exec-sh": "0.2.1", + "fb-watchman": "1.9.2", + "minimatch": "3.0.4", + "minimist": "1.2.0", + "walker": "1.0.7", + "watch": "0.10.0" + }, + "dependencies": { + "bser": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bser/-/bser-1.0.2.tgz", + "integrity": "sha1-OBEWlwsqbe6lZG3RXdcnhES1YWk=", + "dev": true, + "requires": { + "node-int64": "0.4.0" + } + }, + "fb-watchman": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-1.9.2.tgz", + "integrity": "sha1-okz0eCf4LTj7Waaa1wt247auc4M=", + "dev": true, + "requires": { + "bser": "1.0.2" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "sax": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.1.6.tgz", + "integrity": "sha1-XWFr6KXmB9VOEUr65Vt+ry/MMkA=", + "dev": true + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "send": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.13.2.tgz", + "integrity": "sha1-dl52B8gFVFK7pvCwUllTUJhgNt4=", + "dev": true, + "requires": { + "debug": "2.2.0", + "depd": "1.1.2", + "destroy": "1.0.4", + "escape-html": "1.0.3", + "etag": "1.7.0", + "fresh": "0.3.0", + "http-errors": "1.3.1", + "mime": "1.3.4", + "ms": "0.7.1", + "on-finished": "2.3.0", + "range-parser": "1.0.3", + "statuses": "1.2.1" + }, + "dependencies": { + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "0.7.1" + } + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "mime": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", + "integrity": "sha1-EV+eO2s9rylZmDyzjxSaLUDrXVM=", + "dev": true + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + }, + "statuses": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.2.1.tgz", + "integrity": "sha1-3e1FzBglbVHtQK7BQkidXGECbSg=", + "dev": true + } + } + }, + "serve-favicon": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/serve-favicon/-/serve-favicon-2.3.2.tgz", + "integrity": "sha1-3UGeJo3gEqtysxnTN/IQUBP5OB8=", + "dev": true, + "requires": { + "etag": "1.7.0", + "fresh": "0.3.0", + "ms": "0.7.2", + "parseurl": "1.3.2" + }, + "dependencies": { + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "dev": true + } + } + }, + "serve-index": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.7.3.tgz", + "integrity": "sha1-egV/xu4o3GP2RWbl+lexEahq7NI=", + "dev": true, + "requires": { + "accepts": "1.2.13", + "batch": "0.5.3", + "debug": "2.2.0", + "escape-html": "1.0.3", + "http-errors": "1.3.1", + "mime-types": "2.1.11", + "parseurl": "1.3.2" + }, + "dependencies": { + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "0.7.1" + } + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + } + } + }, + "serve-static": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.10.3.tgz", + "integrity": "sha1-zlpuzTEB/tXsCYJ9rCKpwpv7BTU=", + "dev": true, + "requires": { + "escape-html": "1.0.3", + "parseurl": "1.3.2", + "send": "0.13.2" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "dev": true + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "sha.js": { + "version": "2.4.10", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.10.tgz", + "integrity": "sha512-vnwmrFDlOExK4Nm16J2KMWHLrp14lBrjxMxBJpu++EnsuBmpiYaM/MEs46Vxxm/4FvdP5yTwuCTO9it5FSjrqA==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.1" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shell-quote": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "dev": true, + "requires": { + "array-filter": "0.0.1", + "array-map": "0.0.0", + "array-reduce": "0.0.0", + "jsonify": "0.0.0" + } + }, + "shelljs": { + "version": "0.7.8", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", + "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", + "dev": true, + "requires": { + "glob": "7.1.2", + "interpret": "1.1.0", + "rechoir": "0.6.2" + } + }, + "simple-plist": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-0.2.1.tgz", + "integrity": "sha1-cXZts1IyaSjPOoByQrp2IyJjZyM=", + "dev": true, + "requires": { + "bplist-creator": "0.0.7", + "bplist-parser": "0.1.1", + "plist": "2.0.1" + }, + "dependencies": { + "base64-js": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.1.2.tgz", + "integrity": "sha1-1kAMrBxMZgl22Q0HoENR2JOV9eg=", + "dev": true + }, + "plist": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/plist/-/plist-2.0.1.tgz", + "integrity": "sha1-CjLKlIGxw2TpLhjcVch23p0B2os=", + "dev": true, + "requires": { + "base64-js": "1.1.2", + "xmlbuilder": "8.2.2", + "xmldom": "0.1.27" + } + }, + "xmlbuilder": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-8.2.2.tgz", + "integrity": "sha1-aSSGc0ELS6QuGmE2VR0pIjNap3M=", + "dev": true + } + } + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, + "slice-ansi": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", + "dev": true + }, + "slide": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", + "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", + "dev": true + }, + "sntp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", + "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", + "dev": true, + "requires": { + "hoek": "4.2.1" + }, + "dependencies": { + "hoek": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", + "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==", + "dev": true + } + } + }, + "source-list-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.0.tgz", + "integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "0.5.7" + } + }, + "sparkles": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.0.tgz", + "integrity": "sha1-Gsu/tZJDbRC76PeFt8xvgoFQEsM=", + "dev": true + }, + "spdx-correct": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", + "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "dev": true, + "requires": { + "spdx-license-ids": "1.2.2" + } + }, + "spdx-expression-parse": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", + "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", + "dev": true + }, + "spdx-license-ids": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", + "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", + "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "dev": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + } + }, + "stacktrace-parser": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.4.tgz", + "integrity": "sha1-ATl5IuX2Ls8whFUiyVxP4dJefU4=", + "dev": true + }, + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", + "dev": true + }, + "stream-browserify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.4" + } + }, + "stream-buffers": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz", + "integrity": "sha1-kdX1Ew0c75bc+n9yaUUYh0HQnuQ=", + "dev": true + }, + "stream-counter": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/stream-counter/-/stream-counter-0.2.0.tgz", + "integrity": "sha1-3tJmVWMZyLDiIoErnPOyb6fZR94=", + "dev": true, + "requires": { + "readable-stream": "1.1.14" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "stream-http": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.0.tgz", + "integrity": "sha512-sZOFxI/5xw058XIRHl4dU3dZ+TTOIGJR78Dvo0oEAejIt4ou27k+3ne1zYmCV+v7UucbxIFQuOgnkTVHh8YPnw==", + "dev": true, + "requires": { + "builtin-status-codes": "3.0.0", + "inherits": "2.0.3", + "readable-stream": "2.3.4", + "to-arraybuffer": "1.0.1", + "xtend": "4.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "table": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", + "integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=", + "dev": true, + "requires": { + "ajv": "4.11.8", + "ajv-keywords": "1.5.1", + "chalk": "1.1.3", + "lodash": "4.17.5", + "slice-ansi": "0.0.4", + "string-width": "2.1.1" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", + "dev": true + }, + "tapable": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.1.10.tgz", + "integrity": "sha1-KcNXB8K3DlDQdIK10gLo7URtr9Q=", + "dev": true + }, + "temp": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.3.tgz", + "integrity": "sha1-4Ma8TSa5AxJEEOT+2BEDAU38H1k=", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2", + "rimraf": "2.2.8" + }, + "dependencies": { + "rimraf": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", + "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=", + "dev": true + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "throat": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/throat/-/throat-3.2.0.tgz", + "integrity": "sha512-/EY8VpvlqJ+sFtLPeOgc8Pl7kQVOWv0woD87KTXVHPIAE842FGT+rokxIhe8xIUP1cfgrkt0as0vDLjDiMtr8w==", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "2.3.4", + "xtend": "4.0.1" + } + }, + "time-stamp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", + "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", + "dev": true + }, + "timers-browserify": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", + "dev": true, + "requires": { + "process": "0.11.10" + } + }, + "tmpl": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", + "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", + "dev": true + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + }, + "topo": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/topo/-/topo-1.1.0.tgz", + "integrity": "sha1-6ddRYV0buH3IZdsYL6HKCl71NtU=", + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "tough-cookie": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", + "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", + "dev": true, + "requires": { + "punycode": "1.4.1" + } + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "tsscmp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.5.tgz", + "integrity": "sha1-fcSjOvcVgatDN9qR2FylQn69mpc=", + "dev": true + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true, + "optional": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2" + } + }, + "type-is": { + "version": "1.6.16", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", + "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", + "dev": true, + "requires": { + "media-typer": "0.3.0", + "mime-types": "2.1.18" + }, + "dependencies": { + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "dev": true, + "requires": { + "mime-db": "1.33.0" + } + } + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "ua-parser-js": { + "version": "0.7.17", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.17.tgz", + "integrity": "sha512-uRdSdu1oA1rncCQL7sCj8vSyZkgtL7faaw9Tc9rZ3mGgraQ7+Pdx7w5mnOSF3gw9ZNG6oc+KXfkon3bKuROm0g==", + "dev": true + }, + "uglify-js": { + "version": "2.7.5", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.7.5.tgz", + "integrity": "sha1-RhLAx7qu4rp8SH3kkErhIgefLKg=", + "dev": true, + "requires": { + "async": "0.2.10", + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, + "dependencies": { + "async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "dev": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true + }, + "uid-safe": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.4.tgz", + "integrity": "sha1-Otbzg2jG1MjHXsF2I/t5qh0HHYE=", + "dev": true, + "requires": { + "random-bytes": "1.0.0" + } + }, + "ultron": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", + "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", + "dev": true + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true + }, + "underscore": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", + "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", + "dev": true + }, + "underscore-contrib": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/underscore-contrib/-/underscore-contrib-0.3.0.tgz", + "integrity": "sha1-ZltmwkeD+PorGMn4y7Dix9SMJsc=", + "dev": true, + "requires": { + "underscore": "1.6.0" + }, + "dependencies": { + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", + "dev": true + } + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "user-home": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", + "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "utils-merge": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", + "integrity": "sha1-ApT7kiu5N1FTVBxPcJYjHyh8ivg=", + "dev": true + }, + "uuid": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==", + "dev": true + }, + "v8flags": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", + "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", + "dev": true, + "requires": { + "user-home": "1.1.1" + } + }, + "validate-npm-package-license": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", + "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "dev": true, + "requires": { + "spdx-correct": "1.0.2", + "spdx-expression-parse": "1.0.4" + } + }, + "vary": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.0.1.tgz", + "integrity": "sha1-meSYFWaihhGN+yuBc1ffeZM3bRA=", + "dev": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + } + }, + "vhost": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/vhost/-/vhost-3.0.2.tgz", + "integrity": "sha1-L7HezUxGaqiLD5NBrzPcGv8keNU=", + "dev": true + }, + "vinyl": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz", + "integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=", + "dev": true, + "requires": { + "clone": "1.0.3", + "clone-stats": "0.0.1", + "replace-ext": "0.0.1" + } + }, + "vm-browserify": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", + "dev": true, + "requires": { + "indexof": "0.0.1" + } + }, + "walker": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", + "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", + "dev": true, + "requires": { + "makeerror": "1.0.11" + } + }, + "watch": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/watch/-/watch-0.10.0.tgz", + "integrity": "sha1-d3mLLaD5kQ1ZXxrOWwwiWFIfIdw=", + "dev": true + }, + "watchpack": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.4.0.tgz", + "integrity": "sha1-ShRyvLuVK9Cpu0A2gB+VTfs5+qw=", + "dev": true, + "requires": { + "async": "2.6.0", + "chokidar": "1.7.0", + "graceful-fs": "4.1.11" + } + }, + "webpack": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-2.7.0.tgz", + "integrity": "sha512-MjAA0ZqO1ba7ZQJRnoCdbM56mmFpipOPUv/vQpwwfSI42p5PVDdoiuK2AL2FwFUVgT859Jr43bFZXRg/LNsqvg==", + "dev": true, + "requires": { + "acorn": "5.4.1", + "acorn-dynamic-import": "2.0.2", + "ajv": "4.11.8", + "ajv-keywords": "1.5.1", + "async": "2.6.0", + "enhanced-resolve": "3.4.1", + "interpret": "1.1.0", + "json-loader": "0.5.7", + "json5": "0.5.1", + "loader-runner": "2.3.0", + "loader-utils": "0.2.17", + "memory-fs": "0.4.1", + "mkdirp": "0.5.1", + "node-libs-browser": "2.1.0", + "source-map": "0.5.7", + "supports-color": "3.2.3", + "tapable": "0.2.8", + "uglify-js": "2.8.29", + "watchpack": "1.4.0", + "webpack-sources": "1.1.0", + "yargs": "6.6.0" + }, + "dependencies": { + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "1.0.6" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "1.0.0", + "browserify-sign": "4.0.4", + "create-ecdh": "4.0.0", + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "diffie-hellman": "5.0.2", + "inherits": "2.0.3", + "pbkdf2": "3.0.14", + "public-encrypt": "4.0.0", + "randombytes": "2.0.6", + "randomfill": "1.0.4" + } + }, + "enhanced-resolve": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz", + "integrity": "sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "memory-fs": "0.4.1", + "object-assign": "4.1.1", + "tapable": "0.2.8" + } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "dev": true, + "requires": { + "errno": "0.1.7", + "readable-stream": "2.3.4" + } + }, + "node-libs-browser": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz", + "integrity": "sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg==", + "dev": true, + "requires": { + "assert": "1.4.1", + "browserify-zlib": "0.2.0", + "buffer": "4.9.1", + "console-browserify": "1.1.0", + "constants-browserify": "1.0.0", + "crypto-browserify": "3.12.0", + "domain-browser": "1.2.0", + "events": "1.1.1", + "https-browserify": "1.0.0", + "os-browserify": "0.3.0", + "path-browserify": "0.0.0", + "process": "0.11.10", + "punycode": "1.4.1", + "querystring-es3": "0.2.1", + "readable-stream": "2.3.4", + "stream-browserify": "2.0.1", + "stream-http": "2.8.0", + "string_decoder": "1.0.3", + "timers-browserify": "2.0.6", + "tty-browserify": "0.0.0", + "url": "0.11.0", + "util": "0.10.3", + "vm-browserify": "0.0.4" + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "pako": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", + "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", + "dev": true + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "1.0.0" + } + }, + "tapable": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.8.tgz", + "integrity": "sha1-mTcqXJmb8t8WCvwNdL7U9HlIzSI=", + "dev": true + }, + "timers-browserify": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.6.tgz", + "integrity": "sha512-HQ3nbYRAowdVd0ckGFvmJPPCOH/CHleFN/Y0YQCX1DVaB7t+KFvisuyN09fuP8Jtp1CpfSh8O8bMkHbdbPe6Pw==", + "dev": true, + "requires": { + "setimmediate": "1.0.5" + } + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "requires": { + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, + "dependencies": { + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + } + } + } + } + }, + "webpack-sources": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.1.0.tgz", + "integrity": "sha512-aqYp18kPphgoO5c/+NaUvEeACtZjMESmDChuD3NBciVpah3XpMEU9VAAtIaB1BsfJWWTSdv8Vv1m3T0aRk2dUw==", + "dev": true, + "requires": { + "source-list-map": "2.0.0", + "source-map": "0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "whatwg-fetch": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz", + "integrity": "sha1-nITsLc9oGH/wC8ZOEnS0QhduHIQ=", + "dev": true + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "worker-farm": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.5.2.tgz", + "integrity": "sha512-XxiQ9kZN5n6mmnW+mFJ+wXjNNI/Nx4DIdaAKLX1Bn6LYBWlN/zaBhu34DQYPZ1AJobQuu67S2OfDdNSVULvXkQ==", + "dev": true, + "requires": { + "errno": "0.1.7", + "xtend": "4.0.1" + } + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "0.5.1" + } + }, + "write-file-atomic": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", + "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "imurmurhash": "0.1.4", + "slide": "1.1.6" + } + }, + "ws": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.5.tgz", + "integrity": "sha512-o3KqipXNUdS7wpQzBHSe180lBGO60SoK0yVo3CYJgb2MkobuWuBX6dhkYP5ORCLd55y+SaflMOV5fqAB53ux4w==", + "dev": true, + "requires": { + "options": "0.0.6", + "ultron": "1.0.2" + }, + "dependencies": { + "ultron": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", + "integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po=", + "dev": true + } + } + }, + "xcode": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/xcode/-/xcode-0.9.3.tgz", + "integrity": "sha1-kQqJwWrubMC0LKgFptC0z4chHPM=", + "dev": true, + "requires": { + "pegjs": "0.10.0", + "simple-plist": "0.2.1", + "uuid": "3.0.1" + }, + "dependencies": { + "uuid": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz", + "integrity": "sha1-ZUS7ot/ajBzxfmKaOjBeK7H+5sE=", + "dev": true + } + } + }, + "xmlbuilder": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-4.0.0.tgz", + "integrity": "sha1-mLj2UcowqmJANvEn0RzGbce5B6M=", + "dev": true, + "requires": { + "lodash": "3.10.1" + }, + "dependencies": { + "lodash": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", + "dev": true + } + } + }, + "xmlcreate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-1.0.2.tgz", + "integrity": "sha1-+mv3YqYKQT+z3Y9LA8WyaSONMI8=", + "dev": true + }, + "xmldoc": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/xmldoc/-/xmldoc-0.4.0.tgz", + "integrity": "sha1-0lciS+g5PqrL+DfvIn/Y7CWzaIg=", + "dev": true, + "requires": { + "sax": "1.1.6" + } + }, + "xmldom": { + "version": "0.1.27", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", + "integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=", + "dev": true + }, + "xpipe": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/xpipe/-/xpipe-1.0.5.tgz", + "integrity": "sha1-jdi/Rfw/f1Xw4FS4ePQ6YmFNr98=", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-6.6.0.tgz", + "integrity": "sha1-eC7CHvQDNF+DCoCMo9UTr1YGUgg=", + "dev": true, + "requires": { + "camelcase": "3.0.0", + "cliui": "3.2.0", + "decamelize": "1.2.0", + "get-caller-file": "1.0.2", + "os-locale": "1.4.0", + "read-pkg-up": "1.0.1", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "1.0.2", + "which-module": "1.0.0", + "y18n": "3.2.1", + "yargs-parser": "4.2.1" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" + } + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "1.1.0", + "normalize-package-data": "2.4.0", + "path-type": "1.1.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "1.1.2", + "read-pkg": "1.1.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } + } + } + }, + "yargs-parser": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-4.2.1.tgz", + "integrity": "sha1-KczqwNxPA8bIe0qfIX3RjJ90hxw=", + "dev": true, + "requires": { + "camelcase": "3.0.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + } + } } } } diff --git a/packages/amazon-cognito-identity-js/package.json b/packages/amazon-cognito-identity-js/package.json index 44e0fd28d76..8bf4070cdfe 100644 --- a/packages/amazon-cognito-identity-js/package.json +++ b/packages/amazon-cognito-identity-js/package.json @@ -86,6 +86,6 @@ "react": "^16.0.0", "react-native": "^0.44.0", "rimraf": "^2.5.4", - "webpack": "^1.13.1" + "webpack": "^2.6.1" } } diff --git a/packages/amazon-cognito-identity-js/webpack.config.js b/packages/amazon-cognito-identity-js/webpack.config.js index f2c60ed710b..212c203d06c 100644 --- a/packages/amazon-cognito-identity-js/webpack.config.js +++ b/packages/amazon-cognito-identity-js/webpack.config.js @@ -25,15 +25,14 @@ var config = { library: 'AmazonCognitoIdentity' }, plugins: [ - new webpack.optimize.OccurrenceOrderPlugin(), - new webpack.BannerPlugin(banner, { raw: true }) + new webpack.BannerPlugin({banner: banner, raw: true }) ], module: { - loaders: [ + rules: [ { test: /\.js$/, exclude: /node_modules/, - loader: 'babel', + loader: 'babel-loader', query: { cacheDirectory: './node_modules/.cache/babel' } @@ -46,9 +45,7 @@ if (process.env.NODE_ENV === 'production') { config.devtool = 'source-map'; config.plugins.push( new webpack.optimize.UglifyJsPlugin({ - compress: { - warnings: false - } + sourceMap: true }) ); }