/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 160);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return classify; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return camelize; });
/* unused harmony export kebabize */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return getComponentDisplayName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return inDoc; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return UNDEFINED; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return INFINITY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return NEGATIVE_INFINITY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return NAN; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return SPECIAL_TOKENS; });
/* unused harmony export MAX_STRING_SIZE */
/* unused harmony export MAX_ARRAY_SIZE */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return specialTokenToString; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return stringify; });
/* unused harmony export getCustomMapDetails */
/* unused harmony export reviveMap */
/* unused harmony export getCustomSetDetails */
/* unused harmony export reviveSet */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return getComponentName; });
/* unused harmony export getCustomComponentDefinitionDetails */
/* unused harmony export getCustomFunctionDetails */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return getCustomRefDetails; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return parse; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return isPlainObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return searchDeepInObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return sortByKey; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return set; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return get; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return has; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return scrollIntoView; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return focusInput; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return openInEditor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return escape; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return copyToClipboard; });
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _transfer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15);
/* harmony import */ var src_backend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14);
/* harmony import */ var src_backend_vuex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12);
/* harmony import */ var src_backend_router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13);
/* harmony import */ var src_shared_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4);
/* harmony import */ var _devtools_env__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
function cached (fn) {
var cache = Object.create(null)
return function cachedFn (str) {
var hit = cache[str]
return hit || (cache[str] = fn(str))
}
}
var classifyRE = /(?:^|[-_/])(\w)/g
var classify = cached((str) => {
return str && str.replace(classifyRE, toUpper)
})
var camelizeRE = /-(\w)/g
var camelize = cached((str) => {
return str.replace(camelizeRE, toUpper)
})
var kebabizeRE = /([a-z0-9])([A-Z])/g
var kebabize = cached((str) => {
return str && str
.replace(kebabizeRE, (_, lowerCaseCharacter, upperCaseLetter) => {
return `${lowerCaseCharacter}-${upperCaseLetter}`
})
.toLowerCase()
})
function toUpper (_, c) {
return c ? c.toUpperCase() : ''
}
function getComponentDisplayName (originalName, style = 'class') {
switch (style) {
case 'class':
return classify(originalName)
case 'kebab':
return kebabize(originalName)
case 'original':
default:
return originalName
}
}
function inDoc (node) {
if (!node) { return false }
var doc = node.ownerDocument.documentElement
var parent = node.parentNode
return doc === node ||
doc === parent ||
!!(parent && parent.nodeType === 1 && (doc.contains(parent)))
}
/**
* Stringify/parse data using CircularJSON.
*/
var UNDEFINED = '__vue_devtool_undefined__'
var INFINITY = '__vue_devtool_infinity__'
var NEGATIVE_INFINITY = '__vue_devtool_negative_infinity__'
var NAN = '__vue_devtool_nan__'
var SPECIAL_TOKENS = {
'true': true,
'false': false,
'undefined': UNDEFINED,
'null': null,
'-Infinity': NEGATIVE_INFINITY,
'Infinity': INFINITY,
'NaN': NAN
}
var MAX_STRING_SIZE = 10000
var MAX_ARRAY_SIZE = 5000
function specialTokenToString (value) {
if (value === null) {
return 'null'
} else if (value === UNDEFINED) {
return 'undefined'
} else if (value === NAN) {
return 'NaN'
} else if (value === INFINITY) {
return 'Infinity'
} else if (value === NEGATIVE_INFINITY) {
return '-Infinity'
}
return false
}
/**
* Needed to prevent stack overflow
* while replacing complex objects
* like components because we create
* new objects with the CustomValue API
* (.i.e `{ _custom: { ... } }`)
*/
class EncodeCache {
constructor () {
this.map = new Map()
}
/**
* Returns a result unique to each input data
* @param {*} data Input data
* @param {*} factory Function used to create the unique result
*/
cache (data, factory) {
var cached = this.map.get(data)
if (cached) {
return cached
} else {
var result = factory(data)
this.map.set(data, result)
return result
}
}
clear () {
this.map.clear()
}
}
var encodeCache = new EncodeCache()
function stringify (data) {
// Create a fresh cache for each serialization
encodeCache.clear()
return _transfer__WEBPACK_IMPORTED_MODULE_1__[/* stringify */ "b"](data, replacer)
}
function replacer (key) {
var val = this[key]
var type = typeof val
if (Array.isArray(val)) {
var l = val.length
if (l > MAX_ARRAY_SIZE) {
return {
_isArray: true,
length: l,
items: val.slice(0, MAX_ARRAY_SIZE)
}
}
return val
} else if (typeof val === 'string') {
if (val.length > MAX_STRING_SIZE) {
return val.substr(0, MAX_STRING_SIZE) + `... (${(val.length)} total length)`
} else {
return val
}
} else if (type === 'undefined') {
return UNDEFINED
} else if (val === Infinity) {
return INFINITY
} else if (val === -Infinity) {
return NEGATIVE_INFINITY
} else if (type === 'function') {
return getCustomFunctionDetails(val)
} else if (type === 'symbol') {
return `[native Symbol ${Symbol.prototype.toString.call(val)}]`
} else if (val !== null && type === 'object') {
var proto = Object.prototype.toString.call(val)
if (proto === '[object Map]') {
return encodeCache.cache(val, () => getCustomMapDetails(val))
} else if (proto === '[object Set]') {
return encodeCache.cache(val, () => getCustomSetDetails(val))
} else if (proto === '[object RegExp]') {
// special handling of native type
return `[native RegExp ${RegExp.prototype.toString.call(val)}]`
} else if (proto === '[object Date]') {
return `[native Date ${Date.prototype.toString.call(val)}]`
} else if (val.state && val._vm) {
return encodeCache.cache(val, () => Object(src_backend_vuex__WEBPACK_IMPORTED_MODULE_3__[/* getCustomStoreDetails */ "a"])(val))
} else if (val.constructor && val.constructor.name === 'VueRouter') {
return encodeCache.cache(val, () => Object(src_backend_router__WEBPACK_IMPORTED_MODULE_4__[/* getCustomRouterDetails */ "a"])(val))
} else if (val._isVue) {
return encodeCache.cache(val, () => Object(src_backend__WEBPACK_IMPORTED_MODULE_2__[/* getCustomInstanceDetails */ "a"])(val))
} else if (typeof val.render === 'function') {
return encodeCache.cache(val, () => getCustomComponentDefinitionDetails(val))
} else if (val.constructor && val.constructor.name === 'VNode') {
return `[native VNode <${val.tag}>]`
}
} else if (Number.isNaN(val)) {
return NAN
}
return sanitize(val)
}
function getCustomMapDetails (val) {
var list = []
val.forEach(
(value, key) => list.push({
key,
value
})
)
return {
_custom: {
type: 'map',
display: 'Map',
value: list,
readOnly: true,
fields: {
abstract: true
}
}
}
}
function reviveMap (val) {
var result = new Map()
var list = val._custom.value
for (var i = 0; i < list.length; i++) {
var { key, value } = list[i]
result.set(key, reviver(null, value))
}
return result
}
function getCustomSetDetails (val) {
var list = Array.from(val)
return {
_custom: {
type: 'set',
display: `Set[${list.length}]`,
value: list,
readOnly: true
}
}
}
function reviveSet (val) {
var result = new Set()
var list = val._custom.value
for (var i = 0; i < list.length; i++) {
var value = list[i]
result.add(reviver(null, value))
}
return result
}
// Use a custom basename functions instead of the shimed version
// because it doesn't work on Windows
function basename (filename, ext) {
return path__WEBPACK_IMPORTED_MODULE_0___default.a.basename(
filename.replace(/^[a-zA-Z]:/, '').replace(/\\/g, '/'),
ext
)
}
function getComponentName (options) {
var name = options.name || options._componentTag
if (name) {
return name
}
var file = options.__file // injected by vue-loader
if (file) {
return classify(basename(file, '.vue'))
}
}
function getCustomComponentDefinitionDetails (def) {
var display = getComponentName(def)
if (display) {
if (def.name && def.__file) {
display += ` (${def.__file})`
}
} else {
display = 'Unknown Component'
}
return {
_custom: Object.assign({}, {type: 'component-definition',
display,
tooltip: 'Component definition'},
def.__file ? {
file: def.__file
} : {})
}
}
function getCustomFunctionDetails (func) {
var string = ''
var matches = null
try {
string = Function.prototype.toString.call(func)
matches = String.prototype.match.call(string, /\([\s\S]*?\)/)
} catch (e) {
// Func is probably a Proxy, which can break Function.prototype.toString()
}
// Trim any excess whitespace from the argument string
var match = matches && matches[0]
var args = typeof match === 'string'
? `(${match.substr(1, match.length - 2).split(',').map(a => a.trim()).join(', ')})` : '(?)'
var name = typeof func.name === 'string' ? func.name : ''
return {
_custom: {
type: 'function',
display: `ƒ ${escape(name)}${args}`
}
}
}
function getCustomRefDetails (instance, key, ref) {
var value
if (Array.isArray(ref)) {
value = ref.map((r) => getCustomRefDetails(instance, key, r)).map(data => data.value)
} else {
var name
if (ref._isVue) {
name = getComponentName(ref.$options)
} else {
name = ref.tagName.toLowerCase()
}
value = {
_custom: {
display: `<${name}` +
(ref.id ? ` id="${ref.id}"` : '') +
(ref.className ? ` class="${ref.className}"` : '') + '>',
uid: instance.__VUE_DEVTOOLS_UID__,
type: 'reference'
}
}
}
return {
type: '$refs',
key: key,
value,
editable: false
}
}
function parse (data, revive) {
return revive
? _transfer__WEBPACK_IMPORTED_MODULE_1__[/* parse */ "a"](data, reviver)
: _transfer__WEBPACK_IMPORTED_MODULE_1__[/* parse */ "a"](data)
}
var specialTypeRE = /^\[native (\w+) (.*)\]$/
var symbolRE = /^\[native Symbol Symbol\((.*)\)\]$/
function reviver (key, val) {
if (val === UNDEFINED) {
return undefined
} else if (val === INFINITY) {
return Infinity
} else if (val === NEGATIVE_INFINITY) {
return -Infinity
} else if (val === NAN) {
return NaN
} else if (val && val._custom) {
if (val._custom.type === 'component') {
return src_backend__WEBPACK_IMPORTED_MODULE_2__[/* instanceMap */ "d"].get(val._custom.id)
} else if (val._custom.type === 'map') {
return reviveMap(val)
} else if (val._custom.type === 'set') {
return reviveSet(val)
}
} else if (symbolRE.test(val)) {
var [, string] = symbolRE.exec(val)
return Symbol.for(string)
} else if (specialTypeRE.test(val)) {
var [, type, string$1] = specialTypeRE.exec(val)
return new window[type](string$1)
} else {
return val
}
}
/**
* Sanitize data to be posted to the other side.
* Since the message posted is sent with structured clone,
* we need to filter out any types that might cause an error.
*
* @param {*} data
* @return {*}
*/
function sanitize (data) {
if (
!isPrimitive(data) &&
!Array.isArray(data) &&
!isPlainObject(data)
) {
// handle types that will probably cause issues in
// the structured clone
return Object.prototype.toString.call(data)
} else {
return data
}
}
function isPlainObject (obj) {
return Object.prototype.toString.call(obj) === '[object Object]'
}
function isPrimitive (data) {
if (data == null) {
return true
}
var type = typeof data
return (
type === 'string' ||
type === 'number' ||
type === 'boolean'
)
}
/**
* Searches a key or value in the object, with a maximum deepness
* @param {*} obj Search target
* @param {string} searchTerm Search string
* @returns {boolean} Search match
*/
function searchDeepInObject (obj, searchTerm) {
var seen = new Map()
var result = internalSearchObject(obj, searchTerm.toLowerCase(), seen, 0)
seen.clear()
return result
}
var SEARCH_MAX_DEPTH = 10
/**
* Executes a search on each field of the provided object
* @param {*} obj Search target
* @param {string} searchTerm Search string
* @param {Map} seen Map containing the search result to prevent stack overflow by walking on the same object multiple times
* @param {number} depth Deep search depth level, which is capped to prevent performance issues
* @returns {boolean} Search match
*/
function internalSearchObject (obj, searchTerm, seen, depth) {
if (depth > SEARCH_MAX_DEPTH) {
return false
}
var match = false
var keys = Object.keys(obj)
var key, value
for (var i = 0; i < keys.length; i++) {
key = keys[i]
value = obj[key]
match = internalSearchCheck(searchTerm, key, value, seen, depth + 1)
if (match) {
break
}
}
return match
}
/**
* Executes a search on each value of the provided array
* @param {*} array Search target
* @param {string} searchTerm Search string
* @param {Map} seen Map containing the search result to prevent stack overflow by walking on the same object multiple times
* @param {number} depth Deep search depth level, which is capped to prevent performance issues
* @returns {boolean} Search match
*/
function internalSearchArray (array, searchTerm, seen, depth) {
if (depth > SEARCH_MAX_DEPTH) {
return false
}
var match = false
var value
for (var i = 0; i < array.length; i++) {
value = array[i]
match = internalSearchCheck(searchTerm, null, value, seen, depth + 1)
if (match) {
break
}
}
return match
}
/**
* Checks if the provided field matches the search terms
* @param {string} searchTerm Search string
* @param {string} key Field key (null if from array)
* @param {*} value Field value
* @param {Map} seen Map containing the search result to prevent stack overflow by walking on the same object multiple times
* @param {number} depth Deep search depth level, which is capped to prevent performance issues
* @returns {boolean} Search match
*/
function internalSearchCheck (searchTerm, key, value, seen, depth) {
var match = false
var result
if (key === '_custom') {
key = value.display
value = value.value
}
(result = specialTokenToString(value)) && (value = result)
if (key && compare(key, searchTerm)) {
match = true
seen.set(value, true)
} else if (seen.has(value)) {
match = seen.get(value)
} else if (Array.isArray(value)) {
seen.set(value, null)
match = internalSearchArray(value, searchTerm, seen, depth)
seen.set(value, match)
} else if (isPlainObject(value)) {
seen.set(value, null)
match = internalSearchObject(value, searchTerm, seen, depth)
seen.set(value, match)
} else if (compare(value, searchTerm)) {
match = true
seen.set(value, true)
}
return match
}
/**
* Compares two values
* @param {*} value Mixed type value that will be cast to string
* @param {string} searchTerm Search string
* @returns {boolean} Search match
*/
function compare (value, searchTerm) {
return ('' + value).toLowerCase().indexOf(searchTerm) !== -1
}
function sortByKey (state) {
return state && state.slice().sort((a, b) => {
if (a.key < b.key) { return -1 }
if (a.key > b.key) { return 1 }
return 0
})
}
function set (object, path, value, cb = null) {
var sections = Array.isArray(path) ? path : path.split('.')
while (sections.length > 1) {
object = object[sections.shift()]
}
var field = sections[0]
if (cb) {
cb(object, field, value)
} else {
object[field] = value
}
}
function get (object, path) {
var sections = Array.isArray(path) ? path : path.split('.')
for (var i = 0; i < sections.length; i++) {
object = object[sections[i]]
if (!object) {
return undefined
}
}
return object
}
function has (object, path, parent = false) {
if (typeof object === 'undefined') {
return false
}
var sections = Array.isArray(path) ? path : path.split('.')
var size = !parent ? 1 : 2
while (object && sections.length > size) {
object = object[sections.shift()]
}
return object != null && object.hasOwnProperty(sections[0])
}
function scrollIntoView (scrollParent, el, center = true) {
var parentTop = scrollParent.scrollTop
var parentHeight = scrollParent.offsetHeight
var elBounds = el.getBoundingClientRect()
var parentBounds = scrollParent.getBoundingClientRect()
var top = elBounds.top - parentBounds.top + scrollParent.scrollTop
var height = el.offsetHeight
if (center) {
scrollParent.scrollTop = top + (height - parentHeight) / 2
} else if (top < parentTop) {
scrollParent.scrollTop = top
} else if (top + height > parentTop + parentHeight) {
scrollParent.scrollTop = top - parentHeight + height
}
}
function focusInput (el) {
el.focus()
el.setSelectionRange(0, el.value.length)
}
function openInEditor (file) {
// Console display
var fileName = file.replace(/\\/g, '\\\\')
var src = `fetch('${src_shared_data__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"].openInEditorHost}__open-in-editor?file=${encodeURI(file)}').then(response => {
if (response.ok) {
console.log('File ${fileName} opened in editor')
} else {
const msg = 'Opening component ${fileName} failed'
const target = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {}
if (target.__VUE_DEVTOOLS_TOAST__) {
target.__VUE_DEVTOOLS_TOAST__(msg, 'error')
} else {
console.log('%c' + msg, 'color:red')
}
console.log('Check the setup of your project, see https://github.com/vuejs/vue-devtools/blob/master/docs/open-in-editor.md')
}
})`
if (_devtools_env__WEBPACK_IMPORTED_MODULE_6__[/* isChrome */ "c"]) {
chrome.devtools.inspectedWindow.eval(src)
} else {
// eslint-disable-next-line no-eval
eval(src)
}
}
var ESC = {
'<': '<',
'>': '>',
'"': '"',
'&': '&'
}
function escape (s) {
return s.replace(/[<>"&]/g, escapeChar)
}
function escapeChar (a) {
return ESC[a] || a
}
function copyToClipboard (state) {
if (typeof document === 'undefined') { return }
var dummyTextArea = document.createElement('textarea')
dummyTextArea.textContent = stringify(state)
document.body.appendChild(dummyTextArea)
dummyTextArea.select()
document.execCommand('copy')
document.body.removeChild(dummyTextArea)
}
/***/ }),
/***/ 10:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return init; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return get; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return set; });
/* unused harmony export remove */
/* unused harmony export clear */
// If we can, we use the browser extension API to store data
// it's async though, so we synchronize changes from an intermediate
// storageData object
var useStorage = typeof chrome !== 'undefined' && typeof chrome.storage !== 'undefined'
var storageData = null
function init () {
return new Promise((resolve) => {
if (useStorage) {
chrome.storage.local.get(null, result => {
storageData = result
resolve()
})
} else {
storageData = {}
resolve()
}
})
}
function get (key, defaultValue = null) {
checkStorage()
if (useStorage) {
return getDefaultValue(storageData[key], defaultValue)
} else {
try {
return getDefaultValue(JSON.parse(localStorage.getItem(key)), defaultValue)
} catch (e) {}
}
}
function set (key, val) {
checkStorage()
if (useStorage) {
storageData[key] = val
chrome.storage.local.set({ [key]: val })
} else {
try {
localStorage.setItem(key, JSON.stringify(val))
} catch (e) {}
}
}
function remove (key) {
checkStorage()
if (useStorage) {
delete storageData[key]
chrome.storage.local.remove([key])
} else {
try {
localStorage.removeItem(key)
} catch (e) {}
}
}
function clear () {
checkStorage()
if (useStorage) {
storageData = {}
chrome.storage.local.clear()
} else {
try {
localStorage.clear()
} catch (e) {}
}
}
function checkStorage () {
if (!storageData) {
throw new Error(`Storage wasn't initialized with 'init()'`)
}
}
function getDefaultValue (value, defaultValue) {
if (value == null) {
return defaultValue
}
return value
}
/***/ }),
/***/ 12:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return initVuexBackend; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getCustomStoreDetails; });
/* harmony import */ var src_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
/* harmony import */ var src_shared_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5);
/* harmony import */ var _clone__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
var isProd = "production" === 'production'
class VuexBackend {
constructor (hook, bridge, isLegacy) {
bridge.send('vuex:init')
this.hook = hook
this.bridge = bridge
this.isLegacy = isLegacy
this.store = hook.store
// Flush info from hook
// (for example, modules registered before backend was created)
this.earlyModules = hook.flushStoreModules()
/** Initial store state */
this.initialState = this.hook.initialState
/** Internal store vm for mutation replaying */
this.snapshotsVm = null
/** Initial snapshot */
this.baseStateSnapshot = null
/** Snapshot cache */
this.stateSnapshotCache = null
/** Mutation history */
this.mutations = null
/** Last replayed state */
this.lastState = null
/** Currently registered dynamic modules */
this.registeredModules = {}
/** All dynamic modules ever registered, useful for mutation replaying */
this.allTimeModules = {}
/** Legacy base state */
this.legacyBaseSnapshot = null
// First-time snapshot VM creation
this.resetSnapshotsVm()
// Initial setup
this.reset()
// Override dynamic module handling in vuex
if (this.store.registerModule) {
this.origRegisterModule = this.store.registerModule.bind(this.store)
this.store.registerModule = (path, module, options) => {
this.addModule(path, module, options)
this.origRegisterModule(path, module, options)
if (!isProd) { console.log('register module', path) }
}
this.origUnregisterModule = this.store.unregisterModule.bind(this.store)
this.store.unregisterModule = (path) => {
this.removeModule(path)
this.origUnregisterModule(path)
if (!isProd) { console.log('unregister module', path) }
}
} else {
this.origRegisterModule = this.origUnregisterModule = () => {}
}
// Register modules that were added before backend was created
this.earlyModules.forEach((ref) => {
var path = ref.path;
var module = ref.module;
var options = ref.options;
var moduleInfo = this.addModule(path, module, options)
moduleInfo.early = true
})
// deal with multiple backend injections
hook.off('vuex:mutation')
// application -> devtool
hook.on('vuex:mutation', this.onMutation.bind(this))
// devtool -> application
bridge.on('vuex:travel-to-state', this.onTravelToState.bind(this))
bridge.on('vuex:commit-all', this.onCommitAll.bind(this))
bridge.on('vuex:revert-all', this.onRevertAll.bind(this))
bridge.on('vuex:commit', this.onCommit.bind(this))
bridge.on('vuex:revert', this.onRevert.bind(this))
bridge.on('vuex:import-state', this.onImportState.bind(this))
bridge.on('vuex:inspect-state', this.onInspectState.bind(this))
bridge.on('vuex:edit-state', this.onEditState.bind(this))
}
/**
* Register a mutation record
*/
onMutation (ref) {
var type = ref.type;
var payload = ref.payload;
if (!src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].recordVuex) { return }
this.addMutation(type, payload)
}
/**
* Time-travel to the state of a specific mutation (by index)
*/
onTravelToState (ref) {
var index = ref.index;
var apply = ref.apply;
var snapshot = this.replayMutations(index)
var state = Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(this.lastState)
this.bridge.send('vuex:inspected-state', {
index,
snapshot
})
if (apply) {
this.ensureRegisteredModules(this.mutations[index])
this.hook.emit('vuex:travel-to-state', state)
}
}
onCommitAll () {
this.reset(this.lastState)
}
onRevertAll () {
this.reset()
}
/**
* Reset the base state to a specific mutation (by index)
*
* ⚠️ State should be time-traveled to before executing this
*/
onCommit (index) {
if (src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].vuexNewBackend) {
this.baseStateSnapshot = this.lastState
} else {
this.legacyBaseSnapshot = this.mutations[index].snapshot
}
this.resetSnapshotCache()
this.mutations = this.mutations.slice(index + 1)
this.mutations.forEach((mutation, index) => {
mutation.index = index
})
}
/**
* Removes mutations after a specific mutation (by index)
*
* ⚠️ State should be time-traveled to before executing this
*/
onRevert (index) {
this.resetSnapshotCache()
this.ensureRegisteredModules(this.mutations[index - 1])
this.mutations = this.mutations.slice(0, index)
}
/**
* Parse and time-travel to a state
*/
onImportState (state) {
var parsed = Object(src_util__WEBPACK_IMPORTED_MODULE_0__[/* parse */ "s"])(state, true)
this.initialState = parsed
this.hook.emit('vuex:travel-to-state', parsed)
this.reset()
this.bridge.send('vuex:init')
this.onInspectState(-1)
}
/**
* If the index is -1, sends the base state.
* Else replays the mutations up to the mutation.
*/
onInspectState (index) {
var snapshot = this.replayMutations(index)
this.bridge.send('vuex:inspected-state', {
index,
snapshot
})
}
onEditState (ref) {
var index = ref.index;
var value = ref.value;
var path = ref.path;
var parsedValue
if (value) {
parsedValue = Object(src_util__WEBPACK_IMPORTED_MODULE_0__[/* parse */ "s"])(value, true)
}
this.store._committing = true
Object(src_util__WEBPACK_IMPORTED_MODULE_0__[/* set */ "v"])(this.store.state, path, parsedValue)
this.store._committing = false
this.bridge.send('vuex:inspected-state', {
index,
snapshot: this.getStoreSnapshot()
})
this.cacheStateSnapshot(index, true)
}
/**
* Should be called when store structure changes,
* for example when a dynamic module is registered
*/
resetSnapshotsVm (state) {
this.snapshotsVm = new vue__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"]({
data: {
$$state: state || {}
},
computed: this.store._vm.$options.computed
})
}
/**
* Reset vuex backend
*/
reset (stateSnapshot = null) {
if (src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].vuexNewBackend) {
this.baseStateSnapshot = stateSnapshot || Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(this.initialState)
} else {
this.legacyBaseSnapshot = this.stringifyStore()
}
this.mutations = []
this.resetSnapshotCache()
}
resetSnapshotCache () {
this.stateSnapshotCache = [
{
index: -1,
state: this.baseStateSnapshot,
permanent: true
}
]
}
/**
* Handle adding a dynamic store module
*/
addModule (path, module, options) {
if (typeof path === 'string') { path = [path] }
var state
if (options && options.preserveState) {
state = Object(src_util__WEBPACK_IMPORTED_MODULE_0__[/* get */ "k"])(this.store.state, path)
}
if (!state) {
state = typeof module.state === 'function' ? module.state() : module.state
}
if (!state) {
state = {}
}
var fakeModule = Object.assign({}, module)
if (src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].vuexNewBackend) {
// Ensure all children state are cloned
var replaceNestedStates = (nestedModule) => {
if (nestedModule.modules) {
Object.keys(nestedModule.modules).forEach(key => {
var child = nestedModule.modules[key]
var state = {}
if (child.state) {
state = typeof child.state === 'function' ? child.state() : child.state
}
child.state = Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(state)
replaceNestedStates(child)
})
}
}
replaceNestedStates(fakeModule)
}
var key = path.join('/')
var moduleInfo = this.registeredModules[key] = this.allTimeModules[key] = {
path,
module: fakeModule,
options: Object.assign({}, options,
{preserveState: false}),
state: src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].vuexNewBackend ? Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(state) : null
}
if (src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].recordVuex) {
this.addMutation(`Register module: ${key}`, {
path,
module,
options
}, {
registerModule: true
})
}
return moduleInfo
}
/**
* Handle removing a dynamic store module
*/
removeModule (path) {
if (typeof path === 'string') { path = [path] }
delete this.registeredModules[path.join('/')]
if (src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].recordVuex) {
this.addMutation(`Unregister module: ${path.join('/')}`, {
path
}, {
unregisterModule: true
})
}
}
/**
* Make sure all (and only) the dynamic modules present at the moment of a mutation
* are correctly registered in the store
*/
ensureRegisteredModules (mutation) {
if (mutation) {
mutation.registeredModules.forEach(m => {
if (!Object.keys(this.registeredModules).sort((a, b) => a.length - b.length).includes(m)) {
var data = this.allTimeModules[m]
if (data) {
var { path, module, options, state } = data
this.origRegisterModule(path, Object.assign({}, module,
{state: Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(state)}), options)
this.registeredModules[path.join('/')] = data
}
}
})
Object.keys(this.registeredModules).sort((a, b) => b.length - a.length).forEach(m => {
if (!mutation.registeredModules.includes(m)) {
this.origUnregisterModule(m.split('/'))
delete this.registeredModules[m]
}
})
this.resetSnapshotsVm(this.store.state)
}
}
/**
* Check if the store as a specific dynamic module
*/
hasModule (path) {
return !!this.store._modules.get(path)
}
stringifyStore () {
return Object(src_util__WEBPACK_IMPORTED_MODULE_0__[/* stringify */ "y"])({
state: this.store.state,
getters: this.store.getters || {}
})
}
/**
* Handle a new mutation commited to the store
*/
addMutation (type, payload, options = {}) {
var index = this.mutations.length
if (!src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].vuexNewBackend) {
options.snapshot = this.stringifyStore()
}
this.mutations.push(Object.assign({}, {type,
payload: src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].vuexNewBackend ? Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(payload) : null,
index,
handlers: this.store._mutations[type],
registeredModules: Object.keys(this.registeredModules)},
options))
this.bridge.send('vuex:mutation', {
mutation: {
type: type,
payload: Object(src_util__WEBPACK_IMPORTED_MODULE_0__[/* stringify */ "y"])(payload),
index
},
timestamp: Date.now(),
options
})
}
/**
* Replays mutations from the base state up to a specific index
* to re-create what the vuex state should be at this point
*/
replayMutations (index) {
if (!src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].vuexNewBackend) {
var snapshot = index === -1 ? this.legacyBaseSnapshot : this.mutations[index].snapshot
this.lastState = Object(src_util__WEBPACK_IMPORTED_MODULE_0__[/* parse */ "s"])(snapshot, true).state
return snapshot
}
var originalVm = this.store._vm
var originalState = Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(this.store.state)
this.store._vm = this.snapshotsVm
var tempRemovedModules = []
var tempAddedModules = []
// If base state, we need to remove all dynamic registered modules
// to prevent errors because their state is missing
if (index === -1) {
tempRemovedModules = Object.keys(this.registeredModules)
tempRemovedModules.filter(m => this.hasModule(m.split('/'))).sort((a, b) => b.length - a.length).forEach(m => {
this.origUnregisterModule(m.split('/'))
if (!isProd) { console.log('before replay unregister', m) }
})
}
// Get most recent snapshot for target index
// for faster replay
var stateSnapshot
for (var i = 0; i < this.stateSnapshotCache.length; i++) {
var s = this.stateSnapshotCache[i]
if (s.index > index) {
break
} else {
stateSnapshot = s
}
}
var resultState
// Snapshot was already replayed
if (stateSnapshot.index === index) {
resultState = stateSnapshot.state
var state = Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(stateSnapshot.state)
this.resetSnapshotsVm(state)
this.store.replaceState(state)
} else {
// Update state when using fake vm to properly temporarily remove modules
this.resetSnapshotsVm(originalState)
this.store.replaceState(originalState)
// Temporarily remove modules if they where not present during first mutation being replayed
var startMutation = this.mutations[stateSnapshot.index]
if (startMutation) {
tempRemovedModules = Object.keys(this.registeredModules).filter(m => !startMutation.registeredModules.includes(m))
} else {
tempRemovedModules = Object.keys(this.registeredModules)
}
tempRemovedModules.filter(m => this.hasModule(m.split('/'))).sort((a, b) => b.length - a.length).forEach(m => {
this.origUnregisterModule(m.split('/'))
if (!isProd) { console.log('before replay unregister', m) }
})
var state$1 = Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(stateSnapshot.state)
this.resetSnapshotsVm(state$1)
this.store.replaceState(state$1)
src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].snapshotLoading = true
// Replay mutations
for (var i$1 = stateSnapshot.index + 1; i$1 <= index; i$1++) {
var mutation = this.mutations[i$1]
if (mutation.registerModule) {
var key = mutation.payload.path.join('/')
var moduleInfo = this.allTimeModules[key]
tempAddedModules.push(key)
this.origRegisterModule(moduleInfo.path, Object.assign({}, moduleInfo.module,
{state: Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(moduleInfo.state)}), moduleInfo.options)
this.resetSnapshotsVm(this.store.state)
if (!isProd) { console.log('replay register module', moduleInfo) }
} else if (mutation.unregisterModule && this.hasModule(mutation.payload.path)) {
var path = mutation.payload.path
var index$1 = tempAddedModules.indexOf(path.join('/'))
if (index$1 !== -1) { tempAddedModules.splice(index$1, 1) }
this.origUnregisterModule(path)
this.resetSnapshotsVm(this.store.state)
if (!isProd) { console.log('replay unregister module', path) }
} else if (mutation.handlers) {
this.store._committing = true
try {
var payload = mutation.payload
if (this.isLegacy && !Array.isArray(payload)) {
payload = [payload]
}
if (Array.isArray(mutation.handlers)) {
if (this.isLegacy) {
mutation.handlers.forEach(handler => handler(this.store.state, ...payload))
} else {
mutation.handlers.forEach(handler => handler(payload))
}
} else {
if (this.isLegacy) {
mutation.handlers(this.store.state, ...payload)
} else {
mutation.handlers(payload)
}
}
} catch (e) {
throw e
}
this.store._committing = false
}
// Optimization: periodically cache snapshots
if (i$1 === index || (i$1 % src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].cacheVuexSnapshotsEvery === 0)) {
this.cacheStateSnapshot(i$1)
}
}
// Send final state after replay
resultState = Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(this.store.state)
if (!isProd) { console.log(`replayed ${index - stateSnapshot.index} mutation(s)`) }
}
this.lastState = resultState
var result = this.stringifyStore()
// Restore user state
tempAddedModules.sort((a, b) => b.length - a.length).forEach(m => {
this.origUnregisterModule(m.split('/'))
if (!isProd) { console.log('after replay unregister', m) }
})
tempRemovedModules.sort((a, b) => a.length - b.length).forEach(m => {
var { path, module, options, state } = this.registeredModules[m]
this.origRegisterModule(path, Object.assign({}, module,
{state: Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(state)}), options)
if (!isProd) { console.log('after replay register', m) }
})
this.store._vm = originalVm
return result
}
cacheStateSnapshot (index, permanent = false) {
this.removeCachedStateSnapshot(index)
this.stateSnapshotCache.push({
index,
state: Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(this.store.state),
permanent
})
if (!isProd) { console.log('cached snapshot', index) }
// Delete old cached snapshots
if (this.stateSnapshotCache.filter(s => !s.permanent).length > src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].cacheVuexSnapshotsLimit) {
var i = this.stateSnapshotCache.findIndex(s => !s.permanent)
if (i !== -1) {
if (!isProd) { console.log('clean cached snapshot', this.stateSnapshotCache[i].index) }
this.stateSnapshotCache.splice(i, 1)
}
}
}
removeCachedStateSnapshot (index) {
var i = this.stateSnapshotCache.findIndex(s => s.idex === index)
if (i !== -1) { this.stateSnapshotCache.splice(i, 1) }
}
/**
* Get the serialized state and getters from the store
*/
getStoreSnapshot (stateSnapshot = null) {
var originalVm
if (stateSnapshot) {
originalVm = this.store._vm
this.store._vm = this.snapshotsVm
this.store.replaceState(Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(stateSnapshot))
}
var result = Object(src_util__WEBPACK_IMPORTED_MODULE_0__[/* stringify */ "y"])({
state: this.store.state,
getters: this.store.getters || {}
})
if (stateSnapshot) {
// Restore user state
this.store._vm = originalVm
}
return result
}
}
function initVuexBackend (hook, bridge, isLegacy) {
// eslint-disable-next-line no-new
new VuexBackend(hook, bridge, isLegacy)
}
function getCustomStoreDetails (store) {
return {
_custom: {
type: 'store',
display: 'Store',
value: {
state: store.state,
getters: store.getters
},
fields: {
abstract: true
}
}
}
}
/***/ }),
/***/ 13:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return initRouterBackend; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getCustomRouterDetails; });
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
function initRouterBackend (Vue, bridge, rootInstances) {
var recording = true
var getSnapshot = () => {
var routeChanges = []
rootInstances.forEach(instance => {
var router = instance._router
if (router && router.options && router.options.routes) {
routeChanges.push(...router.options.routes)
}
})
return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* stringify */ "y"])({
routeChanges
})
}
bridge.send('routes:init', getSnapshot())
bridge.on('router:toggle-recording', enabled => {
recording = enabled
})
rootInstances.forEach(instance => {
var router = instance._router
if (router) {
router.afterEach((to, from) => {
if (!recording) { return }
bridge.send('router:changed', Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* stringify */ "y"])({
to,
from,
timestamp: Date.now()
}))
})
bridge.send('router:init', Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* stringify */ "y"])({
mode: router.mode,
current: {
from: router.history.current,
to: router.history.current,
timestamp: Date.now()
}
}))
if (router.matcher && router.matcher.addRoutes) {
var addRoutes = router.matcher.addRoutes
router.matcher.addRoutes = function (routes) {
routes.forEach((item) => {
bridge.send('routes:changed', Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* stringify */ "y"])(item))
})
addRoutes.call(this, routes)
}
}
}
})
}
function getCustomRouterDetails (router) {
return {
_custom: {
type: 'router',
display: 'VueRouter',
value: {
options: router.options,
currentRoute: router.currentRoute
},
fields: {
abstract: true
}
}
}
}
/***/ }),
/***/ 14:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ backend_instanceMap; });
__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ initBackend; });
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ getCustomInstanceDetails; });
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ getInstanceName; });
// UNUSED EXPORTS: functionalVnodeMap, findInstanceOrVnode, reduceStateList, toast, inspectInstance
// EXTERNAL MODULE: D:/devtools-5.1.1/src/util.js
var util = __webpack_require__(0);
// EXTERNAL MODULE: D:/devtools-5.1.1/src/shared-data.js
var shared_data = __webpack_require__(4);
// EXTERNAL MODULE: D:/devtools-5.1.1/src/devtools/env.js
var env = __webpack_require__(2);
// CONCATENATED MODULE: D:/devtools-5.1.1/src/backend/highlighter.js
var overlay
var overlayContent
function init () {
if (overlay || !env["b" /* isBrowser */]) { return }
overlay = document.createElement('div')
overlay.style.backgroundColor = 'rgba(104, 182, 255, 0.35)'
overlay.style.position = 'fixed'
overlay.style.zIndex = '99999999999999'
overlay.style.pointerEvents = 'none'
overlay.style.display = 'flex'
overlay.style.alignItems = 'center'
overlay.style.justifyContent = 'center'
overlay.style.borderRadius = '3px'
overlayContent = document.createElement('div')
overlayContent.style.backgroundColor = 'rgba(104, 182, 255, 0.9)'
overlayContent.style.fontFamily = 'monospace'
overlayContent.style.fontSize = '11px'
overlayContent.style.padding = '2px 3px'
overlayContent.style.borderRadius = '3px'
overlayContent.style.color = 'white'
overlay.appendChild(overlayContent)
}
/**
* Highlight an instance.
*
* @param {Vue} instance
*/
function highlight (instance) {
if (!instance) { return }
var rect = getInstanceOrVnodeRect(instance)
if (!env["b" /* isBrowser */]) {
// TODO: Highlight rect area.
return
}
init()
if (rect) {
var content = []
var name = instance.fnContext ? Object(util["m" /* getComponentName */])(instance.fnOptions) : getInstanceName(instance)
name = Object(util["l" /* getComponentDisplayName */])(name, shared_data["a" /* default */].componentNameStyle)
if (name) {
var pre = document.createElement('span')
pre.style.opacity = '0.6'
pre.innerText = '<'
var text = document.createTextNode(name)
var post = document.createElement('span')
post.style.opacity = '0.6'
post.innerText = '>'
content.push(pre, text, post)
}
showOverlay(rect, content)
}
}
/**
* Remove highlight overlay.
*/
function unHighlight () {
if (overlay && overlay.parentNode) {
document.body.removeChild(overlay)
}
}
/**
* Get the client rect for an instance.
*
* @param {Vue|Vnode} instance
* @return {Object}
*/
function getInstanceOrVnodeRect (instance) {
var el = instance.$el || instance.elm
if (!env["b" /* isBrowser */]) {
// TODO: Find position from instance or a vnode (for functional components).
return
}
if (!Object(util["p" /* inDoc */])(el)) {
return
}
if (instance._isFragment) {
return getFragmentRect(instance)
} else if (el.nodeType === 1) {
return el.getBoundingClientRect()
}
}
/**
* Highlight a fragment instance.
* Loop over its node range and determine its bounding box.
*
* @param {Vue} instance
* @return {Object}
*/
function getFragmentRect (ref) {
var _fragmentStart = ref._fragmentStart;
var _fragmentEnd = ref._fragmentEnd;
var top, bottom, left, right
highlighter_util().mapNodeRange(_fragmentStart, _fragmentEnd, function (node) {
var rect
if (node.nodeType === 1 || node.getBoundingClientRect) {
rect = node.getBoundingClientRect()
} else if (node.nodeType === 3 && node.data.trim()) {
rect = getTextRect(node)
}
if (rect) {
if (!top || rect.top < top) {
top = rect.top
}
if (!bottom || rect.bottom > bottom) {
bottom = rect.bottom
}
if (!left || rect.left < left) {
left = rect.left
}
if (!right || rect.right > right) {
right = rect.right
}
}
})
return {
top,
left,
width: right - left,
height: bottom - top
}
}
var range
/**
* Get the bounding rect for a text node using a Range.
*
* @param {Text} node
* @return {Rect}
*/
function getTextRect (node) {
if (!env["b" /* isBrowser */]) { return }
if (!range) { range = document.createRange() }
range.selectNode(node)
return range.getBoundingClientRect()
}
/**
* Display the overlay with given rect.
*
* @param {Rect}
*/
function showOverlay (ref, content = []) {
var width = ref.width; if ( width === void 0 ) width = 0;
var height = ref.height; if ( height === void 0 ) height = 0;
var top = ref.top; if ( top === void 0 ) top = 0;
var left = ref.left; if ( left === void 0 ) left = 0;
if (!env["b" /* isBrowser */]) { return }
overlay.style.width = ~~width + 'px'
overlay.style.height = ~~height + 'px'
overlay.style.top = ~~top + 'px'
overlay.style.left = ~~left + 'px'
overlayContent.innerHTML = ''
content.forEach(child => overlayContent.appendChild(child))
document.body.appendChild(overlay)
}
/**
* Get Vue's util
*/
function highlighter_util () {
return env["f" /* target */].__VUE_DEVTOOLS_GLOBAL_HOOK__.Vue.util
}
// EXTERNAL MODULE: D:/devtools-5.1.1/src/backend/vuex.js
var vuex = __webpack_require__(12);
// CONCATENATED MODULE: D:/devtools-5.1.1/src/backend/events.js
var internalRE = /^(?:pre-)?hook:/
function initEventsBackend (Vue, bridge) {
var recording = true
bridge.send('events:reset')
bridge.on('events:toggle-recording', enabled => {
recording = enabled
})
function logEvent (vm, type, eventName, payload) {
// The string check is important for compat with 1.x where the first
// argument may be an object instead of a string.
// this also ensures the event is only logged for direct $emit (source)
// instead of by $dispatch/$broadcast
if (typeof eventName === 'string' && !internalRE.test(eventName)) {
bridge.send('event:triggered', Object(util["y" /* stringify */])({
eventName,
type,
payload,
instanceId: vm._uid,
instanceName: getInstanceName(vm._self || vm),
timestamp: Date.now()
}))
}
}
function wrap (method) {
var original = Vue.prototype[method]
if (original) {
Vue.prototype[method] = function (...args) {
var res = original.apply(this, args)
if (recording) {
logEvent(this, method, args[0], args.slice(1))
}
return res
}
}
}
wrap('$emit')
wrap('$broadcast')
wrap('$dispatch')
}
// EXTERNAL MODULE: D:/devtools-5.1.1/src/backend/router.js
var router = __webpack_require__(13);
// CONCATENATED MODULE: D:/devtools-5.1.1/src/backend/perf.js
var COMPONENT_HOOKS = [
'beforeCreate',
'created',
'beforeMount',
'mounted',
'beforeUpdate',
'updated',
'beforeDestroyed',
'destroyed'
]
var RENDER_HOOKS = {
beforeMount: { after: 'mountRender' },
mounted: { before: 'mountRender' },
beforeUpdate: { after: 'updateRender' },
updated: { before: 'updateRender' }
}
var perf_frames = 0
var frameTime
var secondsTimer
var perf_bridge
var componentMetrics
function initPerfBackend (Vue, _bridge, instanceMap) {
perf_bridge = _bridge
// Global mixin
Vue.mixin({
beforeCreate () {
applyHooks(this)
}
})
// Apply to existing components
instanceMap.forEach(applyHooks)
Object(shared_data["d" /* watch */])('recordPerf', value => {
if (value) {
startRecording()
} else {
stopRecording()
}
})
}
function startRecording () {
perf_frames = 0
frameTime = performance.now()
secondsTimer = setInterval(frameInterval, 500)
componentMetrics = {}
requestAnimationFrame(perf_frame)
}
function stopRecording () {
clearInterval(secondsTimer)
}
function perf_frame () {
perf_frames++
if (shared_data["a" /* default */].recordPerf) {
requestAnimationFrame(perf_frame)
}
}
function frameInterval () {
var metric = {
type: 'fps',
time: Date.now(),
start: frameTime,
end: frameTime = performance.now()
}
metric.value = Math.round(perf_frames / (metric.end - metric.start) * 1000)
perf_frames = 0
perf_bridge.send('perf:add-metric', metric)
}
function applyHooks (vm) {
if (vm.$options.$_devtoolsPerfHooks) { return }
vm.$options.$_devtoolsPerfHooks = true
var renderMetrics = {}
COMPONENT_HOOKS.forEach(hook => {
var renderHook = RENDER_HOOKS[hook]
var handler = function () {
if (shared_data["a" /* default */].recordPerf) {
// Before
var time = performance.now()
if (renderHook && renderHook.before) {
// Render hook ends before one hook
var metric = renderMetrics[renderHook.before]
if (metric) {
metric.end = time
addComponentMetric(vm.$options, renderHook.before, metric.start, metric.end)
}
}
// After
this.$once(`hook:${hook}`, () => {
var newTime = performance.now()
addComponentMetric(vm.$options, hook, time, newTime)
if (renderHook && renderHook.after) {
// Render hook starts after one hook
renderMetrics[renderHook.after] = {
start: newTime,
end: 0
}
}
})
}
}
var currentValue = vm.$options[hook]
if (Array.isArray(currentValue)) {
vm.$options[hook] = [handler, ...currentValue]
} else if (typeof currentValue === 'function') {
vm.$options[hook] = [handler, currentValue]
} else {
vm.$options[hook] = [handler]
}
})
}
function addComponentMetric (options, type, start, end) {
var duration = end - start
var name = Object(util["m" /* getComponentName */])(options)
var metric = componentMetrics[name] = componentMetrics[name] || {
id: name,
hooks: {},
totalTime: 0
}
var hook = metric.hooks[type] = metric.hooks[type] || {
count: 0,
totalTime: 0
}
hook.count++
hook.totalTime += duration
metric.totalTime += duration
perf_bridge.send('perf:upsert-metric', { type: 'componentRender', data: metric })
}
// CONCATENATED MODULE: D:/devtools-5.1.1/src/backend/utils.js
function findRelatedComponent (el) {
while (!el.__vue__ && el.parentElement) {
el = el.parentElement
}
return el.__vue__
}
// CONCATENATED MODULE: D:/devtools-5.1.1/src/backend/component-selector.js
class component_selector_ComponentSelector {
constructor (bridge, instanceMap) {
var self = this
self.bridge = bridge
self.instanceMap = instanceMap
self.bindMethods()
bridge.on('start-component-selector', self.startSelecting)
bridge.on('stop-component-selector', self.stopSelecting)
}
/**
* Adds event listeners for mouseover and mouseup
*/
startSelecting () {
if (!env["b" /* isBrowser */]) { return }
window.addEventListener('mouseover', this.elementMouseOver, true)
window.addEventListener('click', this.elementClicked, true)
window.addEventListener('mouseout', this.cancelEvent, true)
window.addEventListener('mouseenter', this.cancelEvent, true)
window.addEventListener('mouseleave', this.cancelEvent, true)
window.addEventListener('mousedown', this.cancelEvent, true)
window.addEventListener('mouseup', this.cancelEvent, true)
}
/**
* Removes event listeners
*/
stopSelecting () {
if (!env["b" /* isBrowser */]) { return }
window.removeEventListener('mouseover', this.elementMouseOver, true)
window.removeEventListener('click', this.elementClicked, true)
window.removeEventListener('mouseout', this.cancelEvent, true)
window.removeEventListener('mouseenter', this.cancelEvent, true)
window.removeEventListener('mouseleave', this.cancelEvent, true)
window.removeEventListener('mousedown', this.cancelEvent, true)
window.removeEventListener('mouseup', this.cancelEvent, true)
unHighlight()
}
/**
* Highlights a component on element mouse over
* @param {MouseEvent} e
*/
elementMouseOver (e) {
this.cancelEvent(e)
var el = e.target
if (el) {
this.selectedInstance = findRelatedComponent(el)
}
unHighlight()
if (this.selectedInstance) {
highlight(this.selectedInstance)
}
}
/**
* Selects an instance in the component view
* @param {MouseEvent} e
*/
elementClicked (e) {
this.cancelEvent(e)
if (this.selectedInstance) {
this.bridge.send('inspect-instance', this.selectedInstance.__VUE_DEVTOOLS_UID__)
} else {
this.bridge.send('stop-component-selector')
}
this.stopSelecting()
}
/**
* Cancel a mouse event
* @param {MouseEvent} e
*/
cancelEvent (e) {
e.stopImmediatePropagation()
e.preventDefault()
}
/**
* Bind class methods to the class scope to avoid rebind for event listeners
*/
bindMethods () {
this.startSelecting = this.startSelecting.bind(this)
this.stopSelecting = this.stopSelecting.bind(this)
this.elementMouseOver = this.elementMouseOver.bind(this)
this.elementClicked = this.elementClicked.bind(this)
}
}
// EXTERNAL MODULE: D:/devtools-5.1.1/src/storage.js
var storage = __webpack_require__(10);
// CONCATENATED MODULE: D:/devtools-5.1.1/src/backend/index.js
// This is the backend that is injected into the page that a Vue app lives in
// when the Vue Devtools panel is activated.
// hook should have been injected before this executes.
var backend_hook = env["f" /* target */].__VUE_DEVTOOLS_GLOBAL_HOOK__
var rootInstances = []
var propModes = ['default', 'sync', 'once']
var backend_instanceMap = env["f" /* target */].__VUE_DEVTOOLS_INSTANCE_MAP__ = new Map()
var functionalVnodeMap = env["f" /* target */].__VUE_DEVTOOLS_FUNCTIONAL_VNODE_MAP__ = new Map()
var consoleBoundInstances = Array(5)
var currentInspectedId
var backend_bridge
var filter = ''
var captureCount = 0
var isLegacy = false
var rootUID = 0
var functionalIds = new Map()
// Dedupe instances
// Some instances may be both on a component and on a child abstract/functional component
var captureIds = new Map()
function initBackend (_bridge) {
backend_bridge = _bridge
if (backend_hook.Vue) {
isLegacy = backend_hook.Vue.version && backend_hook.Vue.version.split('.')[0] === '1'
connect(backend_hook.Vue)
} else {
backend_hook.once('init', connect)
}
initRightClick()
}
function connect (Vue) {
Object(storage["b" /* init */])().then(() => {
Object(shared_data["c" /* init */])({
bridge: backend_bridge,
Vue
})
backend_hook.currentTab = 'components'
backend_bridge.on('switch-tab', tab => {
backend_hook.currentTab = tab
if (tab === 'components') {
flush()
}
})
// the backend may get injected to the same page multiple times
// if the user closes and reopens the devtools.
// make sure there's only one flush listener.
backend_hook.off('flush')
backend_hook.on('flush', () => {
if (backend_hook.currentTab === 'components') {
flush()
}
})
backend_bridge.on('select-instance', id => {
currentInspectedId = id
var instance = findInstanceOrVnode(id)
if (!instance) { return }
if (!/:functional:/.test(id)) { bindToConsole(instance) }
flush()
backend_bridge.send('instance-selected')
})
backend_bridge.on('scroll-to-instance', id => {
var instance = findInstanceOrVnode(id)
if (instance) {
scrollIntoView(instance)
highlight(instance)
}
})
backend_bridge.on('filter-instances', _filter => {
filter = _filter.toLowerCase()
flush()
})
backend_bridge.on('refresh', scan)
backend_bridge.on('enter-instance', id => {
var instance = findInstanceOrVnode(id)
if (instance) { highlight(instance) }
})
backend_bridge.on('leave-instance', unHighlight)
// eslint-disable-next-line no-new
new component_selector_ComponentSelector(backend_bridge, backend_instanceMap)
// Get the instance id that is targeted by context menu
backend_bridge.on('get-context-menu-target', () => {
var instance = env["f" /* target */].__VUE_DEVTOOLS_CONTEXT_MENU_TARGET__
env["f" /* target */].__VUE_DEVTOOLS_CONTEXT_MENU_TARGET__ = null
env["f" /* target */].__VUE_DEVTOOLS_CONTEXT_MENU_HAS_TARGET__ = false
if (instance) {
var id = instance.__VUE_DEVTOOLS_UID__
if (id) {
return backend_bridge.send('inspect-instance', id)
}
}
toast('No Vue component was found', 'warn')
})
backend_bridge.on('set-instance-data', args => {
setStateValue(args)
flush()
})
// vuex
if (backend_hook.store) {
Object(vuex["b" /* initVuexBackend */])(backend_hook, backend_bridge, backend_hook.store.commit === undefined)
} else {
backend_hook.once('vuex:init', store => {
Object(vuex["b" /* initVuexBackend */])(backend_hook, backend_bridge, store.commit === undefined)
})
}
backend_hook.once('router:init', () => {
Object(router["b" /* initRouterBackend */])(backend_hook.Vue, backend_bridge, rootInstances)
})
// events
initEventsBackend(Vue, backend_bridge)
env["f" /* target */].__VUE_DEVTOOLS_INSPECT__ = inspectInstance
// User project devtools config
if (env["f" /* target */].hasOwnProperty('VUE_DEVTOOLS_CONFIG')) {
var config = env["f" /* target */].VUE_DEVTOOLS_CONFIG
// Open in editor
if (config.hasOwnProperty('openInEditorHost')) {
shared_data["a" /* default */].openInEditorHost = config.openInEditorHost
}
}
backend_bridge.log('backend ready.')
backend_bridge.send('ready', Vue.version)
backend_bridge.on('log-detected-vue', () => {
console.log(
`%c vue-devtools %c Detected Vue v${Vue.version} %c`,
'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff',
'background:#41b883 ; padding: 1px; border-radius: 0 3px 3px 0; color: #fff',
'background:transparent'
)
})
setTimeout(() => {
scan()
// perf
initPerfBackend(Vue, backend_bridge, backend_instanceMap)
}, 0)
})
}
function findInstanceOrVnode (id) {
if (/:functional:/.test(id)) {
var [refId] = id.split(':functional:')
var map = functionalVnodeMap.get(refId)
return map && map[id]
}
return backend_instanceMap.get(id)
}
/**
* Scan the page for root level Vue instances.
*/
function scan () {
rootInstances.length = 0
var inFragment = false
var currentFragment = null
function processInstance (instance) {
if (instance) {
if (rootInstances.indexOf(instance.$root) === -1) {
instance = instance.$root
}
if (instance._isFragment) {
inFragment = true
currentFragment = instance
}
// respect Vue.config.devtools option
var baseVue = instance.constructor
while (baseVue.super) {
baseVue = baseVue.super
}
if (baseVue.config && baseVue.config.devtools) {
// give a unique id to root instance so we can
// 'namespace' its children
if (typeof instance.__VUE_DEVTOOLS_ROOT_UID__ === 'undefined') {
instance.__VUE_DEVTOOLS_ROOT_UID__ = ++rootUID
}
rootInstances.push(instance)
}
return true
}
}
if (env["b" /* isBrowser */]) {
walk(document, function (node) {
if (inFragment) {
if (node === currentFragment._fragmentEnd) {
inFragment = false
currentFragment = null
}
return true
}
var instance = node.__vue__
return processInstance(instance)
})
} else {
if (Array.isArray(env["f" /* target */].__VUE_ROOT_INSTANCES__)) {
env["f" /* target */].__VUE_ROOT_INSTANCES__.map(processInstance)
}
}
backend_hook.emit('router:init')
flush()
}
/**
* DOM walk helper
*
* @param {NodeList} nodes
* @param {Function} fn
*/
function walk (node, fn) {
if (node.childNodes) {
for (var i = 0, l = node.childNodes.length; i < l; i++) {
var child = node.childNodes[i]
var stop = fn(child)
if (!stop) {
walk(child, fn)
}
}
}
// also walk shadow DOM
if (node.shadowRoot) {
walk(node.shadowRoot, fn)
}
}
/**
* Called on every Vue.js batcher flush cycle.
* Capture current component tree structure and the state
* of the current inspected instance (if present) and
* send it to the devtools.
*/
function flush () {
var start
functionalIds.clear()
captureIds.clear()
if (false) {}
var payload = Object(util["y" /* stringify */])({
inspectedInstance: getInstanceDetails(currentInspectedId),
instances: findQualifiedChildrenFromList(rootInstances)
})
if (false) {}
backend_bridge.send('flush', payload)
}
/**
* Iterate through an array of instances and flatten it into
* an array of qualified instances. This is a depth-first
* traversal - e.g. if an instance is not matched, we will
* recursively go deeper until a qualified child is found.
*
* @param {Array} instances
* @return {Array}
*/
function findQualifiedChildrenFromList (instances) {
instances = instances
.filter(child => !child._isBeingDestroyed)
return !filter
? instances.map(capture)
: Array.prototype.concat.apply([], instances.map(findQualifiedChildren))
}
/**
* Find qualified children from a single instance.
* If the instance itself is qualified, just return itself.
* This is ok because [].concat works in both cases.
*
* @param {Vue|Vnode} instance
* @return {Vue|Array}
*/
function findQualifiedChildren (instance) {
return isQualified(instance)
? capture(instance)
: findQualifiedChildrenFromList(instance.$children).concat(
instance._vnode && instance._vnode.children
// Find functional components in recursively in non-functional vnodes.
? flatten(instance._vnode.children.filter(child => !child.componentInstance).map(captureChild))
// Filter qualified children.
.filter(instance => isQualified(instance))
: []
)
}
/**
* Check if an instance is qualified.
*
* @param {Vue|Vnode} instance
* @return {Boolean}
*/
function isQualified (instance) {
var name = Object(util["g" /* classify */])(instance.name || getInstanceName(instance)).toLowerCase()
return name.indexOf(filter) > -1
}
function flatten (items) {
return items.reduce((acc, item) => {
if (item instanceof Array) { acc.push(...flatten(item)) }
else if (item) { acc.push(item) }
return acc
}, [])
}
function captureChild (child) {
if (child.fnContext && !child.componentInstance) {
return capture(child)
} else if (child.componentInstance) {
if (!child.componentInstance._isBeingDestroyed) { return capture(child.componentInstance) }
} else if (child.children) {
return flatten(child.children.map(captureChild))
}
}
/**
* Capture the meta information of an instance. (recursive)
*
* @param {Vue} instance
* @return {Object}
*/
function capture (instance, index, list) {
if (false) {}
if (instance.$options && instance.$options.abstract && instance._vnode && instance._vnode.componentInstance) {
instance = instance._vnode.componentInstance
}
// Functional component.
if (instance.fnContext && !instance.componentInstance) {
var contextUid = instance.fnContext.__VUE_DEVTOOLS_UID__
var id = functionalIds.get(contextUid)
if (id == null) {
id = 0
} else {
id++
}
functionalIds.set(contextUid, id)
var functionalId = contextUid + ':functional:' + id
markFunctional(functionalId, instance)
return {
id: functionalId,
functional: true,
name: getInstanceName(instance),
renderKey: getRenderKey(instance.key),
children: (instance.children ? instance.children.map(
child => child.fnContext
? captureChild(child)
: child.componentInstance
? capture(child.componentInstance)
: undefined
)
// router-view has both fnContext and componentInstance on vnode.
: instance.componentInstance ? [capture(instance.componentInstance)] : []).filter(Boolean),
inactive: false,
isFragment: false // TODO: Check what is it for.
}
}
// instance._uid is not reliable in devtools as there
// may be 2 roots with same _uid which causes unexpected
// behaviour
instance.__VUE_DEVTOOLS_UID__ = getUniqueId(instance)
// Dedupe
if (captureIds.has(instance.__VUE_DEVTOOLS_UID__)) {
return
} else {
captureIds.set(instance.__VUE_DEVTOOLS_UID__, undefined)
}
mark(instance)
var name = getInstanceName(instance)
var ret = {
uid: instance._uid,
id: instance.__VUE_DEVTOOLS_UID__,
name,
renderKey: getRenderKey(instance.$vnode ? instance.$vnode['key'] : null),
inactive: !!instance._inactive,
isFragment: !!instance._isFragment,
children: instance.$children
.filter(child => !child._isBeingDestroyed)
.map(capture)
.filter(Boolean)
}
if (instance._vnode && instance._vnode.children) {
ret.children = ret.children.concat(
flatten(instance._vnode.children.map(captureChild))
.filter(Boolean)
)
}
// record screen position to ensure correct ordering
if ((!list || list.length > 1) && !instance._inactive) {
var rect = getInstanceOrVnodeRect(instance)
ret.top = rect ? rect.top : Infinity
} else {
ret.top = Infinity
}
// check if instance is available in console
var consoleId = consoleBoundInstances.indexOf(instance.__VUE_DEVTOOLS_UID__)
ret.consoleId = consoleId > -1 ? '$vm' + consoleId : null
// check router view
var isRouterView2 = instance.$vnode && instance.$vnode.data.routerView
if (instance._routerView || isRouterView2) {
ret.isRouterView = true
if (!instance._inactive && instance.$route) {
var matched = instance.$route.matched
var depth = isRouterView2
? instance.$vnode.data.routerViewDepth
: instance._routerView.depth
ret.matchedRouteSegment =
matched &&
matched[depth] &&
(isRouterView2 ? matched[depth].path : matched[depth].handler.path)
}
}
return ret
}
/**
* Mark an instance as captured and store it in the instance map.
*
* @param {Vue} instance
*/
function mark (instance) {
if (!backend_instanceMap.has(instance.__VUE_DEVTOOLS_UID__)) {
backend_instanceMap.set(instance.__VUE_DEVTOOLS_UID__, instance)
instance.$on('hook:beforeDestroy', function () {
backend_instanceMap.delete(instance.__VUE_DEVTOOLS_UID__)
})
}
}
function markFunctional (id, vnode) {
var refId = vnode.fnContext.__VUE_DEVTOOLS_UID__
if (!functionalVnodeMap.has(refId)) {
functionalVnodeMap.set(refId, {})
vnode.fnContext.$on('hook:beforeDestroy', function () {
functionalVnodeMap.delete(refId)
})
}
functionalVnodeMap.get(refId)[id] = vnode
}
/**
* Get the detailed information of an inspected instance.
*
* @param {Number} id
*/
function getInstanceDetails (id) {
var instance = backend_instanceMap.get(id)
if (!instance) {
var vnode = findInstanceOrVnode(id)
if (!vnode) { return {} }
var data = {
id,
name: Object(util["m" /* getComponentName */])(vnode.fnOptions),
file: vnode.fnOptions.__file || null,
state: processProps(Object.assign({}, {$options: vnode.fnOptions}, (vnode.devtoolsMeta && vnode.devtoolsMeta.renderContext.props))),
functional: true
}
return data
} else {
var data$1 = {
id: id,
name: getInstanceName(instance),
state: getInstanceState(instance)
}
var i
if ((i = instance.$vnode) && (i = i.componentOptions) && (i = i.Ctor) && (i = i.options)) {
data$1.file = i.__file || null
}
return data$1
}
}
function getInstanceState (instance) {
return processProps(instance).concat(
processState(instance),
processRefs(instance),
processComputed(instance),
processInjected(instance),
processRouteContext(instance),
processVuexGetters(instance),
processFirebaseBindings(instance),
processObservables(instance),
processAttrs(instance)
)
}
function getCustomInstanceDetails (instance) {
var state = getInstanceState(instance)
return {
_custom: {
type: 'component',
id: instance.__VUE_DEVTOOLS_UID__,
display: getInstanceName(instance),
tooltip: 'Component instance',
value: reduceStateList(state),
fields: {
abstract: true
}
}
}
}
function reduceStateList (list) {
if (!list.length) {
return undefined
}
return list.reduce((map, item) => {
var key = item.type || 'data'
var obj = map[key] = map[key] || {}
obj[item.key] = item.value
return map
}, {})
}
/**
* Get the appropriate display name for an instance.
*
* @param {Vue} instance
* @return {String}
*/
function getInstanceName (instance) {
var name = Object(util["m" /* getComponentName */])(instance.$options || instance.fnOptions || {})
if (name) { return name }
return instance.$root === instance
? 'Root'
: 'Anonymous Component'
}
/**
* Process the props of an instance.
* Make sure return a plain object because window.postMessage()
* will throw an Error if the passed object contains Functions.
*
* @param {Vue} instance
* @return {Array}
*/
function processProps (instance) {
var props
if (isLegacy && (props = instance._props)) {
// 1.x
return Object.keys(props).map(key => {
var prop = props[key]
var options = prop.options
return {
type: 'props',
key: prop.path,
value: instance[prop.path],
meta: options ? {
type: options.type ? getPropType(options.type) : 'any',
required: !!options.required,
mode: propModes[prop.mode]
} : {}
}
})
} else if ((props = instance.$options.props)) {
// 2.0
var propsData = []
for (var key in props) {
var prop = props[key]
key = Object(util["f" /* camelize */])(key)
propsData.push({
type: 'props',
key,
value: instance[key],
meta: prop ? {
type: prop.type ? getPropType(prop.type) : 'any',
required: !!prop.required
} : {
type: 'invalid'
},
editable: shared_data["a" /* default */].editableProps
})
}
return propsData
} else {
return []
}
}
function processAttrs (instance) {
return Object.entries(instance.$attrs || {}).map((ref) => {
var key = ref[0];
var value = ref[1];
return {
type: '$attrs',
key,
value
}
})
}
/**
* Convert prop type constructor to string.
*
* @param {Function} fn
*/
var fnTypeRE = /^(?:function|class) (\w+)/
function getPropType (type) {
var match = type.toString().match(fnTypeRE)
return typeof type === 'function'
? (match && match[1]) || 'any'
: 'any'
}
/**
* Process state, filtering out props and "clean" the result
* with a JSON dance. This removes functions which can cause
* errors during structured clone used by window.postMessage.
*
* @param {Vue} instance
* @return {Array}
*/
function processState (instance) {
var props = isLegacy
? instance._props
: instance.$options.props
var getters =
instance.$options.vuex &&
instance.$options.vuex.getters
return Object.keys(instance._data)
.filter(key => (
!(props && key in props) &&
!(getters && key in getters)
))
.map(key => ({
key,
value: instance._data[key],
editable: true
}))
}
/**
* Process refs
*
* @param {Vue} instance
* @return {Array}
*/
function processRefs (instance) {
return Object.keys(instance.$refs)
.filter(key => instance.$refs[key])
.map(key => Object(util["n" /* getCustomRefDetails */])(instance, key, instance.$refs[key]))
}
/**
* Process the computed properties of an instance.
*
* @param {Vue} instance
* @return {Array}
*/
function processComputed (instance) {
var computed = []
var defs = instance.$options.computed || {}
// use for...in here because if 'computed' is not defined
// on component, computed properties will be placed in prototype
// and Object.keys does not include
// properties from object's prototype
for (var key in defs) {
var def = defs[key]
var type = typeof def === 'function' && def.vuex
? 'vuex bindings'
: 'computed'
// use try ... catch here because some computed properties may
// throw error during its evaluation
var computedProp = null
try {
computedProp = {
type,
key,
value: instance[key]
}
} catch (e) {
computedProp = {
type,
key,
value: '(error during evaluation)'
}
}
computed.push(computedProp)
}
return computed
}
/**
* Process Vuex getters.
*
* @param {Vue} instance
* @return {Array}
*/
function processInjected (instance) {
var injected = instance.$options.inject
if (injected) {
return Object.keys(injected).map(key => {
return {
key,
type: 'injected',
value: instance[key]
}
})
} else {
return []
}
}
/**
* Process possible vue-router $route context
*
* @param {Vue} instance
* @return {Array}
*/
function processRouteContext (instance) {
try {
var route = instance.$route
if (route) {
var { path, query, params } = route
var value = { path, query, params }
if (route.fullPath) { value.fullPath = route.fullPath }
if (route.hash) { value.hash = route.hash }
if (route.name) { value.name = route.name }
if (route.meta) { value.meta = route.meta }
return [{
key: '$route',
value: {
_custom: {
type: 'router',
abstract: true,
value
}
}
}]
}
} catch (e) {
// Invalid $router
}
return []
}
/**
* Process Vuex getters.
*
* @param {Vue} instance
* @return {Array}
*/
function processVuexGetters (instance) {
var getters =
instance.$options.vuex &&
instance.$options.vuex.getters
if (getters) {
return Object.keys(getters).map(key => {
return {
type: 'vuex getters',
key,
value: instance[key]
}
})
} else {
return []
}
}
/**
* Process Firebase bindings.
*
* @param {Vue} instance
* @return {Array}
*/
function processFirebaseBindings (instance) {
var refs = instance.$firebaseRefs
if (refs) {
return Object.keys(refs).map(key => {
return {
type: 'firebase bindings',
key,
value: instance[key]
}
})
} else {
return []
}
}
/**
* Process vue-rx observable bindings.
*
* @param {Vue} instance
* @return {Array}
*/
function processObservables (instance) {
var obs = instance.$observables
if (obs) {
return Object.keys(obs).map(key => {
return {
type: 'observables',
key,
value: instance[key]
}
})
} else {
return []
}
}
/**
* Sroll a node into view.
*
* @param {Vue} instance
*/
function scrollIntoView (instance) {
var rect = getInstanceOrVnodeRect(instance)
if (rect) {
// TODO: Handle this for non-browser environments.
window.scrollBy(0, rect.top + (rect.height - window.innerHeight) / 2)
}
}
/**
* Binds given instance in console as $vm0.
* For compatibility reasons it also binds it as $vm.
*
* @param {Vue} instance
*/
function bindToConsole (instance) {
if (!instance) { return }
if (!env["b" /* isBrowser */]) { return }
var id = instance.__VUE_DEVTOOLS_UID__
var index = consoleBoundInstances.indexOf(id)
if (index > -1) {
consoleBoundInstances.splice(index, 1)
} else {
consoleBoundInstances.pop()
}
consoleBoundInstances.unshift(id)
for (var i = 0; i < 5; i++) {
window['$vm' + i] = backend_instanceMap.get(consoleBoundInstances[i])
}
window.$vm = instance
}
/**
* Returns a devtools unique id for instance.
* @param {Vue} instance
*/
function getUniqueId (instance) {
var rootVueId = instance.$root.__VUE_DEVTOOLS_ROOT_UID__
return `${rootVueId}:${instance._uid}`
}
function getRenderKey (value) {
if (value == null) { return }
var type = typeof value
if (type === 'number') {
return value
} else if (type === 'string') {
return `'${value}'`
} else if (Array.isArray(value)) {
return 'Array'
} else {
return 'Object'
}
}
/**
* Display a toast message.
* @param {any} message HTML content
*/
function toast (message, type = 'normal') {
var fn = env["f" /* target */].__VUE_DEVTOOLS_TOAST__
fn && fn(message, type)
}
function inspectInstance (instance) {
var id = instance.__VUE_DEVTOOLS_UID__
id && backend_bridge.send('inspect-instance', id)
}
function setStateValue (ref) {
var id = ref.id;
var path = ref.path;
var value = ref.value;
var newKey = ref.newKey;
var remove = ref.remove;
var instance = backend_instanceMap.get(id)
if (instance) {
try {
var parsedValue
if (value) {
parsedValue = Object(util["s" /* parse */])(value, true)
}
var api = isLegacy ? {
$set: backend_hook.Vue.set,
$delete: backend_hook.Vue.delete
} : instance
var data = Object(util["o" /* has */])(instance._props, path, newKey)
? instance._props
: instance._data
Object(util["v" /* set */])(data, path, parsedValue, (obj, field, value) => {
(remove || newKey) && api.$delete(obj, field)
!remove && api.$set(obj, newKey || field, value)
})
} catch (e) {
console.error(e)
}
}
}
function initRightClick () {
if (!env["b" /* isBrowser */]) { return }
// Start recording context menu when Vue is detected
// event if Vue devtools are not loaded yet
document.addEventListener('contextmenu', event => {
var el = event.target
if (el) {
// Search for parent that "is" a component instance
var instance = findRelatedComponent(el)
if (instance) {
window.__VUE_DEVTOOLS_CONTEXT_MENU_HAS_TARGET__ = true
window.__VUE_DEVTOOLS_CONTEXT_MENU_TARGET__ = instance
return
}
}
window.__VUE_DEVTOOLS_CONTEXT_MENU_HAS_TARGET__ = null
window.__VUE_DEVTOOLS_CONTEXT_MENU_TARGET__ = null
})
}
/***/ }),
/***/ 15:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return stringify; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return parse; });
/* unused harmony export stringifyStrict */
var MAX_SERIALIZED_SIZE = 512 * 1024 // 1MB
function encode (data, replacer, list, seen) {
var stored, key, value, i, l
var seenIndex = seen.get(data)
if (seenIndex != null) {
return seenIndex
}
var index = list.length
var proto = Object.prototype.toString.call(data)
if (proto === '[object Object]') {
stored = {}
seen.set(data, index)
list.push(stored)
var keys = Object.keys(data)
for (i = 0, l = keys.length; i < l; i++) {
key = keys[i]
value = data[key]
if (replacer) { value = replacer.call(data, key, value) }
stored[key] = encode(value, replacer, list, seen)
}
} else if (proto === '[object Array]') {
stored = []
seen.set(data, index)
list.push(stored)
for (i = 0, l = data.length; i < l; i++) {
value = data[i]
if (replacer) { value = replacer.call(data, i, value) }
stored[i] = encode(value, replacer, list, seen)
}
} else {
list.push(data)
}
return index
}
function decode (list, reviver) {
var i = list.length
var j, k, data, key, value, proto
while (i--) {
data = list[i]
proto = Object.prototype.toString.call(data)
if (proto === '[object Object]') {
var keys = Object.keys(data)
for (j = 0, k = keys.length; j < k; j++) {
key = keys[j]
value = list[data[key]]
if (reviver) { value = reviver.call(data, key, value) }
data[key] = value
}
} else if (proto === '[object Array]') {
for (j = 0, k = data.length; j < k; j++) {
value = list[data[j]]
if (reviver) { value = reviver.call(data, j, value) }
data[j] = value
}
}
}
}
function stringify (data, replacer, space) {
var result
try {
result = arguments.length === 1
? JSON.stringify(data)
: JSON.stringify(data, replacer, space)
} catch (e) {
result = stringifyStrict(data, replacer, space)
}
if (result.length > MAX_SERIALIZED_SIZE) {
var chunkCount = Math.ceil(result.length / MAX_SERIALIZED_SIZE)
var chunks = []
for (var i = 0; i < chunkCount; i++) {
chunks.push(result.slice(i * MAX_SERIALIZED_SIZE, (i + 1) * MAX_SERIALIZED_SIZE))
}
return chunks
}
return result
}
function parse (data, reviver) {
if (Array.isArray(data)) {
data = data.join('')
}
var hasCircular = /^\s/.test(data)
if (!hasCircular) {
return arguments.length === 1
? JSON.parse(data)
: JSON.parse(data, reviver)
} else {
var list = JSON.parse(data)
decode(list, reviver)
return list[0]
}
}
function stringifyStrict (data, replacer, space) {
var list = []
encode(data, replacer, list, new Map())
return space
? ' ' + JSON.stringify(list, null, space)
: ' ' + JSON.stringify(list)
}
/***/ }),
/***/ 160:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var src_backend__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
/* harmony import */ var src_bridge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
// this is injected to the app page when the panel is activated.
window.addEventListener('message', handshake)
function handshake (e) {
if (e.data.source === 'vue-devtools-proxy' && e.data.payload === 'init') {
window.removeEventListener('message', handshake)
var listeners = []
var bridge = new src_bridge__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"]({
listen (fn) {
var listener = evt => {
if (evt.data.source === 'vue-devtools-proxy' && evt.data.payload) {
fn(evt.data.payload)
}
}
window.addEventListener('message', listener)
listeners.push(listener)
},
send (data) {
window.postMessage({
source: 'vue-devtools-backend',
payload: data
}, '*')
}
})
bridge.on('shutdown', () => {
listeners.forEach(l => {
window.removeEventListener('message', l)
})
listeners = []
})
Object(src_backend__WEBPACK_IMPORTED_MODULE_0__[/* initBackend */ "c"])(bridge)
}
}
/***/ }),
/***/ 17:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh
* @license MIT
*/
/* eslint-disable no-proto */
var base64 = __webpack_require__(18)
var ieee754 = __webpack_require__(19)
var isArray = __webpack_require__(20)
exports.Buffer = Buffer
exports.SlowBuffer = SlowBuffer
exports.INSPECT_MAX_BYTES = 50
/**
* If `Buffer.TYPED_ARRAY_SUPPORT`:
* === true Use Uint8Array implementation (fastest)
* === false Use Object implementation (most compatible, even IE6)
*
* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
* Opera 11.6+, iOS 4.2+.
*
* Due to various browser bugs, sometimes the Object implementation will be used even
* when the browser supports typed arrays.
*
* Note:
*
* - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
* See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
*
* - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
*
* - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
* incorrect length in some situations.
* We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
* get the Object implementation, which is slower but behaves correctly.
*/
Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
? global.TYPED_ARRAY_SUPPORT
: typedArraySupport()
/*
* Export kMaxLength after typed array support is determined.
*/
exports.kMaxLength = kMaxLength()
function typedArraySupport () {
try {
var arr = new Uint8Array(1)
arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
return arr.foo() === 42 && // typed array instances can be augmented
typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
} catch (e) {
return false
}
}
function kMaxLength () {
return Buffer.TYPED_ARRAY_SUPPORT
? 0x7fffffff
: 0x3fffffff
}
function createBuffer (that, length) {
if (kMaxLength() < length) {
throw new RangeError('Invalid typed array length')
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
// Return an augmented `Uint8Array` instance, for best performance
that = new Uint8Array(length)
that.__proto__ = Buffer.prototype
} else {
// Fallback: Return an object instance of the Buffer class
if (that === null) {
that = new Buffer(length)
}
that.length = length
}
return that
}
/**
* The Buffer constructor returns instances of `Uint8Array` that have their
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
* returns a single octet.
*
* The `Uint8Array` prototype remains unmodified.
*/
function Buffer (arg, encodingOrOffset, length) {
if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
return new Buffer(arg, encodingOrOffset, length)
}
// Common case.
if (typeof arg === 'number') {
if (typeof encodingOrOffset === 'string') {
throw new Error(
'If encoding is specified then the first argument must be a string'
)
}
return allocUnsafe(this, arg)
}
return from(this, arg, encodingOrOffset, length)
}
Buffer.poolSize = 8192 // not used by this implementation
// TODO: Legacy, not needed anymore. Remove in next major version.
Buffer._augment = function (arr) {
arr.__proto__ = Buffer.prototype
return arr
}
function from (that, value, encodingOrOffset, length) {
if (typeof value === 'number') {
throw new TypeError('"value" argument must not be a number')
}
if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
return fromArrayBuffer(that, value, encodingOrOffset, length)
}
if (typeof value === 'string') {
return fromString(that, value, encodingOrOffset)
}
return fromObject(that, value)
}
/**
* Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
* if value is a number.
* Buffer.from(str[, encoding])
* Buffer.from(array)
* Buffer.from(buffer)
* Buffer.from(arrayBuffer[, byteOffset[, length]])
**/
Buffer.from = function (value, encodingOrOffset, length) {
return from(null, value, encodingOrOffset, length)
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
Buffer.prototype.__proto__ = Uint8Array.prototype
Buffer.__proto__ = Uint8Array
if (typeof Symbol !== 'undefined' && Symbol.species &&
Buffer[Symbol.species] === Buffer) {
// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
Object.defineProperty(Buffer, Symbol.species, {
value: null,
configurable: true
})
}
}
function assertSize (size) {
if (typeof size !== 'number') {
throw new TypeError('"size" argument must be a number')
} else if (size < 0) {
throw new RangeError('"size" argument must not be negative')
}
}
function alloc (that, size, fill, encoding) {
assertSize(size)
if (size <= 0) {
return createBuffer(that, size)
}
if (fill !== undefined) {
// Only pay attention to encoding if it's a string. This
// prevents accidentally sending in a number that would
// be interpretted as a start offset.
return typeof encoding === 'string'
? createBuffer(that, size).fill(fill, encoding)
: createBuffer(that, size).fill(fill)
}
return createBuffer(that, size)
}
/**
* Creates a new filled Buffer instance.
* alloc(size[, fill[, encoding]])
**/
Buffer.alloc = function (size, fill, encoding) {
return alloc(null, size, fill, encoding)
}
function allocUnsafe (that, size) {
assertSize(size)
that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
if (!Buffer.TYPED_ARRAY_SUPPORT) {
for (var i = 0; i < size; ++i) {
that[i] = 0
}
}
return that
}
/**
* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
* */
Buffer.allocUnsafe = function (size) {
return allocUnsafe(null, size)
}
/**
* Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
*/
Buffer.allocUnsafeSlow = function (size) {
return allocUnsafe(null, size)
}
function fromString (that, string, encoding) {
if (typeof encoding !== 'string' || encoding === '') {
encoding = 'utf8'
}
if (!Buffer.isEncoding(encoding)) {
throw new TypeError('"encoding" must be a valid string encoding')
}
var length = byteLength(string, encoding) | 0
that = createBuffer(that, length)
var actual = that.write(string, encoding)
if (actual !== length) {
// Writing a hex string, for example, that contains invalid characters will
// cause everything after the first invalid character to be ignored. (e.g.
// 'abxxcd' will be treated as 'ab')
that = that.slice(0, actual)
}
return that
}
function fromArrayLike (that, array) {
var length = array.length < 0 ? 0 : checked(array.length) | 0
that = createBuffer(that, length)
for (var i = 0; i < length; i += 1) {
that[i] = array[i] & 255
}
return that
}
function fromArrayBuffer (that, array, byteOffset, length) {
array.byteLength // this throws if `array` is not a valid ArrayBuffer
if (byteOffset < 0 || array.byteLength < byteOffset) {
throw new RangeError('\'offset\' is out of bounds')
}
if (array.byteLength < byteOffset + (length || 0)) {
throw new RangeError('\'length\' is out of bounds')
}
if (byteOffset === undefined && length === undefined) {
array = new Uint8Array(array)
} else if (length === undefined) {
array = new Uint8Array(array, byteOffset)
} else {
array = new Uint8Array(array, byteOffset, length)
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
// Return an augmented `Uint8Array` instance, for best performance
that = array
that.__proto__ = Buffer.prototype
} else {
// Fallback: Return an object instance of the Buffer class
that = fromArrayLike(that, array)
}
return that
}
function fromObject (that, obj) {
if (Buffer.isBuffer(obj)) {
var len = checked(obj.length) | 0
that = createBuffer(that, len)
if (that.length === 0) {
return that
}
obj.copy(that, 0, 0, len)
return that
}
if (obj) {
if ((typeof ArrayBuffer !== 'undefined' &&
obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
if (typeof obj.length !== 'number' || isnan(obj.length)) {
return createBuffer(that, 0)
}
return fromArrayLike(that, obj)
}
if (obj.type === 'Buffer' && isArray(obj.data)) {
return fromArrayLike(that, obj.data)
}
}
throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
}
function checked (length) {
// Note: cannot use `length < kMaxLength()` here because that fails when
// length is NaN (which is otherwise coerced to zero.)
if (length >= kMaxLength()) {
throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
'size: 0x' + kMaxLength().toString(16) + ' bytes')
}
return length | 0
}
function SlowBuffer (length) {
if (+length != length) { // eslint-disable-line eqeqeq
length = 0
}
return Buffer.alloc(+length)
}
Buffer.isBuffer = function isBuffer (b) {
return !!(b != null && b._isBuffer)
}
Buffer.compare = function compare (a, b) {
if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
throw new TypeError('Arguments must be Buffers')
}
if (a === b) return 0
var x = a.length
var y = b.length
for (var i = 0, len = Math.min(x, y); i < len; ++i) {
if (a[i] !== b[i]) {
x = a[i]
y = b[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
Buffer.isEncoding = function isEncoding (encoding) {
switch (String(encoding).toLowerCase()) {
case 'hex':
case 'utf8':
case 'utf-8':
case 'ascii':
case 'latin1':
case 'binary':
case 'base64':
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return true
default:
return false
}
}
Buffer.concat = function concat (list, length) {
if (!isArray(list)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
if (list.length === 0) {
return Buffer.alloc(0)
}
var i
if (length === undefined) {
length = 0
for (i = 0; i < list.length; ++i) {
length += list[i].length
}
}
var buffer = Buffer.allocUnsafe(length)
var pos = 0
for (i = 0; i < list.length; ++i) {
var buf = list[i]
if (!Buffer.isBuffer(buf)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
buf.copy(buffer, pos)
pos += buf.length
}
return buffer
}
function byteLength (string, encoding) {
if (Buffer.isBuffer(string)) {
return string.length
}
if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
(ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
return string.byteLength
}
if (typeof string !== 'string') {
string = '' + string
}
var len = string.length
if (len === 0) return 0
// Use a for loop to avoid recursion
var loweredCase = false
for (;;) {
switch (encoding) {
case 'ascii':
case 'latin1':
case 'binary':
return len
case 'utf8':
case 'utf-8':
case undefined:
return utf8ToBytes(string).length
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return len * 2
case 'hex':
return len >>> 1
case 'base64':
return base64ToBytes(string).length
default:
if (loweredCase) return utf8ToBytes(string).length // assume utf8
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.byteLength = byteLength
function slowToString (encoding, start, end) {
var loweredCase = false
// No need to verify that "this.length <= MAX_UINT32" since it's a read-only
// property of a typed array.
// This behaves neither like String nor Uint8Array in that we set start/end
// to their upper/lower bounds if the value passed is out of range.
// undefined is handled specially as per ECMA-262 6th Edition,
// Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
if (start === undefined || start < 0) {
start = 0
}
// Return early if start > this.length. Done here to prevent potential uint32
// coercion fail below.
if (start > this.length) {
return ''
}
if (end === undefined || end > this.length) {
end = this.length
}
if (end <= 0) {
return ''
}
// Force coersion to uint32. This will also coerce falsey/NaN values to 0.
end >>>= 0
start >>>= 0
if (end <= start) {
return ''
}
if (!encoding) encoding = 'utf8'
while (true) {
switch (encoding) {
case 'hex':
return hexSlice(this, start, end)
case 'utf8':
case 'utf-8':
return utf8Slice(this, start, end)
case 'ascii':
return asciiSlice(this, start, end)
case 'latin1':
case 'binary':
return latin1Slice(this, start, end)
case 'base64':
return base64Slice(this, start, end)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return utf16leSlice(this, start, end)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = (encoding + '').toLowerCase()
loweredCase = true
}
}
}
// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
// Buffer instances.
Buffer.prototype._isBuffer = true
function swap (b, n, m) {
var i = b[n]
b[n] = b[m]
b[m] = i
}
Buffer.prototype.swap16 = function swap16 () {
var len = this.length
if (len % 2 !== 0) {
throw new RangeError('Buffer size must be a multiple of 16-bits')
}
for (var i = 0; i < len; i += 2) {
swap(this, i, i + 1)
}
return this
}
Buffer.prototype.swap32 = function swap32 () {
var len = this.length
if (len % 4 !== 0) {
throw new RangeError('Buffer size must be a multiple of 32-bits')
}
for (var i = 0; i < len; i += 4) {
swap(this, i, i + 3)
swap(this, i + 1, i + 2)
}
return this
}
Buffer.prototype.swap64 = function swap64 () {
var len = this.length
if (len % 8 !== 0) {
throw new RangeError('Buffer size must be a multiple of 64-bits')
}
for (var i = 0; i < len; i += 8) {
swap(this, i, i + 7)
swap(this, i + 1, i + 6)
swap(this, i + 2, i + 5)
swap(this, i + 3, i + 4)
}
return this
}
Buffer.prototype.toString = function toString () {
var length = this.length | 0
if (length === 0) return ''
if (arguments.length === 0) return utf8Slice(this, 0, length)
return slowToString.apply(this, arguments)
}
Buffer.prototype.equals = function equals (b) {
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
if (this === b) return true
return Buffer.compare(this, b) === 0
}
Buffer.prototype.inspect = function inspect () {
var str = ''
var max = exports.INSPECT_MAX_BYTES
if (this.length > 0) {
str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
if (this.length > max) str += ' ... '
}
return ''
}
Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
if (!Buffer.isBuffer(target)) {
throw new TypeError('Argument must be a Buffer')
}
if (start === undefined) {
start = 0
}
if (end === undefined) {
end = target ? target.length : 0
}
if (thisStart === undefined) {
thisStart = 0
}
if (thisEnd === undefined) {
thisEnd = this.length
}
if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
throw new RangeError('out of range index')
}
if (thisStart >= thisEnd && start >= end) {
return 0
}
if (thisStart >= thisEnd) {
return -1
}
if (start >= end) {
return 1
}
start >>>= 0
end >>>= 0
thisStart >>>= 0
thisEnd >>>= 0
if (this === target) return 0
var x = thisEnd - thisStart
var y = end - start
var len = Math.min(x, y)
var thisCopy = this.slice(thisStart, thisEnd)
var targetCopy = target.slice(start, end)
for (var i = 0; i < len; ++i) {
if (thisCopy[i] !== targetCopy[i]) {
x = thisCopy[i]
y = targetCopy[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
//
// Arguments:
// - buffer - a Buffer to search
// - val - a string, Buffer, or number
// - byteOffset - an index into `buffer`; will be clamped to an int32
// - encoding - an optional encoding, relevant is val is a string
// - dir - true for indexOf, false for lastIndexOf
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
// Empty buffer means no match
if (buffer.length === 0) return -1
// Normalize byteOffset
if (typeof byteOffset === 'string') {
encoding = byteOffset
byteOffset = 0
} else if (byteOffset > 0x7fffffff) {
byteOffset = 0x7fffffff
} else if (byteOffset < -0x80000000) {
byteOffset = -0x80000000
}
byteOffset = +byteOffset // Coerce to Number.
if (isNaN(byteOffset)) {
// byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
byteOffset = dir ? 0 : (buffer.length - 1)
}
// Normalize byteOffset: negative offsets start from the end of the buffer
if (byteOffset < 0) byteOffset = buffer.length + byteOffset
if (byteOffset >= buffer.length) {
if (dir) return -1
else byteOffset = buffer.length - 1
} else if (byteOffset < 0) {
if (dir) byteOffset = 0
else return -1
}
// Normalize val
if (typeof val === 'string') {
val = Buffer.from(val, encoding)
}
// Finally, search either indexOf (if dir is true) or lastIndexOf
if (Buffer.isBuffer(val)) {
// Special case: looking for empty string/buffer always fails
if (val.length === 0) {
return -1
}
return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
} else if (typeof val === 'number') {
val = val & 0xFF // Search for a byte value [0-255]
if (Buffer.TYPED_ARRAY_SUPPORT &&
typeof Uint8Array.prototype.indexOf === 'function') {
if (dir) {
return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
} else {
return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
}
}
return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
}
throw new TypeError('val must be string, number or Buffer')
}
function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
var indexSize = 1
var arrLength = arr.length
var valLength = val.length
if (encoding !== undefined) {
encoding = String(encoding).toLowerCase()
if (encoding === 'ucs2' || encoding === 'ucs-2' ||
encoding === 'utf16le' || encoding === 'utf-16le') {
if (arr.length < 2 || val.length < 2) {
return -1
}
indexSize = 2
arrLength /= 2
valLength /= 2
byteOffset /= 2
}
}
function read (buf, i) {
if (indexSize === 1) {
return buf[i]
} else {
return buf.readUInt16BE(i * indexSize)
}
}
var i
if (dir) {
var foundIndex = -1
for (i = byteOffset; i < arrLength; i++) {
if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
if (foundIndex === -1) foundIndex = i
if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
} else {
if (foundIndex !== -1) i -= i - foundIndex
foundIndex = -1
}
}
} else {
if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
for (i = byteOffset; i >= 0; i--) {
var found = true
for (var j = 0; j < valLength; j++) {
if (read(arr, i + j) !== read(val, j)) {
found = false
break
}
}
if (found) return i
}
}
return -1
}
Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
return this.indexOf(val, byteOffset, encoding) !== -1
}
Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
}
Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
}
function hexWrite (buf, string, offset, length) {
offset = Number(offset) || 0
var remaining = buf.length - offset
if (!length) {
length = remaining
} else {
length = Number(length)
if (length > remaining) {
length = remaining
}
}
// must be an even number of digits
var strLen = string.length
if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
if (length > strLen / 2) {
length = strLen / 2
}
for (var i = 0; i < length; ++i) {
var parsed = parseInt(string.substr(i * 2, 2), 16)
if (isNaN(parsed)) return i
buf[offset + i] = parsed
}
return i
}
function utf8Write (buf, string, offset, length) {
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
}
function asciiWrite (buf, string, offset, length) {
return blitBuffer(asciiToBytes(string), buf, offset, length)
}
function latin1Write (buf, string, offset, length) {
return asciiWrite(buf, string, offset, length)
}
function base64Write (buf, string, offset, length) {
return blitBuffer(base64ToBytes(string), buf, offset, length)
}
function ucs2Write (buf, string, offset, length) {
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
}
Buffer.prototype.write = function write (string, offset, length, encoding) {
// Buffer#write(string)
if (offset === undefined) {
encoding = 'utf8'
length = this.length
offset = 0
// Buffer#write(string, encoding)
} else if (length === undefined && typeof offset === 'string') {
encoding = offset
length = this.length
offset = 0
// Buffer#write(string, offset[, length][, encoding])
} else if (isFinite(offset)) {
offset = offset | 0
if (isFinite(length)) {
length = length | 0
if (encoding === undefined) encoding = 'utf8'
} else {
encoding = length
length = undefined
}
// legacy write(string, encoding, offset, length) - remove in v0.13
} else {
throw new Error(
'Buffer.write(string, encoding, offset[, length]) is no longer supported'
)
}
var remaining = this.length - offset
if (length === undefined || length > remaining) length = remaining
if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
throw new RangeError('Attempt to write outside buffer bounds')
}
if (!encoding) encoding = 'utf8'
var loweredCase = false
for (;;) {
switch (encoding) {
case 'hex':
return hexWrite(this, string, offset, length)
case 'utf8':
case 'utf-8':
return utf8Write(this, string, offset, length)
case 'ascii':
return asciiWrite(this, string, offset, length)
case 'latin1':
case 'binary':
return latin1Write(this, string, offset, length)
case 'base64':
// Warning: maxLength not taken into account in base64Write
return base64Write(this, string, offset, length)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return ucs2Write(this, string, offset, length)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.prototype.toJSON = function toJSON () {
return {
type: 'Buffer',
data: Array.prototype.slice.call(this._arr || this, 0)
}
}
function base64Slice (buf, start, end) {
if (start === 0 && end === buf.length) {
return base64.fromByteArray(buf)
} else {
return base64.fromByteArray(buf.slice(start, end))
}
}
function utf8Slice (buf, start, end) {
end = Math.min(buf.length, end)
var res = []
var i = start
while (i < end) {
var firstByte = buf[i]
var codePoint = null
var bytesPerSequence = (firstByte > 0xEF) ? 4
: (firstByte > 0xDF) ? 3
: (firstByte > 0xBF) ? 2
: 1
if (i + bytesPerSequence <= end) {
var secondByte, thirdByte, fourthByte, tempCodePoint
switch (bytesPerSequence) {
case 1:
if (firstByte < 0x80) {
codePoint = firstByte
}
break
case 2:
secondByte = buf[i + 1]
if ((secondByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
if (tempCodePoint > 0x7F) {
codePoint = tempCodePoint
}
}
break
case 3:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
codePoint = tempCodePoint
}
}
break
case 4:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
fourthByte = buf[i + 3]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
codePoint = tempCodePoint
}
}
}
}
if (codePoint === null) {
// we did not generate a valid codePoint so insert a
// replacement char (U+FFFD) and advance only 1 byte
codePoint = 0xFFFD
bytesPerSequence = 1
} else if (codePoint > 0xFFFF) {
// encode to utf16 (surrogate pair dance)
codePoint -= 0x10000
res.push(codePoint >>> 10 & 0x3FF | 0xD800)
codePoint = 0xDC00 | codePoint & 0x3FF
}
res.push(codePoint)
i += bytesPerSequence
}
return decodeCodePointsArray(res)
}
// Based on http://stackoverflow.com/a/22747272/680742, the browser with
// the lowest limit is Chrome, with 0x10000 args.
// We go 1 magnitude less, for safety
var MAX_ARGUMENTS_LENGTH = 0x1000
function decodeCodePointsArray (codePoints) {
var len = codePoints.length
if (len <= MAX_ARGUMENTS_LENGTH) {
return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
}
// Decode in chunks to avoid "call stack size exceeded".
var res = ''
var i = 0
while (i < len) {
res += String.fromCharCode.apply(
String,
codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
)
}
return res
}
function asciiSlice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; ++i) {
ret += String.fromCharCode(buf[i] & 0x7F)
}
return ret
}
function latin1Slice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; ++i) {
ret += String.fromCharCode(buf[i])
}
return ret
}
function hexSlice (buf, start, end) {
var len = buf.length
if (!start || start < 0) start = 0
if (!end || end < 0 || end > len) end = len
var out = ''
for (var i = start; i < end; ++i) {
out += toHex(buf[i])
}
return out
}
function utf16leSlice (buf, start, end) {
var bytes = buf.slice(start, end)
var res = ''
for (var i = 0; i < bytes.length; i += 2) {
res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
}
return res
}
Buffer.prototype.slice = function slice (start, end) {
var len = this.length
start = ~~start
end = end === undefined ? len : ~~end
if (start < 0) {
start += len
if (start < 0) start = 0
} else if (start > len) {
start = len
}
if (end < 0) {
end += len
if (end < 0) end = 0
} else if (end > len) {
end = len
}
if (end < start) end = start
var newBuf
if (Buffer.TYPED_ARRAY_SUPPORT) {
newBuf = this.subarray(start, end)
newBuf.__proto__ = Buffer.prototype
} else {
var sliceLen = end - start
newBuf = new Buffer(sliceLen, undefined)
for (var i = 0; i < sliceLen; ++i) {
newBuf[i] = this[i + start]
}
}
return newBuf
}
/*
* Need to make sure that buffer isn't trying to write out of bounds.
*/
function checkOffset (offset, ext, length) {
if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
}
Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
return val
}
Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
checkOffset(offset, byteLength, this.length)
}
var val = this[offset + --byteLength]
var mul = 1
while (byteLength > 0 && (mul *= 0x100)) {
val += this[offset + --byteLength] * mul
}
return val
}
Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
if (!noAssert) checkOffset(offset, 1, this.length)
return this[offset]
}
Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
return this[offset] | (this[offset + 1] << 8)
}
Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
return (this[offset] << 8) | this[offset + 1]
}
Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ((this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16)) +
(this[offset + 3] * 0x1000000)
}
Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] * 0x1000000) +
((this[offset + 1] << 16) |
(this[offset + 2] << 8) |
this[offset + 3])
}
Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var i = byteLength
var mul = 1
var val = this[offset + --i]
while (i > 0 && (mul *= 0x100)) {
val += this[offset + --i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
if (!noAssert) checkOffset(offset, 1, this.length)
if (!(this[offset] & 0x80)) return (this[offset])
return ((0xff - this[offset] + 1) * -1)
}
Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset] | (this[offset + 1] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset + 1] | (this[offset] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16) |
(this[offset + 3] << 24)
}
Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] << 24) |
(this[offset + 1] << 16) |
(this[offset + 2] << 8) |
(this[offset + 3])
}
Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, true, 23, 4)
}
Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, false, 23, 4)
}
Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, true, 52, 8)
}
Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, false, 52, 8)
}
function checkInt (buf, value, offset, ext, max, min) {
if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
if (offset + ext > buf.length) throw new RangeError('Index out of range')
}
Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
var maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
var mul = 1
var i = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
var maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
var i = byteLength - 1
var mul = 1
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
this[offset] = (value & 0xff)
return offset + 1
}
function objectWriteUInt16 (buf, value, offset, littleEndian) {
if (value < 0) value = 0xffff + value + 1
for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
(littleEndian ? i : 1 - i) * 8
}
}
Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
} else {
objectWriteUInt16(this, value, offset, true)
}
return offset + 2
}
Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
} else {
objectWriteUInt16(this, value, offset, false)
}
return offset + 2
}
function objectWriteUInt32 (buf, value, offset, littleEndian) {
if (value < 0) value = 0xffffffff + value + 1
for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
}
}
Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset + 3] = (value >>> 24)
this[offset + 2] = (value >>> 16)
this[offset + 1] = (value >>> 8)
this[offset] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, true)
}
return offset + 4
}
Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, false)
}
return offset + 4
}
Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) {
var limit = Math.pow(2, 8 * byteLength - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = 0
var mul = 1
var sub = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) {
var limit = Math.pow(2, 8 * byteLength - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = byteLength - 1
var mul = 1
var sub = 0
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
if (value < 0) value = 0xff + value + 1
this[offset] = (value & 0xff)
return offset + 1
}
Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
} else {
objectWriteUInt16(this, value, offset, true)
}
return offset + 2
}
Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
} else {
objectWriteUInt16(this, value, offset, false)
}
return offset + 2
}
Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
this[offset + 2] = (value >>> 16)
this[offset + 3] = (value >>> 24)
} else {
objectWriteUInt32(this, value, offset, true)
}
return offset + 4
}
Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (value < 0) value = 0xffffffff + value + 1
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, false)
}
return offset + 4
}
function checkIEEE754 (buf, value, offset, ext, max, min) {
if (offset + ext > buf.length) throw new RangeError('Index out of range')
if (offset < 0) throw new RangeError('Index out of range')
}
function writeFloat (buf, value, offset, littleEndian, noAssert) {
if (!noAssert) {
checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
}
ieee754.write(buf, value, offset, littleEndian, 23, 4)
return offset + 4
}
Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
return writeFloat(this, value, offset, true, noAssert)
}
Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
return writeFloat(this, value, offset, false, noAssert)
}
function writeDouble (buf, value, offset, littleEndian, noAssert) {
if (!noAssert) {
checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
}
ieee754.write(buf, value, offset, littleEndian, 52, 8)
return offset + 8
}
Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
return writeDouble(this, value, offset, true, noAssert)
}
Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
return writeDouble(this, value, offset, false, noAssert)
}
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
if (!start) start = 0
if (!end && end !== 0) end = this.length
if (targetStart >= target.length) targetStart = target.length
if (!targetStart) targetStart = 0
if (end > 0 && end < start) end = start
// Copy 0 bytes; we're done
if (end === start) return 0
if (target.length === 0 || this.length === 0) return 0
// Fatal error conditions
if (targetStart < 0) {
throw new RangeError('targetStart out of bounds')
}
if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
if (end < 0) throw new RangeError('sourceEnd out of bounds')
// Are we oob?
if (end > this.length) end = this.length
if (target.length - targetStart < end - start) {
end = target.length - targetStart + start
}
var len = end - start
var i
if (this === target && start < targetStart && targetStart < end) {
// descending copy from end
for (i = len - 1; i >= 0; --i) {
target[i + targetStart] = this[i + start]
}
} else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
// ascending copy from start
for (i = 0; i < len; ++i) {
target[i + targetStart] = this[i + start]
}
} else {
Uint8Array.prototype.set.call(
target,
this.subarray(start, start + len),
targetStart
)
}
return len
}
// Usage:
// buffer.fill(number[, offset[, end]])
// buffer.fill(buffer[, offset[, end]])
// buffer.fill(string[, offset[, end]][, encoding])
Buffer.prototype.fill = function fill (val, start, end, encoding) {
// Handle string cases:
if (typeof val === 'string') {
if (typeof start === 'string') {
encoding = start
start = 0
end = this.length
} else if (typeof end === 'string') {
encoding = end
end = this.length
}
if (val.length === 1) {
var code = val.charCodeAt(0)
if (code < 256) {
val = code
}
}
if (encoding !== undefined && typeof encoding !== 'string') {
throw new TypeError('encoding must be a string')
}
if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
throw new TypeError('Unknown encoding: ' + encoding)
}
} else if (typeof val === 'number') {
val = val & 255
}
// Invalid ranges are not set to a default, so can range check early.
if (start < 0 || this.length < start || this.length < end) {
throw new RangeError('Out of range index')
}
if (end <= start) {
return this
}
start = start >>> 0
end = end === undefined ? this.length : end >>> 0
if (!val) val = 0
var i
if (typeof val === 'number') {
for (i = start; i < end; ++i) {
this[i] = val
}
} else {
var bytes = Buffer.isBuffer(val)
? val
: utf8ToBytes(new Buffer(val, encoding).toString())
var len = bytes.length
for (i = 0; i < end - start; ++i) {
this[i + start] = bytes[i % len]
}
}
return this
}
// HELPER FUNCTIONS
// ================
var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
function base64clean (str) {
// Node strips out invalid characters like \n and \t from the string, base64-js does not
str = stringtrim(str).replace(INVALID_BASE64_RE, '')
// Node converts strings with length < 2 to ''
if (str.length < 2) return ''
// Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
while (str.length % 4 !== 0) {
str = str + '='
}
return str
}
function stringtrim (str) {
if (str.trim) return str.trim()
return str.replace(/^\s+|\s+$/g, '')
}
function toHex (n) {
if (n < 16) return '0' + n.toString(16)
return n.toString(16)
}
function utf8ToBytes (string, units) {
units = units || Infinity
var codePoint
var length = string.length
var leadSurrogate = null
var bytes = []
for (var i = 0; i < length; ++i) {
codePoint = string.charCodeAt(i)
// is surrogate component
if (codePoint > 0xD7FF && codePoint < 0xE000) {
// last char was a lead
if (!leadSurrogate) {
// no lead yet
if (codePoint > 0xDBFF) {
// unexpected trail
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
} else if (i + 1 === length) {
// unpaired lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
}
// valid lead
leadSurrogate = codePoint
continue
}
// 2 leads in a row
if (codePoint < 0xDC00) {
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
leadSurrogate = codePoint
continue
}
// valid surrogate pair
codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
} else if (leadSurrogate) {
// valid bmp char, but last char was a lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
}
leadSurrogate = null
// encode utf8
if (codePoint < 0x80) {
if ((units -= 1) < 0) break
bytes.push(codePoint)
} else if (codePoint < 0x800) {
if ((units -= 2) < 0) break
bytes.push(
codePoint >> 0x6 | 0xC0,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x10000) {
if ((units -= 3) < 0) break
bytes.push(
codePoint >> 0xC | 0xE0,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x110000) {
if ((units -= 4) < 0) break
bytes.push(
codePoint >> 0x12 | 0xF0,
codePoint >> 0xC & 0x3F | 0x80,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else {
throw new Error('Invalid code point')
}
}
return bytes
}
function asciiToBytes (str) {
var byteArray = []
for (var i = 0; i < str.length; ++i) {
// Node's code seems to be doing this and not & 0x7F..
byteArray.push(str.charCodeAt(i) & 0xFF)
}
return byteArray
}
function utf16leToBytes (str, units) {
var c, hi, lo
var byteArray = []
for (var i = 0; i < str.length; ++i) {
if ((units -= 2) < 0) break
c = str.charCodeAt(i)
hi = c >> 8
lo = c % 256
byteArray.push(lo)
byteArray.push(hi)
}
return byteArray
}
function base64ToBytes (str) {
return base64.toByteArray(base64clean(str))
}
function blitBuffer (src, dst, offset, length) {
for (var i = 0; i < length; ++i) {
if ((i + offset >= dst.length) || (i >= src.length)) break
dst[i + offset] = src[i]
}
return i
}
function isnan (val) {
return val !== val // eslint-disable-line no-self-compare
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(9)))
/***/ }),
/***/ 18:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.byteLength = byteLength
exports.toByteArray = toByteArray
exports.fromByteArray = fromByteArray
var lookup = []
var revLookup = []
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
for (var i = 0, len = code.length; i < len; ++i) {
lookup[i] = code[i]
revLookup[code.charCodeAt(i)] = i
}
// Support decoding URL-safe base64 strings, as Node.js does.
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
revLookup['-'.charCodeAt(0)] = 62
revLookup['_'.charCodeAt(0)] = 63
function getLens (b64) {
var len = b64.length
if (len % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4')
}
// Trim off extra bytes after placeholder bytes are found
// See: https://github.com/beatgammit/base64-js/issues/42
var validLen = b64.indexOf('=')
if (validLen === -1) validLen = len
var placeHoldersLen = validLen === len
? 0
: 4 - (validLen % 4)
return [validLen, placeHoldersLen]
}
// base64 is 4/3 + up to two characters of the original data
function byteLength (b64) {
var lens = getLens(b64)
var validLen = lens[0]
var placeHoldersLen = lens[1]
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}
function _byteLength (b64, validLen, placeHoldersLen) {
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}
function toByteArray (b64) {
var tmp
var lens = getLens(b64)
var validLen = lens[0]
var placeHoldersLen = lens[1]
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
var curByte = 0
// if there are placeholders, only get up to the last complete 4 chars
var len = placeHoldersLen > 0
? validLen - 4
: validLen
var i
for (i = 0; i < len; i += 4) {
tmp =
(revLookup[b64.charCodeAt(i)] << 18) |
(revLookup[b64.charCodeAt(i + 1)] << 12) |
(revLookup[b64.charCodeAt(i + 2)] << 6) |
revLookup[b64.charCodeAt(i + 3)]
arr[curByte++] = (tmp >> 16) & 0xFF
arr[curByte++] = (tmp >> 8) & 0xFF
arr[curByte++] = tmp & 0xFF
}
if (placeHoldersLen === 2) {
tmp =
(revLookup[b64.charCodeAt(i)] << 2) |
(revLookup[b64.charCodeAt(i + 1)] >> 4)
arr[curByte++] = tmp & 0xFF
}
if (placeHoldersLen === 1) {
tmp =
(revLookup[b64.charCodeAt(i)] << 10) |
(revLookup[b64.charCodeAt(i + 1)] << 4) |
(revLookup[b64.charCodeAt(i + 2)] >> 2)
arr[curByte++] = (tmp >> 8) & 0xFF
arr[curByte++] = tmp & 0xFF
}
return arr
}
function tripletToBase64 (num) {
return lookup[num >> 18 & 0x3F] +
lookup[num >> 12 & 0x3F] +
lookup[num >> 6 & 0x3F] +
lookup[num & 0x3F]
}
function encodeChunk (uint8, start, end) {
var tmp
var output = []
for (var i = start; i < end; i += 3) {
tmp =
((uint8[i] << 16) & 0xFF0000) +
((uint8[i + 1] << 8) & 0xFF00) +
(uint8[i + 2] & 0xFF)
output.push(tripletToBase64(tmp))
}
return output.join('')
}
function fromByteArray (uint8) {
var tmp
var len = uint8.length
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
var parts = []
var maxChunkLength = 16383 // must be multiple of 3
// go through the array every three bytes, we'll deal with trailing stuff later
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
}
// pad the end with zeros, but make sure to not forget the extra bytes
if (extraBytes === 1) {
tmp = uint8[len - 1]
parts.push(
lookup[tmp >> 2] +
lookup[(tmp << 4) & 0x3F] +
'=='
)
} else if (extraBytes === 2) {
tmp = (uint8[len - 2] << 8) + uint8[len - 1]
parts.push(
lookup[tmp >> 10] +
lookup[(tmp >> 4) & 0x3F] +
lookup[(tmp << 2) & 0x3F] +
'='
)
}
return parts.join('')
}
/***/ }),
/***/ 19:
/***/ (function(module, exports) {
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
var e, m
var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var nBits = -7
var i = isLE ? (nBytes - 1) : 0
var d = isLE ? -1 : 1
var s = buffer[offset + i]
i += d
e = s & ((1 << (-nBits)) - 1)
s >>= (-nBits)
nBits += eLen
for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
m = e & ((1 << (-nBits)) - 1)
e >>= (-nBits)
nBits += mLen
for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
if (e === 0) {
e = 1 - eBias
} else if (e === eMax) {
return m ? NaN : ((s ? -1 : 1) * Infinity)
} else {
m = m + Math.pow(2, mLen)
e = e - eBias
}
return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
}
exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
var e, m, c
var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
var i = isLE ? 0 : (nBytes - 1)
var d = isLE ? 1 : -1
var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
value = Math.abs(value)
if (isNaN(value) || value === Infinity) {
m = isNaN(value) ? 1 : 0
e = eMax
} else {
e = Math.floor(Math.log(value) / Math.LN2)
if (value * (c = Math.pow(2, -e)) < 1) {
e--
c *= 2
}
if (e + eBias >= 1) {
value += rt / c
} else {
value += rt * Math.pow(2, 1 - eBias)
}
if (value * c >= 2) {
e++
c /= 2
}
if (e + eBias >= eMax) {
m = 0
e = eMax
} else if (e + eBias >= 1) {
m = ((value * c) - 1) * Math.pow(2, mLen)
e = e + eBias
} else {
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
e = 0
}
}
for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
e = (e << mLen) | m
eLen += mLen
for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
buffer[offset + i - d] |= s * 128
}
/***/ }),
/***/ 2:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isBrowser; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return target; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isChrome; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isFirefox; });
/* unused harmony export isWindows */
/* unused harmony export isMac */
/* unused harmony export isLinux */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return keys; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return initEnv; });
var isBrowser = typeof navigator !== 'undefined'
var target = isBrowser
? window
: typeof global !== 'undefined'
? global
: {}
var isChrome = typeof chrome !== 'undefined' && !!chrome.devtools
var isFirefox = isBrowser && navigator.userAgent.indexOf('Firefox') > -1
var isWindows = isBrowser && navigator.platform.indexOf('Win') === 0
var isMac = isBrowser && navigator.platform === 'MacIntel'
var isLinux = isBrowser && navigator.platform.indexOf('Linux') === 0
var keys = {
ctrl: isMac ? '⌘' : 'Ctrl',
shift: 'Shift',
alt: isMac ? '⌥' : 'Alt',
del: 'Del',
enter: 'Enter',
esc: 'Esc'
}
function initEnv (Vue) {
if (Vue.prototype.hasOwnProperty('$isChrome')) { return }
Object.defineProperties(Vue.prototype, {
'$isChrome': { get: () => isChrome },
'$isFirefox': { get: () => isFirefox },
'$isWindows': { get: () => isWindows },
'$isMac': { get: () => isMac },
'$isLinux': { get: () => isLinux },
'$keys': { get: () => keys }
})
if (isWindows) { document.body.classList.add('platform-windows') }
if (isMac) { document.body.classList.add('platform-mac') }
if (isLinux) { document.body.classList.add('platform-linux') }
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(9)))
/***/ }),
/***/ 20:
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = Array.isArray || function (arr) {
return toString.call(arr) == '[object Array]';
};
/***/ }),
/***/ 21:
/***/ (function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// 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
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// 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.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) { return [] }
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
/***/ }),
/***/ 22:
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
// backported and transplited with Babel, with backwards-compat fixes
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// resolves . and .. elements in a path array with directory names there
// must be no slashes, empty elements, or device names (c:\) in the array
// (so also no leading and trailing slashes - it does not distinguish
// relative and absolute paths)
function normalizeArray(parts, allowAboveRoot) {
// if the path tries to go above the root, `up` ends up > 0
var up = 0;
for (var i = parts.length - 1; i >= 0; i--) {
var last = parts[i];
if (last === '.') {
parts.splice(i, 1);
} else if (last === '..') {
parts.splice(i, 1);
up++;
} else if (up) {
parts.splice(i, 1);
up--;
}
}
// if the path is allowed to go above the root, restore leading ..s
if (allowAboveRoot) {
for (; up--; up) {
parts.unshift('..');
}
}
return parts;
}
// path.resolve([from ...], to)
// posix version
exports.resolve = function() {
var resolvedPath = '',
resolvedAbsolute = false;
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
var path = (i >= 0) ? arguments[i] : process.cwd();
// Skip empty and invalid entries
if (typeof path !== 'string') {
throw new TypeError('Arguments to path.resolve must be strings');
} else if (!path) {
continue;
}
resolvedPath = path + '/' + resolvedPath;
resolvedAbsolute = path.charAt(0) === '/';
}
// At this point the path should be resolved to a full absolute path, but
// handle relative paths to be safe (might happen when process.cwd() fails)
// Normalize the path
resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
return !!p;
}), !resolvedAbsolute).join('/');
return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
};
// path.normalize(path)
// posix version
exports.normalize = function(path) {
var isAbsolute = exports.isAbsolute(path),
trailingSlash = substr(path, -1) === '/';
// Normalize the path
path = normalizeArray(filter(path.split('/'), function(p) {
return !!p;
}), !isAbsolute).join('/');
if (!path && !isAbsolute) {
path = '.';
}
if (path && trailingSlash) {
path += '/';
}
return (isAbsolute ? '/' : '') + path;
};
// posix version
exports.isAbsolute = function(path) {
return path.charAt(0) === '/';
};
// posix version
exports.join = function() {
var paths = Array.prototype.slice.call(arguments, 0);
return exports.normalize(filter(paths, function(p, index) {
if (typeof p !== 'string') {
throw new TypeError('Arguments to path.join must be strings');
}
return p;
}).join('/'));
};
// path.relative(from, to)
// posix version
exports.relative = function(from, to) {
from = exports.resolve(from).substr(1);
to = exports.resolve(to).substr(1);
function trim(arr) {
var start = 0;
for (; start < arr.length; start++) {
if (arr[start] !== '') break;
}
var end = arr.length - 1;
for (; end >= 0; end--) {
if (arr[end] !== '') break;
}
if (start > end) return [];
return arr.slice(start, end - start + 1);
}
var fromParts = trim(from.split('/'));
var toParts = trim(to.split('/'));
var length = Math.min(fromParts.length, toParts.length);
var samePartsLength = length;
for (var i = 0; i < length; i++) {
if (fromParts[i] !== toParts[i]) {
samePartsLength = i;
break;
}
}
var outputParts = [];
for (var i = samePartsLength; i < fromParts.length; i++) {
outputParts.push('..');
}
outputParts = outputParts.concat(toParts.slice(samePartsLength));
return outputParts.join('/');
};
exports.sep = '/';
exports.delimiter = ':';
exports.dirname = function (path) {
if (typeof path !== 'string') path = path + '';
if (path.length === 0) return '.';
var code = path.charCodeAt(0);
var hasRoot = code === 47 /*/*/;
var end = -1;
var matchedSlash = true;
for (var i = path.length - 1; i >= 1; --i) {
code = path.charCodeAt(i);
if (code === 47 /*/*/) {
if (!matchedSlash) {
end = i;
break;
}
} else {
// We saw the first non-path separator
matchedSlash = false;
}
}
if (end === -1) return hasRoot ? '/' : '.';
if (hasRoot && end === 1) {
// return '//';
// Backwards-compat fix:
return '/';
}
return path.slice(0, end);
};
function basename(path) {
if (typeof path !== 'string') path = path + '';
var start = 0;
var end = -1;
var matchedSlash = true;
var i;
for (i = path.length - 1; i >= 0; --i) {
if (path.charCodeAt(i) === 47 /*/*/) {
// If we reached a path separator that was not part of a set of path
// separators at the end of the string, stop now
if (!matchedSlash) {
start = i + 1;
break;
}
} else if (end === -1) {
// We saw the first non-path separator, mark this as the end of our
// path component
matchedSlash = false;
end = i + 1;
}
}
if (end === -1) return '';
return path.slice(start, end);
}
// Uses a mixed approach for backwards-compatibility, as ext behavior changed
// in new Node.js versions, so only basename() above is backported here
exports.basename = function (path, ext) {
var f = basename(path);
if (ext && f.substr(-1 * ext.length) === ext) {
f = f.substr(0, f.length - ext.length);
}
return f;
};
exports.extname = function (path) {
if (typeof path !== 'string') path = path + '';
var startDot = -1;
var startPart = 0;
var end = -1;
var matchedSlash = true;
// Track the state of characters (if any) we see before our first dot and
// after any path separator we find
var preDotState = 0;
for (var i = path.length - 1; i >= 0; --i) {
var code = path.charCodeAt(i);
if (code === 47 /*/*/) {
// If we reached a path separator that was not part of a set of path
// separators at the end of the string, stop now
if (!matchedSlash) {
startPart = i + 1;
break;
}
continue;
}
if (end === -1) {
// We saw the first non-path separator, mark this as the end of our
// extension
matchedSlash = false;
end = i + 1;
}
if (code === 46 /*.*/) {
// If this is our first dot, mark it as the start of our extension
if (startDot === -1)
startDot = i;
else if (preDotState !== 1)
preDotState = 1;
} else if (startDot !== -1) {
// We saw a non-dot and non-path separator before our dot, so we should
// have a good chance at having a non-empty extension
preDotState = -1;
}
}
if (startDot === -1 || end === -1 ||
// We saw a non-dot character immediately before the dot
preDotState === 0 ||
// The (right-most) trimmed path component is exactly '..'
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
return '';
}
return path.slice(startDot, end);
};
function filter (xs, f) {
if (xs.filter) return xs.filter(f);
var res = [];
for (var i = 0; i < xs.length; i++) {
if (f(xs[i], i, xs)) res.push(xs[i]);
}
return res;
}
// String.prototype.substr - negative index don't work in IE8
var substr = 'ab'.substr(-1) === 'b'
? function (str, start, len) { return str.substr(start, len) }
: function (str, start, len) {
if (start < 0) start = str.length + start;
return str.substr(start, len);
}
;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(21)))
/***/ }),
/***/ 23:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Bridge; });
/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24);
/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_0__);
var BATCH_DURATION = 100
class Bridge extends events__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"] {
constructor (wall) {
super()
this.setMaxListeners(Infinity)
this.wall = wall
wall.listen(messages => {
if (Array.isArray(messages)) {
messages.forEach(message => this._emit(message))
} else {
this._emit(messages)
}
})
this._batchingQueue = []
this._sendingQueue = []
this._receivingQueue = []
this._sending = false
this._time = null
}
/**
* Send an event.
*
* @param {String} event
* @param {*} payload
*/
send (event, payload) {
if (Array.isArray(payload)) {
var lastIndex = payload.length - 1
payload.forEach((chunk, index) => {
this._send({
event,
_chunk: chunk,
last: index === lastIndex
})
})
this._flush()
} else if (this._time === null) {
this._send([{ event, payload }])
this._time = Date.now()
} else {
this._batchingQueue.push({
event,
payload
})
var now = Date.now()
if (now - this._time > BATCH_DURATION) {
this._flush()
} else {
this._timer = setTimeout(() => this._flush(), BATCH_DURATION)
}
}
}
/**
* Log a message to the devtools background page.
*
* @param {String} message
*/
log (message) {
this.send('log', message)
}
_flush () {
if (this._batchingQueue.length) { this._send(this._batchingQueue) }
clearTimeout(this._timer)
this._batchingQueue = []
this._time = null
}
_emit (message) {
if (typeof message === 'string') {
this.emit(message)
} else if (message._chunk) {
this._receivingQueue.push(message._chunk)
if (message.last) {
this.emit(message.event, this._receivingQueue)
this._receivingQueue = []
}
} else {
this.emit(message.event, message.payload)
}
}
_send (messages) {
this._sendingQueue.push(messages)
this._nextSend()
}
_nextSend () {
if (!this._sendingQueue.length || this._sending) { return }
this._sending = true
var messages = this._sendingQueue.shift()
try {
this.wall.send(messages)
} catch (err) {
if (err.message === 'Message length exceeded maximum allowed length.') {
this._sendingQueue.splice(0, 0, messages.map(message => [message]))
}
}
this._sending = false
requestAnimationFrame(() => this._nextSend())
}
}
/***/ }),
/***/ 24:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var R = typeof Reflect === 'object' ? Reflect : null
var ReflectApply = R && typeof R.apply === 'function'
? R.apply
: function ReflectApply(target, receiver, args) {
return Function.prototype.apply.call(target, receiver, args);
}
var ReflectOwnKeys
if (R && typeof R.ownKeys === 'function') {
ReflectOwnKeys = R.ownKeys
} else if (Object.getOwnPropertySymbols) {
ReflectOwnKeys = function ReflectOwnKeys(target) {
return Object.getOwnPropertyNames(target)
.concat(Object.getOwnPropertySymbols(target));
};
} else {
ReflectOwnKeys = function ReflectOwnKeys(target) {
return Object.getOwnPropertyNames(target);
};
}
function ProcessEmitWarning(warning) {
if (console && console.warn) console.warn(warning);
}
var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
return value !== value;
}
function EventEmitter() {
EventEmitter.init.call(this);
}
module.exports = EventEmitter;
module.exports.once = once;
// Backwards-compat with node 0.10.x
EventEmitter.EventEmitter = EventEmitter;
EventEmitter.prototype._events = undefined;
EventEmitter.prototype._eventsCount = 0;
EventEmitter.prototype._maxListeners = undefined;
// By default EventEmitters will print a warning if more than 10 listeners are
// added to it. This is a useful default which helps finding memory leaks.
var defaultMaxListeners = 10;
function checkListener(listener) {
if (typeof listener !== 'function') {
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
}
}
Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
enumerable: true,
get: function() {
return defaultMaxListeners;
},
set: function(arg) {
if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
}
defaultMaxListeners = arg;
}
});
EventEmitter.init = function() {
if (this._events === undefined ||
this._events === Object.getPrototypeOf(this)._events) {
this._events = Object.create(null);
this._eventsCount = 0;
}
this._maxListeners = this._maxListeners || undefined;
};
// Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
}
this._maxListeners = n;
return this;
};
function _getMaxListeners(that) {
if (that._maxListeners === undefined)
return EventEmitter.defaultMaxListeners;
return that._maxListeners;
}
EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
return _getMaxListeners(this);
};
EventEmitter.prototype.emit = function emit(type) {
var args = [];
for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
var doError = (type === 'error');
var events = this._events;
if (events !== undefined)
doError = (doError && events.error === undefined);
else if (!doError)
return false;
// If there is no 'error' event listener then throw.
if (doError) {
var er;
if (args.length > 0)
er = args[0];
if (er instanceof Error) {
// Note: The comments on the `throw` lines are intentional, they show
// up in Node's output if this results in an unhandled exception.
throw er; // Unhandled 'error' event
}
// At least give some kind of context to the user
var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
err.context = er;
throw err; // Unhandled 'error' event
}
var handler = events[type];
if (handler === undefined)
return false;
if (typeof handler === 'function') {
ReflectApply(handler, this, args);
} else {
var len = handler.length;
var listeners = arrayClone(handler, len);
for (var i = 0; i < len; ++i)
ReflectApply(listeners[i], this, args);
}
return true;
};
function _addListener(target, type, listener, prepend) {
var m;
var events;
var existing;
checkListener(listener);
events = target._events;
if (events === undefined) {
events = target._events = Object.create(null);
target._eventsCount = 0;
} else {
// To avoid recursion in the case that type === "newListener"! Before
// adding it to the listeners, first emit "newListener".
if (events.newListener !== undefined) {
target.emit('newListener', type,
listener.listener ? listener.listener : listener);
// Re-assign `events` because a newListener handler could have caused the
// this._events to be assigned to a new object
events = target._events;
}
existing = events[type];
}
if (existing === undefined) {
// Optimize the case of one listener. Don't need the extra array object.
existing = events[type] = listener;
++target._eventsCount;
} else {
if (typeof existing === 'function') {
// Adding the second element, need to change to array.
existing = events[type] =
prepend ? [listener, existing] : [existing, listener];
// If we've already got an array, just append.
} else if (prepend) {
existing.unshift(listener);
} else {
existing.push(listener);
}
// Check for listener leak
m = _getMaxListeners(target);
if (m > 0 && existing.length > m && !existing.warned) {
existing.warned = true;
// No error code for this since it is a Warning
// eslint-disable-next-line no-restricted-syntax
var w = new Error('Possible EventEmitter memory leak detected. ' +
existing.length + ' ' + String(type) + ' listeners ' +
'added. Use emitter.setMaxListeners() to ' +
'increase limit');
w.name = 'MaxListenersExceededWarning';
w.emitter = target;
w.type = type;
w.count = existing.length;
ProcessEmitWarning(w);
}
}
return target;
}
EventEmitter.prototype.addListener = function addListener(type, listener) {
return _addListener(this, type, listener, false);
};
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
EventEmitter.prototype.prependListener =
function prependListener(type, listener) {
return _addListener(this, type, listener, true);
};
function onceWrapper() {
if (!this.fired) {
this.target.removeListener(this.type, this.wrapFn);
this.fired = true;
if (arguments.length === 0)
return this.listener.call(this.target);
return this.listener.apply(this.target, arguments);
}
}
function _onceWrap(target, type, listener) {
var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
var wrapped = onceWrapper.bind(state);
wrapped.listener = listener;
state.wrapFn = wrapped;
return wrapped;
}
EventEmitter.prototype.once = function once(type, listener) {
checkListener(listener);
this.on(type, _onceWrap(this, type, listener));
return this;
};
EventEmitter.prototype.prependOnceListener =
function prependOnceListener(type, listener) {
checkListener(listener);
this.prependListener(type, _onceWrap(this, type, listener));
return this;
};
// Emits a 'removeListener' event if and only if the listener was removed.
EventEmitter.prototype.removeListener =
function removeListener(type, listener) {
var list, events, position, i, originalListener;
checkListener(listener);
events = this._events;
if (events === undefined)
return this;
list = events[type];
if (list === undefined)
return this;
if (list === listener || list.listener === listener) {
if (--this._eventsCount === 0)
this._events = Object.create(null);
else {
delete events[type];
if (events.removeListener)
this.emit('removeListener', type, list.listener || listener);
}
} else if (typeof list !== 'function') {
position = -1;
for (i = list.length - 1; i >= 0; i--) {
if (list[i] === listener || list[i].listener === listener) {
originalListener = list[i].listener;
position = i;
break;
}
}
if (position < 0)
return this;
if (position === 0)
list.shift();
else {
spliceOne(list, position);
}
if (list.length === 1)
events[type] = list[0];
if (events.removeListener !== undefined)
this.emit('removeListener', type, originalListener || listener);
}
return this;
};
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
EventEmitter.prototype.removeAllListeners =
function removeAllListeners(type) {
var listeners, events, i;
events = this._events;
if (events === undefined)
return this;
// not listening for removeListener, no need to emit
if (events.removeListener === undefined) {
if (arguments.length === 0) {
this._events = Object.create(null);
this._eventsCount = 0;
} else if (events[type] !== undefined) {
if (--this._eventsCount === 0)
this._events = Object.create(null);
else
delete events[type];
}
return this;
}
// emit removeListener for all listeners on all events
if (arguments.length === 0) {
var keys = Object.keys(events);
var key;
for (i = 0; i < keys.length; ++i) {
key = keys[i];
if (key === 'removeListener') continue;
this.removeAllListeners(key);
}
this.removeAllListeners('removeListener');
this._events = Object.create(null);
this._eventsCount = 0;
return this;
}
listeners = events[type];
if (typeof listeners === 'function') {
this.removeListener(type, listeners);
} else if (listeners !== undefined) {
// LIFO order
for (i = listeners.length - 1; i >= 0; i--) {
this.removeListener(type, listeners[i]);
}
}
return this;
};
function _listeners(target, type, unwrap) {
var events = target._events;
if (events === undefined)
return [];
var evlistener = events[type];
if (evlistener === undefined)
return [];
if (typeof evlistener === 'function')
return unwrap ? [evlistener.listener || evlistener] : [evlistener];
return unwrap ?
unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
}
EventEmitter.prototype.listeners = function listeners(type) {
return _listeners(this, type, true);
};
EventEmitter.prototype.rawListeners = function rawListeners(type) {
return _listeners(this, type, false);
};
EventEmitter.listenerCount = function(emitter, type) {
if (typeof emitter.listenerCount === 'function') {
return emitter.listenerCount(type);
} else {
return listenerCount.call(emitter, type);
}
};
EventEmitter.prototype.listenerCount = listenerCount;
function listenerCount(type) {
var events = this._events;
if (events !== undefined) {
var evlistener = events[type];
if (typeof evlistener === 'function') {
return 1;
} else if (evlistener !== undefined) {
return evlistener.length;
}
}
return 0;
}
EventEmitter.prototype.eventNames = function eventNames() {
return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
};
function arrayClone(arr, n) {
var copy = new Array(n);
for (var i = 0; i < n; ++i)
copy[i] = arr[i];
return copy;
}
function spliceOne(list, index) {
for (; index + 1 < list.length; index++)
list[index] = list[index + 1];
list.pop();
}
function unwrapListeners(arr) {
var ret = new Array(arr.length);
for (var i = 0; i < ret.length; ++i) {
ret[i] = arr[i].listener || arr[i];
}
return ret;
}
function once(emitter, name) {
return new Promise(function (resolve, reject) {
function errorListener(err) {
emitter.removeListener(name, resolver);
reject(err);
}
function resolver() {
if (typeof emitter.removeListener === 'function') {
emitter.removeListener('error', errorListener);
}
resolve([].slice.call(arguments));
};
eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
if (name !== 'error') {
addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
}
});
}
function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
if (typeof emitter.on === 'function') {
eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
}
}
function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
if (typeof emitter.on === 'function') {
if (flags.once) {
emitter.once(name, listener);
} else {
emitter.on(name, listener);
}
} else if (typeof emitter.addEventListener === 'function') {
// EventTarget does not have `error` event semantics like Node
// EventEmitters, we do not listen for `error` events here.
emitter.addEventListener(name, function wrapListener(arg) {
// IE does not have builtin `{ once: true }` support so we
// have to do it manually.
if (flags.once) {
emitter.removeEventListener(name, wrapListener);
}
listener(arg);
});
} else {
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
}
}
/***/ }),
/***/ 35:
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) ||
(typeof self !== "undefined" && self) ||
window;
var apply = Function.prototype.apply;
// DOM APIs, for completeness
exports.setTimeout = function() {
return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);
};
exports.setInterval = function() {
return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);
};
exports.clearTimeout =
exports.clearInterval = function(timeout) {
if (timeout) {
timeout.close();
}
};
function Timeout(id, clearFn) {
this._id = id;
this._clearFn = clearFn;
}
Timeout.prototype.unref = Timeout.prototype.ref = function() {};
Timeout.prototype.close = function() {
this._clearFn.call(scope, this._id);
};
// Does not start the time, just sets up the members needed.
exports.enroll = function(item, msecs) {
clearTimeout(item._idleTimeoutId);
item._idleTimeout = msecs;
};
exports.unenroll = function(item) {
clearTimeout(item._idleTimeoutId);
item._idleTimeout = -1;
};
exports._unrefActive = exports.active = function(item) {
clearTimeout(item._idleTimeoutId);
var msecs = item._idleTimeout;
if (msecs >= 0) {
item._idleTimeoutId = setTimeout(function onTimeout() {
if (item._onTimeout)
item._onTimeout();
}, msecs);
}
};
// setimmediate attaches itself to the global object
__webpack_require__(36);
// On some exotic environments, it's not clear which object `setimmediate` was
// able to install onto. Search each possibility in the same order as the
// `setimmediate` library.
exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) ||
(typeof global !== "undefined" && global.setImmediate) ||
(this && this.setImmediate);
exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) ||
(typeof global !== "undefined" && global.clearImmediate) ||
(this && this.clearImmediate);
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(9)))
/***/ }),
/***/ 36:
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
"use strict";
if (global.setImmediate) {
return;
}
var nextHandle = 1; // Spec says greater than zero
var tasksByHandle = {};
var currentlyRunningATask = false;
var doc = global.document;
var registerImmediate;
function setImmediate(callback) {
// Callback can either be a function or a string
if (typeof callback !== "function") {
callback = new Function("" + callback);
}
// Copy function arguments
var args = new Array(arguments.length - 1);
for (var i = 0; i < args.length; i++) {
args[i] = arguments[i + 1];
}
// Store and register the task
var task = { callback: callback, args: args };
tasksByHandle[nextHandle] = task;
registerImmediate(nextHandle);
return nextHandle++;
}
function clearImmediate(handle) {
delete tasksByHandle[handle];
}
function run(task) {
var callback = task.callback;
var args = task.args;
switch (args.length) {
case 0:
callback();
break;
case 1:
callback(args[0]);
break;
case 2:
callback(args[0], args[1]);
break;
case 3:
callback(args[0], args[1], args[2]);
break;
default:
callback.apply(undefined, args);
break;
}
}
function runIfPresent(handle) {
// From the spec: "Wait until any invocations of this algorithm started before this one have completed."
// So if we're currently running a task, we'll need to delay this invocation.
if (currentlyRunningATask) {
// Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
// "too much recursion" error.
setTimeout(runIfPresent, 0, handle);
} else {
var task = tasksByHandle[handle];
if (task) {
currentlyRunningATask = true;
try {
run(task);
} finally {
clearImmediate(handle);
currentlyRunningATask = false;
}
}
}
}
function installNextTickImplementation() {
registerImmediate = function(handle) {
process.nextTick(function () { runIfPresent(handle); });
};
}
function canUsePostMessage() {
// The test against `importScripts` prevents this implementation from being installed inside a web worker,
// where `global.postMessage` means something completely different and can't be used for this purpose.
if (global.postMessage && !global.importScripts) {
var postMessageIsAsynchronous = true;
var oldOnMessage = global.onmessage;
global.onmessage = function() {
postMessageIsAsynchronous = false;
};
global.postMessage("", "*");
global.onmessage = oldOnMessage;
return postMessageIsAsynchronous;
}
}
function installPostMessageImplementation() {
// Installs an event handler on `global` for the `message` event: see
// * https://developer.mozilla.org/en/DOM/window.postMessage
// * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
var messagePrefix = "setImmediate$" + Math.random() + "$";
var onGlobalMessage = function(event) {
if (event.source === global &&
typeof event.data === "string" &&
event.data.indexOf(messagePrefix) === 0) {
runIfPresent(+event.data.slice(messagePrefix.length));
}
};
if (global.addEventListener) {
global.addEventListener("message", onGlobalMessage, false);
} else {
global.attachEvent("onmessage", onGlobalMessage);
}
registerImmediate = function(handle) {
global.postMessage(messagePrefix + handle, "*");
};
}
function installMessageChannelImplementation() {
var channel = new MessageChannel();
channel.port1.onmessage = function(event) {
var handle = event.data;
runIfPresent(handle);
};
registerImmediate = function(handle) {
channel.port2.postMessage(handle);
};
}
function installReadyStateChangeImplementation() {
var html = doc.documentElement;
registerImmediate = function(handle) {
// Create a