Socket
Socket
Sign inDemoInstall

react-router

Package Overview
Dependencies
Maintainers
2
Versions
517
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 1.0.0-beta2 to 1.0.0-beta3

13

doc/00 Guides/0 Overview.md

@@ -29,3 +29,3 @@ To illustrate the problems React Router is going to solve for you, let’s build a

var Child;
switch (this.props.route) {
switch (this.state.route) {
case '/about': Child = About; break;

@@ -113,5 +113,5 @@ case '/inbox': Child = Inbox; break;

// first we import some components
import { Router, Route } from 'react-router';
import { Router, Route, Link } from 'react-router';
// the histories are imported separately for smaller builds
import HashHistory from 'react-router/lib/HashHistory';
import { history } from 'react-router/lib/HashHistory';

@@ -146,3 +146,3 @@ // ...

React.render((
<Router history={HashHistory}>
<Router history={history}>
<Route path="/" component={App}>

@@ -168,3 +168,3 @@ <Route path="about" component={About}/>

React.render(<Router history={HashHistory} children={routes}/>, document.body):
React.render(<Router history={history} children={routes}/>, document.body);
```

@@ -198,3 +198,3 @@

React.render((
<Router history={HashHistory}>
<Router history={history}>
<Route component={App}>

@@ -238,2 +238,1 @@ <Route path="about" component={About}/>

URL.

@@ -68,3 +68,3 @@ React Router is great for small sites like [React.js

[t]:http://twitter.com
[huge]:#TODO
[huge]:/examples/huge-apps

@@ -28,3 +28,4 @@ Rendering on the server is not much different than rendering in the

// server.js
import { Router, Location } from 'react-router';
import Router from 'react-router';
import Location from 'react-router/lib/Location';
import routes from './routes';

@@ -42,3 +43,3 @@

var html = React.renderToString(
<Router history={history} {...initialState}/>
<Router {...initialState}/>
);

@@ -45,0 +46,0 @@ res.send(renderFullPage(html, initialData));

@@ -62,3 +62,3 @@ A `Route` is used to declaratively map routes to your application's

// So with the router its looks like this:
// So with the router it looks like this:
var routes = (

@@ -65,0 +65,0 @@ <Route component={App}>

@@ -10,9 +10,9 @@ The primary way to allow users to navigate around your application.

### `href`
### `to`
The path to link to, ie `/users/123`.
The path to link to, e.g., `/users/123`.
### `query`
An object of key:value pairs to be stingified.
An object of key:value pairs to be stringified.

@@ -19,0 +19,0 @@ ### `activeClassName`

@@ -6,4 +6,4 @@ `Router` sets up a `History` and updates `Router` state when the

```js
import History from 'react-router/lib/BrowserHistory';
<Router history={History}/>
import { history } from 'react-router/lib/BrowserHistory';
<Router history={history}/>
```

@@ -10,0 +10,0 @@

@@ -46,6 +46,6 @@ `BrowserHistory` is a [history][Histories] implementation for DOM environments that

import { Router } from 'react-router';
import BrowserHistory from 'react-router/lib/BrowserHistory';
import { history } from 'react-router/lib/BrowserHistory';
React.render((
<Router history={new BrowserHistory}>
<Router history={ history }>
{/* ... */}

@@ -57,2 +57,1 @@ </Router>

[Histories]:#TODO

@@ -36,6 +36,6 @@ `HashHistory` is a [history][Histories] implementation for DOM environments that

import { Router } from 'react-router';
import HashHistory from 'react-router/lib/HashHistory';
import { history } from 'react-router/lib/HashHistory';
React.render((
<Router history={new HashHistory}>
<Router history={history}>
{/* ... */}

@@ -65,2 +65,1 @@ </Router>

[Histories]:#TODO

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

} else {
window.removeEvent('onpopstate', this.handlePopState);
window.detachEvent('onpopstate', this.handlePopState);
}

@@ -133,3 +133,4 @@ }

exports['default'] = BrowserHistory;
module.exports = exports['default'];
var history = new BrowserHistory();
exports.history = history;
exports['default'] = BrowserHistory;

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

function getHashPath() {
return decodeURI(
// We can't use window.location.hash here because it's not
// consistent across browsers - Firefox will pre-decode it!
window.location.href.split('#')[1] || '');
return window.location.href.split('#')[1] || '';
}

@@ -27,3 +26,3 @@

function getWindowPath() {
return decodeURI(window.location.pathname + window.location.search);
return window.location.pathname + window.location.search;
}

@@ -30,0 +29,0 @@

@@ -7,2 +7,4 @@ 'use strict';

exports._clearCacheForTesting = _clearCacheForTesting;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

@@ -14,14 +16,169 @@

var _invariant = require('invariant');
var _invariant2 = _interopRequireDefault(_invariant);
var _React$PropTypes = _react2['default'].PropTypes;
var func = _React$PropTypes.func;
var array = _React$PropTypes.array;
var shape = _React$PropTypes.shape;
var object = _React$PropTypes.object;
var contextTypes = {
asyncProps: shape({
reloadComponent: func,
propsArray: array,
componentsArray: array
})
};
var _serverPropsArray = null;
function setServerPropsArray(array) {
(0, _invariant2['default'])(!_serverPropsArray, 'You cannot call AsyncProps.hydrate more than once');
_serverPropsArray = array;
}
function _clearCacheForTesting() {
_serverPropsArray = null;
}
function hydrate(routerState, cb) {
var components = routerState.components;
var params = routerState.params;
var flatComponents = filterAndFlattenComponents(components);
_loadAsyncProps(flatComponents, params, cb);
}
function eachComponents(components, iterator) {
for (var i = 0, l = components.length; i < l; i++) {
if (typeof components[i] === 'object') {
for (var key in components[i]) {
iterator(components[i][key], i, key);
}
} else {
iterator(components[i], i);
}
}
}
function filterAndFlattenComponents(components) {
var flattened = [];
eachComponents(components, function (Component) {
if (Component.loadProps) flattened.push(Component);
});
return flattened;
}
function _loadAsyncProps(components, params, cb) {
var propsArray = [];
var componentsArray = [];
var canceled = false;
var needToLoadCounter = components.length;
components.forEach(function (Component, index) {
Component.loadProps(params, function (error, props) {
needToLoadCounter--;
propsArray[index] = props;
componentsArray[index] = Component;
maybeFinish();
});
});
function maybeFinish() {
if (canceled === false && needToLoadCounter === 0) cb(null, { propsArray: propsArray, componentsArray: componentsArray });
}
return {
cancel: function cancel() {
canceled = true;
}
};
}
function getPropsForComponent(Component, componentsArray, propsArray) {
var index = componentsArray.indexOf(Component);
return propsArray[index];
}
function mergeAsyncProps(current, changes) {
for (var i = 0, l = changes.propsArray.length; i < l; i++) {
var Component = changes.componentsArray[i];
var position = current.componentsArray.indexOf(Component);
var isNew = position === -1;
if (isNew) {
current.propsArray.push(changes.propsArray[i]);
current.componentsArray.push(changes.componentsArray[i]);
} else {
current.propsArray[position] = changes.propsArray[i];
}
}
}
function arrayDiff(previous, next) {
var diff = [];
for (var i = 0, l = next.length; i < l; i++) if (previous.indexOf(next[i]) === -1) diff.push(next[i]);
return diff;
}
function shallowEqual(a, b) {
var key;
var ka = 0;
var kb = 0;
for (var key in a) {
for (key in a) {
if (a.hasOwnProperty(key) && a[key] !== b[key]) return false;
ka++;
}
for (var key in b) {
if (b.hasOwnProperty(key)) kb++;
}return ka === kb;
for (key in b) if (b.hasOwnProperty(key)) kb++;
return ka === kb;
}
var RouteComponentWrapper = _react2['default'].createClass({
displayName: 'RouteComponentWrapper',
contextTypes: contextTypes,
// this is here to meet the case of reloading the props when a component's params change,
// the place we know that is here, but the problem is we get occasional waterfall loads
// when clicking links quickly at the same route, AsyncProps doesn't know to load the next
// props until the previous finishes rendering.
//
// if we could tell that a component needs its props reloaded in AsyncProps instead of here
// (by the arrayDiff stuff in componentWillReceiveProps) then we wouldn't need this code at
// all, and we coudl get rid of the terrible forceUpdate hack as well. I'm just not sure
// right now if we can know to reload a pivot transition.
componentWillReceiveProps: function componentWillReceiveProps(nextProps, context) {
var paramsChanged = !shallowEqual(this.props.routerState.routeParams, nextProps.routerState.routeParams);
if (paramsChanged) {
this.reloadProps(nextProps.routerState.routeParams);
}
},
reloadProps: function reloadProps(params) {
this.context.asyncProps.reloadComponent(this.props.Component, params || this.props.routerState.routeParams, this);
},
render: function render() {
var _props = this.props;
var Component = _props.Component;
var routerState = _props.routerState;
var _context$asyncProps = this.context.asyncProps;
var componentsArray = _context$asyncProps.componentsArray;
var propsArray = _context$asyncProps.propsArray;
var loading = _context$asyncProps.loading;
var asyncProps = getPropsForComponent(Component, componentsArray, propsArray);
return _react2['default'].createElement(Component, _extends({}, routerState, asyncProps, { loading: loading, reloadAsyncProps: this.reloadProps }));
}
});
var AsyncProps = _react2['default'].createClass({

@@ -31,13 +188,29 @@ displayName: 'AsyncProps',

statics: {
hydrate: hydrate,
rehydrate: setServerPropsArray,
createElement: function createElement(Component, state) {
return Component.loadProps ? _react2['default'].createElement(AsyncProps, { Component: Component, routing: state }) : _react2['default'].createElement(Component, state);
return typeof Component.loadProps === 'function' ? _react2['default'].createElement(RouteComponentWrapper, { Component: Component, routerState: state }) : _react2['default'].createElement(Component, state);
}
},
childContextTypes: contextTypes,
getChildContext: function getChildContext() {
return {
asyncProps: _extends({
reloadComponent: this.reloadComponent,
loading: this.state.previousProps !== null
}, this.state.asyncProps) };
},
getInitialState: function getInitialState() {
return {
propsAreLoading: false,
propsAreLoadingLong: false,
asyncProps: null,
previousRoutingState: null
asyncProps: {
propsArray: _serverPropsArray,
componentsArray: _serverPropsArray ? filterAndFlattenComponents(this.props.components) : null },
previousProps: null
};

@@ -47,59 +220,52 @@ },

componentDidMount: function componentDidMount() {
this.load(this.props);
var _this = this;
var initialLoad = this.state.asyncProps.propsArray === null;
if (initialLoad) {
hydrate(this.props, function (err, asyncProps) {
_this.setState({ asyncProps: asyncProps });
});
}
},
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
var _this = this;
var routerTransitioned = nextProps.location !== this.props.location;
var needToLoad = !shallowEqual(nextProps.routing.routeParams, this.props.routing.routeParams);
if (!routerTransitioned) return;
if (needToLoad) {
var routerTransitioned = nextProps.routing.location !== this.props.routing.location;
var keepPreviousRoutingState = this.state.propsAreLoadingLong && routerTransitioned;
var oldComponents = this.props.components;
var newComponents = nextProps.components;
if (keepPreviousRoutingState) {
this.load(nextProps);
} else {
this.setState({
previousRoutingState: this.props.routing
}, function () {
return _this.load(nextProps);
});
}
}
var components = arrayDiff(filterAndFlattenComponents(oldComponents), filterAndFlattenComponents(newComponents));
if (components.length === 0) return;
this.loadAsyncProps(components, nextProps.params);
},
/*
* Could make this method much better, right now AsyncProps doesn't render its
* children until it fetches data, causing a "waterfall" effect, when instead
* it could look at the branch of components from it down to the end and load
* up the props for all of them in parallel, waterfall will do for now...
*/
load: function load(props) {
var _this2 = this;
beforeLoad: function beforeLoad(cb) {
this.setState({
previousProps: this.props
}, cb);
},
var lastLoadTime = this._lastLoadTime = Date.now();
var params = props.routing.params;
var Component = this.props.Component;
afterLoad: function afterLoad(err, asyncProps, cb) {
this.inflightLoader = null;
mergeAsyncProps(this.state.asyncProps, asyncProps);
this.setState({
previousProps: null,
asyncProps: this.state.asyncProps
}, cb);
},
this.setState({ propsAreLoading: true }, function () {
var longLoadTimer = setTimeout(function () {
_this2.setState({ propsAreLoadingLong: true });
}, 300);
loadAsyncProps: function loadAsyncProps(components, params, cb) {
var _this2 = this;
// TODO: handle `error`s
Component.loadProps(params, function (error, asyncProps) {
clearTimeout(longLoadTimer);
if (this.inflightLoader) {
this.inflightLoader.cancel();
}
// if the router transitions between now and when the callback runs we will
// ignore it to prevent setting state w/ the wrong data (earlier calls to
// load that call back later than later calls to load)
if (_this2._lastLoadTime !== lastLoadTime || !_this2.isMounted()) return;
_this2.setState({
propsAreLoading: false,
propsAreLoadingLong: false,
asyncProps: asyncProps,
previousRoutingState: null
});
this.beforeLoad(function () {
_this2.inflightLoader = _loadAsyncProps(components, params, function (err, asyncProps) {
_this2.afterLoad(err, asyncProps, cb);
});

@@ -109,26 +275,24 @@ });

reloadComponent: function reloadComponent(Component, params, instance) {
this.loadAsyncProps([Component], params, function () {
// gotta fix this hack ... change in context doesn't cause the
// RouteComponentWrappers to rerender (first one will because
// of cloneElement)
if (instance.isMounted()) instance.forceUpdate();
});
},
render: function render() {
var _this3 = this;
var Component = this.props.Component;
var route = this.props.route;
var _state = this.state;
var asyncProps = _state.asyncProps;
var propsAreLoading = _state.propsAreLoading;
var propsAreLoadingLong = _state.propsAreLoadingLong;
var previousProps = _state.previousProps;
var routing = this.state.previousRoutingState || this.props.routing;
var initialLoad = asyncProps.propsArray === null;
if (this.state.asyncProps === null) return Component.Loader ? _react2['default'].createElement(Component.Loader, routing) : null;
if (initialLoad) return route.renderInitialLoad ? route.renderInitialLoad() : null;else if (previousProps) return _react2['default'].cloneElement(previousProps.children, { loading: true });else return this.props.children;
}
return _react2['default'].createElement(Component, _extends({
onPropsDidChange: function () {
return _this3.load(_this3.props);
},
propsAreLoading: propsAreLoading,
propsAreLoadingLong: propsAreLoadingLong
}, routing, asyncProps));
}
});
exports['default'] = AsyncProps;
module.exports = exports['default'];
exports['default'] = AsyncProps;

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

} else {
window.removeEvent('onhashchange', this.handleHashChange);
window.detachEvent('onhashchange', this.handleHashChange);
}

@@ -184,4 +184,4 @@ }

HashHistory.prototype.makeHref = function makeHref(pathname, query) {
return '#' + _DOMHistory.prototype.makeHref.call(this, pathname, query);
HashHistory.prototype.makeHref = function makeHref(path) {
return '#' + path;
};

@@ -192,5 +192,6 @@

var history = new HashHistory();
exports.history = history;
exports['default'] = HashHistory;
module.exports = exports['default'];
// Ignore invalid JSON in session storage.

@@ -37,8 +37,8 @@ 'use strict';

*
* <Link to="showPost" params={{ postID: "123" }} />
* <Link to={`/posts/${post.id}`} />
*
* In addition to params, links may pass along query string parameters
* Links may pass along query string parameters
* using the `query` prop.
*
* <Link to="showPost" params={{ postID: "123" }} query={{ show:true }}/>
* <Link to="/posts/123" query={{ show:true }}/>
*/

@@ -97,5 +97,5 @@ var Link = _react2['default'].createClass({

if (router && router.isActive(to, query)) {
if (props.activeClassName) props.className += ' ' + props.activeClassName;
if (props.activeClassName) props.className += props.className !== '' ? ' ' + props.activeClassName : props.activeClassName;
if (props.activeStyle) _extends(props.style, props.activeStyle);
if (props.activeStyle) props.style = _extends({}, props.style, props.activeStyle);
}

@@ -102,0 +102,0 @@

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

_this.handleAbort(reason);
_this.handleAbort(transition.abortReason);
}

@@ -292,7 +292,5 @@ } else if (state == null) {

var _state = this.state;
var location = _state.location;
var branch = _state.branch;
var params = _state.params;
var components = _state.components;
var isTransitioning = _state.isTransitioning;

@@ -307,3 +305,3 @@ var element = null;

var routeParams = (0, _RoutingUtils.getRouteParams)(route, params);
var props = { location: location, params: params, route: route, routeParams: routeParams, isTransitioning: isTransitioning };
var props = _extends({}, _this2.state, { route: route, routeParams: routeParams });

@@ -310,0 +308,0 @@ if ((0, _react.isValidElement)(element)) {

@@ -81,3 +81,8 @@ 'use strict';

makeHref: function makeHref(pathname, query) {
return this.makePath(pathname, query);
var path = this.makePath(pathname, query);
var history = this.props.history;
if (history && history.makeHref) return history.makeHref(path);
return path;
},

@@ -84,0 +89,0 @@

@@ -31,2 +31,7 @@ 'use strict';

// When an onEnter hook uses transition.to to redirect
// on the initial load prevLocation is null, so assume
// we don't want to update the scroll position.
if (prevLocation === null) return false;
// Don't update scroll position if only the query has changed.

@@ -78,3 +83,3 @@ if (location.pathname === prevLocation.pathname) return false;

if (scrollX != null && scrollY != null) this.props.updateScrollPosition(location.navigationType, scrollX, scrollY);
this.props.updateScrollPosition(location.navigationType, scrollX || 0, scrollY || 0);
}

@@ -81,0 +86,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;var o=n(17),i=r(o);e.Router=i["default"];var a=n(13),s=r(a);e.Link=s["default"];var u=n(15),c=r(u);e.Redirect=c["default"];var l=n(16),f=r(l);e.Route=f["default"];var p=n(14),d=r(p);e.Navigation=d["default"];var h=n(23),m=r(h);e.TransitionHook=m["default"];var y=n(21),g=r(y);e.State=g["default"];var v=n(3);e.createRoutesFromReactChildren=v.createRoutesFromReactChildren;var R=n(4),_=r(R);e.PropTypes=_["default"];var b=r(o);e["default"]=b["default"]},function(e){e.exports=t},function(t){"use strict";var e=function(t,e,n,r,o,i,a,s){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 c=[n,r,o,i,a,s],l=0;u=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return c[l++]}))}throw u.framesToPop=1,u}};t.exports=e},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){return null==t||f.isValidElement(t)}function i(t){return o(t)||Array.isArray(t)&&t.every(o)}function a(t,e,n){t=t||"UnknownComponent";for(var r in e)if(e.hasOwnProperty(r)){var o=e[r](n,r,t);o instanceof Error&&h["default"](!1,o.message)}}function s(t){var e=t.type,n=l({},e.defaultProps,t.props);return e.propTypes&&a(e.displayName||e.name,e.propTypes,n),n.children&&(n.childRoutes=u(n.children),delete n.children),n}function u(t){var e=[];return p["default"].Children.forEach(t,function(t){f.isValidElement(t)&&e.push(t.type.createRouteFromReactElement?t.type.createRouteFromReactElement(t):s(t))}),e}function c(t){return i(t)?t=u(t):Array.isArray(t)||(t=[t]),t}e.__esModule=!0;var l=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};e.isReactChildren=i,e.createRouteFromReactElement=s,e.createRoutesFromReactChildren=u,e.createRoutes=c;var f=n(1),p=r(f),d=n(6),h=r(d)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,n){return t[e]?new Error("<"+n+'> should not have a "'+e+'" prop'):void 0}var i=n(1),a=r(i),s=n(7),u=r(s),c=n(12),l=r(c),f=a["default"].PropTypes,p=f.func,d=f.object,h=f.arrayOf,m=f.instanceOf,y=f.oneOfType,g=f.element,v=p,R=y([v,d]),_=m(l["default"]),b=m(u["default"]),x=y([d,g]),w=y([x,h(x)]);t.exports={falsy:o,component:v,components:R,history:_,location:b,route:x,routes:w}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){return g["default"].stringify(t,{arrayFormat:"brackets"})}function i(t){return t.replace(b,"")}function a(t){var e=t.match(b);return e?e[1]:""}function s(t){return t?t.replace(/^\/+/,""):""}function u(t){return"string"==typeof t&&"/"===t.charAt(0)}function c(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function l(t){return c(t).replace(/\/+/g,"/+")}function f(t){for(var e,n="",r=[],o=[],i=0,a=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*|\(|\)/g;e=a.exec(t);)e.index!==i&&(o.push(t.slice(i,e.index)),n+=l(t.slice(i,e.index))),e[1]?(n+="([^/?#]+)",r.push(e[1])):"*"===e[0]?(n+="(.*?)",r.push("splat")):"("===e[0]?n+="(?:":")"===e[0]&&(n+=")?"),o.push(e[0]),i=a.lastIndex;return i!==t.length&&(o.push(t.slice(i,t.length)),n+=l(t.slice(i,t.length))),{pattern:t,regexpSource:n,paramNames:r,tokens:o}}function p(t){return t in x||(x[t]=f(t)),x[t]}function d(t,e){var n=p(s(t)),r=n.regexpSource,o=n.paramNames,i=n.tokens;r+="/*";var a="*"!==i[i.length-1];a&&(r+="(.*?)");var u,c,l=e.match(new RegExp("^"+r+"$","i"));return null!=l&&(c=Array.prototype.slice.call(l,1),u=a?c.pop():e.replace(l[0],"")),{remainingPathname:u,paramNames:o,paramValues:c}}function h(t){return p(t).paramNames}function m(t,e){e=e||{};for(var n,r,o,i=p(t),a=i.tokens,s=0,u="",c=0,l=0,f=a.length;f>l;++l)n=a[l],"*"===n?(o=Array.isArray(e.splat)?e.splat[c++]:e.splat,R["default"](null!=o||s>0,'Missing splat #%s for path "%s"',c,t),null!=o&&(u+=o)):"("===n?s+=1:")"===n?s-=1:":"===n.charAt(0)?(r=n.substring(1),o=e[r],R["default"](null!=o||s>0,'Missing "%s" parameter for path "%s"',r,t),null!=o&&(u+=o)):u+=n;return u.replace(/\/+/g,"/")}e.__esModule=!0,e.stringifyQuery=o,e.getPathname=i,e.getQueryString=a,e.stripLeadingSlashes=s,e.isAbsolutePath=u,e.compilePattern=p,e.matchPattern=d,e.getParamNames=h,e.formatPattern=m;var y=n(25),g=r(y),v=n(2),R=r(v),_=g["default"].parse;e.parseQueryString=_;var b=/\?(.*)$/,x={}},function(t){"use strict";var e=!1,n=function(){};e&&(n=function(t,e,n){var r=arguments.length;n=new Array(r>2?r-2:0);for(var o=2;r>o;o++)n[o-2]=arguments[o];if(void 0===e)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(e.length<10||/^[s\W]*$/.test(e))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+e);if(!t){var i=0,a="Warning: "+e.replace(/%s/g,function(){n[i++]});"undefined"!=typeof console&&console.error(a);try{throw new Error(a)}catch(s){}}}),t.exports=n},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")}e.__esModule=!0;var i=n(9),a=r(i),s=function(){function t(){var e=void 0===arguments[0]?"/":arguments[0],n=void 0===arguments[1]?null:arguments[1],r=void 0===arguments[2]?null:arguments[2],i=void 0===arguments[3]?a["default"].POP:arguments[3];o(this,t),this.pathname=e,this.query=n,this.state=r,this.navigationType=i}return t.isLocation=function(e){return e instanceof t},t}();e["default"]=s,t.exports=e["default"]},function(t,e){"use strict";function n(t,e,n){function r(){a=!0,n.apply(this,arguments)}function o(){a||(t>i?(i+=1,e.call(this,i-1,o,r)):r.apply(this,arguments))}var i=0,a=!1;o()}function r(t,e,n){function r(t,e,r){a||(e?(a=!0,n(e)):(i[t]=r,a=++s===o,a&&n(null,i)))}var o=t.length,i=[];if(0===o)return n(null,i);var a=!1,s=0;t.forEach(function(t,n){e(t,n,function(t,e){r(n,t,e)})})}function o(t,e,n){var o=Object.keys(t);r(o,function(n,r,o){e(t[n],o)},function(t,e){if(t)n(t);else{var r=e.reduce(function(t,e,n){return t[o[n]]=e,t},{});n(null,r)}})}e.__esModule=!0,e.loopAsync=n,e.mapAsync=r,e.hashAsync=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(24),i=r(o),a=i["default"]({PUSH:null,REPLACE:null,POP:null});e["default"]=a,t.exports=e["default"]},function(t,e){e.arrayToObject=function(t){for(var e={},n=0,r=t.length;r>n;++n)"undefined"!=typeof t[n]&&(e[n]=t[n]);return e},e.merge=function(t,n){if(!n)return t;if("object"!=typeof n)return Array.isArray(t)?t.push(n):t[n]=!0,t;if("object"!=typeof t)return t=[t].concat(n);Array.isArray(t)&&!Array.isArray(n)&&(t=e.arrayToObject(t));for(var r=Object.keys(n),o=0,i=r.length;i>o;++o){var a=r[o],s=n[a];t[a]=t[a]?e.merge(t[a],s):s}return t},e.decode=function(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t}},e.compact=function(t,n){if("object"!=typeof t||null===t)return t;n=n||[];var r=n.indexOf(t);if(-1!==r)return n[r];if(n.push(t),Array.isArray(t)){for(var o=[],i=0,a=t.length;a>i;++i)"undefined"!=typeof t[i]&&o.push(t[i]);return o}var s=Object.keys(t);for(i=0,a=s.length;a>i;++i){var u=s[i];t[u]=e.compact(t[u],n)}return t},e.isRegExp=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},e.isBuffer=function(t){return null===t||"undefined"==typeof t?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}},function(t,e){"use strict";function n(){return decodeURI(window.location.href.split("#")[1]||"")}function r(t){window.location.replace(window.location.pathname+window.location.search+"#"+t)}function o(){return decodeURI(window.location.pathname+window.location.search)}function i(){return{scrollX:window.pageXOffset||document.documentElement.scrollLeft,scrollY:window.pageYOffset||document.documentElement.scrollTop}}function a(t,e){window.scrollTo(t,e)}function s(){var t=navigator.userAgent;return-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone")?window.history&&"pushState"in window.history:!1}e.__esModule=!0,e.getHashPath=n,e.replaceHashPath=r,e.getWindowPath=o,e.getWindowScrollPosition=i,e.setWindowScrollPosition=a,e.supportsHistory=s;var u=!("undefined"==typeof window||!window.document||!window.document.createElement);e.canUseDOM=u},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(){return Math.random().toString(36).substr(2)}e.__esModule=!0;var a=n(2),s=r(a),u=n(5),c=n(7),l=r(c),f=["pushState","replaceState","go"],p=function(){function t(){var e=void 0===arguments[0]?{}:arguments[0];o(this,t),f.forEach(function(t){s["default"]("function"==typeof this[t],'%s needs a "%s" method',this.constructor.name,t)},this),this.parseQueryString=e.parseQueryString||u.parseQueryString,this.changeListeners=[],this.location=null}return t.prototype._notifyChange=function(){for(var t=0,e=this.changeListeners.length;e>t;++t)this.changeListeners[t].call(this)},t.prototype.addChangeListener=function(t){this.changeListeners.push(t)},t.prototype.removeChangeListener=function(t){this.changeListeners=this.changeListeners.filter(function(e){return e!==t})},t.prototype.back=function(){this.go(-1)},t.prototype.forward=function(){this.go(1)},t.prototype._createState=function(t){return t=t||{},t.key||(t.key=i()),t},t.prototype.createLocation=function(t,e,n){var r=u.getPathname(t),o=u.getQueryString(t),i=o?this.parseQueryString(o):null;return new l["default"](r,i,e,n)},t}();e["default"]=p,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){return 0===t.button}function i(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}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},s=n(1),u=r(s),c=u["default"].PropTypes,l=c.object,f=c.string,p=c.func,d=u["default"].createClass({displayName:"Link",contextTypes:{router:l},propTypes:{activeStyle:l,activeClassName:f,to:f.isRequired,query:l,state:l,onClick:p},getDefaultProps:function(){return{className:"",activeClassName:"active",style:{}}},handleClick:function(t){var e,n=!0;this.props.onClick&&(e=this.props.onClick(t)),!i(t)&&o(t)&&((e===!1||t.defaultPrevented===!0)&&(n=!1),t.preventDefault(),n&&this.context.router.transitionTo(this.props.to,this.props.query,this.props.state))},render:function(){var t=this.context.router,e=this.props,n=e.to,r=e.query,o=a({},this.props,{href:t.makeHref(n,r),onClick:this.handleClick});return t&&t.isActive(n,r)&&(o.activeClassName&&(o.className+=" "+o.activeClassName),o.activeStyle&&a(o.style,o.activeStyle)),u["default"].createElement("a",o)}});e.Link=d,e["default"]=d},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(1),i=r(o),a=i["default"].PropTypes.object,s={contextTypes:{router:a.isRequired}},u=["makePath","makeHref","transitionTo","replaceWith","go","goBack","goForward"];u.forEach(function(t){s[t]=function(){var e=this.context.router;return e[t].apply(e,arguments)}}),e["default"]=s,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(1),i=r(o),a=n(2),s=r(a),u=n(3),c=n(5),l=n(4),f=i["default"].PropTypes,p=f.string,d=f.object,h=i["default"].createClass({displayName:"Redirect",statics:{createRouteFromReactElement:function(t){var e=u.createRouteFromReactElement(t);return e.from&&(e.path=e.from),e.onEnter=function(t,n){var r=t.location,o=t.params,i=e.to?c.formatPattern(e.to,o):r.pathname;n.to(i,e.query||r.query,e.state||r.state)},e}},propTypes:{path:p,from:p,to:p.isRequired,query:d,state:d,onEnter:l.falsy,children:l.falsy},render:function(){s["default"](!1,"<Redirect> elements are for router configuration only and should not be rendered")}});e.Redirect=h,e["default"]=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(1),i=r(o),a=n(2),s=r(a),u=n(3),c=n(4),l=n(6),f=r(l),p=i["default"].PropTypes,d=p.string,h=p.bool,m=p.func,y=i["default"].createClass({displayName:"Route",statics:{createRouteFromReactElement:function(t){var e=u.createRouteFromReactElement(t);return e.handler&&(f["default"](!1,"<Route handler> is deprecated, use <Route component> instead"),e.component=e.handler,delete e.handler),e}},propTypes:{path:d,ignoreScrollBehavior:h,handler:c.component,component:c.component,components:c.components,getComponents:m},render:function(){s["default"](!1,"<Route> elements are for router configuration only and should not be rendered")}});e.Route=y,e["default"]=y},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,n,r,o){var i=new x["default"];h.getState(e,n,function(e,a){if(e||null==a||i.isCancelled)o(e,null,i);else{a.location=n;var s=h.getTransitionHooks(t,a);Array.isArray(r)&&s.unshift.apply(s,r),p.loopAsync(s.length,function(t,e,n){s[t](a,i,function(t){t||i.isCancelled?n(t):e()})},function(t){t||i.isCancelled?o(t,null,i):h.getComponents(a.branch,function(t,e){t||i.isCancelled?o(t,null,i):(a.components=e,o(null,a,i))})})}})}e.__esModule=!0;var i=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},a=n(1),s=r(a),u=n(6),c=r(u),l=n(2),f=r(l),p=n(8),d=n(3),h=n(19),m=n(4),y=n(18),g=r(y),v=n(20),R=r(v),_=n(7),b=n(22),x=r(b),w=s["default"].PropTypes,P=w.arrayOf,O=w.func,C=w.object,T=s["default"].createClass({displayName:"Router",mixins:[g["default"],R["default"]],statics:{run:function(t,e,n,r){"function"==typeof n&&(r=n,n=null),f["default"]("function"==typeof r,"Router.run needs a callback"),o(null,t,e,n,r)}},propTypes:{createElement:O.isRequired,onAbort:O,onError:O,onUpdate:O,history:m.history,routes:m.routes,children:m.routes,location:m.location,branch:m.routes,params:C,components:P(m.components)},getDefaultProps:function(){return{createElement:a.createElement}},getInitialState:function(){return{isTransitioning:!1,location:null,branch:null,params:null,components:null}},_updateState:function(t){var e=this;f["default"](_.isLocation(t),"A <Router> needs a valid Location");var n=this.transitionHooks;n&&(n=n.map(function(t){return h.createTransitionHook(t,e)})),this.setState({isTransitioning:!0}),o(this.state,this.routes,t,n,function(n,r,o){if(n)e.handleError(n);else if(o.isCancelled)if(o.redirectInfo){var i=o.redirectInfo,a=i.pathname,s=i.query,r=i.state;e.replaceWith(a,s,r)}else f["default"](e.state.location,"You may not abort the initial transition"),e.handleAbort(reason);else null==r?c["default"](!1,'Location "%s" did not match any routes',t.pathname):e.setState(r,e.props.onUpdate);e.setState({isTransitioning:!1})})},addTransitionHook:function(t){this.transitionHooks||(this.transitionHooks=[]),this.transitionHooks.push(t)},removeTransitionHook:function(t){this.transitionHooks&&(this.transitionHooks=this.transitionHooks.filter(function(e){return e!==t}))},handleAbort:function(t){this.props.onAbort?this.props.onAbort.call(this,t):(this._ignoreNextHistoryChange=!0,this.goBack())},handleError:function(t){if(!this.props.onError)throw t;this.props.onError.call(this,t)},handleHistoryChange:function(){this._ignoreNextHistoryChange?this._ignoreNextHistoryChange=!1:this._updateState(this.props.history.location)},componentWillMount:function(){var t=this.props,e=t.history,n=t.routes,r=t.children,o=t.location,i=t.branch,a=t.params,s=t.components;e?(f["default"](n||r,"Client-side <Router>s need routes. Try using <Router routes> or passing your routes as nested <Route> children"),this.routes=d.createRoutes(n||r),"function"==typeof e.setup&&e.setup(),e.addChangeListener&&e.addChangeListener(this.handleHistoryChange),this._updateState(e.location)):(f["default"](o&&i&&a&&s,"Server-side <Router>s need location, branch, params, and components props. Try using Router.run to get all the props you need"),this.setState({location:o,branch:i,params:a,components:s}))},componentWillReceiveProps:function(t){if(f["default"](this.props.history===t.history,"<Router history> may not be changed"),t.history){var e=this.props.routes||this.props.children,n=t.routes||t.children;e!==n&&(this.routes=d.createRoutes(n),t.history.location&&this._updateState(t.history.location))}},componentWillUnmount:function(){var t=this.props.history;t&&t.removeChangeListener&&t.removeChangeListener(this.handleHistoryChange)},_createElement:function(t,e){return"function"==typeof t?this.props.createElement(t,e):null},render:function(){var t=this,e=this.state,n=e.location,r=e.branch,o=e.params,s=e.components,u=e.isTransitioning,c=null;return s&&(c=s.reduceRight(function(e,s,c){if(null==s)return e;var l=r[c],f=h.getRouteParams(l,o),p={location:n,params:o,route:l,routeParams:f,isTransitioning:u};if(a.isValidElement(e)?p.children=e:e&&i(p,e),"object"==typeof s){var d={};for(var m in s)s.hasOwnProperty(m)&&(d[m]=t._createElement(s[m],p));return d}return t._createElement(s,p)},c)),f["default"](null===c||c===!1||a.isValidElement(c),"The root route must render a single element"),c}});e["default"]=T,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){return 0===l.stripLeadingSlashes(e).indexOf(l.stripLeadingSlashes(t))?!0:!1}function i(t,e){if(null==e)return null==t;if(null==t)return!0;for(var n in t)if(t.hasOwnProperty(n)&&String(t[n])!==String(e[n]))return!1;return!0}e.__esModule=!0;var a=n(1),s=r(a),u=n(2),c=r(u),l=n(5),f=s["default"].PropTypes,p=f.func,d=f.object,h={propTypes:{stringifyQuery:p.isRequired},getDefaultProps:function(){return{stringifyQuery:l.stringifyQuery}},childContextTypes:{router:d.isRequired},getChildContext:function(){return{router:this}},makePath:function(t,e){return e&&("string"!=typeof e&&(e=this.props.stringifyQuery(e)),""!==e)?t+"?"+e:t},makeHref:function(t,e){return this.makePath(t,e)},transitionTo:function(t,e){var n=void 0===arguments[2]?null:arguments[2],r=this.props.history;c["default"](r,"Router#transitionTo is client-side only (needs history)"),r.pushState(n,this.makePath(t,e))},replaceWith:function(t,e){var n=void 0===arguments[2]?null:arguments[2],r=this.props.history;c["default"](r,"Router#replaceWith is client-side only (needs history)"),r.replaceState(n,this.makePath(t,e))},go:function(t){var e=this.props.history;c["default"](e,"Router#go is client-side only (needs history)"),e.go(t)},goBack:function(){this.go(-1)},goForward:function(){this.go(1)},isActive:function(t,e){var n=this.state.location;return null==n?!1:o(t,n.pathname)&&i(e,n.query)}};e["default"]=h,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,n){t.childRoutes?n(null,t.childRoutes):t.getChildRoutes?t.getChildRoutes(e,n):n()}function i(t,e,n){t.indexRoute?n(null,t.indexRoute):t.getIndexRoute?t.getIndexRoute(n,e):n()}function a(t,e,n){return e.reduceRight(function(t,e,r){var o=n[r];return Array.isArray(t[e])?t[e].unshift(o):t[e]=e in t?[o,t[e]]:o,t},t)}function s(t,e){return a({},t,e)}function u(t,e,n,r){var u=b.matchPattern(t.path,e),l=u.remainingPathname,f=u.paramNames,p=u.paramValues,d=""===l;if(d&&t.path){var h=s(f,p),m=[t];i(t,n,function(t,e){t?r(t):(e&&m.push(e),r(null,{params:h,branch:m}))})}else null!=l?o(t,n,function(e,o){e?r(e):o?c(o,l,n,function(e,n){e?r(e):n?(a(n.params,f,p),n.branch.unshift(t),r(null,n)):r()}):r()}):r()}function c(t,e,n,r){t=_.createRoutes(t),x.loopAsync(t.length,function(r,o,i){u(t[r],e,n,function(t,e){t||e?i(t,e):o()})},r)}function l(t,e,n){c(t,b.stripLeadingSlashes(e.pathname),e.state,n)}function f(t,e,n){if(!t.path)return!1;var r=b.getParamNames(t.path);return r.some(function(t){return e.params[t]!==n.params[t]})}function p(t,e){var n,r,o=t&&t.branch,i=e.branch;return o?(n=o.filter(function(n){return-1===i.indexOf(n)||f(n,t,e)}),n.reverse(),r=i.filter(function(t){return-1===o.indexOf(t)||-1!==n.indexOf(t)})):(n=[],r=i),[n,r]}function d(t,e){return function(n,r,o){t.length>2?t.call(e,n,r,o):(t.call(e,n,r),o())}}function h(t,e){return t.reduce(function(t,n){return n[e]&&t.push(d(n[e],n)),t},[])}function m(t,e){var n=p(t,e),r=n[0],o=n[1],i=h(r,"onLeave");return i.push.apply(i,h(o,"onEnter")),i}function y(t,e){t.component||t.components?e(null,t.component||t.components):t.getComponents?t.getComponents(e):e()}function g(t,e){x.mapAsync(t,function(t,e,n){y(t,n)},e)}function v(t,e){var n={};if(!t.path)return n;var r=b.getParamNames(t.path);for(var o in e)e.hasOwnProperty(o)&&-1!==r.indexOf(o)&&(n[o]=e[o]);return n}e.__esModule=!0,e.getState=l,e.createTransitionHook=d,e.getTransitionHooks=m,e.getComponents=g,e.getRouteParams=v;var R=n(2),_=(r(R),n(3)),b=n(5),x=n(8)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){return t.filter(function(t){return-1!==e.indexOf(t)})}function i(t,e){var n=t.location,r=t.branch,i=e.location,a=e.branch;if(n.pathname===i.pathname)return!1;var s=o(r,a);return s.some(function(t){return t.ignoreScrollBehavior})?!1:!0}function a(t,e,n){c.canUseDOM&&(t===f["default"].POP?c.setWindowScrollPosition(e,n):c.setWindowScrollPosition(0,0))}e.__esModule=!0;var s=n(1),u=r(s),c=n(11),l=n(9),f=r(l),p=u["default"].PropTypes.func,d={propTypes:{shouldUpdateScrollPosition:p.isRequired,updateScrollPosition:p.isRequired},getDefaultProps:function(){return{shouldUpdateScrollPosition:i,updateScrollPosition:a}},componentDidUpdate:function(t,e){var n=this.state.location,r=n&&n.state;if(r&&this.props.shouldUpdateScrollPosition(this.state,e)){var o=r.scrollX,i=r.scrollY;null!=o&&null!=i&&this.props.updateScrollPosition(n.navigationType,o,i)}}};e["default"]=d,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(1),i=r(o),a=i["default"].PropTypes.object,s={contextTypes:{router:a.isRequired}},u=["isActive"];u.forEach(function(t){s[t]=function(){var e=this.context.router;return e[t].apply(e,arguments)}}),e["default"]=s,t.exports=e["default"]},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var r=function(){function t(){n(this,t),this.isCancelled=!1,this.redirectInfo=null,this.abortReason=null}return t.prototype.to=function(t,e,n){this.redirectInfo={pathname:t,query:e,state:n},this.isCancelled=!0},t.prototype.abort=function(t){this.abortReason=t,this.isCancelled=!0},t}();e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(1),i=r(o),a=n(6),s=r(a),u=i["default"].PropTypes.object,c={contextTypes:{router:u.isRequired},componentDidMount:function(){s["default"]("function"==typeof this.routerWillLeave,"Components that mixin TransitionHook should have a routerWillLeave method, check %s",this.constructor.displayName||this.constructor.name),this.routerWillLeave&&this.context.router.addTransitionHook(this.routerWillLeave)},componentWillUnmount:function(){this.routerWillLeave&&this.context.router.removeTransitionHook(this.routerWillLeave)}};e["default"]=c,t.exports=e["default"]},function(t){"use strict";var e=function(t){var e,n={};if(!(t instanceof Object)||Array.isArray(t))throw new Error("keyMirror(...): Argument must be an object.");for(e in t)t.hasOwnProperty(e)&&(n[e]=e);return n};t.exports=e},function(t,e,n){t.exports=n(26)},function(t,e,n){var r=n(28),o=n(27);t.exports={stringify:r,parse:o}},function(t,e,n){var r=n(10),o={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3};o.parseValues=function(t,e){for(var n={},o=t.split(e.delimiter,1/0===e.parameterLimit?void 0:e.parameterLimit),i=0,a=o.length;a>i;++i){var s=o[i],u=-1===s.indexOf("]=")?s.indexOf("="):s.indexOf("]=")+1;if(-1===u)n[r.decode(s)]="";else{var c=r.decode(s.slice(0,u)),l=r.decode(s.slice(u+1));if(Object.prototype.hasOwnProperty(c))continue;n[c]=n.hasOwnProperty(c)?[].concat(n[c]).concat(l):l}}return n},o.parseObject=function(t,e,n){if(!t.length)return e;var r=t.shift(),i={};if("[]"===r)i=[],i=i.concat(o.parseObject(t,e,n));else{var a="["===r[0]&&"]"===r[r.length-1]?r.slice(1,r.length-1):r,s=parseInt(a,10),u=""+s;!isNaN(s)&&r!==a&&u===a&&s>=0&&s<=n.arrayLimit?(i=[],i[s]=o.parseObject(t,e,n)):i[a]=o.parseObject(t,e,n)}return i},o.parseKeys=function(t,e,n){if(t){var r=/^([^\[\]]*)/,i=/(\[[^\[\]]*\])/g,a=r.exec(t);if(!Object.prototype.hasOwnProperty(a[1])){var s=[];a[1]&&s.push(a[1]);for(var u=0;null!==(a=i.exec(t))&&u<n.depth;)++u,Object.prototype.hasOwnProperty(a[1].replace(/\[|\]/g,""))||s.push(a[1]);return a&&s.push("["+t.slice(a.index)+"]"),o.parseObject(s,e,n)}}},t.exports=function(t,e){if(""===t||null===t||"undefined"==typeof t)return{};e=e||{},e.delimiter="string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:o.delimiter,e.depth="number"==typeof e.depth?e.depth:o.depth,e.arrayLimit="number"==typeof e.arrayLimit?e.arrayLimit:o.arrayLimit,e.parameterLimit="number"==typeof e.parameterLimit?e.parameterLimit:o.parameterLimit;for(var n="string"==typeof t?o.parseValues(t,e):t,i={},a=Object.keys(n),s=0,u=a.length;u>s;++s){var c=a[s],l=o.parseKeys(c,n[c],e);i=r.merge(i,l)}return r.compact(i)}},function(t,e,n){var r=n(10),o={delimiter:"&",arrayPrefixGenerators:{brackets:function(t){return t+"[]"},indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}}};o.stringify=function(t,e,n){if(r.isBuffer(t)?t=t.toString():t instanceof Date?t=t.toISOString():null===t&&(t=""),"string"==typeof t||"number"==typeof t||"boolean"==typeof t)return[encodeURIComponent(e)+"="+encodeURIComponent(t)];var i=[];if("undefined"==typeof t)return i;for(var a=Object.keys(t),s=0,u=a.length;u>s;++s){var c=a[s];i=i.concat(Array.isArray(t)?o.stringify(t[c],n(e,c),n):o.stringify(t[c],e+"["+c+"]",n))}return i},t.exports=function(t,e){e=e||{};var n="undefined"==typeof e.delimiter?o.delimiter:e.delimiter,r=[];if("object"!=typeof t||null===t)return"";var i;i=e.arrayFormat in o.arrayPrefixGenerators?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":"indices";for(var a=o.arrayPrefixGenerators[i],s=Object.keys(t),u=0,c=s.length;c>u;++u){var l=s[u];r=r.concat(o.stringify(t[l],l,a))}return r.join(n)}}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactRouter=t(require("react")):e.ReactRouter=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(17),i=r(o);t.Router=i["default"];var a=n(13),s=r(a);t.Link=s["default"];var u=n(15),c=r(u);t.Redirect=c["default"];var l=n(16),f=r(l);t.Route=f["default"];var p=n(14),d=r(p);t.Navigation=d["default"];var h=n(23),m=r(h);t.TransitionHook=m["default"];var y=n(21),g=r(y);t.State=g["default"];var v=n(3);t.createRoutesFromReactChildren=v.createRoutesFromReactChildren;var R=n(4),b=r(R);t.PropTypes=b["default"];var _=r(o);t["default"]=_["default"]},function(t){t.exports=e},function(e){"use strict";var t=function(e,t,n,r,o,i,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,a,s],l=0;u=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return c[l++]}))}throw u.framesToPop=1,u}};e.exports=t},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return null==e||f.isValidElement(e)}function i(e){return o(e)||Array.isArray(e)&&e.every(o)}function a(e,t,n){e=e||"UnknownComponent";for(var r in t)if(t.hasOwnProperty(r)){var o=t[r](n,r,e);o instanceof Error&&h["default"](!1,o.message)}}function s(e){var t=e.type,n=l({},t.defaultProps,e.props);return t.propTypes&&a(t.displayName||t.name,t.propTypes,n),n.children&&(n.childRoutes=u(n.children),delete n.children),n}function u(e){var t=[];return p["default"].Children.forEach(e,function(e){f.isValidElement(e)&&t.push(e.type.createRouteFromReactElement?e.type.createRouteFromReactElement(e):s(e))}),t}function c(e){return i(e)?e=u(e):Array.isArray(e)||(e=[e]),e}t.__esModule=!0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.isReactChildren=i,t.createRouteFromReactElement=s,t.createRoutesFromReactChildren=u,t.createRoutes=c;var f=n(1),p=r(f),d=n(6),h=r(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){return e[t]?new Error("<"+n+'> should not have a "'+t+'" prop'):void 0}var i=n(1),a=r(i),s=n(7),u=r(s),c=n(12),l=r(c),f=a["default"].PropTypes,p=f.func,d=f.object,h=f.arrayOf,m=f.instanceOf,y=f.oneOfType,g=f.element,v=p,R=y([v,d]),b=m(l["default"]),_=m(u["default"]),x=y([d,g]),P=y([x,h(x)]);e.exports={falsy:o,component:v,components:R,history:b,location:_,route:x,routes:P}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return v["default"].stringify(e,{arrayFormat:"brackets"})}function i(e){return e.replace(x,"")}function a(e){var t=e.match(x);return t?t[1]:""}function s(e){return e?e.replace(/^\/+/,""):""}function u(e){return"string"==typeof e&&"/"===e.charAt(0)}function c(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function l(e){return c(e).replace(/\/+/g,"/+")}function f(e){for(var t,n="",r=[],o=[],i=0,a=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*|\(|\)/g;t=a.exec(e);)t.index!==i&&(o.push(e.slice(i,t.index)),n+=l(e.slice(i,t.index))),t[1]?(n+="([^/?#]+)",r.push(t[1])):"*"===t[0]?(n+="([\\s\\S]*?)",r.push("splat")):"("===t[0]?n+="(?:":")"===t[0]&&(n+=")?"),o.push(t[0]),i=a.lastIndex;return i!==e.length&&(o.push(e.slice(i,e.length)),n+=l(e.slice(i,e.length))),{pattern:e,regexpSource:n,paramNames:r,tokens:o}}function p(e){return e in P||(P[e]=f(e)),P[e]}function d(e,t){var n=p(s(e)),r=n.regexpSource,o=n.paramNames,i=n.tokens;r+="/*";var a="*"!==i[i.length-1];a&&(r+="([\\s\\S]*?)");var u,c,l=t.match(new RegExp("^"+r+"$","i"));return null!=l?(c=Array.prototype.slice.call(l,1).map(function(e){return null!=e?decodeURIComponent(e.replace(/\+/g,"%20")):e}),u=a?c.pop():t.replace(l[0],"")):u=c=null,{remainingPathname:u,paramNames:o,paramValues:c}}function h(e){return p(e).paramNames}function m(e,t){var n=d(e,s(t)),r=n.paramNames,o=n.paramValues;return null!=o?r.reduce(function(e,t,n){return e[t]=o[n],e},{}):null}function y(e,t){t=t||{};for(var n,r,o,i=p(e),a=i.tokens,s=0,u="",c=0,l=0,f=a.length;f>l;++l)n=a[l],"*"===n?(o=Array.isArray(t.splat)?t.splat[c++]:t.splat,b["default"](null!=o||s>0,'Missing splat #%s for path "%s"',c,e),null!=o&&(u+=encodeURI(o).replace(/%20/g,"+"))):"("===n?s+=1:")"===n?s-=1:":"===n.charAt(0)?(r=n.substring(1),o=t[r],b["default"](null!=o||s>0,'Missing "%s" parameter for path "%s"',r,e),null!=o&&(u+=encodeURIComponent(o).replace(/%20/g,"+"))):u+=n;return u.replace(/\/+/g,"/")}t.__esModule=!0,t.stringifyQuery=o,t.getPathname=i,t.getQueryString=a,t.stripLeadingSlashes=s,t.isAbsolutePath=u,t.compilePattern=p,t.matchPattern=d,t.getParamNames=h,t.getParams=m,t.formatPattern=y;var g=n(25),v=r(g),R=n(2),b=r(R),_=v["default"].parse;t.parseQueryString=_;var x=/\?([\s\S]*)$/,P={}},function(e){"use strict";var t=!1,n=function(){};t&&(n=function(e,t,n){var r=arguments.length;n=new Array(r>2?r-2:0);for(var o=2;r>o;o++)n[o-2]=arguments[o];if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(t.length<10||/^[s\W]*$/.test(t))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+t);if(!e){var i=0,a="Warning: "+t.replace(/%s/g,function(){n[i++]});"undefined"!=typeof console&&console.error(a);try{throw new Error(a)}catch(s){}}}),e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=n(9),a=r(i),s=function(){function e(){var t=void 0===arguments[0]?"/":arguments[0],n=void 0===arguments[1]?null:arguments[1],r=void 0===arguments[2]?null:arguments[2],i=void 0===arguments[3]?a["default"].POP:arguments[3];o(this,e),this.pathname=t,this.query=n,this.state=r,this.navigationType=i}return e.isLocation=function(t){return t instanceof e},e}();t["default"]=s,e.exports=t["default"]},function(e,t){"use strict";function n(e,t,n){function r(){a=!0,n.apply(this,arguments)}function o(){a||(e>i?(i+=1,t.call(this,i-1,o,r)):r.apply(this,arguments))}var i=0,a=!1;o()}function r(e,t,n){function r(e,t,r){a||(t?(a=!0,n(t)):(i[e]=r,a=++s===o,a&&n(null,i)))}var o=e.length,i=[];if(0===o)return n(null,i);var a=!1,s=0;e.forEach(function(e,n){t(e,n,function(e,t){r(n,e,t)})})}function o(e,t,n){var o=Object.keys(e);r(o,function(n,r,o){t(e[n],o)},function(e,t){if(e)n(e);else{var r=t.reduce(function(e,t,n){return e[o[n]]=t,e},{});n(null,r)}})}t.__esModule=!0,t.loopAsync=n,t.mapAsync=r,t.hashAsync=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(24),i=r(o),a=i["default"]({PUSH:null,REPLACE:null,POP:null});t["default"]=a,e.exports=t["default"]},function(e,t){t.arrayToObject=function(e){for(var t={},n=0,r=e.length;r>n;++n)"undefined"!=typeof e[n]&&(t[n]=e[n]);return t},t.merge=function(e,n){if(!n)return e;if("object"!=typeof n)return Array.isArray(e)?e.push(n):e[n]=!0,e;if("object"!=typeof e)return e=[e].concat(n);Array.isArray(e)&&!Array.isArray(n)&&(e=t.arrayToObject(e));for(var r=Object.keys(n),o=0,i=r.length;i>o;++o){var a=r[o],s=n[a];e[a]=e[a]?t.merge(e[a],s):s}return e},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.compact=function(e,n){if("object"!=typeof e||null===e)return e;n=n||[];var r=n.indexOf(e);if(-1!==r)return n[r];if(n.push(e),Array.isArray(e)){for(var o=[],i=0,a=e.length;a>i;++i)"undefined"!=typeof e[i]&&o.push(e[i]);return o}var s=Object.keys(e);for(i=0,a=s.length;a>i;++i){var u=s[i];e[u]=t.compact(e[u],n)}return e},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null===e||"undefined"==typeof e?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},function(e,t){"use strict";function n(){return window.location.href.split("#")[1]||""}function r(e){window.location.replace(window.location.pathname+window.location.search+"#"+e)}function o(){return window.location.pathname+window.location.search}function i(){return{scrollX:window.pageXOffset||document.documentElement.scrollLeft,scrollY:window.pageYOffset||document.documentElement.scrollTop}}function a(e,t){window.scrollTo(e,t)}function s(){var e=navigator.userAgent;return-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone")?window.history&&"pushState"in window.history:!1}t.__esModule=!0,t.getHashPath=n,t.replaceHashPath=r,t.getWindowPath=o,t.getWindowScrollPosition=i,t.setWindowScrollPosition=a,t.supportsHistory=s;var u=!("undefined"==typeof window||!window.document||!window.document.createElement);t.canUseDOM=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(){return Math.random().toString(36).substr(2)}t.__esModule=!0;var a=n(2),s=r(a),u=n(5),c=n(7),l=r(c),f=["pushState","replaceState","go"],p=function(){function e(){var t=void 0===arguments[0]?{}:arguments[0];o(this,e),f.forEach(function(e){s["default"]("function"==typeof this[e],'%s needs a "%s" method',this.constructor.name,e)},this),this.parseQueryString=t.parseQueryString||u.parseQueryString,this.changeListeners=[],this.location=null}return e.prototype._notifyChange=function(){for(var e=0,t=this.changeListeners.length;t>e;++e)this.changeListeners[e].call(this)},e.prototype.addChangeListener=function(e){this.changeListeners.push(e)},e.prototype.removeChangeListener=function(e){this.changeListeners=this.changeListeners.filter(function(t){return t!==e})},e.prototype.back=function(){this.go(-1)},e.prototype.forward=function(){this.go(1)},e.prototype._createState=function(e){return e=e||{},e.key||(e.key=i()),e},e.prototype.createLocation=function(e,t,n){var r=u.getPathname(e),o=u.getQueryString(e),i=o?this.parseQueryString(o):null;return new l["default"](r,i,t,n)},e}();t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return 0===e.button}function i(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=n(1),u=r(s),c=u["default"].PropTypes,l=c.object,f=c.string,p=c.func,d=u["default"].createClass({displayName:"Link",contextTypes:{router:l},propTypes:{activeStyle:l,activeClassName:f,to:f.isRequired,query:l,state:l,onClick:p},getDefaultProps:function(){return{className:"",activeClassName:"active",style:{}}},handleClick:function(e){var t,n=!0;this.props.onClick&&(t=this.props.onClick(e)),!i(e)&&o(e)&&((t===!1||e.defaultPrevented===!0)&&(n=!1),e.preventDefault(),n&&this.context.router.transitionTo(this.props.to,this.props.query,this.props.state))},render:function(){var e=this.context.router,t=this.props,n=t.to,r=t.query,o=a({},this.props,{href:e.makeHref(n,r),onClick:this.handleClick});return e&&e.isActive(n,r)&&(o.activeClassName&&(o.className+=""!==o.className?" "+o.activeClassName:o.activeClassName),o.activeStyle&&(o.style=a({},o.style,o.activeStyle))),u["default"].createElement("a",o)}});t.Link=d,t["default"]=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(1),i=r(o),a=i["default"].PropTypes.object,s={contextTypes:{router:a.isRequired}},u=["makePath","makeHref","transitionTo","replaceWith","go","goBack","goForward"];u.forEach(function(e){s[e]=function(){var t=this.context.router;return t[e].apply(t,arguments)}}),t["default"]=s,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(1),i=r(o),a=n(2),s=r(a),u=n(3),c=n(5),l=n(4),f=i["default"].PropTypes,p=f.string,d=f.object,h=i["default"].createClass({displayName:"Redirect",statics:{createRouteFromReactElement:function(e){var t=u.createRouteFromReactElement(e);return t.from&&(t.path=t.from),t.onEnter=function(e,n){var r=e.location,o=e.params,i=t.to?c.formatPattern(t.to,o):r.pathname;n.to(i,t.query||r.query,t.state||r.state)},t}},propTypes:{path:p,from:p,to:p.isRequired,query:d,state:d,onEnter:l.falsy,children:l.falsy},render:function(){s["default"](!1,"<Redirect> elements are for router configuration only and should not be rendered")}});t.Redirect=h,t["default"]=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(1),i=r(o),a=n(2),s=r(a),u=n(3),c=n(4),l=n(6),f=r(l),p=i["default"].PropTypes,d=p.string,h=p.bool,m=p.func,y=i["default"].createClass({displayName:"Route",statics:{createRouteFromReactElement:function(e){var t=u.createRouteFromReactElement(e);return t.handler&&(f["default"](!1,"<Route handler> is deprecated, use <Route component> instead"),t.component=t.handler,delete t.handler),t}},propTypes:{path:d,ignoreScrollBehavior:h,handler:c.component,component:c.component,components:c.components,getComponents:m},render:function(){s["default"](!1,"<Route> elements are for router configuration only and should not be rendered")}});t.Route=y,t["default"]=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n,r,o){var i=new x["default"];h.getState(t,n,function(t,a){if(t||null==a||i.isCancelled)o(t,null,i);else{a.location=n;var s=h.getTransitionHooks(e,a);Array.isArray(r)&&s.unshift.apply(s,r),p.loopAsync(s.length,function(e,t,n){s[e](a,i,function(e){e||i.isCancelled?n(e):t()})},function(e){e||i.isCancelled?o(e,null,i):h.getComponents(a.branch,function(e,t){e||i.isCancelled?o(e,null,i):(a.components=t,o(null,a,i))})})}})}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(1),s=r(a),u=n(6),c=r(u),l=n(2),f=r(l),p=n(8),d=n(3),h=n(19),m=n(4),y=n(18),g=r(y),v=n(20),R=r(v),b=n(7),_=n(22),x=r(_),P=s["default"].PropTypes,w=P.arrayOf,C=P.func,O=P.object,S=s["default"].createClass({displayName:"Router",mixins:[g["default"],R["default"]],statics:{run:function(e,t,n,r){"function"==typeof n&&(r=n,n=null),f["default"]("function"==typeof r,"Router.run needs a callback"),o(null,e,t,n,r)}},propTypes:{createElement:C.isRequired,onAbort:C,onError:C,onUpdate:C,history:m.history,routes:m.routes,children:m.routes,location:m.location,branch:m.routes,params:O,components:w(m.components)},getDefaultProps:function(){return{createElement:a.createElement}},getInitialState:function(){return{isTransitioning:!1,location:null,branch:null,params:null,components:null}},_updateState:function(e){var t=this;f["default"](b.isLocation(e),"A <Router> needs a valid Location");var n=this.transitionHooks;n&&(n=n.map(function(e){return h.createTransitionHook(e,t)})),this.setState({isTransitioning:!0}),o(this.state,this.routes,e,n,function(n,r,o){if(n)t.handleError(n);else if(o.isCancelled)if(o.redirectInfo){var i=o.redirectInfo,a=i.pathname,s=i.query,r=i.state;t.replaceWith(a,s,r)}else f["default"](t.state.location,"You may not abort the initial transition"),t.handleAbort(o.abortReason);else null==r?c["default"](!1,'Location "%s" did not match any routes',e.pathname):t.setState(r,t.props.onUpdate);t.setState({isTransitioning:!1})})},addTransitionHook:function(e){this.transitionHooks||(this.transitionHooks=[]),this.transitionHooks.push(e)},removeTransitionHook:function(e){this.transitionHooks&&(this.transitionHooks=this.transitionHooks.filter(function(t){return t!==e}))},handleAbort:function(e){this.props.onAbort?this.props.onAbort.call(this,e):(this._ignoreNextHistoryChange=!0,this.goBack())},handleError:function(e){if(!this.props.onError)throw e;this.props.onError.call(this,e)},handleHistoryChange:function(){this._ignoreNextHistoryChange?this._ignoreNextHistoryChange=!1:this._updateState(this.props.history.location)},componentWillMount:function(){var e=this.props,t=e.history,n=e.routes,r=e.children,o=e.location,i=e.branch,a=e.params,s=e.components;t?(f["default"](n||r,"Client-side <Router>s need routes. Try using <Router routes> or passing your routes as nested <Route> children"),this.routes=d.createRoutes(n||r),"function"==typeof t.setup&&t.setup(),t.addChangeListener&&t.addChangeListener(this.handleHistoryChange),this._updateState(t.location)):(f["default"](o&&i&&a&&s,"Server-side <Router>s need location, branch, params, and components props. Try using Router.run to get all the props you need"),this.setState({location:o,branch:i,params:a,components:s}))},componentWillReceiveProps:function(e){if(f["default"](this.props.history===e.history,"<Router history> may not be changed"),e.history){var t=this.props.routes||this.props.children,n=e.routes||e.children;t!==n&&(this.routes=d.createRoutes(n),e.history.location&&this._updateState(e.history.location))}},componentWillUnmount:function(){var e=this.props.history;e&&e.removeChangeListener&&e.removeChangeListener(this.handleHistoryChange)},_createElement:function(e,t){return"function"==typeof e?this.props.createElement(e,t):null},render:function(){var e=this,t=this.state,n=t.branch,r=t.params,o=t.components,s=null;return o&&(s=o.reduceRight(function(t,o,s){if(null==o)return t;var u=n[s],c=h.getRouteParams(u,r),l=i({},e.state,{route:u,routeParams:c});if(a.isValidElement(t)?l.children=t:t&&i(l,t),"object"==typeof o){var f={};for(var p in o)o.hasOwnProperty(p)&&(f[p]=e._createElement(o[p],l));return f}return e._createElement(o,l)},s)),f["default"](null===s||s===!1||a.isValidElement(s),"The root route must render a single element"),s}});t["default"]=S,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return 0===l.stripLeadingSlashes(t).indexOf(l.stripLeadingSlashes(e))?!0:!1}function i(e,t){if(null==t)return null==e;if(null==e)return!0;for(var n in e)if(e.hasOwnProperty(n)&&String(e[n])!==String(t[n]))return!1;return!0}t.__esModule=!0;var a=n(1),s=r(a),u=n(2),c=r(u),l=n(5),f=s["default"].PropTypes,p=f.func,d=f.object,h={propTypes:{stringifyQuery:p.isRequired},getDefaultProps:function(){return{stringifyQuery:l.stringifyQuery}},childContextTypes:{router:d.isRequired},getChildContext:function(){return{router:this}},makePath:function(e,t){return t&&("string"!=typeof t&&(t=this.props.stringifyQuery(t)),""!==t)?e+"?"+t:e},makeHref:function(e,t){var n=this.makePath(e,t),r=this.props.history;return r&&r.makeHref?r.makeHref(n):n},transitionTo:function(e,t){var n=void 0===arguments[2]?null:arguments[2],r=this.props.history;c["default"](r,"Router#transitionTo is client-side only (needs history)"),r.pushState(n,this.makePath(e,t))},replaceWith:function(e,t){var n=void 0===arguments[2]?null:arguments[2],r=this.props.history;c["default"](r,"Router#replaceWith is client-side only (needs history)"),r.replaceState(n,this.makePath(e,t))},go:function(e){var t=this.props.history;c["default"](t,"Router#go is client-side only (needs history)"),t.go(e)},goBack:function(){this.go(-1)},goForward:function(){this.go(1)},isActive:function(e,t){var n=this.state.location;return null==n?!1:o(e,n.pathname)&&i(t,n.query)}};t["default"]=h,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){e.childRoutes?n(null,e.childRoutes):e.getChildRoutes?e.getChildRoutes(t,n):n()}function i(e,t,n){e.indexRoute?n(null,e.indexRoute):e.getIndexRoute?e.getIndexRoute(n,t):n()}function a(e,t,n){return t.reduceRight(function(e,t,r){var o=n[r];return Array.isArray(e[t])?e[t].unshift(o):e[t]=t in e?[o,e[t]]:o,e},e)}function s(e,t){return a({},e,t)}function u(e,t,n,r){var u=_.matchPattern(e.path,t),l=u.remainingPathname,f=u.paramNames,p=u.paramValues,d=""===l;if(d&&e.path){var h=s(f,p),m=[e];i(e,n,function(e,t){e?r(e):(t&&m.push(t),r(null,{params:h,branch:m}))})}else null!=l?o(e,n,function(t,o){t?r(t):o?c(o,l,n,function(t,n){t?r(t):n?(a(n.params,f,p),n.branch.unshift(e),r(null,n)):r()}):r()}):r()}function c(e,t,n,r){e=b.createRoutes(e),x.loopAsync(e.length,function(r,o,i){u(e[r],t,n,function(e,t){e||t?i(e,t):o()})},r)}function l(e,t,n){c(e,_.stripLeadingSlashes(t.pathname),t.state,n)}function f(e,t,n){if(!e.path)return!1;var r=_.getParamNames(e.path);return r.some(function(e){return t.params[e]!==n.params[e]})}function p(e,t){var n,r,o=e&&e.branch,i=t.branch;return o?(n=o.filter(function(n){return-1===i.indexOf(n)||f(n,e,t)}),n.reverse(),r=i.filter(function(e){return-1===o.indexOf(e)||-1!==n.indexOf(e)})):(n=[],r=i),[n,r]}function d(e,t){return function(n,r,o){e.length>2?e.call(t,n,r,o):(e.call(t,n,r),o())}}function h(e,t){return e.reduce(function(e,n){return n[t]&&e.push(d(n[t],n)),e},[])}function m(e,t){var n=p(e,t),r=n[0],o=n[1],i=h(r,"onLeave");return i.push.apply(i,h(o,"onEnter")),i}function y(e,t){e.component||e.components?t(null,e.component||e.components):e.getComponents?e.getComponents(t):t()}function g(e,t){x.mapAsync(e,function(e,t,n){y(e,n)},t)}function v(e,t){var n={};if(!e.path)return n;var r=_.getParamNames(e.path);for(var o in t)t.hasOwnProperty(o)&&-1!==r.indexOf(o)&&(n[o]=t[o]);return n}t.__esModule=!0,t.getState=l,t.createTransitionHook=d,t.getTransitionHooks=m,t.getComponents=g,t.getRouteParams=v;var R=n(2),b=(r(R),n(3)),_=n(5),x=n(8)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return e.filter(function(e){return-1!==t.indexOf(e)})}function i(e,t){var n=e.location,r=e.branch,i=t.location,a=t.branch;if(null===i)return!1;if(n.pathname===i.pathname)return!1;var s=o(r,a);return s.some(function(e){return e.ignoreScrollBehavior})?!1:!0}function a(e,t,n){c.canUseDOM&&(e===f["default"].POP?c.setWindowScrollPosition(t,n):c.setWindowScrollPosition(0,0))}t.__esModule=!0;var s=n(1),u=r(s),c=n(11),l=n(9),f=r(l),p=u["default"].PropTypes.func,d={propTypes:{shouldUpdateScrollPosition:p.isRequired,updateScrollPosition:p.isRequired},getDefaultProps:function(){return{shouldUpdateScrollPosition:i,updateScrollPosition:a}},componentDidUpdate:function(e,t){var n=this.state.location,r=n&&n.state;if(r&&this.props.shouldUpdateScrollPosition(this.state,t)){var o=r.scrollX,i=r.scrollY;this.props.updateScrollPosition(n.navigationType,o||0,i||0)}}};t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(1),i=r(o),a=i["default"].PropTypes.object,s={contextTypes:{router:a.isRequired}},u=["isActive"];u.forEach(function(e){s[e]=function(){var t=this.context.router;return t[e].apply(t,arguments)}}),t["default"]=s,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=function(){function e(){n(this,e),this.isCancelled=!1,this.redirectInfo=null,this.abortReason=null}return e.prototype.to=function(e,t,n){this.redirectInfo={pathname:e,query:t,state:n},this.isCancelled=!0},e.prototype.abort=function(e){this.abortReason=e,this.isCancelled=!0},e}();t["default"]=r,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(1),i=r(o),a=n(6),s=r(a),u=i["default"].PropTypes.object,c={contextTypes:{router:u.isRequired},componentDidMount:function(){s["default"]("function"==typeof this.routerWillLeave,"Components that mixin TransitionHook should have a routerWillLeave method, check %s",this.constructor.displayName||this.constructor.name),this.routerWillLeave&&this.context.router.addTransitionHook(this.routerWillLeave)},componentWillUnmount:function(){this.routerWillLeave&&this.context.router.removeTransitionHook(this.routerWillLeave)}};t["default"]=c,e.exports=t["default"]},function(e){"use strict";var t=function(e){var t,n={};if(!(e instanceof Object)||Array.isArray(e))throw new Error("keyMirror(...): Argument must be an object.");for(t in e)e.hasOwnProperty(t)&&(n[t]=t);return n};e.exports=t},function(e,t,n){e.exports=n(26)},function(e,t,n){var r=n(28),o=n(27);e.exports={stringify:r,parse:o}},function(e,t,n){var r=n(10),o={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3};o.parseValues=function(e,t){for(var n={},o=e.split(t.delimiter,1/0===t.parameterLimit?void 0:t.parameterLimit),i=0,a=o.length;a>i;++i){var s=o[i],u=-1===s.indexOf("]=")?s.indexOf("="):s.indexOf("]=")+1;if(-1===u)n[r.decode(s)]="";else{var c=r.decode(s.slice(0,u)),l=r.decode(s.slice(u+1));if(Object.prototype.hasOwnProperty(c))continue;n[c]=n.hasOwnProperty(c)?[].concat(n[c]).concat(l):l}}return n},o.parseObject=function(e,t,n){if(!e.length)return t;var r=e.shift(),i={};if("[]"===r)i=[],i=i.concat(o.parseObject(e,t,n));else{var a="["===r[0]&&"]"===r[r.length-1]?r.slice(1,r.length-1):r,s=parseInt(a,10),u=""+s;!isNaN(s)&&r!==a&&u===a&&s>=0&&s<=n.arrayLimit?(i=[],i[s]=o.parseObject(e,t,n)):i[a]=o.parseObject(e,t,n)}return i},o.parseKeys=function(e,t,n){if(e){var r=/^([^\[\]]*)/,i=/(\[[^\[\]]*\])/g,a=r.exec(e);if(!Object.prototype.hasOwnProperty(a[1])){var s=[];a[1]&&s.push(a[1]);for(var u=0;null!==(a=i.exec(e))&&u<n.depth;)++u,Object.prototype.hasOwnProperty(a[1].replace(/\[|\]/g,""))||s.push(a[1]);return a&&s.push("["+e.slice(a.index)+"]"),o.parseObject(s,t,n)}}},e.exports=function(e,t){if(""===e||null===e||"undefined"==typeof e)return{};t=t||{},t.delimiter="string"==typeof t.delimiter||r.isRegExp(t.delimiter)?t.delimiter:o.delimiter,t.depth="number"==typeof t.depth?t.depth:o.depth,t.arrayLimit="number"==typeof t.arrayLimit?t.arrayLimit:o.arrayLimit,t.parameterLimit="number"==typeof t.parameterLimit?t.parameterLimit:o.parameterLimit;for(var n="string"==typeof e?o.parseValues(e,t):e,i={},a=Object.keys(n),s=0,u=a.length;u>s;++s){var c=a[s],l=o.parseKeys(c,n[c],t);i=r.merge(i,l)}return r.compact(i)}},function(e,t,n){var r=n(10),o={delimiter:"&",arrayPrefixGenerators:{brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}}};o.stringify=function(e,t,n){if(r.isBuffer(e)?e=e.toString():e instanceof Date?e=e.toISOString():null===e&&(e=""),"string"==typeof e||"number"==typeof e||"boolean"==typeof e)return[encodeURIComponent(t)+"="+encodeURIComponent(e)];var i=[];if("undefined"==typeof e)return i;for(var a=Object.keys(e),s=0,u=a.length;u>s;++s){var c=a[s];i=i.concat(Array.isArray(e)?o.stringify(e[c],n(t,c),n):o.stringify(e[c],t+"["+c+"]",n))}return i},e.exports=function(e,t){t=t||{};var n="undefined"==typeof t.delimiter?o.delimiter:t.delimiter,r=[];if("object"!=typeof e||null===e)return"";var i;i=t.arrayFormat in o.arrayPrefixGenerators?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":"indices";for(var a=o.arrayPrefixGenerators[i],s=Object.keys(e),u=0,c=s.length;c>u;++u){var l=s[u];r=r.concat(o.stringify(e[l],l,a))}return r.join(n)}}])});

@@ -12,2 +12,3 @@ 'use strict';

exports.getParamNames = getParamNames;
exports.getParams = getParams;
exports.formatPattern = formatPattern;

@@ -33,3 +34,3 @@

var queryMatcher = /\?(.*)$/;
var queryMatcher = /\?([\s\S]*)$/;

@@ -79,3 +80,3 @@ function getPathname(path) {

} else if (match[0] === '*') {
regexpSource += '(.*?)';
regexpSource += '([\\s\\S]*?)';
paramNames.push('splat');

@@ -143,3 +144,3 @@ } else if (match[0] === '(') {

if (captureRemaining) regexpSource += '(.*?)';
if (captureRemaining) regexpSource += '([\\s\\S]*?)';

@@ -150,3 +151,5 @@ var match = pathname.match(new RegExp('^' + regexpSource + '$', 'i'));

if (match != null) {
paramValues = Array.prototype.slice.call(match, 1);
paramValues = Array.prototype.slice.call(match, 1).map(function (v) {
return v != null ? decodeURIComponent(v.replace(/\+/g, '%20')) : v;
});

@@ -158,2 +161,4 @@ if (captureRemaining) {

}
} else {
remainingPathname = paramValues = null;
}

@@ -172,2 +177,18 @@

function getParams(pattern, pathname) {
var _matchPattern = matchPattern(pattern, stripLeadingSlashes(pathname));
var paramNames = _matchPattern.paramNames;
var paramValues = _matchPattern.paramValues;
if (paramValues != null) {
return paramNames.reduce(function (memo, paramName, index) {
memo[paramName] = paramValues[index];
return memo;
}, {});
}
return null;
}
/**

@@ -198,3 +219,3 @@ * Returns a version of the given pattern with params interpolated. Throws

if (paramValue != null) pathname += paramValue;
if (paramValue != null) pathname += encodeURI(paramValue).replace(/%20/g, '+');
} else if (token === '(') {

@@ -210,3 +231,3 @@ parenCount += 1;

if (paramValue != null) pathname += paramValue;
if (paramValue != null) pathname += encodeURIComponent(paramValue).replace(/%20/g, '+');
} else {

@@ -213,0 +234,0 @@ pathname += token;

@@ -76,3 +76,3 @@ import DOMHistory from './DOMHistory';

} else {
window.removeEvent('onpopstate', this.handlePopState);
window.detachEvent('onpopstate', this.handlePopState);
}

@@ -109,5 +109,5 @@ }

}
}
export var history = new BrowserHistory;
export default BrowserHistory;

@@ -8,3 +8,2 @@ import History from './History';

class DOMHistory extends History {
constructor(options={}) {

@@ -11,0 +10,0 @@ super(options);

export var canUseDOM = !!(
(typeof window !== 'undefined' &&
window.document && window.document.createElement)
typeof window !== 'undefined' && window.document && window.document.createElement
);
export function getHashPath() {
return decodeURI(
// We can't use window.location.hash here because it's not
// consistent across browsers - Firefox will pre-decode it!
window.location.href.split('#')[1] || ''
);
// We can't use window.location.hash here because it's not
// consistent across browsers - Firefox will pre-decode it!
return window.location.href.split('#')[1] || '';
}

@@ -21,5 +18,3 @@

export function getWindowPath() {
return decodeURI(
window.location.pathname + window.location.search
);
return window.location.pathname + window.location.search;
}

@@ -26,0 +21,0 @@

import React from 'react';
import invariant from 'invariant';
var { func, array, shape, object } = React.PropTypes;
var contextTypes = {
asyncProps: shape({
reloadComponent: func,
propsArray: array,
componentsArray: array
})
};
var _serverPropsArray = null;
function setServerPropsArray(array) {
invariant(!_serverPropsArray, 'You cannot call AsyncProps.hydrate more than once');
_serverPropsArray = array;
}
export function _clearCacheForTesting() {
_serverPropsArray = null;
}
function hydrate(routerState, cb) {
var { components, params } = routerState;
var flatComponents = filterAndFlattenComponents(components);
loadAsyncProps(flatComponents, params, cb);
}
function eachComponents(components, iterator) {
for (var i = 0, l = components.length; i < l; i++) {
if (typeof components[i] === 'object') {
for (var key in components[i]) {
iterator(components[i][key], i, key);
}
} else {
iterator(components[i], i);
}
}
}
function filterAndFlattenComponents(components) {
var flattened = [];
eachComponents(components, function(Component) {
if (Component.loadProps)
flattened.push(Component);
});
return flattened;
}
function loadAsyncProps(components, params, cb) {
var propsArray = [];
var componentsArray = [];
var canceled = false;
var needToLoadCounter = components.length;
components.forEach(function(Component, index) {
Component.loadProps(params, function(error, props) {
needToLoadCounter--;
propsArray[index] = props;
componentsArray[index] = Component;
maybeFinish();
});
});
function maybeFinish() {
if (canceled === false && needToLoadCounter === 0)
cb(null, {propsArray, componentsArray});
}
return {
cancel () {
canceled = true;
}
};
}
function getPropsForComponent(Component, componentsArray, propsArray) {
var index = componentsArray.indexOf(Component);
return propsArray[index];
}
function mergeAsyncProps(current, changes) {
for (var i = 0, l = changes.propsArray.length; i < l; i++) {
let Component = changes.componentsArray[i];
let position = current.componentsArray.indexOf(Component);
let isNew = position === -1;
if (isNew) {
current.propsArray.push(changes.propsArray[i]);
current.componentsArray.push(changes.componentsArray[i]);
} else {
current.propsArray[position] = changes.propsArray[i];
}
}
}
function arrayDiff(previous, next) {
var diff = [];
for (var i = 0, l = next.length; i < l; i++)
if (previous.indexOf(next[i]) === -1)
diff.push(next[i]);
return diff;
}
function shallowEqual(a, b) {
var key;
var ka = 0;
var kb = 0;
for (let key in a) {
for (key in a) {
if (a.hasOwnProperty(key) && a[key] !== b[key])

@@ -11,24 +118,87 @@ return false;

}
for (let key in b)
for (key in b)
if (b.hasOwnProperty(key))
kb++;
return ka === kb;
}
var RouteComponentWrapper = React.createClass({
contextTypes: contextTypes,
// this is here to meet the case of reloading the props when a component's params change,
// the place we know that is here, but the problem is we get occasional waterfall loads
// when clicking links quickly at the same route, AsyncProps doesn't know to load the next
// props until the previous finishes rendering.
//
// if we could tell that a component needs its props reloaded in AsyncProps instead of here
// (by the arrayDiff stuff in componentWillReceiveProps) then we wouldn't need this code at
// all, and we coudl get rid of the terrible forceUpdate hack as well. I'm just not sure
// right now if we can know to reload a pivot transition.
componentWillReceiveProps(nextProps, context) {
var paramsChanged = !shallowEqual(
this.props.routerState.routeParams,
nextProps.routerState.routeParams
);
if (paramsChanged) {
this.reloadProps(nextProps.routerState.routeParams);
}
},
reloadProps(params) {
this.context.asyncProps.reloadComponent(
this.props.Component,
params || this.props.routerState.routeParams,
this
);
},
render() {
var { Component, routerState } = this.props;
var { componentsArray, propsArray, loading } = this.context.asyncProps;
var asyncProps = getPropsForComponent(Component, componentsArray, propsArray);
return <Component {...routerState} {...asyncProps} loading={loading} reloadAsyncProps={this.reloadProps} />;
}
});
var AsyncProps = React.createClass({
statics: {
createElement (Component, state) {
return Component.loadProps ?
<AsyncProps Component={Component} routing={state}/> :
hydrate: hydrate,
rehydrate: setServerPropsArray,
createElement(Component, state) {
return typeof Component.loadProps === 'function' ?
<RouteComponentWrapper Component={Component} routerState={state}/> :
<Component {...state}/>;
}
},
childContextTypes: contextTypes,
getChildContext() {
return {
asyncProps: Object.assign({
reloadComponent: this.reloadComponent,
loading: this.state.previousProps !== null
}, this.state.asyncProps),
};
},
getInitialState() {
return {
propsAreLoading: false,
propsAreLoadingLong: false,
asyncProps: null,
previousRoutingState: null
asyncProps: {
propsArray: _serverPropsArray,
componentsArray: _serverPropsArray ? filterAndFlattenComponents(this.props.components) : null,
},
previousProps: null
};

@@ -38,57 +208,53 @@ },

componentDidMount() {
this.load(this.props);
var initialLoad = this.state.asyncProps.propsArray === null;
if (initialLoad) {
hydrate(this.props, (err, asyncProps) => {
this.setState({ asyncProps });
});
}
},
componentWillReceiveProps(nextProps) {
var needToLoad = !shallowEqual(
nextProps.routing.routeParams,
this.props.routing.routeParams
var routerTransitioned = nextProps.location !== this.props.location;
if (!routerTransitioned)
return;
var oldComponents = this.props.components;
var newComponents = nextProps.components;
var components = arrayDiff(
filterAndFlattenComponents(oldComponents),
filterAndFlattenComponents(newComponents)
);
if (needToLoad) {
var routerTransitioned = nextProps.routing.location !== this.props.routing.location;
var keepPreviousRoutingState = this.state.propsAreLoadingLong && routerTransitioned;
if (components.length === 0)
return;
if (keepPreviousRoutingState) {
this.load(nextProps);
} else {
this.setState({
previousRoutingState: this.props.routing
}, () => this.load(nextProps));
}
}
this.loadAsyncProps(components, nextProps.params);
},
/*
* Could make this method much better, right now AsyncProps doesn't render its
* children until it fetches data, causing a "waterfall" effect, when instead
* it could look at the branch of components from it down to the end and load
* up the props for all of them in parallel, waterfall will do for now...
*/
load(props) {
var lastLoadTime = this._lastLoadTime = Date.now();
var { params } = props.routing;
var { Component } = this.props;
beforeLoad(cb) {
this.setState({
previousProps: this.props
}, cb);
},
this.setState({ propsAreLoading: true }, () => {
var longLoadTimer = setTimeout(() => {
this.setState({ propsAreLoadingLong: true });
}, 300);
afterLoad(err, asyncProps, cb) {
this.inflightLoader = null;
mergeAsyncProps(this.state.asyncProps, asyncProps);
this.setState({
previousProps: null,
asyncProps: this.state.asyncProps
}, cb);
},
// TODO: handle `error`s
Component.loadProps(params, (error, asyncProps) => {
clearTimeout(longLoadTimer);
loadAsyncProps(components, params, cb) {
if (this.inflightLoader) {
this.inflightLoader.cancel();
}
// if the router transitions between now and when the callback runs we will
// ignore it to prevent setting state w/ the wrong data (earlier calls to
// load that call back later than later calls to load)
if (this._lastLoadTime !== lastLoadTime || !this.isMounted())
return;
this.setState({
propsAreLoading: false,
propsAreLoadingLong: false,
asyncProps: asyncProps,
previousRoutingState: null
});
this.beforeLoad(() => {
this.inflightLoader = loadAsyncProps(components, params, (err, asyncProps) => {
this.afterLoad(err, asyncProps, cb);
});

@@ -98,21 +264,29 @@ });

reloadComponent(Component, params, instance) {
this.loadAsyncProps([Component], params, () => {
// gotta fix this hack ... change in context doesn't cause the
// RouteComponentWrappers to rerender (first one will because
// of cloneElement)
if (instance.isMounted())
instance.forceUpdate();
});
},
render() {
var { Component } = this.props;
var { asyncProps, propsAreLoading, propsAreLoadingLong } = this.state;
var routing = this.state.previousRoutingState || this.props.routing;
var { route } = this.props;
var { asyncProps, previousProps } = this.state;
var initialLoad = asyncProps.propsArray === null;
if (this.state.asyncProps === null)
return Component.Loader ? <Component.Loader {...routing}/> : null;
if (initialLoad)
return route.renderInitialLoad ? route.renderInitialLoad() : null;
return <Component
onPropsDidChange={() => this.load(this.props) }
propsAreLoading={propsAreLoading}
propsAreLoadingLong={propsAreLoadingLong}
{...routing}
{...asyncProps}
/>;
else if (previousProps)
return React.cloneElement(previousProps.children, { loading: true });
else
return this.props.children;
}
});
export default AsyncProps;

@@ -37,3 +37,3 @@ import warning from 'warning';

var json = sessionKey && window.sessionStorage.getItem(sessionKey);
if (json) {

@@ -127,3 +127,3 @@ try {

} else {
window.removeEvent('onhashchange', this.handleHashChange);
window.detachEvent('onhashchange', this.handleHashChange);
}

@@ -169,8 +169,8 @@ }

makeHref(pathname, query) {
return '#' + super.makeHref(pathname, query);
makeHref(path) {
return '#' + path;
}
}
export var history = new HashHistory;
export default HashHistory;

@@ -24,8 +24,8 @@ import React from 'react';

*
* <Link to="showPost" params={{ postID: "123" }} />
* <Link to={`/posts/${post.id}`} />
*
* In addition to params, links may pass along query string parameters
* Links may pass along query string parameters
* using the `query` prop.
*
* <Link to="showPost" params={{ postID: "123" }} query={{ show:true }}/>
* <Link to="/posts/123" query={{ show:true }}/>
*/

@@ -86,6 +86,6 @@ export var Link = React.createClass({

if (props.activeClassName)
props.className += ` ${props.activeClassName}`;
props.className += props.className !== '' ? ` ${props.activeClassName}` : props.activeClassName;
if (props.activeStyle)
Object.assign(props.style, props.activeStyle);
props.style = Object.assign({}, props.style, props.activeStyle);
}

@@ -92,0 +92,0 @@

@@ -141,3 +141,3 @@ import React, { createElement, isValidElement } from 'react';

this.handleAbort(reason);
this.handleAbort(transition.abortReason);
}

@@ -266,3 +266,3 @@ } else if (state == null) {

render() {
var { location, branch, params, components, isTransitioning } = this.state;
var { branch, params, components } = this.state;
var element = null;

@@ -277,3 +277,3 @@

var routeParams = getRouteParams(route, params);
var props = { location, params, route, routeParams, isTransitioning };
var props = Object.assign({}, this.state, { route, routeParams });

@@ -280,0 +280,0 @@ if (isValidElement(element)) {

@@ -74,3 +74,9 @@ import React from 'react';

makeHref(pathname, query) {
return this.makePath(pathname, query);
var path = this.makePath(pathname, query);
var { history } = this.props;
if (history && history.makeHref)
return history.makeHref(path);
return path;
},

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

@@ -15,2 +15,8 @@ import React from 'react';

// When an onEnter hook uses transition.to to redirect
// on the initial load prevLocation is null, so assume
// we don't want to update the scroll position.
if (prevLocation === null)
return false;
// Don't update scroll position if only the query has changed.

@@ -59,5 +65,3 @@ if (location.pathname === prevLocation.pathname)

var { scrollX, scrollY } = locationState;
if (scrollX != null && scrollY != null)
this.props.updateScrollPosition(location.navigationType, scrollX, scrollY);
this.props.updateScrollPosition(location.navigationType, scrollX || 0, scrollY || 0);
}

@@ -64,0 +68,0 @@ }

@@ -10,3 +10,3 @@ import qs from 'qs';

var queryMatcher = /\?(.*)$/;
var queryMatcher = /\?([\s\S]*)$/;

@@ -54,3 +54,3 @@ export function getPathname(path) {

} else if (match[0] === '*') {
regexpSource += '(.*?)';
regexpSource += '([\\s\\S]*?)';
paramNames.push('splat');

@@ -115,3 +115,3 @@ } else if (match[0] === '(') {

if (captureRemaining)
regexpSource += '(.*?)';
regexpSource += '([\\s\\S]*?)';

@@ -122,3 +122,5 @@ var match = pathname.match(new RegExp('^' + regexpSource + '$', 'i'));

if (match != null) {
paramValues = Array.prototype.slice.call(match, 1);
paramValues = Array.prototype.slice.call(match, 1).map(function (v) {
return v != null ? decodeURIComponent(v.replace(/\+/g, '%20')) : v;
});

@@ -130,2 +132,4 @@ if (captureRemaining) {

}
} else {
remainingPathname = paramValues = null;
}

@@ -144,2 +148,15 @@

export function getParams(pattern, pathname) {
var { paramNames, paramValues } = matchPattern(pattern, stripLeadingSlashes(pathname));
if (paramValues != null) {
return paramNames.reduce(function (memo, paramName, index) {
memo[paramName] = paramValues[index];
return memo;
}, {});
}
return null;
}
/**

@@ -169,3 +186,3 @@ * Returns a version of the given pattern with params interpolated. Throws

if (paramValue != null)
pathname += paramValue;
pathname += encodeURI(paramValue).replace(/%20/g, '+');
} else if (token === '(') {

@@ -186,3 +203,3 @@ parenCount += 1;

if (paramValue != null)
pathname += paramValue;
pathname += encodeURIComponent(paramValue).replace(/%20/g, '+');
} else {

@@ -189,0 +206,0 @@ pathname += token;

{
"name": "react-router",
"version": "1.0.0-beta2",
"version": "1.0.0-beta3",
"description": "A complete routing library for React.js",

@@ -35,3 +35,3 @@ "main": "lib/index",

"babel-loader": "^5.0.0",
"babel-plugin-object-assign": "^1.1.0",
"babel-plugin-object-assign": "^1.2.0",
"bundle-loader": "^0.5.2",

@@ -58,5 +58,2 @@ "events": "1.0.2",

},
"peerDependencies": {
"react": "0.13.x"
},
"tags": [

@@ -63,0 +60,0 @@ "react",

@@ -9,3 +9,3 @@ [![npm package](https://img.shields.io/npm/v/react-router.svg?style=flat-square)](https://www.npmjs.org/package/react-router)

React Router keeps the URL in sync with nested UI. It has a simple API
React Router keeps your UI in sync with the URL. It has a simple API
with powerful features like lazy code loading, dynamic route matching,

@@ -26,3 +26,3 @@ and location transition handling built right in. Make the URL your first

We intend to support all the browers React supports.
We support all browsers and environments where React runs.

@@ -48,5 +48,6 @@ Installation

var Route = ReactRouter.Route;
var Link = ReactRouter.Link;
```
There's also a `dist/` folder containing a UMD version.
There's also a `lib/umd` folder containing a UMD version.

@@ -59,4 +60,4 @@ ### bower + who knows what

Find the UMD/global build in `dist/`, and the library on
`window.ReactRouter`. Best of luck to you.
Find the UMD/global build in `lib/umd`, and the library on
`window.ReactRouter`. Best of luck to you. :)

@@ -72,3 +73,3 @@ ### CDN

import { Router, Route } from 'react-router';
import BrowserHistory from 'react-router/lib/BrowserHistory';
import { history } from 'react-router/lib/BrowserHistory';

@@ -122,6 +123,6 @@ var App = React.createClass({/*...*/});

React.render((
<Router history={new BrowserHistory}>
<Router history={history}>
<Route path="/" component={App}>
<Route path="about" component={About}/>
<Route path="users" component={Users} indexComponent={RecentUsers}>
<Route path="users" component={Users}>
<Route path="/user/:userId" component={User}/>

@@ -128,0 +129,0 @@ </Route>

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