Socket
Socket
Sign inDemoInstall

history

Package Overview
Dependencies
2
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.1 to 5.0.2

2

browser.d.ts

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

declare const _default: import("history").BrowserHistory<import("history").State>;
declare const _default: import("history").BrowserHistory;
/**

@@ -3,0 +3,0 @@ * Create a default instance for the current document.

function p(){p=Object.assign||function(b){for(var e=1;e<arguments.length;e++){var f=arguments[e],m;for(m in f)Object.prototype.hasOwnProperty.call(f,m)&&(b[m]=f[m])}return b};return p.apply(this,arguments)}var u,x=u||(u={});x.Pop="POP";x.Push="PUSH";x.Replace="REPLACE";var A="production"!==process.env.NODE_ENV?function(b){return Object.freeze(b)}:function(b){return b};function B(b,e){if(!b){"undefined"!==typeof console&&console.warn(e);try{throw Error(e);}catch(f){}}}
function C(b){b.preventDefault();b.returnValue=""}function G(){var b=[];return{get length(){return b.length},push:function(e){b.push(e);return function(){b=b.filter(function(f){return f!==e})}},call:function(e){b.forEach(function(f){return f&&f(e)})}}}
var H=function(b){function e(){var a=q.location,c=r.state||{};return[c.idx,A({pathname:a.pathname,search:a.search,hash:a.hash,state:c.usr||null,key:c.key||"default"})]}function f(a){if("string"===typeof a)var c=a;else{c=a.pathname;var h=a.search;a=a.hash;c=(void 0===c?"/":c)+(void 0===h?"":h)+(void 0===a?"":a)}return c}function m(a,c){void 0===c&&(c=null);var h=p,k=v;if("string"===typeof a){var d={};if(a){var g=a.indexOf("#");0<=g&&(d.hash=a.substr(g),a=a.substr(0,g));g=a.indexOf("?");0<=g&&(d.search=
a.substr(g),a=a.substr(0,g));a&&(d.pathname=a)}a=d}return A(h({},k,a,{state:c,key:Math.random().toString(36).substr(2,8)}))}function y(a){z=a;a=e();n=a[0];v=a[1];D.call({action:z,location:v})}function E(a,c){function h(){E(a,c)}var k=u.Push,d=m(a,c);if(!l.length||(l.call({action:k,location:d,retry:h}),!1)){var g=[{usr:d.state,key:d.key,idx:n+1},f(d)];d=g[0];g=g[1];try{r.pushState(d,"",g)}catch(I){q.location.assign(g)}y(k)}}function F(a,c){function h(){F(a,c)}var k=u.Replace,d=m(a,c);l.length&&(l.call({action:k,
location:d,retry:h}),1)||(d=[{usr:d.state,key:d.key,idx:n},f(d)],r.replaceState(d[0],"",d[1]),y(k))}function t(a){r.go(a)}void 0===b&&(b={});b=b.window;var q=void 0===b?document.defaultView:b,r=q.history,w=null;q.addEventListener("popstate",function(){if(w)l.call(w),w=null;else{var a=u.Pop,c=e(),h=c[0];c=c[1];if(l.length)if(null!=h){var k=n-h;k&&(w={action:a,location:c,retry:function(){t(-1*k)}},t(k))}else"production"!==process.env.NODE_ENV?B(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
var H=function(b){function e(){var a=q.location,c=r.state||{};return[c.idx,A({pathname:a.pathname,search:a.search,hash:a.hash,state:c.usr||null,key:c.key||"default"})]}function f(a){if("string"===typeof a)var c=a;else{c=a.pathname;var h=a.search;a=a.hash;c=(void 0===c?"/":c)+(void 0===h?"":h)+(void 0===a?"":a)}return c}function m(a,c){void 0===c&&(c=null);var h=p,k=v;if("string"===typeof a){var d={search:""};if(a){var g=a.indexOf("#");0<=g&&(d.hash=a.substr(g),a=a.substr(0,g));g=a.indexOf("?");0<=
g&&(d.search=a.substr(g),a=a.substr(0,g));a&&(d.pathname=a)}a=d}return A(h({},k,a,{state:c,key:Math.random().toString(36).substr(2,8)}))}function y(a){z=a;a=e();n=a[0];v=a[1];D.call({action:z,location:v})}function E(a,c){function h(){E(a,c)}var k=u.Push,d=m(a,c);if(!l.length||(l.call({action:k,location:d,retry:h}),!1)){var g=[{usr:d.state,key:d.key,idx:n+1},f(d)];d=g[0];g=g[1];try{r.pushState(d,"",g)}catch(I){q.location.assign(g)}y(k)}}function F(a,c){function h(){F(a,c)}var k=u.Replace,d=m(a,c);
l.length&&(l.call({action:k,location:d,retry:h}),1)||(d=[{usr:d.state,key:d.key,idx:n},f(d)],r.replaceState(d[0],"",d[1]),y(k))}function t(a){r.go(a)}void 0===b&&(b={});b=b.window;var q=void 0===b?document.defaultView:b,r=q.history,w=null;q.addEventListener("popstate",function(){if(w)l.call(w),w=null;else{var a=u.Pop,c=e(),h=c[0];c=c[1];if(l.length)if(null!=h){var k=n-h;k&&(w={action:a,location:c,retry:function(){t(-1*k)}},t(k))}else"production"!==process.env.NODE_ENV?B(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
void 0;else y(a)}});var z=u.Pop;b=e();var n=b[0],v=b[1],D=G(),l=G();null==n&&(n=0,r.replaceState(p({},r.state,{idx:n}),""));return{get action(){return z},get location(){return v},createHref:f,push:E,replace:F,go:t,back:function(){t(-1)},forward:function(){t(1)},listen:function(a){return D.push(a)},block:function(a){var c=l.push(a);1===l.length&&q.addEventListener("beforeunload",C);return function(){c();l.length||q.removeEventListener("beforeunload",C)}}}}();export default H
//# sourceMappingURL=browser.js.map

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

declare const _default: import("history").HashHistory<import("history").State>;
declare const _default: import("history").HashHistory;
/**

@@ -3,0 +3,0 @@ * Create a default instance for the current document.

function p(){p=Object.assign||function(a){for(var d=1;d<arguments.length;d++){var e=arguments[d],l;for(l in e)Object.prototype.hasOwnProperty.call(e,l)&&(a[l]=e[l])}return a};return p.apply(this,arguments)}var v,x=v||(v={});x.Pop="POP";x.Push="PUSH";x.Replace="REPLACE";var y="production"!==process.env.NODE_ENV?function(a){return Object.freeze(a)}:function(a){return a};function z(a,d){if(!a){"undefined"!==typeof console&&console.warn(d);try{throw Error(d);}catch(e){}}}
function C(a){a.preventDefault();a.returnValue=""}function D(){var a=[];return{get length(){return a.length},push:function(d){a.push(d);return function(){a=a.filter(function(e){return e!==d})}},call:function(d){a.forEach(function(e){return e&&e(d)})}}}function E(a){var d=a.pathname,e=a.search;a=a.hash;return(void 0===d?"/":d)+(void 0===e?"":e)+(void 0===a?"":a)}
function F(a){var d={};if(a){var e=a.indexOf("#");0<=e&&(d.hash=a.substr(e),a=a.substr(0,e));e=a.indexOf("?");0<=e&&(d.search=a.substr(e),a=a.substr(0,e));a&&(d.pathname=a)}return d}
function F(a){var d={search:""};if(a){var e=a.indexOf("#");0<=e&&(d.hash=a.substr(e),a=a.substr(0,e));e=a.indexOf("?");0<=e&&(d.search=a.substr(e),a=a.substr(0,e));a&&(d.pathname=a)}return d}
var K=function(a){function d(){var b=F(m.location.hash.substr(1)),c=b.pathname,g=b.search;b=b.hash;var h=q.state||{};return[h.idx,y({pathname:void 0===c?"/":c,search:void 0===g?"":g,hash:void 0===b?"":b,state:h.usr||null,key:h.key||"default"})]}function e(){if(w)k.call(w),w=null;else{var b=v.Pop,c=d(),g=c[0];c=c[1];if(k.length)if(null!=g){var h=n-g;h&&(w={action:b,location:c,retry:function(){r(-1*h)}},r(h))}else"production"!==process.env.NODE_ENV?z(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):

@@ -5,0 +5,0 @@ void 0;else A(b)}}function l(b){var c=document.querySelector("base"),g="";c&&c.getAttribute("href")&&(c=m.location.href,g=c.indexOf("#"),g=-1===g?c:c.slice(0,g));return g+"#"+("string"===typeof b?b:E(b))}function G(b,c){void 0===c&&(c=null);return y(p({},t,"string"===typeof b?F(b):b,{state:c,key:Math.random().toString(36).substr(2,8)}))}function A(b){B=b;b=d();n=b[0];t=b[1];H.call({action:B,location:t})}function I(b,c){function g(){I(b,c)}var h=v.Push,f=G(b,c);"production"!==process.env.NODE_ENV?

var p,C=p||(p={});C.Pop="POP";C.Push="PUSH";C.Replace="REPLACE";function D(e,g){if(!e){"undefined"!==typeof console&&console.warn(g);try{throw Error(g);}catch(h){}}}function E(e){e.preventDefault();e.returnValue=""}function F(){let e=[];return{get length(){return e.length},push(g){e.push(g);return function(){e=e.filter(h=>h!==g)}},call(g){e.forEach(h=>h&&h(g))}}}function H(){return Math.random().toString(36).substr(2,8)}
function I({pathname:e="/",search:g="",hash:h=""}){return e+g+h}function J(e){let g={};if(e){var h=e.indexOf("#");0<=h&&(g.hash=e.substr(h),e=e.substr(0,h));h=e.indexOf("?");0<=h&&(g.search=e.substr(h),e=e.substr(0,h));e&&(g.pathname=e)}return g}
function I({pathname:e="/",search:g="",hash:h=""}){return e+g+h}function J(e){let g={search:""};if(e){var h=e.indexOf("#");0<=h&&(g.hash=e.substr(h),e=e.substr(0,h));h=e.indexOf("?");0<=h&&(g.search=e.substr(h),e=e.substr(0,h));e&&(g.pathname=e)}return g}
function createBrowserHistory(e={}){function g(){let {pathname:b,search:a,hash:d}=q.location,f=k.state||{};return[f.idx,Object.freeze({pathname:b,search:a,hash:d,state:f.usr||null,key:f.key||"default"})]}function h(b){return"string"===typeof b?b:I(b)}function w(b,a=null){return Object.freeze(Object.assign(Object.assign(Object.assign({},r),"string"===typeof b?J(b):b),{state:a,key:H()}))}function z(b){u=b;[n,r]=g();v.call({action:u,location:r})}function A(b,a){function d(){A(b,a)}let f=p.Push,

@@ -4,0 +4,0 @@ l=w(b,a);if(!c.length||(c.call({action:f,location:l,retry:d}),!1)){let [t,B]=[{usr:l.state,key:l.key,idx:n+1},h(l)];try{k.pushState(t,"",B)}catch(G){q.location.assign(B)}z(f)}}function x(b,a){function d(){x(b,a)}let f=p.Replace,l=w(b,a);if(!c.length||(c.call({action:f,location:l,retry:d}),!1)){let [t,B]=[{usr:l.state,key:l.key,idx:n},h(l)];k.replaceState(t,"",B);z(f)}}function y(b){k.go(b)}let {window:q=document.defaultView}=e,k=q.history,m=null;q.addEventListener("popstate",function(){if(m)c.call(m),

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

var t,e=t||(t={});function n(t){t.preventDefault(),t.returnValue=""}function a(){let t=[];return{get length(){return t.length},push:e=>(t.push(e),function(){t=t.filter((t=>t!==e))}),call(e){t.forEach((t=>t&&t(e)))}}}function l(){return Math.random().toString(36).substr(2,8)}function i({pathname:t="/",search:e="",hash:n=""}){return t+e+n}function r(t){let e={};if(t){var n=t.indexOf("#");0<=n&&(e.hash=t.substr(n),t=t.substr(0,n)),0<=(n=t.indexOf("?"))&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function o(e={}){function o(){let{pathname:t,search:e,hash:n}=h.location,a=g.state||{};return[a.idx,{pathname:t,search:e,hash:n,state:a.usr||null,key:a.key||"default"}]}function c(t){return"string"==typeof t?t:i(t)}function s(t,e=null){return Object.assign(Object.assign(Object.assign({},b),"string"==typeof t?r(t):t),{state:e,key:l()})}function u(t){d=t,[y,b]=o(),k.call({action:d,location:b})}function f(t){g.go(t)}let{window:h=document.defaultView}=e,g=h.history,p=null;h.addEventListener("popstate",(function(){if(p)m.call(p),p=null;else{let e=t.Pop,[n,a]=o();if(m.length){if(null!=n){let t=y-n;t&&(p={action:e,location:a,retry(){f(-1*t)}},f(t))}}else u(e)}}));let d=t.Pop,[y,b]=o(),k=a(),m=a();return null==y&&(y=0,g.replaceState(Object.assign(Object.assign({},g.state),{idx:y}),"")),{get action(){return d},get location(){return b},createHref:c,push:function e(n,a){let l=t.Push,i=s(n,a);if(!m.length||(m.call({action:l,location:i,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:i.state,key:i.key,idx:y+1},c(i)];try{g.pushState(t,"",e)}catch(r){h.location.assign(e)}u(l)}},replace:function e(n,a){let l=t.Replace,i=s(n,a);if(!m.length||(m.call({action:l,location:i,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:i.state,key:i.key,idx:y},c(i)];g.replaceState(t,"",e),u(l)}},go:f,back(){f(-1)},forward(){f(1)},listen:t=>k.push(t),block(t){let e=m.push(t);return 1===m.length&&h.addEventListener("beforeunload",n),function(){e(),m.length||h.removeEventListener("beforeunload",n)}}}}function c(e={}){function o(){let{pathname:t="/",search:e="",hash:n=""}=r(g.location.hash.substr(1)),a=p.state||{};return[a.idx,{pathname:t,search:e,hash:n,state:a.usr||null,key:a.key||"default"}]}function c(){if(d)O.call(d),d=null;else{let e=t.Pop,[n,a]=o();if(O.length){if(null!=n){let t=b-n;t&&(d={action:e,location:a,retry(){h(-1*t)}},h(t))}}else f(e)}}function s(t){var e=document.querySelector("base"),n="";return e&&e.getAttribute("href")&&(n=-1===(n=(e=g.location.href).indexOf("#"))?e:e.slice(0,n)),n+"#"+("string"==typeof t?t:i(t))}function u(t,e=null){return Object.assign(Object.assign(Object.assign({},k),"string"==typeof t?r(t):t),{state:e,key:l()})}function f(t){y=t,[b,k]=o(),m.call({action:y,location:k})}function h(t){p.go(t)}let{window:g=document.defaultView}=e,p=g.history,d=null;g.addEventListener("popstate",c),g.addEventListener("hashchange",(()=>{let[,t]=o();i(t)!==i(k)&&c()}));let y=t.Pop,[b,k]=o(),m=a(),O=a();return null==b&&(b=0,p.replaceState(Object.assign(Object.assign({},p.state),{idx:b}),"")),{get action(){return y},get location(){return k},createHref:s,push:function e(n,a){let l=t.Push,i=u(n,a);if(!O.length||(O.call({action:l,location:i,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:i.state,key:i.key,idx:b+1},s(i)];try{p.pushState(t,"",e)}catch(r){g.location.assign(e)}f(l)}},replace:function e(n,a){let l=t.Replace,i=u(n,a);if(!O.length||(O.call({action:l,location:i,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:i.state,key:i.key,idx:b},s(i)];p.replaceState(t,"",e),f(l)}},go:h,back(){h(-1)},forward(){h(1)},listen:t=>m.push(t),block(t){let e=O.push(t);return 1===O.length&&g.addEventListener("beforeunload",n),function(){e(),O.length||g.removeEventListener("beforeunload",n)}}}}function s(e={}){function n(t,e=null){return Object.assign(Object.assign(Object.assign({},d),"string"==typeof t?r(t):t),{state:e,key:l()})}function o(t,e,n){return!b.length||(b.call({action:t,location:e,retry:n}),!1)}function c(t,e){p=t,d=e,y.call({action:p,location:d})}function s(e){let n=Math.min(Math.max(g+e,0),h.length-1),a=t.Pop,l=h[n];o(a,l,(function(){s(e)}))&&(g=n,c(a,l))}let{initialEntries:u=["/"],initialIndex:f}=e,h=u.map((t=>Object.assign({pathname:"/",search:"",hash:"",state:null,key:l()},"string"==typeof t?r(t):t))),g=Math.min(Math.max(null==f?h.length-1:f,0),h.length-1),p=t.Pop,d=h[g],y=a(),b=a();return{get index(){return g},get action(){return p},get location(){return d},createHref:function(t){return"string"==typeof t?t:i(t)},push:function e(a,l){let i=t.Push,r=n(a,l);o(i,r,(function(){e(a,l)}))&&(g+=1,h.splice(g,h.length,r),c(i,r))},replace:function e(a,l){let i=t.Replace,r=n(a,l);o(i,r,(function(){e(a,l)}))&&(h[g]=r,c(i,r))},go:s,back(){s(-1)},forward(){s(1)},listen:t=>y.push(t),block:t=>b.push(t)}}e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE";export{t as Action,o as createBrowserHistory,c as createHashHistory,s as createMemoryHistory,i as createPath,r as parsePath};
var t,e=t||(t={});function n(t){t.preventDefault(),t.returnValue=""}function a(){let t=[];return{get length(){return t.length},push:e=>(t.push(e),function(){t=t.filter((t=>t!==e))}),call(e){t.forEach((t=>t&&t(e)))}}}function l(){return Math.random().toString(36).substr(2,8)}function i({pathname:t="/",search:e="",hash:n=""}){return t+e+n}function r(t){let e={search:""};if(t){var n=t.indexOf("#");0<=n&&(e.hash=t.substr(n),t=t.substr(0,n)),0<=(n=t.indexOf("?"))&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function o(e={}){function o(){let{pathname:t,search:e,hash:n}=f.location,a=g.state||{};return[a.idx,{pathname:t,search:e,hash:n,state:a.usr||null,key:a.key||"default"}]}function c(t){return"string"==typeof t?t:i(t)}function s(t,e=null){return Object.assign(Object.assign(Object.assign({},b),"string"==typeof t?r(t):t),{state:e,key:l()})}function u(t){d=t,[y,b]=o(),k.call({action:d,location:b})}function h(t){g.go(t)}let{window:f=document.defaultView}=e,g=f.history,p=null;f.addEventListener("popstate",(function(){if(p)m.call(p),p=null;else{let e=t.Pop,[n,a]=o();if(m.length){if(null!=n){let t=y-n;t&&(p={action:e,location:a,retry(){h(-1*t)}},h(t))}}else u(e)}}));let d=t.Pop,[y,b]=o(),k=a(),m=a();return null==y&&(y=0,g.replaceState(Object.assign(Object.assign({},g.state),{idx:y}),"")),{get action(){return d},get location(){return b},createHref:c,push:function e(n,a){let l=t.Push,i=s(n,a);if(!m.length||(m.call({action:l,location:i,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:i.state,key:i.key,idx:y+1},c(i)];try{g.pushState(t,"",e)}catch(r){f.location.assign(e)}u(l)}},replace:function e(n,a){let l=t.Replace,i=s(n,a);if(!m.length||(m.call({action:l,location:i,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:i.state,key:i.key,idx:y},c(i)];g.replaceState(t,"",e),u(l)}},go:h,back(){h(-1)},forward(){h(1)},listen:t=>k.push(t),block(t){let e=m.push(t);return 1===m.length&&f.addEventListener("beforeunload",n),function(){e(),m.length||f.removeEventListener("beforeunload",n)}}}}function c(e={}){function o(){let{pathname:t="/",search:e="",hash:n=""}=r(g.location.hash.substr(1)),a=p.state||{};return[a.idx,{pathname:t,search:e,hash:n,state:a.usr||null,key:a.key||"default"}]}function c(){if(d)O.call(d),d=null;else{let e=t.Pop,[n,a]=o();if(O.length){if(null!=n){let t=b-n;t&&(d={action:e,location:a,retry(){f(-1*t)}},f(t))}}else h(e)}}function s(t){var e=document.querySelector("base"),n="";return e&&e.getAttribute("href")&&(n=-1===(n=(e=g.location.href).indexOf("#"))?e:e.slice(0,n)),n+"#"+("string"==typeof t?t:i(t))}function u(t,e=null){return Object.assign(Object.assign(Object.assign({},k),"string"==typeof t?r(t):t),{state:e,key:l()})}function h(t){y=t,[b,k]=o(),m.call({action:y,location:k})}function f(t){p.go(t)}let{window:g=document.defaultView}=e,p=g.history,d=null;g.addEventListener("popstate",c),g.addEventListener("hashchange",(()=>{let[,t]=o();i(t)!==i(k)&&c()}));let y=t.Pop,[b,k]=o(),m=a(),O=a();return null==b&&(b=0,p.replaceState(Object.assign(Object.assign({},p.state),{idx:b}),"")),{get action(){return y},get location(){return k},createHref:s,push:function e(n,a){let l=t.Push,i=u(n,a);if(!O.length||(O.call({action:l,location:i,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:i.state,key:i.key,idx:b+1},s(i)];try{p.pushState(t,"",e)}catch(r){g.location.assign(e)}h(l)}},replace:function e(n,a){let l=t.Replace,i=u(n,a);if(!O.length||(O.call({action:l,location:i,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:i.state,key:i.key,idx:b},s(i)];p.replaceState(t,"",e),h(l)}},go:f,back(){f(-1)},forward(){f(1)},listen:t=>m.push(t),block(t){let e=O.push(t);return 1===O.length&&g.addEventListener("beforeunload",n),function(){e(),O.length||g.removeEventListener("beforeunload",n)}}}}function s(e={}){function n(t,e=null){return Object.assign(Object.assign(Object.assign({},d),"string"==typeof t?r(t):t),{state:e,key:l()})}function o(t,e,n){return!b.length||(b.call({action:t,location:e,retry:n}),!1)}function c(t,e){p=t,d=e,y.call({action:p,location:d})}function s(e){let n=Math.min(Math.max(g+e,0),f.length-1),a=t.Pop,l=f[n];o(a,l,(function(){s(e)}))&&(g=n,c(a,l))}let{initialEntries:u=["/"],initialIndex:h}=e,f=u.map((t=>Object.assign({pathname:"/",search:"",hash:"",state:null,key:l()},"string"==typeof t?r(t):t))),g=Math.min(Math.max(null==h?f.length-1:h,0),f.length-1),p=t.Pop,d=f[g],y=a(),b=a();return{get index(){return g},get action(){return p},get location(){return d},createHref:function(t){return"string"==typeof t?t:i(t)},push:function e(a,l){let i=t.Push,r=n(a,l);o(i,r,(function(){e(a,l)}))&&(g+=1,f.splice(g,f.length,r),c(i,r))},replace:function e(a,l){let i=t.Replace,r=n(a,l);o(i,r,(function(){e(a,l)}))&&(f[g]=r,c(i,r))},go:s,back(){s(-1)},forward(){s(1)},listen:t=>y.push(t),block:t=>b.push(t)}}e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE";export{t as Action,o as createBrowserHistory,c as createHashHistory,s as createMemoryHistory,i as createPath,r as parsePath};
//# sourceMappingURL=history.production.min.js.map

@@ -46,9 +46,2 @@ /**

/**
* An object that is used to associate some arbitrary data with a location, but
* that does not appear in the URL path.
*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location.state
*/
export declare type State = object | null;
/**
* A unique string associated with a location. May be used to safely store

@@ -89,9 +82,9 @@ * and retrieve data in some other storage API, like `localStorage`.

*/
export interface Location<S extends State = State> extends Path {
export interface Location extends Path {
/**
* An object of arbitrary data associated with this location.
* A value of arbitrary data associated with this location.
*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location.state
*/
state: S;
state: any;
/**

@@ -118,3 +111,3 @@ * A unique string associated with this location. May be used to safely store

*/
export interface Update<S extends State = State> {
export interface Update {
/**

@@ -127,3 +120,3 @@ * The action that triggered the change.

*/
location: Location<S>;
location: Location;
}

@@ -133,4 +126,4 @@ /**

*/
export interface Listener<S extends State = State> {
(update: Update<S>): void;
export interface Listener {
(update: Update): void;
}

@@ -141,3 +134,3 @@ /**

*/
export interface Transition<S extends State = State> extends Update<S> {
export interface Transition extends Update {
/**

@@ -151,4 +144,4 @@ * Retries the update to the current location.

*/
export interface Blocker<S extends State = State> {
(tx: Transition<S>): void;
export interface Blocker {
(tx: Transition): void;
}

@@ -169,3 +162,3 @@ /**

*/
export interface History<S extends State = State> {
export interface History {
/**

@@ -183,3 +176,3 @@ * The last action that modified the current location. This will always be

*/
readonly location: Location<S>;
readonly location: Location;
/**

@@ -204,3 +197,3 @@ * Returns a valid href for the given `to` value that may be used as

*/
push(to: To, state?: S): void;
push(to: To, state?: any): void;
/**

@@ -215,3 +208,3 @@ * Replaces the current location in the history stack with a new one. The

*/
replace(to: To, state?: S): void;
replace(to: To, state?: any): void;
/**

@@ -250,3 +243,3 @@ * Navigates `n` entries backward/forward in the history stack relative to the

*/
listen(listener: Listener<S>): () => void;
listen(listener: Listener): () => void;
/**

@@ -261,3 +254,3 @@ * Prevents the current location from changing and sets up a listener that

*/
block(blocker: Blocker<S>): () => void;
block(blocker: Blocker): () => void;
}

@@ -271,3 +264,3 @@ /**

*/
export interface BrowserHistory<S extends State = State> extends History<S> {
export interface BrowserHistory extends History {
}

@@ -285,3 +278,3 @@ /**

*/
export interface HashHistory<S extends State = State> extends History<S> {
export interface HashHistory extends History {
}

@@ -295,3 +288,3 @@ /**

*/
export interface MemoryHistory<S extends State = State> extends History<S> {
export interface MemoryHistory extends History {
index: number;

@@ -349,2 +342,2 @@ }

*/
export declare function parsePath(path: string): Partial<Path>;
export declare function parsePath(path: string): PartialPath;
import _extends from'@babel/runtime/helpers/esm/extends';var r,B=r||(r={});B.Pop="POP";B.Push="PUSH";B.Replace="REPLACE";var C="production"!==process.env.NODE_ENV?function(b){return Object.freeze(b)}:function(b){return b};function D(b,h){if(!b){"undefined"!==typeof console&&console.warn(h);try{throw Error(h);}catch(k){}}}function E(b){b.preventDefault();b.returnValue=""}
function F(){var b=[];return{get length(){return b.length},push:function(h){b.push(h);return function(){b=b.filter(function(k){return k!==h})}},call:function(h){b.forEach(function(k){return k&&k(h)})}}}function H(){return Math.random().toString(36).substr(2,8)}function I(b){var h=b.pathname,k=b.search;b=b.hash;return(void 0===h?"/":h)+(void 0===k?"":k)+(void 0===b?"":b)}
function J(b){var h={};if(b){var k=b.indexOf("#");0<=k&&(h.hash=b.substr(k),b=b.substr(0,k));k=b.indexOf("?");0<=k&&(h.search=b.substr(k),b=b.substr(0,k));b&&(h.pathname=b)}return h}
function J(b){var h={search:""};if(b){var k=b.indexOf("#");0<=k&&(h.hash=b.substr(k),b=b.substr(0,k));k=b.indexOf("?");0<=k&&(h.search=b.substr(k),b=b.substr(0,k));b&&(h.pathname=b)}return h}
function createBrowserHistory(b){function h(){var c=p.location,a=m.state||{};return[a.idx,C({pathname:c.pathname,search:c.search,hash:c.hash,state:a.usr||null,key:a.key||"default"})]}function k(c){return"string"===typeof c?c:I(c)}function x(c,a){void 0===a&&(a=null);return C(_extends({},q,"string"===typeof c?J(c):c,{state:a,key:H()}))}function z(c){t=c;c=h();v=c[0];q=c[1];d.call({action:t,location:q})}function A(c,a){function e(){A(c,a)}var l=r.Push,g=x(c,a);if(!f.length||(f.call({action:l,

@@ -5,0 +5,0 @@ location:g,retry:e}),!1)){var n=[{usr:g.state,key:g.key,idx:v+1},k(g)];g=n[0];n=n[1];try{m.pushState(g,"",n)}catch(G){p.location.assign(n)}z(l)}}function y(c,a){function e(){y(c,a)}var l=r.Replace,g=x(c,a);f.length&&(f.call({action:l,location:g,retry:e}),1)||(g=[{usr:g.state,key:g.key,idx:v},k(g)],m.replaceState(g[0],"",g[1]),z(l))}function w(c){m.go(c)}void 0===b&&(b={});b=b.window;var p=void 0===b?document.defaultView:b,m=p.history,u=null;p.addEventListener("popstate",function(){if(u)f.call(u),

{
"name": "history",
"version": "5.0.1",
"version": "5.0.2",
"description": "Manage session history with JavaScript",

@@ -5,0 +5,0 @@ "author": "React Training <hello@reacttraining.com>",

'use strict';(function(l,y){"object"===typeof exports&&"undefined"!==typeof module?y(exports):"function"===typeof define&&define.amd?define(["exports"],y):(l="undefined"!==typeof globalThis?globalThis:l||self,y(l.HistoryLibrary={}))})(this,function(l){function y(){y=Object.assign||function(b){for(var g=1;g<arguments.length;g++){var h=arguments[g],t;for(t in h)Object.prototype.hasOwnProperty.call(h,t)&&(b[t]=h[t])}return b};return y.apply(this,arguments)}function C(b,g){if(!b){"undefined"!==typeof console&&
console.warn(g);try{throw Error(g);}catch(h){}}}function H(b){b.preventDefault();b.returnValue=""}function D(){var b=[];return{get length(){return b.length},push:function(g){b.push(g);return function(){b=b.filter(function(h){return h!==g})}},call:function(g){b.forEach(function(h){return h&&h(g)})}}}function I(){return Math.random().toString(36).substr(2,8)}function E(b){var g=b.pathname,h=b.search;b=b.hash;return(void 0===g?"/":g)+(void 0===h?"":h)+(void 0===b?"":b)}function F(b){var g={};if(b){var h=
b.indexOf("#");0<=h&&(g.hash=b.substr(h),b=b.substr(0,h));h=b.indexOf("?");0<=h&&(g.search=b.substr(h),b=b.substr(0,h));b&&(g.pathname=b)}return g}l.Action=void 0;(function(b){b.Pop="POP";b.Push="PUSH";b.Replace="REPLACE"})(l.Action||(l.Action={}));l.createBrowserHistory=function(b){function g(){var c=q.location,a=n.state||{};return[a.idx,Object.freeze({pathname:c.pathname,search:c.search,hash:c.hash,state:a.usr||null,key:a.key||"default"})]}function h(c){return"string"===typeof c?c:E(c)}function t(c,
a){void 0===a&&(a=null);return Object.freeze(y({},r,"string"===typeof c?F(c):c,{state:a,key:I()}))}function A(c){u=c;c=g();w=c[0];r=c[1];d.call({action:u,location:r})}function B(c,a){function e(){B(c,a)}var m=l.Action.Push,k=t(c,a);if(!f.length||(f.call({action:m,location:k,retry:e}),!1)){var p=[{usr:k.state,key:k.key,idx:w+1},h(k)];k=p[0];p=p[1];try{n.pushState(k,"",p)}catch(G){q.location.assign(p)}A(m)}}function z(c,a){function e(){z(c,a)}var m=l.Action.Replace,k=t(c,a);f.length&&(f.call({action:m,
console.warn(g);try{throw Error(g);}catch(h){}}}function H(b){b.preventDefault();b.returnValue=""}function D(){var b=[];return{get length(){return b.length},push:function(g){b.push(g);return function(){b=b.filter(function(h){return h!==g})}},call:function(g){b.forEach(function(h){return h&&h(g)})}}}function I(){return Math.random().toString(36).substr(2,8)}function E(b){var g=b.pathname,h=b.search;b=b.hash;return(void 0===g?"/":g)+(void 0===h?"":h)+(void 0===b?"":b)}function F(b){var g={search:""};
if(b){var h=b.indexOf("#");0<=h&&(g.hash=b.substr(h),b=b.substr(0,h));h=b.indexOf("?");0<=h&&(g.search=b.substr(h),b=b.substr(0,h));b&&(g.pathname=b)}return g}l.Action=void 0;(function(b){b.Pop="POP";b.Push="PUSH";b.Replace="REPLACE"})(l.Action||(l.Action={}));l.createBrowserHistory=function(b){function g(){var c=q.location,a=n.state||{};return[a.idx,Object.freeze({pathname:c.pathname,search:c.search,hash:c.hash,state:a.usr||null,key:a.key||"default"})]}function h(c){return"string"===typeof c?c:E(c)}
function t(c,a){void 0===a&&(a=null);return Object.freeze(y({},r,"string"===typeof c?F(c):c,{state:a,key:I()}))}function A(c){u=c;c=g();w=c[0];r=c[1];d.call({action:u,location:r})}function B(c,a){function e(){B(c,a)}var m=l.Action.Push,k=t(c,a);if(!f.length||(f.call({action:m,location:k,retry:e}),!1)){var p=[{usr:k.state,key:k.key,idx:w+1},h(k)];k=p[0];p=p[1];try{n.pushState(k,"",p)}catch(G){q.location.assign(p)}A(m)}}function z(c,a){function e(){z(c,a)}var m=l.Action.Replace,k=t(c,a);f.length&&(f.call({action:m,
location:k,retry:e}),1)||(k=[{usr:k.state,key:k.key,idx:w},h(k)],n.replaceState(k[0],"",k[1]),A(m))}function x(c){n.go(c)}void 0===b&&(b={});b=b.window;var q=void 0===b?document.defaultView:b,n=q.history,v=null;q.addEventListener("popstate",function(){if(v)f.call(v),v=null;else{var c=l.Action.Pop,a=g(),e=a[0];a=a[1];if(f.length)if(null!=e){var m=w-e;m&&(v={action:c,location:a,retry:function(){x(-1*m)}},x(m))}else C(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");

@@ -6,0 +6,0 @@ else A(c)}});var u=l.Action.Pop;b=g();var w=b[0],r=b[1],d=D(),f=D();null==w&&(w=0,n.replaceState(y({},n.state,{idx:w}),""));return{get action(){return u},get location(){return r},createHref:h,push:B,replace:z,go:x,back:function(){x(-1)},forward:function(){x(1)},listen:function(c){return d.push(c)},block:function(c){var a=f.push(c);1===f.length&&q.addEventListener("beforeunload",H);return function(){a();f.length||q.removeEventListener("beforeunload",H)}}}};l.createHashHistory=function(b){function g(){var a=

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

"use strict";!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).HistoryLibrary={})}(this,(function(t){function n(){return(n=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e,o=arguments[n];for(e in o)Object.prototype.hasOwnProperty.call(o,e)&&(t[e]=o[e])}return t}).apply(this,arguments)}function e(t){t.preventDefault(),t.returnValue=""}function o(){var t=[];return{get length(){return t.length},push:function(n){return t.push(n),function(){t=t.filter((function(t){return t!==n}))}},call:function(n){t.forEach((function(t){return t&&t(n)}))}}}function r(){return Math.random().toString(36).substr(2,8)}function i(t){var n=t.pathname,e=t.search;return(void 0===n?"/":n)+(void 0===e?"":e)+(void 0===(t=t.hash)?"":t)}function a(t){var n={};if(t){var e=t.indexOf("#");0<=e&&(n.hash=t.substr(e),t=t.substr(0,e)),0<=(e=t.indexOf("?"))&&(n.search=t.substr(e),t=t.substr(0,e)),t&&(n.pathname=t)}return n}var c;t.Action=void 0,(c=t.Action||(t.Action={})).Pop="POP",c.Push="PUSH",c.Replace="REPLACE",t.createBrowserHistory=function(c){function u(){var t=d.location,n=p.state||{};return[n.idx,{pathname:t.pathname,search:t.search,hash:t.hash,state:n.usr||null,key:n.key||"default"}]}function l(t){return"string"==typeof t?t:i(t)}function s(t,e){return void 0===e&&(e=null),n({},b,"string"==typeof t?a(t):t,{state:e,key:r()})}function f(t){y=t,t=u(),g=t[0],b=t[1],k.call({action:y,location:b})}function h(t){p.go(t)}void 0===c&&(c={});var d=void 0===(c=c.window)?document.defaultView:c,p=d.history,v=null;d.addEventListener("popstate",(function(){if(v)m.call(v),v=null;else{var n=t.Action.Pop,e=u(),o=e[0];if(e=e[1],m.length){if(null!=o){var r=g-o;r&&(v={action:n,location:e,retry:function(){h(-1*r)}},h(r))}}else f(n)}}));var y=t.Action.Pop,g=(c=u())[0],b=c[1],k=o(),m=o();return null==g&&(g=0,p.replaceState(n({},p.state,{idx:g}),"")),{get action(){return y},get location(){return b},createHref:l,push:function n(e,o){var r=t.Action.Push,i=s(e,o);if(!m.length||(m.call({action:r,location:i,retry:function(){n(e,o)}}),0)){var a=[{usr:i.state,key:i.key,idx:g+1},l(i)];i=a[0],a=a[1];try{p.pushState(i,"",a)}catch(t){d.location.assign(a)}f(r)}},replace:function n(e,o){var r=t.Action.Replace,i=s(e,o);m.length&&(m.call({action:r,location:i,retry:function(){n(e,o)}}),1)||(i=[{usr:i.state,key:i.key,idx:g},l(i)],p.replaceState(i[0],"",i[1]),f(r))},go:h,back:function(){h(-1)},forward:function(){h(1)},listen:function(t){return k.push(t)},block:function(t){var n=m.push(t);return 1===m.length&&d.addEventListener("beforeunload",e),function(){n(),m.length||d.removeEventListener("beforeunload",e)}}}},t.createHashHistory=function(c){function u(){var t=a(p.location.hash.substr(1)),n=t.pathname,e=t.search;t=t.hash;var o=v.state||{};return[o.idx,{pathname:void 0===n?"/":n,search:void 0===e?"":e,hash:void 0===t?"":t,state:o.usr||null,key:o.key||"default"}]}function l(){if(y)P.call(y),y=null;else{var n=t.Action.Pop,e=u(),o=e[0];if(e=e[1],P.length){if(null!=o){var r=b-o;r&&(y={action:n,location:e,retry:function(){d(-1*r)}},d(r))}}else h(n)}}function s(t){var n=document.querySelector("base"),e="";return n&&n.getAttribute("href")&&(e=-1===(e=(n=p.location.href).indexOf("#"))?n:n.slice(0,e)),e+"#"+("string"==typeof t?t:i(t))}function f(t,e){return void 0===e&&(e=null),n({},k,"string"==typeof t?a(t):t,{state:e,key:r()})}function h(t){g=t,t=u(),b=t[0],k=t[1],m.call({action:g,location:k})}function d(t){v.go(t)}void 0===c&&(c={});var p=void 0===(c=c.window)?document.defaultView:c,v=p.history,y=null;p.addEventListener("popstate",l),p.addEventListener("hashchange",(function(){i(u()[1])!==i(k)&&l()}));var g=t.Action.Pop,b=(c=u())[0],k=c[1],m=o(),P=o();return null==b&&(b=0,v.replaceState(n({},v.state,{idx:b}),"")),{get action(){return g},get location(){return k},createHref:s,push:function n(e,o){var r=t.Action.Push,i=f(e,o);if(!P.length||(P.call({action:r,location:i,retry:function(){n(e,o)}}),0)){var a=[{usr:i.state,key:i.key,idx:b+1},s(i)];i=a[0],a=a[1];try{v.pushState(i,"",a)}catch(t){p.location.assign(a)}h(r)}},replace:function n(e,o){var r=t.Action.Replace,i=f(e,o);P.length&&(P.call({action:r,location:i,retry:function(){n(e,o)}}),1)||(i=[{usr:i.state,key:i.key,idx:b},s(i)],v.replaceState(i[0],"",i[1]),h(r))},go:d,back:function(){d(-1)},forward:function(){d(1)},listen:function(t){return m.push(t)},block:function(t){var n=P.push(t);return 1===P.length&&p.addEventListener("beforeunload",e),function(){n(),P.length||p.removeEventListener("beforeunload",e)}}}},t.createMemoryHistory=function(e){function c(t,e){return void 0===e&&(e=null),n({},v,"string"==typeof t?a(t):t,{state:e,key:r()})}function u(t,n,e){return!g.length||(g.call({action:t,location:n,retry:e}),!1)}function l(t,n){p=t,v=n,y.call({action:p,location:v})}function s(n){var e=Math.min(Math.max(d+n,0),h.length-1),o=t.Action.Pop,r=h[e];u(o,r,(function(){s(n)}))&&(d=e,l(o,r))}void 0===e&&(e={});var f=e;e=f.initialEntries,f=f.initialIndex;var h=(void 0===e?["/"]:e).map((function(t){return n({pathname:"/",search:"",hash:"",state:null,key:r()},"string"==typeof t?a(t):t)})),d=Math.min(Math.max(null==f?h.length-1:f,0),h.length-1),p=t.Action.Pop,v=h[d],y=o(),g=o();return{get index(){return d},get action(){return p},get location(){return v},createHref:function(t){return"string"==typeof t?t:i(t)},push:function n(e,o){var r=t.Action.Push,i=c(e,o);u(r,i,(function(){n(e,o)}))&&(d+=1,h.splice(d,h.length,i),l(r,i))},replace:function n(e,o){var r=t.Action.Replace,i=c(e,o);u(r,i,(function(){n(e,o)}))&&(h[d]=i,l(r,i))},go:s,back:function(){s(-1)},forward:function(){s(1)},listen:function(t){return y.push(t)},block:function(t){return g.push(t)}}},t.createPath=i,t.parsePath=a,Object.defineProperty(t,"__esModule",{value:!0})}));
"use strict";!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).HistoryLibrary={})}(this,(function(t){function n(){return(n=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e,r=arguments[n];for(e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t}).apply(this,arguments)}function e(t){t.preventDefault(),t.returnValue=""}function r(){var t=[];return{get length(){return t.length},push:function(n){return t.push(n),function(){t=t.filter((function(t){return t!==n}))}},call:function(n){t.forEach((function(t){return t&&t(n)}))}}}function o(){return Math.random().toString(36).substr(2,8)}function i(t){var n=t.pathname,e=t.search;return(void 0===n?"/":n)+(void 0===e?"":e)+(void 0===(t=t.hash)?"":t)}function a(t){var n={search:""};if(t){var e=t.indexOf("#");0<=e&&(n.hash=t.substr(e),t=t.substr(0,e)),0<=(e=t.indexOf("?"))&&(n.search=t.substr(e),t=t.substr(0,e)),t&&(n.pathname=t)}return n}var c;t.Action=void 0,(c=t.Action||(t.Action={})).Pop="POP",c.Push="PUSH",c.Replace="REPLACE",t.createBrowserHistory=function(c){function u(){var t=d.location,n=p.state||{};return[n.idx,{pathname:t.pathname,search:t.search,hash:t.hash,state:n.usr||null,key:n.key||"default"}]}function l(t){return"string"==typeof t?t:i(t)}function s(t,e){return void 0===e&&(e=null),n({},b,"string"==typeof t?a(t):t,{state:e,key:o()})}function f(t){y=t,t=u(),g=t[0],b=t[1],k.call({action:y,location:b})}function h(t){p.go(t)}void 0===c&&(c={});var d=void 0===(c=c.window)?document.defaultView:c,p=d.history,v=null;d.addEventListener("popstate",(function(){if(v)m.call(v),v=null;else{var n=t.Action.Pop,e=u(),r=e[0];if(e=e[1],m.length){if(null!=r){var o=g-r;o&&(v={action:n,location:e,retry:function(){h(-1*o)}},h(o))}}else f(n)}}));var y=t.Action.Pop,g=(c=u())[0],b=c[1],k=r(),m=r();return null==g&&(g=0,p.replaceState(n({},p.state,{idx:g}),"")),{get action(){return y},get location(){return b},createHref:l,push:function n(e,r){var o=t.Action.Push,i=s(e,r);if(!m.length||(m.call({action:o,location:i,retry:function(){n(e,r)}}),0)){var a=[{usr:i.state,key:i.key,idx:g+1},l(i)];i=a[0],a=a[1];try{p.pushState(i,"",a)}catch(t){d.location.assign(a)}f(o)}},replace:function n(e,r){var o=t.Action.Replace,i=s(e,r);m.length&&(m.call({action:o,location:i,retry:function(){n(e,r)}}),1)||(i=[{usr:i.state,key:i.key,idx:g},l(i)],p.replaceState(i[0],"",i[1]),f(o))},go:h,back:function(){h(-1)},forward:function(){h(1)},listen:function(t){return k.push(t)},block:function(t){var n=m.push(t);return 1===m.length&&d.addEventListener("beforeunload",e),function(){n(),m.length||d.removeEventListener("beforeunload",e)}}}},t.createHashHistory=function(c){function u(){var t=a(p.location.hash.substr(1)),n=t.pathname,e=t.search;t=t.hash;var r=v.state||{};return[r.idx,{pathname:void 0===n?"/":n,search:void 0===e?"":e,hash:void 0===t?"":t,state:r.usr||null,key:r.key||"default"}]}function l(){if(y)P.call(y),y=null;else{var n=t.Action.Pop,e=u(),r=e[0];if(e=e[1],P.length){if(null!=r){var o=b-r;o&&(y={action:n,location:e,retry:function(){d(-1*o)}},d(o))}}else h(n)}}function s(t){var n=document.querySelector("base"),e="";return n&&n.getAttribute("href")&&(e=-1===(e=(n=p.location.href).indexOf("#"))?n:n.slice(0,e)),e+"#"+("string"==typeof t?t:i(t))}function f(t,e){return void 0===e&&(e=null),n({},k,"string"==typeof t?a(t):t,{state:e,key:o()})}function h(t){g=t,t=u(),b=t[0],k=t[1],m.call({action:g,location:k})}function d(t){v.go(t)}void 0===c&&(c={});var p=void 0===(c=c.window)?document.defaultView:c,v=p.history,y=null;p.addEventListener("popstate",l),p.addEventListener("hashchange",(function(){i(u()[1])!==i(k)&&l()}));var g=t.Action.Pop,b=(c=u())[0],k=c[1],m=r(),P=r();return null==b&&(b=0,v.replaceState(n({},v.state,{idx:b}),"")),{get action(){return g},get location(){return k},createHref:s,push:function n(e,r){var o=t.Action.Push,i=f(e,r);if(!P.length||(P.call({action:o,location:i,retry:function(){n(e,r)}}),0)){var a=[{usr:i.state,key:i.key,idx:b+1},s(i)];i=a[0],a=a[1];try{v.pushState(i,"",a)}catch(t){p.location.assign(a)}h(o)}},replace:function n(e,r){var o=t.Action.Replace,i=f(e,r);P.length&&(P.call({action:o,location:i,retry:function(){n(e,r)}}),1)||(i=[{usr:i.state,key:i.key,idx:b},s(i)],v.replaceState(i[0],"",i[1]),h(o))},go:d,back:function(){d(-1)},forward:function(){d(1)},listen:function(t){return m.push(t)},block:function(t){var n=P.push(t);return 1===P.length&&p.addEventListener("beforeunload",e),function(){n(),P.length||p.removeEventListener("beforeunload",e)}}}},t.createMemoryHistory=function(e){function c(t,e){return void 0===e&&(e=null),n({},v,"string"==typeof t?a(t):t,{state:e,key:o()})}function u(t,n,e){return!g.length||(g.call({action:t,location:n,retry:e}),!1)}function l(t,n){p=t,v=n,y.call({action:p,location:v})}function s(n){var e=Math.min(Math.max(d+n,0),h.length-1),r=t.Action.Pop,o=h[e];u(r,o,(function(){s(n)}))&&(d=e,l(r,o))}void 0===e&&(e={});var f=e;e=f.initialEntries,f=f.initialIndex;var h=(void 0===e?["/"]:e).map((function(t){return n({pathname:"/",search:"",hash:"",state:null,key:o()},"string"==typeof t?a(t):t)})),d=Math.min(Math.max(null==f?h.length-1:f,0),h.length-1),p=t.Action.Pop,v=h[d],y=r(),g=r();return{get index(){return d},get action(){return p},get location(){return v},createHref:function(t){return"string"==typeof t?t:i(t)},push:function n(e,r){var o=t.Action.Push,i=c(e,r);u(o,i,(function(){n(e,r)}))&&(d+=1,h.splice(d,h.length,i),l(o,i))},replace:function n(e,r){var o=t.Action.Replace,i=c(e,r);u(o,i,(function(){n(e,r)}))&&(h[d]=i,l(o,i))},go:s,back:function(){s(-1)},forward:function(){s(1)},listen:function(t){return y.push(t)},block:function(t){return g.push(t)}}},t.createPath=i,t.parsePath=a,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=history.production.min.js.map
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