mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
2529 lines
86 KiB
JavaScript
2529 lines
86 KiB
JavaScript
|
(function (global, factory) {
|
||
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('popper.js')) :
|
||
|
typeof define === 'function' && define.amd ? define(['exports', 'react', 'popper.js'], factory) :
|
||
|
(factory((global.ReactPopper = {}),global.React,global.Popper));
|
||
|
}(this, (function (exports,React,PopperJS) { 'use strict';
|
||
|
|
||
|
var React__default = 'default' in React ? React['default'] : React;
|
||
|
PopperJS = PopperJS && PopperJS.hasOwnProperty('default') ? PopperJS['default'] : PopperJS;
|
||
|
|
||
|
function _defineProperty(obj, key, value) {
|
||
|
if (key in obj) {
|
||
|
Object.defineProperty(obj, key, {
|
||
|
value: value,
|
||
|
enumerable: true,
|
||
|
configurable: true,
|
||
|
writable: true
|
||
|
});
|
||
|
} else {
|
||
|
obj[key] = value;
|
||
|
}
|
||
|
|
||
|
return obj;
|
||
|
}
|
||
|
|
||
|
function _extends() {
|
||
|
_extends = Object.assign || function (target) {
|
||
|
for (var i = 1; i < arguments.length; i++) {
|
||
|
var source = arguments[i];
|
||
|
|
||
|
for (var key in source) {
|
||
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||
|
target[key] = source[key];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return target;
|
||
|
};
|
||
|
|
||
|
return _extends.apply(this, arguments);
|
||
|
}
|
||
|
|
||
|
function _inheritsLoose(subClass, superClass) {
|
||
|
subClass.prototype = Object.create(superClass.prototype);
|
||
|
subClass.prototype.constructor = subClass;
|
||
|
subClass.__proto__ = superClass;
|
||
|
}
|
||
|
|
||
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
||
|
if (source == null) return {};
|
||
|
var target = {};
|
||
|
var sourceKeys = Object.keys(source);
|
||
|
var key, i;
|
||
|
|
||
|
for (i = 0; i < sourceKeys.length; i++) {
|
||
|
key = sourceKeys[i];
|
||
|
if (excluded.indexOf(key) >= 0) continue;
|
||
|
target[key] = source[key];
|
||
|
}
|
||
|
|
||
|
return target;
|
||
|
}
|
||
|
|
||
|
function _assertThisInitialized(self) {
|
||
|
if (self === void 0) {
|
||
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||
|
}
|
||
|
|
||
|
return self;
|
||
|
}
|
||
|
|
||
|
var toStr = Object.prototype.toString;
|
||
|
|
||
|
var isArguments = 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;
|
||
|
};
|
||
|
|
||
|
var keysShim;
|
||
|
if (!Object.keys) {
|
||
|
// modified from https://github.com/es-shims/es5-shim
|
||
|
var has = Object.prototype.hasOwnProperty;
|
||
|
var toStr$1 = Object.prototype.toString;
|
||
|
var isArgs = isArguments; // eslint-disable-line global-require
|
||
|
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 = {
|
||
|
$applicationCache: true,
|
||
|
$console: true,
|
||
|
$external: true,
|
||
|
$frame: true,
|
||
|
$frameElement: true,
|
||
|
$frames: true,
|
||
|
$innerHeight: true,
|
||
|
$innerWidth: true,
|
||
|
$onmozfullscreenchange: true,
|
||
|
$onmozfullscreenerror: 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;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
keysShim = function keys(object) {
|
||
|
var isObject = object !== null && typeof object === 'object';
|
||
|
var isFunction = toStr$1.call(object) === '[object Function]';
|
||
|
var isArguments$$1 = isArgs(object);
|
||
|
var isString = isObject && toStr$1.call(object) === '[object String]';
|
||
|
var theKeys = [];
|
||
|
|
||
|
if (!isObject && !isFunction && !isArguments$$1) {
|
||
|
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$$1 && 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;
|
||
|
};
|
||
|
}
|
||
|
var implementation = keysShim;
|
||
|
|
||
|
var slice = Array.prototype.slice;
|
||
|
|
||
|
|
||
|
var origKeys = Object.keys;
|
||
|
var keysShim$1 = origKeys ? function keys(o) { return origKeys(o); } : implementation;
|
||
|
|
||
|
var originalKeys = Object.keys;
|
||
|
|
||
|
keysShim$1.shim = function shimObjectKeys() {
|
||
|
if (Object.keys) {
|
||
|
var keysWorksWithArguments = (function () {
|
||
|
// Safari 5.0 bug
|
||
|
var args = Object.keys(arguments);
|
||
|
return args && args.length === arguments.length;
|
||
|
}(1, 2));
|
||
|
if (!keysWorksWithArguments) {
|
||
|
Object.keys = function keys(object) { // eslint-disable-line func-name-matching
|
||
|
if (isArguments(object)) {
|
||
|
return originalKeys(slice.call(object));
|
||
|
}
|
||
|
return originalKeys(object);
|
||
|
};
|
||
|
}
|
||
|
} else {
|
||
|
Object.keys = keysShim$1;
|
||
|
}
|
||
|
return Object.keys || keysShim$1;
|
||
|
};
|
||
|
|
||
|
var objectKeys = keysShim$1;
|
||
|
|
||
|
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
|
||
|
var toStr$2 = Object.prototype.toString;
|
||
|
|
||
|
var isStandardArguments = function isArguments(value) {
|
||
|
if (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) {
|
||
|
return false;
|
||
|
}
|
||
|
return toStr$2.call(value) === '[object Arguments]';
|
||
|
};
|
||
|
|
||
|
var isLegacyArguments = function isArguments(value) {
|
||
|
if (isStandardArguments(value)) {
|
||
|
return true;
|
||
|
}
|
||
|
return value !== null &&
|
||
|
typeof value === 'object' &&
|
||
|
typeof value.length === 'number' &&
|
||
|
value.length >= 0 &&
|
||
|
toStr$2.call(value) !== '[object Array]' &&
|
||
|
toStr$2.call(value.callee) === '[object Function]';
|
||
|
};
|
||
|
|
||
|
var supportsStandardArguments = (function () {
|
||
|
return isStandardArguments(arguments);
|
||
|
}());
|
||
|
|
||
|
isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests
|
||
|
|
||
|
var isArguments$1 = supportsStandardArguments ? isStandardArguments : isLegacyArguments;
|
||
|
|
||
|
/* https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.is */
|
||
|
|
||
|
var NumberIsNaN = function (value) {
|
||
|
return value !== value;
|
||
|
};
|
||
|
|
||
|
var objectIs = function is(a, b) {
|
||
|
if (a === 0 && b === 0) {
|
||
|
return 1 / a === 1 / b;
|
||
|
} else if (a === b) {
|
||
|
return true;
|
||
|
} else if (NumberIsNaN(a) && NumberIsNaN(b)) {
|
||
|
return true;
|
||
|
}
|
||
|
return false;
|
||
|
};
|
||
|
|
||
|
/* eslint no-invalid-this: 1 */
|
||
|
|
||
|
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
||
|
var slice$1 = Array.prototype.slice;
|
||
|
var toStr$3 = Object.prototype.toString;
|
||
|
var funcType = '[object Function]';
|
||
|
|
||
|
var implementation$1 = function bind(that) {
|
||
|
var target = this;
|
||
|
if (typeof target !== 'function' || toStr$3.call(target) !== funcType) {
|
||
|
throw new TypeError(ERROR_MESSAGE + target);
|
||
|
}
|
||
|
var args = slice$1.call(arguments, 1);
|
||
|
|
||
|
var bound;
|
||
|
var binder = function () {
|
||
|
if (this instanceof bound) {
|
||
|
var result = target.apply(
|
||
|
this,
|
||
|
args.concat(slice$1.call(arguments))
|
||
|
);
|
||
|
if (Object(result) === result) {
|
||
|
return result;
|
||
|
}
|
||
|
return this;
|
||
|
} else {
|
||
|
return target.apply(
|
||
|
that,
|
||
|
args.concat(slice$1.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;
|
||
|
};
|
||
|
|
||
|
var functionBind = Function.prototype.bind || implementation$1;
|
||
|
|
||
|
var src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
|
||
|
|
||
|
var regexExec = RegExp.prototype.exec;
|
||
|
var gOPD = Object.getOwnPropertyDescriptor;
|
||
|
|
||
|
var tryRegexExecCall = function tryRegexExec(value) {
|
||
|
try {
|
||
|
var lastIndex = value.lastIndex;
|
||
|
value.lastIndex = 0;
|
||
|
|
||
|
regexExec.call(value);
|
||
|
return true;
|
||
|
} catch (e) {
|
||
|
return false;
|
||
|
} finally {
|
||
|
value.lastIndex = lastIndex;
|
||
|
}
|
||
|
};
|
||
|
var toStr$4 = Object.prototype.toString;
|
||
|
var regexClass = '[object RegExp]';
|
||
|
var hasToStringTag$1 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
|
||
|
|
||
|
var isRegex = function isRegex(value) {
|
||
|
if (!value || typeof value !== 'object') {
|
||
|
return false;
|
||
|
}
|
||
|
if (!hasToStringTag$1) {
|
||
|
return toStr$4.call(value) === regexClass;
|
||
|
}
|
||
|
|
||
|
var descriptor = gOPD(value, 'lastIndex');
|
||
|
var hasLastIndexDataProperty = descriptor && src(descriptor, 'value');
|
||
|
if (!hasLastIndexDataProperty) {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
return tryRegexExecCall(value);
|
||
|
};
|
||
|
|
||
|
var toStr$5 = Object.prototype.toString;
|
||
|
|
||
|
var isArguments$2 = function isArguments(value) {
|
||
|
var str = toStr$5.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$5.call(value.callee) === '[object Function]';
|
||
|
}
|
||
|
return isArgs;
|
||
|
};
|
||
|
|
||
|
// modified from https://github.com/es-shims/es5-shim
|
||
|
var has$1 = Object.prototype.hasOwnProperty;
|
||
|
var toStr$6 = Object.prototype.toString;
|
||
|
var slice$2 = Array.prototype.slice;
|
||
|
|
||
|
var isEnumerable$1 = Object.prototype.propertyIsEnumerable;
|
||
|
var hasDontEnumBug$1 = !isEnumerable$1.call({ toString: null }, 'toString');
|
||
|
var hasProtoEnumBug$1 = isEnumerable$1.call(function () {}, 'prototype');
|
||
|
var dontEnums$1 = [
|
||
|
'toString',
|
||
|
'toLocaleString',
|
||
|
'valueOf',
|
||
|
'hasOwnProperty',
|
||
|
'isPrototypeOf',
|
||
|
'propertyIsEnumerable',
|
||
|
'constructor'
|
||
|
];
|
||
|
var equalsConstructorPrototype$1 = function (o) {
|
||
|
var ctor = o.constructor;
|
||
|
return ctor && ctor.prototype === o;
|
||
|
};
|
||
|
var excludedKeys$1 = {
|
||
|
$applicationCache: true,
|
||
|
$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$1 = (function () {
|
||
|
/* global window */
|
||
|
if (typeof window === 'undefined') { return false; }
|
||
|
for (var k in window) {
|
||
|
try {
|
||
|
if (!excludedKeys$1['$' + k] && has$1.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
|
||
|
try {
|
||
|
equalsConstructorPrototype$1(window[k]);
|
||
|
} catch (e) {
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
} catch (e) {
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
return false;
|
||
|
}());
|
||
|
var equalsConstructorPrototypeIfNotBuggy$1 = function (o) {
|
||
|
/* global window */
|
||
|
if (typeof window === 'undefined' || !hasAutomationEqualityBug$1) {
|
||
|
return equalsConstructorPrototype$1(o);
|
||
|
}
|
||
|
try {
|
||
|
return equalsConstructorPrototype$1(o);
|
||
|
} catch (e) {
|
||
|
return false;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
var keysShim$2 = function keys(object) {
|
||
|
var isObject = object !== null && typeof object === 'object';
|
||
|
var isFunction = toStr$6.call(object) === '[object Function]';
|
||
|
var isArguments = isArguments$2(object);
|
||
|
var isString = isObject && toStr$6.call(object) === '[object String]';
|
||
|
var theKeys = [];
|
||
|
|
||
|
if (!isObject && !isFunction && !isArguments) {
|
||
|
throw new TypeError('Object.keys called on a non-object');
|
||
|
}
|
||
|
|
||
|
var skipProto = hasProtoEnumBug$1 && isFunction;
|
||
|
if (isString && object.length > 0 && !has$1.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$1.call(object, name)) {
|
||
|
theKeys.push(String(name));
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (hasDontEnumBug$1) {
|
||
|
var skipConstructor = equalsConstructorPrototypeIfNotBuggy$1(object);
|
||
|
|
||
|
for (var k = 0; k < dontEnums$1.length; ++k) {
|
||
|
if (!(skipConstructor && dontEnums$1[k] === 'constructor') && has$1.call(object, dontEnums$1[k])) {
|
||
|
theKeys.push(dontEnums$1[k]);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return theKeys;
|
||
|
};
|
||
|
|
||
|
keysShim$2.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) { // eslint-disable-line func-name-matching
|
||
|
if (isArguments$2(object)) {
|
||
|
return originalKeys(slice$2.call(object));
|
||
|
} else {
|
||
|
return originalKeys(object);
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
} else {
|
||
|
Object.keys = keysShim$2;
|
||
|
}
|
||
|
return Object.keys || keysShim$2;
|
||
|
};
|
||
|
|
||
|
var objectKeys$1 = keysShim$2;
|
||
|
|
||
|
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
|
||
|
|
||
|
var toStr$7 = Object.prototype.toString;
|
||
|
var concat = Array.prototype.concat;
|
||
|
var origDefineProperty = Object.defineProperty;
|
||
|
|
||
|
var isFunction = function (fn) {
|
||
|
return typeof fn === 'function' && toStr$7.call(fn) === '[object Function]';
|
||
|
};
|
||
|
|
||
|
var arePropertyDescriptorsSupported = function () {
|
||
|
var obj = {};
|
||
|
try {
|
||
|
origDefineProperty(obj, 'x', { enumerable: false, value: obj });
|
||
|
// eslint-disable-next-line no-unused-vars, no-restricted-syntax
|
||
|
for (var _ in obj) { // jscs:ignore disallowUnusedVariables
|
||
|
return false;
|
||
|
}
|
||
|
return obj.x === obj;
|
||
|
} catch (e) { /* this is IE 8. */
|
||
|
return false;
|
||
|
}
|
||
|
};
|
||
|
var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
|
||
|
|
||
|
var defineProperty = function (object, name, value, predicate) {
|
||
|
if (name in object && (!isFunction(predicate) || !predicate())) {
|
||
|
return;
|
||
|
}
|
||
|
if (supportsDescriptors) {
|
||
|
origDefineProperty(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 = objectKeys$1(map);
|
||
|
if (hasSymbols) {
|
||
|
props = concat.call(props, Object.getOwnPropertySymbols(map));
|
||
|
}
|
||
|
for (var i = 0; i < props.length; i += 1) {
|
||
|
defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
defineProperties.supportsDescriptors = !!supportsDescriptors;
|
||
|
|
||
|
var defineProperties_1 = defineProperties;
|
||
|
|
||
|
var toObject = Object;
|
||
|
var TypeErr = TypeError;
|
||
|
|
||
|
var implementation$2 = function flags() {
|
||
|
if (this != null && this !== toObject(this)) {
|
||
|
throw new TypeErr('RegExp.prototype.flags getter called on non-object');
|
||
|
}
|
||
|
var result = '';
|
||
|
if (this.global) {
|
||
|
result += 'g';
|
||
|
}
|
||
|
if (this.ignoreCase) {
|
||
|
result += 'i';
|
||
|
}
|
||
|
if (this.multiline) {
|
||
|
result += 'm';
|
||
|
}
|
||
|
if (this.dotAll) {
|
||
|
result += 's';
|
||
|
}
|
||
|
if (this.unicode) {
|
||
|
result += 'u';
|
||
|
}
|
||
|
if (this.sticky) {
|
||
|
result += 'y';
|
||
|
}
|
||
|
return result;
|
||
|
};
|
||
|
|
||
|
var supportsDescriptors$1 = defineProperties_1.supportsDescriptors;
|
||
|
var gOPD$1 = Object.getOwnPropertyDescriptor;
|
||
|
var TypeErr$1 = TypeError;
|
||
|
|
||
|
var polyfill = function getPolyfill() {
|
||
|
if (!supportsDescriptors$1) {
|
||
|
throw new TypeErr$1('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
|
||
|
}
|
||
|
if (/a/mig.flags === 'gim') {
|
||
|
var descriptor = gOPD$1(RegExp.prototype, 'flags');
|
||
|
if (descriptor && typeof descriptor.get === 'function' && typeof (/a/).dotAll === 'boolean') {
|
||
|
return descriptor.get;
|
||
|
}
|
||
|
}
|
||
|
return implementation$2;
|
||
|
};
|
||
|
|
||
|
var supportsDescriptors$2 = defineProperties_1.supportsDescriptors;
|
||
|
|
||
|
var gOPD$2 = Object.getOwnPropertyDescriptor;
|
||
|
var defineProperty$1 = Object.defineProperty;
|
||
|
var TypeErr$2 = TypeError;
|
||
|
var getProto = Object.getPrototypeOf;
|
||
|
var regex = /a/;
|
||
|
|
||
|
var shim = function shimFlags() {
|
||
|
if (!supportsDescriptors$2 || !getProto) {
|
||
|
throw new TypeErr$2('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
|
||
|
}
|
||
|
var polyfill$$1 = polyfill();
|
||
|
var proto = getProto(regex);
|
||
|
var descriptor = gOPD$2(proto, 'flags');
|
||
|
if (!descriptor || descriptor.get !== polyfill$$1) {
|
||
|
defineProperty$1(proto, 'flags', {
|
||
|
configurable: true,
|
||
|
enumerable: false,
|
||
|
get: polyfill$$1
|
||
|
});
|
||
|
}
|
||
|
return polyfill$$1;
|
||
|
};
|
||
|
|
||
|
var flagsBound = Function.call.bind(implementation$2);
|
||
|
|
||
|
defineProperties_1(flagsBound, {
|
||
|
getPolyfill: polyfill,
|
||
|
implementation: implementation$2,
|
||
|
shim: shim
|
||
|
});
|
||
|
|
||
|
var regexp_prototype_flags = flagsBound;
|
||
|
|
||
|
var getDay = Date.prototype.getDay;
|
||
|
var tryDateObject = function tryDateObject(value) {
|
||
|
try {
|
||
|
getDay.call(value);
|
||
|
return true;
|
||
|
} catch (e) {
|
||
|
return false;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
var toStr$8 = Object.prototype.toString;
|
||
|
var dateClass = '[object Date]';
|
||
|
var hasToStringTag$2 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
|
||
|
|
||
|
var isDateObject = function isDateObject(value) {
|
||
|
if (typeof value !== 'object' || value === null) { return false; }
|
||
|
return hasToStringTag$2 ? tryDateObject(value) : toStr$8.call(value) === dateClass;
|
||
|
};
|
||
|
|
||
|
var getTime = Date.prototype.getTime;
|
||
|
|
||
|
function deepEqual(actual, expected, options) {
|
||
|
var opts = options || {};
|
||
|
|
||
|
// 7.1. All identical values are equivalent, as determined by ===.
|
||
|
if (opts.strict ? objectIs(actual, expected) : actual === expected) {
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
// 7.3. Other pairs that do not both pass typeof value == 'object', equivalence is determined by ==.
|
||
|
if (!actual || !expected || (typeof actual !== 'object' && typeof expected !== 'object')) {
|
||
|
return opts.strict ? objectIs(actual, expected) : actual == expected;
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
* 7.4. For all other Object pairs, including Array objects, equivalence is
|
||
|
* determined by having the same number of owned properties (as verified
|
||
|
* with Object.prototype.hasOwnProperty.call), the same set of keys
|
||
|
* (although not necessarily the same order), equivalent values for every
|
||
|
* corresponding key, and an identical 'prototype' property. Note: this
|
||
|
* accounts for both named and indexed properties on Arrays.
|
||
|
*/
|
||
|
// eslint-disable-next-line no-use-before-define
|
||
|
return objEquiv(actual, expected, opts);
|
||
|
}
|
||
|
|
||
|
function isUndefinedOrNull(value) {
|
||
|
return value === null || value === undefined;
|
||
|
}
|
||
|
|
||
|
function isBuffer(x) {
|
||
|
if (!x || typeof x !== 'object' || typeof x.length !== 'number') {
|
||
|
return false;
|
||
|
}
|
||
|
if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {
|
||
|
return false;
|
||
|
}
|
||
|
if (x.length > 0 && typeof x[0] !== 'number') {
|
||
|
return false;
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
function objEquiv(a, b, opts) {
|
||
|
/* eslint max-statements: [2, 50] */
|
||
|
var i, key;
|
||
|
if (typeof a !== typeof b) { return false; }
|
||
|
if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) { return false; }
|
||
|
|
||
|
// an identical 'prototype' property.
|
||
|
if (a.prototype !== b.prototype) { return false; }
|
||
|
|
||
|
if (isArguments$1(a) !== isArguments$1(b)) { return false; }
|
||
|
|
||
|
var aIsRegex = isRegex(a);
|
||
|
var bIsRegex = isRegex(b);
|
||
|
if (aIsRegex !== bIsRegex) { return false; }
|
||
|
if (aIsRegex || bIsRegex) {
|
||
|
return a.source === b.source && regexp_prototype_flags(a) === regexp_prototype_flags(b);
|
||
|
}
|
||
|
|
||
|
if (isDateObject(a) && isDateObject(b)) {
|
||
|
return getTime.call(a) === getTime.call(b);
|
||
|
}
|
||
|
|
||
|
var aIsBuffer = isBuffer(a);
|
||
|
var bIsBuffer = isBuffer(b);
|
||
|
if (aIsBuffer !== bIsBuffer) { return false; }
|
||
|
if (aIsBuffer || bIsBuffer) { // && would work too, because both are true or both false here
|
||
|
if (a.length !== b.length) { return false; }
|
||
|
for (i = 0; i < a.length; i++) {
|
||
|
if (a[i] !== b[i]) { return false; }
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
if (typeof a !== typeof b) { return false; }
|
||
|
|
||
|
try {
|
||
|
var ka = objectKeys(a);
|
||
|
var kb = objectKeys(b);
|
||
|
} catch (e) { // happens when one is a string literal and the other isn't
|
||
|
return false;
|
||
|
}
|
||
|
// having the same number of owned properties (keys incorporates hasOwnProperty)
|
||
|
if (ka.length !== kb.length) { return false; }
|
||
|
|
||
|
// the same set of keys (although not necessarily the same order),
|
||
|
ka.sort();
|
||
|
kb.sort();
|
||
|
// ~~~cheap key test
|
||
|
for (i = ka.length - 1; i >= 0; i--) {
|
||
|
if (ka[i] != kb[i]) { return false; }
|
||
|
}
|
||
|
// equivalent values for every corresponding key, and ~~~possibly expensive deep test
|
||
|
for (i = ka.length - 1; i >= 0; i--) {
|
||
|
key = ka[i];
|
||
|
if (!deepEqual(a[key], b[key], opts)) { return false; }
|
||
|
}
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
var deepEqual_1 = deepEqual;
|
||
|
|
||
|
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
||
|
|
||
|
function unwrapExports (x) {
|
||
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x.default : x;
|
||
|
}
|
||
|
|
||
|
function createCommonjsModule(fn, module) {
|
||
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
||
|
}
|
||
|
|
||
|
var reactIs_production_min = createCommonjsModule(function (module, exports) {
|
||
|
Object.defineProperty(exports,"__esModule",{value:!0});
|
||
|
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.suspense_list"):
|
||
|
60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.fundamental"):60117,w=b?Symbol.for("react.responder"):60118;function x(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return u}}case t:case r:case d:return u}}}function y(a){return x(a)===m}exports.typeOf=x;exports.AsyncMode=l;
|
||
|
exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;
|
||
|
exports.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===v||a.$$typeof===w)};exports.isAsyncMode=function(a){return y(a)||x(a)===l};exports.isConcurrentMode=y;exports.isContextConsumer=function(a){return x(a)===k};exports.isContextProvider=function(a){return x(a)===h};
|
||
|
exports.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return x(a)===n};exports.isFragment=function(a){return x(a)===e};exports.isLazy=function(a){return x(a)===t};exports.isMemo=function(a){return x(a)===r};exports.isPortal=function(a){return x(a)===d};exports.isProfiler=function(a){return x(a)===g};exports.isStrictMode=function(a){return x(a)===f};exports.isSuspense=function(a){return x(a)===p};
|
||
|
});
|
||
|
|
||
|
unwrapExports(reactIs_production_min);
|
||
|
var reactIs_production_min_1 = reactIs_production_min.typeOf;
|
||
|
var reactIs_production_min_2 = reactIs_production_min.AsyncMode;
|
||
|
var reactIs_production_min_3 = reactIs_production_min.ConcurrentMode;
|
||
|
var reactIs_production_min_4 = reactIs_production_min.ContextConsumer;
|
||
|
var reactIs_production_min_5 = reactIs_production_min.ContextProvider;
|
||
|
var reactIs_production_min_6 = reactIs_production_min.Element;
|
||
|
var reactIs_production_min_7 = reactIs_production_min.ForwardRef;
|
||
|
var reactIs_production_min_8 = reactIs_production_min.Fragment;
|
||
|
var reactIs_production_min_9 = reactIs_production_min.Lazy;
|
||
|
var reactIs_production_min_10 = reactIs_production_min.Memo;
|
||
|
var reactIs_production_min_11 = reactIs_production_min.Portal;
|
||
|
var reactIs_production_min_12 = reactIs_production_min.Profiler;
|
||
|
var reactIs_production_min_13 = reactIs_production_min.StrictMode;
|
||
|
var reactIs_production_min_14 = reactIs_production_min.Suspense;
|
||
|
var reactIs_production_min_15 = reactIs_production_min.isValidElementType;
|
||
|
var reactIs_production_min_16 = reactIs_production_min.isAsyncMode;
|
||
|
var reactIs_production_min_17 = reactIs_production_min.isConcurrentMode;
|
||
|
var reactIs_production_min_18 = reactIs_production_min.isContextConsumer;
|
||
|
var reactIs_production_min_19 = reactIs_production_min.isContextProvider;
|
||
|
var reactIs_production_min_20 = reactIs_production_min.isElement;
|
||
|
var reactIs_production_min_21 = reactIs_production_min.isForwardRef;
|
||
|
var reactIs_production_min_22 = reactIs_production_min.isFragment;
|
||
|
var reactIs_production_min_23 = reactIs_production_min.isLazy;
|
||
|
var reactIs_production_min_24 = reactIs_production_min.isMemo;
|
||
|
var reactIs_production_min_25 = reactIs_production_min.isPortal;
|
||
|
var reactIs_production_min_26 = reactIs_production_min.isProfiler;
|
||
|
var reactIs_production_min_27 = reactIs_production_min.isStrictMode;
|
||
|
var reactIs_production_min_28 = reactIs_production_min.isSuspense;
|
||
|
|
||
|
var reactIs_development = createCommonjsModule(function (module, exports) {
|
||
|
|
||
|
|
||
|
|
||
|
{
|
||
|
(function() {
|
||
|
|
||
|
Object.defineProperty(exports, '__esModule', { value: true });
|
||
|
|
||
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
||
|
// nor polyfill, then a plain number is used for performance.
|
||
|
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
||
|
|
||
|
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
||
|
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
||
|
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
||
|
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
||
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
||
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
||
|
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
||
|
// TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
||
|
// (unstable) APIs that have been removed. Can we remove the symbols?
|
||
|
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
||
|
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
||
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
||
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
||
|
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
||
|
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
||
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
||
|
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
||
|
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
||
|
|
||
|
function isValidElementType(type) {
|
||
|
return typeof type === 'string' || typeof type === 'function' ||
|
||
|
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
||
|
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Forked from fbjs/warning:
|
||
|
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
||
|
*
|
||
|
* Only change is we use console.warn instead of console.error,
|
||
|
* and do nothing when 'console' is not supported.
|
||
|
* This really simplifies the code.
|
||
|
* ---
|
||
|
* Similar to invariant but only logs a warning if the condition is not met.
|
||
|
* This can be used to log issues in development environments in critical
|
||
|
* paths. Removing the logging code for production environments will keep the
|
||
|
* same logic and follow the same code paths.
|
||
|
*/
|
||
|
|
||
|
var lowPriorityWarning = function () {};
|
||
|
|
||
|
{
|
||
|
var printWarning = function (format) {
|
||
|
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||
|
args[_key - 1] = arguments[_key];
|
||
|
}
|
||
|
|
||
|
var argIndex = 0;
|
||
|
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
||
|
return args[argIndex++];
|
||
|
});
|
||
|
if (typeof console !== 'undefined') {
|
||
|
console.warn(message);
|
||
|
}
|
||
|
try {
|
||
|
// --- Welcome to debugging React ---
|
||
|
// This error was thrown as a convenience so that you can use this stack
|
||
|
// to find the callsite that caused this warning to fire.
|
||
|
throw new Error(message);
|
||
|
} catch (x) {}
|
||
|
};
|
||
|
|
||
|
lowPriorityWarning = function (condition, format) {
|
||
|
if (format === undefined) {
|
||
|
throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
|
||
|
}
|
||
|
if (!condition) {
|
||
|
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
||
|
args[_key2 - 2] = arguments[_key2];
|
||
|
}
|
||
|
|
||
|
printWarning.apply(undefined, [format].concat(args));
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
var lowPriorityWarning$1 = lowPriorityWarning;
|
||
|
|
||
|
function typeOf(object) {
|
||
|
if (typeof object === 'object' && object !== null) {
|
||
|
var $$typeof = object.$$typeof;
|
||
|
switch ($$typeof) {
|
||
|
case REACT_ELEMENT_TYPE:
|
||
|
var type = object.type;
|
||
|
|
||
|
switch (type) {
|
||
|
case REACT_ASYNC_MODE_TYPE:
|
||
|
case REACT_CONCURRENT_MODE_TYPE:
|
||
|
case REACT_FRAGMENT_TYPE:
|
||
|
case REACT_PROFILER_TYPE:
|
||
|
case REACT_STRICT_MODE_TYPE:
|
||
|
case REACT_SUSPENSE_TYPE:
|
||
|
return type;
|
||
|
default:
|
||
|
var $$typeofType = type && type.$$typeof;
|
||
|
|
||
|
switch ($$typeofType) {
|
||
|
case REACT_CONTEXT_TYPE:
|
||
|
case REACT_FORWARD_REF_TYPE:
|
||
|
case REACT_PROVIDER_TYPE:
|
||
|
return $$typeofType;
|
||
|
default:
|
||
|
return $$typeof;
|
||
|
}
|
||
|
}
|
||
|
case REACT_LAZY_TYPE:
|
||
|
case REACT_MEMO_TYPE:
|
||
|
case REACT_PORTAL_TYPE:
|
||
|
return $$typeof;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return undefined;
|
||
|
}
|
||
|
|
||
|
// AsyncMode is deprecated along with isAsyncMode
|
||
|
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
||
|
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
||
|
var ContextConsumer = REACT_CONTEXT_TYPE;
|
||
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
||
|
var Element = REACT_ELEMENT_TYPE;
|
||
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
||
|
var Fragment = REACT_FRAGMENT_TYPE;
|
||
|
var Lazy = REACT_LAZY_TYPE;
|
||
|
var Memo = REACT_MEMO_TYPE;
|
||
|
var Portal = REACT_PORTAL_TYPE;
|
||
|
var Profiler = REACT_PROFILER_TYPE;
|
||
|
var StrictMode = REACT_STRICT_MODE_TYPE;
|
||
|
var Suspense = REACT_SUSPENSE_TYPE;
|
||
|
|
||
|
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
||
|
|
||
|
// AsyncMode should be deprecated
|
||
|
function isAsyncMode(object) {
|
||
|
{
|
||
|
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
||
|
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
||
|
lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
||
|
}
|
||
|
}
|
||
|
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
||
|
}
|
||
|
function isConcurrentMode(object) {
|
||
|
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
||
|
}
|
||
|
function isContextConsumer(object) {
|
||
|
return typeOf(object) === REACT_CONTEXT_TYPE;
|
||
|
}
|
||
|
function isContextProvider(object) {
|
||
|
return typeOf(object) === REACT_PROVIDER_TYPE;
|
||
|
}
|
||
|
function isElement(object) {
|
||
|
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
||
|
}
|
||
|
function isForwardRef(object) {
|
||
|
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
||
|
}
|
||
|
function isFragment(object) {
|
||
|
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
||
|
}
|
||
|
function isLazy(object) {
|
||
|
return typeOf(object) === REACT_LAZY_TYPE;
|
||
|
}
|
||
|
function isMemo(object) {
|
||
|
return typeOf(object) === REACT_MEMO_TYPE;
|
||
|
}
|
||
|
function isPortal(object) {
|
||
|
return typeOf(object) === REACT_PORTAL_TYPE;
|
||
|
}
|
||
|
function isProfiler(object) {
|
||
|
return typeOf(object) === REACT_PROFILER_TYPE;
|
||
|
}
|
||
|
function isStrictMode(object) {
|
||
|
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
||
|
}
|
||
|
function isSuspense(object) {
|
||
|
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
||
|
}
|
||
|
|
||
|
exports.typeOf = typeOf;
|
||
|
exports.AsyncMode = AsyncMode;
|
||
|
exports.ConcurrentMode = ConcurrentMode;
|
||
|
exports.ContextConsumer = ContextConsumer;
|
||
|
exports.ContextProvider = ContextProvider;
|
||
|
exports.Element = Element;
|
||
|
exports.ForwardRef = ForwardRef;
|
||
|
exports.Fragment = Fragment;
|
||
|
exports.Lazy = Lazy;
|
||
|
exports.Memo = Memo;
|
||
|
exports.Portal = Portal;
|
||
|
exports.Profiler = Profiler;
|
||
|
exports.StrictMode = StrictMode;
|
||
|
exports.Suspense = Suspense;
|
||
|
exports.isValidElementType = isValidElementType;
|
||
|
exports.isAsyncMode = isAsyncMode;
|
||
|
exports.isConcurrentMode = isConcurrentMode;
|
||
|
exports.isContextConsumer = isContextConsumer;
|
||
|
exports.isContextProvider = isContextProvider;
|
||
|
exports.isElement = isElement;
|
||
|
exports.isForwardRef = isForwardRef;
|
||
|
exports.isFragment = isFragment;
|
||
|
exports.isLazy = isLazy;
|
||
|
exports.isMemo = isMemo;
|
||
|
exports.isPortal = isPortal;
|
||
|
exports.isProfiler = isProfiler;
|
||
|
exports.isStrictMode = isStrictMode;
|
||
|
exports.isSuspense = isSuspense;
|
||
|
})();
|
||
|
}
|
||
|
});
|
||
|
|
||
|
unwrapExports(reactIs_development);
|
||
|
var reactIs_development_1 = reactIs_development.typeOf;
|
||
|
var reactIs_development_2 = reactIs_development.AsyncMode;
|
||
|
var reactIs_development_3 = reactIs_development.ConcurrentMode;
|
||
|
var reactIs_development_4 = reactIs_development.ContextConsumer;
|
||
|
var reactIs_development_5 = reactIs_development.ContextProvider;
|
||
|
var reactIs_development_6 = reactIs_development.Element;
|
||
|
var reactIs_development_7 = reactIs_development.ForwardRef;
|
||
|
var reactIs_development_8 = reactIs_development.Fragment;
|
||
|
var reactIs_development_9 = reactIs_development.Lazy;
|
||
|
var reactIs_development_10 = reactIs_development.Memo;
|
||
|
var reactIs_development_11 = reactIs_development.Portal;
|
||
|
var reactIs_development_12 = reactIs_development.Profiler;
|
||
|
var reactIs_development_13 = reactIs_development.StrictMode;
|
||
|
var reactIs_development_14 = reactIs_development.Suspense;
|
||
|
var reactIs_development_15 = reactIs_development.isValidElementType;
|
||
|
var reactIs_development_16 = reactIs_development.isAsyncMode;
|
||
|
var reactIs_development_17 = reactIs_development.isConcurrentMode;
|
||
|
var reactIs_development_18 = reactIs_development.isContextConsumer;
|
||
|
var reactIs_development_19 = reactIs_development.isContextProvider;
|
||
|
var reactIs_development_20 = reactIs_development.isElement;
|
||
|
var reactIs_development_21 = reactIs_development.isForwardRef;
|
||
|
var reactIs_development_22 = reactIs_development.isFragment;
|
||
|
var reactIs_development_23 = reactIs_development.isLazy;
|
||
|
var reactIs_development_24 = reactIs_development.isMemo;
|
||
|
var reactIs_development_25 = reactIs_development.isPortal;
|
||
|
var reactIs_development_26 = reactIs_development.isProfiler;
|
||
|
var reactIs_development_27 = reactIs_development.isStrictMode;
|
||
|
var reactIs_development_28 = reactIs_development.isSuspense;
|
||
|
|
||
|
var reactIs = createCommonjsModule(function (module) {
|
||
|
|
||
|
{
|
||
|
module.exports = reactIs_development;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
/*
|
||
|
object-assign
|
||
|
(c) Sindre Sorhus
|
||
|
@license MIT
|
||
|
*/
|
||
|
/* eslint-disable no-unused-vars */
|
||
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
||
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||
|
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
||
|
|
||
|
function toObject$1(val) {
|
||
|
if (val === null || val === undefined) {
|
||
|
throw new TypeError('Object.assign cannot be called with null or undefined');
|
||
|
}
|
||
|
|
||
|
return Object(val);
|
||
|
}
|
||
|
|
||
|
function shouldUseNative() {
|
||
|
try {
|
||
|
if (!Object.assign) {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
// Detect buggy property enumeration order in older V8 versions.
|
||
|
|
||
|
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
||
|
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
||
|
test1[5] = 'de';
|
||
|
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
||
|
var test2 = {};
|
||
|
for (var i = 0; i < 10; i++) {
|
||
|
test2['_' + String.fromCharCode(i)] = i;
|
||
|
}
|
||
|
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
||
|
return test2[n];
|
||
|
});
|
||
|
if (order2.join('') !== '0123456789') {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
||
|
var test3 = {};
|
||
|
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
||
|
test3[letter] = letter;
|
||
|
});
|
||
|
if (Object.keys(Object.assign({}, test3)).join('') !==
|
||
|
'abcdefghijklmnopqrst') {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
return true;
|
||
|
} catch (err) {
|
||
|
// We don't expect any of the above to throw, but better to be safe.
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
||
|
var from;
|
||
|
var to = toObject$1(target);
|
||
|
var symbols;
|
||
|
|
||
|
for (var s = 1; s < arguments.length; s++) {
|
||
|
from = Object(arguments[s]);
|
||
|
|
||
|
for (var key in from) {
|
||
|
if (hasOwnProperty.call(from, key)) {
|
||
|
to[key] = from[key];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (getOwnPropertySymbols) {
|
||
|
symbols = getOwnPropertySymbols(from);
|
||
|
for (var i = 0; i < symbols.length; i++) {
|
||
|
if (propIsEnumerable.call(from, symbols[i])) {
|
||
|
to[symbols[i]] = from[symbols[i]];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return to;
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Copyright (c) 2013-present, Facebook, Inc.
|
||
|
*
|
||
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
|
*/
|
||
|
|
||
|
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
||
|
|
||
|
var ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
||
|
|
||
|
var printWarning = function() {};
|
||
|
|
||
|
{
|
||
|
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
||
|
var loggedTypeFailures = {};
|
||
|
var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
||
|
|
||
|
printWarning = function(text) {
|
||
|
var message = 'Warning: ' + text;
|
||
|
if (typeof console !== 'undefined') {
|
||
|
console.error(message);
|
||
|
}
|
||
|
try {
|
||
|
// --- Welcome to debugging React ---
|
||
|
// This error was thrown as a convenience so that you can use this stack
|
||
|
// to find the callsite that caused this warning to fire.
|
||
|
throw new Error(message);
|
||
|
} catch (x) {}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Assert that the values match with the type specs.
|
||
|
* Error messages are memorized and will only be shown once.
|
||
|
*
|
||
|
* @param {object} typeSpecs Map of name to a ReactPropType
|
||
|
* @param {object} values Runtime values that need to be type-checked
|
||
|
* @param {string} location e.g. "prop", "context", "child context"
|
||
|
* @param {string} componentName Name of the component for error messages.
|
||
|
* @param {?Function} getStack Returns the component stack.
|
||
|
* @private
|
||
|
*/
|
||
|
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
||
|
{
|
||
|
for (var typeSpecName in typeSpecs) {
|
||
|
if (has$2(typeSpecs, typeSpecName)) {
|
||
|
var error;
|
||
|
// Prop type validation may throw. In case they do, we don't want to
|
||
|
// fail the render phase where it didn't fail before. So we log it.
|
||
|
// After these have been cleaned up, we'll let them throw.
|
||
|
try {
|
||
|
// This is intentionally an invariant that gets caught. It's the same
|
||
|
// behavior as without this statement except with a better message.
|
||
|
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
||
|
var err = Error(
|
||
|
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
||
|
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
||
|
);
|
||
|
err.name = 'Invariant Violation';
|
||
|
throw err;
|
||
|
}
|
||
|
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1);
|
||
|
} catch (ex) {
|
||
|
error = ex;
|
||
|
}
|
||
|
if (error && !(error instanceof Error)) {
|
||
|
printWarning(
|
||
|
(componentName || 'React class') + ': type specification of ' +
|
||
|
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
||
|
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
||
|
'You may have forgotten to pass an argument to the type checker ' +
|
||
|
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
||
|
'shape all require an argument).'
|
||
|
);
|
||
|
}
|
||
|
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
||
|
// Only monitor this failure once because there tends to be a lot of the
|
||
|
// same error.
|
||
|
loggedTypeFailures[error.message] = true;
|
||
|
|
||
|
var stack = getStack ? getStack() : '';
|
||
|
|
||
|
printWarning(
|
||
|
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Resets warning cache when testing.
|
||
|
*
|
||
|
* @private
|
||
|
*/
|
||
|
checkPropTypes.resetWarningCache = function() {
|
||
|
{
|
||
|
loggedTypeFailures = {};
|
||
|
}
|
||
|
};
|
||
|
|
||
|
var checkPropTypes_1 = checkPropTypes;
|
||
|
|
||
|
var has$3 = Function.call.bind(Object.prototype.hasOwnProperty);
|
||
|
var printWarning$1 = function() {};
|
||
|
|
||
|
{
|
||
|
printWarning$1 = function(text) {
|
||
|
var message = 'Warning: ' + text;
|
||
|
if (typeof console !== 'undefined') {
|
||
|
console.error(message);
|
||
|
}
|
||
|
try {
|
||
|
// --- Welcome to debugging React ---
|
||
|
// This error was thrown as a convenience so that you can use this stack
|
||
|
// to find the callsite that caused this warning to fire.
|
||
|
throw new Error(message);
|
||
|
} catch (x) {}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
function emptyFunctionThatReturnsNull() {
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
||
|
/* global Symbol */
|
||
|
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
||
|
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
||
|
|
||
|
/**
|
||
|
* Returns the iterator method function contained on the iterable object.
|
||
|
*
|
||
|
* Be sure to invoke the function with the iterable as context:
|
||
|
*
|
||
|
* var iteratorFn = getIteratorFn(myIterable);
|
||
|
* if (iteratorFn) {
|
||
|
* var iterator = iteratorFn.call(myIterable);
|
||
|
* ...
|
||
|
* }
|
||
|
*
|
||
|
* @param {?object} maybeIterable
|
||
|
* @return {?function}
|
||
|
*/
|
||
|
function getIteratorFn(maybeIterable) {
|
||
|
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
||
|
if (typeof iteratorFn === 'function') {
|
||
|
return iteratorFn;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Collection of methods that allow declaration and validation of props that are
|
||
|
* supplied to React components. Example usage:
|
||
|
*
|
||
|
* var Props = require('ReactPropTypes');
|
||
|
* var MyArticle = React.createClass({
|
||
|
* propTypes: {
|
||
|
* // An optional string prop named "description".
|
||
|
* description: Props.string,
|
||
|
*
|
||
|
* // A required enum prop named "category".
|
||
|
* category: Props.oneOf(['News','Photos']).isRequired,
|
||
|
*
|
||
|
* // A prop named "dialog" that requires an instance of Dialog.
|
||
|
* dialog: Props.instanceOf(Dialog).isRequired
|
||
|
* },
|
||
|
* render: function() { ... }
|
||
|
* });
|
||
|
*
|
||
|
* A more formal specification of how these methods are used:
|
||
|
*
|
||
|
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
||
|
* decl := ReactPropTypes.{type}(.isRequired)?
|
||
|
*
|
||
|
* Each and every declaration produces a function with the same signature. This
|
||
|
* allows the creation of custom validation functions. For example:
|
||
|
*
|
||
|
* var MyLink = React.createClass({
|
||
|
* propTypes: {
|
||
|
* // An optional string or URI prop named "href".
|
||
|
* href: function(props, propName, componentName) {
|
||
|
* var propValue = props[propName];
|
||
|
* if (propValue != null && typeof propValue !== 'string' &&
|
||
|
* !(propValue instanceof URI)) {
|
||
|
* return new Error(
|
||
|
* 'Expected a string or an URI for ' + propName + ' in ' +
|
||
|
* componentName
|
||
|
* );
|
||
|
* }
|
||
|
* }
|
||
|
* },
|
||
|
* render: function() {...}
|
||
|
* });
|
||
|
*
|
||
|
* @internal
|
||
|
*/
|
||
|
|
||
|
var ANONYMOUS = '<<anonymous>>';
|
||
|
|
||
|
// Important!
|
||
|
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
||
|
var ReactPropTypes = {
|
||
|
array: createPrimitiveTypeChecker('array'),
|
||
|
bool: createPrimitiveTypeChecker('boolean'),
|
||
|
func: createPrimitiveTypeChecker('function'),
|
||
|
number: createPrimitiveTypeChecker('number'),
|
||
|
object: createPrimitiveTypeChecker('object'),
|
||
|
string: createPrimitiveTypeChecker('string'),
|
||
|
symbol: createPrimitiveTypeChecker('symbol'),
|
||
|
|
||
|
any: createAnyTypeChecker(),
|
||
|
arrayOf: createArrayOfTypeChecker,
|
||
|
element: createElementTypeChecker(),
|
||
|
elementType: createElementTypeTypeChecker(),
|
||
|
instanceOf: createInstanceTypeChecker,
|
||
|
node: createNodeChecker(),
|
||
|
objectOf: createObjectOfTypeChecker,
|
||
|
oneOf: createEnumTypeChecker,
|
||
|
oneOfType: createUnionTypeChecker,
|
||
|
shape: createShapeTypeChecker,
|
||
|
exact: createStrictShapeTypeChecker,
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
||
|
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
||
|
*/
|
||
|
/*eslint-disable no-self-compare*/
|
||
|
function is(x, y) {
|
||
|
// SameValue algorithm
|
||
|
if (x === y) {
|
||
|
// Steps 1-5, 7-10
|
||
|
// Steps 6.b-6.e: +0 != -0
|
||
|
return x !== 0 || 1 / x === 1 / y;
|
||
|
} else {
|
||
|
// Step 6.a: NaN == NaN
|
||
|
return x !== x && y !== y;
|
||
|
}
|
||
|
}
|
||
|
/*eslint-enable no-self-compare*/
|
||
|
|
||
|
/**
|
||
|
* We use an Error-like object for backward compatibility as people may call
|
||
|
* PropTypes directly and inspect their output. However, we don't use real
|
||
|
* Errors anymore. We don't inspect their stack anyway, and creating them
|
||
|
* is prohibitively expensive if they are created too often, such as what
|
||
|
* happens in oneOfType() for any type before the one that matched.
|
||
|
*/
|
||
|
function PropTypeError(message) {
|
||
|
this.message = message;
|
||
|
this.stack = '';
|
||
|
}
|
||
|
// Make `instanceof Error` still work for returned errors.
|
||
|
PropTypeError.prototype = Error.prototype;
|
||
|
|
||
|
function createChainableTypeChecker(validate) {
|
||
|
{
|
||
|
var manualPropTypeCallCache = {};
|
||
|
var manualPropTypeWarningCount = 0;
|
||
|
}
|
||
|
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
||
|
componentName = componentName || ANONYMOUS;
|
||
|
propFullName = propFullName || propName;
|
||
|
|
||
|
if (secret !== ReactPropTypesSecret_1) {
|
||
|
if (throwOnDirectAccess) {
|
||
|
// New behavior only for users of `prop-types` package
|
||
|
var err = new Error(
|
||
|
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
||
|
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
||
|
'Read more at http://fb.me/use-check-prop-types'
|
||
|
);
|
||
|
err.name = 'Invariant Violation';
|
||
|
throw err;
|
||
|
} else if (typeof console !== 'undefined') {
|
||
|
// Old behavior for people using React.PropTypes
|
||
|
var cacheKey = componentName + ':' + propName;
|
||
|
if (
|
||
|
!manualPropTypeCallCache[cacheKey] &&
|
||
|
// Avoid spamming the console because they are often not actionable except for lib authors
|
||
|
manualPropTypeWarningCount < 3
|
||
|
) {
|
||
|
printWarning$1(
|
||
|
'You are manually calling a React.PropTypes validation ' +
|
||
|
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
||
|
'and will throw in the standalone `prop-types` package. ' +
|
||
|
'You may be seeing this warning due to a third-party PropTypes ' +
|
||
|
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
||
|
);
|
||
|
manualPropTypeCallCache[cacheKey] = true;
|
||
|
manualPropTypeWarningCount++;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (props[propName] == null) {
|
||
|
if (isRequired) {
|
||
|
if (props[propName] === null) {
|
||
|
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
||
|
}
|
||
|
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
||
|
}
|
||
|
return null;
|
||
|
} else {
|
||
|
return validate(props, propName, componentName, location, propFullName);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var chainedCheckType = checkType.bind(null, false);
|
||
|
chainedCheckType.isRequired = checkType.bind(null, true);
|
||
|
|
||
|
return chainedCheckType;
|
||
|
}
|
||
|
|
||
|
function createPrimitiveTypeChecker(expectedType) {
|
||
|
function validate(props, propName, componentName, location, propFullName, secret) {
|
||
|
var propValue = props[propName];
|
||
|
var propType = getPropType(propValue);
|
||
|
if (propType !== expectedType) {
|
||
|
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
||
|
// check, but we can offer a more precise error message here rather than
|
||
|
// 'of type `object`'.
|
||
|
var preciseType = getPreciseType(propValue);
|
||
|
|
||
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
return createChainableTypeChecker(validate);
|
||
|
}
|
||
|
|
||
|
function createAnyTypeChecker() {
|
||
|
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
||
|
}
|
||
|
|
||
|
function createArrayOfTypeChecker(typeChecker) {
|
||
|
function validate(props, propName, componentName, location, propFullName) {
|
||
|
if (typeof typeChecker !== 'function') {
|
||
|
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
||
|
}
|
||
|
var propValue = props[propName];
|
||
|
if (!Array.isArray(propValue)) {
|
||
|
var propType = getPropType(propValue);
|
||
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
||
|
}
|
||
|
for (var i = 0; i < propValue.length; i++) {
|
||
|
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1);
|
||
|
if (error instanceof Error) {
|
||
|
return error;
|
||
|
}
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
return createChainableTypeChecker(validate);
|
||
|
}
|
||
|
|
||
|
function createElementTypeChecker() {
|
||
|
function validate(props, propName, componentName, location, propFullName) {
|
||
|
var propValue = props[propName];
|
||
|
if (!isValidElement(propValue)) {
|
||
|
var propType = getPropType(propValue);
|
||
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
return createChainableTypeChecker(validate);
|
||
|
}
|
||
|
|
||
|
function createElementTypeTypeChecker() {
|
||
|
function validate(props, propName, componentName, location, propFullName) {
|
||
|
var propValue = props[propName];
|
||
|
if (!reactIs.isValidElementType(propValue)) {
|
||
|
var propType = getPropType(propValue);
|
||
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
return createChainableTypeChecker(validate);
|
||
|
}
|
||
|
|
||
|
function createInstanceTypeChecker(expectedClass) {
|
||
|
function validate(props, propName, componentName, location, propFullName) {
|
||
|
if (!(props[propName] instanceof expectedClass)) {
|
||
|
var expectedClassName = expectedClass.name || ANONYMOUS;
|
||
|
var actualClassName = getClassName(props[propName]);
|
||
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
return createChainableTypeChecker(validate);
|
||
|
}
|
||
|
|
||
|
function createEnumTypeChecker(expectedValues) {
|
||
|
if (!Array.isArray(expectedValues)) {
|
||
|
{
|
||
|
if (arguments.length > 1) {
|
||
|
printWarning$1(
|
||
|
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
||
|
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
||
|
);
|
||
|
} else {
|
||
|
printWarning$1('Invalid argument supplied to oneOf, expected an array.');
|
||
|
}
|
||
|
}
|
||
|
return emptyFunctionThatReturnsNull;
|
||
|
}
|
||
|
|
||
|
function validate(props, propName, componentName, location, propFullName) {
|
||
|
var propValue = props[propName];
|
||
|
for (var i = 0; i < expectedValues.length; i++) {
|
||
|
if (is(propValue, expectedValues[i])) {
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
||
|
var type = getPreciseType(value);
|
||
|
if (type === 'symbol') {
|
||
|
return String(value);
|
||
|
}
|
||
|
return value;
|
||
|
});
|
||
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
||
|
}
|
||
|
return createChainableTypeChecker(validate);
|
||
|
}
|
||
|
|
||
|
function createObjectOfTypeChecker(typeChecker) {
|
||
|
function validate(props, propName, componentName, location, propFullName) {
|
||
|
if (typeof typeChecker !== 'function') {
|
||
|
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
||
|
}
|
||
|
var propValue = props[propName];
|
||
|
var propType = getPropType(propValue);
|
||
|
if (propType !== 'object') {
|
||
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
||
|
}
|
||
|
for (var key in propValue) {
|
||
|
if (has$3(propValue, key)) {
|
||
|
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
|
||
|
if (error instanceof Error) {
|
||
|
return error;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
return createChainableTypeChecker(validate);
|
||
|
}
|
||
|
|
||
|
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
||
|
if (!Array.isArray(arrayOfTypeCheckers)) {
|
||
|
printWarning$1('Invalid argument supplied to oneOfType, expected an instance of array.');
|
||
|
return emptyFunctionThatReturnsNull;
|
||
|
}
|
||
|
|
||
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
||
|
var checker = arrayOfTypeCheckers[i];
|
||
|
if (typeof checker !== 'function') {
|
||
|
printWarning$1(
|
||
|
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
||
|
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
||
|
);
|
||
|
return emptyFunctionThatReturnsNull;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function validate(props, propName, componentName, location, propFullName) {
|
||
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
||
|
var checker = arrayOfTypeCheckers[i];
|
||
|
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1) == null) {
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
|
||
|
}
|
||
|
return createChainableTypeChecker(validate);
|
||
|
}
|
||
|
|
||
|
function createNodeChecker() {
|
||
|
function validate(props, propName, componentName, location, propFullName) {
|
||
|
if (!isNode(props[propName])) {
|
||
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
return createChainableTypeChecker(validate);
|
||
|
}
|
||
|
|
||
|
function createShapeTypeChecker(shapeTypes) {
|
||
|
function validate(props, propName, componentName, location, propFullName) {
|
||
|
var propValue = props[propName];
|
||
|
var propType = getPropType(propValue);
|
||
|
if (propType !== 'object') {
|
||
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
||
|
}
|
||
|
for (var key in shapeTypes) {
|
||
|
var checker = shapeTypes[key];
|
||
|
if (!checker) {
|
||
|
continue;
|
||
|
}
|
||
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
|
||
|
if (error) {
|
||
|
return error;
|
||
|
}
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
return createChainableTypeChecker(validate);
|
||
|
}
|
||
|
|
||
|
function createStrictShapeTypeChecker(shapeTypes) {
|
||
|
function validate(props, propName, componentName, location, propFullName) {
|
||
|
var propValue = props[propName];
|
||
|
var propType = getPropType(propValue);
|
||
|
if (propType !== 'object') {
|
||
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
||
|
}
|
||
|
// We need to check all keys in case some are required but missing from
|
||
|
// props.
|
||
|
var allKeys = objectAssign({}, props[propName], shapeTypes);
|
||
|
for (var key in allKeys) {
|
||
|
var checker = shapeTypes[key];
|
||
|
if (!checker) {
|
||
|
return new PropTypeError(
|
||
|
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
||
|
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
||
|
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
||
|
);
|
||
|
}
|
||
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
|
||
|
if (error) {
|
||
|
return error;
|
||
|
}
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
return createChainableTypeChecker(validate);
|
||
|
}
|
||
|
|
||
|
function isNode(propValue) {
|
||
|
switch (typeof propValue) {
|
||
|
case 'number':
|
||
|
case 'string':
|
||
|
case 'undefined':
|
||
|
return true;
|
||
|
case 'boolean':
|
||
|
return !propValue;
|
||
|
case 'object':
|
||
|
if (Array.isArray(propValue)) {
|
||
|
return propValue.every(isNode);
|
||
|
}
|
||
|
if (propValue === null || isValidElement(propValue)) {
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
var iteratorFn = getIteratorFn(propValue);
|
||
|
if (iteratorFn) {
|
||
|
var iterator = iteratorFn.call(propValue);
|
||
|
var step;
|
||
|
if (iteratorFn !== propValue.entries) {
|
||
|
while (!(step = iterator.next()).done) {
|
||
|
if (!isNode(step.value)) {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
// Iterator will provide entry [k,v] tuples rather than values.
|
||
|
while (!(step = iterator.next()).done) {
|
||
|
var entry = step.value;
|
||
|
if (entry) {
|
||
|
if (!isNode(entry[1])) {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
return true;
|
||
|
default:
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function isSymbol(propType, propValue) {
|
||
|
// Native Symbol.
|
||
|
if (propType === 'symbol') {
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
// falsy value can't be a Symbol
|
||
|
if (!propValue) {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
||
|
if (propValue['@@toStringTag'] === 'Symbol') {
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
// Fallback for non-spec compliant Symbols which are polyfilled.
|
||
|
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
// Equivalent of `typeof` but with special handling for array and regexp.
|
||
|
function getPropType(propValue) {
|
||
|
var propType = typeof propValue;
|
||
|
if (Array.isArray(propValue)) {
|
||
|
return 'array';
|
||
|
}
|
||
|
if (propValue instanceof RegExp) {
|
||
|
// Old webkits (at least until Android 4.0) return 'function' rather than
|
||
|
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
||
|
// passes PropTypes.object.
|
||
|
return 'object';
|
||
|
}
|
||
|
if (isSymbol(propType, propValue)) {
|
||
|
return 'symbol';
|
||
|
}
|
||
|
return propType;
|
||
|
}
|
||
|
|
||
|
// This handles more types than `getPropType`. Only used for error messages.
|
||
|
// See `createPrimitiveTypeChecker`.
|
||
|
function getPreciseType(propValue) {
|
||
|
if (typeof propValue === 'undefined' || propValue === null) {
|
||
|
return '' + propValue;
|
||
|
}
|
||
|
var propType = getPropType(propValue);
|
||
|
if (propType === 'object') {
|
||
|
if (propValue instanceof Date) {
|
||
|
return 'date';
|
||
|
} else if (propValue instanceof RegExp) {
|
||
|
return 'regexp';
|
||
|
}
|
||
|
}
|
||
|
return propType;
|
||
|
}
|
||
|
|
||
|
// Returns a string that is postfixed to a warning about an invalid type.
|
||
|
// For example, "undefined" or "of type array"
|
||
|
function getPostfixForTypeWarning(value) {
|
||
|
var type = getPreciseType(value);
|
||
|
switch (type) {
|
||
|
case 'array':
|
||
|
case 'object':
|
||
|
return 'an ' + type;
|
||
|
case 'boolean':
|
||
|
case 'date':
|
||
|
case 'regexp':
|
||
|
return 'a ' + type;
|
||
|
default:
|
||
|
return type;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Returns class name of the object, if any.
|
||
|
function getClassName(propValue) {
|
||
|
if (!propValue.constructor || !propValue.constructor.name) {
|
||
|
return ANONYMOUS;
|
||
|
}
|
||
|
return propValue.constructor.name;
|
||
|
}
|
||
|
|
||
|
ReactPropTypes.checkPropTypes = checkPropTypes_1;
|
||
|
ReactPropTypes.resetWarningCache = checkPropTypes_1.resetWarningCache;
|
||
|
ReactPropTypes.PropTypes = ReactPropTypes;
|
||
|
|
||
|
return ReactPropTypes;
|
||
|
};
|
||
|
|
||
|
var propTypes = createCommonjsModule(function (module) {
|
||
|
/**
|
||
|
* Copyright (c) 2013-present, Facebook, Inc.
|
||
|
*
|
||
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
|
*/
|
||
|
|
||
|
{
|
||
|
var ReactIs = reactIs;
|
||
|
|
||
|
// By explicitly using `prop-types` you are opting into new development behavior.
|
||
|
// http://fb.me/prop-types-in-prod
|
||
|
var throwOnDirectAccess = true;
|
||
|
module.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
var key = '__global_unique_id__';
|
||
|
|
||
|
var gud = function() {
|
||
|
return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1;
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||
|
*
|
||
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
|
*/
|
||
|
|
||
|
var warning = function() {};
|
||
|
|
||
|
{
|
||
|
var printWarning$2 = function printWarning(format, args) {
|
||
|
var len = arguments.length;
|
||
|
args = new Array(len > 1 ? len - 1 : 0);
|
||
|
for (var key = 1; key < len; key++) {
|
||
|
args[key - 1] = arguments[key];
|
||
|
}
|
||
|
var argIndex = 0;
|
||
|
var message = 'Warning: ' +
|
||
|
format.replace(/%s/g, function() {
|
||
|
return args[argIndex++];
|
||
|
});
|
||
|
if (typeof console !== 'undefined') {
|
||
|
console.error(message);
|
||
|
}
|
||
|
try {
|
||
|
// --- Welcome to debugging React ---
|
||
|
// This error was thrown as a convenience so that you can use this stack
|
||
|
// to find the callsite that caused this warning to fire.
|
||
|
throw new Error(message);
|
||
|
} catch (x) {}
|
||
|
};
|
||
|
|
||
|
warning = function(condition, format, args) {
|
||
|
var len = arguments.length;
|
||
|
args = new Array(len > 2 ? len - 2 : 0);
|
||
|
for (var key = 2; key < len; key++) {
|
||
|
args[key - 2] = arguments[key];
|
||
|
}
|
||
|
if (format === undefined) {
|
||
|
throw new Error(
|
||
|
'`warning(condition, format, ...args)` requires a warning ' +
|
||
|
'message argument'
|
||
|
);
|
||
|
}
|
||
|
if (!condition) {
|
||
|
printWarning$2.apply(null, [format].concat(args));
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
var warning_1 = warning;
|
||
|
|
||
|
var implementation$3 = createCommonjsModule(function (module, exports) {
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
|
||
|
|
||
|
|
||
|
var _react2 = _interopRequireDefault(React__default);
|
||
|
|
||
|
|
||
|
|
||
|
var _propTypes2 = _interopRequireDefault(propTypes);
|
||
|
|
||
|
|
||
|
|
||
|
var _gud2 = _interopRequireDefault(gud);
|
||
|
|
||
|
|
||
|
|
||
|
var _warning2 = _interopRequireDefault(warning_1);
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
|
||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||
|
|
||
|
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||
|
|
||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||
|
|
||
|
var MAX_SIGNED_31_BIT_INT = 1073741823;
|
||
|
|
||
|
// Inlined Object.is polyfill.
|
||
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
||
|
function objectIs(x, y) {
|
||
|
if (x === y) {
|
||
|
return x !== 0 || 1 / x === 1 / y;
|
||
|
} else {
|
||
|
return x !== x && y !== y;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function createEventEmitter(value) {
|
||
|
var handlers = [];
|
||
|
return {
|
||
|
on: function on(handler) {
|
||
|
handlers.push(handler);
|
||
|
},
|
||
|
off: function off(handler) {
|
||
|
handlers = handlers.filter(function (h) {
|
||
|
return h !== handler;
|
||
|
});
|
||
|
},
|
||
|
get: function get() {
|
||
|
return value;
|
||
|
},
|
||
|
set: function set(newValue, changedBits) {
|
||
|
value = newValue;
|
||
|
handlers.forEach(function (handler) {
|
||
|
return handler(value, changedBits);
|
||
|
});
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
function onlyChild(children) {
|
||
|
return Array.isArray(children) ? children[0] : children;
|
||
|
}
|
||
|
|
||
|
function createReactContext(defaultValue, calculateChangedBits) {
|
||
|
var _Provider$childContex, _Consumer$contextType;
|
||
|
|
||
|
var contextProp = '__create-react-context-' + (0, _gud2.default)() + '__';
|
||
|
|
||
|
var Provider = function (_Component) {
|
||
|
_inherits(Provider, _Component);
|
||
|
|
||
|
function Provider() {
|
||
|
var _temp, _this, _ret;
|
||
|
|
||
|
_classCallCheck(this, Provider);
|
||
|
|
||
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||
|
args[_key] = arguments[_key];
|
||
|
}
|
||
|
|
||
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.emitter = createEventEmitter(_this.props.value), _temp), _possibleConstructorReturn(_this, _ret);
|
||
|
}
|
||
|
|
||
|
Provider.prototype.getChildContext = function getChildContext() {
|
||
|
var _ref;
|
||
|
|
||
|
return _ref = {}, _ref[contextProp] = this.emitter, _ref;
|
||
|
};
|
||
|
|
||
|
Provider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
||
|
if (this.props.value !== nextProps.value) {
|
||
|
var oldValue = this.props.value;
|
||
|
var newValue = nextProps.value;
|
||
|
var changedBits = void 0;
|
||
|
|
||
|
if (objectIs(oldValue, newValue)) {
|
||
|
changedBits = 0; // No change
|
||
|
} else {
|
||
|
changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
|
||
|
{
|
||
|
(0, _warning2.default)((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits);
|
||
|
}
|
||
|
|
||
|
changedBits |= 0;
|
||
|
|
||
|
if (changedBits !== 0) {
|
||
|
this.emitter.set(nextProps.value, changedBits);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
Provider.prototype.render = function render() {
|
||
|
return this.props.children;
|
||
|
};
|
||
|
|
||
|
return Provider;
|
||
|
}(React__default.Component);
|
||
|
|
||
|
Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = _propTypes2.default.object.isRequired, _Provider$childContex);
|
||
|
|
||
|
var Consumer = function (_Component2) {
|
||
|
_inherits(Consumer, _Component2);
|
||
|
|
||
|
function Consumer() {
|
||
|
var _temp2, _this2, _ret2;
|
||
|
|
||
|
_classCallCheck(this, Consumer);
|
||
|
|
||
|
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||
|
args[_key2] = arguments[_key2];
|
||
|
}
|
||
|
|
||
|
return _ret2 = (_temp2 = (_this2 = _possibleConstructorReturn(this, _Component2.call.apply(_Component2, [this].concat(args))), _this2), _this2.state = {
|
||
|
value: _this2.getValue()
|
||
|
}, _this2.onUpdate = function (newValue, changedBits) {
|
||
|
var observedBits = _this2.observedBits | 0;
|
||
|
if ((observedBits & changedBits) !== 0) {
|
||
|
_this2.setState({ value: _this2.getValue() });
|
||
|
}
|
||
|
}, _temp2), _possibleConstructorReturn(_this2, _ret2);
|
||
|
}
|
||
|
|
||
|
Consumer.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
||
|
var observedBits = nextProps.observedBits;
|
||
|
|
||
|
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
|
||
|
: observedBits;
|
||
|
};
|
||
|
|
||
|
Consumer.prototype.componentDidMount = function componentDidMount() {
|
||
|
if (this.context[contextProp]) {
|
||
|
this.context[contextProp].on(this.onUpdate);
|
||
|
}
|
||
|
var observedBits = this.props.observedBits;
|
||
|
|
||
|
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
|
||
|
: observedBits;
|
||
|
};
|
||
|
|
||
|
Consumer.prototype.componentWillUnmount = function componentWillUnmount() {
|
||
|
if (this.context[contextProp]) {
|
||
|
this.context[contextProp].off(this.onUpdate);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
Consumer.prototype.getValue = function getValue() {
|
||
|
if (this.context[contextProp]) {
|
||
|
return this.context[contextProp].get();
|
||
|
} else {
|
||
|
return defaultValue;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
Consumer.prototype.render = function render() {
|
||
|
return onlyChild(this.props.children)(this.state.value);
|
||
|
};
|
||
|
|
||
|
return Consumer;
|
||
|
}(React__default.Component);
|
||
|
|
||
|
Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = _propTypes2.default.object, _Consumer$contextType);
|
||
|
|
||
|
|
||
|
return {
|
||
|
Provider: Provider,
|
||
|
Consumer: Consumer
|
||
|
};
|
||
|
}
|
||
|
|
||
|
exports.default = createReactContext;
|
||
|
module.exports = exports['default'];
|
||
|
});
|
||
|
|
||
|
unwrapExports(implementation$3);
|
||
|
|
||
|
var lib = createCommonjsModule(function (module, exports) {
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
|
||
|
|
||
|
|
||
|
var _react2 = _interopRequireDefault(React__default);
|
||
|
|
||
|
|
||
|
|
||
|
var _implementation2 = _interopRequireDefault(implementation$3);
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
|
||
|
exports.default = _react2.default.createContext || _implementation2.default;
|
||
|
module.exports = exports['default'];
|
||
|
});
|
||
|
|
||
|
var createContext = unwrapExports(lib);
|
||
|
|
||
|
var ManagerReferenceNodeContext = createContext();
|
||
|
var ManagerReferenceNodeSetterContext = createContext();
|
||
|
|
||
|
var Manager =
|
||
|
/*#__PURE__*/
|
||
|
function (_React$Component) {
|
||
|
_inheritsLoose(Manager, _React$Component);
|
||
|
|
||
|
function Manager() {
|
||
|
var _this;
|
||
|
|
||
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||
|
args[_key] = arguments[_key];
|
||
|
}
|
||
|
|
||
|
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
||
|
|
||
|
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "referenceNode", void 0);
|
||
|
|
||
|
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "setReferenceNode", function (newReferenceNode) {
|
||
|
if (newReferenceNode && _this.referenceNode !== newReferenceNode) {
|
||
|
_this.referenceNode = newReferenceNode;
|
||
|
|
||
|
_this.forceUpdate();
|
||
|
}
|
||
|
});
|
||
|
|
||
|
return _this;
|
||
|
}
|
||
|
|
||
|
var _proto = Manager.prototype;
|
||
|
|
||
|
_proto.componentWillUnmount = function componentWillUnmount() {
|
||
|
this.referenceNode = null;
|
||
|
};
|
||
|
|
||
|
_proto.render = function render() {
|
||
|
return React.createElement(ManagerReferenceNodeContext.Provider, {
|
||
|
value: this.referenceNode
|
||
|
}, React.createElement(ManagerReferenceNodeSetterContext.Provider, {
|
||
|
value: this.setReferenceNode
|
||
|
}, this.props.children));
|
||
|
};
|
||
|
|
||
|
return Manager;
|
||
|
}(React.Component);
|
||
|
|
||
|
/**
|
||
|
* Takes an argument and if it's an array, returns the first item in the array,
|
||
|
* otherwise returns the argument. Used for Preact compatibility.
|
||
|
*/
|
||
|
var unwrapArray = function unwrapArray(arg) {
|
||
|
return Array.isArray(arg) ? arg[0] : arg;
|
||
|
};
|
||
|
/**
|
||
|
* Takes a maybe-undefined function and arbitrary args and invokes the function
|
||
|
* only if it is defined.
|
||
|
*/
|
||
|
|
||
|
var safeInvoke = function safeInvoke(fn) {
|
||
|
if (typeof fn === "function") {
|
||
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||
|
args[_key - 1] = arguments[_key];
|
||
|
}
|
||
|
|
||
|
return fn.apply(void 0, args);
|
||
|
}
|
||
|
};
|
||
|
/**
|
||
|
* Does a shallow equality check of two objects by comparing the reference
|
||
|
* equality of each value.
|
||
|
*/
|
||
|
|
||
|
var shallowEqual = function shallowEqual(objA, objB) {
|
||
|
var aKeys = Object.keys(objA);
|
||
|
var bKeys = Object.keys(objB);
|
||
|
|
||
|
if (bKeys.length !== aKeys.length) {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
for (var i = 0; i < bKeys.length; i++) {
|
||
|
var key = aKeys[i];
|
||
|
|
||
|
if (objA[key] !== objB[key]) {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return true;
|
||
|
};
|
||
|
/**
|
||
|
* Sets a ref using either a ref callback or a ref object
|
||
|
*/
|
||
|
|
||
|
var setRef = function setRef(ref, node) {
|
||
|
// if its a function call it
|
||
|
if (typeof ref === "function") {
|
||
|
return safeInvoke(ref, node);
|
||
|
} // otherwise we should treat it as a ref object
|
||
|
else if (ref != null) {
|
||
|
ref.current = node;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
var initialStyle = {
|
||
|
position: 'absolute',
|
||
|
top: 0,
|
||
|
left: 0,
|
||
|
opacity: 0,
|
||
|
pointerEvents: 'none'
|
||
|
};
|
||
|
var initialArrowStyle = {};
|
||
|
var InnerPopper =
|
||
|
/*#__PURE__*/
|
||
|
function (_React$Component) {
|
||
|
_inheritsLoose(InnerPopper, _React$Component);
|
||
|
|
||
|
function InnerPopper() {
|
||
|
var _this;
|
||
|
|
||
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||
|
args[_key] = arguments[_key];
|
||
|
}
|
||
|
|
||
|
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
||
|
|
||
|
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "state", {
|
||
|
data: undefined,
|
||
|
placement: undefined
|
||
|
});
|
||
|
|
||
|
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "popperInstance", void 0);
|
||
|
|
||
|
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "popperNode", null);
|
||
|
|
||
|
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "arrowNode", null);
|
||
|
|
||
|
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "setPopperNode", function (popperNode) {
|
||
|
if (!popperNode || _this.popperNode === popperNode) return;
|
||
|
setRef(_this.props.innerRef, popperNode);
|
||
|
_this.popperNode = popperNode;
|
||
|
|
||
|
_this.updatePopperInstance();
|
||
|
});
|
||
|
|
||
|
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "setArrowNode", function (arrowNode) {
|
||
|
_this.arrowNode = arrowNode;
|
||
|
});
|
||
|
|
||
|
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "updateStateModifier", {
|
||
|
enabled: true,
|
||
|
order: 900,
|
||
|
fn: function fn(data) {
|
||
|
var placement = data.placement;
|
||
|
|
||
|
_this.setState({
|
||
|
data: data,
|
||
|
placement: placement
|
||
|
});
|
||
|
|
||
|
return data;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getOptions", function () {
|
||
|
return {
|
||
|
placement: _this.props.placement,
|
||
|
eventsEnabled: _this.props.eventsEnabled,
|
||
|
positionFixed: _this.props.positionFixed,
|
||
|
modifiers: _extends({}, _this.props.modifiers, {
|
||
|
arrow: _extends({}, _this.props.modifiers && _this.props.modifiers.arrow, {
|
||
|
enabled: !!_this.arrowNode,
|
||
|
element: _this.arrowNode
|
||
|
}),
|
||
|
applyStyle: {
|
||
|
enabled: false
|
||
|
},
|
||
|
updateStateModifier: _this.updateStateModifier
|
||
|
})
|
||
|
};
|
||
|
});
|
||
|
|
||
|
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getPopperStyle", function () {
|
||
|
return !_this.popperNode || !_this.state.data ? initialStyle : _extends({
|
||
|
position: _this.state.data.offsets.popper.position
|
||
|
}, _this.state.data.styles);
|
||
|
});
|
||
|
|
||
|
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getPopperPlacement", function () {
|
||
|
return !_this.state.data ? undefined : _this.state.placement;
|
||
|
});
|
||
|
|
||
|
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getArrowStyle", function () {
|
||
|
return !_this.arrowNode || !_this.state.data ? initialArrowStyle : _this.state.data.arrowStyles;
|
||
|
});
|
||
|
|
||
|
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getOutOfBoundariesState", function () {
|
||
|
return _this.state.data ? _this.state.data.hide : undefined;
|
||
|
});
|
||
|
|
||
|
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "destroyPopperInstance", function () {
|
||
|
if (!_this.popperInstance) return;
|
||
|
|
||
|
_this.popperInstance.destroy();
|
||
|
|
||
|
_this.popperInstance = null;
|
||
|
});
|
||
|
|
||
|
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "updatePopperInstance", function () {
|
||
|
_this.destroyPopperInstance();
|
||
|
|
||
|
var _assertThisInitialize = _assertThisInitialized(_assertThisInitialized(_this)),
|
||
|
popperNode = _assertThisInitialize.popperNode;
|
||
|
|
||
|
var referenceElement = _this.props.referenceElement;
|
||
|
if (!referenceElement || !popperNode) return;
|
||
|
_this.popperInstance = new PopperJS(referenceElement, popperNode, _this.getOptions());
|
||
|
});
|
||
|
|
||
|
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "scheduleUpdate", function () {
|
||
|
if (_this.popperInstance) {
|
||
|
_this.popperInstance.scheduleUpdate();
|
||
|
}
|
||
|
});
|
||
|
|
||
|
return _this;
|
||
|
}
|
||
|
|
||
|
var _proto = InnerPopper.prototype;
|
||
|
|
||
|
_proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
|
||
|
// If the Popper.js options have changed, update the instance (destroy + create)
|
||
|
if (this.props.placement !== prevProps.placement || this.props.referenceElement !== prevProps.referenceElement || this.props.positionFixed !== prevProps.positionFixed || !deepEqual_1(this.props.modifiers, prevProps.modifiers, {
|
||
|
strict: true
|
||
|
})) {
|
||
|
// develop only check that modifiers isn't being updated needlessly
|
||
|
{
|
||
|
if (this.props.modifiers !== prevProps.modifiers && this.props.modifiers != null && prevProps.modifiers != null && shallowEqual(this.props.modifiers, prevProps.modifiers)) {
|
||
|
console.warn("'modifiers' prop reference updated even though all values appear the same.\nConsider memoizing the 'modifiers' object to avoid needless rendering.");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
this.updatePopperInstance();
|
||
|
} else if (this.props.eventsEnabled !== prevProps.eventsEnabled && this.popperInstance) {
|
||
|
this.props.eventsEnabled ? this.popperInstance.enableEventListeners() : this.popperInstance.disableEventListeners();
|
||
|
} // A placement difference in state means popper determined a new placement
|
||
|
// apart from the props value. By the time the popper element is rendered with
|
||
|
// the new position Popper has already measured it, if the place change triggers
|
||
|
// a size change it will result in a misaligned popper. So we schedule an update to be sure.
|
||
|
|
||
|
|
||
|
if (prevState.placement !== this.state.placement) {
|
||
|
this.scheduleUpdate();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
_proto.componentWillUnmount = function componentWillUnmount() {
|
||
|
setRef(this.props.innerRef, null);
|
||
|
this.destroyPopperInstance();
|
||
|
};
|
||
|
|
||
|
_proto.render = function render() {
|
||
|
return unwrapArray(this.props.children)({
|
||
|
ref: this.setPopperNode,
|
||
|
style: this.getPopperStyle(),
|
||
|
placement: this.getPopperPlacement(),
|
||
|
outOfBoundaries: this.getOutOfBoundariesState(),
|
||
|
scheduleUpdate: this.scheduleUpdate,
|
||
|
arrowProps: {
|
||
|
ref: this.setArrowNode,
|
||
|
style: this.getArrowStyle()
|
||
|
}
|
||
|
});
|
||
|
};
|
||
|
|
||
|
return InnerPopper;
|
||
|
}(React.Component);
|
||
|
|
||
|
_defineProperty(InnerPopper, "defaultProps", {
|
||
|
placement: 'bottom',
|
||
|
eventsEnabled: true,
|
||
|
referenceElement: undefined,
|
||
|
positionFixed: false
|
||
|
});
|
||
|
|
||
|
var placements = PopperJS.placements;
|
||
|
function Popper(_ref) {
|
||
|
var referenceElement = _ref.referenceElement,
|
||
|
props = _objectWithoutPropertiesLoose(_ref, ["referenceElement"]);
|
||
|
|
||
|
return React.createElement(ManagerReferenceNodeContext.Consumer, null, function (referenceNode) {
|
||
|
return React.createElement(InnerPopper, _extends({
|
||
|
referenceElement: referenceElement !== undefined ? referenceElement : referenceNode
|
||
|
}, props));
|
||
|
});
|
||
|
}
|
||
|
|
||
|
var InnerReference =
|
||
|
/*#__PURE__*/
|
||
|
function (_React$Component) {
|
||
|
_inheritsLoose(InnerReference, _React$Component);
|
||
|
|
||
|
function InnerReference() {
|
||
|
var _this;
|
||
|
|
||
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||
|
args[_key] = arguments[_key];
|
||
|
}
|
||
|
|
||
|
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
||
|
|
||
|
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "refHandler", function (node) {
|
||
|
setRef(_this.props.innerRef, node);
|
||
|
safeInvoke(_this.props.setReferenceNode, node);
|
||
|
});
|
||
|
|
||
|
return _this;
|
||
|
}
|
||
|
|
||
|
var _proto = InnerReference.prototype;
|
||
|
|
||
|
_proto.componentWillUnmount = function componentWillUnmount() {
|
||
|
setRef(this.props.innerRef, null);
|
||
|
};
|
||
|
|
||
|
_proto.render = function render() {
|
||
|
warning_1(Boolean(this.props.setReferenceNode), '`Reference` should not be used outside of a `Manager` component.');
|
||
|
return unwrapArray(this.props.children)({
|
||
|
ref: this.refHandler
|
||
|
});
|
||
|
};
|
||
|
|
||
|
return InnerReference;
|
||
|
}(React.Component);
|
||
|
|
||
|
function Reference(props) {
|
||
|
return React.createElement(ManagerReferenceNodeSetterContext.Consumer, null, function (setReferenceNode) {
|
||
|
return React.createElement(InnerReference, _extends({
|
||
|
setReferenceNode: setReferenceNode
|
||
|
}, props));
|
||
|
});
|
||
|
}
|
||
|
|
||
|
// Public components
|
||
|
// Public types
|
||
|
|
||
|
exports.Popper = Popper;
|
||
|
exports.placements = placements;
|
||
|
exports.Manager = Manager;
|
||
|
exports.Reference = Reference;
|
||
|
|
||
|
Object.defineProperty(exports, '__esModule', { value: true });
|
||
|
|
||
|
})));
|