Socket
Socket
Sign inDemoInstall

history

Package Overview
Dependencies
4
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.0-2 to 4.0.0

15

CHANGES.md

@@ -1,7 +0,20 @@

## HEAD
## [v4.0.0]
> Sep 10, 2016
- Added back two-arg form of `push` and `replace`
[v4.0.0]: https://github.com/mjackson/history/compare/v4.0.0-2...v4.0.0
## [v4.0.0-2]
> Sep 9, 2016
- Added `history.length`, `history.location`, and `history.action` properties
- Added `history.index` and `history.entries` properties in memory history
- Added `location.pathname`, `location.search`, and `location.hash` instead of
`location.path` since this is work most people will always have to do
- Added `parsePath` and `createPath` helpers to top-level exports
- Removed `history.getCurrentLocation()`
[v4.0.0-2]: https://github.com/mjackson/history/compare/v4.0.0-1...v4.0.0-2
## [v4.0.0-1]

@@ -8,0 +21,0 @@ > Sep 6, 2016

24

createBrowserHistory.js

@@ -159,5 +159,5 @@ 'use strict';

var push = function push(to) {
var push = function push(path, state) {
var action = 'PUSH';
var location = (0, _LocationUtils.createLocation)(to, createKey());
var location = (0, _LocationUtils.createLocation)(path, state, createKey());

@@ -167,3 +167,3 @@ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {

var path = basename + (0, _PathUtils.createPath)(location);
var url = basename + (0, _PathUtils.createPath)(location);
var key = location.key;

@@ -174,6 +174,6 @@ var state = location.state;

if (canUseHistory) {
globalHistory.pushState({ key: key, state: state }, null, path);
globalHistory.pushState({ key: key, state: state }, null, url);
if (forceRefresh) {
window.location.href = path;
window.location.href = url;
} else {

@@ -191,3 +191,3 @@ var prevIndex = allKeys.indexOf(history.location.key);

window.location.href = path;
window.location.href = url;
}

@@ -197,5 +197,5 @@ });

var replace = function replace(to) {
var replace = function replace(path, state) {
var action = 'REPLACE';
var location = (0, _LocationUtils.createLocation)(to, createKey());
var location = (0, _LocationUtils.createLocation)(path, state, createKey());

@@ -205,3 +205,3 @@ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {

var path = basename + (0, _PathUtils.createPath)(location);
var url = basename + (0, _PathUtils.createPath)(location);
var key = location.key;

@@ -212,6 +212,6 @@ var state = location.state;

if (canUseHistory) {
globalHistory.replaceState({ key: key, state: state }, null, path);
globalHistory.replaceState({ key: key, state: state }, null, url);
if (forceRefresh) {
window.location.replace(path);
window.location.replace(url);
} else {

@@ -227,3 +227,3 @@ var prevIndex = allKeys.indexOf(history.location.key);

window.location.replace(path);
window.location.replace(url);
}

@@ -230,0 +230,0 @@ });

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

var push = function push(to) {
var push = function push(path, state) {
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(state === undefined, 'Hash history cannot push state; it is ignored') : void 0;
var action = 'PUSH';
var location = (0, _LocationUtils.createLocation)(to);
var location = (0, _LocationUtils.createLocation)(path);
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(location.state === undefined, 'Hash history cannot push state; it will be dropped') : void 0;
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {

@@ -218,8 +218,8 @@ if (!ok) return;

var replace = function replace(to) {
var replace = function replace(path, state) {
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(state === undefined, 'Hash history cannot replace state; it is ignored') : void 0;
var action = 'REPLACE';
var location = (0, _LocationUtils.createLocation)(to);
var location = (0, _LocationUtils.createLocation)(path);
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(location.state === undefined, 'Hash history cannot replace state; it will be dropped') : void 0;
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {

@@ -226,0 +226,0 @@ if (!ok) return;

@@ -54,5 +54,5 @@ 'use strict';

var push = function push(to) {
var push = function push(path, state) {
var action = 'PUSH';
var location = (0, _LocationUtils.createLocation)(to, createKey());
var location = (0, _LocationUtils.createLocation)(path, state, createKey());

@@ -81,5 +81,5 @@ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {

var replace = function replace(to) {
var replace = function replace(path, state) {
var action = 'REPLACE';
var location = (0, _LocationUtils.createLocation)(to, createKey());
var location = (0, _LocationUtils.createLocation)(path, state, createKey());

@@ -86,0 +86,0 @@ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {

@@ -10,7 +10,33 @@ 'use strict';

var _warning = require('warning');
var _warning2 = _interopRequireDefault(_warning);
var _PathUtils = require('./PathUtils');
var createLocation = exports.createLocation = function createLocation(to, key) {
var location = typeof to === 'string' ? (0, _PathUtils.parsePath)(to) : _extends({}, to);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// A private helper function used to create location
// objects from the args to push/replace.
var createLocation = exports.createLocation = function createLocation(path, state, key) {
var location = void 0;
if (typeof path === 'string') {
// Two-arg form: push(path, state)
location = (0, _PathUtils.parsePath)(path);
location.state = state;
} else {
// One-arg form: push(location)
location = _extends({}, path);
if (state !== undefined) {
if (location.state === undefined) {
location.state = state;
} else {
process.env.NODE_ENV !== 'production' ? (0, _warning2.default)(false, 'When providing a location-like object with state as the first argument to push/replace ' + 'you should avoid providing a second "state" argument; it is ignored') : void 0;
}
}
}
location.key = key;
return location;

@@ -17,0 +43,0 @@ };

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

@@ -5,0 +5,0 @@ "repository": "mjackson/history",

@@ -57,3 +57,4 @@ # history [![Travis][build-badge]][build] [![npm package][npm-badge]][npm]

const unlisten = history.listen((location, action) => {
console.log(action, location.path, location.state)
// location is an object like window.location
console.log(action, location.pathname, location.state)
})

@@ -100,7 +101,7 @@

- `length` - The number of entries in the history stack
- `location` - The current location (see below)
- `action` - The current navigation action (see below)
- `history.length` - The number of entries in the history stack
- `history.location` - The current location (see below)
- `history.action` - The current navigation action (see below)
Additionally, `createMemoryHistory` provides `index` and `entries` properties that let you inspect the history stack.
Additionally, `createMemoryHistory` provides `history.index` and `history.entries` properties that let you inspect the history stack.

@@ -113,3 +114,3 @@ ### Listening

history.listen((location, action) => {
console.log(`The current URL is ${location.path}`)
console.log(`The current URL is ${location.pathname}${location.search}${location.hash}`)
console.log(`The last navigation action was ${action}`)

@@ -121,10 +122,10 @@ })

- `pathname` - The path of the URL
- `search` - The URL query string
- `hash` - The URL hash fragment
- `location.pathname` - The path of the URL
- `location.search` - The URL query string
- `location.hash` - The URL hash fragment
Locations may also have the following properties:
- `state` - Some extra state for this location that does not reside in the URL (supported in `createBrowserHistory` and `createMemoryHistory`)
- `key` - A unique string representing this location (supported in `createBrowserHistory` and `createMemoryHistory`)
- `location.state` - Some extra state for this location that does not reside in the URL (supported in `createBrowserHistory` and `createMemoryHistory`)
- `location.key` - A unique string representing this location (supported in `createBrowserHistory` and `createMemoryHistory`)

@@ -137,12 +138,12 @@ The `action` is one of `PUSH`, `REPLACE`, or `POP` depending on how the user got to the current URL.

- `push(to)`
- `replace(to)`
- `go(n)`
- `goBack()`
- `goForward()`
- `canGo(n)` (only in `createMemoryHistory`)
- `history.push(path, [state])`
- `history.replace(path, [state])`
- `history.go(n)`
- `history.goBack()`
- `history.goForward()`
- `history.canGo(n)` (only in `createMemoryHistory`)
The `push` and `replace` methods accept a single `to` argument. This is either:
When using `push` or `replace` you can either specify both the URL path and state as separate arguments or include everything in a single location-like object as the first argument.
1. A URL `path` (including the query string and hash fragment) OR
1. A URL path *or*
2. A location-like object with `{ pathname, search, hash, state }`

@@ -154,10 +155,10 @@

// Replace the current entry on the history stack.
history.replace('/profile')
// Push a new entry onto the history stack with a query string
// and some state. Location state does not appear in the URL.
history.push('/home?the=query', { some: 'state' })
// Push a new entry with state onto the history stack. State may
// be any arbitrary data tied to a particular location. Unlike the
// query string, location state does not appear in the URL.
// If you prefer, use a single location-like object to specify both
// the URL and state. This is equivalent to the example above.
history.push({
pathname: '/about',
pathname: '/home',
search: '?the=query',

@@ -224,6 +225,10 @@ state: { some: 'state' }

history.listen(location => {
console.log(location.pathname) // /home
})
history.push('/home') // URL is now /the/base/home
```
**Note:** This feature is not suppported in `createMemoryHistory`.
**Note:** `basename` is not suppported in `createMemoryHistory`.

@@ -253,3 +258,3 @@ ### Forcing Full Page Refreshes in createBrowserHistory

const history = createHashHistory({
hashType: 'noslash' // Omit's the leading slash
hashType: 'noslash' // Omit the leading slash
})

@@ -256,0 +261,0 @@

@@ -71,3 +71,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

var _PathUtils = __webpack_require__(2);
var _PathUtils = __webpack_require__(3);

@@ -87,3 +87,3 @@ Object.defineProperty(exports, 'parsePath', {

var _createBrowserHistory2 = __webpack_require__(3);
var _createBrowserHistory2 = __webpack_require__(4);

@@ -119,7 +119,33 @@ var _createBrowserHistory3 = _interopRequireDefault(_createBrowserHistory2);

var _PathUtils = __webpack_require__(2);
var _warning = __webpack_require__(2);
var createLocation = exports.createLocation = function createLocation(to, key) {
var location = typeof to === 'string' ? (0, _PathUtils.parsePath)(to) : _extends({}, to);
var _warning2 = _interopRequireDefault(_warning);
var _PathUtils = __webpack_require__(3);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// A private helper function used to create location
// objects from the args to push/replace.
var createLocation = exports.createLocation = function createLocation(path, state, key) {
var location = void 0;
if (typeof path === 'string') {
// Two-arg form: push(path, state)
location = (0, _PathUtils.parsePath)(path);
location.state = state;
} else {
// One-arg form: push(location)
location = _extends({}, path);
if (state !== undefined) {
if (location.state === undefined) {
location.state = state;
} else {
false ? (0, _warning2.default)(false, 'When providing a location-like object with state as the first argument to push/replace ' + 'you should avoid providing a second "state" argument; it is ignored') : void 0;
}
}
}
location.key = key;
return location;

@@ -162,2 +188,68 @@ };

/* 2 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2014-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
/**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warning = function() {};
if (false) {
warning = function(condition, format, args) {
var len = arguments.length;
args = new Array(len > 2 ? len - 2 : 0);
for (var key = 2; key < len; key++) {
args[key - 2] = arguments[key];
}
if (format === undefined) {
throw new Error(
'`warning(condition, format, ...args)` requires a warning ' +
'message argument'
);
}
if (format.length < 10 || (/^[s\W]*$/).test(format)) {
throw new Error(
'The warning format should be able to uniquely identify this ' +
'warning. Please, use a more descriptive format than: ' + format
);
}
if (!condition) {
var argIndex = 0;
var message = 'Warning: ' +
format.replace(/%s/g, function() {
return args[argIndex++];
});
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch(x) {}
}
};
}
module.exports = warning;
/***/ },
/* 3 */
/***/ function(module, exports) {

@@ -219,3 +311,3 @@

/***/ },
/* 3 */
/* 4 */
/***/ function(module, exports, __webpack_require__) {

@@ -229,3 +321,3 @@

var _warning = __webpack_require__(4);
var _warning = __webpack_require__(2);

@@ -240,3 +332,3 @@ var _warning2 = _interopRequireDefault(_warning);

var _PathUtils = __webpack_require__(2);
var _PathUtils = __webpack_require__(3);

@@ -383,5 +475,5 @@ var _createTransitionManager = __webpack_require__(6);

var push = function push(to) {
var push = function push(path, state) {
var action = 'PUSH';
var location = (0, _LocationUtils.createLocation)(to, createKey());
var location = (0, _LocationUtils.createLocation)(path, state, createKey());

@@ -391,3 +483,3 @@ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {

var path = basename + (0, _PathUtils.createPath)(location);
var url = basename + (0, _PathUtils.createPath)(location);
var key = location.key;

@@ -398,6 +490,6 @@ var state = location.state;

if (canUseHistory) {
globalHistory.pushState({ key: key, state: state }, null, path);
globalHistory.pushState({ key: key, state: state }, null, url);
if (forceRefresh) {
window.location.href = path;
window.location.href = url;
} else {

@@ -415,3 +507,3 @@ var prevIndex = allKeys.indexOf(history.location.key);

window.location.href = path;
window.location.href = url;
}

@@ -421,5 +513,5 @@ });

var replace = function replace(to) {
var replace = function replace(path, state) {
var action = 'REPLACE';
var location = (0, _LocationUtils.createLocation)(to, createKey());
var location = (0, _LocationUtils.createLocation)(path, state, createKey());

@@ -429,3 +521,3 @@ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {

var path = basename + (0, _PathUtils.createPath)(location);
var url = basename + (0, _PathUtils.createPath)(location);
var key = location.key;

@@ -436,6 +528,6 @@ var state = location.state;

if (canUseHistory) {
globalHistory.replaceState({ key: key, state: state }, null, path);
globalHistory.replaceState({ key: key, state: state }, null, url);
if (forceRefresh) {
window.location.replace(path);
window.location.replace(url);
} else {

@@ -451,3 +543,3 @@ var prevIndex = allKeys.indexOf(history.location.key);

window.location.replace(path);
window.location.replace(url);
}

@@ -536,68 +628,2 @@ });

/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2014-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
/**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warning = function() {};
if (false) {
warning = function(condition, format, args) {
var len = arguments.length;
args = new Array(len > 2 ? len - 2 : 0);
for (var key = 2; key < len; key++) {
args[key - 2] = arguments[key];
}
if (format === undefined) {
throw new Error(
'`warning(condition, format, ...args)` requires a warning ' +
'message argument'
);
}
if (format.length < 10 || (/^[s\W]*$/).test(format)) {
throw new Error(
'The warning format should be able to uniquely identify this ' +
'warning. Please, use a more descriptive format than: ' + format
);
}
if (!condition) {
var argIndex = 0;
var message = 'Warning: ' +
format.replace(/%s/g, function() {
return args[argIndex++];
});
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch(x) {}
}
};
}
module.exports = warning;
/***/ },
/* 5 */

@@ -667,3 +693,3 @@ /***/ function(module, exports, __webpack_require__) {

var _warning = __webpack_require__(4);
var _warning = __webpack_require__(2);

@@ -811,3 +837,3 @@ var _warning2 = _interopRequireDefault(_warning);

var _warning = __webpack_require__(4);
var _warning = __webpack_require__(2);

@@ -822,3 +848,3 @@ var _warning2 = _interopRequireDefault(_warning);

var _PathUtils = __webpack_require__(2);
var _PathUtils = __webpack_require__(3);

@@ -988,8 +1014,8 @@ var _createTransitionManager = __webpack_require__(6);

var push = function push(to) {
var push = function push(path, state) {
false ? (0, _warning2.default)(state === undefined, 'Hash history cannot push state; it is ignored') : void 0;
var action = 'PUSH';
var location = (0, _LocationUtils.createLocation)(to);
var location = (0, _LocationUtils.createLocation)(path);
false ? (0, _warning2.default)(location.state === undefined, 'Hash history cannot push state; it will be dropped') : void 0;
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {

@@ -1024,8 +1050,8 @@ if (!ok) return;

var replace = function replace(to) {
var replace = function replace(path, state) {
false ? (0, _warning2.default)(state === undefined, 'Hash history cannot replace state; it is ignored') : void 0;
var action = 'REPLACE';
var location = (0, _LocationUtils.createLocation)(to);
var location = (0, _LocationUtils.createLocation)(path);
false ? (0, _warning2.default)(location.state === undefined, 'Hash history cannot replace state; it will be dropped') : void 0;
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {

@@ -1187,5 +1213,5 @@ if (!ok) return;

var push = function push(to) {
var push = function push(path, state) {
var action = 'PUSH';
var location = (0, _LocationUtils.createLocation)(to, createKey());
var location = (0, _LocationUtils.createLocation)(path, state, createKey());

@@ -1214,5 +1240,5 @@ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {

var replace = function replace(to) {
var replace = function replace(path, state) {
var action = 'REPLACE';
var location = (0, _LocationUtils.createLocation)(to, createKey());
var location = (0, _LocationUtils.createLocation)(path, state, createKey());

@@ -1219,0 +1245,0 @@ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {

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

!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.History=t():n.History=t()}(this,function(){return function(n){function t(r){if(e[r])return e[r].exports;var o=e[r]={exports:{},id:r,loaded:!1};return n[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var e={};return t.m=n,t.c=e,t.p="",t(0)}([function(n,t,e){"use strict";function r(n){return n&&n.__esModule?n:{"default":n}}t.__esModule=!0,t.createPath=t.parsePath=t.locationsAreEqual=t.createMemoryHistory=t.createHashHistory=t.createBrowserHistory=void 0;var o=e(1);Object.defineProperty(t,"locationsAreEqual",{enumerable:!0,get:function(){return o.locationsAreEqual}});var i=e(2);Object.defineProperty(t,"parsePath",{enumerable:!0,get:function(){return i.parsePath}}),Object.defineProperty(t,"createPath",{enumerable:!0,get:function(){return i.createPath}});var a=e(8),c=r(a),u=e(9),s=r(u),f=e(10),d=r(f);t.createBrowserHistory=c["default"],t.createHashHistory=s["default"],t.createMemoryHistory=d["default"]},function(n,t,e){"use strict";t.__esModule=!0,t.locationsAreEqual=t.createLocation=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol?"symbol":typeof n},o=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},i=e(2),a=(t.createLocation=function(n,t){var e="string"==typeof n?(0,i.parsePath)(n):o({},n);return e.key=t,e},function c(n,t){if(null==n)return n==t;var e="undefined"==typeof n?"undefined":r(n),o="undefined"==typeof t?"undefined":r(t);if(e!==o)return!1;if(Array.isArray(n))return!(!Array.isArray(t)||n.length!==t.length)&&n.every(function(n,e){return c(n,t[e])});if("object"===e){var i=Object.keys(n),a=Object.keys(t);return i.length===a.length&&i.every(function(e){return c(n[e],t[e])})}return n===t});t.locationsAreEqual=function(n,t){return n.pathname===t.pathname&&n.search===t.search&&n.hash===t.hash&&n.key===t.key&&a(n.state,t.state)}},function(n,t){"use strict";t.__esModule=!0;t.addLeadingSlash=function(n){return"/"===n.charAt(0)?n:"/"+n},t.stripLeadingSlash=function(n){return"/"===n.charAt(0)?n.substr(1):n},t.stripPrefix=function(n,t){return 0===n.indexOf(t)?n.substr(t.length):n},t.parsePath=function(n){var t=n,e="",r="",o=t.indexOf("#");o!==-1&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return i!==-1&&(e=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===e?"":e,hash:"#"===r?"":r}},t.createPath=function(n){var t=n.pathname,e=n.search,r=n.hash,o=t||"/";return e&&"?"!==e&&(o+="?"===e.charAt(0)?e:"?"+e),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}},function(n,t,e){"use strict";function r(n){return n&&n.__esModule?n:{"default":n}}t.__esModule=!0;var o=e(4),i=(r(o),function(){var n=null,t=function(t){return n=t,function(){n===t&&(n=null)}},e=function(t,e,r,o){if(null!=n){var i="function"==typeof n?n(t,e):n;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(i!==!1)}else o(!0)},r=[],o=function(n){return r.push(n),function(){r=r.filter(function(t){return t!==n})}},i=function(){for(var n=arguments.length,t=Array(n),e=0;e<n;e++)t[e]=arguments[e];return r.forEach(function(n){return n.apply(void 0,t)})};return{setPrompt:t,confirmTransitionTo:e,appendListener:o,notifyListeners:i}});t["default"]=i},function(n,t,e){"use strict";var r=function(){};n.exports=r},function(n,t){"use strict";t.__esModule=!0;t.addEventListener=function(n,t,e){return n.addEventListener?n.addEventListener(t,e,!1):n.attachEvent("on"+t,e)},t.removeEventListener=function(n,t,e){return n.removeEventListener?n.removeEventListener(t,e,!1):n.detachEvent("on"+t,e)},t.getConfirmation=function(n,t){return t(window.confirm(n))},t.supportsHistory=function(){var n=window.navigator.userAgent;return(n.indexOf("Android 2.")===-1&&n.indexOf("Android 4.0")===-1||n.indexOf("Mobile Safari")===-1||n.indexOf("Chrome")!==-1||n.indexOf("Windows Phone")!==-1)&&(window.history&&"pushState"in window.history)},t.supportsPopStateOnHashChange=function(){return window.navigator.userAgent.indexOf("Trident")===-1},t.supportsGoWithoutReloadUsingHash=function(){return window.navigator.userAgent.indexOf("Firefox")===-1}},function(n,t){"use strict";t.__esModule=!0;t.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement)},function(n,t,e){"use strict";var r=function(n,t,e,r,o,i,a,c){if(!n){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[e,r,o,i,a,c],f=0;u=new Error(t.replace(/%s/g,function(){return s[f++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};n.exports=r},function(n,t,e){"use strict";function r(n){return n&&n.__esModule?n:{"default":n}}t.__esModule=!0;var o=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},i=e(4),a=(r(i),e(7)),c=r(a),u=e(1),s=e(2),f=e(3),d=r(f),l=e(6),h=e(5),v="popstate",p="hashchange",g=function(){try{return window.history.state||{}}catch(n){return{}}},y=function(){var n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];l.canUseDOM?void 0:(0,c["default"])(!1);var t=window.history,e=(0,h.supportsHistory)(),r=!(0,h.supportsPopStateOnHashChange)(),i=n.basename,a=void 0===i?"":i,f=n.forceRefresh,y=void 0!==f&&f,w=n.getUserConfirmation,P=void 0===w?h.getConfirmation:w,m=n.keyLength,O=void 0===m?6:m,x=function(n){var t=n||{},e=t.key,r=t.state,i=window.location,c=i.pathname,u=i.search,f=i.hash,d=c+u+f;return a&&(d=(0,s.stripPrefix)(d,a)),o({},(0,s.parsePath)(d),{state:r,key:e})},b=function(){return Math.random().toString(36).substr(2,O)},L=(0,d["default"])(),E=function(n){o(W,n),W.length=t.length,L.notifyListeners(W.location,W.action)},_=function(n){void 0!==n.state&&M(x(n.state))},k=function(){M(x(g()))},A=!1,M=function(n){A?(A=!1,E()):!function(){var t="POP";L.confirmTransitionTo(n,t,P,function(e){e?E({action:t,location:n}):T(n)})}()},T=function(n){var t=W.location,e=H.indexOf(t.key);e===-1&&(e=0);var r=H.indexOf(n.key);r===-1&&(r=0);var o=e-r;o&&(A=!0,U(o))},S=x(g()),H=[S.key],j=function(n){var r="PUSH",o=(0,u.createLocation)(n,b());L.confirmTransitionTo(o,r,P,function(n){if(n){var i=a+(0,s.createPath)(o),c=o.key,u=o.state;if(e)if(t.pushState({key:c,state:u},null,i),y)window.location.href=i;else{var f=H.indexOf(W.location.key),d=H.slice(0,f===-1?0:f+1);d.push(o.key),H=d,E({action:r,location:o})}else window.location.href=i}})},C=function(n){var r="REPLACE",o=(0,u.createLocation)(n,b());L.confirmTransitionTo(o,r,P,function(n){if(n){var i=a+(0,s.createPath)(o),c=o.key,u=o.state;if(e)if(t.replaceState({key:c,state:u},null,i),y)window.location.replace(i);else{var f=H.indexOf(W.location.key);f!==-1&&(H[f]=o.key),E({action:r,location:o})}else window.location.replace(i)}})},U=function(n){t.go(n)},q=function(){return U(-1)},R=function(){return U(1)},B=0,I=function(n){B+=n,1===B?((0,h.addEventListener)(window,v,_),r&&(0,h.addEventListener)(window,p,k)):0===B&&((0,h.removeEventListener)(window,v,_),r&&(0,h.removeEventListener)(window,p,k))},F=!1,D=function(){var n=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],t=L.setPrompt(n);return F||(I(1),F=!0),function(){return F&&(F=!1,I(-1)),t()}},G=function(n){var t=L.appendListener(n);return I(1),function(){return I(-1),t()}},W={length:t.length,action:"POP",location:S,push:j,replace:C,go:U,goBack:q,goForward:R,block:D,listen:G};return W};t["default"]=y},function(n,t,e){"use strict";function r(n){return n&&n.__esModule?n:{"default":n}}t.__esModule=!0;var o=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},i=e(4),a=(r(i),e(7)),c=r(a),u=e(1),s=e(2),f=e(3),d=r(f),l=e(6),h=e(5),v="hashchange",p={hashbang:{encodePath:function(n){return"!"===n.charAt(0)?n:"!/"+(0,s.stripLeadingSlash)(n)},decodePath:function(n){return"!"===n.charAt(0)?n.substr(1):n}},noslash:{encodePath:s.stripLeadingSlash,decodePath:s.addLeadingSlash},slash:{encodePath:s.addLeadingSlash,decodePath:s.addLeadingSlash}},g=function(){var n=window.location.href,t=n.indexOf("#");return t===-1?"":n.substring(t+1)},y=function(n){return window.location.hash=n},w=function(n){var t=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,t>=0?t:0)+"#"+n)},P=function(){var n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];l.canUseDOM?void 0:(0,c["default"])(!1);var t=window.history,e=((0,h.supportsGoWithoutReloadUsingHash)(),n.basename),r=void 0===e?"":e,i=n.getUserConfirmation,a=void 0===i?h.getConfirmation:i,f=n.hashType,P=void 0===f?"slash":f,m=p[P],O=m.encodePath,x=m.decodePath,b=function(){var n=x(g());return r&&(n=(0,s.stripPrefix)(n,r)),(0,s.parsePath)(n)},L=(0,d["default"])(),E=function(n){o(z,n),z.length=t.length,L.notifyListeners(z.location,z.action)},_=!1,k=null,A=function(){var n=g(),t=O(n);if(n!==t)w(t);else{var e=b(),r=z.location;if(!_&&(0,u.locationsAreEqual)(r,e))return;if(k===(0,s.createPath)(e))return;k=null,M(e)}},M=function(n){_?(_=!1,E()):!function(){var t="POP";L.confirmTransitionTo(n,t,a,function(e){e?E({action:t,location:n}):T(n)})}()},T=function(n){var t=z.location,e=C.lastIndexOf((0,s.createPath)(t));e===-1&&(e=0);var r=C.lastIndexOf((0,s.createPath)(n));r===-1&&(r=0);var o=e-r;o&&(_=!0,R(o))},S=g(),H=O(S);S!==H&&w(H);var j=b(),C=[(0,s.createPath)(j)],U=function(n){var t="PUSH",e=(0,u.createLocation)(n);L.confirmTransitionTo(e,t,a,function(n){if(n){var o=(0,s.createPath)(e),i=O(r+o),a=g()!==i;if(a){k=o,y(i);var c=C.lastIndexOf((0,s.createPath)(z.location)),u=C.slice(0,c===-1?0:c+1);u.push(o),C=u,E({action:t,location:e})}else E()}})},q=function(n){var t="REPLACE",e=(0,u.createLocation)(n);L.confirmTransitionTo(e,t,a,function(n){if(n){var o=(0,s.createPath)(e),i=O(r+o),a=g()!==i;a&&(k=o,w(i));var c=C.indexOf((0,s.createPath)(z.location));c!==-1&&(C[c]=o),E({action:t,location:e})}})},R=function(n){t.go(n)},B=function(){return R(-1)},I=function(){return R(1)},F=0,D=function(n){F+=n,1===F?(0,h.addEventListener)(window,v,A):0===F&&(0,h.removeEventListener)(window,v,A)},G=!1,W=function(){var n=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],t=L.setPrompt(n);return G||(D(1),G=!0),function(){return G&&(G=!1,D(-1)),t()}},V=function(n){var t=L.appendListener(n);return D(1),function(){return D(-1),t()}},z={length:t.length,action:"POP",location:j,push:U,replace:q,go:R,goBack:B,goForward:I,block:W,listen:V};return z};t["default"]=P},function(n,t,e){"use strict";function r(n){return n&&n.__esModule?n:{"default":n}}t.__esModule=!0;var o=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},i=e(1),a=e(3),c=r(a),u=function(n,t,e){return Math.min(Math.max(n,t),e)},s=function(){var n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=n.getUserConfirmation,e=n.initialEntries,r=void 0===e?["/"]:e,a=n.initialIndex,s=void 0===a?0:a,f=n.keyLength,d=void 0===f?6:f,l=(0,c["default"])(),h=function(n){o(E,n),E.length=E.entries.length,l.notifyListeners(E.location,E.action)},v=function(){return Math.random().toString(36).substr(2,d)},p=u(s,0,r.length-1),g=r.map(function(n,t){return"string"==typeof n?(0,i.createLocation)(n,t?v():void 0):n}),y=function(n){var e="PUSH",r=(0,i.createLocation)(n,v());l.confirmTransitionTo(r,e,t,function(n){if(n){var t=E.index,o=t+1,i=E.entries.slice(0);i.length>o?i.splice(o,i.length-o,r):i.push(r),h({action:e,location:r,index:o,entries:i})}})},w=function(n){var e="REPLACE",r=(0,i.createLocation)(n,v());l.confirmTransitionTo(r,e,t,function(n){n&&(E.entries[E.index]=r,h({action:e,location:r}))})},P=function(n){var e=u(E.index+n,0,E.entries.length-1),r="POP",o=E.entries[e];l.confirmTransitionTo(o,r,t,function(n){n?h({action:r,location:o,index:e}):h()})},m=function(){return P(-1)},O=function(){return P(1)},x=function(n){var t=E.index+n;return t>=0&&t<E.entries.length},b=function(){var n=!(arguments.length<=0||void 0===arguments[0])&&arguments[0];return l.setPrompt(n)},L=function(n){return l.appendListener(n)},E={length:g.length,action:"POP",location:g[p],index:p,entries:g,push:y,replace:w,go:P,goBack:m,goForward:O,canGo:x,block:b,listen:L};return E};t["default"]=s}])});
!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.History=t():n.History=t()}(this,function(){return function(n){function t(r){if(e[r])return e[r].exports;var o=e[r]={exports:{},id:r,loaded:!1};return n[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var e={};return t.m=n,t.c=e,t.p="",t(0)}([function(n,t,e){"use strict";function r(n){return n&&n.__esModule?n:{"default":n}}t.__esModule=!0,t.createPath=t.parsePath=t.locationsAreEqual=t.createMemoryHistory=t.createHashHistory=t.createBrowserHistory=void 0;var o=e(1);Object.defineProperty(t,"locationsAreEqual",{enumerable:!0,get:function(){return o.locationsAreEqual}});var i=e(2);Object.defineProperty(t,"parsePath",{enumerable:!0,get:function(){return i.parsePath}}),Object.defineProperty(t,"createPath",{enumerable:!0,get:function(){return i.createPath}});var a=e(8),c=r(a),u=e(9),s=r(u),f=e(10),d=r(f);t.createBrowserHistory=c["default"],t.createHashHistory=s["default"],t.createMemoryHistory=d["default"]},function(n,t,e){"use strict";function r(n){return n&&n.__esModule?n:{"default":n}}t.__esModule=!0,t.locationsAreEqual=t.createLocation=void 0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol?"symbol":typeof n},i=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},a=e(3),c=(r(a),e(2)),u=(t.createLocation=function(n,t,e){var r=void 0;return"string"==typeof n?(r=(0,c.parsePath)(n),r.state=t):(r=i({},n),void 0!==t&&void 0===r.state&&(r.state=t)),r.key=e,r},function s(n,t){if(null==n)return n==t;var e="undefined"==typeof n?"undefined":o(n),r="undefined"==typeof t?"undefined":o(t);if(e!==r)return!1;if(Array.isArray(n))return!(!Array.isArray(t)||n.length!==t.length)&&n.every(function(n,e){return s(n,t[e])});if("object"===e){var i=Object.keys(n),a=Object.keys(t);return i.length===a.length&&i.every(function(e){return s(n[e],t[e])})}return n===t});t.locationsAreEqual=function(n,t){return n.pathname===t.pathname&&n.search===t.search&&n.hash===t.hash&&n.key===t.key&&u(n.state,t.state)}},function(n,t){"use strict";t.__esModule=!0;t.addLeadingSlash=function(n){return"/"===n.charAt(0)?n:"/"+n},t.stripLeadingSlash=function(n){return"/"===n.charAt(0)?n.substr(1):n},t.stripPrefix=function(n,t){return 0===n.indexOf(t)?n.substr(t.length):n},t.parsePath=function(n){var t=n,e="",r="",o=t.indexOf("#");o!==-1&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return i!==-1&&(e=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===e?"":e,hash:"#"===r?"":r}},t.createPath=function(n){var t=n.pathname,e=n.search,r=n.hash,o=t||"/";return e&&"?"!==e&&(o+="?"===e.charAt(0)?e:"?"+e),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}},function(n,t,e){"use strict";var r=function(){};n.exports=r},function(n,t,e){"use strict";function r(n){return n&&n.__esModule?n:{"default":n}}t.__esModule=!0;var o=e(3),i=(r(o),function(){var n=null,t=function(t){return n=t,function(){n===t&&(n=null)}},e=function(t,e,r,o){if(null!=n){var i="function"==typeof n?n(t,e):n;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(i!==!1)}else o(!0)},r=[],o=function(n){return r.push(n),function(){r=r.filter(function(t){return t!==n})}},i=function(){for(var n=arguments.length,t=Array(n),e=0;e<n;e++)t[e]=arguments[e];return r.forEach(function(n){return n.apply(void 0,t)})};return{setPrompt:t,confirmTransitionTo:e,appendListener:o,notifyListeners:i}});t["default"]=i},function(n,t){"use strict";t.__esModule=!0;t.addEventListener=function(n,t,e){return n.addEventListener?n.addEventListener(t,e,!1):n.attachEvent("on"+t,e)},t.removeEventListener=function(n,t,e){return n.removeEventListener?n.removeEventListener(t,e,!1):n.detachEvent("on"+t,e)},t.getConfirmation=function(n,t){return t(window.confirm(n))},t.supportsHistory=function(){var n=window.navigator.userAgent;return(n.indexOf("Android 2.")===-1&&n.indexOf("Android 4.0")===-1||n.indexOf("Mobile Safari")===-1||n.indexOf("Chrome")!==-1||n.indexOf("Windows Phone")!==-1)&&(window.history&&"pushState"in window.history)},t.supportsPopStateOnHashChange=function(){return window.navigator.userAgent.indexOf("Trident")===-1},t.supportsGoWithoutReloadUsingHash=function(){return window.navigator.userAgent.indexOf("Firefox")===-1}},function(n,t){"use strict";t.__esModule=!0;t.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement)},function(n,t,e){"use strict";var r=function(n,t,e,r,o,i,a,c){if(!n){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[e,r,o,i,a,c],f=0;u=new Error(t.replace(/%s/g,function(){return s[f++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};n.exports=r},function(n,t,e){"use strict";function r(n){return n&&n.__esModule?n:{"default":n}}t.__esModule=!0;var o=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},i=e(3),a=(r(i),e(7)),c=r(a),u=e(1),s=e(2),f=e(4),d=r(f),l=e(6),h=e(5),v="popstate",p="hashchange",g=function(){try{return window.history.state||{}}catch(n){return{}}},y=function(){var n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];l.canUseDOM?void 0:(0,c["default"])(!1);var t=window.history,e=(0,h.supportsHistory)(),r=!(0,h.supportsPopStateOnHashChange)(),i=n.basename,a=void 0===i?"":i,f=n.forceRefresh,y=void 0!==f&&f,w=n.getUserConfirmation,P=void 0===w?h.getConfirmation:w,m=n.keyLength,O=void 0===m?6:m,x=function(n){var t=n||{},e=t.key,r=t.state,i=window.location,c=i.pathname,u=i.search,f=i.hash,d=c+u+f;return a&&(d=(0,s.stripPrefix)(d,a)),o({},(0,s.parsePath)(d),{state:r,key:e})},b=function(){return Math.random().toString(36).substr(2,O)},L=(0,d["default"])(),E=function(n){o(W,n),W.length=t.length,L.notifyListeners(W.location,W.action)},_=function(n){void 0!==n.state&&A(x(n.state))},k=function(){A(x(g()))},M=!1,A=function(n){M?(M=!1,E()):!function(){var t="POP";L.confirmTransitionTo(n,t,P,function(e){e?E({action:t,location:n}):T(n)})}()},T=function(n){var t=W.location,e=H.indexOf(t.key);e===-1&&(e=0);var r=H.indexOf(n.key);r===-1&&(r=0);var o=e-r;o&&(M=!0,U(o))},S=x(g()),H=[S.key],j=function(n,r){var o="PUSH",i=(0,u.createLocation)(n,r,b());L.confirmTransitionTo(i,o,P,function(n){if(n){var r=a+(0,s.createPath)(i),c=i.key,u=i.state;if(e)if(t.pushState({key:c,state:u},null,r),y)window.location.href=r;else{var f=H.indexOf(W.location.key),d=H.slice(0,f===-1?0:f+1);d.push(i.key),H=d,E({action:o,location:i})}else window.location.href=r}})},C=function(n,r){var o="REPLACE",i=(0,u.createLocation)(n,r,b());L.confirmTransitionTo(i,o,P,function(n){if(n){var r=a+(0,s.createPath)(i),c=i.key,u=i.state;if(e)if(t.replaceState({key:c,state:u},null,r),y)window.location.replace(r);else{var f=H.indexOf(W.location.key);f!==-1&&(H[f]=i.key),E({action:o,location:i})}else window.location.replace(r)}})},U=function(n){t.go(n)},q=function(){return U(-1)},R=function(){return U(1)},B=0,I=function(n){B+=n,1===B?((0,h.addEventListener)(window,v,_),r&&(0,h.addEventListener)(window,p,k)):0===B&&((0,h.removeEventListener)(window,v,_),r&&(0,h.removeEventListener)(window,p,k))},F=!1,D=function(){var n=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],t=L.setPrompt(n);return F||(I(1),F=!0),function(){return F&&(F=!1,I(-1)),t()}},G=function(n){var t=L.appendListener(n);return I(1),function(){return I(-1),t()}},W={length:t.length,action:"POP",location:S,push:j,replace:C,go:U,goBack:q,goForward:R,block:D,listen:G};return W};t["default"]=y},function(n,t,e){"use strict";function r(n){return n&&n.__esModule?n:{"default":n}}t.__esModule=!0;var o=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},i=e(3),a=(r(i),e(7)),c=r(a),u=e(1),s=e(2),f=e(4),d=r(f),l=e(6),h=e(5),v="hashchange",p={hashbang:{encodePath:function(n){return"!"===n.charAt(0)?n:"!/"+(0,s.stripLeadingSlash)(n)},decodePath:function(n){return"!"===n.charAt(0)?n.substr(1):n}},noslash:{encodePath:s.stripLeadingSlash,decodePath:s.addLeadingSlash},slash:{encodePath:s.addLeadingSlash,decodePath:s.addLeadingSlash}},g=function(){var n=window.location.href,t=n.indexOf("#");return t===-1?"":n.substring(t+1)},y=function(n){return window.location.hash=n},w=function(n){var t=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,t>=0?t:0)+"#"+n)},P=function(){var n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];l.canUseDOM?void 0:(0,c["default"])(!1);var t=window.history,e=((0,h.supportsGoWithoutReloadUsingHash)(),n.basename),r=void 0===e?"":e,i=n.getUserConfirmation,a=void 0===i?h.getConfirmation:i,f=n.hashType,P=void 0===f?"slash":f,m=p[P],O=m.encodePath,x=m.decodePath,b=function(){var n=x(g());return r&&(n=(0,s.stripPrefix)(n,r)),(0,s.parsePath)(n)},L=(0,d["default"])(),E=function(n){o(z,n),z.length=t.length,L.notifyListeners(z.location,z.action)},_=!1,k=null,M=function(){var n=g(),t=O(n);if(n!==t)w(t);else{var e=b(),r=z.location;if(!_&&(0,u.locationsAreEqual)(r,e))return;if(k===(0,s.createPath)(e))return;k=null,A(e)}},A=function(n){_?(_=!1,E()):!function(){var t="POP";L.confirmTransitionTo(n,t,a,function(e){e?E({action:t,location:n}):T(n)})}()},T=function(n){var t=z.location,e=C.lastIndexOf((0,s.createPath)(t));e===-1&&(e=0);var r=C.lastIndexOf((0,s.createPath)(n));r===-1&&(r=0);var o=e-r;o&&(_=!0,R(o))},S=g(),H=O(S);S!==H&&w(H);var j=b(),C=[(0,s.createPath)(j)],U=function(n,t){var e="PUSH",o=(0,u.createLocation)(n);L.confirmTransitionTo(o,e,a,function(n){if(n){var t=(0,s.createPath)(o),i=O(r+t),a=g()!==i;if(a){k=t,y(i);var c=C.lastIndexOf((0,s.createPath)(z.location)),u=C.slice(0,c===-1?0:c+1);u.push(t),C=u,E({action:e,location:o})}else E()}})},q=function(n,t){var e="REPLACE",o=(0,u.createLocation)(n);L.confirmTransitionTo(o,e,a,function(n){if(n){var t=(0,s.createPath)(o),i=O(r+t),a=g()!==i;a&&(k=t,w(i));var c=C.indexOf((0,s.createPath)(z.location));c!==-1&&(C[c]=t),E({action:e,location:o})}})},R=function(n){t.go(n)},B=function(){return R(-1)},I=function(){return R(1)},F=0,D=function(n){F+=n,1===F?(0,h.addEventListener)(window,v,M):0===F&&(0,h.removeEventListener)(window,v,M)},G=!1,W=function(){var n=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],t=L.setPrompt(n);return G||(D(1),G=!0),function(){return G&&(G=!1,D(-1)),t()}},V=function(n){var t=L.appendListener(n);return D(1),function(){return D(-1),t()}},z={length:t.length,action:"POP",location:j,push:U,replace:q,go:R,goBack:B,goForward:I,block:W,listen:V};return z};t["default"]=P},function(n,t,e){"use strict";function r(n){return n&&n.__esModule?n:{"default":n}}t.__esModule=!0;var o=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},i=e(1),a=e(4),c=r(a),u=function(n,t,e){return Math.min(Math.max(n,t),e)},s=function(){var n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=n.getUserConfirmation,e=n.initialEntries,r=void 0===e?["/"]:e,a=n.initialIndex,s=void 0===a?0:a,f=n.keyLength,d=void 0===f?6:f,l=(0,c["default"])(),h=function(n){o(E,n),E.length=E.entries.length,l.notifyListeners(E.location,E.action)},v=function(){return Math.random().toString(36).substr(2,d)},p=u(s,0,r.length-1),g=r.map(function(n,t){return"string"==typeof n?(0,i.createLocation)(n,t?v():void 0):n}),y=function(n,e){var r="PUSH",o=(0,i.createLocation)(n,e,v());l.confirmTransitionTo(o,r,t,function(n){if(n){var t=E.index,e=t+1,i=E.entries.slice(0);i.length>e?i.splice(e,i.length-e,o):i.push(o),h({action:r,location:o,index:e,entries:i})}})},w=function(n,e){var r="REPLACE",o=(0,i.createLocation)(n,e,v());l.confirmTransitionTo(o,r,t,function(n){n&&(E.entries[E.index]=o,h({action:r,location:o}))})},P=function(n){var e=u(E.index+n,0,E.entries.length-1),r="POP",o=E.entries[e];l.confirmTransitionTo(o,r,t,function(n){n?h({action:r,location:o,index:e}):h()})},m=function(){return P(-1)},O=function(){return P(1)},x=function(n){var t=E.index+n;return t>=0&&t<E.entries.length},b=function(){var n=!(arguments.length<=0||void 0===arguments[0])&&arguments[0];return l.setPrompt(n)},L=function(n){return l.appendListener(n)},E={length:g.length,action:"POP",location:g[p],index:p,entries:g,push:y,replace:w,go:P,goBack:m,goForward:O,canGo:x,block:b,listen:L};return E};t["default"]=s}])});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc