Socket
Socket
Sign inDemoInstall

react-router

Package Overview
Dependencies
Maintainers
2
Versions
501
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.2.0 to 4.3.0-rc.1

es/generatePath.js

20

es/index.js

@@ -1,18 +0,20 @@

import _MemoryRouter from './MemoryRouter';
import _MemoryRouter from "./MemoryRouter";
export { _MemoryRouter as MemoryRouter };
import _Prompt from './Prompt';
import _Prompt from "./Prompt";
export { _Prompt as Prompt };
import _Redirect from './Redirect';
import _Redirect from "./Redirect";
export { _Redirect as Redirect };
import _Route from './Route';
import _Route from "./Route";
export { _Route as Route };
import _Router from './Router';
import _Router from "./Router";
export { _Router as Router };
import _StaticRouter from './StaticRouter';
import _StaticRouter from "./StaticRouter";
export { _StaticRouter as StaticRouter };
import _Switch from './Switch';
import _Switch from "./Switch";
export { _Switch as Switch };
import _matchPath from './matchPath';
import _generatePath from "./generatePath";
export { _generatePath as generatePath };
import _matchPath from "./matchPath";
export { _matchPath as matchPath };
import _withRouter from './withRouter';
import _withRouter from "./withRouter";
export { _withRouter as withRouter };

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

import pathToRegexp from 'path-to-regexp';
import pathToRegexp from "path-to-regexp";

@@ -8,3 +8,3 @@ var patternCache = {};

var compilePath = function compilePath(pattern, options) {
var cacheKey = '' + options.end + options.strict + options.sensitive;
var cacheKey = "" + options.end + options.strict + options.sensitive;
var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});

@@ -31,8 +31,8 @@

var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var parent = arguments[2];
if (typeof options === 'string') options = { path: options };
if (typeof options === "string") options = { path: options };
var _options = options,
_options$path = _options.path,
path = _options$path === undefined ? '/' : _options$path,
path = _options.path,
_options$exact = _options.exact,

@@ -45,2 +45,5 @@ exact = _options$exact === undefined ? false : _options$exact,

if (path == null) return parent;
var _compilePath = compilePath(path, { end: exact, strict: strict, sensitive: sensitive }),

@@ -63,3 +66,3 @@ re = _compilePath.re,

path: path, // the path pattern used to match
url: path === '/' && url === '' ? '/' : url, // the matched portion of the URL
url: path === "/" && url === "" ? "/" : url, // the matched portion of the URL
isExact: isExact, // whether or not we matched exactly

