123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492 |
- (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
- 'use strict';
- var keys = require('object-keys').shim();
- delete keys.shim;
- var assign = require('./');
- module.exports = assign.shim();
- delete assign.shim;
- },{"./":3,"object-keys":9}],2:[function(require,module,exports){
- 'use strict';
- // modified from https://github.com/es-shims/es6-shim
- var keys = require('object-keys');
- var bind = require('function-bind');
- var canBeObject = function (obj) {
- return typeof obj !== 'undefined' && obj !== null;
- };
- var hasSymbols = require('has-symbols/shams')();
- var toObject = Object;
- var push = bind.call(Function.call, Array.prototype.push);
- var propIsEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable);
- var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null;
- module.exports = function assign(target, source1) {
- if (!canBeObject(target)) { throw new TypeError('target must be an object'); }
- var objTarget = toObject(target);
- var s, source, i, props, syms, value, key;
- for (s = 1; s < arguments.length; ++s) {
- source = toObject(arguments[s]);
- props = keys(source);
- var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);
- if (getSymbols) {
- syms = getSymbols(source);
- for (i = 0; i < syms.length; ++i) {
- key = syms[i];
- if (propIsEnumerable(source, key)) {
- push(props, key);
- }
- }
- }
- for (i = 0; i < props.length; ++i) {
- key = props[i];
- value = source[key];
- if (propIsEnumerable(source, key)) {
- objTarget[key] = value;
- }
- }
- }
- return objTarget;
- };
- },{"function-bind":7,"has-symbols/shams":8,"object-keys":9}],3:[function(require,module,exports){
- 'use strict';
- var defineProperties = require('define-properties');
- var implementation = require('./implementation');
- var getPolyfill = require('./polyfill');
- var shim = require('./shim');
- var polyfill = getPolyfill();
- defineProperties(polyfill, {
- getPolyfill: getPolyfill,
- implementation: implementation,
- shim: shim
- });
- module.exports = polyfill;
- },{"./implementation":2,"./polyfill":11,"./shim":12,"define-properties":4}],4:[function(require,module,exports){
- 'use strict';
- var keys = require('object-keys');
- var foreach = require('foreach');
- var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol';
- var toStr = Object.prototype.toString;
- var isFunction = function (fn) {
- return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
- };
- var arePropertyDescriptorsSupported = function () {
- var obj = {};
- try {
- Object.defineProperty(obj, 'x', { enumerable: false, value: obj });
- /* eslint-disable no-unused-vars, no-restricted-syntax */
- for (var _ in obj) { return false; }
- /* eslint-enable no-unused-vars, no-restricted-syntax */
- return obj.x === obj;
- } catch (e) { /* this is IE 8. */
- return false;
- }
- };
- var supportsDescriptors = Object.defineProperty && arePropertyDescriptorsSupported();
- var defineProperty = function (object, name, value, predicate) {
- if (name in object && (!isFunction(predicate) || !predicate())) {
- return;
- }
- if (supportsDescriptors) {
- Object.defineProperty(object, name, {
- configurable: true,
- enumerable: false,
- value: value,
- writable: true
- });
- } else {
- object[name] = value;
- }
- };
- var defineProperties = function (object, map) {
- var predicates = arguments.length > 2 ? arguments[2] : {};
- var props = keys(map);
- if (hasSymbols) {
- props = props.concat(Object.getOwnPropertySymbols(map));
- }
- foreach(props, function (name) {
- defineProperty(object, name, map[name], predicates[name]);
- });
- };
- defineProperties.supportsDescriptors = !!supportsDescriptors;
- module.exports = defineProperties;
- },{"foreach":5,"object-keys":9}],5:[function(require,module,exports){
- var hasOwn = Object.prototype.hasOwnProperty;
- var toString = Object.prototype.toString;
- module.exports = function forEach (obj, fn, ctx) {
- if (toString.call(fn) !== '[object Function]') {
- throw new TypeError('iterator must be a function');
- }
- var l = obj.length;
- if (l === +l) {
- for (var i = 0; i < l; i++) {
- fn.call(ctx, obj[i], i, obj);
- }
- } else {
- for (var k in obj) {
- if (hasOwn.call(obj, k)) {
- fn.call(ctx, obj[k], k, obj);
- }
- }
- }
- };
- },{}],6:[function(require,module,exports){
- 'use strict';
- /* eslint no-invalid-this: 1 */
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
- var slice = Array.prototype.slice;
- var toStr = Object.prototype.toString;
- var funcType = '[object Function]';
- module.exports = function bind(that) {
- var target = this;
- if (typeof target !== 'function' || toStr.call(target) !== funcType) {
- throw new TypeError(ERROR_MESSAGE + target);
- }
- var args = slice.call(arguments, 1);
- var bound;
- var binder = function () {
- if (this instanceof bound) {
- var result = target.apply(
- this,
- args.concat(slice.call(arguments))
- );
- if (Object(result) === result) {
- return result;
- }
- return this;
- } else {
- return target.apply(
- that,
- args.concat(slice.call(arguments))
- );
- }
- };
- var boundLength = Math.max(0, target.length - args.length);
- var boundArgs = [];
- for (var i = 0; i < boundLength; i++) {
- boundArgs.push('$' + i);
- }
- bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
- if (target.prototype) {
- var Empty = function Empty() {};
- Empty.prototype = target.prototype;
- bound.prototype = new Empty();
- Empty.prototype = null;
- }
- return bound;
- };
- },{}],7:[function(require,module,exports){
- 'use strict';
- var implementation = require('./implementation');
- module.exports = Function.prototype.bind || implementation;
- },{"./implementation":6}],8:[function(require,module,exports){
- 'use strict';
- /* eslint complexity: [2, 17], max-statements: [2, 33] */
- module.exports = function hasSymbols() {
- if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
- if (typeof Symbol.iterator === 'symbol') { return true; }
- var obj = {};
- var sym = Symbol('test');
- var symObj = Object(sym);
- if (typeof sym === 'string') { return false; }
- if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
- if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
- // temp disabled per https://github.com/ljharb/object.assign/issues/17
- // if (sym instanceof Symbol) { return false; }
- // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
- // if (!(symObj instanceof Symbol)) { return false; }
- // if (typeof Symbol.prototype.toString !== 'function') { return false; }
- // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
- var symVal = 42;
- obj[sym] = symVal;
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
- if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
- if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
- var syms = Object.getOwnPropertySymbols(obj);
- if (syms.length !== 1 || syms[0] !== sym) { return false; }
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
- if (typeof Object.getOwnPropertyDescriptor === 'function') {
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
- if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
- }
- return true;
- };
- },{}],9:[function(require,module,exports){
- 'use strict';
- // modified from https://github.com/es-shims/es5-shim
- var has = Object.prototype.hasOwnProperty;
- var toStr = Object.prototype.toString;
- var slice = Array.prototype.slice;
- var isArgs = require('./isArguments');
- var isEnumerable = Object.prototype.propertyIsEnumerable;
- var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
- var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
- var dontEnums = [
- 'toString',
- 'toLocaleString',
- 'valueOf',
- 'hasOwnProperty',
- 'isPrototypeOf',
- 'propertyIsEnumerable',
- 'constructor'
- ];
- var equalsConstructorPrototype = function (o) {
- var ctor = o.constructor;
- return ctor && ctor.prototype === o;
- };
- var excludedKeys = {
- $console: true,
- $external: true,
- $frame: true,
- $frameElement: true,
- $frames: true,
- $innerHeight: true,
- $innerWidth: true,
- $outerHeight: true,
- $outerWidth: true,
- $pageXOffset: true,
- $pageYOffset: true,
- $parent: true,
- $scrollLeft: true,
- $scrollTop: true,
- $scrollX: true,
- $scrollY: true,
- $self: true,
- $webkitIndexedDB: true,
- $webkitStorageInfo: true,
- $window: true
- };
- var hasAutomationEqualityBug = (function () {
- /* global window */
- if (typeof window === 'undefined') { return false; }
- for (var k in window) {
- try {
- if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
- try {
- equalsConstructorPrototype(window[k]);
- } catch (e) {
- return true;
- }
- }
- } catch (e) {
- return true;
- }
- }
- return false;
- }());
- var equalsConstructorPrototypeIfNotBuggy = function (o) {
- /* global window */
- if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
- return equalsConstructorPrototype(o);
- }
- try {
- return equalsConstructorPrototype(o);
- } catch (e) {
- return false;
- }
- };
- var keysShim = function keys(object) {
- var isObject = object !== null && typeof object === 'object';
- var isFunction = toStr.call(object) === '[object Function]';
- var isArguments = isArgs(object);
- var isString = isObject && toStr.call(object) === '[object String]';
- var theKeys = [];
- if (!isObject && !isFunction && !isArguments) {
- throw new TypeError('Object.keys called on a non-object');
- }
- var skipProto = hasProtoEnumBug && isFunction;
- if (isString && object.length > 0 && !has.call(object, 0)) {
- for (var i = 0; i < object.length; ++i) {
- theKeys.push(String(i));
- }
- }
- if (isArguments && object.length > 0) {
- for (var j = 0; j < object.length; ++j) {
- theKeys.push(String(j));
- }
- } else {
- for (var name in object) {
- if (!(skipProto && name === 'prototype') && has.call(object, name)) {
- theKeys.push(String(name));
- }
- }
- }
- if (hasDontEnumBug) {
- var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
- for (var k = 0; k < dontEnums.length; ++k) {
- if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
- theKeys.push(dontEnums[k]);
- }
- }
- }
- return theKeys;
- };
- keysShim.shim = function shimObjectKeys() {
- if (Object.keys) {
- var keysWorksWithArguments = (function () {
- // Safari 5.0 bug
- return (Object.keys(arguments) || '').length === 2;
- }(1, 2));
- if (!keysWorksWithArguments) {
- var originalKeys = Object.keys;
- Object.keys = function keys(object) {
- if (isArgs(object)) {
- return originalKeys(slice.call(object));
- } else {
- return originalKeys(object);
- }
- };
- }
- } else {
- Object.keys = keysShim;
- }
- return Object.keys || keysShim;
- };
- module.exports = keysShim;
- },{"./isArguments":10}],10:[function(require,module,exports){
- 'use strict';
- var toStr = Object.prototype.toString;
- module.exports = function isArguments(value) {
- var str = toStr.call(value);
- var isArgs = str === '[object Arguments]';
- if (!isArgs) {
- isArgs = str !== '[object Array]' &&
- value !== null &&
- typeof value === 'object' &&
- typeof value.length === 'number' &&
- value.length >= 0 &&
- toStr.call(value.callee) === '[object Function]';
- }
- return isArgs;
- };
- },{}],11:[function(require,module,exports){
- 'use strict';
- var implementation = require('./implementation');
- var lacksProperEnumerationOrder = function () {
- if (!Object.assign) {
- return false;
- }
- // v8, specifically in node 4.x, has a bug with incorrect property enumeration order
- // note: this does not detect the bug unless there's 20 characters
- var str = 'abcdefghijklmnopqrst';
- var letters = str.split('');
- var map = {};
- for (var i = 0; i < letters.length; ++i) {
- map[letters[i]] = letters[i];
- }
- var obj = Object.assign({}, map);
- var actual = '';
- for (var k in obj) {
- actual += k;
- }
- return str !== actual;
- };
- var assignHasPendingExceptions = function () {
- if (!Object.assign || !Object.preventExtensions) {
- return false;
- }
- // Firefox 37 still has "pending exception" logic in its Object.assign implementation,
- // which is 72% slower than our shim, and Firefox 40's native implementation.
- var thrower = Object.preventExtensions({ 1: 2 });
- try {
- Object.assign(thrower, 'xy');
- } catch (e) {
- return thrower[1] === 'y';
- }
- return false;
- };
- module.exports = function getPolyfill() {
- if (!Object.assign) {
- return implementation;
- }
- if (lacksProperEnumerationOrder()) {
- return implementation;
- }
- if (assignHasPendingExceptions()) {
- return implementation;
- }
- return Object.assign;
- };
- },{"./implementation":2}],12:[function(require,module,exports){
- 'use strict';
- var define = require('define-properties');
- var getPolyfill = require('./polyfill');
- module.exports = function shimAssign() {
- var polyfill = getPolyfill();
- define(
- Object,
- { assign: polyfill },
- { assign: function () { return Object.assign !== polyfill; } }
- );
- return polyfill;
- };
- },{"./polyfill":11,"define-properties":4}]},{},[1]);
|