!function(g){function l(w){if(f[w])return f[w].exports;var x=f[w]={i:w,l:!1,exports:{}};return g[w].call(x.exports,x,x.exports,l),x.l=!0,x.exports}var f={};l.m=g;l.c=f;l.d=function(g,f,y){l.o(g,f)||Object.defineProperty(g,f,{configurable:!1,enumerable:!0,get:y})};l.n=function(g){var f=g&&g.__esModule?function(){return g["default"]}:function(){return g};return l.d(f,"a",f),f};l.o=function(g,f){return Object.prototype.hasOwnProperty.call(g,f)};l.p="";l(l.s=2)}([function(g,l){!function(f){function w(a, c,d,k){c=Object.create((c&&c.prototype instanceof y?c:y).prototype);k=new C(k||[]);return c._invoke=function(a,b,c){var d=J;return function(k,g){if(d===L)throw Error("Generator is already running");if(d===A){if("throw"===k)throw g;return B()}c.method=k;for(c.arg=g;;){var f=c.delegate;if(f&&(f=v(f,c))){if(f===e)continue;return f}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if(d===J)throw d=A,c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg); d=L;f=x(a,b,c);if("normal"===f.type){if(d=c.done?A:H,f.arg===e)continue;return{value:f.arg,done:c.done}}"throw"===f.type&&(d=A,c.method="throw",c.arg=f.arg)}}}(a,d,k),c}function x(a,c,d){try{return{type:"normal",arg:a.call(c,d)}}catch(k){return{type:"throw",arg:k}}}function y(){}function p(){}function m(){}function n(a){["next","throw","return"].forEach(function(c){a[c]=function(a){return this._invoke(c,a)}})}function l(a){var c;this._invoke=function(d,k){function h(){return new Promise(function(c, h){!function N(c,d,k,h){c=x(a[c],a,d);if("throw"!==c.type){var e=c.arg;return(c=e.value)&&"object"==typeof c&&z.call(c,"__await")?Promise.resolve(c.__await).then(function(a){N("next",a,k,h)},function(a){N("throw",a,k,h)}):Promise.resolve(c).then(function(a){e.value=a;k(e)},function(a){return N("throw",a,k,h)})}h(c.arg)}(d,k,c,h)})}return c=c?c.then(h,h):h()}}function v(a,c){var d=a.iterator[c.method];if(d===q){if(c.delegate=null,"throw"===c.method){if(a.iterator["return"]&&(c.method="return",c.arg= q,v(a,c),"throw"===c.method))return e;c.method="throw";c.arg=new TypeError("The iterator does not provide a 'throw' method")}return e}d=x(d,a.iterator,c.arg);return"throw"===d.type?(c.method="throw",c.arg=d.arg,c.delegate=null,e):(d=d.arg)?d.done?(c[a.resultName]=d.value,c.next=a.nextLoc,"return"!==c.method&&(c.method="next",c.arg=q),c.delegate=null,e):d:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,e)}function K(a){var c={tryLoc:a[0]};1 in a&&(c.catchLoc= a[1]);2 in a&&(c.finallyLoc=a[2],c.afterLoc=a[3]);this.tryEntries.push(c)}function F(a){var c=a.completion||{};c.type="normal";delete c.arg;a.completion=c}function C(a){this.tryEntries=[{tryLoc:"root"}];a.forEach(K,this);this.reset(!0)}function u(a){if(a){var c=a[D];if(c)return c.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var d=-1,c=function h(){for(;++d+new Date-c&&b.length+30this.innerWidth?15:14,k=1;k<=h;k++)e=2*this.spotStep*k-a,e=b[e]?e+1:e,d||this.isBlocked||(b[e]=this.composeIframeSpot());else e=this.content.length,h=2,k=Math.round(e/2),(this.isMobile||(h=1440>this.innerWidth?3:4,k=e-3),d||this.isBlocked)?(d=a.slice(0,20),d=this.app.lib.shuffleArray(d),b[h]=this.composeLiveSpot(d[0]),this.isMobile&&(b[k]=this.composeLiveSpot(d[1]))):(b[h]=this.composeIframeSpot(),b[k]=this.composeIframeSpot()); var g=0;this.content.forEach(function(a){for(;void 0!==b[g];)g++;b[g]=a});var l=document.createDocumentFragment();b.forEach(function(a){l.appendChild(a)});this.container.innerHTML="";this.container.appendChild(l);this.content=this.container.querySelectorAll("li")}},{key:"getIframeSpotsAmount",value:function(a,b,c){a=1+~~((a+b-(this.isMobile?2:1440>this.innerWidth?3:4))/c);return 15this.innerWidth&&(this.hideSearchBar({updateStatus:!0}),this.isDesktopScreenWidth=!1),this.mobileSearchBarButton.addEventListener("click",this.onSearchButtonClickHandler))}},{key:"getInnerWidth",value:function(){return window.innerWidth||document.documentElement.clientWidth|| document.body.clientWidth}},{key:"getMenuTabsAmount",value:function(){return this.menuNodeElement.querySelectorAll("a.menu-item").length||0}},{key:"getMenuHeight",value:function(){var a=this.getMenuTabsAmount();return a?46*a-4:0}},{key:"onMenuButtonClickHandler",value:function(){this.isMenuShown?this.hideMobileMenu({updateStatus:!0}):this.showMobileMenu({updateStatus:!0})}},{key:"hideMobileMenu",value:function(a){this.menuNodeElement.style.height="0";a.updateStatus&&(this.isMenuShown=!1)}},{key:"showMobileMenu", value:function(a){var b=this.getMenuHeight();this.menuNodeElement.style.height="".concat(b,"px");a.updateStatus&&(this.isMenuShown=!0)}},{key:"onSearchButtonClickHandler",value:function(){this.isSearchBarShown?this.hideSearchBar({updateStatus:!0}):this.showSearchBar({updateStatus:!0,focus:!0})}},{key:"hideSearchBar",value:function(a){this.searchBarNodeElement.style.display="none";a.updateStatus&&(this.isSearchBarShown=!1)}},{key:"showSearchBar",value:function(a){this.searchBarNodeElement.style.display= "inline-block";a.updateStatus&&(this.isSearchBarShown=!0);a.focus&&this.searchBarNodeElement.focus()}},{key:"onResizeHandler",value:function(){var a=this.getInnerWidth(),b=1280<=a;if(this.isDesktopScreenWidth!==b){if(this.isDesktopScreenWidth=b,1280<=a)return this.showSearchBar({updateStatus:!1,focus:!1}),void this.hideMobileMenu({updateStatus:!1});this.isMenuShown?this.showMobileMenu({updateStatus:!1}):this.hideMobileMenu({updateStatus:!1});this.isSearchBarShown?this.showSearchBar({updateStatus:!1, focus:!1}):this.hideSearchBar({updateStatus:!1})}}}]),e}(),F=function(){function e(a){m()(this,e);this.isMobileWidth=1280>a.innerWidth||!1;this.app=a.app;this.menuTabsAmount=3;this.onResizeHandler=this.onResizeHandler.bind(this);this.init()}return n()(e,[{key:"init",value:function(){var a=document.querySelectorAll(".menu-item"),b=a.length;0===b.length||b.length ul"))&&(a.innerHTML="")}},{key:"composeDesktopMenuTab",value:function(a){var b=document.createElement("li"),c=document.createElement("a");return c.setAttribute("href",a.url),c.setAttribute("title",a.title),c.setAttribute("rel","noopener nofollow"),c.setAttribute("target","_blank"),c.innerHTML=a.title,c.className="menu-item",b.appendChild(c),b}},{key:"renderMenuTabs",value:function(){var a=this;if(this.removeMenuTabs(),this.isMobileWidth){var b= document.querySelector(".mob-menu > ul");this.menuTabsData.forEach(function(c,k){var e=a.composeMobileMenuTab(c,k ul");this.menuTabsData.forEach(function(b){b=a.composeDesktopMenuTab(b);c.appendChild(b)})}}},{key:"onResizeHandler",value:function(){var a=1280>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);this.isMobileWidth!==a&&(this.isMobileWidth=a,this.renderMenuTabs(), document.querySelector(".header-menu").style.removeProperty("height"),document.querySelector(".header-search").style.removeProperty("display"))}}]),e}(),C=function(){function e(a){m()(this,e);this.searchIndexUrl=a.searchIndexUrl;this.isMobile=a.isMobile;this.app=a.app;this.maxSearchResultAmount=this.isMobile?5:10;this.onKeyPressHandler=this.onKeyPressHandler.bind(this);this.onInputHandler=this.onInputHandler.bind(this);this.onBlurHandler=this.onBlurHandler.bind(this);this.onFocusHandler=this.onFocusHandler.bind(this); this.onScrollHandler=this.onScrollHandler.bind(this);this.onSearchResultULClick=this.onSearchResultULClick.bind(this);this.init()}return n()(e,[{key:"init",value:function(){this.searchFormWrapper=document.querySelector("#search-form");this.searchForm=document.querySelector(".search-input");this.searchButton=document.querySelector(".search-button");this.searchResultUL=document.querySelector("#search-results");this.searchFormWrapper&&this.searchForm&&this.searchButton&&this.searchResultUL&&(this.setSearchFormValue(), this.setEvents())}},{key:"setSearchFormValue",value:function(){var a=window.location.href;/\/search\//i.test(a)&&(a=a.split("/").filter(function(a){return a}),a=a[a.indexOf("search")+1])&&(a=decodeURI(a.replace(/[-+]/g," ").replace(/ +/g," ")),this.searchForm.value=a,this.setSearchButtonURL(a))}},{key:"setEvents",value:function(){this.onInputHandler=this.app.lib.debounce(this.onInputHandler,250);this.onKeyPressHandler=this.app.lib.debounce(this.onKeyPressHandler,250);this.searchForm.addEventListener("input", this.onInputHandler);this.searchForm.addEventListener("keypress",this.onKeyPressHandler);this.searchForm.addEventListener("blur",this.onBlurHandler);this.searchForm.addEventListener("focus",this.onFocusHandler);this.isMobile||(this.onScrollHandler=this.app.lib.debounce(this.onScrollHandler,250),window.addEventListener("scroll",this.onScrollHandler))}},{key:"onInputHandler",value:function(){var a=this.getSearchQuery();this.setSearchButtonURL(a);this.renderSearchSuggestions(a)}},{key:"getSearchQuery", value:function(){return this.getClearedURL(this.searchForm.value||"")}},{key:"getClearedURL",value:function(a){return a.toLowerCase().trim().replace(/[^a-z0-9 ]/g,"").replace(/ +/g," ")}},{key:"setSearchButtonURL",value:function(a){var b=a.replace(/ /g,"-");b?(this.searchButton.setAttribute("href","/search/".concat(b,"/")),this.searchFormWrapper.setAttribute("action","/search/".concat(b,"/"))):(this.searchFormWrapper.setAttribute("action","/search/"),this.searchButton.setAttribute("href","/search/")); this.searchButton.setAttribute("title",a)}},{key:"renderSearchSuggestions",value:function(a){var b=this;a=a.replace(/ /g,"+");2>a.length||this.app.lib.httpGet(this.searchIndexUrl+a).then(function(a){a&&"string"==typeof a&&(a=JSON.parse(a)||{},"object"===p()(a)&&null!==a&&0this.maxSearchResultAmount?c.slice(0,this.maxSearchResultAmount):c,d=this.searchForm.value.toLowerCase(),k=document.createElement("ul"),e={search:[],pornstars:[],"porn-sites":[]};if(c.forEach(function(b){a.pornstars[b]?e.pornstars.push(b):a["porn-sites"][b]?e["porn-sites"].push(b):e.search.push(b)}),0!==e.search.length){c=document.createElement("span"); c.innerHTML="Suggestions";var f=document.createElement("li");f.className="no-bg-hover";f.appendChild(c);k.appendChild(f);e.search.forEach(function(a){var b=document.createElement("a");b.setAttribute("href","/search/".concat(a.replace(/ /g,"-").trim(),"/"));b.setAttribute("title",a);b.setAttribute("target","_self");b.innerHTML=a.replace(d,"".concat(d,""));a=document.createElement("li");a.appendChild(b);k.appendChild(a)})}0!==e.pornstars.length&&(c=document.createElement("span"),c.innerHTML= "Pornstars",f=document.createElement("li"),f.className="no-bg-hover",f.appendChild(c),k.appendChild(f),e.pornstars.forEach(function(a){var b=document.createElement("a");b.setAttribute("href","/pornstars/".concat(a.replace(/ /g,"-").trim(),"/"));b.setAttribute("title",a);b.setAttribute("target","_self");b.style.textTransform="capitalize";b.innerHTML=a.replace(d,"".concat(d,""));a=document.createElement("li");a.appendChild(b);k.appendChild(a)}));0!==e["porn-sites"].length&&(c=document.createElement("span"), c.innerHTML="Porn Sites",f=document.createElement("li"),f.className="no-bg-hover",f.appendChild(c),k.appendChild(f),e["porn-sites"].forEach(function(a){var b=document.createElement("a");b.setAttribute("href","/porn-sites/".concat(a.replace(/ /g,"-").trim(),"/"));b.setAttribute("title",a);b.setAttribute("target","_self");b.style.textTransform="capitalize";b.innerHTML=a.replace(d,"".concat(d,""));a=document.createElement("li");a.appendChild(b);k.appendChild(a)}));this.searchResultUL.innerHTML= k.innerHTML}},{key:"onKeyPressHandler",value:function(a){13===a.keyCode&&(a.preventDefault(),a=this.getSearchQuery())&&(this.setSearchButtonURL(a),(a=this.searchButton.getAttribute("href"))&&(window.location.href=a))}},{key:"onBlurHandler",value:function(){window.addEventListener("click",this.onSearchResultULClick)}},{key:"onFocusHandler",value:function(){0=a.top&&c<=a.bottom;b>=a.left&&b<=a.right&&c||(this.hideSuggestions(),window.removeEventListener("click",this.onSearchResultULClick))}},{key:"showSuggestions",value:function(){this.searchResultUL.className="search__result"}},{key:"hideSuggestions",value:function(){this.searchResultUL.className="search__result--hidden"}}]), e}(),u=function(){function e(){m()(this,e);this.history={};this.init()}return n()(e,[{key:"init",value:function(){var a=this.getTagName();this.history=this.getHistory();a&&(this.history[a]=this.history[a]?this.history[a]+1:1,this.setHistory(this.history))}},{key:"getTagName",value:function(){var a=document.querySelector("[data-category]"),b=window.location.pathname.replace(/-/gi," ").split("/").filter(function(a){return a});return a&&0!==b.length?b[b.length-1]||"":""}},{key:"getHistory",value:function(){var a= JSON.parse(localStorage.getItem("_tagHistory"));return a&&"object"===p()(a)?a:{}}},{key:"getPopularTags",value:function(a){var b=this;return Object.keys(this.history).sort(function(a,d){return b.history[d]-b.history[a]}).slice(0,a)}},{key:"setHistory",value:function(a){localStorage.setItem("_tagHistory",JSON.stringify(a))}}]),e}(),B=function(){function e(a){m()(this,e);this.adData=a.adData;this.isMobile=a.isMobile;this.container=a.container;this.countryCode=a.countryCode;this.browserLanguages=this.getBrowserLanguages(); this.innerHeight=a.innerHeight;this.loadSpotsAmount=a.loadSpotsAmount;this.app=a.app;this.isBlocked=!document.getElementById("elyse-ad");this.delta=this.getLazyLoadingDelta();this.cappingStatsId="_cappingStats";this.cappingExtraStatsId="_cappingExtraStats";this.onResizeHandler=this.onResizeHandler.bind(this);this.lazyLoading=this.lazyLoading.bind(this);this.onLoadHandler=this.onLoadHandler.bind(this);this.onResizeHandler=this.app.lib.throttle(this.onResizeHandler,50);this.lazyLoading=this.app.lib.throttle(this.lazyLoading, 50);this.init()}return n()(e,[{key:"init",value:function(){(this.updateCappingConfig(),this.spots=this.getSpots(),0!==this.spots.length)&&(this.renderFirstSpots(),0!==document.documentElement.scrollTop&&(this.onResizeHandler(),this.lazyLoading()),window.addEventListener("resize",this.onResizeHandler),window.addEventListener("scroll",this.lazyLoading))}},{key:"updateCappingConfig",value:function(){this.isMobile?this.updateMobileCapping():this.updateDesktopCapping()}},{key:"onLoadHandler",value:function(){this.spots.length< this.loadSpotsAmount&&(this.loadSpotsAmount=this.spots.length);for(var a=0;a a"),b=Array.from(b).map(function(a){return a.textContent.toLowerCase().replaceAll(" ","+")}).join(","), 0= c&&b.position<=d&&a.renderSpot()})}}]),e}(),q=function(){function e(){m()(this,e);this.currentDate=Date.now();this.isSEReferrer=!1;this.searchEngines=["google.","bing.","yahoo."];this.init()}return n()(e,[{key:"init",value:function(){var a=this.getPrevSERefTimestamp();((new RegExp(this.searchEngines.join("|"),"i")).test(document.referrer)||36E5>this.currentDate-a)&&(this.setSERefTimestamp(this.currentDate),this.isSEReferrer=!0)}},{key:"getUserStatus",value:function(){return this.isSEReferrer}},{key:"getPrevSERefTimestamp", value:function(){var a=localStorage.getItem("_seRefTimestamp");return a?+a:0}},{key:"setSERefTimestamp",value:function(a){localStorage.setItem("_seRefTimestamp",a)}}]),e}(),I=function(){function e(a){m()(this,e);this.container=a.container;this.innerHeight=a.innerHeight;this.renderedLiveSpotsData=a.renderedLiveSpotsData;this.isOffsetMinus=this.isFirstLaunch=!1;this.app=a.app;this.init()}return n()(e,[{key:"init",value:function(){this.images=this.getImages();this.images.length&&(this.lazyLoading(), this.images.length&&(this.onResizeHandler=this.onResizeHandler.bind(this),this.lazyLoading=this.lazyLoading.bind(this),this.onResizeHandler=this.app.lib.throttle(this.onResizeHandler,50),this.lazyLoading=this.app.lib.throttle(this.lazyLoading,50),window.addEventListener("resize",this.onResizeHandler),window.addEventListener("scroll",this.lazyLoading)))}},{key:"getImages",value:function(){var a=this,b=Math.floor(this.container.getBoundingClientRect().top);0>b&&(this.isOffsetMinus=!0,b=document.documentElement.scrollTop+ b);var c=Array.prototype.slice.call(this.container.querySelectorAll("img"));return(c=c.filter(function(a){return(a=a.getAttribute("src"))&&(-1!==a.indexOf("placeholder.png")||-1!==a.indexOf("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGP6zwAAAgcBApocMXEAAAAASUVORK5CYII="))})).map(function(c){var e=c.parentNode.parentNode;return{image:c,position:a.getImagePosition(e,b),isLiveSpot:a.isLiveSpotCheck(e)}})}},{key:"getImagePosition",value:function(a,b){return+a.style.top.replace("px", "")+b}},{key:"isLiveSpotCheck",value:function(a){return"kathie-live-spot"===a.className}},{key:"lazyLoading",value:function(){var a=this,b=0,c=this.isOffsetMinus?700:this.isFirstLaunch?700:0;this.isFirstLaunch=!0;var d=document.documentElement.scrollTop,e=0=e&&c.position<=h){var d=c.image.getAttribute("data-src");return c.image.setAttribute("src",d),c.isLiveSpot&&d&&(a.renderedLiveSpotsData.push(d),b++), c.image.removeAttribute("data-src"),!1}return!0}),0a||30+new Date-b[a]:!1:!1:!1}},{key:"httpPost",value:function(a){var b=JSON.stringify(a),c=(+new Date).toString()+Math.round(999999.5+9E6*Math.random());return new Promise(function(a,e){var h=new XMLHttpRequest;h.open("POST","/liverikila/?rnd=".concat(c),!0);h.setRequestHeader("Content-Type","application/json");h.onload=function(){200=== h.status||304===h.status?a():e()};h.onerror=function(){e()};h.send(b)})}},{key:"updateLocalStorage",value:function(a){var b=JSON.parse(localStorage.getItem("_queryStats"));b?"object"===p()(b)?(Object.keys(b).forEach(function(a){36E5<=+new Date-b[a]&&delete b[a]}),Object.keys(b).includes(a)||(b[a]=+new Date),localStorage.setItem("_queryStats",JSON.stringify(b))):localStorage.removeItem("_queryStats"):(a=y()({},a,+new Date),localStorage.setItem("_queryStats",JSON.stringify(a)))}},{key:"log",value:function(a){console.error("QueryStatsService: ".concat(a))}}]), e}(),r=function(){function e(a){m()(this,e);this.containerIDs=a.containerIDs;this.isMobile=a.isMobile;this.innerHeight=a.innerHeight;this.app=a.app;this.domain=window.location.hostname.replace("www.","");this.lastViewedItemIndex=this.viewedItemsAmount=0;this.onClickHandler=this.onClickHandler.bind(this);this.onScrollHandler=this.onScrollHandler.bind(this);this.onResizeHandler=this.onResizeHandler.bind(this);this.init()}return n()(e,[{key:"init",value:function(){var a=this;this.checkAndFixLocalStorage(); this.fingerprint=this.getFingerprint();this.language=this.getLanguage();this.deviceType=this.getDeviceType();this.referrer=this.getReferrerDomain();this.getContentParams();this.viewedItemsAmount=this.getViewedItemsAmount();this.containerIDs.forEach(function(b){(b=document.querySelector(b))&&b.addEventListener("click",a.onClickHandler)});this.timer=setInterval(function(){return a.sendViewedItemsStats()},5E3);this.onScrollHandler=this.app.lib.throttle(this.onScrollHandler,250);this.onResizeHandler= this.app.lib.throttle(this.onResizeHandler,250);window.addEventListener("scroll",this.onScrollHandler);window.addEventListener("resize",this.onResizeHandler)}},{key:"checkAndFixLocalStorage",value:function(){var a=JSON.parse(localStorage.getItem("_stats"))||[];0!==a.length&&this.isWrongRecordsFormatCheck(a[0])&&localStorage.removeItem("_stats")}},{key:"isWrongRecordsFormatCheck",value:function(a){return!(a&&a.url&&a.timestamp&&a.items&&"string"==typeof a.url&&"number"==typeof a.timestamp&&"object"=== p()(a.items)&&0!==a.items.length)}},{key:"getFingerprint",value:function(){var a=JSON.parse(localStorage.getItem("_fp"));if(a=a?a.value:"")return{previous:a,"new":""};a=this.getRandomValueFromInterval(1E18,1E19).toString();return localStorage.setItem("_fp",JSON.stringify({timestamp:+new Date,value:a})),{previous:a,"new":""}}},{key:"getRandomValueFromInterval",value:function(a,b){return Math.round(a-.5+Math.random()*(b-a+1))}},{key:"getLanguage",value:function(){return navigator.language||navigator.userLanguage}}, {key:"getDeviceType",value:function(){return this.isMobile?"mobile":"desktop"}},{key:"getReferrerDomain",value:function(){return document.referrer?document.referrer.match(/:\/\/(.[^/]+)/)[1].replace("www.",""):""}},{key:"getContentParams",value:function(){var a=this;this.resetContentParams();var b=document.documentElement.scrollTop||document.body.scrollTop,c=document.documentElement.clientTop||document.body.clientTop||0;this.containerIDs.forEach(function(d){if(d=document.querySelector(d)){var e=Array.prototype.slice.call(d.querySelectorAll("li")); if(0!==(e=e.filter(function(a){return!/kathie-live-spot|kathie-custom-spot/i.test(a.className)&&a.querySelector("a[data-g]")})).length){e.sort(function(a,b){return+a.style.top.replace("px","")+a.offsetHeight-(+b.style.top.replace("px","")+b.offsetHeight)});var h=Math.floor(d.getBoundingClientRect().top+b-c);e.forEach(function(b){var c=b.querySelector("a").getAttribute("data-g"),d=Math.floor(+b.style.top.replace("px","")+h+.75*b.offsetHeight);a.content.push({id:c,nodeElement:b,position:d})})}}})}}, {key:"resetContentParams",value:function(){this.content=[]}},{key:"getViewedItemsAmount",value:function(){for(var a=document.documentElement.scrollTop+this.innerHeight,b=0,c=this.content.length-1;0<=c;c--)if(this.content[c].position<=a){b=c+1;break}return this.viewedItemsAmountthis.viewedItemsAmount&&(this.viewedItemsAmount=a+1);var e=this.filterViewedItems(this.content.slice(this.lastViewedItemIndex,this.viewedItemsAmount).map(function(a){return a.id}).join());this.lastViewedItemIndex=this.viewedItemsAmount;a=this.getStats("click",e,d);this.httpPost(a).then(function(){e&&b.updateLocalStorageStats(e)})["catch"](function(){b.log("service is not available")})}}}}, {key:"getLinkElement",value:function(a,b){var c;return"LI"===b&&(c=a.firstChild),"A"===b&&(c=a),["IMG","H2","SPAN"].includes(b)&&(c=a.parentNode),"SVG"===b&&(c=a.parentNode.parentNode),c}},{key:"isLiveSpotCheck",value:function(a){return"kathie-live-spot"===a.parentNode.className}},{key:"sendViewedItemsStats",value:function(){var a=this;if(this.lastViewedItemIndex!==this.viewedItemsAmount){var b=this.filterViewedItems(this.content.slice(this.lastViewedItemIndex,this.viewedItemsAmount).map(function(a){return a.id}).join()); if(0!==b.length){this.lastViewedItemIndex=this.viewedItemsAmount;var c=this.getStats("view",b);this.httpPost(c).then(function(){a.updateLocalStorageStats(b);a.content.length===a.lastViewedItemIndex&&clearInterval(a.timer)})["catch"](function(){a.log("service is not available")})}}}},{key:"filterViewedItems",value:function(a){var b,c=JSON.parse(localStorage.getItem("_stats"));if(!c)return a;if(c){var d=+new Date,e=window.location.href;(c=c.filter(function(a){return 36E5>d-a.timestamp&&a.url===e}))&& 0c-a.timestamp&&a.url===d}),e=e.filter(function(a){return 36E5>c-a.timestamp&&a.url!==d}));b=b&&0=this.content.length&&(window.removeEventListener("scroll",this.onScrollHandler),window.removeEventListener("resize",this.onResizeHandler))}},{key:"log",value:function(a){console.error("MainStatsService: ".concat(a))}}]),e}(),D=function(){function e(){m()(this,e);y()(this,"w",void 0); this.countryCode="";this.init()}return n()(e,[{key:"init",value:function(){var a=this;(this.countryCode=this.getCountryCode())||(this.browserCountryCode=this.getBrowserCountryCode(),this.getCountryCodeFromAPI().then(function(b){return a.getCountryCodeFromAPIResponse(b)}).then(function(b){a.countryCode=b;a.setCountryCode(b)}))}},{key:"getBrowserCountryCode",value:function(){if(Array.isArray(this.browserCountryCode)&&0=b.currentDate-a})}},{key:"addNewVisit",value:function(a){1E7<=a-(0!==this.visitHistory.length?this.visitHistory[0]:0)&&this.visitHistory.unshift(a)}}, {key:"getUserStatus",value:function(){if(this.userStatus)return this.userStatus;var a=localStorage.getItem("userStatus"),b=this.visitHistory.length||1;return"bookmark"===a?"bookmark":!a||1===b&&"bookmark"!==a?"unique":"unique"===a?2===b?864E5>this.visitHistory[0]-this.visitHistory[1]?"semibookmark":"bookmark":"unique":"semibookmark"===a?3<=b?"bookmark":"semibookmark":void 0}},{key:"setUserStatus",value:function(a){localStorage.setItem("userStatus",a)}}]),e}(),E=function(){function e(){m()(this,e)} return n()(e,[{key:"throttle",value:function(a,b){var c=null,d=null;return function h(e){d=e;!c&&(a(d),d=null,c=setTimeout(function(){c=null;d&&h(d)},b))}}},{key:"debounce",value:function(a,b){var c;return function(){for(var d=arguments.length,e=Array(d),h=0;hd.length&&(c=c.filter(function(a){return-1===d.indexOf(a)}));5