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

history

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

history - npm Package Compare versions

Comparing version 3.0.0-2 to 3.0.0

14

CHANGES.md

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

## [v3.0.0]
> May 30, 2016
- `location.query` has no prototype
- Warn about protocol-relative URLs ([#243])
- **Bugfix:** Ignore errors when saving hash history state if
`window.sessionStorage` is undefined ([#295])
- **Bugfix:** Fix replacing hash path in IE served via file protocol ([#126])
[v3.0.0]: https://github.com/mjackson/history/compare/v3.0.0-2...v3.0.0
[#243]: https://github.com/mjackson/history/issues/243
[#295]: https://github.com/mjackson/history/issues/295
[#126]: https://github.com/mjackson/history/issues/126
## [v3.0.0-2]

@@ -2,0 +16,0 @@ > Apr 19, 2016

11

lib/BrowserProtocol.js

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

var getCurrentLocation = exports.getCurrentLocation = function getCurrentLocation() {
return _createLocation(window.history.state);
var historyState = void 0;
try {
historyState = window.history.state || {};
} catch (error) {
// IE 11 sometimes throws when accessing window.history.state
// See https://github.com/mjackson/history/pull/289
historyState = {};
}
return _createLocation(historyState);
};

@@ -36,0 +45,0 @@

@@ -25,2 +25,9 @@ 'use strict';

var saveState = exports.saveState = function saveState(key, state) {
if (!window.sessionStorage) {
// Session storage is not available or hidden.
// sessionStorage is undefined in Internet Explorer when served via file protocol.
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(false, '[history] Unable to save state; sessionStorage is not available') : void 0;
return;
}
try {

@@ -27,0 +34,0 @@ if (state == null) {

4

lib/HashProtocol.js

@@ -52,3 +52,5 @@ 'use strict';

var replaceHashPath = function replaceHashPath(path) {
return window.location.replace(window.location.pathname + window.location.search + '#' + path);
var i = window.location.href.indexOf('#');
window.location.replace(window.location.href.slice(0, i >= 0 ? i : 0) + '#' + path);
};

@@ -55,0 +57,0 @@

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

});
exports.locationsAreEqual = exports.statesAreEqual = exports.createLocation = undefined;
exports.locationsAreEqual = exports.statesAreEqual = exports.createLocation = exports.createQuery = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _invariant = require('invariant');

@@ -21,2 +23,6 @@

var createQuery = exports.createQuery = function createQuery(props) {
return _extends(Object.create(null), props);
};
var createLocation = exports.createLocation = function createLocation() {

@@ -23,0 +29,0 @@ var input = arguments.length <= 0 || arguments[0] === undefined ? '/' : arguments[0];

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

var extractPath = function extractPath(string) {
var match = string.match(/^https?:\/\/[^\/]*/);
var match = string.match(/^(https?:)?\/\/[^\/]*/);
return match == null ? string : string.substring(match[0].length);

@@ -70,3 +70,3 @@ };

process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(path === pathname, 'A path must be pathname + search + hash only, not a fully qualified URL like "%s"', path) : void 0;
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(path === pathname, 'A path must be pathname + search + hash only, not a full URL like "%s"', path) : void 0;

@@ -73,0 +73,0 @@ var hashIndex = pathname.indexOf('#');

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

var _LocationUtils = require('./LocationUtils');
var _PathUtils = require('./PathUtils');

@@ -104,3 +106,3 @@

if (location.query) newLocation.query = location.query;
if (location.query) newLocation.query = (0, _LocationUtils.createQuery)(location.query);

@@ -107,0 +109,0 @@ return decodeQuery(newLocation);

{
"name": "history",
"version": "3.0.0-2",
"version": "3.0.0",
"description": "Manage browser history with JavaScript",

@@ -8,3 +8,2 @@ "author": "Michael Jackson",

"main": "lib",
"jsnext:main": "es6/index",
"repository": {

@@ -16,14 +15,12 @@ "type": "git",

"lib",
"umd",
"es6"
"umd"
],
"scripts": {
"start": "webpack-dev-server -d --content-base ./ --history-api-fallback --inline modules/index.js",
"build-cjs": "rimraf lib && babel ./modules -d lib --ignore '__tests__'",
"build-es6": "rimraf es6 && babel ./modules -d es6 --blacklist=es6.modules --ignore '__tests__'",
"build-umd": "NODE_ENV=production webpack modules/index.js umd/history.js",
"build-min": "NODE_ENV=production webpack -p modules/index.js umd/history.min.js",
"build-lib": "rimraf lib && babel ./modules -d lib --ignore '__tests__'",
"build-umd": "webpack modules/index.js umd/history.js",
"build-min": "webpack -p modules/index.js umd/history.min.js",
"build": "node ./scripts/build.js",
"release": "node ./scripts/release.js",
"prepublish": "npm run build",
"prepublish": "node ./scripts/build.js",
"test": "npm run lint && karma start",

@@ -34,22 +31,26 @@ "lint": "eslint modules"

"invariant": "^2.0.0",
"query-string": "^3.0.0",
"query-string": "^4.1.0",
"warning": "^2.0.0"
},
"devDependencies": {
"babel-cli": "^6.6.5",
"babel-cli": "^6.8.0",
"babel-eslint": "^6.0.0",
"babel-loader": "^6.2.4",
"babel-plugin-dev-expression": "^0.2.1",
"babel-plugin-transform-object-assign": "^6.8.0",
"babel-preset-es2015": "^6.6.0",
"babel-preset-stage-1": "^6.5.0",
"eslint": "^2.5.1",
"eslint-config-airbnb": "^6.0.2",
"eslint-plugin-react": "^4.1.0",
"expect": "^1.12.0",
"eslint-config-airbnb": "^9.0.1",
"eslint-plugin-import": "^1.8.1",
"eslint-plugin-jsx-a11y": "^1.2.2",
"eslint-plugin-react": "^5.1.1",
"expect": "^1.20.1",
"gzip-size": "^3.0.0",
"in-publish": "^2.0.0",
"karma": "^0.13.3",
"karma-browserstack-launcher": "^0.1.3",
"karma-chrome-launcher": "^0.2.0",
"karma-mocha": "^0.2.0",
"karma-mocha-reporter": "^1.0.4",
"karma-browserstack-launcher": "^1.0.0",
"karma-chrome-launcher": "^1.0.1",
"karma-mocha": "^1.0.1",
"karma-mocha-reporter": "^2.0.3",
"karma-sourcemap-loader": "^0.3.5",

@@ -78,5 +79,6 @@ "karma-webpack": "^1.7.0",

"plugins": [
"dev-expression"
"dev-expression",
"transform-object-assign"
]
}
}

@@ -120,6 +120,8 @@ (function webpackUniversalModuleDefinition(root, factory) {

});
exports.locationsAreEqual = exports.statesAreEqual = exports.createLocation = undefined;
exports.locationsAreEqual = exports.statesAreEqual = exports.createLocation = exports.createQuery = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _invariant = __webpack_require__(2);

@@ -135,2 +137,6 @@

var createQuery = exports.createQuery = function createQuery(props) {
return _extends(Object.create(null), props);
};
var createLocation = exports.createLocation = function createLocation() {

@@ -316,3 +322,3 @@ var input = arguments.length <= 0 || arguments[0] === undefined ? '/' : arguments[0];

var extractPath = function extractPath(string) {
var match = string.match(/^https?:\/\/[^\/]*/);
var match = string.match(/^(https?:)?\/\/[^\/]*/);
return match == null ? string : string.substring(match[0].length);

@@ -326,3 +332,3 @@ };

false ? (0, _warning2.default)(path === pathname, 'A path must be pathname + search + hash only, not a fully qualified URL like "%s"', path) : void 0;
false ? (0, _warning2.default)(path === pathname, 'A path must be pathname + search + hash only, not a full URL like "%s"', path) : void 0;

@@ -609,3 +615,12 @@ var hashIndex = pathname.indexOf('#');

var getCurrentLocation = exports.getCurrentLocation = function getCurrentLocation() {
return _createLocation(window.history.state);
var historyState = void 0;
try {
historyState = window.history.state || {};
} catch (error) {
// IE 11 sometimes throws when accessing window.history.state
// See https://github.com/mjackson/history/pull/289
historyState = {};
}
return _createLocation(historyState);
};

@@ -723,2 +738,9 @@

var saveState = exports.saveState = function saveState(key, state) {
if (!window.sessionStorage) {
// Session storage is not available or hidden.
// sessionStorage is undefined in Internet Explorer when served via file protocol.
false ? (0, _warning2.default)(false, '[history] Unable to save state; sessionStorage is not available') : void 0;
return;
}
try {

@@ -1273,3 +1295,5 @@ if (state == null) {

var replaceHashPath = function replaceHashPath(path) {
return window.location.replace(window.location.pathname + window.location.search + '#' + path);
var i = window.location.href.indexOf('#');
window.location.replace(window.location.href.slice(0, i >= 0 ? i : 0) + '#' + path);
};

@@ -1722,2 +1746,4 @@

var _LocationUtils = __webpack_require__(1);
var _PathUtils = __webpack_require__(3);

@@ -1811,3 +1837,3 @@

if (location.query) newLocation.query = location.query;
if (location.query) newLocation.query = (0, _LocationUtils.createQuery)(location.query);

@@ -1838,3 +1864,12 @@ return decodeQuery(newLocation);

var strictUriEncode = __webpack_require__(22);
var objectAssign = __webpack_require__(23);
function encode(value, opts) {
if (opts.encode) {
return opts.strict ? strictUriEncode(value) : encodeURIComponent(value);
}
return value;
}
exports.extract = function (str) {

@@ -1845,4 +1880,8 @@ return str.split('?')[1] || '';

exports.parse = function (str) {
// Create an object with no prototype
// https://github.com/sindresorhus/query-string/issues/47
var ret = Object.create(null);
if (typeof str !== 'string') {
return {};
return ret;
}

@@ -1853,6 +1892,6 @@

if (!str) {
return {};
return ret;
}
return str.split('&').reduce(function (ret, param) {
str.split('&').forEach(function (param) {
var parts = param.replace(/\+/g, ' ').split('=');

@@ -1870,3 +1909,3 @@ // Firefox (pre 40) decodes `%3D` to `=`

if (!ret.hasOwnProperty(key)) {
if (ret[key] === undefined) {
ret[key] = val;

@@ -1878,8 +1917,15 @@ } else if (Array.isArray(ret[key])) {

}
});
return ret;
}, {});
return ret;
};
exports.stringify = function (obj) {
exports.stringify = function (obj, opts) {
var defaults = {
encode: true,
strict: true
};
opts = objectAssign(defaults, opts);
return obj ? Object.keys(obj).sort().map(function (key) {

@@ -1897,8 +1943,20 @@ var val = obj[key];

if (Array.isArray(val)) {
return val.slice().sort().map(function (val2) {
return strictUriEncode(key) + '=' + strictUriEncode(val2);
}).join('&');
var result = [];
val.slice().sort().forEach(function (val2) {
if (val2 === undefined) {
return;
}
if (val2 === null) {
result.push(encode(key, opts));
} else {
result.push(encode(key, opts) + '=' + encode(val2, opts));
}
});
return result.join('&');
}
return strictUriEncode(key) + '=' + strictUriEncode(val);
return encode(key, opts) + '=' + encode(val, opts);
}).filter(function (x) {

@@ -1922,2 +1980,91 @@ return x.length > 0;

/***/ },
/* 23 */
/***/ function(module, exports) {
'use strict';
/* eslint-disable no-unused-vars */
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
}
// Detect buggy property enumeration order in older V8 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line
test1[5] = 'de';
if (Object.getOwnPropertyNames(test1)[0] === '5') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test2 = {};
for (var i = 0; i < 10; i++) {
test2['_' + String.fromCharCode(i)] = i;
}
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
return test2[n];
});
if (order2.join('') !== '0123456789') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test3 = {};
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (e) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (Object.getOwnPropertySymbols) {
symbols = Object.getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
/***/ }

@@ -1924,0 +2071,0 @@ /******/ ])

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.History=t():e.History=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.locationsAreEqual=t.Actions=t.useQueries=t.useBeforeUnload=t.useBasename=t.createMemoryHistory=t.createHashHistory=t.createHistory=void 0;var o=n(2);Object.defineProperty(t,"locationsAreEqual",{enumerable:!0,get:function(){return o.locationsAreEqual}});var i=n(15),a=r(i),u=n(16),c=r(u),f=n(17),s=r(f),l=n(18),d=r(l),p=n(19),v=r(p),h=n(20),y=r(h),g=n(6),m=r(g);t.createHistory=a["default"],t.createHashHistory=c["default"],t.createMemoryHistory=s["default"],t.useBasename=d["default"],t.useBeforeUnload=v["default"],t.useQueries=y["default"],t.Actions=m["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.createPath=t.parsePath=t.getQueryStringValueFromPath=t.stripQueryStringValueFromPath=t.addQueryStringValueToPath=t.isAbsolutePath=void 0;var o=n(3),i=(r(o),t.isAbsolutePath=function(e){return"string"==typeof e&&"/"===e.charAt(0)},t.addQueryStringValueToPath=function(e,t,n){var r=a(e),o=r.pathname,i=r.search,c=r.hash;return u({pathname:o,search:i+(-1===i.indexOf("?")?"?":"&")+t+"="+n,hash:c})},t.stripQueryStringValueFromPath=function(e,t){var n=a(e),r=n.pathname,o=n.search,i=n.hash;return u({pathname:r,search:o.replace(new RegExp("([?&])"+t+"=[a-zA-Z0-9]+(&?)"),function(e,t,n){return"?"===t?t:n}),hash:i})},t.getQueryStringValueFromPath=function(e,t){var n=a(e),r=n.search,o=r.match(new RegExp("[?&]"+t+"=([a-zA-Z0-9]+)"));return o&&o[1]},function(e){var t=e.match(/^https?:\/\/[^\/]*/);return null==t?e:e.substring(t[0].length)}),a=t.parsePath=function(e){var t=i(e),n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substring(o),t=t.substring(0,o));var a=t.indexOf("?");return-1!==a&&(n=t.substring(a),t=t.substring(0,a)),""===t&&(t="/"),{pathname:t,search:n,hash:r}},u=t.createPath=function(e){if(null==e||"string"==typeof e)return e;var t=e.basename,n=e.pathname,r=e.search,o=e.hash,i=(t||"")+n;return r&&"?"!==r&&(i+=r),o&&(i+=o),i}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.locationsAreEqual=t.statesAreEqual=t.createLocation=void 0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},i=n(5),a=r(i),u=n(1),c=n(6),f=(t.createLocation=function(){var e=arguments.length<=0||void 0===arguments[0]?"/":arguments[0],t=arguments.length<=1||void 0===arguments[1]?c.POP:arguments[1],n=arguments.length<=2||void 0===arguments[2]?null:arguments[2],r="string"==typeof e?(0,u.parsePath)(e):e,o=r.pathname||"/",i=r.search||"",a=r.hash||"",f=r.state;return{pathname:o,search:i,hash:a,state:f,action:t,key:n}},function(e){return"[object Date]"===Object.prototype.toString.call(e)}),s=t.statesAreEqual=function l(e,t){if(e===t)return!0;var n="undefined"==typeof e?"undefined":o(e),r="undefined"==typeof t?"undefined":o(t);return n!==r?!1:("function"===n?(0,a["default"])(!1):void 0,"object"===n?(f(e)&&f(t)?(0,a["default"])(!1):void 0,Array.isArray(e)?Array.isArray(t)&&e.length===t.length&&e.every(function(e,n){return l(e,t[n])}):Object.keys(e).every(function(n){return l(e[n],t[n])})):!1)};t.locationsAreEqual=function(e,t){return e.key===t.key&&e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&s(e.state,t.state)}},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.addEventListener=function(e,t,n){return e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)},t.removeEventListener=function(e,t,n){return e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},t.supportsHistory=function(){var e=window.navigator.userAgent;return-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone")?window.history&&"pushState"in window.history:!1},t.supportsGoWithoutReloadUsingHash=function(){return-1===window.navigator.userAgent.indexOf("Firefox")}},function(e,t,n){"use strict";var r=function(e,t,n,r,o,i,a,u){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[n,r,o,i,a,u],s=0;c=new Error(t.replace(/%s/g,function(){return f[s++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}};e.exports=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PUSH="PUSH",t.REPLACE="REPLACE",t.POP="POP"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.go=t.replaceLocation=t.pushLocation=t.startListener=t.getUserConfirmation=t.getCurrentLocation=void 0;var r=n(2),o=n(4),i=n(11),a=n(1),u="popstate",c=function(e){var t=e&&e.key;return(0,r.createLocation)({pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,state:t?(0,i.readState)(t):void 0},void 0,t)},f=(t.getCurrentLocation=function(){return c(window.history.state)},t.getUserConfirmation=function(e,t){return t(window.confirm(e))},t.startListener=function(e){var t=function(t){void 0!==t.state&&e(c(t.state))};return(0,o.addEventListener)(window,u,t),function(){return(0,o.removeEventListener)(window,u,t)}},function(e,t){var n=e.state,r=e.key;void 0!==n&&(0,i.saveState)(r,n),t({key:r},(0,a.createPath)(e))});t.pushLocation=function(e){return f(e,function(e,t){return window.history.pushState(e,null,t)})},t.replaceLocation=function(e){return f(e,function(e,t){return window.history.replaceState(e,null,t)})},t.go=function(e){e&&window.history.go(e)}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0});var i=n(12),a=n(1),u=n(10),c=r(u),f=n(6),s=n(2),l=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.getCurrentLocation,n=e.getUserConfirmation,r=e.pushLocation,u=e.replaceLocation,l=e.go,d=e.keyLength,p=void 0,v=void 0,h=[],y=[],g=[],m=function(){return v&&v.action===f.POP?g.indexOf(v.key):p?g.indexOf(p.key):-1},P=function(e){p=e;var t=m();p.action===f.PUSH?g=[].concat(o(g.slice(0,t+1)),[p.key]):p.action===f.REPLACE&&(g[t]=p.key),y.forEach(function(e){return e(p)})},w=function(e){return h.push(e),function(){return h=h.filter(function(t){return t!==e})}},O=function(e){return y.push(e),function(){return y=y.filter(function(t){return t!==e})}},L=function(e,t){(0,i.loopAsync)(h.length,function(t,n,r){(0,c["default"])(h[t],e,function(e){return null!=e?r(e):n()})},function(e){n&&"string"==typeof e?n(e,function(e){return t(e!==!1)}):t(e!==!1)})},b=function(e){p&&(0,s.locationsAreEqual)(p,e)||v&&(0,s.locationsAreEqual)(v,e)||(v=e,L(e,function(t){if(v===e)if(v=null,t){if(e.action===f.PUSH){var n=(0,a.createPath)(p),o=(0,a.createPath)(e);o===n&&(0,s.statesAreEqual)(p.state,e.state)&&(e.action=f.REPLACE)}e.action===f.POP?P(e):e.action===f.PUSH?r(e)!==!1&&P(e):e.action===f.REPLACE&&u(e)!==!1&&P(e)}else if(p&&e.action===f.POP){var i=g.indexOf(p.key),c=g.indexOf(e.key);-1!==i&&-1!==c&&l(i-c)}}))},_=function(e){return b(S(e,f.PUSH))},A=function(e){return b(S(e,f.REPLACE))},E=function(){return l(-1)},j=function(){return l(1)},C=function(){return Math.random().toString(36).substr(2,d||6)},M=function(e){return(0,a.createPath)(e)},S=function(e,t){var n=arguments.length<=2||void 0===arguments[2]?C():arguments[2];return(0,s.createLocation)(e,t,n)};return{getCurrentLocation:t,listenBefore:w,listen:O,transitionTo:b,push:_,replace:A,go:l,goBack:E,goForward:j,createKey:C,createPath:a.createPath,createHref:M,createLocation:S}};t["default"]=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),i=(r(o),function(e,t,n){var r=e(t,n);e.length<2&&n(r)});t["default"]=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.readState=t.saveState=void 0;var o=n(3),i=(r(o),["QuotaExceededError","QUOTA_EXCEEDED_ERR"]),a="SecurityError",u="@@History/",c=function(e){return u+e};t.saveState=function(e,t){try{null==t?window.sessionStorage.removeItem(c(e)):window.sessionStorage.setItem(c(e),JSON.stringify(t))}catch(n){if(n.name===a)return;if(i.indexOf(n.name)>=0&&0===window.sessionStorage.length)return;throw n}},t.readState=function(e){var t=void 0;try{t=window.sessionStorage.getItem(c(e))}catch(n){if(n.name===a)return}if(t)try{return JSON.parse(t)}catch(n){}}},function(e,t){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0});t.loopAsync=function(e,t,r){var o=0,i=!1,a=!1,u=!1,c=void 0,f=function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return i=!0,a?void(c=t):void r.apply(void 0,t)},s=function l(){if(!i&&(u=!0,!a)){for(a=!0;!i&&e>o&&u;)u=!1,t(o++,l,f);return a=!1,i?void r.apply(void 0,n(c)):void(o>=e&&u&&(i=!0,r()))}};s()}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.replaceLocation=t.pushLocation=t.startListener=t.getCurrentLocation=t.go=t.getUserConfirmation=void 0;var o=n(7);Object.defineProperty(t,"getUserConfirmation",{enumerable:!0,get:function(){return o.getUserConfirmation}}),Object.defineProperty(t,"go",{enumerable:!0,get:function(){return o.go}});var i=n(3),a=(r(i),n(2)),u=n(4),c=n(11),f=n(1),s="hashchange",l=function(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)},d=function(e){return window.location.hash=e},p=function(e){return window.location.replace(window.location.pathname+window.location.search+"#"+e)},v=function(){var e=l();return(0,f.isAbsolutePath)(e)?!0:(p("/"+e),!1)},h=t.getCurrentLocation=function(e){var t=l(),n=(0,f.getQueryStringValueFromPath)(t,e),r=void 0;n&&(t=(0,f.stripQueryStringValueFromPath)(t,e),r=(0,c.readState)(n));var o=(0,f.parsePath)(t);return o.state=r,(0,a.createLocation)(o,void 0,n)},y=void 0,g=(t.startListener=function(e,t){var n=function(){if(v()){var n=h(t);y&&n.key&&y.key===n.key||(y=n,e(n))}};return v(),(0,u.addEventListener)(window,s,n),function(){return(0,u.removeEventListener)(window,s,n)}},function(e,t,n){var r=e.state,o=e.key,i=(0,f.createPath)(e);void 0!==r&&(i=(0,f.addQueryStringValueToPath)(i,t,o),(0,c.saveState)(o,r)),y=e,n(i)});t.pushLocation=function(e,t){return g(e,t,function(e){l()!==e&&d(e)})},t.replaceLocation=function(e,t){return g(e,t,function(e){l()!==e&&p(e)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.replaceLocation=t.pushLocation=t.getCurrentLocation=t.go=t.getUserConfirmation=void 0;var r=n(7);Object.defineProperty(t,"getUserConfirmation",{enumerable:!0,get:function(){return r.getUserConfirmation}}),Object.defineProperty(t,"go",{enumerable:!0,get:function(){return r.go}});var o=n(2),i=n(1);t.getCurrentLocation=function(){return(0,o.createLocation)(window.location)},t.pushLocation=function(e){return window.location.href=(0,i.createPath)(e),!1},t.replaceLocation=function(e){return window.location.replace((0,i.createPath)(e)),!1}},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(5),u=o(a),c=n(8),f=n(7),s=r(f),l=n(14),d=r(l),p=n(4),v=n(9),h=o(v),y=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];c.canUseDOM?void 0:(0,u["default"])(!1);var t=e.forceRefresh||!(0,p.supportsHistory)(),n=t?d:s,r=n.getUserConfirmation,o=n.getCurrentLocation,a=n.pushLocation,f=n.replaceLocation,l=n.go,v=(0,h["default"])(i({getUserConfirmation:r},e,{getCurrentLocation:o,pushLocation:a,replaceLocation:f,go:l})),y=0,g=void 0,m=function(e,t){1===++y&&(g=s.startListener(v.transitionTo));var n=t?v.listenBefore(e):v.listen(e);return function(){n(),0===--y&&g()}},P=function(e){return m(e,!0)},w=function(e){return m(e,!1)};return i({},v,{listenBefore:P,listen:w})};t["default"]=y},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(3),u=(o(a),n(5)),c=o(u),f=n(8),s=n(4),l=n(13),d=r(l),p=n(9),v=o(p),h="_k",y=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];f.canUseDOM?void 0:(0,c["default"])(!1);var t=e.queryKey;"string"!=typeof t&&(t=h);var n=d.getUserConfirmation,r=function(){return d.getCurrentLocation(t)},o=function(e){return d.pushLocation(e,t)},a=function(e){return d.replaceLocation(e,t)},u=(0,v["default"])(i({getUserConfirmation:n},e,{getCurrentLocation:r,pushLocation:o,replaceLocation:a,go:d.go})),l=0,p=void 0,y=function(e,n){1===++l&&(p=d.startListener(u.transitionTo,t));var r=n?u.listenBefore(e):u.listen(e);return function(){r(),0===--l&&p()}},g=function(e){return y(e,!0)},m=function(e){return y(e,!1)},P=((0,s.supportsGoWithoutReloadUsingHash)(),function(e){u.go(e)}),w=function(e){return"#"+u.createHref(e)};return i({},u,{listenBefore:g,listen:m,go:P,createHref:w})};t["default"]=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(3),a=(r(i),n(5)),u=r(a),c=n(2),f=n(1),s=n(9),l=r(s),d=n(6),p=function(e){return e.filter(function(e){return e.state}).reduce(function(e,t){return e[t.key]=t.state,e},{})},v=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];Array.isArray(e)?e={entries:e}:"string"==typeof e&&(e={entries:[e]});var t=function(){var e=h[y],t=(0,f.createPath)(e),n=void 0,r=void 0;e.key&&(n=e.key,r=P(n));var i=(0,f.parsePath)(t);return(0,c.createLocation)(o({},i,{state:r}),void 0,n)},n=function(e){var t=y+e;return t>=0&&t<h.length},r=function(e){if(e&&n(e)){y+=e;var r=t();s.transitionTo(o({},r,{action:d.POP}))}},i=function(e){y+=1,y<h.length&&h.splice(y),h.push(e),m(e.key,e.state)},a=function(e){h[y]=e,m(e.key,e.state)},s=(0,l["default"])(o({},e,{getCurrentLocation:t,pushLocation:i,replaceLocation:a,go:r})),v=e,h=v.entries,y=v.current;"string"==typeof h?h=[h]:Array.isArray(h)||(h=["/"]),h=h.map(function(e){return(0,c.createLocation)(e)}),null==y?y=h.length-1:y>=0&&y<h.length?void 0:(0,u["default"])(!1);var g=p(h),m=function(e,t){return g[e]=t},P=function(e){return g[e]};return s};t["default"]=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(10),a=r(i),u=n(1),c=function(e){return function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e(t),r=t.basename,i=function(e){return e?(r&&null==e.basename&&(0===e.pathname.indexOf(r)?(e.pathname=e.pathname.substring(r.length),e.basename=r,""===e.pathname&&(e.pathname="/")):e.basename=""),e):e},c=function(e){if(!r)return e;var t="string"==typeof e?(0,u.parsePath)(e):e,n=t.pathname,i="/"===r.slice(-1)?r:r+"/",a="/"===n.charAt(0)?n.slice(1):n,c=i+a;return o({},e,{pathname:c})},f=function(){return i(n.getCurrentLocation())},s=function(e){return n.listenBefore(function(t,n){return(0,a["default"])(e,i(t),n)})},l=function(e){return n.listen(function(t){return e(i(t))})},d=function(e){return n.push(c(e))},p=function(e){return n.replace(c(e))},v=function(e){return n.createPath(c(e))},h=function(e){return n.createHref(c(e))},y=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;t>o;o++)r[o-1]=arguments[o];return i(n.createLocation.apply(n,[c(e)].concat(r)))};return o({},n,{getCurrentLocation:f,listenBefore:s,listen:l,push:d,replace:p,createPath:v,createHref:h,createLocation:y})}};t["default"]=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(5),a=r(i),u=n(4),c=n(8),f=function(e){var t=function(t){var n=e();return"string"==typeof n?((t||window.event).returnValue=n,n):void 0};return(0,u.addEventListener)(window,"beforeunload",t),function(){return(0,u.removeEventListener)(window,"beforeunload",t)}},s=function(e){return c.canUseDOM?void 0:(0,a["default"])(!1),function(t){var n=e(t),r=[],i=void 0,a=function(){for(var e=void 0,t=0,n=r.length;null==e&&n>t;++t)e=r[t].call();return e},u=function(e){return 1===r.push(e)&&(i=f(a)),function(){r=r.filter(function(t){return t!==e}),0===r.length&&i&&(i(),i=null)}};return o({},n,{listenBeforeUnload:u})}};t["default"]=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(21),a=n(10),u=r(a),c=n(1),f=function(e){return(0,i.stringify)(e).replace(/%20/g,"+")},s=i.parse,l=function(e){return function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e(t),r=t.stringifyQuery,i=t.parseQueryString;"function"!=typeof r&&(r=f),"function"!=typeof i&&(i=s);var a=function(e){return e?(null==e.query&&(e.query=i(e.search.substring(1))),e):e},l=function(e,t){if(null==t)return e;var n="string"==typeof e?(0,c.parsePath)(e):e,i=r(t),a=i?"?"+i:"";return o({},n,{search:a})},d=function(){return a(n.getCurrentLocation())},p=function(e){return n.listenBefore(function(t,n){return(0,u["default"])(e,a(t),n)})},v=function(e){return n.listen(function(t){return e(a(t))})},h=function(e){return n.push(l(e,e.query))},y=function(e){return n.replace(l(e,e.query))},g=function(e){return n.createPath(l(e,e.query))},m=function(e){return n.createHref(l(e,e.query))},P=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;t>o;o++)r[o-1]=arguments[o];var i=n.createLocation.apply(n,[l(e,e.query)].concat(r));return e.query&&(i.query=e.query),a(i)};return o({},n,{getCurrentLocation:d,listenBefore:p,listen:v,push:h,replace:y,createPath:g,createHref:m,createLocation:P})}};t["default"]=l},function(e,t,n){"use strict";var r=n(22);t.extract=function(e){return e.split("?")[1]||""},t.parse=function(e){return"string"!=typeof e?{}:(e=e.trim().replace(/^(\?|#|&)/,""),e?e.split("&").reduce(function(e,t){var n=t.replace(/\+/g," ").split("="),r=n.shift(),o=n.length>0?n.join("="):void 0;return r=decodeURIComponent(r),o=void 0===o?null:decodeURIComponent(o),e.hasOwnProperty(r)?Array.isArray(e[r])?e[r].push(o):e[r]=[e[r],o]:e[r]=o,e},{}):{})},t.stringify=function(e){return e?Object.keys(e).sort().map(function(t){var n=e[t];return void 0===n?"":null===n?t:Array.isArray(n)?n.slice().sort().map(function(e){return r(t)+"="+r(e)}).join("&"):r(t)+"="+r(n)}).filter(function(e){return e.length>0}).join("&"):""}},function(e,t){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.History=t():e.History=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.locationsAreEqual=t.Actions=t.useQueries=t.useBeforeUnload=t.useBasename=t.createMemoryHistory=t.createHashHistory=t.createHistory=void 0;var o=n(2);Object.defineProperty(t,"locationsAreEqual",{enumerable:!0,get:function(){return o.locationsAreEqual}});var i=n(15),a=r(i),u=n(16),c=r(u),f=n(17),s=r(f),l=n(18),d=r(l),p=n(19),v=r(p),h=n(20),y=r(h),g=n(6),m=r(g);t.createHistory=a["default"],t.createHashHistory=c["default"],t.createMemoryHistory=s["default"],t.useBasename=d["default"],t.useBeforeUnload=v["default"],t.useQueries=y["default"],t.Actions=m["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.createPath=t.parsePath=t.getQueryStringValueFromPath=t.stripQueryStringValueFromPath=t.addQueryStringValueToPath=t.isAbsolutePath=void 0;var o=n(3),i=(r(o),t.isAbsolutePath=function(e){return"string"==typeof e&&"/"===e.charAt(0)},t.addQueryStringValueToPath=function(e,t,n){var r=a(e),o=r.pathname,i=r.search,c=r.hash;return u({pathname:o,search:i+(-1===i.indexOf("?")?"?":"&")+t+"="+n,hash:c})},t.stripQueryStringValueFromPath=function(e,t){var n=a(e),r=n.pathname,o=n.search,i=n.hash;return u({pathname:r,search:o.replace(new RegExp("([?&])"+t+"=[a-zA-Z0-9]+(&?)"),function(e,t,n){return"?"===t?t:n}),hash:i})},t.getQueryStringValueFromPath=function(e,t){var n=a(e),r=n.search,o=r.match(new RegExp("[?&]"+t+"=([a-zA-Z0-9]+)"));return o&&o[1]},function(e){var t=e.match(/^(https?:)?\/\/[^\/]*/);return null==t?e:e.substring(t[0].length)}),a=t.parsePath=function(e){var t=i(e),n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substring(o),t=t.substring(0,o));var a=t.indexOf("?");return-1!==a&&(n=t.substring(a),t=t.substring(0,a)),""===t&&(t="/"),{pathname:t,search:n,hash:r}},u=t.createPath=function(e){if(null==e||"string"==typeof e)return e;var t=e.basename,n=e.pathname,r=e.search,o=e.hash,i=(t||"")+n;return r&&"?"!==r&&(i+=r),o&&(i+=o),i}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.locationsAreEqual=t.statesAreEqual=t.createLocation=t.createQuery=void 0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(5),u=r(a),c=n(1),f=n(6),s=(t.createQuery=function(e){return i(Object.create(null),e)},t.createLocation=function(){var e=arguments.length<=0||void 0===arguments[0]?"/":arguments[0],t=arguments.length<=1||void 0===arguments[1]?f.POP:arguments[1],n=arguments.length<=2||void 0===arguments[2]?null:arguments[2],r="string"==typeof e?(0,c.parsePath)(e):e,o=r.pathname||"/",i=r.search||"",a=r.hash||"",u=r.state;return{pathname:o,search:i,hash:a,state:u,action:t,key:n}},function(e){return"[object Date]"===Object.prototype.toString.call(e)}),l=t.statesAreEqual=function d(e,t){if(e===t)return!0;var n="undefined"==typeof e?"undefined":o(e),r="undefined"==typeof t?"undefined":o(t);return n!==r?!1:("function"===n?(0,u["default"])(!1):void 0,"object"===n?(s(e)&&s(t)?(0,u["default"])(!1):void 0,Array.isArray(e)?Array.isArray(t)&&e.length===t.length&&e.every(function(e,n){return d(e,t[n])}):Object.keys(e).every(function(n){return d(e[n],t[n])})):!1)};t.locationsAreEqual=function(e,t){return e.key===t.key&&e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&l(e.state,t.state)}},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.addEventListener=function(e,t,n){return e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)},t.removeEventListener=function(e,t,n){return e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},t.supportsHistory=function(){var e=window.navigator.userAgent;return-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone")?window.history&&"pushState"in window.history:!1},t.supportsGoWithoutReloadUsingHash=function(){return-1===window.navigator.userAgent.indexOf("Firefox")}},function(e,t,n){"use strict";var r=function(e,t,n,r,o,i,a,u){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[n,r,o,i,a,u],s=0;c=new Error(t.replace(/%s/g,function(){return f[s++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}};e.exports=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PUSH="PUSH",t.REPLACE="REPLACE",t.POP="POP"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.go=t.replaceLocation=t.pushLocation=t.startListener=t.getUserConfirmation=t.getCurrentLocation=void 0;var r=n(2),o=n(4),i=n(11),a=n(1),u="popstate",c=function(e){var t=e&&e.key;return(0,r.createLocation)({pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,state:t?(0,i.readState)(t):void 0},void 0,t)},f=(t.getCurrentLocation=function(){var e=void 0;try{e=window.history.state||{}}catch(t){e={}}return c(e)},t.getUserConfirmation=function(e,t){return t(window.confirm(e))},t.startListener=function(e){var t=function(t){void 0!==t.state&&e(c(t.state))};return(0,o.addEventListener)(window,u,t),function(){return(0,o.removeEventListener)(window,u,t)}},function(e,t){var n=e.state,r=e.key;void 0!==n&&(0,i.saveState)(r,n),t({key:r},(0,a.createPath)(e))});t.pushLocation=function(e){return f(e,function(e,t){return window.history.pushState(e,null,t)})},t.replaceLocation=function(e){return f(e,function(e,t){return window.history.replaceState(e,null,t)})},t.go=function(e){e&&window.history.go(e)}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0});var i=n(12),a=n(1),u=n(10),c=r(u),f=n(6),s=n(2),l=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.getCurrentLocation,n=e.getUserConfirmation,r=e.pushLocation,u=e.replaceLocation,l=e.go,d=e.keyLength,p=void 0,v=void 0,h=[],y=[],g=[],m=function(){return v&&v.action===f.POP?g.indexOf(v.key):p?g.indexOf(p.key):-1},O=function(e){p=e;var t=m();p.action===f.PUSH?g=[].concat(o(g.slice(0,t+1)),[p.key]):p.action===f.REPLACE&&(g[t]=p.key),y.forEach(function(e){return e(p)})},b=function(e){return h.push(e),function(){return h=h.filter(function(t){return t!==e})}},P=function(e){return y.push(e),function(){return y=y.filter(function(t){return t!==e})}},w=function(e,t){(0,i.loopAsync)(h.length,function(t,n,r){(0,c["default"])(h[t],e,function(e){return null!=e?r(e):n()})},function(e){n&&"string"==typeof e?n(e,function(e){return t(e!==!1)}):t(e!==!1)})},L=function(e){p&&(0,s.locationsAreEqual)(p,e)||v&&(0,s.locationsAreEqual)(v,e)||(v=e,w(e,function(t){if(v===e)if(v=null,t){if(e.action===f.PUSH){var n=(0,a.createPath)(p),o=(0,a.createPath)(e);o===n&&(0,s.statesAreEqual)(p.state,e.state)&&(e.action=f.REPLACE)}e.action===f.POP?O(e):e.action===f.PUSH?r(e)!==!1&&O(e):e.action===f.REPLACE&&u(e)!==!1&&O(e)}else if(p&&e.action===f.POP){var i=g.indexOf(p.key),c=g.indexOf(e.key);-1!==i&&-1!==c&&l(i-c)}}))},_=function(e){return L(M(e,f.PUSH))},j=function(e){return L(M(e,f.REPLACE))},A=function(){return l(-1)},E=function(){return l(1)},S=function(){return Math.random().toString(36).substr(2,d||6)},C=function(e){return(0,a.createPath)(e)},M=function(e,t){var n=arguments.length<=2||void 0===arguments[2]?S():arguments[2];return(0,s.createLocation)(e,t,n)};return{getCurrentLocation:t,listenBefore:b,listen:P,transitionTo:L,push:_,replace:j,go:l,goBack:A,goForward:E,createKey:S,createPath:a.createPath,createHref:C,createLocation:M}};t["default"]=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),i=(r(o),function(e,t,n){var r=e(t,n);e.length<2&&n(r)});t["default"]=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.readState=t.saveState=void 0;var o=n(3),i=(r(o),["QuotaExceededError","QUOTA_EXCEEDED_ERR"]),a="SecurityError",u="@@History/",c=function(e){return u+e};t.saveState=function(e,t){if(window.sessionStorage)try{null==t?window.sessionStorage.removeItem(c(e)):window.sessionStorage.setItem(c(e),JSON.stringify(t))}catch(n){if(n.name===a)return;if(i.indexOf(n.name)>=0&&0===window.sessionStorage.length)return;throw n}},t.readState=function(e){var t=void 0;try{t=window.sessionStorage.getItem(c(e))}catch(n){if(n.name===a)return}if(t)try{return JSON.parse(t)}catch(n){}}},function(e,t){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0});t.loopAsync=function(e,t,r){var o=0,i=!1,a=!1,u=!1,c=void 0,f=function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return i=!0,a?void(c=t):void r.apply(void 0,t)},s=function l(){if(!i&&(u=!0,!a)){for(a=!0;!i&&e>o&&u;)u=!1,t(o++,l,f);return a=!1,i?void r.apply(void 0,n(c)):void(o>=e&&u&&(i=!0,r()))}};s()}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.replaceLocation=t.pushLocation=t.startListener=t.getCurrentLocation=t.go=t.getUserConfirmation=void 0;var o=n(7);Object.defineProperty(t,"getUserConfirmation",{enumerable:!0,get:function(){return o.getUserConfirmation}}),Object.defineProperty(t,"go",{enumerable:!0,get:function(){return o.go}});var i=n(3),a=(r(i),n(2)),u=n(4),c=n(11),f=n(1),s="hashchange",l=function(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)},d=function(e){return window.location.hash=e},p=function(e){var t=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,t>=0?t:0)+"#"+e)},v=function(){var e=l();return(0,f.isAbsolutePath)(e)?!0:(p("/"+e),!1)},h=t.getCurrentLocation=function(e){var t=l(),n=(0,f.getQueryStringValueFromPath)(t,e),r=void 0;n&&(t=(0,f.stripQueryStringValueFromPath)(t,e),r=(0,c.readState)(n));var o=(0,f.parsePath)(t);return o.state=r,(0,a.createLocation)(o,void 0,n)},y=void 0,g=(t.startListener=function(e,t){var n=function(){if(v()){var n=h(t);y&&n.key&&y.key===n.key||(y=n,e(n))}};return v(),(0,u.addEventListener)(window,s,n),function(){return(0,u.removeEventListener)(window,s,n)}},function(e,t,n){var r=e.state,o=e.key,i=(0,f.createPath)(e);void 0!==r&&(i=(0,f.addQueryStringValueToPath)(i,t,o),(0,c.saveState)(o,r)),y=e,n(i)});t.pushLocation=function(e,t){return g(e,t,function(e){l()!==e&&d(e)})},t.replaceLocation=function(e,t){return g(e,t,function(e){l()!==e&&p(e)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.replaceLocation=t.pushLocation=t.getCurrentLocation=t.go=t.getUserConfirmation=void 0;var r=n(7);Object.defineProperty(t,"getUserConfirmation",{enumerable:!0,get:function(){return r.getUserConfirmation}}),Object.defineProperty(t,"go",{enumerable:!0,get:function(){return r.go}});var o=n(2),i=n(1);t.getCurrentLocation=function(){return(0,o.createLocation)(window.location)},t.pushLocation=function(e){return window.location.href=(0,i.createPath)(e),!1},t.replaceLocation=function(e){return window.location.replace((0,i.createPath)(e)),!1}},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(5),u=o(a),c=n(8),f=n(7),s=r(f),l=n(14),d=r(l),p=n(4),v=n(9),h=o(v),y=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];c.canUseDOM?void 0:(0,u["default"])(!1);var t=e.forceRefresh||!(0,p.supportsHistory)(),n=t?d:s,r=n.getUserConfirmation,o=n.getCurrentLocation,a=n.pushLocation,f=n.replaceLocation,l=n.go,v=(0,h["default"])(i({getUserConfirmation:r},e,{getCurrentLocation:o,pushLocation:a,replaceLocation:f,go:l})),y=0,g=void 0,m=function(e,t){1===++y&&(g=s.startListener(v.transitionTo));var n=t?v.listenBefore(e):v.listen(e);return function(){n(),0===--y&&g()}},O=function(e){return m(e,!0)},b=function(e){return m(e,!1)};return i({},v,{listenBefore:O,listen:b})};t["default"]=y},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(3),u=(o(a),n(5)),c=o(u),f=n(8),s=n(4),l=n(13),d=r(l),p=n(9),v=o(p),h="_k",y=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];f.canUseDOM?void 0:(0,c["default"])(!1);var t=e.queryKey;"string"!=typeof t&&(t=h);var n=d.getUserConfirmation,r=function(){return d.getCurrentLocation(t)},o=function(e){return d.pushLocation(e,t)},a=function(e){return d.replaceLocation(e,t)},u=(0,v["default"])(i({getUserConfirmation:n},e,{getCurrentLocation:r,pushLocation:o,replaceLocation:a,go:d.go})),l=0,p=void 0,y=function(e,n){1===++l&&(p=d.startListener(u.transitionTo,t));var r=n?u.listenBefore(e):u.listen(e);return function(){r(),0===--l&&p()}},g=function(e){return y(e,!0)},m=function(e){return y(e,!1)},O=((0,s.supportsGoWithoutReloadUsingHash)(),function(e){u.go(e)}),b=function(e){return"#"+u.createHref(e)};return i({},u,{listenBefore:g,listen:m,go:O,createHref:b})};t["default"]=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(3),a=(r(i),n(5)),u=r(a),c=n(2),f=n(1),s=n(9),l=r(s),d=n(6),p=function(e){return e.filter(function(e){return e.state}).reduce(function(e,t){return e[t.key]=t.state,e},{})},v=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];Array.isArray(e)?e={entries:e}:"string"==typeof e&&(e={entries:[e]});var t=function(){var e=h[y],t=(0,f.createPath)(e),n=void 0,r=void 0;e.key&&(n=e.key,r=O(n));var i=(0,f.parsePath)(t);return(0,c.createLocation)(o({},i,{state:r}),void 0,n)},n=function(e){var t=y+e;return t>=0&&t<h.length},r=function(e){if(e&&n(e)){y+=e;var r=t();s.transitionTo(o({},r,{action:d.POP}))}},i=function(e){y+=1,y<h.length&&h.splice(y),h.push(e),m(e.key,e.state)},a=function(e){h[y]=e,m(e.key,e.state)},s=(0,l["default"])(o({},e,{getCurrentLocation:t,pushLocation:i,replaceLocation:a,go:r})),v=e,h=v.entries,y=v.current;"string"==typeof h?h=[h]:Array.isArray(h)||(h=["/"]),h=h.map(function(e){return(0,c.createLocation)(e)}),null==y?y=h.length-1:y>=0&&y<h.length?void 0:(0,u["default"])(!1);var g=p(h),m=function(e,t){return g[e]=t},O=function(e){return g[e]};return s};t["default"]=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(10),a=r(i),u=n(1),c=function(e){return function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e(t),r=t.basename,i=function(e){return e?(r&&null==e.basename&&(0===e.pathname.indexOf(r)?(e.pathname=e.pathname.substring(r.length),e.basename=r,""===e.pathname&&(e.pathname="/")):e.basename=""),e):e},c=function(e){if(!r)return e;var t="string"==typeof e?(0,u.parsePath)(e):e,n=t.pathname,i="/"===r.slice(-1)?r:r+"/",a="/"===n.charAt(0)?n.slice(1):n,c=i+a;return o({},e,{pathname:c})},f=function(){return i(n.getCurrentLocation())},s=function(e){return n.listenBefore(function(t,n){return(0,a["default"])(e,i(t),n)})},l=function(e){return n.listen(function(t){return e(i(t))})},d=function(e){return n.push(c(e))},p=function(e){return n.replace(c(e))},v=function(e){return n.createPath(c(e))},h=function(e){return n.createHref(c(e))},y=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;t>o;o++)r[o-1]=arguments[o];return i(n.createLocation.apply(n,[c(e)].concat(r)))};return o({},n,{getCurrentLocation:f,listenBefore:s,listen:l,push:d,replace:p,createPath:v,createHref:h,createLocation:y})}};t["default"]=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(5),a=r(i),u=n(4),c=n(8),f=function(e){var t=function(t){var n=e();return"string"==typeof n?((t||window.event).returnValue=n,n):void 0};return(0,u.addEventListener)(window,"beforeunload",t),function(){return(0,u.removeEventListener)(window,"beforeunload",t)}},s=function(e){return c.canUseDOM?void 0:(0,a["default"])(!1),function(t){var n=e(t),r=[],i=void 0,a=function(){for(var e=void 0,t=0,n=r.length;null==e&&n>t;++t)e=r[t].call();return e},u=function(e){return 1===r.push(e)&&(i=f(a)),function(){r=r.filter(function(t){return t!==e}),0===r.length&&i&&(i(),i=null)}};return o({},n,{listenBeforeUnload:u})}};t["default"]=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(22),a=n(10),u=r(a),c=n(2),f=n(1),s=function(e){return(0,i.stringify)(e).replace(/%20/g,"+")},l=i.parse,d=function(e){return function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e(t),r=t.stringifyQuery,i=t.parseQueryString;"function"!=typeof r&&(r=s),"function"!=typeof i&&(i=l);var a=function(e){return e?(null==e.query&&(e.query=i(e.search.substring(1))),e):e},d=function(e,t){if(null==t)return e;var n="string"==typeof e?(0,f.parsePath)(e):e,i=r(t),a=i?"?"+i:"";return o({},n,{search:a})},p=function(){return a(n.getCurrentLocation())},v=function(e){return n.listenBefore(function(t,n){return(0,u["default"])(e,a(t),n)})},h=function(e){return n.listen(function(t){return e(a(t))})},y=function(e){return n.push(d(e,e.query))},g=function(e){return n.replace(d(e,e.query))},m=function(e){return n.createPath(d(e,e.query))},O=function(e){return n.createHref(d(e,e.query))},b=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;t>o;o++)r[o-1]=arguments[o];var i=n.createLocation.apply(n,[d(e,e.query)].concat(r));return e.query&&(i.query=(0,c.createQuery)(e.query)),a(i)};return o({},n,{getCurrentLocation:p,listenBefore:v,listen:h,push:y,replace:g,createPath:m,createHref:O,createLocation:b})}};t["default"]=d},function(e,t){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function r(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;10>n;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(i){return!1}}var o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=r()?Object.assign:function(e,t){for(var r,a,u=n(e),c=1;c<arguments.length;c++){r=Object(arguments[c]);for(var f in r)o.call(r,f)&&(u[f]=r[f]);if(Object.getOwnPropertySymbols){a=Object.getOwnPropertySymbols(r);for(var s=0;s<a.length;s++)i.call(r,a[s])&&(u[a[s]]=r[a[s]])}}return u}},function(e,t,n){"use strict";function r(e,t){return t.encode?t.strict?o(e):encodeURIComponent(e):e}var o=n(23),i=n(21);t.extract=function(e){return e.split("?")[1]||""},t.parse=function(e){var t=Object.create(null);return"string"!=typeof e?t:(e=e.trim().replace(/^(\?|#|&)/,""))?(e.split("&").forEach(function(e){var n=e.replace(/\+/g," ").split("="),r=n.shift(),o=n.length>0?n.join("="):void 0;r=decodeURIComponent(r),o=void 0===o?null:decodeURIComponent(o),void 0===t[r]?t[r]=o:Array.isArray(t[r])?t[r].push(o):t[r]=[t[r],o]}),t):t},t.stringify=function(e,t){var n={encode:!0,strict:!0};return t=i(n,t),e?Object.keys(e).sort().map(function(n){var o=e[n];if(void 0===o)return"";if(null===o)return n;if(Array.isArray(o)){var i=[];return o.slice().sort().forEach(function(e){void 0!==e&&(null===e?i.push(r(n,t)):i.push(r(n,t)+"="+r(e,t)))}),i.join("&")}return r(n,t)+"="+r(o,t)}).filter(function(e){return e.length>0}).join("&"):""}},function(e,t){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}}])});
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