Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 
 

25252 righe
679 KiB

  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/ // The require function
  5. /******/ function __webpack_require__(moduleId) {
  6. /******/ // Check if module is in cache
  7. /******/ if(installedModules[moduleId])
  8. /******/ return installedModules[moduleId].exports;
  9. /******/ // Create a new module (and put it into the cache)
  10. /******/ var module = installedModules[moduleId] = {
  11. /******/ i: moduleId,
  12. /******/ l: false,
  13. /******/ exports: {}
  14. /******/ };
  15. /******/ // Execute the module function
  16. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  17. /******/ // Flag the module as loaded
  18. /******/ module.l = true;
  19. /******/ // Return the exports of the module
  20. /******/ return module.exports;
  21. /******/ }
  22. /******/ // expose the modules object (__webpack_modules__)
  23. /******/ __webpack_require__.m = modules;
  24. /******/ // expose the module cache
  25. /******/ __webpack_require__.c = installedModules;
  26. /******/ // identity function for calling harmory imports with the correct context
  27. /******/ __webpack_require__.i = function(value) { return value; };
  28. /******/ // define getter function for harmory exports
  29. /******/ __webpack_require__.d = function(exports, name, getter) {
  30. /******/ Object.defineProperty(exports, name, {
  31. /******/ configurable: false,
  32. /******/ enumerable: true,
  33. /******/ get: getter
  34. /******/ });
  35. /******/ };
  36. /******/ // getDefaultExport function for compatibility with non-harmony modules
  37. /******/ __webpack_require__.n = function(module) {
  38. /******/ var getter = module && module.__esModule ?
  39. /******/ function getDefault() { return module['default']; } :
  40. /******/ function getModuleExports() { return module; };
  41. /******/ __webpack_require__.d(getter, 'a', getter);
  42. /******/ return getter;
  43. /******/ };
  44. /******/ // Object.prototype.hasOwnProperty.call
  45. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  46. /******/ // __webpack_public_path__
  47. /******/ __webpack_require__.p = "/dist/";
  48. /******/ // Load entry module and return exports
  49. /******/ return __webpack_require__(__webpack_require__.s = 225);
  50. /******/ })
  51. /************************************************************************/
  52. /******/ ((function(modules) {
  53. // Check all modules for deduplicated modules
  54. for(var i in modules) {
  55. if(Object.prototype.hasOwnProperty.call(modules, i)) {
  56. switch(typeof modules[i]) {
  57. case "function": break;
  58. case "object":
  59. // Module can be created from a template
  60. modules[i] = (function(_m) {
  61. var args = _m.slice(1), fn = modules[_m[0]];
  62. return function (a,b,c) {
  63. fn.apply(this, [a,b,c].concat(args));
  64. };
  65. }(modules[i]));
  66. break;
  67. default:
  68. // Module is a copy of another module
  69. modules[i] = modules[modules[i]];
  70. break;
  71. }
  72. }
  73. }
  74. return modules;
  75. }([
  76. /* 0 */
  77. /***/ function(module, exports, __webpack_require__) {
  78. "use strict";
  79. /* WEBPACK VAR INJECTION */(function(Buffer, global) {/*!
  80. * The buffer module from node.js, for the browser.
  81. *
  82. * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
  83. * @license MIT
  84. */
  85. /* eslint-disable no-proto */
  86. 'use strict'
  87. var base64 = __webpack_require__(117)
  88. var ieee754 = __webpack_require__(172)
  89. var isArray = __webpack_require__(73)
  90. exports.Buffer = Buffer
  91. exports.SlowBuffer = SlowBuffer
  92. exports.INSPECT_MAX_BYTES = 50
  93. /**
  94. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  95. * === true Use Uint8Array implementation (fastest)
  96. * === false Use Object implementation (most compatible, even IE6)
  97. *
  98. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  99. * Opera 11.6+, iOS 4.2+.
  100. *
  101. * Due to various browser bugs, sometimes the Object implementation will be used even
  102. * when the browser supports typed arrays.
  103. *
  104. * Note:
  105. *
  106. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  107. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  108. *
  109. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  110. *
  111. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  112. * incorrect length in some situations.
  113. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  114. * get the Object implementation, which is slower but behaves correctly.
  115. */
  116. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  117. ? global.TYPED_ARRAY_SUPPORT
  118. : typedArraySupport()
  119. /*
  120. * Export kMaxLength after typed array support is determined.
  121. */
  122. exports.kMaxLength = kMaxLength()
  123. function typedArraySupport () {
  124. try {
  125. var arr = new Uint8Array(1)
  126. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  127. return arr.foo() === 42 && // typed array instances can be augmented
  128. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  129. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  130. } catch (e) {
  131. return false
  132. }
  133. }
  134. function kMaxLength () {
  135. return Buffer.TYPED_ARRAY_SUPPORT
  136. ? 0x7fffffff
  137. : 0x3fffffff
  138. }
  139. function createBuffer (that, length) {
  140. if (kMaxLength() < length) {
  141. throw new RangeError('Invalid typed array length')
  142. }
  143. if (Buffer.TYPED_ARRAY_SUPPORT) {
  144. // Return an augmented `Uint8Array` instance, for best performance
  145. that = new Uint8Array(length)
  146. that.__proto__ = Buffer.prototype
  147. } else {
  148. // Fallback: Return an object instance of the Buffer class
  149. if (that === null) {
  150. that = new Buffer(length)
  151. }
  152. that.length = length
  153. }
  154. return that
  155. }
  156. /**
  157. * The Buffer constructor returns instances of `Uint8Array` that have their
  158. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  159. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  160. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  161. * returns a single octet.
  162. *
  163. * The `Uint8Array` prototype remains unmodified.
  164. */
  165. function Buffer (arg, encodingOrOffset, length) {
  166. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  167. return new Buffer(arg, encodingOrOffset, length)
  168. }
  169. // Common case.
  170. if (typeof arg === 'number') {
  171. if (typeof encodingOrOffset === 'string') {
  172. throw new Error(
  173. 'If encoding is specified then the first argument must be a string'
  174. )
  175. }
  176. return allocUnsafe(this, arg)
  177. }
  178. return from(this, arg, encodingOrOffset, length)
  179. }
  180. Buffer.poolSize = 8192 // not used by this implementation
  181. // TODO: Legacy, not needed anymore. Remove in next major version.
  182. Buffer._augment = function (arr) {
  183. arr.__proto__ = Buffer.prototype
  184. return arr
  185. }
  186. function from (that, value, encodingOrOffset, length) {
  187. if (typeof value === 'number') {
  188. throw new TypeError('"value" argument must not be a number')
  189. }
  190. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  191. return fromArrayBuffer(that, value, encodingOrOffset, length)
  192. }
  193. if (typeof value === 'string') {
  194. return fromString(that, value, encodingOrOffset)
  195. }
  196. return fromObject(that, value)
  197. }
  198. /**
  199. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  200. * if value is a number.
  201. * Buffer.from(str[, encoding])
  202. * Buffer.from(array)
  203. * Buffer.from(buffer)
  204. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  205. **/
  206. Buffer.from = function (value, encodingOrOffset, length) {
  207. return from(null, value, encodingOrOffset, length)
  208. }
  209. if (Buffer.TYPED_ARRAY_SUPPORT) {
  210. Buffer.prototype.__proto__ = Uint8Array.prototype
  211. Buffer.__proto__ = Uint8Array
  212. if (typeof Symbol !== 'undefined' && Symbol.species &&
  213. Buffer[Symbol.species] === Buffer) {
  214. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  215. Object.defineProperty(Buffer, Symbol.species, {
  216. value: null,
  217. configurable: true
  218. })
  219. }
  220. }
  221. function assertSize (size) {
  222. if (typeof size !== 'number') {
  223. throw new TypeError('"size" argument must be a number')
  224. } else if (size < 0) {
  225. throw new RangeError('"size" argument must not be negative')
  226. }
  227. }
  228. function alloc (that, size, fill, encoding) {
  229. assertSize(size)
  230. if (size <= 0) {
  231. return createBuffer(that, size)
  232. }
  233. if (fill !== undefined) {
  234. // Only pay attention to encoding if it's a string. This
  235. // prevents accidentally sending in a number that would
  236. // be interpretted as a start offset.
  237. return typeof encoding === 'string'
  238. ? createBuffer(that, size).fill(fill, encoding)
  239. : createBuffer(that, size).fill(fill)
  240. }
  241. return createBuffer(that, size)
  242. }
  243. /**
  244. * Creates a new filled Buffer instance.
  245. * alloc(size[, fill[, encoding]])
  246. **/
  247. Buffer.alloc = function (size, fill, encoding) {
  248. return alloc(null, size, fill, encoding)
  249. }
  250. function allocUnsafe (that, size) {
  251. assertSize(size)
  252. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  253. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  254. for (var i = 0; i < size; ++i) {
  255. that[i] = 0
  256. }
  257. }
  258. return that
  259. }
  260. /**
  261. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  262. * */
  263. Buffer.allocUnsafe = function (size) {
  264. return allocUnsafe(null, size)
  265. }
  266. /**
  267. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  268. */
  269. Buffer.allocUnsafeSlow = function (size) {
  270. return allocUnsafe(null, size)
  271. }
  272. function fromString (that, string, encoding) {
  273. if (typeof encoding !== 'string' || encoding === '') {
  274. encoding = 'utf8'
  275. }
  276. if (!Buffer.isEncoding(encoding)) {
  277. throw new TypeError('"encoding" must be a valid string encoding')
  278. }
  279. var length = byteLength(string, encoding) | 0
  280. that = createBuffer(that, length)
  281. var actual = that.write(string, encoding)
  282. if (actual !== length) {
  283. // Writing a hex string, for example, that contains invalid characters will
  284. // cause everything after the first invalid character to be ignored. (e.g.
  285. // 'abxxcd' will be treated as 'ab')
  286. that = that.slice(0, actual)
  287. }
  288. return that
  289. }
  290. function fromArrayLike (that, array) {
  291. var length = array.length < 0 ? 0 : checked(array.length) | 0
  292. that = createBuffer(that, length)
  293. for (var i = 0; i < length; i += 1) {
  294. that[i] = array[i] & 255
  295. }
  296. return that
  297. }
  298. function fromArrayBuffer (that, array, byteOffset, length) {
  299. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  300. if (byteOffset < 0 || array.byteLength < byteOffset) {
  301. throw new RangeError('\'offset\' is out of bounds')
  302. }
  303. if (array.byteLength < byteOffset + (length || 0)) {
  304. throw new RangeError('\'length\' is out of bounds')
  305. }
  306. if (byteOffset === undefined && length === undefined) {
  307. array = new Uint8Array(array)
  308. } else if (length === undefined) {
  309. array = new Uint8Array(array, byteOffset)
  310. } else {
  311. array = new Uint8Array(array, byteOffset, length)
  312. }
  313. if (Buffer.TYPED_ARRAY_SUPPORT) {
  314. // Return an augmented `Uint8Array` instance, for best performance
  315. that = array
  316. that.__proto__ = Buffer.prototype
  317. } else {
  318. // Fallback: Return an object instance of the Buffer class
  319. that = fromArrayLike(that, array)
  320. }
  321. return that
  322. }
  323. function fromObject (that, obj) {
  324. if (Buffer.isBuffer(obj)) {
  325. var len = checked(obj.length) | 0
  326. that = createBuffer(that, len)
  327. if (that.length === 0) {
  328. return that
  329. }
  330. obj.copy(that, 0, 0, len)
  331. return that
  332. }
  333. if (obj) {
  334. if ((typeof ArrayBuffer !== 'undefined' &&
  335. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  336. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  337. return createBuffer(that, 0)
  338. }
  339. return fromArrayLike(that, obj)
  340. }
  341. if (obj.type === 'Buffer' && isArray(obj.data)) {
  342. return fromArrayLike(that, obj.data)
  343. }
  344. }
  345. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  346. }
  347. function checked (length) {
  348. // Note: cannot use `length < kMaxLength()` here because that fails when
  349. // length is NaN (which is otherwise coerced to zero.)
  350. if (length >= kMaxLength()) {
  351. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  352. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  353. }
  354. return length | 0
  355. }
  356. function SlowBuffer (length) {
  357. if (+length != length) { // eslint-disable-line eqeqeq
  358. length = 0
  359. }
  360. return Buffer.alloc(+length)
  361. }
  362. Buffer.isBuffer = function isBuffer (b) {
  363. return !!(b != null && b._isBuffer)
  364. }
  365. Buffer.compare = function compare (a, b) {
  366. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  367. throw new TypeError('Arguments must be Buffers')
  368. }
  369. if (a === b) return 0
  370. var x = a.length
  371. var y = b.length
  372. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  373. if (a[i] !== b[i]) {
  374. x = a[i]
  375. y = b[i]
  376. break
  377. }
  378. }
  379. if (x < y) return -1
  380. if (y < x) return 1
  381. return 0
  382. }
  383. Buffer.isEncoding = function isEncoding (encoding) {
  384. switch (String(encoding).toLowerCase()) {
  385. case 'hex':
  386. case 'utf8':
  387. case 'utf-8':
  388. case 'ascii':
  389. case 'latin1':
  390. case 'binary':
  391. case 'base64':
  392. case 'ucs2':
  393. case 'ucs-2':
  394. case 'utf16le':
  395. case 'utf-16le':
  396. return true
  397. default:
  398. return false
  399. }
  400. }
  401. Buffer.concat = function concat (list, length) {
  402. if (!isArray(list)) {
  403. throw new TypeError('"list" argument must be an Array of Buffers')
  404. }
  405. if (list.length === 0) {
  406. return Buffer.alloc(0)
  407. }
  408. var i
  409. if (length === undefined) {
  410. length = 0
  411. for (i = 0; i < list.length; ++i) {
  412. length += list[i].length
  413. }
  414. }
  415. var buffer = Buffer.allocUnsafe(length)
  416. var pos = 0
  417. for (i = 0; i < list.length; ++i) {
  418. var buf = list[i]
  419. if (!Buffer.isBuffer(buf)) {
  420. throw new TypeError('"list" argument must be an Array of Buffers')
  421. }
  422. buf.copy(buffer, pos)
  423. pos += buf.length
  424. }
  425. return buffer
  426. }
  427. function byteLength (string, encoding) {
  428. if (Buffer.isBuffer(string)) {
  429. return string.length
  430. }
  431. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  432. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  433. return string.byteLength
  434. }
  435. if (typeof string !== 'string') {
  436. string = '' + string
  437. }
  438. var len = string.length
  439. if (len === 0) return 0
  440. // Use a for loop to avoid recursion
  441. var loweredCase = false
  442. for (;;) {
  443. switch (encoding) {
  444. case 'ascii':
  445. case 'latin1':
  446. case 'binary':
  447. return len
  448. case 'utf8':
  449. case 'utf-8':
  450. case undefined:
  451. return utf8ToBytes(string).length
  452. case 'ucs2':
  453. case 'ucs-2':
  454. case 'utf16le':
  455. case 'utf-16le':
  456. return len * 2
  457. case 'hex':
  458. return len >>> 1
  459. case 'base64':
  460. return base64ToBytes(string).length
  461. default:
  462. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  463. encoding = ('' + encoding).toLowerCase()
  464. loweredCase = true
  465. }
  466. }
  467. }
  468. Buffer.byteLength = byteLength
  469. function slowToString (encoding, start, end) {
  470. var loweredCase = false
  471. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  472. // property of a typed array.
  473. // This behaves neither like String nor Uint8Array in that we set start/end
  474. // to their upper/lower bounds if the value passed is out of range.
  475. // undefined is handled specially as per ECMA-262 6th Edition,
  476. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  477. if (start === undefined || start < 0) {
  478. start = 0
  479. }
  480. // Return early if start > this.length. Done here to prevent potential uint32
  481. // coercion fail below.
  482. if (start > this.length) {
  483. return ''
  484. }
  485. if (end === undefined || end > this.length) {
  486. end = this.length
  487. }
  488. if (end <= 0) {
  489. return ''
  490. }
  491. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  492. end >>>= 0
  493. start >>>= 0
  494. if (end <= start) {
  495. return ''
  496. }
  497. if (!encoding) encoding = 'utf8'
  498. while (true) {
  499. switch (encoding) {
  500. case 'hex':
  501. return hexSlice(this, start, end)
  502. case 'utf8':
  503. case 'utf-8':
  504. return utf8Slice(this, start, end)
  505. case 'ascii':
  506. return asciiSlice(this, start, end)
  507. case 'latin1':
  508. case 'binary':
  509. return latin1Slice(this, start, end)
  510. case 'base64':
  511. return base64Slice(this, start, end)
  512. case 'ucs2':
  513. case 'ucs-2':
  514. case 'utf16le':
  515. case 'utf-16le':
  516. return utf16leSlice(this, start, end)
  517. default:
  518. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  519. encoding = (encoding + '').toLowerCase()
  520. loweredCase = true
  521. }
  522. }
  523. }
  524. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  525. // Buffer instances.
  526. Buffer.prototype._isBuffer = true
  527. function swap (b, n, m) {
  528. var i = b[n]
  529. b[n] = b[m]
  530. b[m] = i
  531. }
  532. Buffer.prototype.swap16 = function swap16 () {
  533. var len = this.length
  534. if (len % 2 !== 0) {
  535. throw new RangeError('Buffer size must be a multiple of 16-bits')
  536. }
  537. for (var i = 0; i < len; i += 2) {
  538. swap(this, i, i + 1)
  539. }
  540. return this
  541. }
  542. Buffer.prototype.swap32 = function swap32 () {
  543. var len = this.length
  544. if (len % 4 !== 0) {
  545. throw new RangeError('Buffer size must be a multiple of 32-bits')
  546. }
  547. for (var i = 0; i < len; i += 4) {
  548. swap(this, i, i + 3)
  549. swap(this, i + 1, i + 2)
  550. }
  551. return this
  552. }
  553. Buffer.prototype.swap64 = function swap64 () {
  554. var len = this.length
  555. if (len % 8 !== 0) {
  556. throw new RangeError('Buffer size must be a multiple of 64-bits')
  557. }
  558. for (var i = 0; i < len; i += 8) {
  559. swap(this, i, i + 7)
  560. swap(this, i + 1, i + 6)
  561. swap(this, i + 2, i + 5)
  562. swap(this, i + 3, i + 4)
  563. }
  564. return this
  565. }
  566. Buffer.prototype.toString = function toString () {
  567. var length = this.length | 0
  568. if (length === 0) return ''
  569. if (arguments.length === 0) return utf8Slice(this, 0, length)
  570. return slowToString.apply(this, arguments)
  571. }
  572. Buffer.prototype.equals = function equals (b) {
  573. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  574. if (this === b) return true
  575. return Buffer.compare(this, b) === 0
  576. }
  577. Buffer.prototype.inspect = function inspect () {
  578. var str = ''
  579. var max = exports.INSPECT_MAX_BYTES
  580. if (this.length > 0) {
  581. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  582. if (this.length > max) str += ' ... '
  583. }
  584. return '<Buffer ' + str + '>'
  585. }
  586. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  587. if (!Buffer.isBuffer(target)) {
  588. throw new TypeError('Argument must be a Buffer')
  589. }
  590. if (start === undefined) {
  591. start = 0
  592. }
  593. if (end === undefined) {
  594. end = target ? target.length : 0
  595. }
  596. if (thisStart === undefined) {
  597. thisStart = 0
  598. }
  599. if (thisEnd === undefined) {
  600. thisEnd = this.length
  601. }
  602. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  603. throw new RangeError('out of range index')
  604. }
  605. if (thisStart >= thisEnd && start >= end) {
  606. return 0
  607. }
  608. if (thisStart >= thisEnd) {
  609. return -1
  610. }
  611. if (start >= end) {
  612. return 1
  613. }
  614. start >>>= 0
  615. end >>>= 0
  616. thisStart >>>= 0
  617. thisEnd >>>= 0
  618. if (this === target) return 0
  619. var x = thisEnd - thisStart
  620. var y = end - start
  621. var len = Math.min(x, y)
  622. var thisCopy = this.slice(thisStart, thisEnd)
  623. var targetCopy = target.slice(start, end)
  624. for (var i = 0; i < len; ++i) {
  625. if (thisCopy[i] !== targetCopy[i]) {
  626. x = thisCopy[i]
  627. y = targetCopy[i]
  628. break
  629. }
  630. }
  631. if (x < y) return -1
  632. if (y < x) return 1
  633. return 0
  634. }
  635. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  636. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  637. //
  638. // Arguments:
  639. // - buffer - a Buffer to search
  640. // - val - a string, Buffer, or number
  641. // - byteOffset - an index into `buffer`; will be clamped to an int32
  642. // - encoding - an optional encoding, relevant is val is a string
  643. // - dir - true for indexOf, false for lastIndexOf
  644. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  645. // Empty buffer means no match
  646. if (buffer.length === 0) return -1
  647. // Normalize byteOffset
  648. if (typeof byteOffset === 'string') {
  649. encoding = byteOffset
  650. byteOffset = 0
  651. } else if (byteOffset > 0x7fffffff) {
  652. byteOffset = 0x7fffffff
  653. } else if (byteOffset < -0x80000000) {
  654. byteOffset = -0x80000000
  655. }
  656. byteOffset = +byteOffset // Coerce to Number.
  657. if (isNaN(byteOffset)) {
  658. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  659. byteOffset = dir ? 0 : (buffer.length - 1)
  660. }
  661. // Normalize byteOffset: negative offsets start from the end of the buffer
  662. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  663. if (byteOffset >= buffer.length) {
  664. if (dir) return -1
  665. else byteOffset = buffer.length - 1
  666. } else if (byteOffset < 0) {
  667. if (dir) byteOffset = 0
  668. else return -1
  669. }
  670. // Normalize val
  671. if (typeof val === 'string') {
  672. val = Buffer.from(val, encoding)
  673. }
  674. // Finally, search either indexOf (if dir is true) or lastIndexOf
  675. if (Buffer.isBuffer(val)) {
  676. // Special case: looking for empty string/buffer always fails
  677. if (val.length === 0) {
  678. return -1
  679. }
  680. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  681. } else if (typeof val === 'number') {
  682. val = val & 0xFF // Search for a byte value [0-255]
  683. if (Buffer.TYPED_ARRAY_SUPPORT &&
  684. typeof Uint8Array.prototype.indexOf === 'function') {
  685. if (dir) {
  686. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  687. } else {
  688. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  689. }
  690. }
  691. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  692. }
  693. throw new TypeError('val must be string, number or Buffer')
  694. }
  695. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  696. var indexSize = 1
  697. var arrLength = arr.length
  698. var valLength = val.length
  699. if (encoding !== undefined) {
  700. encoding = String(encoding).toLowerCase()
  701. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  702. encoding === 'utf16le' || encoding === 'utf-16le') {
  703. if (arr.length < 2 || val.length < 2) {
  704. return -1
  705. }
  706. indexSize = 2
  707. arrLength /= 2
  708. valLength /= 2
  709. byteOffset /= 2
  710. }
  711. }
  712. function read (buf, i) {
  713. if (indexSize === 1) {
  714. return buf[i]
  715. } else {
  716. return buf.readUInt16BE(i * indexSize)
  717. }
  718. }
  719. var i
  720. if (dir) {
  721. var foundIndex = -1
  722. for (i = byteOffset; i < arrLength; i++) {
  723. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  724. if (foundIndex === -1) foundIndex = i
  725. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  726. } else {
  727. if (foundIndex !== -1) i -= i - foundIndex
  728. foundIndex = -1
  729. }
  730. }
  731. } else {
  732. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  733. for (i = byteOffset; i >= 0; i--) {
  734. var found = true
  735. for (var j = 0; j < valLength; j++) {
  736. if (read(arr, i + j) !== read(val, j)) {
  737. found = false
  738. break
  739. }
  740. }
  741. if (found) return i
  742. }
  743. }
  744. return -1
  745. }
  746. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  747. return this.indexOf(val, byteOffset, encoding) !== -1
  748. }
  749. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  750. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  751. }
  752. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  753. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  754. }
  755. function hexWrite (buf, string, offset, length) {
  756. offset = Number(offset) || 0
  757. var remaining = buf.length - offset
  758. if (!length) {
  759. length = remaining
  760. } else {
  761. length = Number(length)
  762. if (length > remaining) {
  763. length = remaining
  764. }
  765. }
  766. // must be an even number of digits
  767. var strLen = string.length
  768. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  769. if (length > strLen / 2) {
  770. length = strLen / 2
  771. }
  772. for (var i = 0; i < length; ++i) {
  773. var parsed = parseInt(string.substr(i * 2, 2), 16)
  774. if (isNaN(parsed)) return i
  775. buf[offset + i] = parsed
  776. }
  777. return i
  778. }
  779. function utf8Write (buf, string, offset, length) {
  780. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  781. }
  782. function asciiWrite (buf, string, offset, length) {
  783. return blitBuffer(asciiToBytes(string), buf, offset, length)
  784. }
  785. function latin1Write (buf, string, offset, length) {
  786. return asciiWrite(buf, string, offset, length)
  787. }
  788. function base64Write (buf, string, offset, length) {
  789. return blitBuffer(base64ToBytes(string), buf, offset, length)
  790. }
  791. function ucs2Write (buf, string, offset, length) {
  792. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  793. }
  794. Buffer.prototype.write = function write (string, offset, length, encoding) {
  795. // Buffer#write(string)
  796. if (offset === undefined) {
  797. encoding = 'utf8'
  798. length = this.length
  799. offset = 0
  800. // Buffer#write(string, encoding)
  801. } else if (length === undefined && typeof offset === 'string') {
  802. encoding = offset
  803. length = this.length
  804. offset = 0
  805. // Buffer#write(string, offset[, length][, encoding])
  806. } else if (isFinite(offset)) {
  807. offset = offset | 0
  808. if (isFinite(length)) {
  809. length = length | 0
  810. if (encoding === undefined) encoding = 'utf8'
  811. } else {
  812. encoding = length
  813. length = undefined
  814. }
  815. // legacy write(string, encoding, offset, length) - remove in v0.13
  816. } else {
  817. throw new Error(
  818. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  819. )
  820. }
  821. var remaining = this.length - offset
  822. if (length === undefined || length > remaining) length = remaining
  823. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  824. throw new RangeError('Attempt to write outside buffer bounds')
  825. }
  826. if (!encoding) encoding = 'utf8'
  827. var loweredCase = false
  828. for (;;) {
  829. switch (encoding) {
  830. case 'hex':
  831. return hexWrite(this, string, offset, length)
  832. case 'utf8':
  833. case 'utf-8':
  834. return utf8Write(this, string, offset, length)
  835. case 'ascii':
  836. return asciiWrite(this, string, offset, length)
  837. case 'latin1':
  838. case 'binary':
  839. return latin1Write(this, string, offset, length)
  840. case 'base64':
  841. // Warning: maxLength not taken into account in base64Write
  842. return base64Write(this, string, offset, length)
  843. case 'ucs2':
  844. case 'ucs-2':
  845. case 'utf16le':
  846. case 'utf-16le':
  847. return ucs2Write(this, string, offset, length)
  848. default:
  849. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  850. encoding = ('' + encoding).toLowerCase()
  851. loweredCase = true
  852. }
  853. }
  854. }
  855. Buffer.prototype.toJSON = function toJSON () {
  856. return {
  857. type: 'Buffer',
  858. data: Array.prototype.slice.call(this._arr || this, 0)
  859. }
  860. }
  861. function base64Slice (buf, start, end) {
  862. if (start === 0 && end === buf.length) {
  863. return base64.fromByteArray(buf)
  864. } else {
  865. return base64.fromByteArray(buf.slice(start, end))
  866. }
  867. }
  868. function utf8Slice (buf, start, end) {
  869. end = Math.min(buf.length, end)
  870. var res = []
  871. var i = start
  872. while (i < end) {
  873. var firstByte = buf[i]
  874. var codePoint = null
  875. var bytesPerSequence = (firstByte > 0xEF) ? 4
  876. : (firstByte > 0xDF) ? 3
  877. : (firstByte > 0xBF) ? 2
  878. : 1
  879. if (i + bytesPerSequence <= end) {
  880. var secondByte, thirdByte, fourthByte, tempCodePoint
  881. switch (bytesPerSequence) {
  882. case 1:
  883. if (firstByte < 0x80) {
  884. codePoint = firstByte
  885. }
  886. break
  887. case 2:
  888. secondByte = buf[i + 1]
  889. if ((secondByte & 0xC0) === 0x80) {
  890. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  891. if (tempCodePoint > 0x7F) {
  892. codePoint = tempCodePoint
  893. }
  894. }
  895. break
  896. case 3:
  897. secondByte = buf[i + 1]
  898. thirdByte = buf[i + 2]
  899. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  900. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  901. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  902. codePoint = tempCodePoint
  903. }
  904. }
  905. break
  906. case 4:
  907. secondByte = buf[i + 1]
  908. thirdByte = buf[i + 2]
  909. fourthByte = buf[i + 3]
  910. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  911. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  912. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  913. codePoint = tempCodePoint
  914. }
  915. }
  916. }
  917. }
  918. if (codePoint === null) {
  919. // we did not generate a valid codePoint so insert a
  920. // replacement char (U+FFFD) and advance only 1 byte
  921. codePoint = 0xFFFD
  922. bytesPerSequence = 1
  923. } else if (codePoint > 0xFFFF) {
  924. // encode to utf16 (surrogate pair dance)
  925. codePoint -= 0x10000
  926. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  927. codePoint = 0xDC00 | codePoint & 0x3FF
  928. }
  929. res.push(codePoint)
  930. i += bytesPerSequence
  931. }
  932. return decodeCodePointsArray(res)
  933. }
  934. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  935. // the lowest limit is Chrome, with 0x10000 args.
  936. // We go 1 magnitude less, for safety
  937. var MAX_ARGUMENTS_LENGTH = 0x1000
  938. function decodeCodePointsArray (codePoints) {
  939. var len = codePoints.length
  940. if (len <= MAX_ARGUMENTS_LENGTH) {
  941. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  942. }
  943. // Decode in chunks to avoid "call stack size exceeded".
  944. var res = ''
  945. var i = 0
  946. while (i < len) {
  947. res += String.fromCharCode.apply(
  948. String,
  949. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  950. )
  951. }
  952. return res
  953. }
  954. function asciiSlice (buf, start, end) {
  955. var ret = ''
  956. end = Math.min(buf.length, end)
  957. for (var i = start; i < end; ++i) {
  958. ret += String.fromCharCode(buf[i] & 0x7F)
  959. }
  960. return ret
  961. }
  962. function latin1Slice (buf, start, end) {
  963. var ret = ''
  964. end = Math.min(buf.length, end)
  965. for (var i = start; i < end; ++i) {
  966. ret += String.fromCharCode(buf[i])
  967. }
  968. return ret
  969. }
  970. function hexSlice (buf, start, end) {
  971. var len = buf.length
  972. if (!start || start < 0) start = 0
  973. if (!end || end < 0 || end > len) end = len
  974. var out = ''
  975. for (var i = start; i < end; ++i) {
  976. out += toHex(buf[i])
  977. }
  978. return out
  979. }
  980. function utf16leSlice (buf, start, end) {
  981. var bytes = buf.slice(start, end)
  982. var res = ''
  983. for (var i = 0; i < bytes.length; i += 2) {
  984. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  985. }
  986. return res
  987. }
  988. Buffer.prototype.slice = function slice (start, end) {
  989. var len = this.length
  990. start = ~~start
  991. end = end === undefined ? len : ~~end
  992. if (start < 0) {
  993. start += len
  994. if (start < 0) start = 0
  995. } else if (start > len) {
  996. start = len
  997. }
  998. if (end < 0) {
  999. end += len
  1000. if (end < 0) end = 0
  1001. } else if (end > len) {
  1002. end = len
  1003. }
  1004. if (end < start) end = start
  1005. var newBuf
  1006. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1007. newBuf = this.subarray(start, end)
  1008. newBuf.__proto__ = Buffer.prototype
  1009. } else {
  1010. var sliceLen = end - start
  1011. newBuf = new Buffer(sliceLen, undefined)
  1012. for (var i = 0; i < sliceLen; ++i) {
  1013. newBuf[i] = this[i + start]
  1014. }
  1015. }
  1016. return newBuf
  1017. }
  1018. /*
  1019. * Need to make sure that buffer isn't trying to write out of bounds.
  1020. */
  1021. function checkOffset (offset, ext, length) {
  1022. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  1023. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  1024. }
  1025. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  1026. offset = offset | 0
  1027. byteLength = byteLength | 0
  1028. if (!noAssert) checkOffset(offset, byteLength, this.length)
  1029. var val = this[offset]
  1030. var mul = 1
  1031. var i = 0
  1032. while (++i < byteLength && (mul *= 0x100)) {
  1033. val += this[offset + i] * mul
  1034. }
  1035. return val
  1036. }
  1037. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  1038. offset = offset | 0
  1039. byteLength = byteLength | 0
  1040. if (!noAssert) {
  1041. checkOffset(offset, byteLength, this.length)
  1042. }
  1043. var val = this[offset + --byteLength]
  1044. var mul = 1
  1045. while (byteLength > 0 && (mul *= 0x100)) {
  1046. val += this[offset + --byteLength] * mul
  1047. }
  1048. return val
  1049. }
  1050. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  1051. if (!noAssert) checkOffset(offset, 1, this.length)
  1052. return this[offset]
  1053. }
  1054. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  1055. if (!noAssert) checkOffset(offset, 2, this.length)
  1056. return this[offset] | (this[offset + 1] << 8)
  1057. }
  1058. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  1059. if (!noAssert) checkOffset(offset, 2, this.length)
  1060. return (this[offset] << 8) | this[offset + 1]
  1061. }
  1062. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  1063. if (!noAssert) checkOffset(offset, 4, this.length)
  1064. return ((this[offset]) |
  1065. (this[offset + 1] << 8) |
  1066. (this[offset + 2] << 16)) +
  1067. (this[offset + 3] * 0x1000000)
  1068. }
  1069. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  1070. if (!noAssert) checkOffset(offset, 4, this.length)
  1071. return (this[offset] * 0x1000000) +
  1072. ((this[offset + 1] << 16) |
  1073. (this[offset + 2] << 8) |
  1074. this[offset + 3])
  1075. }
  1076. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  1077. offset = offset | 0
  1078. byteLength = byteLength | 0
  1079. if (!noAssert) checkOffset(offset, byteLength, this.length)
  1080. var val = this[offset]
  1081. var mul = 1
  1082. var i = 0
  1083. while (++i < byteLength && (mul *= 0x100)) {
  1084. val += this[offset + i] * mul
  1085. }
  1086. mul *= 0x80
  1087. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  1088. return val
  1089. }
  1090. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  1091. offset = offset | 0
  1092. byteLength = byteLength | 0
  1093. if (!noAssert) checkOffset(offset, byteLength, this.length)
  1094. var i = byteLength
  1095. var mul = 1
  1096. var val = this[offset + --i]
  1097. while (i > 0 && (mul *= 0x100)) {
  1098. val += this[offset + --i] * mul
  1099. }
  1100. mul *= 0x80
  1101. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  1102. return val
  1103. }
  1104. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  1105. if (!noAssert) checkOffset(offset, 1, this.length)
  1106. if (!(this[offset] & 0x80)) return (this[offset])
  1107. return ((0xff - this[offset] + 1) * -1)
  1108. }
  1109. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  1110. if (!noAssert) checkOffset(offset, 2, this.length)
  1111. var val = this[offset] | (this[offset + 1] << 8)
  1112. return (val & 0x8000) ? val | 0xFFFF0000 : val
  1113. }
  1114. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  1115. if (!noAssert) checkOffset(offset, 2, this.length)
  1116. var val = this[offset + 1] | (this[offset] << 8)
  1117. return (val & 0x8000) ? val | 0xFFFF0000 : val
  1118. }
  1119. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  1120. if (!noAssert) checkOffset(offset, 4, this.length)
  1121. return (this[offset]) |
  1122. (this[offset + 1] << 8) |
  1123. (this[offset + 2] << 16) |
  1124. (this[offset + 3] << 24)
  1125. }
  1126. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  1127. if (!noAssert) checkOffset(offset, 4, this.length)
  1128. return (this[offset] << 24) |
  1129. (this[offset + 1] << 16) |
  1130. (this[offset + 2] << 8) |
  1131. (this[offset + 3])
  1132. }
  1133. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  1134. if (!noAssert) checkOffset(offset, 4, this.length)
  1135. return ieee754.read(this, offset, true, 23, 4)
  1136. }
  1137. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  1138. if (!noAssert) checkOffset(offset, 4, this.length)
  1139. return ieee754.read(this, offset, false, 23, 4)
  1140. }
  1141. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  1142. if (!noAssert) checkOffset(offset, 8, this.length)
  1143. return ieee754.read(this, offset, true, 52, 8)
  1144. }
  1145. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  1146. if (!noAssert) checkOffset(offset, 8, this.length)
  1147. return ieee754.read(this, offset, false, 52, 8)
  1148. }
  1149. function checkInt (buf, value, offset, ext, max, min) {
  1150. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  1151. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  1152. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  1153. }
  1154. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  1155. value = +value
  1156. offset = offset | 0
  1157. byteLength = byteLength | 0
  1158. if (!noAssert) {
  1159. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  1160. checkInt(this, value, offset, byteLength, maxBytes, 0)
  1161. }
  1162. var mul = 1
  1163. var i = 0
  1164. this[offset] = value & 0xFF
  1165. while (++i < byteLength && (mul *= 0x100)) {
  1166. this[offset + i] = (value / mul) & 0xFF
  1167. }
  1168. return offset + byteLength
  1169. }
  1170. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  1171. value = +value
  1172. offset = offset | 0
  1173. byteLength = byteLength | 0
  1174. if (!noAssert) {
  1175. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  1176. checkInt(this, value, offset, byteLength, maxBytes, 0)
  1177. }
  1178. var i = byteLength - 1
  1179. var mul = 1
  1180. this[offset + i] = value & 0xFF
  1181. while (--i >= 0 && (mul *= 0x100)) {
  1182. this[offset + i] = (value / mul) & 0xFF
  1183. }
  1184. return offset + byteLength
  1185. }
  1186. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  1187. value = +value
  1188. offset = offset | 0
  1189. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  1190. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  1191. this[offset] = (value & 0xff)
  1192. return offset + 1
  1193. }
  1194. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  1195. if (value < 0) value = 0xffff + value + 1
  1196. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  1197. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  1198. (littleEndian ? i : 1 - i) * 8
  1199. }
  1200. }
  1201. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  1202. value = +value
  1203. offset = offset | 0
  1204. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  1205. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1206. this[offset] = (value & 0xff)
  1207. this[offset + 1] = (value >>> 8)
  1208. } else {
  1209. objectWriteUInt16(this, value, offset, true)
  1210. }
  1211. return offset + 2
  1212. }
  1213. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  1214. value = +value
  1215. offset = offset | 0
  1216. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  1217. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1218. this[offset] = (value >>> 8)
  1219. this[offset + 1] = (value & 0xff)
  1220. } else {
  1221. objectWriteUInt16(this, value, offset, false)
  1222. }
  1223. return offset + 2
  1224. }
  1225. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  1226. if (value < 0) value = 0xffffffff + value + 1
  1227. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  1228. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  1229. }
  1230. }
  1231. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  1232. value = +value
  1233. offset = offset | 0
  1234. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  1235. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1236. this[offset + 3] = (value >>> 24)
  1237. this[offset + 2] = (value >>> 16)
  1238. this[offset + 1] = (value >>> 8)
  1239. this[offset] = (value & 0xff)
  1240. } else {
  1241. objectWriteUInt32(this, value, offset, true)
  1242. }
  1243. return offset + 4
  1244. }
  1245. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  1246. value = +value
  1247. offset = offset | 0
  1248. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  1249. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1250. this[offset] = (value >>> 24)
  1251. this[offset + 1] = (value >>> 16)
  1252. this[offset + 2] = (value >>> 8)
  1253. this[offset + 3] = (value & 0xff)
  1254. } else {
  1255. objectWriteUInt32(this, value, offset, false)
  1256. }
  1257. return offset + 4
  1258. }
  1259. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  1260. value = +value
  1261. offset = offset | 0
  1262. if (!noAssert) {
  1263. var limit = Math.pow(2, 8 * byteLength - 1)
  1264. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  1265. }
  1266. var i = 0
  1267. var mul = 1
  1268. var sub = 0
  1269. this[offset] = value & 0xFF
  1270. while (++i < byteLength && (mul *= 0x100)) {
  1271. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  1272. sub = 1
  1273. }
  1274. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  1275. }
  1276. return offset + byteLength
  1277. }
  1278. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  1279. value = +value
  1280. offset = offset | 0
  1281. if (!noAssert) {
  1282. var limit = Math.pow(2, 8 * byteLength - 1)
  1283. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  1284. }
  1285. var i = byteLength - 1
  1286. var mul = 1
  1287. var sub = 0
  1288. this[offset + i] = value & 0xFF
  1289. while (--i >= 0 && (mul *= 0x100)) {
  1290. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  1291. sub = 1
  1292. }
  1293. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  1294. }
  1295. return offset + byteLength
  1296. }
  1297. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  1298. value = +value
  1299. offset = offset | 0
  1300. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  1301. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  1302. if (value < 0) value = 0xff + value + 1
  1303. this[offset] = (value & 0xff)
  1304. return offset + 1
  1305. }
  1306. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  1307. value = +value
  1308. offset = offset | 0
  1309. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  1310. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1311. this[offset] = (value & 0xff)
  1312. this[offset + 1] = (value >>> 8)
  1313. } else {
  1314. objectWriteUInt16(this, value, offset, true)
  1315. }
  1316. return offset + 2
  1317. }
  1318. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  1319. value = +value
  1320. offset = offset | 0
  1321. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  1322. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1323. this[offset] = (value >>> 8)
  1324. this[offset + 1] = (value & 0xff)
  1325. } else {
  1326. objectWriteUInt16(this, value, offset, false)
  1327. }
  1328. return offset + 2
  1329. }
  1330. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  1331. value = +value
  1332. offset = offset | 0
  1333. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  1334. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1335. this[offset] = (value & 0xff)
  1336. this[offset + 1] = (value >>> 8)
  1337. this[offset + 2] = (value >>> 16)
  1338. this[offset + 3] = (value >>> 24)
  1339. } else {
  1340. objectWriteUInt32(this, value, offset, true)
  1341. }
  1342. return offset + 4
  1343. }
  1344. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  1345. value = +value
  1346. offset = offset | 0
  1347. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  1348. if (value < 0) value = 0xffffffff + value + 1
  1349. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1350. this[offset] = (value >>> 24)
  1351. this[offset + 1] = (value >>> 16)
  1352. this[offset + 2] = (value >>> 8)
  1353. this[offset + 3] = (value & 0xff)
  1354. } else {
  1355. objectWriteUInt32(this, value, offset, false)
  1356. }
  1357. return offset + 4
  1358. }
  1359. function checkIEEE754 (buf, value, offset, ext, max, min) {
  1360. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  1361. if (offset < 0) throw new RangeError('Index out of range')
  1362. }
  1363. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  1364. if (!noAssert) {
  1365. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  1366. }
  1367. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  1368. return offset + 4
  1369. }
  1370. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  1371. return writeFloat(this, value, offset, true, noAssert)
  1372. }
  1373. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  1374. return writeFloat(this, value, offset, false, noAssert)
  1375. }
  1376. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  1377. if (!noAssert) {
  1378. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  1379. }
  1380. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  1381. return offset + 8
  1382. }
  1383. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  1384. return writeDouble(this, value, offset, true, noAssert)
  1385. }
  1386. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  1387. return writeDouble(this, value, offset, false, noAssert)
  1388. }
  1389. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  1390. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  1391. if (!start) start = 0
  1392. if (!end && end !== 0) end = this.length
  1393. if (targetStart >= target.length) targetStart = target.length
  1394. if (!targetStart) targetStart = 0
  1395. if (end > 0 && end < start) end = start
  1396. // Copy 0 bytes; we're done
  1397. if (end === start) return 0
  1398. if (target.length === 0 || this.length === 0) return 0
  1399. // Fatal error conditions
  1400. if (targetStart < 0) {
  1401. throw new RangeError('targetStart out of bounds')
  1402. }
  1403. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  1404. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  1405. // Are we oob?
  1406. if (end > this.length) end = this.length
  1407. if (target.length - targetStart < end - start) {
  1408. end = target.length - targetStart + start
  1409. }
  1410. var len = end - start
  1411. var i
  1412. if (this === target && start < targetStart && targetStart < end) {
  1413. // descending copy from end
  1414. for (i = len - 1; i >= 0; --i) {
  1415. target[i + targetStart] = this[i + start]
  1416. }
  1417. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  1418. // ascending copy from start
  1419. for (i = 0; i < len; ++i) {
  1420. target[i + targetStart] = this[i + start]
  1421. }
  1422. } else {
  1423. Uint8Array.prototype.set.call(
  1424. target,
  1425. this.subarray(start, start + len),
  1426. targetStart
  1427. )
  1428. }
  1429. return len
  1430. }
  1431. // Usage:
  1432. // buffer.fill(number[, offset[, end]])
  1433. // buffer.fill(buffer[, offset[, end]])
  1434. // buffer.fill(string[, offset[, end]][, encoding])
  1435. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  1436. // Handle string cases:
  1437. if (typeof val === 'string') {
  1438. if (typeof start === 'string') {
  1439. encoding = start
  1440. start = 0
  1441. end = this.length
  1442. } else if (typeof end === 'string') {
  1443. encoding = end
  1444. end = this.length
  1445. }
  1446. if (val.length === 1) {
  1447. var code = val.charCodeAt(0)
  1448. if (code < 256) {
  1449. val = code
  1450. }
  1451. }
  1452. if (encoding !== undefined && typeof encoding !== 'string') {
  1453. throw new TypeError('encoding must be a string')
  1454. }
  1455. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  1456. throw new TypeError('Unknown encoding: ' + encoding)
  1457. }
  1458. } else if (typeof val === 'number') {
  1459. val = val & 255
  1460. }
  1461. // Invalid ranges are not set to a default, so can range check early.
  1462. if (start < 0 || this.length < start || this.length < end) {
  1463. throw new RangeError('Out of range index')
  1464. }
  1465. if (end <= start) {
  1466. return this
  1467. }
  1468. start = start >>> 0
  1469. end = end === undefined ? this.length : end >>> 0
  1470. if (!val) val = 0
  1471. var i
  1472. if (typeof val === 'number') {
  1473. for (i = start; i < end; ++i) {
  1474. this[i] = val
  1475. }
  1476. } else {
  1477. var bytes = Buffer.isBuffer(val)
  1478. ? val
  1479. : utf8ToBytes(new Buffer(val, encoding).toString())
  1480. var len = bytes.length
  1481. for (i = 0; i < end - start; ++i) {
  1482. this[i + start] = bytes[i % len]
  1483. }
  1484. }
  1485. return this
  1486. }
  1487. // HELPER FUNCTIONS
  1488. // ================
  1489. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  1490. function base64clean (str) {
  1491. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  1492. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  1493. // Node converts strings with length < 2 to ''
  1494. if (str.length < 2) return ''
  1495. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  1496. while (str.length % 4 !== 0) {
  1497. str = str + '='
  1498. }
  1499. return str
  1500. }
  1501. function stringtrim (str) {
  1502. if (str.trim) return str.trim()
  1503. return str.replace(/^\s+|\s+$/g, '')
  1504. }
  1505. function toHex (n) {
  1506. if (n < 16) return '0' + n.toString(16)
  1507. return n.toString(16)
  1508. }
  1509. function utf8ToBytes (string, units) {
  1510. units = units || Infinity
  1511. var codePoint
  1512. var length = string.length
  1513. var leadSurrogate = null
  1514. var bytes = []
  1515. for (var i = 0; i < length; ++i) {
  1516. codePoint = string.charCodeAt(i)
  1517. // is surrogate component
  1518. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  1519. // last char was a lead
  1520. if (!leadSurrogate) {
  1521. // no lead yet
  1522. if (codePoint > 0xDBFF) {
  1523. // unexpected trail
  1524. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  1525. continue
  1526. } else if (i + 1 === length) {
  1527. // unpaired lead
  1528. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  1529. continue
  1530. }
  1531. // valid lead
  1532. leadSurrogate = codePoint
  1533. continue
  1534. }
  1535. // 2 leads in a row
  1536. if (codePoint < 0xDC00) {
  1537. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  1538. leadSurrogate = codePoint
  1539. continue
  1540. }
  1541. // valid surrogate pair
  1542. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  1543. } else if (leadSurrogate) {
  1544. // valid bmp char, but last char was a lead
  1545. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  1546. }
  1547. leadSurrogate = null
  1548. // encode utf8
  1549. if (codePoint < 0x80) {
  1550. if ((units -= 1) < 0) break
  1551. bytes.push(codePoint)
  1552. } else if (codePoint < 0x800) {
  1553. if ((units -= 2) < 0) break
  1554. bytes.push(
  1555. codePoint >> 0x6 | 0xC0,
  1556. codePoint & 0x3F | 0x80
  1557. )
  1558. } else if (codePoint < 0x10000) {
  1559. if ((units -= 3) < 0) break
  1560. bytes.push(
  1561. codePoint >> 0xC | 0xE0,
  1562. codePoint >> 0x6 & 0x3F | 0x80,
  1563. codePoint & 0x3F | 0x80
  1564. )
  1565. } else if (codePoint < 0x110000) {
  1566. if ((units -= 4) < 0) break
  1567. bytes.push(
  1568. codePoint >> 0x12 | 0xF0,
  1569. codePoint >> 0xC & 0x3F | 0x80,
  1570. codePoint >> 0x6 & 0x3F | 0x80,
  1571. codePoint & 0x3F | 0x80
  1572. )
  1573. } else {
  1574. throw new Error('Invalid code point')
  1575. }
  1576. }
  1577. return bytes
  1578. }
  1579. function asciiToBytes (str) {
  1580. var byteArray = []
  1581. for (var i = 0; i < str.length; ++i) {
  1582. // Node's code seems to be doing this and not & 0x7F..
  1583. byteArray.push(str.charCodeAt(i) & 0xFF)
  1584. }
  1585. return byteArray
  1586. }
  1587. function utf16leToBytes (str, units) {
  1588. var c, hi, lo
  1589. var byteArray = []
  1590. for (var i = 0; i < str.length; ++i) {
  1591. if ((units -= 2) < 0) break
  1592. c = str.charCodeAt(i)
  1593. hi = c >> 8
  1594. lo = c % 256
  1595. byteArray.push(lo)
  1596. byteArray.push(hi)
  1597. }
  1598. return byteArray
  1599. }
  1600. function base64ToBytes (str) {
  1601. return base64.toByteArray(base64clean(str))
  1602. }
  1603. function blitBuffer (src, dst, offset, length) {
  1604. for (var i = 0; i < length; ++i) {
  1605. if ((i + offset >= dst.length) || (i >= src.length)) break
  1606. dst[i + offset] = src[i]
  1607. }
  1608. return i
  1609. }
  1610. function isnan (val) {
  1611. return val !== val // eslint-disable-line no-self-compare
  1612. }
  1613. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer, __webpack_require__(22)))
  1614. /***/ },
  1615. /* 1 */
  1616. /***/ function(module, exports) {
  1617. if (typeof Object.create === 'function') {
  1618. // implementation from standard node.js 'util' module
  1619. module.exports = function inherits(ctor, superCtor) {
  1620. ctor.super_ = superCtor
  1621. ctor.prototype = Object.create(superCtor.prototype, {
  1622. constructor: {
  1623. value: ctor,
  1624. enumerable: false,
  1625. writable: true,
  1626. configurable: true
  1627. }
  1628. });
  1629. };
  1630. } else {
  1631. // old school shim for old browsers
  1632. module.exports = function inherits(ctor, superCtor) {
  1633. ctor.super_ = superCtor
  1634. var TempCtor = function () {}
  1635. TempCtor.prototype = superCtor.prototype
  1636. ctor.prototype = new TempCtor()
  1637. ctor.prototype.constructor = ctor
  1638. }
  1639. }
  1640. /***/ },
  1641. /* 2 */
  1642. /***/ function(module, exports, __webpack_require__) {
  1643. "use strict";
  1644. 'use strict';
  1645. var bind = __webpack_require__(55);
  1646. /*global toString:true*/
  1647. // utils is a library of generic helper functions non-specific to axios
  1648. var toString = Object.prototype.toString;
  1649. /**
  1650. * Determine if a value is an Array
  1651. *
  1652. * @param {Object} val The value to test
  1653. * @returns {boolean} True if value is an Array, otherwise false
  1654. */
  1655. function isArray(val) {
  1656. return toString.call(val) === '[object Array]';
  1657. }
  1658. /**
  1659. * Determine if a value is an ArrayBuffer
  1660. *
  1661. * @param {Object} val The value to test
  1662. * @returns {boolean} True if value is an ArrayBuffer, otherwise false
  1663. */
  1664. function isArrayBuffer(val) {
  1665. return toString.call(val) === '[object ArrayBuffer]';
  1666. }
  1667. /**
  1668. * Determine if a value is a FormData
  1669. *
  1670. * @param {Object} val The value to test
  1671. * @returns {boolean} True if value is an FormData, otherwise false
  1672. */
  1673. function isFormData(val) {
  1674. return (typeof FormData !== 'undefined') && (val instanceof FormData);
  1675. }
  1676. /**
  1677. * Determine if a value is a view on an ArrayBuffer
  1678. *
  1679. * @param {Object} val The value to test
  1680. * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
  1681. */
  1682. function isArrayBufferView(val) {
  1683. var result;
  1684. if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
  1685. result = ArrayBuffer.isView(val);
  1686. } else {
  1687. result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
  1688. }
  1689. return result;
  1690. }
  1691. /**
  1692. * Determine if a value is a String
  1693. *
  1694. * @param {Object} val The value to test
  1695. * @returns {boolean} True if value is a String, otherwise false
  1696. */
  1697. function isString(val) {
  1698. return typeof val === 'string';
  1699. }
  1700. /**
  1701. * Determine if a value is a Number
  1702. *
  1703. * @param {Object} val The value to test
  1704. * @returns {boolean} True if value is a Number, otherwise false
  1705. */
  1706. function isNumber(val) {
  1707. return typeof val === 'number';
  1708. }
  1709. /**
  1710. * Determine if a value is undefined
  1711. *
  1712. * @param {Object} val The value to test
  1713. * @returns {boolean} True if the value is undefined, otherwise false
  1714. */
  1715. function isUndefined(val) {
  1716. return typeof val === 'undefined';
  1717. }
  1718. /**
  1719. * Determine if a value is an Object
  1720. *
  1721. * @param {Object} val The value to test
  1722. * @returns {boolean} True if value is an Object, otherwise false
  1723. */
  1724. function isObject(val) {
  1725. return val !== null && typeof val === 'object';
  1726. }
  1727. /**
  1728. * Determine if a value is a Date
  1729. *
  1730. * @param {Object} val The value to test
  1731. * @returns {boolean} True if value is a Date, otherwise false
  1732. */
  1733. function isDate(val) {
  1734. return toString.call(val) === '[object Date]';
  1735. }
  1736. /**
  1737. * Determine if a value is a File
  1738. *
  1739. * @param {Object} val The value to test
  1740. * @returns {boolean} True if value is a File, otherwise false
  1741. */
  1742. function isFile(val) {
  1743. return toString.call(val) === '[object File]';
  1744. }
  1745. /**
  1746. * Determine if a value is a Blob
  1747. *
  1748. * @param {Object} val The value to test
  1749. * @returns {boolean} True if value is a Blob, otherwise false
  1750. */
  1751. function isBlob(val) {
  1752. return toString.call(val) === '[object Blob]';
  1753. }
  1754. /**
  1755. * Determine if a value is a Function
  1756. *
  1757. * @param {Object} val The value to test
  1758. * @returns {boolean} True if value is a Function, otherwise false
  1759. */
  1760. function isFunction(val) {
  1761. return toString.call(val) === '[object Function]';
  1762. }
  1763. /**
  1764. * Determine if a value is a Stream
  1765. *
  1766. * @param {Object} val The value to test
  1767. * @returns {boolean} True if value is a Stream, otherwise false
  1768. */
  1769. function isStream(val) {
  1770. return isObject(val) && isFunction(val.pipe);
  1771. }
  1772. /**
  1773. * Determine if a value is a URLSearchParams object
  1774. *
  1775. * @param {Object} val The value to test
  1776. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  1777. */
  1778. function isURLSearchParams(val) {
  1779. return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
  1780. }
  1781. /**
  1782. * Trim excess whitespace off the beginning and end of a string
  1783. *
  1784. * @param {String} str The String to trim
  1785. * @returns {String} The String freed of excess whitespace
  1786. */
  1787. function trim(str) {
  1788. return str.replace(/^\s*/, '').replace(/\s*$/, '');
  1789. }
  1790. /**
  1791. * Determine if we're running in a standard browser environment
  1792. *
  1793. * This allows axios to run in a web worker, and react-native.
  1794. * Both environments support XMLHttpRequest, but not fully standard globals.
  1795. *
  1796. * web workers:
  1797. * typeof window -> undefined
  1798. * typeof document -> undefined
  1799. *
  1800. * react-native:
  1801. * typeof document.createElement -> undefined
  1802. */
  1803. function isStandardBrowserEnv() {
  1804. return (
  1805. typeof window !== 'undefined' &&
  1806. typeof document !== 'undefined' &&
  1807. typeof document.createElement === 'function'
  1808. );
  1809. }
  1810. /**
  1811. * Iterate over an Array or an Object invoking a function for each item.
  1812. *
  1813. * If `obj` is an Array callback will be called passing
  1814. * the value, index, and complete array for each item.
  1815. *
  1816. * If 'obj' is an Object callback will be called passing
  1817. * the value, key, and complete object for each property.
  1818. *
  1819. * @param {Object|Array} obj The object to iterate
  1820. * @param {Function} fn The callback to invoke for each item
  1821. */
  1822. function forEach(obj, fn) {
  1823. // Don't bother if no value provided
  1824. if (obj === null || typeof obj === 'undefined') {
  1825. return;
  1826. }
  1827. // Force an array if not already something iterable
  1828. if (typeof obj !== 'object' && !isArray(obj)) {
  1829. /*eslint no-param-reassign:0*/
  1830. obj = [obj];
  1831. }
  1832. if (isArray(obj)) {
  1833. // Iterate over array values
  1834. for (var i = 0, l = obj.length; i < l; i++) {
  1835. fn.call(null, obj[i], i, obj);
  1836. }
  1837. } else {
  1838. // Iterate over object keys
  1839. for (var key in obj) {
  1840. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  1841. fn.call(null, obj[key], key, obj);
  1842. }
  1843. }
  1844. }
  1845. }
  1846. /**
  1847. * Accepts varargs expecting each argument to be an object, then
  1848. * immutably merges the properties of each object and returns result.
  1849. *
  1850. * When multiple objects contain the same key the later object in
  1851. * the arguments list will take precedence.
  1852. *
  1853. * Example:
  1854. *
  1855. * ```js
  1856. * var result = merge({foo: 123}, {foo: 456});
  1857. * console.log(result.foo); // outputs 456
  1858. * ```
  1859. *
  1860. * @param {Object} obj1 Object to merge
  1861. * @returns {Object} Result of all merge properties
  1862. */
  1863. function merge(/* obj1, obj2, obj3, ... */) {
  1864. var result = {};
  1865. function assignValue(val, key) {
  1866. if (typeof result[key] === 'object' && typeof val === 'object') {
  1867. result[key] = merge(result[key], val);
  1868. } else {
  1869. result[key] = val;
  1870. }
  1871. }
  1872. for (var i = 0, l = arguments.length; i < l; i++) {
  1873. forEach(arguments[i], assignValue);
  1874. }
  1875. return result;
  1876. }
  1877. /**
  1878. * Extends object a by mutably adding to it the properties of object b.
  1879. *
  1880. * @param {Object} a The object to be extended
  1881. * @param {Object} b The object to copy properties from
  1882. * @param {Object} thisArg The object to bind function to
  1883. * @return {Object} The resulting value of object a
  1884. */
  1885. function extend(a, b, thisArg) {
  1886. forEach(b, function assignValue(val, key) {
  1887. if (thisArg && typeof val === 'function') {
  1888. a[key] = bind(val, thisArg);
  1889. } else {
  1890. a[key] = val;
  1891. }
  1892. });
  1893. return a;
  1894. }
  1895. module.exports = {
  1896. isArray: isArray,
  1897. isArrayBuffer: isArrayBuffer,
  1898. isFormData: isFormData,
  1899. isArrayBufferView: isArrayBufferView,
  1900. isString: isString,
  1901. isNumber: isNumber,
  1902. isObject: isObject,
  1903. isUndefined: isUndefined,
  1904. isDate: isDate,
  1905. isFile: isFile,
  1906. isBlob: isBlob,
  1907. isFunction: isFunction,
  1908. isStream: isStream,
  1909. isURLSearchParams: isURLSearchParams,
  1910. isStandardBrowserEnv: isStandardBrowserEnv,
  1911. forEach: forEach,
  1912. merge: merge,
  1913. extend: extend,
  1914. trim: trim
  1915. };
  1916. /***/ },
  1917. /* 3 */
  1918. /***/ function(module, exports, __webpack_require__) {
  1919. var store = __webpack_require__(67)('wks')
  1920. , uid = __webpack_require__(71)
  1921. , Symbol = __webpack_require__(4).Symbol
  1922. , USE_SYMBOL = typeof Symbol == 'function';
  1923. var $exports = module.exports = function(name){
  1924. return store[name] || (store[name] =
  1925. USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
  1926. };
  1927. $exports.store = store;
  1928. /***/ },
  1929. /* 4 */
  1930. /***/ function(module, exports) {
  1931. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  1932. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  1933. ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
  1934. if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
  1935. /***/ },
  1936. /* 5 */
  1937. /***/ function(module, exports) {
  1938. // shim for using process in browser
  1939. var process = module.exports = {};
  1940. // cached from whatever global is present so that test runners that stub it
  1941. // don't break things. But we need to wrap it in a try catch in case it is
  1942. // wrapped in strict mode code which doesn't define any globals. It's inside a
  1943. // function because try/catches deoptimize in certain engines.
  1944. var cachedSetTimeout;
  1945. var cachedClearTimeout;
  1946. function defaultSetTimout() {
  1947. throw new Error('setTimeout has not been defined');
  1948. }
  1949. function defaultClearTimeout () {
  1950. throw new Error('clearTimeout has not been defined');
  1951. }
  1952. (function () {
  1953. try {
  1954. if (typeof setTimeout === 'function') {
  1955. cachedSetTimeout = setTimeout;
  1956. } else {
  1957. cachedSetTimeout = defaultSetTimout;
  1958. }
  1959. } catch (e) {
  1960. cachedSetTimeout = defaultSetTimout;
  1961. }
  1962. try {
  1963. if (typeof clearTimeout === 'function') {
  1964. cachedClearTimeout = clearTimeout;
  1965. } else {
  1966. cachedClearTimeout = defaultClearTimeout;
  1967. }
  1968. } catch (e) {
  1969. cachedClearTimeout = defaultClearTimeout;
  1970. }
  1971. } ())
  1972. function runTimeout(fun) {
  1973. if (cachedSetTimeout === setTimeout) {
  1974. //normal enviroments in sane situations
  1975. return setTimeout(fun, 0);
  1976. }
  1977. // if setTimeout wasn't available but was latter defined
  1978. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  1979. cachedSetTimeout = setTimeout;
  1980. return setTimeout(fun, 0);
  1981. }
  1982. try {
  1983. // when when somebody has screwed with setTimeout but no I.E. maddness
  1984. return cachedSetTimeout(fun, 0);
  1985. } catch(e){
  1986. try {
  1987. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  1988. return cachedSetTimeout.call(null, fun, 0);
  1989. } catch(e){
  1990. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  1991. return cachedSetTimeout.call(this, fun, 0);
  1992. }
  1993. }
  1994. }
  1995. function runClearTimeout(marker) {
  1996. if (cachedClearTimeout === clearTimeout) {
  1997. //normal enviroments in sane situations
  1998. return clearTimeout(marker);
  1999. }
  2000. // if clearTimeout wasn't available but was latter defined
  2001. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  2002. cachedClearTimeout = clearTimeout;
  2003. return clearTimeout(marker);
  2004. }
  2005. try {
  2006. // when when somebody has screwed with setTimeout but no I.E. maddness
  2007. return cachedClearTimeout(marker);
  2008. } catch (e){
  2009. try {
  2010. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  2011. return cachedClearTimeout.call(null, marker);
  2012. } catch (e){
  2013. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  2014. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  2015. return cachedClearTimeout.call(this, marker);
  2016. }
  2017. }
  2018. }
  2019. var queue = [];
  2020. var draining = false;
  2021. var currentQueue;
  2022. var queueIndex = -1;
  2023. function cleanUpNextTick() {
  2024. if (!draining || !currentQueue) {
  2025. return;
  2026. }
  2027. draining = false;
  2028. if (currentQueue.length) {
  2029. queue = currentQueue.concat(queue);
  2030. } else {
  2031. queueIndex = -1;
  2032. }
  2033. if (queue.length) {
  2034. drainQueue();
  2035. }
  2036. }
  2037. function drainQueue() {
  2038. if (draining) {
  2039. return;
  2040. }
  2041. var timeout = runTimeout(cleanUpNextTick);
  2042. draining = true;
  2043. var len = queue.length;
  2044. while(len) {
  2045. currentQueue = queue;
  2046. queue = [];
  2047. while (++queueIndex < len) {
  2048. if (currentQueue) {
  2049. currentQueue[queueIndex].run();
  2050. }
  2051. }
  2052. queueIndex = -1;
  2053. len = queue.length;
  2054. }
  2055. currentQueue = null;
  2056. draining = false;
  2057. runClearTimeout(timeout);
  2058. }
  2059. process.nextTick = function (fun) {
  2060. var args = new Array(arguments.length - 1);
  2061. if (arguments.length > 1) {
  2062. for (var i = 1; i < arguments.length; i++) {
  2063. args[i - 1] = arguments[i];
  2064. }
  2065. }
  2066. queue.push(new Item(fun, args));
  2067. if (queue.length === 1 && !draining) {
  2068. runTimeout(drainQueue);
  2069. }
  2070. };
  2071. // v8 likes predictible objects
  2072. function Item(fun, array) {
  2073. this.fun = fun;
  2074. this.array = array;
  2075. }
  2076. Item.prototype.run = function () {
  2077. this.fun.apply(null, this.array);
  2078. };
  2079. process.title = 'browser';
  2080. process.browser = true;
  2081. process.env = {};
  2082. process.argv = [];
  2083. process.version = ''; // empty string to avoid regexp issues
  2084. process.versions = {};
  2085. function noop() {}
  2086. process.on = noop;
  2087. process.addListener = noop;
  2088. process.once = noop;
  2089. process.off = noop;
  2090. process.removeListener = noop;
  2091. process.removeAllListeners = noop;
  2092. process.emit = noop;
  2093. process.binding = function (name) {
  2094. throw new Error('process.binding is not supported');
  2095. };
  2096. process.cwd = function () { return '/' };
  2097. process.chdir = function (dir) {
  2098. throw new Error('process.chdir is not supported');
  2099. };
  2100. process.umask = function() { return 0; };
  2101. /***/ },
  2102. /* 6 */
  2103. /***/ function(module, exports) {
  2104. var core = module.exports = {version: '2.4.0'};
  2105. if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
  2106. /***/ },
  2107. /* 7 */
  2108. /***/ function(module, exports, __webpack_require__) {
  2109. "use strict";
  2110. // a duplex stream is just a stream that is both readable and writable.
  2111. // Since JS doesn't have multiple prototypal inheritance, this class
  2112. // prototypally inherits from Readable, and then parasitically from
  2113. // Writable.
  2114. 'use strict';
  2115. /*<replacement>*/
  2116. var objectKeys = Object.keys || function (obj) {
  2117. var keys = [];
  2118. for (var key in obj) {
  2119. keys.push(key);
  2120. }return keys;
  2121. };
  2122. /*</replacement>*/
  2123. module.exports = Duplex;
  2124. /*<replacement>*/
  2125. var processNextTick = __webpack_require__(45);
  2126. /*</replacement>*/
  2127. /*<replacement>*/
  2128. var util = __webpack_require__(18);
  2129. util.inherits = __webpack_require__(1);
  2130. /*</replacement>*/
  2131. var Readable = __webpack_require__(76);
  2132. var Writable = __webpack_require__(47);
  2133. util.inherits(Duplex, Readable);
  2134. var keys = objectKeys(Writable.prototype);
  2135. for (var v = 0; v < keys.length; v++) {
  2136. var method = keys[v];
  2137. if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
  2138. }
  2139. function Duplex(options) {
  2140. if (!(this instanceof Duplex)) return new Duplex(options);
  2141. Readable.call(this, options);
  2142. Writable.call(this, options);
  2143. if (options && options.readable === false) this.readable = false;
  2144. if (options && options.writable === false) this.writable = false;
  2145. this.allowHalfOpen = true;
  2146. if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
  2147. this.once('end', onend);
  2148. }
  2149. // the no-half-open enforcer
  2150. function onend() {
  2151. // if we allow half-open state, or if the writable side ended,
  2152. // then we're ok.
  2153. if (this.allowHalfOpen || this._writableState.ended) return;
  2154. // no more data can be written.
  2155. // But allow more writes to happen in this tick.
  2156. processNextTick(onEndNT, this);
  2157. }
  2158. function onEndNT(self) {
  2159. self.end();
  2160. }
  2161. function forEach(xs, f) {
  2162. for (var i = 0, l = xs.length; i < l; i++) {
  2163. f(xs[i], i);
  2164. }
  2165. }
  2166. /***/ },
  2167. /* 8 */
  2168. /***/ function(module, exports, __webpack_require__) {
  2169. /**
  2170. * vuex v2.0.0
  2171. * (c) 2016 Evan You
  2172. * @license MIT
  2173. */
  2174. (function (global, factory) {
  2175. true ? module.exports = factory() :
  2176. typeof define === 'function' && define.amd ? define(factory) :
  2177. (global.Vuex = factory());
  2178. }(this, (function () { 'use strict';
  2179. var devtoolHook =
  2180. typeof window !== 'undefined' &&
  2181. window.__VUE_DEVTOOLS_GLOBAL_HOOK__
  2182. function devtoolPlugin (store) {
  2183. if (!devtoolHook) { return }
  2184. store._devtoolHook = devtoolHook
  2185. devtoolHook.emit('vuex:init', store)
  2186. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  2187. store.replaceState(targetState)
  2188. })
  2189. store.subscribe(function (mutation, state) {
  2190. devtoolHook.emit('vuex:mutation', mutation, state)
  2191. })
  2192. }
  2193. function applyMixin (Vue) {
  2194. var version = Number(Vue.version.split('.')[0])
  2195. if (version >= 2) {
  2196. var usesInit = Vue.config._lifecycleHooks.indexOf('init') > -1
  2197. Vue.mixin(usesInit ? { init: vuexInit } : { beforeCreate: vuexInit })
  2198. } else {
  2199. // override init and inject vuex init procedure
  2200. // for 1.x backwards compatibility.
  2201. var _init = Vue.prototype._init
  2202. Vue.prototype._init = function (options) {
  2203. if ( options === void 0 ) options = {};
  2204. options.init = options.init
  2205. ? [vuexInit].concat(options.init)
  2206. : vuexInit
  2207. _init.call(this, options)
  2208. }
  2209. }
  2210. /**
  2211. * Vuex init hook, injected into each instances init hooks list.
  2212. */
  2213. function vuexInit () {
  2214. var options = this.$options
  2215. // store injection
  2216. if (options.store) {
  2217. this.$store = options.store
  2218. } else if (options.parent && options.parent.$store) {
  2219. this.$store = options.parent.$store
  2220. }
  2221. }
  2222. }
  2223. function mapState (states) {
  2224. var res = {}
  2225. normalizeMap(states).forEach(function (ref) {
  2226. var key = ref.key;
  2227. var val = ref.val;
  2228. res[key] = function mappedState () {
  2229. return typeof val === 'function'
  2230. ? val.call(this, this.$store.state, this.$store.getters)
  2231. : this.$store.state[val]
  2232. }
  2233. })
  2234. return res
  2235. }
  2236. function mapMutations (mutations) {
  2237. var res = {}
  2238. normalizeMap(mutations).forEach(function (ref) {
  2239. var key = ref.key;
  2240. var val = ref.val;
  2241. res[key] = function mappedMutation () {
  2242. var args = [], len = arguments.length;
  2243. while ( len-- ) args[ len ] = arguments[ len ];
  2244. return this.$store.commit.apply(this.$store, [val].concat(args))
  2245. }
  2246. })
  2247. return res
  2248. }
  2249. function mapGetters (getters) {
  2250. var res = {}
  2251. normalizeMap(getters).forEach(function (ref) {
  2252. var key = ref.key;
  2253. var val = ref.val;
  2254. res[key] = function mappedGetter () {
  2255. if (!(val in this.$store.getters)) {
  2256. console.error(("[vuex] unknown getter: " + val))
  2257. }
  2258. return this.$store.getters[val]
  2259. }
  2260. })
  2261. return res
  2262. }
  2263. function mapActions (actions) {
  2264. var res = {}
  2265. normalizeMap(actions).forEach(function (ref) {
  2266. var key = ref.key;
  2267. var val = ref.val;
  2268. res[key] = function mappedAction () {
  2269. var args = [], len = arguments.length;
  2270. while ( len-- ) args[ len ] = arguments[ len ];
  2271. return this.$store.dispatch.apply(this.$store, [val].concat(args))
  2272. }
  2273. })
  2274. return res
  2275. }
  2276. function normalizeMap (map) {
  2277. return Array.isArray(map)
  2278. ? map.map(function (key) { return ({ key: key, val: key }); })
  2279. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  2280. }
  2281. function isObject (obj) {
  2282. return obj !== null && typeof obj === 'object'
  2283. }
  2284. function isPromise (val) {
  2285. return val && typeof val.then === 'function'
  2286. }
  2287. function assert (condition, msg) {
  2288. if (!condition) { throw new Error(("[vuex] " + msg)) }
  2289. }
  2290. var Vue // bind on install
  2291. var Store = function Store (options) {
  2292. var this$1 = this;
  2293. if ( options === void 0 ) options = {};
  2294. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.")
  2295. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.")
  2296. var state = options.state; if ( state === void 0 ) state = {};
  2297. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  2298. var strict = options.strict; if ( strict === void 0 ) strict = false;
  2299. // store internal state
  2300. this._options = options
  2301. this._committing = false
  2302. this._actions = Object.create(null)
  2303. this._mutations = Object.create(null)
  2304. this._wrappedGetters = Object.create(null)
  2305. this._runtimeModules = Object.create(null)
  2306. this._subscribers = []
  2307. this._watcherVM = new Vue()
  2308. // bind commit and dispatch to self
  2309. var store = this
  2310. var ref = this;
  2311. var dispatch = ref.dispatch;
  2312. var commit = ref.commit;
  2313. this.dispatch = function boundDispatch (type, payload) {
  2314. return dispatch.call(store, type, payload)
  2315. }
  2316. this.commit = function boundCommit (type, payload, options) {
  2317. return commit.call(store, type, payload, options)
  2318. }
  2319. // strict mode
  2320. this.strict = strict
  2321. // init root module.
  2322. // this also recursively registers all sub-modules
  2323. // and collects all module getters inside this._wrappedGetters
  2324. installModule(this, state, [], options)
  2325. // initialize the store vm, which is responsible for the reactivity
  2326. // (also registers _wrappedGetters as computed properties)
  2327. resetStoreVM(this, state)
  2328. // apply plugins
  2329. plugins.concat(devtoolPlugin).forEach(function (plugin) { return plugin(this$1); })
  2330. };
  2331. var prototypeAccessors = { state: {} };
  2332. prototypeAccessors.state.get = function () {
  2333. return this._vm.state
  2334. };
  2335. prototypeAccessors.state.set = function (v) {
  2336. assert(false, "Use store.replaceState() to explicit replace store state.")
  2337. };
  2338. Store.prototype.commit = function commit (type, payload, options) {
  2339. var this$1 = this;
  2340. // check object-style commit
  2341. if (isObject(type) && type.type) {
  2342. options = payload
  2343. payload = type
  2344. type = type.type
  2345. }
  2346. var mutation = { type: type, payload: payload }
  2347. var entry = this._mutations[type]
  2348. if (!entry) {
  2349. console.error(("[vuex] unknown mutation type: " + type))
  2350. return
  2351. }
  2352. this._withCommit(function () {
  2353. entry.forEach(function commitIterator (handler) {
  2354. handler(payload)
  2355. })
  2356. })
  2357. if (!options || !options.silent) {
  2358. this._subscribers.forEach(function (sub) { return sub(mutation, this$1.state); })
  2359. }
  2360. };
  2361. Store.prototype.dispatch = function dispatch (type, payload) {
  2362. // check object-style dispatch
  2363. if (isObject(type) && type.type) {
  2364. payload = type
  2365. type = type.type
  2366. }
  2367. var entry = this._actions[type]
  2368. if (!entry) {
  2369. console.error(("[vuex] unknown action type: " + type))
  2370. return
  2371. }
  2372. return entry.length > 1
  2373. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  2374. : entry[0](payload)
  2375. };
  2376. Store.prototype.subscribe = function subscribe (fn) {
  2377. var subs = this._subscribers
  2378. if (subs.indexOf(fn) < 0) {
  2379. subs.push(fn)
  2380. }
  2381. return function () {
  2382. var i = subs.indexOf(fn)
  2383. if (i > -1) {
  2384. subs.splice(i, 1)
  2385. }
  2386. }
  2387. };
  2388. Store.prototype.watch = function watch (getter, cb, options) {
  2389. var this$1 = this;
  2390. assert(typeof getter === 'function', "store.watch only accepts a function.")
  2391. return this._watcherVM.$watch(function () { return getter(this$1.state); }, cb, options)
  2392. };
  2393. Store.prototype.replaceState = function replaceState (state) {
  2394. var this$1 = this;
  2395. this._withCommit(function () {
  2396. this$1._vm.state = state
  2397. })
  2398. };
  2399. Store.prototype.registerModule = function registerModule (path, module) {
  2400. if (typeof path === 'string') { path = [path] }
  2401. assert(Array.isArray(path), "module path must be a string or an Array.")
  2402. this._runtimeModules[path.join('.')] = module
  2403. installModule(this, this.state, path, module)
  2404. // reset store to update getters...
  2405. resetStoreVM(this, this.state)
  2406. };
  2407. Store.prototype.unregisterModule = function unregisterModule (path) {
  2408. var this$1 = this;
  2409. if (typeof path === 'string') { path = [path] }
  2410. assert(Array.isArray(path), "module path must be a string or an Array.")
  2411. delete this._runtimeModules[path.join('.')]
  2412. this._withCommit(function () {
  2413. var parentState = getNestedState(this$1.state, path.slice(0, -1))
  2414. Vue.delete(parentState, path[path.length - 1])
  2415. })
  2416. resetStore(this)
  2417. };
  2418. Store.prototype.hotUpdate = function hotUpdate (newOptions) {
  2419. updateModule(this._options, newOptions)
  2420. resetStore(this)
  2421. };
  2422. Store.prototype._withCommit = function _withCommit (fn) {
  2423. var committing = this._committing
  2424. this._committing = true
  2425. fn()
  2426. this._committing = committing
  2427. };
  2428. Object.defineProperties( Store.prototype, prototypeAccessors );
  2429. function updateModule (targetModule, newModule) {
  2430. if (newModule.actions) {
  2431. targetModule.actions = newModule.actions
  2432. }
  2433. if (newModule.mutations) {
  2434. targetModule.mutations = newModule.mutations
  2435. }
  2436. if (newModule.getters) {
  2437. targetModule.getters = newModule.getters
  2438. }
  2439. if (newModule.modules) {
  2440. for (var key in newModule.modules) {
  2441. if (!(targetModule.modules && targetModule.modules[key])) {
  2442. console.warn(
  2443. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  2444. 'manual reload is needed'
  2445. )
  2446. return
  2447. }
  2448. updateModule(targetModule.modules[key], newModule.modules[key])
  2449. }
  2450. }
  2451. }
  2452. function resetStore (store) {
  2453. store._actions = Object.create(null)
  2454. store._mutations = Object.create(null)
  2455. store._wrappedGetters = Object.create(null)
  2456. var state = store.state
  2457. // init root module
  2458. installModule(store, state, [], store._options, true)
  2459. // init all runtime modules
  2460. Object.keys(store._runtimeModules).forEach(function (key) {
  2461. installModule(store, state, key.split('.'), store._runtimeModules[key], true)
  2462. })
  2463. // reset vm
  2464. resetStoreVM(store, state)
  2465. }
  2466. function resetStoreVM (store, state) {
  2467. var oldVm = store._vm
  2468. // bind store public getters
  2469. store.getters = {}
  2470. var wrappedGetters = store._wrappedGetters
  2471. var computed = {}
  2472. Object.keys(wrappedGetters).forEach(function (key) {
  2473. var fn = wrappedGetters[key]
  2474. // use computed to leverage its lazy-caching mechanism
  2475. computed[key] = function () { return fn(store); }
  2476. Object.defineProperty(store.getters, key, {
  2477. get: function () { return store._vm[key]; }
  2478. })
  2479. })
  2480. // use a Vue instance to store the state tree
  2481. // suppress warnings just in case the user has added
  2482. // some funky global mixins
  2483. var silent = Vue.config.silent
  2484. Vue.config.silent = true
  2485. store._vm = new Vue({
  2486. data: { state: state },
  2487. computed: computed
  2488. })
  2489. Vue.config.silent = silent
  2490. // enable strict mode for new vm
  2491. if (store.strict) {
  2492. enableStrictMode(store)
  2493. }
  2494. if (oldVm) {
  2495. // dispatch changes in all subscribed watchers
  2496. // to force getter re-evaluation.
  2497. store._withCommit(function () {
  2498. oldVm.state = null
  2499. })
  2500. Vue.nextTick(function () { return oldVm.$destroy(); })
  2501. }
  2502. }
  2503. function installModule (store, rootState, path, module, hot) {
  2504. var isRoot = !path.length
  2505. var state = module.state;
  2506. var actions = module.actions;
  2507. var mutations = module.mutations;
  2508. var getters = module.getters;
  2509. var modules = module.modules;
  2510. // set state
  2511. if (!isRoot && !hot) {
  2512. var parentState = getNestedState(rootState, path.slice(0, -1))
  2513. var moduleName = path[path.length - 1]
  2514. store._withCommit(function () {
  2515. Vue.set(parentState, moduleName, state || {})
  2516. })
  2517. }
  2518. if (mutations) {
  2519. Object.keys(mutations).forEach(function (key) {
  2520. registerMutation(store, key, mutations[key], path)
  2521. })
  2522. }
  2523. if (actions) {
  2524. Object.keys(actions).forEach(function (key) {
  2525. registerAction(store, key, actions[key], path)
  2526. })
  2527. }
  2528. if (getters) {
  2529. wrapGetters(store, getters, path)
  2530. }
  2531. if (modules) {
  2532. Object.keys(modules).forEach(function (key) {
  2533. installModule(store, rootState, path.concat(key), modules[key], hot)
  2534. })
  2535. }
  2536. }
  2537. function registerMutation (store, type, handler, path) {
  2538. if ( path === void 0 ) path = [];
  2539. var entry = store._mutations[type] || (store._mutations[type] = [])
  2540. entry.push(function wrappedMutationHandler (payload) {
  2541. handler(getNestedState(store.state, path), payload)
  2542. })
  2543. }
  2544. function registerAction (store, type, handler, path) {
  2545. if ( path === void 0 ) path = [];
  2546. var entry = store._actions[type] || (store._actions[type] = [])
  2547. var dispatch = store.dispatch;
  2548. var commit = store.commit;
  2549. entry.push(function wrappedActionHandler (payload, cb) {
  2550. var res = handler({
  2551. dispatch: dispatch,
  2552. commit: commit,
  2553. getters: store.getters,
  2554. state: getNestedState(store.state, path),
  2555. rootState: store.state
  2556. }, payload, cb)
  2557. if (!isPromise(res)) {
  2558. res = Promise.resolve(res)
  2559. }
  2560. if (store._devtoolHook) {
  2561. return res.catch(function (err) {
  2562. store._devtoolHook.emit('vuex:error', err)
  2563. throw err
  2564. })
  2565. } else {
  2566. return res
  2567. }
  2568. })
  2569. }
  2570. function wrapGetters (store, moduleGetters, modulePath) {
  2571. Object.keys(moduleGetters).forEach(function (getterKey) {
  2572. var rawGetter = moduleGetters[getterKey]
  2573. if (store._wrappedGetters[getterKey]) {
  2574. console.error(("[vuex] duplicate getter key: " + getterKey))
  2575. return
  2576. }
  2577. store._wrappedGetters[getterKey] = function wrappedGetter (store) {
  2578. return rawGetter(
  2579. getNestedState(store.state, modulePath), // local state
  2580. store.getters, // getters
  2581. store.state // root state
  2582. )
  2583. }
  2584. })
  2585. }
  2586. function enableStrictMode (store) {
  2587. store._vm.$watch('state', function () {
  2588. assert(store._committing, "Do not mutate vuex store state outside mutation handlers.")
  2589. }, { deep: true, sync: true })
  2590. }
  2591. function getNestedState (state, path) {
  2592. return path.length
  2593. ? path.reduce(function (state, key) { return state[key]; }, state)
  2594. : state
  2595. }
  2596. function install (_Vue) {
  2597. if (Vue) {
  2598. console.error(
  2599. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  2600. )
  2601. return
  2602. }
  2603. Vue = _Vue
  2604. applyMixin(Vue)
  2605. }
  2606. // auto install in dist mode
  2607. if (typeof window !== 'undefined' && window.Vue) {
  2608. install(window.Vue)
  2609. }
  2610. var index = {
  2611. Store: Store,
  2612. install: install,
  2613. mapState: mapState,
  2614. mapMutations: mapMutations,
  2615. mapGetters: mapGetters,
  2616. mapActions: mapActions
  2617. }
  2618. return index;
  2619. })));
  2620. /***/ },
  2621. /* 9 */
  2622. /***/ function(module, exports, __webpack_require__) {
  2623. var isObject = __webpack_require__(29);
  2624. module.exports = function(it){
  2625. if(!isObject(it))throw TypeError(it + ' is not an object!');
  2626. return it;
  2627. };
  2628. /***/ },
  2629. /* 10 */
  2630. /***/ function(module, exports, __webpack_require__) {
  2631. // Thank's IE8 for his funny defineProperty
  2632. module.exports = !__webpack_require__(38)(function(){
  2633. return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
  2634. });
  2635. /***/ },
  2636. /* 11 */
  2637. /***/ function(module, exports, __webpack_require__) {
  2638. var dP = __webpack_require__(17)
  2639. , createDesc = __webpack_require__(66);
  2640. module.exports = __webpack_require__(10) ? function(object, key, value){
  2641. return dP.f(object, key, createDesc(1, value));
  2642. } : function(object, key, value){
  2643. object[key] = value;
  2644. return object;
  2645. };
  2646. /***/ },
  2647. /* 12 */
  2648. /***/ function(module, exports, __webpack_require__) {
  2649. /* WEBPACK VAR INJECTION */(function(Buffer) {// prototype class for hash functions
  2650. function Hash (blockSize, finalSize) {
  2651. this._block = new Buffer(blockSize)
  2652. this._finalSize = finalSize
  2653. this._blockSize = blockSize
  2654. this._len = 0
  2655. this._s = 0
  2656. }
  2657. Hash.prototype.update = function (data, enc) {
  2658. if (typeof data === 'string') {
  2659. enc = enc || 'utf8'
  2660. data = new Buffer(data, enc)
  2661. }
  2662. var l = this._len += data.length
  2663. var s = this._s || 0
  2664. var f = 0
  2665. var buffer = this._block
  2666. while (s < l) {
  2667. var t = Math.min(data.length, f + this._blockSize - (s % this._blockSize))
  2668. var ch = (t - f)
  2669. for (var i = 0; i < ch; i++) {
  2670. buffer[(s % this._blockSize) + i] = data[i + f]
  2671. }
  2672. s += ch
  2673. f += ch
  2674. if ((s % this._blockSize) === 0) {
  2675. this._update(buffer)
  2676. }
  2677. }
  2678. this._s = s
  2679. return this
  2680. }
  2681. Hash.prototype.digest = function (enc) {
  2682. // Suppose the length of the message M, in bits, is l
  2683. var l = this._len * 8
  2684. // Append the bit 1 to the end of the message
  2685. this._block[this._len % this._blockSize] = 0x80
  2686. // and then k zero bits, where k is the smallest non-negative solution to the equation (l + 1 + k) === finalSize mod blockSize
  2687. this._block.fill(0, this._len % this._blockSize + 1)
  2688. if (l % (this._blockSize * 8) >= this._finalSize * 8) {
  2689. this._update(this._block)
  2690. this._block.fill(0)
  2691. }
  2692. // to this append the block which is equal to the number l written in binary
  2693. // TODO: handle case where l is > Math.pow(2, 29)
  2694. this._block.writeInt32BE(l, this._blockSize - 4)
  2695. var hash = this._update(this._block) || this._hash()
  2696. return enc ? hash.toString(enc) : hash
  2697. }
  2698. Hash.prototype._update = function () {
  2699. throw new Error('_update must be implemented by subclass')
  2700. }
  2701. module.exports = Hash
  2702. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  2703. /***/ },
  2704. /* 13 */
  2705. /***/ function(module, exports, __webpack_require__) {
  2706. "use strict";
  2707. 'use strict';
  2708. Object.defineProperty(exports, "__esModule", {
  2709. value: true
  2710. });
  2711. exports.TOKEN_KEY = exports.LOCAL_STORAGE_KEY = undefined;
  2712. var _defineProperty2 = __webpack_require__(116);
  2713. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  2714. var _stringify = __webpack_require__(115);
  2715. var _stringify2 = _interopRequireDefault(_stringify);
  2716. var _assign = __webpack_require__(33);
  2717. var _assign2 = _interopRequireDefault(_assign);
  2718. var _classCallCheck2 = __webpack_require__(14);
  2719. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  2720. var _createClass2 = __webpack_require__(15);
  2721. var _createClass3 = _interopRequireDefault(_createClass2);
  2722. var _token = __webpack_require__(112);
  2723. var _token2 = _interopRequireDefault(_token);
  2724. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  2725. var LOCAL_STORAGE_KEY = exports.LOCAL_STORAGE_KEY = 'lesspass';
  2726. var TOKEN_KEY = exports.TOKEN_KEY = 'jwt';
  2727. var Storage = function () {
  2728. function Storage() {
  2729. var storage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.localStorage;
  2730. (0, _classCallCheck3.default)(this, Storage);
  2731. this.storage = storage;
  2732. }
  2733. (0, _createClass3.default)(Storage, [{
  2734. key: '_getLocalStorage',
  2735. value: function _getLocalStorage() {
  2736. return JSON.parse(this.storage.getItem(LOCAL_STORAGE_KEY) || '{}');
  2737. }
  2738. }, {
  2739. key: 'json',
  2740. value: function json() {
  2741. var defaultStorage = {
  2742. baseURL: 'https://lesspass.com',
  2743. timeout: 5000
  2744. };
  2745. var localStorage = this._getLocalStorage();
  2746. return (0, _assign2.default)(defaultStorage, localStorage);
  2747. }
  2748. }, {
  2749. key: 'save',
  2750. value: function save(data) {
  2751. var newData = (0, _assign2.default)(this._getLocalStorage(), data);
  2752. this.storage.setItem(LOCAL_STORAGE_KEY, (0, _stringify2.default)(newData));
  2753. }
  2754. }, {
  2755. key: 'clear',
  2756. value: function clear() {
  2757. this.storage.clear();
  2758. }
  2759. }, {
  2760. key: 'getToken',
  2761. value: function getToken() {
  2762. var storage = this.json();
  2763. if (TOKEN_KEY in storage) {
  2764. return new _token2.default(storage[TOKEN_KEY]);
  2765. }
  2766. return new _token2.default();
  2767. }
  2768. }, {
  2769. key: 'saveToken',
  2770. value: function saveToken(token) {
  2771. this.save((0, _defineProperty3.default)({}, TOKEN_KEY, token));
  2772. }
  2773. }]);
  2774. return Storage;
  2775. }();
  2776. exports.default = Storage;
  2777. /***/ },
  2778. /* 14 */
  2779. /***/ function(module, exports) {
  2780. "use strict";
  2781. "use strict";
  2782. exports.__esModule = true;
  2783. exports.default = function (instance, Constructor) {
  2784. if (!(instance instanceof Constructor)) {
  2785. throw new TypeError("Cannot call a class as a function");
  2786. }
  2787. };
  2788. /***/ },
  2789. /* 15 */
  2790. /***/ function(module, exports, __webpack_require__) {
  2791. "use strict";
  2792. "use strict";
  2793. exports.__esModule = true;
  2794. var _defineProperty = __webpack_require__(57);
  2795. var _defineProperty2 = _interopRequireDefault(_defineProperty);
  2796. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  2797. exports.default = function () {
  2798. function defineProperties(target, props) {
  2799. for (var i = 0; i < props.length; i++) {
  2800. var descriptor = props[i];
  2801. descriptor.enumerable = descriptor.enumerable || false;
  2802. descriptor.configurable = true;
  2803. if ("value" in descriptor) descriptor.writable = true;
  2804. (0, _defineProperty2.default)(target, descriptor.key, descriptor);
  2805. }
  2806. }
  2807. return function (Constructor, protoProps, staticProps) {
  2808. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  2809. if (staticProps) defineProperties(Constructor, staticProps);
  2810. return Constructor;
  2811. };
  2812. }();
  2813. /***/ },
  2814. /* 16 */
  2815. /***/ function(module, exports) {
  2816. module.exports = {};
  2817. /***/ },
  2818. /* 17 */
  2819. /***/ function(module, exports, __webpack_require__) {
  2820. var anObject = __webpack_require__(9)
  2821. , IE8_DOM_DEFINE = __webpack_require__(130)
  2822. , toPrimitive = __webpack_require__(151)
  2823. , dP = Object.defineProperty;
  2824. exports.f = __webpack_require__(10) ? Object.defineProperty : function defineProperty(O, P, Attributes){
  2825. anObject(O);
  2826. P = toPrimitive(P, true);
  2827. anObject(Attributes);
  2828. if(IE8_DOM_DEFINE)try {
  2829. return dP(O, P, Attributes);
  2830. } catch(e){ /* empty */ }
  2831. if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
  2832. if('value' in Attributes)O[P] = Attributes.value;
  2833. return O;
  2834. };
  2835. /***/ },
  2836. /* 18 */
  2837. /***/ function(module, exports, __webpack_require__) {
  2838. /* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors.
  2839. //
  2840. // Permission is hereby granted, free of charge, to any person obtaining a
  2841. // copy of this software and associated documentation files (the
  2842. // "Software"), to deal in the Software without restriction, including
  2843. // without limitation the rights to use, copy, modify, merge, publish,
  2844. // distribute, sublicense, and/or sell copies of the Software, and to permit
  2845. // persons to whom the Software is furnished to do so, subject to the
  2846. // following conditions:
  2847. //
  2848. // The above copyright notice and this permission notice shall be included
  2849. // in all copies or substantial portions of the Software.
  2850. //
  2851. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  2852. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  2853. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  2854. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  2855. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  2856. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  2857. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  2858. // NOTE: These type checking functions intentionally don't use `instanceof`
  2859. // because it is fragile and can be easily faked with `Object.create()`.
  2860. function isArray(arg) {
  2861. if (Array.isArray) {
  2862. return Array.isArray(arg);
  2863. }
  2864. return objectToString(arg) === '[object Array]';
  2865. }
  2866. exports.isArray = isArray;
  2867. function isBoolean(arg) {
  2868. return typeof arg === 'boolean';
  2869. }
  2870. exports.isBoolean = isBoolean;
  2871. function isNull(arg) {
  2872. return arg === null;
  2873. }
  2874. exports.isNull = isNull;
  2875. function isNullOrUndefined(arg) {
  2876. return arg == null;
  2877. }
  2878. exports.isNullOrUndefined = isNullOrUndefined;
  2879. function isNumber(arg) {
  2880. return typeof arg === 'number';
  2881. }
  2882. exports.isNumber = isNumber;
  2883. function isString(arg) {
  2884. return typeof arg === 'string';
  2885. }
  2886. exports.isString = isString;
  2887. function isSymbol(arg) {
  2888. return typeof arg === 'symbol';
  2889. }
  2890. exports.isSymbol = isSymbol;
  2891. function isUndefined(arg) {
  2892. return arg === void 0;
  2893. }
  2894. exports.isUndefined = isUndefined;
  2895. function isRegExp(re) {
  2896. return objectToString(re) === '[object RegExp]';
  2897. }
  2898. exports.isRegExp = isRegExp;
  2899. function isObject(arg) {
  2900. return typeof arg === 'object' && arg !== null;
  2901. }
  2902. exports.isObject = isObject;
  2903. function isDate(d) {
  2904. return objectToString(d) === '[object Date]';
  2905. }
  2906. exports.isDate = isDate;
  2907. function isError(e) {
  2908. return (objectToString(e) === '[object Error]' || e instanceof Error);
  2909. }
  2910. exports.isError = isError;
  2911. function isFunction(arg) {
  2912. return typeof arg === 'function';
  2913. }
  2914. exports.isFunction = isFunction;
  2915. function isPrimitive(arg) {
  2916. return arg === null ||
  2917. typeof arg === 'boolean' ||
  2918. typeof arg === 'number' ||
  2919. typeof arg === 'string' ||
  2920. typeof arg === 'symbol' || // ES6 symbol
  2921. typeof arg === 'undefined';
  2922. }
  2923. exports.isPrimitive = isPrimitive;
  2924. exports.isBuffer = Buffer.isBuffer;
  2925. function objectToString(o) {
  2926. return Object.prototype.toString.call(o);
  2927. }
  2928. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  2929. /***/ },
  2930. /* 19 */
  2931. /***/ function(module, exports) {
  2932. /*
  2933. MIT License http://www.opensource.org/licenses/mit-license.php
  2934. Author Tobias Koppers @sokra
  2935. */
  2936. // css base code, injected by the css-loader
  2937. module.exports = function() {
  2938. var list = [];
  2939. // return the list of modules as css string
  2940. list.toString = function toString() {
  2941. var result = [];
  2942. for(var i = 0; i < this.length; i++) {
  2943. var item = this[i];
  2944. if(item[2]) {
  2945. result.push("@media " + item[2] + "{" + item[1] + "}");
  2946. } else {
  2947. result.push(item[1]);
  2948. }
  2949. }
  2950. return result.join("");
  2951. };
  2952. // import a list of modules into the list
  2953. list.i = function(modules, mediaQuery) {
  2954. if(typeof modules === "string")
  2955. modules = [[null, modules, ""]];
  2956. var alreadyImportedModules = {};
  2957. for(var i = 0; i < this.length; i++) {
  2958. var id = this[i][0];
  2959. if(typeof id === "number")
  2960. alreadyImportedModules[id] = true;
  2961. }
  2962. for(i = 0; i < modules.length; i++) {
  2963. var item = modules[i];
  2964. // skip already imported module
  2965. // this implementation is not 100% perfect for weird media query combinations
  2966. // when a module is imported multiple times with different media queries.
  2967. // I hope this will never occur (Hey this way we have smaller bundles)
  2968. if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
  2969. if(mediaQuery && !item[2]) {
  2970. item[2] = mediaQuery;
  2971. } else if(mediaQuery) {
  2972. item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
  2973. }
  2974. list.push(item);
  2975. }
  2976. }
  2977. };
  2978. return list;
  2979. };
  2980. /***/ },
  2981. /* 20 */
  2982. /***/ function(module, exports, __webpack_require__) {
  2983. // Copyright Joyent, Inc. and other Node contributors.
  2984. //
  2985. // Permission is hereby granted, free of charge, to any person obtaining a
  2986. // copy of this software and associated documentation files (the
  2987. // "Software"), to deal in the Software without restriction, including
  2988. // without limitation the rights to use, copy, modify, merge, publish,
  2989. // distribute, sublicense, and/or sell copies of the Software, and to permit
  2990. // persons to whom the Software is furnished to do so, subject to the
  2991. // following conditions:
  2992. //
  2993. // The above copyright notice and this permission notice shall be included
  2994. // in all copies or substantial portions of the Software.
  2995. //
  2996. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  2997. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  2998. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  2999. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  3000. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  3001. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  3002. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  3003. module.exports = Stream;
  3004. var EE = __webpack_require__(30).EventEmitter;
  3005. var inherits = __webpack_require__(1);
  3006. inherits(Stream, EE);
  3007. Stream.Readable = __webpack_require__(186);
  3008. Stream.Writable = __webpack_require__(188);
  3009. Stream.Duplex = __webpack_require__(183);
  3010. Stream.Transform = __webpack_require__(187);
  3011. Stream.PassThrough = __webpack_require__(185);
  3012. // Backwards-compat with node 0.4.x
  3013. Stream.Stream = Stream;
  3014. // old-style streams. Note that the pipe method (the only relevant
  3015. // part of this class) is overridden in the Readable class.
  3016. function Stream() {
  3017. EE.call(this);
  3018. }
  3019. Stream.prototype.pipe = function(dest, options) {
  3020. var source = this;
  3021. function ondata(chunk) {
  3022. if (dest.writable) {
  3023. if (false === dest.write(chunk) && source.pause) {
  3024. source.pause();
  3025. }
  3026. }
  3027. }
  3028. source.on('data', ondata);
  3029. function ondrain() {
  3030. if (source.readable && source.resume) {
  3031. source.resume();
  3032. }
  3033. }
  3034. dest.on('drain', ondrain);
  3035. // If the 'end' option is not supplied, dest.end() will be called when
  3036. // source gets the 'end' or 'close' events. Only dest.end() once.
  3037. if (!dest._isStdio && (!options || options.end !== false)) {
  3038. source.on('end', onend);
  3039. source.on('close', onclose);
  3040. }
  3041. var didOnEnd = false;
  3042. function onend() {
  3043. if (didOnEnd) return;
  3044. didOnEnd = true;
  3045. dest.end();
  3046. }
  3047. function onclose() {
  3048. if (didOnEnd) return;
  3049. didOnEnd = true;
  3050. if (typeof dest.destroy === 'function') dest.destroy();
  3051. }
  3052. // don't leave dangling pipes when there are errors.
  3053. function onerror(er) {
  3054. cleanup();
  3055. if (EE.listenerCount(this, 'error') === 0) {
  3056. throw er; // Unhandled stream error in pipe.
  3057. }
  3058. }
  3059. source.on('error', onerror);
  3060. dest.on('error', onerror);
  3061. // remove all the event listeners that were added.
  3062. function cleanup() {
  3063. source.removeListener('data', ondata);
  3064. dest.removeListener('drain', ondrain);
  3065. source.removeListener('end', onend);
  3066. source.removeListener('close', onclose);
  3067. source.removeListener('error', onerror);
  3068. dest.removeListener('error', onerror);
  3069. source.removeListener('end', cleanup);
  3070. source.removeListener('close', cleanup);
  3071. dest.removeListener('close', cleanup);
  3072. }
  3073. source.on('end', cleanup);
  3074. source.on('close', cleanup);
  3075. dest.on('close', cleanup);
  3076. dest.emit('pipe', source);
  3077. // Allow for unix-like usage: A.pipe(B).pipe(C)
  3078. return dest;
  3079. };
  3080. /***/ },
  3081. /* 21 */
  3082. /***/ function(module, exports) {
  3083. /*
  3084. MIT License http://www.opensource.org/licenses/mit-license.php
  3085. Author Tobias Koppers @sokra
  3086. */
  3087. var stylesInDom = {},
  3088. memoize = function(fn) {
  3089. var memo;
  3090. return function () {
  3091. if (typeof memo === "undefined") memo = fn.apply(this, arguments);
  3092. return memo;
  3093. };
  3094. },
  3095. isOldIE = memoize(function() {
  3096. return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase());
  3097. }),
  3098. getHeadElement = memoize(function () {
  3099. return document.head || document.getElementsByTagName("head")[0];
  3100. }),
  3101. singletonElement = null,
  3102. singletonCounter = 0,
  3103. styleElementsInsertedAtTop = [];
  3104. module.exports = function(list, options) {
  3105. if(typeof DEBUG !== "undefined" && DEBUG) {
  3106. if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
  3107. }
  3108. options = options || {};
  3109. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  3110. // tags it will allow on a page
  3111. if (typeof options.singleton === "undefined") options.singleton = isOldIE();
  3112. // By default, add <style> tags to the bottom of <head>.
  3113. if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
  3114. var styles = listToStyles(list);
  3115. addStylesToDom(styles, options);
  3116. return function update(newList) {
  3117. var mayRemove = [];
  3118. for(var i = 0; i < styles.length; i++) {
  3119. var item = styles[i];
  3120. var domStyle = stylesInDom[item.id];
  3121. domStyle.refs--;
  3122. mayRemove.push(domStyle);
  3123. }
  3124. if(newList) {
  3125. var newStyles = listToStyles(newList);
  3126. addStylesToDom(newStyles, options);
  3127. }
  3128. for(var i = 0; i < mayRemove.length; i++) {
  3129. var domStyle = mayRemove[i];
  3130. if(domStyle.refs === 0) {
  3131. for(var j = 0; j < domStyle.parts.length; j++)
  3132. domStyle.parts[j]();
  3133. delete stylesInDom[domStyle.id];
  3134. }
  3135. }
  3136. };
  3137. }
  3138. function addStylesToDom(styles, options) {
  3139. for(var i = 0; i < styles.length; i++) {
  3140. var item = styles[i];
  3141. var domStyle = stylesInDom[item.id];
  3142. if(domStyle) {
  3143. domStyle.refs++;
  3144. for(var j = 0; j < domStyle.parts.length; j++) {
  3145. domStyle.parts[j](item.parts[j]);
  3146. }
  3147. for(; j < item.parts.length; j++) {
  3148. domStyle.parts.push(addStyle(item.parts[j], options));
  3149. }
  3150. } else {
  3151. var parts = [];
  3152. for(var j = 0; j < item.parts.length; j++) {
  3153. parts.push(addStyle(item.parts[j], options));
  3154. }
  3155. stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
  3156. }
  3157. }
  3158. }
  3159. function listToStyles(list) {
  3160. var styles = [];
  3161. var newStyles = {};
  3162. for(var i = 0; i < list.length; i++) {
  3163. var item = list[i];
  3164. var id = item[0];
  3165. var css = item[1];
  3166. var media = item[2];
  3167. var sourceMap = item[3];
  3168. var part = {css: css, media: media, sourceMap: sourceMap};
  3169. if(!newStyles[id])
  3170. styles.push(newStyles[id] = {id: id, parts: [part]});
  3171. else
  3172. newStyles[id].parts.push(part);
  3173. }
  3174. return styles;
  3175. }
  3176. function insertStyleElement(options, styleElement) {
  3177. var head = getHeadElement();
  3178. var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
  3179. if (options.insertAt === "top") {
  3180. if(!lastStyleElementInsertedAtTop) {
  3181. head.insertBefore(styleElement, head.firstChild);
  3182. } else if(lastStyleElementInsertedAtTop.nextSibling) {
  3183. head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
  3184. } else {
  3185. head.appendChild(styleElement);
  3186. }
  3187. styleElementsInsertedAtTop.push(styleElement);
  3188. } else if (options.insertAt === "bottom") {
  3189. head.appendChild(styleElement);
  3190. } else {
  3191. throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
  3192. }
  3193. }
  3194. function removeStyleElement(styleElement) {
  3195. styleElement.parentNode.removeChild(styleElement);
  3196. var idx = styleElementsInsertedAtTop.indexOf(styleElement);
  3197. if(idx >= 0) {
  3198. styleElementsInsertedAtTop.splice(idx, 1);
  3199. }
  3200. }
  3201. function createStyleElement(options) {
  3202. var styleElement = document.createElement("style");
  3203. styleElement.type = "text/css";
  3204. insertStyleElement(options, styleElement);
  3205. return styleElement;
  3206. }
  3207. function addStyle(obj, options) {
  3208. var styleElement, update, remove;
  3209. if (options.singleton) {
  3210. var styleIndex = singletonCounter++;
  3211. styleElement = singletonElement || (singletonElement = createStyleElement(options));
  3212. update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
  3213. remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
  3214. } else {
  3215. styleElement = createStyleElement(options);
  3216. update = applyToTag.bind(null, styleElement);
  3217. remove = function() {
  3218. removeStyleElement(styleElement);
  3219. };
  3220. }
  3221. update(obj);
  3222. return function updateStyle(newObj) {
  3223. if(newObj) {
  3224. if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
  3225. return;
  3226. update(obj = newObj);
  3227. } else {
  3228. remove();
  3229. }
  3230. };
  3231. }
  3232. var replaceText = (function () {
  3233. var textStore = [];
  3234. return function (index, replacement) {
  3235. textStore[index] = replacement;
  3236. return textStore.filter(Boolean).join('\n');
  3237. };
  3238. })();
  3239. function applyToSingletonTag(styleElement, index, remove, obj) {
  3240. var css = remove ? "" : obj.css;
  3241. if (styleElement.styleSheet) {
  3242. styleElement.styleSheet.cssText = replaceText(index, css);
  3243. } else {
  3244. var cssNode = document.createTextNode(css);
  3245. var childNodes = styleElement.childNodes;
  3246. if (childNodes[index]) styleElement.removeChild(childNodes[index]);
  3247. if (childNodes.length) {
  3248. styleElement.insertBefore(cssNode, childNodes[index]);
  3249. } else {
  3250. styleElement.appendChild(cssNode);
  3251. }
  3252. }
  3253. }
  3254. function applyToTag(styleElement, obj) {
  3255. var css = obj.css;
  3256. var media = obj.media;
  3257. var sourceMap = obj.sourceMap;
  3258. if (media) {
  3259. styleElement.setAttribute("media", media);
  3260. }
  3261. if (sourceMap) {
  3262. // https://developer.chrome.com/devtools/docs/javascript-debugging
  3263. // this makes source maps inside style tags work properly in Chrome
  3264. css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */';
  3265. // http://stackoverflow.com/a/26603875
  3266. css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
  3267. }
  3268. if (styleElement.styleSheet) {
  3269. styleElement.styleSheet.cssText = css;
  3270. } else {
  3271. while(styleElement.firstChild) {
  3272. styleElement.removeChild(styleElement.firstChild);
  3273. }
  3274. styleElement.appendChild(document.createTextNode(css));
  3275. }
  3276. }
  3277. /***/ },
  3278. /* 22 */
  3279. /***/ function(module, exports) {
  3280. var g;
  3281. // This works in non-strict mode
  3282. g = (function() { return this; })();
  3283. try {
  3284. // This works if eval is allowed (see CSP)
  3285. g = g || Function("return this")() || (1,eval)("this");
  3286. } catch(e) {
  3287. // This works if the window reference is available
  3288. if(typeof window === "object")
  3289. g = window;
  3290. }
  3291. // g can still be undefined, but nothing to do about it...
  3292. // We return undefined, instead of nothing here, so it's
  3293. // easier to handle this case. if(!global) { ...}
  3294. module.exports = g;
  3295. /***/ },
  3296. /* 23 */
  3297. /***/ function(module, exports, __webpack_require__) {
  3298. "use strict";
  3299. 'use strict';
  3300. Object.defineProperty(exports, "__esModule", {
  3301. value: true
  3302. });
  3303. var _promise = __webpack_require__(58);
  3304. var _promise2 = _interopRequireDefault(_promise);
  3305. var _classCallCheck2 = __webpack_require__(14);
  3306. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  3307. var _createClass2 = __webpack_require__(15);
  3308. var _createClass3 = _interopRequireDefault(_createClass2);
  3309. var _axios = __webpack_require__(49);
  3310. var _axios2 = _interopRequireDefault(_axios);
  3311. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3312. var Auth = function () {
  3313. function Auth(storage) {
  3314. (0, _classCallCheck3.default)(this, Auth);
  3315. this.user = {
  3316. authenticated: false
  3317. };
  3318. this.storage = storage;
  3319. }
  3320. (0, _createClass3.default)(Auth, [{
  3321. key: 'isAuthenticated',
  3322. value: function isAuthenticated() {
  3323. var token = this.storage.getToken();
  3324. if (token.stillValid()) {
  3325. this.user.authenticated = true;
  3326. return true;
  3327. }
  3328. this.user.authenticated = false;
  3329. return false;
  3330. }
  3331. }, {
  3332. key: 'isGuest',
  3333. value: function isGuest() {
  3334. return !this.isAuthenticated();
  3335. }
  3336. }, {
  3337. key: 'logout',
  3338. value: function logout() {
  3339. var _this = this;
  3340. return new _promise2.default(function (resolve) {
  3341. _this.storage.clear();
  3342. _this.user.authenticated = false;
  3343. resolve();
  3344. });
  3345. }
  3346. }, {
  3347. key: 'login',
  3348. value: function login(user, baseURL) {
  3349. var _this2 = this;
  3350. var config = this.storage.json();
  3351. if (baseURL) {
  3352. config.baseURL = baseURL;
  3353. }
  3354. return Auth._requestToken(user, config).then(function (token) {
  3355. _this2.storage.saveToken(token);
  3356. });
  3357. }
  3358. }, {
  3359. key: 'refreshToken',
  3360. value: function refreshToken() {
  3361. var _this3 = this;
  3362. var config = this.storage.json();
  3363. var token = this.storage.getToken();
  3364. return Auth._requestNewToken({ token: token.name }, config).then(function (token) {
  3365. _this3.storage.saveToken(token);
  3366. });
  3367. }
  3368. }, {
  3369. key: 'register',
  3370. value: function register(user, baseURL) {
  3371. var config = this.storage.json();
  3372. if (baseURL) {
  3373. config.baseURL = baseURL;
  3374. }
  3375. return _axios2.default.post('/api/auth/register/', user, config).then(function (response) {
  3376. return response.data;
  3377. });
  3378. }
  3379. }, {
  3380. key: 'resetPassword',
  3381. value: function resetPassword(email, baseURL) {
  3382. var config = this.storage.json();
  3383. if (baseURL) {
  3384. config.baseURL = baseURL;
  3385. }
  3386. return _axios2.default.post('/api/auth/password/reset/', email, config);
  3387. }
  3388. }, {
  3389. key: 'confirmResetPassword',
  3390. value: function confirmResetPassword(password, baseURL) {
  3391. var config = this.storage.json();
  3392. if (baseURL) {
  3393. config.baseURL = baseURL;
  3394. }
  3395. return _axios2.default.post('/api/auth/password/reset/confirm/', password, config);
  3396. }
  3397. }], [{
  3398. key: '_requestToken',
  3399. value: function _requestToken(user) {
  3400. var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3401. return _axios2.default.post('/api/tokens/auth/', user, config).then(function (response) {
  3402. return response.data.token;
  3403. });
  3404. }
  3405. }, {
  3406. key: '_requestNewToken',
  3407. value: function _requestNewToken(token) {
  3408. var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3409. return _axios2.default.post('/api/tokens/refresh/', token, config).then(function (response) {
  3410. return response.data.token;
  3411. });
  3412. }
  3413. }]);
  3414. return Auth;
  3415. }();
  3416. exports.default = Auth;
  3417. /***/ },
  3418. /* 24 */
  3419. /***/ function(module, exports, __webpack_require__) {
  3420. "use strict";
  3421. "use strict";
  3422. exports.__esModule = true;
  3423. var _assign = __webpack_require__(33);
  3424. var _assign2 = _interopRequireDefault(_assign);
  3425. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3426. exports.default = _assign2.default || function (target) {
  3427. for (var i = 1; i < arguments.length; i++) {
  3428. var source = arguments[i];
  3429. for (var key in source) {
  3430. if (Object.prototype.hasOwnProperty.call(source, key)) {
  3431. target[key] = source[key];
  3432. }
  3433. }
  3434. }
  3435. return target;
  3436. };
  3437. /***/ },
  3438. /* 25 */
  3439. /***/ function(module, exports) {
  3440. var toString = {}.toString;
  3441. module.exports = function(it){
  3442. return toString.call(it).slice(8, -1);
  3443. };
  3444. /***/ },
  3445. /* 26 */
  3446. /***/ function(module, exports, __webpack_require__) {
  3447. // optional / simple context binding
  3448. var aFunction = __webpack_require__(35);
  3449. module.exports = function(fn, that, length){
  3450. aFunction(fn);
  3451. if(that === undefined)return fn;
  3452. switch(length){
  3453. case 1: return function(a){
  3454. return fn.call(that, a);
  3455. };
  3456. case 2: return function(a, b){
  3457. return fn.call(that, a, b);
  3458. };
  3459. case 3: return function(a, b, c){
  3460. return fn.call(that, a, b, c);
  3461. };
  3462. }
  3463. return function(/* ...args */){
  3464. return fn.apply(that, arguments);
  3465. };
  3466. };
  3467. /***/ },
  3468. /* 27 */
  3469. /***/ function(module, exports, __webpack_require__) {
  3470. var global = __webpack_require__(4)
  3471. , core = __webpack_require__(6)
  3472. , ctx = __webpack_require__(26)
  3473. , hide = __webpack_require__(11)
  3474. , PROTOTYPE = 'prototype';
  3475. var $export = function(type, name, source){
  3476. var IS_FORCED = type & $export.F
  3477. , IS_GLOBAL = type & $export.G
  3478. , IS_STATIC = type & $export.S
  3479. , IS_PROTO = type & $export.P
  3480. , IS_BIND = type & $export.B
  3481. , IS_WRAP = type & $export.W
  3482. , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
  3483. , expProto = exports[PROTOTYPE]
  3484. , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
  3485. , key, own, out;
  3486. if(IS_GLOBAL)source = name;
  3487. for(key in source){
  3488. // contains in native
  3489. own = !IS_FORCED && target && target[key] !== undefined;
  3490. if(own && key in exports)continue;
  3491. // export native or passed
  3492. out = own ? target[key] : source[key];
  3493. // prevent global pollution for namespaces
  3494. exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
  3495. // bind timers to global for call from export context
  3496. : IS_BIND && own ? ctx(out, global)
  3497. // wrap global constructors for prevent change them in library
  3498. : IS_WRAP && target[key] == out ? (function(C){
  3499. var F = function(a, b, c){
  3500. if(this instanceof C){
  3501. switch(arguments.length){
  3502. case 0: return new C;
  3503. case 1: return new C(a);
  3504. case 2: return new C(a, b);
  3505. } return new C(a, b, c);
  3506. } return C.apply(this, arguments);
  3507. };
  3508. F[PROTOTYPE] = C[PROTOTYPE];
  3509. return F;
  3510. // make static versions for prototype methods
  3511. })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  3512. // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
  3513. if(IS_PROTO){
  3514. (exports.virtual || (exports.virtual = {}))[key] = out;
  3515. // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
  3516. if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);
  3517. }
  3518. }
  3519. };
  3520. // type bitmap
  3521. $export.F = 1; // forced
  3522. $export.G = 2; // global
  3523. $export.S = 4; // static
  3524. $export.P = 8; // proto
  3525. $export.B = 16; // bind
  3526. $export.W = 32; // wrap
  3527. $export.U = 64; // safe
  3528. $export.R = 128; // real proto method for `library`
  3529. module.exports = $export;
  3530. /***/ },
  3531. /* 28 */
  3532. /***/ function(module, exports) {
  3533. var hasOwnProperty = {}.hasOwnProperty;
  3534. module.exports = function(it, key){
  3535. return hasOwnProperty.call(it, key);
  3536. };
  3537. /***/ },
  3538. /* 29 */
  3539. /***/ function(module, exports) {
  3540. module.exports = function(it){
  3541. return typeof it === 'object' ? it !== null : typeof it === 'function';
  3542. };
  3543. /***/ },
  3544. /* 30 */
  3545. /***/ function(module, exports) {
  3546. // Copyright Joyent, Inc. and other Node contributors.
  3547. //
  3548. // Permission is hereby granted, free of charge, to any person obtaining a
  3549. // copy of this software and associated documentation files (the
  3550. // "Software"), to deal in the Software without restriction, including
  3551. // without limitation the rights to use, copy, modify, merge, publish,
  3552. // distribute, sublicense, and/or sell copies of the Software, and to permit
  3553. // persons to whom the Software is furnished to do so, subject to the
  3554. // following conditions:
  3555. //
  3556. // The above copyright notice and this permission notice shall be included
  3557. // in all copies or substantial portions of the Software.
  3558. //
  3559. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  3560. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  3561. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  3562. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  3563. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  3564. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  3565. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  3566. function EventEmitter() {
  3567. this._events = this._events || {};
  3568. this._maxListeners = this._maxListeners || undefined;
  3569. }
  3570. module.exports = EventEmitter;
  3571. // Backwards-compat with node 0.10.x
  3572. EventEmitter.EventEmitter = EventEmitter;
  3573. EventEmitter.prototype._events = undefined;
  3574. EventEmitter.prototype._maxListeners = undefined;
  3575. // By default EventEmitters will print a warning if more than 10 listeners are
  3576. // added to it. This is a useful default which helps finding memory leaks.
  3577. EventEmitter.defaultMaxListeners = 10;
  3578. // Obviously not all Emitters should be limited to 10. This function allows
  3579. // that to be increased. Set to zero for unlimited.
  3580. EventEmitter.prototype.setMaxListeners = function(n) {
  3581. if (!isNumber(n) || n < 0 || isNaN(n))
  3582. throw TypeError('n must be a positive number');
  3583. this._maxListeners = n;
  3584. return this;
  3585. };
  3586. EventEmitter.prototype.emit = function(type) {
  3587. var er, handler, len, args, i, listeners;
  3588. if (!this._events)
  3589. this._events = {};
  3590. // If there is no 'error' event listener then throw.
  3591. if (type === 'error') {
  3592. if (!this._events.error ||
  3593. (isObject(this._events.error) && !this._events.error.length)) {
  3594. er = arguments[1];
  3595. if (er instanceof Error) {
  3596. throw er; // Unhandled 'error' event
  3597. } else {
  3598. // At least give some kind of context to the user
  3599. var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
  3600. err.context = er;
  3601. throw err;
  3602. }
  3603. }
  3604. }
  3605. handler = this._events[type];
  3606. if (isUndefined(handler))
  3607. return false;
  3608. if (isFunction(handler)) {
  3609. switch (arguments.length) {
  3610. // fast cases
  3611. case 1:
  3612. handler.call(this);
  3613. break;
  3614. case 2:
  3615. handler.call(this, arguments[1]);
  3616. break;
  3617. case 3:
  3618. handler.call(this, arguments[1], arguments[2]);
  3619. break;
  3620. // slower
  3621. default:
  3622. args = Array.prototype.slice.call(arguments, 1);
  3623. handler.apply(this, args);
  3624. }
  3625. } else if (isObject(handler)) {
  3626. args = Array.prototype.slice.call(arguments, 1);
  3627. listeners = handler.slice();
  3628. len = listeners.length;
  3629. for (i = 0; i < len; i++)
  3630. listeners[i].apply(this, args);
  3631. }
  3632. return true;
  3633. };
  3634. EventEmitter.prototype.addListener = function(type, listener) {
  3635. var m;
  3636. if (!isFunction(listener))
  3637. throw TypeError('listener must be a function');
  3638. if (!this._events)
  3639. this._events = {};
  3640. // To avoid recursion in the case that type === "newListener"! Before
  3641. // adding it to the listeners, first emit "newListener".
  3642. if (this._events.newListener)
  3643. this.emit('newListener', type,
  3644. isFunction(listener.listener) ?
  3645. listener.listener : listener);
  3646. if (!this._events[type])
  3647. // Optimize the case of one listener. Don't need the extra array object.
  3648. this._events[type] = listener;
  3649. else if (isObject(this._events[type]))
  3650. // If we've already got an array, just append.
  3651. this._events[type].push(listener);
  3652. else
  3653. // Adding the second element, need to change to array.
  3654. this._events[type] = [this._events[type], listener];
  3655. // Check for listener leak
  3656. if (isObject(this._events[type]) && !this._events[type].warned) {
  3657. if (!isUndefined(this._maxListeners)) {
  3658. m = this._maxListeners;
  3659. } else {
  3660. m = EventEmitter.defaultMaxListeners;
  3661. }
  3662. if (m && m > 0 && this._events[type].length > m) {
  3663. this._events[type].warned = true;
  3664. console.error('(node) warning: possible EventEmitter memory ' +
  3665. 'leak detected. %d listeners added. ' +
  3666. 'Use emitter.setMaxListeners() to increase limit.',
  3667. this._events[type].length);
  3668. if (typeof console.trace === 'function') {
  3669. // not supported in IE 10
  3670. console.trace();
  3671. }
  3672. }
  3673. }
  3674. return this;
  3675. };
  3676. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  3677. EventEmitter.prototype.once = function(type, listener) {
  3678. if (!isFunction(listener))
  3679. throw TypeError('listener must be a function');
  3680. var fired = false;
  3681. function g() {
  3682. this.removeListener(type, g);
  3683. if (!fired) {
  3684. fired = true;
  3685. listener.apply(this, arguments);
  3686. }
  3687. }
  3688. g.listener = listener;
  3689. this.on(type, g);
  3690. return this;
  3691. };
  3692. // emits a 'removeListener' event iff the listener was removed
  3693. EventEmitter.prototype.removeListener = function(type, listener) {
  3694. var list, position, length, i;
  3695. if (!isFunction(listener))
  3696. throw TypeError('listener must be a function');
  3697. if (!this._events || !this._events[type])
  3698. return this;
  3699. list = this._events[type];
  3700. length = list.length;
  3701. position = -1;
  3702. if (list === listener ||
  3703. (isFunction(list.listener) && list.listener === listener)) {
  3704. delete this._events[type];
  3705. if (this._events.removeListener)
  3706. this.emit('removeListener', type, listener);
  3707. } else if (isObject(list)) {
  3708. for (i = length; i-- > 0;) {
  3709. if (list[i] === listener ||
  3710. (list[i].listener && list[i].listener === listener)) {
  3711. position = i;
  3712. break;
  3713. }
  3714. }
  3715. if (position < 0)
  3716. return this;
  3717. if (list.length === 1) {
  3718. list.length = 0;
  3719. delete this._events[type];
  3720. } else {
  3721. list.splice(position, 1);
  3722. }
  3723. if (this._events.removeListener)
  3724. this.emit('removeListener', type, listener);
  3725. }
  3726. return this;
  3727. };
  3728. EventEmitter.prototype.removeAllListeners = function(type) {
  3729. var key, listeners;
  3730. if (!this._events)
  3731. return this;
  3732. // not listening for removeListener, no need to emit
  3733. if (!this._events.removeListener) {
  3734. if (arguments.length === 0)
  3735. this._events = {};
  3736. else if (this._events[type])
  3737. delete this._events[type];
  3738. return this;
  3739. }
  3740. // emit removeListener for all listeners on all events
  3741. if (arguments.length === 0) {
  3742. for (key in this._events) {
  3743. if (key === 'removeListener') continue;
  3744. this.removeAllListeners(key);
  3745. }
  3746. this.removeAllListeners('removeListener');
  3747. this._events = {};
  3748. return this;
  3749. }
  3750. listeners = this._events[type];
  3751. if (isFunction(listeners)) {
  3752. this.removeListener(type, listeners);
  3753. } else if (listeners) {
  3754. // LIFO order
  3755. while (listeners.length)
  3756. this.removeListener(type, listeners[listeners.length - 1]);
  3757. }
  3758. delete this._events[type];
  3759. return this;
  3760. };
  3761. EventEmitter.prototype.listeners = function(type) {
  3762. var ret;
  3763. if (!this._events || !this._events[type])
  3764. ret = [];
  3765. else if (isFunction(this._events[type]))
  3766. ret = [this._events[type]];
  3767. else
  3768. ret = this._events[type].slice();
  3769. return ret;
  3770. };
  3771. EventEmitter.prototype.listenerCount = function(type) {
  3772. if (this._events) {
  3773. var evlistener = this._events[type];
  3774. if (isFunction(evlistener))
  3775. return 1;
  3776. else if (evlistener)
  3777. return evlistener.length;
  3778. }
  3779. return 0;
  3780. };
  3781. EventEmitter.listenerCount = function(emitter, type) {
  3782. return emitter.listenerCount(type);
  3783. };
  3784. function isFunction(arg) {
  3785. return typeof arg === 'function';
  3786. }
  3787. function isNumber(arg) {
  3788. return typeof arg === 'number';
  3789. }
  3790. function isObject(arg) {
  3791. return typeof arg === 'object' && arg !== null;
  3792. }
  3793. function isUndefined(arg) {
  3794. return arg === void 0;
  3795. }
  3796. /***/ },
  3797. /* 31 */
  3798. /***/ function(module, exports, __webpack_require__) {
  3799. /* WEBPACK VAR INJECTION */(function(setImmediate, clearImmediate) {var nextTick = __webpack_require__(5).nextTick;
  3800. var apply = Function.prototype.apply;
  3801. var slice = Array.prototype.slice;
  3802. var immediateIds = {};
  3803. var nextImmediateId = 0;
  3804. // DOM APIs, for completeness
  3805. exports.setTimeout = function() {
  3806. return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
  3807. };
  3808. exports.setInterval = function() {
  3809. return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
  3810. };
  3811. exports.clearTimeout =
  3812. exports.clearInterval = function(timeout) { timeout.close(); };
  3813. function Timeout(id, clearFn) {
  3814. this._id = id;
  3815. this._clearFn = clearFn;
  3816. }
  3817. Timeout.prototype.unref = Timeout.prototype.ref = function() {};
  3818. Timeout.prototype.close = function() {
  3819. this._clearFn.call(window, this._id);
  3820. };
  3821. // Does not start the time, just sets up the members needed.
  3822. exports.enroll = function(item, msecs) {
  3823. clearTimeout(item._idleTimeoutId);
  3824. item._idleTimeout = msecs;
  3825. };
  3826. exports.unenroll = function(item) {
  3827. clearTimeout(item._idleTimeoutId);
  3828. item._idleTimeout = -1;
  3829. };
  3830. exports._unrefActive = exports.active = function(item) {
  3831. clearTimeout(item._idleTimeoutId);
  3832. var msecs = item._idleTimeout;
  3833. if (msecs >= 0) {
  3834. item._idleTimeoutId = setTimeout(function onTimeout() {
  3835. if (item._onTimeout)
  3836. item._onTimeout();
  3837. }, msecs);
  3838. }
  3839. };
  3840. // That's not how node.js implements it but the exposed api is the same.
  3841. exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) {
  3842. var id = nextImmediateId++;
  3843. var args = arguments.length < 2 ? false : slice.call(arguments, 1);
  3844. immediateIds[id] = true;
  3845. nextTick(function onNextTick() {
  3846. if (immediateIds[id]) {
  3847. // fn.call() is faster so we optimize for the common use-case
  3848. // @see http://jsperf.com/call-apply-segu
  3849. if (args) {
  3850. fn.apply(null, args);
  3851. } else {
  3852. fn.call(null);
  3853. }
  3854. // Prevent ids from leaking
  3855. exports.clearImmediate(id);
  3856. }
  3857. });
  3858. return id;
  3859. };
  3860. exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) {
  3861. delete immediateIds[id];
  3862. };
  3863. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(31).setImmediate, __webpack_require__(31).clearImmediate))
  3864. /***/ },
  3865. /* 32 */
  3866. /***/ function(module, exports, __webpack_require__) {
  3867. "use strict";
  3868. /* WEBPACK VAR INJECTION */(function(process) {/*!
  3869. * Vue.js v2.0.7
  3870. * (c) 2014-2016 Evan You
  3871. * Released under the MIT License.
  3872. */
  3873. 'use strict';
  3874. /* */
  3875. /**
  3876. * Convert a value to a string that is actually rendered.
  3877. */
  3878. function _toString (val) {
  3879. return val == null
  3880. ? ''
  3881. : typeof val === 'object'
  3882. ? JSON.stringify(val, null, 2)
  3883. : String(val)
  3884. }
  3885. /**
  3886. * Convert a input value to a number for persistence.
  3887. * If the conversion fails, return original string.
  3888. */
  3889. function toNumber (val) {
  3890. var n = parseFloat(val, 10);
  3891. return (n || n === 0) ? n : val
  3892. }
  3893. /**
  3894. * Make a map and return a function for checking if a key
  3895. * is in that map.
  3896. */
  3897. function makeMap (
  3898. str,
  3899. expectsLowerCase
  3900. ) {
  3901. var map = Object.create(null);
  3902. var list = str.split(',');
  3903. for (var i = 0; i < list.length; i++) {
  3904. map[list[i]] = true;
  3905. }
  3906. return expectsLowerCase
  3907. ? function (val) { return map[val.toLowerCase()]; }
  3908. : function (val) { return map[val]; }
  3909. }
  3910. /**
  3911. * Check if a tag is a built-in tag.
  3912. */
  3913. var isBuiltInTag = makeMap('slot,component', true);
  3914. /**
  3915. * Remove an item from an array
  3916. */
  3917. function remove$1 (arr, item) {
  3918. if (arr.length) {
  3919. var index = arr.indexOf(item);
  3920. if (index > -1) {
  3921. return arr.splice(index, 1)
  3922. }
  3923. }
  3924. }
  3925. /**
  3926. * Check whether the object has the property.
  3927. */
  3928. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3929. function hasOwn (obj, key) {
  3930. return hasOwnProperty.call(obj, key)
  3931. }
  3932. /**
  3933. * Check if value is primitive
  3934. */
  3935. function isPrimitive (value) {
  3936. return typeof value === 'string' || typeof value === 'number'
  3937. }
  3938. /**
  3939. * Create a cached version of a pure function.
  3940. */
  3941. function cached (fn) {
  3942. var cache = Object.create(null);
  3943. return function cachedFn (str) {
  3944. var hit = cache[str];
  3945. return hit || (cache[str] = fn(str))
  3946. }
  3947. }
  3948. /**
  3949. * Camelize a hyphen-delmited string.
  3950. */
  3951. var camelizeRE = /-(\w)/g;
  3952. var camelize = cached(function (str) {
  3953. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3954. });
  3955. /**
  3956. * Capitalize a string.
  3957. */
  3958. var capitalize = cached(function (str) {
  3959. return str.charAt(0).toUpperCase() + str.slice(1)
  3960. });
  3961. /**
  3962. * Hyphenate a camelCase string.
  3963. */
  3964. var hyphenateRE = /([^-])([A-Z])/g;
  3965. var hyphenate = cached(function (str) {
  3966. return str
  3967. .replace(hyphenateRE, '$1-$2')
  3968. .replace(hyphenateRE, '$1-$2')
  3969. .toLowerCase()
  3970. });
  3971. /**
  3972. * Simple bind, faster than native
  3973. */
  3974. function bind$1 (fn, ctx) {
  3975. function boundFn (a) {
  3976. var l = arguments.length;
  3977. return l
  3978. ? l > 1
  3979. ? fn.apply(ctx, arguments)
  3980. : fn.call(ctx, a)
  3981. : fn.call(ctx)
  3982. }
  3983. // record original fn length
  3984. boundFn._length = fn.length;
  3985. return boundFn
  3986. }
  3987. /**
  3988. * Convert an Array-like object to a real Array.
  3989. */
  3990. function toArray (list, start) {
  3991. start = start || 0;
  3992. var i = list.length - start;
  3993. var ret = new Array(i);
  3994. while (i--) {
  3995. ret[i] = list[i + start];
  3996. }
  3997. return ret
  3998. }
  3999. /**
  4000. * Mix properties into target object.
  4001. */
  4002. function extend (to, _from) {
  4003. for (var key in _from) {
  4004. to[key] = _from[key];
  4005. }
  4006. return to
  4007. }
  4008. /**
  4009. * Quick object check - this is primarily used to tell
  4010. * Objects from primitive values when we know the value
  4011. * is a JSON-compliant type.
  4012. */
  4013. function isObject (obj) {
  4014. return obj !== null && typeof obj === 'object'
  4015. }
  4016. /**
  4017. * Strict object type check. Only returns true
  4018. * for plain JavaScript objects.
  4019. */
  4020. var toString = Object.prototype.toString;
  4021. var OBJECT_STRING = '[object Object]';
  4022. function isPlainObject (obj) {
  4023. return toString.call(obj) === OBJECT_STRING
  4024. }
  4025. /**
  4026. * Merge an Array of Objects into a single Object.
  4027. */
  4028. function toObject (arr) {
  4029. var res = {};
  4030. for (var i = 0; i < arr.length; i++) {
  4031. if (arr[i]) {
  4032. extend(res, arr[i]);
  4033. }
  4034. }
  4035. return res
  4036. }
  4037. /**
  4038. * Perform no operation.
  4039. */
  4040. function noop () {}
  4041. /**
  4042. * Always return false.
  4043. */
  4044. var no = function () { return false; };
  4045. /**
  4046. * Generate a static keys string from compiler modules.
  4047. */
  4048. function genStaticKeys (modules) {
  4049. return modules.reduce(function (keys, m) {
  4050. return keys.concat(m.staticKeys || [])
  4051. }, []).join(',')
  4052. }
  4053. /**
  4054. * Check if two values are loosely equal - that is,
  4055. * if they are plain objects, do they have the same shape?
  4056. */
  4057. function looseEqual (a, b) {
  4058. /* eslint-disable eqeqeq */
  4059. return a == b || (
  4060. isObject(a) && isObject(b)
  4061. ? JSON.stringify(a) === JSON.stringify(b)
  4062. : false
  4063. )
  4064. /* eslint-enable eqeqeq */
  4065. }
  4066. function looseIndexOf (arr, val) {
  4067. for (var i = 0; i < arr.length; i++) {
  4068. if (looseEqual(arr[i], val)) { return i }
  4069. }
  4070. return -1
  4071. }
  4072. /* */
  4073. var config = {
  4074. /**
  4075. * Option merge strategies (used in core/util/options)
  4076. */
  4077. optionMergeStrategies: Object.create(null),
  4078. /**
  4079. * Whether to suppress warnings.
  4080. */
  4081. silent: false,
  4082. /**
  4083. * Whether to enable devtools
  4084. */
  4085. devtools: process.env.NODE_ENV !== 'production',
  4086. /**
  4087. * Error handler for watcher errors
  4088. */
  4089. errorHandler: null,
  4090. /**
  4091. * Ignore certain custom elements
  4092. */
  4093. ignoredElements: null,
  4094. /**
  4095. * Custom user key aliases for v-on
  4096. */
  4097. keyCodes: Object.create(null),
  4098. /**
  4099. * Check if a tag is reserved so that it cannot be registered as a
  4100. * component. This is platform-dependent and may be overwritten.
  4101. */
  4102. isReservedTag: no,
  4103. /**
  4104. * Check if a tag is an unknown element.
  4105. * Platform-dependent.
  4106. */
  4107. isUnknownElement: no,
  4108. /**
  4109. * Get the namespace of an element
  4110. */
  4111. getTagNamespace: noop,
  4112. /**
  4113. * Check if an attribute must be bound using property, e.g. value
  4114. * Platform-dependent.
  4115. */
  4116. mustUseProp: no,
  4117. /**
  4118. * List of asset types that a component can own.
  4119. */
  4120. _assetTypes: [
  4121. 'component',
  4122. 'directive',
  4123. 'filter'
  4124. ],
  4125. /**
  4126. * List of lifecycle hooks.
  4127. */
  4128. _lifecycleHooks: [
  4129. 'beforeCreate',
  4130. 'created',
  4131. 'beforeMount',
  4132. 'mounted',
  4133. 'beforeUpdate',
  4134. 'updated',
  4135. 'beforeDestroy',
  4136. 'destroyed',
  4137. 'activated',
  4138. 'deactivated'
  4139. ],
  4140. /**
  4141. * Max circular updates allowed in a scheduler flush cycle.
  4142. */
  4143. _maxUpdateCount: 100,
  4144. /**
  4145. * Server rendering?
  4146. */
  4147. _isServer: process.env.VUE_ENV === 'server'
  4148. };
  4149. /* */
  4150. /**
  4151. * Check if a string starts with $ or _
  4152. */
  4153. function isReserved (str) {
  4154. var c = (str + '').charCodeAt(0);
  4155. return c === 0x24 || c === 0x5F
  4156. }
  4157. /**
  4158. * Define a property.
  4159. */
  4160. function def (obj, key, val, enumerable) {
  4161. Object.defineProperty(obj, key, {
  4162. value: val,
  4163. enumerable: !!enumerable,
  4164. writable: true,
  4165. configurable: true
  4166. });
  4167. }
  4168. /**
  4169. * Parse simple path.
  4170. */
  4171. var bailRE = /[^\w.$]/;
  4172. function parsePath (path) {
  4173. if (bailRE.test(path)) {
  4174. return
  4175. } else {
  4176. var segments = path.split('.');
  4177. return function (obj) {
  4178. for (var i = 0; i < segments.length; i++) {
  4179. if (!obj) { return }
  4180. obj = obj[segments[i]];
  4181. }
  4182. return obj
  4183. }
  4184. }
  4185. }
  4186. /* */
  4187. /* globals MutationObserver */
  4188. // can we use __proto__?
  4189. var hasProto = '__proto__' in {};
  4190. // Browser environment sniffing
  4191. var inBrowser =
  4192. typeof window !== 'undefined' &&
  4193. Object.prototype.toString.call(window) !== '[object Object]';
  4194. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  4195. var isIE = UA && /msie|trident/.test(UA);
  4196. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  4197. var isEdge = UA && UA.indexOf('edge/') > 0;
  4198. var isAndroid = UA && UA.indexOf('android') > 0;
  4199. var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
  4200. // detect devtools
  4201. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4202. /* istanbul ignore next */
  4203. function isNative (Ctor) {
  4204. return /native code/.test(Ctor.toString())
  4205. }
  4206. /**
  4207. * Defer a task to execute it asynchronously.
  4208. */
  4209. var nextTick = (function () {
  4210. var callbacks = [];
  4211. var pending = false;
  4212. var timerFunc;
  4213. function nextTickHandler () {
  4214. pending = false;
  4215. var copies = callbacks.slice(0);
  4216. callbacks.length = 0;
  4217. for (var i = 0; i < copies.length; i++) {
  4218. copies[i]();
  4219. }
  4220. }
  4221. // the nextTick behavior leverages the microtask queue, which can be accessed
  4222. // via either native Promise.then or MutationObserver.
  4223. // MutationObserver has wider support, however it is seriously bugged in
  4224. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  4225. // completely stops working after triggering a few times... so, if native
  4226. // Promise is available, we will use it:
  4227. /* istanbul ignore if */
  4228. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  4229. var p = Promise.resolve();
  4230. timerFunc = function () {
  4231. p.then(nextTickHandler);
  4232. // in problematic UIWebViews, Promise.then doesn't completely break, but
  4233. // it can get stuck in a weird state where callbacks are pushed into the
  4234. // microtask queue but the queue isn't being flushed, until the browser
  4235. // needs to do some other work, e.g. handle a timer. Therefore we can
  4236. // "force" the microtask queue to be flushed by adding an empty timer.
  4237. if (isIOS) { setTimeout(noop); }
  4238. };
  4239. } else if (typeof MutationObserver !== 'undefined' && (
  4240. isNative(MutationObserver) ||
  4241. // PhantomJS and iOS 7.x
  4242. MutationObserver.toString() === '[object MutationObserverConstructor]'
  4243. )) {
  4244. // use MutationObserver where native Promise is not available,
  4245. // e.g. PhantomJS IE11, iOS7, Android 4.4
  4246. var counter = 1;
  4247. var observer = new MutationObserver(nextTickHandler);
  4248. var textNode = document.createTextNode(String(counter));
  4249. observer.observe(textNode, {
  4250. characterData: true
  4251. });
  4252. timerFunc = function () {
  4253. counter = (counter + 1) % 2;
  4254. textNode.data = String(counter);
  4255. };
  4256. } else {
  4257. // fallback to setTimeout
  4258. /* istanbul ignore next */
  4259. timerFunc = function () {
  4260. setTimeout(nextTickHandler, 0);
  4261. };
  4262. }
  4263. return function queueNextTick (cb, ctx) {
  4264. var func = ctx
  4265. ? function () { cb.call(ctx); }
  4266. : cb;
  4267. callbacks.push(func);
  4268. if (!pending) {
  4269. pending = true;
  4270. timerFunc();
  4271. }
  4272. }
  4273. })();
  4274. var _Set;
  4275. /* istanbul ignore if */
  4276. if (typeof Set !== 'undefined' && isNative(Set)) {
  4277. // use native Set when available.
  4278. _Set = Set;
  4279. } else {
  4280. // a non-standard Set polyfill that only works with primitive keys.
  4281. _Set = (function () {
  4282. function Set () {
  4283. this.set = Object.create(null);
  4284. }
  4285. Set.prototype.has = function has (key) {
  4286. return this.set[key] !== undefined
  4287. };
  4288. Set.prototype.add = function add (key) {
  4289. this.set[key] = 1;
  4290. };
  4291. Set.prototype.clear = function clear () {
  4292. this.set = Object.create(null);
  4293. };
  4294. return Set;
  4295. }());
  4296. }
  4297. /* not type checking this file because flow doesn't play well with Proxy */
  4298. var hasProxy;
  4299. var proxyHandlers;
  4300. var initProxy;
  4301. if (process.env.NODE_ENV !== 'production') {
  4302. var allowedGlobals = makeMap(
  4303. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  4304. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  4305. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  4306. 'require' // for Webpack/Browserify
  4307. );
  4308. hasProxy =
  4309. typeof Proxy !== 'undefined' &&
  4310. Proxy.toString().match(/native code/);
  4311. proxyHandlers = {
  4312. has: function has (target, key) {
  4313. var has = key in target;
  4314. var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
  4315. if (!has && !isAllowed) {
  4316. warn(
  4317. "Property or method \"" + key + "\" is not defined on the instance but " +
  4318. "referenced during render. Make sure to declare reactive data " +
  4319. "properties in the data option.",
  4320. target
  4321. );
  4322. }
  4323. return has || !isAllowed
  4324. }
  4325. };
  4326. initProxy = function initProxy (vm) {
  4327. if (hasProxy) {
  4328. vm._renderProxy = new Proxy(vm, proxyHandlers);
  4329. } else {
  4330. vm._renderProxy = vm;
  4331. }
  4332. };
  4333. }
  4334. /* */
  4335. var uid$2 = 0;
  4336. /**
  4337. * A dep is an observable that can have multiple
  4338. * directives subscribing to it.
  4339. */
  4340. var Dep = function Dep () {
  4341. this.id = uid$2++;
  4342. this.subs = [];
  4343. };
  4344. Dep.prototype.addSub = function addSub (sub) {
  4345. this.subs.push(sub);
  4346. };
  4347. Dep.prototype.removeSub = function removeSub (sub) {
  4348. remove$1(this.subs, sub);
  4349. };
  4350. Dep.prototype.depend = function depend () {
  4351. if (Dep.target) {
  4352. Dep.target.addDep(this);
  4353. }
  4354. };
  4355. Dep.prototype.notify = function notify () {
  4356. // stablize the subscriber list first
  4357. var subs = this.subs.slice();
  4358. for (var i = 0, l = subs.length; i < l; i++) {
  4359. subs[i].update();
  4360. }
  4361. };
  4362. // the current target watcher being evaluated.
  4363. // this is globally unique because there could be only one
  4364. // watcher being evaluated at any time.
  4365. Dep.target = null;
  4366. var targetStack = [];
  4367. function pushTarget (_target) {
  4368. if (Dep.target) { targetStack.push(Dep.target); }
  4369. Dep.target = _target;
  4370. }
  4371. function popTarget () {
  4372. Dep.target = targetStack.pop();
  4373. }
  4374. /* */
  4375. var queue = [];
  4376. var has$1 = {};
  4377. var circular = {};
  4378. var waiting = false;
  4379. var flushing = false;
  4380. var index = 0;
  4381. /**
  4382. * Reset the scheduler's state.
  4383. */
  4384. function resetSchedulerState () {
  4385. queue.length = 0;
  4386. has$1 = {};
  4387. if (process.env.NODE_ENV !== 'production') {
  4388. circular = {};
  4389. }
  4390. waiting = flushing = false;
  4391. }
  4392. /**
  4393. * Flush both queues and run the watchers.
  4394. */
  4395. function flushSchedulerQueue () {
  4396. flushing = true;
  4397. // Sort queue before flush.
  4398. // This ensures that:
  4399. // 1. Components are updated from parent to child. (because parent is always
  4400. // created before the child)
  4401. // 2. A component's user watchers are run before its render watcher (because
  4402. // user watchers are created before the render watcher)
  4403. // 3. If a component is destroyed during a parent component's watcher run,
  4404. // its watchers can be skipped.
  4405. queue.sort(function (a, b) { return a.id - b.id; });
  4406. // do not cache length because more watchers might be pushed
  4407. // as we run existing watchers
  4408. for (index = 0; index < queue.length; index++) {
  4409. var watcher = queue[index];
  4410. var id = watcher.id;
  4411. has$1[id] = null;
  4412. watcher.run();
  4413. // in dev build, check and stop circular updates.
  4414. if (process.env.NODE_ENV !== 'production' && has$1[id] != null) {
  4415. circular[id] = (circular[id] || 0) + 1;
  4416. if (circular[id] > config._maxUpdateCount) {
  4417. warn(
  4418. 'You may have an infinite update loop ' + (
  4419. watcher.user
  4420. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  4421. : "in a component render function."
  4422. ),
  4423. watcher.vm
  4424. );
  4425. break
  4426. }
  4427. }
  4428. }
  4429. // devtool hook
  4430. /* istanbul ignore if */
  4431. if (devtools && config.devtools) {
  4432. devtools.emit('flush');
  4433. }
  4434. resetSchedulerState();
  4435. }
  4436. /**
  4437. * Push a watcher into the watcher queue.
  4438. * Jobs with duplicate IDs will be skipped unless it's
  4439. * pushed when the queue is being flushed.
  4440. */
  4441. function queueWatcher (watcher) {
  4442. var id = watcher.id;
  4443. if (has$1[id] == null) {
  4444. has$1[id] = true;
  4445. if (!flushing) {
  4446. queue.push(watcher);
  4447. } else {
  4448. // if already flushing, splice the watcher based on its id
  4449. // if already past its id, it will be run next immediately.
  4450. var i = queue.length - 1;
  4451. while (i >= 0 && queue[i].id > watcher.id) {
  4452. i--;
  4453. }
  4454. queue.splice(Math.max(i, index) + 1, 0, watcher);
  4455. }
  4456. // queue the flush
  4457. if (!waiting) {
  4458. waiting = true;
  4459. nextTick(flushSchedulerQueue);
  4460. }
  4461. }
  4462. }
  4463. /* */
  4464. var uid$1 = 0;
  4465. /**
  4466. * A watcher parses an expression, collects dependencies,
  4467. * and fires callback when the expression value changes.
  4468. * This is used for both the $watch() api and directives.
  4469. */
  4470. var Watcher = function Watcher (
  4471. vm,
  4472. expOrFn,
  4473. cb,
  4474. options
  4475. ) {
  4476. if ( options === void 0 ) options = {};
  4477. this.vm = vm;
  4478. vm._watchers.push(this);
  4479. // options
  4480. this.deep = !!options.deep;
  4481. this.user = !!options.user;
  4482. this.lazy = !!options.lazy;
  4483. this.sync = !!options.sync;
  4484. this.expression = expOrFn.toString();
  4485. this.cb = cb;
  4486. this.id = ++uid$1; // uid for batching
  4487. this.active = true;
  4488. this.dirty = this.lazy; // for lazy watchers
  4489. this.deps = [];
  4490. this.newDeps = [];
  4491. this.depIds = new _Set();
  4492. this.newDepIds = new _Set();
  4493. // parse expression for getter
  4494. if (typeof expOrFn === 'function') {
  4495. this.getter = expOrFn;
  4496. } else {
  4497. this.getter = parsePath(expOrFn);
  4498. if (!this.getter) {
  4499. this.getter = function () {};
  4500. process.env.NODE_ENV !== 'production' && warn(
  4501. "Failed watching path: \"" + expOrFn + "\" " +
  4502. 'Watcher only accepts simple dot-delimited paths. ' +
  4503. 'For full control, use a function instead.',
  4504. vm
  4505. );
  4506. }
  4507. }
  4508. this.value = this.lazy
  4509. ? undefined
  4510. : this.get();
  4511. };
  4512. /**
  4513. * Evaluate the getter, and re-collect dependencies.
  4514. */
  4515. Watcher.prototype.get = function get () {
  4516. pushTarget(this);
  4517. var value = this.getter.call(this.vm, this.vm);
  4518. // "touch" every property so they are all tracked as
  4519. // dependencies for deep watching
  4520. if (this.deep) {
  4521. traverse(value);
  4522. }
  4523. popTarget();
  4524. this.cleanupDeps();
  4525. return value
  4526. };
  4527. /**
  4528. * Add a dependency to this directive.
  4529. */
  4530. Watcher.prototype.addDep = function addDep (dep) {
  4531. var id = dep.id;
  4532. if (!this.newDepIds.has(id)) {
  4533. this.newDepIds.add(id);
  4534. this.newDeps.push(dep);
  4535. if (!this.depIds.has(id)) {
  4536. dep.addSub(this);
  4537. }
  4538. }
  4539. };
  4540. /**
  4541. * Clean up for dependency collection.
  4542. */
  4543. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  4544. var this$1 = this;
  4545. var i = this.deps.length;
  4546. while (i--) {
  4547. var dep = this$1.deps[i];
  4548. if (!this$1.newDepIds.has(dep.id)) {
  4549. dep.removeSub(this$1);
  4550. }
  4551. }
  4552. var tmp = this.depIds;
  4553. this.depIds = this.newDepIds;
  4554. this.newDepIds = tmp;
  4555. this.newDepIds.clear();
  4556. tmp = this.deps;
  4557. this.deps = this.newDeps;
  4558. this.newDeps = tmp;
  4559. this.newDeps.length = 0;
  4560. };
  4561. /**
  4562. * Subscriber interface.
  4563. * Will be called when a dependency changes.
  4564. */
  4565. Watcher.prototype.update = function update () {
  4566. /* istanbul ignore else */
  4567. if (this.lazy) {
  4568. this.dirty = true;
  4569. } else if (this.sync) {
  4570. this.run();
  4571. } else {
  4572. queueWatcher(this);
  4573. }
  4574. };
  4575. /**
  4576. * Scheduler job interface.
  4577. * Will be called by the scheduler.
  4578. */
  4579. Watcher.prototype.run = function run () {
  4580. if (this.active) {
  4581. var value = this.get();
  4582. if (
  4583. value !== this.value ||
  4584. // Deep watchers and watchers on Object/Arrays should fire even
  4585. // when the value is the same, because the value may
  4586. // have mutated.
  4587. isObject(value) ||
  4588. this.deep
  4589. ) {
  4590. // set new value
  4591. var oldValue = this.value;
  4592. this.value = value;
  4593. if (this.user) {
  4594. try {
  4595. this.cb.call(this.vm, value, oldValue);
  4596. } catch (e) {
  4597. process.env.NODE_ENV !== 'production' && warn(
  4598. ("Error in watcher \"" + (this.expression) + "\""),
  4599. this.vm
  4600. );
  4601. /* istanbul ignore else */
  4602. if (config.errorHandler) {
  4603. config.errorHandler.call(null, e, this.vm);
  4604. } else {
  4605. throw e
  4606. }
  4607. }
  4608. } else {
  4609. this.cb.call(this.vm, value, oldValue);
  4610. }
  4611. }
  4612. }
  4613. };
  4614. /**
  4615. * Evaluate the value of the watcher.
  4616. * This only gets called for lazy watchers.
  4617. */
  4618. Watcher.prototype.evaluate = function evaluate () {
  4619. this.value = this.get();
  4620. this.dirty = false;
  4621. };
  4622. /**
  4623. * Depend on all deps collected by this watcher.
  4624. */
  4625. Watcher.prototype.depend = function depend () {
  4626. var this$1 = this;
  4627. var i = this.deps.length;
  4628. while (i--) {
  4629. this$1.deps[i].depend();
  4630. }
  4631. };
  4632. /**
  4633. * Remove self from all dependencies' subscriber list.
  4634. */
  4635. Watcher.prototype.teardown = function teardown () {
  4636. var this$1 = this;
  4637. if (this.active) {
  4638. // remove self from vm's watcher list
  4639. // this is a somewhat expensive operation so we skip it
  4640. // if the vm is being destroyed or is performing a v-for
  4641. // re-render (the watcher list is then filtered by v-for).
  4642. if (!this.vm._isBeingDestroyed && !this.vm._vForRemoving) {
  4643. remove$1(this.vm._watchers, this);
  4644. }
  4645. var i = this.deps.length;
  4646. while (i--) {
  4647. this$1.deps[i].removeSub(this$1);
  4648. }
  4649. this.active = false;
  4650. }
  4651. };
  4652. /**
  4653. * Recursively traverse an object to evoke all converted
  4654. * getters, so that every nested property inside the object
  4655. * is collected as a "deep" dependency.
  4656. */
  4657. var seenObjects = new _Set();
  4658. function traverse (val) {
  4659. seenObjects.clear();
  4660. _traverse(val, seenObjects);
  4661. }
  4662. function _traverse (val, seen) {
  4663. var i, keys;
  4664. var isA = Array.isArray(val);
  4665. if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {
  4666. return
  4667. }
  4668. if (val.__ob__) {
  4669. var depId = val.__ob__.dep.id;
  4670. if (seen.has(depId)) {
  4671. return
  4672. }
  4673. seen.add(depId);
  4674. }
  4675. if (isA) {
  4676. i = val.length;
  4677. while (i--) { _traverse(val[i], seen); }
  4678. } else {
  4679. keys = Object.keys(val);
  4680. i = keys.length;
  4681. while (i--) { _traverse(val[keys[i]], seen); }
  4682. }
  4683. }
  4684. /*
  4685. * not type checking this file because flow doesn't play well with
  4686. * dynamically accessing methods on Array prototype
  4687. */
  4688. var arrayProto = Array.prototype;
  4689. var arrayMethods = Object.create(arrayProto);[
  4690. 'push',
  4691. 'pop',
  4692. 'shift',
  4693. 'unshift',
  4694. 'splice',
  4695. 'sort',
  4696. 'reverse'
  4697. ]
  4698. .forEach(function (method) {
  4699. // cache original method
  4700. var original = arrayProto[method];
  4701. def(arrayMethods, method, function mutator () {
  4702. var arguments$1 = arguments;
  4703. // avoid leaking arguments:
  4704. // http://jsperf.com/closure-with-arguments
  4705. var i = arguments.length;
  4706. var args = new Array(i);
  4707. while (i--) {
  4708. args[i] = arguments$1[i];
  4709. }
  4710. var result = original.apply(this, args);
  4711. var ob = this.__ob__;
  4712. var inserted;
  4713. switch (method) {
  4714. case 'push':
  4715. inserted = args;
  4716. break
  4717. case 'unshift':
  4718. inserted = args;
  4719. break
  4720. case 'splice':
  4721. inserted = args.slice(2);
  4722. break
  4723. }
  4724. if (inserted) { ob.observeArray(inserted); }
  4725. // notify change
  4726. ob.dep.notify();
  4727. return result
  4728. });
  4729. });
  4730. /* */
  4731. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4732. /**
  4733. * By default, when a reactive property is set, the new value is
  4734. * also converted to become reactive. However when passing down props,
  4735. * we don't want to force conversion because the value may be a nested value
  4736. * under a frozen data structure. Converting it would defeat the optimization.
  4737. */
  4738. var observerState = {
  4739. shouldConvert: true,
  4740. isSettingProps: false
  4741. };
  4742. /**
  4743. * Observer class that are attached to each observed
  4744. * object. Once attached, the observer converts target
  4745. * object's property keys into getter/setters that
  4746. * collect dependencies and dispatches updates.
  4747. */
  4748. var Observer = function Observer (value) {
  4749. this.value = value;
  4750. this.dep = new Dep();
  4751. this.vmCount = 0;
  4752. def(value, '__ob__', this);
  4753. if (Array.isArray(value)) {
  4754. var augment = hasProto
  4755. ? protoAugment
  4756. : copyAugment;
  4757. augment(value, arrayMethods, arrayKeys);
  4758. this.observeArray(value);
  4759. } else {
  4760. this.walk(value);
  4761. }
  4762. };
  4763. /**
  4764. * Walk through each property and convert them into
  4765. * getter/setters. This method should only be called when
  4766. * value type is Object.
  4767. */
  4768. Observer.prototype.walk = function walk (obj) {
  4769. var keys = Object.keys(obj);
  4770. for (var i = 0; i < keys.length; i++) {
  4771. defineReactive$$1(obj, keys[i], obj[keys[i]]);
  4772. }
  4773. };
  4774. /**
  4775. * Observe a list of Array items.
  4776. */
  4777. Observer.prototype.observeArray = function observeArray (items) {
  4778. for (var i = 0, l = items.length; i < l; i++) {
  4779. observe(items[i]);
  4780. }
  4781. };
  4782. // helpers
  4783. /**
  4784. * Augment an target Object or Array by intercepting
  4785. * the prototype chain using __proto__
  4786. */
  4787. function protoAugment (target, src) {
  4788. /* eslint-disable no-proto */
  4789. target.__proto__ = src;
  4790. /* eslint-enable no-proto */
  4791. }
  4792. /**
  4793. * Augment an target Object or Array by defining
  4794. * hidden properties.
  4795. *
  4796. * istanbul ignore next
  4797. */
  4798. function copyAugment (target, src, keys) {
  4799. for (var i = 0, l = keys.length; i < l; i++) {
  4800. var key = keys[i];
  4801. def(target, key, src[key]);
  4802. }
  4803. }
  4804. /**
  4805. * Attempt to create an observer instance for a value,
  4806. * returns the new observer if successfully observed,
  4807. * or the existing observer if the value already has one.
  4808. */
  4809. function observe (value) {
  4810. if (!isObject(value)) {
  4811. return
  4812. }
  4813. var ob;
  4814. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4815. ob = value.__ob__;
  4816. } else if (
  4817. observerState.shouldConvert &&
  4818. !config._isServer &&
  4819. (Array.isArray(value) || isPlainObject(value)) &&
  4820. Object.isExtensible(value) &&
  4821. !value._isVue
  4822. ) {
  4823. ob = new Observer(value);
  4824. }
  4825. return ob
  4826. }
  4827. /**
  4828. * Define a reactive property on an Object.
  4829. */
  4830. function defineReactive$$1 (
  4831. obj,
  4832. key,
  4833. val,
  4834. customSetter
  4835. ) {
  4836. var dep = new Dep();
  4837. var property = Object.getOwnPropertyDescriptor(obj, key);
  4838. if (property && property.configurable === false) {
  4839. return
  4840. }
  4841. // cater for pre-defined getter/setters
  4842. var getter = property && property.get;
  4843. var setter = property && property.set;
  4844. var childOb = observe(val);
  4845. Object.defineProperty(obj, key, {
  4846. enumerable: true,
  4847. configurable: true,
  4848. get: function reactiveGetter () {
  4849. var value = getter ? getter.call(obj) : val;
  4850. if (Dep.target) {
  4851. dep.depend();
  4852. if (childOb) {
  4853. childOb.dep.depend();
  4854. }
  4855. if (Array.isArray(value)) {
  4856. dependArray(value);
  4857. }
  4858. }
  4859. return value
  4860. },
  4861. set: function reactiveSetter (newVal) {
  4862. var value = getter ? getter.call(obj) : val;
  4863. if (newVal === value) {
  4864. return
  4865. }
  4866. if (process.env.NODE_ENV !== 'production' && customSetter) {
  4867. customSetter();
  4868. }
  4869. if (setter) {
  4870. setter.call(obj, newVal);
  4871. } else {
  4872. val = newVal;
  4873. }
  4874. childOb = observe(newVal);
  4875. dep.notify();
  4876. }
  4877. });
  4878. }
  4879. /**
  4880. * Set a property on an object. Adds the new property and
  4881. * triggers change notification if the property doesn't
  4882. * already exist.
  4883. */
  4884. function set (obj, key, val) {
  4885. if (Array.isArray(obj)) {
  4886. obj.length = Math.max(obj.length, key);
  4887. obj.splice(key, 1, val);
  4888. return val
  4889. }
  4890. if (hasOwn(obj, key)) {
  4891. obj[key] = val;
  4892. return
  4893. }
  4894. var ob = obj.__ob__;
  4895. if (obj._isVue || (ob && ob.vmCount)) {
  4896. process.env.NODE_ENV !== 'production' && warn(
  4897. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4898. 'at runtime - declare it upfront in the data option.'
  4899. );
  4900. return
  4901. }
  4902. if (!ob) {
  4903. obj[key] = val;
  4904. return
  4905. }
  4906. defineReactive$$1(ob.value, key, val);
  4907. ob.dep.notify();
  4908. return val
  4909. }
  4910. /**
  4911. * Delete a property and trigger change if necessary.
  4912. */
  4913. function del (obj, key) {
  4914. var ob = obj.__ob__;
  4915. if (obj._isVue || (ob && ob.vmCount)) {
  4916. process.env.NODE_ENV !== 'production' && warn(
  4917. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4918. '- just set it to null.'
  4919. );
  4920. return
  4921. }
  4922. if (!hasOwn(obj, key)) {
  4923. return
  4924. }
  4925. delete obj[key];
  4926. if (!ob) {
  4927. return
  4928. }
  4929. ob.dep.notify();
  4930. }
  4931. /**
  4932. * Collect dependencies on array elements when the array is touched, since
  4933. * we cannot intercept array element access like property getters.
  4934. */
  4935. function dependArray (value) {
  4936. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4937. e = value[i];
  4938. e && e.__ob__ && e.__ob__.dep.depend();
  4939. if (Array.isArray(e)) {
  4940. dependArray(e);
  4941. }
  4942. }
  4943. }
  4944. /* */
  4945. function initState (vm) {
  4946. vm._watchers = [];
  4947. initProps(vm);
  4948. initData(vm);
  4949. initComputed(vm);
  4950. initMethods(vm);
  4951. initWatch(vm);
  4952. }
  4953. function initProps (vm) {
  4954. var props = vm.$options.props;
  4955. if (props) {
  4956. var propsData = vm.$options.propsData || {};
  4957. var keys = vm.$options._propKeys = Object.keys(props);
  4958. var isRoot = !vm.$parent;
  4959. // root instance props should be converted
  4960. observerState.shouldConvert = isRoot;
  4961. var loop = function ( i ) {
  4962. var key = keys[i];
  4963. /* istanbul ignore else */
  4964. if (process.env.NODE_ENV !== 'production') {
  4965. defineReactive$$1(vm, key, validateProp(key, props, propsData, vm), function () {
  4966. if (vm.$parent && !observerState.isSettingProps) {
  4967. warn(
  4968. "Avoid mutating a prop directly since the value will be " +
  4969. "overwritten whenever the parent component re-renders. " +
  4970. "Instead, use a data or computed property based on the prop's " +
  4971. "value. Prop being mutated: \"" + key + "\"",
  4972. vm
  4973. );
  4974. }
  4975. });
  4976. } else {
  4977. defineReactive$$1(vm, key, validateProp(key, props, propsData, vm));
  4978. }
  4979. };
  4980. for (var i = 0; i < keys.length; i++) loop( i );
  4981. observerState.shouldConvert = true;
  4982. }
  4983. }
  4984. function initData (vm) {
  4985. var data = vm.$options.data;
  4986. data = vm._data = typeof data === 'function'
  4987. ? data.call(vm)
  4988. : data || {};
  4989. if (!isPlainObject(data)) {
  4990. data = {};
  4991. process.env.NODE_ENV !== 'production' && warn(
  4992. 'data functions should return an object.',
  4993. vm
  4994. );
  4995. }
  4996. // proxy data on instance
  4997. var keys = Object.keys(data);
  4998. var props = vm.$options.props;
  4999. var i = keys.length;
  5000. while (i--) {
  5001. if (props && hasOwn(props, keys[i])) {
  5002. process.env.NODE_ENV !== 'production' && warn(
  5003. "The data property \"" + (keys[i]) + "\" is already declared as a prop. " +
  5004. "Use prop default value instead.",
  5005. vm
  5006. );
  5007. } else {
  5008. proxy(vm, keys[i]);
  5009. }
  5010. }
  5011. // observe data
  5012. observe(data);
  5013. data.__ob__ && data.__ob__.vmCount++;
  5014. }
  5015. var computedSharedDefinition = {
  5016. enumerable: true,
  5017. configurable: true,
  5018. get: noop,
  5019. set: noop
  5020. };
  5021. function initComputed (vm) {
  5022. var computed = vm.$options.computed;
  5023. if (computed) {
  5024. for (var key in computed) {
  5025. var userDef = computed[key];
  5026. if (typeof userDef === 'function') {
  5027. computedSharedDefinition.get = makeComputedGetter(userDef, vm);
  5028. computedSharedDefinition.set = noop;
  5029. } else {
  5030. computedSharedDefinition.get = userDef.get
  5031. ? userDef.cache !== false
  5032. ? makeComputedGetter(userDef.get, vm)
  5033. : bind$1(userDef.get, vm)
  5034. : noop;
  5035. computedSharedDefinition.set = userDef.set
  5036. ? bind$1(userDef.set, vm)
  5037. : noop;
  5038. }
  5039. Object.defineProperty(vm, key, computedSharedDefinition);
  5040. }
  5041. }
  5042. }
  5043. function makeComputedGetter (getter, owner) {
  5044. var watcher = new Watcher(owner, getter, noop, {
  5045. lazy: true
  5046. });
  5047. return function computedGetter () {
  5048. if (watcher.dirty) {
  5049. watcher.evaluate();
  5050. }
  5051. if (Dep.target) {
  5052. watcher.depend();
  5053. }
  5054. return watcher.value
  5055. }
  5056. }
  5057. function initMethods (vm) {
  5058. var methods = vm.$options.methods;
  5059. if (methods) {
  5060. for (var key in methods) {
  5061. vm[key] = methods[key] == null ? noop : bind$1(methods[key], vm);
  5062. if (process.env.NODE_ENV !== 'production' && methods[key] == null) {
  5063. warn(
  5064. "method \"" + key + "\" has an undefined value in the component definition. " +
  5065. "Did you reference the function correctly?",
  5066. vm
  5067. );
  5068. }
  5069. }
  5070. }
  5071. }
  5072. function initWatch (vm) {
  5073. var watch = vm.$options.watch;
  5074. if (watch) {
  5075. for (var key in watch) {
  5076. var handler = watch[key];
  5077. if (Array.isArray(handler)) {
  5078. for (var i = 0; i < handler.length; i++) {
  5079. createWatcher(vm, key, handler[i]);
  5080. }
  5081. } else {
  5082. createWatcher(vm, key, handler);
  5083. }
  5084. }
  5085. }
  5086. }
  5087. function createWatcher (vm, key, handler) {
  5088. var options;
  5089. if (isPlainObject(handler)) {
  5090. options = handler;
  5091. handler = handler.handler;
  5092. }
  5093. if (typeof handler === 'string') {
  5094. handler = vm[handler];
  5095. }
  5096. vm.$watch(key, handler, options);
  5097. }
  5098. function stateMixin (Vue) {
  5099. // flow somehow has problems with directly declared definition object
  5100. // when using Object.defineProperty, so we have to procedurally build up
  5101. // the object here.
  5102. var dataDef = {};
  5103. dataDef.get = function () {
  5104. return this._data
  5105. };
  5106. if (process.env.NODE_ENV !== 'production') {
  5107. dataDef.set = function (newData) {
  5108. warn(
  5109. 'Avoid replacing instance root $data. ' +
  5110. 'Use nested data properties instead.',
  5111. this
  5112. );
  5113. };
  5114. }
  5115. Object.defineProperty(Vue.prototype, '$data', dataDef);
  5116. Vue.prototype.$set = set;
  5117. Vue.prototype.$delete = del;
  5118. Vue.prototype.$watch = function (
  5119. expOrFn,
  5120. cb,
  5121. options
  5122. ) {
  5123. var vm = this;
  5124. options = options || {};
  5125. options.user = true;
  5126. var watcher = new Watcher(vm, expOrFn, cb, options);
  5127. if (options.immediate) {
  5128. cb.call(vm, watcher.value);
  5129. }
  5130. return function unwatchFn () {
  5131. watcher.teardown();
  5132. }
  5133. };
  5134. }
  5135. function proxy (vm, key) {
  5136. if (!isReserved(key)) {
  5137. Object.defineProperty(vm, key, {
  5138. configurable: true,
  5139. enumerable: true,
  5140. get: function proxyGetter () {
  5141. return vm._data[key]
  5142. },
  5143. set: function proxySetter (val) {
  5144. vm._data[key] = val;
  5145. }
  5146. });
  5147. }
  5148. }
  5149. /* */
  5150. var VNode = function VNode (
  5151. tag,
  5152. data,
  5153. children,
  5154. text,
  5155. elm,
  5156. ns,
  5157. context,
  5158. componentOptions
  5159. ) {
  5160. this.tag = tag;
  5161. this.data = data;
  5162. this.children = children;
  5163. this.text = text;
  5164. this.elm = elm;
  5165. this.ns = ns;
  5166. this.context = context;
  5167. this.functionalContext = undefined;
  5168. this.key = data && data.key;
  5169. this.componentOptions = componentOptions;
  5170. this.child = undefined;
  5171. this.parent = undefined;
  5172. this.raw = false;
  5173. this.isStatic = false;
  5174. this.isRootInsert = true;
  5175. this.isComment = false;
  5176. this.isCloned = false;
  5177. this.isOnce = false;
  5178. };
  5179. var emptyVNode = function () {
  5180. var node = new VNode();
  5181. node.text = '';
  5182. node.isComment = true;
  5183. return node
  5184. };
  5185. // optimized shallow clone
  5186. // used for static nodes and slot nodes because they may be reused across
  5187. // multiple renders, cloning them avoids errors when DOM manipulations rely
  5188. // on their elm reference.
  5189. function cloneVNode (vnode) {
  5190. var cloned = new VNode(
  5191. vnode.tag,
  5192. vnode.data,
  5193. vnode.children,
  5194. vnode.text,
  5195. vnode.elm,
  5196. vnode.ns,
  5197. vnode.context,
  5198. vnode.componentOptions
  5199. );
  5200. cloned.isStatic = vnode.isStatic;
  5201. cloned.key = vnode.key;
  5202. cloned.isCloned = true;
  5203. return cloned
  5204. }
  5205. function cloneVNodes (vnodes) {
  5206. var res = new Array(vnodes.length);
  5207. for (var i = 0; i < vnodes.length; i++) {
  5208. res[i] = cloneVNode(vnodes[i]);
  5209. }
  5210. return res
  5211. }
  5212. /* */
  5213. function mergeVNodeHook (def, hookKey, hook, key) {
  5214. key = key + hookKey;
  5215. var injectedHash = def.__injected || (def.__injected = {});
  5216. if (!injectedHash[key]) {
  5217. injectedHash[key] = true;
  5218. var oldHook = def[hookKey];
  5219. if (oldHook) {
  5220. def[hookKey] = function () {
  5221. oldHook.apply(this, arguments);
  5222. hook.apply(this, arguments);
  5223. };
  5224. } else {
  5225. def[hookKey] = hook;
  5226. }
  5227. }
  5228. }
  5229. /* */
  5230. function updateListeners (
  5231. on,
  5232. oldOn,
  5233. add,
  5234. remove$$1,
  5235. vm
  5236. ) {
  5237. var name, cur, old, fn, event, capture;
  5238. for (name in on) {
  5239. cur = on[name];
  5240. old = oldOn[name];
  5241. if (!cur) {
  5242. process.env.NODE_ENV !== 'production' && warn(
  5243. "Invalid handler for event \"" + name + "\": got " + String(cur),
  5244. vm
  5245. );
  5246. } else if (!old) {
  5247. capture = name.charAt(0) === '!';
  5248. event = capture ? name.slice(1) : name;
  5249. if (Array.isArray(cur)) {
  5250. add(event, (cur.invoker = arrInvoker(cur)), capture);
  5251. } else {
  5252. if (!cur.invoker) {
  5253. fn = cur;
  5254. cur = on[name] = {};
  5255. cur.fn = fn;
  5256. cur.invoker = fnInvoker(cur);
  5257. }
  5258. add(event, cur.invoker, capture);
  5259. }
  5260. } else if (cur !== old) {
  5261. if (Array.isArray(old)) {
  5262. old.length = cur.length;
  5263. for (var i = 0; i < old.length; i++) { old[i] = cur[i]; }
  5264. on[name] = old;
  5265. } else {
  5266. old.fn = cur;
  5267. on[name] = old;
  5268. }
  5269. }
  5270. }
  5271. for (name in oldOn) {
  5272. if (!on[name]) {
  5273. event = name.charAt(0) === '!' ? name.slice(1) : name;
  5274. remove$$1(event, oldOn[name].invoker);
  5275. }
  5276. }
  5277. }
  5278. function arrInvoker (arr) {
  5279. return function (ev) {
  5280. var arguments$1 = arguments;
  5281. var single = arguments.length === 1;
  5282. for (var i = 0; i < arr.length; i++) {
  5283. single ? arr[i](ev) : arr[i].apply(null, arguments$1);
  5284. }
  5285. }
  5286. }
  5287. function fnInvoker (o) {
  5288. return function (ev) {
  5289. var single = arguments.length === 1;
  5290. single ? o.fn(ev) : o.fn.apply(null, arguments);
  5291. }
  5292. }
  5293. /* */
  5294. function normalizeChildren (
  5295. children,
  5296. ns,
  5297. nestedIndex
  5298. ) {
  5299. if (isPrimitive(children)) {
  5300. return [createTextVNode(children)]
  5301. }
  5302. if (Array.isArray(children)) {
  5303. var res = [];
  5304. for (var i = 0, l = children.length; i < l; i++) {
  5305. var c = children[i];
  5306. var last = res[res.length - 1];
  5307. // nested
  5308. if (Array.isArray(c)) {
  5309. res.push.apply(res, normalizeChildren(c, ns, ((nestedIndex || '') + "_" + i)));
  5310. } else if (isPrimitive(c)) {
  5311. if (last && last.text) {
  5312. last.text += String(c);
  5313. } else if (c !== '') {
  5314. // convert primitive to vnode
  5315. res.push(createTextVNode(c));
  5316. }
  5317. } else if (c instanceof VNode) {
  5318. if (c.text && last && last.text) {
  5319. if (!last.isCloned) {
  5320. last.text += c.text;
  5321. }
  5322. } else {
  5323. // inherit parent namespace
  5324. if (ns) {
  5325. applyNS(c, ns);
  5326. }
  5327. // default key for nested array children (likely generated by v-for)
  5328. if (c.tag && c.key == null && nestedIndex != null) {
  5329. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5330. }
  5331. res.push(c);
  5332. }
  5333. }
  5334. }
  5335. return res
  5336. }
  5337. }
  5338. function createTextVNode (val) {
  5339. return new VNode(undefined, undefined, undefined, String(val))
  5340. }
  5341. function applyNS (vnode, ns) {
  5342. if (vnode.tag && !vnode.ns) {
  5343. vnode.ns = ns;
  5344. if (vnode.children) {
  5345. for (var i = 0, l = vnode.children.length; i < l; i++) {
  5346. applyNS(vnode.children[i], ns);
  5347. }
  5348. }
  5349. }
  5350. }
  5351. /* */
  5352. function getFirstComponentChild (children) {
  5353. return children && children.filter(function (c) { return c && c.componentOptions; })[0]
  5354. }
  5355. /* */
  5356. var activeInstance = null;
  5357. function initLifecycle (vm) {
  5358. var options = vm.$options;
  5359. // locate first non-abstract parent
  5360. var parent = options.parent;
  5361. if (parent && !options.abstract) {
  5362. while (parent.$options.abstract && parent.$parent) {
  5363. parent = parent.$parent;
  5364. }
  5365. parent.$children.push(vm);
  5366. }
  5367. vm.$parent = parent;
  5368. vm.$root = parent ? parent.$root : vm;
  5369. vm.$children = [];
  5370. vm.$refs = {};
  5371. vm._watcher = null;
  5372. vm._inactive = false;
  5373. vm._isMounted = false;
  5374. vm._isDestroyed = false;
  5375. vm._isBeingDestroyed = false;
  5376. }
  5377. function lifecycleMixin (Vue) {
  5378. Vue.prototype._mount = function (
  5379. el,
  5380. hydrating
  5381. ) {
  5382. var vm = this;
  5383. vm.$el = el;
  5384. if (!vm.$options.render) {
  5385. vm.$options.render = emptyVNode;
  5386. if (process.env.NODE_ENV !== 'production') {
  5387. /* istanbul ignore if */
  5388. if (vm.$options.template && vm.$options.template.charAt(0) !== '#') {
  5389. warn(
  5390. 'You are using the runtime-only build of Vue where the template ' +
  5391. 'option is not available. Either pre-compile the templates into ' +
  5392. 'render functions, or use the compiler-included build.',
  5393. vm
  5394. );
  5395. } else {
  5396. warn(
  5397. 'Failed to mount component: template or render function not defined.',
  5398. vm
  5399. );
  5400. }
  5401. }
  5402. }
  5403. callHook(vm, 'beforeMount');
  5404. vm._watcher = new Watcher(vm, function () {
  5405. vm._update(vm._render(), hydrating);
  5406. }, noop);
  5407. hydrating = false;
  5408. // manually mounted instance, call mounted on self
  5409. // mounted is called for render-created child components in its inserted hook
  5410. if (vm.$vnode == null) {
  5411. vm._isMounted = true;
  5412. callHook(vm, 'mounted');
  5413. }
  5414. return vm
  5415. };
  5416. Vue.prototype._update = function (vnode, hydrating) {
  5417. var vm = this;
  5418. if (vm._isMounted) {
  5419. callHook(vm, 'beforeUpdate');
  5420. }
  5421. var prevEl = vm.$el;
  5422. var prevActiveInstance = activeInstance;
  5423. activeInstance = vm;
  5424. var prevVnode = vm._vnode;
  5425. vm._vnode = vnode;
  5426. if (!prevVnode) {
  5427. // Vue.prototype.__patch__ is injected in entry points
  5428. // based on the rendering backend used.
  5429. vm.$el = vm.__patch__(vm.$el, vnode, hydrating);
  5430. } else {
  5431. vm.$el = vm.__patch__(prevVnode, vnode);
  5432. }
  5433. activeInstance = prevActiveInstance;
  5434. // update __vue__ reference
  5435. if (prevEl) {
  5436. prevEl.__vue__ = null;
  5437. }
  5438. if (vm.$el) {
  5439. vm.$el.__vue__ = vm;
  5440. }
  5441. // if parent is an HOC, update its $el as well
  5442. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  5443. vm.$parent.$el = vm.$el;
  5444. }
  5445. if (vm._isMounted) {
  5446. callHook(vm, 'updated');
  5447. }
  5448. };
  5449. Vue.prototype._updateFromParent = function (
  5450. propsData,
  5451. listeners,
  5452. parentVnode,
  5453. renderChildren
  5454. ) {
  5455. var vm = this;
  5456. var hasChildren = !!(vm.$options._renderChildren || renderChildren);
  5457. vm.$options._parentVnode = parentVnode;
  5458. vm.$options._renderChildren = renderChildren;
  5459. // update props
  5460. if (propsData && vm.$options.props) {
  5461. observerState.shouldConvert = false;
  5462. if (process.env.NODE_ENV !== 'production') {
  5463. observerState.isSettingProps = true;
  5464. }
  5465. var propKeys = vm.$options._propKeys || [];
  5466. for (var i = 0; i < propKeys.length; i++) {
  5467. var key = propKeys[i];
  5468. vm[key] = validateProp(key, vm.$options.props, propsData, vm);
  5469. }
  5470. observerState.shouldConvert = true;
  5471. if (process.env.NODE_ENV !== 'production') {
  5472. observerState.isSettingProps = false;
  5473. }
  5474. vm.$options.propsData = propsData;
  5475. }
  5476. // update listeners
  5477. if (listeners) {
  5478. var oldListeners = vm.$options._parentListeners;
  5479. vm.$options._parentListeners = listeners;
  5480. vm._updateListeners(listeners, oldListeners);
  5481. }
  5482. // resolve slots + force update if has children
  5483. if (hasChildren) {
  5484. vm.$slots = resolveSlots(renderChildren, vm._renderContext);
  5485. vm.$forceUpdate();
  5486. }
  5487. };
  5488. Vue.prototype.$forceUpdate = function () {
  5489. var vm = this;
  5490. if (vm._watcher) {
  5491. vm._watcher.update();
  5492. }
  5493. };
  5494. Vue.prototype.$destroy = function () {
  5495. var vm = this;
  5496. if (vm._isBeingDestroyed) {
  5497. return
  5498. }
  5499. callHook(vm, 'beforeDestroy');
  5500. vm._isBeingDestroyed = true;
  5501. // remove self from parent
  5502. var parent = vm.$parent;
  5503. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  5504. remove$1(parent.$children, vm);
  5505. }
  5506. // teardown watchers
  5507. if (vm._watcher) {
  5508. vm._watcher.teardown();
  5509. }
  5510. var i = vm._watchers.length;
  5511. while (i--) {
  5512. vm._watchers[i].teardown();
  5513. }
  5514. // remove reference from data ob
  5515. // frozen object may not have observer.
  5516. if (vm._data.__ob__) {
  5517. vm._data.__ob__.vmCount--;
  5518. }
  5519. // call the last hook...
  5520. vm._isDestroyed = true;
  5521. callHook(vm, 'destroyed');
  5522. // turn off all instance listeners.
  5523. vm.$off();
  5524. // remove __vue__ reference
  5525. if (vm.$el) {
  5526. vm.$el.__vue__ = null;
  5527. }
  5528. // invoke destroy hooks on current rendered tree
  5529. vm.__patch__(vm._vnode, null);
  5530. };
  5531. }
  5532. function callHook (vm, hook) {
  5533. var handlers = vm.$options[hook];
  5534. if (handlers) {
  5535. for (var i = 0, j = handlers.length; i < j; i++) {
  5536. handlers[i].call(vm);
  5537. }
  5538. }
  5539. vm.$emit('hook:' + hook);
  5540. }
  5541. /* */
  5542. var hooks = { init: init, prepatch: prepatch, insert: insert, destroy: destroy$1 };
  5543. var hooksToMerge = Object.keys(hooks);
  5544. function createComponent (
  5545. Ctor,
  5546. data,
  5547. context,
  5548. children,
  5549. tag
  5550. ) {
  5551. if (!Ctor) {
  5552. return
  5553. }
  5554. var baseCtor = context.$options._base;
  5555. if (isObject(Ctor)) {
  5556. Ctor = baseCtor.extend(Ctor);
  5557. }
  5558. if (typeof Ctor !== 'function') {
  5559. if (process.env.NODE_ENV !== 'production') {
  5560. warn(("Invalid Component definition: " + (String(Ctor))), context);
  5561. }
  5562. return
  5563. }
  5564. // async component
  5565. if (!Ctor.cid) {
  5566. if (Ctor.resolved) {
  5567. Ctor = Ctor.resolved;
  5568. } else {
  5569. Ctor = resolveAsyncComponent(Ctor, baseCtor, function () {
  5570. // it's ok to queue this on every render because
  5571. // $forceUpdate is buffered by the scheduler.
  5572. context.$forceUpdate();
  5573. });
  5574. if (!Ctor) {
  5575. // return nothing if this is indeed an async component
  5576. // wait for the callback to trigger parent update.
  5577. return
  5578. }
  5579. }
  5580. }
  5581. // resolve constructor options in case global mixins are applied after
  5582. // component constructor creation
  5583. resolveConstructorOptions(Ctor);
  5584. data = data || {};
  5585. // extract props
  5586. var propsData = extractProps(data, Ctor);
  5587. // functional component
  5588. if (Ctor.options.functional) {
  5589. return createFunctionalComponent(Ctor, propsData, data, context, children)
  5590. }
  5591. // extract listeners, since these needs to be treated as
  5592. // child component listeners instead of DOM listeners
  5593. var listeners = data.on;
  5594. // replace with listeners with .native modifier
  5595. data.on = data.nativeOn;
  5596. if (Ctor.options.abstract) {
  5597. // abstract components do not keep anything
  5598. // other than props & listeners
  5599. data = {};
  5600. }
  5601. // merge component management hooks onto the placeholder node
  5602. mergeHooks(data);
  5603. // return a placeholder vnode
  5604. var name = Ctor.options.name || tag;
  5605. var vnode = new VNode(
  5606. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  5607. data, undefined, undefined, undefined, undefined, context,
  5608. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }
  5609. );
  5610. return vnode
  5611. }
  5612. function createFunctionalComponent (
  5613. Ctor,
  5614. propsData,
  5615. data,
  5616. context,
  5617. children
  5618. ) {
  5619. var props = {};
  5620. var propOptions = Ctor.options.props;
  5621. if (propOptions) {
  5622. for (var key in propOptions) {
  5623. props[key] = validateProp(key, propOptions, propsData);
  5624. }
  5625. }
  5626. var vnode = Ctor.options.render.call(
  5627. null,
  5628. // ensure the createElement function in functional components
  5629. // gets a unique context - this is necessary for correct named slot check
  5630. bind$1(createElement, { _self: Object.create(context) }),
  5631. {
  5632. props: props,
  5633. data: data,
  5634. parent: context,
  5635. children: normalizeChildren(children),
  5636. slots: function () { return resolveSlots(children, context); }
  5637. }
  5638. );
  5639. if (vnode instanceof VNode) {
  5640. vnode.functionalContext = context;
  5641. if (data.slot) {
  5642. (vnode.data || (vnode.data = {})).slot = data.slot;
  5643. }
  5644. }
  5645. return vnode
  5646. }
  5647. function createComponentInstanceForVnode (
  5648. vnode, // we know it's MountedComponentVNode but flow doesn't
  5649. parent // activeInstance in lifecycle state
  5650. ) {
  5651. var vnodeComponentOptions = vnode.componentOptions;
  5652. var options = {
  5653. _isComponent: true,
  5654. parent: parent,
  5655. propsData: vnodeComponentOptions.propsData,
  5656. _componentTag: vnodeComponentOptions.tag,
  5657. _parentVnode: vnode,
  5658. _parentListeners: vnodeComponentOptions.listeners,
  5659. _renderChildren: vnodeComponentOptions.children
  5660. };
  5661. // check inline-template render functions
  5662. var inlineTemplate = vnode.data.inlineTemplate;
  5663. if (inlineTemplate) {
  5664. options.render = inlineTemplate.render;
  5665. options.staticRenderFns = inlineTemplate.staticRenderFns;
  5666. }
  5667. return new vnodeComponentOptions.Ctor(options)
  5668. }
  5669. function init (vnode, hydrating) {
  5670. if (!vnode.child || vnode.child._isDestroyed) {
  5671. var child = vnode.child = createComponentInstanceForVnode(vnode, activeInstance);
  5672. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  5673. }
  5674. }
  5675. function prepatch (
  5676. oldVnode,
  5677. vnode
  5678. ) {
  5679. var options = vnode.componentOptions;
  5680. var child = vnode.child = oldVnode.child;
  5681. child._updateFromParent(
  5682. options.propsData, // updated props
  5683. options.listeners, // updated listeners
  5684. vnode, // new parent vnode
  5685. options.children // new children
  5686. );
  5687. }
  5688. function insert (vnode) {
  5689. if (!vnode.child._isMounted) {
  5690. vnode.child._isMounted = true;
  5691. callHook(vnode.child, 'mounted');
  5692. }
  5693. if (vnode.data.keepAlive) {
  5694. vnode.child._inactive = false;
  5695. callHook(vnode.child, 'activated');
  5696. }
  5697. }
  5698. function destroy$1 (vnode) {
  5699. if (!vnode.child._isDestroyed) {
  5700. if (!vnode.data.keepAlive) {
  5701. vnode.child.$destroy();
  5702. } else {
  5703. vnode.child._inactive = true;
  5704. callHook(vnode.child, 'deactivated');
  5705. }
  5706. }
  5707. }
  5708. function resolveAsyncComponent (
  5709. factory,
  5710. baseCtor,
  5711. cb
  5712. ) {
  5713. if (factory.requested) {
  5714. // pool callbacks
  5715. factory.pendingCallbacks.push(cb);
  5716. } else {
  5717. factory.requested = true;
  5718. var cbs = factory.pendingCallbacks = [cb];
  5719. var sync = true;
  5720. var resolve = function (res) {
  5721. if (isObject(res)) {
  5722. res = baseCtor.extend(res);
  5723. }
  5724. // cache resolved
  5725. factory.resolved = res;
  5726. // invoke callbacks only if this is not a synchronous resolve
  5727. // (async resolves are shimmed as synchronous during SSR)
  5728. if (!sync) {
  5729. for (var i = 0, l = cbs.length; i < l; i++) {
  5730. cbs[i](res);
  5731. }
  5732. }
  5733. };
  5734. var reject = function (reason) {
  5735. process.env.NODE_ENV !== 'production' && warn(
  5736. "Failed to resolve async component: " + (String(factory)) +
  5737. (reason ? ("\nReason: " + reason) : '')
  5738. );
  5739. };
  5740. var res = factory(resolve, reject);
  5741. // handle promise
  5742. if (res && typeof res.then === 'function' && !factory.resolved) {
  5743. res.then(resolve, reject);
  5744. }
  5745. sync = false;
  5746. // return in case resolved synchronously
  5747. return factory.resolved
  5748. }
  5749. }
  5750. function extractProps (data, Ctor) {
  5751. // we are only extracting raw values here.
  5752. // validation and default values are handled in the child
  5753. // component itself.
  5754. var propOptions = Ctor.options.props;
  5755. if (!propOptions) {
  5756. return
  5757. }
  5758. var res = {};
  5759. var attrs = data.attrs;
  5760. var props = data.props;
  5761. var domProps = data.domProps;
  5762. if (attrs || props || domProps) {
  5763. for (var key in propOptions) {
  5764. var altKey = hyphenate(key);
  5765. checkProp(res, props, key, altKey, true) ||
  5766. checkProp(res, attrs, key, altKey) ||
  5767. checkProp(res, domProps, key, altKey);
  5768. }
  5769. }
  5770. return res
  5771. }
  5772. function checkProp (
  5773. res,
  5774. hash,
  5775. key,
  5776. altKey,
  5777. preserve
  5778. ) {
  5779. if (hash) {
  5780. if (hasOwn(hash, key)) {
  5781. res[key] = hash[key];
  5782. if (!preserve) {
  5783. delete hash[key];
  5784. }
  5785. return true
  5786. } else if (hasOwn(hash, altKey)) {
  5787. res[key] = hash[altKey];
  5788. if (!preserve) {
  5789. delete hash[altKey];
  5790. }
  5791. return true
  5792. }
  5793. }
  5794. return false
  5795. }
  5796. function mergeHooks (data) {
  5797. if (!data.hook) {
  5798. data.hook = {};
  5799. }
  5800. for (var i = 0; i < hooksToMerge.length; i++) {
  5801. var key = hooksToMerge[i];
  5802. var fromParent = data.hook[key];
  5803. var ours = hooks[key];
  5804. data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;
  5805. }
  5806. }
  5807. function mergeHook$1 (a, b) {
  5808. // since all hooks have at most two args, use fixed args
  5809. // to avoid having to use fn.apply().
  5810. return function (_, __) {
  5811. a(_, __);
  5812. b(_, __);
  5813. }
  5814. }
  5815. /* */
  5816. // wrapper function for providing a more flexible interface
  5817. // without getting yelled at by flow
  5818. function createElement (
  5819. tag,
  5820. data,
  5821. children
  5822. ) {
  5823. if (data && (Array.isArray(data) || typeof data !== 'object')) {
  5824. children = data;
  5825. data = undefined;
  5826. }
  5827. // make sure to use real instance instead of proxy as context
  5828. return _createElement(this._self, tag, data, children)
  5829. }
  5830. function _createElement (
  5831. context,
  5832. tag,
  5833. data,
  5834. children
  5835. ) {
  5836. if (data && data.__ob__) {
  5837. process.env.NODE_ENV !== 'production' && warn(
  5838. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  5839. 'Always create fresh vnode data objects in each render!',
  5840. context
  5841. );
  5842. return
  5843. }
  5844. if (!tag) {
  5845. // in case of component :is set to falsy value
  5846. return emptyVNode()
  5847. }
  5848. if (typeof tag === 'string') {
  5849. var Ctor;
  5850. var ns = config.getTagNamespace(tag);
  5851. if (config.isReservedTag(tag)) {
  5852. // platform built-in elements
  5853. return new VNode(
  5854. tag, data, normalizeChildren(children, ns),
  5855. undefined, undefined, ns, context
  5856. )
  5857. } else if ((Ctor = resolveAsset(context.$options, 'components', tag))) {
  5858. // component
  5859. return createComponent(Ctor, data, context, children, tag)
  5860. } else {
  5861. // unknown or unlisted namespaced elements
  5862. // check at runtime because it may get assigned a namespace when its
  5863. // parent normalizes children
  5864. var childNs = tag === 'foreignObject' ? 'xhtml' : ns;
  5865. return new VNode(
  5866. tag, data, normalizeChildren(children, childNs),
  5867. undefined, undefined, ns, context
  5868. )
  5869. }
  5870. } else {
  5871. // direct component options / constructor
  5872. return createComponent(tag, data, context, children)
  5873. }
  5874. }
  5875. /* */
  5876. function initRender (vm) {
  5877. vm.$vnode = null; // the placeholder node in parent tree
  5878. vm._vnode = null; // the root of the child tree
  5879. vm._staticTrees = null;
  5880. vm._renderContext = vm.$options._parentVnode && vm.$options._parentVnode.context;
  5881. vm.$slots = resolveSlots(vm.$options._renderChildren, vm._renderContext);
  5882. // bind the public createElement fn to this instance
  5883. // so that we get proper render context inside it.
  5884. vm.$createElement = bind$1(createElement, vm);
  5885. if (vm.$options.el) {
  5886. vm.$mount(vm.$options.el);
  5887. }
  5888. }
  5889. function renderMixin (Vue) {
  5890. Vue.prototype.$nextTick = function (fn) {
  5891. nextTick(fn, this);
  5892. };
  5893. Vue.prototype._render = function () {
  5894. var vm = this;
  5895. var ref = vm.$options;
  5896. var render = ref.render;
  5897. var staticRenderFns = ref.staticRenderFns;
  5898. var _parentVnode = ref._parentVnode;
  5899. if (vm._isMounted) {
  5900. // clone slot nodes on re-renders
  5901. for (var key in vm.$slots) {
  5902. vm.$slots[key] = cloneVNodes(vm.$slots[key]);
  5903. }
  5904. }
  5905. if (staticRenderFns && !vm._staticTrees) {
  5906. vm._staticTrees = [];
  5907. }
  5908. // set parent vnode. this allows render functions to have access
  5909. // to the data on the placeholder node.
  5910. vm.$vnode = _parentVnode;
  5911. // render self
  5912. var vnode;
  5913. try {
  5914. vnode = render.call(vm._renderProxy, vm.$createElement);
  5915. } catch (e) {
  5916. if (process.env.NODE_ENV !== 'production') {
  5917. warn(("Error when rendering " + (formatComponentName(vm)) + ":"));
  5918. }
  5919. /* istanbul ignore else */
  5920. if (config.errorHandler) {
  5921. config.errorHandler.call(null, e, vm);
  5922. } else {
  5923. if (config._isServer) {
  5924. throw e
  5925. } else {
  5926. console.error(e);
  5927. }
  5928. }
  5929. // return previous vnode to prevent render error causing blank component
  5930. vnode = vm._vnode;
  5931. }
  5932. // return empty vnode in case the render function errored out
  5933. if (!(vnode instanceof VNode)) {
  5934. if (process.env.NODE_ENV !== 'production' && Array.isArray(vnode)) {
  5935. warn(
  5936. 'Multiple root nodes returned from render function. Render function ' +
  5937. 'should return a single root node.',
  5938. vm
  5939. );
  5940. }
  5941. vnode = emptyVNode();
  5942. }
  5943. // set parent
  5944. vnode.parent = _parentVnode;
  5945. return vnode
  5946. };
  5947. // shorthands used in render functions
  5948. Vue.prototype._h = createElement;
  5949. // toString for mustaches
  5950. Vue.prototype._s = _toString;
  5951. // number conversion
  5952. Vue.prototype._n = toNumber;
  5953. // empty vnode
  5954. Vue.prototype._e = emptyVNode;
  5955. // loose equal
  5956. Vue.prototype._q = looseEqual;
  5957. // loose indexOf
  5958. Vue.prototype._i = looseIndexOf;
  5959. // render static tree by index
  5960. Vue.prototype._m = function renderStatic (
  5961. index,
  5962. isInFor
  5963. ) {
  5964. var tree = this._staticTrees[index];
  5965. // if has already-rendered static tree and not inside v-for,
  5966. // we can reuse the same tree by doing a shallow clone.
  5967. if (tree && !isInFor) {
  5968. return Array.isArray(tree)
  5969. ? cloneVNodes(tree)
  5970. : cloneVNode(tree)
  5971. }
  5972. // otherwise, render a fresh tree.
  5973. tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy);
  5974. markStatic(tree, ("__static__" + index), false);
  5975. return tree
  5976. };
  5977. // mark node as static (v-once)
  5978. Vue.prototype._o = function markOnce (
  5979. tree,
  5980. index,
  5981. key
  5982. ) {
  5983. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5984. return tree
  5985. };
  5986. function markStatic (tree, key, isOnce) {
  5987. if (Array.isArray(tree)) {
  5988. for (var i = 0; i < tree.length; i++) {
  5989. if (tree[i] && typeof tree[i] !== 'string') {
  5990. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5991. }
  5992. }
  5993. } else {
  5994. markStaticNode(tree, key, isOnce);
  5995. }
  5996. }
  5997. function markStaticNode (node, key, isOnce) {
  5998. node.isStatic = true;
  5999. node.key = key;
  6000. node.isOnce = isOnce;
  6001. }
  6002. // filter resolution helper
  6003. var identity = function (_) { return _; };
  6004. Vue.prototype._f = function resolveFilter (id) {
  6005. return resolveAsset(this.$options, 'filters', id, true) || identity
  6006. };
  6007. // render v-for
  6008. Vue.prototype._l = function renderList (
  6009. val,
  6010. render
  6011. ) {
  6012. var ret, i, l, keys, key;
  6013. if (Array.isArray(val)) {
  6014. ret = new Array(val.length);
  6015. for (i = 0, l = val.length; i < l; i++) {
  6016. ret[i] = render(val[i], i);
  6017. }
  6018. } else if (typeof val === 'number') {
  6019. ret = new Array(val);
  6020. for (i = 0; i < val; i++) {
  6021. ret[i] = render(i + 1, i);
  6022. }
  6023. } else if (isObject(val)) {
  6024. keys = Object.keys(val);
  6025. ret = new Array(keys.length);
  6026. for (i = 0, l = keys.length; i < l; i++) {
  6027. key = keys[i];
  6028. ret[i] = render(val[key], key, i);
  6029. }
  6030. }
  6031. return ret
  6032. };
  6033. // renderSlot
  6034. Vue.prototype._t = function (
  6035. name,
  6036. fallback
  6037. ) {
  6038. var slotNodes = this.$slots[name];
  6039. // warn duplicate slot usage
  6040. if (slotNodes && process.env.NODE_ENV !== 'production') {
  6041. slotNodes._rendered && warn(
  6042. "Duplicate presence of slot \"" + name + "\" found in the same render tree " +
  6043. "- this will likely cause render errors.",
  6044. this
  6045. );
  6046. slotNodes._rendered = true;
  6047. }
  6048. return slotNodes || fallback
  6049. };
  6050. // apply v-bind object
  6051. Vue.prototype._b = function bindProps (
  6052. data,
  6053. value,
  6054. asProp
  6055. ) {
  6056. if (value) {
  6057. if (!isObject(value)) {
  6058. process.env.NODE_ENV !== 'production' && warn(
  6059. 'v-bind without argument expects an Object or Array value',
  6060. this
  6061. );
  6062. } else {
  6063. if (Array.isArray(value)) {
  6064. value = toObject(value);
  6065. }
  6066. for (var key in value) {
  6067. if (key === 'class' || key === 'style') {
  6068. data[key] = value[key];
  6069. } else {
  6070. var hash = asProp || config.mustUseProp(key)
  6071. ? data.domProps || (data.domProps = {})
  6072. : data.attrs || (data.attrs = {});
  6073. hash[key] = value[key];
  6074. }
  6075. }
  6076. }
  6077. }
  6078. return data
  6079. };
  6080. // expose v-on keyCodes
  6081. Vue.prototype._k = function getKeyCodes (key) {
  6082. return config.keyCodes[key]
  6083. };
  6084. }
  6085. function resolveSlots (
  6086. renderChildren,
  6087. context
  6088. ) {
  6089. var slots = {};
  6090. if (!renderChildren) {
  6091. return slots
  6092. }
  6093. var children = normalizeChildren(renderChildren) || [];
  6094. var defaultSlot = [];
  6095. var name, child;
  6096. for (var i = 0, l = children.length; i < l; i++) {
  6097. child = children[i];
  6098. // named slots should only be respected if the vnode was rendered in the
  6099. // same context.
  6100. if ((child.context === context || child.functionalContext === context) &&
  6101. child.data && (name = child.data.slot)) {
  6102. var slot = (slots[name] || (slots[name] = []));
  6103. if (child.tag === 'template') {
  6104. slot.push.apply(slot, child.children);
  6105. } else {
  6106. slot.push(child);
  6107. }
  6108. } else {
  6109. defaultSlot.push(child);
  6110. }
  6111. }
  6112. // ignore single whitespace
  6113. if (defaultSlot.length && !(
  6114. defaultSlot.length === 1 &&
  6115. (defaultSlot[0].text === ' ' || defaultSlot[0].isComment)
  6116. )) {
  6117. slots.default = defaultSlot;
  6118. }
  6119. return slots
  6120. }
  6121. /* */
  6122. function initEvents (vm) {
  6123. vm._events = Object.create(null);
  6124. // init parent attached events
  6125. var listeners = vm.$options._parentListeners;
  6126. var on = bind$1(vm.$on, vm);
  6127. var off = bind$1(vm.$off, vm);
  6128. vm._updateListeners = function (listeners, oldListeners) {
  6129. updateListeners(listeners, oldListeners || {}, on, off, vm);
  6130. };
  6131. if (listeners) {
  6132. vm._updateListeners(listeners);
  6133. }
  6134. }
  6135. function eventsMixin (Vue) {
  6136. Vue.prototype.$on = function (event, fn) {
  6137. var vm = this;(vm._events[event] || (vm._events[event] = [])).push(fn);
  6138. return vm
  6139. };
  6140. Vue.prototype.$once = function (event, fn) {
  6141. var vm = this;
  6142. function on () {
  6143. vm.$off(event, on);
  6144. fn.apply(vm, arguments);
  6145. }
  6146. on.fn = fn;
  6147. vm.$on(event, on);
  6148. return vm
  6149. };
  6150. Vue.prototype.$off = function (event, fn) {
  6151. var vm = this;
  6152. // all
  6153. if (!arguments.length) {
  6154. vm._events = Object.create(null);
  6155. return vm
  6156. }
  6157. // specific event
  6158. var cbs = vm._events[event];
  6159. if (!cbs) {
  6160. return vm
  6161. }
  6162. if (arguments.length === 1) {
  6163. vm._events[event] = null;
  6164. return vm
  6165. }
  6166. // specific handler
  6167. var cb;
  6168. var i = cbs.length;
  6169. while (i--) {
  6170. cb = cbs[i];
  6171. if (cb === fn || cb.fn === fn) {
  6172. cbs.splice(i, 1);
  6173. break
  6174. }
  6175. }
  6176. return vm
  6177. };
  6178. Vue.prototype.$emit = function (event) {
  6179. var vm = this;
  6180. var cbs = vm._events[event];
  6181. if (cbs) {
  6182. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6183. var args = toArray(arguments, 1);
  6184. for (var i = 0, l = cbs.length; i < l; i++) {
  6185. cbs[i].apply(vm, args);
  6186. }
  6187. }
  6188. return vm
  6189. };
  6190. }
  6191. /* */
  6192. var uid = 0;
  6193. function initMixin (Vue) {
  6194. Vue.prototype._init = function (options) {
  6195. var vm = this;
  6196. // a uid
  6197. vm._uid = uid++;
  6198. // a flag to avoid this being observed
  6199. vm._isVue = true;
  6200. // merge options
  6201. if (options && options._isComponent) {
  6202. // optimize internal component instantiation
  6203. // since dynamic options merging is pretty slow, and none of the
  6204. // internal component options needs special treatment.
  6205. initInternalComponent(vm, options);
  6206. } else {
  6207. vm.$options = mergeOptions(
  6208. resolveConstructorOptions(vm.constructor),
  6209. options || {},
  6210. vm
  6211. );
  6212. }
  6213. /* istanbul ignore else */
  6214. if (process.env.NODE_ENV !== 'production') {
  6215. initProxy(vm);
  6216. } else {
  6217. vm._renderProxy = vm;
  6218. }
  6219. // expose real self
  6220. vm._self = vm;
  6221. initLifecycle(vm);
  6222. initEvents(vm);
  6223. callHook(vm, 'beforeCreate');
  6224. initState(vm);
  6225. callHook(vm, 'created');
  6226. initRender(vm);
  6227. };
  6228. }
  6229. function initInternalComponent (vm, options) {
  6230. var opts = vm.$options = Object.create(vm.constructor.options);
  6231. // doing this because it's faster than dynamic enumeration.
  6232. opts.parent = options.parent;
  6233. opts.propsData = options.propsData;
  6234. opts._parentVnode = options._parentVnode;
  6235. opts._parentListeners = options._parentListeners;
  6236. opts._renderChildren = options._renderChildren;
  6237. opts._componentTag = options._componentTag;
  6238. if (options.render) {
  6239. opts.render = options.render;
  6240. opts.staticRenderFns = options.staticRenderFns;
  6241. }
  6242. }
  6243. function resolveConstructorOptions (Ctor) {
  6244. var options = Ctor.options;
  6245. if (Ctor.super) {
  6246. var superOptions = Ctor.super.options;
  6247. var cachedSuperOptions = Ctor.superOptions;
  6248. var extendOptions = Ctor.extendOptions;
  6249. if (superOptions !== cachedSuperOptions) {
  6250. // super option changed
  6251. Ctor.superOptions = superOptions;
  6252. extendOptions.render = options.render;
  6253. extendOptions.staticRenderFns = options.staticRenderFns;
  6254. options = Ctor.options = mergeOptions(superOptions, extendOptions);
  6255. if (options.name) {
  6256. options.components[options.name] = Ctor;
  6257. }
  6258. }
  6259. }
  6260. return options
  6261. }
  6262. function Vue$2 (options) {
  6263. if (process.env.NODE_ENV !== 'production' &&
  6264. !(this instanceof Vue$2)) {
  6265. warn('Vue is a constructor and should be called with the `new` keyword');
  6266. }
  6267. this._init(options);
  6268. }
  6269. initMixin(Vue$2);
  6270. stateMixin(Vue$2);
  6271. eventsMixin(Vue$2);
  6272. lifecycleMixin(Vue$2);
  6273. renderMixin(Vue$2);
  6274. var warn = noop;
  6275. var formatComponentName;
  6276. if (process.env.NODE_ENV !== 'production') {
  6277. var hasConsole = typeof console !== 'undefined';
  6278. warn = function (msg, vm) {
  6279. if (hasConsole && (!config.silent)) {
  6280. console.error("[Vue warn]: " + msg + " " + (
  6281. vm ? formatLocation(formatComponentName(vm)) : ''
  6282. ));
  6283. }
  6284. };
  6285. formatComponentName = function (vm) {
  6286. if (vm.$root === vm) {
  6287. return 'root instance'
  6288. }
  6289. var name = vm._isVue
  6290. ? vm.$options.name || vm.$options._componentTag
  6291. : vm.name;
  6292. return (
  6293. (name ? ("component <" + name + ">") : "anonymous component") +
  6294. (vm._isVue && vm.$options.__file ? (" at " + (vm.$options.__file)) : '')
  6295. )
  6296. };
  6297. var formatLocation = function (str) {
  6298. if (str === 'anonymous component') {
  6299. str += " - use the \"name\" option for better debugging messages.";
  6300. }
  6301. return ("\n(found in " + str + ")")
  6302. };
  6303. }
  6304. /* */
  6305. /**
  6306. * Option overwriting strategies are functions that handle
  6307. * how to merge a parent option value and a child option
  6308. * value into the final value.
  6309. */
  6310. var strats = config.optionMergeStrategies;
  6311. /**
  6312. * Options with restrictions
  6313. */
  6314. if (process.env.NODE_ENV !== 'production') {
  6315. strats.el = strats.propsData = function (parent, child, vm, key) {
  6316. if (!vm) {
  6317. warn(
  6318. "option \"" + key + "\" can only be used during instance " +
  6319. 'creation with the `new` keyword.'
  6320. );
  6321. }
  6322. return defaultStrat(parent, child)
  6323. };
  6324. }
  6325. /**
  6326. * Helper that recursively merges two data objects together.
  6327. */
  6328. function mergeData (to, from) {
  6329. if (!from) { return to }
  6330. var key, toVal, fromVal;
  6331. var keys = Object.keys(from);
  6332. for (var i = 0; i < keys.length; i++) {
  6333. key = keys[i];
  6334. toVal = to[key];
  6335. fromVal = from[key];
  6336. if (!hasOwn(to, key)) {
  6337. set(to, key, fromVal);
  6338. } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
  6339. mergeData(toVal, fromVal);
  6340. }
  6341. }
  6342. return to
  6343. }
  6344. /**
  6345. * Data
  6346. */
  6347. strats.data = function (
  6348. parentVal,
  6349. childVal,
  6350. vm
  6351. ) {
  6352. if (!vm) {
  6353. // in a Vue.extend merge, both should be functions
  6354. if (!childVal) {
  6355. return parentVal
  6356. }
  6357. if (typeof childVal !== 'function') {
  6358. process.env.NODE_ENV !== 'production' && warn(
  6359. 'The "data" option should be a function ' +
  6360. 'that returns a per-instance value in component ' +
  6361. 'definitions.',
  6362. vm
  6363. );
  6364. return parentVal
  6365. }
  6366. if (!parentVal) {
  6367. return childVal
  6368. }
  6369. // when parentVal & childVal are both present,
  6370. // we need to return a function that returns the
  6371. // merged result of both functions... no need to
  6372. // check if parentVal is a function here because
  6373. // it has to be a function to pass previous merges.
  6374. return function mergedDataFn () {
  6375. return mergeData(
  6376. childVal.call(this),
  6377. parentVal.call(this)
  6378. )
  6379. }
  6380. } else if (parentVal || childVal) {
  6381. return function mergedInstanceDataFn () {
  6382. // instance merge
  6383. var instanceData = typeof childVal === 'function'
  6384. ? childVal.call(vm)
  6385. : childVal;
  6386. var defaultData = typeof parentVal === 'function'
  6387. ? parentVal.call(vm)
  6388. : undefined;
  6389. if (instanceData) {
  6390. return mergeData(instanceData, defaultData)
  6391. } else {
  6392. return defaultData
  6393. }
  6394. }
  6395. }
  6396. };
  6397. /**
  6398. * Hooks and param attributes are merged as arrays.
  6399. */
  6400. function mergeHook (
  6401. parentVal,
  6402. childVal
  6403. ) {
  6404. return childVal
  6405. ? parentVal
  6406. ? parentVal.concat(childVal)
  6407. : Array.isArray(childVal)
  6408. ? childVal
  6409. : [childVal]
  6410. : parentVal
  6411. }
  6412. config._lifecycleHooks.forEach(function (hook) {
  6413. strats[hook] = mergeHook;
  6414. });
  6415. /**
  6416. * Assets
  6417. *
  6418. * When a vm is present (instance creation), we need to do
  6419. * a three-way merge between constructor options, instance
  6420. * options and parent options.
  6421. */
  6422. function mergeAssets (parentVal, childVal) {
  6423. var res = Object.create(parentVal || null);
  6424. return childVal
  6425. ? extend(res, childVal)
  6426. : res
  6427. }
  6428. config._assetTypes.forEach(function (type) {
  6429. strats[type + 's'] = mergeAssets;
  6430. });
  6431. /**
  6432. * Watchers.
  6433. *
  6434. * Watchers hashes should not overwrite one
  6435. * another, so we merge them as arrays.
  6436. */
  6437. strats.watch = function (parentVal, childVal) {
  6438. /* istanbul ignore if */
  6439. if (!childVal) { return parentVal }
  6440. if (!parentVal) { return childVal }
  6441. var ret = {};
  6442. extend(ret, parentVal);
  6443. for (var key in childVal) {
  6444. var parent = ret[key];
  6445. var child = childVal[key];
  6446. if (parent && !Array.isArray(parent)) {
  6447. parent = [parent];
  6448. }
  6449. ret[key] = parent
  6450. ? parent.concat(child)
  6451. : [child];
  6452. }
  6453. return ret
  6454. };
  6455. /**
  6456. * Other object hashes.
  6457. */
  6458. strats.props =
  6459. strats.methods =
  6460. strats.computed = function (parentVal, childVal) {
  6461. if (!childVal) { return parentVal }
  6462. if (!parentVal) { return childVal }
  6463. var ret = Object.create(null);
  6464. extend(ret, parentVal);
  6465. extend(ret, childVal);
  6466. return ret
  6467. };
  6468. /**
  6469. * Default strategy.
  6470. */
  6471. var defaultStrat = function (parentVal, childVal) {
  6472. return childVal === undefined
  6473. ? parentVal
  6474. : childVal
  6475. };
  6476. /**
  6477. * Validate component names
  6478. */
  6479. function checkComponents (options) {
  6480. for (var key in options.components) {
  6481. var lower = key.toLowerCase();
  6482. if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
  6483. warn(
  6484. 'Do not use built-in or reserved HTML elements as component ' +
  6485. 'id: ' + key
  6486. );
  6487. }
  6488. }
  6489. }
  6490. /**
  6491. * Ensure all props option syntax are normalized into the
  6492. * Object-based format.
  6493. */
  6494. function normalizeProps (options) {
  6495. var props = options.props;
  6496. if (!props) { return }
  6497. var res = {};
  6498. var i, val, name;
  6499. if (Array.isArray(props)) {
  6500. i = props.length;
  6501. while (i--) {
  6502. val = props[i];
  6503. if (typeof val === 'string') {
  6504. name = camelize(val);
  6505. res[name] = { type: null };
  6506. } else if (process.env.NODE_ENV !== 'production') {
  6507. warn('props must be strings when using array syntax.');
  6508. }
  6509. }
  6510. } else if (isPlainObject(props)) {
  6511. for (var key in props) {
  6512. val = props[key];
  6513. name = camelize(key);
  6514. res[name] = isPlainObject(val)
  6515. ? val
  6516. : { type: val };
  6517. }
  6518. }
  6519. options.props = res;
  6520. }
  6521. /**
  6522. * Normalize raw function directives into object format.
  6523. */
  6524. function normalizeDirectives (options) {
  6525. var dirs = options.directives;
  6526. if (dirs) {
  6527. for (var key in dirs) {
  6528. var def = dirs[key];
  6529. if (typeof def === 'function') {
  6530. dirs[key] = { bind: def, update: def };
  6531. }
  6532. }
  6533. }
  6534. }
  6535. /**
  6536. * Merge two option objects into a new one.
  6537. * Core utility used in both instantiation and inheritance.
  6538. */
  6539. function mergeOptions (
  6540. parent,
  6541. child,
  6542. vm
  6543. ) {
  6544. if (process.env.NODE_ENV !== 'production') {
  6545. checkComponents(child);
  6546. }
  6547. normalizeProps(child);
  6548. normalizeDirectives(child);
  6549. var extendsFrom = child.extends;
  6550. if (extendsFrom) {
  6551. parent = typeof extendsFrom === 'function'
  6552. ? mergeOptions(parent, extendsFrom.options, vm)
  6553. : mergeOptions(parent, extendsFrom, vm);
  6554. }
  6555. if (child.mixins) {
  6556. for (var i = 0, l = child.mixins.length; i < l; i++) {
  6557. var mixin = child.mixins[i];
  6558. if (mixin.prototype instanceof Vue$2) {
  6559. mixin = mixin.options;
  6560. }
  6561. parent = mergeOptions(parent, mixin, vm);
  6562. }
  6563. }
  6564. var options = {};
  6565. var key;
  6566. for (key in parent) {
  6567. mergeField(key);
  6568. }
  6569. for (key in child) {
  6570. if (!hasOwn(parent, key)) {
  6571. mergeField(key);
  6572. }
  6573. }
  6574. function mergeField (key) {
  6575. var strat = strats[key] || defaultStrat;
  6576. options[key] = strat(parent[key], child[key], vm, key);
  6577. }
  6578. return options
  6579. }
  6580. /**
  6581. * Resolve an asset.
  6582. * This function is used because child instances need access
  6583. * to assets defined in its ancestor chain.
  6584. */
  6585. function resolveAsset (
  6586. options,
  6587. type,
  6588. id,
  6589. warnMissing
  6590. ) {
  6591. /* istanbul ignore if */
  6592. if (typeof id !== 'string') {
  6593. return
  6594. }
  6595. var assets = options[type];
  6596. var res = assets[id] ||
  6597. // camelCase ID
  6598. assets[camelize(id)] ||
  6599. // Pascal Case ID
  6600. assets[capitalize(camelize(id))];
  6601. if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
  6602. warn(
  6603. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  6604. options
  6605. );
  6606. }
  6607. return res
  6608. }
  6609. /* */
  6610. function validateProp (
  6611. key,
  6612. propOptions,
  6613. propsData,
  6614. vm
  6615. ) {
  6616. var prop = propOptions[key];
  6617. var absent = !hasOwn(propsData, key);
  6618. var value = propsData[key];
  6619. // handle boolean props
  6620. if (isBooleanType(prop.type)) {
  6621. if (absent && !hasOwn(prop, 'default')) {
  6622. value = false;
  6623. } else if (value === '' || value === hyphenate(key)) {
  6624. value = true;
  6625. }
  6626. }
  6627. // check default value
  6628. if (value === undefined) {
  6629. value = getPropDefaultValue(vm, prop, key);
  6630. // since the default value is a fresh copy,
  6631. // make sure to observe it.
  6632. var prevShouldConvert = observerState.shouldConvert;
  6633. observerState.shouldConvert = true;
  6634. observe(value);
  6635. observerState.shouldConvert = prevShouldConvert;
  6636. }
  6637. if (process.env.NODE_ENV !== 'production') {
  6638. assertProp(prop, key, value, vm, absent);
  6639. }
  6640. return value
  6641. }
  6642. /**
  6643. * Get the default value of a prop.
  6644. */
  6645. function getPropDefaultValue (vm, prop, key) {
  6646. // no default, return undefined
  6647. if (!hasOwn(prop, 'default')) {
  6648. return undefined
  6649. }
  6650. var def = prop.default;
  6651. // warn against non-factory defaults for Object & Array
  6652. if (isObject(def)) {
  6653. process.env.NODE_ENV !== 'production' && warn(
  6654. 'Invalid default value for prop "' + key + '": ' +
  6655. 'Props with type Object/Array must use a factory function ' +
  6656. 'to return the default value.',
  6657. vm
  6658. );
  6659. }
  6660. // the raw prop value was also undefined from previous render,
  6661. // return previous default value to avoid unnecessary watcher trigger
  6662. if (vm && vm.$options.propsData &&
  6663. vm.$options.propsData[key] === undefined &&
  6664. vm[key] !== undefined) {
  6665. return vm[key]
  6666. }
  6667. // call factory function for non-Function types
  6668. return typeof def === 'function' && prop.type !== Function
  6669. ? def.call(vm)
  6670. : def
  6671. }
  6672. /**
  6673. * Assert whether a prop is valid.
  6674. */
  6675. function assertProp (
  6676. prop,
  6677. name,
  6678. value,
  6679. vm,
  6680. absent
  6681. ) {
  6682. if (prop.required && absent) {
  6683. warn(
  6684. 'Missing required prop: "' + name + '"',
  6685. vm
  6686. );
  6687. return
  6688. }
  6689. if (value == null && !prop.required) {
  6690. return
  6691. }
  6692. var type = prop.type;
  6693. var valid = !type || type === true;
  6694. var expectedTypes = [];
  6695. if (type) {
  6696. if (!Array.isArray(type)) {
  6697. type = [type];
  6698. }
  6699. for (var i = 0; i < type.length && !valid; i++) {
  6700. var assertedType = assertType(value, type[i]);
  6701. expectedTypes.push(assertedType.expectedType);
  6702. valid = assertedType.valid;
  6703. }
  6704. }
  6705. if (!valid) {
  6706. warn(
  6707. 'Invalid prop: type check failed for prop "' + name + '".' +
  6708. ' Expected ' + expectedTypes.map(capitalize).join(', ') +
  6709. ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',
  6710. vm
  6711. );
  6712. return
  6713. }
  6714. var validator = prop.validator;
  6715. if (validator) {
  6716. if (!validator(value)) {
  6717. warn(
  6718. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  6719. vm
  6720. );
  6721. }
  6722. }
  6723. }
  6724. /**
  6725. * Assert the type of a value
  6726. */
  6727. function assertType (value, type) {
  6728. var valid;
  6729. var expectedType = getType(type);
  6730. if (expectedType === 'String') {
  6731. valid = typeof value === (expectedType = 'string');
  6732. } else if (expectedType === 'Number') {
  6733. valid = typeof value === (expectedType = 'number');
  6734. } else if (expectedType === 'Boolean') {
  6735. valid = typeof value === (expectedType = 'boolean');
  6736. } else if (expectedType === 'Function') {
  6737. valid = typeof value === (expectedType = 'function');
  6738. } else if (expectedType === 'Object') {
  6739. valid = isPlainObject(value);
  6740. } else if (expectedType === 'Array') {
  6741. valid = Array.isArray(value);
  6742. } else {
  6743. valid = value instanceof type;
  6744. }
  6745. return {
  6746. valid: valid,
  6747. expectedType: expectedType
  6748. }
  6749. }
  6750. /**
  6751. * Use function string name to check built-in types,
  6752. * because a simple equality check will fail when running
  6753. * across different vms / iframes.
  6754. */
  6755. function getType (fn) {
  6756. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  6757. return match && match[1]
  6758. }
  6759. function isBooleanType (fn) {
  6760. if (!Array.isArray(fn)) {
  6761. return getType(fn) === 'Boolean'
  6762. }
  6763. for (var i = 0, len = fn.length; i < len; i++) {
  6764. if (getType(fn[i]) === 'Boolean') {
  6765. return true
  6766. }
  6767. }
  6768. /* istanbul ignore next */
  6769. return false
  6770. }
  6771. var util = Object.freeze({
  6772. defineReactive: defineReactive$$1,
  6773. _toString: _toString,
  6774. toNumber: toNumber,
  6775. makeMap: makeMap,
  6776. isBuiltInTag: isBuiltInTag,
  6777. remove: remove$1,
  6778. hasOwn: hasOwn,
  6779. isPrimitive: isPrimitive,
  6780. cached: cached,
  6781. camelize: camelize,
  6782. capitalize: capitalize,
  6783. hyphenate: hyphenate,
  6784. bind: bind$1,
  6785. toArray: toArray,
  6786. extend: extend,
  6787. isObject: isObject,
  6788. isPlainObject: isPlainObject,
  6789. toObject: toObject,
  6790. noop: noop,
  6791. no: no,
  6792. genStaticKeys: genStaticKeys,
  6793. looseEqual: looseEqual,
  6794. looseIndexOf: looseIndexOf,
  6795. isReserved: isReserved,
  6796. def: def,
  6797. parsePath: parsePath,
  6798. hasProto: hasProto,
  6799. inBrowser: inBrowser,
  6800. UA: UA,
  6801. isIE: isIE,
  6802. isIE9: isIE9,
  6803. isEdge: isEdge,
  6804. isAndroid: isAndroid,
  6805. isIOS: isIOS,
  6806. devtools: devtools,
  6807. nextTick: nextTick,
  6808. get _Set () { return _Set; },
  6809. mergeOptions: mergeOptions,
  6810. resolveAsset: resolveAsset,
  6811. get warn () { return warn; },
  6812. get formatComponentName () { return formatComponentName; },
  6813. validateProp: validateProp
  6814. });
  6815. /* */
  6816. function initUse (Vue) {
  6817. Vue.use = function (plugin) {
  6818. /* istanbul ignore if */
  6819. if (plugin.installed) {
  6820. return
  6821. }
  6822. // additional parameters
  6823. var args = toArray(arguments, 1);
  6824. args.unshift(this);
  6825. if (typeof plugin.install === 'function') {
  6826. plugin.install.apply(plugin, args);
  6827. } else {
  6828. plugin.apply(null, args);
  6829. }
  6830. plugin.installed = true;
  6831. return this
  6832. };
  6833. }
  6834. /* */
  6835. function initMixin$1 (Vue) {
  6836. Vue.mixin = function (mixin) {
  6837. this.options = mergeOptions(this.options, mixin);
  6838. };
  6839. }
  6840. /* */
  6841. function initExtend (Vue) {
  6842. /**
  6843. * Each instance constructor, including Vue, has a unique
  6844. * cid. This enables us to create wrapped "child
  6845. * constructors" for prototypal inheritance and cache them.
  6846. */
  6847. Vue.cid = 0;
  6848. var cid = 1;
  6849. /**
  6850. * Class inheritance
  6851. */
  6852. Vue.extend = function (extendOptions) {
  6853. extendOptions = extendOptions || {};
  6854. var Super = this;
  6855. var SuperId = Super.cid;
  6856. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  6857. if (cachedCtors[SuperId]) {
  6858. return cachedCtors[SuperId]
  6859. }
  6860. var name = extendOptions.name || Super.options.name;
  6861. if (process.env.NODE_ENV !== 'production') {
  6862. if (!/^[a-zA-Z][\w-]*$/.test(name)) {
  6863. warn(
  6864. 'Invalid component name: "' + name + '". Component names ' +
  6865. 'can only contain alphanumeric characaters and the hyphen.'
  6866. );
  6867. }
  6868. }
  6869. var Sub = function VueComponent (options) {
  6870. this._init(options);
  6871. };
  6872. Sub.prototype = Object.create(Super.prototype);
  6873. Sub.prototype.constructor = Sub;
  6874. Sub.cid = cid++;
  6875. Sub.options = mergeOptions(
  6876. Super.options,
  6877. extendOptions
  6878. );
  6879. Sub['super'] = Super;
  6880. // allow further extension/mixin/plugin usage
  6881. Sub.extend = Super.extend;
  6882. Sub.mixin = Super.mixin;
  6883. Sub.use = Super.use;
  6884. // create asset registers, so extended classes
  6885. // can have their private assets too.
  6886. config._assetTypes.forEach(function (type) {
  6887. Sub[type] = Super[type];
  6888. });
  6889. // enable recursive self-lookup
  6890. if (name) {
  6891. Sub.options.components[name] = Sub;
  6892. }
  6893. // keep a reference to the super options at extension time.
  6894. // later at instantiation we can check if Super's options have
  6895. // been updated.
  6896. Sub.superOptions = Super.options;
  6897. Sub.extendOptions = extendOptions;
  6898. // cache constructor
  6899. cachedCtors[SuperId] = Sub;
  6900. return Sub
  6901. };
  6902. }
  6903. /* */
  6904. function initAssetRegisters (Vue) {
  6905. /**
  6906. * Create asset registration methods.
  6907. */
  6908. config._assetTypes.forEach(function (type) {
  6909. Vue[type] = function (
  6910. id,
  6911. definition
  6912. ) {
  6913. if (!definition) {
  6914. return this.options[type + 's'][id]
  6915. } else {
  6916. /* istanbul ignore if */
  6917. if (process.env.NODE_ENV !== 'production') {
  6918. if (type === 'component' && config.isReservedTag(id)) {
  6919. warn(
  6920. 'Do not use built-in or reserved HTML elements as component ' +
  6921. 'id: ' + id
  6922. );
  6923. }
  6924. }
  6925. if (type === 'component' && isPlainObject(definition)) {
  6926. definition.name = definition.name || id;
  6927. definition = this.options._base.extend(definition);
  6928. }
  6929. if (type === 'directive' && typeof definition === 'function') {
  6930. definition = { bind: definition, update: definition };
  6931. }
  6932. this.options[type + 's'][id] = definition;
  6933. return definition
  6934. }
  6935. };
  6936. });
  6937. }
  6938. var KeepAlive = {
  6939. name: 'keep-alive',
  6940. abstract: true,
  6941. created: function created () {
  6942. this.cache = Object.create(null);
  6943. },
  6944. render: function render () {
  6945. var vnode = getFirstComponentChild(this.$slots.default);
  6946. if (vnode && vnode.componentOptions) {
  6947. var opts = vnode.componentOptions;
  6948. var key = vnode.key == null
  6949. // same constructor may get registered as different local components
  6950. // so cid alone is not enough (#3269)
  6951. ? opts.Ctor.cid + '::' + opts.tag
  6952. : vnode.key;
  6953. if (this.cache[key]) {
  6954. vnode.child = this.cache[key].child;
  6955. } else {
  6956. this.cache[key] = vnode;
  6957. }
  6958. vnode.data.keepAlive = true;
  6959. }
  6960. return vnode
  6961. },
  6962. destroyed: function destroyed () {
  6963. var this$1 = this;
  6964. for (var key in this.cache) {
  6965. var vnode = this$1.cache[key];
  6966. callHook(vnode.child, 'deactivated');
  6967. vnode.child.$destroy();
  6968. }
  6969. }
  6970. };
  6971. var builtInComponents = {
  6972. KeepAlive: KeepAlive
  6973. };
  6974. /* */
  6975. function initGlobalAPI (Vue) {
  6976. // config
  6977. var configDef = {};
  6978. configDef.get = function () { return config; };
  6979. if (process.env.NODE_ENV !== 'production') {
  6980. configDef.set = function () {
  6981. warn(
  6982. 'Do not replace the Vue.config object, set individual fields instead.'
  6983. );
  6984. };
  6985. }
  6986. Object.defineProperty(Vue, 'config', configDef);
  6987. Vue.util = util;
  6988. Vue.set = set;
  6989. Vue.delete = del;
  6990. Vue.nextTick = nextTick;
  6991. Vue.options = Object.create(null);
  6992. config._assetTypes.forEach(function (type) {
  6993. Vue.options[type + 's'] = Object.create(null);
  6994. });
  6995. // this is used to identify the "base" constructor to extend all plain-object
  6996. // components with in Weex's multi-instance scenarios.
  6997. Vue.options._base = Vue;
  6998. extend(Vue.options.components, builtInComponents);
  6999. initUse(Vue);
  7000. initMixin$1(Vue);
  7001. initExtend(Vue);
  7002. initAssetRegisters(Vue);
  7003. }
  7004. initGlobalAPI(Vue$2);
  7005. Object.defineProperty(Vue$2.prototype, '$isServer', {
  7006. get: function () { return config._isServer; }
  7007. });
  7008. Vue$2.version = '2.0.7';
  7009. /* */
  7010. // attributes that should be using props for binding
  7011. var mustUseProp = makeMap('value,selected,checked,muted');
  7012. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  7013. var isBooleanAttr = makeMap(
  7014. 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  7015. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  7016. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  7017. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  7018. 'required,reversed,scoped,seamless,selected,sortable,translate,' +
  7019. 'truespeed,typemustmatch,visible'
  7020. );
  7021. var isAttr = makeMap(
  7022. 'accept,accept-charset,accesskey,action,align,alt,async,autocomplete,' +
  7023. 'autofocus,autoplay,autosave,bgcolor,border,buffered,challenge,charset,' +
  7024. 'checked,cite,class,code,codebase,color,cols,colspan,content,http-equiv,' +
  7025. 'name,contenteditable,contextmenu,controls,coords,data,datetime,default,' +
  7026. 'defer,dir,dirname,disabled,download,draggable,dropzone,enctype,method,for,' +
  7027. 'form,formaction,headers,<th>,height,hidden,high,href,hreflang,http-equiv,' +
  7028. 'icon,id,ismap,itemprop,keytype,kind,label,lang,language,list,loop,low,' +
  7029. 'manifest,max,maxlength,media,method,GET,POST,min,multiple,email,file,' +
  7030. 'muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,' +
  7031. 'preload,radiogroup,readonly,rel,required,reversed,rows,rowspan,sandbox,' +
  7032. 'scope,scoped,seamless,selected,shape,size,type,text,password,sizes,span,' +
  7033. 'spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,' +
  7034. 'target,title,type,usemap,value,width,wrap'
  7035. );
  7036. var xlinkNS = 'http://www.w3.org/1999/xlink';
  7037. var isXlink = function (name) {
  7038. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
  7039. };
  7040. var getXlinkProp = function (name) {
  7041. return isXlink(name) ? name.slice(6, name.length) : ''
  7042. };
  7043. var isFalsyAttrValue = function (val) {
  7044. return val == null || val === false
  7045. };
  7046. /* */
  7047. function genClassForVnode (vnode) {
  7048. var data = vnode.data;
  7049. var parentNode = vnode;
  7050. var childNode = vnode;
  7051. while (childNode.child) {
  7052. childNode = childNode.child._vnode;
  7053. if (childNode.data) {
  7054. data = mergeClassData(childNode.data, data);
  7055. }
  7056. }
  7057. while ((parentNode = parentNode.parent)) {
  7058. if (parentNode.data) {
  7059. data = mergeClassData(data, parentNode.data);
  7060. }
  7061. }
  7062. return genClassFromData(data)
  7063. }
  7064. function mergeClassData (child, parent) {
  7065. return {
  7066. staticClass: concat(child.staticClass, parent.staticClass),
  7067. class: child.class
  7068. ? [child.class, parent.class]
  7069. : parent.class
  7070. }
  7071. }
  7072. function genClassFromData (data) {
  7073. var dynamicClass = data.class;
  7074. var staticClass = data.staticClass;
  7075. if (staticClass || dynamicClass) {
  7076. return concat(staticClass, stringifyClass(dynamicClass))
  7077. }
  7078. /* istanbul ignore next */
  7079. return ''
  7080. }
  7081. function concat (a, b) {
  7082. return a ? b ? (a + ' ' + b) : a : (b || '')
  7083. }
  7084. function stringifyClass (value) {
  7085. var res = '';
  7086. if (!value) {
  7087. return res
  7088. }
  7089. if (typeof value === 'string') {
  7090. return value
  7091. }
  7092. if (Array.isArray(value)) {
  7093. var stringified;
  7094. for (var i = 0, l = value.length; i < l; i++) {
  7095. if (value[i]) {
  7096. if ((stringified = stringifyClass(value[i]))) {
  7097. res += stringified + ' ';
  7098. }
  7099. }
  7100. }
  7101. return res.slice(0, -1)
  7102. }
  7103. if (isObject(value)) {
  7104. for (var key in value) {
  7105. if (value[key]) { res += key + ' '; }
  7106. }
  7107. return res.slice(0, -1)
  7108. }
  7109. /* istanbul ignore next */
  7110. return res
  7111. }
  7112. /* */
  7113. var namespaceMap = {
  7114. svg: 'http://www.w3.org/2000/svg',
  7115. math: 'http://www.w3.org/1998/Math/MathML',
  7116. xhtml: 'http://www.w3.org/1999/xhtml'
  7117. };
  7118. var isHTMLTag = makeMap(
  7119. 'html,body,base,head,link,meta,style,title,' +
  7120. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  7121. 'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' +
  7122. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  7123. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  7124. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  7125. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  7126. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  7127. 'output,progress,select,textarea,' +
  7128. 'details,dialog,menu,menuitem,summary,' +
  7129. 'content,element,shadow,template'
  7130. );
  7131. var isUnaryTag = makeMap(
  7132. 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
  7133. 'link,meta,param,source,track,wbr',
  7134. true
  7135. );
  7136. // Elements that you can, intentionally, leave open
  7137. // (and which close themselves)
  7138. var canBeLeftOpenTag = makeMap(
  7139. 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source',
  7140. true
  7141. );
  7142. // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
  7143. // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
  7144. var isNonPhrasingTag = makeMap(
  7145. 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
  7146. 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
  7147. 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
  7148. 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
  7149. 'title,tr,track',
  7150. true
  7151. );
  7152. // this map is intentionally selective, only covering SVG elements that may
  7153. // contain child elements.
  7154. var isSVG = makeMap(
  7155. 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font,' +
  7156. 'font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  7157. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
  7158. true
  7159. );
  7160. var isReservedTag = function (tag) {
  7161. return isHTMLTag(tag) || isSVG(tag)
  7162. };
  7163. function getTagNamespace (tag) {
  7164. if (isSVG(tag)) {
  7165. return 'svg'
  7166. }
  7167. // basic support for MathML
  7168. // note it doesn't support other MathML elements being component roots
  7169. if (tag === 'math') {
  7170. return 'math'
  7171. }
  7172. }
  7173. var unknownElementCache = Object.create(null);
  7174. function isUnknownElement (tag) {
  7175. /* istanbul ignore if */
  7176. if (!inBrowser) {
  7177. return true
  7178. }
  7179. if (isReservedTag(tag)) {
  7180. return false
  7181. }
  7182. tag = tag.toLowerCase();
  7183. /* istanbul ignore if */
  7184. if (unknownElementCache[tag] != null) {
  7185. return unknownElementCache[tag]
  7186. }
  7187. var el = document.createElement(tag);
  7188. if (tag.indexOf('-') > -1) {
  7189. // http://stackoverflow.com/a/28210364/1070244
  7190. return (unknownElementCache[tag] = (
  7191. el.constructor === window.HTMLUnknownElement ||
  7192. el.constructor === window.HTMLElement
  7193. ))
  7194. } else {
  7195. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
  7196. }
  7197. }
  7198. /* */
  7199. /**
  7200. * Query an element selector if it's not an element already.
  7201. */
  7202. function query (el) {
  7203. if (typeof el === 'string') {
  7204. var selector = el;
  7205. el = document.querySelector(el);
  7206. if (!el) {
  7207. process.env.NODE_ENV !== 'production' && warn(
  7208. 'Cannot find element: ' + selector
  7209. );
  7210. return document.createElement('div')
  7211. }
  7212. }
  7213. return el
  7214. }
  7215. /* */
  7216. function createElement$1 (tagName, vnode) {
  7217. var elm = document.createElement(tagName);
  7218. if (tagName !== 'select') {
  7219. return elm
  7220. }
  7221. if (vnode.data && vnode.data.attrs && 'multiple' in vnode.data.attrs) {
  7222. elm.setAttribute('multiple', 'multiple');
  7223. }
  7224. return elm
  7225. }
  7226. function createElementNS (namespace, tagName) {
  7227. return document.createElementNS(namespaceMap[namespace], tagName)
  7228. }
  7229. function createTextNode (text) {
  7230. return document.createTextNode(text)
  7231. }
  7232. function createComment (text) {
  7233. return document.createComment(text)
  7234. }
  7235. function insertBefore (parentNode, newNode, referenceNode) {
  7236. parentNode.insertBefore(newNode, referenceNode);
  7237. }
  7238. function removeChild (node, child) {
  7239. node.removeChild(child);
  7240. }
  7241. function appendChild (node, child) {
  7242. node.appendChild(child);
  7243. }
  7244. function parentNode (node) {
  7245. return node.parentNode
  7246. }
  7247. function nextSibling (node) {
  7248. return node.nextSibling
  7249. }
  7250. function tagName (node) {
  7251. return node.tagName
  7252. }
  7253. function setTextContent (node, text) {
  7254. node.textContent = text;
  7255. }
  7256. function childNodes (node) {
  7257. return node.childNodes
  7258. }
  7259. function setAttribute (node, key, val) {
  7260. node.setAttribute(key, val);
  7261. }
  7262. var nodeOps = Object.freeze({
  7263. createElement: createElement$1,
  7264. createElementNS: createElementNS,
  7265. createTextNode: createTextNode,
  7266. createComment: createComment,
  7267. insertBefore: insertBefore,
  7268. removeChild: removeChild,
  7269. appendChild: appendChild,
  7270. parentNode: parentNode,
  7271. nextSibling: nextSibling,
  7272. tagName: tagName,
  7273. setTextContent: setTextContent,
  7274. childNodes: childNodes,
  7275. setAttribute: setAttribute
  7276. });
  7277. /* */
  7278. var ref = {
  7279. create: function create (_, vnode) {
  7280. registerRef(vnode);
  7281. },
  7282. update: function update (oldVnode, vnode) {
  7283. if (oldVnode.data.ref !== vnode.data.ref) {
  7284. registerRef(oldVnode, true);
  7285. registerRef(vnode);
  7286. }
  7287. },
  7288. destroy: function destroy (vnode) {
  7289. registerRef(vnode, true);
  7290. }
  7291. };
  7292. function registerRef (vnode, isRemoval) {
  7293. var key = vnode.data.ref;
  7294. if (!key) { return }
  7295. var vm = vnode.context;
  7296. var ref = vnode.child || vnode.elm;
  7297. var refs = vm.$refs;
  7298. if (isRemoval) {
  7299. if (Array.isArray(refs[key])) {
  7300. remove$1(refs[key], ref);
  7301. } else if (refs[key] === ref) {
  7302. refs[key] = undefined;
  7303. }
  7304. } else {
  7305. if (vnode.data.refInFor) {
  7306. if (Array.isArray(refs[key])) {
  7307. refs[key].push(ref);
  7308. } else {
  7309. refs[key] = [ref];
  7310. }
  7311. } else {
  7312. refs[key] = ref;
  7313. }
  7314. }
  7315. }
  7316. /**
  7317. * Virtual DOM patching algorithm based on Snabbdom by
  7318. * Simon Friis Vindum (@paldepind)
  7319. * Licensed under the MIT License
  7320. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  7321. *
  7322. * modified by Evan You (@yyx990803)
  7323. *
  7324. /*
  7325. * Not type-checking this because this file is perf-critical and the cost
  7326. * of making flow understand it is not worth it.
  7327. */
  7328. var emptyNode = new VNode('', {}, []);
  7329. var hooks$1 = ['create', 'update', 'remove', 'destroy'];
  7330. function isUndef (s) {
  7331. return s == null
  7332. }
  7333. function isDef (s) {
  7334. return s != null
  7335. }
  7336. function sameVnode (vnode1, vnode2) {
  7337. return (
  7338. vnode1.key === vnode2.key &&
  7339. vnode1.tag === vnode2.tag &&
  7340. vnode1.isComment === vnode2.isComment &&
  7341. !vnode1.data === !vnode2.data
  7342. )
  7343. }
  7344. function createKeyToOldIdx (children, beginIdx, endIdx) {
  7345. var i, key;
  7346. var map = {};
  7347. for (i = beginIdx; i <= endIdx; ++i) {
  7348. key = children[i].key;
  7349. if (isDef(key)) { map[key] = i; }
  7350. }
  7351. return map
  7352. }
  7353. function createPatchFunction (backend) {
  7354. var i, j;
  7355. var cbs = {};
  7356. var modules = backend.modules;
  7357. var nodeOps = backend.nodeOps;
  7358. for (i = 0; i < hooks$1.length; ++i) {
  7359. cbs[hooks$1[i]] = [];
  7360. for (j = 0; j < modules.length; ++j) {
  7361. if (modules[j][hooks$1[i]] !== undefined) { cbs[hooks$1[i]].push(modules[j][hooks$1[i]]); }
  7362. }
  7363. }
  7364. function emptyNodeAt (elm) {
  7365. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
  7366. }
  7367. function createRmCb (childElm, listeners) {
  7368. function remove$$1 () {
  7369. if (--remove$$1.listeners === 0) {
  7370. removeElement(childElm);
  7371. }
  7372. }
  7373. remove$$1.listeners = listeners;
  7374. return remove$$1
  7375. }
  7376. function removeElement (el) {
  7377. var parent = nodeOps.parentNode(el);
  7378. // element may have already been removed due to v-html
  7379. if (parent) {
  7380. nodeOps.removeChild(parent, el);
  7381. }
  7382. }
  7383. function createElm (vnode, insertedVnodeQueue, nested) {
  7384. var i;
  7385. var data = vnode.data;
  7386. vnode.isRootInsert = !nested;
  7387. if (isDef(data)) {
  7388. if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode); }
  7389. // after calling the init hook, if the vnode is a child component
  7390. // it should've created a child instance and mounted it. the child
  7391. // component also has set the placeholder vnode's elm.
  7392. // in that case we can just return the element and be done.
  7393. if (isDef(i = vnode.child)) {
  7394. initComponent(vnode, insertedVnodeQueue);
  7395. return vnode.elm
  7396. }
  7397. }
  7398. var children = vnode.children;
  7399. var tag = vnode.tag;
  7400. if (isDef(tag)) {
  7401. if (process.env.NODE_ENV !== 'production') {
  7402. if (
  7403. !vnode.ns &&
  7404. !(config.ignoredElements && config.ignoredElements.indexOf(tag) > -1) &&
  7405. config.isUnknownElement(tag)
  7406. ) {
  7407. warn(
  7408. 'Unknown custom element: <' + tag + '> - did you ' +
  7409. 'register the component correctly? For recursive components, ' +
  7410. 'make sure to provide the "name" option.',
  7411. vnode.context
  7412. );
  7413. }
  7414. }
  7415. vnode.elm = vnode.ns
  7416. ? nodeOps.createElementNS(vnode.ns, tag)
  7417. : nodeOps.createElement(tag, vnode);
  7418. setScope(vnode);
  7419. createChildren(vnode, children, insertedVnodeQueue);
  7420. if (isDef(data)) {
  7421. invokeCreateHooks(vnode, insertedVnodeQueue);
  7422. }
  7423. } else if (vnode.isComment) {
  7424. vnode.elm = nodeOps.createComment(vnode.text);
  7425. } else {
  7426. vnode.elm = nodeOps.createTextNode(vnode.text);
  7427. }
  7428. return vnode.elm
  7429. }
  7430. function createChildren (vnode, children, insertedVnodeQueue) {
  7431. if (Array.isArray(children)) {
  7432. for (var i = 0; i < children.length; ++i) {
  7433. nodeOps.appendChild(vnode.elm, createElm(children[i], insertedVnodeQueue, true));
  7434. }
  7435. } else if (isPrimitive(vnode.text)) {
  7436. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));
  7437. }
  7438. }
  7439. function isPatchable (vnode) {
  7440. while (vnode.child) {
  7441. vnode = vnode.child._vnode;
  7442. }
  7443. return isDef(vnode.tag)
  7444. }
  7445. function invokeCreateHooks (vnode, insertedVnodeQueue) {
  7446. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  7447. cbs.create[i$1](emptyNode, vnode);
  7448. }
  7449. i = vnode.data.hook; // Reuse variable
  7450. if (isDef(i)) {
  7451. if (i.create) { i.create(emptyNode, vnode); }
  7452. if (i.insert) { insertedVnodeQueue.push(vnode); }
  7453. }
  7454. }
  7455. function initComponent (vnode, insertedVnodeQueue) {
  7456. if (vnode.data.pendingInsert) {
  7457. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  7458. }
  7459. vnode.elm = vnode.child.$el;
  7460. if (isPatchable(vnode)) {
  7461. invokeCreateHooks(vnode, insertedVnodeQueue);
  7462. setScope(vnode);
  7463. } else {
  7464. // empty component root.
  7465. // skip all element-related modules except for ref (#3455)
  7466. registerRef(vnode);
  7467. // make sure to invoke the insert hook
  7468. insertedVnodeQueue.push(vnode);
  7469. }
  7470. }
  7471. // set scope id attribute for scoped CSS.
  7472. // this is implemented as a special case to avoid the overhead
  7473. // of going through the normal attribute patching process.
  7474. function setScope (vnode) {
  7475. var i;
  7476. if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {
  7477. nodeOps.setAttribute(vnode.elm, i, '');
  7478. }
  7479. if (isDef(i = activeInstance) &&
  7480. i !== vnode.context &&
  7481. isDef(i = i.$options._scopeId)) {
  7482. nodeOps.setAttribute(vnode.elm, i, '');
  7483. }
  7484. }
  7485. function addVnodes (parentElm, before, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  7486. for (; startIdx <= endIdx; ++startIdx) {
  7487. nodeOps.insertBefore(parentElm, createElm(vnodes[startIdx], insertedVnodeQueue), before);
  7488. }
  7489. }
  7490. function invokeDestroyHook (vnode) {
  7491. var i, j;
  7492. var data = vnode.data;
  7493. if (isDef(data)) {
  7494. if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
  7495. for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
  7496. }
  7497. if (isDef(i = vnode.children)) {
  7498. for (j = 0; j < vnode.children.length; ++j) {
  7499. invokeDestroyHook(vnode.children[j]);
  7500. }
  7501. }
  7502. }
  7503. function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
  7504. for (; startIdx <= endIdx; ++startIdx) {
  7505. var ch = vnodes[startIdx];
  7506. if (isDef(ch)) {
  7507. if (isDef(ch.tag)) {
  7508. removeAndInvokeRemoveHook(ch);
  7509. invokeDestroyHook(ch);
  7510. } else { // Text node
  7511. nodeOps.removeChild(parentElm, ch.elm);
  7512. }
  7513. }
  7514. }
  7515. }
  7516. function removeAndInvokeRemoveHook (vnode, rm) {
  7517. if (rm || isDef(vnode.data)) {
  7518. var listeners = cbs.remove.length + 1;
  7519. if (!rm) {
  7520. // directly removing
  7521. rm = createRmCb(vnode.elm, listeners);
  7522. } else {
  7523. // we have a recursively passed down rm callback
  7524. // increase the listeners count
  7525. rm.listeners += listeners;
  7526. }
  7527. // recursively invoke hooks on child component root node
  7528. if (isDef(i = vnode.child) && isDef(i = i._vnode) && isDef(i.data)) {
  7529. removeAndInvokeRemoveHook(i, rm);
  7530. }
  7531. for (i = 0; i < cbs.remove.length; ++i) {
  7532. cbs.remove[i](vnode, rm);
  7533. }
  7534. if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
  7535. i(vnode, rm);
  7536. } else {
  7537. rm();
  7538. }
  7539. } else {
  7540. removeElement(vnode.elm);
  7541. }
  7542. }
  7543. function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  7544. var oldStartIdx = 0;
  7545. var newStartIdx = 0;
  7546. var oldEndIdx = oldCh.length - 1;
  7547. var oldStartVnode = oldCh[0];
  7548. var oldEndVnode = oldCh[oldEndIdx];
  7549. var newEndIdx = newCh.length - 1;
  7550. var newStartVnode = newCh[0];
  7551. var newEndVnode = newCh[newEndIdx];
  7552. var oldKeyToIdx, idxInOld, elmToMove, before;
  7553. // removeOnly is a special flag used only by <transition-group>
  7554. // to ensure removed elements stay in correct relative positions
  7555. // during leaving transitions
  7556. var canMove = !removeOnly;
  7557. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  7558. if (isUndef(oldStartVnode)) {
  7559. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  7560. } else if (isUndef(oldEndVnode)) {
  7561. oldEndVnode = oldCh[--oldEndIdx];
  7562. } else if (sameVnode(oldStartVnode, newStartVnode)) {
  7563. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);
  7564. oldStartVnode = oldCh[++oldStartIdx];
  7565. newStartVnode = newCh[++newStartIdx];
  7566. } else if (sameVnode(oldEndVnode, newEndVnode)) {
  7567. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);
  7568. oldEndVnode = oldCh[--oldEndIdx];
  7569. newEndVnode = newCh[--newEndIdx];
  7570. } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
  7571. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);
  7572. canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  7573. oldStartVnode = oldCh[++oldStartIdx];
  7574. newEndVnode = newCh[--newEndIdx];
  7575. } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
  7576. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);
  7577. canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  7578. oldEndVnode = oldCh[--oldEndIdx];
  7579. newStartVnode = newCh[++newStartIdx];
  7580. } else {
  7581. if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
  7582. idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : null;
  7583. if (isUndef(idxInOld)) { // New element
  7584. nodeOps.insertBefore(parentElm, createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm);
  7585. newStartVnode = newCh[++newStartIdx];
  7586. } else {
  7587. elmToMove = oldCh[idxInOld];
  7588. /* istanbul ignore if */
  7589. if (process.env.NODE_ENV !== 'production' && !elmToMove) {
  7590. warn(
  7591. 'It seems there are duplicate keys that is causing an update error. ' +
  7592. 'Make sure each v-for item has a unique key.'
  7593. );
  7594. }
  7595. if (elmToMove.tag !== newStartVnode.tag) {
  7596. // same key but different element. treat as new element
  7597. nodeOps.insertBefore(parentElm, createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm);
  7598. newStartVnode = newCh[++newStartIdx];
  7599. } else {
  7600. patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);
  7601. oldCh[idxInOld] = undefined;
  7602. canMove && nodeOps.insertBefore(parentElm, newStartVnode.elm, oldStartVnode.elm);
  7603. newStartVnode = newCh[++newStartIdx];
  7604. }
  7605. }
  7606. }
  7607. }
  7608. if (oldStartIdx > oldEndIdx) {
  7609. before = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  7610. addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  7611. } else if (newStartIdx > newEndIdx) {
  7612. removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
  7613. }
  7614. }
  7615. function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {
  7616. if (oldVnode === vnode) {
  7617. return
  7618. }
  7619. // reuse element for static trees.
  7620. // note we only do this if the vnode is cloned -
  7621. // if the new node is not cloned it means the render functions have been
  7622. // reset by the hot-reload-api and we need to do a proper re-render.
  7623. if (vnode.isStatic &&
  7624. oldVnode.isStatic &&
  7625. vnode.key === oldVnode.key &&
  7626. (vnode.isCloned || vnode.isOnce)) {
  7627. vnode.elm = oldVnode.elm;
  7628. return
  7629. }
  7630. var i;
  7631. var data = vnode.data;
  7632. var hasData = isDef(data);
  7633. if (hasData && isDef(i = data.hook) && isDef(i = i.prepatch)) {
  7634. i(oldVnode, vnode);
  7635. }
  7636. var elm = vnode.elm = oldVnode.elm;
  7637. var oldCh = oldVnode.children;
  7638. var ch = vnode.children;
  7639. if (hasData && isPatchable(vnode)) {
  7640. for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
  7641. if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
  7642. }
  7643. if (isUndef(vnode.text)) {
  7644. if (isDef(oldCh) && isDef(ch)) {
  7645. if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
  7646. } else if (isDef(ch)) {
  7647. if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
  7648. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  7649. } else if (isDef(oldCh)) {
  7650. removeVnodes(elm, oldCh, 0, oldCh.length - 1);
  7651. } else if (isDef(oldVnode.text)) {
  7652. nodeOps.setTextContent(elm, '');
  7653. }
  7654. } else if (oldVnode.text !== vnode.text) {
  7655. nodeOps.setTextContent(elm, vnode.text);
  7656. }
  7657. if (hasData) {
  7658. if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
  7659. }
  7660. }
  7661. function invokeInsertHook (vnode, queue, initial) {
  7662. // delay insert hooks for component root nodes, invoke them after the
  7663. // element is really inserted
  7664. if (initial && vnode.parent) {
  7665. vnode.parent.data.pendingInsert = queue;
  7666. } else {
  7667. for (var i = 0; i < queue.length; ++i) {
  7668. queue[i].data.hook.insert(queue[i]);
  7669. }
  7670. }
  7671. }
  7672. var bailed = false;
  7673. function hydrate (elm, vnode, insertedVnodeQueue) {
  7674. if (process.env.NODE_ENV !== 'production') {
  7675. if (!assertNodeMatch(elm, vnode)) {
  7676. return false
  7677. }
  7678. }
  7679. vnode.elm = elm;
  7680. var tag = vnode.tag;
  7681. var data = vnode.data;
  7682. var children = vnode.children;
  7683. if (isDef(data)) {
  7684. if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
  7685. if (isDef(i = vnode.child)) {
  7686. // child component. it should have hydrated its own tree.
  7687. initComponent(vnode, insertedVnodeQueue);
  7688. return true
  7689. }
  7690. }
  7691. if (isDef(tag)) {
  7692. if (isDef(children)) {
  7693. var childNodes = nodeOps.childNodes(elm);
  7694. // empty element, allow client to pick up and populate children
  7695. if (!childNodes.length) {
  7696. createChildren(vnode, children, insertedVnodeQueue);
  7697. } else {
  7698. var childrenMatch = true;
  7699. if (childNodes.length !== children.length) {
  7700. childrenMatch = false;
  7701. } else {
  7702. for (var i$1 = 0; i$1 < children.length; i$1++) {
  7703. if (!hydrate(childNodes[i$1], children[i$1], insertedVnodeQueue)) {
  7704. childrenMatch = false;
  7705. break
  7706. }
  7707. }
  7708. }
  7709. if (!childrenMatch) {
  7710. if (process.env.NODE_ENV !== 'production' &&
  7711. typeof console !== 'undefined' &&
  7712. !bailed) {
  7713. bailed = true;
  7714. console.warn('Parent: ', elm);
  7715. console.warn('Mismatching childNodes vs. VNodes: ', childNodes, children);
  7716. }
  7717. return false
  7718. }
  7719. }
  7720. }
  7721. if (isDef(data)) {
  7722. invokeCreateHooks(vnode, insertedVnodeQueue);
  7723. }
  7724. }
  7725. return true
  7726. }
  7727. function assertNodeMatch (node, vnode) {
  7728. if (vnode.tag) {
  7729. return (
  7730. vnode.tag.indexOf('vue-component') === 0 ||
  7731. vnode.tag.toLowerCase() === nodeOps.tagName(node).toLowerCase()
  7732. )
  7733. } else {
  7734. return _toString(vnode.text) === node.data
  7735. }
  7736. }
  7737. return function patch (oldVnode, vnode, hydrating, removeOnly) {
  7738. if (!vnode) {
  7739. if (oldVnode) { invokeDestroyHook(oldVnode); }
  7740. return
  7741. }
  7742. var elm, parent;
  7743. var isInitialPatch = false;
  7744. var insertedVnodeQueue = [];
  7745. if (!oldVnode) {
  7746. // empty mount, create new root element
  7747. isInitialPatch = true;
  7748. createElm(vnode, insertedVnodeQueue);
  7749. } else {
  7750. var isRealElement = isDef(oldVnode.nodeType);
  7751. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  7752. patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);
  7753. } else {
  7754. if (isRealElement) {
  7755. // mounting to a real element
  7756. // check if this is server-rendered content and if we can perform
  7757. // a successful hydration.
  7758. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute('server-rendered')) {
  7759. oldVnode.removeAttribute('server-rendered');
  7760. hydrating = true;
  7761. }
  7762. if (hydrating) {
  7763. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  7764. invokeInsertHook(vnode, insertedVnodeQueue, true);
  7765. return oldVnode
  7766. } else if (process.env.NODE_ENV !== 'production') {
  7767. warn(
  7768. 'The client-side rendered virtual DOM tree is not matching ' +
  7769. 'server-rendered content. This is likely caused by incorrect ' +
  7770. 'HTML markup, for example nesting block-level elements inside ' +
  7771. '<p>, or missing <tbody>. Bailing hydration and performing ' +
  7772. 'full client-side render.'
  7773. );
  7774. }
  7775. }
  7776. // either not server-rendered, or hydration failed.
  7777. // create an empty node and replace it
  7778. oldVnode = emptyNodeAt(oldVnode);
  7779. }
  7780. elm = oldVnode.elm;
  7781. parent = nodeOps.parentNode(elm);
  7782. createElm(vnode, insertedVnodeQueue);
  7783. // component root element replaced.
  7784. // update parent placeholder node element.
  7785. if (vnode.parent) {
  7786. vnode.parent.elm = vnode.elm;
  7787. if (isPatchable(vnode)) {
  7788. for (var i = 0; i < cbs.create.length; ++i) {
  7789. cbs.create[i](emptyNode, vnode.parent);
  7790. }
  7791. }
  7792. }
  7793. if (parent !== null) {
  7794. nodeOps.insertBefore(parent, vnode.elm, nodeOps.nextSibling(elm));
  7795. removeVnodes(parent, [oldVnode], 0, 0);
  7796. } else if (isDef(oldVnode.tag)) {
  7797. invokeDestroyHook(oldVnode);
  7798. }
  7799. }
  7800. }
  7801. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  7802. return vnode.elm
  7803. }
  7804. }
  7805. /* */
  7806. var directives = {
  7807. create: updateDirectives,
  7808. update: updateDirectives,
  7809. destroy: function unbindDirectives (vnode) {
  7810. updateDirectives(vnode, emptyNode);
  7811. }
  7812. };
  7813. function updateDirectives (
  7814. oldVnode,
  7815. vnode
  7816. ) {
  7817. if (!oldVnode.data.directives && !vnode.data.directives) {
  7818. return
  7819. }
  7820. var isCreate = oldVnode === emptyNode;
  7821. var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
  7822. var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
  7823. var dirsWithInsert = [];
  7824. var dirsWithPostpatch = [];
  7825. var key, oldDir, dir;
  7826. for (key in newDirs) {
  7827. oldDir = oldDirs[key];
  7828. dir = newDirs[key];
  7829. if (!oldDir) {
  7830. // new directive, bind
  7831. callHook$1(dir, 'bind', vnode, oldVnode);
  7832. if (dir.def && dir.def.inserted) {
  7833. dirsWithInsert.push(dir);
  7834. }
  7835. } else {
  7836. // existing directive, update
  7837. dir.oldValue = oldDir.value;
  7838. callHook$1(dir, 'update', vnode, oldVnode);
  7839. if (dir.def && dir.def.componentUpdated) {
  7840. dirsWithPostpatch.push(dir);
  7841. }
  7842. }
  7843. }
  7844. if (dirsWithInsert.length) {
  7845. var callInsert = function () {
  7846. dirsWithInsert.forEach(function (dir) {
  7847. callHook$1(dir, 'inserted', vnode, oldVnode);
  7848. });
  7849. };
  7850. if (isCreate) {
  7851. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert, 'dir-insert');
  7852. } else {
  7853. callInsert();
  7854. }
  7855. }
  7856. if (dirsWithPostpatch.length) {
  7857. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () {
  7858. dirsWithPostpatch.forEach(function (dir) {
  7859. callHook$1(dir, 'componentUpdated', vnode, oldVnode);
  7860. });
  7861. }, 'dir-postpatch');
  7862. }
  7863. if (!isCreate) {
  7864. for (key in oldDirs) {
  7865. if (!newDirs[key]) {
  7866. // no longer present, unbind
  7867. callHook$1(oldDirs[key], 'unbind', oldVnode);
  7868. }
  7869. }
  7870. }
  7871. }
  7872. var emptyModifiers = Object.create(null);
  7873. function normalizeDirectives$1 (
  7874. dirs,
  7875. vm
  7876. ) {
  7877. var res = Object.create(null);
  7878. if (!dirs) {
  7879. return res
  7880. }
  7881. var i, dir;
  7882. for (i = 0; i < dirs.length; i++) {
  7883. dir = dirs[i];
  7884. if (!dir.modifiers) {
  7885. dir.modifiers = emptyModifiers;
  7886. }
  7887. res[getRawDirName(dir)] = dir;
  7888. dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
  7889. }
  7890. return res
  7891. }
  7892. function getRawDirName (dir) {
  7893. return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
  7894. }
  7895. function callHook$1 (dir, hook, vnode, oldVnode) {
  7896. var fn = dir.def && dir.def[hook];
  7897. if (fn) {
  7898. fn(vnode.elm, dir, vnode, oldVnode);
  7899. }
  7900. }
  7901. var baseModules = [
  7902. ref,
  7903. directives
  7904. ];
  7905. /* */
  7906. function updateAttrs (oldVnode, vnode) {
  7907. if (!oldVnode.data.attrs && !vnode.data.attrs) {
  7908. return
  7909. }
  7910. var key, cur, old;
  7911. var elm = vnode.elm;
  7912. var oldAttrs = oldVnode.data.attrs || {};
  7913. var attrs = vnode.data.attrs || {};
  7914. // clone observed objects, as the user probably wants to mutate it
  7915. if (attrs.__ob__) {
  7916. attrs = vnode.data.attrs = extend({}, attrs);
  7917. }
  7918. for (key in attrs) {
  7919. cur = attrs[key];
  7920. old = oldAttrs[key];
  7921. if (old !== cur) {
  7922. setAttr(elm, key, cur);
  7923. }
  7924. }
  7925. for (key in oldAttrs) {
  7926. if (attrs[key] == null) {
  7927. if (isXlink(key)) {
  7928. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  7929. } else if (!isEnumeratedAttr(key)) {
  7930. elm.removeAttribute(key);
  7931. }
  7932. }
  7933. }
  7934. }
  7935. function setAttr (el, key, value) {
  7936. if (isBooleanAttr(key)) {
  7937. // set attribute for blank value
  7938. // e.g. <option disabled>Select one</option>
  7939. if (isFalsyAttrValue(value)) {
  7940. el.removeAttribute(key);
  7941. } else {
  7942. el.setAttribute(key, key);
  7943. }
  7944. } else if (isEnumeratedAttr(key)) {
  7945. el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');
  7946. } else if (isXlink(key)) {
  7947. if (isFalsyAttrValue(value)) {
  7948. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  7949. } else {
  7950. el.setAttributeNS(xlinkNS, key, value);
  7951. }
  7952. } else {
  7953. if (isFalsyAttrValue(value)) {
  7954. el.removeAttribute(key);
  7955. } else {
  7956. el.setAttribute(key, value);
  7957. }
  7958. }
  7959. }
  7960. var attrs = {
  7961. create: updateAttrs,
  7962. update: updateAttrs
  7963. };
  7964. /* */
  7965. function updateClass (oldVnode, vnode) {
  7966. var el = vnode.elm;
  7967. var data = vnode.data;
  7968. var oldData = oldVnode.data;
  7969. if (!data.staticClass && !data.class &&
  7970. (!oldData || (!oldData.staticClass && !oldData.class))) {
  7971. return
  7972. }
  7973. var cls = genClassForVnode(vnode);
  7974. // handle transition classes
  7975. var transitionClass = el._transitionClasses;
  7976. if (transitionClass) {
  7977. cls = concat(cls, stringifyClass(transitionClass));
  7978. }
  7979. // set the class
  7980. if (cls !== el._prevClass) {
  7981. el.setAttribute('class', cls);
  7982. el._prevClass = cls;
  7983. }
  7984. }
  7985. var klass = {
  7986. create: updateClass,
  7987. update: updateClass
  7988. };
  7989. // skip type checking this file because we need to attach private properties
  7990. // to elements
  7991. function updateDOMListeners (oldVnode, vnode) {
  7992. if (!oldVnode.data.on && !vnode.data.on) {
  7993. return
  7994. }
  7995. var on = vnode.data.on || {};
  7996. var oldOn = oldVnode.data.on || {};
  7997. var add = vnode.elm._v_add || (vnode.elm._v_add = function (event, handler, capture) {
  7998. vnode.elm.addEventListener(event, handler, capture);
  7999. });
  8000. var remove = vnode.elm._v_remove || (vnode.elm._v_remove = function (event, handler) {
  8001. vnode.elm.removeEventListener(event, handler);
  8002. });
  8003. updateListeners(on, oldOn, add, remove, vnode.context);
  8004. }
  8005. var events = {
  8006. create: updateDOMListeners,
  8007. update: updateDOMListeners
  8008. };
  8009. /* */
  8010. function updateDOMProps (oldVnode, vnode) {
  8011. if (!oldVnode.data.domProps && !vnode.data.domProps) {
  8012. return
  8013. }
  8014. var key, cur;
  8015. var elm = vnode.elm;
  8016. var oldProps = oldVnode.data.domProps || {};
  8017. var props = vnode.data.domProps || {};
  8018. // clone observed objects, as the user probably wants to mutate it
  8019. if (props.__ob__) {
  8020. props = vnode.data.domProps = extend({}, props);
  8021. }
  8022. for (key in oldProps) {
  8023. if (props[key] == null) {
  8024. elm[key] = '';
  8025. }
  8026. }
  8027. for (key in props) {
  8028. // ignore children if the node has textContent or innerHTML,
  8029. // as these will throw away existing DOM nodes and cause removal errors
  8030. // on subsequent patches (#3360)
  8031. if ((key === 'textContent' || key === 'innerHTML') && vnode.children) {
  8032. vnode.children.length = 0;
  8033. }
  8034. cur = props[key];
  8035. if (key === 'value') {
  8036. // store value as _value as well since
  8037. // non-string values will be stringified
  8038. elm._value = cur;
  8039. // avoid resetting cursor position when value is the same
  8040. var strCur = cur == null ? '' : String(cur);
  8041. if (elm.value !== strCur && !elm.composing) {
  8042. elm.value = strCur;
  8043. }
  8044. } else {
  8045. elm[key] = cur;
  8046. }
  8047. }
  8048. }
  8049. var domProps = {
  8050. create: updateDOMProps,
  8051. update: updateDOMProps
  8052. };
  8053. /* */
  8054. var parseStyleText = cached(function (cssText) {
  8055. var res = {};
  8056. var hasBackground = cssText.indexOf('background') >= 0;
  8057. // maybe with background-image: url(http://xxx) or base64 img
  8058. var listDelimiter = hasBackground ? /;(?![^(]*\))/g : ';';
  8059. var propertyDelimiter = hasBackground ? /:(.+)/ : ':';
  8060. cssText.split(listDelimiter).forEach(function (item) {
  8061. if (item) {
  8062. var tmp = item.split(propertyDelimiter);
  8063. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8064. }
  8065. });
  8066. return res
  8067. });
  8068. // merge static and dynamic style data on the same vnode
  8069. function normalizeStyleData (data) {
  8070. var style = normalizeStyleBinding(data.style);
  8071. // static style is pre-processed into an object during compilation
  8072. // and is always a fresh object, so it's safe to merge into it
  8073. return data.staticStyle
  8074. ? extend(data.staticStyle, style)
  8075. : style
  8076. }
  8077. // normalize possible array / string values into Object
  8078. function normalizeStyleBinding (bindingStyle) {
  8079. if (Array.isArray(bindingStyle)) {
  8080. return toObject(bindingStyle)
  8081. }
  8082. if (typeof bindingStyle === 'string') {
  8083. return parseStyleText(bindingStyle)
  8084. }
  8085. return bindingStyle
  8086. }
  8087. /**
  8088. * parent component style should be after child's
  8089. * so that parent component's style could override it
  8090. */
  8091. function getStyle (vnode, checkChild) {
  8092. var res = {};
  8093. var styleData;
  8094. if (checkChild) {
  8095. var childNode = vnode;
  8096. while (childNode.child) {
  8097. childNode = childNode.child._vnode;
  8098. if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {
  8099. extend(res, styleData);
  8100. }
  8101. }
  8102. }
  8103. if ((styleData = normalizeStyleData(vnode.data))) {
  8104. extend(res, styleData);
  8105. }
  8106. var parentNode = vnode;
  8107. while ((parentNode = parentNode.parent)) {
  8108. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  8109. extend(res, styleData);
  8110. }
  8111. }
  8112. return res
  8113. }
  8114. /* */
  8115. var cssVarRE = /^--/;
  8116. var setProp = function (el, name, val) {
  8117. /* istanbul ignore if */
  8118. if (cssVarRE.test(name)) {
  8119. el.style.setProperty(name, val);
  8120. } else {
  8121. el.style[normalize(name)] = val;
  8122. }
  8123. };
  8124. var prefixes = ['Webkit', 'Moz', 'ms'];
  8125. var testEl;
  8126. var normalize = cached(function (prop) {
  8127. testEl = testEl || document.createElement('div');
  8128. prop = camelize(prop);
  8129. if (prop !== 'filter' && (prop in testEl.style)) {
  8130. return prop
  8131. }
  8132. var upper = prop.charAt(0).toUpperCase() + prop.slice(1);
  8133. for (var i = 0; i < prefixes.length; i++) {
  8134. var prefixed = prefixes[i] + upper;
  8135. if (prefixed in testEl.style) {
  8136. return prefixed
  8137. }
  8138. }
  8139. });
  8140. function updateStyle (oldVnode, vnode) {
  8141. var data = vnode.data;
  8142. var oldData = oldVnode.data;
  8143. if (!data.staticStyle && !data.style &&
  8144. !oldData.staticStyle && !oldData.style) {
  8145. return
  8146. }
  8147. var cur, name;
  8148. var el = vnode.elm;
  8149. var oldStyle = oldVnode.data.style || {};
  8150. var style = normalizeStyleBinding(vnode.data.style) || {};
  8151. vnode.data.style = style.__ob__ ? extend({}, style) : style;
  8152. var newStyle = getStyle(vnode, true);
  8153. for (name in oldStyle) {
  8154. if (newStyle[name] == null) {
  8155. setProp(el, name, '');
  8156. }
  8157. }
  8158. for (name in newStyle) {
  8159. cur = newStyle[name];
  8160. if (cur !== oldStyle[name]) {
  8161. // ie9 setting to null has no effect, must use empty string
  8162. setProp(el, name, cur == null ? '' : cur);
  8163. }
  8164. }
  8165. }
  8166. var style = {
  8167. create: updateStyle,
  8168. update: updateStyle
  8169. };
  8170. /* */
  8171. /**
  8172. * Add class with compatibility for SVG since classList is not supported on
  8173. * SVG elements in IE
  8174. */
  8175. function addClass (el, cls) {
  8176. /* istanbul ignore if */
  8177. if (!cls || !cls.trim()) {
  8178. return
  8179. }
  8180. /* istanbul ignore else */
  8181. if (el.classList) {
  8182. if (cls.indexOf(' ') > -1) {
  8183. cls.split(/\s+/).forEach(function (c) { return el.classList.add(c); });
  8184. } else {
  8185. el.classList.add(cls);
  8186. }
  8187. } else {
  8188. var cur = ' ' + el.getAttribute('class') + ' ';
  8189. if (cur.indexOf(' ' + cls + ' ') < 0) {
  8190. el.setAttribute('class', (cur + cls).trim());
  8191. }
  8192. }
  8193. }
  8194. /**
  8195. * Remove class with compatibility for SVG since classList is not supported on
  8196. * SVG elements in IE
  8197. */
  8198. function removeClass (el, cls) {
  8199. /* istanbul ignore if */
  8200. if (!cls || !cls.trim()) {
  8201. return
  8202. }
  8203. /* istanbul ignore else */
  8204. if (el.classList) {
  8205. if (cls.indexOf(' ') > -1) {
  8206. cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); });
  8207. } else {
  8208. el.classList.remove(cls);
  8209. }
  8210. } else {
  8211. var cur = ' ' + el.getAttribute('class') + ' ';
  8212. var tar = ' ' + cls + ' ';
  8213. while (cur.indexOf(tar) >= 0) {
  8214. cur = cur.replace(tar, ' ');
  8215. }
  8216. el.setAttribute('class', cur.trim());
  8217. }
  8218. }
  8219. /* */
  8220. var hasTransition = inBrowser && !isIE9;
  8221. var TRANSITION = 'transition';
  8222. var ANIMATION = 'animation';
  8223. // Transition property/event sniffing
  8224. var transitionProp = 'transition';
  8225. var transitionEndEvent = 'transitionend';
  8226. var animationProp = 'animation';
  8227. var animationEndEvent = 'animationend';
  8228. if (hasTransition) {
  8229. /* istanbul ignore if */
  8230. if (window.ontransitionend === undefined &&
  8231. window.onwebkittransitionend !== undefined) {
  8232. transitionProp = 'WebkitTransition';
  8233. transitionEndEvent = 'webkitTransitionEnd';
  8234. }
  8235. if (window.onanimationend === undefined &&
  8236. window.onwebkitanimationend !== undefined) {
  8237. animationProp = 'WebkitAnimation';
  8238. animationEndEvent = 'webkitAnimationEnd';
  8239. }
  8240. }
  8241. var raf = (inBrowser && window.requestAnimationFrame) || setTimeout;
  8242. function nextFrame (fn) {
  8243. raf(function () {
  8244. raf(fn);
  8245. });
  8246. }
  8247. function addTransitionClass (el, cls) {
  8248. (el._transitionClasses || (el._transitionClasses = [])).push(cls);
  8249. addClass(el, cls);
  8250. }
  8251. function removeTransitionClass (el, cls) {
  8252. if (el._transitionClasses) {
  8253. remove$1(el._transitionClasses, cls);
  8254. }
  8255. removeClass(el, cls);
  8256. }
  8257. function whenTransitionEnds (
  8258. el,
  8259. expectedType,
  8260. cb
  8261. ) {
  8262. var ref = getTransitionInfo(el, expectedType);
  8263. var type = ref.type;
  8264. var timeout = ref.timeout;
  8265. var propCount = ref.propCount;
  8266. if (!type) { return cb() }
  8267. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  8268. var ended = 0;
  8269. var end = function () {
  8270. el.removeEventListener(event, onEnd);
  8271. cb();
  8272. };
  8273. var onEnd = function (e) {
  8274. if (e.target === el) {
  8275. if (++ended >= propCount) {
  8276. end();
  8277. }
  8278. }
  8279. };
  8280. setTimeout(function () {
  8281. if (ended < propCount) {
  8282. end();
  8283. }
  8284. }, timeout + 1);
  8285. el.addEventListener(event, onEnd);
  8286. }
  8287. var transformRE = /\b(transform|all)(,|$)/;
  8288. function getTransitionInfo (el, expectedType) {
  8289. var styles = window.getComputedStyle(el);
  8290. var transitioneDelays = styles[transitionProp + 'Delay'].split(', ');
  8291. var transitionDurations = styles[transitionProp + 'Duration'].split(', ');
  8292. var transitionTimeout = getTimeout(transitioneDelays, transitionDurations);
  8293. var animationDelays = styles[animationProp + 'Delay'].split(', ');
  8294. var animationDurations = styles[animationProp + 'Duration'].split(', ');
  8295. var animationTimeout = getTimeout(animationDelays, animationDurations);
  8296. var type;
  8297. var timeout = 0;
  8298. var propCount = 0;
  8299. /* istanbul ignore if */
  8300. if (expectedType === TRANSITION) {
  8301. if (transitionTimeout > 0) {
  8302. type = TRANSITION;
  8303. timeout = transitionTimeout;
  8304. propCount = transitionDurations.length;
  8305. }
  8306. } else if (expectedType === ANIMATION) {
  8307. if (animationTimeout > 0) {
  8308. type = ANIMATION;
  8309. timeout = animationTimeout;
  8310. propCount = animationDurations.length;
  8311. }
  8312. } else {
  8313. timeout = Math.max(transitionTimeout, animationTimeout);
  8314. type = timeout > 0
  8315. ? transitionTimeout > animationTimeout
  8316. ? TRANSITION
  8317. : ANIMATION
  8318. : null;
  8319. propCount = type
  8320. ? type === TRANSITION
  8321. ? transitionDurations.length
  8322. : animationDurations.length
  8323. : 0;
  8324. }
  8325. var hasTransform =
  8326. type === TRANSITION &&
  8327. transformRE.test(styles[transitionProp + 'Property']);
  8328. return {
  8329. type: type,
  8330. timeout: timeout,
  8331. propCount: propCount,
  8332. hasTransform: hasTransform
  8333. }
  8334. }
  8335. function getTimeout (delays, durations) {
  8336. /* istanbul ignore next */
  8337. while (delays.length < durations.length) {
  8338. delays = delays.concat(delays);
  8339. }
  8340. return Math.max.apply(null, durations.map(function (d, i) {
  8341. return toMs(d) + toMs(delays[i])
  8342. }))
  8343. }
  8344. function toMs (s) {
  8345. return Number(s.slice(0, -1)) * 1000
  8346. }
  8347. /* */
  8348. function enter (vnode) {
  8349. var el = vnode.elm;
  8350. // call leave callback now
  8351. if (el._leaveCb) {
  8352. el._leaveCb.cancelled = true;
  8353. el._leaveCb();
  8354. }
  8355. var data = resolveTransition(vnode.data.transition);
  8356. if (!data) {
  8357. return
  8358. }
  8359. /* istanbul ignore if */
  8360. if (el._enterCb || el.nodeType !== 1) {
  8361. return
  8362. }
  8363. var css = data.css;
  8364. var type = data.type;
  8365. var enterClass = data.enterClass;
  8366. var enterActiveClass = data.enterActiveClass;
  8367. var appearClass = data.appearClass;
  8368. var appearActiveClass = data.appearActiveClass;
  8369. var beforeEnter = data.beforeEnter;
  8370. var enter = data.enter;
  8371. var afterEnter = data.afterEnter;
  8372. var enterCancelled = data.enterCancelled;
  8373. var beforeAppear = data.beforeAppear;
  8374. var appear = data.appear;
  8375. var afterAppear = data.afterAppear;
  8376. var appearCancelled = data.appearCancelled;
  8377. // activeInstance will always be the <transition> component managing this
  8378. // transition. One edge case to check is when the <transition> is placed
  8379. // as the root node of a child component. In that case we need to check
  8380. // <transition>'s parent for appear check.
  8381. var transitionNode = activeInstance.$vnode;
  8382. var context = transitionNode && transitionNode.parent
  8383. ? transitionNode.parent.context
  8384. : activeInstance;
  8385. var isAppear = !context._isMounted || !vnode.isRootInsert;
  8386. if (isAppear && !appear && appear !== '') {
  8387. return
  8388. }
  8389. var startClass = isAppear ? appearClass : enterClass;
  8390. var activeClass = isAppear ? appearActiveClass : enterActiveClass;
  8391. var beforeEnterHook = isAppear ? (beforeAppear || beforeEnter) : beforeEnter;
  8392. var enterHook = isAppear ? (typeof appear === 'function' ? appear : enter) : enter;
  8393. var afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter;
  8394. var enterCancelledHook = isAppear ? (appearCancelled || enterCancelled) : enterCancelled;
  8395. var expectsCSS = css !== false && !isIE9;
  8396. var userWantsControl =
  8397. enterHook &&
  8398. // enterHook may be a bound method which exposes
  8399. // the length of original fn as _length
  8400. (enterHook._length || enterHook.length) > 1;
  8401. var cb = el._enterCb = once(function () {
  8402. if (expectsCSS) {
  8403. removeTransitionClass(el, activeClass);
  8404. }
  8405. if (cb.cancelled) {
  8406. if (expectsCSS) {
  8407. removeTransitionClass(el, startClass);
  8408. }
  8409. enterCancelledHook && enterCancelledHook(el);
  8410. } else {
  8411. afterEnterHook && afterEnterHook(el);
  8412. }
  8413. el._enterCb = null;
  8414. });
  8415. if (!vnode.data.show) {
  8416. // remove pending leave element on enter by injecting an insert hook
  8417. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () {
  8418. var parent = el.parentNode;
  8419. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  8420. if (pendingNode && pendingNode.tag === vnode.tag && pendingNode.elm._leaveCb) {
  8421. pendingNode.elm._leaveCb();
  8422. }
  8423. enterHook && enterHook(el, cb);
  8424. }, 'transition-insert');
  8425. }
  8426. // start enter transition
  8427. beforeEnterHook && beforeEnterHook(el);
  8428. if (expectsCSS) {
  8429. addTransitionClass(el, startClass);
  8430. addTransitionClass(el, activeClass);
  8431. nextFrame(function () {
  8432. removeTransitionClass(el, startClass);
  8433. if (!cb.cancelled && !userWantsControl) {
  8434. whenTransitionEnds(el, type, cb);
  8435. }
  8436. });
  8437. }
  8438. if (vnode.data.show) {
  8439. enterHook && enterHook(el, cb);
  8440. }
  8441. if (!expectsCSS && !userWantsControl) {
  8442. cb();
  8443. }
  8444. }
  8445. function leave (vnode, rm) {
  8446. var el = vnode.elm;
  8447. // call enter callback now
  8448. if (el._enterCb) {
  8449. el._enterCb.cancelled = true;
  8450. el._enterCb();
  8451. }
  8452. var data = resolveTransition(vnode.data.transition);
  8453. if (!data) {
  8454. return rm()
  8455. }
  8456. /* istanbul ignore if */
  8457. if (el._leaveCb || el.nodeType !== 1) {
  8458. return
  8459. }
  8460. var css = data.css;
  8461. var type = data.type;
  8462. var leaveClass = data.leaveClass;
  8463. var leaveActiveClass = data.leaveActiveClass;
  8464. var beforeLeave = data.beforeLeave;
  8465. var leave = data.leave;
  8466. var afterLeave = data.afterLeave;
  8467. var leaveCancelled = data.leaveCancelled;
  8468. var delayLeave = data.delayLeave;
  8469. var expectsCSS = css !== false && !isIE9;
  8470. var userWantsControl =
  8471. leave &&
  8472. // leave hook may be a bound method which exposes
  8473. // the length of original fn as _length
  8474. (leave._length || leave.length) > 1;
  8475. var cb = el._leaveCb = once(function () {
  8476. if (el.parentNode && el.parentNode._pending) {
  8477. el.parentNode._pending[vnode.key] = null;
  8478. }
  8479. if (expectsCSS) {
  8480. removeTransitionClass(el, leaveActiveClass);
  8481. }
  8482. if (cb.cancelled) {
  8483. if (expectsCSS) {
  8484. removeTransitionClass(el, leaveClass);
  8485. }
  8486. leaveCancelled && leaveCancelled(el);
  8487. } else {
  8488. rm();
  8489. afterLeave && afterLeave(el);
  8490. }
  8491. el._leaveCb = null;
  8492. });
  8493. if (delayLeave) {
  8494. delayLeave(performLeave);
  8495. } else {
  8496. performLeave();
  8497. }
  8498. function performLeave () {
  8499. // the delayed leave may have already been cancelled
  8500. if (cb.cancelled) {
  8501. return
  8502. }
  8503. // record leaving element
  8504. if (!vnode.data.show) {
  8505. (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = vnode;
  8506. }
  8507. beforeLeave && beforeLeave(el);
  8508. if (expectsCSS) {
  8509. addTransitionClass(el, leaveClass);
  8510. addTransitionClass(el, leaveActiveClass);
  8511. nextFrame(function () {
  8512. removeTransitionClass(el, leaveClass);
  8513. if (!cb.cancelled && !userWantsControl) {
  8514. whenTransitionEnds(el, type, cb);
  8515. }
  8516. });
  8517. }
  8518. leave && leave(el, cb);
  8519. if (!expectsCSS && !userWantsControl) {
  8520. cb();
  8521. }
  8522. }
  8523. }
  8524. function resolveTransition (def$$1) {
  8525. if (!def$$1) {
  8526. return
  8527. }
  8528. /* istanbul ignore else */
  8529. if (typeof def$$1 === 'object') {
  8530. var res = {};
  8531. if (def$$1.css !== false) {
  8532. extend(res, autoCssTransition(def$$1.name || 'v'));
  8533. }
  8534. extend(res, def$$1);
  8535. return res
  8536. } else if (typeof def$$1 === 'string') {
  8537. return autoCssTransition(def$$1)
  8538. }
  8539. }
  8540. var autoCssTransition = cached(function (name) {
  8541. return {
  8542. enterClass: (name + "-enter"),
  8543. leaveClass: (name + "-leave"),
  8544. appearClass: (name + "-enter"),
  8545. enterActiveClass: (name + "-enter-active"),
  8546. leaveActiveClass: (name + "-leave-active"),
  8547. appearActiveClass: (name + "-enter-active")
  8548. }
  8549. });
  8550. function once (fn) {
  8551. var called = false;
  8552. return function () {
  8553. if (!called) {
  8554. called = true;
  8555. fn();
  8556. }
  8557. }
  8558. }
  8559. var transition = inBrowser ? {
  8560. create: function create (_, vnode) {
  8561. if (!vnode.data.show) {
  8562. enter(vnode);
  8563. }
  8564. },
  8565. remove: function remove (vnode, rm) {
  8566. /* istanbul ignore else */
  8567. if (!vnode.data.show) {
  8568. leave(vnode, rm);
  8569. } else {
  8570. rm();
  8571. }
  8572. }
  8573. } : {};
  8574. var platformModules = [
  8575. attrs,
  8576. klass,
  8577. events,
  8578. domProps,
  8579. style,
  8580. transition
  8581. ];
  8582. /* */
  8583. // the directive module should be applied last, after all
  8584. // built-in modules have been applied.
  8585. var modules = platformModules.concat(baseModules);
  8586. var patch$1 = createPatchFunction({ nodeOps: nodeOps, modules: modules });
  8587. /**
  8588. * Not type checking this file because flow doesn't like attaching
  8589. * properties to Elements.
  8590. */
  8591. var modelableTagRE = /^input|select|textarea|vue-component-[0-9]+(-[0-9a-zA-Z_-]*)?$/;
  8592. /* istanbul ignore if */
  8593. if (isIE9) {
  8594. // http://www.matts411.com/post/internet-explorer-9-oninput/
  8595. document.addEventListener('selectionchange', function () {
  8596. var el = document.activeElement;
  8597. if (el && el.vmodel) {
  8598. trigger(el, 'input');
  8599. }
  8600. });
  8601. }
  8602. var model = {
  8603. inserted: function inserted (el, binding, vnode) {
  8604. if (process.env.NODE_ENV !== 'production') {
  8605. if (!modelableTagRE.test(vnode.tag)) {
  8606. warn(
  8607. "v-model is not supported on element type: <" + (vnode.tag) + ">. " +
  8608. 'If you are working with contenteditable, it\'s recommended to ' +
  8609. 'wrap a library dedicated for that purpose inside a custom component.',
  8610. vnode.context
  8611. );
  8612. }
  8613. }
  8614. if (vnode.tag === 'select') {
  8615. var cb = function () {
  8616. setSelected(el, binding, vnode.context);
  8617. };
  8618. cb();
  8619. /* istanbul ignore if */
  8620. if (isIE || isEdge) {
  8621. setTimeout(cb, 0);
  8622. }
  8623. } else if (
  8624. (vnode.tag === 'textarea' || el.type === 'text') &&
  8625. !binding.modifiers.lazy
  8626. ) {
  8627. if (!isAndroid) {
  8628. el.addEventListener('compositionstart', onCompositionStart);
  8629. el.addEventListener('compositionend', onCompositionEnd);
  8630. }
  8631. /* istanbul ignore if */
  8632. if (isIE9) {
  8633. el.vmodel = true;
  8634. }
  8635. }
  8636. },
  8637. componentUpdated: function componentUpdated (el, binding, vnode) {
  8638. if (vnode.tag === 'select') {
  8639. setSelected(el, binding, vnode.context);
  8640. // in case the options rendered by v-for have changed,
  8641. // it's possible that the value is out-of-sync with the rendered options.
  8642. // detect such cases and filter out values that no longer has a matching
  8643. // option in the DOM.
  8644. var needReset = el.multiple
  8645. ? binding.value.some(function (v) { return hasNoMatchingOption(v, el.options); })
  8646. : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, el.options);
  8647. if (needReset) {
  8648. trigger(el, 'change');
  8649. }
  8650. }
  8651. }
  8652. };
  8653. function setSelected (el, binding, vm) {
  8654. var value = binding.value;
  8655. var isMultiple = el.multiple;
  8656. if (isMultiple && !Array.isArray(value)) {
  8657. process.env.NODE_ENV !== 'production' && warn(
  8658. "<select multiple v-model=\"" + (binding.expression) + "\"> " +
  8659. "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
  8660. vm
  8661. );
  8662. return
  8663. }
  8664. var selected, option;
  8665. for (var i = 0, l = el.options.length; i < l; i++) {
  8666. option = el.options[i];
  8667. if (isMultiple) {
  8668. selected = looseIndexOf(value, getValue(option)) > -1;
  8669. if (option.selected !== selected) {
  8670. option.selected = selected;
  8671. }
  8672. } else {
  8673. if (looseEqual(getValue(option), value)) {
  8674. if (el.selectedIndex !== i) {
  8675. el.selectedIndex = i;
  8676. }
  8677. return
  8678. }
  8679. }
  8680. }
  8681. if (!isMultiple) {
  8682. el.selectedIndex = -1;
  8683. }
  8684. }
  8685. function hasNoMatchingOption (value, options) {
  8686. for (var i = 0, l = options.length; i < l; i++) {
  8687. if (looseEqual(getValue(options[i]), value)) {
  8688. return false
  8689. }
  8690. }
  8691. return true
  8692. }
  8693. function getValue (option) {
  8694. return '_value' in option
  8695. ? option._value
  8696. : option.value
  8697. }
  8698. function onCompositionStart (e) {
  8699. e.target.composing = true;
  8700. }
  8701. function onCompositionEnd (e) {
  8702. e.target.composing = false;
  8703. trigger(e.target, 'input');
  8704. }
  8705. function trigger (el, type) {
  8706. var e = document.createEvent('HTMLEvents');
  8707. e.initEvent(type, true, true);
  8708. el.dispatchEvent(e);
  8709. }
  8710. /* */
  8711. // recursively search for possible transition defined inside the component root
  8712. function locateNode (vnode) {
  8713. return vnode.child && (!vnode.data || !vnode.data.transition)
  8714. ? locateNode(vnode.child._vnode)
  8715. : vnode
  8716. }
  8717. var show = {
  8718. bind: function bind (el, ref, vnode) {
  8719. var value = ref.value;
  8720. vnode = locateNode(vnode);
  8721. var transition = vnode.data && vnode.data.transition;
  8722. if (value && transition && !isIE9) {
  8723. enter(vnode);
  8724. }
  8725. var originalDisplay = el.style.display === 'none' ? '' : el.style.display;
  8726. el.style.display = value ? originalDisplay : 'none';
  8727. el.__vOriginalDisplay = originalDisplay;
  8728. },
  8729. update: function update (el, ref, vnode) {
  8730. var value = ref.value;
  8731. var oldValue = ref.oldValue;
  8732. /* istanbul ignore if */
  8733. if (value === oldValue) { return }
  8734. vnode = locateNode(vnode);
  8735. var transition = vnode.data && vnode.data.transition;
  8736. if (transition && !isIE9) {
  8737. if (value) {
  8738. enter(vnode);
  8739. el.style.display = el.__vOriginalDisplay;
  8740. } else {
  8741. leave(vnode, function () {
  8742. el.style.display = 'none';
  8743. });
  8744. }
  8745. } else {
  8746. el.style.display = value ? el.__vOriginalDisplay : 'none';
  8747. }
  8748. }
  8749. };
  8750. var platformDirectives = {
  8751. model: model,
  8752. show: show
  8753. };
  8754. /* */
  8755. // Provides transition support for a single element/component.
  8756. // supports transition mode (out-in / in-out)
  8757. var transitionProps = {
  8758. name: String,
  8759. appear: Boolean,
  8760. css: Boolean,
  8761. mode: String,
  8762. type: String,
  8763. enterClass: String,
  8764. leaveClass: String,
  8765. enterActiveClass: String,
  8766. leaveActiveClass: String,
  8767. appearClass: String,
  8768. appearActiveClass: String
  8769. };
  8770. // in case the child is also an abstract component, e.g. <keep-alive>
  8771. // we want to recursively retrieve the real component to be rendered
  8772. function getRealChild (vnode) {
  8773. var compOptions = vnode && vnode.componentOptions;
  8774. if (compOptions && compOptions.Ctor.options.abstract) {
  8775. return getRealChild(getFirstComponentChild(compOptions.children))
  8776. } else {
  8777. return vnode
  8778. }
  8779. }
  8780. function extractTransitionData (comp) {
  8781. var data = {};
  8782. var options = comp.$options;
  8783. // props
  8784. for (var key in options.propsData) {
  8785. data[key] = comp[key];
  8786. }
  8787. // events.
  8788. // extract listeners and pass them directly to the transition methods
  8789. var listeners = options._parentListeners;
  8790. for (var key$1 in listeners) {
  8791. data[camelize(key$1)] = listeners[key$1].fn;
  8792. }
  8793. return data
  8794. }
  8795. function placeholder (h, rawChild) {
  8796. return /\d-keep-alive$/.test(rawChild.tag)
  8797. ? h('keep-alive')
  8798. : null
  8799. }
  8800. function hasParentTransition (vnode) {
  8801. while ((vnode = vnode.parent)) {
  8802. if (vnode.data.transition) {
  8803. return true
  8804. }
  8805. }
  8806. }
  8807. var Transition = {
  8808. name: 'transition',
  8809. props: transitionProps,
  8810. abstract: true,
  8811. render: function render (h) {
  8812. var this$1 = this;
  8813. var children = this.$slots.default;
  8814. if (!children) {
  8815. return
  8816. }
  8817. // filter out text nodes (possible whitespaces)
  8818. children = children.filter(function (c) { return c.tag; });
  8819. /* istanbul ignore if */
  8820. if (!children.length) {
  8821. return
  8822. }
  8823. // warn multiple elements
  8824. if (process.env.NODE_ENV !== 'production' && children.length > 1) {
  8825. warn(
  8826. '<transition> can only be used on a single element. Use ' +
  8827. '<transition-group> for lists.',
  8828. this.$parent
  8829. );
  8830. }
  8831. var mode = this.mode;
  8832. // warn invalid mode
  8833. if (process.env.NODE_ENV !== 'production' &&
  8834. mode && mode !== 'in-out' && mode !== 'out-in') {
  8835. warn(
  8836. 'invalid <transition> mode: ' + mode,
  8837. this.$parent
  8838. );
  8839. }
  8840. var rawChild = children[0];
  8841. // if this is a component root node and the component's
  8842. // parent container node also has transition, skip.
  8843. if (hasParentTransition(this.$vnode)) {
  8844. return rawChild
  8845. }
  8846. // apply transition data to child
  8847. // use getRealChild() to ignore abstract components e.g. keep-alive
  8848. var child = getRealChild(rawChild);
  8849. /* istanbul ignore if */
  8850. if (!child) {
  8851. return rawChild
  8852. }
  8853. if (this._leaving) {
  8854. return placeholder(h, rawChild)
  8855. }
  8856. var key = child.key = child.key == null || child.isStatic
  8857. ? ("__v" + (child.tag + this._uid) + "__")
  8858. : child.key;
  8859. var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
  8860. var oldRawChild = this._vnode;
  8861. var oldChild = getRealChild(oldRawChild);
  8862. // mark v-show
  8863. // so that the transition module can hand over the control to the directive
  8864. if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) {
  8865. child.data.show = true;
  8866. }
  8867. if (oldChild && oldChild.data && oldChild.key !== key) {
  8868. // replace old child transition data with fresh one
  8869. // important for dynamic transitions!
  8870. var oldData = oldChild.data.transition = extend({}, data);
  8871. // handle transition mode
  8872. if (mode === 'out-in') {
  8873. // return placeholder node and queue update when leave finishes
  8874. this._leaving = true;
  8875. mergeVNodeHook(oldData, 'afterLeave', function () {
  8876. this$1._leaving = false;
  8877. this$1.$forceUpdate();
  8878. }, key);
  8879. return placeholder(h, rawChild)
  8880. } else if (mode === 'in-out') {
  8881. var delayedLeave;
  8882. var performLeave = function () { delayedLeave(); };
  8883. mergeVNodeHook(data, 'afterEnter', performLeave, key);
  8884. mergeVNodeHook(data, 'enterCancelled', performLeave, key);
  8885. mergeVNodeHook(oldData, 'delayLeave', function (leave) {
  8886. delayedLeave = leave;
  8887. }, key);
  8888. }
  8889. }
  8890. return rawChild
  8891. }
  8892. };
  8893. /* */
  8894. // Provides transition support for list items.
  8895. // supports move transitions using the FLIP technique.
  8896. // Because the vdom's children update algorithm is "unstable" - i.e.
  8897. // it doesn't guarantee the relative positioning of removed elements,
  8898. // we force transition-group to update its children into two passes:
  8899. // in the first pass, we remove all nodes that need to be removed,
  8900. // triggering their leaving transition; in the second pass, we insert/move
  8901. // into the final disired state. This way in the second pass removed
  8902. // nodes will remain where they should be.
  8903. var props = extend({
  8904. tag: String,
  8905. moveClass: String
  8906. }, transitionProps);
  8907. delete props.mode;
  8908. var TransitionGroup = {
  8909. props: props,
  8910. render: function render (h) {
  8911. var tag = this.tag || this.$vnode.data.tag || 'span';
  8912. var map = Object.create(null);
  8913. var prevChildren = this.prevChildren = this.children;
  8914. var rawChildren = this.$slots.default || [];
  8915. var children = this.children = [];
  8916. var transitionData = extractTransitionData(this);
  8917. for (var i = 0; i < rawChildren.length; i++) {
  8918. var c = rawChildren[i];
  8919. if (c.tag) {
  8920. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  8921. children.push(c);
  8922. map[c.key] = c
  8923. ;(c.data || (c.data = {})).transition = transitionData;
  8924. } else if (process.env.NODE_ENV !== 'production') {
  8925. var opts = c.componentOptions;
  8926. var name = opts
  8927. ? (opts.Ctor.options.name || opts.tag)
  8928. : c.tag;
  8929. warn(("<transition-group> children must be keyed: <" + name + ">"));
  8930. }
  8931. }
  8932. }
  8933. if (prevChildren) {
  8934. var kept = [];
  8935. var removed = [];
  8936. for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
  8937. var c$1 = prevChildren[i$1];
  8938. c$1.data.transition = transitionData;
  8939. c$1.data.pos = c$1.elm.getBoundingClientRect();
  8940. if (map[c$1.key]) {
  8941. kept.push(c$1);
  8942. } else {
  8943. removed.push(c$1);
  8944. }
  8945. }
  8946. this.kept = h(tag, null, kept);
  8947. this.removed = removed;
  8948. }
  8949. return h(tag, null, children)
  8950. },
  8951. beforeUpdate: function beforeUpdate () {
  8952. // force removing pass
  8953. this.__patch__(
  8954. this._vnode,
  8955. this.kept,
  8956. false, // hydrating
  8957. true // removeOnly (!important, avoids unnecessary moves)
  8958. );
  8959. this._vnode = this.kept;
  8960. },
  8961. updated: function updated () {
  8962. var children = this.prevChildren;
  8963. var moveClass = this.moveClass || (this.name + '-move');
  8964. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  8965. return
  8966. }
  8967. // we divide the work into three loops to avoid mixing DOM reads and writes
  8968. // in each iteration - which helps prevent layout thrashing.
  8969. children.forEach(callPendingCbs);
  8970. children.forEach(recordPosition);
  8971. children.forEach(applyTranslation);
  8972. // force reflow to put everything in position
  8973. var f = document.body.offsetHeight; // eslint-disable-line
  8974. children.forEach(function (c) {
  8975. if (c.data.moved) {
  8976. var el = c.elm;
  8977. var s = el.style;
  8978. addTransitionClass(el, moveClass);
  8979. s.transform = s.WebkitTransform = s.transitionDuration = '';
  8980. el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
  8981. if (!e || /transform$/.test(e.propertyName)) {
  8982. el.removeEventListener(transitionEndEvent, cb);
  8983. el._moveCb = null;
  8984. removeTransitionClass(el, moveClass);
  8985. }
  8986. });
  8987. }
  8988. });
  8989. },
  8990. methods: {
  8991. hasMove: function hasMove (el, moveClass) {
  8992. /* istanbul ignore if */
  8993. if (!hasTransition) {
  8994. return false
  8995. }
  8996. if (this._hasMove != null) {
  8997. return this._hasMove
  8998. }
  8999. addTransitionClass(el, moveClass);
  9000. var info = getTransitionInfo(el);
  9001. removeTransitionClass(el, moveClass);
  9002. return (this._hasMove = info.hasTransform)
  9003. }
  9004. }
  9005. };
  9006. function callPendingCbs (c) {
  9007. /* istanbul ignore if */
  9008. if (c.elm._moveCb) {
  9009. c.elm._moveCb();
  9010. }
  9011. /* istanbul ignore if */
  9012. if (c.elm._enterCb) {
  9013. c.elm._enterCb();
  9014. }
  9015. }
  9016. function recordPosition (c) {
  9017. c.data.newPos = c.elm.getBoundingClientRect();
  9018. }
  9019. function applyTranslation (c) {
  9020. var oldPos = c.data.pos;
  9021. var newPos = c.data.newPos;
  9022. var dx = oldPos.left - newPos.left;
  9023. var dy = oldPos.top - newPos.top;
  9024. if (dx || dy) {
  9025. c.data.moved = true;
  9026. var s = c.elm.style;
  9027. s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
  9028. s.transitionDuration = '0s';
  9029. }
  9030. }
  9031. var platformComponents = {
  9032. Transition: Transition,
  9033. TransitionGroup: TransitionGroup
  9034. };
  9035. /* */
  9036. // install platform specific utils
  9037. Vue$2.config.isUnknownElement = isUnknownElement;
  9038. Vue$2.config.isReservedTag = isReservedTag;
  9039. Vue$2.config.getTagNamespace = getTagNamespace;
  9040. Vue$2.config.mustUseProp = mustUseProp;
  9041. // install platform runtime directives & components
  9042. extend(Vue$2.options.directives, platformDirectives);
  9043. extend(Vue$2.options.components, platformComponents);
  9044. // install platform patch function
  9045. Vue$2.prototype.__patch__ = config._isServer ? noop : patch$1;
  9046. // wrap mount
  9047. Vue$2.prototype.$mount = function (
  9048. el,
  9049. hydrating
  9050. ) {
  9051. el = el && !config._isServer ? query(el) : undefined;
  9052. return this._mount(el, hydrating)
  9053. };
  9054. // devtools global hook
  9055. /* istanbul ignore next */
  9056. setTimeout(function () {
  9057. if (config.devtools) {
  9058. if (devtools) {
  9059. devtools.emit('init', Vue$2);
  9060. } else if (
  9061. process.env.NODE_ENV !== 'production' &&
  9062. inBrowser && /Chrome\/\d+/.test(window.navigator.userAgent)
  9063. ) {
  9064. console.log(
  9065. 'Download the Vue Devtools for a better development experience:\n' +
  9066. 'https://github.com/vuejs/vue-devtools'
  9067. );
  9068. }
  9069. }
  9070. }, 0);
  9071. module.exports = Vue$2;
  9072. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  9073. /***/ },
  9074. /* 33 */
  9075. /***/ function(module, exports, __webpack_require__) {
  9076. module.exports = { "default": __webpack_require__(123), __esModule: true };
  9077. /***/ },
  9078. /* 34 */
  9079. /***/ function(module, exports, __webpack_require__) {
  9080. "use strict";
  9081. /* WEBPACK VAR INJECTION */(function(global) {'use strict';
  9082. var buffer = __webpack_require__(0);
  9083. var Buffer = buffer.Buffer;
  9084. var SlowBuffer = buffer.SlowBuffer;
  9085. var MAX_LEN = buffer.kMaxLength || 2147483647;
  9086. exports.alloc = function alloc(size, fill, encoding) {
  9087. if (typeof Buffer.alloc === 'function') {
  9088. return Buffer.alloc(size, fill, encoding);
  9089. }
  9090. if (typeof encoding === 'number') {
  9091. throw new TypeError('encoding must not be number');
  9092. }
  9093. if (typeof size !== 'number') {
  9094. throw new TypeError('size must be a number');
  9095. }
  9096. if (size > MAX_LEN) {
  9097. throw new RangeError('size is too large');
  9098. }
  9099. var enc = encoding;
  9100. var _fill = fill;
  9101. if (_fill === undefined) {
  9102. enc = undefined;
  9103. _fill = 0;
  9104. }
  9105. var buf = new Buffer(size);
  9106. if (typeof _fill === 'string') {
  9107. var fillBuf = new Buffer(_fill, enc);
  9108. var flen = fillBuf.length;
  9109. var i = -1;
  9110. while (++i < size) {
  9111. buf[i] = fillBuf[i % flen];
  9112. }
  9113. } else {
  9114. buf.fill(_fill);
  9115. }
  9116. return buf;
  9117. }
  9118. exports.allocUnsafe = function allocUnsafe(size) {
  9119. if (typeof Buffer.allocUnsafe === 'function') {
  9120. return Buffer.allocUnsafe(size);
  9121. }
  9122. if (typeof size !== 'number') {
  9123. throw new TypeError('size must be a number');
  9124. }
  9125. if (size > MAX_LEN) {
  9126. throw new RangeError('size is too large');
  9127. }
  9128. return new Buffer(size);
  9129. }
  9130. exports.from = function from(value, encodingOrOffset, length) {
  9131. if (typeof Buffer.from === 'function' && (!global.Uint8Array || Uint8Array.from !== Buffer.from)) {
  9132. return Buffer.from(value, encodingOrOffset, length);
  9133. }
  9134. if (typeof value === 'number') {
  9135. throw new TypeError('"value" argument must not be a number');
  9136. }
  9137. if (typeof value === 'string') {
  9138. return new Buffer(value, encodingOrOffset);
  9139. }
  9140. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  9141. var offset = encodingOrOffset;
  9142. if (arguments.length === 1) {
  9143. return new Buffer(value);
  9144. }
  9145. if (typeof offset === 'undefined') {
  9146. offset = 0;
  9147. }
  9148. var len = length;
  9149. if (typeof len === 'undefined') {
  9150. len = value.byteLength - offset;
  9151. }
  9152. if (offset >= value.byteLength) {
  9153. throw new RangeError('\'offset\' is out of bounds');
  9154. }
  9155. if (len > value.byteLength - offset) {
  9156. throw new RangeError('\'length\' is out of bounds');
  9157. }
  9158. return new Buffer(value.slice(offset, offset + len));
  9159. }
  9160. if (Buffer.isBuffer(value)) {
  9161. var out = new Buffer(value.length);
  9162. value.copy(out, 0, 0, value.length);
  9163. return out;
  9164. }
  9165. if (value) {
  9166. if (Array.isArray(value) || (typeof ArrayBuffer !== 'undefined' && value.buffer instanceof ArrayBuffer) || 'length' in value) {
  9167. return new Buffer(value);
  9168. }
  9169. if (value.type === 'Buffer' && Array.isArray(value.data)) {
  9170. return new Buffer(value.data);
  9171. }
  9172. }
  9173. throw new TypeError('First argument must be a string, Buffer, ' + 'ArrayBuffer, Array, or array-like object.');
  9174. }
  9175. exports.allocUnsafeSlow = function allocUnsafeSlow(size) {
  9176. if (typeof Buffer.allocUnsafeSlow === 'function') {
  9177. return Buffer.allocUnsafeSlow(size);
  9178. }
  9179. if (typeof size !== 'number') {
  9180. throw new TypeError('size must be a number');
  9181. }
  9182. if (size >= MAX_LEN) {
  9183. throw new RangeError('size is too large');
  9184. }
  9185. return new SlowBuffer(size);
  9186. }
  9187. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22)))
  9188. /***/ },
  9189. /* 35 */
  9190. /***/ function(module, exports) {
  9191. module.exports = function(it){
  9192. if(typeof it != 'function')throw TypeError(it + ' is not a function!');
  9193. return it;
  9194. };
  9195. /***/ },
  9196. /* 36 */
  9197. /***/ function(module, exports) {
  9198. // 7.2.1 RequireObjectCoercible(argument)
  9199. module.exports = function(it){
  9200. if(it == undefined)throw TypeError("Can't call method on " + it);
  9201. return it;
  9202. };
  9203. /***/ },
  9204. /* 37 */
  9205. /***/ function(module, exports, __webpack_require__) {
  9206. var isObject = __webpack_require__(29)
  9207. , document = __webpack_require__(4).document
  9208. // in old IE typeof document.createElement is 'object'
  9209. , is = isObject(document) && isObject(document.createElement);
  9210. module.exports = function(it){
  9211. return is ? document.createElement(it) : {};
  9212. };
  9213. /***/ },
  9214. /* 38 */
  9215. /***/ function(module, exports) {
  9216. module.exports = function(exec){
  9217. try {
  9218. return !!exec();
  9219. } catch(e){
  9220. return true;
  9221. }
  9222. };
  9223. /***/ },
  9224. /* 39 */
  9225. /***/ function(module, exports, __webpack_require__) {
  9226. var def = __webpack_require__(17).f
  9227. , has = __webpack_require__(28)
  9228. , TAG = __webpack_require__(3)('toStringTag');
  9229. module.exports = function(it, tag, stat){
  9230. if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag});
  9231. };
  9232. /***/ },
  9233. /* 40 */
  9234. /***/ function(module, exports, __webpack_require__) {
  9235. var shared = __webpack_require__(67)('keys')
  9236. , uid = __webpack_require__(71);
  9237. module.exports = function(key){
  9238. return shared[key] || (shared[key] = uid(key));
  9239. };
  9240. /***/ },
  9241. /* 41 */
  9242. /***/ function(module, exports) {
  9243. // 7.1.4 ToInteger
  9244. var ceil = Math.ceil
  9245. , floor = Math.floor;
  9246. module.exports = function(it){
  9247. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  9248. };
  9249. /***/ },
  9250. /* 42 */
  9251. /***/ function(module, exports, __webpack_require__) {
  9252. // to indexed object, toObject with fallback for non-array-like ES3 strings
  9253. var IObject = __webpack_require__(62)
  9254. , defined = __webpack_require__(36);
  9255. module.exports = function(it){
  9256. return IObject(defined(it));
  9257. };
  9258. /***/ },
  9259. /* 43 */
  9260. /***/ function(module, exports, __webpack_require__) {
  9261. var v1 = __webpack_require__(176);
  9262. var v2 = __webpack_require__(177);
  9263. var pbkdf2 = __webpack_require__(44);
  9264. var objectAssign = __webpack_require__(179);
  9265. module.exports = {
  9266. encryptLogin: v1.encryptLogin,
  9267. renderPassword: v1.renderPassword,
  9268. createFingerprint: v1.createFingerprint,
  9269. _deriveEncryptedLogin: v1._deriveEncryptedLogin,
  9270. _getPasswordTemplate: v1._getPasswordTemplate,
  9271. _prettyPrint: v1._prettyPrint,
  9272. _string2charCodes: v1._string2charCodes,
  9273. _getCharType: v1._getCharType,
  9274. _getPasswordChar: v1._getPasswordChar,
  9275. _createHmac: v1._createHmac,
  9276. generatePassword: generatePassword,
  9277. _calcEntropy: v2._calcEntropy,
  9278. _consumeEntropy: v2._consumeEntropy,
  9279. _getSetOfCharacters: v2._getSetOfCharacters,
  9280. _getConfiguredRules: v2._getConfiguredRules,
  9281. _insertStringPseudoRandomly: v2._insertStringPseudoRandomly,
  9282. _getOneCharPerRule: v2._getOneCharPerRule,
  9283. _renderPassword: v2._renderPassword,
  9284. pbkdf2: pbkdf2
  9285. };
  9286. var defaultPasswordProfile = {
  9287. version: 2,
  9288. lowercase: true,
  9289. numbers: true,
  9290. uppercase: true,
  9291. symbols: true,
  9292. keylen: 32,
  9293. digest: 'sha256',
  9294. length: 16,
  9295. index: 1,
  9296. iterations: 100000
  9297. };
  9298. function generatePassword(site, login, masterPassword, passwordProfile) {
  9299. var _passwordProfile = objectAssign({}, defaultPasswordProfile, passwordProfile);
  9300. if (_passwordProfile.version === 1) {
  9301. var options = {
  9302. counter: _passwordProfile.counter,
  9303. length: _passwordProfile.length,
  9304. lowercase: _passwordProfile.lowercase,
  9305. uppercase: _passwordProfile.uppercase,
  9306. numbers: _passwordProfile.numbers,
  9307. symbols: _passwordProfile.symbols
  9308. };
  9309. return v1.encryptLogin(login, masterPassword)
  9310. .then(function (encryptedLogin) {
  9311. return v1.renderPassword(encryptedLogin, site, options).then(function (generatedPassword) {
  9312. return generatedPassword
  9313. });
  9314. });
  9315. }
  9316. return v2.generatePassword(site, login, masterPassword, _passwordProfile);
  9317. }
  9318. /***/ },
  9319. /* 44 */
  9320. /***/ function(module, exports, __webpack_require__) {
  9321. /* WEBPACK VAR INJECTION */(function(Buffer) {var pbkdf2 = __webpack_require__(180);
  9322. var Promise = __webpack_require__(74);
  9323. function shouldUseNative() {
  9324. return !!(typeof window !== 'undefined' && window.crypto && window.crypto.subtle);
  9325. }
  9326. function pbkdf2Native(password, salt, iterations, keylen, digest) {
  9327. var algorithms = {
  9328. 'sha1': 'SHA-1',
  9329. 'sha-1': 'SHA-1',
  9330. 'sha256': 'SHA-256',
  9331. 'sha-256': 'SHA-256',
  9332. 'sha512': 'SHA-512',
  9333. 'sha-512': 'SHA-512',
  9334. };
  9335. return window.crypto.subtle.importKey('raw', new Buffer(password), 'PBKDF2', false, ['deriveKey'])
  9336. .then(function (key) {
  9337. var algo = {
  9338. name: 'PBKDF2',
  9339. salt: new Buffer(salt),
  9340. iterations: iterations,
  9341. hash: algorithms[digest.toLowerCase()],
  9342. };
  9343. return window.crypto.subtle.deriveKey(algo, key, {
  9344. name: 'AES-CTR',
  9345. length: keylen * 8
  9346. }, true, ['encrypt', 'decrypt']);
  9347. })
  9348. .then(function (derivedKey) {
  9349. return window.crypto.subtle.exportKey('raw', derivedKey).then(function (keyArray) {
  9350. return new Buffer(keyArray).toString('hex');
  9351. });
  9352. });
  9353. }
  9354. function pbkdf2Browserified(password, salt, iterations, keylen, digest) {
  9355. return new Promise(function (resolve, reject) {
  9356. pbkdf2.pbkdf2(password, salt, iterations, keylen, digest, function (error, key) {
  9357. if (error) {
  9358. reject('error in pbkdf2');
  9359. } else {
  9360. resolve(key.toString('hex'));
  9361. }
  9362. });
  9363. });
  9364. }
  9365. module.exports = shouldUseNative() ? pbkdf2Native : pbkdf2Browserified;
  9366. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  9367. /***/ },
  9368. /* 45 */
  9369. /***/ function(module, exports, __webpack_require__) {
  9370. "use strict";
  9371. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  9372. if (!process.version ||
  9373. process.version.indexOf('v0.') === 0 ||
  9374. process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
  9375. module.exports = nextTick;
  9376. } else {
  9377. module.exports = process.nextTick;
  9378. }
  9379. function nextTick(fn, arg1, arg2, arg3) {
  9380. if (typeof fn !== 'function') {
  9381. throw new TypeError('"callback" argument must be a function');
  9382. }
  9383. var len = arguments.length;
  9384. var args, i;
  9385. switch (len) {
  9386. case 0:
  9387. case 1:
  9388. return process.nextTick(fn);
  9389. case 2:
  9390. return process.nextTick(function afterTickOne() {
  9391. fn.call(null, arg1);
  9392. });
  9393. case 3:
  9394. return process.nextTick(function afterTickTwo() {
  9395. fn.call(null, arg1, arg2);
  9396. });
  9397. case 4:
  9398. return process.nextTick(function afterTickThree() {
  9399. fn.call(null, arg1, arg2, arg3);
  9400. });
  9401. default:
  9402. args = new Array(len - 1);
  9403. i = 0;
  9404. while (i < args.length) {
  9405. args[i++] = arguments[i];
  9406. }
  9407. return process.nextTick(function afterTick() {
  9408. fn.apply(null, args);
  9409. });
  9410. }
  9411. }
  9412. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  9413. /***/ },
  9414. /* 46 */
  9415. /***/ function(module, exports, __webpack_require__) {
  9416. "use strict";
  9417. // a transform stream is a readable/writable stream where you do
  9418. // something with the data. Sometimes it's called a "filter",
  9419. // but that's not a great name for it, since that implies a thing where
  9420. // some bits pass through, and others are simply ignored. (That would
  9421. // be a valid example of a transform, of course.)
  9422. //
  9423. // While the output is causally related to the input, it's not a
  9424. // necessarily symmetric or synchronous transformation. For example,
  9425. // a zlib stream might take multiple plain-text writes(), and then
  9426. // emit a single compressed chunk some time in the future.
  9427. //
  9428. // Here's how this works:
  9429. //
  9430. // The Transform stream has all the aspects of the readable and writable
  9431. // stream classes. When you write(chunk), that calls _write(chunk,cb)
  9432. // internally, and returns false if there's a lot of pending writes
  9433. // buffered up. When you call read(), that calls _read(n) until
  9434. // there's enough pending readable data buffered up.
  9435. //
  9436. // In a transform stream, the written data is placed in a buffer. When
  9437. // _read(n) is called, it transforms the queued up data, calling the
  9438. // buffered _write cb's as it consumes chunks. If consuming a single
  9439. // written chunk would result in multiple output chunks, then the first
  9440. // outputted bit calls the readcb, and subsequent chunks just go into
  9441. // the read buffer, and will cause it to emit 'readable' if necessary.
  9442. //
  9443. // This way, back-pressure is actually determined by the reading side,
  9444. // since _read has to be called to start processing a new chunk. However,
  9445. // a pathological inflate type of transform can cause excessive buffering
  9446. // here. For example, imagine a stream where every byte of input is
  9447. // interpreted as an integer from 0-255, and then results in that many
  9448. // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
  9449. // 1kb of data being output. In this case, you could write a very small
  9450. // amount of input, and end up with a very large amount of output. In
  9451. // such a pathological inflating mechanism, there'd be no way to tell
  9452. // the system to stop doing the transform. A single 4MB write could
  9453. // cause the system to run out of memory.
  9454. //
  9455. // However, even in such a pathological case, only a single written chunk
  9456. // would be consumed, and then the rest would wait (un-transformed) until
  9457. // the results of the previous transformed chunk were consumed.
  9458. 'use strict';
  9459. module.exports = Transform;
  9460. var Duplex = __webpack_require__(7);
  9461. /*<replacement>*/
  9462. var util = __webpack_require__(18);
  9463. util.inherits = __webpack_require__(1);
  9464. /*</replacement>*/
  9465. util.inherits(Transform, Duplex);
  9466. function TransformState(stream) {
  9467. this.afterTransform = function (er, data) {
  9468. return afterTransform(stream, er, data);
  9469. };
  9470. this.needTransform = false;
  9471. this.transforming = false;
  9472. this.writecb = null;
  9473. this.writechunk = null;
  9474. this.writeencoding = null;
  9475. }
  9476. function afterTransform(stream, er, data) {
  9477. var ts = stream._transformState;
  9478. ts.transforming = false;
  9479. var cb = ts.writecb;
  9480. if (!cb) return stream.emit('error', new Error('no writecb in Transform class'));
  9481. ts.writechunk = null;
  9482. ts.writecb = null;
  9483. if (data !== null && data !== undefined) stream.push(data);
  9484. cb(er);
  9485. var rs = stream._readableState;
  9486. rs.reading = false;
  9487. if (rs.needReadable || rs.length < rs.highWaterMark) {
  9488. stream._read(rs.highWaterMark);
  9489. }
  9490. }
  9491. function Transform(options) {
  9492. if (!(this instanceof Transform)) return new Transform(options);
  9493. Duplex.call(this, options);
  9494. this._transformState = new TransformState(this);
  9495. // when the writable side finishes, then flush out anything remaining.
  9496. var stream = this;
  9497. // start out asking for a readable event once data is transformed.
  9498. this._readableState.needReadable = true;
  9499. // we have implemented the _read method, and done the other things
  9500. // that Readable wants before the first _read call, so unset the
  9501. // sync guard flag.
  9502. this._readableState.sync = false;
  9503. if (options) {
  9504. if (typeof options.transform === 'function') this._transform = options.transform;
  9505. if (typeof options.flush === 'function') this._flush = options.flush;
  9506. }
  9507. this.once('prefinish', function () {
  9508. if (typeof this._flush === 'function') this._flush(function (er) {
  9509. done(stream, er);
  9510. });else done(stream);
  9511. });
  9512. }
  9513. Transform.prototype.push = function (chunk, encoding) {
  9514. this._transformState.needTransform = false;
  9515. return Duplex.prototype.push.call(this, chunk, encoding);
  9516. };
  9517. // This is the part where you do stuff!
  9518. // override this function in implementation classes.
  9519. // 'chunk' is an input chunk.
  9520. //
  9521. // Call `push(newChunk)` to pass along transformed output
  9522. // to the readable side. You may call 'push' zero or more times.
  9523. //
  9524. // Call `cb(err)` when you are done with this chunk. If you pass
  9525. // an error, then that'll put the hurt on the whole operation. If you
  9526. // never call cb(), then you'll never get another chunk.
  9527. Transform.prototype._transform = function (chunk, encoding, cb) {
  9528. throw new Error('Not implemented');
  9529. };
  9530. Transform.prototype._write = function (chunk, encoding, cb) {
  9531. var ts = this._transformState;
  9532. ts.writecb = cb;
  9533. ts.writechunk = chunk;
  9534. ts.writeencoding = encoding;
  9535. if (!ts.transforming) {
  9536. var rs = this._readableState;
  9537. if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
  9538. }
  9539. };
  9540. // Doesn't matter what the args are here.
  9541. // _transform does all the work.
  9542. // That we got here means that the readable side wants more data.
  9543. Transform.prototype._read = function (n) {
  9544. var ts = this._transformState;
  9545. if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
  9546. ts.transforming = true;
  9547. this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
  9548. } else {
  9549. // mark that we need a transform, so that any data that comes in
  9550. // will get processed, now that we've asked for it.
  9551. ts.needTransform = true;
  9552. }
  9553. };
  9554. function done(stream, er) {
  9555. if (er) return stream.emit('error', er);
  9556. // if there's nothing in the write buffer, then that means
  9557. // that nothing more will ever be provided
  9558. var ws = stream._writableState;
  9559. var ts = stream._transformState;
  9560. if (ws.length) throw new Error('Calling transform done when ws.length != 0');
  9561. if (ts.transforming) throw new Error('Calling transform done when still transforming');
  9562. return stream.push(null);
  9563. }
  9564. /***/ },
  9565. /* 47 */
  9566. /***/ function(module, exports, __webpack_require__) {
  9567. "use strict";
  9568. /* WEBPACK VAR INJECTION */(function(process, setImmediate) {// A bit simpler than readable streams.
  9569. // Implement an async ._write(chunk, encoding, cb), and it'll handle all
  9570. // the drain event emission and buffering.
  9571. 'use strict';
  9572. module.exports = Writable;
  9573. /*<replacement>*/
  9574. var processNextTick = __webpack_require__(45);
  9575. /*</replacement>*/
  9576. /*<replacement>*/
  9577. var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;
  9578. /*</replacement>*/
  9579. Writable.WritableState = WritableState;
  9580. /*<replacement>*/
  9581. var util = __webpack_require__(18);
  9582. util.inherits = __webpack_require__(1);
  9583. /*</replacement>*/
  9584. /*<replacement>*/
  9585. var internalUtil = {
  9586. deprecate: __webpack_require__(197)
  9587. };
  9588. /*</replacement>*/
  9589. /*<replacement>*/
  9590. var Stream;
  9591. (function () {
  9592. try {
  9593. Stream = __webpack_require__(20);
  9594. } catch (_) {} finally {
  9595. if (!Stream) Stream = __webpack_require__(30).EventEmitter;
  9596. }
  9597. })();
  9598. /*</replacement>*/
  9599. var Buffer = __webpack_require__(0).Buffer;
  9600. /*<replacement>*/
  9601. var bufferShim = __webpack_require__(34);
  9602. /*</replacement>*/
  9603. util.inherits(Writable, Stream);
  9604. function nop() {}
  9605. function WriteReq(chunk, encoding, cb) {
  9606. this.chunk = chunk;
  9607. this.encoding = encoding;
  9608. this.callback = cb;
  9609. this.next = null;
  9610. }
  9611. var Duplex;
  9612. function WritableState(options, stream) {
  9613. Duplex = Duplex || __webpack_require__(7);
  9614. options = options || {};
  9615. // object stream flag to indicate whether or not this stream
  9616. // contains buffers or objects.
  9617. this.objectMode = !!options.objectMode;
  9618. if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
  9619. // the point at which write() starts returning false
  9620. // Note: 0 is a valid value, means that we always return false if
  9621. // the entire buffer is not flushed immediately on write()
  9622. var hwm = options.highWaterMark;
  9623. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  9624. this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
  9625. // cast to ints.
  9626. this.highWaterMark = ~ ~this.highWaterMark;
  9627. this.needDrain = false;
  9628. // at the start of calling end()
  9629. this.ending = false;
  9630. // when end() has been called, and returned
  9631. this.ended = false;
  9632. // when 'finish' is emitted
  9633. this.finished = false;
  9634. // should we decode strings into buffers before passing to _write?
  9635. // this is here so that some node-core streams can optimize string
  9636. // handling at a lower level.
  9637. var noDecode = options.decodeStrings === false;
  9638. this.decodeStrings = !noDecode;
  9639. // Crypto is kind of old and crusty. Historically, its default string
  9640. // encoding is 'binary' so we have to make this configurable.
  9641. // Everything else in the universe uses 'utf8', though.
  9642. this.defaultEncoding = options.defaultEncoding || 'utf8';
  9643. // not an actual buffer we keep track of, but a measurement
  9644. // of how much we're waiting to get pushed to some underlying
  9645. // socket or file.
  9646. this.length = 0;
  9647. // a flag to see when we're in the middle of a write.
  9648. this.writing = false;
  9649. // when true all writes will be buffered until .uncork() call
  9650. this.corked = 0;
  9651. // a flag to be able to tell if the onwrite cb is called immediately,
  9652. // or on a later tick. We set this to true at first, because any
  9653. // actions that shouldn't happen until "later" should generally also
  9654. // not happen before the first write call.
  9655. this.sync = true;
  9656. // a flag to know if we're processing previously buffered items, which
  9657. // may call the _write() callback in the same tick, so that we don't
  9658. // end up in an overlapped onwrite situation.
  9659. this.bufferProcessing = false;
  9660. // the callback that's passed to _write(chunk,cb)
  9661. this.onwrite = function (er) {
  9662. onwrite(stream, er);
  9663. };
  9664. // the callback that the user supplies to write(chunk,encoding,cb)
  9665. this.writecb = null;
  9666. // the amount that is being written when _write is called.
  9667. this.writelen = 0;
  9668. this.bufferedRequest = null;
  9669. this.lastBufferedRequest = null;
  9670. // number of pending user-supplied write callbacks
  9671. // this must be 0 before 'finish' can be emitted
  9672. this.pendingcb = 0;
  9673. // emit prefinish if the only thing we're waiting for is _write cbs
  9674. // This is relevant for synchronous Transform streams
  9675. this.prefinished = false;
  9676. // True if the error was already emitted and should not be thrown again
  9677. this.errorEmitted = false;
  9678. // count buffered requests
  9679. this.bufferedRequestCount = 0;
  9680. // allocate the first CorkedRequest, there is always
  9681. // one allocated and free to use, and we maintain at most two
  9682. this.corkedRequestsFree = new CorkedRequest(this);
  9683. }
  9684. WritableState.prototype.getBuffer = function writableStateGetBuffer() {
  9685. var current = this.bufferedRequest;
  9686. var out = [];
  9687. while (current) {
  9688. out.push(current);
  9689. current = current.next;
  9690. }
  9691. return out;
  9692. };
  9693. (function () {
  9694. try {
  9695. Object.defineProperty(WritableState.prototype, 'buffer', {
  9696. get: internalUtil.deprecate(function () {
  9697. return this.getBuffer();
  9698. }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.')
  9699. });
  9700. } catch (_) {}
  9701. })();
  9702. var Duplex;
  9703. function Writable(options) {
  9704. Duplex = Duplex || __webpack_require__(7);
  9705. // Writable ctor is applied to Duplexes, though they're not
  9706. // instanceof Writable, they're instanceof Readable.
  9707. if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options);
  9708. this._writableState = new WritableState(options, this);
  9709. // legacy.
  9710. this.writable = true;
  9711. if (options) {
  9712. if (typeof options.write === 'function') this._write = options.write;
  9713. if (typeof options.writev === 'function') this._writev = options.writev;
  9714. }
  9715. Stream.call(this);
  9716. }
  9717. // Otherwise people can pipe Writable streams, which is just wrong.
  9718. Writable.prototype.pipe = function () {
  9719. this.emit('error', new Error('Cannot pipe, not readable'));
  9720. };
  9721. function writeAfterEnd(stream, cb) {
  9722. var er = new Error('write after end');
  9723. // TODO: defer error events consistently everywhere, not just the cb
  9724. stream.emit('error', er);
  9725. processNextTick(cb, er);
  9726. }
  9727. // If we get something that is not a buffer, string, null, or undefined,
  9728. // and we're not in objectMode, then that's an error.
  9729. // Otherwise stream chunks are all considered to be of length=1, and the
  9730. // watermarks determine how many objects to keep in the buffer, rather than
  9731. // how many bytes or characters.
  9732. function validChunk(stream, state, chunk, cb) {
  9733. var valid = true;
  9734. var er = false;
  9735. // Always throw error if a null is written
  9736. // if we are not in object mode then throw
  9737. // if it is not a buffer, string, or undefined.
  9738. if (chunk === null) {
  9739. er = new TypeError('May not write null values to stream');
  9740. } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
  9741. er = new TypeError('Invalid non-string/buffer chunk');
  9742. }
  9743. if (er) {
  9744. stream.emit('error', er);
  9745. processNextTick(cb, er);
  9746. valid = false;
  9747. }
  9748. return valid;
  9749. }
  9750. Writable.prototype.write = function (chunk, encoding, cb) {
  9751. var state = this._writableState;
  9752. var ret = false;
  9753. if (typeof encoding === 'function') {
  9754. cb = encoding;
  9755. encoding = null;
  9756. }
  9757. if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
  9758. if (typeof cb !== 'function') cb = nop;
  9759. if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) {
  9760. state.pendingcb++;
  9761. ret = writeOrBuffer(this, state, chunk, encoding, cb);
  9762. }
  9763. return ret;
  9764. };
  9765. Writable.prototype.cork = function () {
  9766. var state = this._writableState;
  9767. state.corked++;
  9768. };
  9769. Writable.prototype.uncork = function () {
  9770. var state = this._writableState;
  9771. if (state.corked) {
  9772. state.corked--;
  9773. if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
  9774. }
  9775. };
  9776. Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
  9777. // node::ParseEncoding() requires lower case.
  9778. if (typeof encoding === 'string') encoding = encoding.toLowerCase();
  9779. if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
  9780. this._writableState.defaultEncoding = encoding;
  9781. return this;
  9782. };
  9783. function decodeChunk(state, chunk, encoding) {
  9784. if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
  9785. chunk = bufferShim.from(chunk, encoding);
  9786. }
  9787. return chunk;
  9788. }
  9789. // if we're already writing something, then just put this
  9790. // in the queue, and wait our turn. Otherwise, call _write
  9791. // If we return false, then we need a drain event, so set that flag.
  9792. function writeOrBuffer(stream, state, chunk, encoding, cb) {
  9793. chunk = decodeChunk(state, chunk, encoding);
  9794. if (Buffer.isBuffer(chunk)) encoding = 'buffer';
  9795. var len = state.objectMode ? 1 : chunk.length;
  9796. state.length += len;
  9797. var ret = state.length < state.highWaterMark;
  9798. // we must ensure that previous needDrain will not be reset to false.
  9799. if (!ret) state.needDrain = true;
  9800. if (state.writing || state.corked) {
  9801. var last = state.lastBufferedRequest;
  9802. state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);
  9803. if (last) {
  9804. last.next = state.lastBufferedRequest;
  9805. } else {
  9806. state.bufferedRequest = state.lastBufferedRequest;
  9807. }
  9808. state.bufferedRequestCount += 1;
  9809. } else {
  9810. doWrite(stream, state, false, len, chunk, encoding, cb);
  9811. }
  9812. return ret;
  9813. }
  9814. function doWrite(stream, state, writev, len, chunk, encoding, cb) {
  9815. state.writelen = len;
  9816. state.writecb = cb;
  9817. state.writing = true;
  9818. state.sync = true;
  9819. if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
  9820. state.sync = false;
  9821. }
  9822. function onwriteError(stream, state, sync, er, cb) {
  9823. --state.pendingcb;
  9824. if (sync) processNextTick(cb, er);else cb(er);
  9825. stream._writableState.errorEmitted = true;
  9826. stream.emit('error', er);
  9827. }
  9828. function onwriteStateUpdate(state) {
  9829. state.writing = false;
  9830. state.writecb = null;
  9831. state.length -= state.writelen;
  9832. state.writelen = 0;
  9833. }
  9834. function onwrite(stream, er) {
  9835. var state = stream._writableState;
  9836. var sync = state.sync;
  9837. var cb = state.writecb;
  9838. onwriteStateUpdate(state);
  9839. if (er) onwriteError(stream, state, sync, er, cb);else {
  9840. // Check if we're actually ready to finish, but don't emit yet
  9841. var finished = needFinish(state);
  9842. if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
  9843. clearBuffer(stream, state);
  9844. }
  9845. if (sync) {
  9846. /*<replacement>*/
  9847. asyncWrite(afterWrite, stream, state, finished, cb);
  9848. /*</replacement>*/
  9849. } else {
  9850. afterWrite(stream, state, finished, cb);
  9851. }
  9852. }
  9853. }
  9854. function afterWrite(stream, state, finished, cb) {
  9855. if (!finished) onwriteDrain(stream, state);
  9856. state.pendingcb--;
  9857. cb();
  9858. finishMaybe(stream, state);
  9859. }
  9860. // Must force callback to be called on nextTick, so that we don't
  9861. // emit 'drain' before the write() consumer gets the 'false' return
  9862. // value, and has a chance to attach a 'drain' listener.
  9863. function onwriteDrain(stream, state) {
  9864. if (state.length === 0 && state.needDrain) {
  9865. state.needDrain = false;
  9866. stream.emit('drain');
  9867. }
  9868. }
  9869. // if there's something in the buffer waiting, then process it
  9870. function clearBuffer(stream, state) {
  9871. state.bufferProcessing = true;
  9872. var entry = state.bufferedRequest;
  9873. if (stream._writev && entry && entry.next) {
  9874. // Fast case, write everything using _writev()
  9875. var l = state.bufferedRequestCount;
  9876. var buffer = new Array(l);
  9877. var holder = state.corkedRequestsFree;
  9878. holder.entry = entry;
  9879. var count = 0;
  9880. while (entry) {
  9881. buffer[count] = entry;
  9882. entry = entry.next;
  9883. count += 1;
  9884. }
  9885. doWrite(stream, state, true, state.length, buffer, '', holder.finish);
  9886. // doWrite is almost always async, defer these to save a bit of time
  9887. // as the hot path ends with doWrite
  9888. state.pendingcb++;
  9889. state.lastBufferedRequest = null;
  9890. if (holder.next) {
  9891. state.corkedRequestsFree = holder.next;
  9892. holder.next = null;
  9893. } else {
  9894. state.corkedRequestsFree = new CorkedRequest(state);
  9895. }
  9896. } else {
  9897. // Slow case, write chunks one-by-one
  9898. while (entry) {
  9899. var chunk = entry.chunk;
  9900. var encoding = entry.encoding;
  9901. var cb = entry.callback;
  9902. var len = state.objectMode ? 1 : chunk.length;
  9903. doWrite(stream, state, false, len, chunk, encoding, cb);
  9904. entry = entry.next;
  9905. // if we didn't call the onwrite immediately, then
  9906. // it means that we need to wait until it does.
  9907. // also, that means that the chunk and cb are currently
  9908. // being processed, so move the buffer counter past them.
  9909. if (state.writing) {
  9910. break;
  9911. }
  9912. }
  9913. if (entry === null) state.lastBufferedRequest = null;
  9914. }
  9915. state.bufferedRequestCount = 0;
  9916. state.bufferedRequest = entry;
  9917. state.bufferProcessing = false;
  9918. }
  9919. Writable.prototype._write = function (chunk, encoding, cb) {
  9920. cb(new Error('not implemented'));
  9921. };
  9922. Writable.prototype._writev = null;
  9923. Writable.prototype.end = function (chunk, encoding, cb) {
  9924. var state = this._writableState;
  9925. if (typeof chunk === 'function') {
  9926. cb = chunk;
  9927. chunk = null;
  9928. encoding = null;
  9929. } else if (typeof encoding === 'function') {
  9930. cb = encoding;
  9931. encoding = null;
  9932. }
  9933. if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
  9934. // .end() fully uncorks
  9935. if (state.corked) {
  9936. state.corked = 1;
  9937. this.uncork();
  9938. }
  9939. // ignore unnecessary end() calls.
  9940. if (!state.ending && !state.finished) endWritable(this, state, cb);
  9941. };
  9942. function needFinish(state) {
  9943. return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
  9944. }
  9945. function prefinish(stream, state) {
  9946. if (!state.prefinished) {
  9947. state.prefinished = true;
  9948. stream.emit('prefinish');
  9949. }
  9950. }
  9951. function finishMaybe(stream, state) {
  9952. var need = needFinish(state);
  9953. if (need) {
  9954. if (state.pendingcb === 0) {
  9955. prefinish(stream, state);
  9956. state.finished = true;
  9957. stream.emit('finish');
  9958. } else {
  9959. prefinish(stream, state);
  9960. }
  9961. }
  9962. return need;
  9963. }
  9964. function endWritable(stream, state, cb) {
  9965. state.ending = true;
  9966. finishMaybe(stream, state);
  9967. if (cb) {
  9968. if (state.finished) processNextTick(cb);else stream.once('finish', cb);
  9969. }
  9970. state.ended = true;
  9971. stream.writable = false;
  9972. }
  9973. // It seems a linked list but it is not
  9974. // there will be only 2 of these for each stream
  9975. function CorkedRequest(state) {
  9976. var _this = this;
  9977. this.next = null;
  9978. this.entry = null;
  9979. this.finish = function (err) {
  9980. var entry = _this.entry;
  9981. _this.entry = null;
  9982. while (entry) {
  9983. var cb = entry.callback;
  9984. state.pendingcb--;
  9985. cb(err);
  9986. entry = entry.next;
  9987. }
  9988. if (state.corkedRequestsFree) {
  9989. state.corkedRequestsFree.next = _this;
  9990. } else {
  9991. state.corkedRequestsFree = _this;
  9992. }
  9993. };
  9994. }
  9995. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(31).setImmediate))
  9996. /***/ },
  9997. /* 48 */
  9998. /***/ function(module, exports, __webpack_require__) {
  9999. // Copyright Joyent, Inc. and other Node contributors.
  10000. //
  10001. // Permission is hereby granted, free of charge, to any person obtaining a
  10002. // copy of this software and associated documentation files (the
  10003. // "Software"), to deal in the Software without restriction, including
  10004. // without limitation the rights to use, copy, modify, merge, publish,
  10005. // distribute, sublicense, and/or sell copies of the Software, and to permit
  10006. // persons to whom the Software is furnished to do so, subject to the
  10007. // following conditions:
  10008. //
  10009. // The above copyright notice and this permission notice shall be included
  10010. // in all copies or substantial portions of the Software.
  10011. //
  10012. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  10013. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  10014. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  10015. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  10016. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  10017. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  10018. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  10019. var Buffer = __webpack_require__(0).Buffer;
  10020. var isBufferEncoding = Buffer.isEncoding
  10021. || function(encoding) {
  10022. switch (encoding && encoding.toLowerCase()) {
  10023. case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
  10024. default: return false;
  10025. }
  10026. }
  10027. function assertEncoding(encoding) {
  10028. if (encoding && !isBufferEncoding(encoding)) {
  10029. throw new Error('Unknown encoding: ' + encoding);
  10030. }
  10031. }
  10032. // StringDecoder provides an interface for efficiently splitting a series of
  10033. // buffers into a series of JS strings without breaking apart multi-byte
  10034. // characters. CESU-8 is handled as part of the UTF-8 encoding.
  10035. //
  10036. // @TODO Handling all encodings inside a single object makes it very difficult
  10037. // to reason about this code, so it should be split up in the future.
  10038. // @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
  10039. // points as used by CESU-8.
  10040. var StringDecoder = exports.StringDecoder = function(encoding) {
  10041. this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
  10042. assertEncoding(encoding);
  10043. switch (this.encoding) {
  10044. case 'utf8':
  10045. // CESU-8 represents each of Surrogate Pair by 3-bytes
  10046. this.surrogateSize = 3;
  10047. break;
  10048. case 'ucs2':
  10049. case 'utf16le':
  10050. // UTF-16 represents each of Surrogate Pair by 2-bytes
  10051. this.surrogateSize = 2;
  10052. this.detectIncompleteChar = utf16DetectIncompleteChar;
  10053. break;
  10054. case 'base64':
  10055. // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
  10056. this.surrogateSize = 3;
  10057. this.detectIncompleteChar = base64DetectIncompleteChar;
  10058. break;
  10059. default:
  10060. this.write = passThroughWrite;
  10061. return;
  10062. }
  10063. // Enough space to store all bytes of a single character. UTF-8 needs 4
  10064. // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
  10065. this.charBuffer = new Buffer(6);
  10066. // Number of bytes received for the current incomplete multi-byte character.
  10067. this.charReceived = 0;
  10068. // Number of bytes expected for the current incomplete multi-byte character.
  10069. this.charLength = 0;
  10070. };
  10071. // write decodes the given buffer and returns it as JS string that is
  10072. // guaranteed to not contain any partial multi-byte characters. Any partial
  10073. // character found at the end of the buffer is buffered up, and will be
  10074. // returned when calling write again with the remaining bytes.
  10075. //
  10076. // Note: Converting a Buffer containing an orphan surrogate to a String
  10077. // currently works, but converting a String to a Buffer (via `new Buffer`, or
  10078. // Buffer#write) will replace incomplete surrogates with the unicode
  10079. // replacement character. See https://codereview.chromium.org/121173009/ .
  10080. StringDecoder.prototype.write = function(buffer) {
  10081. var charStr = '';
  10082. // if our last write ended with an incomplete multibyte character
  10083. while (this.charLength) {
  10084. // determine how many remaining bytes this buffer has to offer for this char
  10085. var available = (buffer.length >= this.charLength - this.charReceived) ?
  10086. this.charLength - this.charReceived :
  10087. buffer.length;
  10088. // add the new bytes to the char buffer
  10089. buffer.copy(this.charBuffer, this.charReceived, 0, available);
  10090. this.charReceived += available;
  10091. if (this.charReceived < this.charLength) {
  10092. // still not enough chars in this buffer? wait for more ...
  10093. return '';
  10094. }
  10095. // remove bytes belonging to the current character from the buffer
  10096. buffer = buffer.slice(available, buffer.length);
  10097. // get the character that was split
  10098. charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
  10099. // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
  10100. var charCode = charStr.charCodeAt(charStr.length - 1);
  10101. if (charCode >= 0xD800 && charCode <= 0xDBFF) {
  10102. this.charLength += this.surrogateSize;
  10103. charStr = '';
  10104. continue;
  10105. }
  10106. this.charReceived = this.charLength = 0;
  10107. // if there are no more bytes in this buffer, just emit our char
  10108. if (buffer.length === 0) {
  10109. return charStr;
  10110. }
  10111. break;
  10112. }
  10113. // determine and set charLength / charReceived
  10114. this.detectIncompleteChar(buffer);
  10115. var end = buffer.length;
  10116. if (this.charLength) {
  10117. // buffer the incomplete character bytes we got
  10118. buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
  10119. end -= this.charReceived;
  10120. }
  10121. charStr += buffer.toString(this.encoding, 0, end);
  10122. var end = charStr.length - 1;
  10123. var charCode = charStr.charCodeAt(end);
  10124. // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
  10125. if (charCode >= 0xD800 && charCode <= 0xDBFF) {
  10126. var size = this.surrogateSize;
  10127. this.charLength += size;
  10128. this.charReceived += size;
  10129. this.charBuffer.copy(this.charBuffer, size, 0, size);
  10130. buffer.copy(this.charBuffer, 0, 0, size);
  10131. return charStr.substring(0, end);
  10132. }
  10133. // or just emit the charStr
  10134. return charStr;
  10135. };
  10136. // detectIncompleteChar determines if there is an incomplete UTF-8 character at
  10137. // the end of the given buffer. If so, it sets this.charLength to the byte
  10138. // length that character, and sets this.charReceived to the number of bytes
  10139. // that are available for this character.
  10140. StringDecoder.prototype.detectIncompleteChar = function(buffer) {
  10141. // determine how many bytes we have to check at the end of this buffer
  10142. var i = (buffer.length >= 3) ? 3 : buffer.length;
  10143. // Figure out if one of the last i bytes of our buffer announces an
  10144. // incomplete char.
  10145. for (; i > 0; i--) {
  10146. var c = buffer[buffer.length - i];
  10147. // See http://en.wikipedia.org/wiki/UTF-8#Description
  10148. // 110XXXXX
  10149. if (i == 1 && c >> 5 == 0x06) {
  10150. this.charLength = 2;
  10151. break;
  10152. }
  10153. // 1110XXXX
  10154. if (i <= 2 && c >> 4 == 0x0E) {
  10155. this.charLength = 3;
  10156. break;
  10157. }
  10158. // 11110XXX
  10159. if (i <= 3 && c >> 3 == 0x1E) {
  10160. this.charLength = 4;
  10161. break;
  10162. }
  10163. }
  10164. this.charReceived = i;
  10165. };
  10166. StringDecoder.prototype.end = function(buffer) {
  10167. var res = '';
  10168. if (buffer && buffer.length)
  10169. res = this.write(buffer);
  10170. if (this.charReceived) {
  10171. var cr = this.charReceived;
  10172. var buf = this.charBuffer;
  10173. var enc = this.encoding;
  10174. res += buf.slice(0, cr).toString(enc);
  10175. }
  10176. return res;
  10177. };
  10178. function passThroughWrite(buffer) {
  10179. return buffer.toString(this.encoding);
  10180. }
  10181. function utf16DetectIncompleteChar(buffer) {
  10182. this.charReceived = buffer.length % 2;
  10183. this.charLength = this.charReceived ? 2 : 0;
  10184. }
  10185. function base64DetectIncompleteChar(buffer) {
  10186. this.charReceived = buffer.length % 3;
  10187. this.charLength = this.charReceived ? 3 : 0;
  10188. }
  10189. /***/ },
  10190. /* 49 */
  10191. /***/ function(module, exports, __webpack_require__) {
  10192. module.exports = __webpack_require__(85);
  10193. /***/ },
  10194. /* 50 */
  10195. /***/ function(module, exports, __webpack_require__) {
  10196. "use strict";
  10197. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  10198. var utils = __webpack_require__(2);
  10199. var settle = __webpack_require__(91);
  10200. var buildURL = __webpack_require__(94);
  10201. var parseHeaders = __webpack_require__(100);
  10202. var isURLSameOrigin = __webpack_require__(98);
  10203. var createError = __webpack_require__(53);
  10204. var btoa = (typeof window !== 'undefined' && window.btoa) || __webpack_require__(93);
  10205. module.exports = function xhrAdapter(config) {
  10206. return new Promise(function dispatchXhrRequest(resolve, reject) {
  10207. var requestData = config.data;
  10208. var requestHeaders = config.headers;
  10209. if (utils.isFormData(requestData)) {
  10210. delete requestHeaders['Content-Type']; // Let the browser set it
  10211. }
  10212. var request = new XMLHttpRequest();
  10213. var loadEvent = 'onreadystatechange';
  10214. var xDomain = false;
  10215. // For IE 8/9 CORS support
  10216. // Only supports POST and GET calls and doesn't returns the response headers.
  10217. // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.
  10218. if (process.env.NODE_ENV !== 'test' &&
  10219. typeof window !== 'undefined' &&
  10220. window.XDomainRequest && !('withCredentials' in request) &&
  10221. !isURLSameOrigin(config.url)) {
  10222. request = new window.XDomainRequest();
  10223. loadEvent = 'onload';
  10224. xDomain = true;
  10225. request.onprogress = function handleProgress() {};
  10226. request.ontimeout = function handleTimeout() {};
  10227. }
  10228. // HTTP basic authentication
  10229. if (config.auth) {
  10230. var username = config.auth.username || '';
  10231. var password = config.auth.password || '';
  10232. requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
  10233. }
  10234. request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);
  10235. // Set the request timeout in MS
  10236. request.timeout = config.timeout;
  10237. // Listen for ready state
  10238. request[loadEvent] = function handleLoad() {
  10239. if (!request || (request.readyState !== 4 && !xDomain)) {
  10240. return;
  10241. }
  10242. // The request errored out and we didn't get a response, this will be
  10243. // handled by onerror instead
  10244. // With one exception: request that using file: protocol, most browsers
  10245. // will return status as 0 even though it's a successful request
  10246. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
  10247. return;
  10248. }
  10249. // Prepare the response
  10250. var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
  10251. var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
  10252. var response = {
  10253. data: responseData,
  10254. // IE sends 1223 instead of 204 (https://github.com/mzabriskie/axios/issues/201)
  10255. status: request.status === 1223 ? 204 : request.status,
  10256. statusText: request.status === 1223 ? 'No Content' : request.statusText,
  10257. headers: responseHeaders,
  10258. config: config,
  10259. request: request
  10260. };
  10261. settle(resolve, reject, response);
  10262. // Clean up request
  10263. request = null;
  10264. };
  10265. // Handle low level network errors
  10266. request.onerror = function handleError() {
  10267. // Real errors are hidden from us by the browser
  10268. // onerror should only fire if it's a network error
  10269. reject(createError('Network Error', config));
  10270. // Clean up request
  10271. request = null;
  10272. };
  10273. // Handle timeout
  10274. request.ontimeout = function handleTimeout() {
  10275. reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED'));
  10276. // Clean up request
  10277. request = null;
  10278. };
  10279. // Add xsrf header
  10280. // This is only done if running in a standard browser environment.
  10281. // Specifically not if we're in a web worker, or react-native.
  10282. if (utils.isStandardBrowserEnv()) {
  10283. var cookies = __webpack_require__(96);
  10284. // Add xsrf header
  10285. var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?
  10286. cookies.read(config.xsrfCookieName) :
  10287. undefined;
  10288. if (xsrfValue) {
  10289. requestHeaders[config.xsrfHeaderName] = xsrfValue;
  10290. }
  10291. }
  10292. // Add headers to the request
  10293. if ('setRequestHeader' in request) {
  10294. utils.forEach(requestHeaders, function setRequestHeader(val, key) {
  10295. if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
  10296. // Remove Content-Type if data is undefined
  10297. delete requestHeaders[key];
  10298. } else {
  10299. // Otherwise add header to the request
  10300. request.setRequestHeader(key, val);
  10301. }
  10302. });
  10303. }
  10304. // Add withCredentials to request if needed
  10305. if (config.withCredentials) {
  10306. request.withCredentials = true;
  10307. }
  10308. // Add responseType to request if needed
  10309. if (config.responseType) {
  10310. try {
  10311. request.responseType = config.responseType;
  10312. } catch (e) {
  10313. if (request.responseType !== 'json') {
  10314. throw e;
  10315. }
  10316. }
  10317. }
  10318. // Handle progress if needed
  10319. if (typeof config.onDownloadProgress === 'function') {
  10320. request.addEventListener('progress', config.onDownloadProgress);
  10321. }
  10322. // Not all browsers support upload events
  10323. if (typeof config.onUploadProgress === 'function' && request.upload) {
  10324. request.upload.addEventListener('progress', config.onUploadProgress);
  10325. }
  10326. if (config.cancelToken) {
  10327. // Handle cancellation
  10328. config.cancelToken.promise.then(function onCanceled(cancel) {
  10329. if (!request) {
  10330. return;
  10331. }
  10332. request.abort();
  10333. reject(cancel);
  10334. // Clean up request
  10335. request = null;
  10336. });
  10337. }
  10338. if (requestData === undefined) {
  10339. requestData = null;
  10340. }
  10341. // Send the request
  10342. request.send(requestData);
  10343. });
  10344. };
  10345. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  10346. /***/ },
  10347. /* 51 */
  10348. /***/ function(module, exports) {
  10349. "use strict";
  10350. 'use strict';
  10351. /**
  10352. * A `Cancel` is an object that is thrown when an operation is canceled.
  10353. *
  10354. * @class
  10355. * @param {string=} message The message.
  10356. */
  10357. function Cancel(message) {
  10358. this.message = message;
  10359. }
  10360. Cancel.prototype.toString = function toString() {
  10361. return 'Cancel' + (this.message ? ': ' + this.message : '');
  10362. };
  10363. Cancel.prototype.__CANCEL__ = true;
  10364. module.exports = Cancel;
  10365. /***/ },
  10366. /* 52 */
  10367. /***/ function(module, exports) {
  10368. "use strict";
  10369. 'use strict';
  10370. module.exports = function isCancel(value) {
  10371. return !!(value && value.__CANCEL__);
  10372. };
  10373. /***/ },
  10374. /* 53 */
  10375. /***/ function(module, exports, __webpack_require__) {
  10376. "use strict";
  10377. 'use strict';
  10378. var enhanceError = __webpack_require__(90);
  10379. /**
  10380. * Create an Error with the specified message, config, error code, and response.
  10381. *
  10382. * @param {string} message The error message.
  10383. * @param {Object} config The config.
  10384. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  10385. @ @param {Object} [response] The response.
  10386. * @returns {Error} The created error.
  10387. */
  10388. module.exports = function createError(message, config, code, response) {
  10389. var error = new Error(message);
  10390. return enhanceError(error, config, code, response);
  10391. };
  10392. /***/ },
  10393. /* 54 */
  10394. /***/ function(module, exports, __webpack_require__) {
  10395. "use strict";
  10396. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  10397. var utils = __webpack_require__(2);
  10398. var normalizeHeaderName = __webpack_require__(99);
  10399. var PROTECTION_PREFIX = /^\)\]\}',?\n/;
  10400. var DEFAULT_CONTENT_TYPE = {
  10401. 'Content-Type': 'application/x-www-form-urlencoded'
  10402. };
  10403. function setContentTypeIfUnset(headers, value) {
  10404. if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
  10405. headers['Content-Type'] = value;
  10406. }
  10407. }
  10408. function getDefaultAdapter() {
  10409. var adapter;
  10410. if (typeof XMLHttpRequest !== 'undefined') {
  10411. // For browsers use XHR adapter
  10412. adapter = __webpack_require__(50);
  10413. } else if (typeof process !== 'undefined') {
  10414. // For node use HTTP adapter
  10415. adapter = __webpack_require__(50);
  10416. }
  10417. return adapter;
  10418. }
  10419. module.exports = {
  10420. adapter: getDefaultAdapter(),
  10421. transformRequest: [function transformRequest(data, headers) {
  10422. normalizeHeaderName(headers, 'Content-Type');
  10423. if (utils.isFormData(data) ||
  10424. utils.isArrayBuffer(data) ||
  10425. utils.isStream(data) ||
  10426. utils.isFile(data) ||
  10427. utils.isBlob(data)
  10428. ) {
  10429. return data;
  10430. }
  10431. if (utils.isArrayBufferView(data)) {
  10432. return data.buffer;
  10433. }
  10434. if (utils.isURLSearchParams(data)) {
  10435. setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
  10436. return data.toString();
  10437. }
  10438. if (utils.isObject(data)) {
  10439. setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
  10440. return JSON.stringify(data);
  10441. }
  10442. return data;
  10443. }],
  10444. transformResponse: [function transformResponse(data) {
  10445. /*eslint no-param-reassign:0*/
  10446. if (typeof data === 'string') {
  10447. data = data.replace(PROTECTION_PREFIX, '');
  10448. try {
  10449. data = JSON.parse(data);
  10450. } catch (e) { /* Ignore */ }
  10451. }
  10452. return data;
  10453. }],
  10454. headers: {
  10455. common: {
  10456. 'Accept': 'application/json, text/plain, */*'
  10457. },
  10458. patch: utils.merge(DEFAULT_CONTENT_TYPE),
  10459. post: utils.merge(DEFAULT_CONTENT_TYPE),
  10460. put: utils.merge(DEFAULT_CONTENT_TYPE)
  10461. },
  10462. timeout: 0,
  10463. xsrfCookieName: 'XSRF-TOKEN',
  10464. xsrfHeaderName: 'X-XSRF-TOKEN',
  10465. maxContentLength: -1,
  10466. validateStatus: function validateStatus(status) {
  10467. return status >= 200 && status < 300;
  10468. }
  10469. };
  10470. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  10471. /***/ },
  10472. /* 55 */
  10473. /***/ function(module, exports) {
  10474. "use strict";
  10475. 'use strict';
  10476. module.exports = function bind(fn, thisArg) {
  10477. return function wrap() {
  10478. var args = new Array(arguments.length);
  10479. for (var i = 0; i < args.length; i++) {
  10480. args[i] = arguments[i];
  10481. }
  10482. return fn.apply(thisArg, args);
  10483. };
  10484. };
  10485. /***/ },
  10486. /* 56 */
  10487. /***/ function(module, exports, __webpack_require__) {
  10488. "use strict";
  10489. "use strict";
  10490. Object.defineProperty(exports, "__esModule", {
  10491. value: true
  10492. });
  10493. var _classCallCheck2 = __webpack_require__(14);
  10494. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  10495. var _createClass2 = __webpack_require__(15);
  10496. var _createClass3 = _interopRequireDefault(_createClass2);
  10497. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10498. var Password = function () {
  10499. function Password(password) {
  10500. (0, _classCallCheck3.default)(this, Password);
  10501. this.password = password;
  10502. this.options = {
  10503. uppercase: password.uppercase,
  10504. lowercase: password.lowercase,
  10505. numbers: password.numbers,
  10506. symbols: password.symbols,
  10507. length: password.length,
  10508. counter: password.counter
  10509. };
  10510. }
  10511. (0, _createClass3.default)(Password, [{
  10512. key: "isNewPassword",
  10513. value: function isNewPassword(passwords) {
  10514. var _this = this;
  10515. var isNew = true;
  10516. passwords.forEach(function (pwd) {
  10517. if (pwd.site === _this.password.site && pwd.login === _this.password.login) {
  10518. isNew = false;
  10519. }
  10520. });
  10521. return isNew;
  10522. }
  10523. }, {
  10524. key: "json",
  10525. value: function json() {
  10526. return this.password;
  10527. }
  10528. }]);
  10529. return Password;
  10530. }();
  10531. exports.default = Password;
  10532. /***/ },
  10533. /* 57 */
  10534. /***/ function(module, exports, __webpack_require__) {
  10535. module.exports = { "default": __webpack_require__(124), __esModule: true };
  10536. /***/ },
  10537. /* 58 */
  10538. /***/ function(module, exports, __webpack_require__) {
  10539. module.exports = { "default": __webpack_require__(125), __esModule: true };
  10540. /***/ },
  10541. /* 59 */
  10542. /***/ function(module, exports, __webpack_require__) {
  10543. // getting tag from 19.1.3.6 Object.prototype.toString()
  10544. var cof = __webpack_require__(25)
  10545. , TAG = __webpack_require__(3)('toStringTag')
  10546. // ES3 wrong here
  10547. , ARG = cof(function(){ return arguments; }()) == 'Arguments';
  10548. // fallback for IE11 Script Access Denied error
  10549. var tryGet = function(it, key){
  10550. try {
  10551. return it[key];
  10552. } catch(e){ /* empty */ }
  10553. };
  10554. module.exports = function(it){
  10555. var O, T, B;
  10556. return it === undefined ? 'Undefined' : it === null ? 'Null'
  10557. // @@toStringTag case
  10558. : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
  10559. // builtinTag case
  10560. : ARG ? cof(O)
  10561. // ES3 arguments fallback
  10562. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  10563. };
  10564. /***/ },
  10565. /* 60 */
  10566. /***/ function(module, exports) {
  10567. // IE 8- don't enum bug keys
  10568. module.exports = (
  10569. 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
  10570. ).split(',');
  10571. /***/ },
  10572. /* 61 */
  10573. /***/ function(module, exports, __webpack_require__) {
  10574. module.exports = __webpack_require__(4).document && document.documentElement;
  10575. /***/ },
  10576. /* 62 */
  10577. /***/ function(module, exports, __webpack_require__) {
  10578. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  10579. var cof = __webpack_require__(25);
  10580. module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){
  10581. return cof(it) == 'String' ? it.split('') : Object(it);
  10582. };
  10583. /***/ },
  10584. /* 63 */
  10585. /***/ function(module, exports, __webpack_require__) {
  10586. "use strict";
  10587. 'use strict';
  10588. var LIBRARY = __webpack_require__(64)
  10589. , $export = __webpack_require__(27)
  10590. , redefine = __webpack_require__(146)
  10591. , hide = __webpack_require__(11)
  10592. , has = __webpack_require__(28)
  10593. , Iterators = __webpack_require__(16)
  10594. , $iterCreate = __webpack_require__(134)
  10595. , setToStringTag = __webpack_require__(39)
  10596. , getPrototypeOf = __webpack_require__(142)
  10597. , ITERATOR = __webpack_require__(3)('iterator')
  10598. , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next`
  10599. , FF_ITERATOR = '@@iterator'
  10600. , KEYS = 'keys'
  10601. , VALUES = 'values';
  10602. var returnThis = function(){ return this; };
  10603. module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){
  10604. $iterCreate(Constructor, NAME, next);
  10605. var getMethod = function(kind){
  10606. if(!BUGGY && kind in proto)return proto[kind];
  10607. switch(kind){
  10608. case KEYS: return function keys(){ return new Constructor(this, kind); };
  10609. case VALUES: return function values(){ return new Constructor(this, kind); };
  10610. } return function entries(){ return new Constructor(this, kind); };
  10611. };
  10612. var TAG = NAME + ' Iterator'
  10613. , DEF_VALUES = DEFAULT == VALUES
  10614. , VALUES_BUG = false
  10615. , proto = Base.prototype
  10616. , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]
  10617. , $default = $native || getMethod(DEFAULT)
  10618. , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined
  10619. , $anyNative = NAME == 'Array' ? proto.entries || $native : $native
  10620. , methods, key, IteratorPrototype;
  10621. // Fix native
  10622. if($anyNative){
  10623. IteratorPrototype = getPrototypeOf($anyNative.call(new Base));
  10624. if(IteratorPrototype !== Object.prototype){
  10625. // Set @@toStringTag to native iterators
  10626. setToStringTag(IteratorPrototype, TAG, true);
  10627. // fix for some old engines
  10628. if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis);
  10629. }
  10630. }
  10631. // fix Array#{values, @@iterator}.name in V8 / FF
  10632. if(DEF_VALUES && $native && $native.name !== VALUES){
  10633. VALUES_BUG = true;
  10634. $default = function values(){ return $native.call(this); };
  10635. }
  10636. // Define iterator
  10637. if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){
  10638. hide(proto, ITERATOR, $default);
  10639. }
  10640. // Plug for library
  10641. Iterators[NAME] = $default;
  10642. Iterators[TAG] = returnThis;
  10643. if(DEFAULT){
  10644. methods = {
  10645. values: DEF_VALUES ? $default : getMethod(VALUES),
  10646. keys: IS_SET ? $default : getMethod(KEYS),
  10647. entries: $entries
  10648. };
  10649. if(FORCED)for(key in methods){
  10650. if(!(key in proto))redefine(proto, key, methods[key]);
  10651. } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  10652. }
  10653. return methods;
  10654. };
  10655. /***/ },
  10656. /* 64 */
  10657. /***/ function(module, exports) {
  10658. module.exports = true;
  10659. /***/ },
  10660. /* 65 */
  10661. /***/ function(module, exports, __webpack_require__) {
  10662. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  10663. var $keys = __webpack_require__(143)
  10664. , enumBugKeys = __webpack_require__(60);
  10665. module.exports = Object.keys || function keys(O){
  10666. return $keys(O, enumBugKeys);
  10667. };
  10668. /***/ },
  10669. /* 66 */
  10670. /***/ function(module, exports) {
  10671. module.exports = function(bitmap, value){
  10672. return {
  10673. enumerable : !(bitmap & 1),
  10674. configurable: !(bitmap & 2),
  10675. writable : !(bitmap & 4),
  10676. value : value
  10677. };
  10678. };
  10679. /***/ },
  10680. /* 67 */
  10681. /***/ function(module, exports, __webpack_require__) {
  10682. var global = __webpack_require__(4)
  10683. , SHARED = '__core-js_shared__'
  10684. , store = global[SHARED] || (global[SHARED] = {});
  10685. module.exports = function(key){
  10686. return store[key] || (store[key] = {});
  10687. };
  10688. /***/ },
  10689. /* 68 */
  10690. /***/ function(module, exports, __webpack_require__) {
  10691. var ctx = __webpack_require__(26)
  10692. , invoke = __webpack_require__(131)
  10693. , html = __webpack_require__(61)
  10694. , cel = __webpack_require__(37)
  10695. , global = __webpack_require__(4)
  10696. , process = global.process
  10697. , setTask = global.setImmediate
  10698. , clearTask = global.clearImmediate
  10699. , MessageChannel = global.MessageChannel
  10700. , counter = 0
  10701. , queue = {}
  10702. , ONREADYSTATECHANGE = 'onreadystatechange'
  10703. , defer, channel, port;
  10704. var run = function(){
  10705. var id = +this;
  10706. if(queue.hasOwnProperty(id)){
  10707. var fn = queue[id];
  10708. delete queue[id];
  10709. fn();
  10710. }
  10711. };
  10712. var listener = function(event){
  10713. run.call(event.data);
  10714. };
  10715. // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  10716. if(!setTask || !clearTask){
  10717. setTask = function setImmediate(fn){
  10718. var args = [], i = 1;
  10719. while(arguments.length > i)args.push(arguments[i++]);
  10720. queue[++counter] = function(){
  10721. invoke(typeof fn == 'function' ? fn : Function(fn), args);
  10722. };
  10723. defer(counter);
  10724. return counter;
  10725. };
  10726. clearTask = function clearImmediate(id){
  10727. delete queue[id];
  10728. };
  10729. // Node.js 0.8-
  10730. if(__webpack_require__(25)(process) == 'process'){
  10731. defer = function(id){
  10732. process.nextTick(ctx(run, id, 1));
  10733. };
  10734. // Browsers with MessageChannel, includes WebWorkers
  10735. } else if(MessageChannel){
  10736. channel = new MessageChannel;
  10737. port = channel.port2;
  10738. channel.port1.onmessage = listener;
  10739. defer = ctx(port.postMessage, port, 1);
  10740. // Browsers with postMessage, skip WebWorkers
  10741. // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  10742. } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){
  10743. defer = function(id){
  10744. global.postMessage(id + '', '*');
  10745. };
  10746. global.addEventListener('message', listener, false);
  10747. // IE8-
  10748. } else if(ONREADYSTATECHANGE in cel('script')){
  10749. defer = function(id){
  10750. html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){
  10751. html.removeChild(this);
  10752. run.call(id);
  10753. };
  10754. };
  10755. // Rest old browsers
  10756. } else {
  10757. defer = function(id){
  10758. setTimeout(ctx(run, id, 1), 0);
  10759. };
  10760. }
  10761. }
  10762. module.exports = {
  10763. set: setTask,
  10764. clear: clearTask
  10765. };
  10766. /***/ },
  10767. /* 69 */
  10768. /***/ function(module, exports, __webpack_require__) {
  10769. // 7.1.15 ToLength
  10770. var toInteger = __webpack_require__(41)
  10771. , min = Math.min;
  10772. module.exports = function(it){
  10773. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  10774. };
  10775. /***/ },
  10776. /* 70 */
  10777. /***/ function(module, exports, __webpack_require__) {
  10778. // 7.1.13 ToObject(argument)
  10779. var defined = __webpack_require__(36);
  10780. module.exports = function(it){
  10781. return Object(defined(it));
  10782. };
  10783. /***/ },
  10784. /* 71 */
  10785. /***/ function(module, exports) {
  10786. var id = 0
  10787. , px = Math.random();
  10788. module.exports = function(key){
  10789. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  10790. };
  10791. /***/ },
  10792. /* 72 */
  10793. /***/ function(module, exports, __webpack_require__) {
  10794. "use strict";
  10795. /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
  10796. var createHash = __webpack_require__(160);
  10797. var inherits = __webpack_require__(1)
  10798. var Transform = __webpack_require__(20).Transform
  10799. var ZEROS = new Buffer(128)
  10800. ZEROS.fill(0)
  10801. function Hmac(alg, key) {
  10802. Transform.call(this)
  10803. alg = alg.toLowerCase()
  10804. if (typeof key === 'string') {
  10805. key = new Buffer(key)
  10806. }
  10807. var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64
  10808. this._alg = alg
  10809. this._key = key
  10810. if (key.length > blocksize) {
  10811. key = createHash(alg).update(key).digest()
  10812. } else if (key.length < blocksize) {
  10813. key = Buffer.concat([key, ZEROS], blocksize)
  10814. }
  10815. var ipad = this._ipad = new Buffer(blocksize)
  10816. var opad = this._opad = new Buffer(blocksize)
  10817. for (var i = 0; i < blocksize; i++) {
  10818. ipad[i] = key[i] ^ 0x36
  10819. opad[i] = key[i] ^ 0x5C
  10820. }
  10821. this._hash = createHash(alg).update(ipad)
  10822. }
  10823. inherits(Hmac, Transform)
  10824. Hmac.prototype.update = function (data, enc) {
  10825. this._hash.update(data, enc)
  10826. return this
  10827. }
  10828. Hmac.prototype._transform = function (data, _, next) {
  10829. this._hash.update(data)
  10830. next()
  10831. }
  10832. Hmac.prototype._flush = function (next) {
  10833. this.push(this.digest())
  10834. next()
  10835. }
  10836. Hmac.prototype.digest = function (enc) {
  10837. var h = this._hash.digest()
  10838. return createHash(this._alg).update(this._opad).update(h).digest(enc)
  10839. }
  10840. module.exports = function createHmac(alg, key) {
  10841. return new Hmac(alg, key)
  10842. }
  10843. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  10844. /***/ },
  10845. /* 73 */
  10846. /***/ function(module, exports) {
  10847. var toString = {}.toString;
  10848. module.exports = Array.isArray || function (arr) {
  10849. return toString.call(arr) == '[object Array]';
  10850. };
  10851. /***/ },
  10852. /* 74 */
  10853. /***/ function(module, exports, __webpack_require__) {
  10854. "use strict";
  10855. 'use strict';
  10856. module.exports = typeof Promise === 'function' ? Promise : __webpack_require__(182);
  10857. /***/ },
  10858. /* 75 */
  10859. /***/ function(module, exports, __webpack_require__) {
  10860. "use strict";
  10861. // a passthrough stream.
  10862. // basically just the most minimal sort of Transform stream.
  10863. // Every written chunk gets output as-is.
  10864. 'use strict';
  10865. module.exports = PassThrough;
  10866. var Transform = __webpack_require__(46);
  10867. /*<replacement>*/
  10868. var util = __webpack_require__(18);
  10869. util.inherits = __webpack_require__(1);
  10870. /*</replacement>*/
  10871. util.inherits(PassThrough, Transform);
  10872. function PassThrough(options) {
  10873. if (!(this instanceof PassThrough)) return new PassThrough(options);
  10874. Transform.call(this, options);
  10875. }
  10876. PassThrough.prototype._transform = function (chunk, encoding, cb) {
  10877. cb(null, chunk);
  10878. };
  10879. /***/ },
  10880. /* 76 */
  10881. /***/ function(module, exports, __webpack_require__) {
  10882. "use strict";
  10883. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  10884. module.exports = Readable;
  10885. /*<replacement>*/
  10886. var processNextTick = __webpack_require__(45);
  10887. /*</replacement>*/
  10888. /*<replacement>*/
  10889. var isArray = __webpack_require__(73);
  10890. /*</replacement>*/
  10891. Readable.ReadableState = ReadableState;
  10892. /*<replacement>*/
  10893. var EE = __webpack_require__(30).EventEmitter;
  10894. var EElistenerCount = function (emitter, type) {
  10895. return emitter.listeners(type).length;
  10896. };
  10897. /*</replacement>*/
  10898. /*<replacement>*/
  10899. var Stream;
  10900. (function () {
  10901. try {
  10902. Stream = __webpack_require__(20);
  10903. } catch (_) {} finally {
  10904. if (!Stream) Stream = __webpack_require__(30).EventEmitter;
  10905. }
  10906. })();
  10907. /*</replacement>*/
  10908. var Buffer = __webpack_require__(0).Buffer;
  10909. /*<replacement>*/
  10910. var bufferShim = __webpack_require__(34);
  10911. /*</replacement>*/
  10912. /*<replacement>*/
  10913. var util = __webpack_require__(18);
  10914. util.inherits = __webpack_require__(1);
  10915. /*</replacement>*/
  10916. /*<replacement>*/
  10917. var debugUtil = __webpack_require__(224);
  10918. var debug = void 0;
  10919. if (debugUtil && debugUtil.debuglog) {
  10920. debug = debugUtil.debuglog('stream');
  10921. } else {
  10922. debug = function () {};
  10923. }
  10924. /*</replacement>*/
  10925. var BufferList = __webpack_require__(184);
  10926. var StringDecoder;
  10927. util.inherits(Readable, Stream);
  10928. function prependListener(emitter, event, fn) {
  10929. if (typeof emitter.prependListener === 'function') {
  10930. return emitter.prependListener(event, fn);
  10931. } else {
  10932. // This is a hack to make sure that our error handler is attached before any
  10933. // userland ones. NEVER DO THIS. This is here only because this code needs
  10934. // to continue to work with older versions of Node.js that do not include
  10935. // the prependListener() method. The goal is to eventually remove this hack.
  10936. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
  10937. }
  10938. }
  10939. var Duplex;
  10940. function ReadableState(options, stream) {
  10941. Duplex = Duplex || __webpack_require__(7);
  10942. options = options || {};
  10943. // object stream flag. Used to make read(n) ignore n and to
  10944. // make all the buffer merging and length checks go away
  10945. this.objectMode = !!options.objectMode;
  10946. if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
  10947. // the point at which it stops calling _read() to fill the buffer
  10948. // Note: 0 is a valid value, means "don't call _read preemptively ever"
  10949. var hwm = options.highWaterMark;
  10950. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  10951. this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
  10952. // cast to ints.
  10953. this.highWaterMark = ~ ~this.highWaterMark;
  10954. // A linked list is used to store data chunks instead of an array because the
  10955. // linked list can remove elements from the beginning faster than
  10956. // array.shift()
  10957. this.buffer = new BufferList();
  10958. this.length = 0;
  10959. this.pipes = null;
  10960. this.pipesCount = 0;
  10961. this.flowing = null;
  10962. this.ended = false;
  10963. this.endEmitted = false;
  10964. this.reading = false;
  10965. // a flag to be able to tell if the onwrite cb is called immediately,
  10966. // or on a later tick. We set this to true at first, because any
  10967. // actions that shouldn't happen until "later" should generally also
  10968. // not happen before the first write call.
  10969. this.sync = true;
  10970. // whenever we return null, then we set a flag to say
  10971. // that we're awaiting a 'readable' event emission.
  10972. this.needReadable = false;
  10973. this.emittedReadable = false;
  10974. this.readableListening = false;
  10975. this.resumeScheduled = false;
  10976. // Crypto is kind of old and crusty. Historically, its default string
  10977. // encoding is 'binary' so we have to make this configurable.
  10978. // Everything else in the universe uses 'utf8', though.
  10979. this.defaultEncoding = options.defaultEncoding || 'utf8';
  10980. // when piping, we only care about 'readable' events that happen
  10981. // after read()ing all the bytes and not getting any pushback.
  10982. this.ranOut = false;
  10983. // the number of writers that are awaiting a drain event in .pipe()s
  10984. this.awaitDrain = 0;
  10985. // if true, a maybeReadMore has been scheduled
  10986. this.readingMore = false;
  10987. this.decoder = null;
  10988. this.encoding = null;
  10989. if (options.encoding) {
  10990. if (!StringDecoder) StringDecoder = __webpack_require__(48).StringDecoder;
  10991. this.decoder = new StringDecoder(options.encoding);
  10992. this.encoding = options.encoding;
  10993. }
  10994. }
  10995. var Duplex;
  10996. function Readable(options) {
  10997. Duplex = Duplex || __webpack_require__(7);
  10998. if (!(this instanceof Readable)) return new Readable(options);
  10999. this._readableState = new ReadableState(options, this);
  11000. // legacy
  11001. this.readable = true;
  11002. if (options && typeof options.read === 'function') this._read = options.read;
  11003. Stream.call(this);
  11004. }
  11005. // Manually shove something into the read() buffer.
  11006. // This returns true if the highWaterMark has not been hit yet,
  11007. // similar to how Writable.write() returns true if you should
  11008. // write() some more.
  11009. Readable.prototype.push = function (chunk, encoding) {
  11010. var state = this._readableState;
  11011. if (!state.objectMode && typeof chunk === 'string') {
  11012. encoding = encoding || state.defaultEncoding;
  11013. if (encoding !== state.encoding) {
  11014. chunk = bufferShim.from(chunk, encoding);
  11015. encoding = '';
  11016. }
  11017. }
  11018. return readableAddChunk(this, state, chunk, encoding, false);
  11019. };
  11020. // Unshift should *always* be something directly out of read()
  11021. Readable.prototype.unshift = function (chunk) {
  11022. var state = this._readableState;
  11023. return readableAddChunk(this, state, chunk, '', true);
  11024. };
  11025. Readable.prototype.isPaused = function () {
  11026. return this._readableState.flowing === false;
  11027. };
  11028. function readableAddChunk(stream, state, chunk, encoding, addToFront) {
  11029. var er = chunkInvalid(state, chunk);
  11030. if (er) {
  11031. stream.emit('error', er);
  11032. } else if (chunk === null) {
  11033. state.reading = false;
  11034. onEofChunk(stream, state);
  11035. } else if (state.objectMode || chunk && chunk.length > 0) {
  11036. if (state.ended && !addToFront) {
  11037. var e = new Error('stream.push() after EOF');
  11038. stream.emit('error', e);
  11039. } else if (state.endEmitted && addToFront) {
  11040. var _e = new Error('stream.unshift() after end event');
  11041. stream.emit('error', _e);
  11042. } else {
  11043. var skipAdd;
  11044. if (state.decoder && !addToFront && !encoding) {
  11045. chunk = state.decoder.write(chunk);
  11046. skipAdd = !state.objectMode && chunk.length === 0;
  11047. }
  11048. if (!addToFront) state.reading = false;
  11049. // Don't add to the buffer if we've decoded to an empty string chunk and
  11050. // we're not in object mode
  11051. if (!skipAdd) {
  11052. // if we want the data now, just emit it.
  11053. if (state.flowing && state.length === 0 && !state.sync) {
  11054. stream.emit('data', chunk);
  11055. stream.read(0);
  11056. } else {
  11057. // update the buffer info.
  11058. state.length += state.objectMode ? 1 : chunk.length;
  11059. if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
  11060. if (state.needReadable) emitReadable(stream);
  11061. }
  11062. }
  11063. maybeReadMore(stream, state);
  11064. }
  11065. } else if (!addToFront) {
  11066. state.reading = false;
  11067. }
  11068. return needMoreData(state);
  11069. }
  11070. // if it's past the high water mark, we can push in some more.
  11071. // Also, if we have no data yet, we can stand some
  11072. // more bytes. This is to work around cases where hwm=0,
  11073. // such as the repl. Also, if the push() triggered a
  11074. // readable event, and the user called read(largeNumber) such that
  11075. // needReadable was set, then we ought to push more, so that another
  11076. // 'readable' event will be triggered.
  11077. function needMoreData(state) {
  11078. return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
  11079. }
  11080. // backwards compatibility.
  11081. Readable.prototype.setEncoding = function (enc) {
  11082. if (!StringDecoder) StringDecoder = __webpack_require__(48).StringDecoder;
  11083. this._readableState.decoder = new StringDecoder(enc);
  11084. this._readableState.encoding = enc;
  11085. return this;
  11086. };
  11087. // Don't raise the hwm > 8MB
  11088. var MAX_HWM = 0x800000;
  11089. function computeNewHighWaterMark(n) {
  11090. if (n >= MAX_HWM) {
  11091. n = MAX_HWM;
  11092. } else {
  11093. // Get the next highest power of 2 to prevent increasing hwm excessively in
  11094. // tiny amounts
  11095. n--;
  11096. n |= n >>> 1;
  11097. n |= n >>> 2;
  11098. n |= n >>> 4;
  11099. n |= n >>> 8;
  11100. n |= n >>> 16;
  11101. n++;
  11102. }
  11103. return n;
  11104. }
  11105. // This function is designed to be inlinable, so please take care when making
  11106. // changes to the function body.
  11107. function howMuchToRead(n, state) {
  11108. if (n <= 0 || state.length === 0 && state.ended) return 0;
  11109. if (state.objectMode) return 1;
  11110. if (n !== n) {
  11111. // Only flow one buffer at a time
  11112. if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
  11113. }
  11114. // If we're asking for more than the current hwm, then raise the hwm.
  11115. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
  11116. if (n <= state.length) return n;
  11117. // Don't have enough
  11118. if (!state.ended) {
  11119. state.needReadable = true;
  11120. return 0;
  11121. }
  11122. return state.length;
  11123. }
  11124. // you can override either this method, or the async _read(n) below.
  11125. Readable.prototype.read = function (n) {
  11126. debug('read', n);
  11127. n = parseInt(n, 10);
  11128. var state = this._readableState;
  11129. var nOrig = n;
  11130. if (n !== 0) state.emittedReadable = false;
  11131. // if we're doing read(0) to trigger a readable event, but we
  11132. // already have a bunch of data in the buffer, then just trigger
  11133. // the 'readable' event and move on.
  11134. if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
  11135. debug('read: emitReadable', state.length, state.ended);
  11136. if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
  11137. return null;
  11138. }
  11139. n = howMuchToRead(n, state);
  11140. // if we've ended, and we're now clear, then finish it up.
  11141. if (n === 0 && state.ended) {
  11142. if (state.length === 0) endReadable(this);
  11143. return null;
  11144. }
  11145. // All the actual chunk generation logic needs to be
  11146. // *below* the call to _read. The reason is that in certain
  11147. // synthetic stream cases, such as passthrough streams, _read
  11148. // may be a completely synchronous operation which may change
  11149. // the state of the read buffer, providing enough data when
  11150. // before there was *not* enough.
  11151. //
  11152. // So, the steps are:
  11153. // 1. Figure out what the state of things will be after we do
  11154. // a read from the buffer.
  11155. //
  11156. // 2. If that resulting state will trigger a _read, then call _read.
  11157. // Note that this may be asynchronous, or synchronous. Yes, it is
  11158. // deeply ugly to write APIs this way, but that still doesn't mean
  11159. // that the Readable class should behave improperly, as streams are
  11160. // designed to be sync/async agnostic.
  11161. // Take note if the _read call is sync or async (ie, if the read call
  11162. // has returned yet), so that we know whether or not it's safe to emit
  11163. // 'readable' etc.
  11164. //
  11165. // 3. Actually pull the requested chunks out of the buffer and return.
  11166. // if we need a readable event, then we need to do some reading.
  11167. var doRead = state.needReadable;
  11168. debug('need readable', doRead);
  11169. // if we currently have less than the highWaterMark, then also read some
  11170. if (state.length === 0 || state.length - n < state.highWaterMark) {
  11171. doRead = true;
  11172. debug('length less than watermark', doRead);
  11173. }
  11174. // however, if we've ended, then there's no point, and if we're already
  11175. // reading, then it's unnecessary.
  11176. if (state.ended || state.reading) {
  11177. doRead = false;
  11178. debug('reading or ended', doRead);
  11179. } else if (doRead) {
  11180. debug('do read');
  11181. state.reading = true;
  11182. state.sync = true;
  11183. // if the length is currently zero, then we *need* a readable event.
  11184. if (state.length === 0) state.needReadable = true;
  11185. // call internal read method
  11186. this._read(state.highWaterMark);
  11187. state.sync = false;
  11188. // If _read pushed data synchronously, then `reading` will be false,
  11189. // and we need to re-evaluate how much data we can return to the user.
  11190. if (!state.reading) n = howMuchToRead(nOrig, state);
  11191. }
  11192. var ret;
  11193. if (n > 0) ret = fromList(n, state);else ret = null;
  11194. if (ret === null) {
  11195. state.needReadable = true;
  11196. n = 0;
  11197. } else {
  11198. state.length -= n;
  11199. }
  11200. if (state.length === 0) {
  11201. // If we have nothing in the buffer, then we want to know
  11202. // as soon as we *do* get something into the buffer.
  11203. if (!state.ended) state.needReadable = true;
  11204. // If we tried to read() past the EOF, then emit end on the next tick.
  11205. if (nOrig !== n && state.ended) endReadable(this);
  11206. }
  11207. if (ret !== null) this.emit('data', ret);
  11208. return ret;
  11209. };
  11210. function chunkInvalid(state, chunk) {
  11211. var er = null;
  11212. if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {
  11213. er = new TypeError('Invalid non-string/buffer chunk');
  11214. }
  11215. return er;
  11216. }
  11217. function onEofChunk(stream, state) {
  11218. if (state.ended) return;
  11219. if (state.decoder) {
  11220. var chunk = state.decoder.end();
  11221. if (chunk && chunk.length) {
  11222. state.buffer.push(chunk);
  11223. state.length += state.objectMode ? 1 : chunk.length;
  11224. }
  11225. }
  11226. state.ended = true;
  11227. // emit 'readable' now to make sure it gets picked up.
  11228. emitReadable(stream);
  11229. }
  11230. // Don't emit readable right away in sync mode, because this can trigger
  11231. // another read() call => stack overflow. This way, it might trigger
  11232. // a nextTick recursion warning, but that's not so bad.
  11233. function emitReadable(stream) {
  11234. var state = stream._readableState;
  11235. state.needReadable = false;
  11236. if (!state.emittedReadable) {
  11237. debug('emitReadable', state.flowing);
  11238. state.emittedReadable = true;
  11239. if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);
  11240. }
  11241. }
  11242. function emitReadable_(stream) {
  11243. debug('emit readable');
  11244. stream.emit('readable');
  11245. flow(stream);
  11246. }
  11247. // at this point, the user has presumably seen the 'readable' event,
  11248. // and called read() to consume some data. that may have triggered
  11249. // in turn another _read(n) call, in which case reading = true if
  11250. // it's in progress.
  11251. // However, if we're not ended, or reading, and the length < hwm,
  11252. // then go ahead and try to read some more preemptively.
  11253. function maybeReadMore(stream, state) {
  11254. if (!state.readingMore) {
  11255. state.readingMore = true;
  11256. processNextTick(maybeReadMore_, stream, state);
  11257. }
  11258. }
  11259. function maybeReadMore_(stream, state) {
  11260. var len = state.length;
  11261. while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
  11262. debug('maybeReadMore read 0');
  11263. stream.read(0);
  11264. if (len === state.length)
  11265. // didn't get any data, stop spinning.
  11266. break;else len = state.length;
  11267. }
  11268. state.readingMore = false;
  11269. }
  11270. // abstract method. to be overridden in specific implementation classes.
  11271. // call cb(er, data) where data is <= n in length.
  11272. // for virtual (non-string, non-buffer) streams, "length" is somewhat
  11273. // arbitrary, and perhaps not very meaningful.
  11274. Readable.prototype._read = function (n) {
  11275. this.emit('error', new Error('not implemented'));
  11276. };
  11277. Readable.prototype.pipe = function (dest, pipeOpts) {
  11278. var src = this;
  11279. var state = this._readableState;
  11280. switch (state.pipesCount) {
  11281. case 0:
  11282. state.pipes = dest;
  11283. break;
  11284. case 1:
  11285. state.pipes = [state.pipes, dest];
  11286. break;
  11287. default:
  11288. state.pipes.push(dest);
  11289. break;
  11290. }
  11291. state.pipesCount += 1;
  11292. debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
  11293. var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
  11294. var endFn = doEnd ? onend : cleanup;
  11295. if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn);
  11296. dest.on('unpipe', onunpipe);
  11297. function onunpipe(readable) {
  11298. debug('onunpipe');
  11299. if (readable === src) {
  11300. cleanup();
  11301. }
  11302. }
  11303. function onend() {
  11304. debug('onend');
  11305. dest.end();
  11306. }
  11307. // when the dest drains, it reduces the awaitDrain counter
  11308. // on the source. This would be more elegant with a .once()
  11309. // handler in flow(), but adding and removing repeatedly is
  11310. // too slow.
  11311. var ondrain = pipeOnDrain(src);
  11312. dest.on('drain', ondrain);
  11313. var cleanedUp = false;
  11314. function cleanup() {
  11315. debug('cleanup');
  11316. // cleanup event handlers once the pipe is broken
  11317. dest.removeListener('close', onclose);
  11318. dest.removeListener('finish', onfinish);
  11319. dest.removeListener('drain', ondrain);
  11320. dest.removeListener('error', onerror);
  11321. dest.removeListener('unpipe', onunpipe);
  11322. src.removeListener('end', onend);
  11323. src.removeListener('end', cleanup);
  11324. src.removeListener('data', ondata);
  11325. cleanedUp = true;
  11326. // if the reader is waiting for a drain event from this
  11327. // specific writer, then it would cause it to never start
  11328. // flowing again.
  11329. // So, if this is awaiting a drain, then we just call it now.
  11330. // If we don't know, then assume that we are waiting for one.
  11331. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
  11332. }
  11333. // If the user pushes more data while we're writing to dest then we'll end up
  11334. // in ondata again. However, we only want to increase awaitDrain once because
  11335. // dest will only emit one 'drain' event for the multiple writes.
  11336. // => Introduce a guard on increasing awaitDrain.
  11337. var increasedAwaitDrain = false;
  11338. src.on('data', ondata);
  11339. function ondata(chunk) {
  11340. debug('ondata');
  11341. increasedAwaitDrain = false;
  11342. var ret = dest.write(chunk);
  11343. if (false === ret && !increasedAwaitDrain) {
  11344. // If the user unpiped during `dest.write()`, it is possible
  11345. // to get stuck in a permanently paused state if that write
  11346. // also returned false.
  11347. // => Check whether `dest` is still a piping destination.
  11348. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
  11349. debug('false write response, pause', src._readableState.awaitDrain);
  11350. src._readableState.awaitDrain++;
  11351. increasedAwaitDrain = true;
  11352. }
  11353. src.pause();
  11354. }
  11355. }
  11356. // if the dest has an error, then stop piping into it.
  11357. // however, don't suppress the throwing behavior for this.
  11358. function onerror(er) {
  11359. debug('onerror', er);
  11360. unpipe();
  11361. dest.removeListener('error', onerror);
  11362. if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
  11363. }
  11364. // Make sure our error handler is attached before userland ones.
  11365. prependListener(dest, 'error', onerror);
  11366. // Both close and finish should trigger unpipe, but only once.
  11367. function onclose() {
  11368. dest.removeListener('finish', onfinish);
  11369. unpipe();
  11370. }
  11371. dest.once('close', onclose);
  11372. function onfinish() {
  11373. debug('onfinish');
  11374. dest.removeListener('close', onclose);
  11375. unpipe();
  11376. }
  11377. dest.once('finish', onfinish);
  11378. function unpipe() {
  11379. debug('unpipe');
  11380. src.unpipe(dest);
  11381. }
  11382. // tell the dest that it's being piped to
  11383. dest.emit('pipe', src);
  11384. // start the flow if it hasn't been started already.
  11385. if (!state.flowing) {
  11386. debug('pipe resume');
  11387. src.resume();
  11388. }
  11389. return dest;
  11390. };
  11391. function pipeOnDrain(src) {
  11392. return function () {
  11393. var state = src._readableState;
  11394. debug('pipeOnDrain', state.awaitDrain);
  11395. if (state.awaitDrain) state.awaitDrain--;
  11396. if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
  11397. state.flowing = true;
  11398. flow(src);
  11399. }
  11400. };
  11401. }
  11402. Readable.prototype.unpipe = function (dest) {
  11403. var state = this._readableState;
  11404. // if we're not piping anywhere, then do nothing.
  11405. if (state.pipesCount === 0) return this;
  11406. // just one destination. most common case.
  11407. if (state.pipesCount === 1) {
  11408. // passed in one, but it's not the right one.
  11409. if (dest && dest !== state.pipes) return this;
  11410. if (!dest) dest = state.pipes;
  11411. // got a match.
  11412. state.pipes = null;
  11413. state.pipesCount = 0;
  11414. state.flowing = false;
  11415. if (dest) dest.emit('unpipe', this);
  11416. return this;
  11417. }
  11418. // slow case. multiple pipe destinations.
  11419. if (!dest) {
  11420. // remove all.
  11421. var dests = state.pipes;
  11422. var len = state.pipesCount;
  11423. state.pipes = null;
  11424. state.pipesCount = 0;
  11425. state.flowing = false;
  11426. for (var _i = 0; _i < len; _i++) {
  11427. dests[_i].emit('unpipe', this);
  11428. }return this;
  11429. }
  11430. // try to find the right one.
  11431. var i = indexOf(state.pipes, dest);
  11432. if (i === -1) return this;
  11433. state.pipes.splice(i, 1);
  11434. state.pipesCount -= 1;
  11435. if (state.pipesCount === 1) state.pipes = state.pipes[0];
  11436. dest.emit('unpipe', this);
  11437. return this;
  11438. };
  11439. // set up data events if they are asked for
  11440. // Ensure readable listeners eventually get something
  11441. Readable.prototype.on = function (ev, fn) {
  11442. var res = Stream.prototype.on.call(this, ev, fn);
  11443. if (ev === 'data') {
  11444. // Start flowing on next tick if stream isn't explicitly paused
  11445. if (this._readableState.flowing !== false) this.resume();
  11446. } else if (ev === 'readable') {
  11447. var state = this._readableState;
  11448. if (!state.endEmitted && !state.readableListening) {
  11449. state.readableListening = state.needReadable = true;
  11450. state.emittedReadable = false;
  11451. if (!state.reading) {
  11452. processNextTick(nReadingNextTick, this);
  11453. } else if (state.length) {
  11454. emitReadable(this, state);
  11455. }
  11456. }
  11457. }
  11458. return res;
  11459. };
  11460. Readable.prototype.addListener = Readable.prototype.on;
  11461. function nReadingNextTick(self) {
  11462. debug('readable nexttick read 0');
  11463. self.read(0);
  11464. }
  11465. // pause() and resume() are remnants of the legacy readable stream API
  11466. // If the user uses them, then switch into old mode.
  11467. Readable.prototype.resume = function () {
  11468. var state = this._readableState;
  11469. if (!state.flowing) {
  11470. debug('resume');
  11471. state.flowing = true;
  11472. resume(this, state);
  11473. }
  11474. return this;
  11475. };
  11476. function resume(stream, state) {
  11477. if (!state.resumeScheduled) {
  11478. state.resumeScheduled = true;
  11479. processNextTick(resume_, stream, state);
  11480. }
  11481. }
  11482. function resume_(stream, state) {
  11483. if (!state.reading) {
  11484. debug('resume read 0');
  11485. stream.read(0);
  11486. }
  11487. state.resumeScheduled = false;
  11488. state.awaitDrain = 0;
  11489. stream.emit('resume');
  11490. flow(stream);
  11491. if (state.flowing && !state.reading) stream.read(0);
  11492. }
  11493. Readable.prototype.pause = function () {
  11494. debug('call pause flowing=%j', this._readableState.flowing);
  11495. if (false !== this._readableState.flowing) {
  11496. debug('pause');
  11497. this._readableState.flowing = false;
  11498. this.emit('pause');
  11499. }
  11500. return this;
  11501. };
  11502. function flow(stream) {
  11503. var state = stream._readableState;
  11504. debug('flow', state.flowing);
  11505. while (state.flowing && stream.read() !== null) {}
  11506. }
  11507. // wrap an old-style stream as the async data source.
  11508. // This is *not* part of the readable stream interface.
  11509. // It is an ugly unfortunate mess of history.
  11510. Readable.prototype.wrap = function (stream) {
  11511. var state = this._readableState;
  11512. var paused = false;
  11513. var self = this;
  11514. stream.on('end', function () {
  11515. debug('wrapped end');
  11516. if (state.decoder && !state.ended) {
  11517. var chunk = state.decoder.end();
  11518. if (chunk && chunk.length) self.push(chunk);
  11519. }
  11520. self.push(null);
  11521. });
  11522. stream.on('data', function (chunk) {
  11523. debug('wrapped data');
  11524. if (state.decoder) chunk = state.decoder.write(chunk);
  11525. // don't skip over falsy values in objectMode
  11526. if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
  11527. var ret = self.push(chunk);
  11528. if (!ret) {
  11529. paused = true;
  11530. stream.pause();
  11531. }
  11532. });
  11533. // proxy all the other methods.
  11534. // important when wrapping filters and duplexes.
  11535. for (var i in stream) {
  11536. if (this[i] === undefined && typeof stream[i] === 'function') {
  11537. this[i] = function (method) {
  11538. return function () {
  11539. return stream[method].apply(stream, arguments);
  11540. };
  11541. }(i);
  11542. }
  11543. }
  11544. // proxy certain important events.
  11545. var events = ['error', 'close', 'destroy', 'pause', 'resume'];
  11546. forEach(events, function (ev) {
  11547. stream.on(ev, self.emit.bind(self, ev));
  11548. });
  11549. // when we try to consume some more bytes, simply unpause the
  11550. // underlying stream.
  11551. self._read = function (n) {
  11552. debug('wrapped _read', n);
  11553. if (paused) {
  11554. paused = false;
  11555. stream.resume();
  11556. }
  11557. };
  11558. return self;
  11559. };
  11560. // exposed for testing purposes only.
  11561. Readable._fromList = fromList;
  11562. // Pluck off n bytes from an array of buffers.
  11563. // Length is the combined lengths of all the buffers in the list.
  11564. // This function is designed to be inlinable, so please take care when making
  11565. // changes to the function body.
  11566. function fromList(n, state) {
  11567. // nothing buffered
  11568. if (state.length === 0) return null;
  11569. var ret;
  11570. if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
  11571. // read it all, truncate the list
  11572. if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
  11573. state.buffer.clear();
  11574. } else {
  11575. // read part of list
  11576. ret = fromListPartial(n, state.buffer, state.decoder);
  11577. }
  11578. return ret;
  11579. }
  11580. // Extracts only enough buffered data to satisfy the amount requested.
  11581. // This function is designed to be inlinable, so please take care when making
  11582. // changes to the function body.
  11583. function fromListPartial(n, list, hasStrings) {
  11584. var ret;
  11585. if (n < list.head.data.length) {
  11586. // slice is the same for buffers and strings
  11587. ret = list.head.data.slice(0, n);
  11588. list.head.data = list.head.data.slice(n);
  11589. } else if (n === list.head.data.length) {
  11590. // first chunk is a perfect match
  11591. ret = list.shift();
  11592. } else {
  11593. // result spans more than one buffer
  11594. ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
  11595. }
  11596. return ret;
  11597. }
  11598. // Copies a specified amount of characters from the list of buffered data
  11599. // chunks.
  11600. // This function is designed to be inlinable, so please take care when making
  11601. // changes to the function body.
  11602. function copyFromBufferString(n, list) {
  11603. var p = list.head;
  11604. var c = 1;
  11605. var ret = p.data;
  11606. n -= ret.length;
  11607. while (p = p.next) {
  11608. var str = p.data;
  11609. var nb = n > str.length ? str.length : n;
  11610. if (nb === str.length) ret += str;else ret += str.slice(0, n);
  11611. n -= nb;
  11612. if (n === 0) {
  11613. if (nb === str.length) {
  11614. ++c;
  11615. if (p.next) list.head = p.next;else list.head = list.tail = null;
  11616. } else {
  11617. list.head = p;
  11618. p.data = str.slice(nb);
  11619. }
  11620. break;
  11621. }
  11622. ++c;
  11623. }
  11624. list.length -= c;
  11625. return ret;
  11626. }
  11627. // Copies a specified amount of bytes from the list of buffered data chunks.
  11628. // This function is designed to be inlinable, so please take care when making
  11629. // changes to the function body.
  11630. function copyFromBuffer(n, list) {
  11631. var ret = bufferShim.allocUnsafe(n);
  11632. var p = list.head;
  11633. var c = 1;
  11634. p.data.copy(ret);
  11635. n -= p.data.length;
  11636. while (p = p.next) {
  11637. var buf = p.data;
  11638. var nb = n > buf.length ? buf.length : n;
  11639. buf.copy(ret, ret.length - n, 0, nb);
  11640. n -= nb;
  11641. if (n === 0) {
  11642. if (nb === buf.length) {
  11643. ++c;
  11644. if (p.next) list.head = p.next;else list.head = list.tail = null;
  11645. } else {
  11646. list.head = p;
  11647. p.data = buf.slice(nb);
  11648. }
  11649. break;
  11650. }
  11651. ++c;
  11652. }
  11653. list.length -= c;
  11654. return ret;
  11655. }
  11656. function endReadable(stream) {
  11657. var state = stream._readableState;
  11658. // If we get here before consuming all the bytes, then that is a
  11659. // bug in node. Should never happen.
  11660. if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
  11661. if (!state.endEmitted) {
  11662. state.ended = true;
  11663. processNextTick(endReadableNT, state, stream);
  11664. }
  11665. }
  11666. function endReadableNT(state, stream) {
  11667. // Check that we didn't get one last unshift.
  11668. if (!state.endEmitted && state.length === 0) {
  11669. state.endEmitted = true;
  11670. stream.readable = false;
  11671. stream.emit('end');
  11672. }
  11673. }
  11674. function forEach(xs, f) {
  11675. for (var i = 0, l = xs.length; i < l; i++) {
  11676. f(xs[i], i);
  11677. }
  11678. }
  11679. function indexOf(xs, x) {
  11680. for (var i = 0, l = xs.length; i < l; i++) {
  11681. if (xs[i] === x) return i;
  11682. }
  11683. return -1;
  11684. }
  11685. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  11686. /***/ },
  11687. /* 77 */
  11688. /***/ function(module, exports, __webpack_require__) {
  11689. /* WEBPACK VAR INJECTION */(function(Buffer) {/**
  11690. * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
  11691. * in FIPS 180-2
  11692. * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
  11693. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  11694. *
  11695. */
  11696. var inherits = __webpack_require__(1)
  11697. var Hash = __webpack_require__(12)
  11698. var K = [
  11699. 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
  11700. 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
  11701. 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
  11702. 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
  11703. 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
  11704. 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
  11705. 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
  11706. 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
  11707. 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
  11708. 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
  11709. 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
  11710. 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
  11711. 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
  11712. 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
  11713. 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
  11714. 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
  11715. ]
  11716. var W = new Array(64)
  11717. function Sha256 () {
  11718. this.init()
  11719. this._w = W // new Array(64)
  11720. Hash.call(this, 64, 56)
  11721. }
  11722. inherits(Sha256, Hash)
  11723. Sha256.prototype.init = function () {
  11724. this._a = 0x6a09e667
  11725. this._b = 0xbb67ae85
  11726. this._c = 0x3c6ef372
  11727. this._d = 0xa54ff53a
  11728. this._e = 0x510e527f
  11729. this._f = 0x9b05688c
  11730. this._g = 0x1f83d9ab
  11731. this._h = 0x5be0cd19
  11732. return this
  11733. }
  11734. function ch (x, y, z) {
  11735. return z ^ (x & (y ^ z))
  11736. }
  11737. function maj (x, y, z) {
  11738. return (x & y) | (z & (x | y))
  11739. }
  11740. function sigma0 (x) {
  11741. return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)
  11742. }
  11743. function sigma1 (x) {
  11744. return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)
  11745. }
  11746. function gamma0 (x) {
  11747. return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)
  11748. }
  11749. function gamma1 (x) {
  11750. return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)
  11751. }
  11752. Sha256.prototype._update = function (M) {
  11753. var W = this._w
  11754. var a = this._a | 0
  11755. var b = this._b | 0
  11756. var c = this._c | 0
  11757. var d = this._d | 0
  11758. var e = this._e | 0
  11759. var f = this._f | 0
  11760. var g = this._g | 0
  11761. var h = this._h | 0
  11762. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  11763. for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0
  11764. for (var j = 0; j < 64; ++j) {
  11765. var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0
  11766. var T2 = (sigma0(a) + maj(a, b, c)) | 0
  11767. h = g
  11768. g = f
  11769. f = e
  11770. e = (d + T1) | 0
  11771. d = c
  11772. c = b
  11773. b = a
  11774. a = (T1 + T2) | 0
  11775. }
  11776. this._a = (a + this._a) | 0
  11777. this._b = (b + this._b) | 0
  11778. this._c = (c + this._c) | 0
  11779. this._d = (d + this._d) | 0
  11780. this._e = (e + this._e) | 0
  11781. this._f = (f + this._f) | 0
  11782. this._g = (g + this._g) | 0
  11783. this._h = (h + this._h) | 0
  11784. }
  11785. Sha256.prototype._hash = function () {
  11786. var H = new Buffer(32)
  11787. H.writeInt32BE(this._a, 0)
  11788. H.writeInt32BE(this._b, 4)
  11789. H.writeInt32BE(this._c, 8)
  11790. H.writeInt32BE(this._d, 12)
  11791. H.writeInt32BE(this._e, 16)
  11792. H.writeInt32BE(this._f, 20)
  11793. H.writeInt32BE(this._g, 24)
  11794. H.writeInt32BE(this._h, 28)
  11795. return H
  11796. }
  11797. module.exports = Sha256
  11798. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  11799. /***/ },
  11800. /* 78 */
  11801. /***/ function(module, exports, __webpack_require__) {
  11802. /* WEBPACK VAR INJECTION */(function(Buffer) {var inherits = __webpack_require__(1)
  11803. var Hash = __webpack_require__(12)
  11804. var K = [
  11805. 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
  11806. 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
  11807. 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
  11808. 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
  11809. 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
  11810. 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
  11811. 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
  11812. 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
  11813. 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
  11814. 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
  11815. 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
  11816. 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
  11817. 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
  11818. 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
  11819. 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
  11820. 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
  11821. 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
  11822. 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
  11823. 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
  11824. 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
  11825. 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
  11826. 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
  11827. 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
  11828. 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
  11829. 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
  11830. 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
  11831. 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
  11832. 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
  11833. 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
  11834. 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
  11835. 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
  11836. 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
  11837. 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
  11838. 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
  11839. 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
  11840. 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
  11841. 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
  11842. 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
  11843. 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
  11844. 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
  11845. ]
  11846. var W = new Array(160)
  11847. function Sha512 () {
  11848. this.init()
  11849. this._w = W
  11850. Hash.call(this, 128, 112)
  11851. }
  11852. inherits(Sha512, Hash)
  11853. Sha512.prototype.init = function () {
  11854. this._ah = 0x6a09e667
  11855. this._bh = 0xbb67ae85
  11856. this._ch = 0x3c6ef372
  11857. this._dh = 0xa54ff53a
  11858. this._eh = 0x510e527f
  11859. this._fh = 0x9b05688c
  11860. this._gh = 0x1f83d9ab
  11861. this._hh = 0x5be0cd19
  11862. this._al = 0xf3bcc908
  11863. this._bl = 0x84caa73b
  11864. this._cl = 0xfe94f82b
  11865. this._dl = 0x5f1d36f1
  11866. this._el = 0xade682d1
  11867. this._fl = 0x2b3e6c1f
  11868. this._gl = 0xfb41bd6b
  11869. this._hl = 0x137e2179
  11870. return this
  11871. }
  11872. function Ch (x, y, z) {
  11873. return z ^ (x & (y ^ z))
  11874. }
  11875. function maj (x, y, z) {
  11876. return (x & y) | (z & (x | y))
  11877. }
  11878. function sigma0 (x, xl) {
  11879. return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)
  11880. }
  11881. function sigma1 (x, xl) {
  11882. return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)
  11883. }
  11884. function Gamma0 (x, xl) {
  11885. return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)
  11886. }
  11887. function Gamma0l (x, xl) {
  11888. return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)
  11889. }
  11890. function Gamma1 (x, xl) {
  11891. return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)
  11892. }
  11893. function Gamma1l (x, xl) {
  11894. return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)
  11895. }
  11896. function getCarry (a, b) {
  11897. return (a >>> 0) < (b >>> 0) ? 1 : 0
  11898. }
  11899. Sha512.prototype._update = function (M) {
  11900. var W = this._w
  11901. var ah = this._ah | 0
  11902. var bh = this._bh | 0
  11903. var ch = this._ch | 0
  11904. var dh = this._dh | 0
  11905. var eh = this._eh | 0
  11906. var fh = this._fh | 0
  11907. var gh = this._gh | 0
  11908. var hh = this._hh | 0
  11909. var al = this._al | 0
  11910. var bl = this._bl | 0
  11911. var cl = this._cl | 0
  11912. var dl = this._dl | 0
  11913. var el = this._el | 0
  11914. var fl = this._fl | 0
  11915. var gl = this._gl | 0
  11916. var hl = this._hl | 0
  11917. for (var i = 0; i < 32; i += 2) {
  11918. W[i] = M.readInt32BE(i * 4)
  11919. W[i + 1] = M.readInt32BE(i * 4 + 4)
  11920. }
  11921. for (; i < 160; i += 2) {
  11922. var xh = W[i - 15 * 2]
  11923. var xl = W[i - 15 * 2 + 1]
  11924. var gamma0 = Gamma0(xh, xl)
  11925. var gamma0l = Gamma0l(xl, xh)
  11926. xh = W[i - 2 * 2]
  11927. xl = W[i - 2 * 2 + 1]
  11928. var gamma1 = Gamma1(xh, xl)
  11929. var gamma1l = Gamma1l(xl, xh)
  11930. // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
  11931. var Wi7h = W[i - 7 * 2]
  11932. var Wi7l = W[i - 7 * 2 + 1]
  11933. var Wi16h = W[i - 16 * 2]
  11934. var Wi16l = W[i - 16 * 2 + 1]
  11935. var Wil = (gamma0l + Wi7l) | 0
  11936. var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0
  11937. Wil = (Wil + gamma1l) | 0
  11938. Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0
  11939. Wil = (Wil + Wi16l) | 0
  11940. Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0
  11941. W[i] = Wih
  11942. W[i + 1] = Wil
  11943. }
  11944. for (var j = 0; j < 160; j += 2) {
  11945. Wih = W[j]
  11946. Wil = W[j + 1]
  11947. var majh = maj(ah, bh, ch)
  11948. var majl = maj(al, bl, cl)
  11949. var sigma0h = sigma0(ah, al)
  11950. var sigma0l = sigma0(al, ah)
  11951. var sigma1h = sigma1(eh, el)
  11952. var sigma1l = sigma1(el, eh)
  11953. // t1 = h + sigma1 + ch + K[j] + W[j]
  11954. var Kih = K[j]
  11955. var Kil = K[j + 1]
  11956. var chh = Ch(eh, fh, gh)
  11957. var chl = Ch(el, fl, gl)
  11958. var t1l = (hl + sigma1l) | 0
  11959. var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0
  11960. t1l = (t1l + chl) | 0
  11961. t1h = (t1h + chh + getCarry(t1l, chl)) | 0
  11962. t1l = (t1l + Kil) | 0
  11963. t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0
  11964. t1l = (t1l + Wil) | 0
  11965. t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0
  11966. // t2 = sigma0 + maj
  11967. var t2l = (sigma0l + majl) | 0
  11968. var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0
  11969. hh = gh
  11970. hl = gl
  11971. gh = fh
  11972. gl = fl
  11973. fh = eh
  11974. fl = el
  11975. el = (dl + t1l) | 0
  11976. eh = (dh + t1h + getCarry(el, dl)) | 0
  11977. dh = ch
  11978. dl = cl
  11979. ch = bh
  11980. cl = bl
  11981. bh = ah
  11982. bl = al
  11983. al = (t1l + t2l) | 0
  11984. ah = (t1h + t2h + getCarry(al, t1l)) | 0
  11985. }
  11986. this._al = (this._al + al) | 0
  11987. this._bl = (this._bl + bl) | 0
  11988. this._cl = (this._cl + cl) | 0
  11989. this._dl = (this._dl + dl) | 0
  11990. this._el = (this._el + el) | 0
  11991. this._fl = (this._fl + fl) | 0
  11992. this._gl = (this._gl + gl) | 0
  11993. this._hl = (this._hl + hl) | 0
  11994. this._ah = (this._ah + ah + getCarry(this._al, al)) | 0
  11995. this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0
  11996. this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0
  11997. this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0
  11998. this._eh = (this._eh + eh + getCarry(this._el, el)) | 0
  11999. this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0
  12000. this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0
  12001. this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0
  12002. }
  12003. Sha512.prototype._hash = function () {
  12004. var H = new Buffer(64)
  12005. function writeInt64BE (h, l, offset) {
  12006. H.writeInt32BE(h, offset)
  12007. H.writeInt32BE(l, offset + 4)
  12008. }
  12009. writeInt64BE(this._ah, this._al, 0)
  12010. writeInt64BE(this._bh, this._bl, 8)
  12011. writeInt64BE(this._ch, this._cl, 16)
  12012. writeInt64BE(this._dh, this._dl, 24)
  12013. writeInt64BE(this._eh, this._el, 32)
  12014. writeInt64BE(this._fh, this._fl, 40)
  12015. writeInt64BE(this._gh, this._gl, 48)
  12016. writeInt64BE(this._hh, this._hl, 56)
  12017. return H
  12018. }
  12019. module.exports = Sha512
  12020. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  12021. /***/ },
  12022. /* 79 */
  12023. /***/ function(module, exports, __webpack_require__) {
  12024. "use strict";
  12025. 'use strict';
  12026. Object.defineProperty(exports, "__esModule", {
  12027. value: true
  12028. });
  12029. var _vue = __webpack_require__(32);
  12030. var _vue2 = _interopRequireDefault(_vue);
  12031. var _vueRouter = __webpack_require__(217);
  12032. var _vueRouter2 = _interopRequireDefault(_vueRouter);
  12033. var _PasswordGenerator = __webpack_require__(203);
  12034. var _PasswordGenerator2 = _interopRequireDefault(_PasswordGenerator);
  12035. var _Login = __webpack_require__(202);
  12036. var _Login2 = _interopRequireDefault(_Login);
  12037. var _PasswordReset = __webpack_require__(204);
  12038. var _PasswordReset2 = _interopRequireDefault(_PasswordReset);
  12039. var _PasswordResetConfirm = __webpack_require__(205);
  12040. var _PasswordResetConfirm2 = _interopRequireDefault(_PasswordResetConfirm);
  12041. var _Passwords = __webpack_require__(206);
  12042. var _Passwords2 = _interopRequireDefault(_Passwords);
  12043. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  12044. _vue2.default.use(_vueRouter2.default);
  12045. var routes = [{ path: '/', name: 'home', component: _PasswordGenerator2.default }, { path: '/login', name: 'login', component: _Login2.default }, { path: '/passwords/', name: 'passwords', component: _Passwords2.default }, { path: '/passwords/:id', name: 'password', component: _PasswordGenerator2.default }, { path: '/password/reset', name: 'passwordReset', component: _PasswordReset2.default }, { path: '/password/reset/confirm/:uid/:token', name: 'passwordResetConfirm', component: _PasswordResetConfirm2.default }];
  12046. var router = new _vueRouter2.default({
  12047. routes: routes
  12048. });
  12049. exports.default = router;
  12050. /***/ },
  12051. /* 80 */
  12052. /***/ function(module, exports, __webpack_require__) {
  12053. "use strict";
  12054. 'use strict';
  12055. Object.defineProperty(exports, "__esModule", {
  12056. value: true
  12057. });
  12058. var _assign = __webpack_require__(33);
  12059. var _assign2 = _interopRequireDefault(_assign);
  12060. var _vue = __webpack_require__(32);
  12061. var _vue2 = _interopRequireDefault(_vue);
  12062. var _vuex = __webpack_require__(8);
  12063. var _vuex2 = _interopRequireDefault(_vuex);
  12064. var _auth = __webpack_require__(23);
  12065. var _auth2 = _interopRequireDefault(_auth);
  12066. var _http = __webpack_require__(111);
  12067. var _http2 = _interopRequireDefault(_http);
  12068. var _storage = __webpack_require__(13);
  12069. var _storage2 = _interopRequireDefault(_storage);
  12070. var _password = __webpack_require__(56);
  12071. var _password2 = _interopRequireDefault(_password);
  12072. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  12073. _vue2.default.use(_vuex2.default);
  12074. var storage = new _storage2.default();
  12075. var auth = new _auth2.default(storage);
  12076. var PasswordsAPI = new _http2.default('passwords', storage);
  12077. var defaultPassword = {
  12078. id: '',
  12079. site: '',
  12080. login: '',
  12081. uppercase: true,
  12082. lowercase: true,
  12083. numbers: true,
  12084. symbols: true,
  12085. length: 12,
  12086. counter: 1
  12087. };
  12088. function getDefaultPasswordProfile(version) {
  12089. if (version === 1) {
  12090. return (0, _assign2.default)({}, defaultPassword, { version: 1, length: 12 });
  12091. }
  12092. if (version === 2) {
  12093. return (0, _assign2.default)({}, defaultPassword, { version: 2, length: 16 });
  12094. }
  12095. }
  12096. var versionLoadedByDefault = 1;
  12097. var state = {
  12098. authenticated: auth.isAuthenticated(),
  12099. email: '',
  12100. passwordStatus: 'CLEAN',
  12101. passwords: [],
  12102. baseURL: 'https://lesspass.com',
  12103. password: getDefaultPasswordProfile(versionLoadedByDefault),
  12104. version: versionLoadedByDefault
  12105. };
  12106. var mutations = {
  12107. LOGOUT: function LOGOUT(state) {
  12108. state.authenticated = false;
  12109. },
  12110. USER_AUTHENTICATED: function USER_AUTHENTICATED(state, user) {
  12111. state.authenticated = true;
  12112. state.email = user.email;
  12113. },
  12114. SET_PASSWORDS: function SET_PASSWORDS(state, passwords) {
  12115. state.passwords = passwords;
  12116. },
  12117. SET_PASSWORD: function SET_PASSWORD(state, _ref) {
  12118. var password = _ref.password;
  12119. state.password = password;
  12120. },
  12121. DELETE_PASSWORD: function DELETE_PASSWORD(state, _ref2) {
  12122. var id = _ref2.id;
  12123. var passwords = state.passwords;
  12124. state.passwords = passwords.filter(function (password) {
  12125. return password.id !== id;
  12126. });
  12127. if (state.password.id === id) {
  12128. state.password = state.defaultPassword;
  12129. }
  12130. },
  12131. PASSWORD_CLEAN: function PASSWORD_CLEAN(state) {
  12132. setTimeout(function () {
  12133. state.passwordStatus = 'CLEAN';
  12134. }, 5000);
  12135. },
  12136. CHANGE_PASSWORD_STATUS: function CHANGE_PASSWORD_STATUS(state, status) {
  12137. state.passwordStatus = status;
  12138. },
  12139. SET_DEFAULT_PASSWORD: function SET_DEFAULT_PASSWORD(state) {
  12140. state.password = (0, _assign2.default)({}, defaultPassword);
  12141. },
  12142. UPDATE_SITE: function UPDATE_SITE(state, _ref3) {
  12143. var site = _ref3.site;
  12144. state.password.site = site;
  12145. },
  12146. UPDATE_BASE_URL: function UPDATE_BASE_URL(state, _ref4) {
  12147. var baseURL = _ref4.baseURL;
  12148. state.baseURL = baseURL;
  12149. },
  12150. UPDATE_EMAIL: function UPDATE_EMAIL(state, _ref5) {
  12151. var email = _ref5.email;
  12152. state.email = email;
  12153. },
  12154. CHANGE_VERSION: function CHANGE_VERSION(state, _ref6) {
  12155. var version = _ref6.version;
  12156. state.password = getDefaultPasswordProfile(version);
  12157. state.version = version;
  12158. storage.save({ version: version });
  12159. }
  12160. };
  12161. var actions = {
  12162. USER_AUTHENTICATED: function USER_AUTHENTICATED(_ref7, user) {
  12163. var commit = _ref7.commit;
  12164. return commit('USER_AUTHENTICATED', user);
  12165. },
  12166. LOGOUT: function LOGOUT(_ref8) {
  12167. var commit = _ref8.commit;
  12168. auth.logout();
  12169. commit('LOGOUT');
  12170. },
  12171. SAVE_OR_UPDATE_PASSWORD: function SAVE_OR_UPDATE_PASSWORD(_ref9) {
  12172. var commit = _ref9.commit,
  12173. state = _ref9.state,
  12174. dispatch = _ref9.dispatch;
  12175. var password = new _password2.default(state.password);
  12176. if (password.isNewPassword(state.passwords)) {
  12177. PasswordsAPI.create(password.json()).then(function () {
  12178. commit('CHANGE_PASSWORD_STATUS', 'CREATED');
  12179. commit('PASSWORD_CLEAN');
  12180. dispatch('FETCH_PASSWORDS');
  12181. });
  12182. } else {
  12183. PasswordsAPI.update(password.json()).then(function () {
  12184. commit('CHANGE_PASSWORD_STATUS', 'UPDATED');
  12185. commit('PASSWORD_CLEAN');
  12186. dispatch('FETCH_PASSWORDS');
  12187. });
  12188. }
  12189. },
  12190. REFRESH_TOKEN: function REFRESH_TOKEN(_ref10) {
  12191. var commit = _ref10.commit;
  12192. if (auth.isAuthenticated()) {
  12193. auth.refreshToken().catch(function () {
  12194. commit('LOGOUT');
  12195. });
  12196. }
  12197. },
  12198. PASSWORD_CHANGE: function PASSWORD_CHANGE(_ref11, _ref12) {
  12199. var commit = _ref11.commit;
  12200. var password = _ref12.password;
  12201. commit('SET_PASSWORD', { password: password });
  12202. },
  12203. PASSWORD_GENERATED: function PASSWORD_GENERATED(_ref13) {
  12204. var commit = _ref13.commit;
  12205. commit('CHANGE_PASSWORD_STATUS', 'DIRTY');
  12206. },
  12207. FETCH_PASSWORDS: function FETCH_PASSWORDS(_ref14) {
  12208. var commit = _ref14.commit;
  12209. if (auth.isAuthenticated()) {
  12210. PasswordsAPI.all().then(function (response) {
  12211. return commit('SET_PASSWORDS', response.data.results);
  12212. });
  12213. }
  12214. },
  12215. FETCH_PASSWORD: function FETCH_PASSWORD(_ref15, _ref16) {
  12216. var commit = _ref15.commit;
  12217. var id = _ref16.id;
  12218. PasswordsAPI.get({ id: id }).then(function (response) {
  12219. return commit('SET_PASSWORD', { password: response.data });
  12220. });
  12221. },
  12222. DELETE_PASSWORD: function DELETE_PASSWORD(_ref17, _ref18) {
  12223. var commit = _ref17.commit;
  12224. var id = _ref18.id;
  12225. PasswordsAPI.remove({ id: id }).then(function () {
  12226. commit('DELETE_PASSWORD', { id: id });
  12227. });
  12228. },
  12229. LOAD_DEFAULT_PASSWORD: function LOAD_DEFAULT_PASSWORD(_ref19) {
  12230. var commit = _ref19.commit;
  12231. commit('SET_DEFAULT_PASSWORD');
  12232. }
  12233. };
  12234. var getters = {
  12235. passwords: function passwords(state) {
  12236. return state.passwords;
  12237. },
  12238. password: function password(state) {
  12239. return state.password;
  12240. },
  12241. isAuthenticated: function isAuthenticated(state) {
  12242. return state.authenticated;
  12243. },
  12244. isGuest: function isGuest(state) {
  12245. return !state.authenticated;
  12246. },
  12247. passwordStatus: function passwordStatus(state) {
  12248. return state.passwordStatus;
  12249. },
  12250. email: function email(state) {
  12251. return state.email;
  12252. },
  12253. version: function version(state) {
  12254. return state.version;
  12255. }
  12256. };
  12257. exports.default = new _vuex2.default.Store({
  12258. state: (0, _assign2.default)(state, storage.json()),
  12259. getters: getters,
  12260. actions: actions,
  12261. mutations: mutations
  12262. });
  12263. /***/ },
  12264. /* 81 */
  12265. /***/ function(module, exports) {
  12266. // removed by extract-text-webpack-plugin
  12267. /***/ },
  12268. /* 82 */
  12269. 81,
  12270. /* 83 */
  12271. 81,
  12272. /* 84 */
  12273. /***/ function(module, exports, __webpack_require__) {
  12274. var __vue_exports__, __vue_options__
  12275. var __vue_styles__ = {}
  12276. /* styles */
  12277. __webpack_require__(220)
  12278. /* script */
  12279. __vue_exports__ = __webpack_require__(102)
  12280. /* template */
  12281. var __vue_template__ = __webpack_require__(212)
  12282. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  12283. if (
  12284. typeof __vue_exports__.default === "object" ||
  12285. typeof __vue_exports__.default === "function"
  12286. ) {
  12287. __vue_options__ = __vue_exports__ = __vue_exports__.default
  12288. }
  12289. if (typeof __vue_options__ === "function") {
  12290. __vue_options__ = __vue_options__.options
  12291. }
  12292. __vue_options__.render = __vue_template__.render
  12293. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  12294. module.exports = __vue_exports__
  12295. /***/ },
  12296. /* 85 */
  12297. /***/ function(module, exports, __webpack_require__) {
  12298. "use strict";
  12299. 'use strict';
  12300. var utils = __webpack_require__(2);
  12301. var bind = __webpack_require__(55);
  12302. var Axios = __webpack_require__(87);
  12303. /**
  12304. * Create an instance of Axios
  12305. *
  12306. * @param {Object} defaultConfig The default config for the instance
  12307. * @return {Axios} A new instance of Axios
  12308. */
  12309. function createInstance(defaultConfig) {
  12310. var context = new Axios(defaultConfig);
  12311. var instance = bind(Axios.prototype.request, context);
  12312. // Copy axios.prototype to instance
  12313. utils.extend(instance, Axios.prototype, context);
  12314. // Copy context to instance
  12315. utils.extend(instance, context);
  12316. return instance;
  12317. }
  12318. // Create the default instance to be exported
  12319. var axios = createInstance();
  12320. // Expose Axios class to allow class inheritance
  12321. axios.Axios = Axios;
  12322. // Factory for creating new instances
  12323. axios.create = function create(defaultConfig) {
  12324. return createInstance(defaultConfig);
  12325. };
  12326. // Expose Cancel & CancelToken
  12327. axios.Cancel = __webpack_require__(51);
  12328. axios.CancelToken = __webpack_require__(86);
  12329. axios.isCancel = __webpack_require__(52);
  12330. // Expose all/spread
  12331. axios.all = function all(promises) {
  12332. return Promise.all(promises);
  12333. };
  12334. axios.spread = __webpack_require__(101);
  12335. module.exports = axios;
  12336. // Allow use of default import syntax in TypeScript
  12337. module.exports.default = axios;
  12338. /***/ },
  12339. /* 86 */
  12340. /***/ function(module, exports, __webpack_require__) {
  12341. "use strict";
  12342. 'use strict';
  12343. var Cancel = __webpack_require__(51);
  12344. /**
  12345. * A `CancelToken` is an object that can be used to request cancellation of an operation.
  12346. *
  12347. * @class
  12348. * @param {Function} executor The executor function.
  12349. */
  12350. function CancelToken(executor) {
  12351. if (typeof executor !== 'function') {
  12352. throw new TypeError('executor must be a function.');
  12353. }
  12354. var resolvePromise;
  12355. this.promise = new Promise(function promiseExecutor(resolve) {
  12356. resolvePromise = resolve;
  12357. });
  12358. var token = this;
  12359. executor(function cancel(message) {
  12360. if (token.reason) {
  12361. // Cancellation has already been requested
  12362. return;
  12363. }
  12364. token.reason = new Cancel(message);
  12365. resolvePromise(token.reason);
  12366. });
  12367. }
  12368. /**
  12369. * Throws a `Cancel` if cancellation has been requested.
  12370. */
  12371. CancelToken.prototype.throwIfRequested = function throwIfRequested() {
  12372. if (this.reason) {
  12373. throw this.reason;
  12374. }
  12375. };
  12376. /**
  12377. * Returns an object that contains a new `CancelToken` and a function that, when called,
  12378. * cancels the `CancelToken`.
  12379. */
  12380. CancelToken.source = function source() {
  12381. var cancel;
  12382. var token = new CancelToken(function executor(c) {
  12383. cancel = c;
  12384. });
  12385. return {
  12386. token: token,
  12387. cancel: cancel
  12388. };
  12389. };
  12390. module.exports = CancelToken;
  12391. /***/ },
  12392. /* 87 */
  12393. /***/ function(module, exports, __webpack_require__) {
  12394. "use strict";
  12395. 'use strict';
  12396. var defaults = __webpack_require__(54);
  12397. var utils = __webpack_require__(2);
  12398. var InterceptorManager = __webpack_require__(88);
  12399. var dispatchRequest = __webpack_require__(89);
  12400. var isAbsoluteURL = __webpack_require__(97);
  12401. var combineURLs = __webpack_require__(95);
  12402. /**
  12403. * Create a new instance of Axios
  12404. *
  12405. * @param {Object} defaultConfig The default config for the instance
  12406. */
  12407. function Axios(defaultConfig) {
  12408. this.defaults = utils.merge(defaults, defaultConfig);
  12409. this.interceptors = {
  12410. request: new InterceptorManager(),
  12411. response: new InterceptorManager()
  12412. };
  12413. }
  12414. /**
  12415. * Dispatch a request
  12416. *
  12417. * @param {Object} config The config specific for this request (merged with this.defaults)
  12418. */
  12419. Axios.prototype.request = function request(config) {
  12420. /*eslint no-param-reassign:0*/
  12421. // Allow for axios('example/url'[, config]) a la fetch API
  12422. if (typeof config === 'string') {
  12423. config = utils.merge({
  12424. url: arguments[0]
  12425. }, arguments[1]);
  12426. }
  12427. config = utils.merge(defaults, this.defaults, { method: 'get' }, config);
  12428. // Support baseURL config
  12429. if (config.baseURL && !isAbsoluteURL(config.url)) {
  12430. config.url = combineURLs(config.baseURL, config.url);
  12431. }
  12432. // Hook up interceptors middleware
  12433. var chain = [dispatchRequest, undefined];
  12434. var promise = Promise.resolve(config);
  12435. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  12436. chain.unshift(interceptor.fulfilled, interceptor.rejected);
  12437. });
  12438. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  12439. chain.push(interceptor.fulfilled, interceptor.rejected);
  12440. });
  12441. while (chain.length) {
  12442. promise = promise.then(chain.shift(), chain.shift());
  12443. }
  12444. return promise;
  12445. };
  12446. // Provide aliases for supported request methods
  12447. utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
  12448. /*eslint func-names:0*/
  12449. Axios.prototype[method] = function(url, config) {
  12450. return this.request(utils.merge(config || {}, {
  12451. method: method,
  12452. url: url
  12453. }));
  12454. };
  12455. });
  12456. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  12457. /*eslint func-names:0*/
  12458. Axios.prototype[method] = function(url, data, config) {
  12459. return this.request(utils.merge(config || {}, {
  12460. method: method,
  12461. url: url,
  12462. data: data
  12463. }));
  12464. };
  12465. });
  12466. module.exports = Axios;
  12467. /***/ },
  12468. /* 88 */
  12469. /***/ function(module, exports, __webpack_require__) {
  12470. "use strict";
  12471. 'use strict';
  12472. var utils = __webpack_require__(2);
  12473. function InterceptorManager() {
  12474. this.handlers = [];
  12475. }
  12476. /**
  12477. * Add a new interceptor to the stack
  12478. *
  12479. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  12480. * @param {Function} rejected The function to handle `reject` for a `Promise`
  12481. *
  12482. * @return {Number} An ID used to remove interceptor later
  12483. */
  12484. InterceptorManager.prototype.use = function use(fulfilled, rejected) {
  12485. this.handlers.push({
  12486. fulfilled: fulfilled,
  12487. rejected: rejected
  12488. });
  12489. return this.handlers.length - 1;
  12490. };
  12491. /**
  12492. * Remove an interceptor from the stack
  12493. *
  12494. * @param {Number} id The ID that was returned by `use`
  12495. */
  12496. InterceptorManager.prototype.eject = function eject(id) {
  12497. if (this.handlers[id]) {
  12498. this.handlers[id] = null;
  12499. }
  12500. };
  12501. /**
  12502. * Iterate over all the registered interceptors
  12503. *
  12504. * This method is particularly useful for skipping over any
  12505. * interceptors that may have become `null` calling `eject`.
  12506. *
  12507. * @param {Function} fn The function to call for each interceptor
  12508. */
  12509. InterceptorManager.prototype.forEach = function forEach(fn) {
  12510. utils.forEach(this.handlers, function forEachHandler(h) {
  12511. if (h !== null) {
  12512. fn(h);
  12513. }
  12514. });
  12515. };
  12516. module.exports = InterceptorManager;
  12517. /***/ },
  12518. /* 89 */
  12519. /***/ function(module, exports, __webpack_require__) {
  12520. "use strict";
  12521. 'use strict';
  12522. var utils = __webpack_require__(2);
  12523. var transformData = __webpack_require__(92);
  12524. var isCancel = __webpack_require__(52);
  12525. var defaults = __webpack_require__(54);
  12526. /**
  12527. * Throws a `Cancel` if cancellation has been requested.
  12528. */
  12529. function throwIfCancellationRequested(config) {
  12530. if (config.cancelToken) {
  12531. config.cancelToken.throwIfRequested();
  12532. }
  12533. }
  12534. /**
  12535. * Dispatch a request to the server using the configured adapter.
  12536. *
  12537. * @param {object} config The config that is to be used for the request
  12538. * @returns {Promise} The Promise to be fulfilled
  12539. */
  12540. module.exports = function dispatchRequest(config) {
  12541. throwIfCancellationRequested(config);
  12542. // Ensure headers exist
  12543. config.headers = config.headers || {};
  12544. // Transform request data
  12545. config.data = transformData(
  12546. config.data,
  12547. config.headers,
  12548. config.transformRequest
  12549. );
  12550. // Flatten headers
  12551. config.headers = utils.merge(
  12552. config.headers.common || {},
  12553. config.headers[config.method] || {},
  12554. config.headers || {}
  12555. );
  12556. utils.forEach(
  12557. ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
  12558. function cleanHeaderConfig(method) {
  12559. delete config.headers[method];
  12560. }
  12561. );
  12562. var adapter = config.adapter || defaults.adapter;
  12563. return adapter(config).then(function onAdapterResolution(response) {
  12564. throwIfCancellationRequested(config);
  12565. // Transform response data
  12566. response.data = transformData(
  12567. response.data,
  12568. response.headers,
  12569. config.transformResponse
  12570. );
  12571. return response;
  12572. }, function onAdapterRejection(reason) {
  12573. if (!isCancel(reason)) {
  12574. throwIfCancellationRequested(config);
  12575. // Transform response data
  12576. if (reason && reason.response) {
  12577. reason.response.data = transformData(
  12578. reason.response.data,
  12579. reason.response.headers,
  12580. config.transformResponse
  12581. );
  12582. }
  12583. }
  12584. return Promise.reject(reason);
  12585. });
  12586. };
  12587. /***/ },
  12588. /* 90 */
  12589. /***/ function(module, exports) {
  12590. "use strict";
  12591. 'use strict';
  12592. /**
  12593. * Update an Error with the specified config, error code, and response.
  12594. *
  12595. * @param {Error} error The error to update.
  12596. * @param {Object} config The config.
  12597. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  12598. @ @param {Object} [response] The response.
  12599. * @returns {Error} The error.
  12600. */
  12601. module.exports = function enhanceError(error, config, code, response) {
  12602. error.config = config;
  12603. if (code) {
  12604. error.code = code;
  12605. }
  12606. error.response = response;
  12607. return error;
  12608. };
  12609. /***/ },
  12610. /* 91 */
  12611. /***/ function(module, exports, __webpack_require__) {
  12612. "use strict";
  12613. 'use strict';
  12614. var createError = __webpack_require__(53);
  12615. /**
  12616. * Resolve or reject a Promise based on response status.
  12617. *
  12618. * @param {Function} resolve A function that resolves the promise.
  12619. * @param {Function} reject A function that rejects the promise.
  12620. * @param {object} response The response.
  12621. */
  12622. module.exports = function settle(resolve, reject, response) {
  12623. var validateStatus = response.config.validateStatus;
  12624. // Note: status is not exposed by XDomainRequest
  12625. if (!response.status || !validateStatus || validateStatus(response.status)) {
  12626. resolve(response);
  12627. } else {
  12628. reject(createError(
  12629. 'Request failed with status code ' + response.status,
  12630. response.config,
  12631. null,
  12632. response
  12633. ));
  12634. }
  12635. };
  12636. /***/ },
  12637. /* 92 */
  12638. /***/ function(module, exports, __webpack_require__) {
  12639. "use strict";
  12640. 'use strict';
  12641. var utils = __webpack_require__(2);
  12642. /**
  12643. * Transform the data for a request or a response
  12644. *
  12645. * @param {Object|String} data The data to be transformed
  12646. * @param {Array} headers The headers for the request or response
  12647. * @param {Array|Function} fns A single function or Array of functions
  12648. * @returns {*} The resulting transformed data
  12649. */
  12650. module.exports = function transformData(data, headers, fns) {
  12651. /*eslint no-param-reassign:0*/
  12652. utils.forEach(fns, function transform(fn) {
  12653. data = fn(data, headers);
  12654. });
  12655. return data;
  12656. };
  12657. /***/ },
  12658. /* 93 */
  12659. /***/ function(module, exports) {
  12660. "use strict";
  12661. 'use strict';
  12662. // btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js
  12663. var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  12664. function E() {
  12665. this.message = 'String contains an invalid character';
  12666. }
  12667. E.prototype = new Error;
  12668. E.prototype.code = 5;
  12669. E.prototype.name = 'InvalidCharacterError';
  12670. function btoa(input) {
  12671. var str = String(input);
  12672. var output = '';
  12673. for (
  12674. // initialize result and counter
  12675. var block, charCode, idx = 0, map = chars;
  12676. // if the next str index does not exist:
  12677. // change the mapping table to "="
  12678. // check if d has no fractional digits
  12679. str.charAt(idx | 0) || (map = '=', idx % 1);
  12680. // "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8
  12681. output += map.charAt(63 & block >> 8 - idx % 1 * 8)
  12682. ) {
  12683. charCode = str.charCodeAt(idx += 3 / 4);
  12684. if (charCode > 0xFF) {
  12685. throw new E();
  12686. }
  12687. block = block << 8 | charCode;
  12688. }
  12689. return output;
  12690. }
  12691. module.exports = btoa;
  12692. /***/ },
  12693. /* 94 */
  12694. /***/ function(module, exports, __webpack_require__) {
  12695. "use strict";
  12696. 'use strict';
  12697. var utils = __webpack_require__(2);
  12698. function encode(val) {
  12699. return encodeURIComponent(val).
  12700. replace(/%40/gi, '@').
  12701. replace(/%3A/gi, ':').
  12702. replace(/%24/g, '$').
  12703. replace(/%2C/gi, ',').
  12704. replace(/%20/g, '+').
  12705. replace(/%5B/gi, '[').
  12706. replace(/%5D/gi, ']');
  12707. }
  12708. /**
  12709. * Build a URL by appending params to the end
  12710. *
  12711. * @param {string} url The base of the url (e.g., http://www.google.com)
  12712. * @param {object} [params] The params to be appended
  12713. * @returns {string} The formatted url
  12714. */
  12715. module.exports = function buildURL(url, params, paramsSerializer) {
  12716. /*eslint no-param-reassign:0*/
  12717. if (!params) {
  12718. return url;
  12719. }
  12720. var serializedParams;
  12721. if (paramsSerializer) {
  12722. serializedParams = paramsSerializer(params);
  12723. } else if (utils.isURLSearchParams(params)) {
  12724. serializedParams = params.toString();
  12725. } else {
  12726. var parts = [];
  12727. utils.forEach(params, function serialize(val, key) {
  12728. if (val === null || typeof val === 'undefined') {
  12729. return;
  12730. }
  12731. if (utils.isArray(val)) {
  12732. key = key + '[]';
  12733. }
  12734. if (!utils.isArray(val)) {
  12735. val = [val];
  12736. }
  12737. utils.forEach(val, function parseValue(v) {
  12738. if (utils.isDate(v)) {
  12739. v = v.toISOString();
  12740. } else if (utils.isObject(v)) {
  12741. v = JSON.stringify(v);
  12742. }
  12743. parts.push(encode(key) + '=' + encode(v));
  12744. });
  12745. });
  12746. serializedParams = parts.join('&');
  12747. }
  12748. if (serializedParams) {
  12749. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  12750. }
  12751. return url;
  12752. };
  12753. /***/ },
  12754. /* 95 */
  12755. /***/ function(module, exports) {
  12756. "use strict";
  12757. 'use strict';
  12758. /**
  12759. * Creates a new URL by combining the specified URLs
  12760. *
  12761. * @param {string} baseURL The base URL
  12762. * @param {string} relativeURL The relative URL
  12763. * @returns {string} The combined URL
  12764. */
  12765. module.exports = function combineURLs(baseURL, relativeURL) {
  12766. return baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '');
  12767. };
  12768. /***/ },
  12769. /* 96 */
  12770. /***/ function(module, exports, __webpack_require__) {
  12771. "use strict";
  12772. 'use strict';
  12773. var utils = __webpack_require__(2);
  12774. module.exports = (
  12775. utils.isStandardBrowserEnv() ?
  12776. // Standard browser envs support document.cookie
  12777. (function standardBrowserEnv() {
  12778. return {
  12779. write: function write(name, value, expires, path, domain, secure) {
  12780. var cookie = [];
  12781. cookie.push(name + '=' + encodeURIComponent(value));
  12782. if (utils.isNumber(expires)) {
  12783. cookie.push('expires=' + new Date(expires).toGMTString());
  12784. }
  12785. if (utils.isString(path)) {
  12786. cookie.push('path=' + path);
  12787. }
  12788. if (utils.isString(domain)) {
  12789. cookie.push('domain=' + domain);
  12790. }
  12791. if (secure === true) {
  12792. cookie.push('secure');
  12793. }
  12794. document.cookie = cookie.join('; ');
  12795. },
  12796. read: function read(name) {
  12797. var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
  12798. return (match ? decodeURIComponent(match[3]) : null);
  12799. },
  12800. remove: function remove(name) {
  12801. this.write(name, '', Date.now() - 86400000);
  12802. }
  12803. };
  12804. })() :
  12805. // Non standard browser env (web workers, react-native) lack needed support.
  12806. (function nonStandardBrowserEnv() {
  12807. return {
  12808. write: function write() {},
  12809. read: function read() { return null; },
  12810. remove: function remove() {}
  12811. };
  12812. })()
  12813. );
  12814. /***/ },
  12815. /* 97 */
  12816. /***/ function(module, exports) {
  12817. "use strict";
  12818. 'use strict';
  12819. /**
  12820. * Determines whether the specified URL is absolute
  12821. *
  12822. * @param {string} url The URL to test
  12823. * @returns {boolean} True if the specified URL is absolute, otherwise false
  12824. */
  12825. module.exports = function isAbsoluteURL(url) {
  12826. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  12827. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  12828. // by any combination of letters, digits, plus, period, or hyphen.
  12829. return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
  12830. };
  12831. /***/ },
  12832. /* 98 */
  12833. /***/ function(module, exports, __webpack_require__) {
  12834. "use strict";
  12835. 'use strict';
  12836. var utils = __webpack_require__(2);
  12837. module.exports = (
  12838. utils.isStandardBrowserEnv() ?
  12839. // Standard browser envs have full support of the APIs needed to test
  12840. // whether the request URL is of the same origin as current location.
  12841. (function standardBrowserEnv() {
  12842. var msie = /(msie|trident)/i.test(navigator.userAgent);
  12843. var urlParsingNode = document.createElement('a');
  12844. var originURL;
  12845. /**
  12846. * Parse a URL to discover it's components
  12847. *
  12848. * @param {String} url The URL to be parsed
  12849. * @returns {Object}
  12850. */
  12851. function resolveURL(url) {
  12852. var href = url;
  12853. if (msie) {
  12854. // IE needs attribute set twice to normalize properties
  12855. urlParsingNode.setAttribute('href', href);
  12856. href = urlParsingNode.href;
  12857. }
  12858. urlParsingNode.setAttribute('href', href);
  12859. // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
  12860. return {
  12861. href: urlParsingNode.href,
  12862. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
  12863. host: urlParsingNode.host,
  12864. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
  12865. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
  12866. hostname: urlParsingNode.hostname,
  12867. port: urlParsingNode.port,
  12868. pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
  12869. urlParsingNode.pathname :
  12870. '/' + urlParsingNode.pathname
  12871. };
  12872. }
  12873. originURL = resolveURL(window.location.href);
  12874. /**
  12875. * Determine if a URL shares the same origin as the current location
  12876. *
  12877. * @param {String} requestURL The URL to test
  12878. * @returns {boolean} True if URL shares the same origin, otherwise false
  12879. */
  12880. return function isURLSameOrigin(requestURL) {
  12881. var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
  12882. return (parsed.protocol === originURL.protocol &&
  12883. parsed.host === originURL.host);
  12884. };
  12885. })() :
  12886. // Non standard browser envs (web workers, react-native) lack needed support.
  12887. (function nonStandardBrowserEnv() {
  12888. return function isURLSameOrigin() {
  12889. return true;
  12890. };
  12891. })()
  12892. );
  12893. /***/ },
  12894. /* 99 */
  12895. /***/ function(module, exports, __webpack_require__) {
  12896. "use strict";
  12897. 'use strict';
  12898. var utils = __webpack_require__(2);
  12899. module.exports = function normalizeHeaderName(headers, normalizedName) {
  12900. utils.forEach(headers, function processHeader(value, name) {
  12901. if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
  12902. headers[normalizedName] = value;
  12903. delete headers[name];
  12904. }
  12905. });
  12906. };
  12907. /***/ },
  12908. /* 100 */
  12909. /***/ function(module, exports, __webpack_require__) {
  12910. "use strict";
  12911. 'use strict';
  12912. var utils = __webpack_require__(2);
  12913. /**
  12914. * Parse headers into an object
  12915. *
  12916. * ```
  12917. * Date: Wed, 27 Aug 2014 08:58:49 GMT
  12918. * Content-Type: application/json
  12919. * Connection: keep-alive
  12920. * Transfer-Encoding: chunked
  12921. * ```
  12922. *
  12923. * @param {String} headers Headers needing to be parsed
  12924. * @returns {Object} Headers parsed into an object
  12925. */
  12926. module.exports = function parseHeaders(headers) {
  12927. var parsed = {};
  12928. var key;
  12929. var val;
  12930. var i;
  12931. if (!headers) { return parsed; }
  12932. utils.forEach(headers.split('\n'), function parser(line) {
  12933. i = line.indexOf(':');
  12934. key = utils.trim(line.substr(0, i)).toLowerCase();
  12935. val = utils.trim(line.substr(i + 1));
  12936. if (key) {
  12937. parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
  12938. }
  12939. });
  12940. return parsed;
  12941. };
  12942. /***/ },
  12943. /* 101 */
  12944. /***/ function(module, exports) {
  12945. "use strict";
  12946. 'use strict';
  12947. /**
  12948. * Syntactic sugar for invoking a function and expanding an array for arguments.
  12949. *
  12950. * Common use case would be to use `Function.prototype.apply`.
  12951. *
  12952. * ```js
  12953. * function f(x, y, z) {}
  12954. * var args = [1, 2, 3];
  12955. * f.apply(null, args);
  12956. * ```
  12957. *
  12958. * With `spread` this example can be re-written.
  12959. *
  12960. * ```js
  12961. * spread(function(x, y, z) {})([1, 2, 3]);
  12962. * ```
  12963. *
  12964. * @param {Function} callback
  12965. * @returns {Function}
  12966. */
  12967. module.exports = function spread(callback) {
  12968. return function wrap(arr) {
  12969. return callback.apply(null, arr);
  12970. };
  12971. };
  12972. /***/ },
  12973. /* 102 */
  12974. /***/ function(module, exports, __webpack_require__) {
  12975. "use strict";
  12976. 'use strict';
  12977. Object.defineProperty(exports, "__esModule", {
  12978. value: true
  12979. });
  12980. var _Menu = __webpack_require__(200);
  12981. var _Menu2 = _interopRequireDefault(_Menu);
  12982. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  12983. exports.default = {
  12984. name: 'LessPass',
  12985. components: {
  12986. 'lesspass-menu': _Menu2.default
  12987. },
  12988. created: function created() {
  12989. var _this = this;
  12990. var fiveMinutes = 1000 * 60 * 5;
  12991. this.$store.dispatch('REFRESH_TOKEN');
  12992. setInterval(function () {
  12993. _this.$store.dispatch('REFRESH_TOKEN');
  12994. }, fiveMinutes);
  12995. }
  12996. };
  12997. /***/ },
  12998. /* 103 */
  12999. /***/ function(module, exports) {
  13000. "use strict";
  13001. 'use strict';
  13002. Object.defineProperty(exports, "__esModule", {
  13003. value: true
  13004. });
  13005. exports.default = {
  13006. data: function data() {
  13007. return {
  13008. progress: false,
  13009. pressTimer: null,
  13010. longPress: false,
  13011. confirmHelp: ''
  13012. };
  13013. },
  13014. props: {
  13015. action: { type: Function, required: true },
  13016. text: { type: String, required: true },
  13017. object: { type: Object, required: true }
  13018. },
  13019. methods: {
  13020. start: function start(event) {
  13021. var _this = this;
  13022. if (event.type === "click" && event.button !== 0) {
  13023. return;
  13024. }
  13025. this.longPress = false;
  13026. this.progress = true;
  13027. this.pressTimer = setTimeout(function () {
  13028. _this.longPress = true;
  13029. _this.deleteConfirmed();
  13030. }, 2000);
  13031. return false;
  13032. },
  13033. click: function click() {
  13034. if (this.longPress) {
  13035. return;
  13036. }
  13037. if (this.pressTimer !== null) {
  13038. clearTimeout(this.pressTimer);
  13039. this.pressTimer = null;
  13040. }
  13041. this.progress = false;
  13042. this.confirmHelp = 'Long Press To Confirm';
  13043. },
  13044. cancel: function cancel() {
  13045. if (this.pressTimer !== null) {
  13046. clearTimeout(this.pressTimer);
  13047. this.pressTimer = null;
  13048. this.confirmHelp = '';
  13049. }
  13050. this.progress = false;
  13051. },
  13052. deleteConfirmed: function deleteConfirmed() {
  13053. var _this2 = this;
  13054. setTimeout(function () {
  13055. _this2.action(_this2.object);
  13056. }, 1000);
  13057. }
  13058. }
  13059. };
  13060. /***/ },
  13061. /* 104 */
  13062. /***/ function(module, exports, __webpack_require__) {
  13063. "use strict";
  13064. 'use strict';
  13065. Object.defineProperty(exports, "__esModule", {
  13066. value: true
  13067. });
  13068. var _lesspass = __webpack_require__(43);
  13069. var _lesspass2 = _interopRequireDefault(_lesspass);
  13070. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13071. exports.default = {
  13072. data: function data() {
  13073. return {
  13074. icon1: '',
  13075. icon2: '',
  13076. icon3: '',
  13077. color1: '',
  13078. color2: '',
  13079. color3: ''
  13080. };
  13081. },
  13082. props: ['fingerprint'],
  13083. watch: {
  13084. fingerprint: function fingerprint(newFingerprint) {
  13085. var _this = this;
  13086. if (!newFingerprint) {
  13087. return;
  13088. }
  13089. _lesspass2.default.createFingerprint(newFingerprint).then(function (sha256) {
  13090. var hash1 = sha256.substring(0, 6);
  13091. var hash2 = sha256.substring(6, 12);
  13092. var hash3 = sha256.substring(12, 18);
  13093. _this.icon1 = _this.getIcon(hash1);
  13094. _this.icon2 = _this.getIcon(hash2);
  13095. _this.icon3 = _this.getIcon(hash3);
  13096. _this.color1 = _this.getColor(hash1);
  13097. _this.color2 = _this.getColor(hash2);
  13098. _this.color3 = _this.getColor(hash3);
  13099. });
  13100. }
  13101. },
  13102. methods: {
  13103. getColor: function getColor(color) {
  13104. var colors = ['#000000', '#074750', '#009191', '#FF6CB6', '#FFB5DA', '#490092', '#006CDB', '#B66DFF', '#6DB5FE', '#B5DAFE', '#920000', '#924900', '#DB6D00', '#24FE23'];
  13105. var index = parseInt(color, 16) % colors.length;
  13106. return colors[index];
  13107. },
  13108. getIcon: function getIcon(hash) {
  13109. var icons = ['fa-hashtag', 'fa-heart', 'fa-hotel', 'fa-university', 'fa-plug', 'fa-ambulance', 'fa-bus', 'fa-car', 'fa-plane', 'fa-rocket', 'fa-ship', 'fa-subway', 'fa-truck', 'fa-jpy', 'fa-eur', 'fa-btc', 'fa-usd', 'fa-gbp', 'fa-archive', 'fa-area-chart', 'fa-bed', 'fa-beer', 'fa-bell', 'fa-binoculars', 'fa-birthday-cake', 'fa-bomb', 'fa-briefcase', 'fa-bug', 'fa-camera', 'fa-cart-plus', 'fa-certificate', 'fa-coffee', 'fa-cloud', 'fa-coffee', 'fa-comment', 'fa-cube', 'fa-cutlery', 'fa-database', 'fa-diamond', 'fa-exclamation-circle', 'fa-eye', 'fa-flag', 'fa-flask', 'fa-futbol-o', 'fa-gamepad', 'fa-graduation-cap'];
  13110. var index = parseInt(hash, 16) % icons.length;
  13111. return icons[index];
  13112. }
  13113. }
  13114. };
  13115. /***/ },
  13116. /* 105 */
  13117. /***/ function(module, exports, __webpack_require__) {
  13118. "use strict";
  13119. 'use strict';
  13120. Object.defineProperty(exports, "__esModule", {
  13121. value: true
  13122. });
  13123. var _vuex = __webpack_require__(8);
  13124. exports.default = {
  13125. methods: {
  13126. logout: function logout() {
  13127. this.$store.dispatch('LOGOUT');
  13128. this.$router.push({ name: 'home' });
  13129. },
  13130. saveOrUpdatePassword: function saveOrUpdatePassword() {
  13131. this.$store.dispatch('SAVE_OR_UPDATE_PASSWORD');
  13132. }
  13133. },
  13134. computed: (0, _vuex.mapGetters)(['isAuthenticated', 'isGuest', 'email', 'passwordStatus', 'version'])
  13135. };
  13136. /***/ },
  13137. /* 106 */
  13138. /***/ function(module, exports, __webpack_require__) {
  13139. "use strict";
  13140. 'use strict';
  13141. Object.defineProperty(exports, "__esModule", {
  13142. value: true
  13143. });
  13144. var _extends2 = __webpack_require__(24);
  13145. var _extends3 = _interopRequireDefault(_extends2);
  13146. var _lesspass = __webpack_require__(43);
  13147. var _lesspass2 = _interopRequireDefault(_lesspass);
  13148. var _auth = __webpack_require__(23);
  13149. var _auth2 = _interopRequireDefault(_auth);
  13150. var _storage = __webpack_require__(13);
  13151. var _storage2 = _interopRequireDefault(_storage);
  13152. var _vuex = __webpack_require__(8);
  13153. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13154. var defaultErrors = {
  13155. userNameAlreadyExist: false,
  13156. emailInvalid: false,
  13157. baseURLRequired: false,
  13158. emailRequired: false,
  13159. passwordRequired: false
  13160. };
  13161. exports.default = {
  13162. data: function data() {
  13163. var storage = new _storage2.default();
  13164. var auth = new _auth2.default(storage);
  13165. return {
  13166. auth: auth,
  13167. storage: storage,
  13168. password: '',
  13169. useMasterPassword: false,
  13170. seeMasterPasswordHelp: false,
  13171. showError: false,
  13172. errorMessage: '',
  13173. loadingRegister: false,
  13174. loadingSignIn: false,
  13175. errors: (0, _extends3.default)({}, defaultErrors)
  13176. };
  13177. },
  13178. methods: {
  13179. noErrors: function noErrors() {
  13180. return !(this.errors.userNameAlreadyExist || this.errors.emailInvalid || this.errors.emailRequired || this.errors.passwordRequired || this.errors.baseURLRequired || this.showError);
  13181. },
  13182. formIsValid: function formIsValid() {
  13183. this.cleanErrors();
  13184. var formIsValid = true;
  13185. if (!this.email) {
  13186. this.errors.emailRequired = true;
  13187. formIsValid = false;
  13188. }
  13189. if (!this.password) {
  13190. this.errors.passwordRequired = true;
  13191. formIsValid = false;
  13192. }
  13193. if (!this.baseURL) {
  13194. this.errors.baseURLRequired = true;
  13195. formIsValid = false;
  13196. }
  13197. return formIsValid;
  13198. },
  13199. cleanErrors: function cleanErrors() {
  13200. this.loadingRegister = false;
  13201. this.loadingSignIn = false;
  13202. this.showError = false;
  13203. this.errorMessage = '';
  13204. this.errors = (0, _extends3.default)({}, defaultErrors);
  13205. },
  13206. signIn: function signIn() {
  13207. var _this = this;
  13208. if (this.formIsValid()) {
  13209. (function () {
  13210. _this.loadingSignIn = true;
  13211. var email = _this.email;
  13212. var password = _this.password;
  13213. var baseURL = _this.baseURL;
  13214. _this.auth.login({ email: email, password: password }, baseURL).then(function () {
  13215. _this.loadingSignIn = false;
  13216. _this.storage.save({ baseURL: baseURL, email: email });
  13217. _this.$store.dispatch('USER_AUTHENTICATED', { email: email });
  13218. _this.$router.push({ name: 'home' });
  13219. }).catch(function (err) {
  13220. _this.cleanErrors();
  13221. if (err.response === undefined) {
  13222. if (baseURL === "https://lesspass.com") {
  13223. _this.showErrorMessage();
  13224. } else {
  13225. _this.showErrorMessage('Your LessPass Database is not running');
  13226. }
  13227. } else if (err.response.status === 400) {
  13228. _this.showErrorMessage('Your email and/or password is not good. Do you have an account?');
  13229. } else {
  13230. _this.showErrorMessage();
  13231. }
  13232. });
  13233. })();
  13234. }
  13235. },
  13236. register: function register() {
  13237. var _this2 = this;
  13238. if (this.formIsValid()) {
  13239. this.loadingRegister = true;
  13240. var email = this.email;
  13241. var password = this.password;
  13242. var baseURL = this.baseURL;
  13243. this.auth.register({ email: email, password: password }, baseURL).then(function () {
  13244. _this2.loadingRegister = false;
  13245. _this2.signIn();
  13246. }).catch(function (err) {
  13247. _this2.cleanErrors();
  13248. if (err.response && typeof err.response.data.email !== 'undefined') {
  13249. if (err.response.data.email[0].indexOf('already exists') !== -1) {
  13250. _this2.errors.userNameAlreadyExist = true;
  13251. }
  13252. if (err.response.data.email[0].indexOf('valid email') !== -1) {
  13253. _this2.errors.emailInvalid = true;
  13254. }
  13255. } else {
  13256. _this2.showErrorMessage();
  13257. }
  13258. });
  13259. }
  13260. },
  13261. showErrorMessage: function showErrorMessage() {
  13262. var errorMessage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Oops! Something went wrong. Retry in a few minutes.';
  13263. this.errorMessage = errorMessage;
  13264. this.showError = true;
  13265. }
  13266. },
  13267. computed: (0, _extends3.default)({}, (0, _vuex.mapGetters)(['version']), {
  13268. baseURL: {
  13269. get: function get() {
  13270. return this.$store.state.baseURL;
  13271. },
  13272. set: function set(baseURL) {
  13273. this.$store.commit('UPDATE_BASE_URL', { baseURL: baseURL });
  13274. }
  13275. },
  13276. email: {
  13277. get: function get() {
  13278. return this.$store.state.email;
  13279. },
  13280. set: function set(email) {
  13281. this.$store.commit('UPDATE_EMAIL', { email: email });
  13282. }
  13283. }
  13284. }),
  13285. watch: {
  13286. 'useMasterPassword': function useMasterPassword(_useMasterPassword) {
  13287. var _this3 = this;
  13288. if (!this.email || !this.password) {
  13289. return;
  13290. }
  13291. if (!_useMasterPassword) {
  13292. this.password = '';
  13293. return;
  13294. }
  13295. var site = 'lesspass.com';
  13296. var options = {
  13297. counter: 1,
  13298. length: 12,
  13299. lowercase: true,
  13300. uppercase: true,
  13301. numbers: true,
  13302. symbols: true
  13303. };
  13304. _lesspass2.default.encryptLogin(this.email, this.password).then(function (encryptedLogin) {
  13305. _lesspass2.default.renderPassword(encryptedLogin, site, options).then(function (generatedPassword) {
  13306. _this3.password = generatedPassword;
  13307. });
  13308. });
  13309. }
  13310. }
  13311. };
  13312. /***/ },
  13313. /* 107 */
  13314. /***/ function(module, exports, __webpack_require__) {
  13315. "use strict";
  13316. 'use strict';
  13317. Object.defineProperty(exports, "__esModule", {
  13318. value: true
  13319. });
  13320. var _extends2 = __webpack_require__(24);
  13321. var _extends3 = _interopRequireDefault(_extends2);
  13322. var _lesspass = __webpack_require__(43);
  13323. var _lesspass2 = _interopRequireDefault(_lesspass);
  13324. var _vuex = __webpack_require__(8);
  13325. var _clipboard = __webpack_require__(121);
  13326. var _clipboard2 = _interopRequireDefault(_clipboard);
  13327. var _lodash = __webpack_require__(178);
  13328. var _lodash2 = _interopRequireDefault(_lodash);
  13329. var _tooltip = __webpack_require__(113);
  13330. var _password = __webpack_require__(56);
  13331. var _password2 = _interopRequireDefault(_password);
  13332. var _urlParser = __webpack_require__(114);
  13333. var _RemoveAutoComplete = __webpack_require__(201);
  13334. var _RemoveAutoComplete2 = _interopRequireDefault(_RemoveAutoComplete);
  13335. var _Fingerprint = __webpack_require__(199);
  13336. var _Fingerprint2 = _interopRequireDefault(_Fingerprint);
  13337. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13338. function fetchPasswords(store) {
  13339. return store.dispatch('FETCH_PASSWORDS');
  13340. }
  13341. exports.default = {
  13342. name: 'password-generator-view',
  13343. components: {
  13344. RemoveAutoComplete: _RemoveAutoComplete2.default,
  13345. Fingerprint: _Fingerprint2.default
  13346. },
  13347. computed: (0, _vuex.mapGetters)(['passwords', 'password', 'version']),
  13348. preFetch: fetchPasswords,
  13349. beforeMount: function beforeMount() {
  13350. var _this = this;
  13351. var id = this.$route.params.id;
  13352. if (id) {
  13353. this.$store.dispatch('FETCH_PASSWORD', { id: id });
  13354. } else {
  13355. fetchPasswords(this.$store);
  13356. }
  13357. (0, _urlParser.getSite)().then(function (site) {
  13358. if (site) {
  13359. _this.$store.commit('UPDATE_SITE', { site: site });
  13360. }
  13361. });
  13362. var clipboard = new _clipboard2.default('#copyPasswordButton');
  13363. clipboard.on('success', function (event) {
  13364. if (event.text) {
  13365. (0, _tooltip.showTooltip)(event.trigger, 'copied !');
  13366. setTimeout(function () {
  13367. _this.showCopyBtn = false;
  13368. _this.cleanFormInSeconds(8);
  13369. }, 2000);
  13370. }
  13371. });
  13372. },
  13373. data: function data() {
  13374. return {
  13375. masterPassword: '',
  13376. fingerprint: '',
  13377. cleanTimeout: null,
  13378. showOptions: false,
  13379. showCopyBtn: false,
  13380. showError: false
  13381. };
  13382. },
  13383. watch: {
  13384. 'masterPassword': function masterPassword() {
  13385. this.showCopyBtn = false;
  13386. this.showFingerprint();
  13387. },
  13388. 'password.site': function passwordSite(newValue) {
  13389. var values = newValue.split(" | ");
  13390. if (values.length === 2) {
  13391. var site = values[0];
  13392. var login = values[1];
  13393. var passwords = this.passwords;
  13394. for (var i = 0; i < passwords.length; i++) {
  13395. var password = passwords[i];
  13396. if (password.site === site && password.login === login) {
  13397. this.$store.dispatch('PASSWORD_CHANGE', { password: (0, _extends3.default)({}, password) });
  13398. this.$refs.masterPassword.focus();
  13399. break;
  13400. }
  13401. }
  13402. }
  13403. }
  13404. },
  13405. methods: {
  13406. showFingerprint: (0, _lodash2.default)(function () {
  13407. this.fingerprint = this.masterPassword;
  13408. }, 3000),
  13409. showMasterPassword: function showMasterPassword() {
  13410. if (this.$refs.masterPassword.type === 'password') {
  13411. this.$refs.masterPassword.type = 'text';
  13412. } else {
  13413. this.$refs.masterPassword.type = 'password';
  13414. }
  13415. },
  13416. cleanFormInSeconds: function cleanFormInSeconds(seconds) {
  13417. var _this2 = this;
  13418. clearTimeout(this.cleanTimeout);
  13419. this.cleanTimeout = setTimeout(function () {
  13420. _this2.$store.commit('PASSWORD_CLEAN');
  13421. _this2.masterPassword = '';
  13422. _this2.fingerprint = '';
  13423. }, 1000 * seconds);
  13424. },
  13425. renderPassword: function renderPassword() {
  13426. var _this3 = this;
  13427. clearTimeout(this.cleanTimeout);
  13428. var site = this.password.site;
  13429. var login = this.password.login;
  13430. var masterPassword = this.masterPassword;
  13431. if (!site || !login || !masterPassword) {
  13432. this.showError = true;
  13433. return;
  13434. }
  13435. this.showError = false;
  13436. this.fingerprint = this.masterPassword;
  13437. var passwordProfile = {
  13438. lowercase: this.password.lowercase,
  13439. uppercase: this.password.uppercase,
  13440. numbers: this.password.numbers,
  13441. symbols: this.password.symbols,
  13442. length: this.password.length,
  13443. counter: this.password.counter,
  13444. version: this.password.version || this.version
  13445. };
  13446. return _lesspass2.default.generatePassword(site, login, masterPassword, passwordProfile).then(function (generatedPassword) {
  13447. window.document.getElementById('copyPasswordButton').setAttribute('data-clipboard-text', generatedPassword);
  13448. _this3.showCopyBtn = !_this3.showCopyBtn;
  13449. _this3.$store.dispatch('PASSWORD_GENERATED');
  13450. }).catch(function (err) {
  13451. console.log(err);
  13452. });
  13453. },
  13454. changeVersion: function changeVersion(version) {
  13455. this.$store.commit('CHANGE_VERSION', { version: version });
  13456. },
  13457. selectVersion: function selectVersion(event) {
  13458. this.password.version = parseInt(event.target.value);
  13459. }
  13460. }
  13461. };
  13462. /***/ },
  13463. /* 108 */
  13464. /***/ function(module, exports, __webpack_require__) {
  13465. "use strict";
  13466. 'use strict';
  13467. Object.defineProperty(exports, "__esModule", {
  13468. value: true
  13469. });
  13470. var _auth = __webpack_require__(23);
  13471. var _auth2 = _interopRequireDefault(_auth);
  13472. var _storage = __webpack_require__(13);
  13473. var _storage2 = _interopRequireDefault(_storage);
  13474. var _vuex = __webpack_require__(8);
  13475. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13476. exports.default = {
  13477. data: function data() {
  13478. var storage = new _storage2.default();
  13479. var auth = new _auth2.default(storage);
  13480. return {
  13481. auth: auth,
  13482. storage: storage,
  13483. email: '',
  13484. emailRequired: false,
  13485. showError: false,
  13486. loading: false,
  13487. successMessage: false
  13488. };
  13489. },
  13490. methods: {
  13491. cleanErrors: function cleanErrors() {
  13492. this.loading = false;
  13493. this.emailRequired = false;
  13494. this.showError = false;
  13495. this.successMessage = false;
  13496. },
  13497. noErrors: function noErrors() {
  13498. return !(this.emailRequired || this.showError);
  13499. },
  13500. resetPassword: function resetPassword() {
  13501. var _this = this;
  13502. this.cleanErrors();
  13503. if (!this.email) {
  13504. this.emailRequired = true;
  13505. return;
  13506. }
  13507. this.loading = true;
  13508. this.auth.resetPassword({ email: this.email }).then(function () {
  13509. _this.cleanErrors();
  13510. _this.successMessage = true;
  13511. }).catch(function () {
  13512. _this.cleanErrors();
  13513. _this.showError = true;
  13514. });
  13515. }
  13516. }
  13517. };
  13518. /***/ },
  13519. /* 109 */
  13520. /***/ function(module, exports, __webpack_require__) {
  13521. "use strict";
  13522. 'use strict';
  13523. Object.defineProperty(exports, "__esModule", {
  13524. value: true
  13525. });
  13526. var _auth = __webpack_require__(23);
  13527. var _auth2 = _interopRequireDefault(_auth);
  13528. var _storage = __webpack_require__(13);
  13529. var _storage2 = _interopRequireDefault(_storage);
  13530. var _vuex = __webpack_require__(8);
  13531. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13532. exports.default = {
  13533. data: function data() {
  13534. var storage = new _storage2.default();
  13535. var auth = new _auth2.default(storage);
  13536. return {
  13537. auth: auth,
  13538. storage: storage,
  13539. new_password: '',
  13540. passwordRequired: false,
  13541. showError: false,
  13542. successMessage: false,
  13543. errorMessage: 'Oops! Something went wrong. Retry in a few minutes.'
  13544. };
  13545. },
  13546. methods: {
  13547. cleanErrors: function cleanErrors() {
  13548. this.passwordRequired = false;
  13549. this.showError = false;
  13550. this.successMessage = false;
  13551. },
  13552. noErrors: function noErrors() {
  13553. return !(this.passwordRequired || this.showError);
  13554. },
  13555. resetPasswordConfirm: function resetPasswordConfirm() {
  13556. var _this = this;
  13557. this.cleanErrors();
  13558. if (!this.new_password) {
  13559. this.passwordRequired = true;
  13560. return;
  13561. }
  13562. this.auth.confirmResetPassword({
  13563. uid: this.$route.params.uid,
  13564. token: this.$route.params.token,
  13565. new_password: this.new_password
  13566. }).then(function () {
  13567. _this.successMessage = true;
  13568. }).catch(function (err) {
  13569. if (err.response.status === 400) {
  13570. _this.errorMessage = 'This password reset link become invalid.';
  13571. }
  13572. _this.showError = true;
  13573. });
  13574. }
  13575. }
  13576. };
  13577. /***/ },
  13578. /* 110 */
  13579. /***/ function(module, exports, __webpack_require__) {
  13580. "use strict";
  13581. 'use strict';
  13582. Object.defineProperty(exports, "__esModule", {
  13583. value: true
  13584. });
  13585. var _extends2 = __webpack_require__(24);
  13586. var _extends3 = _interopRequireDefault(_extends2);
  13587. var _DeleteButton = __webpack_require__(198);
  13588. var _DeleteButton2 = _interopRequireDefault(_DeleteButton);
  13589. var _vuex = __webpack_require__(8);
  13590. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13591. function fetchPasswords(store) {
  13592. return store.dispatch('FETCH_PASSWORDS');
  13593. }
  13594. exports.default = {
  13595. name: 'passwords-view',
  13596. data: function data() {
  13597. return {
  13598. searchQuery: ''
  13599. };
  13600. },
  13601. components: { DeleteButton: _DeleteButton2.default },
  13602. computed: (0, _extends3.default)({}, (0, _vuex.mapGetters)(['passwords', 'email']), {
  13603. filteredPasswords: function filteredPasswords() {
  13604. var _this = this;
  13605. return this.passwords.filter(function (password) {
  13606. return password.site.indexOf(_this.searchQuery) > -1 || password.login.indexOf(_this.searchQuery) > -1;
  13607. });
  13608. }
  13609. }),
  13610. preFetch: fetchPasswords,
  13611. beforeMount: function beforeMount() {
  13612. fetchPasswords(this.$store);
  13613. },
  13614. methods: {
  13615. deletePassword: function deletePassword(password) {
  13616. return this.$store.dispatch('DELETE_PASSWORD', { id: password.id });
  13617. }
  13618. }
  13619. };
  13620. /***/ },
  13621. /* 111 */
  13622. /***/ function(module, exports, __webpack_require__) {
  13623. "use strict";
  13624. 'use strict';
  13625. Object.defineProperty(exports, "__esModule", {
  13626. value: true
  13627. });
  13628. var _extends2 = __webpack_require__(24);
  13629. var _extends3 = _interopRequireDefault(_extends2);
  13630. var _classCallCheck2 = __webpack_require__(14);
  13631. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  13632. var _createClass2 = __webpack_require__(15);
  13633. var _createClass3 = _interopRequireDefault(_createClass2);
  13634. var _axios = __webpack_require__(49);
  13635. var _axios2 = _interopRequireDefault(_axios);
  13636. var _storage = __webpack_require__(13);
  13637. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13638. var HTTP = function () {
  13639. function HTTP(resource, storage) {
  13640. (0, _classCallCheck3.default)(this, HTTP);
  13641. this.storage = storage;
  13642. this.resource = resource;
  13643. }
  13644. (0, _createClass3.default)(HTTP, [{
  13645. key: 'getRequestConfig',
  13646. value: function getRequestConfig() {
  13647. var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  13648. var config = this.storage.json();
  13649. return (0, _extends3.default)({}, params, {
  13650. baseURL: config.baseURL,
  13651. headers: { Authorization: 'JWT ' + config[_storage.TOKEN_KEY] }
  13652. });
  13653. }
  13654. }, {
  13655. key: 'create',
  13656. value: function create(resource) {
  13657. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13658. return _axios2.default.post('/api/' + this.resource + '/', resource, this.getRequestConfig(params));
  13659. }
  13660. }, {
  13661. key: 'all',
  13662. value: function all() {
  13663. var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  13664. return _axios2.default.get('/api/' + this.resource + '/', this.getRequestConfig(params));
  13665. }
  13666. }, {
  13667. key: 'get',
  13668. value: function get(resource) {
  13669. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13670. return _axios2.default.get('/api/' + this.resource + '/' + resource.id + '/', this.getRequestConfig(params));
  13671. }
  13672. }, {
  13673. key: 'update',
  13674. value: function update(resource) {
  13675. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13676. return _axios2.default.put('/api/' + this.resource + '/' + resource.id + '/', resource, this.getRequestConfig(params));
  13677. }
  13678. }, {
  13679. key: 'remove',
  13680. value: function remove(resource) {
  13681. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13682. return _axios2.default.delete('/api/' + this.resource + '/' + resource.id + '/', this.getRequestConfig(params));
  13683. }
  13684. }]);
  13685. return HTTP;
  13686. }();
  13687. exports.default = HTTP;
  13688. /***/ },
  13689. /* 112 */
  13690. /***/ function(module, exports, __webpack_require__) {
  13691. "use strict";
  13692. 'use strict';
  13693. Object.defineProperty(exports, "__esModule", {
  13694. value: true
  13695. });
  13696. exports.TOKEN_KEY = undefined;
  13697. var _classCallCheck2 = __webpack_require__(14);
  13698. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  13699. var _createClass2 = __webpack_require__(15);
  13700. var _createClass3 = _interopRequireDefault(_createClass2);
  13701. var _jwtDecode = __webpack_require__(175);
  13702. var _jwtDecode2 = _interopRequireDefault(_jwtDecode);
  13703. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13704. var TOKEN_KEY = exports.TOKEN_KEY = 'jwt';
  13705. var Token = function () {
  13706. function Token(tokenName) {
  13707. (0, _classCallCheck3.default)(this, Token);
  13708. this.name = tokenName;
  13709. }
  13710. (0, _createClass3.default)(Token, [{
  13711. key: 'stillValid',
  13712. value: function stillValid() {
  13713. var now = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
  13714. try {
  13715. return this._expirationDateSuperiorTo(now);
  13716. } catch (err) {
  13717. return false;
  13718. }
  13719. }
  13720. }, {
  13721. key: 'expiresInMinutes',
  13722. value: function expiresInMinutes(minutes) {
  13723. var now = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Date();
  13724. try {
  13725. var nowPlusDuration = new Date(now.getTime() + minutes * 60000);
  13726. return this._expirationDateInferiorTo(nowPlusDuration);
  13727. } catch (err) {
  13728. return false;
  13729. }
  13730. }
  13731. }, {
  13732. key: '_expirationDateInferiorTo',
  13733. value: function _expirationDateInferiorTo(date) {
  13734. var expireDate = this._getTokenExpirationDate();
  13735. return expireDate < date;
  13736. }
  13737. }, {
  13738. key: '_expirationDateSuperiorTo',
  13739. value: function _expirationDateSuperiorTo(date) {
  13740. return !this._expirationDateInferiorTo(date);
  13741. }
  13742. }, {
  13743. key: '_getTokenExpirationDate',
  13744. value: function _getTokenExpirationDate() {
  13745. var decodedToken = (0, _jwtDecode2.default)(this.name);
  13746. return new Date(decodedToken.exp * 1000);
  13747. }
  13748. }]);
  13749. return Token;
  13750. }();
  13751. exports.default = Token;
  13752. /***/ },
  13753. /* 113 */
  13754. /***/ function(module, exports) {
  13755. "use strict";
  13756. 'use strict';
  13757. Object.defineProperty(exports, "__esModule", {
  13758. value: true
  13759. });
  13760. exports.showTooltip = showTooltip;
  13761. function showTooltip(elem, msg) {
  13762. var classNames = elem.className;
  13763. elem.setAttribute('class', classNames + ' hint--top');
  13764. elem.setAttribute('aria-label', msg);
  13765. setTimeout(function () {
  13766. elem.setAttribute('class', classNames);
  13767. }, 2000);
  13768. }
  13769. /***/ },
  13770. /* 114 */
  13771. /***/ function(module, exports, __webpack_require__) {
  13772. "use strict";
  13773. 'use strict';
  13774. Object.defineProperty(exports, "__esModule", {
  13775. value: true
  13776. });
  13777. exports.getSite = exports.getCurrentUrl = exports.isWebExtension = exports._ipIsValid = exports.getDomainName = undefined;
  13778. var _promise = __webpack_require__(58);
  13779. var _promise2 = _interopRequireDefault(_promise);
  13780. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13781. function _ipIsValid(ipAddress) {
  13782. return Boolean(/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ipAddress));
  13783. }
  13784. function getDomainName(urlStr) {
  13785. var matches = urlStr.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
  13786. return matches && matches[1];
  13787. }
  13788. function isWebExtension() {
  13789. if (typeof chrome !== 'undefined' && typeof chrome.tabs !== 'undefined') {
  13790. return typeof chrome.tabs.query === 'function';
  13791. }
  13792. return false;
  13793. }
  13794. function getCurrentUrl() {
  13795. return new _promise2.default(function (resolve) {
  13796. chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
  13797. resolve(tabs[0].url);
  13798. });
  13799. });
  13800. }
  13801. function getSite() {
  13802. if (isWebExtension()) {
  13803. return getCurrentUrl().then(function (currentUrl) {
  13804. return getDomainName(currentUrl);
  13805. });
  13806. }
  13807. return new _promise2.default(function (resolve) {
  13808. resolve('');
  13809. });
  13810. }
  13811. exports.getDomainName = getDomainName;
  13812. exports._ipIsValid = _ipIsValid;
  13813. exports.isWebExtension = isWebExtension;
  13814. exports.getCurrentUrl = getCurrentUrl;
  13815. exports.getSite = getSite;
  13816. /***/ },
  13817. /* 115 */
  13818. /***/ function(module, exports, __webpack_require__) {
  13819. module.exports = { "default": __webpack_require__(122), __esModule: true };
  13820. /***/ },
  13821. /* 116 */
  13822. /***/ function(module, exports, __webpack_require__) {
  13823. "use strict";
  13824. "use strict";
  13825. exports.__esModule = true;
  13826. var _defineProperty = __webpack_require__(57);
  13827. var _defineProperty2 = _interopRequireDefault(_defineProperty);
  13828. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13829. exports.default = function (obj, key, value) {
  13830. if (key in obj) {
  13831. (0, _defineProperty2.default)(obj, key, {
  13832. value: value,
  13833. enumerable: true,
  13834. configurable: true,
  13835. writable: true
  13836. });
  13837. } else {
  13838. obj[key] = value;
  13839. }
  13840. return obj;
  13841. };
  13842. /***/ },
  13843. /* 117 */
  13844. /***/ function(module, exports) {
  13845. "use strict";
  13846. 'use strict'
  13847. exports.byteLength = byteLength
  13848. exports.toByteArray = toByteArray
  13849. exports.fromByteArray = fromByteArray
  13850. var lookup = []
  13851. var revLookup = []
  13852. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  13853. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  13854. for (var i = 0, len = code.length; i < len; ++i) {
  13855. lookup[i] = code[i]
  13856. revLookup[code.charCodeAt(i)] = i
  13857. }
  13858. revLookup['-'.charCodeAt(0)] = 62
  13859. revLookup['_'.charCodeAt(0)] = 63
  13860. function placeHoldersCount (b64) {
  13861. var len = b64.length
  13862. if (len % 4 > 0) {
  13863. throw new Error('Invalid string. Length must be a multiple of 4')
  13864. }
  13865. // the number of equal signs (place holders)
  13866. // if there are two placeholders, than the two characters before it
  13867. // represent one byte
  13868. // if there is only one, then the three characters before it represent 2 bytes
  13869. // this is just a cheap hack to not do indexOf twice
  13870. return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
  13871. }
  13872. function byteLength (b64) {
  13873. // base64 is 4/3 + up to two characters of the original data
  13874. return b64.length * 3 / 4 - placeHoldersCount(b64)
  13875. }
  13876. function toByteArray (b64) {
  13877. var i, j, l, tmp, placeHolders, arr
  13878. var len = b64.length
  13879. placeHolders = placeHoldersCount(b64)
  13880. arr = new Arr(len * 3 / 4 - placeHolders)
  13881. // if there are placeholders, only get up to the last complete 4 chars
  13882. l = placeHolders > 0 ? len - 4 : len
  13883. var L = 0
  13884. for (i = 0, j = 0; i < l; i += 4, j += 3) {
  13885. tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
  13886. arr[L++] = (tmp >> 16) & 0xFF
  13887. arr[L++] = (tmp >> 8) & 0xFF
  13888. arr[L++] = tmp & 0xFF
  13889. }
  13890. if (placeHolders === 2) {
  13891. tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
  13892. arr[L++] = tmp & 0xFF
  13893. } else if (placeHolders === 1) {
  13894. tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
  13895. arr[L++] = (tmp >> 8) & 0xFF
  13896. arr[L++] = tmp & 0xFF
  13897. }
  13898. return arr
  13899. }
  13900. function tripletToBase64 (num) {
  13901. return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
  13902. }
  13903. function encodeChunk (uint8, start, end) {
  13904. var tmp
  13905. var output = []
  13906. for (var i = start; i < end; i += 3) {
  13907. tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
  13908. output.push(tripletToBase64(tmp))
  13909. }
  13910. return output.join('')
  13911. }
  13912. function fromByteArray (uint8) {
  13913. var tmp
  13914. var len = uint8.length
  13915. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  13916. var output = ''
  13917. var parts = []
  13918. var maxChunkLength = 16383 // must be multiple of 3
  13919. // go through the array every three bytes, we'll deal with trailing stuff later
  13920. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  13921. parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
  13922. }
  13923. // pad the end with zeros, but make sure to not forget the extra bytes
  13924. if (extraBytes === 1) {
  13925. tmp = uint8[len - 1]
  13926. output += lookup[tmp >> 2]
  13927. output += lookup[(tmp << 4) & 0x3F]
  13928. output += '=='
  13929. } else if (extraBytes === 2) {
  13930. tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
  13931. output += lookup[tmp >> 10]
  13932. output += lookup[(tmp >> 4) & 0x3F]
  13933. output += lookup[(tmp << 2) & 0x3F]
  13934. output += '='
  13935. }
  13936. parts.push(output)
  13937. return parts.join('')
  13938. }
  13939. /***/ },
  13940. /* 118 */
  13941. /***/ function(module, exports, __webpack_require__) {
  13942. /* WEBPACK VAR INJECTION */(function(module) {var bigInt = (function (undefined) {
  13943. "use strict";
  13944. var BASE = 1e7,
  13945. LOG_BASE = 7,
  13946. MAX_INT = 9007199254740992,
  13947. MAX_INT_ARR = smallToArray(MAX_INT),
  13948. LOG_MAX_INT = Math.log(MAX_INT);
  13949. function Integer(v, radix) {
  13950. if (typeof v === "undefined") return Integer[0];
  13951. if (typeof radix !== "undefined") return +radix === 10 ? parseValue(v) : parseBase(v, radix);
  13952. return parseValue(v);
  13953. }
  13954. function BigInteger(value, sign) {
  13955. this.value = value;
  13956. this.sign = sign;
  13957. this.isSmall = false;
  13958. }
  13959. BigInteger.prototype = Object.create(Integer.prototype);
  13960. function SmallInteger(value) {
  13961. this.value = value;
  13962. this.sign = value < 0;
  13963. this.isSmall = true;
  13964. }
  13965. SmallInteger.prototype = Object.create(Integer.prototype);
  13966. function isPrecise(n) {
  13967. return -MAX_INT < n && n < MAX_INT;
  13968. }
  13969. function smallToArray(n) { // For performance reasons doesn't reference BASE, need to change this function if BASE changes
  13970. if (n < 1e7)
  13971. return [n];
  13972. if (n < 1e14)
  13973. return [n % 1e7, Math.floor(n / 1e7)];
  13974. return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)];
  13975. }
  13976. function arrayToSmall(arr) { // If BASE changes this function may need to change
  13977. trim(arr);
  13978. var length = arr.length;
  13979. if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) {
  13980. switch (length) {
  13981. case 0: return 0;
  13982. case 1: return arr[0];
  13983. case 2: return arr[0] + arr[1] * BASE;
  13984. default: return arr[0] + (arr[1] + arr[2] * BASE) * BASE;
  13985. }
  13986. }
  13987. return arr;
  13988. }
  13989. function trim(v) {
  13990. var i = v.length;
  13991. while (v[--i] === 0);
  13992. v.length = i + 1;
  13993. }
  13994. function createArray(length) { // function shamelessly stolen from Yaffle's library https://github.com/Yaffle/BigInteger
  13995. var x = new Array(length);
  13996. var i = -1;
  13997. while (++i < length) {
  13998. x[i] = 0;
  13999. }
  14000. return x;
  14001. }
  14002. function truncate(n) {
  14003. if (n > 0) return Math.floor(n);
  14004. return Math.ceil(n);
  14005. }
  14006. function add(a, b) { // assumes a and b are arrays with a.length >= b.length
  14007. var l_a = a.length,
  14008. l_b = b.length,
  14009. r = new Array(l_a),
  14010. carry = 0,
  14011. base = BASE,
  14012. sum, i;
  14013. for (i = 0; i < l_b; i++) {
  14014. sum = a[i] + b[i] + carry;
  14015. carry = sum >= base ? 1 : 0;
  14016. r[i] = sum - carry * base;
  14017. }
  14018. while (i < l_a) {
  14019. sum = a[i] + carry;
  14020. carry = sum === base ? 1 : 0;
  14021. r[i++] = sum - carry * base;
  14022. }
  14023. if (carry > 0) r.push(carry);
  14024. return r;
  14025. }
  14026. function addAny(a, b) {
  14027. if (a.length >= b.length) return add(a, b);
  14028. return add(b, a);
  14029. }
  14030. function addSmall(a, carry) { // assumes a is array, carry is number with 0 <= carry < MAX_INT
  14031. var l = a.length,
  14032. r = new Array(l),
  14033. base = BASE,
  14034. sum, i;
  14035. for (i = 0; i < l; i++) {
  14036. sum = a[i] - base + carry;
  14037. carry = Math.floor(sum / base);
  14038. r[i] = sum - carry * base;
  14039. carry += 1;
  14040. }
  14041. while (carry > 0) {
  14042. r[i++] = carry % base;
  14043. carry = Math.floor(carry / base);
  14044. }
  14045. return r;
  14046. }
  14047. BigInteger.prototype.add = function (v) {
  14048. var value, n = parseValue(v);
  14049. if (this.sign !== n.sign) {
  14050. return this.subtract(n.negate());
  14051. }
  14052. var a = this.value, b = n.value;
  14053. if (n.isSmall) {
  14054. return new BigInteger(addSmall(a, Math.abs(b)), this.sign);
  14055. }
  14056. return new BigInteger(addAny(a, b), this.sign);
  14057. };
  14058. BigInteger.prototype.plus = BigInteger.prototype.add;
  14059. SmallInteger.prototype.add = function (v) {
  14060. var n = parseValue(v);
  14061. var a = this.value;
  14062. if (a < 0 !== n.sign) {
  14063. return this.subtract(n.negate());
  14064. }
  14065. var b = n.value;
  14066. if (n.isSmall) {
  14067. if (isPrecise(a + b)) return new SmallInteger(a + b);
  14068. b = smallToArray(Math.abs(b));
  14069. }
  14070. return new BigInteger(addSmall(b, Math.abs(a)), a < 0);
  14071. };
  14072. SmallInteger.prototype.plus = SmallInteger.prototype.add;
  14073. function subtract(a, b) { // assumes a and b are arrays with a >= b
  14074. var a_l = a.length,
  14075. b_l = b.length,
  14076. r = new Array(a_l),
  14077. borrow = 0,
  14078. base = BASE,
  14079. i, difference;
  14080. for (i = 0; i < b_l; i++) {
  14081. difference = a[i] - borrow - b[i];
  14082. if (difference < 0) {
  14083. difference += base;
  14084. borrow = 1;
  14085. } else borrow = 0;
  14086. r[i] = difference;
  14087. }
  14088. for (i = b_l; i < a_l; i++) {
  14089. difference = a[i] - borrow;
  14090. if (difference < 0) difference += base;
  14091. else {
  14092. r[i++] = difference;
  14093. break;
  14094. }
  14095. r[i] = difference;
  14096. }
  14097. for (; i < a_l; i++) {
  14098. r[i] = a[i];
  14099. }
  14100. trim(r);
  14101. return r;
  14102. }
  14103. function subtractAny(a, b, sign) {
  14104. var value, isSmall;
  14105. if (compareAbs(a, b) >= 0) {
  14106. value = subtract(a,b);
  14107. } else {
  14108. value = subtract(b, a);
  14109. sign = !sign;
  14110. }
  14111. value = arrayToSmall(value);
  14112. if (typeof value === "number") {
  14113. if (sign) value = -value;
  14114. return new SmallInteger(value);
  14115. }
  14116. return new BigInteger(value, sign);
  14117. }
  14118. function subtractSmall(a, b, sign) { // assumes a is array, b is number with 0 <= b < MAX_INT
  14119. var l = a.length,
  14120. r = new Array(l),
  14121. carry = -b,
  14122. base = BASE,
  14123. i, difference;
  14124. for (i = 0; i < l; i++) {
  14125. difference = a[i] + carry;
  14126. carry = Math.floor(difference / base);
  14127. difference %= base;
  14128. r[i] = difference < 0 ? difference + base : difference;
  14129. }
  14130. r = arrayToSmall(r);
  14131. if (typeof r === "number") {
  14132. if (sign) r = -r;
  14133. return new SmallInteger(r);
  14134. } return new BigInteger(r, sign);
  14135. }
  14136. BigInteger.prototype.subtract = function (v) {
  14137. var n = parseValue(v);
  14138. if (this.sign !== n.sign) {
  14139. return this.add(n.negate());
  14140. }
  14141. var a = this.value, b = n.value;
  14142. if (n.isSmall)
  14143. return subtractSmall(a, Math.abs(b), this.sign);
  14144. return subtractAny(a, b, this.sign);
  14145. };
  14146. BigInteger.prototype.minus = BigInteger.prototype.subtract;
  14147. SmallInteger.prototype.subtract = function (v) {
  14148. var n = parseValue(v);
  14149. var a = this.value;
  14150. if (a < 0 !== n.sign) {
  14151. return this.add(n.negate());
  14152. }
  14153. var b = n.value;
  14154. if (n.isSmall) {
  14155. return new SmallInteger(a - b);
  14156. }
  14157. return subtractSmall(b, Math.abs(a), a >= 0);
  14158. };
  14159. SmallInteger.prototype.minus = SmallInteger.prototype.subtract;
  14160. BigInteger.prototype.negate = function () {
  14161. return new BigInteger(this.value, !this.sign);
  14162. };
  14163. SmallInteger.prototype.negate = function () {
  14164. var sign = this.sign;
  14165. var small = new SmallInteger(-this.value);
  14166. small.sign = !sign;
  14167. return small;
  14168. };
  14169. BigInteger.prototype.abs = function () {
  14170. return new BigInteger(this.value, false);
  14171. };
  14172. SmallInteger.prototype.abs = function () {
  14173. return new SmallInteger(Math.abs(this.value));
  14174. };
  14175. function multiplyLong(a, b) {
  14176. var a_l = a.length,
  14177. b_l = b.length,
  14178. l = a_l + b_l,
  14179. r = createArray(l),
  14180. base = BASE,
  14181. product, carry, i, a_i, b_j;
  14182. for (i = 0; i < a_l; ++i) {
  14183. a_i = a[i];
  14184. for (var j = 0; j < b_l; ++j) {
  14185. b_j = b[j];
  14186. product = a_i * b_j + r[i + j];
  14187. carry = Math.floor(product / base);
  14188. r[i + j] = product - carry * base;
  14189. r[i + j + 1] += carry;
  14190. }
  14191. }
  14192. trim(r);
  14193. return r;
  14194. }
  14195. function multiplySmall(a, b) { // assumes a is array, b is number with |b| < BASE
  14196. var l = a.length,
  14197. r = new Array(l),
  14198. base = BASE,
  14199. carry = 0,
  14200. product, i;
  14201. for (i = 0; i < l; i++) {
  14202. product = a[i] * b + carry;
  14203. carry = Math.floor(product / base);
  14204. r[i] = product - carry * base;
  14205. }
  14206. while (carry > 0) {
  14207. r[i++] = carry % base;
  14208. carry = Math.floor(carry / base);
  14209. }
  14210. return r;
  14211. }
  14212. function shiftLeft(x, n) {
  14213. var r = [];
  14214. while (n-- > 0) r.push(0);
  14215. return r.concat(x);
  14216. }
  14217. function multiplyKaratsuba(x, y) {
  14218. var n = Math.max(x.length, y.length);
  14219. if (n <= 30) return multiplyLong(x, y);
  14220. n = Math.ceil(n / 2);
  14221. var b = x.slice(n),
  14222. a = x.slice(0, n),
  14223. d = y.slice(n),
  14224. c = y.slice(0, n);
  14225. var ac = multiplyKaratsuba(a, c),
  14226. bd = multiplyKaratsuba(b, d),
  14227. abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d));
  14228. var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n));
  14229. trim(product);
  14230. return product;
  14231. }
  14232. // The following function is derived from a surface fit of a graph plotting the performance difference
  14233. // between long multiplication and karatsuba multiplication versus the lengths of the two arrays.
  14234. function useKaratsuba(l1, l2) {
  14235. return -0.012 * l1 - 0.012 * l2 + 0.000015 * l1 * l2 > 0;
  14236. }
  14237. BigInteger.prototype.multiply = function (v) {
  14238. var value, n = parseValue(v),
  14239. a = this.value, b = n.value,
  14240. sign = this.sign !== n.sign,
  14241. abs;
  14242. if (n.isSmall) {
  14243. if (b === 0) return Integer[0];
  14244. if (b === 1) return this;
  14245. if (b === -1) return this.negate();
  14246. abs = Math.abs(b);
  14247. if (abs < BASE) {
  14248. return new BigInteger(multiplySmall(a, abs), sign);
  14249. }
  14250. b = smallToArray(abs);
  14251. }
  14252. if (useKaratsuba(a.length, b.length)) // Karatsuba is only faster for certain array sizes
  14253. return new BigInteger(multiplyKaratsuba(a, b), sign);
  14254. return new BigInteger(multiplyLong(a, b), sign);
  14255. };
  14256. BigInteger.prototype.times = BigInteger.prototype.multiply;
  14257. function multiplySmallAndArray(a, b, sign) { // a >= 0
  14258. if (a < BASE) {
  14259. return new BigInteger(multiplySmall(b, a), sign);
  14260. }
  14261. return new BigInteger(multiplyLong(b, smallToArray(a)), sign);
  14262. }
  14263. SmallInteger.prototype._multiplyBySmall = function (a) {
  14264. if (isPrecise(a.value * this.value)) {
  14265. return new SmallInteger(a.value * this.value);
  14266. }
  14267. return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign);
  14268. };
  14269. BigInteger.prototype._multiplyBySmall = function (a) {
  14270. if (a.value === 0) return Integer[0];
  14271. if (a.value === 1) return this;
  14272. if (a.value === -1) return this.negate();
  14273. return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign);
  14274. };
  14275. SmallInteger.prototype.multiply = function (v) {
  14276. return parseValue(v)._multiplyBySmall(this);
  14277. };
  14278. SmallInteger.prototype.times = SmallInteger.prototype.multiply;
  14279. function square(a) {
  14280. var l = a.length,
  14281. r = createArray(l + l),
  14282. base = BASE,
  14283. product, carry, i, a_i, a_j;
  14284. for (i = 0; i < l; i++) {
  14285. a_i = a[i];
  14286. for (var j = 0; j < l; j++) {
  14287. a_j = a[j];
  14288. product = a_i * a_j + r[i + j];
  14289. carry = Math.floor(product / base);
  14290. r[i + j] = product - carry * base;
  14291. r[i + j + 1] += carry;
  14292. }
  14293. }
  14294. trim(r);
  14295. return r;
  14296. }
  14297. BigInteger.prototype.square = function () {
  14298. return new BigInteger(square(this.value), false);
  14299. };
  14300. SmallInteger.prototype.square = function () {
  14301. var value = this.value * this.value;
  14302. if (isPrecise(value)) return new SmallInteger(value);
  14303. return new BigInteger(square(smallToArray(Math.abs(this.value))), false);
  14304. };
  14305. function divMod1(a, b) { // Left over from previous version. Performs faster than divMod2 on smaller input sizes.
  14306. var a_l = a.length,
  14307. b_l = b.length,
  14308. base = BASE,
  14309. result = createArray(b.length),
  14310. divisorMostSignificantDigit = b[b_l - 1],
  14311. // normalization
  14312. lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)),
  14313. remainder = multiplySmall(a, lambda),
  14314. divisor = multiplySmall(b, lambda),
  14315. quotientDigit, shift, carry, borrow, i, l, q;
  14316. if (remainder.length <= a_l) remainder.push(0);
  14317. divisor.push(0);
  14318. divisorMostSignificantDigit = divisor[b_l - 1];
  14319. for (shift = a_l - b_l; shift >= 0; shift--) {
  14320. quotientDigit = base - 1;
  14321. if (remainder[shift + b_l] !== divisorMostSignificantDigit) {
  14322. quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit);
  14323. }
  14324. // quotientDigit <= base - 1
  14325. carry = 0;
  14326. borrow = 0;
  14327. l = divisor.length;
  14328. for (i = 0; i < l; i++) {
  14329. carry += quotientDigit * divisor[i];
  14330. q = Math.floor(carry / base);
  14331. borrow += remainder[shift + i] - (carry - q * base);
  14332. carry = q;
  14333. if (borrow < 0) {
  14334. remainder[shift + i] = borrow + base;
  14335. borrow = -1;
  14336. } else {
  14337. remainder[shift + i] = borrow;
  14338. borrow = 0;
  14339. }
  14340. }
  14341. while (borrow !== 0) {
  14342. quotientDigit -= 1;
  14343. carry = 0;
  14344. for (i = 0; i < l; i++) {
  14345. carry += remainder[shift + i] - base + divisor[i];
  14346. if (carry < 0) {
  14347. remainder[shift + i] = carry + base;
  14348. carry = 0;
  14349. } else {
  14350. remainder[shift + i] = carry;
  14351. carry = 1;
  14352. }
  14353. }
  14354. borrow += carry;
  14355. }
  14356. result[shift] = quotientDigit;
  14357. }
  14358. // denormalization
  14359. remainder = divModSmall(remainder, lambda)[0];
  14360. return [arrayToSmall(result), arrayToSmall(remainder)];
  14361. }
  14362. function divMod2(a, b) { // Implementation idea shamelessly stolen from Silent Matt's library http://silentmatt.com/biginteger/
  14363. // Performs faster than divMod1 on larger input sizes.
  14364. var a_l = a.length,
  14365. b_l = b.length,
  14366. result = [],
  14367. part = [],
  14368. base = BASE,
  14369. guess, xlen, highx, highy, check;
  14370. while (a_l) {
  14371. part.unshift(a[--a_l]);
  14372. if (compareAbs(part, b) < 0) {
  14373. result.push(0);
  14374. continue;
  14375. }
  14376. xlen = part.length;
  14377. highx = part[xlen - 1] * base + part[xlen - 2];
  14378. highy = b[b_l - 1] * base + b[b_l - 2];
  14379. if (xlen > b_l) {
  14380. highx = (highx + 1) * base;
  14381. }
  14382. guess = Math.ceil(highx / highy);
  14383. do {
  14384. check = multiplySmall(b, guess);
  14385. if (compareAbs(check, part) <= 0) break;
  14386. guess--;
  14387. } while (guess);
  14388. result.push(guess);
  14389. part = subtract(part, check);
  14390. }
  14391. result.reverse();
  14392. return [arrayToSmall(result), arrayToSmall(part)];
  14393. }
  14394. function divModSmall(value, lambda) {
  14395. var length = value.length,
  14396. quotient = createArray(length),
  14397. base = BASE,
  14398. i, q, remainder, divisor;
  14399. remainder = 0;
  14400. for (i = length - 1; i >= 0; --i) {
  14401. divisor = remainder * base + value[i];
  14402. q = truncate(divisor / lambda);
  14403. remainder = divisor - q * lambda;
  14404. quotient[i] = q | 0;
  14405. }
  14406. return [quotient, remainder | 0];
  14407. }
  14408. function divModAny(self, v) {
  14409. var value, n = parseValue(v);
  14410. var a = self.value, b = n.value;
  14411. var quotient;
  14412. if (b === 0) throw new Error("Cannot divide by zero");
  14413. if (self.isSmall) {
  14414. if (n.isSmall) {
  14415. return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)];
  14416. }
  14417. return [Integer[0], self];
  14418. }
  14419. if (n.isSmall) {
  14420. if (b === 1) return [self, Integer[0]];
  14421. if (b == -1) return [self.negate(), Integer[0]];
  14422. var abs = Math.abs(b);
  14423. if (abs < BASE) {
  14424. value = divModSmall(a, abs);
  14425. quotient = arrayToSmall(value[0]);
  14426. var remainder = value[1];
  14427. if (self.sign) remainder = -remainder;
  14428. if (typeof quotient === "number") {
  14429. if (self.sign !== n.sign) quotient = -quotient;
  14430. return [new SmallInteger(quotient), new SmallInteger(remainder)];
  14431. }
  14432. return [new BigInteger(quotient, self.sign !== n.sign), new SmallInteger(remainder)];
  14433. }
  14434. b = smallToArray(abs);
  14435. }
  14436. var comparison = compareAbs(a, b);
  14437. if (comparison === -1) return [Integer[0], self];
  14438. if (comparison === 0) return [Integer[self.sign === n.sign ? 1 : -1], Integer[0]];
  14439. // divMod1 is faster on smaller input sizes
  14440. if (a.length + b.length <= 200)
  14441. value = divMod1(a, b);
  14442. else value = divMod2(a, b);
  14443. quotient = value[0];
  14444. var qSign = self.sign !== n.sign,
  14445. mod = value[1],
  14446. mSign = self.sign;
  14447. if (typeof quotient === "number") {
  14448. if (qSign) quotient = -quotient;
  14449. quotient = new SmallInteger(quotient);
  14450. } else quotient = new BigInteger(quotient, qSign);
  14451. if (typeof mod === "number") {
  14452. if (mSign) mod = -mod;
  14453. mod = new SmallInteger(mod);
  14454. } else mod = new BigInteger(mod, mSign);
  14455. return [quotient, mod];
  14456. }
  14457. BigInteger.prototype.divmod = function (v) {
  14458. var result = divModAny(this, v);
  14459. return {
  14460. quotient: result[0],
  14461. remainder: result[1]
  14462. };
  14463. };
  14464. SmallInteger.prototype.divmod = BigInteger.prototype.divmod;
  14465. BigInteger.prototype.divide = function (v) {
  14466. return divModAny(this, v)[0];
  14467. };
  14468. SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide;
  14469. BigInteger.prototype.mod = function (v) {
  14470. return divModAny(this, v)[1];
  14471. };
  14472. SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod;
  14473. BigInteger.prototype.pow = function (v) {
  14474. var n = parseValue(v),
  14475. a = this.value,
  14476. b = n.value,
  14477. value, x, y;
  14478. if (b === 0) return Integer[1];
  14479. if (a === 0) return Integer[0];
  14480. if (a === 1) return Integer[1];
  14481. if (a === -1) return n.isEven() ? Integer[1] : Integer[-1];
  14482. if (n.sign) {
  14483. return Integer[0];
  14484. }
  14485. if (!n.isSmall) throw new Error("The exponent " + n.toString() + " is too large.");
  14486. if (this.isSmall) {
  14487. if (isPrecise(value = Math.pow(a, b)))
  14488. return new SmallInteger(truncate(value));
  14489. }
  14490. x = this;
  14491. y = Integer[1];
  14492. while (true) {
  14493. if (b & 1 === 1) {
  14494. y = y.times(x);
  14495. --b;
  14496. }
  14497. if (b === 0) break;
  14498. b /= 2;
  14499. x = x.square();
  14500. }
  14501. return y;
  14502. };
  14503. SmallInteger.prototype.pow = BigInteger.prototype.pow;
  14504. BigInteger.prototype.modPow = function (exp, mod) {
  14505. exp = parseValue(exp);
  14506. mod = parseValue(mod);
  14507. if (mod.isZero()) throw new Error("Cannot take modPow with modulus 0");
  14508. var r = Integer[1],
  14509. base = this.mod(mod);
  14510. while (exp.isPositive()) {
  14511. if (base.isZero()) return Integer[0];
  14512. if (exp.isOdd()) r = r.multiply(base).mod(mod);
  14513. exp = exp.divide(2);
  14514. base = base.square().mod(mod);
  14515. }
  14516. return r;
  14517. };
  14518. SmallInteger.prototype.modPow = BigInteger.prototype.modPow;
  14519. function compareAbs(a, b) {
  14520. if (a.length !== b.length) {
  14521. return a.length > b.length ? 1 : -1;
  14522. }
  14523. for (var i = a.length - 1; i >= 0; i--) {
  14524. if (a[i] !== b[i]) return a[i] > b[i] ? 1 : -1;
  14525. }
  14526. return 0;
  14527. }
  14528. BigInteger.prototype.compareAbs = function (v) {
  14529. var n = parseValue(v),
  14530. a = this.value,
  14531. b = n.value;
  14532. if (n.isSmall) return 1;
  14533. return compareAbs(a, b);
  14534. };
  14535. SmallInteger.prototype.compareAbs = function (v) {
  14536. var n = parseValue(v),
  14537. a = Math.abs(this.value),
  14538. b = n.value;
  14539. if (n.isSmall) {
  14540. b = Math.abs(b);
  14541. return a === b ? 0 : a > b ? 1 : -1;
  14542. }
  14543. return -1;
  14544. };
  14545. BigInteger.prototype.compare = function (v) {
  14546. // See discussion about comparison with Infinity:
  14547. // https://github.com/peterolson/BigInteger.js/issues/61
  14548. if (v === Infinity) {
  14549. return -1;
  14550. }
  14551. if (v === -Infinity) {
  14552. return 1;
  14553. }
  14554. var n = parseValue(v),
  14555. a = this.value,
  14556. b = n.value;
  14557. if (this.sign !== n.sign) {
  14558. return n.sign ? 1 : -1;
  14559. }
  14560. if (n.isSmall) {
  14561. return this.sign ? -1 : 1;
  14562. }
  14563. return compareAbs(a, b) * (this.sign ? -1 : 1);
  14564. };
  14565. BigInteger.prototype.compareTo = BigInteger.prototype.compare;
  14566. SmallInteger.prototype.compare = function (v) {
  14567. if (v === Infinity) {
  14568. return -1;
  14569. }
  14570. if (v === -Infinity) {
  14571. return 1;
  14572. }
  14573. var n = parseValue(v),
  14574. a = this.value,
  14575. b = n.value;
  14576. if (n.isSmall) {
  14577. return a == b ? 0 : a > b ? 1 : -1;
  14578. }
  14579. if (a < 0 !== n.sign) {
  14580. return a < 0 ? -1 : 1;
  14581. }
  14582. return a < 0 ? 1 : -1;
  14583. };
  14584. SmallInteger.prototype.compareTo = SmallInteger.prototype.compare;
  14585. BigInteger.prototype.equals = function (v) {
  14586. return this.compare(v) === 0;
  14587. };
  14588. SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals;
  14589. BigInteger.prototype.notEquals = function (v) {
  14590. return this.compare(v) !== 0;
  14591. };
  14592. SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals;
  14593. BigInteger.prototype.greater = function (v) {
  14594. return this.compare(v) > 0;
  14595. };
  14596. SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater;
  14597. BigInteger.prototype.lesser = function (v) {
  14598. return this.compare(v) < 0;
  14599. };
  14600. SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser;
  14601. BigInteger.prototype.greaterOrEquals = function (v) {
  14602. return this.compare(v) >= 0;
  14603. };
  14604. SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals;
  14605. BigInteger.prototype.lesserOrEquals = function (v) {
  14606. return this.compare(v) <= 0;
  14607. };
  14608. SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals;
  14609. BigInteger.prototype.isEven = function () {
  14610. return (this.value[0] & 1) === 0;
  14611. };
  14612. SmallInteger.prototype.isEven = function () {
  14613. return (this.value & 1) === 0;
  14614. };
  14615. BigInteger.prototype.isOdd = function () {
  14616. return (this.value[0] & 1) === 1;
  14617. };
  14618. SmallInteger.prototype.isOdd = function () {
  14619. return (this.value & 1) === 1;
  14620. };
  14621. BigInteger.prototype.isPositive = function () {
  14622. return !this.sign;
  14623. };
  14624. SmallInteger.prototype.isPositive = function () {
  14625. return this.value > 0;
  14626. };
  14627. BigInteger.prototype.isNegative = function () {
  14628. return this.sign;
  14629. };
  14630. SmallInteger.prototype.isNegative = function () {
  14631. return this.value < 0;
  14632. };
  14633. BigInteger.prototype.isUnit = function () {
  14634. return false;
  14635. };
  14636. SmallInteger.prototype.isUnit = function () {
  14637. return Math.abs(this.value) === 1;
  14638. };
  14639. BigInteger.prototype.isZero = function () {
  14640. return false;
  14641. };
  14642. SmallInteger.prototype.isZero = function () {
  14643. return this.value === 0;
  14644. };
  14645. BigInteger.prototype.isDivisibleBy = function (v) {
  14646. var n = parseValue(v);
  14647. var value = n.value;
  14648. if (value === 0) return false;
  14649. if (value === 1) return true;
  14650. if (value === 2) return this.isEven();
  14651. return this.mod(n).equals(Integer[0]);
  14652. };
  14653. SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy;
  14654. function isBasicPrime(v) {
  14655. var n = v.abs();
  14656. if (n.isUnit()) return false;
  14657. if (n.equals(2) || n.equals(3) || n.equals(5)) return true;
  14658. if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) return false;
  14659. if (n.lesser(25)) return true;
  14660. // we don't know if it's prime: let the other functions figure it out
  14661. }
  14662. BigInteger.prototype.isPrime = function () {
  14663. var isPrime = isBasicPrime(this);
  14664. if (isPrime !== undefined) return isPrime;
  14665. var n = this.abs(),
  14666. nPrev = n.prev();
  14667. var a = [2, 3, 5, 7, 11, 13, 17, 19],
  14668. b = nPrev,
  14669. d, t, i, x;
  14670. while (b.isEven()) b = b.divide(2);
  14671. for (i = 0; i < a.length; i++) {
  14672. x = bigInt(a[i]).modPow(b, n);
  14673. if (x.equals(Integer[1]) || x.equals(nPrev)) continue;
  14674. for (t = true, d = b; t && d.lesser(nPrev) ; d = d.multiply(2)) {
  14675. x = x.square().mod(n);
  14676. if (x.equals(nPrev)) t = false;
  14677. }
  14678. if (t) return false;
  14679. }
  14680. return true;
  14681. };
  14682. SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime;
  14683. BigInteger.prototype.isProbablePrime = function (iterations) {
  14684. var isPrime = isBasicPrime(this);
  14685. if (isPrime !== undefined) return isPrime;
  14686. var n = this.abs();
  14687. var t = iterations === undefined ? 5 : iterations;
  14688. // use the Fermat primality test
  14689. for (var i = 0; i < t; i++) {
  14690. var a = bigInt.randBetween(2, n.minus(2));
  14691. if (!a.modPow(n.prev(), n).isUnit()) return false; // definitely composite
  14692. }
  14693. return true; // large chance of being prime
  14694. };
  14695. SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime;
  14696. BigInteger.prototype.modInv = function (n) {
  14697. var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR;
  14698. while (!newR.equals(bigInt.zero)) {
  14699. q = r.divide(newR);
  14700. lastT = t;
  14701. lastR = r;
  14702. t = newT;
  14703. r = newR;
  14704. newT = lastT.subtract(q.multiply(newT));
  14705. newR = lastR.subtract(q.multiply(newR));
  14706. }
  14707. if (!r.equals(1)) throw new Error(this.toString() + " and " + n.toString() + " are not co-prime");
  14708. if (t.compare(0) === -1) {
  14709. t = t.add(n);
  14710. }
  14711. return t;
  14712. }
  14713. SmallInteger.prototype.modInv = BigInteger.prototype.modInv;
  14714. BigInteger.prototype.next = function () {
  14715. var value = this.value;
  14716. if (this.sign) {
  14717. return subtractSmall(value, 1, this.sign);
  14718. }
  14719. return new BigInteger(addSmall(value, 1), this.sign);
  14720. };
  14721. SmallInteger.prototype.next = function () {
  14722. var value = this.value;
  14723. if (value + 1 < MAX_INT) return new SmallInteger(value + 1);
  14724. return new BigInteger(MAX_INT_ARR, false);
  14725. };
  14726. BigInteger.prototype.prev = function () {
  14727. var value = this.value;
  14728. if (this.sign) {
  14729. return new BigInteger(addSmall(value, 1), true);
  14730. }
  14731. return subtractSmall(value, 1, this.sign);
  14732. };
  14733. SmallInteger.prototype.prev = function () {
  14734. var value = this.value;
  14735. if (value - 1 > -MAX_INT) return new SmallInteger(value - 1);
  14736. return new BigInteger(MAX_INT_ARR, true);
  14737. };
  14738. var powersOfTwo = [1];
  14739. while (powersOfTwo[powersOfTwo.length - 1] <= BASE) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]);
  14740. var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1];
  14741. function shift_isSmall(n) {
  14742. return ((typeof n === "number" || typeof n === "string") && +Math.abs(n) <= BASE) ||
  14743. (n instanceof BigInteger && n.value.length <= 1);
  14744. }
  14745. BigInteger.prototype.shiftLeft = function (n) {
  14746. if (!shift_isSmall(n)) {
  14747. throw new Error(String(n) + " is too large for shifting.");
  14748. }
  14749. n = +n;
  14750. if (n < 0) return this.shiftRight(-n);
  14751. var result = this;
  14752. while (n >= powers2Length) {
  14753. result = result.multiply(highestPower2);
  14754. n -= powers2Length - 1;
  14755. }
  14756. return result.multiply(powersOfTwo[n]);
  14757. };
  14758. SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft;
  14759. BigInteger.prototype.shiftRight = function (n) {
  14760. var remQuo;
  14761. if (!shift_isSmall(n)) {
  14762. throw new Error(String(n) + " is too large for shifting.");
  14763. }
  14764. n = +n;
  14765. if (n < 0) return this.shiftLeft(-n);
  14766. var result = this;
  14767. while (n >= powers2Length) {
  14768. if (result.isZero()) return result;
  14769. remQuo = divModAny(result, highestPower2);
  14770. result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
  14771. n -= powers2Length - 1;
  14772. }
  14773. remQuo = divModAny(result, powersOfTwo[n]);
  14774. return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
  14775. };
  14776. SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight;
  14777. function bitwise(x, y, fn) {
  14778. y = parseValue(y);
  14779. var xSign = x.isNegative(), ySign = y.isNegative();
  14780. var xRem = xSign ? x.not() : x,
  14781. yRem = ySign ? y.not() : y;
  14782. var xBits = [], yBits = [];
  14783. var xStop = false, yStop = false;
  14784. while (!xStop || !yStop) {
  14785. if (xRem.isZero()) { // virtual sign extension for simulating two's complement
  14786. xStop = true;
  14787. xBits.push(xSign ? 1 : 0);
  14788. }
  14789. else if (xSign) xBits.push(xRem.isEven() ? 1 : 0); // two's complement for negative numbers
  14790. else xBits.push(xRem.isEven() ? 0 : 1);
  14791. if (yRem.isZero()) {
  14792. yStop = true;
  14793. yBits.push(ySign ? 1 : 0);
  14794. }
  14795. else if (ySign) yBits.push(yRem.isEven() ? 1 : 0);
  14796. else yBits.push(yRem.isEven() ? 0 : 1);
  14797. xRem = xRem.over(2);
  14798. yRem = yRem.over(2);
  14799. }
  14800. var result = [];
  14801. for (var i = 0; i < xBits.length; i++) result.push(fn(xBits[i], yBits[i]));
  14802. var sum = bigInt(result.pop()).negate().times(bigInt(2).pow(result.length));
  14803. while (result.length) {
  14804. sum = sum.add(bigInt(result.pop()).times(bigInt(2).pow(result.length)));
  14805. }
  14806. return sum;
  14807. }
  14808. BigInteger.prototype.not = function () {
  14809. return this.negate().prev();
  14810. };
  14811. SmallInteger.prototype.not = BigInteger.prototype.not;
  14812. BigInteger.prototype.and = function (n) {
  14813. return bitwise(this, n, function (a, b) { return a & b; });
  14814. };
  14815. SmallInteger.prototype.and = BigInteger.prototype.and;
  14816. BigInteger.prototype.or = function (n) {
  14817. return bitwise(this, n, function (a, b) { return a | b; });
  14818. };
  14819. SmallInteger.prototype.or = BigInteger.prototype.or;
  14820. BigInteger.prototype.xor = function (n) {
  14821. return bitwise(this, n, function (a, b) { return a ^ b; });
  14822. };
  14823. SmallInteger.prototype.xor = BigInteger.prototype.xor;
  14824. var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I;
  14825. function roughLOB(n) { // get lowestOneBit (rough)
  14826. // SmallInteger: return Min(lowestOneBit(n), 1 << 30)
  14827. // BigInteger: return Min(lowestOneBit(n), 1 << 14) [BASE=1e7]
  14828. var v = n.value, x = typeof v === "number" ? v | LOBMASK_I : v[0] + v[1] * BASE | LOBMASK_BI;
  14829. return x & -x;
  14830. }
  14831. function max(a, b) {
  14832. a = parseValue(a);
  14833. b = parseValue(b);
  14834. return a.greater(b) ? a : b;
  14835. }
  14836. function min(a,b) {
  14837. a = parseValue(a);
  14838. b = parseValue(b);
  14839. return a.lesser(b) ? a : b;
  14840. }
  14841. function gcd(a, b) {
  14842. a = parseValue(a).abs();
  14843. b = parseValue(b).abs();
  14844. if (a.equals(b)) return a;
  14845. if (a.isZero()) return b;
  14846. if (b.isZero()) return a;
  14847. var c = Integer[1], d, t;
  14848. while (a.isEven() && b.isEven()) {
  14849. d = Math.min(roughLOB(a), roughLOB(b));
  14850. a = a.divide(d);
  14851. b = b.divide(d);
  14852. c = c.multiply(d);
  14853. }
  14854. while (a.isEven()) {
  14855. a = a.divide(roughLOB(a));
  14856. }
  14857. do {
  14858. while (b.isEven()) {
  14859. b = b.divide(roughLOB(b));
  14860. }
  14861. if (a.greater(b)) {
  14862. t = b; b = a; a = t;
  14863. }
  14864. b = b.subtract(a);
  14865. } while (!b.isZero());
  14866. return c.isUnit() ? a : a.multiply(c);
  14867. }
  14868. function lcm(a, b) {
  14869. a = parseValue(a).abs();
  14870. b = parseValue(b).abs();
  14871. return a.divide(gcd(a, b)).multiply(b);
  14872. }
  14873. function randBetween(a, b) {
  14874. a = parseValue(a);
  14875. b = parseValue(b);
  14876. var low = min(a, b), high = max(a, b);
  14877. var range = high.subtract(low);
  14878. if (range.isSmall) return low.add(Math.round(Math.random() * range));
  14879. var length = range.value.length - 1;
  14880. var result = [], restricted = true;
  14881. for (var i = length; i >= 0; i--) {
  14882. var top = restricted ? range.value[i] : BASE;
  14883. var digit = truncate(Math.random() * top);
  14884. result.unshift(digit);
  14885. if (digit < top) restricted = false;
  14886. }
  14887. result = arrayToSmall(result);
  14888. return low.add(typeof result === "number" ? new SmallInteger(result) : new BigInteger(result, false));
  14889. }
  14890. var parseBase = function (text, base) {
  14891. var val = Integer[0], pow = Integer[1],
  14892. length = text.length;
  14893. if (2 <= base && base <= 36) {
  14894. if (length <= LOG_MAX_INT / Math.log(base)) {
  14895. return new SmallInteger(parseInt(text, base));
  14896. }
  14897. }
  14898. base = parseValue(base);
  14899. var digits = [];
  14900. var i;
  14901. var isNegative = text[0] === "-";
  14902. for (i = isNegative ? 1 : 0; i < text.length; i++) {
  14903. var c = text[i].toLowerCase(),
  14904. charCode = c.charCodeAt(0);
  14905. if (48 <= charCode && charCode <= 57) digits.push(parseValue(c));
  14906. else if (97 <= charCode && charCode <= 122) digits.push(parseValue(c.charCodeAt(0) - 87));
  14907. else if (c === "<") {
  14908. var start = i;
  14909. do { i++; } while (text[i] !== ">");
  14910. digits.push(parseValue(text.slice(start + 1, i)));
  14911. }
  14912. else throw new Error(c + " is not a valid character");
  14913. }
  14914. digits.reverse();
  14915. for (i = 0; i < digits.length; i++) {
  14916. val = val.add(digits[i].times(pow));
  14917. pow = pow.times(base);
  14918. }
  14919. return isNegative ? val.negate() : val;
  14920. };
  14921. function stringify(digit) {
  14922. var v = digit.value;
  14923. if (typeof v === "number") v = [v];
  14924. if (v.length === 1 && v[0] <= 35) {
  14925. return "0123456789abcdefghijklmnopqrstuvwxyz".charAt(v[0]);
  14926. }
  14927. return "<" + v + ">";
  14928. }
  14929. function toBase(n, base) {
  14930. base = bigInt(base);
  14931. if (base.isZero()) {
  14932. if (n.isZero()) return "0";
  14933. throw new Error("Cannot convert nonzero numbers to base 0.");
  14934. }
  14935. if (base.equals(-1)) {
  14936. if (n.isZero()) return "0";
  14937. if (n.isNegative()) return new Array(1 - n).join("10");
  14938. return "1" + new Array(+n).join("01");
  14939. }
  14940. var minusSign = "";
  14941. if (n.isNegative() && base.isPositive()) {
  14942. minusSign = "-";
  14943. n = n.abs();
  14944. }
  14945. if (base.equals(1)) {
  14946. if (n.isZero()) return "0";
  14947. return minusSign + new Array(+n + 1).join(1);
  14948. }
  14949. var out = [];
  14950. var left = n, divmod;
  14951. while (left.isNegative() || left.compareAbs(base) >= 0) {
  14952. divmod = left.divmod(base);
  14953. left = divmod.quotient;
  14954. var digit = divmod.remainder;
  14955. if (digit.isNegative()) {
  14956. digit = base.minus(digit).abs();
  14957. left = left.next();
  14958. }
  14959. out.push(stringify(digit));
  14960. }
  14961. out.push(stringify(left));
  14962. return minusSign + out.reverse().join("");
  14963. }
  14964. BigInteger.prototype.toString = function (radix) {
  14965. if (radix === undefined) radix = 10;
  14966. if (radix !== 10) return toBase(this, radix);
  14967. var v = this.value, l = v.length, str = String(v[--l]), zeros = "0000000", digit;
  14968. while (--l >= 0) {
  14969. digit = String(v[l]);
  14970. str += zeros.slice(digit.length) + digit;
  14971. }
  14972. var sign = this.sign ? "-" : "";
  14973. return sign + str;
  14974. };
  14975. SmallInteger.prototype.toString = function (radix) {
  14976. if (radix === undefined) radix = 10;
  14977. if (radix != 10) return toBase(this, radix);
  14978. return String(this.value);
  14979. };
  14980. BigInteger.prototype.valueOf = function () {
  14981. return +this.toString();
  14982. };
  14983. BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf;
  14984. SmallInteger.prototype.valueOf = function () {
  14985. return this.value;
  14986. };
  14987. SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf;
  14988. function parseStringValue(v) {
  14989. if (isPrecise(+v)) {
  14990. var x = +v;
  14991. if (x === truncate(x))
  14992. return new SmallInteger(x);
  14993. throw "Invalid integer: " + v;
  14994. }
  14995. var sign = v[0] === "-";
  14996. if (sign) v = v.slice(1);
  14997. var split = v.split(/e/i);
  14998. if (split.length > 2) throw new Error("Invalid integer: " + split.join("e"));
  14999. if (split.length === 2) {
  15000. var exp = split[1];
  15001. if (exp[0] === "+") exp = exp.slice(1);
  15002. exp = +exp;
  15003. if (exp !== truncate(exp) || !isPrecise(exp)) throw new Error("Invalid integer: " + exp + " is not a valid exponent.");
  15004. var text = split[0];
  15005. var decimalPlace = text.indexOf(".");
  15006. if (decimalPlace >= 0) {
  15007. exp -= text.length - decimalPlace - 1;
  15008. text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1);
  15009. }
  15010. if (exp < 0) throw new Error("Cannot include negative exponent part for integers");
  15011. text += (new Array(exp + 1)).join("0");
  15012. v = text;
  15013. }
  15014. var isValid = /^([0-9][0-9]*)$/.test(v);
  15015. if (!isValid) throw new Error("Invalid integer: " + v);
  15016. var r = [], max = v.length, l = LOG_BASE, min = max - l;
  15017. while (max > 0) {
  15018. r.push(+v.slice(min, max));
  15019. min -= l;
  15020. if (min < 0) min = 0;
  15021. max -= l;
  15022. }
  15023. trim(r);
  15024. return new BigInteger(r, sign);
  15025. }
  15026. function parseNumberValue(v) {
  15027. if (isPrecise(v)) {
  15028. if (v !== truncate(v)) throw new Error(v + " is not an integer.");
  15029. return new SmallInteger(v);
  15030. }
  15031. return parseStringValue(v.toString());
  15032. }
  15033. function parseValue(v) {
  15034. if (typeof v === "number") {
  15035. return parseNumberValue(v);
  15036. }
  15037. if (typeof v === "string") {
  15038. return parseStringValue(v);
  15039. }
  15040. return v;
  15041. }
  15042. // Pre-define numbers in range [-999,999]
  15043. for (var i = 0; i < 1000; i++) {
  15044. Integer[i] = new SmallInteger(i);
  15045. if (i > 0) Integer[-i] = new SmallInteger(-i);
  15046. }
  15047. // Backwards compatibility
  15048. Integer.one = Integer[1];
  15049. Integer.zero = Integer[0];
  15050. Integer.minusOne = Integer[-1];
  15051. Integer.max = max;
  15052. Integer.min = min;
  15053. Integer.gcd = gcd;
  15054. Integer.lcm = lcm;
  15055. Integer.isInstance = function (x) { return x instanceof BigInteger || x instanceof SmallInteger; };
  15056. Integer.randBetween = randBetween;
  15057. return Integer;
  15058. })();
  15059. // Node.js check
  15060. if (typeof module !== "undefined" && module.hasOwnProperty("exports")) {
  15061. module.exports = bigInt;
  15062. }
  15063. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(223)(module)))
  15064. /***/ },
  15065. /* 119 */
  15066. /***/ function(module, exports, __webpack_require__) {
  15067. /* WEBPACK VAR INJECTION */(function(Buffer) {var Transform = __webpack_require__(20).Transform
  15068. var inherits = __webpack_require__(1)
  15069. var StringDecoder = __webpack_require__(48).StringDecoder
  15070. module.exports = CipherBase
  15071. inherits(CipherBase, Transform)
  15072. function CipherBase (hashMode) {
  15073. Transform.call(this)
  15074. this.hashMode = typeof hashMode === 'string'
  15075. if (this.hashMode) {
  15076. this[hashMode] = this._finalOrDigest
  15077. } else {
  15078. this.final = this._finalOrDigest
  15079. }
  15080. this._decoder = null
  15081. this._encoding = null
  15082. }
  15083. CipherBase.prototype.update = function (data, inputEnc, outputEnc) {
  15084. if (typeof data === 'string') {
  15085. data = new Buffer(data, inputEnc)
  15086. }
  15087. var outData = this._update(data)
  15088. if (this.hashMode) {
  15089. return this
  15090. }
  15091. if (outputEnc) {
  15092. outData = this._toString(outData, outputEnc)
  15093. }
  15094. return outData
  15095. }
  15096. CipherBase.prototype.setAutoPadding = function () {}
  15097. CipherBase.prototype.getAuthTag = function () {
  15098. throw new Error('trying to get auth tag in unsupported state')
  15099. }
  15100. CipherBase.prototype.setAuthTag = function () {
  15101. throw new Error('trying to set auth tag in unsupported state')
  15102. }
  15103. CipherBase.prototype.setAAD = function () {
  15104. throw new Error('trying to set aad in unsupported state')
  15105. }
  15106. CipherBase.prototype._transform = function (data, _, next) {
  15107. var err
  15108. try {
  15109. if (this.hashMode) {
  15110. this._update(data)
  15111. } else {
  15112. this.push(this._update(data))
  15113. }
  15114. } catch (e) {
  15115. err = e
  15116. } finally {
  15117. next(err)
  15118. }
  15119. }
  15120. CipherBase.prototype._flush = function (done) {
  15121. var err
  15122. try {
  15123. this.push(this._final())
  15124. } catch (e) {
  15125. err = e
  15126. } finally {
  15127. done(err)
  15128. }
  15129. }
  15130. CipherBase.prototype._finalOrDigest = function (outputEnc) {
  15131. var outData = this._final() || new Buffer('')
  15132. if (outputEnc) {
  15133. outData = this._toString(outData, outputEnc, true)
  15134. }
  15135. return outData
  15136. }
  15137. CipherBase.prototype._toString = function (value, enc, fin) {
  15138. if (!this._decoder) {
  15139. this._decoder = new StringDecoder(enc)
  15140. this._encoding = enc
  15141. }
  15142. if (this._encoding !== enc) {
  15143. throw new Error('can\'t switch encodings')
  15144. }
  15145. var out = this._decoder.write(value)
  15146. if (fin) {
  15147. out += this._decoder.end()
  15148. }
  15149. return out
  15150. }
  15151. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  15152. /***/ },
  15153. /* 120 */
  15154. /***/ function(module, exports, __webpack_require__) {
  15155. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  15156. if (true) {
  15157. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, __webpack_require__(190)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  15158. } else if (typeof exports !== "undefined") {
  15159. factory(module, require('select'));
  15160. } else {
  15161. var mod = {
  15162. exports: {}
  15163. };
  15164. factory(mod, global.select);
  15165. global.clipboardAction = mod.exports;
  15166. }
  15167. })(this, function (module, _select) {
  15168. 'use strict';
  15169. var _select2 = _interopRequireDefault(_select);
  15170. function _interopRequireDefault(obj) {
  15171. return obj && obj.__esModule ? obj : {
  15172. default: obj
  15173. };
  15174. }
  15175. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
  15176. return typeof obj;
  15177. } : function (obj) {
  15178. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  15179. };
  15180. function _classCallCheck(instance, Constructor) {
  15181. if (!(instance instanceof Constructor)) {
  15182. throw new TypeError("Cannot call a class as a function");
  15183. }
  15184. }
  15185. var _createClass = function () {
  15186. function defineProperties(target, props) {
  15187. for (var i = 0; i < props.length; i++) {
  15188. var descriptor = props[i];
  15189. descriptor.enumerable = descriptor.enumerable || false;
  15190. descriptor.configurable = true;
  15191. if ("value" in descriptor) descriptor.writable = true;
  15192. Object.defineProperty(target, descriptor.key, descriptor);
  15193. }
  15194. }
  15195. return function (Constructor, protoProps, staticProps) {
  15196. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  15197. if (staticProps) defineProperties(Constructor, staticProps);
  15198. return Constructor;
  15199. };
  15200. }();
  15201. var ClipboardAction = function () {
  15202. /**
  15203. * @param {Object} options
  15204. */
  15205. function ClipboardAction(options) {
  15206. _classCallCheck(this, ClipboardAction);
  15207. this.resolveOptions(options);
  15208. this.initSelection();
  15209. }
  15210. /**
  15211. * Defines base properties passed from constructor.
  15212. * @param {Object} options
  15213. */
  15214. _createClass(ClipboardAction, [{
  15215. key: 'resolveOptions',
  15216. value: function resolveOptions() {
  15217. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  15218. this.action = options.action;
  15219. this.emitter = options.emitter;
  15220. this.target = options.target;
  15221. this.text = options.text;
  15222. this.trigger = options.trigger;
  15223. this.selectedText = '';
  15224. }
  15225. }, {
  15226. key: 'initSelection',
  15227. value: function initSelection() {
  15228. if (this.text) {
  15229. this.selectFake();
  15230. } else if (this.target) {
  15231. this.selectTarget();
  15232. }
  15233. }
  15234. }, {
  15235. key: 'selectFake',
  15236. value: function selectFake() {
  15237. var _this = this;
  15238. var isRTL = document.documentElement.getAttribute('dir') == 'rtl';
  15239. this.removeFake();
  15240. this.fakeHandlerCallback = function () {
  15241. return _this.removeFake();
  15242. };
  15243. this.fakeHandler = document.body.addEventListener('click', this.fakeHandlerCallback) || true;
  15244. this.fakeElem = document.createElement('textarea');
  15245. // Prevent zooming on iOS
  15246. this.fakeElem.style.fontSize = '12pt';
  15247. // Reset box model
  15248. this.fakeElem.style.border = '0';
  15249. this.fakeElem.style.padding = '0';
  15250. this.fakeElem.style.margin = '0';
  15251. // Move element out of screen horizontally
  15252. this.fakeElem.style.position = 'absolute';
  15253. this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';
  15254. // Move element to the same position vertically
  15255. var yPosition = window.pageYOffset || document.documentElement.scrollTop;
  15256. this.fakeElem.addEventListener('focus', window.scrollTo(0, yPosition));
  15257. this.fakeElem.style.top = yPosition + 'px';
  15258. this.fakeElem.setAttribute('readonly', '');
  15259. this.fakeElem.value = this.text;
  15260. document.body.appendChild(this.fakeElem);
  15261. this.selectedText = (0, _select2.default)(this.fakeElem);
  15262. this.copyText();
  15263. }
  15264. }, {
  15265. key: 'removeFake',
  15266. value: function removeFake() {
  15267. if (this.fakeHandler) {
  15268. document.body.removeEventListener('click', this.fakeHandlerCallback);
  15269. this.fakeHandler = null;
  15270. this.fakeHandlerCallback = null;
  15271. }
  15272. if (this.fakeElem) {
  15273. document.body.removeChild(this.fakeElem);
  15274. this.fakeElem = null;
  15275. }
  15276. }
  15277. }, {
  15278. key: 'selectTarget',
  15279. value: function selectTarget() {
  15280. this.selectedText = (0, _select2.default)(this.target);
  15281. this.copyText();
  15282. }
  15283. }, {
  15284. key: 'copyText',
  15285. value: function copyText() {
  15286. var succeeded = void 0;
  15287. try {
  15288. succeeded = document.execCommand(this.action);
  15289. } catch (err) {
  15290. succeeded = false;
  15291. }
  15292. this.handleResult(succeeded);
  15293. }
  15294. }, {
  15295. key: 'handleResult',
  15296. value: function handleResult(succeeded) {
  15297. this.emitter.emit(succeeded ? 'success' : 'error', {
  15298. action: this.action,
  15299. text: this.selectedText,
  15300. trigger: this.trigger,
  15301. clearSelection: this.clearSelection.bind(this)
  15302. });
  15303. }
  15304. }, {
  15305. key: 'clearSelection',
  15306. value: function clearSelection() {
  15307. if (this.target) {
  15308. this.target.blur();
  15309. }
  15310. window.getSelection().removeAllRanges();
  15311. }
  15312. }, {
  15313. key: 'destroy',
  15314. value: function destroy() {
  15315. this.removeFake();
  15316. }
  15317. }, {
  15318. key: 'action',
  15319. set: function set() {
  15320. var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy';
  15321. this._action = action;
  15322. if (this._action !== 'copy' && this._action !== 'cut') {
  15323. throw new Error('Invalid "action" value, use either "copy" or "cut"');
  15324. }
  15325. },
  15326. get: function get() {
  15327. return this._action;
  15328. }
  15329. }, {
  15330. key: 'target',
  15331. set: function set(target) {
  15332. if (target !== undefined) {
  15333. if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) {
  15334. if (this.action === 'copy' && target.hasAttribute('disabled')) {
  15335. throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
  15336. }
  15337. if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
  15338. throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
  15339. }
  15340. this._target = target;
  15341. } else {
  15342. throw new Error('Invalid "target" value, use a valid Element');
  15343. }
  15344. }
  15345. },
  15346. get: function get() {
  15347. return this._target;
  15348. }
  15349. }]);
  15350. return ClipboardAction;
  15351. }();
  15352. module.exports = ClipboardAction;
  15353. });
  15354. /***/ },
  15355. /* 121 */
  15356. /***/ function(module, exports, __webpack_require__) {
  15357. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  15358. if (true) {
  15359. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, __webpack_require__(120), __webpack_require__(196), __webpack_require__(171)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  15360. } else if (typeof exports !== "undefined") {
  15361. factory(module, require('./clipboard-action'), require('tiny-emitter'), require('good-listener'));
  15362. } else {
  15363. var mod = {
  15364. exports: {}
  15365. };
  15366. factory(mod, global.clipboardAction, global.tinyEmitter, global.goodListener);
  15367. global.clipboard = mod.exports;
  15368. }
  15369. })(this, function (module, _clipboardAction, _tinyEmitter, _goodListener) {
  15370. 'use strict';
  15371. var _clipboardAction2 = _interopRequireDefault(_clipboardAction);
  15372. var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter);
  15373. var _goodListener2 = _interopRequireDefault(_goodListener);
  15374. function _interopRequireDefault(obj) {
  15375. return obj && obj.__esModule ? obj : {
  15376. default: obj
  15377. };
  15378. }
  15379. function _classCallCheck(instance, Constructor) {
  15380. if (!(instance instanceof Constructor)) {
  15381. throw new TypeError("Cannot call a class as a function");
  15382. }
  15383. }
  15384. var _createClass = function () {
  15385. function defineProperties(target, props) {
  15386. for (var i = 0; i < props.length; i++) {
  15387. var descriptor = props[i];
  15388. descriptor.enumerable = descriptor.enumerable || false;
  15389. descriptor.configurable = true;
  15390. if ("value" in descriptor) descriptor.writable = true;
  15391. Object.defineProperty(target, descriptor.key, descriptor);
  15392. }
  15393. }
  15394. return function (Constructor, protoProps, staticProps) {
  15395. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  15396. if (staticProps) defineProperties(Constructor, staticProps);
  15397. return Constructor;
  15398. };
  15399. }();
  15400. function _possibleConstructorReturn(self, call) {
  15401. if (!self) {
  15402. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  15403. }
  15404. return call && (typeof call === "object" || typeof call === "function") ? call : self;
  15405. }
  15406. function _inherits(subClass, superClass) {
  15407. if (typeof superClass !== "function" && superClass !== null) {
  15408. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  15409. }
  15410. subClass.prototype = Object.create(superClass && superClass.prototype, {
  15411. constructor: {
  15412. value: subClass,
  15413. enumerable: false,
  15414. writable: true,
  15415. configurable: true
  15416. }
  15417. });
  15418. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  15419. }
  15420. var Clipboard = function (_Emitter) {
  15421. _inherits(Clipboard, _Emitter);
  15422. /**
  15423. * @param {String|HTMLElement|HTMLCollection|NodeList} trigger
  15424. * @param {Object} options
  15425. */
  15426. function Clipboard(trigger, options) {
  15427. _classCallCheck(this, Clipboard);
  15428. var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this));
  15429. _this.resolveOptions(options);
  15430. _this.listenClick(trigger);
  15431. return _this;
  15432. }
  15433. /**
  15434. * Defines if attributes would be resolved using internal setter functions
  15435. * or custom functions that were passed in the constructor.
  15436. * @param {Object} options
  15437. */
  15438. _createClass(Clipboard, [{
  15439. key: 'resolveOptions',
  15440. value: function resolveOptions() {
  15441. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  15442. this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
  15443. this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
  15444. this.text = typeof options.text === 'function' ? options.text : this.defaultText;
  15445. }
  15446. }, {
  15447. key: 'listenClick',
  15448. value: function listenClick(trigger) {
  15449. var _this2 = this;
  15450. this.listener = (0, _goodListener2.default)(trigger, 'click', function (e) {
  15451. return _this2.onClick(e);
  15452. });
  15453. }
  15454. }, {
  15455. key: 'onClick',
  15456. value: function onClick(e) {
  15457. var trigger = e.delegateTarget || e.currentTarget;
  15458. if (this.clipboardAction) {
  15459. this.clipboardAction = null;
  15460. }
  15461. this.clipboardAction = new _clipboardAction2.default({
  15462. action: this.action(trigger),
  15463. target: this.target(trigger),
  15464. text: this.text(trigger),
  15465. trigger: trigger,
  15466. emitter: this
  15467. });
  15468. }
  15469. }, {
  15470. key: 'defaultAction',
  15471. value: function defaultAction(trigger) {
  15472. return getAttributeValue('action', trigger);
  15473. }
  15474. }, {
  15475. key: 'defaultTarget',
  15476. value: function defaultTarget(trigger) {
  15477. var selector = getAttributeValue('target', trigger);
  15478. if (selector) {
  15479. return document.querySelector(selector);
  15480. }
  15481. }
  15482. }, {
  15483. key: 'defaultText',
  15484. value: function defaultText(trigger) {
  15485. return getAttributeValue('text', trigger);
  15486. }
  15487. }, {
  15488. key: 'destroy',
  15489. value: function destroy() {
  15490. this.listener.destroy();
  15491. if (this.clipboardAction) {
  15492. this.clipboardAction.destroy();
  15493. this.clipboardAction = null;
  15494. }
  15495. }
  15496. }]);
  15497. return Clipboard;
  15498. }(_tinyEmitter2.default);
  15499. /**
  15500. * Helper function to retrieve attribute value.
  15501. * @param {String} suffix
  15502. * @param {Element} element
  15503. */
  15504. function getAttributeValue(suffix, element) {
  15505. var attribute = 'data-clipboard-' + suffix;
  15506. if (!element.hasAttribute(attribute)) {
  15507. return;
  15508. }
  15509. return element.getAttribute(attribute);
  15510. }
  15511. module.exports = Clipboard;
  15512. });
  15513. /***/ },
  15514. /* 122 */
  15515. /***/ function(module, exports, __webpack_require__) {
  15516. var core = __webpack_require__(6)
  15517. , $JSON = core.JSON || (core.JSON = {stringify: JSON.stringify});
  15518. module.exports = function stringify(it){ // eslint-disable-line no-unused-vars
  15519. return $JSON.stringify.apply($JSON, arguments);
  15520. };
  15521. /***/ },
  15522. /* 123 */
  15523. /***/ function(module, exports, __webpack_require__) {
  15524. __webpack_require__(154);
  15525. module.exports = __webpack_require__(6).Object.assign;
  15526. /***/ },
  15527. /* 124 */
  15528. /***/ function(module, exports, __webpack_require__) {
  15529. __webpack_require__(155);
  15530. var $Object = __webpack_require__(6).Object;
  15531. module.exports = function defineProperty(it, key, desc){
  15532. return $Object.defineProperty(it, key, desc);
  15533. };
  15534. /***/ },
  15535. /* 125 */
  15536. /***/ function(module, exports, __webpack_require__) {
  15537. __webpack_require__(156);
  15538. __webpack_require__(158);
  15539. __webpack_require__(159);
  15540. __webpack_require__(157);
  15541. module.exports = __webpack_require__(6).Promise;
  15542. /***/ },
  15543. /* 126 */
  15544. /***/ function(module, exports) {
  15545. module.exports = function(){ /* empty */ };
  15546. /***/ },
  15547. /* 127 */
  15548. /***/ function(module, exports) {
  15549. module.exports = function(it, Constructor, name, forbiddenField){
  15550. if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){
  15551. throw TypeError(name + ': incorrect invocation!');
  15552. } return it;
  15553. };
  15554. /***/ },
  15555. /* 128 */
  15556. /***/ function(module, exports, __webpack_require__) {
  15557. // false -> Array#indexOf
  15558. // true -> Array#includes
  15559. var toIObject = __webpack_require__(42)
  15560. , toLength = __webpack_require__(69)
  15561. , toIndex = __webpack_require__(150);
  15562. module.exports = function(IS_INCLUDES){
  15563. return function($this, el, fromIndex){
  15564. var O = toIObject($this)
  15565. , length = toLength(O.length)
  15566. , index = toIndex(fromIndex, length)
  15567. , value;
  15568. // Array#includes uses SameValueZero equality algorithm
  15569. if(IS_INCLUDES && el != el)while(length > index){
  15570. value = O[index++];
  15571. if(value != value)return true;
  15572. // Array#toIndex ignores holes, Array#includes - not
  15573. } else for(;length > index; index++)if(IS_INCLUDES || index in O){
  15574. if(O[index] === el)return IS_INCLUDES || index || 0;
  15575. } return !IS_INCLUDES && -1;
  15576. };
  15577. };
  15578. /***/ },
  15579. /* 129 */
  15580. /***/ function(module, exports, __webpack_require__) {
  15581. var ctx = __webpack_require__(26)
  15582. , call = __webpack_require__(133)
  15583. , isArrayIter = __webpack_require__(132)
  15584. , anObject = __webpack_require__(9)
  15585. , toLength = __webpack_require__(69)
  15586. , getIterFn = __webpack_require__(152)
  15587. , BREAK = {}
  15588. , RETURN = {};
  15589. var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){
  15590. var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable)
  15591. , f = ctx(fn, that, entries ? 2 : 1)
  15592. , index = 0
  15593. , length, step, iterator, result;
  15594. if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!');
  15595. // fast case for arrays with default iterator
  15596. if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){
  15597. result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
  15598. if(result === BREAK || result === RETURN)return result;
  15599. } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){
  15600. result = call(iterator, f, step.value, entries);
  15601. if(result === BREAK || result === RETURN)return result;
  15602. }
  15603. };
  15604. exports.BREAK = BREAK;
  15605. exports.RETURN = RETURN;
  15606. /***/ },
  15607. /* 130 */
  15608. /***/ function(module, exports, __webpack_require__) {
  15609. module.exports = !__webpack_require__(10) && !__webpack_require__(38)(function(){
  15610. return Object.defineProperty(__webpack_require__(37)('div'), 'a', {get: function(){ return 7; }}).a != 7;
  15611. });
  15612. /***/ },
  15613. /* 131 */
  15614. /***/ function(module, exports) {
  15615. // fast apply, http://jsperf.lnkit.com/fast-apply/5
  15616. module.exports = function(fn, args, that){
  15617. var un = that === undefined;
  15618. switch(args.length){
  15619. case 0: return un ? fn()
  15620. : fn.call(that);
  15621. case 1: return un ? fn(args[0])
  15622. : fn.call(that, args[0]);
  15623. case 2: return un ? fn(args[0], args[1])
  15624. : fn.call(that, args[0], args[1]);
  15625. case 3: return un ? fn(args[0], args[1], args[2])
  15626. : fn.call(that, args[0], args[1], args[2]);
  15627. case 4: return un ? fn(args[0], args[1], args[2], args[3])
  15628. : fn.call(that, args[0], args[1], args[2], args[3]);
  15629. } return fn.apply(that, args);
  15630. };
  15631. /***/ },
  15632. /* 132 */
  15633. /***/ function(module, exports, __webpack_require__) {
  15634. // check on default Array iterator
  15635. var Iterators = __webpack_require__(16)
  15636. , ITERATOR = __webpack_require__(3)('iterator')
  15637. , ArrayProto = Array.prototype;
  15638. module.exports = function(it){
  15639. return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
  15640. };
  15641. /***/ },
  15642. /* 133 */
  15643. /***/ function(module, exports, __webpack_require__) {
  15644. // call something on iterator step with safe closing on error
  15645. var anObject = __webpack_require__(9);
  15646. module.exports = function(iterator, fn, value, entries){
  15647. try {
  15648. return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  15649. // 7.4.6 IteratorClose(iterator, completion)
  15650. } catch(e){
  15651. var ret = iterator['return'];
  15652. if(ret !== undefined)anObject(ret.call(iterator));
  15653. throw e;
  15654. }
  15655. };
  15656. /***/ },
  15657. /* 134 */
  15658. /***/ function(module, exports, __webpack_require__) {
  15659. "use strict";
  15660. 'use strict';
  15661. var create = __webpack_require__(139)
  15662. , descriptor = __webpack_require__(66)
  15663. , setToStringTag = __webpack_require__(39)
  15664. , IteratorPrototype = {};
  15665. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  15666. __webpack_require__(11)(IteratorPrototype, __webpack_require__(3)('iterator'), function(){ return this; });
  15667. module.exports = function(Constructor, NAME, next){
  15668. Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)});
  15669. setToStringTag(Constructor, NAME + ' Iterator');
  15670. };
  15671. /***/ },
  15672. /* 135 */
  15673. /***/ function(module, exports, __webpack_require__) {
  15674. var ITERATOR = __webpack_require__(3)('iterator')
  15675. , SAFE_CLOSING = false;
  15676. try {
  15677. var riter = [7][ITERATOR]();
  15678. riter['return'] = function(){ SAFE_CLOSING = true; };
  15679. Array.from(riter, function(){ throw 2; });
  15680. } catch(e){ /* empty */ }
  15681. module.exports = function(exec, skipClosing){
  15682. if(!skipClosing && !SAFE_CLOSING)return false;
  15683. var safe = false;
  15684. try {
  15685. var arr = [7]
  15686. , iter = arr[ITERATOR]();
  15687. iter.next = function(){ return {done: safe = true}; };
  15688. arr[ITERATOR] = function(){ return iter; };
  15689. exec(arr);
  15690. } catch(e){ /* empty */ }
  15691. return safe;
  15692. };
  15693. /***/ },
  15694. /* 136 */
  15695. /***/ function(module, exports) {
  15696. module.exports = function(done, value){
  15697. return {value: value, done: !!done};
  15698. };
  15699. /***/ },
  15700. /* 137 */
  15701. /***/ function(module, exports, __webpack_require__) {
  15702. var global = __webpack_require__(4)
  15703. , macrotask = __webpack_require__(68).set
  15704. , Observer = global.MutationObserver || global.WebKitMutationObserver
  15705. , process = global.process
  15706. , Promise = global.Promise
  15707. , isNode = __webpack_require__(25)(process) == 'process';
  15708. module.exports = function(){
  15709. var head, last, notify;
  15710. var flush = function(){
  15711. var parent, fn;
  15712. if(isNode && (parent = process.domain))parent.exit();
  15713. while(head){
  15714. fn = head.fn;
  15715. head = head.next;
  15716. try {
  15717. fn();
  15718. } catch(e){
  15719. if(head)notify();
  15720. else last = undefined;
  15721. throw e;
  15722. }
  15723. } last = undefined;
  15724. if(parent)parent.enter();
  15725. };
  15726. // Node.js
  15727. if(isNode){
  15728. notify = function(){
  15729. process.nextTick(flush);
  15730. };
  15731. // browsers with MutationObserver
  15732. } else if(Observer){
  15733. var toggle = true
  15734. , node = document.createTextNode('');
  15735. new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new
  15736. notify = function(){
  15737. node.data = toggle = !toggle;
  15738. };
  15739. // environments with maybe non-completely correct, but existent Promise
  15740. } else if(Promise && Promise.resolve){
  15741. var promise = Promise.resolve();
  15742. notify = function(){
  15743. promise.then(flush);
  15744. };
  15745. // for other environments - macrotask based on:
  15746. // - setImmediate
  15747. // - MessageChannel
  15748. // - window.postMessag
  15749. // - onreadystatechange
  15750. // - setTimeout
  15751. } else {
  15752. notify = function(){
  15753. // strange IE + webpack dev server bug - use .call(global)
  15754. macrotask.call(global, flush);
  15755. };
  15756. }
  15757. return function(fn){
  15758. var task = {fn: fn, next: undefined};
  15759. if(last)last.next = task;
  15760. if(!head){
  15761. head = task;
  15762. notify();
  15763. } last = task;
  15764. };
  15765. };
  15766. /***/ },
  15767. /* 138 */
  15768. /***/ function(module, exports, __webpack_require__) {
  15769. "use strict";
  15770. 'use strict';
  15771. // 19.1.2.1 Object.assign(target, source, ...)
  15772. var getKeys = __webpack_require__(65)
  15773. , gOPS = __webpack_require__(141)
  15774. , pIE = __webpack_require__(144)
  15775. , toObject = __webpack_require__(70)
  15776. , IObject = __webpack_require__(62)
  15777. , $assign = Object.assign;
  15778. // should work with symbols and should have deterministic property order (V8 bug)
  15779. module.exports = !$assign || __webpack_require__(38)(function(){
  15780. var A = {}
  15781. , B = {}
  15782. , S = Symbol()
  15783. , K = 'abcdefghijklmnopqrst';
  15784. A[S] = 7;
  15785. K.split('').forEach(function(k){ B[k] = k; });
  15786. return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
  15787. }) ? function assign(target, source){ // eslint-disable-line no-unused-vars
  15788. var T = toObject(target)
  15789. , aLen = arguments.length
  15790. , index = 1
  15791. , getSymbols = gOPS.f
  15792. , isEnum = pIE.f;
  15793. while(aLen > index){
  15794. var S = IObject(arguments[index++])
  15795. , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)
  15796. , length = keys.length
  15797. , j = 0
  15798. , key;
  15799. while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];
  15800. } return T;
  15801. } : $assign;
  15802. /***/ },
  15803. /* 139 */
  15804. /***/ function(module, exports, __webpack_require__) {
  15805. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  15806. var anObject = __webpack_require__(9)
  15807. , dPs = __webpack_require__(140)
  15808. , enumBugKeys = __webpack_require__(60)
  15809. , IE_PROTO = __webpack_require__(40)('IE_PROTO')
  15810. , Empty = function(){ /* empty */ }
  15811. , PROTOTYPE = 'prototype';
  15812. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  15813. var createDict = function(){
  15814. // Thrash, waste and sodomy: IE GC bug
  15815. var iframe = __webpack_require__(37)('iframe')
  15816. , i = enumBugKeys.length
  15817. , lt = '<'
  15818. , gt = '>'
  15819. , iframeDocument;
  15820. iframe.style.display = 'none';
  15821. __webpack_require__(61).appendChild(iframe);
  15822. iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  15823. // createDict = iframe.contentWindow.Object;
  15824. // html.removeChild(iframe);
  15825. iframeDocument = iframe.contentWindow.document;
  15826. iframeDocument.open();
  15827. iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  15828. iframeDocument.close();
  15829. createDict = iframeDocument.F;
  15830. while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];
  15831. return createDict();
  15832. };
  15833. module.exports = Object.create || function create(O, Properties){
  15834. var result;
  15835. if(O !== null){
  15836. Empty[PROTOTYPE] = anObject(O);
  15837. result = new Empty;
  15838. Empty[PROTOTYPE] = null;
  15839. // add "__proto__" for Object.getPrototypeOf polyfill
  15840. result[IE_PROTO] = O;
  15841. } else result = createDict();
  15842. return Properties === undefined ? result : dPs(result, Properties);
  15843. };
  15844. /***/ },
  15845. /* 140 */
  15846. /***/ function(module, exports, __webpack_require__) {
  15847. var dP = __webpack_require__(17)
  15848. , anObject = __webpack_require__(9)
  15849. , getKeys = __webpack_require__(65);
  15850. module.exports = __webpack_require__(10) ? Object.defineProperties : function defineProperties(O, Properties){
  15851. anObject(O);
  15852. var keys = getKeys(Properties)
  15853. , length = keys.length
  15854. , i = 0
  15855. , P;
  15856. while(length > i)dP.f(O, P = keys[i++], Properties[P]);
  15857. return O;
  15858. };
  15859. /***/ },
  15860. /* 141 */
  15861. /***/ function(module, exports) {
  15862. exports.f = Object.getOwnPropertySymbols;
  15863. /***/ },
  15864. /* 142 */
  15865. /***/ function(module, exports, __webpack_require__) {
  15866. // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
  15867. var has = __webpack_require__(28)
  15868. , toObject = __webpack_require__(70)
  15869. , IE_PROTO = __webpack_require__(40)('IE_PROTO')
  15870. , ObjectProto = Object.prototype;
  15871. module.exports = Object.getPrototypeOf || function(O){
  15872. O = toObject(O);
  15873. if(has(O, IE_PROTO))return O[IE_PROTO];
  15874. if(typeof O.constructor == 'function' && O instanceof O.constructor){
  15875. return O.constructor.prototype;
  15876. } return O instanceof Object ? ObjectProto : null;
  15877. };
  15878. /***/ },
  15879. /* 143 */
  15880. /***/ function(module, exports, __webpack_require__) {
  15881. var has = __webpack_require__(28)
  15882. , toIObject = __webpack_require__(42)
  15883. , arrayIndexOf = __webpack_require__(128)(false)
  15884. , IE_PROTO = __webpack_require__(40)('IE_PROTO');
  15885. module.exports = function(object, names){
  15886. var O = toIObject(object)
  15887. , i = 0
  15888. , result = []
  15889. , key;
  15890. for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);
  15891. // Don't enum bug & hidden keys
  15892. while(names.length > i)if(has(O, key = names[i++])){
  15893. ~arrayIndexOf(result, key) || result.push(key);
  15894. }
  15895. return result;
  15896. };
  15897. /***/ },
  15898. /* 144 */
  15899. /***/ function(module, exports) {
  15900. exports.f = {}.propertyIsEnumerable;
  15901. /***/ },
  15902. /* 145 */
  15903. /***/ function(module, exports, __webpack_require__) {
  15904. var hide = __webpack_require__(11);
  15905. module.exports = function(target, src, safe){
  15906. for(var key in src){
  15907. if(safe && target[key])target[key] = src[key];
  15908. else hide(target, key, src[key]);
  15909. } return target;
  15910. };
  15911. /***/ },
  15912. /* 146 */
  15913. /***/ function(module, exports, __webpack_require__) {
  15914. module.exports = __webpack_require__(11);
  15915. /***/ },
  15916. /* 147 */
  15917. /***/ function(module, exports, __webpack_require__) {
  15918. "use strict";
  15919. 'use strict';
  15920. var global = __webpack_require__(4)
  15921. , core = __webpack_require__(6)
  15922. , dP = __webpack_require__(17)
  15923. , DESCRIPTORS = __webpack_require__(10)
  15924. , SPECIES = __webpack_require__(3)('species');
  15925. module.exports = function(KEY){
  15926. var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];
  15927. if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, {
  15928. configurable: true,
  15929. get: function(){ return this; }
  15930. });
  15931. };
  15932. /***/ },
  15933. /* 148 */
  15934. /***/ function(module, exports, __webpack_require__) {
  15935. // 7.3.20 SpeciesConstructor(O, defaultConstructor)
  15936. var anObject = __webpack_require__(9)
  15937. , aFunction = __webpack_require__(35)
  15938. , SPECIES = __webpack_require__(3)('species');
  15939. module.exports = function(O, D){
  15940. var C = anObject(O).constructor, S;
  15941. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
  15942. };
  15943. /***/ },
  15944. /* 149 */
  15945. /***/ function(module, exports, __webpack_require__) {
  15946. var toInteger = __webpack_require__(41)
  15947. , defined = __webpack_require__(36);
  15948. // true -> String#at
  15949. // false -> String#codePointAt
  15950. module.exports = function(TO_STRING){
  15951. return function(that, pos){
  15952. var s = String(defined(that))
  15953. , i = toInteger(pos)
  15954. , l = s.length
  15955. , a, b;
  15956. if(i < 0 || i >= l)return TO_STRING ? '' : undefined;
  15957. a = s.charCodeAt(i);
  15958. return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
  15959. ? TO_STRING ? s.charAt(i) : a
  15960. : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  15961. };
  15962. };
  15963. /***/ },
  15964. /* 150 */
  15965. /***/ function(module, exports, __webpack_require__) {
  15966. var toInteger = __webpack_require__(41)
  15967. , max = Math.max
  15968. , min = Math.min;
  15969. module.exports = function(index, length){
  15970. index = toInteger(index);
  15971. return index < 0 ? max(index + length, 0) : min(index, length);
  15972. };
  15973. /***/ },
  15974. /* 151 */
  15975. /***/ function(module, exports, __webpack_require__) {
  15976. // 7.1.1 ToPrimitive(input [, PreferredType])
  15977. var isObject = __webpack_require__(29);
  15978. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  15979. // and the second argument - flag - preferred type is a string
  15980. module.exports = function(it, S){
  15981. if(!isObject(it))return it;
  15982. var fn, val;
  15983. if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
  15984. if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;
  15985. if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
  15986. throw TypeError("Can't convert object to primitive value");
  15987. };
  15988. /***/ },
  15989. /* 152 */
  15990. /***/ function(module, exports, __webpack_require__) {
  15991. var classof = __webpack_require__(59)
  15992. , ITERATOR = __webpack_require__(3)('iterator')
  15993. , Iterators = __webpack_require__(16);
  15994. module.exports = __webpack_require__(6).getIteratorMethod = function(it){
  15995. if(it != undefined)return it[ITERATOR]
  15996. || it['@@iterator']
  15997. || Iterators[classof(it)];
  15998. };
  15999. /***/ },
  16000. /* 153 */
  16001. /***/ function(module, exports, __webpack_require__) {
  16002. "use strict";
  16003. 'use strict';
  16004. var addToUnscopables = __webpack_require__(126)
  16005. , step = __webpack_require__(136)
  16006. , Iterators = __webpack_require__(16)
  16007. , toIObject = __webpack_require__(42);
  16008. // 22.1.3.4 Array.prototype.entries()
  16009. // 22.1.3.13 Array.prototype.keys()
  16010. // 22.1.3.29 Array.prototype.values()
  16011. // 22.1.3.30 Array.prototype[@@iterator]()
  16012. module.exports = __webpack_require__(63)(Array, 'Array', function(iterated, kind){
  16013. this._t = toIObject(iterated); // target
  16014. this._i = 0; // next index
  16015. this._k = kind; // kind
  16016. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  16017. }, function(){
  16018. var O = this._t
  16019. , kind = this._k
  16020. , index = this._i++;
  16021. if(!O || index >= O.length){
  16022. this._t = undefined;
  16023. return step(1);
  16024. }
  16025. if(kind == 'keys' )return step(0, index);
  16026. if(kind == 'values')return step(0, O[index]);
  16027. return step(0, [index, O[index]]);
  16028. }, 'values');
  16029. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  16030. Iterators.Arguments = Iterators.Array;
  16031. addToUnscopables('keys');
  16032. addToUnscopables('values');
  16033. addToUnscopables('entries');
  16034. /***/ },
  16035. /* 154 */
  16036. /***/ function(module, exports, __webpack_require__) {
  16037. // 19.1.3.1 Object.assign(target, source)
  16038. var $export = __webpack_require__(27);
  16039. $export($export.S + $export.F, 'Object', {assign: __webpack_require__(138)});
  16040. /***/ },
  16041. /* 155 */
  16042. /***/ function(module, exports, __webpack_require__) {
  16043. var $export = __webpack_require__(27);
  16044. // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
  16045. $export($export.S + $export.F * !__webpack_require__(10), 'Object', {defineProperty: __webpack_require__(17).f});
  16046. /***/ },
  16047. /* 156 */
  16048. /***/ function(module, exports) {
  16049. /***/ },
  16050. /* 157 */
  16051. /***/ function(module, exports, __webpack_require__) {
  16052. "use strict";
  16053. 'use strict';
  16054. var LIBRARY = __webpack_require__(64)
  16055. , global = __webpack_require__(4)
  16056. , ctx = __webpack_require__(26)
  16057. , classof = __webpack_require__(59)
  16058. , $export = __webpack_require__(27)
  16059. , isObject = __webpack_require__(29)
  16060. , aFunction = __webpack_require__(35)
  16061. , anInstance = __webpack_require__(127)
  16062. , forOf = __webpack_require__(129)
  16063. , speciesConstructor = __webpack_require__(148)
  16064. , task = __webpack_require__(68).set
  16065. , microtask = __webpack_require__(137)()
  16066. , PROMISE = 'Promise'
  16067. , TypeError = global.TypeError
  16068. , process = global.process
  16069. , $Promise = global[PROMISE]
  16070. , process = global.process
  16071. , isNode = classof(process) == 'process'
  16072. , empty = function(){ /* empty */ }
  16073. , Internal, GenericPromiseCapability, Wrapper;
  16074. var USE_NATIVE = !!function(){
  16075. try {
  16076. // correct subclassing with @@species support
  16077. var promise = $Promise.resolve(1)
  16078. , FakePromise = (promise.constructor = {})[__webpack_require__(3)('species')] = function(exec){ exec(empty, empty); };
  16079. // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
  16080. return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;
  16081. } catch(e){ /* empty */ }
  16082. }();
  16083. // helpers
  16084. var sameConstructor = function(a, b){
  16085. // with library wrapper special case
  16086. return a === b || a === $Promise && b === Wrapper;
  16087. };
  16088. var isThenable = function(it){
  16089. var then;
  16090. return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
  16091. };
  16092. var newPromiseCapability = function(C){
  16093. return sameConstructor($Promise, C)
  16094. ? new PromiseCapability(C)
  16095. : new GenericPromiseCapability(C);
  16096. };
  16097. var PromiseCapability = GenericPromiseCapability = function(C){
  16098. var resolve, reject;
  16099. this.promise = new C(function($$resolve, $$reject){
  16100. if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor');
  16101. resolve = $$resolve;
  16102. reject = $$reject;
  16103. });
  16104. this.resolve = aFunction(resolve);
  16105. this.reject = aFunction(reject);
  16106. };
  16107. var perform = function(exec){
  16108. try {
  16109. exec();
  16110. } catch(e){
  16111. return {error: e};
  16112. }
  16113. };
  16114. var notify = function(promise, isReject){
  16115. if(promise._n)return;
  16116. promise._n = true;
  16117. var chain = promise._c;
  16118. microtask(function(){
  16119. var value = promise._v
  16120. , ok = promise._s == 1
  16121. , i = 0;
  16122. var run = function(reaction){
  16123. var handler = ok ? reaction.ok : reaction.fail
  16124. , resolve = reaction.resolve
  16125. , reject = reaction.reject
  16126. , domain = reaction.domain
  16127. , result, then;
  16128. try {
  16129. if(handler){
  16130. if(!ok){
  16131. if(promise._h == 2)onHandleUnhandled(promise);
  16132. promise._h = 1;
  16133. }
  16134. if(handler === true)result = value;
  16135. else {
  16136. if(domain)domain.enter();
  16137. result = handler(value);
  16138. if(domain)domain.exit();
  16139. }
  16140. if(result === reaction.promise){
  16141. reject(TypeError('Promise-chain cycle'));
  16142. } else if(then = isThenable(result)){
  16143. then.call(result, resolve, reject);
  16144. } else resolve(result);
  16145. } else reject(value);
  16146. } catch(e){
  16147. reject(e);
  16148. }
  16149. };
  16150. while(chain.length > i)run(chain[i++]); // variable length - can't use forEach
  16151. promise._c = [];
  16152. promise._n = false;
  16153. if(isReject && !promise._h)onUnhandled(promise);
  16154. });
  16155. };
  16156. var onUnhandled = function(promise){
  16157. task.call(global, function(){
  16158. var value = promise._v
  16159. , abrupt, handler, console;
  16160. if(isUnhandled(promise)){
  16161. abrupt = perform(function(){
  16162. if(isNode){
  16163. process.emit('unhandledRejection', value, promise);
  16164. } else if(handler = global.onunhandledrejection){
  16165. handler({promise: promise, reason: value});
  16166. } else if((console = global.console) && console.error){
  16167. console.error('Unhandled promise rejection', value);
  16168. }
  16169. });
  16170. // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
  16171. promise._h = isNode || isUnhandled(promise) ? 2 : 1;
  16172. } promise._a = undefined;
  16173. if(abrupt)throw abrupt.error;
  16174. });
  16175. };
  16176. var isUnhandled = function(promise){
  16177. if(promise._h == 1)return false;
  16178. var chain = promise._a || promise._c
  16179. , i = 0
  16180. , reaction;
  16181. while(chain.length > i){
  16182. reaction = chain[i++];
  16183. if(reaction.fail || !isUnhandled(reaction.promise))return false;
  16184. } return true;
  16185. };
  16186. var onHandleUnhandled = function(promise){
  16187. task.call(global, function(){
  16188. var handler;
  16189. if(isNode){
  16190. process.emit('rejectionHandled', promise);
  16191. } else if(handler = global.onrejectionhandled){
  16192. handler({promise: promise, reason: promise._v});
  16193. }
  16194. });
  16195. };
  16196. var $reject = function(value){
  16197. var promise = this;
  16198. if(promise._d)return;
  16199. promise._d = true;
  16200. promise = promise._w || promise; // unwrap
  16201. promise._v = value;
  16202. promise._s = 2;
  16203. if(!promise._a)promise._a = promise._c.slice();
  16204. notify(promise, true);
  16205. };
  16206. var $resolve = function(value){
  16207. var promise = this
  16208. , then;
  16209. if(promise._d)return;
  16210. promise._d = true;
  16211. promise = promise._w || promise; // unwrap
  16212. try {
  16213. if(promise === value)throw TypeError("Promise can't be resolved itself");
  16214. if(then = isThenable(value)){
  16215. microtask(function(){
  16216. var wrapper = {_w: promise, _d: false}; // wrap
  16217. try {
  16218. then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
  16219. } catch(e){
  16220. $reject.call(wrapper, e);
  16221. }
  16222. });
  16223. } else {
  16224. promise._v = value;
  16225. promise._s = 1;
  16226. notify(promise, false);
  16227. }
  16228. } catch(e){
  16229. $reject.call({_w: promise, _d: false}, e); // wrap
  16230. }
  16231. };
  16232. // constructor polyfill
  16233. if(!USE_NATIVE){
  16234. // 25.4.3.1 Promise(executor)
  16235. $Promise = function Promise(executor){
  16236. anInstance(this, $Promise, PROMISE, '_h');
  16237. aFunction(executor);
  16238. Internal.call(this);
  16239. try {
  16240. executor(ctx($resolve, this, 1), ctx($reject, this, 1));
  16241. } catch(err){
  16242. $reject.call(this, err);
  16243. }
  16244. };
  16245. Internal = function Promise(executor){
  16246. this._c = []; // <- awaiting reactions
  16247. this._a = undefined; // <- checked in isUnhandled reactions
  16248. this._s = 0; // <- state
  16249. this._d = false; // <- done
  16250. this._v = undefined; // <- value
  16251. this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
  16252. this._n = false; // <- notify
  16253. };
  16254. Internal.prototype = __webpack_require__(145)($Promise.prototype, {
  16255. // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
  16256. then: function then(onFulfilled, onRejected){
  16257. var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
  16258. reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
  16259. reaction.fail = typeof onRejected == 'function' && onRejected;
  16260. reaction.domain = isNode ? process.domain : undefined;
  16261. this._c.push(reaction);
  16262. if(this._a)this._a.push(reaction);
  16263. if(this._s)notify(this, false);
  16264. return reaction.promise;
  16265. },
  16266. // 25.4.5.1 Promise.prototype.catch(onRejected)
  16267. 'catch': function(onRejected){
  16268. return this.then(undefined, onRejected);
  16269. }
  16270. });
  16271. PromiseCapability = function(){
  16272. var promise = new Internal;
  16273. this.promise = promise;
  16274. this.resolve = ctx($resolve, promise, 1);
  16275. this.reject = ctx($reject, promise, 1);
  16276. };
  16277. }
  16278. $export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise});
  16279. __webpack_require__(39)($Promise, PROMISE);
  16280. __webpack_require__(147)(PROMISE);
  16281. Wrapper = __webpack_require__(6)[PROMISE];
  16282. // statics
  16283. $export($export.S + $export.F * !USE_NATIVE, PROMISE, {
  16284. // 25.4.4.5 Promise.reject(r)
  16285. reject: function reject(r){
  16286. var capability = newPromiseCapability(this)
  16287. , $$reject = capability.reject;
  16288. $$reject(r);
  16289. return capability.promise;
  16290. }
  16291. });
  16292. $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
  16293. // 25.4.4.6 Promise.resolve(x)
  16294. resolve: function resolve(x){
  16295. // instanceof instead of internal slot check because we should fix it without replacement native Promise core
  16296. if(x instanceof $Promise && sameConstructor(x.constructor, this))return x;
  16297. var capability = newPromiseCapability(this)
  16298. , $$resolve = capability.resolve;
  16299. $$resolve(x);
  16300. return capability.promise;
  16301. }
  16302. });
  16303. $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(135)(function(iter){
  16304. $Promise.all(iter)['catch'](empty);
  16305. })), PROMISE, {
  16306. // 25.4.4.1 Promise.all(iterable)
  16307. all: function all(iterable){
  16308. var C = this
  16309. , capability = newPromiseCapability(C)
  16310. , resolve = capability.resolve
  16311. , reject = capability.reject;
  16312. var abrupt = perform(function(){
  16313. var values = []
  16314. , index = 0
  16315. , remaining = 1;
  16316. forOf(iterable, false, function(promise){
  16317. var $index = index++
  16318. , alreadyCalled = false;
  16319. values.push(undefined);
  16320. remaining++;
  16321. C.resolve(promise).then(function(value){
  16322. if(alreadyCalled)return;
  16323. alreadyCalled = true;
  16324. values[$index] = value;
  16325. --remaining || resolve(values);
  16326. }, reject);
  16327. });
  16328. --remaining || resolve(values);
  16329. });
  16330. if(abrupt)reject(abrupt.error);
  16331. return capability.promise;
  16332. },
  16333. // 25.4.4.4 Promise.race(iterable)
  16334. race: function race(iterable){
  16335. var C = this
  16336. , capability = newPromiseCapability(C)
  16337. , reject = capability.reject;
  16338. var abrupt = perform(function(){
  16339. forOf(iterable, false, function(promise){
  16340. C.resolve(promise).then(capability.resolve, reject);
  16341. });
  16342. });
  16343. if(abrupt)reject(abrupt.error);
  16344. return capability.promise;
  16345. }
  16346. });
  16347. /***/ },
  16348. /* 158 */
  16349. /***/ function(module, exports, __webpack_require__) {
  16350. "use strict";
  16351. 'use strict';
  16352. var $at = __webpack_require__(149)(true);
  16353. // 21.1.3.27 String.prototype[@@iterator]()
  16354. __webpack_require__(63)(String, 'String', function(iterated){
  16355. this._t = String(iterated); // target
  16356. this._i = 0; // next index
  16357. // 21.1.5.2.1 %StringIteratorPrototype%.next()
  16358. }, function(){
  16359. var O = this._t
  16360. , index = this._i
  16361. , point;
  16362. if(index >= O.length)return {value: undefined, done: true};
  16363. point = $at(O, index);
  16364. this._i += point.length;
  16365. return {value: point, done: false};
  16366. });
  16367. /***/ },
  16368. /* 159 */
  16369. /***/ function(module, exports, __webpack_require__) {
  16370. __webpack_require__(153);
  16371. var global = __webpack_require__(4)
  16372. , hide = __webpack_require__(11)
  16373. , Iterators = __webpack_require__(16)
  16374. , TO_STRING_TAG = __webpack_require__(3)('toStringTag');
  16375. for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){
  16376. var NAME = collections[i]
  16377. , Collection = global[NAME]
  16378. , proto = Collection && Collection.prototype;
  16379. if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME);
  16380. Iterators[NAME] = Iterators.Array;
  16381. }
  16382. /***/ },
  16383. /* 160 */
  16384. /***/ function(module, exports, __webpack_require__) {
  16385. "use strict";
  16386. /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
  16387. var inherits = __webpack_require__(1)
  16388. var md5 = __webpack_require__(162)
  16389. var rmd160 = __webpack_require__(189)
  16390. var sha = __webpack_require__(191)
  16391. var Base = __webpack_require__(119)
  16392. function HashNoConstructor(hash) {
  16393. Base.call(this, 'digest')
  16394. this._hash = hash
  16395. this.buffers = []
  16396. }
  16397. inherits(HashNoConstructor, Base)
  16398. HashNoConstructor.prototype._update = function (data) {
  16399. this.buffers.push(data)
  16400. }
  16401. HashNoConstructor.prototype._final = function () {
  16402. var buf = Buffer.concat(this.buffers)
  16403. var r = this._hash(buf)
  16404. this.buffers = null
  16405. return r
  16406. }
  16407. function Hash(hash) {
  16408. Base.call(this, 'digest')
  16409. this._hash = hash
  16410. }
  16411. inherits(Hash, Base)
  16412. Hash.prototype._update = function (data) {
  16413. this._hash.update(data)
  16414. }
  16415. Hash.prototype._final = function () {
  16416. return this._hash.digest()
  16417. }
  16418. module.exports = function createHash (alg) {
  16419. alg = alg.toLowerCase()
  16420. if ('md5' === alg) return new HashNoConstructor(md5)
  16421. if ('rmd160' === alg || 'ripemd160' === alg) return new HashNoConstructor(rmd160)
  16422. return new Hash(sha(alg))
  16423. }
  16424. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  16425. /***/ },
  16426. /* 161 */
  16427. /***/ function(module, exports, __webpack_require__) {
  16428. "use strict";
  16429. /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
  16430. var intSize = 4;
  16431. var zeroBuffer = new Buffer(intSize); zeroBuffer.fill(0);
  16432. var chrsz = 8;
  16433. function toArray(buf, bigEndian) {
  16434. if ((buf.length % intSize) !== 0) {
  16435. var len = buf.length + (intSize - (buf.length % intSize));
  16436. buf = Buffer.concat([buf, zeroBuffer], len);
  16437. }
  16438. var arr = [];
  16439. var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE;
  16440. for (var i = 0; i < buf.length; i += intSize) {
  16441. arr.push(fn.call(buf, i));
  16442. }
  16443. return arr;
  16444. }
  16445. function toBuffer(arr, size, bigEndian) {
  16446. var buf = new Buffer(size);
  16447. var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE;
  16448. for (var i = 0; i < arr.length; i++) {
  16449. fn.call(buf, arr[i], i * 4, true);
  16450. }
  16451. return buf;
  16452. }
  16453. function hash(buf, fn, hashSize, bigEndian) {
  16454. if (!Buffer.isBuffer(buf)) buf = new Buffer(buf);
  16455. var arr = fn(toArray(buf, bigEndian), buf.length * chrsz);
  16456. return toBuffer(arr, hashSize, bigEndian);
  16457. }
  16458. exports.hash = hash;
  16459. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  16460. /***/ },
  16461. /* 162 */
  16462. /***/ function(module, exports, __webpack_require__) {
  16463. "use strict";
  16464. 'use strict';
  16465. /*
  16466. * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
  16467. * Digest Algorithm, as defined in RFC 1321.
  16468. * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
  16469. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  16470. * Distributed under the BSD License
  16471. * See http://pajhome.org.uk/crypt/md5 for more info.
  16472. */
  16473. var helpers = __webpack_require__(161);
  16474. /*
  16475. * Calculate the MD5 of an array of little-endian words, and a bit length
  16476. */
  16477. function core_md5(x, len)
  16478. {
  16479. /* append padding */
  16480. x[len >> 5] |= 0x80 << ((len) % 32);
  16481. x[(((len + 64) >>> 9) << 4) + 14] = len;
  16482. var a = 1732584193;
  16483. var b = -271733879;
  16484. var c = -1732584194;
  16485. var d = 271733878;
  16486. for(var i = 0; i < x.length; i += 16)
  16487. {
  16488. var olda = a;
  16489. var oldb = b;
  16490. var oldc = c;
  16491. var oldd = d;
  16492. a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
  16493. d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
  16494. c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
  16495. b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
  16496. a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
  16497. d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
  16498. c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
  16499. b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
  16500. a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
  16501. d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
  16502. c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
  16503. b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
  16504. a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
  16505. d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
  16506. c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
  16507. b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
  16508. a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
  16509. d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
  16510. c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
  16511. b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
  16512. a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
  16513. d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
  16514. c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
  16515. b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
  16516. a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
  16517. d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
  16518. c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
  16519. b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
  16520. a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
  16521. d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
  16522. c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
  16523. b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
  16524. a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
  16525. d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
  16526. c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
  16527. b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
  16528. a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
  16529. d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
  16530. c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
  16531. b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
  16532. a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
  16533. d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
  16534. c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
  16535. b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
  16536. a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
  16537. d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
  16538. c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
  16539. b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
  16540. a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
  16541. d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
  16542. c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
  16543. b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
  16544. a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
  16545. d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
  16546. c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
  16547. b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
  16548. a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
  16549. d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
  16550. c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
  16551. b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
  16552. a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
  16553. d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
  16554. c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
  16555. b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
  16556. a = safe_add(a, olda);
  16557. b = safe_add(b, oldb);
  16558. c = safe_add(c, oldc);
  16559. d = safe_add(d, oldd);
  16560. }
  16561. return Array(a, b, c, d);
  16562. }
  16563. /*
  16564. * These functions implement the four basic operations the algorithm uses.
  16565. */
  16566. function md5_cmn(q, a, b, x, s, t)
  16567. {
  16568. return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
  16569. }
  16570. function md5_ff(a, b, c, d, x, s, t)
  16571. {
  16572. return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
  16573. }
  16574. function md5_gg(a, b, c, d, x, s, t)
  16575. {
  16576. return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
  16577. }
  16578. function md5_hh(a, b, c, d, x, s, t)
  16579. {
  16580. return md5_cmn(b ^ c ^ d, a, b, x, s, t);
  16581. }
  16582. function md5_ii(a, b, c, d, x, s, t)
  16583. {
  16584. return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
  16585. }
  16586. /*
  16587. * Add integers, wrapping at 2^32. This uses 16-bit operations internally
  16588. * to work around bugs in some JS interpreters.
  16589. */
  16590. function safe_add(x, y)
  16591. {
  16592. var lsw = (x & 0xFFFF) + (y & 0xFFFF);
  16593. var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  16594. return (msw << 16) | (lsw & 0xFFFF);
  16595. }
  16596. /*
  16597. * Bitwise rotate a 32-bit number to the left.
  16598. */
  16599. function bit_rol(num, cnt)
  16600. {
  16601. return (num << cnt) | (num >>> (32 - cnt));
  16602. }
  16603. module.exports = function md5(buf) {
  16604. return helpers.hash(buf, core_md5, 16);
  16605. };
  16606. /***/ },
  16607. /* 163 */
  16608. /***/ function(module, exports, __webpack_require__) {
  16609. exports = module.exports = __webpack_require__(19)();
  16610. // imports
  16611. // module
  16612. exports.push([module.i, "\n#fingerprint {\n min-width: 90px;\n text-align: center;\n background-color: transparent;\n color: white;\n}\n#fingerprint i {\n color: black;\n position: relative;\n padding: 0;\n text-shadow: 1px 1px 0 white;\n font-size: 1.3em;\n}\n", ""]);
  16613. // exports
  16614. /***/ },
  16615. /* 164 */
  16616. /***/ function(module, exports, __webpack_require__) {
  16617. exports = module.exports = __webpack_require__(19)();
  16618. // imports
  16619. // module
  16620. exports.push([module.i, "\n#password-generator {\n color: #555;\n}\n.inner-addon i {\n position: absolute;\n padding: 10px;\n pointer-events: none;\n z-index: 10;\n}\n.inner-addon {\n position: relative;\n}\n.left-addon i {\n left: 0;\n}\n.right-addon i {\n right: 0;\n}\n.left-addon input {\n padding-left: 30px;\n}\n.right-addon input {\n padding-right: 30px;\n}\n", ""]);
  16621. // exports
  16622. /***/ },
  16623. /* 165 */
  16624. /***/ function(module, exports, __webpack_require__) {
  16625. exports = module.exports = __webpack_require__(19)();
  16626. // imports
  16627. // module
  16628. exports.push([module.i, "\n#lesspass .white-link {\n color: white;\n}\n#lesspass .white-link:hover, #lesspass .white-link:focus, #lesspass .white-link:active {\n text-decoration: none;\n color: white;\n}\n#lesspass, #lesspass * {\n border-radius: 0 !important;\n}\n", ""]);
  16629. // exports
  16630. /***/ },
  16631. /* 166 */
  16632. /***/ function(module, exports, __webpack_require__) {
  16633. exports = module.exports = __webpack_require__(19)();
  16634. // imports
  16635. // module
  16636. exports.push([module.i, "\n.fa-white {\n color: #ffffff;\n}\n#delete-button {\n position: relative;\n}\n.btn-progress:before {\n content: \"\";\n position: absolute;\n background: #D9534F;\n bottom: 0;\n left: 0;\n top: 80%;\n z-index: 1;\n animation: 2s progress;\n}\n@keyframes progress {\n0% {\n right: 100%;\n}\n100% {\n right: 0;\n}\n}\n", ""]);
  16637. // exports
  16638. /***/ },
  16639. /* 167 */
  16640. /***/ function(module, exports, __webpack_require__) {
  16641. exports = module.exports = __webpack_require__(19)();
  16642. // imports
  16643. // module
  16644. exports.push([module.i, "\n.card-header-dark {\n background-color: #555;\n color: #FFF;\n}\n.grey-link {\n color: #373a3c;\n text-decoration: none;\n}\n.grey-link:hover, .grey-link:focus, .grey-link:active {\n color: #373a3c;\n text-decoration: none;\n}\n.white-link {\n color: white;\n}\n.white-link:hover, .white-link:focus, .white-link:active {\n text-decoration: none;\n color: white;\n}\n.fa-clickable {\n cursor: pointer;\n}\n", ""]);
  16645. // exports
  16646. /***/ },
  16647. /* 168 */
  16648. /***/ function(module, exports) {
  16649. /**
  16650. * A polyfill for Element.matches()
  16651. */
  16652. if (Element && !Element.prototype.matches) {
  16653. var proto = Element.prototype;
  16654. proto.matches = proto.matchesSelector ||
  16655. proto.mozMatchesSelector ||
  16656. proto.msMatchesSelector ||
  16657. proto.oMatchesSelector ||
  16658. proto.webkitMatchesSelector;
  16659. }
  16660. /**
  16661. * Finds the closest parent that matches a selector.
  16662. *
  16663. * @param {Element} element
  16664. * @param {String} selector
  16665. * @return {Function}
  16666. */
  16667. function closest (element, selector) {
  16668. while (element && element !== document) {
  16669. if (element.matches(selector)) return element;
  16670. element = element.parentNode;
  16671. }
  16672. }
  16673. module.exports = closest;
  16674. /***/ },
  16675. /* 169 */
  16676. /***/ function(module, exports, __webpack_require__) {
  16677. var closest = __webpack_require__(168);
  16678. /**
  16679. * Delegates event to a selector.
  16680. *
  16681. * @param {Element} element
  16682. * @param {String} selector
  16683. * @param {String} type
  16684. * @param {Function} callback
  16685. * @param {Boolean} useCapture
  16686. * @return {Object}
  16687. */
  16688. function delegate(element, selector, type, callback, useCapture) {
  16689. var listenerFn = listener.apply(this, arguments);
  16690. element.addEventListener(type, listenerFn, useCapture);
  16691. return {
  16692. destroy: function() {
  16693. element.removeEventListener(type, listenerFn, useCapture);
  16694. }
  16695. }
  16696. }
  16697. /**
  16698. * Finds closest match and invokes callback.
  16699. *
  16700. * @param {Element} element
  16701. * @param {String} selector
  16702. * @param {String} type
  16703. * @param {Function} callback
  16704. * @return {Function}
  16705. */
  16706. function listener(element, selector, type, callback) {
  16707. return function(e) {
  16708. e.delegateTarget = closest(e.target, selector);
  16709. if (e.delegateTarget) {
  16710. callback.call(element, e);
  16711. }
  16712. }
  16713. }
  16714. module.exports = delegate;
  16715. /***/ },
  16716. /* 170 */
  16717. /***/ function(module, exports) {
  16718. /**
  16719. * Check if argument is a HTML element.
  16720. *
  16721. * @param {Object} value
  16722. * @return {Boolean}
  16723. */
  16724. exports.node = function(value) {
  16725. return value !== undefined
  16726. && value instanceof HTMLElement
  16727. && value.nodeType === 1;
  16728. };
  16729. /**
  16730. * Check if argument is a list of HTML elements.
  16731. *
  16732. * @param {Object} value
  16733. * @return {Boolean}
  16734. */
  16735. exports.nodeList = function(value) {
  16736. var type = Object.prototype.toString.call(value);
  16737. return value !== undefined
  16738. && (type === '[object NodeList]' || type === '[object HTMLCollection]')
  16739. && ('length' in value)
  16740. && (value.length === 0 || exports.node(value[0]));
  16741. };
  16742. /**
  16743. * Check if argument is a string.
  16744. *
  16745. * @param {Object} value
  16746. * @return {Boolean}
  16747. */
  16748. exports.string = function(value) {
  16749. return typeof value === 'string'
  16750. || value instanceof String;
  16751. };
  16752. /**
  16753. * Check if argument is a function.
  16754. *
  16755. * @param {Object} value
  16756. * @return {Boolean}
  16757. */
  16758. exports.fn = function(value) {
  16759. var type = Object.prototype.toString.call(value);
  16760. return type === '[object Function]';
  16761. };
  16762. /***/ },
  16763. /* 171 */
  16764. /***/ function(module, exports, __webpack_require__) {
  16765. var is = __webpack_require__(170);
  16766. var delegate = __webpack_require__(169);
  16767. /**
  16768. * Validates all params and calls the right
  16769. * listener function based on its target type.
  16770. *
  16771. * @param {String|HTMLElement|HTMLCollection|NodeList} target
  16772. * @param {String} type
  16773. * @param {Function} callback
  16774. * @return {Object}
  16775. */
  16776. function listen(target, type, callback) {
  16777. if (!target && !type && !callback) {
  16778. throw new Error('Missing required arguments');
  16779. }
  16780. if (!is.string(type)) {
  16781. throw new TypeError('Second argument must be a String');
  16782. }
  16783. if (!is.fn(callback)) {
  16784. throw new TypeError('Third argument must be a Function');
  16785. }
  16786. if (is.node(target)) {
  16787. return listenNode(target, type, callback);
  16788. }
  16789. else if (is.nodeList(target)) {
  16790. return listenNodeList(target, type, callback);
  16791. }
  16792. else if (is.string(target)) {
  16793. return listenSelector(target, type, callback);
  16794. }
  16795. else {
  16796. throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
  16797. }
  16798. }
  16799. /**
  16800. * Adds an event listener to a HTML element
  16801. * and returns a remove listener function.
  16802. *
  16803. * @param {HTMLElement} node
  16804. * @param {String} type
  16805. * @param {Function} callback
  16806. * @return {Object}
  16807. */
  16808. function listenNode(node, type, callback) {
  16809. node.addEventListener(type, callback);
  16810. return {
  16811. destroy: function() {
  16812. node.removeEventListener(type, callback);
  16813. }
  16814. }
  16815. }
  16816. /**
  16817. * Add an event listener to a list of HTML elements
  16818. * and returns a remove listener function.
  16819. *
  16820. * @param {NodeList|HTMLCollection} nodeList
  16821. * @param {String} type
  16822. * @param {Function} callback
  16823. * @return {Object}
  16824. */
  16825. function listenNodeList(nodeList, type, callback) {
  16826. Array.prototype.forEach.call(nodeList, function(node) {
  16827. node.addEventListener(type, callback);
  16828. });
  16829. return {
  16830. destroy: function() {
  16831. Array.prototype.forEach.call(nodeList, function(node) {
  16832. node.removeEventListener(type, callback);
  16833. });
  16834. }
  16835. }
  16836. }
  16837. /**
  16838. * Add an event listener to a selector
  16839. * and returns a remove listener function.
  16840. *
  16841. * @param {String} selector
  16842. * @param {String} type
  16843. * @param {Function} callback
  16844. * @return {Object}
  16845. */
  16846. function listenSelector(selector, type, callback) {
  16847. return delegate(document.body, selector, type, callback);
  16848. }
  16849. module.exports = listen;
  16850. /***/ },
  16851. /* 172 */
  16852. /***/ function(module, exports) {
  16853. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  16854. var e, m
  16855. var eLen = nBytes * 8 - mLen - 1
  16856. var eMax = (1 << eLen) - 1
  16857. var eBias = eMax >> 1
  16858. var nBits = -7
  16859. var i = isLE ? (nBytes - 1) : 0
  16860. var d = isLE ? -1 : 1
  16861. var s = buffer[offset + i]
  16862. i += d
  16863. e = s & ((1 << (-nBits)) - 1)
  16864. s >>= (-nBits)
  16865. nBits += eLen
  16866. for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
  16867. m = e & ((1 << (-nBits)) - 1)
  16868. e >>= (-nBits)
  16869. nBits += mLen
  16870. for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
  16871. if (e === 0) {
  16872. e = 1 - eBias
  16873. } else if (e === eMax) {
  16874. return m ? NaN : ((s ? -1 : 1) * Infinity)
  16875. } else {
  16876. m = m + Math.pow(2, mLen)
  16877. e = e - eBias
  16878. }
  16879. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  16880. }
  16881. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  16882. var e, m, c
  16883. var eLen = nBytes * 8 - mLen - 1
  16884. var eMax = (1 << eLen) - 1
  16885. var eBias = eMax >> 1
  16886. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  16887. var i = isLE ? 0 : (nBytes - 1)
  16888. var d = isLE ? 1 : -1
  16889. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  16890. value = Math.abs(value)
  16891. if (isNaN(value) || value === Infinity) {
  16892. m = isNaN(value) ? 1 : 0
  16893. e = eMax
  16894. } else {
  16895. e = Math.floor(Math.log(value) / Math.LN2)
  16896. if (value * (c = Math.pow(2, -e)) < 1) {
  16897. e--
  16898. c *= 2
  16899. }
  16900. if (e + eBias >= 1) {
  16901. value += rt / c
  16902. } else {
  16903. value += rt * Math.pow(2, 1 - eBias)
  16904. }
  16905. if (value * c >= 2) {
  16906. e++
  16907. c /= 2
  16908. }
  16909. if (e + eBias >= eMax) {
  16910. m = 0
  16911. e = eMax
  16912. } else if (e + eBias >= 1) {
  16913. m = (value * c - 1) * Math.pow(2, mLen)
  16914. e = e + eBias
  16915. } else {
  16916. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  16917. e = 0
  16918. }
  16919. }
  16920. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  16921. e = (e << mLen) | m
  16922. eLen += mLen
  16923. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  16924. buffer[offset + i - d] |= s * 128
  16925. }
  16926. /***/ },
  16927. /* 173 */
  16928. /***/ function(module, exports) {
  16929. /**
  16930. * The code was extracted from:
  16931. * https://github.com/davidchambers/Base64.js
  16932. */
  16933. var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  16934. function InvalidCharacterError(message) {
  16935. this.message = message;
  16936. }
  16937. InvalidCharacterError.prototype = new Error();
  16938. InvalidCharacterError.prototype.name = 'InvalidCharacterError';
  16939. function polyfill (input) {
  16940. var str = String(input).replace(/=+$/, '');
  16941. if (str.length % 4 == 1) {
  16942. throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded.");
  16943. }
  16944. for (
  16945. // initialize result and counters
  16946. var bc = 0, bs, buffer, idx = 0, output = '';
  16947. // get next character
  16948. buffer = str.charAt(idx++);
  16949. // character found in table? initialize bit storage and add its ascii value;
  16950. ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,
  16951. // and if not first of each 4 characters,
  16952. // convert the first 8 bits to one ascii character
  16953. bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0
  16954. ) {
  16955. // try to find character in table (0-63, not found => -1)
  16956. buffer = chars.indexOf(buffer);
  16957. }
  16958. return output;
  16959. }
  16960. module.exports = typeof window !== 'undefined' && window.atob && window.atob.bind(window) || polyfill;
  16961. /***/ },
  16962. /* 174 */
  16963. /***/ function(module, exports, __webpack_require__) {
  16964. var atob = __webpack_require__(173);
  16965. function b64DecodeUnicode(str) {
  16966. return decodeURIComponent(atob(str).replace(/(.)/g, function (m, p) {
  16967. var code = p.charCodeAt(0).toString(16).toUpperCase();
  16968. if (code.length < 2) {
  16969. code = '0' + code;
  16970. }
  16971. return '%' + code;
  16972. }));
  16973. }
  16974. module.exports = function(str) {
  16975. var output = str.replace(/-/g, "+").replace(/_/g, "/");
  16976. switch (output.length % 4) {
  16977. case 0:
  16978. break;
  16979. case 2:
  16980. output += "==";
  16981. break;
  16982. case 3:
  16983. output += "=";
  16984. break;
  16985. default:
  16986. throw "Illegal base64url string!";
  16987. }
  16988. try{
  16989. return b64DecodeUnicode(output);
  16990. } catch (err) {
  16991. return atob(output);
  16992. }
  16993. };
  16994. /***/ },
  16995. /* 175 */
  16996. /***/ function(module, exports, __webpack_require__) {
  16997. "use strict";
  16998. 'use strict';
  16999. var base64_url_decode = __webpack_require__(174);
  17000. module.exports = function (token,options) {
  17001. if (typeof token !== 'string') {
  17002. throw new Error('Invalid token specified');
  17003. }
  17004. options = options || {};
  17005. var pos = options.header === true ? 0 : 1;
  17006. return JSON.parse(base64_url_decode(token.split('.')[pos]));
  17007. };
  17008. /***/ },
  17009. /* 176 */
  17010. /***/ function(module, exports, __webpack_require__) {
  17011. /* WEBPACK VAR INJECTION */(function(Buffer) {var pbkdf2 = __webpack_require__(44);
  17012. var createHMAC = __webpack_require__(72);
  17013. var Promise = __webpack_require__(74);
  17014. module.exports = {
  17015. encryptLogin: encryptLogin,
  17016. renderPassword: renderPassword,
  17017. createFingerprint: createFingerprint,
  17018. _deriveEncryptedLogin: deriveEncryptedLogin,
  17019. _getPasswordTemplate: getPasswordTemplate,
  17020. _prettyPrint: prettyPrint,
  17021. _string2charCodes: string2charCodes,
  17022. _getCharType: getCharType,
  17023. _getPasswordChar: getPasswordChar,
  17024. _createHmac: createHmac,
  17025. };
  17026. function encryptLogin(login, masterPassword, options) {
  17027. var _options = options !== undefined ? options : {};
  17028. var iterations = _options.iterations || 8192;
  17029. var keylen = _options.keylen || 32;
  17030. return pbkdf2(masterPassword, login, iterations, keylen, 'sha256');
  17031. }
  17032. function renderPassword(encryptedLogin, site, passwordOptions) {
  17033. return deriveEncryptedLogin(encryptedLogin, site, passwordOptions).then(function (derivedEncryptedLogin) {
  17034. var template = passwordOptions.template || getPasswordTemplate(passwordOptions);
  17035. return prettyPrint(derivedEncryptedLogin, template);
  17036. });
  17037. }
  17038. function createHmac(encryptedLogin, salt) {
  17039. return new Promise(function (resolve) {
  17040. resolve(createHMAC('sha256', new Buffer(encryptedLogin)).update(salt).digest('hex'));
  17041. });
  17042. }
  17043. function deriveEncryptedLogin(encryptedLogin, site, options) {
  17044. var _options = options !== undefined ? options : {};
  17045. var length = _options.length || 12;
  17046. var counter = _options.counter || 1;
  17047. var salt = site + counter.toString();
  17048. return createHmac(encryptedLogin, salt).then(function (derivedHash) {
  17049. return derivedHash.substring(0, length);
  17050. });
  17051. }
  17052. function getPasswordTemplate(passwordTypes) {
  17053. var templates = {
  17054. lowercase: 'vc',
  17055. uppercase: 'VC',
  17056. numbers: 'n',
  17057. symbols: 's',
  17058. };
  17059. var returnedTemplate = '';
  17060. Object.keys(templates).forEach(function (template) {
  17061. if (passwordTypes.hasOwnProperty(template) && passwordTypes[template]) {
  17062. returnedTemplate += templates[template]
  17063. }
  17064. });
  17065. return returnedTemplate;
  17066. }
  17067. function prettyPrint(hash, template) {
  17068. var password = '';
  17069. string2charCodes(hash).forEach(function (charCode, index) {
  17070. var charType = getCharType(template, index);
  17071. password += getPasswordChar(charType, charCode);
  17072. });
  17073. return password;
  17074. }
  17075. function string2charCodes(text) {
  17076. var charCodes = [];
  17077. for (var i = 0; i < text.length; i++) {
  17078. charCodes.push(text.charCodeAt(i));
  17079. }
  17080. return charCodes;
  17081. }
  17082. function getCharType(template, index) {
  17083. return template[index % template.length];
  17084. }
  17085. function getPasswordChar(charType, index) {
  17086. var passwordsChars = {
  17087. V: 'AEIOUY',
  17088. C: 'BCDFGHJKLMNPQRSTVWXZ',
  17089. v: 'aeiouy',
  17090. c: 'bcdfghjklmnpqrstvwxz',
  17091. A: 'AEIOUYBCDFGHJKLMNPQRSTVWXZ',
  17092. a: 'AEIOUYaeiouyBCDFGHJKLMNPQRSTVWXZbcdfghjklmnpqrstvwxz',
  17093. n: '0123456789',
  17094. s: '@&%?,=[]_:-+*$#!\'^~;()/.',
  17095. x: 'AEIOUYaeiouyBCDFGHJKLMNPQRSTVWXZbcdfghjklmnpqrstvwxz0123456789@&%?,=[]_:-+*$#!\'^~;()/.'
  17096. };
  17097. var passwordChar = passwordsChars[charType];
  17098. return passwordChar[index % passwordChar.length];
  17099. }
  17100. function createFingerprint(str) {
  17101. return new Promise(function (resolve) {
  17102. resolve(createHMAC('sha256', new Buffer(str)).digest('hex'))
  17103. });
  17104. }
  17105. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  17106. /***/ },
  17107. /* 177 */
  17108. /***/ function(module, exports, __webpack_require__) {
  17109. var pbkdf2 = __webpack_require__(44);
  17110. var bigInt = __webpack_require__(118);
  17111. module.exports = {
  17112. generatePassword: generatePassword,
  17113. _calcEntropy: calcEntropy,
  17114. _consumeEntropy: consumeEntropy,
  17115. _getSetOfCharacters: getSetOfCharacters,
  17116. _getConfiguredRules: getConfiguredRules,
  17117. _insertStringPseudoRandomly: insertStringPseudoRandomly,
  17118. _getOneCharPerRule: getOneCharPerRule,
  17119. _renderPassword: renderPassword
  17120. };
  17121. function generatePassword(site, login, masterPassword, passwordProfile) {
  17122. return calcEntropy(site, login, masterPassword, passwordProfile).then(function (entropy) {
  17123. return renderPassword(entropy, passwordProfile);
  17124. });
  17125. }
  17126. function calcEntropy(site, login, masterPassword, passwordProfile) {
  17127. var salt = site + login + passwordProfile.counter.toString(16);
  17128. return pbkdf2(masterPassword, salt, passwordProfile.iterations, passwordProfile.keylen, passwordProfile.digest);
  17129. }
  17130. var characterSubsets = {
  17131. lowercase: 'abcdefghijklmnopqrstuvwxyz',
  17132. uppercase: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  17133. numbers: '0123456789',
  17134. symbols: '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
  17135. };
  17136. function getSetOfCharacters(rules) {
  17137. if (typeof rules === 'undefined') {
  17138. return characterSubsets.lowercase + characterSubsets.uppercase + characterSubsets.numbers + characterSubsets.symbols;
  17139. }
  17140. var setOfChars = '';
  17141. rules.forEach(function (rule) {
  17142. setOfChars += characterSubsets[rule];
  17143. });
  17144. return setOfChars;
  17145. }
  17146. function consumeEntropy(generatedPassword, quotient, setOfCharacters, maxLength) {
  17147. if (generatedPassword.length >= maxLength) {
  17148. return {value: generatedPassword, entropy: quotient};
  17149. }
  17150. var longDivision = quotient.divmod(setOfCharacters.length);
  17151. generatedPassword += setOfCharacters[longDivision.remainder];
  17152. return consumeEntropy(generatedPassword, longDivision.quotient, setOfCharacters, maxLength);
  17153. }
  17154. function insertStringPseudoRandomly(generatedPassword, entropy, string) {
  17155. for (var i = 0; i < string.length; i++) {
  17156. var longDivision = entropy.divmod(generatedPassword.length);
  17157. generatedPassword = generatedPassword.slice(0, longDivision.remainder) + string[i] + generatedPassword.slice(longDivision.remainder);
  17158. entropy = longDivision.quotient;
  17159. }
  17160. return generatedPassword;
  17161. }
  17162. function getOneCharPerRule(entropy, rules) {
  17163. var oneCharPerRules = '';
  17164. rules.forEach(function (rule) {
  17165. var password = consumeEntropy('', entropy, characterSubsets[rule], 1);
  17166. oneCharPerRules += password.value;
  17167. entropy = password.entropy;
  17168. });
  17169. return {value: oneCharPerRules, entropy: entropy};
  17170. }
  17171. function getConfiguredRules(passwordProfile) {
  17172. return ['lowercase', 'uppercase', 'numbers', 'symbols'].filter(function (rule) {
  17173. return passwordProfile[rule];
  17174. });
  17175. }
  17176. function renderPassword(entropy, passwordProfile) {
  17177. var rules = getConfiguredRules(passwordProfile);
  17178. var setOfCharacters = getSetOfCharacters(rules);
  17179. var password = consumeEntropy('', bigInt(entropy, 16), setOfCharacters, passwordProfile.length - rules.length);
  17180. var charactersToAdd = getOneCharPerRule(password.entropy, rules);
  17181. return insertStringPseudoRandomly(password.value, charactersToAdd.entropy, charactersToAdd.value);
  17182. }
  17183. /***/ },
  17184. /* 178 */
  17185. /***/ function(module, exports, __webpack_require__) {
  17186. /* WEBPACK VAR INJECTION */(function(global) {/**
  17187. * lodash (Custom Build) <https://lodash.com/>
  17188. * Build: `lodash modularize exports="npm" -o ./`
  17189. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  17190. * Released under MIT license <https://lodash.com/license>
  17191. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  17192. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  17193. */
  17194. /** Used as the `TypeError` message for "Functions" methods. */
  17195. var FUNC_ERROR_TEXT = 'Expected a function';
  17196. /** Used as references for various `Number` constants. */
  17197. var NAN = 0 / 0;
  17198. /** `Object#toString` result references. */
  17199. var symbolTag = '[object Symbol]';
  17200. /** Used to match leading and trailing whitespace. */
  17201. var reTrim = /^\s+|\s+$/g;
  17202. /** Used to detect bad signed hexadecimal string values. */
  17203. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  17204. /** Used to detect binary string values. */
  17205. var reIsBinary = /^0b[01]+$/i;
  17206. /** Used to detect octal string values. */
  17207. var reIsOctal = /^0o[0-7]+$/i;
  17208. /** Built-in method references without a dependency on `root`. */
  17209. var freeParseInt = parseInt;
  17210. /** Detect free variable `global` from Node.js. */
  17211. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  17212. /** Detect free variable `self`. */
  17213. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  17214. /** Used as a reference to the global object. */
  17215. var root = freeGlobal || freeSelf || Function('return this')();
  17216. /** Used for built-in method references. */
  17217. var objectProto = Object.prototype;
  17218. /**
  17219. * Used to resolve the
  17220. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  17221. * of values.
  17222. */
  17223. var objectToString = objectProto.toString;
  17224. /* Built-in method references for those with the same name as other `lodash` methods. */
  17225. var nativeMax = Math.max,
  17226. nativeMin = Math.min;
  17227. /**
  17228. * Gets the timestamp of the number of milliseconds that have elapsed since
  17229. * the Unix epoch (1 January 1970 00:00:00 UTC).
  17230. *
  17231. * @static
  17232. * @memberOf _
  17233. * @since 2.4.0
  17234. * @category Date
  17235. * @returns {number} Returns the timestamp.
  17236. * @example
  17237. *
  17238. * _.defer(function(stamp) {
  17239. * console.log(_.now() - stamp);
  17240. * }, _.now());
  17241. * // => Logs the number of milliseconds it took for the deferred invocation.
  17242. */
  17243. var now = function() {
  17244. return root.Date.now();
  17245. };
  17246. /**
  17247. * Creates a debounced function that delays invoking `func` until after `wait`
  17248. * milliseconds have elapsed since the last time the debounced function was
  17249. * invoked. The debounced function comes with a `cancel` method to cancel
  17250. * delayed `func` invocations and a `flush` method to immediately invoke them.
  17251. * Provide `options` to indicate whether `func` should be invoked on the
  17252. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  17253. * with the last arguments provided to the debounced function. Subsequent
  17254. * calls to the debounced function return the result of the last `func`
  17255. * invocation.
  17256. *
  17257. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  17258. * invoked on the trailing edge of the timeout only if the debounced function
  17259. * is invoked more than once during the `wait` timeout.
  17260. *
  17261. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  17262. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  17263. *
  17264. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  17265. * for details over the differences between `_.debounce` and `_.throttle`.
  17266. *
  17267. * @static
  17268. * @memberOf _
  17269. * @since 0.1.0
  17270. * @category Function
  17271. * @param {Function} func The function to debounce.
  17272. * @param {number} [wait=0] The number of milliseconds to delay.
  17273. * @param {Object} [options={}] The options object.
  17274. * @param {boolean} [options.leading=false]
  17275. * Specify invoking on the leading edge of the timeout.
  17276. * @param {number} [options.maxWait]
  17277. * The maximum time `func` is allowed to be delayed before it's invoked.
  17278. * @param {boolean} [options.trailing=true]
  17279. * Specify invoking on the trailing edge of the timeout.
  17280. * @returns {Function} Returns the new debounced function.
  17281. * @example
  17282. *
  17283. * // Avoid costly calculations while the window size is in flux.
  17284. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  17285. *
  17286. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  17287. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  17288. * 'leading': true,
  17289. * 'trailing': false
  17290. * }));
  17291. *
  17292. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  17293. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  17294. * var source = new EventSource('/stream');
  17295. * jQuery(source).on('message', debounced);
  17296. *
  17297. * // Cancel the trailing debounced invocation.
  17298. * jQuery(window).on('popstate', debounced.cancel);
  17299. */
  17300. function debounce(func, wait, options) {
  17301. var lastArgs,
  17302. lastThis,
  17303. maxWait,
  17304. result,
  17305. timerId,
  17306. lastCallTime,
  17307. lastInvokeTime = 0,
  17308. leading = false,
  17309. maxing = false,
  17310. trailing = true;
  17311. if (typeof func != 'function') {
  17312. throw new TypeError(FUNC_ERROR_TEXT);
  17313. }
  17314. wait = toNumber(wait) || 0;
  17315. if (isObject(options)) {
  17316. leading = !!options.leading;
  17317. maxing = 'maxWait' in options;
  17318. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  17319. trailing = 'trailing' in options ? !!options.trailing : trailing;
  17320. }
  17321. function invokeFunc(time) {
  17322. var args = lastArgs,
  17323. thisArg = lastThis;
  17324. lastArgs = lastThis = undefined;
  17325. lastInvokeTime = time;
  17326. result = func.apply(thisArg, args);
  17327. return result;
  17328. }
  17329. function leadingEdge(time) {
  17330. // Reset any `maxWait` timer.
  17331. lastInvokeTime = time;
  17332. // Start the timer for the trailing edge.
  17333. timerId = setTimeout(timerExpired, wait);
  17334. // Invoke the leading edge.
  17335. return leading ? invokeFunc(time) : result;
  17336. }
  17337. function remainingWait(time) {
  17338. var timeSinceLastCall = time - lastCallTime,
  17339. timeSinceLastInvoke = time - lastInvokeTime,
  17340. result = wait - timeSinceLastCall;
  17341. return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
  17342. }
  17343. function shouldInvoke(time) {
  17344. var timeSinceLastCall = time - lastCallTime,
  17345. timeSinceLastInvoke = time - lastInvokeTime;
  17346. // Either this is the first call, activity has stopped and we're at the
  17347. // trailing edge, the system time has gone backwards and we're treating
  17348. // it as the trailing edge, or we've hit the `maxWait` limit.
  17349. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  17350. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  17351. }
  17352. function timerExpired() {
  17353. var time = now();
  17354. if (shouldInvoke(time)) {
  17355. return trailingEdge(time);
  17356. }
  17357. // Restart the timer.
  17358. timerId = setTimeout(timerExpired, remainingWait(time));
  17359. }
  17360. function trailingEdge(time) {
  17361. timerId = undefined;
  17362. // Only invoke if we have `lastArgs` which means `func` has been
  17363. // debounced at least once.
  17364. if (trailing && lastArgs) {
  17365. return invokeFunc(time);
  17366. }
  17367. lastArgs = lastThis = undefined;
  17368. return result;
  17369. }
  17370. function cancel() {
  17371. if (timerId !== undefined) {
  17372. clearTimeout(timerId);
  17373. }
  17374. lastInvokeTime = 0;
  17375. lastArgs = lastCallTime = lastThis = timerId = undefined;
  17376. }
  17377. function flush() {
  17378. return timerId === undefined ? result : trailingEdge(now());
  17379. }
  17380. function debounced() {
  17381. var time = now(),
  17382. isInvoking = shouldInvoke(time);
  17383. lastArgs = arguments;
  17384. lastThis = this;
  17385. lastCallTime = time;
  17386. if (isInvoking) {
  17387. if (timerId === undefined) {
  17388. return leadingEdge(lastCallTime);
  17389. }
  17390. if (maxing) {
  17391. // Handle invocations in a tight loop.
  17392. timerId = setTimeout(timerExpired, wait);
  17393. return invokeFunc(lastCallTime);
  17394. }
  17395. }
  17396. if (timerId === undefined) {
  17397. timerId = setTimeout(timerExpired, wait);
  17398. }
  17399. return result;
  17400. }
  17401. debounced.cancel = cancel;
  17402. debounced.flush = flush;
  17403. return debounced;
  17404. }
  17405. /**
  17406. * Checks if `value` is the
  17407. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  17408. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  17409. *
  17410. * @static
  17411. * @memberOf _
  17412. * @since 0.1.0
  17413. * @category Lang
  17414. * @param {*} value The value to check.
  17415. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  17416. * @example
  17417. *
  17418. * _.isObject({});
  17419. * // => true
  17420. *
  17421. * _.isObject([1, 2, 3]);
  17422. * // => true
  17423. *
  17424. * _.isObject(_.noop);
  17425. * // => true
  17426. *
  17427. * _.isObject(null);
  17428. * // => false
  17429. */
  17430. function isObject(value) {
  17431. var type = typeof value;
  17432. return !!value && (type == 'object' || type == 'function');
  17433. }
  17434. /**
  17435. * Checks if `value` is object-like. A value is object-like if it's not `null`
  17436. * and has a `typeof` result of "object".
  17437. *
  17438. * @static
  17439. * @memberOf _
  17440. * @since 4.0.0
  17441. * @category Lang
  17442. * @param {*} value The value to check.
  17443. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  17444. * @example
  17445. *
  17446. * _.isObjectLike({});
  17447. * // => true
  17448. *
  17449. * _.isObjectLike([1, 2, 3]);
  17450. * // => true
  17451. *
  17452. * _.isObjectLike(_.noop);
  17453. * // => false
  17454. *
  17455. * _.isObjectLike(null);
  17456. * // => false
  17457. */
  17458. function isObjectLike(value) {
  17459. return !!value && typeof value == 'object';
  17460. }
  17461. /**
  17462. * Checks if `value` is classified as a `Symbol` primitive or object.
  17463. *
  17464. * @static
  17465. * @memberOf _
  17466. * @since 4.0.0
  17467. * @category Lang
  17468. * @param {*} value The value to check.
  17469. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  17470. * @example
  17471. *
  17472. * _.isSymbol(Symbol.iterator);
  17473. * // => true
  17474. *
  17475. * _.isSymbol('abc');
  17476. * // => false
  17477. */
  17478. function isSymbol(value) {
  17479. return typeof value == 'symbol' ||
  17480. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  17481. }
  17482. /**
  17483. * Converts `value` to a number.
  17484. *
  17485. * @static
  17486. * @memberOf _
  17487. * @since 4.0.0
  17488. * @category Lang
  17489. * @param {*} value The value to process.
  17490. * @returns {number} Returns the number.
  17491. * @example
  17492. *
  17493. * _.toNumber(3.2);
  17494. * // => 3.2
  17495. *
  17496. * _.toNumber(Number.MIN_VALUE);
  17497. * // => 5e-324
  17498. *
  17499. * _.toNumber(Infinity);
  17500. * // => Infinity
  17501. *
  17502. * _.toNumber('3.2');
  17503. * // => 3.2
  17504. */
  17505. function toNumber(value) {
  17506. if (typeof value == 'number') {
  17507. return value;
  17508. }
  17509. if (isSymbol(value)) {
  17510. return NAN;
  17511. }
  17512. if (isObject(value)) {
  17513. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  17514. value = isObject(other) ? (other + '') : other;
  17515. }
  17516. if (typeof value != 'string') {
  17517. return value === 0 ? value : +value;
  17518. }
  17519. value = value.replace(reTrim, '');
  17520. var isBinary = reIsBinary.test(value);
  17521. return (isBinary || reIsOctal.test(value))
  17522. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  17523. : (reIsBadHex.test(value) ? NAN : +value);
  17524. }
  17525. module.exports = debounce;
  17526. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22)))
  17527. /***/ },
  17528. /* 179 */
  17529. /***/ function(module, exports) {
  17530. "use strict";
  17531. 'use strict';
  17532. /* eslint-disable no-unused-vars */
  17533. var hasOwnProperty = Object.prototype.hasOwnProperty;
  17534. var propIsEnumerable = Object.prototype.propertyIsEnumerable;
  17535. function toObject(val) {
  17536. if (val === null || val === undefined) {
  17537. throw new TypeError('Object.assign cannot be called with null or undefined');
  17538. }
  17539. return Object(val);
  17540. }
  17541. function shouldUseNative() {
  17542. try {
  17543. if (!Object.assign) {
  17544. return false;
  17545. }
  17546. // Detect buggy property enumeration order in older V8 versions.
  17547. // https://bugs.chromium.org/p/v8/issues/detail?id=4118
  17548. var test1 = new String('abc'); // eslint-disable-line
  17549. test1[5] = 'de';
  17550. if (Object.getOwnPropertyNames(test1)[0] === '5') {
  17551. return false;
  17552. }
  17553. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  17554. var test2 = {};
  17555. for (var i = 0; i < 10; i++) {
  17556. test2['_' + String.fromCharCode(i)] = i;
  17557. }
  17558. var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
  17559. return test2[n];
  17560. });
  17561. if (order2.join('') !== '0123456789') {
  17562. return false;
  17563. }
  17564. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  17565. var test3 = {};
  17566. 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
  17567. test3[letter] = letter;
  17568. });
  17569. if (Object.keys(Object.assign({}, test3)).join('') !==
  17570. 'abcdefghijklmnopqrst') {
  17571. return false;
  17572. }
  17573. return true;
  17574. } catch (e) {
  17575. // We don't expect any of the above to throw, but better to be safe.
  17576. return false;
  17577. }
  17578. }
  17579. module.exports = shouldUseNative() ? Object.assign : function (target, source) {
  17580. var from;
  17581. var to = toObject(target);
  17582. var symbols;
  17583. for (var s = 1; s < arguments.length; s++) {
  17584. from = Object(arguments[s]);
  17585. for (var key in from) {
  17586. if (hasOwnProperty.call(from, key)) {
  17587. to[key] = from[key];
  17588. }
  17589. }
  17590. if (Object.getOwnPropertySymbols) {
  17591. symbols = Object.getOwnPropertySymbols(from);
  17592. for (var i = 0; i < symbols.length; i++) {
  17593. if (propIsEnumerable.call(from, symbols[i])) {
  17594. to[symbols[i]] = from[symbols[i]];
  17595. }
  17596. }
  17597. }
  17598. }
  17599. return to;
  17600. };
  17601. /***/ },
  17602. /* 180 */
  17603. /***/ function(module, exports, __webpack_require__) {
  17604. /* WEBPACK VAR INJECTION */(function(process, Buffer) {var createHmac = __webpack_require__(72)
  17605. var checkParameters = __webpack_require__(181)
  17606. exports.pbkdf2 = function (password, salt, iterations, keylen, digest, callback) {
  17607. if (typeof digest === 'function') {
  17608. callback = digest
  17609. digest = undefined
  17610. }
  17611. checkParameters(iterations, keylen)
  17612. if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2')
  17613. setTimeout(function () {
  17614. callback(null, exports.pbkdf2Sync(password, salt, iterations, keylen, digest))
  17615. })
  17616. }
  17617. var defaultEncoding
  17618. if (process.browser) {
  17619. defaultEncoding = 'utf-8'
  17620. } else {
  17621. var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)
  17622. defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'
  17623. }
  17624. exports.pbkdf2Sync = function (password, salt, iterations, keylen, digest) {
  17625. if (!Buffer.isBuffer(password)) password = new Buffer(password, defaultEncoding)
  17626. if (!Buffer.isBuffer(salt)) salt = new Buffer(salt, defaultEncoding)
  17627. checkParameters(iterations, keylen)
  17628. digest = digest || 'sha1'
  17629. var hLen
  17630. var l = 1
  17631. var DK = new Buffer(keylen)
  17632. var block1 = new Buffer(salt.length + 4)
  17633. salt.copy(block1, 0, 0, salt.length)
  17634. var r
  17635. var T
  17636. for (var i = 1; i <= l; i++) {
  17637. block1.writeUInt32BE(i, salt.length)
  17638. var U = createHmac(digest, password).update(block1).digest()
  17639. if (!hLen) {
  17640. hLen = U.length
  17641. T = new Buffer(hLen)
  17642. l = Math.ceil(keylen / hLen)
  17643. r = keylen - (l - 1) * hLen
  17644. }
  17645. U.copy(T, 0, 0, hLen)
  17646. for (var j = 1; j < iterations; j++) {
  17647. U = createHmac(digest, password).update(U).digest()
  17648. for (var k = 0; k < hLen; k++) T[k] ^= U[k]
  17649. }
  17650. var destPos = (i - 1) * hLen
  17651. var len = (i === l ? r : hLen)
  17652. T.copy(DK, destPos, 0, len)
  17653. }
  17654. return DK
  17655. }
  17656. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(0).Buffer))
  17657. /***/ },
  17658. /* 181 */
  17659. /***/ function(module, exports) {
  17660. var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs
  17661. module.exports = function (iterations, keylen) {
  17662. if (typeof iterations !== 'number') {
  17663. throw new TypeError('Iterations not a number')
  17664. }
  17665. if (iterations < 0) {
  17666. throw new TypeError('Bad iterations')
  17667. }
  17668. if (typeof keylen !== 'number') {
  17669. throw new TypeError('Key length not a number')
  17670. }
  17671. if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */
  17672. throw new TypeError('Bad key length')
  17673. }
  17674. }
  17675. /***/ },
  17676. /* 182 */
  17677. /***/ function(module, exports, __webpack_require__) {
  17678. "use strict";
  17679. /* WEBPACK VAR INJECTION */(function(global, setImmediate) {'use strict';
  17680. var PENDING = 'pending';
  17681. var SETTLED = 'settled';
  17682. var FULFILLED = 'fulfilled';
  17683. var REJECTED = 'rejected';
  17684. var NOOP = function () {};
  17685. var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function';
  17686. var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate;
  17687. var asyncQueue = [];
  17688. var asyncTimer;
  17689. function asyncFlush() {
  17690. // run promise callbacks
  17691. for (var i = 0; i < asyncQueue.length; i++) {
  17692. asyncQueue[i][0](asyncQueue[i][1]);
  17693. }
  17694. // reset async asyncQueue
  17695. asyncQueue = [];
  17696. asyncTimer = false;
  17697. }
  17698. function asyncCall(callback, arg) {
  17699. asyncQueue.push([callback, arg]);
  17700. if (!asyncTimer) {
  17701. asyncTimer = true;
  17702. asyncSetTimer(asyncFlush, 0);
  17703. }
  17704. }
  17705. function invokeResolver(resolver, promise) {
  17706. function resolvePromise(value) {
  17707. resolve(promise, value);
  17708. }
  17709. function rejectPromise(reason) {
  17710. reject(promise, reason);
  17711. }
  17712. try {
  17713. resolver(resolvePromise, rejectPromise);
  17714. } catch (e) {
  17715. rejectPromise(e);
  17716. }
  17717. }
  17718. function invokeCallback(subscriber) {
  17719. var owner = subscriber.owner;
  17720. var settled = owner._state;
  17721. var value = owner._data;
  17722. var callback = subscriber[settled];
  17723. var promise = subscriber.then;
  17724. if (typeof callback === 'function') {
  17725. settled = FULFILLED;
  17726. try {
  17727. value = callback(value);
  17728. } catch (e) {
  17729. reject(promise, e);
  17730. }
  17731. }
  17732. if (!handleThenable(promise, value)) {
  17733. if (settled === FULFILLED) {
  17734. resolve(promise, value);
  17735. }
  17736. if (settled === REJECTED) {
  17737. reject(promise, value);
  17738. }
  17739. }
  17740. }
  17741. function handleThenable(promise, value) {
  17742. var resolved;
  17743. try {
  17744. if (promise === value) {
  17745. throw new TypeError('A promises callback cannot return that same promise.');
  17746. }
  17747. if (value && (typeof value === 'function' || typeof value === 'object')) {
  17748. // then should be retrieved only once
  17749. var then = value.then;
  17750. if (typeof then === 'function') {
  17751. then.call(value, function (val) {
  17752. if (!resolved) {
  17753. resolved = true;
  17754. if (value === val) {
  17755. fulfill(promise, val);
  17756. } else {
  17757. resolve(promise, val);
  17758. }
  17759. }
  17760. }, function (reason) {
  17761. if (!resolved) {
  17762. resolved = true;
  17763. reject(promise, reason);
  17764. }
  17765. });
  17766. return true;
  17767. }
  17768. }
  17769. } catch (e) {
  17770. if (!resolved) {
  17771. reject(promise, e);
  17772. }
  17773. return true;
  17774. }
  17775. return false;
  17776. }
  17777. function resolve(promise, value) {
  17778. if (promise === value || !handleThenable(promise, value)) {
  17779. fulfill(promise, value);
  17780. }
  17781. }
  17782. function fulfill(promise, value) {
  17783. if (promise._state === PENDING) {
  17784. promise._state = SETTLED;
  17785. promise._data = value;
  17786. asyncCall(publishFulfillment, promise);
  17787. }
  17788. }
  17789. function reject(promise, reason) {
  17790. if (promise._state === PENDING) {
  17791. promise._state = SETTLED;
  17792. promise._data = reason;
  17793. asyncCall(publishRejection, promise);
  17794. }
  17795. }
  17796. function publish(promise) {
  17797. promise._then = promise._then.forEach(invokeCallback);
  17798. }
  17799. function publishFulfillment(promise) {
  17800. promise._state = FULFILLED;
  17801. publish(promise);
  17802. }
  17803. function publishRejection(promise) {
  17804. promise._state = REJECTED;
  17805. publish(promise);
  17806. if (!promise._handled && isNode) {
  17807. global.process.emit('unhandledRejection', promise._data, promise);
  17808. }
  17809. }
  17810. function notifyRejectionHandled(promise) {
  17811. global.process.emit('rejectionHandled', promise);
  17812. }
  17813. /**
  17814. * @class
  17815. */
  17816. function Promise(resolver) {
  17817. if (typeof resolver !== 'function') {
  17818. throw new TypeError('Promise resolver ' + resolver + ' is not a function');
  17819. }
  17820. if (this instanceof Promise === false) {
  17821. throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.');
  17822. }
  17823. this._then = [];
  17824. invokeResolver(resolver, this);
  17825. }
  17826. Promise.prototype = {
  17827. constructor: Promise,
  17828. _state: PENDING,
  17829. _then: null,
  17830. _data: undefined,
  17831. _handled: false,
  17832. then: function (onFulfillment, onRejection) {
  17833. var subscriber = {
  17834. owner: this,
  17835. then: new this.constructor(NOOP),
  17836. fulfilled: onFulfillment,
  17837. rejected: onRejection
  17838. };
  17839. if ((onRejection || onFulfillment) && !this._handled) {
  17840. this._handled = true;
  17841. if (this._state === REJECTED && isNode) {
  17842. asyncCall(notifyRejectionHandled, this);
  17843. }
  17844. }
  17845. if (this._state === FULFILLED || this._state === REJECTED) {
  17846. // already resolved, call callback async
  17847. asyncCall(invokeCallback, subscriber);
  17848. } else {
  17849. // subscribe
  17850. this._then.push(subscriber);
  17851. }
  17852. return subscriber.then;
  17853. },
  17854. catch: function (onRejection) {
  17855. return this.then(null, onRejection);
  17856. }
  17857. };
  17858. Promise.all = function (promises) {
  17859. if (!Array.isArray(promises)) {
  17860. throw new TypeError('You must pass an array to Promise.all().');
  17861. }
  17862. return new Promise(function (resolve, reject) {
  17863. var results = [];
  17864. var remaining = 0;
  17865. function resolver(index) {
  17866. remaining++;
  17867. return function (value) {
  17868. results[index] = value;
  17869. if (!--remaining) {
  17870. resolve(results);
  17871. }
  17872. };
  17873. }
  17874. for (var i = 0, promise; i < promises.length; i++) {
  17875. promise = promises[i];
  17876. if (promise && typeof promise.then === 'function') {
  17877. promise.then(resolver(i), reject);
  17878. } else {
  17879. results[i] = promise;
  17880. }
  17881. }
  17882. if (!remaining) {
  17883. resolve(results);
  17884. }
  17885. });
  17886. };
  17887. Promise.race = function (promises) {
  17888. if (!Array.isArray(promises)) {
  17889. throw new TypeError('You must pass an array to Promise.race().');
  17890. }
  17891. return new Promise(function (resolve, reject) {
  17892. for (var i = 0, promise; i < promises.length; i++) {
  17893. promise = promises[i];
  17894. if (promise && typeof promise.then === 'function') {
  17895. promise.then(resolve, reject);
  17896. } else {
  17897. resolve(promise);
  17898. }
  17899. }
  17900. });
  17901. };
  17902. Promise.resolve = function (value) {
  17903. if (value && typeof value === 'object' && value.constructor === Promise) {
  17904. return value;
  17905. }
  17906. return new Promise(function (resolve) {
  17907. resolve(value);
  17908. });
  17909. };
  17910. Promise.reject = function (reason) {
  17911. return new Promise(function (resolve, reject) {
  17912. reject(reason);
  17913. });
  17914. };
  17915. module.exports = Promise;
  17916. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22), __webpack_require__(31).setImmediate))
  17917. /***/ },
  17918. /* 183 */
  17919. /***/ function(module, exports, __webpack_require__) {
  17920. module.exports = __webpack_require__(7)
  17921. /***/ },
  17922. /* 184 */
  17923. /***/ function(module, exports, __webpack_require__) {
  17924. "use strict";
  17925. 'use strict';
  17926. var Buffer = __webpack_require__(0).Buffer;
  17927. /*<replacement>*/
  17928. var bufferShim = __webpack_require__(34);
  17929. /*</replacement>*/
  17930. module.exports = BufferList;
  17931. function BufferList() {
  17932. this.head = null;
  17933. this.tail = null;
  17934. this.length = 0;
  17935. }
  17936. BufferList.prototype.push = function (v) {
  17937. var entry = { data: v, next: null };
  17938. if (this.length > 0) this.tail.next = entry;else this.head = entry;
  17939. this.tail = entry;
  17940. ++this.length;
  17941. };
  17942. BufferList.prototype.unshift = function (v) {
  17943. var entry = { data: v, next: this.head };
  17944. if (this.length === 0) this.tail = entry;
  17945. this.head = entry;
  17946. ++this.length;
  17947. };
  17948. BufferList.prototype.shift = function () {
  17949. if (this.length === 0) return;
  17950. var ret = this.head.data;
  17951. if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
  17952. --this.length;
  17953. return ret;
  17954. };
  17955. BufferList.prototype.clear = function () {
  17956. this.head = this.tail = null;
  17957. this.length = 0;
  17958. };
  17959. BufferList.prototype.join = function (s) {
  17960. if (this.length === 0) return '';
  17961. var p = this.head;
  17962. var ret = '' + p.data;
  17963. while (p = p.next) {
  17964. ret += s + p.data;
  17965. }return ret;
  17966. };
  17967. BufferList.prototype.concat = function (n) {
  17968. if (this.length === 0) return bufferShim.alloc(0);
  17969. if (this.length === 1) return this.head.data;
  17970. var ret = bufferShim.allocUnsafe(n >>> 0);
  17971. var p = this.head;
  17972. var i = 0;
  17973. while (p) {
  17974. p.data.copy(ret, i);
  17975. i += p.data.length;
  17976. p = p.next;
  17977. }
  17978. return ret;
  17979. };
  17980. /***/ },
  17981. /* 185 */
  17982. /***/ function(module, exports, __webpack_require__) {
  17983. module.exports = __webpack_require__(75)
  17984. /***/ },
  17985. /* 186 */
  17986. /***/ function(module, exports, __webpack_require__) {
  17987. /* WEBPACK VAR INJECTION */(function(process) {var Stream = (function (){
  17988. try {
  17989. return __webpack_require__(20); // hack to fix a circular dependency issue when used with browserify
  17990. } catch(_){}
  17991. }());
  17992. exports = module.exports = __webpack_require__(76);
  17993. exports.Stream = Stream || exports;
  17994. exports.Readable = exports;
  17995. exports.Writable = __webpack_require__(47);
  17996. exports.Duplex = __webpack_require__(7);
  17997. exports.Transform = __webpack_require__(46);
  17998. exports.PassThrough = __webpack_require__(75);
  17999. if (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) {
  18000. module.exports = Stream;
  18001. }
  18002. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  18003. /***/ },
  18004. /* 187 */
  18005. /***/ function(module, exports, __webpack_require__) {
  18006. module.exports = __webpack_require__(46)
  18007. /***/ },
  18008. /* 188 */
  18009. /***/ function(module, exports, __webpack_require__) {
  18010. module.exports = __webpack_require__(47)
  18011. /***/ },
  18012. /* 189 */
  18013. /***/ function(module, exports, __webpack_require__) {
  18014. /* WEBPACK VAR INJECTION */(function(Buffer) {/*
  18015. CryptoJS v3.1.2
  18016. code.google.com/p/crypto-js
  18017. (c) 2009-2013 by Jeff Mott. All rights reserved.
  18018. code.google.com/p/crypto-js/wiki/License
  18019. */
  18020. /** @preserve
  18021. (c) 2012 by Cédric Mesnil. All rights reserved.
  18022. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  18023. - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  18024. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  18025. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  18026. */
  18027. // constants table
  18028. var zl = [
  18029. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  18030. 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
  18031. 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
  18032. 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
  18033. 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
  18034. ]
  18035. var zr = [
  18036. 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
  18037. 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
  18038. 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
  18039. 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
  18040. 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
  18041. ]
  18042. var sl = [
  18043. 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
  18044. 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
  18045. 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
  18046. 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
  18047. 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
  18048. ]
  18049. var sr = [
  18050. 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
  18051. 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
  18052. 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
  18053. 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
  18054. 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
  18055. ]
  18056. var hl = [0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]
  18057. var hr = [0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]
  18058. function bytesToWords (bytes) {
  18059. var words = []
  18060. for (var i = 0, b = 0; i < bytes.length; i++, b += 8) {
  18061. words[b >>> 5] |= bytes[i] << (24 - b % 32)
  18062. }
  18063. return words
  18064. }
  18065. function wordsToBytes (words) {
  18066. var bytes = []
  18067. for (var b = 0; b < words.length * 32; b += 8) {
  18068. bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF)
  18069. }
  18070. return bytes
  18071. }
  18072. function processBlock (H, M, offset) {
  18073. // swap endian
  18074. for (var i = 0; i < 16; i++) {
  18075. var offset_i = offset + i
  18076. var M_offset_i = M[offset_i]
  18077. // Swap
  18078. M[offset_i] = (
  18079. (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
  18080. (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
  18081. )
  18082. }
  18083. // Working variables
  18084. var al, bl, cl, dl, el
  18085. var ar, br, cr, dr, er
  18086. ar = al = H[0]
  18087. br = bl = H[1]
  18088. cr = cl = H[2]
  18089. dr = dl = H[3]
  18090. er = el = H[4]
  18091. // computation
  18092. var t
  18093. for (i = 0; i < 80; i += 1) {
  18094. t = (al + M[offset + zl[i]]) | 0
  18095. if (i < 16) {
  18096. t += f1(bl, cl, dl) + hl[0]
  18097. } else if (i < 32) {
  18098. t += f2(bl, cl, dl) + hl[1]
  18099. } else if (i < 48) {
  18100. t += f3(bl, cl, dl) + hl[2]
  18101. } else if (i < 64) {
  18102. t += f4(bl, cl, dl) + hl[3]
  18103. } else {// if (i<80) {
  18104. t += f5(bl, cl, dl) + hl[4]
  18105. }
  18106. t = t | 0
  18107. t = rotl(t, sl[i])
  18108. t = (t + el) | 0
  18109. al = el
  18110. el = dl
  18111. dl = rotl(cl, 10)
  18112. cl = bl
  18113. bl = t
  18114. t = (ar + M[offset + zr[i]]) | 0
  18115. if (i < 16) {
  18116. t += f5(br, cr, dr) + hr[0]
  18117. } else if (i < 32) {
  18118. t += f4(br, cr, dr) + hr[1]
  18119. } else if (i < 48) {
  18120. t += f3(br, cr, dr) + hr[2]
  18121. } else if (i < 64) {
  18122. t += f2(br, cr, dr) + hr[3]
  18123. } else {// if (i<80) {
  18124. t += f1(br, cr, dr) + hr[4]
  18125. }
  18126. t = t | 0
  18127. t = rotl(t, sr[i])
  18128. t = (t + er) | 0
  18129. ar = er
  18130. er = dr
  18131. dr = rotl(cr, 10)
  18132. cr = br
  18133. br = t
  18134. }
  18135. // intermediate hash value
  18136. t = (H[1] + cl + dr) | 0
  18137. H[1] = (H[2] + dl + er) | 0
  18138. H[2] = (H[3] + el + ar) | 0
  18139. H[3] = (H[4] + al + br) | 0
  18140. H[4] = (H[0] + bl + cr) | 0
  18141. H[0] = t
  18142. }
  18143. function f1 (x, y, z) {
  18144. return ((x) ^ (y) ^ (z))
  18145. }
  18146. function f2 (x, y, z) {
  18147. return (((x) & (y)) | ((~x) & (z)))
  18148. }
  18149. function f3 (x, y, z) {
  18150. return (((x) | (~(y))) ^ (z))
  18151. }
  18152. function f4 (x, y, z) {
  18153. return (((x) & (z)) | ((y) & (~(z))))
  18154. }
  18155. function f5 (x, y, z) {
  18156. return ((x) ^ ((y) | (~(z))))
  18157. }
  18158. function rotl (x, n) {
  18159. return (x << n) | (x >>> (32 - n))
  18160. }
  18161. function ripemd160 (message) {
  18162. var H = [0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]
  18163. if (typeof message === 'string') {
  18164. message = new Buffer(message, 'utf8')
  18165. }
  18166. var m = bytesToWords(message)
  18167. var nBitsLeft = message.length * 8
  18168. var nBitsTotal = message.length * 8
  18169. // Add padding
  18170. m[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32)
  18171. m[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
  18172. (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |
  18173. (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)
  18174. )
  18175. for (var i = 0; i < m.length; i += 16) {
  18176. processBlock(H, m, i)
  18177. }
  18178. // swap endian
  18179. for (i = 0; i < 5; i++) {
  18180. // shortcut
  18181. var H_i = H[i]
  18182. // Swap
  18183. H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
  18184. (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00)
  18185. }
  18186. var digestbytes = wordsToBytes(H)
  18187. return new Buffer(digestbytes)
  18188. }
  18189. module.exports = ripemd160
  18190. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  18191. /***/ },
  18192. /* 190 */
  18193. /***/ function(module, exports) {
  18194. function select(element) {
  18195. var selectedText;
  18196. if (element.nodeName === 'SELECT') {
  18197. element.focus();
  18198. selectedText = element.value;
  18199. }
  18200. else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
  18201. element.focus();
  18202. element.setSelectionRange(0, element.value.length);
  18203. selectedText = element.value;
  18204. }
  18205. else {
  18206. if (element.hasAttribute('contenteditable')) {
  18207. element.focus();
  18208. }
  18209. var selection = window.getSelection();
  18210. var range = document.createRange();
  18211. range.selectNodeContents(element);
  18212. selection.removeAllRanges();
  18213. selection.addRange(range);
  18214. selectedText = selection.toString();
  18215. }
  18216. return selectedText;
  18217. }
  18218. module.exports = select;
  18219. /***/ },
  18220. /* 191 */
  18221. /***/ function(module, exports, __webpack_require__) {
  18222. var exports = module.exports = function SHA (algorithm) {
  18223. algorithm = algorithm.toLowerCase()
  18224. var Algorithm = exports[algorithm]
  18225. if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')
  18226. return new Algorithm()
  18227. }
  18228. exports.sha = __webpack_require__(192)
  18229. exports.sha1 = __webpack_require__(193)
  18230. exports.sha224 = __webpack_require__(194)
  18231. exports.sha256 = __webpack_require__(77)
  18232. exports.sha384 = __webpack_require__(195)
  18233. exports.sha512 = __webpack_require__(78)
  18234. /***/ },
  18235. /* 192 */
  18236. /***/ function(module, exports, __webpack_require__) {
  18237. /* WEBPACK VAR INJECTION */(function(Buffer) {/*
  18238. * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined
  18239. * in FIPS PUB 180-1
  18240. * This source code is derived from sha1.js of the same repository.
  18241. * The difference between SHA-0 and SHA-1 is just a bitwise rotate left
  18242. * operation was added.
  18243. */
  18244. var inherits = __webpack_require__(1)
  18245. var Hash = __webpack_require__(12)
  18246. var K = [
  18247. 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
  18248. ]
  18249. var W = new Array(80)
  18250. function Sha () {
  18251. this.init()
  18252. this._w = W
  18253. Hash.call(this, 64, 56)
  18254. }
  18255. inherits(Sha, Hash)
  18256. Sha.prototype.init = function () {
  18257. this._a = 0x67452301
  18258. this._b = 0xefcdab89
  18259. this._c = 0x98badcfe
  18260. this._d = 0x10325476
  18261. this._e = 0xc3d2e1f0
  18262. return this
  18263. }
  18264. function rotl5 (num) {
  18265. return (num << 5) | (num >>> 27)
  18266. }
  18267. function rotl30 (num) {
  18268. return (num << 30) | (num >>> 2)
  18269. }
  18270. function ft (s, b, c, d) {
  18271. if (s === 0) return (b & c) | ((~b) & d)
  18272. if (s === 2) return (b & c) | (b & d) | (c & d)
  18273. return b ^ c ^ d
  18274. }
  18275. Sha.prototype._update = function (M) {
  18276. var W = this._w
  18277. var a = this._a | 0
  18278. var b = this._b | 0
  18279. var c = this._c | 0
  18280. var d = this._d | 0
  18281. var e = this._e | 0
  18282. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  18283. for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]
  18284. for (var j = 0; j < 80; ++j) {
  18285. var s = ~~(j / 20)
  18286. var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
  18287. e = d
  18288. d = c
  18289. c = rotl30(b)
  18290. b = a
  18291. a = t
  18292. }
  18293. this._a = (a + this._a) | 0
  18294. this._b = (b + this._b) | 0
  18295. this._c = (c + this._c) | 0
  18296. this._d = (d + this._d) | 0
  18297. this._e = (e + this._e) | 0
  18298. }
  18299. Sha.prototype._hash = function () {
  18300. var H = new Buffer(20)
  18301. H.writeInt32BE(this._a | 0, 0)
  18302. H.writeInt32BE(this._b | 0, 4)
  18303. H.writeInt32BE(this._c | 0, 8)
  18304. H.writeInt32BE(this._d | 0, 12)
  18305. H.writeInt32BE(this._e | 0, 16)
  18306. return H
  18307. }
  18308. module.exports = Sha
  18309. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  18310. /***/ },
  18311. /* 193 */
  18312. /***/ function(module, exports, __webpack_require__) {
  18313. /* WEBPACK VAR INJECTION */(function(Buffer) {/*
  18314. * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
  18315. * in FIPS PUB 180-1
  18316. * Version 2.1a Copyright Paul Johnston 2000 - 2002.
  18317. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  18318. * Distributed under the BSD License
  18319. * See http://pajhome.org.uk/crypt/md5 for details.
  18320. */
  18321. var inherits = __webpack_require__(1)
  18322. var Hash = __webpack_require__(12)
  18323. var K = [
  18324. 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
  18325. ]
  18326. var W = new Array(80)
  18327. function Sha1 () {
  18328. this.init()
  18329. this._w = W
  18330. Hash.call(this, 64, 56)
  18331. }
  18332. inherits(Sha1, Hash)
  18333. Sha1.prototype.init = function () {
  18334. this._a = 0x67452301
  18335. this._b = 0xefcdab89
  18336. this._c = 0x98badcfe
  18337. this._d = 0x10325476
  18338. this._e = 0xc3d2e1f0
  18339. return this
  18340. }
  18341. function rotl1 (num) {
  18342. return (num << 1) | (num >>> 31)
  18343. }
  18344. function rotl5 (num) {
  18345. return (num << 5) | (num >>> 27)
  18346. }
  18347. function rotl30 (num) {
  18348. return (num << 30) | (num >>> 2)
  18349. }
  18350. function ft (s, b, c, d) {
  18351. if (s === 0) return (b & c) | ((~b) & d)
  18352. if (s === 2) return (b & c) | (b & d) | (c & d)
  18353. return b ^ c ^ d
  18354. }
  18355. Sha1.prototype._update = function (M) {
  18356. var W = this._w
  18357. var a = this._a | 0
  18358. var b = this._b | 0
  18359. var c = this._c | 0
  18360. var d = this._d | 0
  18361. var e = this._e | 0
  18362. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  18363. for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])
  18364. for (var j = 0; j < 80; ++j) {
  18365. var s = ~~(j / 20)
  18366. var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
  18367. e = d
  18368. d = c
  18369. c = rotl30(b)
  18370. b = a
  18371. a = t
  18372. }
  18373. this._a = (a + this._a) | 0
  18374. this._b = (b + this._b) | 0
  18375. this._c = (c + this._c) | 0
  18376. this._d = (d + this._d) | 0
  18377. this._e = (e + this._e) | 0
  18378. }
  18379. Sha1.prototype._hash = function () {
  18380. var H = new Buffer(20)
  18381. H.writeInt32BE(this._a | 0, 0)
  18382. H.writeInt32BE(this._b | 0, 4)
  18383. H.writeInt32BE(this._c | 0, 8)
  18384. H.writeInt32BE(this._d | 0, 12)
  18385. H.writeInt32BE(this._e | 0, 16)
  18386. return H
  18387. }
  18388. module.exports = Sha1
  18389. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  18390. /***/ },
  18391. /* 194 */
  18392. /***/ function(module, exports, __webpack_require__) {
  18393. /* WEBPACK VAR INJECTION */(function(Buffer) {/**
  18394. * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
  18395. * in FIPS 180-2
  18396. * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
  18397. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  18398. *
  18399. */
  18400. var inherits = __webpack_require__(1)
  18401. var Sha256 = __webpack_require__(77)
  18402. var Hash = __webpack_require__(12)
  18403. var W = new Array(64)
  18404. function Sha224 () {
  18405. this.init()
  18406. this._w = W // new Array(64)
  18407. Hash.call(this, 64, 56)
  18408. }
  18409. inherits(Sha224, Sha256)
  18410. Sha224.prototype.init = function () {
  18411. this._a = 0xc1059ed8
  18412. this._b = 0x367cd507
  18413. this._c = 0x3070dd17
  18414. this._d = 0xf70e5939
  18415. this._e = 0xffc00b31
  18416. this._f = 0x68581511
  18417. this._g = 0x64f98fa7
  18418. this._h = 0xbefa4fa4
  18419. return this
  18420. }
  18421. Sha224.prototype._hash = function () {
  18422. var H = new Buffer(28)
  18423. H.writeInt32BE(this._a, 0)
  18424. H.writeInt32BE(this._b, 4)
  18425. H.writeInt32BE(this._c, 8)
  18426. H.writeInt32BE(this._d, 12)
  18427. H.writeInt32BE(this._e, 16)
  18428. H.writeInt32BE(this._f, 20)
  18429. H.writeInt32BE(this._g, 24)
  18430. return H
  18431. }
  18432. module.exports = Sha224
  18433. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  18434. /***/ },
  18435. /* 195 */
  18436. /***/ function(module, exports, __webpack_require__) {
  18437. /* WEBPACK VAR INJECTION */(function(Buffer) {var inherits = __webpack_require__(1)
  18438. var SHA512 = __webpack_require__(78)
  18439. var Hash = __webpack_require__(12)
  18440. var W = new Array(160)
  18441. function Sha384 () {
  18442. this.init()
  18443. this._w = W
  18444. Hash.call(this, 128, 112)
  18445. }
  18446. inherits(Sha384, SHA512)
  18447. Sha384.prototype.init = function () {
  18448. this._ah = 0xcbbb9d5d
  18449. this._bh = 0x629a292a
  18450. this._ch = 0x9159015a
  18451. this._dh = 0x152fecd8
  18452. this._eh = 0x67332667
  18453. this._fh = 0x8eb44a87
  18454. this._gh = 0xdb0c2e0d
  18455. this._hh = 0x47b5481d
  18456. this._al = 0xc1059ed8
  18457. this._bl = 0x367cd507
  18458. this._cl = 0x3070dd17
  18459. this._dl = 0xf70e5939
  18460. this._el = 0xffc00b31
  18461. this._fl = 0x68581511
  18462. this._gl = 0x64f98fa7
  18463. this._hl = 0xbefa4fa4
  18464. return this
  18465. }
  18466. Sha384.prototype._hash = function () {
  18467. var H = new Buffer(48)
  18468. function writeInt64BE (h, l, offset) {
  18469. H.writeInt32BE(h, offset)
  18470. H.writeInt32BE(l, offset + 4)
  18471. }
  18472. writeInt64BE(this._ah, this._al, 0)
  18473. writeInt64BE(this._bh, this._bl, 8)
  18474. writeInt64BE(this._ch, this._cl, 16)
  18475. writeInt64BE(this._dh, this._dl, 24)
  18476. writeInt64BE(this._eh, this._el, 32)
  18477. writeInt64BE(this._fh, this._fl, 40)
  18478. return H
  18479. }
  18480. module.exports = Sha384
  18481. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  18482. /***/ },
  18483. /* 196 */
  18484. /***/ function(module, exports) {
  18485. function E () {
  18486. // Keep this empty so it's easier to inherit from
  18487. // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
  18488. }
  18489. E.prototype = {
  18490. on: function (name, callback, ctx) {
  18491. var e = this.e || (this.e = {});
  18492. (e[name] || (e[name] = [])).push({
  18493. fn: callback,
  18494. ctx: ctx
  18495. });
  18496. return this;
  18497. },
  18498. once: function (name, callback, ctx) {
  18499. var self = this;
  18500. function listener () {
  18501. self.off(name, listener);
  18502. callback.apply(ctx, arguments);
  18503. };
  18504. listener._ = callback
  18505. return this.on(name, listener, ctx);
  18506. },
  18507. emit: function (name) {
  18508. var data = [].slice.call(arguments, 1);
  18509. var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
  18510. var i = 0;
  18511. var len = evtArr.length;
  18512. for (i; i < len; i++) {
  18513. evtArr[i].fn.apply(evtArr[i].ctx, data);
  18514. }
  18515. return this;
  18516. },
  18517. off: function (name, callback) {
  18518. var e = this.e || (this.e = {});
  18519. var evts = e[name];
  18520. var liveEvents = [];
  18521. if (evts && callback) {
  18522. for (var i = 0, len = evts.length; i < len; i++) {
  18523. if (evts[i].fn !== callback && evts[i].fn._ !== callback)
  18524. liveEvents.push(evts[i]);
  18525. }
  18526. }
  18527. // Remove event from queue to prevent memory leak
  18528. // Suggested by https://github.com/lazd
  18529. // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
  18530. (liveEvents.length)
  18531. ? e[name] = liveEvents
  18532. : delete e[name];
  18533. return this;
  18534. }
  18535. };
  18536. module.exports = E;
  18537. /***/ },
  18538. /* 197 */
  18539. /***/ function(module, exports, __webpack_require__) {
  18540. /* WEBPACK VAR INJECTION */(function(global) {
  18541. /**
  18542. * Module exports.
  18543. */
  18544. module.exports = deprecate;
  18545. /**
  18546. * Mark that a method should not be used.
  18547. * Returns a modified function which warns once by default.
  18548. *
  18549. * If `localStorage.noDeprecation = true` is set, then it is a no-op.
  18550. *
  18551. * If `localStorage.throwDeprecation = true` is set, then deprecated functions
  18552. * will throw an Error when invoked.
  18553. *
  18554. * If `localStorage.traceDeprecation = true` is set, then deprecated functions
  18555. * will invoke `console.trace()` instead of `console.error()`.
  18556. *
  18557. * @param {Function} fn - the function to deprecate
  18558. * @param {String} msg - the string to print to the console when `fn` is invoked
  18559. * @returns {Function} a new "deprecated" version of `fn`
  18560. * @api public
  18561. */
  18562. function deprecate (fn, msg) {
  18563. if (config('noDeprecation')) {
  18564. return fn;
  18565. }
  18566. var warned = false;
  18567. function deprecated() {
  18568. if (!warned) {
  18569. if (config('throwDeprecation')) {
  18570. throw new Error(msg);
  18571. } else if (config('traceDeprecation')) {
  18572. console.trace(msg);
  18573. } else {
  18574. console.warn(msg);
  18575. }
  18576. warned = true;
  18577. }
  18578. return fn.apply(this, arguments);
  18579. }
  18580. return deprecated;
  18581. }
  18582. /**
  18583. * Checks `localStorage` for boolean values for the given `name`.
  18584. *
  18585. * @param {String} name
  18586. * @returns {Boolean}
  18587. * @api private
  18588. */
  18589. function config (name) {
  18590. // accessing global.localStorage can trigger a DOMException in sandboxed iframes
  18591. try {
  18592. if (!global.localStorage) return false;
  18593. } catch (_) {
  18594. return false;
  18595. }
  18596. var val = global.localStorage[name];
  18597. if (null == val) return false;
  18598. return String(val).toLowerCase() === 'true';
  18599. }
  18600. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22)))
  18601. /***/ },
  18602. /* 198 */
  18603. /***/ function(module, exports, __webpack_require__) {
  18604. var __vue_exports__, __vue_options__
  18605. var __vue_styles__ = {}
  18606. /* styles */
  18607. __webpack_require__(221)
  18608. /* script */
  18609. __vue_exports__ = __webpack_require__(103)
  18610. /* template */
  18611. var __vue_template__ = __webpack_require__(214)
  18612. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  18613. if (
  18614. typeof __vue_exports__.default === "object" ||
  18615. typeof __vue_exports__.default === "function"
  18616. ) {
  18617. __vue_options__ = __vue_exports__ = __vue_exports__.default
  18618. }
  18619. if (typeof __vue_options__ === "function") {
  18620. __vue_options__ = __vue_options__.options
  18621. }
  18622. __vue_options__.render = __vue_template__.render
  18623. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  18624. module.exports = __vue_exports__
  18625. /***/ },
  18626. /* 199 */
  18627. /***/ function(module, exports, __webpack_require__) {
  18628. var __vue_exports__, __vue_options__
  18629. var __vue_styles__ = {}
  18630. /* styles */
  18631. __webpack_require__(218)
  18632. /* script */
  18633. __vue_exports__ = __webpack_require__(104)
  18634. /* template */
  18635. var __vue_template__ = __webpack_require__(209)
  18636. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  18637. if (
  18638. typeof __vue_exports__.default === "object" ||
  18639. typeof __vue_exports__.default === "function"
  18640. ) {
  18641. __vue_options__ = __vue_exports__ = __vue_exports__.default
  18642. }
  18643. if (typeof __vue_options__ === "function") {
  18644. __vue_options__ = __vue_options__.options
  18645. }
  18646. __vue_options__.render = __vue_template__.render
  18647. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  18648. module.exports = __vue_exports__
  18649. /***/ },
  18650. /* 200 */
  18651. /***/ function(module, exports, __webpack_require__) {
  18652. var __vue_exports__, __vue_options__
  18653. var __vue_styles__ = {}
  18654. /* styles */
  18655. __webpack_require__(222)
  18656. /* script */
  18657. __vue_exports__ = __webpack_require__(105)
  18658. /* template */
  18659. var __vue_template__ = __webpack_require__(216)
  18660. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  18661. if (
  18662. typeof __vue_exports__.default === "object" ||
  18663. typeof __vue_exports__.default === "function"
  18664. ) {
  18665. __vue_options__ = __vue_exports__ = __vue_exports__.default
  18666. }
  18667. if (typeof __vue_options__ === "function") {
  18668. __vue_options__ = __vue_options__.options
  18669. }
  18670. __vue_options__.render = __vue_template__.render
  18671. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  18672. module.exports = __vue_exports__
  18673. /***/ },
  18674. /* 201 */
  18675. /***/ function(module, exports, __webpack_require__) {
  18676. var __vue_exports__, __vue_options__
  18677. var __vue_styles__ = {}
  18678. /* template */
  18679. var __vue_template__ = __webpack_require__(207)
  18680. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  18681. if (
  18682. typeof __vue_exports__.default === "object" ||
  18683. typeof __vue_exports__.default === "function"
  18684. ) {
  18685. __vue_options__ = __vue_exports__ = __vue_exports__.default
  18686. }
  18687. if (typeof __vue_options__ === "function") {
  18688. __vue_options__ = __vue_options__.options
  18689. }
  18690. __vue_options__.render = __vue_template__.render
  18691. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  18692. module.exports = __vue_exports__
  18693. /***/ },
  18694. /* 202 */
  18695. /***/ function(module, exports, __webpack_require__) {
  18696. var __vue_exports__, __vue_options__
  18697. var __vue_styles__ = {}
  18698. /* script */
  18699. __vue_exports__ = __webpack_require__(106)
  18700. /* template */
  18701. var __vue_template__ = __webpack_require__(208)
  18702. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  18703. if (
  18704. typeof __vue_exports__.default === "object" ||
  18705. typeof __vue_exports__.default === "function"
  18706. ) {
  18707. __vue_options__ = __vue_exports__ = __vue_exports__.default
  18708. }
  18709. if (typeof __vue_options__ === "function") {
  18710. __vue_options__ = __vue_options__.options
  18711. }
  18712. __vue_options__.render = __vue_template__.render
  18713. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  18714. module.exports = __vue_exports__
  18715. /***/ },
  18716. /* 203 */
  18717. /***/ function(module, exports, __webpack_require__) {
  18718. var __vue_exports__, __vue_options__
  18719. var __vue_styles__ = {}
  18720. /* styles */
  18721. __webpack_require__(219)
  18722. /* script */
  18723. __vue_exports__ = __webpack_require__(107)
  18724. /* template */
  18725. var __vue_template__ = __webpack_require__(211)
  18726. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  18727. if (
  18728. typeof __vue_exports__.default === "object" ||
  18729. typeof __vue_exports__.default === "function"
  18730. ) {
  18731. __vue_options__ = __vue_exports__ = __vue_exports__.default
  18732. }
  18733. if (typeof __vue_options__ === "function") {
  18734. __vue_options__ = __vue_options__.options
  18735. }
  18736. __vue_options__.render = __vue_template__.render
  18737. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  18738. module.exports = __vue_exports__
  18739. /***/ },
  18740. /* 204 */
  18741. /***/ function(module, exports, __webpack_require__) {
  18742. var __vue_exports__, __vue_options__
  18743. var __vue_styles__ = {}
  18744. /* script */
  18745. __vue_exports__ = __webpack_require__(108)
  18746. /* template */
  18747. var __vue_template__ = __webpack_require__(213)
  18748. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  18749. if (
  18750. typeof __vue_exports__.default === "object" ||
  18751. typeof __vue_exports__.default === "function"
  18752. ) {
  18753. __vue_options__ = __vue_exports__ = __vue_exports__.default
  18754. }
  18755. if (typeof __vue_options__ === "function") {
  18756. __vue_options__ = __vue_options__.options
  18757. }
  18758. __vue_options__.render = __vue_template__.render
  18759. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  18760. module.exports = __vue_exports__
  18761. /***/ },
  18762. /* 205 */
  18763. /***/ function(module, exports, __webpack_require__) {
  18764. var __vue_exports__, __vue_options__
  18765. var __vue_styles__ = {}
  18766. /* script */
  18767. __vue_exports__ = __webpack_require__(109)
  18768. /* template */
  18769. var __vue_template__ = __webpack_require__(215)
  18770. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  18771. if (
  18772. typeof __vue_exports__.default === "object" ||
  18773. typeof __vue_exports__.default === "function"
  18774. ) {
  18775. __vue_options__ = __vue_exports__ = __vue_exports__.default
  18776. }
  18777. if (typeof __vue_options__ === "function") {
  18778. __vue_options__ = __vue_options__.options
  18779. }
  18780. __vue_options__.render = __vue_template__.render
  18781. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  18782. module.exports = __vue_exports__
  18783. /***/ },
  18784. /* 206 */
  18785. /***/ function(module, exports, __webpack_require__) {
  18786. var __vue_exports__, __vue_options__
  18787. var __vue_styles__ = {}
  18788. /* script */
  18789. __vue_exports__ = __webpack_require__(110)
  18790. /* template */
  18791. var __vue_template__ = __webpack_require__(210)
  18792. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  18793. if (
  18794. typeof __vue_exports__.default === "object" ||
  18795. typeof __vue_exports__.default === "function"
  18796. ) {
  18797. __vue_options__ = __vue_exports__ = __vue_exports__.default
  18798. }
  18799. if (typeof __vue_options__ === "function") {
  18800. __vue_options__ = __vue_options__.options
  18801. }
  18802. __vue_options__.render = __vue_template__.render
  18803. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  18804. module.exports = __vue_exports__
  18805. /***/ },
  18806. /* 207 */
  18807. /***/ function(module, exports) {
  18808. module.exports={render:function (){var _vm=this;
  18809. return _vm._m(0)
  18810. },staticRenderFns: [function (){var _vm=this;
  18811. return _vm._h('div', {
  18812. staticStyle: {
  18813. "display": "none"
  18814. }
  18815. }, [_vm._h('label', {
  18816. attrs: {
  18817. "for": "username"
  18818. }
  18819. }, [_vm._h('input', {
  18820. attrs: {
  18821. "type": "text",
  18822. "id": "username",
  18823. "name": "username",
  18824. "autocomplete": "username"
  18825. }
  18826. })]), " ", _vm._h('label', {
  18827. attrs: {
  18828. "for": "password"
  18829. }
  18830. }, [_vm._h('input', {
  18831. attrs: {
  18832. "type": "password",
  18833. "id": "password",
  18834. "name": "password",
  18835. "autocomplete": "current-password"
  18836. }
  18837. })])])
  18838. }]}
  18839. /***/ },
  18840. /* 208 */
  18841. /***/ function(module, exports) {
  18842. module.exports={render:function (){var _vm=this;
  18843. return _vm._h('form', [(_vm.showError) ? _vm._h('div', {
  18844. staticClass: "form-group row"
  18845. }, [_vm._h('div', {
  18846. staticClass: "col-xs-12 text-muted text-danger"
  18847. }, ["\n " + _vm._s(_vm.errorMessage) + "\n "])]) : _vm._e(), " ", _vm._h('div', {
  18848. staticClass: "form-group row"
  18849. }, [_vm._h('div', {
  18850. staticClass: "col-xs-12"
  18851. }, [_vm._h('div', {
  18852. staticClass: "inner-addon left-addon"
  18853. }, [_vm._m(0), " ", _vm._h('input', {
  18854. directives: [{
  18855. name: "model",
  18856. rawName: "v-model",
  18857. value: (_vm.email),
  18858. expression: "email"
  18859. }],
  18860. staticClass: "form-control",
  18861. attrs: {
  18862. "id": "email",
  18863. "name": "login",
  18864. "type": "email",
  18865. "placeholder": "Email",
  18866. "required": ""
  18867. },
  18868. domProps: {
  18869. "value": _vm._s(_vm.email)
  18870. },
  18871. on: {
  18872. "input": function($event) {
  18873. if ($event.target.composing) { return; }
  18874. _vm.email = $event.target.value
  18875. }
  18876. }
  18877. }), " ", _vm._h('small', {
  18878. staticClass: "form-text text-muted text-danger"
  18879. }, [(_vm.errors.userNameAlreadyExist) ? _vm._h('span', ["Someone already use that username. Do you want to sign in ?"]) : _vm._e(), " ", (_vm.errors.emailInvalid) ? _vm._h('span', ["Please enter a valid email"]) : _vm._e(), " ", (_vm.errors.emailRequired) ? _vm._h('span', ["An email is required"]) : _vm._e()])])])]), " ", _vm._h('div', {
  18880. staticClass: "form-group row"
  18881. }, [_vm._h('div', {
  18882. staticClass: "col-xs-12"
  18883. }, [_vm._h('div', {
  18884. staticClass: "inner-addon left-addon"
  18885. }, [_vm._m(1), " ", _vm._h('input', {
  18886. directives: [{
  18887. name: "model",
  18888. rawName: "v-model",
  18889. value: (_vm.password),
  18890. expression: "password"
  18891. }],
  18892. staticClass: "form-control",
  18893. attrs: {
  18894. "id": "password",
  18895. "name": "password",
  18896. "type": "password",
  18897. "required": "",
  18898. "placeholder": "LessPass password"
  18899. },
  18900. domProps: {
  18901. "value": _vm._s(_vm.password)
  18902. },
  18903. on: {
  18904. "input": function($event) {
  18905. if ($event.target.composing) { return; }
  18906. _vm.password = $event.target.value
  18907. }
  18908. }
  18909. }), " ", _vm._h('small', {
  18910. staticClass: "form-text text-muted"
  18911. }, [(_vm.errors.passwordRequired) ? _vm._h('span', {
  18912. staticClass: "text-danger"
  18913. }, ["A password is required"]) : _vm._e(), " ", _vm._h('label', {
  18914. staticClass: "form-check-label"
  18915. }, [_vm._h('input', {
  18916. directives: [{
  18917. name: "model",
  18918. rawName: "v-model",
  18919. value: (_vm.useMasterPassword),
  18920. expression: "useMasterPassword"
  18921. }],
  18922. staticClass: "form-check-input",
  18923. attrs: {
  18924. "type": "checkbox"
  18925. },
  18926. domProps: {
  18927. "checked": Array.isArray(_vm.useMasterPassword) ? _vm._i(_vm.useMasterPassword, null) > -1 : _vm._q(_vm.useMasterPassword, true)
  18928. },
  18929. on: {
  18930. "change": function($event) {
  18931. var $$a = _vm.useMasterPassword,
  18932. $$el = $event.target,
  18933. $$c = $$el.checked ? (true) : (false);
  18934. if (Array.isArray($$a)) {
  18935. var $$v = null,
  18936. $$i = _vm._i($$a, $$v);
  18937. if ($$c) {
  18938. $$i < 0 && (_vm.useMasterPassword = $$a.concat($$v))
  18939. } else {
  18940. $$i > -1 && (_vm.useMasterPassword = $$a.slice(0, $$i).concat($$a.slice($$i + 1)))
  18941. }
  18942. } else {
  18943. _vm.useMasterPassword = $$c
  18944. }
  18945. }
  18946. }
  18947. }), "\n Check me if you want to use your master password here.\n ", _vm._h('span', {
  18948. staticClass: "tag tag-warning",
  18949. on: {
  18950. "click": function($event) {
  18951. $event.preventDefault();
  18952. _vm.seeMasterPasswordHelp = !_vm.seeMasterPasswordHelp
  18953. }
  18954. }
  18955. }, ["\n ?\n "]), " ", (_vm.seeMasterPasswordHelp) ? _vm._h('span', {
  18956. staticClass: "text-warning"
  18957. }, [_vm._m(2), " Your master password ", _vm._m(3), " on a database even encrypted.\n If you want to use your master password here, you can check the option.\n It will replace your master password with a LessPass generated password.\n "]) : _vm._e()])])])])]), " ", _vm._h('div', {
  18958. staticClass: "form-group row"
  18959. }, [_vm._h('div', {
  18960. staticClass: "col-xs-12 hint--bottom",
  18961. attrs: {
  18962. "aria-label": "You can use your self hosted LessPass Database"
  18963. }
  18964. }, [_vm._h('div', {
  18965. staticClass: "inner-addon left-addon"
  18966. }, [_vm._m(4), " ", _vm._h('input', {
  18967. directives: [{
  18968. name: "model",
  18969. rawName: "v-model",
  18970. value: (_vm.baseURL),
  18971. expression: "baseURL"
  18972. }],
  18973. staticClass: "form-control",
  18974. attrs: {
  18975. "id": "baseURL",
  18976. "type": "text",
  18977. "placeholder": "LessPass Database (https://...)"
  18978. },
  18979. domProps: {
  18980. "value": _vm._s(_vm.baseURL)
  18981. },
  18982. on: {
  18983. "input": function($event) {
  18984. if ($event.target.composing) { return; }
  18985. _vm.baseURL = $event.target.value
  18986. }
  18987. }
  18988. }), " ", _vm._h('small', {
  18989. staticClass: "form-text text-muted"
  18990. }, [(_vm.noErrors()) ? _vm._h('span', ["You can use your self hosted LessPass Database"]) : _vm._e(), " ", (_vm.errors.baseURLRequired) ? _vm._h('span', {
  18991. staticClass: "text-danger"
  18992. }, ["\n A LessPass database url is required\n "]) : _vm._e()])])])]), " ", _vm._h('div', {
  18993. staticClass: "form-group row"
  18994. }, [_vm._h('div', {
  18995. staticClass: "col-xs-12"
  18996. }, [_vm._h('button', {
  18997. staticClass: "btn",
  18998. class: {
  18999. 'btn-warning': _vm.version === 1, 'btn-primary': _vm.version === 2
  19000. },
  19001. attrs: {
  19002. "id": "signInButton",
  19003. "type": "button"
  19004. },
  19005. on: {
  19006. "click": _vm.signIn
  19007. }
  19008. }, [(_vm.loadingSignIn) ? _vm._h('span', [_vm._m(5)]) : _vm._e(), "\n Sign In\n "]), " ", _vm._h('button', {
  19009. staticClass: "btn btn-secondary",
  19010. attrs: {
  19011. "id": "registerButton",
  19012. "type": "button"
  19013. },
  19014. on: {
  19015. "click": _vm.register
  19016. }
  19017. }, [(_vm.loadingRegister) ? _vm._h('span', [_vm._m(6)]) : _vm._e(), "\n Register\n "])])]), " ", _vm._h('div', {
  19018. staticClass: "form-group row"
  19019. }, [_vm._h('div', {
  19020. staticClass: "col-xs-12"
  19021. }, [_vm._h('router-link', {
  19022. attrs: {
  19023. "to": {
  19024. name: 'passwordReset'
  19025. }
  19026. }
  19027. }, ["\n Forgot your password?\n "])])])])
  19028. },staticRenderFns: [function (){var _vm=this;
  19029. return _vm._h('i', {
  19030. staticClass: "fa fa-user"
  19031. })
  19032. },function (){var _vm=this;
  19033. return _vm._h('i', {
  19034. staticClass: "fa fa-lock"
  19035. })
  19036. },function (){var _vm=this;
  19037. return _vm._h('br')
  19038. },function (){var _vm=this;
  19039. return _vm._h('b', ["should not be saved"])
  19040. },function (){var _vm=this;
  19041. return _vm._h('i', {
  19042. staticClass: "fa fa-globe"
  19043. })
  19044. },function (){var _vm=this;
  19045. return _vm._h('i', {
  19046. staticClass: "fa fa-spinner fa-pulse fa-fw"
  19047. })
  19048. },function (){var _vm=this;
  19049. return _vm._h('i', {
  19050. staticClass: "fa fa-spinner fa-pulse fa-fw"
  19051. })
  19052. }]}
  19053. /***/ },
  19054. /* 209 */
  19055. /***/ function(module, exports) {
  19056. module.exports={render:function (){var _vm=this;
  19057. return (_vm.fingerprint) ? _vm._h('span', {
  19058. staticClass: "input-group-btn"
  19059. }, [_vm._h('button', {
  19060. staticClass: "btn",
  19061. attrs: {
  19062. "id": "fingerprint",
  19063. "type": "button",
  19064. "tabindex": "-1"
  19065. }
  19066. }, [_vm._h('small', {
  19067. staticClass: "hint--left",
  19068. attrs: {
  19069. "aria-label": "master password fingerprint"
  19070. }
  19071. }, [_vm._h('i', {
  19072. staticClass: "fa fa-fw",
  19073. class: [_vm.icon1],
  19074. style: ({
  19075. color: _vm.color1
  19076. })
  19077. }), " ", _vm._h('i', {
  19078. staticClass: "fa fa-fw",
  19079. class: [_vm.icon2],
  19080. style: ({
  19081. color: _vm.color2
  19082. })
  19083. }), " ", _vm._h('i', {
  19084. staticClass: "fa fa-fw",
  19085. class: [_vm.icon3],
  19086. style: ({
  19087. color: _vm.color3
  19088. })
  19089. })])])]) : _vm._e()
  19090. },staticRenderFns: []}
  19091. /***/ },
  19092. /* 210 */
  19093. /***/ function(module, exports) {
  19094. module.exports={render:function (){var _vm=this;
  19095. return _vm._h('div', [_vm._h('form', [_vm._h('div', {
  19096. staticClass: "form-group row"
  19097. }, [_vm._h('div', {
  19098. staticClass: "col-xs-12"
  19099. }, [_vm._h('div', {
  19100. staticClass: "inner-addon left-addon"
  19101. }, [_vm._m(0), " ", _vm._h('input', {
  19102. directives: [{
  19103. name: "model",
  19104. rawName: "v-model",
  19105. value: (_vm.searchQuery),
  19106. expression: "searchQuery"
  19107. }],
  19108. staticClass: "form-control",
  19109. attrs: {
  19110. "name": "search",
  19111. "placeholder": "Search"
  19112. },
  19113. domProps: {
  19114. "value": _vm._s(_vm.searchQuery)
  19115. },
  19116. on: {
  19117. "input": function($event) {
  19118. if ($event.target.composing) { return; }
  19119. _vm.searchQuery = $event.target.value
  19120. }
  19121. }
  19122. })])])])]), " ", _vm._h('div', {
  19123. attrs: {
  19124. "id": "passwords"
  19125. }
  19126. }, [_vm._l((_vm.filteredPasswords), function(password) {
  19127. return _vm._h('div', {
  19128. staticClass: "row"
  19129. }, [_vm._h('div', {
  19130. staticClass: "col-xs-9"
  19131. }, [_vm._h('ul', {
  19132. staticClass: "list-unstyled"
  19133. }, [_vm._h('li', [_vm._h('router-link', {
  19134. attrs: {
  19135. "to": {
  19136. name: 'password',
  19137. params: {
  19138. id: password.id
  19139. }
  19140. }
  19141. }
  19142. }, ["\n " + _vm._s(password.site) + "\n "])]), " ", _vm._h('li', ["\n " + _vm._s(password.login) + "\n "])])]), " ", _vm._h('div', {
  19143. staticClass: "col-xs-3"
  19144. }, [_vm._h('delete-button', {
  19145. staticClass: "float-xs-right",
  19146. staticStyle: {
  19147. "position": "absolute",
  19148. "right": "1em",
  19149. "margin-top": "3px"
  19150. },
  19151. attrs: {
  19152. "action": _vm.deletePassword,
  19153. "object": password,
  19154. "text": "Are you sure you want to delete this password ?"
  19155. }
  19156. })])])
  19157. })])])
  19158. },staticRenderFns: [function (){var _vm=this;
  19159. return _vm._h('i', {
  19160. staticClass: "fa fa-search"
  19161. })
  19162. }]}
  19163. /***/ },
  19164. /* 211 */
  19165. /***/ function(module, exports) {
  19166. module.exports={render:function (){var _vm=this;
  19167. return _vm._h('form', {
  19168. attrs: {
  19169. "id": "password-generator"
  19170. }
  19171. }, [_vm._h('div', {
  19172. staticClass: "form-group"
  19173. }, [_vm._h('div', {
  19174. staticClass: "inner-addon left-addon"
  19175. }, [_vm._m(0), " ", _vm._m(1), " ", _vm._h('input', {
  19176. directives: [{
  19177. name: "model",
  19178. rawName: "v-model",
  19179. value: (_vm.password.site),
  19180. expression: "password.site"
  19181. }],
  19182. ref: "site",
  19183. staticClass: "form-control",
  19184. attrs: {
  19185. "id": "site",
  19186. "name": "site",
  19187. "type": "text",
  19188. "placeholder": "Site",
  19189. "list": "savedSites",
  19190. "autocorrect": "off",
  19191. "autocapitalize": "none"
  19192. },
  19193. domProps: {
  19194. "value": _vm._s(_vm.password.site)
  19195. },
  19196. on: {
  19197. "input": function($event) {
  19198. if ($event.target.composing) { return; }
  19199. _vm.password.site = $event.target.value
  19200. }
  19201. }
  19202. }), " ", _vm._h('datalist', {
  19203. attrs: {
  19204. "id": "savedSites"
  19205. }
  19206. }, [_vm._l((_vm.passwords), function(pwd) {
  19207. return _vm._h('option', ["\n " + _vm._s(pwd.site) + " | " + _vm._s(pwd.login) + "\n "])
  19208. })])])]), " ", _vm._h('remove-auto-complete'), " ", _vm._h('div', {
  19209. staticClass: "form-group"
  19210. }, [_vm._h('div', {
  19211. staticClass: "inner-addon left-addon"
  19212. }, [_vm._m(2), " ", _vm._m(3), " ", _vm._h('input', {
  19213. directives: [{
  19214. name: "model",
  19215. rawName: "v-model",
  19216. value: (_vm.password.login),
  19217. expression: "password.login"
  19218. }],
  19219. staticClass: "form-control",
  19220. attrs: {
  19221. "id": "login",
  19222. "name": "login",
  19223. "type": "text",
  19224. "placeholder": "Login",
  19225. "autocomplete": "off",
  19226. "autocorrect": "off",
  19227. "autocapitalize": "none"
  19228. },
  19229. domProps: {
  19230. "value": _vm._s(_vm.password.login)
  19231. },
  19232. on: {
  19233. "input": function($event) {
  19234. if ($event.target.composing) { return; }
  19235. _vm.password.login = $event.target.value
  19236. }
  19237. }
  19238. })])]), " ", _vm._h('div', {
  19239. staticClass: "form-group"
  19240. }, [_vm._h('div', {
  19241. staticClass: "inner-addon left-addon input-group"
  19242. }, [_vm._m(4), " ", _vm._m(5), " ", _vm._h('input', {
  19243. directives: [{
  19244. name: "model",
  19245. rawName: "v-model",
  19246. value: (_vm.masterPassword),
  19247. expression: "masterPassword"
  19248. }],
  19249. ref: "masterPassword",
  19250. staticClass: "form-control",
  19251. attrs: {
  19252. "id": "masterPassword",
  19253. "name": "masterPassword",
  19254. "type": "password",
  19255. "placeholder": "Master password",
  19256. "autocomplete": "new-password",
  19257. "autocorrect": "off",
  19258. "autocapitalize": "none"
  19259. },
  19260. domProps: {
  19261. "value": _vm._s(_vm.masterPassword)
  19262. },
  19263. on: {
  19264. "input": function($event) {
  19265. if ($event.target.composing) { return; }
  19266. _vm.masterPassword = $event.target.value
  19267. }
  19268. }
  19269. }), " ", _vm._h('fingerprint', {
  19270. attrs: {
  19271. "fingerprint": _vm.fingerprint
  19272. },
  19273. nativeOn: {
  19274. "click": function($event) {
  19275. _vm.showMasterPassword($event)
  19276. }
  19277. }
  19278. })])]), " ", _vm._h('div', {
  19279. staticClass: "form-group"
  19280. }, [_vm._h('button', {
  19281. directives: [{
  19282. name: "show",
  19283. rawName: "v-show",
  19284. value: (_vm.showCopyBtn),
  19285. expression: "showCopyBtn"
  19286. }],
  19287. staticClass: "btn",
  19288. class: {
  19289. 'btn-warning': _vm.password.version === 1, 'btn-primary': _vm.password.version === 2
  19290. },
  19291. attrs: {
  19292. "id": "copyPasswordButton",
  19293. "type": "button",
  19294. "data-clipboard-text": ""
  19295. }
  19296. }, ["\n Copy to clipboard\n "]), " ", _vm._h('button', {
  19297. directives: [{
  19298. name: "show",
  19299. rawName: "v-show",
  19300. value: (!_vm.showCopyBtn),
  19301. expression: "!showCopyBtn"
  19302. }],
  19303. staticClass: "btn btn-secondary",
  19304. attrs: {
  19305. "type": "button"
  19306. },
  19307. on: {
  19308. "click": _vm.renderPassword
  19309. }
  19310. }, ["\n Generate Password\n "]), " ", _vm._h('button', {
  19311. staticClass: "btn btn-secondary",
  19312. attrs: {
  19313. "type": "button"
  19314. },
  19315. on: {
  19316. "click": function($event) {
  19317. _vm.showOptions = !_vm.showOptions
  19318. }
  19319. }
  19320. }, [_vm._m(6), " Options\n "])]), " ", (_vm.showOptions) ? _vm._h('div', {
  19321. staticClass: "form-group"
  19322. }, [_vm._h('label', {
  19323. staticClass: "form-check-inline"
  19324. }, [_vm._h('input', {
  19325. directives: [{
  19326. name: "model",
  19327. rawName: "v-model",
  19328. value: (_vm.password.lowercase),
  19329. expression: "password.lowercase"
  19330. }],
  19331. staticClass: "form-check-input",
  19332. attrs: {
  19333. "type": "checkbox",
  19334. "id": "lowercase"
  19335. },
  19336. domProps: {
  19337. "checked": Array.isArray(_vm.password.lowercase) ? _vm._i(_vm.password.lowercase, null) > -1 : _vm._q(_vm.password.lowercase, true)
  19338. },
  19339. on: {
  19340. "change": function($event) {
  19341. var $$a = _vm.password.lowercase,
  19342. $$el = $event.target,
  19343. $$c = $$el.checked ? (true) : (false);
  19344. if (Array.isArray($$a)) {
  19345. var $$v = null,
  19346. $$i = _vm._i($$a, $$v);
  19347. if ($$c) {
  19348. $$i < 0 && (_vm.password.lowercase = $$a.concat($$v))
  19349. } else {
  19350. $$i > -1 && (_vm.password.lowercase = $$a.slice(0, $$i).concat($$a.slice($$i + 1)))
  19351. }
  19352. } else {
  19353. _vm.password.lowercase = $$c
  19354. }
  19355. }
  19356. }
  19357. }), " abc\n "]), " ", _vm._h('label', {
  19358. staticClass: "form-check-inline"
  19359. }, [_vm._h('input', {
  19360. directives: [{
  19361. name: "model",
  19362. rawName: "v-model",
  19363. value: (_vm.password.uppercase),
  19364. expression: "password.uppercase"
  19365. }],
  19366. staticClass: "form-check-input",
  19367. attrs: {
  19368. "type": "checkbox",
  19369. "id": "uppercase"
  19370. },
  19371. domProps: {
  19372. "checked": Array.isArray(_vm.password.uppercase) ? _vm._i(_vm.password.uppercase, null) > -1 : _vm._q(_vm.password.uppercase, true)
  19373. },
  19374. on: {
  19375. "change": function($event) {
  19376. var $$a = _vm.password.uppercase,
  19377. $$el = $event.target,
  19378. $$c = $$el.checked ? (true) : (false);
  19379. if (Array.isArray($$a)) {
  19380. var $$v = null,
  19381. $$i = _vm._i($$a, $$v);
  19382. if ($$c) {
  19383. $$i < 0 && (_vm.password.uppercase = $$a.concat($$v))
  19384. } else {
  19385. $$i > -1 && (_vm.password.uppercase = $$a.slice(0, $$i).concat($$a.slice($$i + 1)))
  19386. }
  19387. } else {
  19388. _vm.password.uppercase = $$c
  19389. }
  19390. }
  19391. }
  19392. }), " ABC\n "]), " ", _vm._h('label', {
  19393. staticClass: "form-check-inline"
  19394. }, [_vm._h('input', {
  19395. directives: [{
  19396. name: "model",
  19397. rawName: "v-model",
  19398. value: (_vm.password.numbers),
  19399. expression: "password.numbers"
  19400. }],
  19401. staticClass: "form-check-input",
  19402. attrs: {
  19403. "type": "checkbox",
  19404. "id": "numbers"
  19405. },
  19406. domProps: {
  19407. "checked": Array.isArray(_vm.password.numbers) ? _vm._i(_vm.password.numbers, null) > -1 : _vm._q(_vm.password.numbers, true)
  19408. },
  19409. on: {
  19410. "change": function($event) {
  19411. var $$a = _vm.password.numbers,
  19412. $$el = $event.target,
  19413. $$c = $$el.checked ? (true) : (false);
  19414. if (Array.isArray($$a)) {
  19415. var $$v = null,
  19416. $$i = _vm._i($$a, $$v);
  19417. if ($$c) {
  19418. $$i < 0 && (_vm.password.numbers = $$a.concat($$v))
  19419. } else {
  19420. $$i > -1 && (_vm.password.numbers = $$a.slice(0, $$i).concat($$a.slice($$i + 1)))
  19421. }
  19422. } else {
  19423. _vm.password.numbers = $$c
  19424. }
  19425. }
  19426. }
  19427. }), "\n 123\n "]), " ", _vm._h('label', {
  19428. staticClass: "form-check-inline"
  19429. }, [_vm._h('input', {
  19430. directives: [{
  19431. name: "model",
  19432. rawName: "v-model",
  19433. value: (_vm.password.symbols),
  19434. expression: "password.symbols"
  19435. }],
  19436. staticClass: "form-check-input",
  19437. attrs: {
  19438. "type": "checkbox",
  19439. "id": "symbols"
  19440. },
  19441. domProps: {
  19442. "checked": Array.isArray(_vm.password.symbols) ? _vm._i(_vm.password.symbols, null) > -1 : _vm._q(_vm.password.symbols, true)
  19443. },
  19444. on: {
  19445. "change": function($event) {
  19446. var $$a = _vm.password.symbols,
  19447. $$el = $event.target,
  19448. $$c = $$el.checked ? (true) : (false);
  19449. if (Array.isArray($$a)) {
  19450. var $$v = null,
  19451. $$i = _vm._i($$a, $$v);
  19452. if ($$c) {
  19453. $$i < 0 && (_vm.password.symbols = $$a.concat($$v))
  19454. } else {
  19455. $$i > -1 && (_vm.password.symbols = $$a.slice(0, $$i).concat($$a.slice($$i + 1)))
  19456. }
  19457. } else {
  19458. _vm.password.symbols = $$c
  19459. }
  19460. }
  19461. }
  19462. }), "\n %!@\n "])]) : _vm._e(), " ", (_vm.showOptions) ? _vm._h('div', {
  19463. staticClass: "form-group row"
  19464. }, [_vm._h('div', {
  19465. staticClass: "col-xs-12 col-sm-4 pb-1"
  19466. }, [_vm._m(7), " ", _vm._h('input', {
  19467. directives: [{
  19468. name: "model",
  19469. rawName: "v-model",
  19470. value: (_vm.password.length),
  19471. expression: "password.length"
  19472. }],
  19473. staticClass: "form-control",
  19474. attrs: {
  19475. "type": "number",
  19476. "id": "passwordLength",
  19477. "min": "6"
  19478. },
  19479. domProps: {
  19480. "value": _vm._s(_vm.password.length)
  19481. },
  19482. on: {
  19483. "input": function($event) {
  19484. if ($event.target.composing) { return; }
  19485. _vm.password.length = _vm._n($event.target.value)
  19486. }
  19487. }
  19488. })]), " ", _vm._h('div', {
  19489. staticClass: "col-xs-12 col-sm-4 pb-1"
  19490. }, [_vm._m(8), " ", _vm._h('input', {
  19491. directives: [{
  19492. name: "model",
  19493. rawName: "v-model",
  19494. value: (_vm.password.counter),
  19495. expression: "password.counter"
  19496. }],
  19497. staticClass: "form-control",
  19498. attrs: {
  19499. "type": "number",
  19500. "id": "passwordCounter",
  19501. "min": "1"
  19502. },
  19503. domProps: {
  19504. "value": _vm._s(_vm.password.counter)
  19505. },
  19506. on: {
  19507. "input": function($event) {
  19508. if ($event.target.composing) { return; }
  19509. _vm.password.counter = _vm._n($event.target.value)
  19510. }
  19511. }
  19512. })]), " ", _vm._h('div', {
  19513. staticClass: "col-xs-12 col-sm-4 pb-1"
  19514. }, [_vm._m(9), " ", _vm._h('select', {
  19515. directives: [{
  19516. name: "model",
  19517. rawName: "v-model",
  19518. value: (_vm.password.version),
  19519. expression: "password.version"
  19520. }],
  19521. staticClass: "form-control",
  19522. attrs: {
  19523. "id": "version"
  19524. },
  19525. on: {
  19526. "change": [function($event) {
  19527. _vm.password.version = Array.prototype.filter.call($event.target.options, function(o) {
  19528. return o.selected
  19529. }).map(function(o) {
  19530. var val = "_value" in o ? o._value : o.value;
  19531. return val
  19532. })[0]
  19533. }, _vm.selectVersion]
  19534. }
  19535. }, [_vm._m(10), " ", _vm._m(11)])])]) : _vm._e(), " ", (_vm.showError) ? _vm._h('div', {
  19536. staticClass: "form-group"
  19537. }, [_vm._m(12)]) : _vm._e(), " ", (_vm.version === 2 && _vm.password.version === 1 && !_vm.showError) ? _vm._h('div', {
  19538. staticClass: "form-group"
  19539. }, [_vm._h('div', {
  19540. staticClass: "alert alert-warning",
  19541. attrs: {
  19542. "role": "alert"
  19543. }
  19544. }, ["\n This is a password in version 1.\n You should update your password and use version 2\n ", _vm._m(13), " ", (!_vm.showOptions) ? _vm._h('a', {
  19545. attrs: {
  19546. "href": "#"
  19547. },
  19548. on: {
  19549. "click": function($event) {
  19550. $event.preventDefault();
  19551. _vm.showOptions = !_vm.showOptions
  19552. }
  19553. }
  19554. }, [" show me the options"]) : _vm._e()])]) : _vm._e(), " ", (_vm.version === 1 && !_vm.showError) ? _vm._h('div', {
  19555. staticClass: "form-group"
  19556. }, [_vm._h('div', {
  19557. staticClass: "alert alert-warning",
  19558. attrs: {
  19559. "role": "alert"
  19560. }
  19561. }, ["\n You are using LessPass ", _vm._m(14), " which is deprecated.\n We will load the ", _vm._m(15), " by default on january 1st, 2017.\n ", _vm._m(16), "You can still use version 1 in options after this period.\n ", _vm._m(17), " ", _vm._h('a', {
  19562. attrs: {
  19563. "href": "#"
  19564. },
  19565. on: {
  19566. "click": function($event) {
  19567. $event.preventDefault();
  19568. _vm.changeVersion(2)
  19569. }
  19570. }
  19571. }, ["Use version 2 now"])])]) : _vm._e()])
  19572. },staticRenderFns: [function (){var _vm=this;
  19573. return _vm._h('label', {
  19574. staticClass: "sr-only",
  19575. attrs: {
  19576. "for": "site"
  19577. }
  19578. }, ["Site"])
  19579. },function (){var _vm=this;
  19580. return _vm._h('i', {
  19581. staticClass: "fa fa-globe"
  19582. })
  19583. },function (){var _vm=this;
  19584. return _vm._h('label', {
  19585. staticClass: "sr-only",
  19586. attrs: {
  19587. "for": "login"
  19588. }
  19589. }, ["Login"])
  19590. },function (){var _vm=this;
  19591. return _vm._h('i', {
  19592. staticClass: "fa fa-user"
  19593. })
  19594. },function (){var _vm=this;
  19595. return _vm._h('label', {
  19596. staticClass: "sr-only",
  19597. attrs: {
  19598. "for": "masterPassword"
  19599. }
  19600. }, ["Master Password"])
  19601. },function (){var _vm=this;
  19602. return _vm._h('i', {
  19603. staticClass: "fa fa-lock"
  19604. })
  19605. },function (){var _vm=this;
  19606. return _vm._h('i', {
  19607. staticClass: "fa fa-cog",
  19608. attrs: {
  19609. "aria-hidden": "true"
  19610. }
  19611. })
  19612. },function (){var _vm=this;
  19613. return _vm._h('label', {
  19614. attrs: {
  19615. "for": "passwordLength"
  19616. }
  19617. }, ["\n Password Length\n "])
  19618. },function (){var _vm=this;
  19619. return _vm._h('label', {
  19620. attrs: {
  19621. "for": "passwordLength"
  19622. }
  19623. }, ["\n Counter\n "])
  19624. },function (){var _vm=this;
  19625. return _vm._h('label', {
  19626. attrs: {
  19627. "for": "version"
  19628. }
  19629. }, ["\n Version\n "])
  19630. },function (){var _vm=this;
  19631. return _vm._h('option', {
  19632. attrs: {
  19633. "value": "1"
  19634. }
  19635. }, ["V1"])
  19636. },function (){var _vm=this;
  19637. return _vm._h('option', {
  19638. attrs: {
  19639. "value": "2"
  19640. }
  19641. }, ["V2"])
  19642. },function (){var _vm=this;
  19643. return _vm._h('div', {
  19644. staticClass: "alert alert-danger",
  19645. attrs: {
  19646. "role": "alert"
  19647. }
  19648. }, ["\n site, login and master password fields are mandatory\n "])
  19649. },function (){var _vm=this;
  19650. return _vm._h('br')
  19651. },function (){var _vm=this;
  19652. return _vm._h('strong', ["version 1"])
  19653. },function (){var _vm=this;
  19654. return _vm._h('strong', ["version 2"])
  19655. },function (){var _vm=this;
  19656. return _vm._h('br')
  19657. },function (){var _vm=this;
  19658. return _vm._h('br')
  19659. }]}
  19660. /***/ },
  19661. /* 212 */
  19662. /***/ function(module, exports) {
  19663. module.exports={render:function (){var _vm=this;
  19664. return _vm._h('div', {
  19665. staticClass: "card",
  19666. staticStyle: {
  19667. "max-width": "475px"
  19668. },
  19669. attrs: {
  19670. "id": "lesspass"
  19671. }
  19672. }, [_vm._h('lesspass-menu'), " ", _vm._h('div', {
  19673. staticClass: "card-block"
  19674. }, [_vm._h('router-view')])])
  19675. },staticRenderFns: []}
  19676. /***/ },
  19677. /* 213 */
  19678. /***/ function(module, exports) {
  19679. module.exports={render:function (){var _vm=this;
  19680. return _vm._h('form', {
  19681. on: {
  19682. "submit": function($event) {
  19683. $event.preventDefault();
  19684. _vm.resetPassword($event)
  19685. }
  19686. }
  19687. }, [(_vm.showError) ? _vm._h('div', {
  19688. staticClass: "form-group row"
  19689. }, [_vm._m(0)]) : _vm._e(), " ", (_vm.successMessage) ? _vm._h('div', {
  19690. staticClass: "form-group row"
  19691. }, [_vm._m(1)]) : _vm._e(), " ", _vm._h('div', {
  19692. staticClass: "form-group row"
  19693. }, [_vm._h('div', {
  19694. staticClass: "col-xs-12"
  19695. }, [_vm._h('div', {
  19696. staticClass: "inner-addon left-addon"
  19697. }, [_vm._m(2), " ", _vm._h('input', {
  19698. directives: [{
  19699. name: "model",
  19700. rawName: "v-model",
  19701. value: (_vm.email),
  19702. expression: "email"
  19703. }],
  19704. staticClass: "form-control",
  19705. attrs: {
  19706. "id": "email",
  19707. "name": "email",
  19708. "type": "email",
  19709. "placeholder": "Email"
  19710. },
  19711. domProps: {
  19712. "value": _vm._s(_vm.email)
  19713. },
  19714. on: {
  19715. "input": function($event) {
  19716. if ($event.target.composing) { return; }
  19717. _vm.email = $event.target.value
  19718. }
  19719. }
  19720. }), " ", _vm._h('small', {
  19721. staticClass: "form-text text-muted text-danger"
  19722. }, [(_vm.emailRequired) ? _vm._h('span', ["An email is required"]) : _vm._e()])])])]), " ", _vm._h('div', {
  19723. staticClass: "form-group row"
  19724. }, [_vm._h('div', {
  19725. staticClass: "col-xs-12"
  19726. }, [_vm._h('button', {
  19727. staticClass: "btn btn-primary",
  19728. attrs: {
  19729. "id": "loginButton",
  19730. "type": "submit"
  19731. }
  19732. }, [(_vm.loading) ? _vm._h('span', [_vm._m(3)]) : _vm._e(), "\n Send me a reset link\n "])])])])
  19733. },staticRenderFns: [function (){var _vm=this;
  19734. return _vm._h('div', {
  19735. staticClass: "col-xs-12 text-muted text-danger"
  19736. }, ["\n Oops! Something went wrong. Retry in a few minutes.\n "])
  19737. },function (){var _vm=this;
  19738. return _vm._h('div', {
  19739. staticClass: "col-xs-12 text-muted text-success"
  19740. }, ["\n If a matching account was found an email was sent to allow you to reset your password.\n "])
  19741. },function (){var _vm=this;
  19742. return _vm._h('i', {
  19743. staticClass: "fa fa-user"
  19744. })
  19745. },function (){var _vm=this;
  19746. return _vm._h('i', {
  19747. staticClass: "fa fa-spinner fa-pulse fa-fw"
  19748. })
  19749. }]}
  19750. /***/ },
  19751. /* 214 */
  19752. /***/ function(module, exports) {
  19753. module.exports={render:function (){var _vm=this;
  19754. return _vm._h('div', {
  19755. attrs: {
  19756. "id": "delete-button"
  19757. }
  19758. }, [_vm._h('button', {
  19759. staticClass: "btn btn-danger",
  19760. class: {
  19761. 'btn-progress': _vm.progress
  19762. },
  19763. attrs: {
  19764. "type": "button"
  19765. },
  19766. on: {
  19767. "mouseup": _vm.click,
  19768. "mousedown": _vm.start,
  19769. "mouseout": _vm.cancel
  19770. }
  19771. }, [_vm._m(0), "\n " + _vm._s(_vm.confirmHelp) + "\n "])])
  19772. },staticRenderFns: [function (){var _vm=this;
  19773. return _vm._h('i', {
  19774. staticClass: "fa-white fa fa-trash fw"
  19775. })
  19776. }]}
  19777. /***/ },
  19778. /* 215 */
  19779. /***/ function(module, exports) {
  19780. module.exports={render:function (){var _vm=this;
  19781. return _vm._h('form', {
  19782. on: {
  19783. "submit": function($event) {
  19784. $event.preventDefault();
  19785. _vm.resetPasswordConfirm($event)
  19786. }
  19787. }
  19788. }, [(_vm.showError) ? _vm._h('div', {
  19789. staticClass: "form-group row"
  19790. }, [_vm._h('div', {
  19791. staticClass: "col-xs-12 text-muted text-danger"
  19792. }, ["\n " + _vm._s(_vm.errorMessage) + "\n "])]) : _vm._e(), " ", (_vm.successMessage) ? _vm._h('div', {
  19793. staticClass: "form-group row"
  19794. }, [_vm._h('div', {
  19795. staticClass: "col-xs-12 text-muted text-success"
  19796. }, ["\n You're password was reset successfully.\n ", _vm._h('router-link', {
  19797. attrs: {
  19798. "to": {
  19799. name: 'login'
  19800. }
  19801. }
  19802. }, ["Do you want to login ?"])])]) : _vm._e(), " ", _vm._h('div', {
  19803. staticClass: "form-group row"
  19804. }, [_vm._h('div', {
  19805. staticClass: "col-xs-12"
  19806. }, [_vm._h('div', {
  19807. staticClass: "inner-addon left-addon"
  19808. }, [_vm._m(0), " ", _vm._h('input', {
  19809. directives: [{
  19810. name: "model",
  19811. rawName: "v-model",
  19812. value: (_vm.new_password),
  19813. expression: "new_password"
  19814. }],
  19815. staticClass: "form-control",
  19816. attrs: {
  19817. "id": "new-password",
  19818. "name": "new-password",
  19819. "type": "password",
  19820. "autocomplete": "new-password",
  19821. "placeholder": "New Password"
  19822. },
  19823. domProps: {
  19824. "value": _vm._s(_vm.new_password)
  19825. },
  19826. on: {
  19827. "input": function($event) {
  19828. if ($event.target.composing) { return; }
  19829. _vm.new_password = $event.target.value
  19830. }
  19831. }
  19832. }), " ", _vm._h('small', {
  19833. staticClass: "form-text text-muted text-danger"
  19834. }, [(_vm.passwordRequired) ? _vm._h('span', ["A password is required"]) : _vm._e()])])])]), " ", _vm._m(1)])
  19835. },staticRenderFns: [function (){var _vm=this;
  19836. return _vm._h('i', {
  19837. staticClass: "fa fa-lock"
  19838. })
  19839. },function (){var _vm=this;
  19840. return _vm._h('div', {
  19841. staticClass: "form-group row"
  19842. }, [_vm._h('div', {
  19843. staticClass: "col-xs-12"
  19844. }, [_vm._h('button', {
  19845. staticClass: "btn btn-primary",
  19846. attrs: {
  19847. "id": "loginButton",
  19848. "type": "submit"
  19849. }
  19850. }, ["\n Reset my password\n "])])])
  19851. }]}
  19852. /***/ },
  19853. /* 216 */
  19854. /***/ function(module, exports) {
  19855. module.exports={render:function (){var _vm=this;
  19856. return _vm._h('div', {
  19857. attrs: {
  19858. "id": "menu"
  19859. }
  19860. }, [_vm._h('div', {
  19861. directives: [{
  19862. name: "show",
  19863. rawName: "v-show",
  19864. value: (_vm.isAuthenticated),
  19865. expression: "isAuthenticated"
  19866. }],
  19867. staticClass: "card-header"
  19868. }, [_vm._h('div', {
  19869. staticClass: "row"
  19870. }, [_vm._h('div', {
  19871. staticClass: "col-xs-6"
  19872. }, [_vm._h('router-link', {
  19873. staticClass: "grey-link",
  19874. attrs: {
  19875. "to": {
  19876. name: 'home'
  19877. }
  19878. }
  19879. }, ["LessPass"]), " ", _vm._h('span', {
  19880. staticClass: " hint--right",
  19881. attrs: {
  19882. "aria-label": "Save password"
  19883. },
  19884. on: {
  19885. "click": _vm.saveOrUpdatePassword
  19886. }
  19887. }, [(_vm.passwordStatus == 'DIRTY') ? _vm._h('i', {
  19888. staticClass: "fa fa-save ml-1 fa-clickable"
  19889. }) : _vm._e()]), " ", (_vm.passwordStatus == 'CREATED') ? _vm._h('span', {
  19890. staticClass: "text-success"
  19891. }, [_vm._m(0)]) : _vm._e()]), " ", _vm._h('div', {
  19892. staticClass: "col-xs-6 text-xs-right"
  19893. }, [_vm._h('router-link', {
  19894. staticClass: "grey-link ml-1",
  19895. attrs: {
  19896. "to": {
  19897. name: 'passwords'
  19898. }
  19899. }
  19900. }, [_vm._h('i', {
  19901. staticClass: "fa fa-key",
  19902. attrs: {
  19903. "aria-hidden": "true"
  19904. }
  19905. })]), " ", _vm._h('button', {
  19906. staticClass: "grey-link ml-1 btn btn-link p-0 m-0",
  19907. attrs: {
  19908. "type": "button"
  19909. },
  19910. on: {
  19911. "click": _vm.logout
  19912. }
  19913. }, [_vm._m(1)])])])]), " ", _vm._h('div', {
  19914. directives: [{
  19915. name: "show",
  19916. rawName: "v-show",
  19917. value: (_vm.isGuest),
  19918. expression: "isGuest"
  19919. }],
  19920. staticClass: "card-header",
  19921. class: {
  19922. 'card-warning': _vm.version === 1, 'card-primary': _vm.version === 2
  19923. }
  19924. }, [_vm._h('div', {
  19925. staticClass: "row"
  19926. }, [_vm._h('div', {
  19927. staticClass: "index-header"
  19928. }, [_vm._h('div', {
  19929. staticClass: "col-xs-6"
  19930. }, [_vm._h('router-link', {
  19931. staticClass: "white-link",
  19932. attrs: {
  19933. "to": {
  19934. name: 'home'
  19935. }
  19936. }
  19937. }, ["LessPass"])]), " ", _vm._h('div', {
  19938. staticClass: "col-xs-6 text-xs-right"
  19939. }, [_vm._h('router-link', {
  19940. staticClass: "white-link pl-1",
  19941. attrs: {
  19942. "to": {
  19943. name: 'login'
  19944. }
  19945. }
  19946. }, [_vm._h('i', {
  19947. staticClass: "fa fa-user-secret fa-clickable",
  19948. attrs: {
  19949. "aria-hidden": "true"
  19950. }
  19951. })])])])])])])
  19952. },staticRenderFns: [function (){var _vm=this;
  19953. return _vm._h('i', {
  19954. staticClass: "fa fa-check ml-1 text-success"
  19955. })
  19956. },function (){var _vm=this;
  19957. return _vm._h('i', {
  19958. staticClass: "fa fa-sign-out",
  19959. attrs: {
  19960. "aria-hidden": "true"
  19961. }
  19962. })
  19963. }]}
  19964. /***/ },
  19965. /* 217 */
  19966. /***/ function(module, exports, __webpack_require__) {
  19967. /**
  19968. * vue-router v2.0.2
  19969. * (c) 2016 Evan You
  19970. * @license MIT
  19971. */
  19972. (function (global, factory) {
  19973. true ? module.exports = factory() :
  19974. typeof define === 'function' && define.amd ? define(factory) :
  19975. (global.VueRouter = factory());
  19976. }(this, (function () { 'use strict';
  19977. var View = {
  19978. name: 'router-view',
  19979. functional: true,
  19980. props: {
  19981. name: {
  19982. type: String,
  19983. default: 'default'
  19984. }
  19985. },
  19986. render: function render (h, ref) {
  19987. var props = ref.props;
  19988. var children = ref.children;
  19989. var parent = ref.parent;
  19990. var data = ref.data;
  19991. data.routerView = true
  19992. var route = parent.$route
  19993. var cache = parent._routerViewCache || (parent._routerViewCache = {})
  19994. var depth = 0
  19995. var inactive = false
  19996. while (parent) {
  19997. if (parent.$vnode && parent.$vnode.data.routerView) {
  19998. depth++
  19999. }
  20000. if (parent._inactive) {
  20001. inactive = true
  20002. }
  20003. parent = parent.$parent
  20004. }
  20005. data.routerViewDepth = depth
  20006. var matched = route.matched[depth]
  20007. if (!matched) {
  20008. return h()
  20009. }
  20010. var name = props.name
  20011. var component = inactive
  20012. ? cache[name]
  20013. : (cache[name] = matched.components[name])
  20014. if (!inactive) {
  20015. var hooks = data.hook || (data.hook = {})
  20016. hooks.init = function (vnode) {
  20017. matched.instances[name] = vnode.child
  20018. }
  20019. hooks.prepatch = function (oldVnode, vnode) {
  20020. matched.instances[name] = vnode.child
  20021. }
  20022. hooks.destroy = function (vnode) {
  20023. if (matched.instances[name] === vnode.child) {
  20024. matched.instances[name] = undefined
  20025. }
  20026. }
  20027. }
  20028. return h(component, data, children)
  20029. }
  20030. }
  20031. /* */
  20032. function resolvePath (
  20033. relative,
  20034. base,
  20035. append
  20036. ) {
  20037. if (relative.charAt(0) === '/') {
  20038. return relative
  20039. }
  20040. if (relative.charAt(0) === '?' || relative.charAt(0) === '#') {
  20041. return base + relative
  20042. }
  20043. var stack = base.split('/')
  20044. // remove trailing segment if:
  20045. // - not appending
  20046. // - appending to trailing slash (last segment is empty)
  20047. if (!append || !stack[stack.length - 1]) {
  20048. stack.pop()
  20049. }
  20050. // resolve relative path
  20051. var segments = relative.replace(/^\//, '').split('/')
  20052. for (var i = 0; i < segments.length; i++) {
  20053. var segment = segments[i]
  20054. if (segment === '.') {
  20055. continue
  20056. } else if (segment === '..') {
  20057. stack.pop()
  20058. } else {
  20059. stack.push(segment)
  20060. }
  20061. }
  20062. // ensure leading slash
  20063. if (stack[0] !== '') {
  20064. stack.unshift('')
  20065. }
  20066. return stack.join('/')
  20067. }
  20068. function parsePath (path) {
  20069. var hash = ''
  20070. var query = ''
  20071. var hashIndex = path.indexOf('#')
  20072. if (hashIndex >= 0) {
  20073. hash = path.slice(hashIndex)
  20074. path = path.slice(0, hashIndex)
  20075. }
  20076. var queryIndex = path.indexOf('?')
  20077. if (queryIndex >= 0) {
  20078. query = path.slice(queryIndex + 1)
  20079. path = path.slice(0, queryIndex)
  20080. }
  20081. return {
  20082. path: path,
  20083. query: query,
  20084. hash: hash
  20085. }
  20086. }
  20087. function cleanPath (path) {
  20088. return path.replace(/\/\//g, '/')
  20089. }
  20090. /* */
  20091. function assert (condition, message) {
  20092. if (!condition) {
  20093. throw new Error(("[vue-router] " + message))
  20094. }
  20095. }
  20096. function warn (condition, message) {
  20097. if (!condition) {
  20098. typeof console !== 'undefined' && console.warn(("[vue-router] " + message))
  20099. }
  20100. }
  20101. /* */
  20102. var encode = encodeURIComponent
  20103. var decode = decodeURIComponent
  20104. function resolveQuery (
  20105. query,
  20106. extraQuery
  20107. ) {
  20108. if ( extraQuery === void 0 ) extraQuery = {};
  20109. if (query) {
  20110. var parsedQuery
  20111. try {
  20112. parsedQuery = parseQuery(query)
  20113. } catch (e) {
  20114. warn(false, e.message)
  20115. parsedQuery = {}
  20116. }
  20117. for (var key in extraQuery) {
  20118. parsedQuery[key] = extraQuery[key]
  20119. }
  20120. return parsedQuery
  20121. } else {
  20122. return extraQuery
  20123. }
  20124. }
  20125. function parseQuery (query) {
  20126. var res = {}
  20127. query = query.trim().replace(/^(\?|#|&)/, '')
  20128. if (!query) {
  20129. return res
  20130. }
  20131. query.split('&').forEach(function (param) {
  20132. var parts = param.replace(/\+/g, ' ').split('=')
  20133. var key = decode(parts.shift())
  20134. var val = parts.length > 0
  20135. ? decode(parts.join('='))
  20136. : null
  20137. if (res[key] === undefined) {
  20138. res[key] = val
  20139. } else if (Array.isArray(res[key])) {
  20140. res[key].push(val)
  20141. } else {
  20142. res[key] = [res[key], val]
  20143. }
  20144. })
  20145. return res
  20146. }
  20147. function stringifyQuery (obj) {
  20148. var res = obj ? Object.keys(obj).sort().map(function (key) {
  20149. var val = obj[key]
  20150. if (val === undefined) {
  20151. return ''
  20152. }
  20153. if (val === null) {
  20154. return encode(key)
  20155. }
  20156. if (Array.isArray(val)) {
  20157. var result = []
  20158. val.slice().forEach(function (val2) {
  20159. if (val2 === undefined) {
  20160. return
  20161. }
  20162. if (val2 === null) {
  20163. result.push(encode(key))
  20164. } else {
  20165. result.push(encode(key) + '=' + encode(val2))
  20166. }
  20167. })
  20168. return result.join('&')
  20169. }
  20170. return encode(key) + '=' + encode(val)
  20171. }).filter(function (x) { return x.length > 0; }).join('&') : null
  20172. return res ? ("?" + res) : ''
  20173. }
  20174. /* */
  20175. function createRoute (
  20176. record,
  20177. location,
  20178. redirectedFrom
  20179. ) {
  20180. var route = {
  20181. name: location.name || (record && record.name),
  20182. meta: (record && record.meta) || {},
  20183. path: location.path || '/',
  20184. hash: location.hash || '',
  20185. query: location.query || {},
  20186. params: location.params || {},
  20187. fullPath: getFullPath(location),
  20188. matched: record ? formatMatch(record) : []
  20189. }
  20190. if (redirectedFrom) {
  20191. route.redirectedFrom = getFullPath(redirectedFrom)
  20192. }
  20193. return Object.freeze(route)
  20194. }
  20195. // the starting route that represents the initial state
  20196. var START = createRoute(null, {
  20197. path: '/'
  20198. })
  20199. function formatMatch (record) {
  20200. var res = []
  20201. while (record) {
  20202. res.unshift(record)
  20203. record = record.parent
  20204. }
  20205. return res
  20206. }
  20207. function getFullPath (ref) {
  20208. var path = ref.path;
  20209. var query = ref.query; if ( query === void 0 ) query = {};
  20210. var hash = ref.hash; if ( hash === void 0 ) hash = '';
  20211. return (path || '/') + stringifyQuery(query) + hash
  20212. }
  20213. var trailingSlashRE = /\/$/
  20214. function isSameRoute (a, b) {
  20215. if (b === START) {
  20216. return a === b
  20217. } else if (!b) {
  20218. return false
  20219. } else if (a.path && b.path) {
  20220. return (
  20221. a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') &&
  20222. a.hash === b.hash &&
  20223. isObjectEqual(a.query, b.query)
  20224. )
  20225. } else if (a.name && b.name) {
  20226. return (
  20227. a.name === b.name &&
  20228. a.hash === b.hash &&
  20229. isObjectEqual(a.query, b.query) &&
  20230. isObjectEqual(a.params, b.params)
  20231. )
  20232. } else {
  20233. return false
  20234. }
  20235. }
  20236. function isObjectEqual (a, b) {
  20237. if ( a === void 0 ) a = {};
  20238. if ( b === void 0 ) b = {};
  20239. var aKeys = Object.keys(a)
  20240. var bKeys = Object.keys(b)
  20241. if (aKeys.length !== bKeys.length) {
  20242. return false
  20243. }
  20244. return aKeys.every(function (key) { return String(a[key]) === String(b[key]); })
  20245. }
  20246. function isIncludedRoute (current, target) {
  20247. return (
  20248. current.path.indexOf(target.path.replace(/\/$/, '')) === 0 &&
  20249. (!target.hash || current.hash === target.hash) &&
  20250. queryIncludes(current.query, target.query)
  20251. )
  20252. }
  20253. function queryIncludes (current, target) {
  20254. for (var key in target) {
  20255. if (!(key in current)) {
  20256. return false
  20257. }
  20258. }
  20259. return true
  20260. }
  20261. /* */
  20262. function normalizeLocation (
  20263. raw,
  20264. current,
  20265. append
  20266. ) {
  20267. var next = typeof raw === 'string' ? { path: raw } : raw
  20268. if (next.name || next._normalized) {
  20269. return next
  20270. }
  20271. var parsedPath = parsePath(next.path || '')
  20272. var basePath = (current && current.path) || '/'
  20273. var path = parsedPath.path
  20274. ? resolvePath(parsedPath.path, basePath, append)
  20275. : (current && current.path) || '/'
  20276. var query = resolveQuery(parsedPath.query, next.query)
  20277. var hash = next.hash || parsedPath.hash
  20278. if (hash && hash.charAt(0) !== '#') {
  20279. hash = "#" + hash
  20280. }
  20281. return {
  20282. _normalized: true,
  20283. path: path,
  20284. query: query,
  20285. hash: hash
  20286. }
  20287. }
  20288. /* */
  20289. // work around weird flow bug
  20290. var toTypes = [String, Object]
  20291. var Link = {
  20292. name: 'router-link',
  20293. props: {
  20294. to: {
  20295. type: toTypes,
  20296. required: true
  20297. },
  20298. tag: {
  20299. type: String,
  20300. default: 'a'
  20301. },
  20302. exact: Boolean,
  20303. append: Boolean,
  20304. replace: Boolean,
  20305. activeClass: String
  20306. },
  20307. render: function render (h) {
  20308. var this$1 = this;
  20309. var router = this.$router
  20310. var current = this.$route
  20311. var to = normalizeLocation(this.to, current, this.append)
  20312. var resolved = router.match(to, current)
  20313. var fullPath = resolved.redirectedFrom || resolved.fullPath
  20314. var base = router.history.base
  20315. var href = createHref(base, fullPath, router.mode)
  20316. var classes = {}
  20317. var activeClass = this.activeClass || router.options.linkActiveClass || 'router-link-active'
  20318. var compareTarget = to.path ? createRoute(null, to) : resolved
  20319. classes[activeClass] = this.exact
  20320. ? isSameRoute(current, compareTarget)
  20321. : isIncludedRoute(current, compareTarget)
  20322. var on = {
  20323. click: function (e) {
  20324. // don't redirect with control keys
  20325. /* istanbul ignore if */
  20326. if (e.metaKey || e.ctrlKey || e.shiftKey) { return }
  20327. // don't redirect when preventDefault called
  20328. /* istanbul ignore if */
  20329. if (e.defaultPrevented) { return }
  20330. // don't redirect on right click
  20331. /* istanbul ignore if */
  20332. if (e.button !== 0) { return }
  20333. // don't redirect if `target="_blank"`
  20334. /* istanbul ignore if */
  20335. var target = e.target.getAttribute('target')
  20336. if (/\b_blank\b/i.test(target)) { return }
  20337. e.preventDefault()
  20338. if (this$1.replace) {
  20339. router.replace(to)
  20340. } else {
  20341. router.push(to)
  20342. }
  20343. }
  20344. }
  20345. var data = {
  20346. class: classes
  20347. }
  20348. if (this.tag === 'a') {
  20349. data.on = on
  20350. data.attrs = { href: href }
  20351. } else {
  20352. // find the first <a> child and apply listener and href
  20353. var a = findAnchor(this.$slots.default)
  20354. if (a) {
  20355. // in case the <a> is a static node
  20356. a.isStatic = false
  20357. var extend = _Vue.util.extend
  20358. var aData = a.data = extend({}, a.data)
  20359. aData.on = on
  20360. var aAttrs = a.data.attrs = extend({}, a.data.attrs)
  20361. aAttrs.href = href
  20362. } else {
  20363. // doesn't have <a> child, apply listener to self
  20364. data.on = on
  20365. }
  20366. }
  20367. return h(this.tag, data, this.$slots.default)
  20368. }
  20369. }
  20370. function findAnchor (children) {
  20371. if (children) {
  20372. var child
  20373. for (var i = 0; i < children.length; i++) {
  20374. child = children[i]
  20375. if (child.tag === 'a') {
  20376. return child
  20377. }
  20378. if (child.children && (child = findAnchor(child.children))) {
  20379. return child
  20380. }
  20381. }
  20382. }
  20383. }
  20384. function createHref (base, fullPath, mode) {
  20385. var path = mode === 'hash' ? '/#' + fullPath : fullPath
  20386. return base ? cleanPath(base + path) : path
  20387. }
  20388. var _Vue
  20389. function install (Vue) {
  20390. if (install.installed) { return }
  20391. install.installed = true
  20392. _Vue = Vue
  20393. Object.defineProperty(Vue.prototype, '$router', {
  20394. get: function get () { return this.$root._router }
  20395. })
  20396. Object.defineProperty(Vue.prototype, '$route', {
  20397. get: function get$1 () { return this.$root._route }
  20398. })
  20399. Vue.mixin({
  20400. beforeCreate: function beforeCreate () {
  20401. if (this.$options.router) {
  20402. this._router = this.$options.router
  20403. this._router.init(this)
  20404. Vue.util.defineReactive(this, '_route', this._router.history.current)
  20405. }
  20406. }
  20407. })
  20408. Vue.component('router-view', View)
  20409. Vue.component('router-link', Link)
  20410. var strats = Vue.config.optionMergeStrategies
  20411. // use the same hook merging strategy for route hooks
  20412. strats.beforeRouteEnter = strats.beforeRouteLeave = strats.created
  20413. }
  20414. var __moduleExports = Array.isArray || function (arr) {
  20415. return Object.prototype.toString.call(arr) == '[object Array]';
  20416. };
  20417. var isarray = __moduleExports
  20418. /**
  20419. * Expose `pathToRegexp`.
  20420. */
  20421. var index = pathToRegexp
  20422. var parse_1 = parse
  20423. var compile_1 = compile
  20424. var tokensToFunction_1 = tokensToFunction
  20425. var tokensToRegExp_1 = tokensToRegExp
  20426. /**
  20427. * The main path matching regexp utility.
  20428. *
  20429. * @type {RegExp}
  20430. */
  20431. var PATH_REGEXP = new RegExp([
  20432. // Match escaped characters that would otherwise appear in future matches.
  20433. // This allows the user to escape special characters that won't transform.
  20434. '(\\\\.)',
  20435. // Match Express-style parameters and un-named parameters with a prefix
  20436. // and optional suffixes. Matches appear as:
  20437. //
  20438. // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
  20439. // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
  20440. // "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
  20441. '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
  20442. ].join('|'), 'g')
  20443. /**
  20444. * Parse a string for the raw tokens.
  20445. *
  20446. * @param {string} str
  20447. * @param {Object=} options
  20448. * @return {!Array}
  20449. */
  20450. function parse (str, options) {
  20451. var tokens = []
  20452. var key = 0
  20453. var index = 0
  20454. var path = ''
  20455. var defaultDelimiter = options && options.delimiter || '/'
  20456. var res
  20457. while ((res = PATH_REGEXP.exec(str)) != null) {
  20458. var m = res[0]
  20459. var escaped = res[1]
  20460. var offset = res.index
  20461. path += str.slice(index, offset)
  20462. index = offset + m.length
  20463. // Ignore already escaped sequences.
  20464. if (escaped) {
  20465. path += escaped[1]
  20466. continue
  20467. }
  20468. var next = str[index]
  20469. var prefix = res[2]
  20470. var name = res[3]
  20471. var capture = res[4]
  20472. var group = res[5]
  20473. var modifier = res[6]
  20474. var asterisk = res[7]
  20475. // Push the current path onto the tokens.
  20476. if (path) {
  20477. tokens.push(path)
  20478. path = ''
  20479. }
  20480. var partial = prefix != null && next != null && next !== prefix
  20481. var repeat = modifier === '+' || modifier === '*'
  20482. var optional = modifier === '?' || modifier === '*'
  20483. var delimiter = res[2] || defaultDelimiter
  20484. var pattern = capture || group
  20485. tokens.push({
  20486. name: name || key++,
  20487. prefix: prefix || '',
  20488. delimiter: delimiter,
  20489. optional: optional,
  20490. repeat: repeat,
  20491. partial: partial,
  20492. asterisk: !!asterisk,
  20493. pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
  20494. })
  20495. }
  20496. // Match any characters still remaining.
  20497. if (index < str.length) {
  20498. path += str.substr(index)
  20499. }
  20500. // If the path exists, push it onto the end.
  20501. if (path) {
  20502. tokens.push(path)
  20503. }
  20504. return tokens
  20505. }
  20506. /**
  20507. * Compile a string to a template function for the path.
  20508. *
  20509. * @param {string} str
  20510. * @param {Object=} options
  20511. * @return {!function(Object=, Object=)}
  20512. */
  20513. function compile (str, options) {
  20514. return tokensToFunction(parse(str, options))
  20515. }
  20516. /**
  20517. * Prettier encoding of URI path segments.
  20518. *
  20519. * @param {string}
  20520. * @return {string}
  20521. */
  20522. function encodeURIComponentPretty (str) {
  20523. return encodeURI(str).replace(/[\/?#]/g, function (c) {
  20524. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  20525. })
  20526. }
  20527. /**
  20528. * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
  20529. *
  20530. * @param {string}
  20531. * @return {string}
  20532. */
  20533. function encodeAsterisk (str) {
  20534. return encodeURI(str).replace(/[?#]/g, function (c) {
  20535. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  20536. })
  20537. }
  20538. /**
  20539. * Expose a method for transforming tokens into the path function.
  20540. */
  20541. function tokensToFunction (tokens) {
  20542. // Compile all the tokens into regexps.
  20543. var matches = new Array(tokens.length)
  20544. // Compile all the patterns before compilation.
  20545. for (var i = 0; i < tokens.length; i++) {
  20546. if (typeof tokens[i] === 'object') {
  20547. matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')
  20548. }
  20549. }
  20550. return function (obj, opts) {
  20551. var path = ''
  20552. var data = obj || {}
  20553. var options = opts || {}
  20554. var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent
  20555. for (var i = 0; i < tokens.length; i++) {
  20556. var token = tokens[i]
  20557. if (typeof token === 'string') {
  20558. path += token
  20559. continue
  20560. }
  20561. var value = data[token.name]
  20562. var segment
  20563. if (value == null) {
  20564. if (token.optional) {
  20565. // Prepend partial segment prefixes.
  20566. if (token.partial) {
  20567. path += token.prefix
  20568. }
  20569. continue
  20570. } else {
  20571. throw new TypeError('Expected "' + token.name + '" to be defined')
  20572. }
  20573. }
  20574. if (isarray(value)) {
  20575. if (!token.repeat) {
  20576. throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
  20577. }
  20578. if (value.length === 0) {
  20579. if (token.optional) {
  20580. continue
  20581. } else {
  20582. throw new TypeError('Expected "' + token.name + '" to not be empty')
  20583. }
  20584. }
  20585. for (var j = 0; j < value.length; j++) {
  20586. segment = encode(value[j])
  20587. if (!matches[i].test(segment)) {
  20588. throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
  20589. }
  20590. path += (j === 0 ? token.prefix : token.delimiter) + segment
  20591. }
  20592. continue
  20593. }
  20594. segment = token.asterisk ? encodeAsterisk(value) : encode(value)
  20595. if (!matches[i].test(segment)) {
  20596. throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
  20597. }
  20598. path += token.prefix + segment
  20599. }
  20600. return path
  20601. }
  20602. }
  20603. /**
  20604. * Escape a regular expression string.
  20605. *
  20606. * @param {string} str
  20607. * @return {string}
  20608. */
  20609. function escapeString (str) {
  20610. return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
  20611. }
  20612. /**
  20613. * Escape the capturing group by escaping special characters and meaning.
  20614. *
  20615. * @param {string} group
  20616. * @return {string}
  20617. */
  20618. function escapeGroup (group) {
  20619. return group.replace(/([=!:$\/()])/g, '\\$1')
  20620. }
  20621. /**
  20622. * Attach the keys as a property of the regexp.
  20623. *
  20624. * @param {!RegExp} re
  20625. * @param {Array} keys
  20626. * @return {!RegExp}
  20627. */
  20628. function attachKeys (re, keys) {
  20629. re.keys = keys
  20630. return re
  20631. }
  20632. /**
  20633. * Get the flags for a regexp from the options.
  20634. *
  20635. * @param {Object} options
  20636. * @return {string}
  20637. */
  20638. function flags (options) {
  20639. return options.sensitive ? '' : 'i'
  20640. }
  20641. /**
  20642. * Pull out keys from a regexp.
  20643. *
  20644. * @param {!RegExp} path
  20645. * @param {!Array} keys
  20646. * @return {!RegExp}
  20647. */
  20648. function regexpToRegexp (path, keys) {
  20649. // Use a negative lookahead to match only capturing groups.
  20650. var groups = path.source.match(/\((?!\?)/g)
  20651. if (groups) {
  20652. for (var i = 0; i < groups.length; i++) {
  20653. keys.push({
  20654. name: i,
  20655. prefix: null,
  20656. delimiter: null,
  20657. optional: false,
  20658. repeat: false,
  20659. partial: false,
  20660. asterisk: false,
  20661. pattern: null
  20662. })
  20663. }
  20664. }
  20665. return attachKeys(path, keys)
  20666. }
  20667. /**
  20668. * Transform an array into a regexp.
  20669. *
  20670. * @param {!Array} path
  20671. * @param {Array} keys
  20672. * @param {!Object} options
  20673. * @return {!RegExp}
  20674. */
  20675. function arrayToRegexp (path, keys, options) {
  20676. var parts = []
  20677. for (var i = 0; i < path.length; i++) {
  20678. parts.push(pathToRegexp(path[i], keys, options).source)
  20679. }
  20680. var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))
  20681. return attachKeys(regexp, keys)
  20682. }
  20683. /**
  20684. * Create a path regexp from string input.
  20685. *
  20686. * @param {string} path
  20687. * @param {!Array} keys
  20688. * @param {!Object} options
  20689. * @return {!RegExp}
  20690. */
  20691. function stringToRegexp (path, keys, options) {
  20692. return tokensToRegExp(parse(path, options), keys, options)
  20693. }
  20694. /**
  20695. * Expose a function for taking tokens and returning a RegExp.
  20696. *
  20697. * @param {!Array} tokens
  20698. * @param {(Array|Object)=} keys
  20699. * @param {Object=} options
  20700. * @return {!RegExp}
  20701. */
  20702. function tokensToRegExp (tokens, keys, options) {
  20703. if (!isarray(keys)) {
  20704. options = /** @type {!Object} */ (keys || options)
  20705. keys = []
  20706. }
  20707. options = options || {}
  20708. var strict = options.strict
  20709. var end = options.end !== false
  20710. var route = ''
  20711. // Iterate over the tokens and create our regexp string.
  20712. for (var i = 0; i < tokens.length; i++) {
  20713. var token = tokens[i]
  20714. if (typeof token === 'string') {
  20715. route += escapeString(token)
  20716. } else {
  20717. var prefix = escapeString(token.prefix)
  20718. var capture = '(?:' + token.pattern + ')'
  20719. keys.push(token)
  20720. if (token.repeat) {
  20721. capture += '(?:' + prefix + capture + ')*'
  20722. }
  20723. if (token.optional) {
  20724. if (!token.partial) {
  20725. capture = '(?:' + prefix + '(' + capture + '))?'
  20726. } else {
  20727. capture = prefix + '(' + capture + ')?'
  20728. }
  20729. } else {
  20730. capture = prefix + '(' + capture + ')'
  20731. }
  20732. route += capture
  20733. }
  20734. }
  20735. var delimiter = escapeString(options.delimiter || '/')
  20736. var endsWithDelimiter = route.slice(-delimiter.length) === delimiter
  20737. // In non-strict mode we allow a slash at the end of match. If the path to
  20738. // match already ends with a slash, we remove it for consistency. The slash
  20739. // is valid at the end of a path match, not in the middle. This is important
  20740. // in non-ending mode, where "/test/" shouldn't match "/test//route".
  20741. if (!strict) {
  20742. route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'
  20743. }
  20744. if (end) {
  20745. route += '$'
  20746. } else {
  20747. // In non-ending mode, we need the capturing groups to match as much as
  20748. // possible by using a positive lookahead to the end or next path segment.
  20749. route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'
  20750. }
  20751. return attachKeys(new RegExp('^' + route, flags(options)), keys)
  20752. }
  20753. /**
  20754. * Normalize the given path string, returning a regular expression.
  20755. *
  20756. * An empty array can be passed in for the keys, which will hold the
  20757. * placeholder key descriptions. For example, using `/user/:id`, `keys` will
  20758. * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
  20759. *
  20760. * @param {(string|RegExp|Array)} path
  20761. * @param {(Array|Object)=} keys
  20762. * @param {Object=} options
  20763. * @return {!RegExp}
  20764. */
  20765. function pathToRegexp (path, keys, options) {
  20766. if (!isarray(keys)) {
  20767. options = /** @type {!Object} */ (keys || options)
  20768. keys = []
  20769. }
  20770. options = options || {}
  20771. if (path instanceof RegExp) {
  20772. return regexpToRegexp(path, /** @type {!Array} */ (keys))
  20773. }
  20774. if (isarray(path)) {
  20775. return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
  20776. }
  20777. return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
  20778. }
  20779. index.parse = parse_1;
  20780. index.compile = compile_1;
  20781. index.tokensToFunction = tokensToFunction_1;
  20782. index.tokensToRegExp = tokensToRegExp_1;
  20783. /* */
  20784. function createRouteMap (routes) {
  20785. var pathMap = Object.create(null)
  20786. var nameMap = Object.create(null)
  20787. routes.forEach(function (route) {
  20788. addRouteRecord(pathMap, nameMap, route)
  20789. })
  20790. return {
  20791. pathMap: pathMap,
  20792. nameMap: nameMap
  20793. }
  20794. }
  20795. function addRouteRecord (
  20796. pathMap,
  20797. nameMap,
  20798. route,
  20799. parent,
  20800. matchAs
  20801. ) {
  20802. var path = route.path;
  20803. var name = route.name;
  20804. assert(path != null, "\"path\" is required in a route configuration.")
  20805. var record = {
  20806. path: normalizePath(path, parent),
  20807. components: route.components || { default: route.component },
  20808. instances: {},
  20809. name: name,
  20810. parent: parent,
  20811. matchAs: matchAs,
  20812. redirect: route.redirect,
  20813. beforeEnter: route.beforeEnter,
  20814. meta: route.meta || {}
  20815. }
  20816. if (route.children) {
  20817. // Warn if route is named and has a default child route.
  20818. // If users navigate to this route by name, the default child will
  20819. // not be rendered (GH Issue #629)
  20820. if (false) {}
  20821. route.children.forEach(function (child) {
  20822. addRouteRecord(pathMap, nameMap, child, record)
  20823. })
  20824. }
  20825. if (route.alias !== undefined) {
  20826. if (Array.isArray(route.alias)) {
  20827. route.alias.forEach(function (alias) {
  20828. addRouteRecord(pathMap, nameMap, { path: alias }, parent, record.path)
  20829. })
  20830. } else {
  20831. addRouteRecord(pathMap, nameMap, { path: route.alias }, parent, record.path)
  20832. }
  20833. }
  20834. pathMap[record.path] = record
  20835. if (name) {
  20836. if (!nameMap[name]) {
  20837. nameMap[name] = record
  20838. } else {
  20839. warn(false, ("Duplicate named routes definition: { name: \"" + name + "\", path: \"" + (record.path) + "\" }"))
  20840. }
  20841. }
  20842. }
  20843. function normalizePath (path, parent) {
  20844. path = path.replace(/\/$/, '')
  20845. if (path[0] === '/') { return path }
  20846. if (parent == null) { return path }
  20847. return cleanPath(((parent.path) + "/" + path))
  20848. }
  20849. /* */
  20850. var regexpCache = Object.create(null)
  20851. var regexpCompileCache = Object.create(null)
  20852. function createMatcher (routes) {
  20853. var ref = createRouteMap(routes);
  20854. var pathMap = ref.pathMap;
  20855. var nameMap = ref.nameMap;
  20856. function match (
  20857. raw,
  20858. currentRoute,
  20859. redirectedFrom
  20860. ) {
  20861. var location = normalizeLocation(raw, currentRoute)
  20862. var name = location.name;
  20863. if (name) {
  20864. var record = nameMap[name]
  20865. if (typeof location.params !== 'object') {
  20866. location.params = {}
  20867. }
  20868. if (currentRoute && typeof currentRoute.params === 'object') {
  20869. for (var key in currentRoute.params) {
  20870. if (!(key in location.params)) {
  20871. location.params[key] = currentRoute.params[key]
  20872. }
  20873. }
  20874. }
  20875. if (record) {
  20876. location.path = fillParams(record.path, location.params, ("named route \"" + name + "\""))
  20877. return _createRoute(record, location, redirectedFrom)
  20878. }
  20879. } else if (location.path) {
  20880. location.params = {}
  20881. for (var path in pathMap) {
  20882. if (matchRoute(path, location.params, location.path)) {
  20883. return _createRoute(pathMap[path], location, redirectedFrom)
  20884. }
  20885. }
  20886. }
  20887. // no match
  20888. return _createRoute(null, location)
  20889. }
  20890. function redirect (
  20891. record,
  20892. location
  20893. ) {
  20894. var originalRedirect = record.redirect
  20895. var redirect = typeof originalRedirect === 'function'
  20896. ? originalRedirect(createRoute(record, location))
  20897. : originalRedirect
  20898. if (typeof redirect === 'string') {
  20899. redirect = { path: redirect }
  20900. }
  20901. if (!redirect || typeof redirect !== 'object') {
  20902. warn(false, ("invalid redirect option: " + (JSON.stringify(redirect))))
  20903. return _createRoute(null, location)
  20904. }
  20905. var re = redirect
  20906. var name = re.name;
  20907. var path = re.path;
  20908. var query = location.query;
  20909. var hash = location.hash;
  20910. var params = location.params;
  20911. query = re.hasOwnProperty('query') ? re.query : query
  20912. hash = re.hasOwnProperty('hash') ? re.hash : hash
  20913. params = re.hasOwnProperty('params') ? re.params : params
  20914. if (name) {
  20915. // resolved named direct
  20916. var targetRecord = nameMap[name]
  20917. assert(targetRecord, ("redirect failed: named route \"" + name + "\" not found."))
  20918. return match({
  20919. _normalized: true,
  20920. name: name,
  20921. query: query,
  20922. hash: hash,
  20923. params: params
  20924. }, undefined, location)
  20925. } else if (path) {
  20926. // 1. resolve relative redirect
  20927. var rawPath = resolveRecordPath(path, record)
  20928. // 2. resolve params
  20929. var resolvedPath = fillParams(rawPath, params, ("redirect route with path \"" + rawPath + "\""))
  20930. // 3. rematch with existing query and hash
  20931. return match({
  20932. _normalized: true,
  20933. path: resolvedPath,
  20934. query: query,
  20935. hash: hash
  20936. }, undefined, location)
  20937. } else {
  20938. warn(false, ("invalid redirect option: " + (JSON.stringify(redirect))))
  20939. return _createRoute(null, location)
  20940. }
  20941. }
  20942. function alias (
  20943. record,
  20944. location,
  20945. matchAs
  20946. ) {
  20947. var aliasedPath = fillParams(matchAs, location.params, ("aliased route with path \"" + matchAs + "\""))
  20948. var aliasedMatch = match({
  20949. _normalized: true,
  20950. path: aliasedPath
  20951. })
  20952. if (aliasedMatch) {
  20953. var matched = aliasedMatch.matched
  20954. var aliasedRecord = matched[matched.length - 1]
  20955. location.params = aliasedMatch.params
  20956. return _createRoute(aliasedRecord, location)
  20957. }
  20958. return _createRoute(null, location)
  20959. }
  20960. function _createRoute (
  20961. record,
  20962. location,
  20963. redirectedFrom
  20964. ) {
  20965. if (record && record.redirect) {
  20966. return redirect(record, redirectedFrom || location)
  20967. }
  20968. if (record && record.matchAs) {
  20969. return alias(record, location, record.matchAs)
  20970. }
  20971. return createRoute(record, location, redirectedFrom)
  20972. }
  20973. return match
  20974. }
  20975. function matchRoute (
  20976. path,
  20977. params,
  20978. pathname
  20979. ) {
  20980. var keys, regexp
  20981. var hit = regexpCache[path]
  20982. if (hit) {
  20983. keys = hit.keys
  20984. regexp = hit.regexp
  20985. } else {
  20986. keys = []
  20987. regexp = index(path, keys)
  20988. regexpCache[path] = { keys: keys, regexp: regexp }
  20989. }
  20990. var m = pathname.match(regexp)
  20991. if (!m) {
  20992. return false
  20993. } else if (!params) {
  20994. return true
  20995. }
  20996. for (var i = 1, len = m.length; i < len; ++i) {
  20997. var key = keys[i - 1]
  20998. var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i]
  20999. if (key) { params[key.name] = val }
  21000. }
  21001. return true
  21002. }
  21003. function fillParams (
  21004. path,
  21005. params,
  21006. routeMsg
  21007. ) {
  21008. try {
  21009. var filler =
  21010. regexpCompileCache[path] ||
  21011. (regexpCompileCache[path] = index.compile(path))
  21012. return filler(params || {}, { pretty: true })
  21013. } catch (e) {
  21014. assert(false, ("missing param for " + routeMsg + ": " + (e.message)))
  21015. return ''
  21016. }
  21017. }
  21018. function resolveRecordPath (path, record) {
  21019. return resolvePath(path, record.parent ? record.parent.path : '/', true)
  21020. }
  21021. /* */
  21022. var inBrowser = typeof window !== 'undefined'
  21023. var supportsHistory = inBrowser && (function () {
  21024. var ua = window.navigator.userAgent
  21025. if (
  21026. (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&
  21027. ua.indexOf('Mobile Safari') !== -1 &&
  21028. ua.indexOf('Chrome') === -1 &&
  21029. ua.indexOf('Windows Phone') === -1
  21030. ) {
  21031. return false
  21032. }
  21033. return window.history && 'pushState' in window.history
  21034. })()
  21035. /* */
  21036. function runQueue (queue, fn, cb) {
  21037. var step = function (index) {
  21038. if (index >= queue.length) {
  21039. cb()
  21040. } else {
  21041. if (queue[index]) {
  21042. fn(queue[index], function () {
  21043. step(index + 1)
  21044. })
  21045. } else {
  21046. step(index + 1)
  21047. }
  21048. }
  21049. }
  21050. step(0)
  21051. }
  21052. /* */
  21053. var History = function History (router, base) {
  21054. this.router = router
  21055. this.base = normalizeBase(base)
  21056. // start with a route object that stands for "nowhere"
  21057. this.current = START
  21058. this.pending = null
  21059. };
  21060. History.prototype.listen = function listen (cb) {
  21061. this.cb = cb
  21062. };
  21063. History.prototype.transitionTo = function transitionTo (location, cb) {
  21064. var this$1 = this;
  21065. var route = this.router.match(location, this.current)
  21066. this.confirmTransition(route, function () {
  21067. this$1.updateRoute(route)
  21068. cb && cb(route)
  21069. this$1.ensureURL()
  21070. })
  21071. };
  21072. History.prototype.confirmTransition = function confirmTransition (route, cb) {
  21073. var this$1 = this;
  21074. var current = this.current
  21075. if (isSameRoute(route, current)) {
  21076. this.ensureURL()
  21077. return
  21078. }
  21079. var ref = resolveQueue(this.current.matched, route.matched);
  21080. var deactivated = ref.deactivated;
  21081. var activated = ref.activated;
  21082. var queue = [].concat(
  21083. // in-component leave guards
  21084. extractLeaveGuards(deactivated),
  21085. // global before hooks
  21086. this.router.beforeHooks,
  21087. // enter guards
  21088. activated.map(function (m) { return m.beforeEnter; }),
  21089. // async components
  21090. resolveAsyncComponents(activated)
  21091. )
  21092. this.pending = route
  21093. var iterator = function (hook, next) {
  21094. if (this$1.pending !== route) { return }
  21095. hook(route, current, function (to) {
  21096. if (to === false) {
  21097. // next(false) -> abort navigation, ensure current URL
  21098. this$1.ensureURL(true)
  21099. } else if (typeof to === 'string' || typeof to === 'object') {
  21100. // next('/') or next({ path: '/' }) -> redirect
  21101. this$1.push(to)
  21102. } else {
  21103. // confirm transition and pass on the value
  21104. next(to)
  21105. }
  21106. })
  21107. }
  21108. runQueue(queue, iterator, function () {
  21109. var postEnterCbs = []
  21110. var enterGuards = extractEnterGuards(activated, postEnterCbs, function () {
  21111. return this$1.current === route
  21112. })
  21113. // wait until async components are resolved before
  21114. // extracting in-component enter guards
  21115. runQueue(enterGuards, iterator, function () {
  21116. if (this$1.pending === route) {
  21117. this$1.pending = null
  21118. cb(route)
  21119. this$1.router.app.$nextTick(function () {
  21120. postEnterCbs.forEach(function (cb) { return cb(); })
  21121. })
  21122. }
  21123. })
  21124. })
  21125. };
  21126. History.prototype.updateRoute = function updateRoute (route) {
  21127. var prev = this.current
  21128. this.current = route
  21129. this.cb && this.cb(route)
  21130. this.router.afterHooks.forEach(function (hook) {
  21131. hook && hook(route, prev)
  21132. })
  21133. };
  21134. function normalizeBase (base) {
  21135. if (!base) {
  21136. if (inBrowser) {
  21137. // respect <base> tag
  21138. var baseEl = document.querySelector('base')
  21139. base = baseEl ? baseEl.getAttribute('href') : '/'
  21140. } else {
  21141. base = '/'
  21142. }
  21143. }
  21144. // make sure there's the starting slash
  21145. if (base.charAt(0) !== '/') {
  21146. base = '/' + base
  21147. }
  21148. // remove trailing slash
  21149. return base.replace(/\/$/, '')
  21150. }
  21151. function resolveQueue (
  21152. current,
  21153. next
  21154. ) {
  21155. var i
  21156. var max = Math.max(current.length, next.length)
  21157. for (i = 0; i < max; i++) {
  21158. if (current[i] !== next[i]) {
  21159. break
  21160. }
  21161. }
  21162. return {
  21163. activated: next.slice(i),
  21164. deactivated: current.slice(i)
  21165. }
  21166. }
  21167. function extractGuard (
  21168. def,
  21169. key
  21170. ) {
  21171. if (typeof def !== 'function') {
  21172. // extend now so that global mixins are applied.
  21173. def = _Vue.extend(def)
  21174. }
  21175. return def.options[key]
  21176. }
  21177. function extractLeaveGuards (matched) {
  21178. return flatten(flatMapComponents(matched, function (def, instance) {
  21179. var guard = extractGuard(def, 'beforeRouteLeave')
  21180. if (guard) {
  21181. return Array.isArray(guard)
  21182. ? guard.map(function (guard) { return wrapLeaveGuard(guard, instance); })
  21183. : wrapLeaveGuard(guard, instance)
  21184. }
  21185. }).reverse())
  21186. }
  21187. function wrapLeaveGuard (
  21188. guard,
  21189. instance
  21190. ) {
  21191. return function routeLeaveGuard () {
  21192. return guard.apply(instance, arguments)
  21193. }
  21194. }
  21195. function extractEnterGuards (
  21196. matched,
  21197. cbs,
  21198. isValid
  21199. ) {
  21200. return flatten(flatMapComponents(matched, function (def, _, match, key) {
  21201. var guard = extractGuard(def, 'beforeRouteEnter')
  21202. if (guard) {
  21203. return Array.isArray(guard)
  21204. ? guard.map(function (guard) { return wrapEnterGuard(guard, cbs, match, key, isValid); })
  21205. : wrapEnterGuard(guard, cbs, match, key, isValid)
  21206. }
  21207. }))
  21208. }
  21209. function wrapEnterGuard (
  21210. guard,
  21211. cbs,
  21212. match,
  21213. key,
  21214. isValid
  21215. ) {
  21216. return function routeEnterGuard (to, from, next) {
  21217. return guard(to, from, function (cb) {
  21218. next(cb)
  21219. if (typeof cb === 'function') {
  21220. cbs.push(function () {
  21221. // #750
  21222. // if a router-view is wrapped with an out-in transition,
  21223. // the instance may not have been registered at this time.
  21224. // we will need to poll for registration until current route
  21225. // is no longer valid.
  21226. poll(cb, match.instances, key, isValid)
  21227. })
  21228. }
  21229. })
  21230. }
  21231. }
  21232. function poll (
  21233. cb, // somehow flow cannot infer this is a function
  21234. instances,
  21235. key,
  21236. isValid
  21237. ) {
  21238. if (instances[key]) {
  21239. cb(instances[key])
  21240. } else if (isValid()) {
  21241. setTimeout(function () {
  21242. poll(cb, instances, key, isValid)
  21243. }, 16)
  21244. }
  21245. }
  21246. function resolveAsyncComponents (matched) {
  21247. return flatMapComponents(matched, function (def, _, match, key) {
  21248. // if it's a function and doesn't have Vue options attached,
  21249. // assume it's an async component resolve function.
  21250. // we are not using Vue's default async resolving mechanism because
  21251. // we want to halt the navigation until the incoming component has been
  21252. // resolved.
  21253. if (typeof def === 'function' && !def.options) {
  21254. return function (to, from, next) {
  21255. var resolve = function (resolvedDef) {
  21256. match.components[key] = resolvedDef
  21257. next()
  21258. }
  21259. var reject = function (reason) {
  21260. warn(false, ("Failed to resolve async component " + key + ": " + reason))
  21261. next(false)
  21262. }
  21263. var res = def(resolve, reject)
  21264. if (res && typeof res.then === 'function') {
  21265. res.then(resolve, reject)
  21266. }
  21267. }
  21268. }
  21269. })
  21270. }
  21271. function flatMapComponents (
  21272. matched,
  21273. fn
  21274. ) {
  21275. return flatten(matched.map(function (m) {
  21276. return Object.keys(m.components).map(function (key) { return fn(
  21277. m.components[key],
  21278. m.instances[key],
  21279. m, key
  21280. ); })
  21281. }))
  21282. }
  21283. function flatten (arr) {
  21284. return Array.prototype.concat.apply([], arr)
  21285. }
  21286. /* */
  21287. var positionStore = Object.create(null)
  21288. function saveScrollPosition (key) {
  21289. if (!key) { return }
  21290. positionStore[key] = {
  21291. x: window.pageXOffset,
  21292. y: window.pageYOffset
  21293. }
  21294. }
  21295. function getScrollPosition (key) {
  21296. if (!key) { return }
  21297. return positionStore[key]
  21298. }
  21299. function getElementPosition (el) {
  21300. var docRect = document.documentElement.getBoundingClientRect()
  21301. var elRect = el.getBoundingClientRect()
  21302. return {
  21303. x: elRect.left - docRect.left,
  21304. y: elRect.top - docRect.top
  21305. }
  21306. }
  21307. function isValidPosition (obj) {
  21308. return isNumber(obj.x) || isNumber(obj.y)
  21309. }
  21310. function normalizePosition (obj) {
  21311. return {
  21312. x: isNumber(obj.x) ? obj.x : window.pageXOffset,
  21313. y: isNumber(obj.y) ? obj.y : window.pageYOffset
  21314. }
  21315. }
  21316. function isNumber (v) {
  21317. return typeof v === 'number'
  21318. }
  21319. /* */
  21320. var genKey = function () { return String(Date.now()); }
  21321. var _key = genKey()
  21322. var HTML5History = (function (History) {
  21323. function HTML5History (router, base) {
  21324. var this$1 = this;
  21325. History.call(this, router, base)
  21326. var expectScroll = router.options.scrollBehavior
  21327. window.addEventListener('popstate', function (e) {
  21328. _key = e.state && e.state.key
  21329. var current = this$1.current
  21330. this$1.transitionTo(getLocation(this$1.base), function (next) {
  21331. if (expectScroll) {
  21332. this$1.handleScroll(next, current, true)
  21333. }
  21334. })
  21335. })
  21336. if (expectScroll) {
  21337. window.addEventListener('scroll', function () {
  21338. saveScrollPosition(_key)
  21339. })
  21340. }
  21341. }
  21342. if ( History ) HTML5History.__proto__ = History;
  21343. HTML5History.prototype = Object.create( History && History.prototype );
  21344. HTML5History.prototype.constructor = HTML5History;
  21345. HTML5History.prototype.go = function go (n) {
  21346. window.history.go(n)
  21347. };
  21348. HTML5History.prototype.push = function push (location) {
  21349. var this$1 = this;
  21350. var current = this.current
  21351. this.transitionTo(location, function (route) {
  21352. pushState(cleanPath(this$1.base + route.fullPath))
  21353. this$1.handleScroll(route, current, false)
  21354. })
  21355. };
  21356. HTML5History.prototype.replace = function replace (location) {
  21357. var this$1 = this;
  21358. var current = this.current
  21359. this.transitionTo(location, function (route) {
  21360. replaceState(cleanPath(this$1.base + route.fullPath))
  21361. this$1.handleScroll(route, current, false)
  21362. })
  21363. };
  21364. HTML5History.prototype.ensureURL = function ensureURL (push) {
  21365. if (getLocation(this.base) !== this.current.fullPath) {
  21366. var current = cleanPath(this.base + this.current.fullPath)
  21367. push ? pushState(current) : replaceState(current)
  21368. }
  21369. };
  21370. HTML5History.prototype.handleScroll = function handleScroll (to, from, isPop) {
  21371. var router = this.router
  21372. if (!router.app) {
  21373. return
  21374. }
  21375. var behavior = router.options.scrollBehavior
  21376. if (!behavior) {
  21377. return
  21378. }
  21379. assert(typeof behavior === 'function', "scrollBehavior must be a function")
  21380. // wait until re-render finishes before scrolling
  21381. router.app.$nextTick(function () {
  21382. var position = getScrollPosition(_key)
  21383. var shouldScroll = behavior(to, from, isPop ? position : null)
  21384. if (!shouldScroll) {
  21385. return
  21386. }
  21387. var isObject = typeof shouldScroll === 'object'
  21388. if (isObject && typeof shouldScroll.selector === 'string') {
  21389. var el = document.querySelector(shouldScroll.selector)
  21390. if (el) {
  21391. position = getElementPosition(el)
  21392. } else if (isValidPosition(shouldScroll)) {
  21393. position = normalizePosition(shouldScroll)
  21394. }
  21395. } else if (isObject && isValidPosition(shouldScroll)) {
  21396. position = normalizePosition(shouldScroll)
  21397. }
  21398. if (position) {
  21399. window.scrollTo(position.x, position.y)
  21400. }
  21401. })
  21402. };
  21403. return HTML5History;
  21404. }(History));
  21405. function getLocation (base) {
  21406. var path = window.location.pathname
  21407. if (base && path.indexOf(base) === 0) {
  21408. path = path.slice(base.length)
  21409. }
  21410. return (path || '/') + window.location.search + window.location.hash
  21411. }
  21412. function pushState (url, replace) {
  21413. // try...catch the pushState call to get around Safari
  21414. // DOM Exception 18 where it limits to 100 pushState calls
  21415. var history = window.history
  21416. try {
  21417. if (replace) {
  21418. history.replaceState({ key: _key }, '', url)
  21419. } else {
  21420. _key = genKey()
  21421. history.pushState({ key: _key }, '', url)
  21422. }
  21423. saveScrollPosition(_key)
  21424. } catch (e) {
  21425. window.location[replace ? 'assign' : 'replace'](url)
  21426. }
  21427. }
  21428. function replaceState (url) {
  21429. pushState(url, true)
  21430. }
  21431. /* */
  21432. var HashHistory = (function (History) {
  21433. function HashHistory (router, base, fallback) {
  21434. History.call(this, router, base)
  21435. // check history fallback deeplinking
  21436. if (fallback && this.checkFallback()) {
  21437. return
  21438. }
  21439. ensureSlash()
  21440. }
  21441. if ( History ) HashHistory.__proto__ = History;
  21442. HashHistory.prototype = Object.create( History && History.prototype );
  21443. HashHistory.prototype.constructor = HashHistory;
  21444. HashHistory.prototype.checkFallback = function checkFallback () {
  21445. var location = getLocation(this.base)
  21446. if (!/^\/#/.test(location)) {
  21447. window.location.replace(
  21448. cleanPath(this.base + '/#' + location)
  21449. )
  21450. return true
  21451. }
  21452. };
  21453. HashHistory.prototype.onHashChange = function onHashChange () {
  21454. if (!ensureSlash()) {
  21455. return
  21456. }
  21457. this.transitionTo(getHash(), function (route) {
  21458. replaceHash(route.fullPath)
  21459. })
  21460. };
  21461. HashHistory.prototype.push = function push (location) {
  21462. this.transitionTo(location, function (route) {
  21463. pushHash(route.fullPath)
  21464. })
  21465. };
  21466. HashHistory.prototype.replace = function replace (location) {
  21467. this.transitionTo(location, function (route) {
  21468. replaceHash(route.fullPath)
  21469. })
  21470. };
  21471. HashHistory.prototype.go = function go (n) {
  21472. window.history.go(n)
  21473. };
  21474. HashHistory.prototype.ensureURL = function ensureURL (push) {
  21475. var current = this.current.fullPath
  21476. if (getHash() !== current) {
  21477. push ? pushHash(current) : replaceHash(current)
  21478. }
  21479. };
  21480. return HashHistory;
  21481. }(History));
  21482. function ensureSlash () {
  21483. var path = getHash()
  21484. if (path.charAt(0) === '/') {
  21485. return true
  21486. }
  21487. replaceHash('/' + path)
  21488. return false
  21489. }
  21490. function getHash () {
  21491. // We can't use window.location.hash here because it's not
  21492. // consistent across browsers - Firefox will pre-decode it!
  21493. var href = window.location.href
  21494. var index = href.indexOf('#')
  21495. return index === -1 ? '' : href.slice(index + 1)
  21496. }
  21497. function pushHash (path) {
  21498. window.location.hash = path
  21499. }
  21500. function replaceHash (path) {
  21501. var i = window.location.href.indexOf('#')
  21502. window.location.replace(
  21503. window.location.href.slice(0, i >= 0 ? i : 0) + '#' + path
  21504. )
  21505. }
  21506. /* */
  21507. var AbstractHistory = (function (History) {
  21508. function AbstractHistory (router) {
  21509. History.call(this, router)
  21510. this.stack = []
  21511. this.index = -1
  21512. }
  21513. if ( History ) AbstractHistory.__proto__ = History;
  21514. AbstractHistory.prototype = Object.create( History && History.prototype );
  21515. AbstractHistory.prototype.constructor = AbstractHistory;
  21516. AbstractHistory.prototype.push = function push (location) {
  21517. var this$1 = this;
  21518. this.transitionTo(location, function (route) {
  21519. this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route)
  21520. this$1.index++
  21521. })
  21522. };
  21523. AbstractHistory.prototype.replace = function replace (location) {
  21524. var this$1 = this;
  21525. this.transitionTo(location, function (route) {
  21526. this$1.stack = this$1.stack.slice(0, this$1.index).concat(route)
  21527. })
  21528. };
  21529. AbstractHistory.prototype.go = function go (n) {
  21530. var this$1 = this;
  21531. var targetIndex = this.index + n
  21532. if (targetIndex < 0 || targetIndex >= this.stack.length) {
  21533. return
  21534. }
  21535. var route = this.stack[targetIndex]
  21536. this.confirmTransition(route, function () {
  21537. this$1.index = targetIndex
  21538. this$1.updateRoute(route)
  21539. })
  21540. };
  21541. AbstractHistory.prototype.ensureURL = function ensureURL () {
  21542. // noop
  21543. };
  21544. return AbstractHistory;
  21545. }(History));
  21546. /* */
  21547. var VueRouter = function VueRouter (options) {
  21548. if ( options === void 0 ) options = {};
  21549. this.app = null
  21550. this.options = options
  21551. this.beforeHooks = []
  21552. this.afterHooks = []
  21553. this.match = createMatcher(options.routes || [])
  21554. var mode = options.mode || 'hash'
  21555. this.fallback = mode === 'history' && !supportsHistory
  21556. if (this.fallback) {
  21557. mode = 'hash'
  21558. }
  21559. if (!inBrowser) {
  21560. mode = 'abstract'
  21561. }
  21562. this.mode = mode
  21563. switch (mode) {
  21564. case 'history':
  21565. this.history = new HTML5History(this, options.base)
  21566. break
  21567. case 'hash':
  21568. this.history = new HashHistory(this, options.base, this.fallback)
  21569. break
  21570. case 'abstract':
  21571. this.history = new AbstractHistory(this)
  21572. break
  21573. default:
  21574. assert(false, ("invalid mode: " + mode))
  21575. }
  21576. };
  21577. var prototypeAccessors = { currentRoute: {} };
  21578. prototypeAccessors.currentRoute.get = function () {
  21579. return this.history && this.history.current
  21580. };
  21581. VueRouter.prototype.init = function init (app /* Vue component instance */) {
  21582. var this$1 = this;
  21583. assert(
  21584. install.installed,
  21585. "not installed. Make sure to call `Vue.use(VueRouter)` " +
  21586. "before creating root instance."
  21587. )
  21588. this.app = app
  21589. var history = this.history
  21590. if (history instanceof HTML5History) {
  21591. history.transitionTo(getLocation(history.base))
  21592. } else if (history instanceof HashHistory) {
  21593. history.transitionTo(getHash(), function () {
  21594. window.addEventListener('hashchange', function () {
  21595. history.onHashChange()
  21596. })
  21597. })
  21598. }
  21599. history.listen(function (route) {
  21600. this$1.app._route = route
  21601. })
  21602. };
  21603. VueRouter.prototype.beforeEach = function beforeEach (fn) {
  21604. this.beforeHooks.push(fn)
  21605. };
  21606. VueRouter.prototype.afterEach = function afterEach (fn) {
  21607. this.afterHooks.push(fn)
  21608. };
  21609. VueRouter.prototype.push = function push (location) {
  21610. this.history.push(location)
  21611. };
  21612. VueRouter.prototype.replace = function replace (location) {
  21613. this.history.replace(location)
  21614. };
  21615. VueRouter.prototype.go = function go (n) {
  21616. this.history.go(n)
  21617. };
  21618. VueRouter.prototype.back = function back () {
  21619. this.go(-1)
  21620. };
  21621. VueRouter.prototype.forward = function forward () {
  21622. this.go(1)
  21623. };
  21624. VueRouter.prototype.getMatchedComponents = function getMatchedComponents () {
  21625. if (!this.currentRoute) {
  21626. return []
  21627. }
  21628. return [].concat.apply([], this.currentRoute.matched.map(function (m) {
  21629. return Object.keys(m.components).map(function (key) {
  21630. return m.components[key]
  21631. })
  21632. }))
  21633. };
  21634. Object.defineProperties( VueRouter.prototype, prototypeAccessors );
  21635. VueRouter.install = install
  21636. if (inBrowser && window.Vue) {
  21637. window.Vue.use(VueRouter)
  21638. }
  21639. return VueRouter;
  21640. })));
  21641. /***/ },
  21642. /* 218 */
  21643. /***/ function(module, exports, __webpack_require__) {
  21644. // style-loader: Adds some css to the DOM by adding a <style> tag
  21645. // load the styles
  21646. var content = __webpack_require__(163);
  21647. if(typeof content === 'string') content = [[module.i, content, '']];
  21648. // add the styles to the DOM
  21649. var update = __webpack_require__(21)(content, {});
  21650. if(content.locals) module.exports = content.locals;
  21651. // Hot Module Replacement
  21652. if(false) {
  21653. // When the styles change, update the <style> tags
  21654. if(!content.locals) {
  21655. module.hot.accept("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-28c275d9!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Fingerprint.vue", function() {
  21656. var newContent = require("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-28c275d9!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Fingerprint.vue");
  21657. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  21658. update(newContent);
  21659. });
  21660. }
  21661. // When the module is disposed, remove the <style> tags
  21662. module.hot.dispose(function() { update(); });
  21663. }
  21664. /***/ },
  21665. /* 219 */
  21666. /***/ function(module, exports, __webpack_require__) {
  21667. // style-loader: Adds some css to the DOM by adding a <style> tag
  21668. // load the styles
  21669. var content = __webpack_require__(164);
  21670. if(typeof content === 'string') content = [[module.i, content, '']];
  21671. // add the styles to the DOM
  21672. var update = __webpack_require__(21)(content, {});
  21673. if(content.locals) module.exports = content.locals;
  21674. // Hot Module Replacement
  21675. if(false) {
  21676. // When the styles change, update the <style> tags
  21677. if(!content.locals) {
  21678. module.hot.accept("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-4e146d4e!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./PasswordGenerator.vue", function() {
  21679. var newContent = require("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-4e146d4e!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./PasswordGenerator.vue");
  21680. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  21681. update(newContent);
  21682. });
  21683. }
  21684. // When the module is disposed, remove the <style> tags
  21685. module.hot.dispose(function() { update(); });
  21686. }
  21687. /***/ },
  21688. /* 220 */
  21689. /***/ function(module, exports, __webpack_require__) {
  21690. // style-loader: Adds some css to the DOM by adding a <style> tag
  21691. // load the styles
  21692. var content = __webpack_require__(165);
  21693. if(typeof content === 'string') content = [[module.i, content, '']];
  21694. // add the styles to the DOM
  21695. var update = __webpack_require__(21)(content, {});
  21696. if(content.locals) module.exports = content.locals;
  21697. // Hot Module Replacement
  21698. if(false) {
  21699. // When the styles change, update the <style> tags
  21700. if(!content.locals) {
  21701. module.hot.accept("!!./../node_modules/css-loader/index.js!./../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-7d2a5ef8!./../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./LessPass.vue", function() {
  21702. var newContent = require("!!./../node_modules/css-loader/index.js!./../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-7d2a5ef8!./../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./LessPass.vue");
  21703. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  21704. update(newContent);
  21705. });
  21706. }
  21707. // When the module is disposed, remove the <style> tags
  21708. module.hot.dispose(function() { update(); });
  21709. }
  21710. /***/ },
  21711. /* 221 */
  21712. /***/ function(module, exports, __webpack_require__) {
  21713. // style-loader: Adds some css to the DOM by adding a <style> tag
  21714. // load the styles
  21715. var content = __webpack_require__(166);
  21716. if(typeof content === 'string') content = [[module.i, content, '']];
  21717. // add the styles to the DOM
  21718. var update = __webpack_require__(21)(content, {});
  21719. if(content.locals) module.exports = content.locals;
  21720. // Hot Module Replacement
  21721. if(false) {
  21722. // When the styles change, update the <style> tags
  21723. if(!content.locals) {
  21724. module.hot.accept("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-e2e1cfd0!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./DeleteButton.vue", function() {
  21725. var newContent = require("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-e2e1cfd0!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./DeleteButton.vue");
  21726. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  21727. update(newContent);
  21728. });
  21729. }
  21730. // When the module is disposed, remove the <style> tags
  21731. module.hot.dispose(function() { update(); });
  21732. }
  21733. /***/ },
  21734. /* 222 */
  21735. /***/ function(module, exports, __webpack_require__) {
  21736. // style-loader: Adds some css to the DOM by adding a <style> tag
  21737. // load the styles
  21738. var content = __webpack_require__(167);
  21739. if(typeof content === 'string') content = [[module.i, content, '']];
  21740. // add the styles to the DOM
  21741. var update = __webpack_require__(21)(content, {});
  21742. if(content.locals) module.exports = content.locals;
  21743. // Hot Module Replacement
  21744. if(false) {
  21745. // When the styles change, update the <style> tags
  21746. if(!content.locals) {
  21747. module.hot.accept("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-eabada8c!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Menu.vue", function() {
  21748. var newContent = require("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-eabada8c!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Menu.vue");
  21749. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  21750. update(newContent);
  21751. });
  21752. }
  21753. // When the module is disposed, remove the <style> tags
  21754. module.hot.dispose(function() { update(); });
  21755. }
  21756. /***/ },
  21757. /* 223 */
  21758. /***/ function(module, exports) {
  21759. module.exports = function(module) {
  21760. if(!module.webpackPolyfill) {
  21761. module.deprecate = function() {};
  21762. module.paths = [];
  21763. // module.parent = undefined by default
  21764. if(!module.children) module.children = [];
  21765. Object.defineProperty(module, "loaded", {
  21766. enumerable: true,
  21767. configurable: false,
  21768. get: function() { return module.l; }
  21769. });
  21770. Object.defineProperty(module, "id", {
  21771. enumerable: true,
  21772. configurable: false,
  21773. get: function() { return module.i; }
  21774. });
  21775. module.webpackPolyfill = 1;
  21776. }
  21777. return module;
  21778. }
  21779. /***/ },
  21780. /* 224 */
  21781. /***/ function(module, exports) {
  21782. /* (ignored) */
  21783. /***/ },
  21784. /* 225 */
  21785. /***/ function(module, exports, __webpack_require__) {
  21786. "use strict";
  21787. 'use strict';
  21788. var _vue = __webpack_require__(32);
  21789. var _vue2 = _interopRequireDefault(_vue);
  21790. __webpack_require__(81);
  21791. __webpack_require__(82);
  21792. __webpack_require__(83);
  21793. var _LessPass = __webpack_require__(84);
  21794. var _LessPass2 = _interopRequireDefault(_LessPass);
  21795. var _store = __webpack_require__(80);
  21796. var _store2 = _interopRequireDefault(_store);
  21797. var _router = __webpack_require__(79);
  21798. var _router2 = _interopRequireDefault(_router);
  21799. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  21800. new _vue2.default({
  21801. el: '#lesspass',
  21802. store: _store2.default,
  21803. router: _router2.default,
  21804. render: function render(h) {
  21805. return h(_LessPass2.default);
  21806. }
  21807. });
  21808. /***/ }
  21809. /******/ ])));