document.addEventListener('DOMContentLoaded',(event)=>{const CrossOriginLocalStorage=function(currentWindow,iframe,onMessage){let childWindow;try{childWindow=iframe.contentWindow}catch(e){childWindow=iframe.contentWindow} currentWindow.onmessage=(event)=>{if(!this.isAllowedOrigin(event.origin)){return} return onMessage(JSON.parse(event.data),event)};this.isAllowedOrigin=(origin)=>{let allowedOrigins=[akya.akya_url];return allowedOrigins.includes(origin)} this.getData=(key)=>{const messageData={key:key,method:'get',} this.postMessage(messageData)} this.setData=(key,data)=>{const messageData={key:key,method:'set',data:data,} this.postMessage(messageData)} this.postMessage=(messageData)=>{childWindow.postMessage(JSON.stringify(messageData),'*')}} const AkyaTrackComponent=class{selector=document.querySelector("script[src='https://akya.io/ice.js']");akya_url='https://akya.io';redirected_url=null;tracking_id=this.selector.id;cookie_link='https://iceberg-digital.co.uk/cookies';cookie_hash=null;geoip=null;geoip_address='https://ip-api.com/json';collect_data={};confirmation=this.selector.getAttribute('hide-confirm')??!1;position=this.selector.getAttribute('position')??'bottom';type='PageView';debug=this.selector.getAttribute('debug')??!1;main_data=!1;iframe=!1;corss_origin=null;iframe_storage_hash=null;cookie_name='__fc';swap_run=!1;is_init=!1;constructor(){} boot(){try{akya.createIframe();if(akya.iframe&&typeof window.localStorage!=="undefined"){akya.iframe.onload=function(){const onMessage=(payload,event)=>{try{if(payload&&payload.method){switch(payload.method){case 'storage#get':akya.setLog(payload);if(payload&&payload.data){akya.iframe_storage_hash=payload.data} break;default:akya.setLog('Unknown method '+payload.method)}}}catch(e){akya.setLog(e)} akya.init()};try{akya.corss_origin=new CrossOriginLocalStorage(window,akya.iframe,onMessage);akya.corss_origin.getData(akya.cookie_name)}catch(e){akya.setLog(e);akya.init()}}}else{akya.init()}}catch(e){akya.setLog(e);akya.init()} setTimeout(function(){if(akya.is_init===!1){akya.init()}},4000)} init(){akya.is_init=!0;akya.setLog('Tracking ID : '+akya.tracking_id);akya.checkCookie();if(akya.confirmation==''||akya.confirmation=='false'){if(!akya.getCookie('__fc_confirmed')){akya.showConfirmation()}} akya.getCollectData();akya.setFrameTrack('POST',`${akya.akya_url}/frame/${akya.tracking_id}`,akya.collect_data)} getParameterByName(name,url){if(!url)url=window.location.href;name=name.replace(/[\[\]]/g,'\\$&');var regex=new RegExp('[?&]'+name+'(=([^&#]*)|&|#|$)'),results=regex.exec(url);if(!results)return null;if(!results[2])return'';return decodeURIComponent(results[2].replace(/\+/g,' '))} checkCookie(){let crrCookie=akya.getCookie(akya.cookie_name);if(akya.getParameterByName('utm')){let t_hash=akya.getParameterByName('utm');let url=document.location.href;url=url.split("utm=fc-");let baseurl=url[0];history.pushState(null,null,baseurl);let cookie_hash=t_hash.split("-");if(cookie_hash.length>2){akya.redirected_url=cookie_hash[2]} akya.cookie_hash=cookie_hash[1];akya.setStorage(akya.cookie_name,akya.cookie_hash);if(akya.cookie_hash!==crrCookie&&!akya.empty(crrCookie)){akya.setLog("checkCookie swap run");akya.swapper(crrCookie,akya.cookie_hash)}}else{if(!akya.empty(crrCookie)){akya.cookie_hash=crrCookie}}} setFrameTrack(method,url,data){let xhr=new XMLHttpRequest();xhr.open(method,url);xhr.setRequestHeader('Content-Type','application/json');xhr.setRequestHeader('X-Requested-With','XMLHttpRequest');xhr.onreadystatechange=function(){if(this.readyState==4&&this.status==200){var parsed_response=JSON.parse(this.responseText);akya.cookie_hash=parsed_response.result.x_text;akya.cookie_link=parsed_response.result.x_url;if(document.getElementById('learn_more_banner_button')!=undefined){document.getElementById('learn_more_banner_button').setAttribute('href',akya.cookie_link)} akya.setCookie(akya.cookie_name,akya.cookie_hash,365);akya.setCurrentPageStorage(akya.cookie_name,akya.cookie_hash);akya.getCollectData();let tracer=new XMLHttpRequest();tracer.open('POST',`${akya.akya_url}/api/v2/track`);tracer.setRequestHeader('content-Type','application/json');tracer.setRequestHeader('X-Requested-With','XMLHttpRequest');tracer.send(JSON.stringify(akya.collect_data))}};xhr.send(JSON.stringify(data))} onClickConfirm(){akya.setCookie('__fc_confirmed',new Date(),365);document.getElementById('akya-container').remove()} setBootOld(name,value,days){var xhr=new XMLHttpRequest();xhr.open('POST',akya.geoip_address);xhr.withCredentials=!1;xhr.setRequestHeader('Content-Type','application/json; charset=utf-8');xhr.onreadystatechange=function(){if(this.readyState==4&&this.status==200){akya.geoip=JSON.stringify(this.responseText);akya.main_data=!0;akya.getCollectData();akya.setFrameTrack('POST',`${akya.akya_url}/frame/${akya.tracking_id}`,akya.collect_data)}else{akya.getCollectData();akya.setFrameTrack('POST',`${akya.akya_url}/frame/${akya.tracking_id}`,akya.collect_data)}};xhr.send()} showConfirmation(){if(akya.position==='full-screen'){akya.getFullScreenConfirmTemplate()}else if(akya.position==='top'){akya.getTopConfirmTemplate()}else{akya.getBottomConfirmTemplate()}} getFullScreenConfirmTemplate(){var body=document.querySelector('body');var container=document.createElement('div');container.className='akya-container';container.id='akya-container';container.style.position='absolute';container.style.zIndex='999999';container.style.bottom='0';container.style.fontFamily='sans-serif';container.style.zIndex='9999';container.style.width='100%';container.style.height=`${window.innerHeight}px`;setInterval(function(){container.style.height=`${window.innerHeight}px`},900);container.style.fontSize='18px';container.style.color='#ffffff';container.style.backgroundColor='#000000';var row=document.createElement('div');row.className='akya-row';row.style.maxWidth='1020px';row.style.marginLeft='auto';row.style.marginRight='auto';row.style.marginTop=`${window.innerHeight / 2 - 80}px`;setInterval(function(){row.style.marginTop=`${window.innerHeight / 2 - 80}px`},900);row.style.paddingTop='40px';row.style.paddingBottom='30px';row.style.paddingLeft='0';row.style.paddingRight='0';container.appendChild(row);var col_9=document.createElement('div');col_9.className='akya-col-9';col_9.style.width='75%';col_9.style.paddingLeft='15px';col_9.style.display='inline-block';row.appendChild(col_9);var paragraph=document.createElement('p');paragraph.style.display='inline-block';paragraph.style.marginRight='6px';var paragraph_content=document.createTextNode("This website uses cookies to give you an incredible experience.");paragraph.appendChild(paragraph_content);col_9.appendChild(paragraph);var more_link=document.createElement('a');more_link.style.color='#ff2857';more_link.style.marginRight='5px';more_link.style.textDecoration='none';more_link.setAttribute('href',akya.cookie_link);more_link.setAttribute('target','_blank');more_link.setAttribute('id','learn_more_banner_button');var more_link_content=document.createTextNode("Learn more.");more_link.appendChild(more_link_content);col_9.appendChild(more_link);var col_3=document.createElement('div');col_3.className='akya-col-3';col_3.style.width='20%';col_3.style.display='inline-block';col_3.style.textAlign='right';row.appendChild(col_3);var confirm_btn=document.createElement('button');var confirm_btn_content=document.createTextNode("Accept ");confirm_btn.id='akya-confirm-btn';confirm_btn.style.fontSize='22px!important';confirm_btn.style.padding='13px!important';confirm_btn.style.height='62px';confirm_btn.style.backgroundColor='#ffffff';confirm_btn.style.color='#000000';confirm_btn.style.borderRadius='6px';confirm_btn.style.border='0';confirm_btn.style.cursor='pointer';confirm_btn.onclick=function(){akya.onClickConfirm()};confirm_btn.appendChild(confirm_btn_content);col_3.appendChild(confirm_btn);body.appendChild(container)} getTopConfirmTemplate(){var body=document.querySelector('body');var container=document.createElement('div');container.className='akya-container';container.id='akya-container';container.style.position='fixed';container.style.top='0';container.style.fontFamily='sans-serif';container.style.zIndex='9999';container.style.width='100%';container.style.fontSize='18px';container.style.color='#ffffff';container.style.backgroundColor='#000000';var row=document.createElement('div');row.className='akya-row';row.style.maxWidth='1020px';row.style.marginLeft='auto';row.style.marginRight='auto';row.style.paddingTop='30px';row.style.paddingBottom='30px';row.style.paddingLeft='0';row.style.paddingRight='0';container.appendChild(row);var col_9=document.createElement('div');col_9.className='akya-col-9';col_9.style.width='75%';col_9.style.paddingLeft='15px';col_9.style.display='inline-block';row.appendChild(col_9);var paragraph=document.createElement('p');paragraph.style.display='inline-block';paragraph.style.marginRight='6px';var paragraph_content=document.createTextNode("This website uses cookies to give you an incredible experience.");paragraph.appendChild(paragraph_content);col_9.appendChild(paragraph);var more_link=document.createElement('a');more_link.style.color='#ff2857';more_link.style.marginRight='5px';more_link.style.textDecoration='none';more_link.setAttribute('href',akya.cookie_link);more_link.setAttribute('target','_blank');more_link.setAttribute('id','learn_more_banner_button');var more_link_content=document.createTextNode("Learn more.");more_link.appendChild(more_link_content);col_9.appendChild(more_link);var col_3=document.createElement('div');col_3.className='akya-col-3';col_3.style.width='20%';col_3.style.display='inline-block';col_3.style.textAlign='right';row.appendChild(col_3);var confirm_btn=document.createElement('button');var confirm_btn_content=document.createTextNode("Accept ");confirm_btn.id='akya-confirm-btn';confirm_btn.style.fontSize='22px!important';confirm_btn.style.padding='13px!important';confirm_btn.style.height='62px';confirm_btn.style.backgroundColor='#ffffff';confirm_btn.style.color='#000000';confirm_btn.style.borderRadius='6px';confirm_btn.style.border='0';confirm_btn.style.cursor='pointer';confirm_btn.onclick=function(){akya.onClickConfirm()};confirm_btn.appendChild(confirm_btn_content);col_3.appendChild(confirm_btn);body.appendChild(container)} getBottomConfirmTemplate(){var body=document.querySelector('body');var container=document.createElement('div');container.className='akya-container';container.id='akya-container';container.style.position='fixed';container.style.bottom='0';container.style.fontFamily='sans-serif';container.style.zIndex='9999';container.style.width='100%';container.style.fontSize='18px';container.style.color='#ffffff';container.style.backgroundColor='#000000';var row=document.createElement('div');row.className='akya-row';row.style.maxWidth='1020px';row.style.marginLeft='auto';row.style.marginRight='auto';row.style.paddingTop='30px';row.style.paddingBottom='30px';row.style.paddingLeft='0';row.style.paddingRight='0';container.appendChild(row);var col_9=document.createElement('div');col_9.className='akya-col-9';col_9.style.width='75%';col_9.style.paddingLeft='15px';col_9.style.display='inline-block';row.appendChild(col_9);var paragraph=document.createElement('p');paragraph.style.display='inline-block';paragraph.style.marginRight='6px';var paragraph_content=document.createTextNode("This website uses cookies to give you an incredible experience.");paragraph.appendChild(paragraph_content);col_9.appendChild(paragraph);var more_link=document.createElement('a');more_link.style.color='#ff2857';more_link.style.marginRight='5px';more_link.style.textDecoration='none';more_link.setAttribute('href',akya.cookie_link);more_link.setAttribute('target','_blank');more_link.setAttribute('id','learn_more_banner_button');var more_link_content=document.createTextNode("Learn more.");more_link.appendChild(more_link_content);col_9.appendChild(more_link);var col_3=document.createElement('div');col_3.className='akya-col-3';col_3.style.width='20%';col_3.style.display='inline-block';col_3.style.textAlign='right';row.appendChild(col_3);var confirm_btn=document.createElement('button');var confirm_btn_content=document.createTextNode("Accept ");confirm_btn.id='akya-confirm-btn';confirm_btn.style.fontSize='22px!important';confirm_btn.style.padding='13px!important';confirm_btn.style.height='62px';confirm_btn.style.backgroundColor='#ffffff';confirm_btn.style.color='#000000';confirm_btn.style.borderRadius='6px';confirm_btn.style.border='0';confirm_btn.style.cursor='pointer';confirm_btn.onclick=function(){akya.onClickConfirm()};confirm_btn.appendChild(confirm_btn_content);col_3.appendChild(confirm_btn);body.appendChild(container)} getCollectData(){akya.collect_data={tracking_id:akya.tracking_id,page_title:document.title,url:document.baseURI,geoip:akya.geoip,redirected_url:akya.redirected_url,type:akya.type,cookie_hash:akya.cookie_hash,info:{app_name:navigator.appName,app_code_name:navigator.appCodeName,app_version:navigator.appVersion,user_agent:navigator.userAgent,screen_width:screen.width,screen_height:screen.height,charset:document.charset,base_url:document.baseURI,document_uri:document.documentURI,referrer:document.referrer}};akya.setLog('getCollectData');akya.setLog(akya.collect_data)} setCookie(name,value,days){var date=new Date();date.setTime(date.getTime()+(days*86400000));document.cookie=name+"="+value+"; expires="+date.toUTCString()+"; path=/;";akya.setLog('setCookie : '+document.cookie)} getCookie(cookieName){let name=cookieName+"=";let allCookieArray=document.cookie.split(';');for(let i=0;i