electron-devtools-vendor
Version:
<div align="center"> <h2>electron-devtools-vendor</h2> <img alt="MIT" src="https://img.shields.io/github/license/BlackHole1/electron-devtools-vendor?color=9cf&style=flat-square"> <img alt="GitHub repo size" src="https://img.shields.io/github/r
1,416 lines (1,116 loc) • 38.8 kB
JavaScript
/******/ (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, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 332);
/******/ })
/************************************************************************/
/******/ ({
/***/ 1:
/***/ (function(module, exports) {
var core = module.exports = { version: '2.6.11' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
/***/ }),
/***/ 10:
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(9);
var core = __webpack_require__(1);
var ctx = __webpack_require__(18);
var hide = __webpack_require__(16);
var has = __webpack_require__(17);
var PROTOTYPE = 'prototype';
var $export = function (type, name, source) {
var IS_FORCED = type & $export.F;
var IS_GLOBAL = type & $export.G;
var IS_STATIC = type & $export.S;
var IS_PROTO = type & $export.P;
var IS_BIND = type & $export.B;
var IS_WRAP = type & $export.W;
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
var expProto = exports[PROTOTYPE];
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
var key, own, out;
if (IS_GLOBAL) source = name;
for (key in source) {
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
if (own && has(exports, key)) continue;
// export native or passed
out = own ? target[key] : source[key];
// prevent global pollution for namespaces
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
// bind timers to global for call from export context
: IS_BIND && own ? ctx(out, global)
// wrap global constructors for prevent change them in library
: IS_WRAP && target[key] == out ? (function (C) {
var F = function (a, b, c) {
if (this instanceof C) {
switch (arguments.length) {
case 0: return new C();
case 1: return new C(a);
case 2: return new C(a, b);
} return new C(a, b, c);
} return C.apply(this, arguments);
};
F[PROTOTYPE] = C[PROTOTYPE];
return F;
// make static versions for prototype methods
})(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
// export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
if (IS_PROTO) {
(exports.virtual || (exports.virtual = {}))[key] = out;
// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
}
}
};
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;
/***/ }),
/***/ 12:
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(15);
var IE8_DOM_DEFINE = __webpack_require__(62);
var toPrimitive = __webpack_require__(48);
var dP = Object.defineProperty;
exports.f = __webpack_require__(13) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return dP(O, P, Attributes);
} catch (e) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
/***/ }),
/***/ 13:
/***/ (function(module, exports, __webpack_require__) {
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__(20)(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/***/ 14:
/***/ (function(module, exports) {
module.exports = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ }),
/***/ 15:
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(14);
module.exports = function (it) {
if (!isObject(it)) throw TypeError(it + ' is not an object!');
return it;
};
/***/ }),
/***/ 16:
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(12);
var createDesc = __webpack_require__(23);
module.exports = __webpack_require__(13) ? function (object, key, value) {
return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
/***/ }),
/***/ 17:
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
return hasOwnProperty.call(it, key);
};
/***/ }),
/***/ 18:
/***/ (function(module, exports, __webpack_require__) {
// optional / simple context binding
var aFunction = __webpack_require__(29);
module.exports = function (fn, that, length) {
aFunction(fn);
if (that === undefined) return fn;
switch (length) {
case 1: return function (a) {
return fn.call(that, a);
};
case 2: return function (a, b) {
return fn.call(that, a, b);
};
case 3: return function (a, b, c) {
return fn.call(that, a, b, c);
};
}
return function (/* ...args */) {
return fn.apply(that, arguments);
};
};
/***/ }),
/***/ 19:
/***/ (function(module, exports, __webpack_require__) {
// 7.1.13 ToObject(argument)
var defined = __webpack_require__(34);
module.exports = function (it) {
return Object(defined(it));
};
/***/ }),
/***/ 20:
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
/***/ }),
/***/ 21:
/***/ (function(module, exports) {
module.exports = {};
/***/ }),
/***/ 22:
/***/ (function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__(47);
var defined = __webpack_require__(34);
module.exports = function (it) {
return IObject(defined(it));
};
/***/ }),
/***/ 23:
/***/ (function(module, exports) {
module.exports = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
/***/ }),
/***/ 24:
/***/ (function(module, exports, __webpack_require__) {
;
var $at = __webpack_require__(79)(true);
// 21.1.3.27 String.prototype[@@iterator]()
__webpack_require__(49)(String, 'String', function (iterated) {
this._t = String(iterated); // target
this._i = 0; // next index
// 21.1.5.2.1 %StringIteratorPrototype%.next()
}, function () {
var O = this._t;
var index = this._i;
var point;
if (index >= O.length) return { value: undefined, done: true };
point = $at(O, index);
this._i += point.length;
return { value: point, done: false };
});
/***/ }),
/***/ 25:
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = function (it) {
return toString.call(it).slice(8, -1);
};
/***/ }),
/***/ 26:
/***/ (function(module, exports) {
module.exports = true;
/***/ }),
/***/ 27:
/***/ (function(module, exports, __webpack_require__) {
var def = __webpack_require__(12).f;
var has = __webpack_require__(17);
var TAG = __webpack_require__(8)('toStringTag');
module.exports = function (it, tag, stat) {
if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
};
/***/ }),
/***/ 28:
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__(61);
var enumBugKeys = __webpack_require__(43);
module.exports = Object.keys || function keys(O) {
return $keys(O, enumBugKeys);
};
/***/ }),
/***/ 29:
/***/ (function(module, exports) {
module.exports = function (it) {
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
return it;
};
/***/ }),
/***/ 31:
/***/ (function(module, exports, __webpack_require__) {
// 7.1.15 ToLength
var toInteger = __webpack_require__(35);
var min = Math.min;
module.exports = function (it) {
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
/***/ }),
/***/ 32:
/***/ (function(module, exports) {
var id = 0;
var px = Math.random();
module.exports = function (key) {
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
/***/ }),
/***/ 332:
/***/ (function(module, exports, __webpack_require__) {
;
var _debugConnection = __webpack_require__(92);
var _debugConnection2 = _interopRequireDefault(_debugConnection);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/*
* background.js
*
* Runs all the time and serves as a central message hub for panels, contentScript, backend
*/
if (false) {
var listener = function listener(evt, _ref) {
var tab = _ref.tab;
if (evt.eventName === 'open-mobx-devtools-window') {
window.contentTabId = tab.id;
openWindow(tab.id);
}
};
chrome.runtime.onMessage.addListener(listener);
}
var orphansByTabId = {};
function getActiveContentWindow(cb) {
chrome.tabs.query({ active: true, windowType: 'normal', currentWindow: true }, function (d) {
if (d.length > 0) {
cb(d[0]);
}
});
}
function openWindow(contentTabId) {
var devtoolWidth = window.screen.availWidth > 1366 ? 450 : 420;
// Resize main window
chrome.windows.getCurrent(function (wind) {
if (wind.left + wind.width > window.screen.availWidth - devtoolWidth) {
var newWidth = Math.min(window.screen.availWidth - devtoolWidth, wind.width);
chrome.windows.update(wind.id, {
left: window.screen.availWidth - devtoolWidth - newWidth,
top: wind.top,
width: newWidth,
height: wind.height
});
}
});
// Open devtools window
chrome.windows.create({
type: 'popup',
url: chrome.extension.getURL('window.html#window'),
width: devtoolWidth,
height: window.screen.availHeight,
top: 0,
left: window.screen.availWidth - devtoolWidth
}, function (win) {
function closeListener(tabId) {
if (tabId === contentTabId || tabId === win.tabs[0].id) {
chrome.tabs.onRemoved.removeListener(closeListener);
chrome.windows.remove(win.id);
}
}
chrome.tabs.onRemoved.addListener(closeListener);
});
}
function isNumeric(str) {
return '' + +str === str;
}
function handleInstallError(tabId, error) {
if (false) console.warn(error); // eslint-disable-line no-console
var orphanDevtools = orphansByTabId[tabId].filter(function (p) {
return !p.contentScript && p.devtools !== undefined;
}).map(function (p) {
return p.devtools;
});
orphanDevtools.forEach(function (d) {
return d.postMessage('content-script-installation-error');
});
}
var waitTabLoad = function waitTabLoad(tabId, cb) {
if (!chrome.tabs.get) {
// electron doesn't support this api
cb();
return;
}
chrome.tabs.get(+tabId, function (tab) {
if (chrome.runtime.lastError) {
cb(chrome.runtime.lastError);
} else if (tab.status === 'complete') {
cb();
} else {
chrome.tabs.onUpdated.addListener(function listener(tid, changeInfo) {
if (tid !== tabId || changeInfo.status === 'loading') return;
chrome.tabs.onUpdated.removeListener(listener);
cb();
});
}
});
};
var installContentScript = function installContentScript(tabId) {
waitTabLoad(+tabId, function (err) {
if (err) {
handleInstallError(tabId, err);
} else {
chrome.tabs.executeScript(tabId, { file: '/contentScript.js' }, function (res) {
var installError = chrome.runtime.lastError;
if (err || !res) handleInstallError(tabId, installError);
});
}
});
};
function doublePipe(one, two) {
if (!one.$i) {
one.$i = Math.random().toString(32).slice(2);
}
if (!two.$i) {
two.$i = Math.random().toString(32).slice(2);
}
(0, _debugConnection2.default)('BACKGORUND: connect ' + one.name + ' <-> ' + two.name + ' [' + one.$i + ' <-> ' + two.$i + ']');
function lOne(message) {
(0, _debugConnection2.default)(one.name + ' -> BACKGORUND -> ' + two.name + ' [' + one.$i + '-' + two.$i + ']', message);
try {
two.postMessage(message);
} catch (e) {
if (false) console.error('Unexpected disconnect, error', e); // eslint-disable-line no-console
shutdown(); // eslint-disable-line no-use-before-define
}
}
function lTwo(message) {
(0, _debugConnection2.default)(two.name + ' -> BACKGORUND -> ' + one.name + ' [' + two.$i + '-' + one.$i + ']', message);
try {
one.postMessage(message);
} catch (e) {
if (false) console.error('Unexpected disconnect, error', e); // eslint-disable-line no-console
shutdown(); // eslint-disable-line no-use-before-define
}
}
one.onMessage.addListener(lOne);
two.onMessage.addListener(lTwo);
function shutdown() {
(0, _debugConnection2.default)('SHUTDOWN ' + one.name + ' <-> ' + two.name + ' [' + one.$i + ' <-> ' + two.$i + ']');
one.onMessage.removeListener(lOne);
two.onMessage.removeListener(lTwo);
one.disconnect();
two.disconnect();
}
one.onDisconnect.addListener(shutdown);
two.onDisconnect.addListener(shutdown);
}
if (chrome.contextMenus) {
// electron doesn't support this api
chrome.contextMenus.onClicked.addListener(function (_, contentWindow) {
openWindow(contentWindow.id);
});
}
if (chrome.commands) {
// electron doesn't support this api
chrome.commands.onCommand.addListener(function (shortcut) {
if (shortcut === 'open-devtools-window') {
getActiveContentWindow(function (contentWindow) {
window.contentTabId = contentWindow.id;
openWindow(contentWindow.id);
});
}
});
}
if (chrome.browserAction) {
// electron doesn't support this api
chrome.browserAction.onClicked.addListener(function (tab) {
window.contentTabId = tab.id;
openWindow(tab.id);
});
}
chrome.runtime.onInstalled.addListener(function () {
chrome.contextMenus.create({
id: 'mobx-devtools',
title: 'Open Mobx DevTools',
contexts: ['all']
});
});
chrome.runtime.onConnect.addListener(function (port) {
var tab = null;
var name = null;
if (isNumeric(port.name)) {
tab = port.name;
name = 'devtools';
installContentScript(+port.name);
} else {
tab = port.sender.tab.id;
name = 'content-script';
}
if (!orphansByTabId[tab]) {
orphansByTabId[tab] = [];
}
if (name === 'content-script') {
var orphan = orphansByTabId[tab].find(function (t) {
return t.name === 'devtools';
});
if (orphan) {
doublePipe(orphan.port, port);
orphansByTabId[tab] = orphansByTabId[tab].filter(function (t) {
return t !== orphan;
});
} else {
var newOrphan = { name: name, port: port };
orphansByTabId[tab].push(newOrphan);
port.onDisconnect.addListener(function () {
if (false) console.warn('orphan devtools disconnected'); // eslint-disable-line no-console
orphansByTabId[tab] = orphansByTabId[tab].filter(function (t) {
return t !== newOrphan;
});
});
}
} else if (name === 'devtools') {
var _orphan = orphansByTabId[tab].find(function (t) {
return t.name === 'content-script';
});
if (_orphan) {
orphansByTabId[tab] = orphansByTabId[tab].filter(function (t) {
return t !== _orphan;
});
} else {
var _newOrphan = { name: name, port: port };
orphansByTabId[tab].push(_newOrphan);
port.onDisconnect.addListener(function () {
if (false) console.warn('orphan content-script disconnected'); // eslint-disable-line no-console
orphansByTabId[tab] = orphansByTabId[tab].filter(function (t) {
return t !== _newOrphan;
});
});
}
}
});
/***/ }),
/***/ 34:
/***/ (function(module, exports) {
// 7.2.1 RequireObjectCoercible(argument)
module.exports = function (it) {
if (it == undefined) throw TypeError("Can't call method on " + it);
return it;
};
/***/ }),
/***/ 35:
/***/ (function(module, exports) {
// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
module.exports = function (it) {
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
/***/ }),
/***/ 36:
/***/ (function(module, exports, __webpack_require__) {
var shared = __webpack_require__(42)('keys');
var uid = __webpack_require__(32);
module.exports = function (key) {
return shared[key] || (shared[key] = uid(key));
};
/***/ }),
/***/ 39:
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = __webpack_require__(15);
var dPs = __webpack_require__(81);
var enumBugKeys = __webpack_require__(43);
var IE_PROTO = __webpack_require__(36)('IE_PROTO');
var Empty = function () { /* empty */ };
var PROTOTYPE = 'prototype';
// Create object with fake `null` prototype: use iframe Object with cleared prototype
var createDict = function () {
// Thrash, waste and sodomy: IE GC bug
var iframe = __webpack_require__(44)('iframe');
var i = enumBugKeys.length;
var lt = '<';
var gt = '>';
var iframeDocument;
iframe.style.display = 'none';
__webpack_require__(63).appendChild(iframe);
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
// createDict = iframe.contentWindow.Object;
// html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
iframeDocument.close();
createDict = iframeDocument.F;
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
return createDict();
};
module.exports = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
Empty[PROTOTYPE] = anObject(O);
result = new Empty();
Empty[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO] = O;
} else result = createDict();
return Properties === undefined ? result : dPs(result, Properties);
};
/***/ }),
/***/ 42:
/***/ (function(module, exports, __webpack_require__) {
var core = __webpack_require__(1);
var global = __webpack_require__(9);
var SHARED = '__core-js_shared__';
var store = global[SHARED] || (global[SHARED] = {});
(module.exports = function (key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: core.version,
mode: __webpack_require__(26) ? 'pure' : 'global',
copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
});
/***/ }),
/***/ 43:
/***/ (function(module, exports) {
// IE 8- don't enum bug keys
module.exports = (
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');
/***/ }),
/***/ 44:
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(14);
var document = __webpack_require__(9).document;
// typeof document.createElement is 'object' in old IE
var is = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
return is ? document.createElement(it) : {};
};
/***/ }),
/***/ 45:
/***/ (function(module, exports, __webpack_require__) {
// getting tag from 19.1.3.6 Object.prototype.toString()
var cof = __webpack_require__(25);
var TAG = __webpack_require__(8)('toStringTag');
// ES3 wrong here
var ARG = cof(function () { return arguments; }()) == 'Arguments';
// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
try {
return it[key];
} catch (e) { /* empty */ }
};
module.exports = function (it) {
var O, T, B;
return it === undefined ? 'Undefined' : it === null ? 'Null'
// @@toStringTag case
: typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
// builtinTag case
: ARG ? cof(O)
// ES3 arguments fallback
: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
};
/***/ }),
/***/ 47:
/***/ (function(module, exports, __webpack_require__) {
// fallback for non-array-like ES3 and non-enumerable old V8 strings
var cof = __webpack_require__(25);
// eslint-disable-next-line no-prototype-builtins
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
return cof(it) == 'String' ? it.split('') : Object(it);
};
/***/ }),
/***/ 48:
/***/ (function(module, exports, __webpack_require__) {
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = __webpack_require__(14);
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function (it, S) {
if (!isObject(it)) return it;
var fn, val;
if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
throw TypeError("Can't convert object to primitive value");
};
/***/ }),
/***/ 49:
/***/ (function(module, exports, __webpack_require__) {
;
var LIBRARY = __webpack_require__(26);
var $export = __webpack_require__(10);
var redefine = __webpack_require__(56);
var hide = __webpack_require__(16);
var Iterators = __webpack_require__(21);
var $iterCreate = __webpack_require__(80);
var setToStringTag = __webpack_require__(27);
var getPrototypeOf = __webpack_require__(64);
var ITERATOR = __webpack_require__(8)('iterator');
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
var FF_ITERATOR = '@@iterator';
var KEYS = 'keys';
var VALUES = 'values';
var returnThis = function () { return this; };
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
$iterCreate(Constructor, NAME, next);
var getMethod = function (kind) {
if (!BUGGY && kind in proto) return proto[kind];
switch (kind) {
case KEYS: return function keys() { return new Constructor(this, kind); };
case VALUES: return function values() { return new Constructor(this, kind); };
} return function entries() { return new Constructor(this, kind); };
};
var TAG = NAME + ' Iterator';
var DEF_VALUES = DEFAULT == VALUES;
var VALUES_BUG = false;
var proto = Base.prototype;
var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
var $default = $native || getMethod(DEFAULT);
var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
var methods, key, IteratorPrototype;
// Fix native
if ($anyNative) {
IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
// Set @@toStringTag to native iterators
setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
}
}
// fix Array#{values, @@iterator}.name in V8 / FF
if (DEF_VALUES && $native && $native.name !== VALUES) {
VALUES_BUG = true;
$default = function values() { return $native.call(this); };
}
// Define iterator
if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
hide(proto, ITERATOR, $default);
}
// Plug for library
Iterators[NAME] = $default;
Iterators[TAG] = returnThis;
if (DEFAULT) {
methods = {
values: DEF_VALUES ? $default : getMethod(VALUES),
keys: IS_SET ? $default : getMethod(KEYS),
entries: $entries
};
if (FORCED) for (key in methods) {
if (!(key in proto)) redefine(proto, key, methods[key]);
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
}
return methods;
};
/***/ }),
/***/ 52:
/***/ (function(module, exports, __webpack_require__) {
;
exports.__esModule = true;
var _from = __webpack_require__(73);
var _from2 = _interopRequireDefault(_from);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
arr2[i] = arr[i];
}
return arr2;
} else {
return (0, _from2.default)(arr);
}
};
/***/ }),
/***/ 54:
/***/ (function(module, exports, __webpack_require__) {
var classof = __webpack_require__(45);
var ITERATOR = __webpack_require__(8)('iterator');
var Iterators = __webpack_require__(21);
module.exports = __webpack_require__(1).getIteratorMethod = function (it) {
if (it != undefined) return it[ITERATOR]
|| it['@@iterator']
|| Iterators[classof(it)];
};
/***/ }),
/***/ 56:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(16);
/***/ }),
/***/ 59:
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(93), __esModule: true };
/***/ }),
/***/ 61:
/***/ (function(module, exports, __webpack_require__) {
var has = __webpack_require__(17);
var toIObject = __webpack_require__(22);
var arrayIndexOf = __webpack_require__(77)(false);
var IE_PROTO = __webpack_require__(36)('IE_PROTO');
module.exports = function (object, names) {
var O = toIObject(object);
var i = 0;
var result = [];
var key;
for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while (names.length > i) if (has(O, key = names[i++])) {
~arrayIndexOf(result, key) || result.push(key);
}
return result;
};
/***/ }),
/***/ 62:
/***/ (function(module, exports, __webpack_require__) {
module.exports = !__webpack_require__(13) && !__webpack_require__(20)(function () {
return Object.defineProperty(__webpack_require__(44)('div'), 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/***/ 63:
/***/ (function(module, exports, __webpack_require__) {
var document = __webpack_require__(9).document;
module.exports = document && document.documentElement;
/***/ }),
/***/ 64:
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var has = __webpack_require__(17);
var toObject = __webpack_require__(19);
var IE_PROTO = __webpack_require__(36)('IE_PROTO');
var ObjectProto = Object.prototype;
module.exports = Object.getPrototypeOf || function (O) {
O = toObject(O);
if (has(O, IE_PROTO)) return O[IE_PROTO];
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
return O.constructor.prototype;
} return O instanceof Object ? ObjectProto : null;
};
/***/ }),
/***/ 67:
/***/ (function(module, exports, __webpack_require__) {
// call something on iterator step with safe closing on error
var anObject = __webpack_require__(15);
module.exports = function (iterator, fn, value, entries) {
try {
return entries ? fn(anObject(value)[0], value[1]) : fn(value);
// 7.4.6 IteratorClose(iterator, completion)
} catch (e) {
var ret = iterator['return'];
if (ret !== undefined) anObject(ret.call(iterator));
throw e;
}
};
/***/ }),
/***/ 68:
/***/ (function(module, exports, __webpack_require__) {
// check on default Array iterator
var Iterators = __webpack_require__(21);
var ITERATOR = __webpack_require__(8)('iterator');
var ArrayProto = Array.prototype;
module.exports = function (it) {
return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
};
/***/ }),
/***/ 69:
/***/ (function(module, exports, __webpack_require__) {
var ITERATOR = __webpack_require__(8)('iterator');
var SAFE_CLOSING = false;
try {
var riter = [7][ITERATOR]();
riter['return'] = function () { SAFE_CLOSING = true; };
// eslint-disable-next-line no-throw-literal
Array.from(riter, function () { throw 2; });
} catch (e) { /* empty */ }
module.exports = function (exec, skipClosing) {
if (!skipClosing && !SAFE_CLOSING) return false;
var safe = false;
try {
var arr = [7];
var iter = arr[ITERATOR]();
iter.next = function () { return { done: safe = true }; };
arr[ITERATOR] = function () { return iter; };
exec(arr);
} catch (e) { /* empty */ }
return safe;
};
/***/ }),
/***/ 73:
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(89), __esModule: true };
/***/ }),
/***/ 77:
/***/ (function(module, exports, __webpack_require__) {
// false -> Array#indexOf
// true -> Array#includes
var toIObject = __webpack_require__(22);
var toLength = __webpack_require__(31);
var toAbsoluteIndex = __webpack_require__(78);
module.exports = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = toIObject($this);
var length = toLength(O.length);
var index = toAbsoluteIndex(fromIndex, length);
var value;
// Array#includes uses SameValueZero equality algorithm
// eslint-disable-next-line no-self-compare
if (IS_INCLUDES && el != el) while (length > index) {
value = O[index++];
// eslint-disable-next-line no-self-compare
if (value != value) return true;
// Array#indexOf ignores holes, Array#includes - not
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
if (O[index] === el) return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
/***/ }),
/***/ 78:
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(35);
var max = Math.max;
var min = Math.min;
module.exports = function (index, length) {
index = toInteger(index);
return index < 0 ? max(index + length, 0) : min(index, length);
};
/***/ }),
/***/ 79:
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(35);
var defined = __webpack_require__(34);
// true -> String#at
// false -> String#codePointAt
module.exports = function (TO_STRING) {
return function (that, pos) {
var s = String(defined(that));
var i = toInteger(pos);
var l = s.length;
var a, b;
if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
a = s.charCodeAt(i);
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
? TO_STRING ? s.charAt(i) : a
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
};
};
/***/ }),
/***/ 8:
/***/ (function(module, exports, __webpack_require__) {
var store = __webpack_require__(42)('wks');
var uid = __webpack_require__(32);
var Symbol = __webpack_require__(9).Symbol;
var USE_SYMBOL = typeof Symbol == 'function';
var $exports = module.exports = function (name) {
return store[name] || (store[name] =
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};
$exports.store = store;
/***/ }),
/***/ 80:
/***/ (function(module, exports, __webpack_require__) {
;
var create = __webpack_require__(39);
var descriptor = __webpack_require__(23);
var setToStringTag = __webpack_require__(27);
var IteratorPrototype = {};
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
__webpack_require__(16)(IteratorPrototype, __webpack_require__(8)('iterator'), function () { return this; });
module.exports = function (Constructor, NAME, next) {
Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
setToStringTag(Constructor, NAME + ' Iterator');
};
/***/ }),
/***/ 81:
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(12);
var anObject = __webpack_require__(15);
var getKeys = __webpack_require__(28);
module.exports = __webpack_require__(13) ? Object.defineProperties : function defineProperties(O, Properties) {
anObject(O);
var keys = getKeys(Properties);
var length = keys.length;
var i = 0;
var P;
while (length > i) dP.f(O, P = keys[i++], Properties[P]);
return O;
};
/***/ }),
/***/ 89:
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(24);
__webpack_require__(90);
module.exports = __webpack_require__(1).Array.from;
/***/ }),
/***/ 9:
/***/ (function(module, exports) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
: Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
/***/ }),
/***/ 90:
/***/ (function(module, exports, __webpack_require__) {
;
var ctx = __webpack_require__(18);
var $export = __webpack_require__(10);
var toObject = __webpack_require__(19);
var call = __webpack_require__(67);
var isArrayIter = __webpack_require__(68);
var toLength = __webpack_require__(31);
var createProperty = __webpack_require__(91);
var getIterFn = __webpack_require__(54);
$export($export.S + $export.F * !__webpack_require__(69)(function (iter) { Array.from(iter); }), 'Array', {
// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
var O = toObject(arrayLike);
var C = typeof this == 'function' ? this : Array;
var aLen = arguments.length;
var mapfn = aLen > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
var index = 0;
var iterFn = getIterFn(O);
var length, result, step, iterator;
if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
// if object isn't iterable or it's array with default iterator - use simple case
if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
}
} else {
length = toLength(O.length);
for (result = new C(length); length > index; index++) {
createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
}
}
result.length = index;
return result;
}
});
/***/ }),
/***/ 91:
/***/ (function(module, exports, __webpack_require__) {
;
var $defineProperty = __webpack_require__(12);
var createDesc = __webpack_require__(23);
module.exports = function (object, index, value) {
if (index in object) $defineProperty.f(object, index, createDesc(0, value));
else object[index] = value;
};
/***/ }),
/***/ 92:
/***/ (function(module, exports, __webpack_require__) {
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _toConsumableArray2 = __webpack_require__(52);
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
var _stringify = __webpack_require__(59);
var _stringify2 = _interopRequireDefault(_stringify);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var clean = function clean(data) {
if (!data) return [];
if (!data.eventName) {
if (data.data) return clean(data.data);
if (data.payload) return clean(data.payload);
if (data.events) return clean(data.events);
}
if (data instanceof Array) return data.map(clean);
return [data.eventName || data];
};
var stringify = function stringify(data) {
try {
return (0, _stringify2.default)(data);
} catch (e) {
return data;
}
};
exports.default = function (title, data) {
if (false) {
var _console;
var filename = (new Error().stack || '').match(/[^/]*\.js[:\d]*/)[0] || '';
// eslint-disable-next-line no-console
(_console = console).log.apply(_console, [title].concat((0, _toConsumableArray3.default)(clean(data).map(stringify)), [filename]));
}
};
/***/ }),
/***/ 93:
/***/ (function(module, exports, __webpack_require__) {
var core = __webpack_require__(1);
var $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });
module.exports = function stringify(it) { // eslint-disable-line no-unused-vars
return $JSON.stringify.apply($JSON, arguments);
};
/***/ })
/******/ });