core/1/iiko_files/tilda-stat-1.0.min.js

1 line
8.5 KiB
JavaScript
Raw Normal View History

2023-04-09 19:52:26 +05:00
!function(){var r=document.getElementById("allrecords");function e(){var e=Math.floor(899999*Math.random())+1e5;return(new Date).getTime()+"."+e}function n(e){e=e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1"),e=new RegExp("(?:^|; )"+e+"=([^;]*)"),e=document.cookie.match(e);if(e)return decodeURIComponent(e[1])}function o(e,t,n){if(i=n.expires){"number"==typeof i&&(o=(new Date).getTime()+1e3*i,(i=new Date(o)).toUTCString&&(n.expires=i.toUTCString()));var o,i,a,r=e+"="+(t=encodeURIComponent(t));for(a in n)r+="; "+a,!0!==n[a]&&(r+="="+n[a]);document.cookie=r}}function a(){var e=window.pageYOffset,t=window.innerHeight,n=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),o=0,i=0,a=(m=!0,document.getElementById("t-header")),r=document.getElementById("t-footer"),d=document.getElementById("tildacopy"),c=(a&&(o=a.offsetHeight),r&&(i=r.offsetHeight),d&&(i+=d.offsetHeight),Math.floor(100*(e-o+t)/(n-o-i)));if(!(c<10))for(var l=[10,25,50,75,90],s=0;s<l.length;s++){var u=l[s],p=l.length-1;if(0===s&&u<=c&&!w["p"+u])g.page="/tilda/scroll/"+u+"/",window.tildastat("pageview"),w["p"+u]=!0;else if(u-1<=c){if(0===w["p"+u]){g.page="/tilda/scroll/"+u+"/",window.tildastat("pageview"),w["p"+u]=setTimeout(function(){clearTimeout(w["p"+u]),w["p"+u]=-1},5e3);break}if((s!==p&&c<l[s+1]||s===p)&&-1===w["p"+u]){w["p"+u]=0;break}}}}function d(){var e=0===window.location.hostname.indexOf("www.")?window.location.hostname.slice(4):window.location.hostname;return(e=e.lastIndexOf(".")===e.length-1?e.slice(0,-1):e)+window.location.pathname}function c(){var e=(navigator.cookieEnabled?"cT":"cF")+(navigator.deviceMemory?"dm"+navigator.deviceMemory:"dm")+(navigator.hardwareConcurrency?"hc"+navigator.hardwareConcurrency:"hc")+(navigator.languages?"l"+navigator.languages.join(","):"l")+(navigator.platform?"p"+navigator.platform:"p")+(navigator.vendor?"v"+navigator.vendor:"v")+(navigator.appCodeName?"a"+navigator.appCodeName:"a")+(navigator.appName?"n"+navigator.appName:"n");if(navigator.plugins){for(var t="",n=0;n<navigator.plugins.length;n++)t+=navigator.plugins[n].filename;e+="pl"+t}return e=function(t){for(var e=Array(t.length),n=0;n<t.length;n++)e[n]=n;return Array.prototype.map.call(e,function(e){return t.charCodeAt(e).toString(16)}).join("")}(e=(e+="pr"+window.devicePixelRatio)+("w"+window.winWidth+"h"+window.winHeight))}function l(){v=n("tildauid"),y=n("tildasid"),y=f?(v=v||"simple",y||"simple"):(v=v||e(),y||e())}function s(){f||(o("tildauid",v,{expires:7776e3,path:"/"}),o("tildasid",y,{expires:1800,path:"/"}))}function u(){if(!(""<g.user_agent&&-1!=g.user_agent.indexOf("bot")))if("http:"!=window.location.protocol&&"https:"!=window.location.protocol)console.log("TildaStat: cannot work on local page");else{var t;l(),s(),g.page=d(),g.referrer=document.referrer||"",g.userid=v,g.sessionid=y,g.user_agent=window.navigator.userAgent,g.user_language=window.navigator.userLanguage||window.navigator.language,r&&(g.projectid=r.getAttribute("data-tilda-project-id")||"0",g.pageid=r.getAttribute("data-tilda-page-id")||"0",g.pagealias=r.getAttribute("data-tilda-page-alias")||"",g.formskey=r.getAttribute("data-tilda-formskey")||""),g.params={};try{n=decodeURIComponent(window.location.search)}catch(e){n=window.location.search}"?"<n&&(g.pagequery=n.substring(1).toLowerCase(),~g.pagequery.indexOf("utm_")&&(n=g.pagequery.split("&"),Array.prototype.forEach.call(n,function(e){1<(t=e.split("=")).length?"utm_referrer"!==t[0]||g.referrer&&!~g.referrer.indexOf("ohio8.v")?g.params[t[0]]=t[1]:g.referrer=t[1]:g.params[t[0]]=""})));var n=!1;if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(n=!0),g.ismobile=n,document.getElementById("tildastatscript")&&(g.tildastatcode=document.getElementById("tildastatscript").key),h)try{var e=function(e){m=!!e},o=!0;if(!e)throw new Error("no callback given");function i(){o||e(o=!0)}function a(){o&&e(o=!1)}"hidden"in document&&document.addEventListener("visi