You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
8609 lines
314 KiB
8609 lines
314 KiB
(function webpackUniversalModuleDefinition(root, factory) {
|
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
module.exports = factory();
|
|
else if(typeof define === 'function' && define.amd)
|
|
define([], factory);
|
|
else if(typeof exports === 'object')
|
|
exports["ConnectedReactRouter"] = factory();
|
|
else
|
|
root["ConnectedReactRouter"] = factory();
|
|
})(this, function() {
|
|
return /******/ (function(modules) { // webpackBootstrap
|
|
/******/ // The module cache
|
|
/******/ var installedModules = {};
|
|
/******/
|
|
/******/ // The require function
|
|
/******/ function __webpack_require__(moduleId) {
|
|
/******/
|
|
/******/ // Check if module is in cache
|
|
/******/ if(installedModules[moduleId]) {
|
|
/******/ return installedModules[moduleId].exports;
|
|
/******/ }
|
|
/******/ // Create a new module (and put it into the cache)
|
|
/******/ var module = installedModules[moduleId] = {
|
|
/******/ i: moduleId,
|
|
/******/ l: false,
|
|
/******/ exports: {}
|
|
/******/ };
|
|
/******/
|
|
/******/ // Execute the module function
|
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
/******/
|
|
/******/ // Flag the module as loaded
|
|
/******/ module.l = true;
|
|
/******/
|
|
/******/ // Return the exports of the module
|
|
/******/ return module.exports;
|
|
/******/ }
|
|
/******/
|
|
/******/
|
|
/******/ // expose the modules object (__webpack_modules__)
|
|
/******/ __webpack_require__.m = modules;
|
|
/******/
|
|
/******/ // expose the module cache
|
|
/******/ __webpack_require__.c = installedModules;
|
|
/******/
|
|
/******/ // identity function for calling harmony imports with the correct context
|
|
/******/ __webpack_require__.i = function(value) { return value; };
|
|
/******/
|
|
/******/ // define getter function for harmony exports
|
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
/******/ Object.defineProperty(exports, name, {
|
|
/******/ configurable: false,
|
|
/******/ enumerable: true,
|
|
/******/ get: getter
|
|
/******/ });
|
|
/******/ }
|
|
/******/ };
|
|
/******/
|
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
/******/ __webpack_require__.n = function(module) {
|
|
/******/ var getter = module && module.__esModule ?
|
|
/******/ function getDefault() { return module['default']; } :
|
|
/******/ function getModuleExports() { return module; };
|
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
/******/ return getter;
|
|
/******/ };
|
|
/******/
|
|
/******/ // Object.prototype.hasOwnProperty.call
|
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
/******/
|
|
/******/ // __webpack_public_path__
|
|
/******/ __webpack_require__.p = "";
|
|
/******/
|
|
/******/ // Load entry module and return exports
|
|
/******/ return __webpack_require__(__webpack_require__.s = 73);
|
|
/******/ })
|
|
/************************************************************************/
|
|
/******/ ([
|
|
/* 0 */
|
|
/***/ (function(module, exports) {
|
|
|
|
// shim for using process in browser
|
|
var process = module.exports = {};
|
|
|
|
// cached from whatever global is present so that test runners that stub it
|
|
// don't break things. But we need to wrap it in a try catch in case it is
|
|
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
|
// function because try/catches deoptimize in certain engines.
|
|
|
|
var cachedSetTimeout;
|
|
var cachedClearTimeout;
|
|
|
|
function defaultSetTimout() {
|
|
throw new Error('setTimeout has not been defined');
|
|
}
|
|
function defaultClearTimeout () {
|
|
throw new Error('clearTimeout has not been defined');
|
|
}
|
|
(function () {
|
|
try {
|
|
if (typeof setTimeout === 'function') {
|
|
cachedSetTimeout = setTimeout;
|
|
} else {
|
|
cachedSetTimeout = defaultSetTimout;
|
|
}
|
|
} catch (e) {
|
|
cachedSetTimeout = defaultSetTimout;
|
|
}
|
|
try {
|
|
if (typeof clearTimeout === 'function') {
|
|
cachedClearTimeout = clearTimeout;
|
|
} else {
|
|
cachedClearTimeout = defaultClearTimeout;
|
|
}
|
|
} catch (e) {
|
|
cachedClearTimeout = defaultClearTimeout;
|
|
}
|
|
} ())
|
|
function runTimeout(fun) {
|
|
if (cachedSetTimeout === setTimeout) {
|
|
//normal enviroments in sane situations
|
|
return setTimeout(fun, 0);
|
|
}
|
|
// if setTimeout wasn't available but was latter defined
|
|
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
|
cachedSetTimeout = setTimeout;
|
|
return setTimeout(fun, 0);
|
|
}
|
|
try {
|
|
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
return cachedSetTimeout(fun, 0);
|
|
} catch(e){
|
|
try {
|
|
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
return cachedSetTimeout.call(null, fun, 0);
|
|
} catch(e){
|
|
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
|
return cachedSetTimeout.call(this, fun, 0);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
function runClearTimeout(marker) {
|
|
if (cachedClearTimeout === clearTimeout) {
|
|
//normal enviroments in sane situations
|
|
return clearTimeout(marker);
|
|
}
|
|
// if clearTimeout wasn't available but was latter defined
|
|
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
|
cachedClearTimeout = clearTimeout;
|
|
return clearTimeout(marker);
|
|
}
|
|
try {
|
|
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
return cachedClearTimeout(marker);
|
|
} catch (e){
|
|
try {
|
|
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
return cachedClearTimeout.call(null, marker);
|
|
} catch (e){
|
|
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
|
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
|
return cachedClearTimeout.call(this, marker);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
var queue = [];
|
|
var draining = false;
|
|
var currentQueue;
|
|
var queueIndex = -1;
|
|
|
|
function cleanUpNextTick() {
|
|
if (!draining || !currentQueue) {
|
|
return;
|
|
}
|
|
draining = false;
|
|
if (currentQueue.length) {
|
|
queue = currentQueue.concat(queue);
|
|
} else {
|
|
queueIndex = -1;
|
|
}
|
|
if (queue.length) {
|
|
drainQueue();
|
|
}
|
|
}
|
|
|
|
function drainQueue() {
|
|
if (draining) {
|
|
return;
|
|
}
|
|
var timeout = runTimeout(cleanUpNextTick);
|
|
draining = true;
|
|
|
|
var len = queue.length;
|
|
while(len) {
|
|
currentQueue = queue;
|
|
queue = [];
|
|
while (++queueIndex < len) {
|
|
if (currentQueue) {
|
|
currentQueue[queueIndex].run();
|
|
}
|
|
}
|
|
queueIndex = -1;
|
|
len = queue.length;
|
|
}
|
|
currentQueue = null;
|
|
draining = false;
|
|
runClearTimeout(timeout);
|
|
}
|
|
|
|
process.nextTick = function (fun) {
|
|
var args = new Array(arguments.length - 1);
|
|
if (arguments.length > 1) {
|
|
for (var i = 1; i < arguments.length; i++) {
|
|
args[i - 1] = arguments[i];
|
|
}
|
|
}
|
|
queue.push(new Item(fun, args));
|
|
if (queue.length === 1 && !draining) {
|
|
runTimeout(drainQueue);
|
|
}
|
|
};
|
|
|
|
// v8 likes predictible objects
|
|
function Item(fun, array) {
|
|
this.fun = fun;
|
|
this.array = array;
|
|
}
|
|
Item.prototype.run = function () {
|
|
this.fun.apply(null, this.array);
|
|
};
|
|
process.title = 'browser';
|
|
process.browser = true;
|
|
process.env = {};
|
|
process.argv = [];
|
|
process.version = ''; // empty string to avoid regexp issues
|
|
process.versions = {};
|
|
|
|
function noop() {}
|
|
|
|
process.on = noop;
|
|
process.addListener = noop;
|
|
process.once = noop;
|
|
process.off = noop;
|
|
process.removeListener = noop;
|
|
process.removeAllListeners = noop;
|
|
process.emit = noop;
|
|
process.prependListener = noop;
|
|
process.prependOnceListener = noop;
|
|
|
|
process.listeners = function (name) { return [] }
|
|
|
|
process.binding = function (name) {
|
|
throw new Error('process.binding is not supported');
|
|
};
|
|
|
|
process.cwd = function () { return '/' };
|
|
process.chdir = function (dir) {
|
|
throw new Error('process.chdir is not supported');
|
|
};
|
|
process.umask = function() { return 0; };
|
|
|
|
|
|
/***/ }),
|
|
/* 1 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* WEBPACK VAR INJECTION */(function(process) {
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
module.exports = __webpack_require__(65);
|
|
} else {
|
|
module.exports = __webpack_require__(64);
|
|
}
|
|
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
|
|
|
|
/***/ }),
|
|
/* 2 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* 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.
|
|
*/
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
|
|
Symbol.for &&
|
|
Symbol.for('react.element')) ||
|
|
0xeac7;
|
|
|
|
var isValidElement = function(object) {
|
|
return typeof object === 'object' &&
|
|
object !== null &&
|
|
object.$$typeof === REACT_ELEMENT_TYPE;
|
|
};
|
|
|
|
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
// http://fb.me/prop-types-in-prod
|
|
var throwOnDirectAccess = true;
|
|
module.exports = __webpack_require__(44)(isValidElement, throwOnDirectAccess);
|
|
} else {
|
|
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
// http://fb.me/prop-types-in-prod
|
|
module.exports = __webpack_require__(43)();
|
|
}
|
|
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
|
|
|
|
/***/ }),
|
|
/* 3 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* 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.
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
* Use invariant() to assert state which your program assumes to be true.
|
|
*
|
|
* Provide sprintf-style format (only %s is supported) and arguments
|
|
* to provide information about what broke and what you were
|
|
* expecting.
|
|
*
|
|
* The invariant message will be stripped in production, but the invariant
|
|
* will remain to ensure logic does not differ in production.
|
|
*/
|
|
|
|
var invariant = function(condition, format, a, b, c, d, e, f) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
if (format === undefined) {
|
|
throw new Error('invariant requires an error message argument');
|
|
}
|
|
}
|
|
|
|
if (!condition) {
|
|
var error;
|
|
if (format === undefined) {
|
|
error = new Error(
|
|
'Minified exception occurred; use the non-minified dev environment ' +
|
|
'for the full error message and additional helpful warnings.'
|
|
);
|
|
} else {
|
|
var args = [a, b, c, d, e, f];
|
|
var argIndex = 0;
|
|
error = new Error(
|
|
format.replace(/%s/g, function() { return args[argIndex++]; })
|
|
);
|
|
error.name = 'Invariant Violation';
|
|
}
|
|
|
|
error.framesToPop = 1; // we don't care about invariant's own frame
|
|
throw error;
|
|
}
|
|
};
|
|
|
|
module.exports = invariant;
|
|
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
|
|
|
|
/***/ }),
|
|
/* 4 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* 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.
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
* 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 __DEV__ = process.env.NODE_ENV !== 'production';
|
|
|
|
var warning = function() {};
|
|
|
|
if (__DEV__) {
|
|
var printWarning = function printWarning(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];
|
|
}
|
|
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.apply(null, [format].concat(args));
|
|
}
|
|
};
|
|
}
|
|
|
|
module.exports = warning;
|
|
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
|
|
|
|
/***/ }),
|
|
/* 5 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return addLeadingSlash; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return stripLeadingSlash; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return hasBasename; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return stripBasename; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return stripTrailingSlash; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return parsePath; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createPath; });
|
|
var addLeadingSlash = function addLeadingSlash(path) {
|
|
return path.charAt(0) === '/' ? path : '/' + path;
|
|
};
|
|
|
|
var stripLeadingSlash = function stripLeadingSlash(path) {
|
|
return path.charAt(0) === '/' ? path.substr(1) : path;
|
|
};
|
|
|
|
var hasBasename = function hasBasename(path, prefix) {
|
|
return new RegExp('^' + prefix + '(\\/|\\?|#|$)', 'i').test(path);
|
|
};
|
|
|
|
var stripBasename = function stripBasename(path, prefix) {
|
|
return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
|
|
};
|
|
|
|
var stripTrailingSlash = function stripTrailingSlash(path) {
|
|
return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
|
|
};
|
|
|
|
var parsePath = function parsePath(path) {
|
|
var pathname = path || '/';
|
|
var search = '';
|
|
var hash = '';
|
|
|
|
var hashIndex = pathname.indexOf('#');
|
|
if (hashIndex !== -1) {
|
|
hash = pathname.substr(hashIndex);
|
|
pathname = pathname.substr(0, hashIndex);
|
|
}
|
|
|
|
var searchIndex = pathname.indexOf('?');
|
|
if (searchIndex !== -1) {
|
|
search = pathname.substr(searchIndex);
|
|
pathname = pathname.substr(0, searchIndex);
|
|
}
|
|
|
|
return {
|
|
pathname: pathname,
|
|
search: search === '?' ? '' : search,
|
|
hash: hash === '#' ? '' : hash
|
|
};
|
|
};
|
|
|
|
var createPath = function createPath(location) {
|
|
var pathname = location.pathname,
|
|
search = location.search,
|
|
hash = location.hash;
|
|
|
|
|
|
var path = pathname || '/';
|
|
|
|
if (search && search !== '?') path += search.charAt(0) === '?' ? search : '?' + search;
|
|
|
|
if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : '#' + hash;
|
|
|
|
return path;
|
|
};
|
|
|
|
/***/ }),
|
|
/* 6 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LOCATION_CHANGE; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return onLocationChanged; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CALL_HISTORY_METHOD; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return push; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return replace; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return go; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return goBack; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return goForward; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return routerActions; });
|
|
/**
|
|
* This action type will be dispatched when your history
|
|
* receives a location change.
|
|
*/
|
|
var LOCATION_CHANGE = '@@router/LOCATION_CHANGE';
|
|
var onLocationChanged = function onLocationChanged(location, action) {
|
|
var isFirstRendering = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
return {
|
|
type: LOCATION_CHANGE,
|
|
payload: {
|
|
location: location,
|
|
action: action,
|
|
isFirstRendering: isFirstRendering
|
|
}
|
|
};
|
|
};
|
|
/**
|
|
* This action type will be dispatched by the history actions below.
|
|
* If you're writing a middleware to watch for navigation events, be sure to
|
|
* look for actions of this type.
|
|
*/
|
|
|
|
var CALL_HISTORY_METHOD = '@@router/CALL_HISTORY_METHOD';
|
|
|
|
var updateLocation = function updateLocation(method) {
|
|
return function () {
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
return {
|
|
type: CALL_HISTORY_METHOD,
|
|
payload: {
|
|
method: method,
|
|
args: args
|
|
}
|
|
};
|
|
};
|
|
};
|
|
/**
|
|
* These actions correspond to the history API.
|
|
* The associated routerMiddleware will capture these events before they get to
|
|
* your reducer and reissue them as the matching function on your history.
|
|
*/
|
|
|
|
|
|
var push = updateLocation('push');
|
|
var replace = updateLocation('replace');
|
|
var go = updateLocation('go');
|
|
var goBack = updateLocation('goBack');
|
|
var goForward = updateLocation('goForward');
|
|
var routerActions = {
|
|
push: push,
|
|
replace: replace,
|
|
go: go,
|
|
goBack: goBack,
|
|
goForward: goForward
|
|
};
|
|
|
|
/***/ }),
|
|
/* 7 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createLocation; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return locationsAreEqual; });
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_resolve_pathname__ = __webpack_require__(67);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_value_equal__ = __webpack_require__(70);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__PathUtils__ = __webpack_require__(5);
|
|
var _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; };
|
|
|
|
|
|
|
|
|
|
|
|
var createLocation = function createLocation(path, state, key, currentLocation) {
|
|
var location = void 0;
|
|
if (typeof path === 'string') {
|
|
// Two-arg form: push(path, state)
|
|
location = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__PathUtils__["b" /* parsePath */])(path);
|
|
location.state = state;
|
|
} else {
|
|
// One-arg form: push(location)
|
|
location = _extends({}, path);
|
|
|
|
if (location.pathname === undefined) location.pathname = '';
|
|
|
|
if (location.search) {
|
|
if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
|
|
} else {
|
|
location.search = '';
|
|
}
|
|
|
|
if (location.hash) {
|
|
if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
|
|
} else {
|
|
location.hash = '';
|
|
}
|
|
|
|
if (state !== undefined && location.state === undefined) location.state = state;
|
|
}
|
|
|
|
try {
|
|
location.pathname = decodeURI(location.pathname);
|
|
} catch (e) {
|
|
if (e instanceof URIError) {
|
|
throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
|
|
} else {
|
|
throw e;
|
|
}
|
|
}
|
|
|
|
if (key) location.key = key;
|
|
|
|
if (currentLocation) {
|
|
// Resolve incomplete/relative pathname relative to current location.
|
|
if (!location.pathname) {
|
|
location.pathname = currentLocation.pathname;
|
|
} else if (location.pathname.charAt(0) !== '/') {
|
|
location.pathname = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_resolve_pathname__["a" /* default */])(location.pathname, currentLocation.pathname);
|
|
}
|
|
} else {
|
|
// When there is no prior location and pathname is empty, set it to /
|
|
if (!location.pathname) {
|
|
location.pathname = '/';
|
|
}
|
|
}
|
|
|
|
return location;
|
|
};
|
|
|
|
var locationsAreEqual = function locationsAreEqual(a, b) {
|
|
return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_value_equal__["a" /* default */])(a.state, b.state);
|
|
};
|
|
|
|
/***/ }),
|
|
/* 8 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2014-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
* 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 warning = function() {};
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
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 (format.length < 10 || (/^[s\W]*$/).test(format)) {
|
|
throw new Error(
|
|
'The warning format should be able to uniquely identify this ' +
|
|
'warning. Please, use a more descriptive format than: ' + format
|
|
);
|
|
}
|
|
|
|
if (!condition) {
|
|
var argIndex = 0;
|
|
var message = 'Warning: ' +
|
|
format.replace(/%s/g, function() {
|
|
return args[argIndex++];
|
|
});
|
|
if (typeof console !== 'undefined') {
|
|
console.error(message);
|
|
}
|
|
try {
|
|
// 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) {}
|
|
}
|
|
};
|
|
}
|
|
|
|
module.exports = warning;
|
|
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
|
|
|
|
/***/ }),
|
|
/* 9 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConnectedRouter", function() { return ConnectedRouter; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "connectRouter", function() { return connectRouter; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocation", function() { return getLocation; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAction", function() { return getAction; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getHash", function() { return getHash; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSearch", function() { return getSearch; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMatchSelector", function() { return createMatchSelector; });
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ConnectedRouter__ = __webpack_require__(33);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__reducer__ = __webpack_require__(35);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__selectors__ = __webpack_require__(20);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__structure_plain__ = __webpack_require__(37);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__actions__ = __webpack_require__(6);
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "LOCATION_CHANGE", function() { return __WEBPACK_IMPORTED_MODULE_4__actions__["a"]; });
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CALL_HISTORY_METHOD", function() { return __WEBPACK_IMPORTED_MODULE_4__actions__["b"]; });
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "onLocationChanged", function() { return __WEBPACK_IMPORTED_MODULE_4__actions__["c"]; });
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "push", function() { return __WEBPACK_IMPORTED_MODULE_4__actions__["d"]; });
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "replace", function() { return __WEBPACK_IMPORTED_MODULE_4__actions__["e"]; });
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "go", function() { return __WEBPACK_IMPORTED_MODULE_4__actions__["f"]; });
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "goBack", function() { return __WEBPACK_IMPORTED_MODULE_4__actions__["g"]; });
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "goForward", function() { return __WEBPACK_IMPORTED_MODULE_4__actions__["h"]; });
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "routerActions", function() { return __WEBPACK_IMPORTED_MODULE_4__actions__["i"]; });
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__middleware__ = __webpack_require__(34);
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "routerMiddleware", function() { return __WEBPACK_IMPORTED_MODULE_5__middleware__["a"]; });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ConnectedRouter =
|
|
/*#__PURE__*/
|
|
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__ConnectedRouter__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_3__structure_plain__["a" /* default */]);
|
|
var connectRouter =
|
|
/*#__PURE__*/
|
|
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__reducer__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_3__structure_plain__["a" /* default */]);
|
|
|
|
var _createSelectors =
|
|
/*#__PURE__*/
|
|
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__selectors__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_3__structure_plain__["a" /* default */]),
|
|
getLocation = _createSelectors.getLocation,
|
|
getAction = _createSelectors.getAction,
|
|
getHash = _createSelectors.getHash,
|
|
getSearch = _createSelectors.getSearch,
|
|
createMatchSelector = _createSelectors.createMatchSelector;
|
|
|
|
|
|
|
|
/***/ }),
|
|
/* 10 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export (immutable) */ __webpack_exports__["a"] = _extends;
|
|
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);
|
|
}
|
|
|
|
/***/ }),
|
|
/* 11 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export (immutable) */ __webpack_exports__["a"] = _objectWithoutPropertiesLoose;
|
|
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;
|
|
}
|
|
|
|
/***/ }),
|
|
/* 12 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(8);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__);
|
|
|
|
|
|
var createTransitionManager = function createTransitionManager() {
|
|
var prompt = null;
|
|
|
|
var setPrompt = function setPrompt(nextPrompt) {
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(prompt == null, 'A history supports only one prompt at a time');
|
|
|
|
prompt = nextPrompt;
|
|
|
|
return function () {
|
|
if (prompt === nextPrompt) prompt = null;
|
|
};
|
|
};
|
|
|
|
var confirmTransitionTo = function confirmTransitionTo(location, action, getUserConfirmation, callback) {
|
|
// TODO: If another transition starts while we're still confirming
|
|
// the previous one, we may end up in a weird state. Figure out the
|
|
// best way to handle this.
|
|
if (prompt != null) {
|
|
var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
|
|
|
|
if (typeof result === 'string') {
|
|
if (typeof getUserConfirmation === 'function') {
|
|
getUserConfirmation(result, callback);
|
|
} else {
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(false, 'A history needs a getUserConfirmation function in order to use a prompt message');
|
|
|
|
callback(true);
|
|
}
|
|
} else {
|
|
// Return false from a transition hook to cancel the transition.
|
|
callback(result !== false);
|
|
}
|
|
} else {
|
|
callback(true);
|
|
}
|
|
};
|
|
|
|
var listeners = [];
|
|
|
|
var appendListener = function appendListener(fn) {
|
|
var isActive = true;
|
|
|
|
var listener = function listener() {
|
|
if (isActive) fn.apply(undefined, arguments);
|
|
};
|
|
|
|
listeners.push(listener);
|
|
|
|
return function () {
|
|
isActive = false;
|
|
listeners = listeners.filter(function (item) {
|
|
return item !== listener;
|
|
});
|
|
};
|
|
};
|
|
|
|
var notifyListeners = function notifyListeners() {
|
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
listeners.forEach(function (listener) {
|
|
return listener.apply(undefined, args);
|
|
});
|
|
};
|
|
|
|
return {
|
|
setPrompt: setPrompt,
|
|
confirmTransitionTo: confirmTransitionTo,
|
|
appendListener: appendListener,
|
|
notifyListeners: notifyListeners
|
|
};
|
|
};
|
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (createTransitionManager);
|
|
|
|
/***/ }),
|
|
/* 13 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createBrowserHistory__ = __webpack_require__(38);
|
|
/* unused harmony reexport createBrowserHistory */
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__createHashHistory__ = __webpack_require__(39);
|
|
/* unused harmony reexport createHashHistory */
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__createMemoryHistory__ = __webpack_require__(40);
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_2__createMemoryHistory__["a"]; });
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__LocationUtils__ = __webpack_require__(7);
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_3__LocationUtils__["a"]; });
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_3__LocationUtils__["b"]; });
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__PathUtils__ = __webpack_require__(5);
|
|
/* unused harmony reexport parsePath */
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_4__PathUtils__["a"]; });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
/* 14 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/*
|
|
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(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;
|
|
}
|
|
}
|
|
|
|
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
|
var from;
|
|
var to = toObject(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;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
/* 15 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/**
|
|
* 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';
|
|
|
|
module.exports = ReactPropTypesSecret;
|
|
|
|
|
|
/***/ }),
|
|
/* 16 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ReactReduxContext; });
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
|
|
|
|
var ReactReduxContext = __WEBPACK_IMPORTED_MODULE_0_react___default.a.createContext(null);
|
|
/* unused harmony default export */ var _unused_webpack_default_export = (ReactReduxContext);
|
|
|
|
/***/ }),
|
|
/* 17 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(4);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(3);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(1);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(2);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);
|
|
var _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; };
|
|
|
|
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; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* The public API for putting history on context.
|
|
*/
|
|
|
|
var Router = function (_React$Component) {
|
|
_inherits(Router, _React$Component);
|
|
|
|
function Router() {
|
|
var _temp, _this, _ret;
|
|
|
|
_classCallCheck(this, Router);
|
|
|
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
|
|
match: _this.computeMatch(_this.props.history.location.pathname)
|
|
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
}
|
|
|
|
Router.prototype.getChildContext = function getChildContext() {
|
|
return {
|
|
router: _extends({}, this.context.router, {
|
|
history: this.props.history,
|
|
route: {
|
|
location: this.props.history.location,
|
|
match: this.state.match
|
|
}
|
|
})
|
|
};
|
|
};
|
|
|
|
Router.prototype.computeMatch = function computeMatch(pathname) {
|
|
return {
|
|
path: "/",
|
|
url: "/",
|
|
params: {},
|
|
isExact: pathname === "/"
|
|
};
|
|
};
|
|
|
|
Router.prototype.componentWillMount = function componentWillMount() {
|
|
var _this2 = this;
|
|
|
|
var _props = this.props,
|
|
children = _props.children,
|
|
history = _props.history;
|
|
|
|
|
|
__WEBPACK_IMPORTED_MODULE_1_invariant___default()(children == null || __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.count(children) === 1, "A <Router> may have only one child element");
|
|
|
|
// Do this here so we can setState when a <Redirect> changes the
|
|
// location in componentWillMount. This happens e.g. when doing
|
|
// server rendering using a <StaticRouter>.
|
|
this.unlisten = history.listen(function () {
|
|
console.log('react-router: history changed, match', _this2.computeMatch(history.location.pathname))
|
|
console.log('history', history)
|
|
_this2.setState({
|
|
match: _this2.computeMatch(history.location.pathname)
|
|
});
|
|
});
|
|
};
|
|
|
|
Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(this.props.history === nextProps.history, "You cannot change <Router history>");
|
|
};
|
|
|
|
Router.prototype.componentWillUnmount = function componentWillUnmount() {
|
|
console.log('react-router: unlisten')
|
|
this.unlisten();
|
|
};
|
|
// Ping added
|
|
Router.prototype.componentWillUpdate = function componentWillUpdate(prevProps, nextProps) {
|
|
console.log('react-router: componentWillUpdate')
|
|
console.log('prevProps', prevProps)
|
|
console.log('nextProps', nextProps)
|
|
return false;
|
|
}
|
|
|
|
Router.prototype.render = function render() {
|
|
console.log('react-router: render Router')
|
|
var children = this.props.children;
|
|
|
|
return children ? __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.only(children) : null;
|
|
};
|
|
|
|
return Router;
|
|
}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);
|
|
|
|
Router.propTypes = {
|
|
history: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,
|
|
children: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node
|
|
};
|
|
Router.contextTypes = {
|
|
router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object
|
|
};
|
|
Router.childContextTypes = {
|
|
router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired
|
|
};
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (Router);
|
|
|
|
|
|
/***/ }),
|
|
/* 18 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp__ = __webpack_require__(22);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_path_to_regexp__);
|
|
|
|
|
|
var patternCache = {};
|
|
var cacheLimit = 10000;
|
|
var cacheCount = 0;
|
|
|
|
var compilePath = function compilePath(pattern, options) {
|
|
var cacheKey = "" + options.end + options.strict + options.sensitive;
|
|
var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});
|
|
|
|
if (cache[pattern]) return cache[pattern];
|
|
|
|
var keys = [];
|
|
var re = __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default()(pattern, keys, options);
|
|
var compiledPattern = { re: re, keys: keys };
|
|
|
|
if (cacheCount < cacheLimit) {
|
|
cache[pattern] = compiledPattern;
|
|
cacheCount++;
|
|
}
|
|
|
|
return compiledPattern;
|
|
};
|
|
|
|
/**
|
|
* Public API for matching a URL pathname to a path pattern.
|
|
*/
|
|
var matchPath = function matchPath(pathname) {
|
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
var parent = arguments[2];
|
|
|
|
if (typeof options === "string") options = { path: options };
|
|
|
|
var _options = options,
|
|
path = _options.path,
|
|
_options$exact = _options.exact,
|
|
exact = _options$exact === undefined ? false : _options$exact,
|
|
_options$strict = _options.strict,
|
|
strict = _options$strict === undefined ? false : _options$strict,
|
|
_options$sensitive = _options.sensitive,
|
|
sensitive = _options$sensitive === undefined ? false : _options$sensitive;
|
|
|
|
|
|
if (path == null) return parent;
|
|
|
|
var _compilePath = compilePath(path, { end: exact, strict: strict, sensitive: sensitive }),
|
|
re = _compilePath.re,
|
|
keys = _compilePath.keys;
|
|
|
|
var match = re.exec(pathname);
|
|
|
|
if (!match) return null;
|
|
|
|
var url = match[0],
|
|
values = match.slice(1);
|
|
|
|
var isExact = pathname === url;
|
|
|
|
if (exact && !isExact) return null;
|
|
|
|
return {
|
|
path: path, // the path pattern used to match
|
|
url: path === "/" && url === "" ? "/" : url, // the matched portion of the URL
|
|
isExact: isExact, // whether or not we matched exactly
|
|
params: keys.reduce(function (memo, key, index) {
|
|
memo[key.name] = values[index];
|
|
return memo;
|
|
}, {})
|
|
};
|
|
};
|
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (matchPath);
|
|
|
|
/***/ }),
|
|
/* 19 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export (immutable) */ __webpack_exports__["a"] = _inheritsLoose;
|
|
function _inheritsLoose(subClass, superClass) {
|
|
subClass.prototype = Object.create(superClass.prototype);
|
|
subClass.prototype.constructor = subClass;
|
|
subClass.__proto__ = superClass;
|
|
}
|
|
|
|
/***/ }),
|
|
/* 20 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(31);
|
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
|
|
|
|
|
|
var createSelectors = function createSelectors(structure) {
|
|
var getIn = structure.getIn,
|
|
toJS = structure.toJS;
|
|
|
|
var isRouter = function isRouter(value) {
|
|
return value != null && _typeof(value) === 'object' && getIn(value, ['location']) && getIn(value, ['action']);
|
|
};
|
|
|
|
var getRouter = function getRouter(state) {
|
|
var router = toJS(getIn(state, ['router']));
|
|
|
|
if (!isRouter(router)) {
|
|
throw 'Could not find router reducer in state tree, it must be mounted under "router"';
|
|
}
|
|
|
|
return router;
|
|
};
|
|
|
|
var getLocation = function getLocation(state) {
|
|
return toJS(getIn(getRouter(state), ['location']));
|
|
};
|
|
|
|
var getAction = function getAction(state) {
|
|
return toJS(getIn(getRouter(state), ['action']));
|
|
};
|
|
|
|
var getSearch = function getSearch(state) {
|
|
return toJS(getIn(getRouter(state), ['location', 'search']));
|
|
};
|
|
|
|
var getHash = function getHash(state) {
|
|
return toJS(getIn(getRouter(state), ['location', 'hash']));
|
|
}; // It only makes sense to recalculate the `matchPath` whenever the pathname
|
|
// of the location changes. That's why `createMatchSelector` memoizes
|
|
// the latest result based on the location's pathname.
|
|
|
|
|
|
var createMatchSelector = function createMatchSelector(path) {
|
|
var lastPathname = null;
|
|
var lastMatch = null;
|
|
return function (state) {
|
|
var _ref = getLocation(state) || {},
|
|
pathname = _ref.pathname;
|
|
|
|
if (pathname === lastPathname) {
|
|
return lastMatch;
|
|
}
|
|
|
|
lastPathname = pathname;
|
|
var match = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_react_router__["a" /* matchPath */])(pathname, path);
|
|
|
|
if (!match || !lastMatch || match.url !== lastMatch.url) {
|
|
lastMatch = match;
|
|
}
|
|
|
|
return lastMatch;
|
|
};
|
|
};
|
|
|
|
return {
|
|
getLocation: getLocation,
|
|
getAction: getAction,
|
|
getRouter: getRouter,
|
|
getSearch: getSearch,
|
|
getHash: getHash,
|
|
createMatchSelector: createMatchSelector
|
|
};
|
|
};
|
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (createSelectors);
|
|
|
|
/***/ }),
|
|
/* 21 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return canUseDOM; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return addEventListener; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return removeEventListener; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getConfirmation; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return supportsHistory; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return supportsPopStateOnHashChange; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return supportsGoWithoutReloadUsingHash; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return isExtraneousPopstateEvent; });
|
|
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
|
|
var addEventListener = function addEventListener(node, event, listener) {
|
|
return node.addEventListener ? node.addEventListener(event, listener, false) : node.attachEvent('on' + event, listener);
|
|
};
|
|
|
|
var removeEventListener = function removeEventListener(node, event, listener) {
|
|
return node.removeEventListener ? node.removeEventListener(event, listener, false) : node.detachEvent('on' + event, listener);
|
|
};
|
|
|
|
var getConfirmation = function getConfirmation(message, callback) {
|
|
return callback(window.confirm(message));
|
|
}; // eslint-disable-line no-alert
|
|
|
|
/**
|
|
* Returns true if the HTML5 history API is supported. Taken from Modernizr.
|
|
*
|
|
* https://github.com/Modernizr/Modernizr/blob/master/LICENSE
|
|
* https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
|
|
* changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
|
|
*/
|
|
var supportsHistory = function supportsHistory() {
|
|
var ua = window.navigator.userAgent;
|
|
|
|
if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
|
|
|
|
return window.history && 'pushState' in window.history;
|
|
};
|
|
|
|
/**
|
|
* Returns true if browser fires popstate on hash change.
|
|
* IE10 and IE11 do not.
|
|
*/
|
|
var supportsPopStateOnHashChange = function supportsPopStateOnHashChange() {
|
|
return window.navigator.userAgent.indexOf('Trident') === -1;
|
|
};
|
|
|
|
/**
|
|
* Returns false if using go(n) with hash history causes a full page reload.
|
|
*/
|
|
var supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() {
|
|
return window.navigator.userAgent.indexOf('Firefox') === -1;
|
|
};
|
|
|
|
/**
|
|
* Returns true if a given popstate event is an extraneous WebKit event.
|
|
* Accounts for the fact that Chrome on iOS fires real popstate events
|
|
* containing undefined state when pressing the back button.
|
|
*/
|
|
var isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) {
|
|
return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
|
|
};
|
|
|
|
/***/ }),
|
|
/* 22 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var isarray = __webpack_require__(42)
|
|
|
|
/**
|
|
* Expose `pathToRegexp`.
|
|
*/
|
|
module.exports = pathToRegexp
|
|
module.exports.parse = parse
|
|
module.exports.compile = compile
|
|
module.exports.tokensToFunction = tokensToFunction
|
|
module.exports.tokensToRegExp = tokensToRegExp
|
|
|
|
/**
|
|
* The main path matching regexp utility.
|
|
*
|
|
* @type {RegExp}
|
|
*/
|
|
var PATH_REGEXP = new RegExp([
|
|
// Match escaped characters that would otherwise appear in future matches.
|
|
// This allows the user to escape special characters that won't transform.
|
|
'(\\\\.)',
|
|
// Match Express-style parameters and un-named parameters with a prefix
|
|
// and optional suffixes. Matches appear as:
|
|
//
|
|
// "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
|
|
// "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
|
|
// "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
|
|
'([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
|
|
].join('|'), 'g')
|
|
|
|
/**
|
|
* Parse a string for the raw tokens.
|
|
*
|
|
* @param {string} str
|
|
* @param {Object=} options
|
|
* @return {!Array}
|
|
*/
|
|
function parse (str, options) {
|
|
var tokens = []
|
|
var key = 0
|
|
var index = 0
|
|
var path = ''
|
|
var defaultDelimiter = options && options.delimiter || '/'
|
|
var res
|
|
|
|
while ((res = PATH_REGEXP.exec(str)) != null) {
|
|
var m = res[0]
|
|
var escaped = res[1]
|
|
var offset = res.index
|
|
path += str.slice(index, offset)
|
|
index = offset + m.length
|
|
|
|
// Ignore already escaped sequences.
|
|
if (escaped) {
|
|
path += escaped[1]
|
|
continue
|
|
}
|
|
|
|
var next = str[index]
|
|
var prefix = res[2]
|
|
var name = res[3]
|
|
var capture = res[4]
|
|
var group = res[5]
|
|
var modifier = res[6]
|
|
var asterisk = res[7]
|
|
|
|
// Push the current path onto the tokens.
|
|
if (path) {
|
|
tokens.push(path)
|
|
path = ''
|
|
}
|
|
|
|
var partial = prefix != null && next != null && next !== prefix
|
|
var repeat = modifier === '+' || modifier === '*'
|
|
var optional = modifier === '?' || modifier === '*'
|
|
var delimiter = res[2] || defaultDelimiter
|
|
var pattern = capture || group
|
|
|
|
tokens.push({
|
|
name: name || key++,
|
|
prefix: prefix || '',
|
|
delimiter: delimiter,
|
|
optional: optional,
|
|
repeat: repeat,
|
|
partial: partial,
|
|
asterisk: !!asterisk,
|
|
pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
|
|
})
|
|
}
|
|
|
|
// Match any characters still remaining.
|
|
if (index < str.length) {
|
|
path += str.substr(index)
|
|
}
|
|
|
|
// If the path exists, push it onto the end.
|
|
if (path) {
|
|
tokens.push(path)
|
|
}
|
|
|
|
return tokens
|
|
}
|
|
|
|
/**
|
|
* Compile a string to a template function for the path.
|
|
*
|
|
* @param {string} str
|
|
* @param {Object=} options
|
|
* @return {!function(Object=, Object=)}
|
|
*/
|
|
function compile (str, options) {
|
|
return tokensToFunction(parse(str, options))
|
|
}
|
|
|
|
/**
|
|
* Prettier encoding of URI path segments.
|
|
*
|
|
* @param {string}
|
|
* @return {string}
|
|
*/
|
|
function encodeURIComponentPretty (str) {
|
|
return encodeURI(str).replace(/[\/?#]/g, function (c) {
|
|
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
|
|
})
|
|
}
|
|
|
|
/**
|
|
* Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
|
|
*
|
|
* @param {string}
|
|
* @return {string}
|
|
*/
|
|
function encodeAsterisk (str) {
|
|
return encodeURI(str).replace(/[?#]/g, function (c) {
|
|
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
|
|
})
|
|
}
|
|
|
|
/**
|
|
* Expose a method for transforming tokens into the path function.
|
|
*/
|
|
function tokensToFunction (tokens) {
|
|
// Compile all the tokens into regexps.
|
|
var matches = new Array(tokens.length)
|
|
|
|
// Compile all the patterns before compilation.
|
|
for (var i = 0; i < tokens.length; i++) {
|
|
if (typeof tokens[i] === 'object') {
|
|
matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')
|
|
}
|
|
}
|
|
|
|
return function (obj, opts) {
|
|
var path = ''
|
|
var data = obj || {}
|
|
var options = opts || {}
|
|
var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent
|
|
|
|
for (var i = 0; i < tokens.length; i++) {
|
|
var token = tokens[i]
|
|
|
|
if (typeof token === 'string') {
|
|
path += token
|
|
|
|
continue
|
|
}
|
|
|
|
var value = data[token.name]
|
|
var segment
|
|
|
|
if (value == null) {
|
|
if (token.optional) {
|
|
// Prepend partial segment prefixes.
|
|
if (token.partial) {
|
|
path += token.prefix
|
|
}
|
|
|
|
continue
|
|
} else {
|
|
throw new TypeError('Expected "' + token.name + '" to be defined')
|
|
}
|
|
}
|
|
|
|
if (isarray(value)) {
|
|
if (!token.repeat) {
|
|
throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
|
|
}
|
|
|
|
if (value.length === 0) {
|
|
if (token.optional) {
|
|
continue
|
|
} else {
|
|
throw new TypeError('Expected "' + token.name + '" to not be empty')
|
|
}
|
|
}
|
|
|
|
for (var j = 0; j < value.length; j++) {
|
|
segment = encode(value[j])
|
|
|
|
if (!matches[i].test(segment)) {
|
|
throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
|
|
}
|
|
|
|
path += (j === 0 ? token.prefix : token.delimiter) + segment
|
|
}
|
|
|
|
continue
|
|
}
|
|
|
|
segment = token.asterisk ? encodeAsterisk(value) : encode(value)
|
|
|
|
if (!matches[i].test(segment)) {
|
|
throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
|
|
}
|
|
|
|
path += token.prefix + segment
|
|
}
|
|
|
|
return path
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Escape a regular expression string.
|
|
*
|
|
* @param {string} str
|
|
* @return {string}
|
|
*/
|
|
function escapeString (str) {
|
|
return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
|
|
}
|
|
|
|
/**
|
|
* Escape the capturing group by escaping special characters and meaning.
|
|
*
|
|
* @param {string} group
|
|
* @return {string}
|
|
*/
|
|
function escapeGroup (group) {
|
|
return group.replace(/([=!:$\/()])/g, '\\$1')
|
|
}
|
|
|
|
/**
|
|
* Attach the keys as a property of the regexp.
|
|
*
|
|
* @param {!RegExp} re
|
|
* @param {Array} keys
|
|
* @return {!RegExp}
|
|
*/
|
|
function attachKeys (re, keys) {
|
|
re.keys = keys
|
|
return re
|
|
}
|
|
|
|
/**
|
|
* Get the flags for a regexp from the options.
|
|
*
|
|
* @param {Object} options
|
|
* @return {string}
|
|
*/
|
|
function flags (options) {
|
|
return options.sensitive ? '' : 'i'
|
|
}
|
|
|
|
/**
|
|
* Pull out keys from a regexp.
|
|
*
|
|
* @param {!RegExp} path
|
|
* @param {!Array} keys
|
|
* @return {!RegExp}
|
|
*/
|
|
function regexpToRegexp (path, keys) {
|
|
// Use a negative lookahead to match only capturing groups.
|
|
var groups = path.source.match(/\((?!\?)/g)
|
|
|
|
if (groups) {
|
|
for (var i = 0; i < groups.length; i++) {
|
|
keys.push({
|
|
name: i,
|
|
prefix: null,
|
|
delimiter: null,
|
|
optional: false,
|
|
repeat: false,
|
|
partial: false,
|
|
asterisk: false,
|
|
pattern: null
|
|
})
|
|
}
|
|
}
|
|
|
|
return attachKeys(path, keys)
|
|
}
|
|
|
|
/**
|
|
* Transform an array into a regexp.
|
|
*
|
|
* @param {!Array} path
|
|
* @param {Array} keys
|
|
* @param {!Object} options
|
|
* @return {!RegExp}
|
|
*/
|
|
function arrayToRegexp (path, keys, options) {
|
|
var parts = []
|
|
|
|
for (var i = 0; i < path.length; i++) {
|
|
parts.push(pathToRegexp(path[i], keys, options).source)
|
|
}
|
|
|
|
var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))
|
|
|
|
return attachKeys(regexp, keys)
|
|
}
|
|
|
|
/**
|
|
* Create a path regexp from string input.
|
|
*
|
|
* @param {string} path
|
|
* @param {!Array} keys
|
|
* @param {!Object} options
|
|
* @return {!RegExp}
|
|
*/
|
|
function stringToRegexp (path, keys, options) {
|
|
return tokensToRegExp(parse(path, options), keys, options)
|
|
}
|
|
|
|
/**
|
|
* Expose a function for taking tokens and returning a RegExp.
|
|
*
|
|
* @param {!Array} tokens
|
|
* @param {(Array|Object)=} keys
|
|
* @param {Object=} options
|
|
* @return {!RegExp}
|
|
*/
|
|
function tokensToRegExp (tokens, keys, options) {
|
|
if (!isarray(keys)) {
|
|
options = /** @type {!Object} */ (keys || options)
|
|
keys = []
|
|
}
|
|
|
|
options = options || {}
|
|
|
|
var strict = options.strict
|
|
var end = options.end !== false
|
|
var route = ''
|
|
|
|
// Iterate over the tokens and create our regexp string.
|
|
for (var i = 0; i < tokens.length; i++) {
|
|
var token = tokens[i]
|
|
|
|
if (typeof token === 'string') {
|
|
route += escapeString(token)
|
|
} else {
|
|
var prefix = escapeString(token.prefix)
|
|
var capture = '(?:' + token.pattern + ')'
|
|
|
|
keys.push(token)
|
|
|
|
if (token.repeat) {
|
|
capture += '(?:' + prefix + capture + ')*'
|
|
}
|
|
|
|
if (token.optional) {
|
|
if (!token.partial) {
|
|
capture = '(?:' + prefix + '(' + capture + '))?'
|
|
} else {
|
|
capture = prefix + '(' + capture + ')?'
|
|
}
|
|
} else {
|
|
capture = prefix + '(' + capture + ')'
|
|
}
|
|
|
|
route += capture
|
|
}
|
|
}
|
|
|
|
var delimiter = escapeString(options.delimiter || '/')
|
|
var endsWithDelimiter = route.slice(-delimiter.length) === delimiter
|
|
|
|
// In non-strict mode we allow a slash at the end of match. If the path to
|
|
// match already ends with a slash, we remove it for consistency. The slash
|
|
// is valid at the end of a path match, not in the middle. This is important
|
|
// in non-ending mode, where "/test/" shouldn't match "/test//route".
|
|
if (!strict) {
|
|
route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'
|
|
}
|
|
|
|
if (end) {
|
|
route += '$'
|
|
} else {
|
|
// In non-ending mode, we need the capturing groups to match as much as
|
|
// possible by using a positive lookahead to the end or next path segment.
|
|
route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'
|
|
}
|
|
|
|
return attachKeys(new RegExp('^' + route, flags(options)), keys)
|
|
}
|
|
|
|
/**
|
|
* Normalize the given path string, returning a regular expression.
|
|
*
|
|
* An empty array can be passed in for the keys, which will hold the
|
|
* placeholder key descriptions. For example, using `/user/:id`, `keys` will
|
|
* contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
|
|
*
|
|
* @param {(string|RegExp|Array)} path
|
|
* @param {(Array|Object)=} keys
|
|
* @param {Object=} options
|
|
* @return {!RegExp}
|
|
*/
|
|
function pathToRegexp (path, keys, options) {
|
|
if (!isarray(keys)) {
|
|
options = /** @type {!Object} */ (keys || options)
|
|
keys = []
|
|
}
|
|
|
|
options = options || {}
|
|
|
|
if (path instanceof RegExp) {
|
|
return regexpToRegexp(path, /** @type {!Array} */ (keys))
|
|
}
|
|
|
|
if (isarray(path)) {
|
|
return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
|
|
}
|
|
|
|
return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
/* 23 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* 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 printWarning = function() {};
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var ReactPropTypesSecret = __webpack_require__(15);
|
|
var loggedTypeFailures = {};
|
|
|
|
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) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
for (var typeSpecName in typeSpecs) {
|
|
if (typeSpecs.hasOwnProperty(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);
|
|
} 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 : '')
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = checkPropTypes;
|
|
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
|
|
|
|
/***/ }),
|
|
/* 24 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* WEBPACK VAR INJECTION */(function(process) {
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
module.exports = __webpack_require__(46);
|
|
} else {
|
|
module.exports = __webpack_require__(45);
|
|
}
|
|
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
|
|
|
|
/***/ }),
|
|
/* 25 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = connectAdvanced;
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_inheritsLoose__ = __webpack_require__(19);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(32);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_extends__ = __webpack_require__(10);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_objectWithoutPropertiesLoose__ = __webpack_require__(11);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_hoist_non_react_statics__ = __webpack_require__(57);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_hoist_non_react_statics__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_invariant__ = __webpack_require__(3);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_invariant__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(1);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react_is__ = __webpack_require__(24);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react_is___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react_is__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__Context__ = __webpack_require__(16);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function connectAdvanced(
|
|
/*
|
|
selectorFactory is a func that is responsible for returning the selector function used to
|
|
compute new props from state, props, and dispatch. For example:
|
|
export default connectAdvanced((dispatch, options) => (state, props) => ({
|
|
thing: state.things[props.thingId],
|
|
saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),
|
|
}))(YourComponent)
|
|
Access to dispatch is provided to the factory so selectorFactories can bind actionCreators
|
|
outside of their selector as an optimization. Options passed to connectAdvanced are passed to
|
|
the selectorFactory, along with displayName and WrappedComponent, as the second argument.
|
|
Note that selectorFactory is responsible for all caching/memoization of inbound and outbound
|
|
props. Do not use connectAdvanced directly without memoizing results between calls to your
|
|
selector, otherwise the Connect component will re-render on every state or props change.
|
|
*/
|
|
selectorFactory, // options object:
|
|
_ref) {
|
|
if (_ref === void 0) {
|
|
_ref = {};
|
|
}
|
|
var _ref2 = _ref,
|
|
_ref2$getDisplayName = _ref2.getDisplayName,
|
|
getDisplayName = _ref2$getDisplayName === void 0 ? function (name) {
|
|
return "ConnectAdvanced(" + name + ")";
|
|
} : _ref2$getDisplayName,
|
|
_ref2$methodName = _ref2.methodName,
|
|
methodName = _ref2$methodName === void 0 ? 'connectAdvanced' : _ref2$methodName,
|
|
_ref2$renderCountProp = _ref2.renderCountProp,
|
|
renderCountProp = _ref2$renderCountProp === void 0 ? undefined : _ref2$renderCountProp,
|
|
_ref2$shouldHandleSta = _ref2.shouldHandleStateChanges,
|
|
shouldHandleStateChanges = _ref2$shouldHandleSta === void 0 ? true : _ref2$shouldHandleSta,
|
|
_ref2$storeKey = _ref2.storeKey,
|
|
storeKey = _ref2$storeKey === void 0 ? 'store' : _ref2$storeKey,
|
|
_ref2$withRef = _ref2.withRef,
|
|
withRef = _ref2$withRef === void 0 ? false : _ref2$withRef,
|
|
_ref2$forwardRef = _ref2.forwardRef,
|
|
forwardRef = _ref2$forwardRef === void 0 ? false : _ref2$forwardRef,
|
|
_ref2$context = _ref2.context,
|
|
context = _ref2$context === void 0 ? __WEBPACK_IMPORTED_MODULE_8__Context__["a" /* ReactReduxContext */] : _ref2$context,
|
|
connectOptions = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_objectWithoutPropertiesLoose__["a" /* default */])(_ref2, ["getDisplayName", "methodName", "renderCountProp", "shouldHandleStateChanges", "storeKey", "withRef", "forwardRef", "context"]);
|
|
|
|
__WEBPACK_IMPORTED_MODULE_5_invariant___default()(renderCountProp === undefined, "renderCountProp is removed. render counting is built into the latest React dev tools profiling extension");
|
|
__WEBPACK_IMPORTED_MODULE_5_invariant___default()(!withRef, 'withRef is removed. To access the wrapped instance, use a ref on the connected component');
|
|
var customStoreWarningMessage = 'To use a custom Redux store for specific components, create a custom React context with ' + "React.createContext(), and pass the context object to React-Redux's Provider and specific components" + ' like: <Provider context={MyContext}><ConnectedComponent context={MyContext} /></Provider>. ' + 'You may also pass a {context : MyContext} option to connect';
|
|
__WEBPACK_IMPORTED_MODULE_5_invariant___default()(storeKey === 'store', 'storeKey has been removed and does not do anything. ' + customStoreWarningMessage);
|
|
var Context = context;
|
|
return function wrapWithConnect(WrappedComponent) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
__WEBPACK_IMPORTED_MODULE_5_invariant___default()(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_react_is__["isValidElementType"])(WrappedComponent), "You must pass a component to the function returned by " + (methodName + ". Instead received " + JSON.stringify(WrappedComponent)));
|
|
}
|
|
|
|
var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
var displayName = getDisplayName(wrappedComponentName);
|
|
|
|
var selectorFactoryOptions = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_extends__["a" /* default */])({}, connectOptions, {
|
|
getDisplayName: getDisplayName,
|
|
methodName: methodName,
|
|
renderCountProp: renderCountProp,
|
|
shouldHandleStateChanges: shouldHandleStateChanges,
|
|
storeKey: storeKey,
|
|
displayName: displayName,
|
|
wrappedComponentName: wrappedComponentName,
|
|
WrappedComponent: WrappedComponent
|
|
});
|
|
|
|
var pure = connectOptions.pure;
|
|
var OuterBaseComponent = __WEBPACK_IMPORTED_MODULE_6_react__["Component"];
|
|
var FinalWrappedComponent = WrappedComponent;
|
|
|
|
if (pure) {
|
|
OuterBaseComponent = __WEBPACK_IMPORTED_MODULE_6_react__["PureComponent"];
|
|
}
|
|
|
|
function makeDerivedPropsSelector() {
|
|
var lastProps;
|
|
var lastState;
|
|
var lastDerivedProps;
|
|
var lastStore;
|
|
var sourceSelector;
|
|
return function selectDerivedProps(state, props, store) {
|
|
if (pure && lastProps === props && lastState === state) {
|
|
return lastDerivedProps;
|
|
}
|
|
|
|
if (store !== lastStore) {
|
|
lastStore = store;
|
|
sourceSelector = selectorFactory(store.dispatch, selectorFactoryOptions);
|
|
}
|
|
|
|
lastProps = props;
|
|
lastState = state;
|
|
var nextProps = sourceSelector(state, props);
|
|
|
|
if (lastDerivedProps === nextProps) {
|
|
return lastDerivedProps;
|
|
}
|
|
|
|
lastDerivedProps = nextProps;
|
|
return lastDerivedProps;
|
|
};
|
|
}
|
|
|
|
function makeChildElementSelector() {
|
|
var lastChildProps, lastForwardRef, lastChildElement;
|
|
return function selectChildElement(childProps, forwardRef) {
|
|
if (childProps !== lastChildProps || forwardRef !== lastForwardRef) {
|
|
lastChildProps = childProps;
|
|
lastForwardRef = forwardRef;
|
|
lastChildElement = __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(FinalWrappedComponent, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_extends__["a" /* default */])({}, childProps, {
|
|
ref: forwardRef
|
|
}));
|
|
}
|
|
|
|
return lastChildElement;
|
|
};
|
|
}
|
|
|
|
var Connect =
|
|
/*#__PURE__*/
|
|
function (_OuterBaseComponent) {
|
|
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_inheritsLoose__["a" /* default */])(Connect, _OuterBaseComponent);
|
|
|
|
function Connect(props) {
|
|
var _this;
|
|
|
|
_this = _OuterBaseComponent.call(this, props) || this;
|
|
__WEBPACK_IMPORTED_MODULE_5_invariant___default()(forwardRef ? !props.wrapperProps[storeKey] : !props[storeKey], 'Passing redux store in props has been removed and does not do anything. ' + customStoreWarningMessage);
|
|
_this.selectDerivedProps = makeDerivedPropsSelector();
|
|
_this.selectChildElement = makeChildElementSelector();
|
|
_this.renderWrappedComponent = _this.renderWrappedComponent.bind(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
|
|
return _this;
|
|
}
|
|
|
|
var _proto = Connect.prototype;
|
|
|
|
_proto.renderWrappedComponent = function renderWrappedComponent(value) {
|
|
__WEBPACK_IMPORTED_MODULE_5_invariant___default()(value, "Could not find \"store\" in the context of " + ("\"" + displayName + "\". Either wrap the root component in a <Provider>, ") + "or pass a custom React context provider to <Provider> and the corresponding " + ("React context consumer to " + displayName + " in connect options."));
|
|
var storeState = value.storeState,
|
|
store = value.store;
|
|
var wrapperProps = this.props;
|
|
var forwardedRef;
|
|
|
|
if (forwardRef) {
|
|
wrapperProps = this.props.wrapperProps;
|
|
forwardedRef = this.props.forwardedRef;
|
|
}
|
|
|
|
var derivedProps = this.selectDerivedProps(storeState, wrapperProps, store);
|
|
|
|
if (pure) {
|
|
return this.selectChildElement(derivedProps, forwardedRef);
|
|
}
|
|
|
|
return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(FinalWrappedComponent, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_extends__["a" /* default */])({}, derivedProps, {
|
|
ref: forwardedRef
|
|
}));
|
|
};
|
|
|
|
_proto.render = function render() {
|
|
var ContextToUse = this.props.context || Context;
|
|
return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(ContextToUse.Consumer, null, this.renderWrappedComponent);
|
|
};
|
|
|
|
return Connect;
|
|
}(OuterBaseComponent);
|
|
|
|
Connect.WrappedComponent = WrappedComponent;
|
|
Connect.displayName = displayName;
|
|
|
|
if (forwardRef) {
|
|
var forwarded = __WEBPACK_IMPORTED_MODULE_6_react___default.a.forwardRef(function forwardConnectRef(props, ref) {
|
|
return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(Connect, {
|
|
wrapperProps: props,
|
|
forwardedRef: ref
|
|
});
|
|
});
|
|
forwarded.displayName = displayName;
|
|
forwarded.WrappedComponent = WrappedComponent;
|
|
return __WEBPACK_IMPORTED_MODULE_4_hoist_non_react_statics___default()(forwarded, WrappedComponent);
|
|
}
|
|
|
|
return __WEBPACK_IMPORTED_MODULE_4_hoist_non_react_statics___default()(Connect, WrappedComponent);
|
|
};
|
|
}
|
|
|
|
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0)))
|
|
|
|
/***/ }),
|
|
/* 26 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["b"] = wrapMapToPropsConstant;
|
|
/* unused harmony export getDependsOnOwnProps */
|
|
/* harmony export (immutable) */ __webpack_exports__["a"] = wrapMapToPropsFunc;
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(27);
|
|
|
|
function wrapMapToPropsConstant(getConstant) {
|
|
return function initConstantSelector(dispatch, options) {
|
|
var constant = getConstant(dispatch, options);
|
|
|
|
function constantSelector() {
|
|
return constant;
|
|
}
|
|
|
|
constantSelector.dependsOnOwnProps = false;
|
|
return constantSelector;
|
|
};
|
|
} // dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args
|
|
// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine
|
|
// whether mapToProps needs to be invoked when props have changed.
|
|
//
|
|
// A length of one signals that mapToProps does not depend on props from the parent component.
|
|
// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and
|
|
// therefore not reporting its length accurately..
|
|
|
|
function getDependsOnOwnProps(mapToProps) {
|
|
return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;
|
|
} // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,
|
|
// this function wraps mapToProps in a proxy function which does several things:
|
|
//
|
|
// * Detects whether the mapToProps function being called depends on props, which
|
|
// is used by selectorFactory to decide if it should reinvoke on props changes.
|
|
//
|
|
// * On first call, handles mapToProps if returns another function, and treats that
|
|
// new function as the true mapToProps for subsequent calls.
|
|
//
|
|
// * On first call, verifies the first result is a plain object, in order to warn
|
|
// the developer that their mapToProps function is not returning a valid result.
|
|
//
|
|
|
|
function wrapMapToPropsFunc(mapToProps, methodName) {
|
|
return function initProxySelector(dispatch, _ref) {
|
|
var displayName = _ref.displayName;
|
|
|
|
var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {
|
|
return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);
|
|
}; // allow detectFactoryAndVerify to get ownProps
|
|
|
|
|
|
proxy.dependsOnOwnProps = true;
|
|
|
|
proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {
|
|
proxy.mapToProps = mapToProps;
|
|
proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);
|
|
var props = proxy(stateOrDispatch, ownProps);
|
|
|
|
if (typeof props === 'function') {
|
|
proxy.mapToProps = props;
|
|
proxy.dependsOnOwnProps = getDependsOnOwnProps(props);
|
|
props = proxy(stateOrDispatch, ownProps);
|
|
}
|
|
|
|
if (process.env.NODE_ENV !== 'production') __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__["a" /* default */])(props, displayName, methodName);
|
|
return props;
|
|
};
|
|
|
|
return proxy;
|
|
};
|
|
}
|
|
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0)))
|
|
|
|
/***/ }),
|
|
/* 27 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export (immutable) */ __webpack_exports__["a"] = verifyPlainObject;
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isPlainObject__ = __webpack_require__(55);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__warning__ = __webpack_require__(28);
|
|
|
|
|
|
function verifyPlainObject(value, displayName, methodName) {
|
|
if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isPlainObject__["a" /* default */])(value)) {
|
|
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__warning__["a" /* default */])(methodName + "() in " + displayName + " must return a plain object. Instead received " + value + ".");
|
|
}
|
|
}
|
|
|
|
/***/ }),
|
|
/* 28 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export (immutable) */ __webpack_exports__["a"] = warning;
|
|
/**
|
|
* Prints a warning in the console if it exists.
|
|
*
|
|
* @param {String} message The warning message.
|
|
* @returns {void}
|
|
*/
|
|
function warning(message) {
|
|
/* eslint-disable no-console */
|
|
if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
|
console.error(message);
|
|
}
|
|
/* eslint-enable no-console */
|
|
|
|
|
|
try {
|
|
// This error was thrown as a convenience so that if you enable
|
|
// "break on all exceptions" in your console,
|
|
// it would pause the execution at this line.
|
|
throw new Error(message);
|
|
/* eslint-disable no-empty */
|
|
} catch (e) {}
|
|
/* eslint-enable no-empty */
|
|
|
|
}
|
|
|
|
/***/ }),
|
|
/* 29 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(4);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(3);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(1);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(2);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__matchPath__ = __webpack_require__(18);
|
|
var _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; };
|
|
|
|
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 isEmptyChildren = function isEmptyChildren(children) {
|
|
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.count(children) === 0;
|
|
};
|
|
|
|
/**
|
|
* The public API for matching a single path and rendering.
|
|
*/
|
|
|
|
var Route = function (_React$Component) {
|
|
_inherits(Route, _React$Component);
|
|
|
|
function Route() {
|
|
var _temp, _this, _ret;
|
|
|
|
_classCallCheck(this, Route);
|
|
|
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
|
|
match: _this.computeMatch(_this.props, _this.context.router)
|
|
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
}
|
|
|
|
Route.prototype.getChildContext = function getChildContext() {
|
|
return {
|
|
router: _extends({}, this.context.router, {
|
|
route: {
|
|
location: this.props.location || this.context.router.route.location,
|
|
match: this.state.match
|
|
}
|
|
})
|
|
};
|
|
};
|
|
|
|
Route.prototype.computeMatch = function computeMatch(_ref, router) {
|
|
var computedMatch = _ref.computedMatch,
|
|
location = _ref.location,
|
|
path = _ref.path,
|
|
strict = _ref.strict,
|
|
exact = _ref.exact,
|
|
sensitive = _ref.sensitive;
|
|
|
|
if (computedMatch) return computedMatch; // <Switch> already computed the match for us
|
|
|
|
__WEBPACK_IMPORTED_MODULE_1_invariant___default()(router, "You should not use <Route> or withRouter() outside a <Router>");
|
|
|
|
var route = router.route;
|
|
|
|
var pathname = (location || route.location).pathname;
|
|
|
|
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__matchPath__["a" /* default */])(pathname, { path: path, strict: strict, exact: exact, sensitive: sensitive }, route.match);
|
|
};
|
|
|
|
Route.prototype.componentWillMount = function componentWillMount() {
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(!(this.props.component && this.props.render), "You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored");
|
|
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(!(this.props.component && this.props.children && !isEmptyChildren(this.props.children)), "You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored");
|
|
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(!(this.props.render && this.props.children && !isEmptyChildren(this.props.children)), "You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored");
|
|
};
|
|
|
|
Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) {
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(!(nextProps.location && !this.props.location), '<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.');
|
|
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(!(!nextProps.location && this.props.location), '<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.');
|
|
|
|
this.setState({
|
|
match: this.computeMatch(nextProps, nextContext.router)
|
|
});
|
|
};
|
|
|
|
Route.prototype.render = function render() {
|
|
var match = this.state.match;
|
|
var _props = this.props,
|
|
children = _props.children,
|
|
component = _props.component,
|
|
render = _props.render;
|
|
var _context$router = this.context.router,
|
|
history = _context$router.history,
|
|
route = _context$router.route,
|
|
staticContext = _context$router.staticContext;
|
|
|
|
var location = this.props.location || route.location;
|
|
var props = { match: match, location: location, history: history, staticContext: staticContext };
|
|
|
|
if (component) return match ? __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(component, props) : null;
|
|
|
|
if (render) return match ? render(props) : null;
|
|
|
|
if (typeof children === "function") return children(props);
|
|
|
|
if (children && !isEmptyChildren(children)) return __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.only(children);
|
|
|
|
return null;
|
|
};
|
|
|
|
return Route;
|
|
}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);
|
|
|
|
Route.propTypes = {
|
|
computedMatch: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object, // private, from <Switch>
|
|
path: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string,
|
|
exact: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
|
|
strict: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
|
|
sensitive: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
|
|
component: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func,
|
|
render: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func,
|
|
children: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node]),
|
|
location: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object
|
|
};
|
|
Route.contextTypes = {
|
|
router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.shape({
|
|
history: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,
|
|
route: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,
|
|
staticContext: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object
|
|
})
|
|
};
|
|
Route.childContextTypes = {
|
|
router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired
|
|
};
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (Route);
|
|
|
|
/***/ }),
|
|
/* 30 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp__ = __webpack_require__(22);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_path_to_regexp__);
|
|
|
|
|
|
var patternCache = {};
|
|
var cacheLimit = 10000;
|
|
var cacheCount = 0;
|
|
|
|
var compileGenerator = function compileGenerator(pattern) {
|
|
var cacheKey = pattern;
|
|
var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});
|
|
|
|
if (cache[pattern]) return cache[pattern];
|
|
|
|
var compiledGenerator = __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default.a.compile(pattern);
|
|
|
|
if (cacheCount < cacheLimit) {
|
|
cache[pattern] = compiledGenerator;
|
|
cacheCount++;
|
|
}
|
|
|
|
return compiledGenerator;
|
|
};
|
|
|
|
/**
|
|
* Public API for generating a URL pathname from a pattern and parameters.
|
|
*/
|
|
var generatePath = function generatePath() {
|
|
var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "/";
|
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
|
|
if (pattern === "/") {
|
|
return pattern;
|
|
}
|
|
var generator = compileGenerator(pattern);
|
|
return generator(params, { pretty: true });
|
|
};
|
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (generatePath);
|
|
|
|
/***/ }),
|
|
/* 31 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__MemoryRouter__ = __webpack_require__(58);
|
|
/* unused harmony reexport MemoryRouter */
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Prompt__ = __webpack_require__(59);
|
|
/* unused harmony reexport Prompt */
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Redirect__ = __webpack_require__(60);
|
|
/* unused harmony reexport Redirect */
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Route__ = __webpack_require__(29);
|
|
/* unused harmony reexport Route */
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Router__ = __webpack_require__(17);
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_4__Router__["a"]; });
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__StaticRouter__ = __webpack_require__(61);
|
|
/* unused harmony reexport StaticRouter */
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__Switch__ = __webpack_require__(62);
|
|
/* unused harmony reexport Switch */
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__generatePath__ = __webpack_require__(30);
|
|
/* unused harmony reexport generatePath */
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__matchPath__ = __webpack_require__(18);
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_8__matchPath__["a"]; });
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__withRouter__ = __webpack_require__(63);
|
|
/* unused harmony reexport withRouter */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
/* 32 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export (immutable) */ __webpack_exports__["a"] = _assertThisInitialized;
|
|
function _assertThisInitialized(self) {
|
|
if (self === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
|
|
return self;
|
|
}
|
|
|
|
/***/ }),
|
|
/* 33 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(2);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_redux__ = __webpack_require__(54);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_router__ = __webpack_require__(31);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__actions__ = __webpack_require__(6);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__selectors__ = __webpack_require__(20);
|
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
|
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var createConnectedRouter = function createConnectedRouter(structure) {
|
|
var _createSelectors = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__selectors__["a" /* default */])(structure),
|
|
getLocation = _createSelectors.getLocation;
|
|
/*
|
|
* ConnectedRouter listens to a history object passed from props.
|
|
* When history is changed, it dispatches action to redux store.
|
|
* Then, store will pass props to component to render.
|
|
* This creates uni-directional flow from history->store->router->components.
|
|
*/
|
|
|
|
|
|
var ConnectedRouter =
|
|
/*#__PURE__*/
|
|
function (_PureComponent) {
|
|
_inherits(ConnectedRouter, _PureComponent);
|
|
|
|
function ConnectedRouter(props) {
|
|
var _this;
|
|
|
|
_classCallCheck(this, ConnectedRouter);
|
|
|
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(ConnectedRouter).call(this, props));
|
|
var store = props.store,
|
|
history = props.history,
|
|
onLocationChanged = props.onLocationChanged;
|
|
_this.inTimeTravelling = false; // Subscribe to store changes to check if we are in time travelling
|
|
|
|
_this.unsubscribe = store.subscribe(function () {
|
|
// Extract store's location
|
|
var _getLocation = getLocation(store.getState()),
|
|
pathnameInStore = _getLocation.pathname,
|
|
searchInStore = _getLocation.search,
|
|
hashInStore = _getLocation.hash; // Extract history's location
|
|
|
|
|
|
var _history$location = history.location,
|
|
pathnameInHistory = _history$location.pathname,
|
|
searchInHistory = _history$location.search,
|
|
hashInHistory = _history$location.hash; // If we do time travelling, the location in store is changed but location in history is not changed
|
|
|
|
if (pathnameInHistory !== pathnameInStore || searchInHistory !== searchInStore || hashInHistory !== hashInStore) {
|
|
_this.inTimeTravelling = true; // Update history's location to match store's location
|
|
|
|
history.push({
|
|
pathname: pathnameInStore,
|
|
search: searchInStore,
|
|
hash: hashInStore
|
|
});
|
|
}
|
|
});
|
|
|
|
var handleLocationChange = function handleLocationChange(location, action) {
|
|
var isFirstRendering = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
|
|
// Dispatch onLocationChanged except when we're in time travelling
|
|
if (!_this.inTimeTravelling) {
|
|
onLocationChanged(location, action, isFirstRendering);
|
|
} else {
|
|
_this.inTimeTravelling = false;
|
|
}
|
|
}; // Listen to history changes
|
|
|
|
|
|
_this.unlisten = history.listen(handleLocationChange); // Dispatch a location change action for the initial location.
|
|
// This makes it backward-compatible with react-router-redux.
|
|
// But, we add `isFirstRendering` to `true` to prevent double-rendering.
|
|
|
|
handleLocationChange(history.location, history.action, true);
|
|
return _this;
|
|
}
|
|
|
|
_createClass(ConnectedRouter, [{
|
|
key: "componentWillUnmount",
|
|
value: function componentWillUnmount() {
|
|
this.unlisten();
|
|
this.unsubscribe();
|
|
}
|
|
}, {
|
|
key: "render",
|
|
value: function render() {
|
|
var _this$props = this.props,
|
|
history = _this$props.history,
|
|
children = _this$props.children;
|
|
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_react_router__["b" /* Router */], {
|
|
history: history
|
|
}, children);
|
|
}
|
|
}]);
|
|
|
|
return ConnectedRouter;
|
|
}(__WEBPACK_IMPORTED_MODULE_0_react__["PureComponent"]);
|
|
|
|
ConnectedRouter.propTypes = {
|
|
store: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
|
|
getState: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired,
|
|
subscribe: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired
|
|
}).isRequired,
|
|
history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
|
|
action: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string.isRequired,
|
|
listen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired,
|
|
location: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired,
|
|
push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired
|
|
}).isRequired,
|
|
basename: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
|
|
children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node]),
|
|
onLocationChanged: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired
|
|
};
|
|
|
|
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
return {
|
|
onLocationChanged: function onLocationChanged(location, action, isFirstRendering) {
|
|
return dispatch(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__actions__["c" /* onLocationChanged */])(location, action, isFirstRendering));
|
|
}
|
|
};
|
|
};
|
|
|
|
var ConnectedRouterWithContext = function ConnectedRouterWithContext(props) {
|
|
var Context = props.context || __WEBPACK_IMPORTED_MODULE_2_react_redux__["a" /* ReactReduxContext */];
|
|
|
|
if (Context == null) {
|
|
throw 'Please upgrade to react-redux v6';
|
|
}
|
|
|
|
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Context.Consumer, null, function (_ref) {
|
|
var store = _ref.store;
|
|
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(ConnectedRouter, _extends({
|
|
store: store
|
|
}, props));
|
|
});
|
|
};
|
|
|
|
ConnectedRouterWithContext.propTypes = {
|
|
context: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object
|
|
};
|
|
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_react_redux__["b" /* connect */])(null, mapDispatchToProps)(ConnectedRouterWithContext);
|
|
};
|
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (createConnectedRouter);
|
|
|
|
/***/ }),
|
|
/* 34 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__actions__ = __webpack_require__(6);
|
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
|
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
|
|
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
|
|
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
|
|
|
|
|
/**
|
|
* This middleware captures CALL_HISTORY_METHOD actions to redirect to the
|
|
* provided history object. This will prevent these actions from reaching your
|
|
* reducer or any middleware that comes after this one.
|
|
*/
|
|
|
|
var routerMiddleware = function routerMiddleware(history) {
|
|
return function (store) {
|
|
return function (next) {
|
|
return function (action) {
|
|
// eslint-disable-line no-unused-vars
|
|
if (action.type !== __WEBPACK_IMPORTED_MODULE_0__actions__["b" /* CALL_HISTORY_METHOD */]) {
|
|
return next(action);
|
|
}
|
|
|
|
var _action$payload = action.payload,
|
|
method = _action$payload.method,
|
|
args = _action$payload.args;
|
|
history[method].apply(history, _toConsumableArray(args));
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (routerMiddleware);
|
|
|
|
/***/ }),
|
|
/* 35 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__actions__ = __webpack_require__(6);
|
|
|
|
|
|
var createConnectRouter = function createConnectRouter(structure) {
|
|
var fromJS = structure.fromJS,
|
|
merge = structure.merge;
|
|
|
|
var createRouterReducer = function createRouterReducer(history) {
|
|
var initialRouterState = fromJS({
|
|
location: history.location,
|
|
action: history.action
|
|
});
|
|
/*
|
|
* This reducer will update the state with the most recent location history
|
|
* has transitioned to.
|
|
*/
|
|
|
|
return function () {
|
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialRouterState;
|
|
|
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
type = _ref.type,
|
|
payload = _ref.payload;
|
|
|
|
if (type === __WEBPACK_IMPORTED_MODULE_0__actions__["a" /* LOCATION_CHANGE */]) {
|
|
var location = payload.location,
|
|
action = payload.action,
|
|
isFirstRendering = payload.isFirstRendering; // Don't update the state ref for the first rendering
|
|
// to prevent the double-rendering issue on initilization
|
|
|
|
return isFirstRendering ? state : merge(state, {
|
|
location: fromJS(location),
|
|
action: action
|
|
});
|
|
}
|
|
|
|
return state;
|
|
};
|
|
};
|
|
|
|
return createRouterReducer;
|
|
};
|
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (createConnectRouter);
|
|
|
|
/***/ }),
|
|
/* 36 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* Code from github.com/erikras/redux-form by Erik Rasmussen */
|
|
var getIn = function getIn(state, path) {
|
|
if (!state) {
|
|
return state;
|
|
}
|
|
|
|
var length = path.length;
|
|
|
|
if (!length) {
|
|
return undefined;
|
|
}
|
|
|
|
var result = state;
|
|
|
|
for (var i = 0; i < length && !!result; ++i) {
|
|
result = result[path[i]];
|
|
}
|
|
|
|
return result;
|
|
};
|
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (getIn);
|
|
|
|
/***/ }),
|
|
/* 37 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getIn__ = __webpack_require__(36);
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
|
|
|
|
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; }
|
|
|
|
|
|
var structure = {
|
|
fromJS: function fromJS(value) {
|
|
return value;
|
|
},
|
|
getIn: __WEBPACK_IMPORTED_MODULE_0__getIn__["a" /* default */],
|
|
merge: function merge(state, payload) {
|
|
return _objectSpread({}, state, payload);
|
|
},
|
|
toJS: function toJS(value) {
|
|
return value;
|
|
}
|
|
};
|
|
/* harmony default export */ __webpack_exports__["a"] = (structure);
|
|
|
|
/***/ }),
|
|
/* 38 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(8);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(3);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__LocationUtils__ = __webpack_require__(7);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__PathUtils__ = __webpack_require__(5);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__createTransitionManager__ = __webpack_require__(12);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__DOMUtils__ = __webpack_require__(21);
|
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
|
|
var _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; };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var PopStateEvent = 'popstate';
|
|
var HashChangeEvent = 'hashchange';
|
|
|
|
var getHistoryState = function getHistoryState() {
|
|
try {
|
|
return window.history.state || {};
|
|
} catch (e) {
|
|
// IE 11 sometimes throws when accessing window.history.state
|
|
// See https://github.com/ReactTraining/history/pull/289
|
|
return {};
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Creates a history object that uses the HTML5 history API including
|
|
* pushState, replaceState, and the popstate event.
|
|
*/
|
|
var createBrowserHistory = function createBrowserHistory() {
|
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
|
|
__WEBPACK_IMPORTED_MODULE_1_invariant___default()(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["a" /* canUseDOM */], 'Browser history needs a DOM');
|
|
|
|
var globalHistory = window.history;
|
|
var canUseHistory = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["f" /* supportsHistory */])();
|
|
var needsHashChangeListener = !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["g" /* supportsPopStateOnHashChange */])();
|
|
|
|
var _props$forceRefresh = props.forceRefresh,
|
|
forceRefresh = _props$forceRefresh === undefined ? false : _props$forceRefresh,
|
|
_props$getUserConfirm = props.getUserConfirmation,
|
|
getUserConfirmation = _props$getUserConfirm === undefined ? __WEBPACK_IMPORTED_MODULE_5__DOMUtils__["c" /* getConfirmation */] : _props$getUserConfirm,
|
|
_props$keyLength = props.keyLength,
|
|
keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;
|
|
|
|
var basename = props.basename ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["e" /* stripTrailingSlash */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["d" /* addLeadingSlash */])(props.basename)) : '';
|
|
|
|
var getDOMLocation = function getDOMLocation(historyState) {
|
|
var _ref = historyState || {},
|
|
key = _ref.key,
|
|
state = _ref.state;
|
|
|
|
var _window$location = window.location,
|
|
pathname = _window$location.pathname,
|
|
search = _window$location.search,
|
|
hash = _window$location.hash;
|
|
|
|
|
|
var path = pathname + search + hash;
|
|
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(!basename || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["f" /* hasBasename */])(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".');
|
|
|
|
if (basename) path = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["g" /* stripBasename */])(path, basename);
|
|
|
|
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(path, state, key);
|
|
};
|
|
|
|
var createKey = function createKey() {
|
|
return Math.random().toString(36).substr(2, keyLength);
|
|
};
|
|
|
|
var transitionManager = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__createTransitionManager__["a" /* default */])();
|
|
|
|
var setState = function setState(nextState) {
|
|
_extends(history, nextState);
|
|
|
|
history.length = globalHistory.length;
|
|
|
|
transitionManager.notifyListeners(history.location, history.action);
|
|
};
|
|
|
|
var handlePopState = function handlePopState(event) {
|
|
// Ignore extraneous popstate events in WebKit.
|
|
if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["h" /* isExtraneousPopstateEvent */])(event)) return;
|
|
|
|
handlePop(getDOMLocation(event.state));
|
|
};
|
|
|
|
var handleHashChange = function handleHashChange() {
|
|
handlePop(getDOMLocation(getHistoryState()));
|
|
};
|
|
|
|
var forceNextPop = false;
|
|
|
|
var handlePop = function handlePop(location) {
|
|
if (forceNextPop) {
|
|
forceNextPop = false;
|
|
setState();
|
|
} else {
|
|
var action = 'POP';
|
|
|
|
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
if (ok) {
|
|
setState({ action: action, location: location });
|
|
} else {
|
|
revertPop(location);
|
|
}
|
|
});
|
|
}
|
|
};
|
|
|
|
var revertPop = function revertPop(fromLocation) {
|
|
var toLocation = history.location;
|
|
|
|
// TODO: We could probably make this more reliable by
|
|
// keeping a list of keys we've seen in sessionStorage.
|
|
// Instead, we just default to 0 for keys we don't know.
|
|
|
|
var toIndex = allKeys.indexOf(toLocation.key);
|
|
|
|
if (toIndex === -1) toIndex = 0;
|
|
|
|
var fromIndex = allKeys.indexOf(fromLocation.key);
|
|
|
|
if (fromIndex === -1) fromIndex = 0;
|
|
|
|
var delta = toIndex - fromIndex;
|
|
|
|
if (delta) {
|
|
forceNextPop = true;
|
|
go(delta);
|
|
}
|
|
};
|
|
|
|
var initialLocation = getDOMLocation(getHistoryState());
|
|
var allKeys = [initialLocation.key];
|
|
|
|
// Public interface
|
|
|
|
var createHref = function createHref(location) {
|
|
return basename + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["a" /* createPath */])(location);
|
|
};
|
|
|
|
var push = function push(path, state) {
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
|
|
|
|
var action = 'PUSH';
|
|
var location = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(path, state, createKey(), history.location);
|
|
|
|
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
if (!ok) return;
|
|
|
|
var href = createHref(location);
|
|
var key = location.key,
|
|
state = location.state;
|
|
|
|
|
|
if (canUseHistory) {
|
|
globalHistory.pushState({ key: key, state: state }, null, href);
|
|
|
|
if (forceRefresh) {
|
|
window.location.href = href;
|
|
} else {
|
|
var prevIndex = allKeys.indexOf(history.location.key);
|
|
var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);
|
|
|
|
nextKeys.push(location.key);
|
|
allKeys = nextKeys;
|
|
|
|
setState({ action: action, location: location });
|
|
}
|
|
} else {
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history');
|
|
|
|
window.location.href = href;
|
|
}
|
|
});
|
|
};
|
|
|
|
var replace = function replace(path, state) {
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
|
|
|
|
var action = 'REPLACE';
|
|
var location = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(path, state, createKey(), history.location);
|
|
|
|
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
if (!ok) return;
|
|
|
|
var href = createHref(location);
|
|
var key = location.key,
|
|
state = location.state;
|
|
|
|
|
|
if (canUseHistory) {
|
|
globalHistory.replaceState({ key: key, state: state }, null, href);
|
|
|
|
if (forceRefresh) {
|
|
window.location.replace(href);
|
|
} else {
|
|
var prevIndex = allKeys.indexOf(history.location.key);
|
|
|
|
if (prevIndex !== -1) allKeys[prevIndex] = location.key;
|
|
|
|
setState({ action: action, location: location });
|
|
}
|
|
} else {
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history');
|
|
|
|
window.location.replace(href);
|
|
}
|
|
});
|
|
};
|
|
|
|
var go = function go(n) {
|
|
globalHistory.go(n);
|
|
};
|
|
|
|
var goBack = function goBack() {
|
|
return go(-1);
|
|
};
|
|
|
|
var goForward = function goForward() {
|
|
return go(1);
|
|
};
|
|
|
|
var listenerCount = 0;
|
|
|
|
var checkDOMListeners = function checkDOMListeners(delta) {
|
|
listenerCount += delta;
|
|
|
|
if (listenerCount === 1) {
|
|
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["d" /* addEventListener */])(window, PopStateEvent, handlePopState);
|
|
|
|
if (needsHashChangeListener) __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["d" /* addEventListener */])(window, HashChangeEvent, handleHashChange);
|
|
} else if (listenerCount === 0) {
|
|
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["e" /* removeEventListener */])(window, PopStateEvent, handlePopState);
|
|
|
|
if (needsHashChangeListener) __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["e" /* removeEventListener */])(window, HashChangeEvent, handleHashChange);
|
|
}
|
|
};
|
|
|
|
var isBlocked = false;
|
|
|
|
var block = function block() {
|
|
var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
|
|
var unblock = transitionManager.setPrompt(prompt);
|
|
|
|
if (!isBlocked) {
|
|
checkDOMListeners(1);
|
|
isBlocked = true;
|
|
}
|
|
|
|
return function () {
|
|
if (isBlocked) {
|
|
isBlocked = false;
|
|
checkDOMListeners(-1);
|
|
}
|
|
|
|
return unblock();
|
|
};
|
|
};
|
|
|
|
var listen = function listen(listener) {
|
|
var unlisten = transitionManager.appendListener(listener);
|
|
checkDOMListeners(1);
|
|
|
|
return function () {
|
|
checkDOMListeners(-1);
|
|
unlisten();
|
|
};
|
|
};
|
|
|
|
var history = {
|
|
length: globalHistory.length,
|
|
action: 'POP',
|
|
location: initialLocation,
|
|
createHref: createHref,
|
|
push: push,
|
|
replace: replace,
|
|
go: go,
|
|
goBack: goBack,
|
|
goForward: goForward,
|
|
block: block,
|
|
listen: listen
|
|
};
|
|
|
|
return history;
|
|
};
|
|
|
|
/* unused harmony default export */ var _unused_webpack_default_export = (createBrowserHistory);
|
|
|
|
/***/ }),
|
|
/* 39 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(8);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(3);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__LocationUtils__ = __webpack_require__(7);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__PathUtils__ = __webpack_require__(5);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__createTransitionManager__ = __webpack_require__(12);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__DOMUtils__ = __webpack_require__(21);
|
|
var _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; };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var HashChangeEvent = 'hashchange';
|
|
|
|
var HashPathCoders = {
|
|
hashbang: {
|
|
encodePath: function encodePath(path) {
|
|
return path.charAt(0) === '!' ? path : '!/' + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["c" /* stripLeadingSlash */])(path);
|
|
},
|
|
decodePath: function decodePath(path) {
|
|
return path.charAt(0) === '!' ? path.substr(1) : path;
|
|
}
|
|
},
|
|
noslash: {
|
|
encodePath: __WEBPACK_IMPORTED_MODULE_3__PathUtils__["c" /* stripLeadingSlash */],
|
|
decodePath: __WEBPACK_IMPORTED_MODULE_3__PathUtils__["d" /* addLeadingSlash */]
|
|
},
|
|
slash: {
|
|
encodePath: __WEBPACK_IMPORTED_MODULE_3__PathUtils__["d" /* addLeadingSlash */],
|
|
decodePath: __WEBPACK_IMPORTED_MODULE_3__PathUtils__["d" /* addLeadingSlash */]
|
|
}
|
|
};
|
|
|
|
var getHashPath = function getHashPath() {
|
|
// We can't use window.location.hash here because it's not
|
|
// consistent across browsers - Firefox will pre-decode it!
|
|
var href = window.location.href;
|
|
var hashIndex = href.indexOf('#');
|
|
return hashIndex === -1 ? '' : href.substring(hashIndex + 1);
|
|
};
|
|
|
|
var pushHashPath = function pushHashPath(path) {
|
|
return window.location.hash = path;
|
|
};
|
|
|
|
var replaceHashPath = function replaceHashPath(path) {
|
|
var hashIndex = window.location.href.indexOf('#');
|
|
|
|
window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path);
|
|
};
|
|
|
|
var createHashHistory = function createHashHistory() {
|
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
|
|
__WEBPACK_IMPORTED_MODULE_1_invariant___default()(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["a" /* canUseDOM */], 'Hash history needs a DOM');
|
|
|
|
var globalHistory = window.history;
|
|
var canGoWithoutReload = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["b" /* supportsGoWithoutReloadUsingHash */])();
|
|
|
|
var _props$getUserConfirm = props.getUserConfirmation,
|
|
getUserConfirmation = _props$getUserConfirm === undefined ? __WEBPACK_IMPORTED_MODULE_5__DOMUtils__["c" /* getConfirmation */] : _props$getUserConfirm,
|
|
_props$hashType = props.hashType,
|
|
hashType = _props$hashType === undefined ? 'slash' : _props$hashType;
|
|
|
|
var basename = props.basename ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["e" /* stripTrailingSlash */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["d" /* addLeadingSlash */])(props.basename)) : '';
|
|
|
|
var _HashPathCoders$hashT = HashPathCoders[hashType],
|
|
encodePath = _HashPathCoders$hashT.encodePath,
|
|
decodePath = _HashPathCoders$hashT.decodePath;
|
|
|
|
|
|
var getDOMLocation = function getDOMLocation() {
|
|
var path = decodePath(getHashPath());
|
|
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(!basename || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["f" /* hasBasename */])(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".');
|
|
|
|
if (basename) path = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["g" /* stripBasename */])(path, basename);
|
|
|
|
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(path);
|
|
};
|
|
|
|
var transitionManager = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__createTransitionManager__["a" /* default */])();
|
|
|
|
var setState = function setState(nextState) {
|
|
_extends(history, nextState);
|
|
|
|
history.length = globalHistory.length;
|
|
|
|
transitionManager.notifyListeners(history.location, history.action);
|
|
};
|
|
|
|
var forceNextPop = false;
|
|
var ignorePath = null;
|
|
|
|
var handleHashChange = function handleHashChange() {
|
|
var path = getHashPath();
|
|
var encodedPath = encodePath(path);
|
|
|
|
if (path !== encodedPath) {
|
|
// Ensure we always have a properly-encoded hash.
|
|
replaceHashPath(encodedPath);
|
|
} else {
|
|
var location = getDOMLocation();
|
|
var prevLocation = history.location;
|
|
|
|
if (!forceNextPop && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["b" /* locationsAreEqual */])(prevLocation, location)) return; // A hashchange doesn't always == location change.
|
|
|
|
if (ignorePath === __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["a" /* createPath */])(location)) return; // Ignore this change; we already setState in push/replace.
|
|
|
|
ignorePath = null;
|
|
|
|
handlePop(location);
|
|
}
|
|
};
|
|
|
|
var handlePop = function handlePop(location) {
|
|
if (forceNextPop) {
|
|
forceNextPop = false;
|
|
setState();
|
|
} else {
|
|
var action = 'POP';
|
|
|
|
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
if (ok) {
|
|
setState({ action: action, location: location });
|
|
} else {
|
|
revertPop(location);
|
|
}
|
|
});
|
|
}
|
|
};
|
|
|
|
var revertPop = function revertPop(fromLocation) {
|
|
var toLocation = history.location;
|
|
|
|
// TODO: We could probably make this more reliable by
|
|
// keeping a list of paths we've seen in sessionStorage.
|
|
// Instead, we just default to 0 for paths we don't know.
|
|
|
|
var toIndex = allPaths.lastIndexOf(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["a" /* createPath */])(toLocation));
|
|
|
|
if (toIndex === -1) toIndex = 0;
|
|
|
|
var fromIndex = allPaths.lastIndexOf(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["a" /* createPath */])(fromLocation));
|
|
|
|
if (fromIndex === -1) fromIndex = 0;
|
|
|
|
var delta = toIndex - fromIndex;
|
|
|
|
if (delta) {
|
|
forceNextPop = true;
|
|
go(delta);
|
|
}
|
|
};
|
|
|
|
// Ensure the hash is encoded properly before doing anything else.
|
|
var path = getHashPath();
|
|
var encodedPath = encodePath(path);
|
|
|
|
if (path !== encodedPath) replaceHashPath(encodedPath);
|
|
|
|
var initialLocation = getDOMLocation();
|
|
var allPaths = [__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["a" /* createPath */])(initialLocation)];
|
|
|
|
// Public interface
|
|
|
|
var createHref = function createHref(location) {
|
|
return '#' + encodePath(basename + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["a" /* createPath */])(location));
|
|
};
|
|
|
|
var push = function push(path, state) {
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(state === undefined, 'Hash history cannot push state; it is ignored');
|
|
|
|
var action = 'PUSH';
|
|
var location = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(path, undefined, undefined, history.location);
|
|
|
|
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
if (!ok) return;
|
|
|
|
var path = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["a" /* createPath */])(location);
|
|
var encodedPath = encodePath(basename + path);
|
|
var hashChanged = getHashPath() !== encodedPath;
|
|
|
|
if (hashChanged) {
|
|
// We cannot tell if a hashchange was caused by a PUSH, so we'd
|
|
// rather setState here and ignore the hashchange. The caveat here
|
|
// is that other hash histories in the page will consider it a POP.
|
|
ignorePath = path;
|
|
pushHashPath(encodedPath);
|
|
|
|
var prevIndex = allPaths.lastIndexOf(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["a" /* createPath */])(history.location));
|
|
var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);
|
|
|
|
nextPaths.push(path);
|
|
allPaths = nextPaths;
|
|
|
|
setState({ action: action, location: location });
|
|
} else {
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack');
|
|
|
|
setState();
|
|
}
|
|
});
|
|
};
|
|
|
|
var replace = function replace(path, state) {
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(state === undefined, 'Hash history cannot replace state; it is ignored');
|
|
|
|
var action = 'REPLACE';
|
|
var location = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(path, undefined, undefined, history.location);
|
|
|
|
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
if (!ok) return;
|
|
|
|
var path = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["a" /* createPath */])(location);
|
|
var encodedPath = encodePath(basename + path);
|
|
var hashChanged = getHashPath() !== encodedPath;
|
|
|
|
if (hashChanged) {
|
|
// We cannot tell if a hashchange was caused by a REPLACE, so we'd
|
|
// rather setState here and ignore the hashchange. The caveat here
|
|
// is that other hash histories in the page will consider it a POP.
|
|
ignorePath = path;
|
|
replaceHashPath(encodedPath);
|
|
}
|
|
|
|
var prevIndex = allPaths.indexOf(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["a" /* createPath */])(history.location));
|
|
|
|
if (prevIndex !== -1) allPaths[prevIndex] = path;
|
|
|
|
setState({ action: action, location: location });
|
|
});
|
|
};
|
|
|
|
var go = function go(n) {
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser');
|
|
|
|
globalHistory.go(n);
|
|
};
|
|
|
|
var goBack = function goBack() {
|
|
return go(-1);
|
|
};
|
|
|
|
var goForward = function goForward() {
|
|
return go(1);
|
|
};
|
|
|
|
var listenerCount = 0;
|
|
|
|
var checkDOMListeners = function checkDOMListeners(delta) {
|
|
listenerCount += delta;
|
|
|
|
if (listenerCount === 1) {
|
|
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["d" /* addEventListener */])(window, HashChangeEvent, handleHashChange);
|
|
} else if (listenerCount === 0) {
|
|
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["e" /* removeEventListener */])(window, HashChangeEvent, handleHashChange);
|
|
}
|
|
};
|
|
|
|
var isBlocked = false;
|
|
|
|
var block = function block() {
|
|
var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
|
|
var unblock = transitionManager.setPrompt(prompt);
|
|
|
|
if (!isBlocked) {
|
|
checkDOMListeners(1);
|
|
isBlocked = true;
|
|
}
|
|
|
|
return function () {
|
|
if (isBlocked) {
|
|
isBlocked = false;
|
|
checkDOMListeners(-1);
|
|
}
|
|
|
|
return unblock();
|
|
};
|
|
};
|
|
|
|
var listen = function listen(listener) {
|
|
var unlisten = transitionManager.appendListener(listener);
|
|
checkDOMListeners(1);
|
|
|
|
return function () {
|
|
checkDOMListeners(-1);
|
|
unlisten();
|
|
};
|
|
};
|
|
|
|
var history = {
|
|
length: globalHistory.length,
|
|
action: 'POP',
|
|
location: initialLocation,
|
|
createHref: createHref,
|
|
push: push,
|
|
replace: replace,
|
|
go: go,
|
|
goBack: goBack,
|
|
goForward: goForward,
|
|
block: block,
|
|
listen: listen
|
|
};
|
|
|
|
return history;
|
|
};
|
|
|
|
/* unused harmony default export */ var _unused_webpack_default_export = (createHashHistory);
|
|
|
|
/***/ }),
|
|
/* 40 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(8);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__PathUtils__ = __webpack_require__(5);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__LocationUtils__ = __webpack_require__(7);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__createTransitionManager__ = __webpack_require__(12);
|
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
|
|
var _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; };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var clamp = function clamp(n, lowerBound, upperBound) {
|
|
return Math.min(Math.max(n, lowerBound), upperBound);
|
|
};
|
|
|
|
/**
|
|
* Creates a history object that stores locations in memory.
|
|
*/
|
|
var createMemoryHistory = function createMemoryHistory() {
|
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
var getUserConfirmation = props.getUserConfirmation,
|
|
_props$initialEntries = props.initialEntries,
|
|
initialEntries = _props$initialEntries === undefined ? ['/'] : _props$initialEntries,
|
|
_props$initialIndex = props.initialIndex,
|
|
initialIndex = _props$initialIndex === undefined ? 0 : _props$initialIndex,
|
|
_props$keyLength = props.keyLength,
|
|
keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;
|
|
|
|
|
|
var transitionManager = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__createTransitionManager__["a" /* default */])();
|
|
|
|
var setState = function setState(nextState) {
|
|
_extends(history, nextState);
|
|
|
|
history.length = history.entries.length;
|
|
|
|
transitionManager.notifyListeners(history.location, history.action);
|
|
};
|
|
|
|
var createKey = function createKey() {
|
|
return Math.random().toString(36).substr(2, keyLength);
|
|
};
|
|
|
|
var index = clamp(initialIndex, 0, initialEntries.length - 1);
|
|
var entries = initialEntries.map(function (entry) {
|
|
return typeof entry === 'string' ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(entry, undefined, createKey()) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(entry, undefined, entry.key || createKey());
|
|
});
|
|
|
|
// Public interface
|
|
|
|
var createHref = __WEBPACK_IMPORTED_MODULE_1__PathUtils__["a" /* createPath */];
|
|
|
|
var push = function push(path, state) {
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
|
|
|
|
var action = 'PUSH';
|
|
var location = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(path, state, createKey(), history.location);
|
|
|
|
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
if (!ok) return;
|
|
|
|
var prevIndex = history.index;
|
|
var nextIndex = prevIndex + 1;
|
|
|
|
var nextEntries = history.entries.slice(0);
|
|
if (nextEntries.length > nextIndex) {
|
|
nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);
|
|
} else {
|
|
nextEntries.push(location);
|
|
}
|
|
|
|
setState({
|
|
action: action,
|
|
location: location,
|
|
index: nextIndex,
|
|
entries: nextEntries
|
|
});
|
|
});
|
|
};
|
|
|
|
var replace = function replace(path, state) {
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
|
|
|
|
var action = 'REPLACE';
|
|
var location = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(path, state, createKey(), history.location);
|
|
|
|
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
if (!ok) return;
|
|
|
|
history.entries[history.index] = location;
|
|
|
|
setState({ action: action, location: location });
|
|
});
|
|
};
|
|
|
|
var go = function go(n) {
|
|
var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);
|
|
|
|
var action = 'POP';
|
|
var location = history.entries[nextIndex];
|
|
|
|
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
if (ok) {
|
|
setState({
|
|
action: action,
|
|
location: location,
|
|
index: nextIndex
|
|
});
|
|
} else {
|
|
// Mimic the behavior of DOM histories by
|
|
// causing a render after a cancelled POP.
|
|
setState();
|
|
}
|
|
});
|
|
};
|
|
|
|
var goBack = function goBack() {
|
|
return go(-1);
|
|
};
|
|
|
|
var goForward = function goForward() {
|
|
return go(1);
|
|
};
|
|
|
|
var canGo = function canGo(n) {
|
|
var nextIndex = history.index + n;
|
|
return nextIndex >= 0 && nextIndex < history.entries.length;
|
|
};
|
|
|
|
var block = function block() {
|
|
var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
return transitionManager.setPrompt(prompt);
|
|
};
|
|
|
|
var listen = function listen(listener) {
|
|
return transitionManager.appendListener(listener);
|
|
};
|
|
|
|
var history = {
|
|
length: entries.length,
|
|
action: 'POP',
|
|
location: entries[index],
|
|
index: index,
|
|
entries: entries,
|
|
createHref: createHref,
|
|
push: push,
|
|
replace: replace,
|
|
go: go,
|
|
goBack: goBack,
|
|
goForward: goForward,
|
|
canGo: canGo,
|
|
block: block,
|
|
listen: listen
|
|
};
|
|
|
|
return history;
|
|
};
|
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (createMemoryHistory);
|
|
|
|
/***/ }),
|
|
/* 41 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
|
|
/**
|
|
* Copyright 2015, Yahoo! Inc.
|
|
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
|
*/
|
|
var REACT_STATICS = {
|
|
childContextTypes: true,
|
|
contextTypes: true,
|
|
defaultProps: true,
|
|
displayName: true,
|
|
getDefaultProps: true,
|
|
getDerivedStateFromProps: true,
|
|
mixins: true,
|
|
propTypes: true,
|
|
type: true
|
|
};
|
|
|
|
var KNOWN_STATICS = {
|
|
name: true,
|
|
length: true,
|
|
prototype: true,
|
|
caller: true,
|
|
callee: true,
|
|
arguments: true,
|
|
arity: true
|
|
};
|
|
|
|
var defineProperty = Object.defineProperty;
|
|
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
var getPrototypeOf = Object.getPrototypeOf;
|
|
var objectPrototype = getPrototypeOf && getPrototypeOf(Object);
|
|
|
|
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
|
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
|
|
|
|
if (objectPrototype) {
|
|
var inheritedComponent = getPrototypeOf(sourceComponent);
|
|
if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
|
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
|
}
|
|
}
|
|
|
|
var keys = getOwnPropertyNames(sourceComponent);
|
|
|
|
if (getOwnPropertySymbols) {
|
|
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
|
}
|
|
|
|
for (var i = 0; i < keys.length; ++i) {
|
|
var key = keys[i];
|
|
if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
|
|
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
|
try { // Avoid failures from read-only properties
|
|
defineProperty(targetComponent, key, descriptor);
|
|
} catch (e) {}
|
|
}
|
|
}
|
|
|
|
return targetComponent;
|
|
}
|
|
|
|
return targetComponent;
|
|
}
|
|
|
|
module.exports = hoistNonReactStatics;
|
|
|
|
|
|
/***/ }),
|
|
/* 42 */
|
|
/***/ (function(module, exports) {
|
|
|
|
module.exports = Array.isArray || function (arr) {
|
|
return Object.prototype.toString.call(arr) == '[object Array]';
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
/* 43 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/**
|
|
* 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 = __webpack_require__(15);
|
|
|
|
function emptyFunction() {}
|
|
|
|
module.exports = function() {
|
|
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
if (secret === ReactPropTypesSecret) {
|
|
// It is still safe when called from React.
|
|
return;
|
|
}
|
|
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;
|
|
};
|
|
shim.isRequired = shim;
|
|
function getShim() {
|
|
return shim;
|
|
};
|
|
// Important!
|
|
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
var ReactPropTypes = {
|
|
array: shim,
|
|
bool: shim,
|
|
func: shim,
|
|
number: shim,
|
|
object: shim,
|
|
string: shim,
|
|
symbol: shim,
|
|
|
|
any: shim,
|
|
arrayOf: getShim,
|
|
element: shim,
|
|
instanceOf: getShim,
|
|
node: shim,
|
|
objectOf: getShim,
|
|
oneOf: getShim,
|
|
oneOfType: getShim,
|
|
shape: getShim,
|
|
exact: getShim
|
|
};
|
|
|
|
ReactPropTypes.checkPropTypes = emptyFunction;
|
|
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
|
|
return ReactPropTypes;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
/* 44 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* 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 assign = __webpack_require__(14);
|
|
|
|
var ReactPropTypesSecret = __webpack_require__(15);
|
|
var checkPropTypes = __webpack_require__(23);
|
|
|
|
var printWarning = function() {};
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
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) {}
|
|
};
|
|
}
|
|
|
|
function emptyFunctionThatReturnsNull() {
|
|
return null;
|
|
}
|
|
|
|
module.exports = 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(),
|
|
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) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var manualPropTypeCallCache = {};
|
|
var manualPropTypeWarningCount = 0;
|
|
}
|
|
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
componentName = componentName || ANONYMOUS;
|
|
propFullName = propFullName || propName;
|
|
|
|
if (secret !== ReactPropTypesSecret) {
|
|
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 (process.env.NODE_ENV !== 'production' && 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(
|
|
'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);
|
|
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 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)) {
|
|
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
|
|
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);
|
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + 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 (propValue.hasOwnProperty(key)) {
|
|
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
if (error instanceof Error) {
|
|
return error;
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
|
|
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
return emptyFunctionThatReturnsNull;
|
|
}
|
|
|
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
var checker = arrayOfTypeCheckers[i];
|
|
if (typeof checker !== 'function') {
|
|
printWarning(
|
|
'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) == 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);
|
|
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 = assign({}, 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);
|
|
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;
|
|
}
|
|
|
|
// 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;
|
|
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
|
|
return ReactPropTypes;
|
|
};
|
|
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
|
|
|
|
/***/ }),
|
|
/* 45 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.6.1
|
|
* react-is.development.js
|
|
*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
if (process.env.NODE_ENV !== "production") {
|
|
(function() {
|
|
'use strict';
|
|
|
|
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;
|
|
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_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
|
|
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 || 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);
|
|
}
|
|
|
|
/**
|
|
* 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:
|
|
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_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 Profiler = REACT_PROFILER_TYPE;
|
|
var Portal = REACT_PORTAL_TYPE;
|
|
var StrictMode = REACT_STRICT_MODE_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 isProfiler(object) {
|
|
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
}
|
|
function isPortal(object) {
|
|
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
}
|
|
function isStrictMode(object) {
|
|
return typeOf(object) === REACT_STRICT_MODE_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.Profiler = Profiler;
|
|
exports.Portal = Portal;
|
|
exports.StrictMode = StrictMode;
|
|
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.isProfiler = isProfiler;
|
|
exports.isPortal = isPortal;
|
|
exports.isStrictMode = isStrictMode;
|
|
})();
|
|
}
|
|
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
|
|
|
|
/***/ }),
|
|
/* 46 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/** @license React v16.6.1
|
|
* react-is.production.min.js
|
|
*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
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,r=b?Symbol.for("react.memo"):
|
|
60115,t=b?Symbol.for("react.lazy"):60116;function u(a){if("object"===typeof a&&null!==a){var q=a.$$typeof;switch(q){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return q}}case d:return q}}}function v(a){return u(a)===m}exports.typeOf=u;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;
|
|
exports.Profiler=g;exports.Portal=d;exports.StrictMode=f;exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||u(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return u(a)===k};exports.isContextProvider=function(a){return u(a)===h};
|
|
exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return u(a)===n};exports.isFragment=function(a){return u(a)===e};exports.isProfiler=function(a){return u(a)===g};exports.isPortal=function(a){return u(a)===d};exports.isStrictMode=function(a){return u(a)===f};
|
|
|
|
|
|
/***/ }),
|
|
/* 47 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_inheritsLoose__ = __webpack_require__(19);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(1);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(2);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Context__ = __webpack_require__(16);
|
|
|
|
|
|
|
|
|
|
|
|
var Provider =
|
|
/*#__PURE__*/
|
|
function (_Component) {
|
|
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_inheritsLoose__["a" /* default */])(Provider, _Component);
|
|
|
|
function Provider(props) {
|
|
var _this;
|
|
|
|
_this = _Component.call(this, props) || this;
|
|
var store = props.store;
|
|
_this.state = {
|
|
storeState: store.getState(),
|
|
store: store
|
|
};
|
|
return _this;
|
|
}
|
|
|
|
var _proto = Provider.prototype;
|
|
|
|
_proto.componentDidMount = function componentDidMount() {
|
|
this._isMounted = true;
|
|
this.subscribe();
|
|
};
|
|
|
|
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
if (this.unsubscribe) this.unsubscribe();
|
|
this._isMounted = false;
|
|
};
|
|
|
|
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
|
if (this.props.store !== prevProps.store) {
|
|
if (this.unsubscribe) this.unsubscribe();
|
|
this.subscribe();
|
|
}
|
|
};
|
|
|
|
_proto.subscribe = function subscribe() {
|
|
var _this2 = this;
|
|
|
|
var store = this.props.store;
|
|
this.unsubscribe = store.subscribe(function () {
|
|
var newStoreState = store.getState();
|
|
|
|
if (!_this2._isMounted) {
|
|
return;
|
|
}
|
|
|
|
_this2.setState(function (providerState) {
|
|
// If the value is the same, skip the unnecessary state update.
|
|
if (providerState.storeState === newStoreState) {
|
|
return null;
|
|
}
|
|
|
|
return {
|
|
storeState: newStoreState
|
|
};
|
|
});
|
|
}); // Actions might have been dispatched between render and mount - handle those
|
|
|
|
var postMountStoreState = store.getState();
|
|
|
|
if (postMountStoreState !== this.state.storeState) {
|
|
this.setState({
|
|
storeState: postMountStoreState
|
|
});
|
|
}
|
|
};
|
|
|
|
_proto.render = function render() {
|
|
console.log('rendering')
|
|
var Context = this.props.context || __WEBPACK_IMPORTED_MODULE_3__Context__["a" /* ReactReduxContext */]; console.log('state', this.state);
|
|
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(Context.Provider, {
|
|
value: this.state
|
|
}, this.props.children);
|
|
};
|
|
|
|
return Provider;
|
|
}(__WEBPACK_IMPORTED_MODULE_1_react__["Component"]);
|
|
|
|
Provider.propTypes = {
|
|
store: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.shape({
|
|
subscribe: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func.isRequired,
|
|
dispatch: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func.isRequired,
|
|
getState: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func.isRequired
|
|
}),
|
|
context: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object,
|
|
children: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.any
|
|
};
|
|
/* unused harmony default export */ var _unused_webpack_default_export = (Provider);
|
|
|
|
|
|
/***/ }),
|
|
/* 48 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* unused harmony export createConnect */
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__ = __webpack_require__(10);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutPropertiesLoose__ = __webpack_require__(11);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_connectAdvanced__ = __webpack_require__(25);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_shallowEqual__ = __webpack_require__(56);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mapDispatchToProps__ = __webpack_require__(49);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__mapStateToProps__ = __webpack_require__(50);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__mergeProps__ = __webpack_require__(51);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__selectorFactory__ = __webpack_require__(52);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
connect is a facade over connectAdvanced. It turns its args into a compatible
|
|
selectorFactory, which has the signature:
|
|
|
|
(dispatch, options) => (nextState, nextOwnProps) => nextFinalProps
|
|
|
|
connect passes its args to connectAdvanced as options, which will in turn pass them to
|
|
selectorFactory each time a Connect component instance is instantiated or hot reloaded.
|
|
|
|
selectorFactory returns a final props selector from its mapStateToProps,
|
|
mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,
|
|
mergePropsFactories, and pure args.
|
|
|
|
The resulting final props selector is called by the Connect component instance whenever
|
|
it receives new props or store state.
|
|
*/
|
|
|
|
function match(arg, factories, name) {
|
|
for (var i = factories.length - 1; i >= 0; i--) {
|
|
var result = factories[i](arg);
|
|
if (result) return result;
|
|
}
|
|
|
|
return function (dispatch, options) {
|
|
throw new Error("Invalid value of type " + typeof arg + " for " + name + " argument when connecting component " + options.wrappedComponentName + ".");
|
|
};
|
|
}
|
|
|
|
function strictEqual(a, b) {
|
|
return a === b;
|
|
} // createConnect with default args builds the 'official' connect behavior. Calling it with
|
|
// different options opens up some testing and extensibility scenarios
|
|
|
|
|
|
function createConnect(_temp) {
|
|
var _ref = _temp === void 0 ? {} : _temp,
|
|
_ref$connectHOC = _ref.connectHOC,
|
|
connectHOC = _ref$connectHOC === void 0 ? __WEBPACK_IMPORTED_MODULE_2__components_connectAdvanced__["a" /* default */] : _ref$connectHOC,
|
|
_ref$mapStateToPropsF = _ref.mapStateToPropsFactories,
|
|
mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? __WEBPACK_IMPORTED_MODULE_5__mapStateToProps__["a" /* default */] : _ref$mapStateToPropsF,
|
|
_ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,
|
|
mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? __WEBPACK_IMPORTED_MODULE_4__mapDispatchToProps__["a" /* default */] : _ref$mapDispatchToPro,
|
|
_ref$mergePropsFactor = _ref.mergePropsFactories,
|
|
mergePropsFactories = _ref$mergePropsFactor === void 0 ? __WEBPACK_IMPORTED_MODULE_6__mergeProps__["a" /* default */] : _ref$mergePropsFactor,
|
|
_ref$selectorFactory = _ref.selectorFactory,
|
|
selectorFactory = _ref$selectorFactory === void 0 ? __WEBPACK_IMPORTED_MODULE_7__selectorFactory__["a" /* default */] : _ref$selectorFactory;
|
|
|
|
return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {
|
|
if (_ref2 === void 0) {
|
|
_ref2 = {};
|
|
}
|
|
|
|
var _ref3 = _ref2,
|
|
_ref3$pure = _ref3.pure,
|
|
pure = _ref3$pure === void 0 ? true : _ref3$pure,
|
|
_ref3$areStatesEqual = _ref3.areStatesEqual,
|
|
areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,
|
|
_ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,
|
|
areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? __WEBPACK_IMPORTED_MODULE_3__utils_shallowEqual__["a" /* default */] : _ref3$areOwnPropsEqua,
|
|
_ref3$areStatePropsEq = _ref3.areStatePropsEqual,
|
|
areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? __WEBPACK_IMPORTED_MODULE_3__utils_shallowEqual__["a" /* default */] : _ref3$areStatePropsEq,
|
|
_ref3$areMergedPropsE = _ref3.areMergedPropsEqual,
|
|
areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? __WEBPACK_IMPORTED_MODULE_3__utils_shallowEqual__["a" /* default */] : _ref3$areMergedPropsE,
|
|
extraOptions = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutPropertiesLoose__["a" /* default */])(_ref3, ["pure", "areStatesEqual", "areOwnPropsEqual", "areStatePropsEqual", "areMergedPropsEqual"]);
|
|
|
|
var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');
|
|
var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');
|
|
var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');
|
|
return connectHOC(selectorFactory, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])({
|
|
// used in error messages
|
|
methodName: 'connect',
|
|
// used to compute Connect's displayName from the wrapped component's displayName.
|
|
getDisplayName: function getDisplayName(name) {
|
|
return "Connect(" + name + ")";
|
|
},
|
|
// if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes
|
|
shouldHandleStateChanges: Boolean(mapStateToProps),
|
|
// passed through to selectorFactory
|
|
initMapStateToProps: initMapStateToProps,
|
|
initMapDispatchToProps: initMapDispatchToProps,
|
|
initMergeProps: initMergeProps,
|
|
pure: pure,
|
|
areStatesEqual: areStatesEqual,
|
|
areOwnPropsEqual: areOwnPropsEqual,
|
|
areStatePropsEqual: areStatePropsEqual,
|
|
areMergedPropsEqual: areMergedPropsEqual
|
|
}, extraOptions));
|
|
};
|
|
}
|
|
/* harmony default export */ __webpack_exports__["a"] = (createConnect());
|
|
|
|
/***/ }),
|
|
/* 49 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* unused harmony export whenMapDispatchToPropsIsFunction */
|
|
/* unused harmony export whenMapDispatchToPropsIsMissing */
|
|
/* unused harmony export whenMapDispatchToPropsIsObject */
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_redux__ = __webpack_require__(66);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__ = __webpack_require__(26);
|
|
|
|
|
|
function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {
|
|
return typeof mapDispatchToProps === 'function' ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["a" /* wrapMapToPropsFunc */])(mapDispatchToProps, 'mapDispatchToProps') : undefined;
|
|
}
|
|
function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {
|
|
return !mapDispatchToProps ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["b" /* wrapMapToPropsConstant */])(function (dispatch) {
|
|
return {
|
|
dispatch: dispatch
|
|
};
|
|
}) : undefined;
|
|
}
|
|
function whenMapDispatchToPropsIsObject(mapDispatchToProps) {
|
|
return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["b" /* wrapMapToPropsConstant */])(function (dispatch) {
|
|
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_redux__["a" /* bindActionCreators */])(mapDispatchToProps, dispatch);
|
|
}) : undefined;
|
|
}
|
|
/* harmony default export */ __webpack_exports__["a"] = ([whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject]);
|
|
|
|
/***/ }),
|
|
/* 50 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* unused harmony export whenMapStateToPropsIsFunction */
|
|
/* unused harmony export whenMapStateToPropsIsMissing */
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__ = __webpack_require__(26);
|
|
|
|
function whenMapStateToPropsIsFunction(mapStateToProps) {
|
|
return typeof mapStateToProps === 'function' ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__["a" /* wrapMapToPropsFunc */])(mapStateToProps, 'mapStateToProps') : undefined;
|
|
}
|
|
function whenMapStateToPropsIsMissing(mapStateToProps) {
|
|
return !mapStateToProps ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__["b" /* wrapMapToPropsConstant */])(function () {
|
|
return {};
|
|
}) : undefined;
|
|
}
|
|
/* harmony default export */ __webpack_exports__["a"] = ([whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing]);
|
|
|
|
/***/ }),
|
|
/* 51 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export defaultMergeProps */
|
|
/* unused harmony export wrapMergePropsFunc */
|
|
/* unused harmony export whenMergePropsIsFunction */
|
|
/* unused harmony export whenMergePropsIsOmitted */
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__ = __webpack_require__(10);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_verifyPlainObject__ = __webpack_require__(27);
|
|
|
|
|
|
function defaultMergeProps(stateProps, dispatchProps, ownProps) {
|
|
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])({}, ownProps, stateProps, dispatchProps);
|
|
}
|
|
function wrapMergePropsFunc(mergeProps) {
|
|
return function initMergePropsProxy(dispatch, _ref) {
|
|
var displayName = _ref.displayName,
|
|
pure = _ref.pure,
|
|
areMergedPropsEqual = _ref.areMergedPropsEqual;
|
|
var hasRunOnce = false;
|
|
var mergedProps;
|
|
return function mergePropsProxy(stateProps, dispatchProps, ownProps) {
|
|
var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
|
|
|
if (hasRunOnce) {
|
|
if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;
|
|
} else {
|
|
hasRunOnce = true;
|
|
mergedProps = nextMergedProps;
|
|
if (process.env.NODE_ENV !== 'production') __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_verifyPlainObject__["a" /* default */])(mergedProps, displayName, 'mergeProps');
|
|
}
|
|
|
|
return mergedProps;
|
|
};
|
|
};
|
|
}
|
|
function whenMergePropsIsFunction(mergeProps) {
|
|
return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;
|
|
}
|
|
function whenMergePropsIsOmitted(mergeProps) {
|
|
return !mergeProps ? function () {
|
|
return defaultMergeProps;
|
|
} : undefined;
|
|
}
|
|
/* harmony default export */ __webpack_exports__["a"] = ([whenMergePropsIsFunction, whenMergePropsIsOmitted]);
|
|
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0)))
|
|
|
|
/***/ }),
|
|
/* 52 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export impureFinalPropsSelectorFactory */
|
|
/* unused harmony export pureFinalPropsSelectorFactory */
|
|
/* harmony export (immutable) */ __webpack_exports__["a"] = finalPropsSelectorFactory;
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectWithoutPropertiesLoose__ = __webpack_require__(11);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__verifySubselectors__ = __webpack_require__(53);
|
|
|
|
|
|
function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {
|
|
return function impureFinalPropsSelector(state, ownProps) {
|
|
return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);
|
|
};
|
|
}
|
|
function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {
|
|
var areStatesEqual = _ref.areStatesEqual,
|
|
areOwnPropsEqual = _ref.areOwnPropsEqual,
|
|
areStatePropsEqual = _ref.areStatePropsEqual;
|
|
var hasRunAtLeastOnce = false;
|
|
var state;
|
|
var ownProps;
|
|
var stateProps;
|
|
var dispatchProps;
|
|
var mergedProps;
|
|
|
|
function handleFirstCall(firstState, firstOwnProps) {
|
|
state = firstState;
|
|
ownProps = firstOwnProps;
|
|
stateProps = mapStateToProps(state, ownProps);
|
|
dispatchProps = mapDispatchToProps(dispatch, ownProps);
|
|
mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
|
hasRunAtLeastOnce = true;
|
|
return mergedProps;
|
|
}
|
|
|
|
function handleNewPropsAndNewState() {
|
|
stateProps = mapStateToProps(state, ownProps);
|
|
if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
|
|
mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
|
return mergedProps;
|
|
}
|
|
|
|
function handleNewProps() {
|
|
if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);
|
|
if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
|
|
mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
|
return mergedProps;
|
|
}
|
|
|
|
function handleNewState() {
|
|
var nextStateProps = mapStateToProps(state, ownProps);
|
|
var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);
|
|
stateProps = nextStateProps;
|
|
if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
|
return mergedProps;
|
|
}
|
|
|
|
function handleSubsequentCalls(nextState, nextOwnProps) {
|
|
var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);
|
|
var stateChanged = !areStatesEqual(nextState, state);
|
|
state = nextState;
|
|
ownProps = nextOwnProps;
|
|
if (propsChanged && stateChanged) return handleNewPropsAndNewState();
|
|
if (propsChanged) return handleNewProps();
|
|
if (stateChanged) return handleNewState();
|
|
return mergedProps;
|
|
}
|
|
|
|
return function pureFinalPropsSelector(nextState, nextOwnProps) {
|
|
return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);
|
|
};
|
|
} // TODO: Add more comments
|
|
// If pure is true, the selector returned by selectorFactory will memoize its results,
|
|
// allowing connectAdvanced's shouldComponentUpdate to return false if final
|
|
// props have not changed. If false, the selector will always return a new
|
|
// object and shouldComponentUpdate will always return true.
|
|
|
|
function finalPropsSelectorFactory(dispatch, _ref2) {
|
|
var initMapStateToProps = _ref2.initMapStateToProps,
|
|
initMapDispatchToProps = _ref2.initMapDispatchToProps,
|
|
initMergeProps = _ref2.initMergeProps,
|
|
options = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectWithoutPropertiesLoose__["a" /* default */])(_ref2, ["initMapStateToProps", "initMapDispatchToProps", "initMergeProps"]);
|
|
|
|
var mapStateToProps = initMapStateToProps(dispatch, options);
|
|
var mapDispatchToProps = initMapDispatchToProps(dispatch, options);
|
|
var mergeProps = initMergeProps(dispatch, options);
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__verifySubselectors__["a" /* default */])(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);
|
|
}
|
|
|
|
var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;
|
|
return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);
|
|
}
|
|
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0)))
|
|
|
|
/***/ }),
|
|
/* 53 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export (immutable) */ __webpack_exports__["a"] = verifySubselectors;
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_warning__ = __webpack_require__(28);
|
|
|
|
|
|
function verify(selector, methodName, displayName) {
|
|
if (!selector) {
|
|
throw new Error("Unexpected value for " + methodName + " in " + displayName + ".");
|
|
} else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {
|
|
if (!selector.hasOwnProperty('dependsOnOwnProps')) {
|
|
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_warning__["a" /* default */])("The selector for " + methodName + " of " + displayName + " did not specify a value for dependsOnOwnProps.");
|
|
}
|
|
}
|
|
}
|
|
|
|
function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {
|
|
verify(mapStateToProps, 'mapStateToProps', displayName);
|
|
verify(mapDispatchToProps, 'mapDispatchToProps', displayName);
|
|
verify(mergeProps, 'mergeProps', displayName);
|
|
}
|
|
|
|
/***/ }),
|
|
/* 54 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_Provider__ = __webpack_require__(47);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__ = __webpack_require__(25);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_Context__ = __webpack_require__(16);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__connect_connect__ = __webpack_require__(48);
|
|
/* unused harmony reexport Provider */
|
|
/* unused harmony reexport connectAdvanced */
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_2__components_Context__["a"]; });
|
|
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_3__connect_connect__["a"]; });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
/* 55 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export (immutable) */ __webpack_exports__["a"] = isPlainObject;
|
|
/**
|
|
* @param {any} obj The object to inspect.
|
|
* @returns {boolean} True if the argument appears to be a plain object.
|
|
*/
|
|
function isPlainObject(obj) {
|
|
if (typeof obj !== 'object' || obj === null) return false;
|
|
var proto = obj;
|
|
|
|
while (Object.getPrototypeOf(proto) !== null) {
|
|
proto = Object.getPrototypeOf(proto);
|
|
}
|
|
|
|
return Object.getPrototypeOf(obj) === proto;
|
|
}
|
|
|
|
/***/ }),
|
|
/* 56 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export (immutable) */ __webpack_exports__["a"] = shallowEqual;
|
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
|
|
function is(x, y) {
|
|
if (x === y) {
|
|
return x !== 0 || y !== 0 || 1 / x === 1 / y;
|
|
} else {
|
|
return x !== x && y !== y;
|
|
}
|
|
}
|
|
|
|
function shallowEqual(objA, objB) {
|
|
if (is(objA, objB)) return true;
|
|
|
|
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
|
|
return false;
|
|
}
|
|
|
|
var keysA = Object.keys(objA);
|
|
var keysB = Object.keys(objB);
|
|
if (keysA.length !== keysB.length) return false;
|
|
|
|
for (var i = 0; i < keysA.length; i++) {
|
|
if (!hasOwn.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
/***/ }),
|
|
/* 57 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
|
|
/**
|
|
* Copyright 2015, Yahoo! Inc.
|
|
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
|
*/
|
|
var ReactIs = __webpack_require__(24);
|
|
var React = __webpack_require__(1);
|
|
var REACT_STATICS = {
|
|
childContextTypes: true,
|
|
contextType: true,
|
|
contextTypes: true,
|
|
defaultProps: true,
|
|
displayName: true,
|
|
getDefaultProps: true,
|
|
getDerivedStateFromProps: true,
|
|
mixins: true,
|
|
propTypes: true,
|
|
type: true
|
|
};
|
|
|
|
var KNOWN_STATICS = {
|
|
name: true,
|
|
length: true,
|
|
prototype: true,
|
|
caller: true,
|
|
callee: true,
|
|
arguments: true,
|
|
arity: true
|
|
};
|
|
|
|
var FORWARD_REF_STATICS = {
|
|
'$$typeof': true,
|
|
render: true
|
|
};
|
|
|
|
var TYPE_STATICS = {};
|
|
TYPE_STATICS[ReactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
|
|
var defineProperty = Object.defineProperty;
|
|
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
var getPrototypeOf = Object.getPrototypeOf;
|
|
var objectPrototype = Object.prototype;
|
|
|
|
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
|
if (typeof sourceComponent !== 'string') {
|
|
// don't hoist over string (html) components
|
|
|
|
if (objectPrototype) {
|
|
var inheritedComponent = getPrototypeOf(sourceComponent);
|
|
if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
|
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
|
}
|
|
}
|
|
|
|
var keys = getOwnPropertyNames(sourceComponent);
|
|
|
|
if (getOwnPropertySymbols) {
|
|
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
|
}
|
|
|
|
var targetStatics = TYPE_STATICS[targetComponent['$$typeof']] || REACT_STATICS;
|
|
var sourceStatics = TYPE_STATICS[sourceComponent['$$typeof']] || REACT_STATICS;
|
|
|
|
for (var i = 0; i < keys.length; ++i) {
|
|
var key = keys[i];
|
|
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
|
|
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
|
try {
|
|
// Avoid failures from read-only properties
|
|
defineProperty(targetComponent, key, descriptor);
|
|
} catch (e) {}
|
|
}
|
|
}
|
|
|
|
return targetComponent;
|
|
}
|
|
|
|
return targetComponent;
|
|
}
|
|
|
|
module.exports = hoistNonReactStatics;
|
|
|
|
|
|
/***/ }),
|
|
/* 58 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(4);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(1);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(2);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history__ = __webpack_require__(13);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Router__ = __webpack_require__(17);
|
|
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; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* The public API for a <Router> that stores location in memory.
|
|
*/
|
|
|
|
var MemoryRouter = function (_React$Component) {
|
|
_inherits(MemoryRouter, _React$Component);
|
|
|
|
function MemoryRouter() {
|
|
var _temp, _this, _ret;
|
|
|
|
_classCallCheck(this, MemoryRouter);
|
|
|
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_history__["d" /* createMemoryHistory */])(_this.props), _temp), _possibleConstructorReturn(_this, _ret);
|
|
}
|
|
|
|
MemoryRouter.prototype.componentWillMount = function componentWillMount() {
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(!this.props.history, "<MemoryRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { MemoryRouter as Router }`.");
|
|
};
|
|
|
|
MemoryRouter.prototype.render = function render() {
|
|
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__Router__["a" /* default */], { history: this.history, children: this.props.children });
|
|
};
|
|
|
|
return MemoryRouter;
|
|
}(__WEBPACK_IMPORTED_MODULE_1_react___default.a.Component);
|
|
|
|
MemoryRouter.propTypes = {
|
|
initialEntries: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.array,
|
|
initialIndex: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.number,
|
|
getUserConfirmation: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func,
|
|
keyLength: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.number,
|
|
children: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.node
|
|
};
|
|
|
|
|
|
/* unused harmony default export */ var _unused_webpack_default_export = (MemoryRouter);
|
|
|
|
/***/ }),
|
|
/* 59 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(2);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_invariant__ = __webpack_require__(3);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_invariant__);
|
|
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; }
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* The public API for prompting the user before navigating away
|
|
* from a screen with a component.
|
|
*/
|
|
|
|
var Prompt = function (_React$Component) {
|
|
_inherits(Prompt, _React$Component);
|
|
|
|
function Prompt() {
|
|
_classCallCheck(this, Prompt);
|
|
|
|
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
}
|
|
|
|
Prompt.prototype.enable = function enable(message) {
|
|
if (this.unblock) this.unblock();
|
|
|
|
this.unblock = this.context.router.history.block(message);
|
|
};
|
|
|
|
Prompt.prototype.disable = function disable() {
|
|
if (this.unblock) {
|
|
this.unblock();
|
|
this.unblock = null;
|
|
}
|
|
};
|
|
|
|
Prompt.prototype.componentWillMount = function componentWillMount() {
|
|
__WEBPACK_IMPORTED_MODULE_2_invariant___default()(this.context.router, "You should not use <Prompt> outside a <Router>");
|
|
|
|
if (this.props.when) this.enable(this.props.message);
|
|
};
|
|
|
|
Prompt.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
|
if (nextProps.when) {
|
|
if (!this.props.when || this.props.message !== nextProps.message) this.enable(nextProps.message);
|
|
} else {
|
|
this.disable();
|
|
}
|
|
};
|
|
|
|
Prompt.prototype.componentWillUnmount = function componentWillUnmount() {
|
|
this.disable();
|
|
};
|
|
|
|
Prompt.prototype.render = function render() {
|
|
return null;
|
|
};
|
|
|
|
return Prompt;
|
|
}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
|
|
|
|
Prompt.propTypes = {
|
|
when: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
|
|
message: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]).isRequired
|
|
};
|
|
Prompt.defaultProps = {
|
|
when: true
|
|
};
|
|
Prompt.contextTypes = {
|
|
router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
|
|
history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
|
|
block: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired
|
|
}).isRequired
|
|
}).isRequired
|
|
};
|
|
|
|
|
|
/* unused harmony default export */ var _unused_webpack_default_export = (Prompt);
|
|
|
|
/***/ }),
|
|
/* 60 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(2);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_warning__ = __webpack_require__(4);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_warning__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_invariant__ = __webpack_require__(3);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_invariant__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_history__ = __webpack_require__(13);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__generatePath__ = __webpack_require__(30);
|
|
var _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; };
|
|
|
|
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; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* The public API for updating the location programmatically
|
|
* with a component.
|
|
*/
|
|
|
|
var Redirect = function (_React$Component) {
|
|
_inherits(Redirect, _React$Component);
|
|
|
|
function Redirect() {
|
|
_classCallCheck(this, Redirect);
|
|
|
|
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
}
|
|
|
|
Redirect.prototype.isStatic = function isStatic() {
|
|
return this.context.router && this.context.router.staticContext;
|
|
};
|
|
|
|
Redirect.prototype.componentWillMount = function componentWillMount() {
|
|
__WEBPACK_IMPORTED_MODULE_3_invariant___default()(this.context.router, "You should not use <Redirect> outside a <Router>");
|
|
|
|
if (this.isStatic()) this.perform();
|
|
};
|
|
|
|
Redirect.prototype.componentDidMount = function componentDidMount() {
|
|
if (!this.isStatic()) this.perform();
|
|
};
|
|
|
|
Redirect.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
|
|
var prevTo = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_history__["b" /* createLocation */])(prevProps.to);
|
|
var nextTo = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_history__["b" /* createLocation */])(this.props.to);
|
|
|
|
if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_history__["c" /* locationsAreEqual */])(prevTo, nextTo)) {
|
|
__WEBPACK_IMPORTED_MODULE_2_warning___default()(false, "You tried to redirect to the same route you're currently on: " + ("\"" + nextTo.pathname + nextTo.search + "\""));
|
|
return;
|
|
}
|
|
|
|
this.perform();
|
|
};
|
|
|
|
Redirect.prototype.computeTo = function computeTo(_ref) {
|
|
var computedMatch = _ref.computedMatch,
|
|
to = _ref.to;
|
|
|
|
if (computedMatch) {
|
|
if (typeof to === "string") {
|
|
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__generatePath__["a" /* default */])(to, computedMatch.params);
|
|
} else {
|
|
return _extends({}, to, {
|
|
pathname: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__generatePath__["a" /* default */])(to.pathname, computedMatch.params)
|
|
});
|
|
}
|
|
}
|
|
|
|
return to;
|
|
};
|
|
|
|
Redirect.prototype.perform = function perform() {
|
|
var history = this.context.router.history;
|
|
var push = this.props.push;
|
|
|
|
var to = this.computeTo(this.props);
|
|
|
|
if (push) {
|
|
history.push(to);
|
|
} else {
|
|
history.replace(to);
|
|
}
|
|
};
|
|
|
|
Redirect.prototype.render = function render() {
|
|
return null;
|
|
};
|
|
|
|
return Redirect;
|
|
}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
|
|
|
|
Redirect.propTypes = {
|
|
computedMatch: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, // private, from <Switch>
|
|
push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
|
|
from: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
|
|
to: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object]).isRequired
|
|
};
|
|
Redirect.defaultProps = {
|
|
push: false
|
|
};
|
|
Redirect.contextTypes = {
|
|
router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
|
|
history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
|
|
push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired,
|
|
replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired
|
|
}).isRequired,
|
|
staticContext: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object
|
|
}).isRequired
|
|
};
|
|
|
|
|
|
/* unused harmony default export */ var _unused_webpack_default_export = (Redirect);
|
|
|
|
/***/ }),
|
|
/* 61 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(4);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(3);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(1);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(2);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_history__ = __webpack_require__(13);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Router__ = __webpack_require__(17);
|
|
var _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; };
|
|
|
|
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
|
|
|
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 addLeadingSlash = function addLeadingSlash(path) {
|
|
return path.charAt(0) === "/" ? path : "/" + path;
|
|
};
|
|
|
|
var addBasename = function addBasename(basename, location) {
|
|
if (!basename) return location;
|
|
|
|
return _extends({}, location, {
|
|
pathname: addLeadingSlash(basename) + location.pathname
|
|
});
|
|
};
|
|
|
|
var stripBasename = function stripBasename(basename, location) {
|
|
if (!basename) return location;
|
|
|
|
var base = addLeadingSlash(basename);
|
|
|
|
if (location.pathname.indexOf(base) !== 0) return location;
|
|
|
|
return _extends({}, location, {
|
|
pathname: location.pathname.substr(base.length)
|
|
});
|
|
};
|
|
|
|
var createURL = function createURL(location) {
|
|
return typeof location === "string" ? location : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_history__["a" /* createPath */])(location);
|
|
};
|
|
|
|
var staticHandler = function staticHandler(methodName) {
|
|
return function () {
|
|
__WEBPACK_IMPORTED_MODULE_1_invariant___default()(false, "You cannot %s with <StaticRouter>", methodName);
|
|
};
|
|
};
|
|
|
|
var noop = function noop() {};
|
|
|
|
/**
|
|
* The public top-level API for a "static" <Router>, so-called because it
|
|
* can't actually change the current location. Instead, it just records
|
|
* location changes in a context object. Useful mainly in testing and
|
|
* server-rendering scenarios.
|
|
*/
|
|
|
|
var StaticRouter = function (_React$Component) {
|
|
_inherits(StaticRouter, _React$Component);
|
|
|
|
function StaticRouter() {
|
|
var _temp, _this, _ret;
|
|
|
|
_classCallCheck(this, StaticRouter);
|
|
|
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.createHref = function (path) {
|
|
return addLeadingSlash(_this.props.basename + createURL(path));
|
|
}, _this.handlePush = function (location) {
|
|
var _this$props = _this.props,
|
|
basename = _this$props.basename,
|
|
context = _this$props.context;
|
|
|
|
context.action = "PUSH";
|
|
context.location = addBasename(basename, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_history__["b" /* createLocation */])(location));
|
|
context.url = createURL(context.location);
|
|
}, _this.handleReplace = function (location) {
|
|
var _this$props2 = _this.props,
|
|
basename = _this$props2.basename,
|
|
context = _this$props2.context;
|
|
|
|
context.action = "REPLACE";
|
|
context.location = addBasename(basename, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_history__["b" /* createLocation */])(location));
|
|
context.url = createURL(context.location);
|
|
}, _this.handleListen = function () {
|
|
return noop;
|
|
}, _this.handleBlock = function () {
|
|
return noop;
|
|
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
}
|
|
|
|
StaticRouter.prototype.getChildContext = function getChildContext() {
|
|
return {
|
|
router: {
|
|
staticContext: this.props.context
|
|
}
|
|
};
|
|
};
|
|
|
|
StaticRouter.prototype.componentWillMount = function componentWillMount() {
|
|
__WEBPACK_IMPORTED_MODULE_0_warning___default()(!this.props.history, "<StaticRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { StaticRouter as Router }`.");
|
|
};
|
|
|
|
StaticRouter.prototype.render = function render() {
|
|
var _props = this.props,
|
|
basename = _props.basename,
|
|
context = _props.context,
|
|
location = _props.location,
|
|
props = _objectWithoutProperties(_props, ["basename", "context", "location"]);
|
|
|
|
var history = {
|
|
createHref: this.createHref,
|
|
action: "POP",
|
|
location: stripBasename(basename, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_history__["b" /* createLocation */])(location)),
|
|
push: this.handlePush,
|
|
replace: this.handleReplace,
|
|
go: staticHandler("go"),
|
|
goBack: staticHandler("goBack"),
|
|
goForward: staticHandler("goForward"),
|
|
listen: this.handleListen,
|
|
block: this.handleBlock
|
|
};
|
|
|
|
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5__Router__["a" /* default */], _extends({}, props, { history: history }));
|
|
};
|
|
|
|
return StaticRouter;
|
|
}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);
|
|
|
|
StaticRouter.propTypes = {
|
|
basename: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string,
|
|
context: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,
|
|
location: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object])
|
|
};
|
|
StaticRouter.defaultProps = {
|
|
basename: "",
|
|
location: "/"
|
|
};
|
|
StaticRouter.childContextTypes = {
|
|
router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired
|
|
};
|
|
|
|
|
|
/* unused harmony default export */ var _unused_webpack_default_export = (StaticRouter);
|
|
|
|
/***/ }),
|
|
/* 62 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(2);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_warning__ = __webpack_require__(4);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_warning__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_invariant__ = __webpack_require__(3);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_invariant__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__matchPath__ = __webpack_require__(18);
|
|
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; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* The public API for rendering the first <Route> that matches.
|
|
*/
|
|
|
|
var Switch = function (_React$Component) {
|
|
_inherits(Switch, _React$Component);
|
|
|
|
function Switch() {
|
|
_classCallCheck(this, Switch);
|
|
|
|
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
}
|
|
|
|
Switch.prototype.componentWillMount = function componentWillMount() {
|
|
__WEBPACK_IMPORTED_MODULE_3_invariant___default()(this.context.router, "You should not use <Switch> outside a <Router>");
|
|
};
|
|
|
|
Switch.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
|
__WEBPACK_IMPORTED_MODULE_2_warning___default()(!(nextProps.location && !this.props.location), '<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.');
|
|
|
|
__WEBPACK_IMPORTED_MODULE_2_warning___default()(!(!nextProps.location && this.props.location), '<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.');
|
|
};
|
|
|
|
Switch.prototype.render = function render() {
|
|
var route = this.context.router.route;
|
|
var children = this.props.children;
|
|
|
|
var location = this.props.location || route.location;
|
|
|
|
var match = void 0,
|
|
child = void 0;
|
|
__WEBPACK_IMPORTED_MODULE_0_react___default.a.Children.forEach(children, function (element) {
|
|
if (match == null && __WEBPACK_IMPORTED_MODULE_0_react___default.a.isValidElement(element)) {
|
|
var _element$props = element.props,
|
|
pathProp = _element$props.path,
|
|
exact = _element$props.exact,
|
|
strict = _element$props.strict,
|
|
sensitive = _element$props.sensitive,
|
|
from = _element$props.from;
|
|
|
|
var path = pathProp || from;
|
|
|
|
child = element;
|
|
match = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__matchPath__["a" /* default */])(location.pathname, { path: path, exact: exact, strict: strict, sensitive: sensitive }, route.match);
|
|
}
|
|
});
|
|
|
|
return match ? __WEBPACK_IMPORTED_MODULE_0_react___default.a.cloneElement(child, { location: location, computedMatch: match }) : null;
|
|
};
|
|
|
|
return Switch;
|
|
}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
|
|
|
|
Switch.contextTypes = {
|
|
router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
|
|
route: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired
|
|
}).isRequired
|
|
};
|
|
Switch.propTypes = {
|
|
children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node,
|
|
location: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object
|
|
};
|
|
|
|
|
|
/* unused harmony default export */ var _unused_webpack_default_export = (Switch);
|
|
|
|
/***/ }),
|
|
/* 63 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(2);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__ = __webpack_require__(41);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__);
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Route__ = __webpack_require__(29);
|
|
var _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; };
|
|
|
|
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* A public higher-order component to access the imperative API
|
|
*/
|
|
var withRouter = function withRouter(Component) {
|
|
var C = function C(props) {
|
|
var wrappedComponentRef = props.wrappedComponentRef,
|
|
remainingProps = _objectWithoutProperties(props, ["wrappedComponentRef"]);
|
|
|
|
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3__Route__["a" /* default */], {
|
|
children: function children(routeComponentProps) {
|
|
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Component, _extends({}, remainingProps, routeComponentProps, {
|
|
ref: wrappedComponentRef
|
|
}));
|
|
}
|
|
});
|
|
};
|
|
|
|
C.displayName = "withRouter(" + (Component.displayName || Component.name) + ")";
|
|
C.WrappedComponent = Component;
|
|
C.propTypes = {
|
|
wrappedComponentRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func
|
|
};
|
|
|
|
return __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default()(C, Component);
|
|
};
|
|
|
|
/* unused harmony default export */ var _unused_webpack_default_export = (withRouter);
|
|
|
|
/***/ }),
|
|
/* 64 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.6.1
|
|
* react.development.js
|
|
*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
if (process.env.NODE_ENV !== "production") {
|
|
(function() {
|
|
'use strict';
|
|
|
|
var _assign = __webpack_require__(14);
|
|
var checkPropTypes = __webpack_require__(23);
|
|
|
|
// TODO: this is special because it gets imported during build.
|
|
|
|
var ReactVersion = '16.6.1';
|
|
|
|
// 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;
|
|
|
|
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_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
|
|
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
|
|
function getIteratorFn(maybeIterable) {
|
|
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
return null;
|
|
}
|
|
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
if (typeof maybeIterator === 'function') {
|
|
return maybeIterator;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
var enableHooks = false;
|
|
// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
|
|
|
|
|
|
// In some cases, StrictMode should also double-render lifecycles.
|
|
// This can be confusing for tests though,
|
|
// And it can be bad for performance in production.
|
|
// This feature flag can be used to control the behavior:
|
|
|
|
|
|
// To preserve the "Pause on caught exceptions" behavior of the debugger, we
|
|
// replay the begin phase of a failed component inside invokeGuardedCallback.
|
|
|
|
|
|
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
|
|
|
|
|
// Gather advanced timing metrics for Profiler subtrees.
|
|
|
|
|
|
// Trace which interactions trigger each commit.
|
|
|
|
|
|
// Only used in www builds.
|
|
|
|
|
|
// Only used in www builds.
|
|
|
|
|
|
// React Fire: prevent the value and checked attributes from syncing
|
|
// with their related DOM properties
|
|
|
|
|
|
// These APIs will no longer be "unstable" in the upcoming 16.7 release,
|
|
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
|
|
var enableStableConcurrentModeAPIs = false;
|
|
|
|
/**
|
|
* Use invariant() to assert state which your program assumes to be true.
|
|
*
|
|
* Provide sprintf-style format (only %s is supported) and arguments
|
|
* to provide information about what broke and what you were
|
|
* expecting.
|
|
*
|
|
* The invariant message will be stripped in production, but the invariant
|
|
* will remain to ensure logic does not differ in production.
|
|
*/
|
|
|
|
var validateFormat = function () {};
|
|
|
|
{
|
|
validateFormat = function (format) {
|
|
if (format === undefined) {
|
|
throw new Error('invariant requires an error message argument');
|
|
}
|
|
};
|
|
}
|
|
|
|
function invariant(condition, format, a, b, c, d, e, f) {
|
|
validateFormat(format);
|
|
|
|
if (!condition) {
|
|
var error = void 0;
|
|
if (format === undefined) {
|
|
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
|
} else {
|
|
var args = [a, b, c, d, e, f];
|
|
var argIndex = 0;
|
|
error = new Error(format.replace(/%s/g, function () {
|
|
return args[argIndex++];
|
|
}));
|
|
error.name = 'Invariant Violation';
|
|
}
|
|
|
|
error.framesToPop = 1; // we don't care about invariant's own frame
|
|
throw error;
|
|
}
|
|
}
|
|
|
|
// Relying on the `invariant()` implementation lets us
|
|
// preserve the format and params in the www builds.
|
|
|
|
/**
|
|
* 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;
|
|
|
|
/**
|
|
* 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 warningWithoutStack = function () {};
|
|
|
|
{
|
|
warningWithoutStack = function (condition, format) {
|
|
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
args[_key - 2] = arguments[_key];
|
|
}
|
|
|
|
if (format === undefined) {
|
|
throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
}
|
|
if (args.length > 8) {
|
|
// Check before the condition to catch violations early.
|
|
throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
|
|
}
|
|
if (condition) {
|
|
return;
|
|
}
|
|
if (typeof console !== 'undefined') {
|
|
var argsWithFormat = args.map(function (item) {
|
|
return '' + item;
|
|
});
|
|
argsWithFormat.unshift('Warning: ' + format);
|
|
|
|
// We intentionally don't use spread (or .apply) directly because it
|
|
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
Function.prototype.apply.call(console.error, console, argsWithFormat);
|
|
}
|
|
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.
|
|
var argIndex = 0;
|
|
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
return args[argIndex++];
|
|
});
|
|
throw new Error(message);
|
|
} catch (x) {}
|
|
};
|
|
}
|
|
|
|
var warningWithoutStack$1 = warningWithoutStack;
|
|
|
|
var didWarnStateUpdateForUnmountedComponent = {};
|
|
|
|
function warnNoop(publicInstance, callerName) {
|
|
{
|
|
var _constructor = publicInstance.constructor;
|
|
var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
|
|
var warningKey = componentName + '.' + callerName;
|
|
if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
|
return;
|
|
}
|
|
warningWithoutStack$1(false, "Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
|
|
didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* This is the abstract API for an update queue.
|
|
*/
|
|
var ReactNoopUpdateQueue = {
|
|
/**
|
|
* Checks whether or not this composite component is mounted.
|
|
* @param {ReactClass} publicInstance The instance we want to test.
|
|
* @return {boolean} True if mounted, false otherwise.
|
|
* @protected
|
|
* @final
|
|
*/
|
|
isMounted: function (publicInstance) {
|
|
return false;
|
|
},
|
|
|
|
/**
|
|
* Forces an update. This should only be invoked when it is known with
|
|
* certainty that we are **not** in a DOM transaction.
|
|
*
|
|
* You may want to call this when you know that some deeper aspect of the
|
|
* component's state has changed but `setState` was not called.
|
|
*
|
|
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
* `componentWillUpdate` and `componentDidUpdate`.
|
|
*
|
|
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
* @param {?function} callback Called after component is updated.
|
|
* @param {?string} callerName name of the calling function in the public API.
|
|
* @internal
|
|
*/
|
|
enqueueForceUpdate: function (publicInstance, callback, callerName) {
|
|
warnNoop(publicInstance, 'forceUpdate');
|
|
},
|
|
|
|
/**
|
|
* Replaces all of the state. Always use this or `setState` to mutate state.
|
|
* You should treat `this.state` as immutable.
|
|
*
|
|
* There is no guarantee that `this.state` will be immediately updated, so
|
|
* accessing `this.state` after calling this method may return the old value.
|
|
*
|
|
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
* @param {object} completeState Next state.
|
|
* @param {?function} callback Called after component is updated.
|
|
* @param {?string} callerName name of the calling function in the public API.
|
|
* @internal
|
|
*/
|
|
enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
|
|
warnNoop(publicInstance, 'replaceState');
|
|
},
|
|
|
|
/**
|
|
* Sets a subset of the state. This only exists because _pendingState is
|
|
* internal. This provides a merging strategy that is not available to deep
|
|
* properties which is confusing. TODO: Expose pendingState or don't use it
|
|
* during the merge.
|
|
*
|
|
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
* @param {object} partialState Next partial state to be merged with state.
|
|
* @param {?function} callback Called after component is updated.
|
|
* @param {?string} Name of the calling function in the public API.
|
|
* @internal
|
|
*/
|
|
enqueueSetState: function (publicInstance, partialState, callback, callerName) {
|
|
warnNoop(publicInstance, 'setState');
|
|
}
|
|
};
|
|
|
|
var emptyObject = {};
|
|
{
|
|
Object.freeze(emptyObject);
|
|
}
|
|
|
|
/**
|
|
* Base class helpers for the updating state of a component.
|
|
*/
|
|
function Component(props, context, updater) {
|
|
this.props = props;
|
|
this.context = context;
|
|
// If a component has string refs, we will assign a different object later.
|
|
this.refs = emptyObject;
|
|
// We initialize the default updater but the real one gets injected by the
|
|
// renderer.
|
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
}
|
|
|
|
Component.prototype.isReactComponent = {};
|
|
|
|
/**
|
|
* Sets a subset of the state. Always use this to mutate
|
|
* state. You should treat `this.state` as immutable.
|
|
*
|
|
* There is no guarantee that `this.state` will be immediately updated, so
|
|
* accessing `this.state` after calling this method may return the old value.
|
|
*
|
|
* There is no guarantee that calls to `setState` will run synchronously,
|
|
* as they may eventually be batched together. You can provide an optional
|
|
* callback that will be executed when the call to setState is actually
|
|
* completed.
|
|
*
|
|
* When a function is provided to setState, it will be called at some point in
|
|
* the future (not synchronously). It will be called with the up to date
|
|
* component arguments (state, props, context). These values can be different
|
|
* from this.* because your function may be called after receiveProps but before
|
|
* shouldComponentUpdate, and this new state, props, and context will not yet be
|
|
* assigned to this.
|
|
*
|
|
* @param {object|function} partialState Next partial state or function to
|
|
* produce next partial state to be merged with current state.
|
|
* @param {?function} callback Called after state is updated.
|
|
* @final
|
|
* @protected
|
|
*/
|
|
Component.prototype.setState = function (partialState, callback) {
|
|
!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : void 0;
|
|
this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
|
};
|
|
|
|
/**
|
|
* Forces an update. This should only be invoked when it is known with
|
|
* certainty that we are **not** in a DOM transaction.
|
|
*
|
|
* You may want to call this when you know that some deeper aspect of the
|
|
* component's state has changed but `setState` was not called.
|
|
*
|
|
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
* `componentWillUpdate` and `componentDidUpdate`.
|
|
*
|
|
* @param {?function} callback Called after update is complete.
|
|
* @final
|
|
* @protected
|
|
*/
|
|
Component.prototype.forceUpdate = function (callback) {
|
|
this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
|
|
};
|
|
|
|
/**
|
|
* Deprecated APIs. These APIs used to exist on classic React classes but since
|
|
* we would like to deprecate them, we're not going to move them over to this
|
|
* modern base class. Instead, we define a getter that warns if it's accessed.
|
|
*/
|
|
{
|
|
var deprecatedAPIs = {
|
|
isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
|
replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
|
};
|
|
var defineDeprecationWarning = function (methodName, info) {
|
|
Object.defineProperty(Component.prototype, methodName, {
|
|
get: function () {
|
|
lowPriorityWarning$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
|
|
return undefined;
|
|
}
|
|
});
|
|
};
|
|
for (var fnName in deprecatedAPIs) {
|
|
if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
|
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
}
|
|
}
|
|
}
|
|
|
|
function ComponentDummy() {}
|
|
ComponentDummy.prototype = Component.prototype;
|
|
|
|
/**
|
|
* Convenience component with default shallow equality check for sCU.
|
|
*/
|
|
function PureComponent(props, context, updater) {
|
|
this.props = props;
|
|
this.context = context;
|
|
// If a component has string refs, we will assign a different object later.
|
|
this.refs = emptyObject;
|
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
}
|
|
|
|
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
pureComponentPrototype.constructor = PureComponent;
|
|
// Avoid an extra prototype jump for these methods.
|
|
_assign(pureComponentPrototype, Component.prototype);
|
|
pureComponentPrototype.isPureReactComponent = true;
|
|
|
|
// an immutable object with a single mutable value
|
|
function createRef() {
|
|
var refObject = {
|
|
current: null
|
|
};
|
|
{
|
|
Object.seal(refObject);
|
|
}
|
|
return refObject;
|
|
}
|
|
|
|
/**
|
|
* Keeps track of the current owner.
|
|
*
|
|
* The current owner is the component who should own any components that are
|
|
* currently being constructed.
|
|
*/
|
|
var ReactCurrentOwner = {
|
|
/**
|
|
* @internal
|
|
* @type {ReactComponent}
|
|
*/
|
|
current: null,
|
|
currentDispatcher: null
|
|
};
|
|
|
|
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
|
|
var describeComponentFrame = function (name, source, ownerName) {
|
|
var sourceInfo = '';
|
|
if (source) {
|
|
var path = source.fileName;
|
|
var fileName = path.replace(BEFORE_SLASH_RE, '');
|
|
{
|
|
// In DEV, include code for a common special case:
|
|
// prefer "folder/index.js" instead of just "index.js".
|
|
if (/^index\./.test(fileName)) {
|
|
var match = path.match(BEFORE_SLASH_RE);
|
|
if (match) {
|
|
var pathBeforeSlash = match[1];
|
|
if (pathBeforeSlash) {
|
|
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
|
fileName = folderName + '/' + fileName;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
|
} else if (ownerName) {
|
|
sourceInfo = ' (created by ' + ownerName + ')';
|
|
}
|
|
return '\n in ' + (name || 'Unknown') + sourceInfo;
|
|
};
|
|
|
|
var Resolved = 1;
|
|
|
|
|
|
function refineResolvedLazyComponent(lazyComponent) {
|
|
return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
|
}
|
|
|
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
var functionName = innerType.displayName || innerType.name || '';
|
|
return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
|
|
}
|
|
|
|
function getComponentName(type) {
|
|
if (type == null) {
|
|
// Host root, text node or just invalid type.
|
|
return null;
|
|
}
|
|
{
|
|
if (typeof type.tag === 'number') {
|
|
warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
}
|
|
}
|
|
if (typeof type === 'function') {
|
|
return type.displayName || type.name || null;
|
|
}
|
|
if (typeof type === 'string') {
|
|
return type;
|
|
}
|
|
switch (type) {
|
|
case REACT_CONCURRENT_MODE_TYPE:
|
|
return 'ConcurrentMode';
|
|
case REACT_FRAGMENT_TYPE:
|
|
return 'Fragment';
|
|
case REACT_PORTAL_TYPE:
|
|
return 'Portal';
|
|
case REACT_PROFILER_TYPE:
|
|
return 'Profiler';
|
|
case REACT_STRICT_MODE_TYPE:
|
|
return 'StrictMode';
|
|
case REACT_SUSPENSE_TYPE:
|
|
return 'Suspense';
|
|
}
|
|
if (typeof type === 'object') {
|
|
switch (type.$$typeof) {
|
|
case REACT_CONTEXT_TYPE:
|
|
return 'Context.Consumer';
|
|
case REACT_PROVIDER_TYPE:
|
|
return 'Context.Provider';
|
|
case REACT_FORWARD_REF_TYPE:
|
|
return getWrappedName(type, type.render, 'ForwardRef');
|
|
case REACT_MEMO_TYPE:
|
|
return getComponentName(type.type);
|
|
case REACT_LAZY_TYPE:
|
|
{
|
|
var thenable = type;
|
|
var resolvedThenable = refineResolvedLazyComponent(thenable);
|
|
if (resolvedThenable) {
|
|
return getComponentName(resolvedThenable);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
var ReactDebugCurrentFrame = {};
|
|
|
|
var currentlyValidatingElement = null;
|
|
|
|
function setCurrentlyValidatingElement(element) {
|
|
{
|
|
currentlyValidatingElement = element;
|
|
}
|
|
}
|
|
|
|
{
|
|
// Stack implementation injected by the current renderer.
|
|
ReactDebugCurrentFrame.getCurrentStack = null;
|
|
|
|
ReactDebugCurrentFrame.getStackAddendum = function () {
|
|
var stack = '';
|
|
|
|
// Add an extra top frame while an element is being validated
|
|
if (currentlyValidatingElement) {
|
|
var name = getComponentName(currentlyValidatingElement.type);
|
|
var owner = currentlyValidatingElement._owner;
|
|
stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
|
|
}
|
|
|
|
// Delegate to the injected renderer-specific implementation
|
|
var impl = ReactDebugCurrentFrame.getCurrentStack;
|
|
if (impl) {
|
|
stack += impl() || '';
|
|
}
|
|
|
|
return stack;
|
|
};
|
|
}
|
|
|
|
var ReactSharedInternals = {
|
|
ReactCurrentOwner: ReactCurrentOwner,
|
|
// Used by renderers to avoid bundling object-assign twice in UMD bundles:
|
|
assign: _assign
|
|
};
|
|
|
|
{
|
|
_assign(ReactSharedInternals, {
|
|
// These should not be included in production.
|
|
ReactDebugCurrentFrame: ReactDebugCurrentFrame,
|
|
// Shim for React DOM 16.0.0 which still destructured (but not used) this.
|
|
// TODO: remove in React 17.0.
|
|
ReactComponentTreeHook: {}
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 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 warning = warningWithoutStack$1;
|
|
|
|
{
|
|
warning = function (condition, format) {
|
|
if (condition) {
|
|
return;
|
|
}
|
|
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
// eslint-disable-next-line react-internal/warning-and-invariant-args
|
|
|
|
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
args[_key - 2] = arguments[_key];
|
|
}
|
|
|
|
warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack]));
|
|
};
|
|
}
|
|
|
|
var warning$1 = warning;
|
|
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
|
|
var RESERVED_PROPS = {
|
|
key: true,
|
|
ref: true,
|
|
__self: true,
|
|
__source: true
|
|
};
|
|
|
|
var specialPropKeyWarningShown = void 0;
|
|
var specialPropRefWarningShown = void 0;
|
|
|
|
function hasValidRef(config) {
|
|
{
|
|
if (hasOwnProperty.call(config, 'ref')) {
|
|
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
if (getter && getter.isReactWarning) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
return config.ref !== undefined;
|
|
}
|
|
|
|
function hasValidKey(config) {
|
|
{
|
|
if (hasOwnProperty.call(config, 'key')) {
|
|
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
|
if (getter && getter.isReactWarning) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
return config.key !== undefined;
|
|
}
|
|
|
|
function defineKeyPropWarningGetter(props, displayName) {
|
|
var warnAboutAccessingKey = function () {
|
|
if (!specialPropKeyWarningShown) {
|
|
specialPropKeyWarningShown = true;
|
|
warningWithoutStack$1(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
|
|
}
|
|
};
|
|
warnAboutAccessingKey.isReactWarning = true;
|
|
Object.defineProperty(props, 'key', {
|
|
get: warnAboutAccessingKey,
|
|
configurable: true
|
|
});
|
|
}
|
|
|
|
function defineRefPropWarningGetter(props, displayName) {
|
|
var warnAboutAccessingRef = function () {
|
|
if (!specialPropRefWarningShown) {
|
|
specialPropRefWarningShown = true;
|
|
warningWithoutStack$1(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
|
|
}
|
|
};
|
|
warnAboutAccessingRef.isReactWarning = true;
|
|
Object.defineProperty(props, 'ref', {
|
|
get: warnAboutAccessingRef,
|
|
configurable: true
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Factory method to create a new React element. This no longer adheres to
|
|
* the class pattern, so do not use new to call it. Also, no instanceof check
|
|
* will work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
* if something is a React Element.
|
|
*
|
|
* @param {*} type
|
|
* @param {*} key
|
|
* @param {string|object} ref
|
|
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
* different from the `owner` when React.createElement is called, so that we
|
|
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
* functions, and as long as `this` and owner are the same, there will be no
|
|
* change in behavior.
|
|
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
* indicating filename, line number, and/or other information.
|
|
* @param {*} owner
|
|
* @param {*} props
|
|
* @internal
|
|
*/
|
|
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
var element = {
|
|
// This tag allows us to uniquely identify this as a React Element
|
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
|
|
// Built-in properties that belong on the element
|
|
type: type,
|
|
key: key,
|
|
ref: ref,
|
|
props: props,
|
|
|
|
// Record the component responsible for creating this element.
|
|
_owner: owner
|
|
};
|
|
|
|
{
|
|
// The validation flag is currently mutative. We put it on
|
|
// an external backing store so that we can freeze the whole object.
|
|
// This can be replaced with a WeakMap once they are implemented in
|
|
// commonly used development environments.
|
|
element._store = {};
|
|
|
|
// To make comparing ReactElements easier for testing purposes, we make
|
|
// the validation flag non-enumerable (where possible, which should
|
|
// include every environment we run tests in), so the test framework
|
|
// ignores it.
|
|
Object.defineProperty(element._store, 'validated', {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: true,
|
|
value: false
|
|
});
|
|
// self and source are DEV only properties.
|
|
Object.defineProperty(element, '_self', {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: false,
|
|
value: self
|
|
});
|
|
// Two elements created in two different places should be considered
|
|
// equal for testing purposes and therefore we hide it from enumeration.
|
|
Object.defineProperty(element, '_source', {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: false,
|
|
value: source
|
|
});
|
|
if (Object.freeze) {
|
|
Object.freeze(element.props);
|
|
Object.freeze(element);
|
|
}
|
|
}
|
|
|
|
return element;
|
|
};
|
|
|
|
/**
|
|
* Create and return a new ReactElement of the given type.
|
|
* See https://reactjs.org/docs/react-api.html#createelement
|
|
*/
|
|
function createElement(type, config, children) {
|
|
var propName = void 0;
|
|
|
|
// Reserved names are extracted
|
|
var props = {};
|
|
|
|
var key = null;
|
|
var ref = null;
|
|
var self = null;
|
|
var source = null;
|
|
|
|
if (config != null) {
|
|
if (hasValidRef(config)) {
|
|
ref = config.ref;
|
|
}
|
|
if (hasValidKey(config)) {
|
|
key = '' + config.key;
|
|
}
|
|
|
|
self = config.__self === undefined ? null : config.__self;
|
|
source = config.__source === undefined ? null : config.__source;
|
|
// Remaining properties are added to a new props object
|
|
for (propName in config) {
|
|
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
props[propName] = config[propName];
|
|
}
|
|
}
|
|
}
|
|
|
|
// Children can be more than one argument, and those are transferred onto
|
|
// the newly allocated props object.
|
|
var childrenLength = arguments.length - 2;
|
|
if (childrenLength === 1) {
|
|
props.children = children;
|
|
} else if (childrenLength > 1) {
|
|
var childArray = Array(childrenLength);
|
|
for (var i = 0; i < childrenLength; i++) {
|
|
childArray[i] = arguments[i + 2];
|
|
}
|
|
{
|
|
if (Object.freeze) {
|
|
Object.freeze(childArray);
|
|
}
|
|
}
|
|
props.children = childArray;
|
|
}
|
|
|
|
// Resolve default props
|
|
if (type && type.defaultProps) {
|
|
var defaultProps = type.defaultProps;
|
|
for (propName in defaultProps) {
|
|
if (props[propName] === undefined) {
|
|
props[propName] = defaultProps[propName];
|
|
}
|
|
}
|
|
}
|
|
{
|
|
if (key || ref) {
|
|
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
if (key) {
|
|
defineKeyPropWarningGetter(props, displayName);
|
|
}
|
|
if (ref) {
|
|
defineRefPropWarningGetter(props, displayName);
|
|
}
|
|
}
|
|
}
|
|
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
}
|
|
|
|
/**
|
|
* Return a function that produces ReactElements of a given type.
|
|
* See https://reactjs.org/docs/react-api.html#createfactory
|
|
*/
|
|
|
|
|
|
function cloneAndReplaceKey(oldElement, newKey) {
|
|
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
|
|
|
return newElement;
|
|
}
|
|
|
|
/**
|
|
* Clone and return a new ReactElement using element as the starting point.
|
|
* See https://reactjs.org/docs/react-api.html#cloneelement
|
|
*/
|
|
function cloneElement(element, config, children) {
|
|
!!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;
|
|
|
|
var propName = void 0;
|
|
|
|
// Original props are copied
|
|
var props = _assign({}, element.props);
|
|
|
|
// Reserved names are extracted
|
|
var key = element.key;
|
|
var ref = element.ref;
|
|
// Self is preserved since the owner is preserved.
|
|
var self = element._self;
|
|
// Source is preserved since cloneElement is unlikely to be targeted by a
|
|
// transpiler, and the original source is probably a better indicator of the
|
|
// true owner.
|
|
var source = element._source;
|
|
|
|
// Owner will be preserved, unless ref is overridden
|
|
var owner = element._owner;
|
|
|
|
if (config != null) {
|
|
if (hasValidRef(config)) {
|
|
// Silently steal the ref from the parent.
|
|
ref = config.ref;
|
|
owner = ReactCurrentOwner.current;
|
|
}
|
|
if (hasValidKey(config)) {
|
|
key = '' + config.key;
|
|
}
|
|
|
|
// Remaining properties override existing props
|
|
var defaultProps = void 0;
|
|
if (element.type && element.type.defaultProps) {
|
|
defaultProps = element.type.defaultProps;
|
|
}
|
|
for (propName in config) {
|
|
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
if (config[propName] === undefined && defaultProps !== undefined) {
|
|
// Resolve default props
|
|
props[propName] = defaultProps[propName];
|
|
} else {
|
|
props[propName] = config[propName];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Children can be more than one argument, and those are transferred onto
|
|
// the newly allocated props object.
|
|
var childrenLength = arguments.length - 2;
|
|
if (childrenLength === 1) {
|
|
props.children = children;
|
|
} else if (childrenLength > 1) {
|
|
var childArray = Array(childrenLength);
|
|
for (var i = 0; i < childrenLength; i++) {
|
|
childArray[i] = arguments[i + 2];
|
|
}
|
|
props.children = childArray;
|
|
}
|
|
|
|
return ReactElement(element.type, key, ref, self, source, owner, props);
|
|
}
|
|
|
|
/**
|
|
* Verifies the object is a ReactElement.
|
|
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
* @param {?object} object
|
|
* @return {boolean} True if `object` is a ReactElement.
|
|
* @final
|
|
*/
|
|
function isValidElement(object) {
|
|
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
}
|
|
|
|
var SEPARATOR = '.';
|
|
var SUBSEPARATOR = ':';
|
|
|
|
/**
|
|
* Escape and wrap key so it is safe to use as a reactid
|
|
*
|
|
* @param {string} key to be escaped.
|
|
* @return {string} the escaped key.
|
|
*/
|
|
function escape(key) {
|
|
var escapeRegex = /[=:]/g;
|
|
var escaperLookup = {
|
|
'=': '=0',
|
|
':': '=2'
|
|
};
|
|
var escapedString = ('' + key).replace(escapeRegex, function (match) {
|
|
return escaperLookup[match];
|
|
});
|
|
|
|
return '$' + escapedString;
|
|
}
|
|
|
|
/**
|
|
* TODO: Test that a single child and an array with one item have the same key
|
|
* pattern.
|
|
*/
|
|
|
|
var didWarnAboutMaps = false;
|
|
|
|
var userProvidedKeyEscapeRegex = /\/+/g;
|
|
function escapeUserProvidedKey(text) {
|
|
return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
|
|
}
|
|
|
|
var POOL_SIZE = 10;
|
|
var traverseContextPool = [];
|
|
function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
|
|
if (traverseContextPool.length) {
|
|
var traverseContext = traverseContextPool.pop();
|
|
traverseContext.result = mapResult;
|
|
traverseContext.keyPrefix = keyPrefix;
|
|
traverseContext.func = mapFunction;
|
|
traverseContext.context = mapContext;
|
|
traverseContext.count = 0;
|
|
return traverseContext;
|
|
} else {
|
|
return {
|
|
result: mapResult,
|
|
keyPrefix: keyPrefix,
|
|
func: mapFunction,
|
|
context: mapContext,
|
|
count: 0
|
|
};
|
|
}
|
|
}
|
|
|
|
function releaseTraverseContext(traverseContext) {
|
|
traverseContext.result = null;
|
|
traverseContext.keyPrefix = null;
|
|
traverseContext.func = null;
|
|
traverseContext.context = null;
|
|
traverseContext.count = 0;
|
|
if (traverseContextPool.length < POOL_SIZE) {
|
|
traverseContextPool.push(traverseContext);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @param {?*} children Children tree container.
|
|
* @param {!string} nameSoFar Name of the key path so far.
|
|
* @param {!function} callback Callback to invoke with each child found.
|
|
* @param {?*} traverseContext Used to pass information throughout the traversal
|
|
* process.
|
|
* @return {!number} The number of children in this subtree.
|
|
*/
|
|
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
|
|
var type = typeof children;
|
|
|
|
if (type === 'undefined' || type === 'boolean') {
|
|
// All of the above are perceived as null.
|
|
children = null;
|
|
}
|
|
|
|
var invokeCallback = false;
|
|
|
|
if (children === null) {
|
|
invokeCallback = true;
|
|
} else {
|
|
switch (type) {
|
|
case 'string':
|
|
case 'number':
|
|
invokeCallback = true;
|
|
break;
|
|
case 'object':
|
|
switch (children.$$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
case REACT_PORTAL_TYPE:
|
|
invokeCallback = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (invokeCallback) {
|
|
callback(traverseContext, children,
|
|
// If it's the only child, treat the name as if it was wrapped in an array
|
|
// so that it's consistent if the number of children grows.
|
|
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
|
|
return 1;
|
|
}
|
|
|
|
var child = void 0;
|
|
var nextName = void 0;
|
|
var subtreeCount = 0; // Count of children found in the current subtree.
|
|
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
|
|
if (Array.isArray(children)) {
|
|
for (var i = 0; i < children.length; i++) {
|
|
child = children[i];
|
|
nextName = nextNamePrefix + getComponentKey(child, i);
|
|
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
}
|
|
} else {
|
|
var iteratorFn = getIteratorFn(children);
|
|
if (typeof iteratorFn === 'function') {
|
|
{
|
|
// Warn about using Maps as children
|
|
if (iteratorFn === children.entries) {
|
|
!didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0;
|
|
didWarnAboutMaps = true;
|
|
}
|
|
}
|
|
|
|
var iterator = iteratorFn.call(children);
|
|
var step = void 0;
|
|
var ii = 0;
|
|
while (!(step = iterator.next()).done) {
|
|
child = step.value;
|
|
nextName = nextNamePrefix + getComponentKey(child, ii++);
|
|
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
}
|
|
} else if (type === 'object') {
|
|
var addendum = '';
|
|
{
|
|
addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
|
|
}
|
|
var childrenString = '' + children;
|
|
invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum);
|
|
}
|
|
}
|
|
|
|
return subtreeCount;
|
|
}
|
|
|
|
/**
|
|
* Traverses children that are typically specified as `props.children`, but
|
|
* might also be specified through attributes:
|
|
*
|
|
* - `traverseAllChildren(this.props.children, ...)`
|
|
* - `traverseAllChildren(this.props.leftPanelChildren, ...)`
|
|
*
|
|
* The `traverseContext` is an optional argument that is passed through the
|
|
* entire traversal. It can be used to store accumulations or anything else that
|
|
* the callback might find relevant.
|
|
*
|
|
* @param {?*} children Children tree object.
|
|
* @param {!function} callback To invoke upon traversing each child.
|
|
* @param {?*} traverseContext Context for traversal.
|
|
* @return {!number} The number of children in this subtree.
|
|
*/
|
|
function traverseAllChildren(children, callback, traverseContext) {
|
|
if (children == null) {
|
|
return 0;
|
|
}
|
|
|
|
return traverseAllChildrenImpl(children, '', callback, traverseContext);
|
|
}
|
|
|
|
/**
|
|
* Generate a key string that identifies a component within a set.
|
|
*
|
|
* @param {*} component A component that could contain a manual key.
|
|
* @param {number} index Index that is used if a manual key is not provided.
|
|
* @return {string}
|
|
*/
|
|
function getComponentKey(component, index) {
|
|
// Do some typechecking here since we call this blindly. We want to ensure
|
|
// that we don't block potential future ES APIs.
|
|
if (typeof component === 'object' && component !== null && component.key != null) {
|
|
// Explicit key
|
|
return escape(component.key);
|
|
}
|
|
// Implicit key determined by the index in the set
|
|
return index.toString(36);
|
|
}
|
|
|
|
function forEachSingleChild(bookKeeping, child, name) {
|
|
var func = bookKeeping.func,
|
|
context = bookKeeping.context;
|
|
|
|
func.call(context, child, bookKeeping.count++);
|
|
}
|
|
|
|
/**
|
|
* Iterates through children that are typically specified as `props.children`.
|
|
*
|
|
* See https://reactjs.org/docs/react-api.html#reactchildrenforeach
|
|
*
|
|
* The provided forEachFunc(child, index) will be called for each
|
|
* leaf child.
|
|
*
|
|
* @param {?*} children Children tree container.
|
|
* @param {function(*, int)} forEachFunc
|
|
* @param {*} forEachContext Context for forEachContext.
|
|
*/
|
|
function forEachChildren(children, forEachFunc, forEachContext) {
|
|
if (children == null) {
|
|
return children;
|
|
}
|
|
var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
|
|
traverseAllChildren(children, forEachSingleChild, traverseContext);
|
|
releaseTraverseContext(traverseContext);
|
|
}
|
|
|
|
function mapSingleChildIntoContext(bookKeeping, child, childKey) {
|
|
var result = bookKeeping.result,
|
|
keyPrefix = bookKeeping.keyPrefix,
|
|
func = bookKeeping.func,
|
|
context = bookKeeping.context;
|
|
|
|
|
|
var mappedChild = func.call(context, child, bookKeeping.count++);
|
|
if (Array.isArray(mappedChild)) {
|
|
mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
|
|
return c;
|
|
});
|
|
} else if (mappedChild != null) {
|
|
if (isValidElement(mappedChild)) {
|
|
mappedChild = cloneAndReplaceKey(mappedChild,
|
|
// Keep both the (mapped) and old keys if they differ, just as
|
|
// traverseAllChildren used to do for objects as children
|
|
keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
|
|
}
|
|
result.push(mappedChild);
|
|
}
|
|
}
|
|
|
|
function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
|
var escapedPrefix = '';
|
|
if (prefix != null) {
|
|
escapedPrefix = escapeUserProvidedKey(prefix) + '/';
|
|
}
|
|
var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
|
|
traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
|
|
releaseTraverseContext(traverseContext);
|
|
}
|
|
|
|
/**
|
|
* Maps children that are typically specified as `props.children`.
|
|
*
|
|
* See https://reactjs.org/docs/react-api.html#reactchildrenmap
|
|
*
|
|
* The provided mapFunction(child, key, index) will be called for each
|
|
* leaf child.
|
|
*
|
|
* @param {?*} children Children tree container.
|
|
* @param {function(*, int)} func The map function.
|
|
* @param {*} context Context for mapFunction.
|
|
* @return {object} Object containing the ordered map of results.
|
|
*/
|
|
function mapChildren(children, func, context) {
|
|
if (children == null) {
|
|
return children;
|
|
}
|
|
var result = [];
|
|
mapIntoWithKeyPrefixInternal(children, result, null, func, context);
|
|
return result;
|
|
}
|
|
|
|
/**
|
|
* Count the number of children that are typically specified as
|
|
* `props.children`.
|
|
*
|
|
* See https://reactjs.org/docs/react-api.html#reactchildrencount
|
|
*
|
|
* @param {?*} children Children tree container.
|
|
* @return {number} The number of children.
|
|
*/
|
|
function countChildren(children) {
|
|
return traverseAllChildren(children, function () {
|
|
return null;
|
|
}, null);
|
|
}
|
|
|
|
/**
|
|
* Flatten a children object (typically specified as `props.children`) and
|
|
* return an array with appropriately re-keyed children.
|
|
*
|
|
* See https://reactjs.org/docs/react-api.html#reactchildrentoarray
|
|
*/
|
|
function toArray(children) {
|
|
var result = [];
|
|
mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
|
|
return child;
|
|
});
|
|
return result;
|
|
}
|
|
|
|
/**
|
|
* Returns the first child in a collection of children and verifies that there
|
|
* is only one child in the collection.
|
|
*
|
|
* See https://reactjs.org/docs/react-api.html#reactchildrenonly
|
|
*
|
|
* The current implementation of this function assumes that a single child gets
|
|
* passed without a wrapper, but the purpose of this helper function is to
|
|
* abstract away the particular structure of children.
|
|
*
|
|
* @param {?object} children Child collection structure.
|
|
* @return {ReactElement} The first and only `ReactElement` contained in the
|
|
* structure.
|
|
*/
|
|
function onlyChild(children) {
|
|
!isValidElement(children) ? invariant(false, 'React.Children.only expected to receive a single React element child.') : void 0;
|
|
return children;
|
|
}
|
|
|
|
function createContext(defaultValue, calculateChangedBits) {
|
|
if (calculateChangedBits === undefined) {
|
|
calculateChangedBits = null;
|
|
} else {
|
|
{
|
|
!(calculateChangedBits === null || typeof calculateChangedBits === 'function') ? warningWithoutStack$1(false, 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits) : void 0;
|
|
}
|
|
}
|
|
|
|
var context = {
|
|
$$typeof: REACT_CONTEXT_TYPE,
|
|
_calculateChangedBits: calculateChangedBits,
|
|
// As a workaround to support multiple concurrent renderers, we categorize
|
|
// some renderers as primary and others as secondary. We only expect
|
|
// there to be two concurrent renderers at most: React Native (primary) and
|
|
// Fabric (secondary); React DOM (primary) and React ART (secondary).
|
|
// Secondary renderers store their context values on separate fields.
|
|
_currentValue: defaultValue,
|
|
_currentValue2: defaultValue,
|
|
// These are circular
|
|
Provider: null,
|
|
Consumer: null
|
|
};
|
|
|
|
context.Provider = {
|
|
$$typeof: REACT_PROVIDER_TYPE,
|
|
_context: context
|
|
};
|
|
|
|
var hasWarnedAboutUsingNestedContextConsumers = false;
|
|
var hasWarnedAboutUsingConsumerProvider = false;
|
|
|
|
{
|
|
// A separate object, but proxies back to the original context object for
|
|
// backwards compatibility. It has a different $$typeof, so we can properly
|
|
// warn for the incorrect usage of Context as a Consumer.
|
|
var Consumer = {
|
|
$$typeof: REACT_CONTEXT_TYPE,
|
|
_context: context,
|
|
_calculateChangedBits: context._calculateChangedBits
|
|
};
|
|
// $FlowFixMe: Flow complains about not setting a value, which is intentional here
|
|
Object.defineProperties(Consumer, {
|
|
Provider: {
|
|
get: function () {
|
|
if (!hasWarnedAboutUsingConsumerProvider) {
|
|
hasWarnedAboutUsingConsumerProvider = true;
|
|
warning$1(false, 'Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
|
|
}
|
|
return context.Provider;
|
|
},
|
|
set: function (_Provider) {
|
|
context.Provider = _Provider;
|
|
}
|
|
},
|
|
_currentValue: {
|
|
get: function () {
|
|
return context._currentValue;
|
|
},
|
|
set: function (_currentValue) {
|
|
context._currentValue = _currentValue;
|
|
}
|
|
},
|
|
_currentValue2: {
|
|
get: function () {
|
|
return context._currentValue2;
|
|
},
|
|
set: function (_currentValue2) {
|
|
context._currentValue2 = _currentValue2;
|
|
}
|
|
},
|
|
Consumer: {
|
|
get: function () {
|
|
if (!hasWarnedAboutUsingNestedContextConsumers) {
|
|
hasWarnedAboutUsingNestedContextConsumers = true;
|
|
warning$1(false, 'Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
|
|
}
|
|
return context.Consumer;
|
|
}
|
|
}
|
|
});
|
|
// $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
|
|
context.Consumer = Consumer;
|
|
}
|
|
|
|
{
|
|
context._currentRenderer = null;
|
|
context._currentRenderer2 = null;
|
|
}
|
|
|
|
return context;
|
|
}
|
|
|
|
function lazy(ctor) {
|
|
return {
|
|
$$typeof: REACT_LAZY_TYPE,
|
|
_ctor: ctor,
|
|
// React uses these fields to store the result.
|
|
_status: -1,
|
|
_result: null
|
|
};
|
|
}
|
|
|
|
function forwardRef(render) {
|
|
{
|
|
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
|
warningWithoutStack$1(false, 'forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
|
|
} else if (typeof render !== 'function') {
|
|
warningWithoutStack$1(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
|
} else {
|
|
!(
|
|
// Do not warn for 0 arguments because it could be due to usage of the 'arguments' object
|
|
render.length === 0 || render.length === 2) ? warningWithoutStack$1(false, 'forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.') : void 0;
|
|
}
|
|
|
|
if (render != null) {
|
|
!(render.defaultProps == null && render.propTypes == null) ? warningWithoutStack$1(false, 'forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?') : void 0;
|
|
}
|
|
}
|
|
|
|
return {
|
|
$$typeof: REACT_FORWARD_REF_TYPE,
|
|
render: render
|
|
};
|
|
}
|
|
|
|
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 || 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);
|
|
}
|
|
|
|
function memo(type, compare) {
|
|
{
|
|
if (!isValidElementType(type)) {
|
|
warningWithoutStack$1(false, 'memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
|
}
|
|
}
|
|
return {
|
|
$$typeof: REACT_MEMO_TYPE,
|
|
type: type,
|
|
compare: compare === undefined ? null : compare
|
|
};
|
|
}
|
|
|
|
function resolveDispatcher() {
|
|
var dispatcher = ReactCurrentOwner.currentDispatcher;
|
|
!(dispatcher !== null) ? invariant(false, 'Hooks can only be called inside the body of a function component.') : void 0;
|
|
return dispatcher;
|
|
}
|
|
|
|
function useContext(Context, observedBits) {
|
|
var dispatcher = resolveDispatcher();
|
|
{
|
|
// TODO: add a more generic warning for invalid values.
|
|
if (Context._context !== undefined) {
|
|
var realContext = Context._context;
|
|
// Don't deduplicate because this legitimately causes bugs
|
|
// and nobody should be using this in existing code.
|
|
if (realContext.Consumer === Context) {
|
|
warning$1(false, 'Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
|
|
} else if (realContext.Provider === Context) {
|
|
warning$1(false, 'Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
|
|
}
|
|
}
|
|
}
|
|
return dispatcher.useContext(Context, observedBits);
|
|
}
|
|
|
|
function useState(initialState) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useState(initialState);
|
|
}
|
|
|
|
function useReducer(reducer, initialState, initialAction) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useReducer(reducer, initialState, initialAction);
|
|
}
|
|
|
|
function useRef(initialValue) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useRef(initialValue);
|
|
}
|
|
|
|
function useEffect(create, inputs) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useEffect(create, inputs);
|
|
}
|
|
|
|
function useMutationEffect(create, inputs) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useMutationEffect(create, inputs);
|
|
}
|
|
|
|
function useLayoutEffect(create, inputs) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useLayoutEffect(create, inputs);
|
|
}
|
|
|
|
function useCallback(callback, inputs) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useCallback(callback, inputs);
|
|
}
|
|
|
|
function useMemo(create, inputs) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useMemo(create, inputs);
|
|
}
|
|
|
|
function useImperativeMethods(ref, create, inputs) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useImperativeMethods(ref, create, inputs);
|
|
}
|
|
|
|
/**
|
|
* ReactElementValidator provides a wrapper around a element factory
|
|
* which validates the props passed to the element. This is intended to be
|
|
* used only in DEV and could be replaced by a static type checker for languages
|
|
* that support it.
|
|
*/
|
|
|
|
var propTypesMisspellWarningShown = void 0;
|
|
|
|
{
|
|
propTypesMisspellWarningShown = false;
|
|
}
|
|
|
|
function getDeclarationErrorAddendum() {
|
|
if (ReactCurrentOwner.current) {
|
|
var name = getComponentName(ReactCurrentOwner.current.type);
|
|
if (name) {
|
|
return '\n\nCheck the render method of `' + name + '`.';
|
|
}
|
|
}
|
|
return '';
|
|
}
|
|
|
|
function getSourceInfoErrorAddendum(elementProps) {
|
|
if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) {
|
|
var source = elementProps.__source;
|
|
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
var lineNumber = source.lineNumber;
|
|
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
}
|
|
return '';
|
|
}
|
|
|
|
/**
|
|
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
* object keys are not valid. This allows us to keep track of children between
|
|
* updates.
|
|
*/
|
|
var ownerHasKeyUseWarning = {};
|
|
|
|
function getCurrentComponentErrorInfo(parentType) {
|
|
var info = getDeclarationErrorAddendum();
|
|
|
|
if (!info) {
|
|
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
if (parentName) {
|
|
info = '\n\nCheck the top-level render call using <' + parentName + '>.';
|
|
}
|
|
}
|
|
return info;
|
|
}
|
|
|
|
/**
|
|
* Warn if the element doesn't have an explicit key assigned to it.
|
|
* This element is in an array. The array could grow and shrink or be
|
|
* reordered. All children that haven't already been validated are required to
|
|
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
* will only be shown once.
|
|
*
|
|
* @internal
|
|
* @param {ReactElement} element Element that requires a key.
|
|
* @param {*} parentType element's parent's type.
|
|
*/
|
|
function validateExplicitKey(element, parentType) {
|
|
if (!element._store || element._store.validated || element.key != null) {
|
|
return;
|
|
}
|
|
element._store.validated = true;
|
|
|
|
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
return;
|
|
}
|
|
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
|
|
// Usually the current owner is the offender, but if it accepts children as a
|
|
// property, it may be the creator of the child that's responsible for
|
|
// assigning it a key.
|
|
var childOwner = '';
|
|
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
|
// Give the component that originally created this child.
|
|
childOwner = ' It was passed a child from ' + getComponentName(element._owner.type) + '.';
|
|
}
|
|
|
|
setCurrentlyValidatingElement(element);
|
|
{
|
|
warning$1(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
}
|
|
setCurrentlyValidatingElement(null);
|
|
}
|
|
|
|
/**
|
|
* Ensure that every element either is passed in a static location, in an
|
|
* array with an explicit keys property defined, or in an object literal
|
|
* with valid key property.
|
|
*
|
|
* @internal
|
|
* @param {ReactNode} node Statically passed child of any type.
|
|
* @param {*} parentType node's parent's type.
|
|
*/
|
|
function validateChildKeys(node, parentType) {
|
|
if (typeof node !== 'object') {
|
|
return;
|
|
}
|
|
if (Array.isArray(node)) {
|
|
for (var i = 0; i < node.length; i++) {
|
|
var child = node[i];
|
|
if (isValidElement(child)) {
|
|
validateExplicitKey(child, parentType);
|
|
}
|
|
}
|
|
} else if (isValidElement(node)) {
|
|
// This element was passed in a valid location.
|
|
if (node._store) {
|
|
node._store.validated = true;
|
|
}
|
|
} else if (node) {
|
|
var iteratorFn = getIteratorFn(node);
|
|
if (typeof iteratorFn === 'function') {
|
|
// Entry iterators used to provide implicit keys,
|
|
// but now we print a separate warning for them later.
|
|
if (iteratorFn !== node.entries) {
|
|
var iterator = iteratorFn.call(node);
|
|
var step = void 0;
|
|
while (!(step = iterator.next()).done) {
|
|
if (isValidElement(step.value)) {
|
|
validateExplicitKey(step.value, parentType);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Given an element, validate that its props follow the propTypes definition,
|
|
* provided by the type.
|
|
*
|
|
* @param {ReactElement} element
|
|
*/
|
|
function validatePropTypes(element) {
|
|
var type = element.type;
|
|
var name = void 0,
|
|
propTypes = void 0;
|
|
if (typeof type === 'function') {
|
|
// Class or function component
|
|
name = type.displayName || type.name;
|
|
propTypes = type.propTypes;
|
|
} else if (typeof type === 'object' && type !== null && type.$$typeof === REACT_FORWARD_REF_TYPE) {
|
|
// ForwardRef
|
|
var functionName = type.render.displayName || type.render.name || '';
|
|
name = type.displayName || (functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef');
|
|
propTypes = type.propTypes;
|
|
} else {
|
|
return;
|
|
}
|
|
if (propTypes) {
|
|
setCurrentlyValidatingElement(element);
|
|
checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
|
|
setCurrentlyValidatingElement(null);
|
|
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
propTypesMisspellWarningShown = true;
|
|
warningWithoutStack$1(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
|
|
}
|
|
if (typeof type.getDefaultProps === 'function') {
|
|
!type.getDefaultProps.isReactClassApproved ? warningWithoutStack$1(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Given a fragment, validate that it can only be provided with fragment props
|
|
* @param {ReactElement} fragment
|
|
*/
|
|
function validateFragmentProps(fragment) {
|
|
setCurrentlyValidatingElement(fragment);
|
|
|
|
var keys = Object.keys(fragment.props);
|
|
for (var i = 0; i < keys.length; i++) {
|
|
var key = keys[i];
|
|
if (key !== 'children' && key !== 'key') {
|
|
warning$1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (fragment.ref !== null) {
|
|
warning$1(false, 'Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
}
|
|
|
|
setCurrentlyValidatingElement(null);
|
|
}
|
|
|
|
function createElementWithValidation(type, props, children) {
|
|
var validType = isValidElementType(type);
|
|
|
|
// We warn in this case but don't throw. We expect the element creation to
|
|
// succeed and there will likely be errors in render.
|
|
if (!validType) {
|
|
var info = '';
|
|
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
}
|
|
|
|
var sourceInfo = getSourceInfoErrorAddendum(props);
|
|
if (sourceInfo) {
|
|
info += sourceInfo;
|
|
} else {
|
|
info += getDeclarationErrorAddendum();
|
|
}
|
|
|
|
var typeString = void 0;
|
|
if (type === null) {
|
|
typeString = 'null';
|
|
} else if (Array.isArray(type)) {
|
|
typeString = 'array';
|
|
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
typeString = '<' + (getComponentName(type.type) || 'Unknown') + ' />';
|
|
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
} else {
|
|
typeString = typeof type;
|
|
}
|
|
|
|
warning$1(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
}
|
|
|
|
var element = createElement.apply(this, arguments);
|
|
|
|
// The result can be nullish if a mock or a custom function is used.
|
|
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
if (element == null) {
|
|
return element;
|
|
}
|
|
|
|
// Skip key warning if the type isn't valid since our key validation logic
|
|
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
// We don't want exception behavior to differ between dev and prod.
|
|
// (Rendering will throw with a helpful message and as soon as the type is
|
|
// fixed, the key warnings will appear.)
|
|
if (validType) {
|
|
for (var i = 2; i < arguments.length; i++) {
|
|
validateChildKeys(arguments[i], type);
|
|
}
|
|
}
|
|
|
|
if (type === REACT_FRAGMENT_TYPE) {
|
|
validateFragmentProps(element);
|
|
} else {
|
|
validatePropTypes(element);
|
|
}
|
|
|
|
return element;
|
|
}
|
|
|
|
function createFactoryWithValidation(type) {
|
|
var validatedFactory = createElementWithValidation.bind(null, type);
|
|
validatedFactory.type = type;
|
|
// Legacy hook: remove it
|
|
{
|
|
Object.defineProperty(validatedFactory, 'type', {
|
|
enumerable: false,
|
|
get: function () {
|
|
lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
|
|
Object.defineProperty(this, 'type', {
|
|
value: type
|
|
});
|
|
return type;
|
|
}
|
|
});
|
|
}
|
|
|
|
return validatedFactory;
|
|
}
|
|
|
|
function cloneElementWithValidation(element, props, children) {
|
|
var newElement = cloneElement.apply(this, arguments);
|
|
for (var i = 2; i < arguments.length; i++) {
|
|
validateChildKeys(arguments[i], newElement.type);
|
|
}
|
|
validatePropTypes(newElement);
|
|
return newElement;
|
|
}
|
|
|
|
var React = {
|
|
Children: {
|
|
map: mapChildren,
|
|
forEach: forEachChildren,
|
|
count: countChildren,
|
|
toArray: toArray,
|
|
only: onlyChild
|
|
},
|
|
|
|
createRef: createRef,
|
|
Component: Component,
|
|
PureComponent: PureComponent,
|
|
|
|
createContext: createContext,
|
|
forwardRef: forwardRef,
|
|
lazy: lazy,
|
|
memo: memo,
|
|
|
|
Fragment: REACT_FRAGMENT_TYPE,
|
|
StrictMode: REACT_STRICT_MODE_TYPE,
|
|
Suspense: REACT_SUSPENSE_TYPE,
|
|
|
|
createElement: createElementWithValidation,
|
|
cloneElement: cloneElementWithValidation,
|
|
createFactory: createFactoryWithValidation,
|
|
isValidElement: isValidElement,
|
|
|
|
version: ReactVersion,
|
|
|
|
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
|
|
};
|
|
|
|
if (enableStableConcurrentModeAPIs) {
|
|
React.ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
React.Profiler = REACT_PROFILER_TYPE;
|
|
} else {
|
|
React.unstable_ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
React.unstable_Profiler = REACT_PROFILER_TYPE;
|
|
}
|
|
|
|
if (enableHooks) {
|
|
React.useCallback = useCallback;
|
|
React.useContext = useContext;
|
|
React.useEffect = useEffect;
|
|
React.useImperativeMethods = useImperativeMethods;
|
|
React.useLayoutEffect = useLayoutEffect;
|
|
React.useMemo = useMemo;
|
|
React.useMutationEffect = useMutationEffect;
|
|
React.useReducer = useReducer;
|
|
React.useRef = useRef;
|
|
React.useState = useState;
|
|
}
|
|
|
|
|
|
|
|
var React$2 = Object.freeze({
|
|
default: React
|
|
});
|
|
|
|
var React$3 = ( React$2 && React ) || React$2;
|
|
|
|
// TODO: decide on the top-level export form.
|
|
// This is hacky but makes it work with both Rollup and Jest.
|
|
var react = React$3.default || React$3;
|
|
|
|
module.exports = react;
|
|
})();
|
|
}
|
|
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
|
|
|
|
/***/ }),
|
|
/* 65 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/** @license React v16.6.1
|
|
* react.production.min.js
|
|
*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
var k=__webpack_require__(14),n="function"===typeof Symbol&&Symbol.for,p=n?Symbol.for("react.element"):60103,q=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,t=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,v=n?Symbol.for("react.provider"):60109,w=n?Symbol.for("react.context"):60110,x=n?Symbol.for("react.concurrent_mode"):60111,y=n?Symbol.for("react.forward_ref"):60112,z=n?Symbol.for("react.suspense"):60113,A=n?Symbol.for("react.memo"):
|
|
60115,B=n?Symbol.for("react.lazy"):60116,C="function"===typeof Symbol&&Symbol.iterator;function aa(a,b,e,c,d,g,h,f){if(!a){a=void 0;if(void 0===b)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[e,c,d,g,h,f],m=0;a=Error(b.replace(/%s/g,function(){return l[m++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}}
|
|
function D(a){for(var b=arguments.length-1,e="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;c<b;c++)e+="&args[]="+encodeURIComponent(arguments[c+1]);aa(!1,"Minified React error #"+a+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",e)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},F={};
|
|
function G(a,b,e){this.props=a;this.context=b;this.refs=F;this.updater=e||E}G.prototype.isReactComponent={};G.prototype.setState=function(a,b){"object"!==typeof a&&"function"!==typeof a&&null!=a?D("85"):void 0;this.updater.enqueueSetState(this,a,b,"setState")};G.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function H(){}H.prototype=G.prototype;function I(a,b,e){this.props=a;this.context=b;this.refs=F;this.updater=e||E}var J=I.prototype=new H;
|
|
J.constructor=I;k(J,G.prototype);J.isPureReactComponent=!0;var K={current:null,currentDispatcher:null},L=Object.prototype.hasOwnProperty,M={key:!0,ref:!0,__self:!0,__source:!0};
|
|
function N(a,b,e){var c=void 0,d={},g=null,h=null;if(null!=b)for(c in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(g=""+b.key),b)L.call(b,c)&&!M.hasOwnProperty(c)&&(d[c]=b[c]);var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){for(var l=Array(f),m=0;m<f;m++)l[m]=arguments[m+2];d.children=l}if(a&&a.defaultProps)for(c in f=a.defaultProps,f)void 0===d[c]&&(d[c]=f[c]);return{$$typeof:p,type:a,key:g,ref:h,props:d,_owner:K.current}}
|
|
function ba(a,b){return{$$typeof:p,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return"object"===typeof a&&null!==a&&a.$$typeof===p}function escape(a){var b={"=":"=0",":":"=2"};return"$"+(""+a).replace(/[=:]/g,function(a){return b[a]})}var P=/\/+/g,Q=[];function R(a,b,e,c){if(Q.length){var d=Q.pop();d.result=a;d.keyPrefix=b;d.func=e;d.context=c;d.count=0;return d}return{result:a,keyPrefix:b,func:e,context:c,count:0}}
|
|
function S(a){a.result=null;a.keyPrefix=null;a.func=null;a.context=null;a.count=0;10>Q.length&&Q.push(a)}
|
|
function T(a,b,e,c){var d=typeof a;if("undefined"===d||"boolean"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case "string":case "number":g=!0;break;case "object":switch(a.$$typeof){case p:case q:g=!0}}if(g)return e(c,a,""===b?"."+U(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var h=0;h<a.length;h++){d=a[h];var f=b+U(d,h);g+=T(d,f,e,c)}else if(null===a||"object"!==typeof a?f=null:(f=C&&a[C]||a["@@iterator"],f="function"===typeof f?f:null),"function"===typeof f)for(a=f.call(a),h=
|
|
0;!(d=a.next()).done;)d=d.value,f=b+U(d,h++),g+=T(d,f,e,c);else"object"===d&&(e=""+a,D("31","[object Object]"===e?"object with keys {"+Object.keys(a).join(", ")+"}":e,""));return g}function V(a,b,e){return null==a?0:T(a,"",b,e)}function U(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(a.key):b.toString(36)}function ca(a,b){a.func.call(a.context,b,a.count++)}
|
|
function da(a,b,e){var c=a.result,d=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?W(a,c,e,function(a){return a}):null!=a&&(O(a)&&(a=ba(a,d+(!a.key||b&&b.key===a.key?"":(""+a.key).replace(P,"$&/")+"/")+e)),c.push(a))}function W(a,b,e,c,d){var g="";null!=e&&(g=(""+e).replace(P,"$&/")+"/");b=R(b,g,c,d);V(a,da,b);S(b)}
|
|
var X={Children:{map:function(a,b,e){if(null==a)return a;var c=[];W(a,c,null,b,e);return c},forEach:function(a,b,e){if(null==a)return a;b=R(null,null,b,e);V(a,ca,b);S(b)},count:function(a){return V(a,function(){return null},null)},toArray:function(a){var b=[];W(a,b,null,function(a){return a});return b},only:function(a){O(a)?void 0:D("143");return a}},createRef:function(){return{current:null}},Component:G,PureComponent:I,createContext:function(a,b){void 0===b&&(b=null);a={$$typeof:w,_calculateChangedBits:b,
|
|
_currentValue:a,_currentValue2:a,Provider:null,Consumer:null};a.Provider={$$typeof:v,_context:a};return a.Consumer=a},forwardRef:function(a){return{$$typeof:y,render:a}},lazy:function(a){return{$$typeof:B,_ctor:a,_status:-1,_result:null}},memo:function(a,b){return{$$typeof:A,type:a,compare:void 0===b?null:b}},Fragment:r,StrictMode:t,Suspense:z,createElement:N,cloneElement:function(a,b,e){null===a||void 0===a?D("267",a):void 0;var c=void 0,d=k({},a.props),g=a.key,h=a.ref,f=a._owner;if(null!=b){void 0!==
|
|
b.ref&&(h=b.ref,f=K.current);void 0!==b.key&&(g=""+b.key);var l=void 0;a.type&&a.type.defaultProps&&(l=a.type.defaultProps);for(c in b)L.call(b,c)&&!M.hasOwnProperty(c)&&(d[c]=void 0===b[c]&&void 0!==l?l[c]:b[c])}c=arguments.length-2;if(1===c)d.children=e;else if(1<c){l=Array(c);for(var m=0;m<c;m++)l[m]=arguments[m+2];d.children=l}return{$$typeof:p,type:a.type,key:g,ref:h,props:d,_owner:f}},createFactory:function(a){var b=N.bind(null,a);b.type=a;return b},isValidElement:O,version:"16.6.1",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:K,
|
|
assign:k}};X.unstable_ConcurrentMode=x;X.unstable_Profiler=u;var Y={default:X},Z=Y&&X||Y;module.exports=Z.default||Z;
|
|
|
|
|
|
/***/ }),
|
|
/* 66 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export createStore */
|
|
/* unused harmony export combineReducers */
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return bindActionCreators; });
|
|
/* unused harmony export applyMiddleware */
|
|
/* unused harmony export compose */
|
|
/* unused harmony export __DO_NOT_USE__ActionTypes */
|
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_symbol_observable__ = __webpack_require__(68);
|
|
|
|
|
|
/**
|
|
* These are private action types reserved by Redux.
|
|
* For any unknown actions, you must return the current state.
|
|
* If the current state is undefined, you must return the initial state.
|
|
* Do not reference these action types directly in your code.
|
|
*/
|
|
var randomString = function randomString() {
|
|
return Math.random().toString(36).substring(7).split('').join('.');
|
|
};
|
|
|
|
var ActionTypes = {
|
|
INIT: "@@redux/INIT" + randomString(),
|
|
REPLACE: "@@redux/REPLACE" + randomString(),
|
|
PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
|
|
return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {any} obj The object to inspect.
|
|
* @returns {boolean} True if the argument appears to be a plain object.
|
|
*/
|
|
function isPlainObject(obj) {
|
|
if (typeof obj !== 'object' || obj === null) return false;
|
|
var proto = obj;
|
|
|
|
while (Object.getPrototypeOf(proto) !== null) {
|
|
proto = Object.getPrototypeOf(proto);
|
|
}
|
|
|
|
return Object.getPrototypeOf(obj) === proto;
|
|
}
|
|
|
|
/**
|
|
* Creates a Redux store that holds the state tree.
|
|
* The only way to change the data in the store is to call `dispatch()` on it.
|
|
*
|
|
* There should only be a single store in your app. To specify how different
|
|
* parts of the state tree respond to actions, you may combine several reducers
|
|
* into a single reducer function by using `combineReducers`.
|
|
*
|
|
* @param {Function} reducer A function that returns the next state tree, given
|
|
* the current state tree and the action to handle.
|
|
*
|
|
* @param {any} [preloadedState] The initial state. You may optionally specify it
|
|
* to hydrate the state from the server in universal apps, or to restore a
|
|
* previously serialized user session.
|
|
* If you use `combineReducers` to produce the root reducer function, this must be
|
|
* an object with the same shape as `combineReducers` keys.
|
|
*
|
|
* @param {Function} [enhancer] The store enhancer. You may optionally specify it
|
|
* to enhance the store with third-party capabilities such as middleware,
|
|
* time travel, persistence, etc. The only store enhancer that ships with Redux
|
|
* is `applyMiddleware()`.
|
|
*
|
|
* @returns {Store} A Redux store that lets you read the state, dispatch actions
|
|
* and subscribe to changes.
|
|
*/
|
|
|
|
function createStore(reducer, preloadedState, enhancer) {
|
|
var _ref2;
|
|
|
|
if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
|
|
throw new Error('It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function');
|
|
}
|
|
|
|
if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
|
|
enhancer = preloadedState;
|
|
preloadedState = undefined;
|
|
}
|
|
|
|
if (typeof enhancer !== 'undefined') {
|
|
if (typeof enhancer !== 'function') {
|
|
throw new Error('Expected the enhancer to be a function.');
|
|
}
|
|
|
|
return enhancer(createStore)(reducer, preloadedState);
|
|
}
|
|
|
|
if (typeof reducer !== 'function') {
|
|
throw new Error('Expected the reducer to be a function.');
|
|
}
|
|
|
|
var currentReducer = reducer;
|
|
var currentState = preloadedState;
|
|
var currentListeners = [];
|
|
var nextListeners = currentListeners;
|
|
var isDispatching = false;
|
|
|
|
function ensureCanMutateNextListeners() {
|
|
if (nextListeners === currentListeners) {
|
|
nextListeners = currentListeners.slice();
|
|
}
|
|
}
|
|
/**
|
|
* Reads the state tree managed by the store.
|
|
*
|
|
* @returns {any} The current state tree of your application.
|
|
*/
|
|
|
|
|
|
function getState() {
|
|
if (isDispatching) {
|
|
throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');
|
|
}
|
|
|
|
return currentState;
|
|
}
|
|
/**
|
|
* Adds a change listener. It will be called any time an action is dispatched,
|
|
* and some part of the state tree may potentially have changed. You may then
|
|
* call `getState()` to read the current state tree inside the callback.
|
|
*
|
|
* You may call `dispatch()` from a change listener, with the following
|
|
* caveats:
|
|
*
|
|
* 1. The subscriptions are snapshotted just before every `dispatch()` call.
|
|
* If you subscribe or unsubscribe while the listeners are being invoked, this
|
|
* will not have any effect on the `dispatch()` that is currently in progress.
|
|
* However, the next `dispatch()` call, whether nested or not, will use a more
|
|
* recent snapshot of the subscription list.
|
|
*
|
|
* 2. The listener should not expect to see all state changes, as the state
|
|
* might have been updated multiple times during a nested `dispatch()` before
|
|
* the listener is called. It is, however, guaranteed that all subscribers
|
|
* registered before the `dispatch()` started will be called with the latest
|
|
* state by the time it exits.
|
|
*
|
|
* @param {Function} listener A callback to be invoked on every dispatch.
|
|
* @returns {Function} A function to remove this change listener.
|
|
*/
|
|
|
|
|
|
function subscribe(listener) {
|
|
if (typeof listener !== 'function') {
|
|
throw new Error('Expected the listener to be a function.');
|
|
}
|
|
|
|
if (isDispatching) {
|
|
throw new Error('You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');
|
|
}
|
|
|
|
var isSubscribed = true;
|
|
ensureCanMutateNextListeners();
|
|
nextListeners.push(listener);
|
|
return function unsubscribe() {
|
|
if (!isSubscribed) {
|
|
return;
|
|
}
|
|
|
|
if (isDispatching) {
|
|
throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');
|
|
}
|
|
|
|
isSubscribed = false;
|
|
ensureCanMutateNextListeners();
|
|
var index = nextListeners.indexOf(listener);
|
|
nextListeners.splice(index, 1);
|
|
};
|
|
}
|
|
/**
|
|
* Dispatches an action. It is the only way to trigger a state change.
|
|
*
|
|
* The `reducer` function, used to create the store, will be called with the
|
|
* current state tree and the given `action`. Its return value will
|
|
* be considered the **next** state of the tree, and the change listeners
|
|
* will be notified.
|
|
*
|
|
* The base implementation only supports plain object actions. If you want to
|
|
* dispatch a Promise, an Observable, a thunk, or something else, you need to
|
|
* wrap your store creating function into the corresponding middleware. For
|
|
* example, see the documentation for the `redux-thunk` package. Even the
|
|
* middleware will eventually dispatch plain object actions using this method.
|
|
*
|
|
* @param {Object} action A plain object representing “what changed”. It is
|
|
* a good idea to keep actions serializable so you can record and replay user
|
|
* sessions, or use the time travelling `redux-devtools`. An action must have
|
|
* a `type` property which may not be `undefined`. It is a good idea to use
|
|
* string constants for action types.
|
|
*
|
|
* @returns {Object} For convenience, the same action object you dispatched.
|
|
*
|
|
* Note that, if you use a custom middleware, it may wrap `dispatch()` to
|
|
* return something else (for example, a Promise you can await).
|
|
*/
|
|
|
|
|
|
function dispatch(action) {
|
|
if (!isPlainObject(action)) {
|
|
throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
|
|
}
|
|
|
|
if (typeof action.type === 'undefined') {
|
|
throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
|
|
}
|
|
|
|
if (isDispatching) {
|
|
throw new Error('Reducers may not dispatch actions.');
|
|
}
|
|
|
|
try {
|
|
isDispatching = true;
|
|
currentState = currentReducer(currentState, action);
|
|
} finally {
|
|
isDispatching = false;
|
|
}
|
|
|
|
var listeners = currentListeners = nextListeners;
|
|
|
|
for (var i = 0; i < listeners.length; i++) {
|
|
var listener = listeners[i];
|
|
listener();
|
|
}
|
|
|
|
return action;
|
|
}
|
|
/**
|
|
* Replaces the reducer currently used by the store to calculate the state.
|
|
*
|
|
* You might need this if your app implements code splitting and you want to
|
|
* load some of the reducers dynamically. You might also need this if you
|
|
* implement a hot reloading mechanism for Redux.
|
|
*
|
|
* @param {Function} nextReducer The reducer for the store to use instead.
|
|
* @returns {void}
|
|
*/
|
|
|
|
|
|
function replaceReducer(nextReducer) {
|
|
if (typeof nextReducer !== 'function') {
|
|
throw new Error('Expected the nextReducer to be a function.');
|
|
}
|
|
|
|
currentReducer = nextReducer;
|
|
dispatch({
|
|
type: ActionTypes.REPLACE
|
|
});
|
|
}
|
|
/**
|
|
* Interoperability point for observable/reactive libraries.
|
|
* @returns {observable} A minimal observable of state changes.
|
|
* For more information, see the observable proposal:
|
|
* https://github.com/tc39/proposal-observable
|
|
*/
|
|
|
|
|
|
function observable() {
|
|
var _ref;
|
|
|
|
var outerSubscribe = subscribe;
|
|
return _ref = {
|
|
/**
|
|
* The minimal observable subscription method.
|
|
* @param {Object} observer Any object that can be used as an observer.
|
|
* The observer object should have a `next` method.
|
|
* @returns {subscription} An object with an `unsubscribe` method that can
|
|
* be used to unsubscribe the observable from the store, and prevent further
|
|
* emission of values from the observable.
|
|
*/
|
|
subscribe: function subscribe(observer) {
|
|
if (typeof observer !== 'object' || observer === null) {
|
|
throw new TypeError('Expected the observer to be an object.');
|
|
}
|
|
|
|
function observeState() {
|
|
if (observer.next) {
|
|
observer.next(getState());
|
|
}
|
|
}
|
|
|
|
observeState();
|
|
var unsubscribe = outerSubscribe(observeState);
|
|
return {
|
|
unsubscribe: unsubscribe
|
|
};
|
|
}
|
|
}, _ref[__WEBPACK_IMPORTED_MODULE_0_symbol_observable__["a" /* default */]] = function () {
|
|
return this;
|
|
}, _ref;
|
|
} // When a store is created, an "INIT" action is dispatched so that every
|
|
// reducer returns their initial state. This effectively populates
|
|
// the initial state tree.
|
|
|
|
|
|
dispatch({
|
|
type: ActionTypes.INIT
|
|
});
|
|
return _ref2 = {
|
|
dispatch: dispatch,
|
|
subscribe: subscribe,
|
|
getState: getState,
|
|
replaceReducer: replaceReducer
|
|
}, _ref2[__WEBPACK_IMPORTED_MODULE_0_symbol_observable__["a" /* default */]] = observable, _ref2;
|
|
}
|
|
|
|
/**
|
|
* Prints a warning in the console if it exists.
|
|
*
|
|
* @param {String} message The warning message.
|
|
* @returns {void}
|
|
*/
|
|
function warning(message) {
|
|
/* eslint-disable no-console */
|
|
if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
|
console.error(message);
|
|
}
|
|
/* eslint-enable no-console */
|
|
|
|
|
|
try {
|
|
// This error was thrown as a convenience so that if you enable
|
|
// "break on all exceptions" in your console,
|
|
// it would pause the execution at this line.
|
|
throw new Error(message);
|
|
} catch (e) {} // eslint-disable-line no-empty
|
|
|
|
}
|
|
|
|
function getUndefinedStateErrorMessage(key, action) {
|
|
var actionType = action && action.type;
|
|
var actionDescription = actionType && "action \"" + String(actionType) + "\"" || 'an action';
|
|
return "Given " + actionDescription + ", reducer \"" + key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined.";
|
|
}
|
|
|
|
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
|
|
var reducerKeys = Object.keys(reducers);
|
|
var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
|
|
|
|
if (reducerKeys.length === 0) {
|
|
return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
|
|
}
|
|
|
|
if (!isPlainObject(inputState)) {
|
|
return "The " + argumentName + " has unexpected type of \"" + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
|
|
}
|
|
|
|
var unexpectedKeys = Object.keys(inputState).filter(function (key) {
|
|
return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
|
|
});
|
|
unexpectedKeys.forEach(function (key) {
|
|
unexpectedKeyCache[key] = true;
|
|
});
|
|
if (action && action.type === ActionTypes.REPLACE) return;
|
|
|
|
if (unexpectedKeys.length > 0) {
|
|
return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored.");
|
|
}
|
|
}
|
|
|
|
function assertReducerShape(reducers) {
|
|
Object.keys(reducers).forEach(function (key) {
|
|
var reducer = reducers[key];
|
|
var initialState = reducer(undefined, {
|
|
type: ActionTypes.INIT
|
|
});
|
|
|
|
if (typeof initialState === 'undefined') {
|
|
throw new Error("Reducer \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined.");
|
|
}
|
|
|
|
if (typeof reducer(undefined, {
|
|
type: ActionTypes.PROBE_UNKNOWN_ACTION()
|
|
}) === 'undefined') {
|
|
throw new Error("Reducer \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle " + ActionTypes.INIT + " or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null.");
|
|
}
|
|
});
|
|
}
|
|
/**
|
|
* Turns an object whose values are different reducer functions, into a single
|
|
* reducer function. It will call every child reducer, and gather their results
|
|
* into a single state object, whose keys correspond to the keys of the passed
|
|
* reducer functions.
|
|
*
|
|
* @param {Object} reducers An object whose values correspond to different
|
|
* reducer functions that need to be combined into one. One handy way to obtain
|
|
* it is to use ES6 `import * as reducers` syntax. The reducers may never return
|
|
* undefined for any action. Instead, they should return their initial state
|
|
* if the state passed to them was undefined, and the current state for any
|
|
* unrecognized action.
|
|
*
|
|
* @returns {Function} A reducer function that invokes every reducer inside the
|
|
* passed object, and builds a state object with the same shape.
|
|
*/
|
|
|
|
|
|
function combineReducers(reducers) {
|
|
var reducerKeys = Object.keys(reducers);
|
|
var finalReducers = {};
|
|
|
|
for (var i = 0; i < reducerKeys.length; i++) {
|
|
var key = reducerKeys[i];
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
if (typeof reducers[key] === 'undefined') {
|
|
warning("No reducer provided for key \"" + key + "\"");
|
|
}
|
|
}
|
|
|
|
if (typeof reducers[key] === 'function') {
|
|
finalReducers[key] = reducers[key];
|
|
}
|
|
}
|
|
|
|
var finalReducerKeys = Object.keys(finalReducers);
|
|
var unexpectedKeyCache;
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
unexpectedKeyCache = {};
|
|
}
|
|
|
|
var shapeAssertionError;
|
|
|
|
try {
|
|
assertReducerShape(finalReducers);
|
|
} catch (e) {
|
|
shapeAssertionError = e;
|
|
}
|
|
|
|
return function combination(state, action) {
|
|
if (state === void 0) {
|
|
state = {};
|
|
}
|
|
|
|
if (shapeAssertionError) {
|
|
throw shapeAssertionError;
|
|
}
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
|
|
|
|
if (warningMessage) {
|
|
warning(warningMessage);
|
|
}
|
|
}
|
|
|
|
var hasChanged = false;
|
|
var nextState = {};
|
|
|
|
for (var _i = 0; _i < finalReducerKeys.length; _i++) {
|
|
var _key = finalReducerKeys[_i];
|
|
var reducer = finalReducers[_key];
|
|
var previousStateForKey = state[_key];
|
|
var nextStateForKey = reducer(previousStateForKey, action);
|
|
|
|
if (typeof nextStateForKey === 'undefined') {
|
|
var errorMessage = getUndefinedStateErrorMessage(_key, action);
|
|
throw new Error(errorMessage);
|
|
}
|
|
|
|
nextState[_key] = nextStateForKey;
|
|
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
|
|
}
|
|
|
|
return hasChanged ? nextState : state;
|
|
};
|
|
}
|
|
|
|
function bindActionCreator(actionCreator, dispatch) {
|
|
return function () {
|
|
return dispatch(actionCreator.apply(this, arguments));
|
|
};
|
|
}
|
|
/**
|
|
* Turns an object whose values are action creators, into an object with the
|
|
* same keys, but with every function wrapped into a `dispatch` call so they
|
|
* may be invoked directly. This is just a convenience method, as you can call
|
|
* `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
|
|
*
|
|
* For convenience, you can also pass a single function as the first argument,
|
|
* and get a function in return.
|
|
*
|
|
* @param {Function|Object} actionCreators An object whose values are action
|
|
* creator functions. One handy way to obtain it is to use ES6 `import * as`
|
|
* syntax. You may also pass a single function.
|
|
*
|
|
* @param {Function} dispatch The `dispatch` function available on your Redux
|
|
* store.
|
|
*
|
|
* @returns {Function|Object} The object mimicking the original object, but with
|
|
* every action creator wrapped into the `dispatch` call. If you passed a
|
|
* function as `actionCreators`, the return value will also be a single
|
|
* function.
|
|
*/
|
|
|
|
|
|
function bindActionCreators(actionCreators, dispatch) {
|
|
if (typeof actionCreators === 'function') {
|
|
return bindActionCreator(actionCreators, dispatch);
|
|
}
|
|
|
|
if (typeof actionCreators !== 'object' || actionCreators === null) {
|
|
throw new Error("bindActionCreators expected an object or a function, instead received " + (actionCreators === null ? 'null' : typeof actionCreators) + ". " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?");
|
|
}
|
|
|
|
var keys = Object.keys(actionCreators);
|
|
var boundActionCreators = {};
|
|
|
|
for (var i = 0; i < keys.length; i++) {
|
|
var key = keys[i];
|
|
var actionCreator = actionCreators[key];
|
|
|
|
if (typeof actionCreator === 'function') {
|
|
boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
|
|
}
|
|
}
|
|
|
|
return boundActionCreators;
|
|
}
|
|
|
|
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 _objectSpread(target) {
|
|
for (var i = 1; i < arguments.length; i++) {
|
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
var ownKeys = Object.keys(source);
|
|
|
|
if (typeof Object.getOwnPropertySymbols === 'function') {
|
|
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
|
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
}));
|
|
}
|
|
|
|
ownKeys.forEach(function (key) {
|
|
_defineProperty(target, key, source[key]);
|
|
});
|
|
}
|
|
|
|
return target;
|
|
}
|
|
|
|
/**
|
|
* Composes single-argument functions from right to left. The rightmost
|
|
* function can take multiple arguments as it provides the signature for
|
|
* the resulting composite function.
|
|
*
|
|
* @param {...Function} funcs The functions to compose.
|
|
* @returns {Function} A function obtained by composing the argument functions
|
|
* from right to left. For example, compose(f, g, h) is identical to doing
|
|
* (...args) => f(g(h(...args))).
|
|
*/
|
|
function compose() {
|
|
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
funcs[_key] = arguments[_key];
|
|
}
|
|
|
|
if (funcs.length === 0) {
|
|
return function (arg) {
|
|
return arg;
|
|
};
|
|
}
|
|
|
|
if (funcs.length === 1) {
|
|
return funcs[0];
|
|
}
|
|
|
|
return funcs.reduce(function (a, b) {
|
|
return function () {
|
|
return a(b.apply(void 0, arguments));
|
|
};
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Creates a store enhancer that applies middleware to the dispatch method
|
|
* of the Redux store. This is handy for a variety of tasks, such as expressing
|
|
* asynchronous actions in a concise manner, or logging every action payload.
|
|
*
|
|
* See `redux-thunk` package as an example of the Redux middleware.
|
|
*
|
|
* Because middleware is potentially asynchronous, this should be the first
|
|
* store enhancer in the composition chain.
|
|
*
|
|
* Note that each middleware will be given the `dispatch` and `getState` functions
|
|
* as named arguments.
|
|
*
|
|
* @param {...Function} middlewares The middleware chain to be applied.
|
|
* @returns {Function} A store enhancer applying the middleware.
|
|
*/
|
|
|
|
function applyMiddleware() {
|
|
for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
middlewares[_key] = arguments[_key];
|
|
}
|
|
|
|
return function (createStore) {
|
|
return function () {
|
|
var store = createStore.apply(void 0, arguments);
|
|
|
|
var _dispatch = function dispatch() {
|
|
throw new Error("Dispatching while constructing your middleware is not allowed. " + "Other middleware would not be applied to this dispatch.");
|
|
};
|
|
|
|
var middlewareAPI = {
|
|
getState: store.getState,
|
|
dispatch: function dispatch() {
|
|
return _dispatch.apply(void 0, arguments);
|
|
}
|
|
};
|
|
var chain = middlewares.map(function (middleware) {
|
|
return middleware(middlewareAPI);
|
|
});
|
|
_dispatch = compose.apply(void 0, chain)(store.dispatch);
|
|
return _objectSpread({}, store, {
|
|
dispatch: _dispatch
|
|
});
|
|
};
|
|
};
|
|
}
|
|
|
|
/*
|
|
* This is a dummy function to check if the function name has been altered by minification.
|
|
* If the function has been minified and NODE_ENV !== 'production', warn the user.
|
|
*/
|
|
|
|
function isCrushed() {}
|
|
|
|
if (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
|
|
warning('You are currently using minified code outside of NODE_ENV === "production". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');
|
|
}
|
|
|
|
|
|
|
|
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0)))
|
|
|
|
/***/ }),
|
|
/* 67 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
function isAbsolute(pathname) {
|
|
return pathname.charAt(0) === '/';
|
|
}
|
|
|
|
// About 1.5x faster than the two-arg version of Array#splice()
|
|
function spliceOne(list, index) {
|
|
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
|
|
list[i] = list[k];
|
|
}
|
|
|
|
list.pop();
|
|
}
|
|
|
|
// This implementation is based heavily on node's url.parse
|
|
function resolvePathname(to) {
|
|
var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
|
|
var toParts = to && to.split('/') || [];
|
|
var fromParts = from && from.split('/') || [];
|
|
|
|
var isToAbs = to && isAbsolute(to);
|
|
var isFromAbs = from && isAbsolute(from);
|
|
var mustEndAbs = isToAbs || isFromAbs;
|
|
|
|
if (to && isAbsolute(to)) {
|
|
// to is absolute
|
|
fromParts = toParts;
|
|
} else if (toParts.length) {
|
|
// to is relative, drop the filename
|
|
fromParts.pop();
|
|
fromParts = fromParts.concat(toParts);
|
|
}
|
|
|
|
if (!fromParts.length) return '/';
|
|
|
|
var hasTrailingSlash = void 0;
|
|
if (fromParts.length) {
|
|
var last = fromParts[fromParts.length - 1];
|
|
hasTrailingSlash = last === '.' || last === '..' || last === '';
|
|
} else {
|
|
hasTrailingSlash = false;
|
|
}
|
|
|
|
var up = 0;
|
|
for (var i = fromParts.length; i >= 0; i--) {
|
|
var part = fromParts[i];
|
|
|
|
if (part === '.') {
|
|
spliceOne(fromParts, i);
|
|
} else if (part === '..') {
|
|
spliceOne(fromParts, i);
|
|
up++;
|
|
} else if (up) {
|
|
spliceOne(fromParts, i);
|
|
up--;
|
|
}
|
|
}
|
|
|
|
if (!mustEndAbs) for (; up--; up) {
|
|
fromParts.unshift('..');
|
|
}if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');
|
|
|
|
var result = fromParts.join('/');
|
|
|
|
if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
|
|
|
|
return result;
|
|
}
|
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (resolvePathname);
|
|
|
|
/***/ }),
|
|
/* 68 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* WEBPACK VAR INJECTION */(function(global, module) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ponyfill_js__ = __webpack_require__(69);
|
|
/* global window */
|
|
|
|
|
|
var root;
|
|
|
|
if (typeof self !== 'undefined') {
|
|
root = self;
|
|
} else if (typeof window !== 'undefined') {
|
|
root = window;
|
|
} else if (typeof global !== 'undefined') {
|
|
root = global;
|
|
} else if (true) {
|
|
root = module;
|
|
} else {
|
|
root = Function('return this')();
|
|
}
|
|
|
|
var result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__ponyfill_js__["a" /* default */])(root);
|
|
/* harmony default export */ __webpack_exports__["a"] = (result);
|
|
|
|
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(71), __webpack_require__(72)(module)))
|
|
|
|
/***/ }),
|
|
/* 69 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export (immutable) */ __webpack_exports__["a"] = symbolObservablePonyfill;
|
|
function symbolObservablePonyfill(root) {
|
|
var result;
|
|
var Symbol = root.Symbol;
|
|
|
|
if (typeof Symbol === 'function') {
|
|
if (Symbol.observable) {
|
|
result = Symbol.observable;
|
|
} else {
|
|
result = Symbol('observable');
|
|
Symbol.observable = result;
|
|
}
|
|
} else {
|
|
result = '@@observable';
|
|
}
|
|
|
|
return result;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
/* 70 */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
|
|
function valueEqual(a, b) {
|
|
if (a === b) return true;
|
|
|
|
if (a == null || b == null) return false;
|
|
|
|
if (Array.isArray(a)) {
|
|
return Array.isArray(b) && a.length === b.length && a.every(function (item, index) {
|
|
return valueEqual(item, b[index]);
|
|
});
|
|
}
|
|
|
|
var aType = typeof a === 'undefined' ? 'undefined' : _typeof(a);
|
|
var bType = typeof b === 'undefined' ? 'undefined' : _typeof(b);
|
|
|
|
if (aType !== bType) return false;
|
|
|
|
if (aType === 'object') {
|
|
var aValue = a.valueOf();
|
|
var bValue = b.valueOf();
|
|
|
|
if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue);
|
|
|
|
var aKeys = Object.keys(a);
|
|
var bKeys = Object.keys(b);
|
|
|
|
if (aKeys.length !== bKeys.length) return false;
|
|
|
|
return aKeys.every(function (key) {
|
|
return valueEqual(a[key], b[key]);
|
|
});
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
/* harmony default export */ __webpack_exports__["a"] = (valueEqual);
|
|
|
|
/***/ }),
|
|
/* 71 */
|
|
/***/ (function(module, exports) {
|
|
|
|
var g;
|
|
|
|
// This works in non-strict mode
|
|
g = (function() {
|
|
return this;
|
|
})();
|
|
|
|
try {
|
|
// This works if eval is allowed (see CSP)
|
|
g = g || Function("return this")() || (1,eval)("this");
|
|
} catch(e) {
|
|
// This works if the window reference is available
|
|
if(typeof window === "object")
|
|
g = window;
|
|
}
|
|
|
|
// g can still be undefined, but nothing to do about it...
|
|
// We return undefined, instead of nothing here, so it's
|
|
// easier to handle this case. if(!global) { ...}
|
|
|
|
module.exports = g;
|
|
|
|
|
|
/***/ }),
|
|
/* 72 */
|
|
/***/ (function(module, exports) {
|
|
|
|
module.exports = function(originalModule) {
|
|
if(!originalModule.webpackPolyfill) {
|
|
var module = Object.create(originalModule);
|
|
// module.parent = undefined by default
|
|
if(!module.children) module.children = [];
|
|
Object.defineProperty(module, "loaded", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return module.l;
|
|
}
|
|
});
|
|
Object.defineProperty(module, "id", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return module.i;
|
|
}
|
|
});
|
|
Object.defineProperty(module, "exports", {
|
|
enumerable: true,
|
|
});
|
|
module.webpackPolyfill = 1;
|
|
}
|
|
return module;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
/* 73 */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
__webpack_require__(9);
|
|
module.exports = __webpack_require__(9);
|
|
|
|
|
|
/***/ })
|
|
/******/ ]);
|
|
}); |