File: /var/www/sites/1250.info/wp-content/themes/savoy/assets/js/plugins/snapback-cache.min.js
var SnapbackCache=function(c){c=c||{};var f=function(){return{set:function(a,b,d){var e=sessionStorage.getItem(a);e=e?JSON.parse(e):{};d?e[b]=JSON.stringify(d):delete e[b];sessionStorage.setItem(a,JSON.stringify(e))},get:function(a,b,d){if(a=sessionStorage.getItem(a))if(a=JSON.parse(a),a[b])return JSON.parse(a[b]);return null}}}(),k=function(a){f.set("pageCache",a,null)},m=function(){if(l()){var a=f.get("pageCache",document.location.href),b=jQuery(c.bodySelector);b.removeClass().addClass(a.wrapperClass);
b.html(a.body);setTimeout(function(){var d=b.children(".nm-products").children(".hide");d.length&&(d.find(".lazyloading").removeClass("lazyloading").addClass("lazyloaded"),d.removeClass("hide"))},300);"function"===typeof c.removeAutofocus&&c.removeAutofocus();setTimeout(function(){window.scrollTo(a.positionX,a.positionY)},1);k(document.location.href);sessionStorage.setItem("pageCacheViews",1);jQuery(c.bodySelector).trigger("snapback-cache:loaded",a);return!1}},n=function(){var a=sessionStorage.getItem("pageCache");
if(a){a=JSON.parse(a);var b=[];for(e in a)b.push([e,a[e]]);if(10<=b.length){b.sort(function(g,h){g=g[1].cachedAt;h=h[1].cachedAt;return h<g?-1:h>g?1:0});for(var d=0;d<b.length+1-10;d++){var e=b[d][0];delete a[e]}sessionStorage.setItem(namespace,JSON.stringify(a))}}},l=function(){if(!sessionStorage||!history)return!1;var a=f.get("pageCache",document.location.href);return a&&a.cachedAt>(new Date).getTime()-9E5?(a=sessionStorage.getItem("pageCacheViews"),3<parseInt(a)?(k(document.location.href),sessionStorage.setItem("pageCacheViews",
1),!1):!0):!1};jQuery(function(){"function"===typeof c.removeAutofocus&&l()&&c.removeAutofocus()});jQuery(window).on("load",function(){m()});return{remove:k,loadFromCache:m,cachePage:function(){if(sessionStorage&&history){"function"===typeof c.removeAutofocus&&c.removeAutofocus();var a=jQuery(c.bodySelector);a.children(".nm-infload-controls").removeClass("nm-loader");a={body:a.html(),wrapperClass:jQuery(c.bodySelector).attr("class"),positionY:window.pageYOffset,positionX:window.pageXOffset,cachedAt:(new Date).getTime()};
var b=document.location.href;a&&n();f.set("pageCache",b,a);jQuery(c.bodySelector).trigger("snapback-cache:cached",a)}},willUseCacheOnThisPage:l}};