Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-router

Package Overview
Dependencies
Maintainers
2
Versions
564
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router - npm Package Compare versions

Comparing version 4.4.0-alpha.0 to 4.4.0-alpha.1

4

es/index.js

@@ -11,4 +11,4 @@ import _MemoryRouter from "./MemoryRouter";

export { _Router as Router };
import RouterContext from "./RouterContext";
import _RouterContext from "./RouterContext";
export { _RouterContext as RouterContext };
import _StaticRouter from "./StaticRouter";

@@ -15,0 +15,0 @@ export { _StaticRouter as StaticRouter };

"use strict";
exports.__esModule = true;
exports.withRouter = exports.matchPath = exports.generatePath = exports.Switch = exports.StaticRouter = exports.Router = exports.Route = exports.Redirect = exports.Prompt = exports.MemoryRouter = undefined;
exports.withRouter = exports.matchPath = exports.generatePath = exports.Switch = exports.StaticRouter = exports.RouterContext = exports.Router = exports.Route = exports.Redirect = exports.Prompt = exports.MemoryRouter = undefined;

@@ -26,5 +26,5 @@ var _MemoryRouter2 = require("./MemoryRouter");

var _RouterContext = require("./RouterContext");
var _RouterContext2 = require("./RouterContext");
var _RouterContext2 = _interopRequireDefault(_RouterContext);
var _RouterContext3 = _interopRequireDefault(_RouterContext2);

@@ -58,2 +58,3 @@ var _StaticRouter2 = require("./StaticRouter");

exports.Router = _Router3.default;
exports.RouterContext = _RouterContext3.default;
exports.StaticRouter = _StaticRouter3.default;

@@ -60,0 +61,0 @@ exports.Switch = _Switch3.default;

{
"name": "react-router",
"version": "4.4.0-alpha.0",
"version": "4.4.0-alpha.1",
"description": "Declarative routing for React",

@@ -5,0 +5,0 @@ "repository": "ReactTraining/react-router",

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

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

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