(function(){function n(){this.aid=26831;this.havId=null;this.userAgent=null;this.browser=null;this.isMobile=!1;this.pageUrl=null;this.referrerUrl=null;this.pageViewStart=null;this.pageViewEnd=null;this.m5=null;this.m5mpf=null;this.scriptUrl=null;this.debug=null;this.hasBeenActive=null;this.dataSent=!1;this.cpPxAdded=!1;this.pendingResolutionFunctions=[]}n.prototype.init=function(n){try{this.logDebug("init");this.pageViewStart=Date.now();this.debug=n;this.userAgent=this.getUserAgent();this.browser=this.getBrowser();this.isMobile=this.getIsMobile();this.pageUrl=this.getPageUrl();this.referrerUrl=this.getReferrer();this.loadExitMonitor();this.scriptUrl=document.currentScript?.getAttribute("src");this.processResolution()}catch(t){this.logError(t)}};n.prototype.getUserAgent=function(){try{return this.logDebug("getUserAgent"),navigator.userAgent}catch(n){this.logError(n)}};n.prototype.getReferrer=function(){try{return this.logDebug("getReferrer"),document.referrer}catch(n){return this.logError(n),null}};n.prototype.getPageUrl=function(){try{return(this.logDebug("getPageUrl"),document.location&&document.location.href)?document.location.href:document.documentURI?document.documentURI:null}catch(n){this.logError(n)}};n.prototype.getBrowser=function(){try{this.logDebug("getBrowser");var n=navigator.userAgent;return n.indexOf("Edg")>-1?"Microsoft Edge":n.indexOf("Chrome")>-1?"Chrome":n.indexOf("Firefox")>-1?"Firefox":n.indexOf("Safari")>-1?"Safari":n.indexOf("Opera")>-1?"Opera":n.indexOf("Trident")>-1||userAgent.indexOf("MSIE")>-1?"Internet Explorer":"Other"}catch(t){this.logError(t)}};n.prototype.getIsMobile=function(){try{return(this.logDebug("getIsMobile"),/Mobi|Android|iPhone/i.test(this.userAgent))?!0:!1}catch(n){this.logError(n)}};n.prototype.storeVariable=function(n,t,i){try{this.logDebug("storeVariable");document.cookie=n+"="+t+";max-age="+i+";secure;samesite=strict;path=/";localStorage.setItem(n,t)}catch(r){this.logError(r)}};n.prototype.getVariable=function(n){try{this.logDebug("getVariable");let t=null;return typeof localStorage!="undefined"&&(t=localStorage.getItem(n)),t===null&&(t=document.cookie.split("; ").find(t=>t.startsWith(n+"="))?.split("=")[1]),t}catch(t){this.logError(t)}};n.prototype.processResolution=function(){if(this.logDebug("processResolution"),this.m5==null&&this.getVariable("m5")!=null&&(this.m5=this.getVariable("m5"),this.m5mpf=this.getVariable("m5mpf")),this.m5!=null||this.pendingResolutionFunctions.length==0)this.sendData();else{const n=this.pendingResolutionFunctions[0];this.pendingResolutionFunctions=this.pendingResolutionFunctions.slice(1);eval(`this.${n}()`)}};n.prototype.resolveAloCdnC=function(){try{this.logDebug("resolveAloCdnC");fetch("https://alocdn.com/c/jk32ih/a/xtarget/p.json",{credentials:"include"}).then(n=>n.json()).then(n=>{(n.md5_email||n.m)&&(this.logDebug(`resolveAloCdnC m5 received: ${n.md5_email||n.m}`),this.m5=n.md5_email||n.m,this.m5mpf="resolveAloCdnC",this.storeVariable("m5",this.m5,604800),this.storeVariable("m5mpf",this.m5mpf,604800)),this.processResolution()})}catch(n){this.logError(n)}};n.prototype.resolveAloCdnP=function(){try{this.logDebug("resolveAloCdnP");fetch("https://alocdn.com/c/g8dlwlwy/a/xtarget/p.json",{credentials:"include"}).then(n=>n.json()).then(n=>{(n.md5_email||n.m)&&(this.logDebug(`resolveAloCdnP m5 received: ${n.md5_email||n.m}`),this.m5=n.md5_email||n.m,this.m5mpf="resolveAloCdnP",this.storeVariable("m5",this.m5,604800),this.storeVariable("m5mpf",this.m5mpf,604800)),this.processResolution()})}catch(n){this.logError(n)}};n.prototype.resolveLiP=function(){var t,n;try{window.liQd_did_006k=window.liQd_did_006k||[];t=document.createElement("script");t.src="https://d-code.liadm.com/did-006k.min.js";this.logDebug("callLI script attached");n=this;t.onload=function(){n.logDebug("resolveLiP script load fired");window.liQd_did_006k.resolve(function(t){n.logDebug(`resolveLiP result received: ${JSON.stringify(t)}`);t.md5&&(n.logDebug(`resolveLiP m5 received: ${t.md5}`),n.m5=t.md5,n.m5mpf="resolveLiP",n.storeVariable("m5",this.m5,604800),n.storeVariable("m5mpf",this.m5mpf,604800));n.processResolution()},function(){n.logDebug(`resolveLiP failed: ${error}`)},{resolve:["md5"]})};document.head.appendChild(t)}catch(i){this.logError(i)}};n.prototype.loadCP=function(){try{this.logDebug("loadCP");fetch("https://rdcdn.com/tctsjs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(this)}).then(n=>n.json()).then(n=>{if(this.logDebug(`loadCP data received: ${JSON.stringify(n)}`),n.success){const t=document.createElement("html");t.innerHTML=`<img src='${n.px}' height='1' width='1' referrerpolicy='no-referrer-when-downgrade' />`;document.body.appendChild(t);this.cpPxAdded=!0;this.logDebug(`loadCP px added`)}this.processResolution()})}catch(n){this.logError(n)}};n.prototype.sendData=function(){try{typeof navigator.userActivation!="undefined"&&(this.hasBeenActive=navigator.userActivation.hasBeenActive);this.logDebug("sendData");this.logDebug(`sendData json payload: ${JSON.stringify(this)}`);fetch("https://rdcdn.com/rtjsld",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(this)}).then(n=>n.json()).then(n=>{this.logDebug(`sendData received: ${JSON.stringify(n)}`),this.havId=n.havId,this.dataSent=!0})}catch(n){this.logError(n)}};n.prototype.loadExitMonitor=function(){window.document.onvisibilitychange=()=>{document.visibilityState==="visible"&&this.logDebug("visibility change event fired: visible"),document.visibilityState==="hidden"&&(typeof navigator.userActivation!="undefined"&&(this.hasBeenActive=navigator.userActivation.hasBeenActive),this.pageViewEnd=Date.now(),this.logDebug("visibility change event fired: hidden"),this.logDebug(this.pageViewEnd),this.logDebug(`sendData json payload: ${JSON.stringify(this)}`),navigator.sendBeacon("https://rdcdn.com/rtjsld",this.buildBeaconPayload()))}};n.prototype.buildBeaconPayload=function(){var n=new FormData;return Object.keys(this).forEach(t=>{typeof this[t]!="object"?n.append(t,this[t]):n.append(t,JSON.stringify(this[t]))}),n};n.prototype.logError=function(n){console.log(`rdcdnJs error: ${n}`)};n.prototype.logDebug=function(n){this.debug&&console.log(`rdcdnJs debug: ${this.aid}: ${n}`)};let t=new n;t.init(window.rdcndbg!=null&&window.rdcndbg==!0)})()