From 9a6fa889c172001d1eb61bdad537485b31390148 Mon Sep 17 00:00:00 2001 From: Jonathan Wickens Date: Wed, 9 Jun 2021 12:05:23 -0700 Subject: [PATCH] Adds action info to transition --- build/lib/Transition.js | 3 +++ build/lib/createRouter.js | 2 +- build/package.json | 2 +- build/umd/ReactRouter.js | 5 ++++- build/umd/ReactRouter.min.js | 6 +++--- modules/Transition.js | 3 ++- modules/createRouter.js | 2 +- package.json | 2 +- 8 files changed, 16 insertions(+), 9 deletions(-) diff --git a/build/lib/Transition.js b/build/lib/Transition.js index d58c3118..8d8e62fe 100644 --- a/build/lib/Transition.js +++ b/build/lib/Transition.js @@ -12,8 +12,11 @@ var Redirect = require('./Redirect'); * an instance of this class as their first argument. */ function Transition(path, retry) { + var meta = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; + this.path = path; this.abortReason = null; + this.meta = meta; // TODO: Change this to router.retryTransition(transition) this.retry = retry.bind(this); } diff --git a/build/lib/createRouter.js b/build/lib/createRouter.js index 83731f31..419156f3 100644 --- a/build/lib/createRouter.js +++ b/build/lib/createRouter.js @@ -335,7 +335,7 @@ function createRouter(options) { toRoutes = nextRoutes; } - var transition = new Transition(path, Router.replaceWith.bind(Router, path)); + var transition = new Transition(path, Router.replaceWith.bind(Router, path), { action: action, prevRoutes: prevRoutes, prevPrams: prevPrams, prevQuery: prevQuery }); pendingTransition = transition; var fromComponents = mountedComponents.slice(prevRoutes.length - fromRoutes.length); diff --git a/build/package.json b/build/package.json index 9253fdaa..596206af 100644 --- a/build/package.json +++ b/build/package.json @@ -1,6 +1,6 @@ { "name": "react-router", - "version": "0.13.5", + "version": "0.13.6", "description": "A complete routing library for React.js", "main": "lib", "repository": { diff --git a/build/umd/ReactRouter.js b/build/umd/ReactRouter.js index 51676a29..e5360a90 100644 --- a/build/umd/ReactRouter.js +++ b/build/umd/ReactRouter.js @@ -2737,7 +2737,7 @@ return /******/ (function(modules) { // webpackBootstrap toRoutes = nextRoutes; } - var transition = new Transition(path, Router.replaceWith.bind(Router, path)); + var transition = new Transition(path, Router.replaceWith.bind(Router, path), { action: action, prevRoutes: prevRoutes, prevPrams: prevPrams, prevQuery: prevQuery }); pendingTransition = transition; var fromComponents = mountedComponents.slice(prevRoutes.length - fromRoutes.length); @@ -3052,8 +3052,11 @@ return /******/ (function(modules) { // webpackBootstrap * an instance of this class as their first argument. */ function Transition(path, retry) { + var meta = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; + this.path = path; this.abortReason = null; + this.meta = meta; // TODO: Change this to router.retryTransition(transition) this.retry = retry.bind(this); } diff --git a/build/umd/ReactRouter.min.js b/build/umd/ReactRouter.min.js index 4455b233..764eb85b 100644 --- a/build/umd/ReactRouter.min.js +++ b/build/umd/ReactRouter.min.js @@ -1,7 +1,7 @@ -!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";e.DefaultRoute=n(1),e.Link=n(18),e.NotFoundRoute=n(19),e.Redirect=n(20),e.Route=n(17),e.ActiveHandler=n(15),e.RouteHandler=e.ActiveHandler,e.HashLocation=n(21),e.HistoryLocation=n(25),e.RefreshLocation=n(26),e.StaticLocation=n(27),e.TestLocation=n(28),e.ImitateBrowserBehavior=n(29),e.ScrollToTopBehavior=n(30),e.History=n(23),e.Navigation=n(31),e.State=n(32),e.createRoute=n(5).createRoute,e.createDefaultRoute=n(5).createDefaultRoute,e.createNotFoundRoute=n(5).createNotFoundRoute,e.createRedirect=n(5).createRedirect,e.createRoutesFromReactChildren=n(33),e.create=n(34),e.run=n(43)},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(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)}var i=function(t,e,n){for(var r=!0;r;){var o=t,i=e,a=n;r=!1,null===o&&(o=Function.prototype);var u=Object.getOwnPropertyDescriptor(o,i);if(void 0!==u){if("value"in u)return u.value;var c=u.get;if(void 0===c)return;return c.call(a)}var s=Object.getPrototypeOf(o);if(null===s)return;t=s,e=i,n=a,r=!0,u=s=void 0}},a=n(2),u=n(15),c=n(17),s=function(t){function e(){r(this,e),i(Object.getPrototypeOf(e.prototype),"constructor",this).apply(this,arguments)}return o(e,t),e}(c);s.propTypes={name:a.string,path:a.falsy,children:a.falsy,handler:a.func.isRequired},s.defaultProps={handler:u},t.exports=s},function(t,e,n){"use strict";var r=n(3),o=n(4).PropTypes,i=n(5),a=r({},o,{falsy:function(t,e,n){if(t[e])return new Error("<"+n+'> should not have a "'+e+'" prop')},route:o.instanceOf(i),router:o.func});t.exports=a},function(t,e){"use strict";function n(t,e){if(null==t)throw new TypeError("Object.assign target cannot be null or undefined");for(var n=Object(t),r=Object.prototype.hasOwnProperty,o=1;o'}}]),t}();t.exports=f},function(t,e,n){"use strict";var r=function(t,e,n,r,o,i,a,u){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,r,o,i,a,u],f=0;c=new Error(e.replace(/%s/g,function(){return s[f++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}};t.exports=r},function(t,e,n){"use strict";var r=!1,o=function(){};r&&(o=function(t,e){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o=0&&u<=n.arrayLimit?(i=[],i[u]=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 u=[];a[1]&&u.push(a[1]);for(var c=0;null!==(a=i.exec(t))&&c"}};t.exports=l},function(t,e){"use strict";var n={PUSH:"push",REPLACE:"replace",POP:"pop"};t.exports=n},function(t,e,n){"use strict";var r=n(6),o=n(24),i={length:1,back:function(){r(o,"Cannot use History.back without a DOM"),i.length-=1,window.history.back()}};t.exports=i},function(t,e){"use strict";var n=!("undefined"==typeof window||!window.document||!window.document.createElement);t.exports=n},function(t,e,n){"use strict";function r(t){var e={path:s.getCurrentPath(),type:t};u.forEach(function(t){t.call(s,e)})}function o(t){void 0!==t.state&&r(i.POP)}var i=n(22),a=n(23),u=[],c=!1,s={addChangeListener:function(t){u.push(t),c||(window.addEventListener?window.addEventListener("popstate",o,!1):window.attachEvent("onpopstate",o),c=!0)},removeChangeListener:function(t){u=u.filter(function(e){return e!==t}),0===u.length&&(window.addEventListener?window.removeEventListener("popstate",o,!1):window.removeEvent("onpopstate",o),c=!1)},push:function(t){window.history.pushState({path:t},"",t),a.length+=1,r(i.PUSH)},replace:function(t){window.history.replaceState({path:t},"",t),r(i.REPLACE)},pop:a.back,getCurrentPath:function(){return window.location.pathname+window.location.search},toString:function(){return""}};t.exports=s},function(t,e,n){"use strict";var r=n(25),o=n(23),i={push:function(t){window.location=t},replace:function(t){window.location.replace(t)},pop:o.back,getCurrentPath:r.getCurrentPath,toString:function(){return""}};t.exports=i},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(){a(!1,"You cannot modify a static location")}var i=function(){function t(t,e){for(var n=0;n'}}]),t}();u.prototype.push=o,u.prototype.replace=o,u.prototype.pop=o,t.exports=u},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var n=0;n"}}]),t}();t.exports=c},function(t,e,n){"use strict";var r=n(22),o={updateScrollPosition:function(t,e){switch(e){case r.PUSH:case r.REPLACE:window.scrollTo(0,0);break;case r.POP:t?window.scrollTo(t.x,t.y):window.scrollTo(0,0)}}};t.exports=o},function(t,e){"use strict";var n={updateScrollPosition:function(){window.scrollTo(0,0)}};t.exports=n},function(t,e,n){"use strict";var r=n(2),o={contextTypes:{router:r.router.isRequired},makePath:function(t,e,n){return this.context.router.makePath(t,e,n)},makeHref:function(t,e,n){return this.context.router.makeHref(t,e,n)},transitionTo:function(t,e,n){this.context.router.transitionTo(t,e,n)},replaceWith:function(t,e,n){this.context.router.replaceWith(t,e,n)},goBack:function(){return this.context.router.goBack()}};t.exports=o},function(t,e,n){"use strict";var r=n(2),o={contextTypes:{router:r.router.isRequired},getPath:function(){return this.context.router.getCurrentPath()},getPathname:function(){return this.context.router.getCurrentPathname()},getParams:function(){return this.context.router.getCurrentParams()},getQuery:function(){return this.context.router.getCurrentQuery()},getRoutes:function(){return this.context.router.getCurrentRoutes()},isActive:function(t,e,n){return this.context.router.isActive(t,e,n)}};t.exports=o},function(t,e,n){"use strict";function r(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&&s(!1,o.message)}}function o(t){var e=c({},t),n=e.handler;return n&&(e.onEnter=n.willTransitionTo,e.onLeave=n.willTransitionFrom),e}function i(t){if(u.isValidElement(t)){var e=t.type,n=c({},e.defaultProps,t.props);return e.propTypes&&r(e.displayName,e.propTypes,n),e===f?h.createDefaultRoute(o(n)):e===l?h.createNotFoundRoute(o(n)):e===p?h.createRedirect(o(n)):h.createRoute(o(n),function(){n.children&&a(n.children)})}}function a(t){var e=[];return u.Children.forEach(t,function(t){(t=i(t))&&e.push(t)}),e}var u=n(4),c=n(3),s=n(7),f=n(1),l=n(19),p=n(20),h=n(5);t.exports=a},function(t,e,n){"use strict";function r(t,e){for(var n in e)if(e.hasOwnProperty(n)&&t[n]!==e[n])return!1;return!0}function o(t,e,n,o,i,a){return t.some(function(t){if(t!==e)return!1;for(var u,c=e.paramNames,s=0,f=c.length;s1||n===g?(n.pop(),!0):(l(!1,"goBack() was ignored because there is no router history"),!1)},handleAbort:t.onAbort||function(t){if(n instanceof b)throw new Error("Unhandled aborted transition! Reason: "+t);t instanceof k||(t instanceof C?n.replace(N.makePath(t.to,t.params,t.query)):n.pop())},handleError:t.onError||function(t){throw t},handleLocationChange:function(t){N.dispatch(t.path,t.type)},dispatch:function(t,n){N.cancelPendingTransition();var r=s.path,i=null==n;if(r!==t||i){r&&n===d.PUSH&&N.recordScrollPosition(r);var a=N.match(t);l(null!=a,'No route matches path "%s". Make sure you have somewhere in your routes',t,t),null==a&&(a={});var u,c,f=s.routes||[],p=s.params||{},h=s.query||{},y=a.routes||[],v=a.params||{},m=a.query||{};f.length?(u=f.filter(function(t){return!o(y,t,p,v,h,m)}),c=y.filter(function(t){return!o(f,t,p,v,h,m)})):(u=[],c=y);var g=new R(t,N.replaceWith.bind(N,t));D=g;var b=e.slice(f.length-u.length);R.from(g,u,b,function(e){return e||g.abortReason?H.call(N,e,g):void R.to(g,c,v,m,function(e){H.call(N,e,g,{path:t,action:n,pathname:a.pathname,routes:y,params:v,query:m})})})}},run:function(t){p(!N.isRunning,"Router is already running"),H=function(e,n,r){e&&N.handleError(e),D===n&&(D=null,n.abortReason?N.handleAbort(n.abortReason):t.call(N,N,y=r))},n instanceof b||(n.addChangeListener&&n.addChangeListener(N.handleLocationChange),N.isRunning=!0),N.refresh()},refresh:function(){N.dispatch(n.getCurrentPath(),null)},stop:function(){N.cancelPendingTransition(),n.removeChangeListener&&n.removeChangeListener(N.handleLocationChange),N.isRunning=!1},getLocation:function(){return n},getScrollBehavior:function(){return r},getRouteAtDepth:function(t){var e=s.routes;return e&&e[t]},setRouteComponentAtDepth:function(t,n){e[t]=n},getCurrentPath:function(){return s.path},getCurrentPathname:function(){return s.pathname},getCurrentParams:function(){return s.params},getCurrentQuery:function(){return s.query},getCurrentRoutes:function(){return s.routes},isActive:function(t,e,n){return S.isAbsolute(t)?t===s.path:a(s.routes,t)&&u(s.params,e)&&(null==n||c(s.query,n))}},mixins:[w],propTypes:{children:x.falsy},childContextTypes:{routeDepth:x.number.isRequired,router:x.router.isRequired},getChildContext:function(){return{routeDepth:1,router:N}},getInitialState:function(){return s=y},componentWillReceiveProps:function(){ -this.setState(s=y)},componentWillUnmount:function(){N.stop()},render:function(){var t=N.getRouteAtDepth(0);return t?f.createElement(t.handler,this.props):null}});return N.clearAllRoutes(),t.routes&&N.addRoutes(t.routes),N}var f=n(4),l=n(7),p=n(6),h=n(24),d=n(22),y=n(29),v=n(21),m=n(25),g=n(26),b=n(27),w=n(35),O=n(33),P=n(37),R=n(38),x=n(2),C=n(40),j=n(23),k=n(39),E=n(41),L=n(5),T=n(42),S=n(8),A=h?v:"/",_=h?y:null;t.exports=s},function(t,e,n){"use strict";function r(t,e){if(!e)return!0;if(t.pathname===e.pathname)return!1;var n=t.routes,r=e.routes,o=n.filter(function(t){return r.indexOf(t)!==-1});return!o.some(function(t){return t.ignoreScrollBehavior})}var o=n(6),i=n(24),a=n(36),u={statics:{recordScrollPosition:function(t){this.scrollHistory||(this.scrollHistory={}),this.scrollHistory[t]=a()},getScrollPosition:function(t){return this.scrollHistory||(this.scrollHistory={}),this.scrollHistory[t]||null}},componentWillMount:function(){o(null==this.constructor.getScrollBehavior()||i,"Cannot use scroll behavior without a DOM")},componentDidMount:function(){this._updateScroll()},componentDidUpdate:function(t,e){this._updateScroll(e)},_updateScroll:function(t){if(r(this.state,t)){var e=this.constructor.getScrollBehavior();e&&e.updateScrollPosition(this.constructor.getScrollPosition(this.state.path),this.state.action)}}};t.exports=u},function(t,e,n){"use strict";function r(){return o(i,"Cannot get current scroll position without a DOM"),{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}}var o=n(6),i=n(24);t.exports=r},function(t,e,n){"use strict";function r(t){return null==t||i.isValidElement(t)}function o(t){return r(t)||Array.isArray(t)&&t.every(r)}var i=n(4);t.exports=o},function(t,e,n){"use strict";function r(t,e){this.path=t,this.abortReason=null,this.retry=e.bind(this)}var o=n(39),i=n(40);r.prototype.abort=function(t){null==this.abortReason&&(this.abortReason=t||"ABORT")},r.prototype.redirect=function(t,e,n){this.abort(new i(t,e,n))},r.prototype.cancel=function(){this.abort(new o)},r.from=function(t,e,n,r){e.reduce(function(e,r,o){return function(i){if(i||t.abortReason)e(i);else if(r.onLeave)try{r.onLeave(t,n[o],e),r.onLeave.length<3&&e()}catch(t){e(t)}else e()}},r)()},r.to=function(t,e,n,r,o){e.reduceRight(function(e,o){return function(i){if(i||t.abortReason)e(i);else if(o.onEnter)try{o.onEnter(t,n,r,e),o.onEnter.length<4&&e()}catch(t){e(t)}else e()}},o)()},t.exports=r},function(t,e){"use strict";function n(){}t.exports=n},function(t,e){"use strict";function n(t,e,n){this.to=t,this.params=e,this.query=n}t.exports=n},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){var r=t.childRoutes;if(r)for(var i,c,s=0,f=r.length;s should not have a "'+e+'" prop')},route:o.instanceOf(i),router:o.func});t.exports=a},function(t,e){"use strict";function r(t,e){if(null==t)throw new TypeError("Object.assign target cannot be null or undefined");for(var r=Object(t),n=Object.prototype.hasOwnProperty,o=1;o'}}]),t}();t.exports=f},function(t,e,r){"use strict";var n=function(t,e,r,n,o,i,a,u){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[r,n,o,i,a,u],f=0;c=new Error(e.replace(/%s/g,function(){return s[f++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}};t.exports=n},function(t,e,r){"use strict";var n=!1,o=function(){};n&&(o=function(t,e){for(var r=arguments.length,n=Array(r>2?r-2:0),o=2;o=0&&u<=r.arrayLimit?(i=[],i[u]=o.parseObject(t,e,r)):i[a]=o.parseObject(t,e,r)}return i},o.parseKeys=function(t,e,r){if(t){var n=/^([^\[\]]*)/,i=/(\[[^\[\]]*\])/g,a=n.exec(t);if(!Object.prototype.hasOwnProperty(a[1])){var u=[];a[1]&&u.push(a[1]);for(var c=0;null!==(a=i.exec(t))&&c"}};t.exports=l},function(t,e){"use strict";var r={PUSH:"push",REPLACE:"replace",POP:"pop"};t.exports=r},function(t,e,r){"use strict";var n=r(6),o=r(24),i={length:1,back:function(){n(o,"Cannot use History.back without a DOM"),i.length-=1,window.history.back()}};t.exports=i},function(t,e){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement);t.exports=r},function(t,e,r){"use strict";function n(t){var e={path:s.getCurrentPath(),type:t};u.forEach(function(t){t.call(s,e)})}function o(t){void 0!==t.state&&n(i.POP)}var i=r(22),a=r(23),u=[],c=!1,s={addChangeListener:function(t){u.push(t),c||(window.addEventListener?window.addEventListener("popstate",o,!1):window.attachEvent("onpopstate",o),c=!0)},removeChangeListener:function(t){u=u.filter(function(e){return e!==t}),0===u.length&&(window.addEventListener?window.removeEventListener("popstate",o,!1):window.removeEvent("onpopstate",o),c=!1)},push:function(t){window.history.pushState({path:t},"",t),a.length+=1,n(i.PUSH)},replace:function(t){window.history.replaceState({path:t},"",t),n(i.REPLACE)},pop:a.back,getCurrentPath:function(){return window.location.pathname+window.location.search},toString:function(){return""}};t.exports=s},function(t,e,r){"use strict";var n=r(25),o=r(23),i={push:function(t){window.location=t},replace:function(t){window.location.replace(t)},pop:o.back,getCurrentPath:n.getCurrentPath,toString:function(){return""}};t.exports=i},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(){a(!1,"You cannot modify a static location")}var i=function(){function t(t,e){for(var r=0;r'}}]),t}();u.prototype.push=o,u.prototype.replace=o,u.prototype.pop=o,t.exports=u},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var r=0;r"}}]),t}();t.exports=c},function(t,e,r){"use strict";var n=r(22),o={updateScrollPosition:function(t,e){switch(e){case n.PUSH:case n.REPLACE:window.scrollTo(0,0);break;case n.POP:t?window.scrollTo(t.x,t.y):window.scrollTo(0,0)}}};t.exports=o},function(t,e){"use strict";var r={updateScrollPosition:function(){window.scrollTo(0,0)}};t.exports=r},function(t,e,r){"use strict";var n=r(2),o={contextTypes:{router:n.router.isRequired},makePath:function(t,e,r){return this.context.router.makePath(t,e,r)},makeHref:function(t,e,r){return this.context.router.makeHref(t,e,r)},transitionTo:function(t,e,r){this.context.router.transitionTo(t,e,r)},replaceWith:function(t,e,r){this.context.router.replaceWith(t,e,r)},goBack:function(){return this.context.router.goBack()}};t.exports=o},function(t,e,r){"use strict";var n=r(2),o={contextTypes:{router:n.router.isRequired},getPath:function(){return this.context.router.getCurrentPath()},getPathname:function(){return this.context.router.getCurrentPathname()},getParams:function(){return this.context.router.getCurrentParams()},getQuery:function(){return this.context.router.getCurrentQuery()},getRoutes:function(){return this.context.router.getCurrentRoutes()},isActive:function(t,e,r){return this.context.router.isActive(t,e,r)}};t.exports=o},function(t,e,r){"use strict";function n(t,e,r){t=t||"UnknownComponent";for(var n in e)if(e.hasOwnProperty(n)){var o=e[n](r,n,t);o instanceof Error&&s(!1,o.message)}}function o(t){var e=c({},t),r=e.handler;return r&&(e.onEnter=r.willTransitionTo,e.onLeave=r.willTransitionFrom),e}function i(t){if(u.isValidElement(t)){var e=t.type,r=c({},e.defaultProps,t.props);return e.propTypes&&n(e.displayName,e.propTypes,r),e===f?h.createDefaultRoute(o(r)):e===l?h.createNotFoundRoute(o(r)):e===p?h.createRedirect(o(r)):h.createRoute(o(r),function(){r.children&&a(r.children)})}}function a(t){var e=[];return u.Children.forEach(t,function(t){(t=i(t))&&e.push(t)}),e}var u=r(4),c=r(3),s=r(7),f=r(1),l=r(19),p=r(20),h=r(5);t.exports=a},function(t,e,r){"use strict";function n(t,e){for(var r in e)if(e.hasOwnProperty(r)&&t[r]!==e[r])return!1;return!0}function o(t,e,r,o,i,a){return t.some(function(t){if(t!==e)return!1;for(var u,c=e.paramNames,s=0,f=c.length;s1||r===g?(r.pop(),!0):(l(!1,"goBack() was ignored because there is no router history"),!1)},handleAbort:t.onAbort||function(t){if(r instanceof b)throw new Error("Unhandled aborted transition! Reason: "+t);t instanceof k||(t instanceof C?r.replace(N.makePath(t.to,t.params,t.query)):r.pop())},handleError:t.onError||function(t){throw t},handleLocationChange:function(t){N.dispatch(t.path,t.type)},dispatch:function(t,r){N.cancelPendingTransition();var n=s.path,i=null==r;if(n!==t||i){n&&r===d.PUSH&&N.recordScrollPosition(n);var a=N.match(t);l(null!=a,'No route matches path "%s". Make sure you have somewhere in your routes',t,t),null==a&&(a={});var u,c,f=s.routes||[],p=s.params||{},h=s.query||{},y=a.routes||[],v=a.params||{},m=a.query||{};f.length?(u=f.filter(function(t){return!o(y,t,p,v,h,m)}),c=y.filter(function(t){return!o(f,t,p,v,h,m)})):(u=[],c=y);var g=new R(t,N.replaceWith.bind(N,t),{action:r,prevRoutes:f,prevPrams:prevPrams,prevQuery:h});D=g;var b=e.slice(f.length-u.length);R.from(g,u,b,function(e){return e||g.abortReason?H.call(N,e,g):void R.to(g,c,v,m,function(e){H.call(N,e,g,{path:t,action:r,pathname:a.pathname,routes:y,params:v,query:m})})})}},run:function(t){p(!N.isRunning,"Router is already running"),H=function(e,r,n){e&&N.handleError(e),D===r&&(D=null,r.abortReason?N.handleAbort(r.abortReason):t.call(N,N,y=n))},r instanceof b||(r.addChangeListener&&r.addChangeListener(N.handleLocationChange),N.isRunning=!0),N.refresh()},refresh:function(){N.dispatch(r.getCurrentPath(),null)},stop:function(){N.cancelPendingTransition(),r.removeChangeListener&&r.removeChangeListener(N.handleLocationChange),N.isRunning=!1},getLocation:function(){return r},getScrollBehavior:function(){return n},getRouteAtDepth:function(t){var e=s.routes;return e&&e[t]},setRouteComponentAtDepth:function(t,r){e[t]=r},getCurrentPath:function(){return s.path},getCurrentPathname:function(){return s.pathname},getCurrentParams:function(){return s.params},getCurrentQuery:function(){return s.query},getCurrentRoutes:function(){return s.routes},isActive:function(t,e,r){return S.isAbsolute(t)?t===s.path:a(s.routes,t)&&u(s.params,e)&&(null==r||c(s.query,r))}},mixins:[w],propTypes:{children:x.falsy},childContextTypes:{routeDepth:x.number.isRequired,router:x.router.isRequired},getChildContext:function(){return{routeDepth:1, +router:N}},getInitialState:function(){return s=y},componentWillReceiveProps:function(){this.setState(s=y)},componentWillUnmount:function(){N.stop()},render:function(){var t=N.getRouteAtDepth(0);return t?f.createElement(t.handler,this.props):null}});return N.clearAllRoutes(),t.routes&&N.addRoutes(t.routes),N}var f=r(4),l=r(7),p=r(6),h=r(24),d=r(22),y=r(29),v=r(21),m=r(25),g=r(26),b=r(27),w=r(35),O=r(33),P=r(37),R=r(38),x=r(2),C=r(40),j=r(23),k=r(39),E=r(41),L=r(5),T=r(42),S=r(8),A=h?v:"/",_=h?y:null;t.exports=s},function(t,e,r){"use strict";function n(t,e){if(!e)return!0;if(t.pathname===e.pathname)return!1;var r=t.routes,n=e.routes,o=r.filter(function(t){return n.indexOf(t)!==-1});return!o.some(function(t){return t.ignoreScrollBehavior})}var o=r(6),i=r(24),a=r(36),u={statics:{recordScrollPosition:function(t){this.scrollHistory||(this.scrollHistory={}),this.scrollHistory[t]=a()},getScrollPosition:function(t){return this.scrollHistory||(this.scrollHistory={}),this.scrollHistory[t]||null}},componentWillMount:function(){o(null==this.constructor.getScrollBehavior()||i,"Cannot use scroll behavior without a DOM")},componentDidMount:function(){this._updateScroll()},componentDidUpdate:function(t,e){this._updateScroll(e)},_updateScroll:function(t){if(n(this.state,t)){var e=this.constructor.getScrollBehavior();e&&e.updateScrollPosition(this.constructor.getScrollPosition(this.state.path),this.state.action)}}};t.exports=u},function(t,e,r){"use strict";function n(){return o(i,"Cannot get current scroll position without a DOM"),{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}}var o=r(6),i=r(24);t.exports=n},function(t,e,r){"use strict";function n(t){return null==t||i.isValidElement(t)}function o(t){return n(t)||Array.isArray(t)&&t.every(n)}var i=r(4);t.exports=o},function(t,e,r){"use strict";function n(t,e){var r=arguments.length<=2||void 0===arguments[2]?null:arguments[2];this.path=t,this.abortReason=null,this.meta=r,this.retry=e.bind(this)}var o=r(39),i=r(40);n.prototype.abort=function(t){null==this.abortReason&&(this.abortReason=t||"ABORT")},n.prototype.redirect=function(t,e,r){this.abort(new i(t,e,r))},n.prototype.cancel=function(){this.abort(new o)},n.from=function(t,e,r,n){e.reduce(function(e,n,o){return function(i){if(i||t.abortReason)e(i);else if(n.onLeave)try{n.onLeave(t,r[o],e),n.onLeave.length<3&&e()}catch(t){e(t)}else e()}},n)()},n.to=function(t,e,r,n,o){e.reduceRight(function(e,o){return function(i){if(i||t.abortReason)e(i);else if(o.onEnter)try{o.onEnter(t,r,n,e),o.onEnter.length<4&&e()}catch(t){e(t)}else e()}},o)()},t.exports=n},function(t,e){"use strict";function r(){}t.exports=r},function(t,e){"use strict";function r(t,e,r){this.to=t,this.params=e,this.query=r}t.exports=r},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,r){var n=t.childRoutes;if(n)for(var i,c,s=0,f=n.length;s