Socket
Socket
Sign inDemoInstall

react-router

Package Overview
Dependencies
Maintainers
3
Versions
515
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router - npm Package Compare versions

Comparing version 4.0.0-beta.6 to 4.0.0-beta.7

13

es/matchPath.js

@@ -28,9 +28,14 @@ import pathToRegexp from 'path-to-regexp';

*/
var matchPath = function matchPath(pathname, path) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var _options$exact = options.exact,
var matchPath = function matchPath(pathname) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
if (typeof options === 'string') options = { path: options };
var _options = options,
_options$exact = _options.exact,
exact = _options$exact === undefined ? false : _options$exact,
_options$strict = options.strict,
_options$strict = _options.strict,
strict = _options$strict === undefined ? false : _options$strict;
var path = options.path || options.from;

@@ -37,0 +42,0 @@ if (!path) return { url: pathname, isExact: true, params: {} };

@@ -26,3 +26,3 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

this.unblock = this.context.router.block(message);
this.unblock = this.context.history.block(message);
};

@@ -61,3 +61,3 @@

Prompt.contextTypes = {
router: PropTypes.shape({
history: PropTypes.shape({
block: PropTypes.func.isRequired

@@ -64,0 +64,0 @@ }).isRequired

@@ -24,11 +24,11 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

Redirect.prototype.componentWillMount = function componentWillMount() {
if (this.context.router.staticContext) this.perform();
if (this.context.history.staticContext) this.perform();
};
Redirect.prototype.componentDidMount = function componentDidMount() {
if (!this.context.router.staticContext) this.perform();
if (!this.context.history.staticContext) this.perform();
};
Redirect.prototype.perform = function perform() {
var router = this.context.router;
var history = this.context.history;
var _props = this.props,

@@ -40,5 +40,5 @@ push = _props.push,

if (push) {
router.push(to);
history.push(to);
} else {
router.replace(to);
history.replace(to);
}

@@ -55,3 +55,3 @@ };

Redirect.contextTypes = {
router: PropTypes.shape({
history: PropTypes.shape({
push: PropTypes.func.isRequired,

@@ -58,0 +58,0 @@ replace: PropTypes.func.isRequired,

@@ -1,3 +0,1 @@

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"); } }

@@ -9,13 +7,6 @@

import warning from 'warning';
import React, { PropTypes } from 'react';
import matchPath from './matchPath';
var computeMatch = function computeMatch(router, _ref) {
var computedMatch = _ref.computedMatch,
path = _ref.path,
exact = _ref.exact,
strict = _ref.strict;
return computedMatch || matchPath(router.location.pathname, path, { exact: exact, strict: strict });
};
/**

@@ -29,5 +20,13 @@ * The public API for matching a single path and rendering.

function Route() {
var _temp, _this, _ret;
_classCallCheck(this, Route);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
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)
}, _temp), _possibleConstructorReturn(_this, _ret);
}

@@ -37,36 +36,36 @@

return {
router: this.router
route: {
location: this.props.location || this.context.route.location,
match: this.state.match
}
};
};
Route.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
Route.prototype.computeMatch = function computeMatch(_ref, _ref2) {
var computedMatch = _ref.computedMatch,
location = _ref.location,
path = _ref.path,
strict = _ref.strict,
exact = _ref.exact;
var route = _ref2.route;
var parentRouter = this.context.router;
if (computedMatch) return computedMatch; // <Switch> already computed the match for us
this.router = _extends({}, parentRouter, {
match: computeMatch(parentRouter, this.props)
});
var pathname = (location || route.location).pathname;
// Start listening here so we can <Redirect> on the initial render.
this.unlisten = parentRouter.listen(function () {
_extends(_this2.router, parentRouter, {
match: computeMatch(parentRouter, _this2.props)
});
_this2.forceUpdate();
});
return matchPath(pathname, { path: path, strict: strict, exact: exact });
};
Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
_extends(this.router, {
match: computeMatch(this.router, nextProps)
Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) {
warning(!(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.');
warning(!(!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)
});
};
Route.prototype.componentWillUnmount = function componentWillUnmount() {
this.unlisten();
};
Route.prototype.render = function render() {
var match = this.state.match;
var _props = this.props,

@@ -76,8 +75,12 @@ children = _props.children,

render = _props.render;
var _context = this.context,
history = _context.history,
route = _context.route;
var props = _extends({}, this.router);
var location = this.props.location || route.location;
var props = { match: match, location: location, history: history };
return component ? // component prop gets first priority, only called if there's a match
props.match ? React.createElement(component, props) : null : render ? // render prop is next, only called if there's a match
props.match ? render(props) : null : children ? // children come last, always called
match ? React.createElement(component, props) : null : render ? // render prop is next, only called if there's a match
match ? render(props) : null : children ? // children come last, always called
typeof children === 'function' ? children(props) : !Array.isArray(children) || children.length ? // Preact defaults to empty children array

@@ -91,5 +94,4 @@ React.Children.only(children) : null : null;

Route.contextTypes = {
router: PropTypes.shape({
listen: PropTypes.func.isRequired
}).isRequired
history: PropTypes.object.isRequired,
route: PropTypes.object.isRequired
};

@@ -103,6 +105,7 @@ Route.propTypes = {

render: PropTypes.func,
children: PropTypes.oneOfType([PropTypes.func, PropTypes.node])
children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
location: PropTypes.object
};
Route.childContextTypes = {
router: PropTypes.object.isRequired
route: PropTypes.object.isRequired
};

@@ -109,0 +112,0 @@

@@ -7,2 +7,3 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

import warning from 'warning';
import invariant from 'invariant';

@@ -12,3 +13,3 @@ import React, { PropTypes } from 'react';

/**
* The public API for putting history on context.router.
* The public API for putting history on context.
*/

@@ -20,5 +21,13 @@

function Router() {
var _temp, _this, _ret;
_classCallCheck(this, Router);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
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);
}

@@ -28,13 +37,47 @@

return {
router: this.props.history
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 children = this.props.children;
var _this2 = this;
var _props = this.props,
children = _props.children,
history = _props.history;
invariant(children == null || React.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 () {
_this2.setState({
match: _this2.computeMatch(history.location.pathname)
});
});
};
Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
warning(this.props.history === nextProps.history, 'You cannot change <Router history>');
};
Router.prototype.componentWillUnmount = function componentWillUnmount() {
this.unlisten();
};
Router.prototype.render = function render() {

@@ -54,3 +97,4 @@ var children = this.props.children;

Router.childContextTypes = {
router: PropTypes.object.isRequired
history: PropTypes.object.isRequired,
route: PropTypes.object.isRequired
};

@@ -57,0 +101,0 @@

@@ -44,5 +44,3 @@ 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 base = addLeadingSlash(basename);
var pathname = location.pathname;
if (location.pathname.indexOf(base) !== 0) return location;

@@ -110,2 +108,4 @@

return noop;
}, _this.handleBlock = function () {
return noop;
}, _temp), _possibleConstructorReturn(_this, _ret);

@@ -131,3 +131,4 @@ }

goForward: staticHandler('goForward'),
listen: this.handleListen
listen: this.handleListen,
block: this.handleBlock
};

@@ -134,0 +135,0 @@

@@ -8,2 +8,3 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

import React, { PropTypes } from 'react';
import warning from 'warning';
import matchPath from './matchPath';

@@ -19,51 +20,28 @@

function Switch() {
var _temp, _this, _ret;
_classCallCheck(this, Switch);
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 = {
location: null
}, _temp), _possibleConstructorReturn(_this, _ret);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
Switch.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
Switch.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
warning(!(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.');
var router = this.context.router;
this.setState({
location: router.location
});
// Start listening here so we can <Redirect> on the initial render.
this.unlisten = router.listen(function () {
_this2.setState({
location: router.location
});
});
warning(!(!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.componentWillUnmount = function componentWillUnmount() {
this.unlisten();
};
Switch.prototype.render = function render() {
var children = this.props.children;
var location = this.state.location;
var routes = React.Children.toArray(children);
var location = this.props.location || this.context.route.location;
var route = void 0,
match = void 0;
for (var i = 0, length = routes.length; match == null && i < length; ++i) {
route = routes[i];
match = matchPath(location.pathname, route.props.path, route.props);
}
var match = void 0,
child = void 0;
React.Children.forEach(children, function (element) {
if (match == null) {
child = element;
match = matchPath(location.pathname, element.props);
}
});
return match ? React.cloneElement(route, { computedMatch: match }) : null;
return match ? React.cloneElement(child, { location: location, computedMatch: match }) : null;
};

@@ -75,8 +53,7 @@

Switch.contextTypes = {
router: PropTypes.shape({
listen: PropTypes.func.isRequired
}).isRequired
route: PropTypes.object.isRequired
};
Switch.propTypes = {
children: PropTypes.node
children: PropTypes.node,
location: PropTypes.object
};

@@ -83,0 +60,0 @@

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"); } }
import React from 'react';
import Route from './Route';
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; }
import React, { PropTypes } from 'react';
/**
* A public higher-order component for re-rendering as the
* location changes. Also, passes ...context.router as props.
* A public higher-order component to access the imperative API
*/
var withRouter = function withRouter(component) {
var _class, _temp;
var withRouter = function withRouter(Component) {
var C = function C(props) {
return React.createElement(Route, { render: function render(routeComponentProps) {
return React.createElement(Component, _extends({}, props, routeComponentProps));
} });
};
return _temp = _class = function (_React$Component) {
_inherits(_class, _React$Component);
C.displayName = 'withRouter(' + (Component.displayName || Component.name) + ')';
function _class() {
_classCallCheck(this, _class);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
_class.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
// Start listening here so we can <Redirect> on the initial render.
this.unlisten = this.context.router.listen(function () {
return _this2.forceUpdate();
});
};
_class.prototype.componentWillUnmount = function componentWillUnmount() {
this.unlisten();
};
_class.prototype.render = function render() {
return React.createElement(component, _extends({}, this.props, this.context.router));
};
return _class;
}(React.Component), _class.displayName = 'withRouter(' + (component.displayName || component.name) + ')', _class.contextTypes = {
router: PropTypes.shape({
listen: PropTypes.func.isRequired
}).isRequired
}, _temp;
return C;
};
export default withRouter;

@@ -36,9 +36,14 @@ 'use strict';

*/
var matchPath = function matchPath(pathname, path) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var _options$exact = options.exact,
var matchPath = function matchPath(pathname) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
if (typeof options === 'string') options = { path: options };
var _options = options,
_options$exact = _options.exact,
exact = _options$exact === undefined ? false : _options$exact,
_options$strict = options.strict,
_options$strict = _options.strict,
strict = _options$strict === undefined ? false : _options$strict;
var path = options.path || options.from;

@@ -45,0 +50,0 @@ if (!path) return { url: pathname, isExact: true, params: {} };

{
"name": "react-router",
"version": "4.0.0-beta.6",
"version": "4.0.0-beta.7",
"description": "Declarative routing for React",

@@ -43,3 +43,4 @@ "repository": "ReactTraining/react-router",

"loose-envify": "^1.3.1",
"path-to-regexp": "^1.5.3"
"path-to-regexp": "^1.5.3",
"warning": "^3.0.0"
},

@@ -51,3 +52,2 @@ "devDependencies": {

"babel-plugin-dev-expression": "^0.2.1",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-plugin-transform-react-remove-prop-types": "^0.2.11",

@@ -54,0 +54,0 @@ "babel-preset-es2015": "^6.14.0",

@@ -33,3 +33,3 @@ 'use strict';

this.unblock = this.context.router.block(message);
this.unblock = this.context.history.block(message);
};

@@ -68,3 +68,3 @@

Prompt.contextTypes = {
router: _react.PropTypes.shape({
history: _react.PropTypes.shape({
block: _react.PropTypes.func.isRequired

@@ -71,0 +71,0 @@ }).isRequired

@@ -31,11 +31,11 @@ 'use strict';

Redirect.prototype.componentWillMount = function componentWillMount() {
if (this.context.router.staticContext) this.perform();
if (this.context.history.staticContext) this.perform();
};
Redirect.prototype.componentDidMount = function componentDidMount() {
if (!this.context.router.staticContext) this.perform();
if (!this.context.history.staticContext) this.perform();
};
Redirect.prototype.perform = function perform() {
var router = this.context.router;
var history = this.context.history;
var _props = this.props,

@@ -47,5 +47,5 @@ push = _props.push,

if (push) {
router.push(to);
history.push(to);
} else {
router.replace(to);
history.replace(to);
}

@@ -62,3 +62,3 @@ };

Redirect.contextTypes = {
router: _react.PropTypes.shape({
history: _react.PropTypes.shape({
push: _react.PropTypes.func.isRequired,

@@ -65,0 +65,0 @@ replace: _react.PropTypes.func.isRequired,

@@ -5,4 +5,6 @@ 'use strict';

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 _warning = require('warning');
var _warning2 = _interopRequireDefault(_warning);
var _react = require('react');

@@ -24,14 +26,5 @@

var computeMatch = function computeMatch(router, _ref) {
var computedMatch = _ref.computedMatch,
path = _ref.path,
exact = _ref.exact,
strict = _ref.strict;
return computedMatch || (0, _matchPath2.default)(router.location.pathname, path, { exact: exact, strict: strict });
};
/**
* The public API for matching a single path and rendering.
*/
var Route = function (_React$Component) {

@@ -41,5 +34,13 @@ _inherits(Route, _React$Component);

function Route() {
var _temp, _this, _ret;
_classCallCheck(this, Route);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
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)
}, _temp), _possibleConstructorReturn(_this, _ret);
}

@@ -49,36 +50,36 @@

return {
router: this.router
route: {
location: this.props.location || this.context.route.location,
match: this.state.match
}
};
};
Route.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
Route.prototype.computeMatch = function computeMatch(_ref, _ref2) {
var computedMatch = _ref.computedMatch,
location = _ref.location,
path = _ref.path,
strict = _ref.strict,
exact = _ref.exact;
var route = _ref2.route;
var parentRouter = this.context.router;
if (computedMatch) return computedMatch; // <Switch> already computed the match for us
this.router = _extends({}, parentRouter, {
match: computeMatch(parentRouter, this.props)
});
var pathname = (location || route.location).pathname;
// Start listening here so we can <Redirect> on the initial render.
this.unlisten = parentRouter.listen(function () {
_extends(_this2.router, parentRouter, {
match: computeMatch(parentRouter, _this2.props)
});
_this2.forceUpdate();
});
return (0, _matchPath2.default)(pathname, { path: path, strict: strict, exact: exact });
};
Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
_extends(this.router, {
match: computeMatch(this.router, nextProps)
Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) {
(0, _warning2.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.');
(0, _warning2.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)
});
};
Route.prototype.componentWillUnmount = function componentWillUnmount() {
this.unlisten();
};
Route.prototype.render = function render() {
var match = this.state.match;
var _props = this.props,

@@ -88,8 +89,12 @@ children = _props.children,

render = _props.render;
var _context = this.context,
history = _context.history,
route = _context.route;
var props = _extends({}, this.router);
var location = this.props.location || route.location;
var props = { match: match, location: location, history: history };
return component ? // component prop gets first priority, only called if there's a match
props.match ? _react2.default.createElement(component, props) : null : render ? // render prop is next, only called if there's a match
props.match ? render(props) : null : children ? // children come last, always called
match ? _react2.default.createElement(component, props) : null : render ? // render prop is next, only called if there's a match
match ? render(props) : null : children ? // children come last, always called
typeof children === 'function' ? children(props) : !Array.isArray(children) || children.length ? // Preact defaults to empty children array

@@ -103,5 +108,4 @@ _react2.default.Children.only(children) : null : null;

Route.contextTypes = {
router: _react.PropTypes.shape({
listen: _react.PropTypes.func.isRequired
}).isRequired
history: _react.PropTypes.object.isRequired,
route: _react.PropTypes.object.isRequired
};

@@ -115,7 +119,8 @@ Route.propTypes = {

render: _react.PropTypes.func,
children: _react.PropTypes.oneOfType([_react.PropTypes.func, _react.PropTypes.node])
children: _react.PropTypes.oneOfType([_react.PropTypes.func, _react.PropTypes.node]),
location: _react.PropTypes.object
};
Route.childContextTypes = {
router: _react.PropTypes.object.isRequired
route: _react.PropTypes.object.isRequired
};
exports.default = Route;

@@ -5,2 +5,6 @@ 'use strict';

var _warning = require('warning');
var _warning2 = _interopRequireDefault(_warning);
var _invariant = require('invariant');

@@ -23,3 +27,3 @@

/**
* The public API for putting history on context.router.
* The public API for putting history on context.
*/

@@ -30,5 +34,13 @@ var Router = function (_React$Component) {

function Router() {
var _temp, _this, _ret;
_classCallCheck(this, Router);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
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);
}

@@ -38,13 +50,47 @@

return {
router: this.props.history
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 children = this.props.children;
var _this2 = this;
var _props = this.props,
children = _props.children,
history = _props.history;
(0, _invariant2.default)(children == null || _react2.default.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 () {
_this2.setState({
match: _this2.computeMatch(history.location.pathname)
});
});
};
Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
(0, _warning2.default)(this.props.history === nextProps.history, 'You cannot change <Router history>');
};
Router.prototype.componentWillUnmount = function componentWillUnmount() {
this.unlisten();
};
Router.prototype.render = function render() {

@@ -64,4 +110,5 @@ var children = this.props.children;

Router.childContextTypes = {
router: _react.PropTypes.object.isRequired
history: _react.PropTypes.object.isRequired,
route: _react.PropTypes.object.isRequired
};
exports.default = Router;

@@ -59,5 +59,3 @@ 'use strict';

var base = (0, _PathUtils.addLeadingSlash)(basename);
var pathname = location.pathname;
if (location.pathname.indexOf(base) !== 0) return location;

@@ -125,2 +123,4 @@

return noop;
}, _this.handleBlock = function () {
return noop;
}, _temp), _possibleConstructorReturn(_this, _ret);

@@ -146,3 +146,4 @@ }

goForward: staticHandler('goForward'),
listen: this.handleListen
listen: this.handleListen,
block: this.handleBlock
};

@@ -149,0 +150,0 @@

@@ -9,2 +9,6 @@ 'use strict';

var _warning = require('warning');
var _warning2 = _interopRequireDefault(_warning);
var _matchPath = require('./matchPath');

@@ -29,51 +33,28 @@

function Switch() {
var _temp, _this, _ret;
_classCallCheck(this, Switch);
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 = {
location: null
}, _temp), _possibleConstructorReturn(_this, _ret);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
Switch.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
Switch.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
(0, _warning2.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.');
var router = this.context.router;
this.setState({
location: router.location
});
// Start listening here so we can <Redirect> on the initial render.
this.unlisten = router.listen(function () {
_this2.setState({
location: router.location
});
});
(0, _warning2.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.componentWillUnmount = function componentWillUnmount() {
this.unlisten();
};
Switch.prototype.render = function render() {
var children = this.props.children;
var location = this.state.location;
var routes = _react2.default.Children.toArray(children);
var location = this.props.location || this.context.route.location;
var route = void 0,
match = void 0;
for (var i = 0, length = routes.length; match == null && i < length; ++i) {
route = routes[i];
match = (0, _matchPath2.default)(location.pathname, route.props.path, route.props);
}
var match = void 0,
child = void 0;
_react2.default.Children.forEach(children, function (element) {
if (match == null) {
child = element;
match = (0, _matchPath2.default)(location.pathname, element.props);
}
});
return match ? _react2.default.cloneElement(route, { computedMatch: match }) : null;
return match ? _react2.default.cloneElement(child, { location: location, computedMatch: match }) : null;
};

@@ -85,9 +66,8 @@

Switch.contextTypes = {
router: _react.PropTypes.shape({
listen: _react.PropTypes.func.isRequired
}).isRequired
route: _react.PropTypes.object.isRequired
};
Switch.propTypes = {
children: _react.PropTypes.node
children: _react.PropTypes.node,
location: _react.PropTypes.object
};
exports.default = Switch;

@@ -760,2 +760,6 @@ (function webpackUniversalModuleDefinition(root, factory) {

var _warning = __webpack_require__(4);
var _warning2 = _interopRequireDefault(_warning);
var _invariant = __webpack_require__(11);

@@ -778,3 +782,3 @@

/**
* The public API for putting history on context.router.
* The public API for putting history on context.
*/

@@ -785,5 +789,13 @@ var Router = function (_React$Component) {

function Router() {
var _temp, _this, _ret;
_classCallCheck(this, Router);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
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);
}

@@ -793,13 +805,47 @@

return {
router: this.props.history
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 children = this.props.children;
var _this2 = this;
var _props = this.props,
children = _props.children,
history = _props.history;
!(children == null || _react2.default.Children.count(children) === 1) ? false ? (0, _invariant2.default)(false, 'A <Router> may have only one child element') : (0, _invariant2.default)(false) : void 0;
// 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 () {
_this2.setState({
match: _this2.computeMatch(history.location.pathname)
});
});
};
Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
false ? (0, _warning2.default)(this.props.history === nextProps.history, 'You cannot change <Router history>') : void 0;
};
Router.prototype.componentWillUnmount = function componentWillUnmount() {
this.unlisten();
};
Router.prototype.render = function render() {

@@ -815,3 +861,4 @@ var children = this.props.children;

Router.childContextTypes = {
router: _react.PropTypes.object.isRequired
history: _react.PropTypes.object.isRequired,
route: _react.PropTypes.object.isRequired
};

@@ -913,3 +960,3 @@ exports.default = Router;

this.unblock = this.context.router.block(message);
this.unblock = this.context.history.block(message);
};

@@ -948,3 +995,3 @@

Prompt.contextTypes = {
router: _react.PropTypes.shape({
history: _react.PropTypes.shape({
block: _react.PropTypes.func.isRequired

@@ -992,11 +1039,11 @@ }).isRequired

Redirect.prototype.componentWillMount = function componentWillMount() {
if (this.context.router.staticContext) this.perform();
if (this.context.history.staticContext) this.perform();
};
Redirect.prototype.componentDidMount = function componentDidMount() {
if (!this.context.router.staticContext) this.perform();
if (!this.context.history.staticContext) this.perform();
};
Redirect.prototype.perform = function perform() {
var router = this.context.router;
var history = this.context.history;
var _props = this.props,

@@ -1008,5 +1055,5 @@ push = _props.push,

if (push) {
router.push(to);
history.push(to);
} else {
router.replace(to);
history.replace(to);
}

@@ -1023,3 +1070,3 @@ };

Redirect.contextTypes = {
router: _react.PropTypes.shape({
history: _react.PropTypes.shape({
push: _react.PropTypes.func.isRequired,

@@ -1043,4 +1090,6 @@ replace: _react.PropTypes.func.isRequired,

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 _warning = __webpack_require__(4);
var _warning2 = _interopRequireDefault(_warning);
var _react = __webpack_require__(2);

@@ -1062,14 +1111,5 @@

var computeMatch = function computeMatch(router, _ref) {
var computedMatch = _ref.computedMatch,
path = _ref.path,
exact = _ref.exact,
strict = _ref.strict;
return computedMatch || (0, _matchPath2.default)(router.location.pathname, path, { exact: exact, strict: strict });
};
/**
* The public API for matching a single path and rendering.
*/
var Route = function (_React$Component) {

@@ -1079,5 +1119,13 @@ _inherits(Route, _React$Component);

function Route() {
var _temp, _this, _ret;
_classCallCheck(this, Route);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
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)
}, _temp), _possibleConstructorReturn(_this, _ret);
}

@@ -1087,36 +1135,36 @@

return {
router: this.router
route: {
location: this.props.location || this.context.route.location,
match: this.state.match
}
};
};
Route.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
Route.prototype.computeMatch = function computeMatch(_ref, _ref2) {
var computedMatch = _ref.computedMatch,
location = _ref.location,
path = _ref.path,
strict = _ref.strict,
exact = _ref.exact;
var route = _ref2.route;
var parentRouter = this.context.router;
if (computedMatch) return computedMatch; // <Switch> already computed the match for us
this.router = _extends({}, parentRouter, {
match: computeMatch(parentRouter, this.props)
});
var pathname = (location || route.location).pathname;
// Start listening here so we can <Redirect> on the initial render.
this.unlisten = parentRouter.listen(function () {
_extends(_this2.router, parentRouter, {
match: computeMatch(parentRouter, _this2.props)
});
_this2.forceUpdate();
});
return (0, _matchPath2.default)(pathname, { path: path, strict: strict, exact: exact });
};
Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
_extends(this.router, {
match: computeMatch(this.router, nextProps)
Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) {
false ? (0, _warning2.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.') : void 0;
false ? (0, _warning2.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.') : void 0;
this.setState({
match: this.computeMatch(nextProps, nextContext)
});
};
Route.prototype.componentWillUnmount = function componentWillUnmount() {
this.unlisten();
};
Route.prototype.render = function render() {
var match = this.state.match;
var _props = this.props,

@@ -1126,8 +1174,12 @@ children = _props.children,

render = _props.render;
var _context = this.context,
history = _context.history,
route = _context.route;
var props = _extends({}, this.router);
var location = this.props.location || route.location;
var props = { match: match, location: location, history: history };
return component ? // component prop gets first priority, only called if there's a match
props.match ? _react2.default.createElement(component, props) : null : render ? // render prop is next, only called if there's a match
props.match ? render(props) : null : children ? // children come last, always called
match ? _react2.default.createElement(component, props) : null : render ? // render prop is next, only called if there's a match
match ? render(props) : null : children ? // children come last, always called
typeof children === 'function' ? children(props) : !Array.isArray(children) || children.length ? // Preact defaults to empty children array

@@ -1141,8 +1193,7 @@ _react2.default.Children.only(children) : null : null;

Route.contextTypes = {
router: _react.PropTypes.shape({
listen: _react.PropTypes.func.isRequired
}).isRequired
history: _react.PropTypes.object.isRequired,
route: _react.PropTypes.object.isRequired
};
Route.childContextTypes = {
router: _react.PropTypes.object.isRequired
route: _react.PropTypes.object.isRequired
};

@@ -1190,9 +1241,14 @@ exports.default = Route;

*/
var matchPath = function matchPath(pathname, path) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var _options$exact = options.exact,
var matchPath = function matchPath(pathname) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
if (typeof options === 'string') options = { path: options };
var _options = options,
_options$exact = _options.exact,
exact = _options$exact === undefined ? false : _options$exact,
_options$strict = options.strict,
_options$strict = _options.strict,
strict = _options$strict === undefined ? false : _options$strict;
var path = options.path || options.from;

@@ -1732,5 +1788,3 @@ if (!path) return { url: pathname, isExact: true, params: {} };

var base = (0, _PathUtils.addLeadingSlash)(basename);
var pathname = location.pathname;
if (location.pathname.indexOf(base) !== 0) return location;

@@ -1798,2 +1852,4 @@

return noop;
}, _this.handleBlock = function () {
return noop;
}, _temp), _possibleConstructorReturn(_this, _ret);

@@ -1819,3 +1875,4 @@ }

goForward: staticHandler('goForward'),
listen: this.handleListen
listen: this.handleListen,
block: this.handleBlock
};

@@ -1847,2 +1904,6 @@

var _warning = __webpack_require__(4);
var _warning2 = _interopRequireDefault(_warning);
var _matchPath = __webpack_require__(15);

@@ -1867,51 +1928,28 @@

function Switch() {
var _temp, _this, _ret;
_classCallCheck(this, Switch);
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 = {
location: null
}, _temp), _possibleConstructorReturn(_this, _ret);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
Switch.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
Switch.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
false ? (0, _warning2.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.') : void 0;
var router = this.context.router;
this.setState({
location: router.location
});
// Start listening here so we can <Redirect> on the initial render.
this.unlisten = router.listen(function () {
_this2.setState({
location: router.location
});
});
false ? (0, _warning2.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.') : void 0;
};
Switch.prototype.componentWillUnmount = function componentWillUnmount() {
this.unlisten();
};
Switch.prototype.render = function render() {
var children = this.props.children;
var location = this.state.location;
var routes = _react2.default.Children.toArray(children);
var location = this.props.location || this.context.route.location;
var route = void 0,
match = void 0;
for (var i = 0, length = routes.length; match == null && i < length; ++i) {
route = routes[i];
match = (0, _matchPath2.default)(location.pathname, route.props.path, route.props);
}
var match = void 0,
child = void 0;
_react2.default.Children.forEach(children, function (element) {
if (match == null) {
child = element;
match = (0, _matchPath2.default)(location.pathname, element.props);
}
});
return match ? _react2.default.cloneElement(route, { computedMatch: match }) : null;
return match ? _react2.default.cloneElement(child, { location: location, computedMatch: match }) : null;
};

@@ -1923,5 +1961,3 @@

Switch.contextTypes = {
router: _react.PropTypes.shape({
listen: _react.PropTypes.func.isRequired
}).isRequired
route: _react.PropTypes.object.isRequired
};

@@ -1944,49 +1980,21 @@ exports.default = Switch;

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _Route = __webpack_require__(14);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var _Route2 = _interopRequireDefault(_Route);
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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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; }
/**
* A public higher-order component for re-rendering as the
* location changes. Also, passes ...context.router as props.
* A public higher-order component to access the imperative API
*/
var withRouter = function withRouter(component) {
var _class, _temp;
var withRouter = function withRouter(Component) {
var C = function C(props) {
return _react2.default.createElement(_Route2.default, { render: function render(routeComponentProps) {
return _react2.default.createElement(Component, _extends({}, props, routeComponentProps));
} });
};
return _temp = _class = function (_React$Component) {
_inherits(_class, _React$Component);
C.displayName = 'withRouter(' + (Component.displayName || Component.name) + ')';
function _class() {
_classCallCheck(this, _class);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
_class.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
// Start listening here so we can <Redirect> on the initial render.
this.unlisten = this.context.router.listen(function () {
return _this2.forceUpdate();
});
};
_class.prototype.componentWillUnmount = function componentWillUnmount() {
this.unlisten();
};
_class.prototype.render = function render() {
return _react2.default.createElement(component, _extends({}, this.props, this.context.router));
};
return _class;
}(_react2.default.Component), _class.displayName = 'withRouter(' + (component.displayName || component.name) + ')', _class.contextTypes = {
router: _react.PropTypes.shape({
listen: _react.PropTypes.func.isRequired
}).isRequired
}, _temp;
return C;
};

@@ -1993,0 +2001,0 @@

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ReactRouter=e(require("react")):t.ReactRouter=e(t.React)}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.withRouter=e.matchPath=e.Switch=e.StaticRouter=e.Router=e.Route=e.Redirect=e.Prompt=e.MemoryRouter=void 0;var o=n(7),i=r(o),u=n(8),a=r(u),c=n(9),s=r(c),f=n(10),l=r(f),p=n(2),h=r(p),d=n(11),y=r(d),v=n(12),m=r(v),b=n(3),g=r(b),w=n(13),x=r(w);e.MemoryRouter=i.default,e.Prompt=a.default,e.Redirect=s.default,e.Route=l.default,e.Router=h.default,e.StaticRouter=y.default,e.Switch=m.default,e.matchPath=g.default,e.withRouter=x.default},function(e,n){e.exports=t},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var a=n(5),c=r(a),s=n(1),f=r(s),l=function(t){function e(){return o(this,e),i(this,t.apply(this,arguments))}return u(e,t),e.prototype.getChildContext=function(){return{router:this.props.history}},e.prototype.componentWillMount=function(){var t=this.props.children;null!=t&&1!==f.default.Children.count(t)?(0,c.default)(!1):void 0},e.prototype.render=function(){var t=this.props.children;return t?f.default.Children.only(t):null},e}(f.default.Component);l.childContextTypes={router:s.PropTypes.object.isRequired},e.default=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(18),i=r(o),u={},a=1e4,c=0,s=function(t,e){var n=""+e.end+e.strict,r=u[n]||(u[n]={});if(r[t])return r[t];var o=[],s=(0,i.default)(t,o,e),f={re:s,keys:o};return c<a&&(r[t]=f,c++),f},f=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.exact,o=void 0!==r&&r,i=n.strict,u=void 0!==i&&i;if(!e)return{url:t,isExact:!0,params:{}};var a=s(e,{end:o,strict:u}),c=a.re,f=a.keys,l=c.exec(t);if(!l)return null;var p=l[0],h=l.slice(1),d=t===p;return o&&!d?null:{path:e,url:"/"===e&&""===p?"/":p,isExact:d,params:f.reduce(function(t,e,n){return t[e.name]=h[n],t},{})}};e.default=f},function(t,e){"use strict";e.__esModule=!0;e.addLeadingSlash=function(t){return"/"===t.charAt(0)?t:"/"+t},e.stripLeadingSlash=function(t){return"/"===t.charAt(0)?t.substr(1):t},e.stripPrefix=function(t,e){return 0===t.indexOf(e)?t.substr(e.length):t},e.parsePath=function(t){var e=t||"/",n="",r="",o=e.indexOf("#");o!==-1&&(r=e.substr(o),e=e.substr(0,o));var i=e.indexOf("?");return i!==-1&&(n=e.substr(i),e=e.substr(0,i)),{pathname:e,search:"?"===n?"":n,hash:"#"===r?"":r}},e.createPath=function(t){var e=t.pathname,n=t.search,r=t.hash,o=e||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}},function(t,e,n){"use strict";var r=function(t,e,n,r,o,i,u,a){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,r,o,i,u,a],f=0;c=new Error(e.replace(/%s/g,function(){return s[f++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}};t.exports=r},function(t,e,n){"use strict";var r=function(){};t.exports=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var a=n(1),c=r(a),s=n(15),f=r(s),l=n(2),p=r(l),h=function(t){function e(){var n,r,u;o(this,e);for(var a=arguments.length,c=Array(a),s=0;s<a;s++)c[s]=arguments[s];return n=r=i(this,t.call.apply(t,[this].concat(c))),r.history=(0,f.default)(r.props),u=n,i(r,u)}return u(e,t),e.prototype.render=function(){return c.default.createElement(p.default,{history:this.history,children:this.props.children})},e}(c.default.Component);e.default=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var a=n(1),c=r(a),s=function(t){function e(){return o(this,e),i(this,t.apply(this,arguments))}return u(e,t),e.prototype.enable=function(t){this.unblock&&this.unblock(),this.unblock=this.context.router.block(t)},e.prototype.disable=function(){this.unblock&&(this.unblock(),this.unblock=null)},e.prototype.componentWillMount=function(){this.props.when&&this.enable(this.props.message)},e.prototype.componentWillReceiveProps=function(t){t.when?this.props.when&&this.props.message===t.message||this.enable(t.message):this.disable()},e.prototype.componentWillUnmount=function(){this.disable()},e.prototype.render=function(){return null},e}(c.default.Component);s.contextTypes={router:a.PropTypes.shape({block:a.PropTypes.func.isRequired}).isRequired},s.defaultProps={when:!0},e.default=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var a=n(1),c=r(a),s=function(t){function e(){return o(this,e),i(this,t.apply(this,arguments))}return u(e,t),e.prototype.componentWillMount=function(){this.context.router.staticContext&&this.perform()},e.prototype.componentDidMount=function(){this.context.router.staticContext||this.perform()},e.prototype.perform=function(){var t=this.context.router,e=this.props,n=e.push,r=e.to;n?t.push(r):t.replace(r)},e.prototype.render=function(){return null},e}(c.default.Component);s.contextTypes={router:a.PropTypes.shape({push:a.PropTypes.func.isRequired,replace:a.PropTypes.func.isRequired,staticContext:a.PropTypes.object}).isRequired},s.defaultProps={push:!1},e.default=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},c=n(1),s=r(c),f=n(3),l=r(f),p=function(t,e){var n=e.computedMatch,r=e.path,o=e.exact,i=e.strict;return n||(0,l.default)(t.location.pathname,r,{exact:o,strict:i})},h=function(t){function e(){return o(this,e),i(this,t.apply(this,arguments))}return u(e,t),e.prototype.getChildContext=function(){return{router:this.router}},e.prototype.componentWillMount=function(){var t=this,e=this.context.router;this.router=a({},e,{match:p(e,this.props)}),this.unlisten=e.listen(function(){a(t.router,e,{match:p(e,t.props)}),t.forceUpdate()})},e.prototype.componentWillReceiveProps=function(t){a(this.router,{match:p(this.router,t)})},e.prototype.componentWillUnmount=function(){this.unlisten()},e.prototype.render=function t(){var e=this.props,n=e.children,r=e.component,t=e.render,o=a({},this.router);return r?o.match?s.default.createElement(r,o):null:t?o.match?t(o):null:n?"function"==typeof n?n(o):!Array.isArray(n)||n.length?s.default.Children.only(n):null:null},e}(s.default.Component);h.contextTypes={router:c.PropTypes.shape({listen:c.PropTypes.func.isRequired}).isRequired},h.childContextTypes={router:c.PropTypes.object.isRequired},e.default=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},s=n(5),f=r(s),l=n(1),p=r(l),h=n(4),d=n(2),y=r(d),v=function(t){var e=t.pathname,n=void 0===e?"/":e,r=t.search,o=void 0===r?"":r,i=t.hash,u=void 0===i?"":i;return{pathname:n,search:"?"===o?"":o,hash:"#"===u?"":u}},m=function(t,e){return t?c({},e,{pathname:(0,h.addLeadingSlash)(t)+e.pathname}):e},b=function(t,e){if(!t)return e;var n=(0,h.addLeadingSlash)(t);e.pathname;return 0!==e.pathname.indexOf(n)?e:c({},e,{pathname:e.pathname.substr(n.length)})},g=function(t){return"string"==typeof t?(0,h.parsePath)(t):v(t)},w=function(t){return"string"==typeof t?t:(0,h.createPath)(t)},x=function(t){return function(){(0,f.default)(!1)}},_=function(){},O=function(t){function e(){var n,r,o;i(this,e);for(var a=arguments.length,c=Array(a),s=0;s<a;s++)c[s]=arguments[s];return n=r=u(this,t.call.apply(t,[this].concat(c))),r.createHref=function(t){return(0,h.addLeadingSlash)(r.props.basename+w(t))},r.handlePush=function(t){var e=r.props,n=e.basename,o=e.context;o.action="PUSH",o.location=m(n,g(t)),o.url=w(o.location)},r.handleReplace=function(t){var e=r.props,n=e.basename,o=e.context;o.action="REPLACE",o.location=m(n,g(t)),o.url=w(o.location)},r.handleListen=function(){return _},o=n,u(r,o)}return a(e,t),e.prototype.render=function(){var t=this.props,e=t.basename,n=t.context,r=t.location,i=o(t,["basename","context","location"]),u={staticContext:n,createHref:this.createHref,action:"POP",location:b(e,g(r)),push:this.handlePush,replace:this.handleReplace,go:x("go"),goBack:x("goBack"),goForward:x("goForward"),listen:this.handleListen};return p.default.createElement(y.default,c({},i,{history:u}))},e}(p.default.Component);O.defaultProps={basename:"",location:"/"},e.default=O},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var a=n(1),c=r(a),s=n(3),f=r(s),l=function(t){function e(){var n,r,u;o(this,e);for(var a=arguments.length,c=Array(a),s=0;s<a;s++)c[s]=arguments[s];return n=r=i(this,t.call.apply(t,[this].concat(c))),r.state={location:null},u=n,i(r,u)}return u(e,t),e.prototype.componentWillMount=function(){var t=this,e=this.context.router;this.setState({location:e.location}),this.unlisten=e.listen(function(){t.setState({location:e.location})})},e.prototype.componentWillUnmount=function(){this.unlisten()},e.prototype.render=function(){for(var t=this.props.children,e=this.state.location,n=c.default.Children.toArray(t),r=void 0,o=void 0,i=0,u=n.length;null==o&&i<u;++i)r=n[i],o=(0,f.default)(e.pathname,r.props.path,r.props);return o?c.default.cloneElement(r,{computedMatch:o}):null},e}(c.default.Component);l.contextTypes={router:a.PropTypes.shape({listen:a.PropTypes.func.isRequired}).isRequired},e.default=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},c=n(1),s=r(c),f=function(t){var e,n;return n=e=function(e){function n(){return o(this,n),i(this,e.apply(this,arguments))}return u(n,e),n.prototype.componentWillMount=function(){var t=this;this.unlisten=this.context.router.listen(function(){return t.forceUpdate()})},n.prototype.componentWillUnmount=function(){this.unlisten()},n.prototype.render=function(){return s.default.createElement(t,a({},this.props,this.context.router))},n}(s.default.Component),e.displayName="withRouter("+(t.displayName||t.name)+")",e.contextTypes={router:c.PropTypes.shape({listen:c.PropTypes.func.isRequired}).isRequired},n};e.default=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.locationsAreEqual=e.createLocation=void 0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(19),u=r(i),a=n(20),c=r(a),s=n(4);e.createLocation=function(t,e,n,r){var i=void 0;return"string"==typeof t?(i=(0,s.parsePath)(t),i.state=e):(i=o({},t),void 0===i.pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==e&&void 0===i.state&&(i.state=e)),i.key=n,r&&(i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=(0,u.default)(i.pathname,r.pathname)):i.pathname=r.pathname),i},e.locationsAreEqual=function(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&(0,c.default)(t.state,e.state)}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}),i=n(6),u=(r(i),n(4)),a=n(14),c=n(16),s=r(c),f=function(t,e,n){return Math.min(Math.max(t,e),n)},l=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.getUserConfirmation,n=t.initialEntries,r=void 0===n?["/"]:n,i=t.initialIndex,c=void 0===i?0:i,l=t.keyLength,p=void 0===l?6:l,h=(0,s.default)(),d=function(t){o(R,t),R.length=R.entries.length,h.notifyListeners(R.location,R.action)},y=function(){return Math.random().toString(36).substr(2,p)},v=f(c,0,r.length-1),m=r.map(function(t,e){return"string"==typeof t?(0,a.createLocation)(t,void 0,e?y():void 0):(0,a.createLocation)(t,void 0,e?t.key||y():void 0)}),b=u.createPath,g=function(t,n){var r="PUSH",o=(0,a.createLocation)(t,n,y(),R.location);h.confirmTransitionTo(o,r,e,function(t){if(t){var e=R.index,n=e+1,i=R.entries.slice(0);i.length>n?i.splice(n,i.length-n,o):i.push(o),d({action:r,location:o,index:n,entries:i})}})},w=function(t,n){var r="REPLACE",o=(0,a.createLocation)(t,n,y(),R.location);h.confirmTransitionTo(o,r,e,function(t){t&&(R.entries[R.index]=o,d({action:r,location:o}))})},x=function(t){var n=f(R.index+t,0,R.entries.length-1),r="POP",o=R.entries[n];h.confirmTransitionTo(o,r,e,function(t){t?d({action:r,location:o,index:n}):d()})},_=function(){return x(-1)},O=function(){return x(1)},P=function(t){var e=R.index+t;return e>=0&&e<R.entries.length},j=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return h.setPrompt(t)},E=function(t){return h.appendListener(t)},R={length:m.length,action:"POP",location:m[v],index:v,entries:m,createHref:b,push:g,replace:w,go:x,goBack:_,goForward:O,canGo:P,block:j,listen:E};return R};e.default=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(6),i=(r(o),function(){var t=null,e=function(e){return t=e,function(){t===e&&(t=null)}},n=function(e,n,r,o){if(null!=t){var i="function"==typeof t?t(e,n):t;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(i!==!1)}else o(!0)},r=[],o=function(t){var e=!0,n=function(){e&&t.apply(void 0,arguments)};return r.push(n),function(){e=!1,r=r.filter(function(t){return t!==n})}},i=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];r.forEach(function(t){return t.apply(void 0,e)})};return{setPrompt:e,confirmTransitionTo:n,appendListener:o,notifyListeners:i}});e.default=i},function(t,e){t.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}},function(t,e,n){function r(t,e){for(var n,r=[],o=0,i=0,u="",a=e&&e.delimiter||"/";null!=(n=b.exec(t));){var f=n[0],l=n[1],p=n.index;if(u+=t.slice(i,p),i=p+f.length,l)u+=l[1];else{var h=t[i],d=n[2],y=n[3],v=n[4],m=n[5],g=n[6],w=n[7];u&&(r.push(u),u="");var x=null!=d&&null!=h&&h!==d,_="+"===g||"*"===g,O="?"===g||"*"===g,P=n[2]||a,j=v||m;r.push({name:y||o++,prefix:d||"",delimiter:P,optional:O,repeat:_,partial:x,asterisk:!!w,pattern:j?s(j):w?".*":"[^"+c(P)+"]+?"})}}return i<t.length&&(u+=t.substr(i)),u&&r.push(u),r}function o(t,e){return a(r(t,e))}function i(t){return encodeURI(t).replace(/[\/?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function u(t){return encodeURI(t).replace(/[?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function a(t){for(var e=new Array(t.length),n=0;n<t.length;n++)"object"==typeof t[n]&&(e[n]=new RegExp("^(?:"+t[n].pattern+")$"));return function(n,r){for(var o="",a=n||{},c=r||{},s=c.pretty?i:encodeURIComponent,f=0;f<t.length;f++){var l=t[f];if("string"!=typeof l){var p,h=a[l.name];if(null==h){if(l.optional){l.partial&&(o+=l.prefix);continue}throw new TypeError('Expected "'+l.name+'" to be defined')}if(m(h)){if(!l.repeat)throw new TypeError('Expected "'+l.name+'" to not repeat, but received `'+JSON.stringify(h)+"`");if(0===h.length){if(l.optional)continue;throw new TypeError('Expected "'+l.name+'" to not be empty')}for(var d=0;d<h.length;d++){if(p=s(h[d]),!e[f].test(p))throw new TypeError('Expected all "'+l.name+'" to match "'+l.pattern+'", but received `'+JSON.stringify(p)+"`");o+=(0===d?l.prefix:l.delimiter)+p}}else{if(p=l.asterisk?u(h):s(h),!e[f].test(p))throw new TypeError('Expected "'+l.name+'" to match "'+l.pattern+'", but received "'+p+'"');o+=l.prefix+p}}else o+=l}return o}}function c(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function s(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function f(t,e){return t.keys=e,t}function l(t){return t.sensitive?"":"i"}function p(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return f(t,e)}function h(t,e,n){for(var r=[],o=0;o<t.length;o++)r.push(v(t[o],e,n).source);var i=new RegExp("(?:"+r.join("|")+")",l(n));return f(i,e)}function d(t,e,n){return y(r(t,n),e,n)}function y(t,e,n){m(e)||(n=e||n,e=[]),n=n||{};for(var r=n.strict,o=n.end!==!1,i="",u=0;u<t.length;u++){var a=t[u];if("string"==typeof a)i+=c(a);else{var s=c(a.prefix),p="(?:"+a.pattern+")";e.push(a),a.repeat&&(p+="(?:"+s+p+")*"),p=a.optional?a.partial?s+"("+p+")?":"(?:"+s+"("+p+"))?":s+"("+p+")",i+=p}}var h=c(n.delimiter||"/"),d=i.slice(-h.length)===h;return r||(i=(d?i.slice(0,-h.length):i)+"(?:"+h+"(?=$))?"),i+=o?"$":r&&d?"":"(?="+h+"|$)",f(new RegExp("^"+i,l(n)),e)}function v(t,e,n){return m(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?p(t,e):m(t)?h(t,e,n):d(t,e,n)}var m=n(17);t.exports=v,t.exports.parse=r,t.exports.compile=o,t.exports.tokensToFunction=a,t.exports.tokensToRegExp=y;var b=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g")},function(t,e){"use strict";var n=function(t){return"/"===t.charAt(0)},r=function(t,e){for(var n=e,r=n+1,o=t.length;r<o;n+=1,r+=1)t[n]=t[r];t.pop()},o=function(t){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1],o=t&&t.split("/")||[],i=e&&e.split("/")||[],u=t&&n(t),a=e&&n(e),c=u||a;if(t&&n(t)?i=o:o.length&&(i.pop(),i=i.concat(o)),!i.length)return"/";var s=void 0;if(i.length){var f=i[i.length-1];s="."===f||".."===f||""===f}else s=!1;for(var l=0,p=i.length;p>=0;p--){var h=i[p];"."===h?r(i,p):".."===h?(r(i,p),l++):l&&(r(i,p),l--)}if(!c)for(;l--;l)i.unshift("..");!c||""===i[0]||i[0]&&n(i[0])||i.unshift("");var d=i.join("/");return s&&"/"!==d.substr(-1)&&(d+="/"),d};t.exports=o},function(t,e){"use strict";e.__esModule=!0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function t(e,r){if(e===r)return!0;if(null==e||null==r)return!1;if(Array.isArray(e))return!(!Array.isArray(r)||e.length!==r.length)&&e.every(function(e,n){return t(e,r[n])});var o="undefined"==typeof e?"undefined":n(e),i="undefined"==typeof r?"undefined":n(r);if(o!==i)return!1;if("object"===o){var u=e.valueOf(),a=r.valueOf();if(u!==e||a!==r)return t(u,a);var c=Object.keys(e),s=Object.keys(r);return c.length===s.length&&c.every(function(n){return t(e[n],r[n])})}return!1};e.default=r}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ReactRouter=e(require("react")):t.ReactRouter=e(t.React)}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.withRouter=e.matchPath=e.Switch=e.StaticRouter=e.Router=e.Route=e.Redirect=e.Prompt=e.MemoryRouter=void 0;var o=n(8),i=r(o),a=n(9),u=r(a),c=n(10),s=r(c),f=n(6),l=r(f),p=n(3),h=r(p),d=n(11),y=r(d),m=n(12),v=r(m),b=n(4),g=r(b),x=n(13),w=r(x);e.MemoryRouter=i.default,e.Prompt=u.default,e.Redirect=s.default,e.Route=l.default,e.Router=h.default,e.StaticRouter=y.default,e.Switch=v.default,e.matchPath=g.default,e.withRouter=w.default},function(e,n){e.exports=t},function(t,e,n){"use strict";var r=function(){};t.exports=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var u=n(2),c=(r(u),n(7)),s=r(c),f=n(1),l=r(f),p=function(t){function e(){var n,r,a;o(this,e);for(var u=arguments.length,c=Array(u),s=0;s<u;s++)c[s]=arguments[s];return n=r=i(this,t.call.apply(t,[this].concat(c))),r.state={match:r.computeMatch(r.props.history.location.pathname)},a=n,i(r,a)}return a(e,t),e.prototype.getChildContext=function(){return{history:this.props.history,route:{location:this.props.history.location,match:this.state.match}}},e.prototype.computeMatch=function(t){return{path:"/",url:"/",params:{},isExact:"/"===t}},e.prototype.componentWillMount=function(){var t=this,e=this.props,n=e.children,r=e.history;null!=n&&1!==l.default.Children.count(n)?(0,s.default)(!1):void 0,this.unlisten=r.listen(function(){t.setState({match:t.computeMatch(r.location.pathname)})})},e.prototype.componentWillReceiveProps=function(t){},e.prototype.componentWillUnmount=function(){this.unlisten()},e.prototype.render=function(){var t=this.props.children;return t?l.default.Children.only(t):null},e}(l.default.Component);p.childContextTypes={history:f.PropTypes.object.isRequired,route:f.PropTypes.object.isRequired},e.default=p},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(18),i=r(o),a={},u=1e4,c=0,s=function(t,e){var n=""+e.end+e.strict,r=a[n]||(a[n]={});if(r[t])return r[t];var o=[],s=(0,i.default)(t,o,e),f={re:s,keys:o};return c<u&&(r[t]=f,c++),f},f=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"==typeof e&&(e={path:e});var n=e,r=n.exact,o=void 0!==r&&r,i=n.strict,a=void 0!==i&&i,u=e.path||e.from;if(!u)return{url:t,isExact:!0,params:{}};var c=s(u,{end:o,strict:a}),f=c.re,l=c.keys,p=f.exec(t);if(!p)return null;var h=p[0],d=p.slice(1),y=t===h;return o&&!y?null:{path:u,url:"/"===u&&""===h?"/":h,isExact:y,params:l.reduce(function(t,e,n){return t[e.name]=d[n],t},{})}};e.default=f},function(t,e){"use strict";e.__esModule=!0;e.addLeadingSlash=function(t){return"/"===t.charAt(0)?t:"/"+t},e.stripLeadingSlash=function(t){return"/"===t.charAt(0)?t.substr(1):t},e.stripPrefix=function(t,e){return 0===t.indexOf(e)?t.substr(e.length):t},e.parsePath=function(t){var e=t||"/",n="",r="",o=e.indexOf("#");o!==-1&&(r=e.substr(o),e=e.substr(0,o));var i=e.indexOf("?");return i!==-1&&(n=e.substr(i),e=e.substr(0,i)),{pathname:e,search:"?"===n?"":n,hash:"#"===r?"":r}},e.createPath=function(t){var e=t.pathname,n=t.search,r=t.hash,o=e||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var u=n(2),c=(r(u),n(1)),s=r(c),f=n(4),l=r(f),p=function(t){function e(){var n,r,a;o(this,e);for(var u=arguments.length,c=Array(u),s=0;s<u;s++)c[s]=arguments[s];return n=r=i(this,t.call.apply(t,[this].concat(c))),r.state={match:r.computeMatch(r.props,r.context)},a=n,i(r,a)}return a(e,t),e.prototype.getChildContext=function(){return{route:{location:this.props.location||this.context.route.location,match:this.state.match}}},e.prototype.computeMatch=function(t,e){var n=t.computedMatch,r=t.location,o=t.path,i=t.strict,a=t.exact,u=e.route;if(n)return n;var c=(r||u.location).pathname;return(0,l.default)(c,{path:o,strict:i,exact:a})},e.prototype.componentWillReceiveProps=function(t,e){this.setState({match:this.computeMatch(t,e)})},e.prototype.render=function t(){var e=this.state.match,n=this.props,r=n.children,o=n.component,t=n.render,i=this.context,a=i.history,u=i.route,c=this.props.location||u.location,f={match:e,location:c,history:a};return o?e?s.default.createElement(o,f):null:t?e?t(f):null:r?"function"==typeof r?r(f):!Array.isArray(r)||r.length?s.default.Children.only(r):null:null},e}(s.default.Component);p.contextTypes={history:c.PropTypes.object.isRequired,route:c.PropTypes.object.isRequired},p.childContextTypes={route:c.PropTypes.object.isRequired},e.default=p},function(t,e,n){"use strict";var r=function(t,e,n,r,o,i,a,u){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,r,o,i,a,u],f=0;c=new Error(e.replace(/%s/g,function(){return s[f++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}};t.exports=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var u=n(1),c=r(u),s=n(15),f=r(s),l=n(3),p=r(l),h=function(t){function e(){var n,r,a;o(this,e);for(var u=arguments.length,c=Array(u),s=0;s<u;s++)c[s]=arguments[s];return n=r=i(this,t.call.apply(t,[this].concat(c))),r.history=(0,f.default)(r.props),a=n,i(r,a)}return a(e,t),e.prototype.render=function(){return c.default.createElement(p.default,{history:this.history,children:this.props.children})},e}(c.default.Component);e.default=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var u=n(1),c=r(u),s=function(t){function e(){return o(this,e),i(this,t.apply(this,arguments))}return a(e,t),e.prototype.enable=function(t){this.unblock&&this.unblock(),this.unblock=this.context.history.block(t)},e.prototype.disable=function(){this.unblock&&(this.unblock(),this.unblock=null)},e.prototype.componentWillMount=function(){this.props.when&&this.enable(this.props.message)},e.prototype.componentWillReceiveProps=function(t){t.when?this.props.when&&this.props.message===t.message||this.enable(t.message):this.disable()},e.prototype.componentWillUnmount=function(){this.disable()},e.prototype.render=function(){return null},e}(c.default.Component);s.contextTypes={history:u.PropTypes.shape({block:u.PropTypes.func.isRequired}).isRequired},s.defaultProps={when:!0},e.default=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var u=n(1),c=r(u),s=function(t){function e(){return o(this,e),i(this,t.apply(this,arguments))}return a(e,t),e.prototype.componentWillMount=function(){this.context.history.staticContext&&this.perform()},e.prototype.componentDidMount=function(){this.context.history.staticContext||this.perform()},e.prototype.perform=function(){var t=this.context.history,e=this.props,n=e.push,r=e.to;n?t.push(r):t.replace(r)},e.prototype.render=function(){return null},e}(c.default.Component);s.contextTypes={history:u.PropTypes.shape({push:u.PropTypes.func.isRequired,replace:u.PropTypes.func.isRequired,staticContext:u.PropTypes.object}).isRequired},s.defaultProps={push:!1},e.default=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},s=n(7),f=r(s),l=n(1),p=r(l),h=n(5),d=n(3),y=r(d),m=function(t){var e=t.pathname,n=void 0===e?"/":e,r=t.search,o=void 0===r?"":r,i=t.hash,a=void 0===i?"":i;return{pathname:n,search:"?"===o?"":o,hash:"#"===a?"":a}},v=function(t,e){return t?c({},e,{pathname:(0,h.addLeadingSlash)(t)+e.pathname}):e},b=function(t,e){if(!t)return e;var n=(0,h.addLeadingSlash)(t);return 0!==e.pathname.indexOf(n)?e:c({},e,{pathname:e.pathname.substr(n.length)})},g=function(t){return"string"==typeof t?(0,h.parsePath)(t):m(t)},x=function(t){return"string"==typeof t?t:(0,h.createPath)(t)},w=function(t){return function(){(0,f.default)(!1)}},_=function(){},O=function(t){function e(){var n,r,o;i(this,e);for(var u=arguments.length,c=Array(u),s=0;s<u;s++)c[s]=arguments[s];return n=r=a(this,t.call.apply(t,[this].concat(c))),r.createHref=function(t){return(0,h.addLeadingSlash)(r.props.basename+x(t))},r.handlePush=function(t){var e=r.props,n=e.basename,o=e.context;o.action="PUSH",o.location=v(n,g(t)),o.url=x(o.location)},r.handleReplace=function(t){var e=r.props,n=e.basename,o=e.context;o.action="REPLACE",o.location=v(n,g(t)),o.url=x(o.location)},r.handleListen=function(){return _},r.handleBlock=function(){return _},o=n,a(r,o)}return u(e,t),e.prototype.render=function(){var t=this.props,e=t.basename,n=t.context,r=t.location,i=o(t,["basename","context","location"]),a={staticContext:n,createHref:this.createHref,action:"POP",location:b(e,g(r)),push:this.handlePush,replace:this.handleReplace,go:w("go"),goBack:w("goBack"),goForward:w("goForward"),listen:this.handleListen,block:this.handleBlock};return p.default.createElement(y.default,c({},i,{history:a}))},e}(p.default.Component);O.defaultProps={basename:"",location:"/"},e.default=O},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}e.__esModule=!0;var u=n(1),c=r(u),s=n(2),f=(r(s),n(4)),l=r(f),p=function(t){function e(){return o(this,e),i(this,t.apply(this,arguments))}return a(e,t),e.prototype.componentWillReceiveProps=function(t){},e.prototype.render=function(){var t=this.props.children,e=this.props.location||this.context.route.location,n=void 0,r=void 0;return c.default.Children.forEach(t,function(t){null==n&&(r=t,n=(0,l.default)(e.pathname,t.props))}),n?c.default.cloneElement(r,{location:e,computedMatch:n}):null},e}(c.default.Component);p.contextTypes={route:u.PropTypes.object.isRequired},e.default=p},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(1),a=r(i),u=n(6),c=r(u),s=function(t){var e=function(e){return a.default.createElement(c.default,{render:function(n){return a.default.createElement(t,o({},e,n))}})};return e.displayName="withRouter("+(t.displayName||t.name)+")",e};e.default=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.locationsAreEqual=e.createLocation=void 0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(19),a=r(i),u=n(20),c=r(u),s=n(5);e.createLocation=function(t,e,n,r){var i=void 0;return"string"==typeof t?(i=(0,s.parsePath)(t),i.state=e):(i=o({},t),void 0===i.pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==e&&void 0===i.state&&(i.state=e)),i.key=n,r&&(i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=(0,a.default)(i.pathname,r.pathname)):i.pathname=r.pathname),i},e.locationsAreEqual=function(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&(0,c.default)(t.state,e.state)}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}),i=n(2),a=(r(i),n(5)),u=n(14),c=n(16),s=r(c),f=function(t,e,n){return Math.min(Math.max(t,e),n)},l=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.getUserConfirmation,n=t.initialEntries,r=void 0===n?["/"]:n,i=t.initialIndex,c=void 0===i?0:i,l=t.keyLength,p=void 0===l?6:l,h=(0,s.default)(),d=function(t){o(R,t),R.length=R.entries.length,h.notifyListeners(R.location,R.action)},y=function(){return Math.random().toString(36).substr(2,p)},m=f(c,0,r.length-1),v=r.map(function(t,e){return"string"==typeof t?(0,u.createLocation)(t,void 0,e?y():void 0):(0,u.createLocation)(t,void 0,e?t.key||y():void 0)}),b=a.createPath,g=function(t,n){var r="PUSH",o=(0,u.createLocation)(t,n,y(),R.location);h.confirmTransitionTo(o,r,e,function(t){if(t){var e=R.index,n=e+1,i=R.entries.slice(0);i.length>n?i.splice(n,i.length-n,o):i.push(o),d({action:r,location:o,index:n,entries:i})}})},x=function(t,n){var r="REPLACE",o=(0,u.createLocation)(t,n,y(),R.location);h.confirmTransitionTo(o,r,e,function(t){t&&(R.entries[R.index]=o,d({action:r,location:o}))})},w=function(t){var n=f(R.index+t,0,R.entries.length-1),r="POP",o=R.entries[n];h.confirmTransitionTo(o,r,e,function(t){t?d({action:r,location:o,index:n}):d()})},_=function(){return w(-1)},O=function(){return w(1)},P=function(t){var e=R.index+t;return e>=0&&e<R.entries.length},E=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return h.setPrompt(t)},j=function(t){return h.appendListener(t)},R={length:v.length,action:"POP",location:v[m],index:m,entries:v,createHref:b,push:g,replace:x,go:w,goBack:_,goForward:O,canGo:P,block:E,listen:j};return R};e.default=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(2),i=(r(o),function(){var t=null,e=function(e){return t=e,function(){t===e&&(t=null)}},n=function(e,n,r,o){if(null!=t){var i="function"==typeof t?t(e,n):t;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(i!==!1)}else o(!0)},r=[],o=function(t){var e=!0,n=function(){e&&t.apply(void 0,arguments)};return r.push(n),function(){e=!1,r=r.filter(function(t){return t!==n})}},i=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];r.forEach(function(t){return t.apply(void 0,e)})};return{setPrompt:e,confirmTransitionTo:n,appendListener:o,notifyListeners:i}});e.default=i},function(t,e){t.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}},function(t,e,n){function r(t,e){for(var n,r=[],o=0,i=0,a="",u=e&&e.delimiter||"/";null!=(n=b.exec(t));){var f=n[0],l=n[1],p=n.index;if(a+=t.slice(i,p),i=p+f.length,l)a+=l[1];else{var h=t[i],d=n[2],y=n[3],m=n[4],v=n[5],g=n[6],x=n[7];a&&(r.push(a),a="");var w=null!=d&&null!=h&&h!==d,_="+"===g||"*"===g,O="?"===g||"*"===g,P=n[2]||u,E=m||v;r.push({name:y||o++,prefix:d||"",delimiter:P,optional:O,repeat:_,partial:w,asterisk:!!x,pattern:E?s(E):x?".*":"[^"+c(P)+"]+?"})}}return i<t.length&&(a+=t.substr(i)),a&&r.push(a),r}function o(t,e){return u(r(t,e))}function i(t){return encodeURI(t).replace(/[\/?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function a(t){return encodeURI(t).replace(/[?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function u(t){for(var e=new Array(t.length),n=0;n<t.length;n++)"object"==typeof t[n]&&(e[n]=new RegExp("^(?:"+t[n].pattern+")$"));return function(n,r){for(var o="",u=n||{},c=r||{},s=c.pretty?i:encodeURIComponent,f=0;f<t.length;f++){var l=t[f];if("string"!=typeof l){var p,h=u[l.name];if(null==h){if(l.optional){l.partial&&(o+=l.prefix);continue}throw new TypeError('Expected "'+l.name+'" to be defined')}if(v(h)){if(!l.repeat)throw new TypeError('Expected "'+l.name+'" to not repeat, but received `'+JSON.stringify(h)+"`");if(0===h.length){if(l.optional)continue;throw new TypeError('Expected "'+l.name+'" to not be empty')}for(var d=0;d<h.length;d++){if(p=s(h[d]),!e[f].test(p))throw new TypeError('Expected all "'+l.name+'" to match "'+l.pattern+'", but received `'+JSON.stringify(p)+"`");o+=(0===d?l.prefix:l.delimiter)+p}}else{if(p=l.asterisk?a(h):s(h),!e[f].test(p))throw new TypeError('Expected "'+l.name+'" to match "'+l.pattern+'", but received "'+p+'"');o+=l.prefix+p}}else o+=l}return o}}function c(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function s(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function f(t,e){return t.keys=e,t}function l(t){return t.sensitive?"":"i"}function p(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return f(t,e)}function h(t,e,n){for(var r=[],o=0;o<t.length;o++)r.push(m(t[o],e,n).source);var i=new RegExp("(?:"+r.join("|")+")",l(n));return f(i,e)}function d(t,e,n){return y(r(t,n),e,n)}function y(t,e,n){v(e)||(n=e||n,e=[]),n=n||{};for(var r=n.strict,o=n.end!==!1,i="",a=0;a<t.length;a++){var u=t[a];if("string"==typeof u)i+=c(u);else{var s=c(u.prefix),p="(?:"+u.pattern+")";e.push(u),u.repeat&&(p+="(?:"+s+p+")*"),p=u.optional?u.partial?s+"("+p+")?":"(?:"+s+"("+p+"))?":s+"("+p+")",i+=p}}var h=c(n.delimiter||"/"),d=i.slice(-h.length)===h;return r||(i=(d?i.slice(0,-h.length):i)+"(?:"+h+"(?=$))?"),i+=o?"$":r&&d?"":"(?="+h+"|$)",f(new RegExp("^"+i,l(n)),e)}function m(t,e,n){return v(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?p(t,e):v(t)?h(t,e,n):d(t,e,n)}var v=n(17);t.exports=m,t.exports.parse=r,t.exports.compile=o,t.exports.tokensToFunction=u,t.exports.tokensToRegExp=y;var b=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g")},function(t,e){"use strict";var n=function(t){return"/"===t.charAt(0)},r=function(t,e){for(var n=e,r=n+1,o=t.length;r<o;n+=1,r+=1)t[n]=t[r];t.pop()},o=function(t){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1],o=t&&t.split("/")||[],i=e&&e.split("/")||[],a=t&&n(t),u=e&&n(e),c=a||u;if(t&&n(t)?i=o:o.length&&(i.pop(),i=i.concat(o)),!i.length)return"/";var s=void 0;if(i.length){var f=i[i.length-1];s="."===f||".."===f||""===f}else s=!1;for(var l=0,p=i.length;p>=0;p--){var h=i[p];"."===h?r(i,p):".."===h?(r(i,p),l++):l&&(r(i,p),l--)}if(!c)for(;l--;l)i.unshift("..");!c||""===i[0]||i[0]&&n(i[0])||i.unshift("");var d=i.join("/");return s&&"/"!==d.substr(-1)&&(d+="/"),d};t.exports=o},function(t,e){"use strict";e.__esModule=!0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function t(e,r){if(e===r)return!0;if(null==e||null==r)return!1;if(Array.isArray(e))return!(!Array.isArray(r)||e.length!==r.length)&&e.every(function(e,n){return t(e,r[n])});var o="undefined"==typeof e?"undefined":n(e),i="undefined"==typeof r?"undefined":n(r);if(o!==i)return!1;if("object"===o){var a=e.valueOf(),u=r.valueOf();if(a!==e||u!==r)return t(a,u);var c=Object.keys(e),s=Object.keys(r);return c.length===s.length&&c.every(function(n){return t(e[n],r[n])})}return!1};e.default=r}])});

@@ -11,51 +11,23 @@ 'use strict';

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _Route = require('./Route');
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var _Route2 = _interopRequireDefault(_Route);
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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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; }
/**
* A public higher-order component for re-rendering as the
* location changes. Also, passes ...context.router as props.
* A public higher-order component to access the imperative API
*/
var withRouter = function withRouter(component) {
var _class, _temp;
var withRouter = function withRouter(Component) {
var C = function C(props) {
return _react2.default.createElement(_Route2.default, { render: function render(routeComponentProps) {
return _react2.default.createElement(Component, _extends({}, props, routeComponentProps));
} });
};
return _temp = _class = function (_React$Component) {
_inherits(_class, _React$Component);
C.displayName = 'withRouter(' + (Component.displayName || Component.name) + ')';
function _class() {
_classCallCheck(this, _class);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
_class.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
// Start listening here so we can <Redirect> on the initial render.
this.unlisten = this.context.router.listen(function () {
return _this2.forceUpdate();
});
};
_class.prototype.componentWillUnmount = function componentWillUnmount() {
this.unlisten();
};
_class.prototype.render = function render() {
return _react2.default.createElement(component, _extends({}, this.props, this.context.router));
};
return _class;
}(_react2.default.Component), _class.displayName = 'withRouter(' + (component.displayName || component.name) + ')', _class.contextTypes = {
router: _react.PropTypes.shape({
listen: _react.PropTypes.func.isRequired
}).isRequired
}, _temp;
return C;
};
exports.default = withRouter;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc