(function(){var init=true;var visitID=null;var API_CONTENT_TYPE="application/json; charset=utf-8";function addEvent(element,event,fn){if(element.addEventListener){element.addEventListener(event,fn,false);return true}else if(element.attachEvent){return element.attachEvent("on"+event,fn)}element["on"+event]=fn}function getAjax(){try{return new XMLHttpRequest}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}return false}function reportError(error){var errorData={blog:"5f60c8914dfb34476a1c3b26",location:location,document:document,navigator:navigator,error:error.stack||error.message||JSON.stringify(error)};var xhr=getAjax();xhr.open("POST","https://ghostboard.io/api/v1/views/debug",true);xhr.setRequestHeader("Content-Type",API_CONTENT_TYPE);xhr.send(JSON.stringify(errorData))}function getReferrer(){var referrer="";try{referrer=window.top.document.referrer}catch(e){if(window.parent){try{referrer=window.parent.document.referrer}catch(e2){referrer=""}}}return referrer===""?document.referrer:referrer}function runGhostboard(){try{if(!init){return false}init=false;var visitTime=0;var rssPath=document.querySelector("link[type='application/rss+xml']");var baseUrl=document.querySelector("head base");var anyBase=rssPath||baseUrl;var rootURL=anyBase?anyBase.href:"";var shortcut=document.querySelector("link[rel='shortcut icon']");var icon=document.querySelector("link[rel='icon']");var anyIcon=shortcut||icon;var favicon=anyIcon?anyIcon.href:"";var locationData=location||window.location||document.location;var ghostAPIEnable=typeof ghost!=="undefined"&&ghost&&ghost.url&&ghost.url.api();if(ghostAPIEnable){var ghostAPI=ghost.url.api();rootURL=ghostAPI.substring(0,ghostAPI.indexOf("/ghost/")+1);if(rootURL.indexOf("//")===0){rootURL=location.protocol+rootURL}}else{var hasRss=rootURL&&rootURL.indexOf("/rss/")!==-1;if(hasRss){rootURL=rootURL.substring(0,rootURL.length-4)}else if(!rootURL){rootURL=locationData.origin+"/"}}var visitData={A:rootURL,C:navigator.language||navigator.userLanguage,F:locationData.origin,I:favicon,U:location.href||document.url};var referrer=getReferrer();if(referrer){visitData.D=referrer}var metaGenerator=document.head.querySelector("[name=generator]");if(metaGenerator&&metaGenerator.content){visitData.E=metaGenerator.content}var startDate=null;var endDate=null;var lastHearbeat=null;var savingVisit=false;var newVisit=function(e){if(visitID||savingVisit){return false}savingVisit=true;visitData.G=e;startDate=(new Date).getTime();visitTime=0;var xhr=getAjax();xhr.open("POST","https://ghostboard.io/api/v2/views/5f60c8914dfb34476a1c3b26/",true);xhr.setRequestHeader("Content-Type",API_CONTENT_TYPE);xhr.onreadystatechange=function(){savingVisit=false;if(xhr.readyState===XMLHttpRequest.DONE&&xhr.status===200){visitID=JSON.parse(xhr.responseText)}};xhr.send(JSON.stringify(visitData))};var heartbeat=function(event){var now=(new Date).getTime();var onlyOnce=!lastHearbeat||lastHearbeat&&now-lastHearbeat>=1e3;var enterEvent=["focus","pageshow","focusin","visibilityState:visible"].indexOf(event)!==-1;var exitEvent=["beforeunload","blur","unload","focusout","pagehide","visibilityState:hidden"].indexOf(event)!==-1;var proceed=visitID&&(onlyOnce||exitEvent);if(proceed){lastHearbeat=now;var url="https://ghostboard.io/api/v2/visits/heartbeat";var heartbeatData={A:visitTime.toString(),B:event,C:visitID};if(navigator.sendBeacon){navigator.sendBeacon(url,JSON.stringify(heartbeatData))}else{var xhr=getAjax();xhr.open("POST",url,enterEvent);xhr.setRequestHeader("Content-Type",API_CONTENT_TYPE);xhr.send(JSON.stringify(heartbeatData))}}};var updateTime=function(){endDate=(new Date).getTime();var spentTime=endDate-startDate;visitTime+=parseInt(spentTime/1e3,10);startDate=endDate};var handleEnter=function(e){var now=(new Date).getTime();var diffLastSeen=endDate?now-endDate:0;var createNewVisit=!visitID||diffLastSeen>=3e5;if(createNewVisit){visitID=null;newVisit(e)}else{startDate=now;heartbeat(e)}};var handleExit=function(e){var updateEvents=["blur","focusout","pagehide","visibilityState:hidden"];var shouldUpdate=updateEvents.indexOf(e)!==-1;if(shouldUpdate){updateTime()}heartbeat(e)};addEvent(document,"visibilitychange",function(){if(document.visibilityState==="hidden"){handleExit("visibilityState:hidden")}if(document.visibilityState==="visible"){handleEnter("visibilityState:visible")}});addEvent(window,"focus",function(){handleEnter("focus")});addEvent(window,"focusin",function(){handleEnter("focusin")});addEvent(window,"pageshow",function(){handleEnter("pageshow")});addEvent(window,"blur",function(){handleExit("blur")});addEvent(window,"focusout",function(){handleExit("focusout")});addEvent(window,"pagehide",function(){handleExit("pagehide")});addEvent(window,"beforeunload",function(){handleExit("beforeunload")});addEvent(window,"unload",function(){handleExit("unload")});var isActive=document.hasFocus()||document.visibilityState==="visible";if(isActive){handleEnter("document-focus")}}catch(err){reportError(err)}}function listenToLinksClicks(){var links=document.getElementsByTagName("a");for(var i=0;i