!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(2),e.NotFoundRoute=n(3),e.Redirect=n(4),e.Route=n(5),e.ActiveHandler=n(6),e.RouteHandler=e.ActiveHandler,e.HashLocation=n(7),e.HistoryLocation=n(8),e.RefreshLocation=n(9),e.StaticLocation=n(10),e.TestLocation=n(11),e.ImitateBrowserBehavior=n(12),e.ScrollToTopBehavior=n(13),e.History=n(14),e.Navigation=n(15),e.State=n(16),e.createRoute=n(17).createRoute,e.createDefaultRoute=n(17).createDefaultRoute,e.createNotFoundRoute=n(17).createNotFoundRoute,e.createRedirect=n(17).createRedirect,e.createRoutesFromReactChildren=n(18),e.create=n(19),e.run=n(20)},function(t,e,n){"use strict";var r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},i=n(22),a=n(6),u=n(5),s=function(t){function e(){r(this,e),null!=t&&t.apply(this,arguments)}return o(e,t),e}(u);s.propTypes={name:i.string,path:i.falsy,children:i.falsy,handler:i.func.isRequired},s.defaultProps={handler:a},t.exports=s},function(t,e,n){"use strict";function r(t){return 0===t.button}function o(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var n=0;n"}};t.exports=f},function(t,e,n){"use strict";function r(t){var e={path:c.getCurrentPath(),type:t};u.forEach(function(t){t.call(c,e)})}function o(t){void 0!==t.state&&r(i.POP)}var i=n(24),a=n(14),u=[],s=!1,c={addChangeListener:function(t){u.push(t),s||(window.addEventListener?window.addEventListener("popstate",o,!1):window.attachEvent("onpopstate",o),s=!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),s=!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 decodeURI(window.location.pathname+window.location.search)},toString:function(){return""}};t.exports=c},function(t,e,n){"use strict";var r=n(8),o=n(14),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(){a(!1,"You cannot modify a static location")}var o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function t(t,e){for(var n=0;n'}}]),t}();u.prototype.push=r,u.prototype.replace=r,u.prototype.pop=r,t.exports=u},function(t,e,n){"use strict";var r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(){function t(t,e){for(var n=0;nn;++n)this.listeners[n].call(this,e)}},{key:"addChangeListener",value:function(t){this.listeners.push(t)}},{key:"removeChangeListener",value:function(t){this.listeners=this.listeners.filter(function(e){return e!==t})}},{key:"push",value:function(t){this.history.push(t),this._updateHistoryLength(),this._notifyChange(a.PUSH)}},{key:"replace",value:function(t){i(this.history.length,"You cannot replace the current path with no history"),this.history[this.history.length-1]=t,this._notifyChange(a.REPLACE)}},{key:"pop",value:function(){this.history.pop(),this._updateHistoryLength(),this._notifyChange(a.POP)}},{key:"getCurrentPath",value:function(){return this.history[this.history.length-1]}},{key:"toString",value:function(){return""}}]),t}();t.exports=s},function(t,e,n){"use strict";var r=n(24),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){"use strict";var e={updateScrollPosition:function(){window.scrollTo(0,0)}};t.exports=e},function(t,e,n){"use strict";var r=n(34),o=n(35).canUseDOM,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,n){"use strict";var r=n(22),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(22),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";var r,o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function t(t,e){for(var n=0;n'}}],[{key:"createRoute",value:function(e,n){e=e||{},"string"==typeof e&&(e={path:e});var o=r;o?s(null==e.parentRoute||e.parentRoute===o,"You should not use parentRoute with createRoute inside another route's child callback; it is ignored"):o=e.parentRoute;var i=e.name,a=e.path||i;!a||e.isDefault||e.isNotFound?a=o?o.path:"/":c.isAbsolute(a)?o&&u(a===o.path||0===o.paramNames.length,'You cannot nest path "%s" inside "%s"; the parent requires URL parameters',a,o.path):a=o?c.join(o.path,a):"/"+a,e.isNotFound&&!/\*$/.test(a)&&(a+="*");var l=new t(i,a,e.ignoreScrollBehavior,e.isDefault,e.isNotFound,e.onEnter,e.onLeave,e.handler);if(o&&(l.isDefault?(u(null==o.defaultRoute,"%s may not have more than one default route",o),o.defaultRoute=l):l.isNotFound&&(u(null==o.notFoundRoute,"%s may not have more than one not found route",o),o.notFoundRoute=l),o.appendChild(l)),"function"==typeof n){var f=r;r=l,n.call(l,l),r=f}return l}},{key:"createDefaultRoute",value:function(e){return t.createRoute(a({},e,{isDefault:!0}))}},{key:"createNotFoundRoute",value:function(e){return t.createRoute(a({},e,{isNotFound:!0}))}},{key:"createRedirect",value:function(e){return t.createRoute(a({},e,{path:e.path||e.from||"*",onEnter:function(t,n,r){t.redirect(e.to,e.params||n,e.query||r)}}))}}]),t}();t.exports=l},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&&c(!1,o.message)}}function o(t){var e=s({},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=s({},e.defaultProps,t.props);return e.propTypes&&r(e.displayName,e.propTypes,n),e===l?h.createDefaultRoute(o(n)):e===f?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(21),s=n(33),c=n(36),l=n(1),f=n(3),p=n(4),h=n(17);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,s=e.paramNames,c=0,l=s.length;l>c;++c)if(u=s[c],o[u]!==n[u])return!1;return r(i,a)&&r(a,i)})}function i(t,e){for(var n,r=0,o=t.length;o>r;++r)n=t[r],n.name&&(p(null==e[n.name],'You may not have more than one route named "%s"',n.name),e[n.name]=n),n.childRoutes&&i(n.childRoutes,e)}function a(t,e){return t.some(function(t){return t.name===e})}function u(t,e){for(var n in e)if(String(t[n])!==String(e[n]))return!1;return!0}function s(t,e){for(var n in e)if(String(t[n])!==String(e[n]))return!1;return!0}function c(t){t=t||{},x(t)&&(t={routes:t});var e=[],n=t.location||A,r=t.scrollBehavior||_,c={},y={},D=null,H=null;"string"==typeof n&&(n=new w(n)),n instanceof w?f(!h||!1,"You should not use a static location in a DOM environment because the router will not be kept in sync with the current URL"):p(h||n.needsDOM===!1,"You cannot use %s without a DOM",n),n!==v||S()||(n=g);var N=l.createClass({displayName:"Router",statics:{isRunning:!1,cancelPendingTransition:function(){D&&(D.cancel(),D=null)},clearAllRoutes:function(){N.cancelPendingTransition(),N.namedRoutes={},N.routes=[]},addRoutes:function(t){x(t)&&(t=R(t)),i(t,N.namedRoutes),N.routes.push.apply(N.routes,t)},replaceRoutes:function(t){N.clearAllRoutes(),N.addRoutes(t),N.refresh()},match:function(t){return L.findMatch(N.routes,t)},makePath:function(t,e,n){var r;if(j.isAbsolute(t))r=t;else{var o=t instanceof T?t:N.namedRoutes[t];p(o instanceof T,'Cannot find a route named "%s"',t),r=o.path}return j.withQuery(j.injectParams(r,e),n)},makeHref:function(t,e,r){var o=N.makePath(t,e,r);return n===m?"#"+o:o},transitionTo:function(t,e,r){var o=N.makePath(t,e,r);D?n.replace(o):n.push(o)},replaceWith:function(t,e,r){n.replace(N.makePath(t,e,r))},goBack:function(){return O.length>1||n===g?(n.pop(),!0):(f(!1,"goBack() was ignored because there is no router history"),!1)},handleAbort:t.onAbort||function(t){if(n instanceof w)throw new Error("Unhandled aborted transition! Reason: "+t);t instanceof E||(t instanceof k?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=c.path,i=null==n;if(r!==t||i){r&&n===d.PUSH&&N.recordScrollPosition(r);var a=N.match(t);f(null!=a,'No route matches path "%s". Make sure you have somewhere in your routes',t,t),null==a&&(a={});var u,s,l=c.routes||[],p=c.params||{},h=c.query||{},y=a.routes||[],m=a.params||{},v=a.query||{};l.length?(u=l.filter(function(t){return!o(y,t,p,m,h,v)}),s=y.filter(function(t){return!o(l,t,p,m,h,v)})):(u=[],s=y);var g=new C(t,N.replaceWith.bind(N,t));D=g;var w=e.slice(l.length-u.length);C.from(g,u,w,function(e){return e||g.abortReason?H.call(N,e,g):void C.to(g,s,m,v,function(e){H.call(N,e,g,{path:t,action:n,pathname:a.pathname,routes:y,params:m,query:v})})})}},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 w||(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=c.routes;return e&&e[t]},setRouteComponentAtDepth:function(t,n){e[t]=n},getCurrentPath:function(){return c.path},getCurrentPathname:function(){return c.pathname},getCurrentParams:function(){return c.params},getCurrentQuery:function(){return c.query},getCurrentRoutes:function(){return c.routes},isActive:function(t,e,n){return j.isAbsolute(t)?t===c.path:a(c.routes,t)&&u(c.params,e)&&(null==n||s(c.query,n))}},mixins:[b],propTypes:{children:P.falsy},childContextTypes:{routeDepth:P.number.isRequired,router:P.router.isRequired},getChildContext:function(){return{routeDepth:1,router:N}},getInitialState:function(){return c=y},componentWillReceiveProps:function(){this.setState(c=y)},componentWillUnmount:function(){N.stop()},render:function(){var t=N.getRouteAtDepth(0);return t?l.createElement(t.handler,this.props):null}});return N.clearAllRoutes(),t.routes&&N.addRoutes(t.routes),N}var l=n(21),f=n(36),p=n(34),h=n(35).canUseDOM,d=n(24),y=n(12),m=n(7),v=n(8),g=n(9),w=n(10),b=n(26),R=n(18),x=n(27),C=n(28),P=n(22),k=n(29),O=n(14),E=n(30),L=n(31),T=n(17),S=n(32),j=n(25),A=h?m:"/",_=h?y:null;t.exports=c},function(t,e,n){"use strict";function r(t,e,n){"function"==typeof e&&(n=e,e=null);var r=o({routes:t,location:e});return r.run(n),r}var o=n(19);t.exports=r},function(e){e.exports=t},function(t,e,n){"use strict";var r=n(33),o=n(21).PropTypes,i=n(17),a=r({},o,{falsy:function(t,e,n){return t[e]?new Error("<"+n+'> should not have a "'+e+'" prop'):void 0},route:o.instanceOf(i),router:o.func});t.exports=a},function(t,e,n){"use strict";var r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(){function t(t,e){for(var n=0;nc;++c)if(s=o[c],!s.isDefault&&!s.isNotFound&&(i=r(s,e,n)))return i.routes.unshift(t),i;var f=t.defaultRoute;if(f&&(h=a.extractParams(f.path,e)))return new u(e,h,n,[t,f]);var p=t.notFoundRoute;if(p&&(h=a.extractParams(p.path,e)))return new u(e,h,n,[t,p]);var h=a.extractParams(t.path,e);return h?new u(e,h,n,[t]):null}var o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function t(t,e){for(var n=0;nu;++u)i=r(t[u],n,o);return i}}]),t}();t.exports=u},function(t){"use strict";function e(){/*! taken from modernizr * https://github.com/Modernizr/Modernizr/blob/master/LICENSE * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js * changed to avoid false negatives for Windows Phones: https://github.com/rackt/react-router/issues/586 */ 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}t.exports=e},function(t){"use strict";function e(t){if(null==t)throw new TypeError("Object.assign target cannot be null or undefined");for(var e=Object(t),n=Object.prototype.hasOwnProperty,r=1;ru;++u){var c=a[u];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],u=Object.keys(t),s=0,c=u.length;c>s;++s){var l=u[s];r=r.concat(o.stringify(t[l],l,a))}return r.join(n)}},function(t,e,n){"use strict";var r=n(44),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 u=o[i],s=-1===u.indexOf("]=")?u.indexOf("="):u.indexOf("]=")+1;if(-1===s)n[r.decode(u)]="";else{var c=r.decode(u.slice(0,s)),l=r.decode(u.slice(s+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,u=parseInt(a,10),s=""+u;!isNaN(u)&&r!==a&&s===a&&u>=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 s=0;null!==(a=i.exec(t))&&su;++u){var c=a[u],l=o.parseKeys(c,n[c],e);i=r.merge(i,l)}return r.compact(i)}},function(t,e){"use strict";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],u=n[a];t[a]=t[a]?e.merge(t[a],u):u}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 u=Object.keys(t);for(i=0,a=u.length;a>i;++i){var s=u[i];t[s]=e.compact(t[s],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))}}])});