PageSourceSearch

https://www.visiteastbourne.com/JsHandlerMin/engine/javascript/DataCaptureCore_v63920480218.js

js visiteastbourne.com collected 2026-09-24 09:49:50 UTC 11,079 bytes, 1 lines download raw bytes

1NewMind.registerNameSpace('NewMind.DataCapture').Core=(function(){"use strict";if(!NewMind.env||!NewMind.env.platform||!NewMind.DataCapture.Data||!NewMind.DataCapture.Data.host||!NewMind.DataCapture.Data.serverTimestampUtc){throw new Error("Unable to initialise data capture functionality.");}window.document.body.addEventListener("click",function(e){if(!e.target){return;}var $target=$(e.target);sendPollingBookingReferralOutIfApplicable($target);sendBookingWebsiteReferralIfApplicable($target);});var strServerTimestampUtc=NewMind.DataCapture.Data.serverTimestampUtc,bUserHasConsented=false,bIsKnownToBeNewSession=false,arrObjectsToPost=[],queueFlushTimeoutId,bQueueFlushIsPending,dataPersister;dataPersister={setItem:function(strName,strValue){window.localStorage.setItem(strName,strValue);},getItem:function(strName){return window.localStorage.getItem(strName);},removeItem:function(strName){window.localStorage.removeItem(strName);}};var hexChars=['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'];function getNewGUID(){if(window.crypto&&window.crypto.getRandomValues&&window.Uint8Array){var guidBytes=new Uint8Array(16);crypto.getRandomValues(guidBytes);guidBytes[6]=(guidBytes[6]&0x0F)|0x40;guidBytes[8]=(guidBytes[8]&0x3F)|0x80;var guid='';for(var i=0;i<16;i++){if(i==4||i==6||i==8||i==10){guid+='-';}guid+=hexChars[(guidBytes[i]>>4)&0xF];guid+=hexChars[guidBytes[i]&0xF];}return guid;}return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(c){var r=Math.random()*16|0,v=(c==='x')?r:(r&0x3|0x8);return v.toString(16);});}var SessionStorageKey="SVInsights-Session";var SessionExpiryMsec=20*60*1000;var UserStorageKey="SVInsights-User";var UserExpiryMsec=180*24*60*60*1000;function getUserSession(){var storedUser=JSON.parse(dataPersister.getItem(UserStorageKey));var storedSession=JSON.parse(dataPersister.getItem(SessionStorageKey));var currentTimestamp=Date.now();var isNewSession=false;if(storedUser===null||currentTimestamp>(storedUser.lastUsedTimestamp+UserExpiryMsec)){storedUser={id:getNewGUID()};}storedUser.lastUsedTimestamp=currentTimestamp;if(storedSession===null||currentTimestamp>(storedSession.lastUsedTimestamp+SessionExpiryMsec)){storedSession={id:storedUser.id+"-"+getNewGUID()};isNewSession=true;}storedSession.lastUsedTimestamp=currentTimestamp;dataPersister.setItem(UserStorageKey,JSON.stringify(storedUser));dataPersister.setItem(SessionStorageKey,JSON.stringify(storedSession));return{userId:storedUser.id,sessionId:storedSession.id,isNewSession:isNewSession};}function generateNewEventId(){return getNewGUID();}function etwpPrintTrace(message){if(NewMind.ETWP&&NewMind.ETWP.Trace&&NewMind.ETWP.Trace.PrintTrace){NewMind.ETWP.Trace.PrintTrace(message);}}function etwpPrintTraceWarning(message){if(NewMind.ETWP&&NewMind.ETWP.Trace&&NewMind.ETWP.Trace.PrintTraceWarning){NewMind.ETWP.Trace.PrintTraceWarning(message);}}function record(objEvent,bFlushImmediately){if(!objEvent){throw new Error("Called record without an event");}var userSession=getUserSession();if(userSession.isNewSession){bIsKnownToBeNewSession=true;var objSessionStartEvent={type:"sessionStart",id:userSession.sessionId};setGenericEventProperties(objSessionStartEvent,userSession.sessionId,userSession.userId);arrObjectsToPost.push(objSessionStartEvent);}setGenericEventProperties(objEvent,userSession.sessionId,userSession.userId);arrObjectsToPost.push(objEvent);registerNewEventPushedToQueue(bFlushImmediately);}function registerNewEventPushedToQueue(bFlushImmediately){var flushQueue=function(synchronous){if(bUserHasConsented&&arrObjectsToPost.length>0){var json=JSON.stringify(arrObjectsToPost);var beaconSent=false;try{beaconSent=(navigator.sendBeacon&&navigator.sendBeacon(NewMind.DataCapture.Data.host,json));}catch(e){}if(!beaconSent){var request=new XMLHttpRequest();request.open("POST",NewMind.DataCapture.Data.host,!synchronous);request.send(json);}etwpPrintTrace("Simpleview Insights: Event sent: "+json);arrObjectsToPost=[];}bQueueFlushIsPending=false;};if(bFlushImmediately){if(queueFlushTimeoutId){clearTimeout(queueFlushTimeoutId);}flushQueue(true);}else if(!bQueueFlushIsPending){bQueueFlushIsPending=true;queueFlushTimeoutId=setTimeout(function(){flushQueue(false)},400);}}function setGenericEventProperties(objEvent,strSessionId,strUserId){objEvent.sessionId=strSessionId;objEvent.userId=strUserId;objEvent.serverTimestamp=strServerTimestampUtc;objEvent.clientTimestamp=new Date().toJSON();objEvent.timeElapsed=(function(){if((typeof(window.performance)==="undefined")||(typeof(window.performance.now)!=="function" )){return -1;}return window.performance.now();}());if(NewMind.env&&NewMind.env.platform&&NewMind.env.platform.dmsName){objEvent.dms=NewMind.env.platform.dmsName;}if(NewMind.env&&NewMind.env.page&&NewMind.env.page.channelId){objEvent.websiteChannelId=NewMind.env.page.channelId;}if(window.navigator&&window.navigator.userAgent){objEvent.userAgent=window.navigator.userAgent;}if(!objEvent.causalId){if(NewMind.DataCapture.PageView&&NewMind.DataCapture.PageView.PageViewEventId){objEvent.causalId=NewMind.DataCapture.PageView.PageViewEventId;}else if(bIsKnownToBeNewSession){objEvent.causalId=strSessionId;}}}var strTrackedNavigationsKey="Navigations",iTrackingNavigationExpirationInMs=60000;function registerImminentNavigation(strAbsoluteUrl,strEventID){var objNavigations=JSON.parse(dataPersister.getItem(strTrackedNavigationsKey));if(objNavigations){pruneExpiredEntries(objNavigations);}else{objNavigations={};}objNavigations[strAbsoluteUrl]={id:strEventID,from:new Date()};dataPersister.setItem(strTrackedNavigationsKey,JSON.stringify(objNavigations));}function getCausalIdIfTrackedNavigation(strAbsoluteUrl){var objNavigations=JSON.parse(dataPersister.getItem(strTrackedNavigationsKey));if(!objNavigations){return null;}pruneExpiredEntries(objNavigations);var objEntry=objNavigations[strAbsoluteUrl];var strID;if(objEntry){strID=objEntry.id;delete(objNavigations[strAbsoluteUrl]);}else{strID=null;}dataPersister.setItem(strTrackedNavigationsKey,JSON.stringify(objNavigations));return strID;}function pruneExpiredEntries(objNavigations){var now=new Date();for(var strName in objNavigations){if(!objNavigations.hasOwnProperty(strName)){continue;}var objEntry=objNavigations[strName];if((now-new Date(objEntry.from))>=iTrackingNavigationExpirationInMs){delete(objNavigations[strName]);}}}window.addEventListener("unload",function(){var objNavigations=JSON.parse(dataPersister.getItem(strTrackedNavigationsKey));var iMaxAcceptableAgeOfNavigationTrackingEntriesInMs=5000;var strTrackingNavigationCausalIdIfFound=null;var now=new Date();if(objNavigations){var iMaxAgeOfDataToConsiderInMs;for(var strName in objNavigations){if(!objNavigations.hasOwnProperty(strName)){continue;}var objEntry=objNavigations[strName];if((now-new Date(objEntry.from))<=iMaxAcceptableAgeOfNavigationTrackingEntriesInMs){strTrackingNavigationCausalIdIfFound=objNavigations[strName].id;break;}}}var objPageUnload={type:"pageUnload",pageViewId:NewMind.DataCapture.PageView?NewMind.DataCapture.PageView.PageViewEventId:null};if(strTrackingNavigationCausalIdIfFound){objPageUnload.causalId=strTrackingNavigationCausalIdIfFound;}NewMind.DataCapture.Core.record(objPageUnload,true);},false);function retryWhileFalse(func,attempts,interval,onSuccess,onFailure){function work(){attempts--;var success=(func()!==false);
1if(success){if(onSuccess){onSuccess();}}else if(attempts>0){setTimeout(work,interval);}else{if(onFailure){onFailure();}}}work();}function integrateWithTCFAPI(){if(typeof(window.__tcfapi)!=="function" )return false;window.__tcfapi('addEventListener',2,function(tcData,success){if(!success){return;}if(tcData.eventStatus!=='tcloaded'&&tcData.eventStatus!=='useractioncomplete'){return;}var eventPrefix="Simpleview Insights: CMP API v2 Event '"+tcData.eventStatus+"': ";if(tcData.gdprApplies===false){etwpPrintTrace(eventPrefix+"gdprApplies is false; events will be sent");bUserHasConsented=true;registerNewEventPushedToQueue(false);return;}if(tcData.gdprApplies!==true){etwpPrintTrace(eventPrefix+"gdprApplies is neither true or false; events will not be sent");bUserHasConsented=false;registerNewEventPushedToQueue(false);return;}function isStandardPurposeConsented(purposeId){return(tcData.purpose.consents[purposeId]||tcData.purpose.legitimateInterests[purposeId]||tcData.publisher.consents[purposeId]||tcData.publisher.legitimateInterests[purposeId]);}if(isStandardPurposeConsented(1)&&isStandardPurposeConsented(8)&&isStandardPurposeConsented(9)&&isStandardPurposeConsented(10)){etwpPrintTrace(eventPrefix+"GDPR applies and the required Standard Purposes have been accepted; events will be sent");bUserHasConsented=true;registerNewEventPushedToQueue(false);return;}etwpPrintTrace(eventPrefix+"GDPR applies but the required Standard Purposes have not been accepted; events will not be sent");bUserHasConsented=false;registerNewEventPushedToQueue(false);});}var integrateWithTCFAPIWithRetries=retryWhileFalse.bind(null,integrateWithTCFAPI,5,2000,null,function(){etwpPrintTraceWarning('Simpleview Insights: Unable to gain user consent because window.__tcfapi was not present after 10 seconds; events will not be sent');});if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',integrateWithTCFAPIWithRetries);}else{integrateWithTCFAPIWithRetries();}function sendBookingWebsiteReferralIfApplicable($target){var $possibleLinkWrapper=$target.closest("a.ProvClickCustom");if($possibleLinkWrapper.length===0){return;}var name=$possibleLinkWrapper.attr("name");if(!name){return;}var nameSegments=name.split("|");if((nameSegments.length!==3)||(nameSegments[0]!=="PROBWEBREF")){return;}var iProductKey=parseInt(nameSegments[2],10);if(isNaN(iProductKey)){return;}record({type:"providerBookingWebsiteReferralOut",productKey:iProductKey,url:$possibleLinkWrapper.attr("href"),pageViewId:getPageViewEventIdIfAny()},true);}function sendPollingBookingReferralOutIfApplicable($target){if(!$target.hasClass("btnBookStay")){return;}var $form=$target.closest("form.FrmUnitOptions");if($form.length===0){return;}var iProductKey=parseInt($form.find("input[name=product]").val(),10);var strProviderId=$form.find("input[name=SupplierId]").val();if(isNaN(iProductKey)||!strProviderId){return;}record({type:"pollingBookingReferralOut",productKey:iProductKey,supplierId:strProviderId,pageViewId:getPageViewEventIdIfAny()},true);}function getPageViewEventIdIfAny(){return NewMind.DataCapture.PageView?NewMind.DataCapture.PageView.PageViewEventId:null;}return{record:record,registerImminentNavigation:registerImminentNavigation,getCausalIdIfTrackedNavigation:getCausalIdIfTrackedNavigation,generateNewEventId:generateNewEventId,formatDate:function(dValue){dValue=new Date(dValue);if(isNaN(dValue)){throw new Error("formatDate called with a value that is not (and is not parseable as) a Date");}var padToTwoDigits=function(iValue){return(iValue<10)?("0"+iValue):(""+iValue);};return dValue.getFullYear()+"-"+padToTwoDigits(dValue.getMonth()+1)+"-"+padToTwoDigits(dValue.getDate());},getPageViewEventIdIfAny:getPageViewEventIdIfAny};}());

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.