@@ -66,0 +69,0 @@ params: keys.reduce(function (memo, key, index) {

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

import warning from 'warning';
import React from 'react';
import PropTypes from 'prop-types';
import createHistory from 'history/createMemoryHistory';
import Router from './Router';
import warning from "warning";
import React from "react";
import PropTypes from "prop-types";
import { createMemoryHistory as createHistory } from "history";
import Router from "./Router";

@@ -34,3 +34,3 @@ /**

MemoryRouter.prototype.componentWillMount = function componentWillMount() {
warning(!this.props.history, '<MemoryRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { MemoryRouter as Router }`.');
warning(!this.props.history, "<MemoryRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { MemoryRouter as Router }`.");
};

@@ -37,0 +37,0 @@

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

import React from 'react';
import PropTypes from 'prop-types';
import invariant from 'invariant';
import React from "react";
import PropTypes from "prop-types";
import invariant from "invariant";

@@ -40,3 +40,3 @@ /**

Prompt.prototype.componentWillMount = function componentWillMount() {
invariant(this.context.router, 'You should not use <Prompt> outside a <Router>');
invariant(this.context.router, "You should not use <Prompt> outside a <Router>");

@@ -43,0 +43,0 @@ if (this.props.when) this.enable(this.props.message);

@@ -0,1 +1,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; };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -7,7 +9,8 @@

import React from 'react';
import PropTypes from 'prop-types';
import warning from 'warning';
import invariant from 'invariant';
import { createLocation, locationsAreEqual } from 'history';
import React from "react";
import PropTypes from "prop-types";
import warning from "warning";
import invariant from "invariant";
import { createLocation, locationsAreEqual } from "history";
import generatePath from "./generatePath";

@@ -33,3 +36,3 @@ /**

Redirect.prototype.componentWillMount = function componentWillMount() {
invariant(this.context.router, 'You should not use <Redirect> outside a <Router>');
invariant(this.context.router, "You should not use <Redirect> outside a <Router>");

@@ -48,3 +51,3 @@ if (this.isStatic()) this.perform();

if (locationsAreEqual(prevTo, nextTo)) {
warning(false, 'You tried to redirect to the same route you\'re currently on: ' + ('"' + nextTo.pathname + nextTo.search + '"'));
warning(false, "You tried to redirect to the same route you're currently on: " + ("\"" + nextTo.pathname + nextTo.search + "\""));
return;

@@ -56,8 +59,24 @@ }

Redirect.prototype.computeTo = function computeTo(_ref) {
var computedMatch = _ref.computedMatch,
to = _ref.to;
if (computedMatch) {
if (typeof to === "string") {
return generatePath(to, computedMatch.params);
} else {
return _extends({}, to, {
pathname: generatePath(to.pathname, computedMatch.params)
});
}
}
return to;
};
Redirect.prototype.perform = function perform() {
var history = this.context.router.history;
var _props = this.props,
push = _props.push,
to = _props.to;
var push = this.props.push;
var to = this.computeTo(this.props);

@@ -79,2 +98,3 @@ if (push) {

Redirect.propTypes = {
computedMatch: PropTypes.object, // private, from <Switch>
push: PropTypes.bool,

@@ -81,0 +101,0 @@ from: PropTypes.string,

@@ -9,7 +9,7 @@ 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; };

import warning from 'warning';
import invariant from 'invariant';
import React from 'react';
import PropTypes from 'prop-types';
import matchPath from './matchPath';
import warning from "warning";
import invariant from "invariant";
import React from "react";
import PropTypes from "prop-types";
import matchPath from "./matchPath";

@@ -62,3 +62,3 @@ var isEmptyChildren = function isEmptyChildren(children) {

invariant(router, 'You should not use <Route> or withRouter() outside a <Router>');
invariant(router, "You should not use <Route> or withRouter() outside a <Router>");

@@ -69,11 +69,11 @@ var route = router.route;

return path ? matchPath(pathname, { path: path, strict: strict, exact: exact, sensitive: sensitive }) : route.match;
return matchPath(pathname, { path: path, strict: strict, exact: exact, sensitive: sensitive }, route.match);
};
Route.prototype.componentWillMount = function componentWillMount() {
warning(!(this.props.component && this.props.render), 'You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored');
warning(!(this.props.component && this.props.render), "You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored");
warning(!(this.props.component && this.props.children && !isEmptyChildren(this.props.children)), 'You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored');
warning(!(this.props.component && this.props.children && !isEmptyChildren(this.props.children)), "You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored");
warning(!(this.props.render && this.props.children && !isEmptyChildren(this.props.children)), 'You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored');
warning(!(this.props.render && this.props.children && !isEmptyChildren(this.props.children)), "You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored");
};

@@ -105,6 +105,11 @@

return component ? // component prop gets first priority, only called if there's a match
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) : !isEmptyChildren(children) ? React.Children.only(children) : null : null;
if (component) return match ? React.createElement(component, props) : null;
if (render) return match ? render(props) : null;
if (typeof children === "function") return children(props);
if (children && !isEmptyChildren(children)) return React.Children.only(children);
return null;
};

@@ -111,0 +116,0 @@

@@ -9,6 +9,6 @@ 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; };

import warning from 'warning';
import invariant from 'invariant';
import React from 'react';
import PropTypes from 'prop-types';
import warning from "warning";
import invariant from "invariant";
import React from "react";
import PropTypes from "prop-types";

@@ -50,6 +50,6 @@ /**

return {
path: '/',
url: '/',
path: "/",
url: "/",
params: {},
isExact: pathname === '/'
isExact: pathname === "/"
};

@@ -66,3 +66,3 @@ };

invariant(children == null || React.Children.count(children) === 1, 'A <Router> may have only one child element');
invariant(children == null || React.Children.count(children) === 1, "A <Router> may have only one child element");

@@ -80,3 +80,3 @@ // Do this here so we can setState when a <Redirect> changes the

Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
warning(this.props.history === nextProps.history, 'You cannot change <Router history>');
warning(this.props.history === nextProps.history, "You cannot change <Router history>");
};

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

@@ -11,23 +11,11 @@ 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; };

import warning from 'warning';
import invariant from 'invariant';
import React from 'react';
import PropTypes from 'prop-types';
import { addLeadingSlash, createPath, parsePath } from 'history/PathUtils';
import Router from './Router';
import warning from "warning";
import invariant from "invariant";
import React from "react";
import PropTypes from "prop-types";
import { createLocation, createPath } from "history";
import Router from "./Router";
var normalizeLocation = function normalizeLocation(object) {
var _object$pathname = object.pathname,
pathname = _object$pathname === undefined ? '/' : _object$pathname,
_object$search = object.search,
search = _object$search === undefined ? '' : _object$search,
_object$hash = object.hash,
hash = _object$hash === undefined ? '' : _object$hash;
return {
pathname: pathname,
search: search === '?' ? '' : search,
hash: hash === '#' ? '' : hash
};
var addLeadingSlash = function addLeadingSlash(path) {
return path.charAt(0) === "/" ? path : "/" + path;
};

@@ -55,8 +43,4 @@

var createLocation = function createLocation(location) {
return typeof location === 'string' ? parsePath(location) : normalizeLocation(location);
};
var createURL = function createURL(location) {
return typeof location === 'string' ? location : createPath(location);
return typeof location === "string" ? location : createPath(location);
};

@@ -66,3 +50,3 @@

return function () {
invariant(false, 'You cannot %s with <StaticRouter>', methodName);
invariant(false, "You cannot %s with <StaticRouter>", methodName);
};

@@ -99,3 +83,3 @@ };

context.action = 'PUSH';
context.action = "PUSH";
context.location = addBasename(basename, createLocation(location));

@@ -108,3 +92,3 @@ context.url = createURL(context.location);

context.action = 'REPLACE';
context.action = "REPLACE";
context.location = addBasename(basename, createLocation(location));

@@ -128,3 +112,3 @@ context.url = createURL(context.location);

StaticRouter.prototype.componentWillMount = function componentWillMount() {
warning(!this.props.history, '<StaticRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { StaticRouter as Router }`.');
warning(!this.props.history, "<StaticRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { StaticRouter as Router }`.");
};

@@ -137,13 +121,13 @@

location = _props.location,
props = _objectWithoutProperties(_props, ['basename', 'context', 'location']);
props = _objectWithoutProperties(_props, ["basename", "context", "location"]);
var history = {
createHref: this.createHref,
action: 'POP',
action: "POP",
location: stripBasename(basename, createLocation(location)),
push: this.handlePush,
replace: this.handleReplace,
go: staticHandler('go'),
goBack: staticHandler('goBack'),
goForward: staticHandler('goForward'),
go: staticHandler("go"),
goBack: staticHandler("goBack"),
goForward: staticHandler("goForward"),
listen: this.handleListen,

@@ -165,4 +149,4 @@ block: this.handleBlock

StaticRouter.defaultProps = {
basename: '',
location: '/'
basename: "",
location: "/"
};

@@ -169,0 +153,0 @@ StaticRouter.childContextTypes = {

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

import React from 'react';
import PropTypes from 'prop-types';
import warning from 'warning';
import invariant from 'invariant';
import matchPath from './matchPath';
import React from "react";
import PropTypes from "prop-types";
import warning from "warning";
import invariant from "invariant";
import matchPath from "./matchPath";

@@ -28,3 +28,3 @@ /**

Switch.prototype.componentWillMount = function componentWillMount() {
invariant(this.context.router, 'You should not use <Switch> outside a <Router>');
invariant(this.context.router, "You should not use <Switch> outside a <Router>");
};

@@ -47,16 +47,14 @@

React.Children.forEach(children, function (element) {
if (!React.isValidElement(element)) return;
if (match == null && React.isValidElement(element)) {
var _element$props = element.props,
pathProp = _element$props.path,
exact = _element$props.exact,
strict = _element$props.strict,
sensitive = _element$props.sensitive,
from = _element$props.from;
var _element$props = element.props,
pathProp = _element$props.path,
exact = _element$props.exact,
strict = _element$props.strict,
sensitive = _element$props.sensitive,
from = _element$props.from;
var path = pathProp || from;
var path = pathProp || from;
if (match == null) {
child = element;
match = path ? matchPath(location.pathname, { path: path, exact: exact, strict: strict, sensitive: sensitive }) : route.match;
match = matchPath(location.pathname, { path: path, exact: exact, strict: strict, sensitive: sensitive }, route.match);
}

@@ -63,0 +61,0 @@ });

@@ -5,6 +5,6 @@ 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; };

import React from 'react';
import PropTypes from 'prop-types';
import hoistStatics from 'hoist-non-react-statics';
import Route from './Route';
import React from "react";
import PropTypes from "prop-types";
import hoistStatics from "hoist-non-react-statics";
import Route from "./Route";

@@ -17,10 +17,14 @@ /**

var wrappedComponentRef = props.wrappedComponentRef,
remainingProps = _objectWithoutProperties(props, ['wrappedComponentRef']);
remainingProps = _objectWithoutProperties(props, ["wrappedComponentRef"]);
return React.createElement(Route, { render: function render(routeComponentProps) {
return React.createElement(Component, _extends({}, remainingProps, routeComponentProps, { ref: wrappedComponentRef }));
} });
return React.createElement(Route, {
children: function children(routeComponentProps) {
return React.createElement(Component, _extends({}, remainingProps, routeComponentProps, {
ref: wrappedComponentRef
}));
}
});
};
C.displayName = 'withRouter(' + (Component.displayName || Component.name) + ')';
C.displayName = "withRouter(" + (Component.displayName || Component.name) + ")";
C.WrappedComponent = Component;

@@ -27,0 +31,0 @@ C.propTypes = {

@@ -1,39 +0,43 @@

'use strict';
"use strict";
exports.__esModule = true;
exports.withRouter = exports.matchPath = exports.Switch = exports.StaticRouter = exports.Router = exports.Route = exports.Redirect = exports.Prompt = exports.MemoryRouter = undefined;
exports.withRouter = exports.matchPath = exports.generatePath = exports.Switch = exports.StaticRouter = exports.Router = exports.Route = exports.Redirect = exports.Prompt = exports.MemoryRouter = undefined;
var _MemoryRouter2 = require('./MemoryRouter');
var _MemoryRouter2 = require("./MemoryRouter");
var _MemoryRouter3 = _interopRequireDefault(_MemoryRouter2);
var _Prompt2 = require('./Prompt');
var _Prompt2 = require("./Prompt");
var _Prompt3 = _interopRequireDefault(_Prompt2);
var _Redirect2 = require('./Redirect');
var _Redirect2 = require("./Redirect");
var _Redirect3 = _interopRequireDefault(_Redirect2);
var _Route2 = require('./Route');
var _Route2 = require("./Route");
var _Route3 = _interopRequireDefault(_Route2);
var _Router2 = require('./Router');
var _Router2 = require("./Router");
var _Router3 = _interopRequireDefault(_Router2);
var _StaticRouter2 = require('./StaticRouter');
var _StaticRouter2 = require("./StaticRouter");
var _StaticRouter3 = _interopRequireDefault(_StaticRouter2);
var _Switch2 = require('./Switch');
var _Switch2 = require("./Switch");
var _Switch3 = _interopRequireDefault(_Switch2);
var _matchPath2 = require('./matchPath');
var _generatePath2 = require("./generatePath");
var _generatePath3 = _interopRequireDefault(_generatePath2);
var _matchPath2 = require("./matchPath");
var _matchPath3 = _interopRequireDefault(_matchPath2);
var _withRouter2 = require('./withRouter');
var _withRouter2 = require("./withRouter");

@@ -51,3 +55,4 @@ var _withRouter3 = _interopRequireDefault(_withRouter2);

exports.Switch = _Switch3.default;
exports.generatePath = _generatePath3.default;
exports.matchPath = _matchPath3.default;
exports.withRouter = _withRouter3.default;

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

'use strict';
"use strict";
exports.__esModule = true;
var _pathToRegexp = require('path-to-regexp');
var _pathToRegexp = require("path-to-regexp");

@@ -16,3 +16,3 @@ var _pathToRegexp2 = _interopRequireDefault(_pathToRegexp);

var compilePath = function compilePath(pattern, options) {
var cacheKey = '' + options.end + options.strict + options.sensitive;
var cacheKey = "" + options.end + options.strict + options.sensitive;
var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});

@@ -39,8 +39,8 @@

var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var parent = arguments[2];
if (typeof options === 'string') options = { path: options };
if (typeof options === "string") options = { path: options };
var _options = options,
_options$path = _options.path,
path = _options$path === undefined ? '/' : _options$path,
path = _options.path,
_options$exact = _options.exact,

@@ -53,2 +53,5 @@ exact = _options$exact === undefined ? false : _options$exact,

if (path == null) return parent;
var _compilePath = compilePath(path, { end: exact, strict: strict, sensitive: sensitive }),

@@ -71,3 +74,3 @@ re = _compilePath.re,

path: path, // the path pattern used to match
url: path === '/' && url === '' ? '/' : url, // the matched portion of the URL
url: path === "/" && url === "" ? "/" : url, // the matched portion of the URL
isExact: isExact, // whether or not we matched exactly

@@ -74,0 +77,0 @@ params: keys.reduce(function (memo, key, index) {

@@ -1,23 +0,21 @@

'use strict';
"use strict";
exports.__esModule = true;
var _warning = require('warning');
var _warning = require("warning");
var _warning2 = _interopRequireDefault(_warning);
var _react = require('react');
var _react = require("react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes = require("prop-types");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _createMemoryHistory = require('history/createMemoryHistory');
var _history = require("history");
var _createMemoryHistory2 = _interopRequireDefault(_createMemoryHistory);
var _Router = require("./Router");
var _Router = require('./Router');
var _Router2 = _interopRequireDefault(_Router);

@@ -48,7 +46,7 @@

return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = (0, _createMemoryHistory2.default)(_this.props), _temp), _possibleConstructorReturn(_this, _ret);
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = (0, _history.createMemoryHistory)(_this.props), _temp), _possibleConstructorReturn(_this, _ret);
}
MemoryRouter.prototype.componentWillMount = function componentWillMount() {
(0, _warning2.default)(!this.props.history, '<MemoryRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { MemoryRouter as Router }`.');
(0, _warning2.default)(!this.props.history, "<MemoryRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { MemoryRouter as Router }`.");
};

@@ -55,0 +53,0 @@

{
"name": "react-router",
"version": "4.2.0",
"version": "4.3.0-rc.1",
"description": "Declarative routing for React",

@@ -21,2 +21,3 @@ "repository": "ReactTraining/react-router",

"index.js",
"generatePath.js",
"matchPath.js",

@@ -41,7 +42,7 @@ "withRouter.js",

"history": "^4.7.2",
"hoist-non-react-statics": "^2.3.0",
"hoist-non-react-statics": "^2.3.1",
"invariant": "^2.2.2",
"loose-envify": "^1.3.1",
"path-to-regexp": "^1.7.0",
"prop-types": "^15.5.4",
"prop-types": "^15.6.0",
"warning": "^3.0.0"

@@ -51,24 +52,26 @@ },

"babel-cli": "^6.26.0",
"babel-eslint": "^7.0.4",
"babel-eslint": "^8.2.1",
"babel-jest": "^22.1.0",
"babel-plugin-dev-expression": "^0.2.1",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.8",
"babel-plugin-transform-react-remove-prop-types": "^0.4.12",
"babel-preset-es2015": "^6.14.0",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-1": "^6.5.0",
"eslint": "^4.5.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-react": "^7.3.0",
"gzip-size": "^3.0.0",
"jest": "^20.0.4",
"eslint": "^4.16.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-react": "^7.6.0",
"gzip-size": "^4.1.0",
"jest": "^22.1.4",
"pretty-bytes": "^4.0.2",
"react": "^15.4.2",
"react-addons-test-utils": "^15.4.2",
"react-dom": "^15.3.0",
"rollup": "^0.48.2",
"rollup-plugin-babel": "^3.0.2",
"rollup-plugin-commonjs": "^8.2.0",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-replace": "^1.1.1",
"rollup-plugin-uglify": "^2.0.1"
"raf": "^3.4.0",
"react": "^16.2.0",
"react-addons-test-utils": "^15.6.2",
"react-dom": "^16.2.0",
"rollup": "^0.50.1",
"rollup-plugin-babel": "^3.0.3",
"rollup-plugin-commonjs": "^8.2.6",
"rollup-plugin-node-resolve": "^3.0.2",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-uglify": "^3.0.0"
},

@@ -80,2 +83,7 @@ "browserify": {

},
"jest": {
"setupFiles": [
"raf/polyfill"
]
},
"keywords": [

@@ -82,0 +90,0 @@ "react",

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

'use strict';
"use strict";
exports.__esModule = true;
var _react = require('react');
var _react = require("react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes = require("prop-types");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _invariant = require('invariant');
var _invariant = require("invariant");

@@ -52,3 +52,3 @@ var _invariant2 = _interopRequireDefault(_invariant);

Prompt.prototype.componentWillMount = function componentWillMount() {
(0, _invariant2.default)(this.context.router, 'You should not use <Prompt> outside a <Router>');
(0, _invariant2.default)(this.context.router, "You should not use <Prompt> outside a <Router>");

@@ -55,0 +55,0 @@ if (this.props.when) this.enable(this.props.message);

@@ -1,23 +0,29 @@

'use strict';
"use strict";
exports.__esModule = true;
var _react = require('react');
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 _react = require("react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes = require("prop-types");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _warning = require('warning');
var _warning = require("warning");
var _warning2 = _interopRequireDefault(_warning);
var _invariant = require('invariant');
var _invariant = require("invariant");
var _invariant2 = _interopRequireDefault(_invariant);
var _history = require('history');
var _history = require("history");
var _generatePath = require("./generatePath");
var _generatePath2 = _interopRequireDefault(_generatePath);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -49,3 +55,3 @@

Redirect.prototype.componentWillMount = function componentWillMount() {
(0, _invariant2.default)(this.context.router, 'You should not use <Redirect> outside a <Router>');
(0, _invariant2.default)(this.context.router, "You should not use <Redirect> outside a <Router>");

@@ -64,3 +70,3 @@ if (this.isStatic()) this.perform();

if ((0, _history.locationsAreEqual)(prevTo, nextTo)) {
(0, _warning2.default)(false, 'You tried to redirect to the same route you\'re currently on: ' + ('"' + nextTo.pathname + nextTo.search + '"'));
(0, _warning2.default)(false, "You tried to redirect to the same route you're currently on: " + ("\"" + nextTo.pathname + nextTo.search + "\""));
return;

@@ -72,8 +78,24 @@ }

Redirect.prototype.computeTo = function computeTo(_ref) {
var computedMatch = _ref.computedMatch,
to = _ref.to;
if (computedMatch) {
if (typeof to === "string") {
return (0, _generatePath2.default)(to, computedMatch.params);
} else {
return _extends({}, to, {
pathname: (0, _generatePath2.default)(to.pathname, computedMatch.params)
});
}
}
return to;
};
Redirect.prototype.perform = function perform() {
var history = this.context.router.history;
var _props = this.props,
push = _props.push,
to = _props.to;
var push = this.props.push;
var to = this.computeTo(this.props);

@@ -95,2 +117,3 @@ if (push) {

Redirect.propTypes = {
computedMatch: _propTypes2.default.object, // private, from <Switch>
push: _propTypes2.default.bool,

@@ -97,0 +120,0 @@ from: _propTypes2.default.string,

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

'use strict';
"use strict";

@@ -7,19 +7,19 @@ exports.__esModule = true;

var _warning = require('warning');
var _warning = require("warning");
var _warning2 = _interopRequireDefault(_warning);
var _invariant = require('invariant');
var _invariant = require("invariant");
var _invariant2 = _interopRequireDefault(_invariant);
var _react = require('react');
var _react = require("react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes = require("prop-types");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _matchPath = require('./matchPath');
var _matchPath = require("./matchPath");

@@ -82,3 +82,3 @@ var _matchPath2 = _interopRequireDefault(_matchPath);

(0, _invariant2.default)(router, 'You should not use <Route> or withRouter() outside a <Router>');
(0, _invariant2.default)(router, "You should not use <Route> or withRouter() outside a <Router>");

@@ -89,11 +89,11 @@ var route = router.route;

return path ? (0, _matchPath2.default)(pathname, { path: path, strict: strict, exact: exact, sensitive: sensitive }) : route.match;
return (0, _matchPath2.default)(pathname, { path: path, strict: strict, exact: exact, sensitive: sensitive }, route.match);
};
Route.prototype.componentWillMount = function componentWillMount() {
(0, _warning2.default)(!(this.props.component && this.props.render), 'You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored');
(0, _warning2.default)(!(this.props.component && this.props.render), "You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored");
(0, _warning2.default)(!(this.props.component && this.props.children && !isEmptyChildren(this.props.children)), 'You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored');
(0, _warning2.default)(!(this.props.component && this.props.children && !isEmptyChildren(this.props.children)), "You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored");
(0, _warning2.default)(!(this.props.render && this.props.children && !isEmptyChildren(this.props.children)), 'You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored');
(0, _warning2.default)(!(this.props.render && this.props.children && !isEmptyChildren(this.props.children)), "You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored");
};

@@ -125,6 +125,11 @@

return component ? // component prop gets first priority, only called if there's a match
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) : !isEmptyChildren(children) ? _react2.default.Children.only(children) : null : null;
if (component) return match ? _react2.default.createElement(component, props) : null;
if (render) return match ? render(props) : null;
if (typeof children === "function") return children(props);
if (children && !isEmptyChildren(children)) return _react2.default.Children.only(children);
return null;
};

@@ -131,0 +136,0 @@

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

'use strict';
"use strict";

@@ -7,15 +7,15 @@ exports.__esModule = true;

var _warning = require('warning');
var _warning = require("warning");
var _warning2 = _interopRequireDefault(_warning);
var _invariant = require('invariant');
var _invariant = require("invariant");
var _invariant2 = _interopRequireDefault(_invariant);
var _react = require('react');
var _react = require("react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes = require("prop-types");

@@ -66,6 +66,6 @@ var _propTypes2 = _interopRequireDefault(_propTypes);

return {
path: '/',
url: '/',
path: "/",
url: "/",
params: {},
isExact: pathname === '/'
isExact: pathname === "/"
};

@@ -82,3 +82,3 @@ };

(0, _invariant2.default)(children == null || _react2.default.Children.count(children) === 1, 'A <Router> may have only one child element');
(0, _invariant2.default)(children == null || _react2.default.Children.count(children) === 1, "A <Router> may have only one child element");

@@ -96,3 +96,3 @@ // Do this here so we can setState when a <Redirect> changes the

Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
(0, _warning2.default)(this.props.history === nextProps.history, 'You cannot change <Router history>');
(0, _warning2.default)(this.props.history === nextProps.history, "You cannot change <Router history>");
};

@@ -99,0 +99,0 @@

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

'use strict';
"use strict";

@@ -7,21 +7,21 @@ exports.__esModule = true;

var _warning = require('warning');
var _warning = require("warning");
var _warning2 = _interopRequireDefault(_warning);
var _invariant = require('invariant');
var _invariant = require("invariant");
var _invariant2 = _interopRequireDefault(_invariant);
var _react = require('react');
var _react = require("react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes = require("prop-types");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _PathUtils = require('history/PathUtils');
var _history = require("history");
var _Router = require('./Router');
var _Router = require("./Router");

@@ -40,16 +40,4 @@ var _Router2 = _interopRequireDefault(_Router);

var normalizeLocation = function normalizeLocation(object) {
var _object$pathname = object.pathname,
pathname = _object$pathname === undefined ? '/' : _object$pathname,
_object$search = object.search,
search = _object$search === undefined ? '' : _object$search,
_object$hash = object.hash,
hash = _object$hash === undefined ? '' : _object$hash;
return {
pathname: pathname,
search: search === '?' ? '' : search,
hash: hash === '#' ? '' : hash
};
var addLeadingSlash = function addLeadingSlash(path) {
return path.charAt(0) === "/" ? path : "/" + path;
};

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

return _extends({}, location, {
pathname: (0, _PathUtils.addLeadingSlash)(basename) + location.pathname
pathname: addLeadingSlash(basename) + location.pathname
});

@@ -69,3 +57,3 @@ };

var base = (0, _PathUtils.addLeadingSlash)(basename);
var base = addLeadingSlash(basename);

@@ -79,8 +67,4 @@ if (location.pathname.indexOf(base) !== 0) return location;

var createLocation = function createLocation(location) {
return typeof location === 'string' ? (0, _PathUtils.parsePath)(location) : normalizeLocation(location);
};
var createURL = function createURL(location) {
return typeof location === 'string' ? location : (0, _PathUtils.createPath)(location);
return typeof location === "string" ? location : (0, _history.createPath)(location);
};

@@ -90,3 +74,3 @@

return function () {
(0, _invariant2.default)(false, 'You cannot %s with <StaticRouter>', methodName);
(0, _invariant2.default)(false, "You cannot %s with <StaticRouter>", methodName);
};

@@ -117,3 +101,3 @@ };

return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.createHref = function (path) {
return (0, _PathUtils.addLeadingSlash)(_this.props.basename + createURL(path));
return addLeadingSlash(_this.props.basename + createURL(path));
}, _this.handlePush = function (location) {

@@ -124,4 +108,4 @@ var _this$props = _this.props,

context.action = 'PUSH';
context.location = addBasename(basename, createLocation(location));
context.action = "PUSH";
context.location = addBasename(basename, (0, _history.createLocation)(location));
context.url = createURL(context.location);

@@ -133,4 +117,4 @@ }, _this.handleReplace = function (location) {

context.action = 'REPLACE';
context.location = addBasename(basename, createLocation(location));
context.action = "REPLACE";
context.location = addBasename(basename, (0, _history.createLocation)(location));
context.url = createURL(context.location);

@@ -153,3 +137,3 @@ }, _this.handleListen = function () {

StaticRouter.prototype.componentWillMount = function componentWillMount() {
(0, _warning2.default)(!this.props.history, '<StaticRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { StaticRouter as Router }`.');
(0, _warning2.default)(!this.props.history, "<StaticRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { StaticRouter as Router }`.");
};

@@ -162,13 +146,13 @@

location = _props.location,
props = _objectWithoutProperties(_props, ['basename', 'context', 'location']);
props = _objectWithoutProperties(_props, ["basename", "context", "location"]);
var history = {
createHref: this.createHref,
action: 'POP',
location: stripBasename(basename, createLocation(location)),
action: "POP",
location: stripBasename(basename, (0, _history.createLocation)(location)),
push: this.handlePush,
replace: this.handleReplace,
go: staticHandler('go'),
goBack: staticHandler('goBack'),
goForward: staticHandler('goForward'),
go: staticHandler("go"),
goBack: staticHandler("goBack"),
goForward: staticHandler("goForward"),
listen: this.handleListen,

@@ -190,4 +174,4 @@ block: this.handleBlock

StaticRouter.defaultProps = {
basename: '',
location: '/'
basename: "",
location: "/"
};

@@ -194,0 +178,0 @@ StaticRouter.childContextTypes = {

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

'use strict';
"use strict";
exports.__esModule = true;
var _react = require('react');
var _react = require("react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes = require("prop-types");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _warning = require('warning');
var _warning = require("warning");
var _warning2 = _interopRequireDefault(_warning);
var _invariant = require('invariant');
var _invariant = require("invariant");
var _invariant2 = _interopRequireDefault(_invariant);
var _matchPath = require('./matchPath');
var _matchPath = require("./matchPath");

@@ -46,3 +46,3 @@ var _matchPath2 = _interopRequireDefault(_matchPath);

Switch.prototype.componentWillMount = function componentWillMount() {
(0, _invariant2.default)(this.context.router, 'You should not use <Switch> outside a <Router>');
(0, _invariant2.default)(this.context.router, "You should not use <Switch> outside a <Router>");
};

@@ -65,16 +65,14 @@

_react2.default.Children.forEach(children, function (element) {
if (!_react2.default.isValidElement(element)) return;
if (match == null && _react2.default.isValidElement(element)) {
var _element$props = element.props,
pathProp = _element$props.path,
exact = _element$props.exact,
strict = _element$props.strict,
sensitive = _element$props.sensitive,
from = _element$props.from;
var _element$props = element.props,
pathProp = _element$props.path,
exact = _element$props.exact,
strict = _element$props.strict,
sensitive = _element$props.sensitive,
from = _element$props.from;
var path = pathProp || from;
var path = pathProp || from;
if (match == null) {
child = element;
match = path ? (0, _matchPath2.default)(location.pathname, { path: path, exact: exact, strict: strict, sensitive: sensitive }) : route.match;
match = (0, _matchPath2.default)(location.pathname, { path: path, exact: exact, strict: strict, sensitive: sensitive }, route.match);
}

@@ -81,0 +79,0 @@ });

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e(t.ReactRouter={},t.React)}(this,function(t,e){"use strict";function n(t,e){return e={exports:{}},t(e,e.exports),e.exports}function r(t){return function(){return t}}function o(t){return"/"===t.charAt(0)}function i(t,e){for(var n=e,r=n+1,o=t.length;r<o;n+=1,r+=1)t[n]=t[r];t.pop()}function a(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t&&t.split("/")||[],r=e&&e.split("/")||[],a=t&&o(t),c=e&&o(e),u=a||c;if(t&&o(t)?r=n:n.length&&(r.pop(),r=r.concat(n)),!r.length)return"/";var s=void 0;if(r.length){var p=r[r.length-1];s="."===p||".."===p||""===p}else s=!1;for(var h=0,l=r.length;l>=0;l--){var f=r[l];"."===f?i(r,l):".."===f?(i(r,l),h++):h&&(i(r,l),h--)}if(!u)for(;h--;h)r.unshift("..");!u||""===r[0]||r[0]&&o(r[0])||r.unshift("");var d=r.join("/");return s&&"/"!==d.substr(-1)&&(d+="/"),d}function c(t,e){if(t===e)return!0;if(null==t||null==e)return!1;if(Array.isArray(t))return Array.isArray(e)&&t.length===e.length&&t.every(function(t,n){return c(t,e[n])});var n=void 0===t?"undefined":U(t);if(n!==(void 0===e?"undefined":U(e)))return!1;if("object"===n){var r=t.valueOf(),o=e.valueOf();if(r!==t||o!==e)return c(r,o);var i=Object.keys(t),a=Object.keys(e);return i.length===a.length&&i.every(function(n){return c(t[n],e[n])})}return!1}function u(t,e){for(var n,r=[],o=0,i=0,a="",c=e&&e.delimiter||"/";null!=(n=ct.exec(t));){var u=n[0],s=n[1],p=n.index;if(a+=t.slice(i,p),i=p+u.length,s)a+=s[1];else{var h=t[i],d=n[2],y=n[3],m=n[4],v=n[5],g=n[6],b=n[7];a&&(r.push(a),a="");var x=null!=d&&null!=h&&h!==d,R="+"===g||"*"===g,O="?"===g||"*"===g,P=n[2]||c,w=m||v;r.push({name:y||o++,prefix:d||"",delimiter:P,optional:O,repeat:R,partial:x,asterisk:!!b,pattern:w?f(w):b?".*":"[^"+l(P)+"]+?"})}}return i<t.length&&(a+=t.substr(i)),a&&r.push(a),r}function s(t){return encodeURI(t).replace(/[\/?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function p(t){return encodeURI(t).replace(/[?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function h(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="",i=n||{},a=(r||{}).pretty?s:encodeURIComponent,c=0;c<t.length;c++){var u=t[c];if("string"!=typeof u){var h,l=i[u.name];if(null==l){if(u.optional){u.partial&&(o+=u.prefix);continue}throw new TypeError('Expected "'+u.name+'" to be defined')}if(nt(l)){if(!u.repeat)throw new TypeError('Expected "'+u.name+'" to not repeat, but received `'+JSON.stringify(l)+"`");if(0===l.length){if(u.optional)continue;throw new TypeError('Expected "'+u.name+'" to not be empty')}for(var f=0;f<l.length;f++){if(h=a(l[f]),!e[c].test(h))throw new TypeError('Expected all "'+u.name+'" to match "'+u.pattern+'", but received `'+JSON.stringify(h)+"`");o+=(0===f?u.prefix:u.delimiter)+h}}else{if(h=u.asterisk?p(l):a(l),!e[c].test(h))throw new TypeError('Expected "'+u.name+'" to match "'+u.pattern+'", but received "'+h+'"');o+=u.prefix+h}}else o+=u}return o}}function l(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function f(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function d(t,e){return t.keys=e,t}function y(t){return t.sensitive?"":"i"}function m(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 d(t,e)}function v(t,e,n){for(var r=[],o=0;o<t.length;o++)r.push(x(t[o],e,n).source);return d(new RegExp("(?:"+r.join("|")+")",y(n)),e)}function g(t,e,n){return b(u(t,n),e,n)}function b(t,e,n){nt(e)||(n=e||n,e=[]);for(var r=(n=n||{}).strict,o=!1!==n.end,i="",a=0;a<t.length;a++){var c=t[a];if("string"==typeof c)i+=l(c);else{var u=l(c.prefix),s="(?:"+c.pattern+")";e.push(c),c.repeat&&(s+="(?:"+u+s+")*"),i+=s=c.optional?c.partial?u+"("+s+")?":"(?:"+u+"("+s+"))?":u+"("+s+")"}}var p=l(n.delimiter||"/"),h=i.slice(-p.length)===p;return r||(i=(h?i.slice(0,-p.length):i)+"(?:"+p+"(?=$))?"),i+=o?"$":r&&h?"":"(?="+p+"|$)",d(new RegExp("^"+i,y(n)),e)}function x(t,e,n){return nt(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?m(t,e):nt(t)?v(t,e,n):g(t,e,n)}e=e&&e.hasOwnProperty("default")?e.default:e;var R=function(){},O=R,P=function(){};P.thatReturns=r,P.thatReturnsFalse=r(!1),P.thatReturnsTrue=r(!0),P.thatReturnsNull=r(null),P.thatReturnsThis=function(){return this},P.thatReturnsArgument=function(t){return t};var w=P,E=function(t){},j=function(t,e,n,r,o,i,a,c){if(E(e),!t){var u;if(void 0===e)u=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,c],p=0;(u=new Error(e.replace(/%s/g,function(){return s[p++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}},C="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",T=function(){function t(t,e,n,r,o,i){i!==C&&j(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e};return n.checkPropTypes=w,n.PropTypes=n,n},k=n(function(t){t.exports=T()}),A=n(function(t,e){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};var n=e.hasBasename=function(t,e){return new RegExp("^"+e+"(\\/|\\?|#|$)","i").test(t)};e.stripBasename=function(t,e){return n(t,e)?t.substr(e.length):t},e.stripTrailingSlash=function(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t},e.parsePath=function(t){var e=t||"/",n="",r="",o=e.indexOf("#");-1!==o&&(r=e.substr(o),e=e.substr(0,o));var i=e.indexOf("?");return-1!==i&&(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}}),S=A.addLeadingSlash,M=A.parsePath,_=A.createPath,L=Object.freeze({default:a}),U="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},q=Object.freeze({default:c}),I=L&&a||L,W=q&&c||q,$=n(function(t,e){function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.locationsAreEqual=e.createLocation=void 0;var r=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},o=n(I),i=n(W);e.createLocation=function(t,e,n,i){var a=void 0;"string"==typeof t?(a=(0,A.parsePath)(t)).state=e:(void 0===(a=r({},t)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==e&&void 0===a.state&&(a.state=e));try{a.pathname=decodeURI(a.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return n&&(a.key=n),i?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=(0,o.default)(a.pathname,i.pathname)):a.pathname=i.pathname:a.pathname||(a.pathname="/"),a},e.locationsAreEqual=function(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&(0,i.default)(t.state,e.state)}}),H=n(function(t,e){e.__esModule=!0;var n=function(t){return t&&t.__esModule?t:{default:t}}(O);e.default=function(){var t=null,e=[];return{setPrompt:function(e){return(0,n.default)(null==t,"A history supports only one prompt at a time"),t=e,function(){t===e&&(t=null)}},confirmTransitionTo:function(e,r,o,i){if(null!=t){var a="function"==typeof t?t(e,r):t;"string"==typeof a?"function"==typeof o?o(a,i):((0,n.default)(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),i(!0)):i(!1!==a)}else i(!0)},appendListener:function(t){var n=!0,r=function(){n&&t.apply(void 0,arguments)};return e.push(r),function(){n=!1,e=e.filter(function(t){return t!==r})}},notifyListeners:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];e.forEach(function(t){return t.apply(void 0,n)})}}}}),N=function(t){return t&&t.__esModule?t.default:t}(n(function(t,e){function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r="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},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(O),a=n(H),c=function(t,e,n){return Math.min(Math.max(t,e),n)};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.getUserConfirmation,n=t.initialEntries,u=void 0===n?["/"]:n,s=t.initialIndex,p=void 0===s?0:s,h=t.keyLength,l=void 0===h?6:h,f=(0,a.default)(),d=function(t){o(x,t),x.length=x.entries.length,f.notifyListeners(x.location,x.action)},y=function(){return Math.random().toString(36).substr(2,l)},m=c(p,0,u.length-1),v=u.map(function(t){return"string"==typeof t?(0,$.createLocation)(t,void 0,y()):(0,$.createLocation)(t,void 0,t.key||y())}),g=A.createPath,b=function(t){var n=c(x.index+t,0,x.entries.length-1),r=x.entries[n];f.confirmTransitionTo(r,"POP",e,function(t){t?d({action:"POP",location:r,index:n}):d()})},x={length:v.length,action:"POP",location:v[m],index:m,entries:v,createHref:g,push:function(t,n){(0,i.default)(!("object"===(void 0===t?"undefined":r(t))&&void 0!==t.state&&void 0!==n),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var o=(0,$.createLocation)(t,n,y(),x.location);f.confirmTransitionTo(o,"PUSH",e,function(t){if(t){var e=x.index+1,n=x.entries.slice(0);n.length>e?n.splice(e,n.length-e,o):n.push(o),d({action:"PUSH",location:o,index:e,entries:n})}})},replace:function(t,n){(0,i.default)(!("object"===(void 0===t?"undefined":r(t))&&void 0!==t.state&&void 0!==n),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var o=(0,$.createLocation)(t,n,y(),x.location);f.confirmTransitionTo(o,"REPLACE",e,function(t){t&&(x.entries[x.index]=o,d({action:"REPLACE",location:o}))})},go:b,goBack:function(){return b(-1)},goForward:function(){return b(1)},canGo:function(t){var e=x.index+t;return e>=0&&e<x.entries.length},block:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return f.setPrompt(t)},listen:function(t){return f.appendListener(t)}};return x}})),B=function(t,e,n,r,o,i,a,c){if(!t){var u;if(void 0===e)u=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,c],p=0;(u=new Error(e.replace(/%s/g,function(){return s[p++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}},D=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},F=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},V=function(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)},Y=function(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},z=function(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},J=function(t){function n(){var e,r,o;D(this,n);for(var i=arguments.length,a=Array(i),c=0;c<i;c++)a[c]=arguments[c];return e=r=z(this,t.call.apply(t,[this].concat(a))),r.state={match:r.computeMatch(r.props.history.location.pathname)},o=e,z(r,o)}return V(n,t),n.prototype.getChildContext=function(){return{router:F({},this.context.router,{history:this.props.history,route:{location:this.props.history.location,match:this.state.match}})}},n.prototype.computeMatch=function(t){return{path:"/",url:"/",params:{},isExact:"/"===t}},n.prototype.componentWillMount=function(){var t=this,n=this.props,r=n.children,o=n.history;null!=r&&1!==e.Children.count(r)&&B(!1),this.unlisten=o.listen(function(){t.setState({match:t.computeMatch(o.location.pathname)})})},n.prototype.componentWillReceiveProps=function(t){},n.prototype.componentWillUnmount=function(){this.unlisten()},n.prototype.render=function(){var t=this.props.children;return t?e.Children.only(t):null},n}(e.Component);J.contextTypes={router:k.object},J.childContextTypes={router:k.object.isRequired};var G=function(t){function n(){var e,r,o;D(this,n);for(var i=arguments.length,a=Array(i),c=0;c<i;c++)a[c]=arguments[c];return e=r=z(this,t.call.apply(t,[this].concat(a))),r.history=N(r.props),o=e,z(r,o)}return V(n,t),n.prototype.componentWillMount=function(){},n.prototype.render=function(){return e.createElement(J,{history:this.history,children:this.props.children})},n}(e.Component),K=function(t){function e(){return D(this,e),z(this,t.apply(this,arguments))}return V(e,t),e.prototype.enable=function(t){this.unblock&&this.unblock(),this.unblock=this.context.router.history.block(t)},e.prototype.disable=function(){this.unblock&&(this.unblock(),this.unblock=null)},e.prototype.componentWillMount=function(){this.context.router||B(!1),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}(e.Component);K.defaultProps={when:!0},K.contextTypes={router:k.shape({history:k.shape({block:k.func.isRequired}).isRequired}).isRequired};var Q=function(t){var e=t||"/",n="",r="",o=e.indexOf("#");-1!==o&&(r=e.substr(o),e=e.substr(0,o));var i=e.indexOf("?");return-1!==i&&(n=e.substr(i),e=e.substr(0,i)),{pathname:e,search:"?"===n?"":n,hash:"#"===r?"":r}},X=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},Z=function(t,e,n,r){var o=void 0;"string"==typeof t?(o=Q(t)).state=e:(void 0===(o=X({},t)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==e&&void 0===o.state&&(o.state=e));try{o.pathname=decodeURI(o.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=a(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o},tt=function(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&c(t.state,e.state)},et=function(t){function e(){return D(this,e),z(this,t.apply(this,arguments))}return V(e,t),e.prototype.isStatic=function(){return this.context.router&&this.context.router.staticContext},e.prototype.componentWillMount=function(){this.context.router||B(!1),this.isStatic()&&this.perform()},e.prototype.componentDidMount=function(){this.isStatic()||this.perform()},e.prototype.componentDidUpdate=function(t){var e=Z(t.to),n=Z(this.props.to);tt(e,n)||this.perform()},e.prototype.perform=function(){var t=this.context.router.history,e=this.props,n=e.push,r=e.to;n?t.push(r):t.replace(r)},e.prototype.render=function(){return null},e}(e.Component);et.defaultProps={push:!1},et.contextTypes={router:k.shape({history:k.shape({push:k.func.isRequired,replace:k.func.isRequired}).isRequired,staticContext:k.object}).isRequired};var nt=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},rt=x,ot=u,it=h,at=b,ct=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");rt.parse=ot,rt.compile=function(t,e){return h(u(t,e))},rt.tokensToFunction=it,rt.tokensToRegExp=at;var ut={},st=0,pt=function(t,e){var n=""+e.end+e.strict+e.sensitive,r=ut[n]||(ut[n]={});if(r[t])return r[t];var o=[],i={re:rt(t,o,e),keys:o};return st<1e4&&(r[t]=i,st++),i},ht=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"==typeof e&&(e={path:e});var n=e,r=n.path,o=void 0===r?"/":r,i=n.exact,a=void 0!==i&&i,c=n.strict,u=void 0!==c&&c,s=n.sensitive,p=pt(o,{end:a,strict:u,sensitive:void 0!==s&&s}),h=p.re,l=p.keys,f=h.exec(t);if(!f)return null;var d=f[0],y=f.slice(1),m=t===d;return a&&!m?null:{path:o,url:"/"===o&&""===d?"/":d,isExact:m,params:l.reduce(function(t,e,n){return t[e.name]=y[n],t},{})}},lt=function(t){return 0===e.Children.count(t)},ft=function(t){function n(){var e,r,o;D(this,n);for(var i=arguments.length,a=Array(i),c=0;c<i;c++)a[c]=arguments[c];return e=r=z(this,t.call.apply(t,[this].concat(a))),r.state={match:r.computeMatch(r.props,r.context.router)},o=e,z(r,o)}return V(n,t),n.prototype.getChildContext=function(){return{router:F({},this.context.router,{route:{location:this.props.location||this.context.router.route.location,match:this.state.match}})}},n.prototype.computeMatch=function(t,e){var n=t.computedMatch,r=t.location,o=t.path,i=t.strict,a=t.exact,c=t.sensitive;if(n)return n;e||B(!1);var u=e.route,s=(r||u.location).pathname;return o?ht(s,{path:o,strict:i,exact:a,sensitive:c}):u.match},n.prototype.componentWillMount=function(){},n.prototype.componentWillReceiveProps=function(t,e){this.setState({match:this.computeMatch(t,e.router)})},n.prototype.render=function(){var t=this.state.match,n=this.props,r=n.children,o=n.component,i=n.render,a=this.context.router,c=a.history,u=a.route,s=a.staticContext,p={match:t,location:this.props.location||u.location,history:c,staticContext:s};return o?t?e.createElement(o,p):null:i?t?i(p):null:r?"function"==typeof r?r(p):lt(r)?null:e.Children.only(r):null},n}(e.Component);ft.contextTypes={router:k.shape({history:k.object.isRequired,route:k.object.isRequired,staticContext:k.object})},ft.childContextTypes={router:k.object.isRequired};var dt=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}},yt=function(t,e){return t?F({},e,{pathname:S(t)+e.pathname}):e},mt=function(t,e){if(!t)return e;var n=S(t);return 0!==e.pathname.indexOf(n)?e:F({},e,{pathname:e.pathname.substr(n.length)})},vt=function(t){return"string"==typeof t?M(t):dt(t)},gt=function(t){return"string"==typeof t?t:_(t)},bt=function(t){return function(){B(!1)}},xt=function(){},Rt=function(t){function n(){var e,r,o;D(this,n);for(var i=arguments.length,a=Array(i),c=0;c<i;c++)a[c]=arguments[c];return e=r=z(this,t.call.apply(t,[this].concat(a))),r.createHref=function(t){return S(r.props.basename+gt(t))},r.handlePush=function(t){var e=r.props,n=e.basename,o=e.context;o.action="PUSH",o.location=yt(n,vt(t)),o.url=gt(o.location)},r.handleReplace=function(t){var e=r.props,n=e.basename,o=e.context;o.action="REPLACE",o.location=yt(n,vt(t)),o.url=gt(o.location)},r.handleListen=function(){return xt},r.handleBlock=function(){return xt},o=e,z(r,o)}return V(n,t),n.prototype.getChildContext=function(){return{router:{staticContext:this.props.context}}},n.prototype.componentWillMount=function(){},n.prototype.render=function(){var t=this.props,n=t.basename,r=(t.context,t.location),o=Y(t,["basename","context","location"]),i={createHref:this.createHref,action:"POP",location:mt(n,vt(r)),push:this.handlePush,replace:this.handleReplace,go:bt(),goBack:bt(),goForward:bt(),listen:this.handleListen,block:this.handleBlock};return e.createElement(J,F({},o,{history:i}))},n}(e.Component);Rt.defaultProps={basename:"",location:"/"},Rt.childContextTypes={router:k.object.isRequired};var Ot=function(t){function n(){return D(this,n),z(this,t.apply(this,arguments))}return V(n,t),n.prototype.componentWillMount=function(){this.context.router||B(!1)},n.prototype.componentWillReceiveProps=function(t){},n.prototype.render=function(){var t=this.context.router.route,n=this.props.children,r=this.props.location||t.location,o=void 0,i=void 0;return e.Children.forEach(n,function(n){if(e.isValidElement(n)){var a=n.props,c=a.path,u=a.exact,s=a.strict,p=a.sensitive,h=a.from,l=c||h;null==o&&(i=n,o=l?ht(r.pathname,{path:l,exact:u,strict:s,sensitive:p}):t.match)}}),o?e.cloneElement(i,{location:r,computedMatch:o}):null},n}(e.Component);Ot.contextTypes={router:k.shape({route:k.object.isRequired}).isRequired};var Pt={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},wt={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Et=Object.defineProperty,jt=Object.getOwnPropertyNames,Ct=Object.getOwnPropertySymbols,Tt=Object.getOwnPropertyDescriptor,kt=Object.getPrototypeOf,At=kt&&kt(Object),St=function t(e,n,r){if("string"!=typeof n){if(At){var o=kt(n);o&&o!==At&&t(e,o,r)}var i=jt(n);Ct&&(i=i.concat(Ct(n)));for(var a=0;a<i.length;++a){var c=i[a];if(!(Pt[c]||wt[c]||r&&r[c])){var u=Tt(n,c);try{Et(e,c,u)}catch(t){}}}return e}return e};t.MemoryRouter=G,t.Prompt=K,t.Redirect=et,t.Route=ft,t.Router=J,t.StaticRouter=Rt,t.Switch=Ot,t.matchPath=ht,t.withRouter=function(t){var n=function(n){var r=n.wrappedComponentRef,o=Y(n,["wrappedComponentRef"]);return e.createElement(ft,{render:function(n){return e.createElement(t,F({},o,n,{ref:r}))}})};return n.displayName="withRouter("+(t.displayName||t.name)+")",n.WrappedComponent=t,St(n,t)},Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e(t.ReactRouter={},t.React)}(this,function(t,e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function n(t,e){return t(e={exports:{}},e.exports),e.exports}function r(t){return function(){return t}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(t){return t};var i=o;var a=function(t,e,n,r,o,i,a,c){if(!t){var u;if(void 0===e)u=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,c],p=0;(u=new Error(e.replace(/%s/g,function(){return s[p++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}},c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;(function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}})()&&Object.assign;var p="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",l=n(function(t){t.exports=function(){function t(t,e,n,r,o,i){i!==p&&a(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=i,n.PropTypes=n,n}()}),h=function(t,e,n,r,o,i,a,c){if(!t){var u;if(void 0===e)u=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,c],p=0;(u=new Error(e.replace(/%s/g,function(){return s[p++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}};function f(t){return"/"===t.charAt(0)}function y(t,e){for(var n=e,r=n+1,o=t.length;r<o;n+=1,r+=1)t[n]=t[r];t.pop()}var d="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};var m=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},v=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},b=function(t,e,n,r){var o=void 0;"string"==typeof t?(o=function(t){var e=t||"/",n="",r="",o=e.indexOf("#");-1!==o&&(r=e.substr(o),e=e.substr(0,o));var i=e.indexOf("?");return-1!==i&&(n=e.substr(i),e=e.substr(0,i)),{pathname:e,search:"?"===n?"":n,hash:"#"===r?"":r}}(t)).state=e:(void 0===(o=v({},t)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==e&&void 0===o.state&&(o.state=e));try{o.pathname=decodeURI(o.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t&&t.split("/")||[],r=e&&e.split("/")||[],o=t&&f(t),i=e&&f(e),a=o||i;if(t&&f(t)?r=n:n.length&&(r.pop(),r=r.concat(n)),!r.length)return"/";var c=void 0;if(r.length){var u=r[r.length-1];c="."===u||".."===u||""===u}else c=!1;for(var s=0,p=r.length;p>=0;p--){var l=r[p];"."===l?y(r,p):".."===l?(y(r,p),s++):s&&(y(r,p),s--)}if(!a)for(;s--;s)r.unshift("..");!a||""===r[0]||r[0]&&f(r[0])||r.unshift("");var h=r.join("/");return c&&"/"!==h.substr(-1)&&(h+="/"),h}(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o},g=function(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&function t(e,n){if(e===n)return!0;if(null==e||null==n)return!1;if(Array.isArray(e))return Array.isArray(n)&&e.length===n.length&&e.every(function(e,r){return t(e,n[r])});var r=void 0===e?"undefined":d(e);if(r!==(void 0===n?"undefined":d(n)))return!1;if("object"===r){var o=e.valueOf(),i=n.valueOf();if(o!==e||i!==n)return t(o,i);var a=Object.keys(e),c=Object.keys(n);return a.length===c.length&&a.every(function(r){return t(e[r],n[r])})}return!1}(t.state,e.state)},x=("function"==typeof Symbol&&Symbol.iterator,Object.assign,function(){function t(t){this.value=t}function e(e){var n,r;function o(n,r){try{var a=e[n](r),c=a.value;c instanceof t?Promise.resolve(c.value).then(function(t){o("next",t)},function(t){o("throw",t)}):i(a.done?"return":"normal",a.value)}catch(t){i("throw",t)}}function i(t,e){switch(t){case"return":n.resolve({value:e,done:!0});break;case"throw":n.reject(e);break;default:n.resolve({value:e,done:!1})}(n=n.next)?o(n.key,n.arg):r=null}this._invoke=function(t,e){return new Promise(function(i,a){var c={key:t,arg:e,resolve:i,reject:a,next:null};r?r=r.next=c:(n=r=c,o(t,e))})},"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(e.prototype[Symbol.asyncIterator]=function(){return this}),e.prototype.next=function(t){return this._invoke("next",t)},e.prototype.throw=function(t){return this._invoke("throw",t)},e.prototype.return=function(t){return this._invoke("return",t)}}(),function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}),w=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},R=function(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)},O=function(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},j=function(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},C=function(t){function n(){var e,r,o;x(this,n);for(var i=arguments.length,a=Array(i),c=0;c<i;c++)a[c]=arguments[c];return e=r=babelHelpers.possibleConstructorReturn(this,t.call.apply(t,[this].concat(a))),r.state={match:r.computeMatch(r.props.history.location.pathname)},o=e,babelHelpers.possibleConstructorReturn(r,o)}return R(n,t),n.prototype.getChildContext=function(){return{router:w({},this.context.router,{history:this.props.history,route:{location:this.props.history.location,match:this.state.match}})}},n.prototype.computeMatch=function(t){return{path:"/",url:"/",params:{},isExact:"/"===t}},n.prototype.componentWillMount=function(){var t=this,n=this.props,r=n.children,o=n.history;null!=r&&1!==e.Children.count(r)&&h(!1),this.unlisten=o.listen(function(){t.setState({match:t.computeMatch(o.location.pathname)})})},n.prototype.componentWillReceiveProps=function(t){},n.prototype.componentWillUnmount=function(){this.unlisten()},n.prototype.render=function(){var t=this.props.children;return t?e.Children.only(t):null},n}(e.Component);C.contextTypes={router:l.object},C.childContextTypes={router:l.object.isRequired};var P=function(t){function n(){var e,r,o;x(this,n);for(var i=arguments.length,a=Array(i),c=0;c<i;c++)a[c]=arguments[c];return e=r=babelHelpers.possibleConstructorReturn(this,t.call.apply(t,[this].concat(a))),r.history=createHistory(r.props),o=e,babelHelpers.possibleConstructorReturn(r,o)}return R(n,t),n.prototype.componentWillMount=function(){},n.prototype.render=function(){return e.createElement(C,{history:this.history,children:this.props.children})},n}(e.Component),E=function(t){function e(){return x(this,e),j(this,t.apply(this,arguments))}return R(e,t),e.prototype.enable=function(t){this.unblock&&this.unblock(),this.unblock=this.context.router.history.block(t)},e.prototype.disable=function(){this.unblock&&(this.unblock(),this.unblock=null)},e.prototype.componentWillMount=function(){this.context.router||h(!1),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}(e.Component);E.defaultProps={when:!0},E.contextTypes={router:l.shape({history:l.shape({block:l.func.isRequired}).isRequired}).isRequired};var k=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},T=F,S=W,A=function(t,e){return I(W(t,e))},M=I,_=L,q=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function W(t,e){for(var n,r=[],o=0,i=0,a="",c=e&&e.delimiter||"/";null!=(n=q.exec(t));){var u=n[0],s=n[1],p=n.index;if(a+=t.slice(i,p),i=p+u.length,s)a+=s[1];else{var l=t[i],h=n[2],f=n[3],y=n[4],d=n[5],m=n[6],v=n[7];a&&(r.push(a),a="");var b=null!=h&&null!=l&&l!==h,g="+"===m||"*"===m,x="?"===m||"*"===m,w=n[2]||c,R=y||d;r.push({name:f||o++,prefix:h||"",delimiter:w,optional:x,repeat:g,partial:b,asterisk:!!v,pattern:R?N(R):v?".*":"[^"+U(w)+"]+?"})}}return i<t.length&&(a+=t.substr(i)),a&&r.push(a),r}function H(t){return encodeURI(t).replace(/[\/?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function I(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="",i=n||{},a=(r||{}).pretty?H:encodeURIComponent,c=0;c<t.length;c++){var u=t[c];if("string"!=typeof u){var s,p=i[u.name];if(null==p){if(u.optional){u.partial&&(o+=u.prefix);continue}throw new TypeError('Expected "'+u.name+'" to be defined')}if(k(p)){if(!u.repeat)throw new TypeError('Expected "'+u.name+'" to not repeat, but received `'+JSON.stringify(p)+"`");if(0===p.length){if(u.optional)continue;throw new TypeError('Expected "'+u.name+'" to not be empty')}for(var l=0;l<p.length;l++){if(s=a(p[l]),!e[c].test(s))throw new TypeError('Expected all "'+u.name+'" to match "'+u.pattern+'", but received `'+JSON.stringify(s)+"`");o+=(0===l?u.prefix:u.delimiter)+s}}else{if(s=u.asterisk?encodeURI(p).replace(/[?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}):a(p),!e[c].test(s))throw new TypeError('Expected "'+u.name+'" to match "'+u.pattern+'", but received "'+s+'"');o+=u.prefix+s}}else o+=u}return o}}function U(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function N(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function $(t,e){return t.keys=e,t}function D(t){return t.sensitive?"":"i"}function L(t,e,n){k(e)||(n=e||n,e=[]);for(var r=(n=n||{}).strict,o=!1!==n.end,i="",a=0;a<t.length;a++){var c=t[a];if("string"==typeof c)i+=U(c);else{var u=U(c.prefix),s="(?:"+c.pattern+")";e.push(c),c.repeat&&(s+="(?:"+u+s+")*"),i+=s=c.optional?c.partial?u+"("+s+")?":"(?:"+u+"("+s+"))?":u+"("+s+")"}}var p=U(n.delimiter||"/"),l=i.slice(-p.length)===p;return r||(i=(l?i.slice(0,-p.length):i)+"(?:"+p+"(?=$))?"),i+=o?"$":r&&l?"":"(?="+p+"|$)",$(new RegExp("^"+i,D(n)),e)}function F(t,e,n){return k(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?function(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 $(t,e)}(t,e):k(t)?function(t,e,n){for(var r=[],o=0;o<t.length;o++)r.push(F(t[o],e,n).source);return $(new RegExp("(?:"+r.join("|")+")",D(n)),e)}(t,e,n):function(t,e,n){return L(W(t,n),e,n)}(t,e,n)}T.parse=S,T.compile=A,T.tokensToFunction=M,T.tokensToRegExp=_;var B={},V=0,J=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"/"===t?t:function(t){var e=t,n=B[e]||(B[e]={});if(n[t])return n[t];var r=T.compile(t);return V<1e4&&(n[t]=r,V++),r}(t)(e)},Y=function(t){function e(){return x(this,e),j(this,t.apply(this,arguments))}return R(e,t),e.prototype.isStatic=function(){return this.context.router&&this.context.router.staticContext},e.prototype.componentWillMount=function(){this.context.router||h(!1),this.isStatic()&&this.perform()},e.prototype.componentDidMount=function(){this.isStatic()||this.perform()},e.prototype.componentDidUpdate=function(t){var e=b(t.to),n=b(this.props.to);g(e,n)||this.perform()},e.prototype.computeTo=function(t){var e=t.computedMatch,n=t.to;return e?"string"==typeof n?J(n,e.params):w({},n,{pathname:J(n.pathname,e.params)}):n},e.prototype.perform=function(){var t=this.context.router.history,e=this.props.push,n=this.computeTo(this.props);e?t.push(n):t.replace(n)},e.prototype.render=function(){return null},e}(e.Component);Y.defaultProps={push:!1},Y.contextTypes={router:l.shape({history:l.shape({push:l.func.isRequired,replace:l.func.isRequired}).isRequired,staticContext:l.object}).isRequired};var z={},G=0,K=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];"string"==typeof e&&(e={path:e});var r=e,o=r.path,i=r.exact,a=void 0!==i&&i,c=r.strict,u=void 0!==c&&c,s=r.sensitive,p=void 0!==s&&s;if(null==o)return n;var l=function(t,e){var n=""+e.end+e.strict+e.sensitive,r=z[n]||(z[n]={});if(r[t])return r[t];var o=[],i={re:T(t,o,e),keys:o};return G<1e4&&(r[t]=i,G++),i}(o,{end:a,strict:u,sensitive:p}),h=l.re,f=l.keys,y=h.exec(t);if(!y)return null;var d=y[0],m=y.slice(1),v=t===d;return a&&!v?null:{path:o,url:"/"===o&&""===d?"/":d,isExact:v,params:f.reduce(function(t,e,n){return t[e.name]=m[n],t},{})}},Q=function(t){function n(){var e,r,o;x(this,n);for(var i=arguments.length,a=Array(i),c=0;c<i;c++)a[c]=arguments[c];return e=r=babelHelpers.possibleConstructorReturn(this,t.call.apply(t,[this].concat(a))),r.state={match:r.computeMatch(r.props,r.context.router)},o=e,babelHelpers.possibleConstructorReturn(r,o)}return R(n,t),n.prototype.getChildContext=function(){return{router:w({},this.context.router,{route:{location:this.props.location||this.context.router.route.location,match:this.state.match}})}},n.prototype.computeMatch=function(t,e){var n=t.computedMatch,r=t.location,o=t.path,i=t.strict,a=t.exact,c=t.sensitive;if(n)return n;e||h(!1);var u=e.route,s=(r||u.location).pathname;return K(s,{path:o,strict:i,exact:a,sensitive:c},u.match)},n.prototype.componentWillMount=function(){},n.prototype.componentWillReceiveProps=function(t,e){this.setState({match:this.computeMatch(t,e.router)})},n.prototype.render=function(){var t=this.state.match,n=this.props,r=n.children,o=n.component,i=n.render,a=this.context.router,c=a.history,u=a.route,s=a.staticContext,p={match:t,location:this.props.location||u.location,history:c,staticContext:s};return o?t?e.createElement(o,p):null:i?t?i(p):null:"function"==typeof r?r(p):r&&!function(t){return 0===e.Children.count(t)}(r)?e.Children.only(r):null},n}(e.Component);Q.contextTypes={router:l.shape({history:l.object.isRequired,route:l.object.isRequired,staticContext:l.object})},Q.childContextTypes={router:l.object.isRequired};var X=function(t){return"/"===t.charAt(0)?t:"/"+t},Z=function(t,e){return t?w({},e,{pathname:X(t)+e.pathname}):e},tt=function(t){return"string"==typeof t?t:m(t)},et=function(t){return function(){h(!1)}},nt=function(){},rt=function(t){function n(){var e,r,o;x(this,n);for(var i=arguments.length,a=Array(i),c=0;c<i;c++)a[c]=arguments[c];return e=r=babelHelpers.possibleConstructorReturn(this,t.call.apply(t,[this].concat(a))),r.createHref=function(t){return addLeadingSlash(r.props.basename+tt(t))},r.handlePush=function(t){var e=r.props,n=e.basename,o=e.context;o.action="PUSH",o.location=Z(n,b(t)),o.url=tt(o.location)},r.handleReplace=function(t){var e=r.props,n=e.basename,o=e.context;o.action="REPLACE",o.location=Z(n,b(t)),o.url=tt(o.location)},r.handleListen=function(){return nt},r.handleBlock=function(){return nt},o=e,babelHelpers.possibleConstructorReturn(r,o)}return R(n,t),n.prototype.getChildContext=function(){return{router:{staticContext:this.props.context}}},n.prototype.componentWillMount=function(){},n.prototype.render=function(){var t=this.props,n=t.basename,r=(t.context,t.location),o=O(t,["basename","context","location"]),i={createHref:this.createHref,action:"POP",location:function(t,e){if(!t)return e;var n=X(t);return 0!==e.pathname.indexOf(n)?e:w({},e,{pathname:e.pathname.substr(n.length)})}(n,b(r)),push:this.handlePush,replace:this.handleReplace,go:et(),goBack:et(),goForward:et(),listen:this.handleListen,block:this.handleBlock};return e.createElement(C,w({},o,{history:i}))},n}(e.Component);rt.defaultProps={basename:"",location:"/"},rt.childContextTypes={router:l.object.isRequired};var ot=function(t){function n(){return x(this,n),j(this,t.apply(this,arguments))}return R(n,t),n.prototype.componentWillMount=function(){this.context.router||h(!1)},n.prototype.componentWillReceiveProps=function(t){},n.prototype.render=function(){var t=this.context.router.route,n=this.props.children,r=this.props.location||t.location,o=void 0,i=void 0;return e.Children.forEach(n,function(n){if(null==o&&e.isValidElement(n)){var a=n.props,c=a.path,u=a.exact,s=a.strict,p=a.sensitive,l=a.from,h=c||l;i=n,o=K(r.pathname,{path:h,exact:u,strict:s,sensitive:p},t.match)}}),o?e.cloneElement(i,{location:r,computedMatch:o}):null},n}(e.Component);ot.contextTypes={router:l.shape({route:l.object.isRequired}).isRequired};var it=n(function(t,e){var n,r,o,i,a,c,u,s;t.exports=(n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o=Object.defineProperty,i=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,c=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,s=u&&u(Object),function t(e,p,l){if("string"!=typeof p){if(s){var h=u(p);h&&h!==s&&t(e,h,l)}var f=i(p);a&&(f=f.concat(a(p)));for(var y=0;y<f.length;++y){var d=f[y];if(!(n[d]||r[d]||l&&l[d])){var m=c(p,d);try{o(e,d,m)}catch(t){}}}return e}return e})});t.MemoryRouter=P,t.Prompt=E,t.Redirect=Y,t.Route=Q,t.Router=C,t.StaticRouter=rt,t.Switch=ot,t.generatePath=J,t.matchPath=K,t.withRouter=function(t){var n=function(n){var r=n.wrappedComponentRef,o=O(n,["wrappedComponentRef"]);return e.createElement(Q,{children:function(n){return e.createElement(t,w({},o,n,{ref:r}))}})};return n.displayName="withRouter("+(t.displayName||t.name)+")",n.WrappedComponent=t,it(n,t)},Object.defineProperty(t,"__esModule",{value:!0})});

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

'use strict';
"use strict";

@@ -7,15 +7,15 @@ exports.__esModule = true;

var _react = require('react');
var _react = require("react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes = require("prop-types");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _hoistNonReactStatics = require('hoist-non-react-statics');
var _hoistNonReactStatics = require("hoist-non-react-statics");
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
var _Route = require('./Route');
var _Route = require("./Route");

@@ -34,10 +34,14 @@ var _Route2 = _interopRequireDefault(_Route);

var wrappedComponentRef = props.wrappedComponentRef,
remainingProps = _objectWithoutProperties(props, ['wrappedComponentRef']);
remainingProps = _objectWithoutProperties(props, ["wrappedComponentRef"]);
return _react2.default.createElement(_Route2.default, { render: function render(routeComponentProps) {
return _react2.default.createElement(Component, _extends({}, remainingProps, routeComponentProps, { ref: wrappedComponentRef }));
} });
return _react2.default.createElement(_Route2.default, {
children: function children(routeComponentProps) {
return _react2.default.createElement(Component, _extends({}, remainingProps, routeComponentProps, {
ref: wrappedComponentRef
}));
}
});
};
C.displayName = 'withRouter(' + (Component.displayName || Component.name) + ')';
C.displayName = "withRouter(" + (Component.displayName || Component.name) + ")";
C.WrappedComponent = Component;

@@ -44,0 +48,0 @@ C.propTypes = {

Sorry, the diff of this file is too big to display

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