if (undefined === window.Kameleoon){(function(){!function(e,t){e.kbowser=t()}(this,(function(){return function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=90)}({17:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var i=r(18),n=function(){function e(){}return e.getFirstMatch=function(e,t){var r=t.match(e);return r&&r.length>0&&r[1]||""},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||""},e.map=function(e,t){var r,i=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r1?n-1:0),a=1;a=3},describe:function(){return{type:s.PLATFORMS_MAP.t}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.m}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.d}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.d}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.d}}}];t.default=a,e.exports=t.default}})}));class APIConfiguration{constructor(e){this.generationTime=e.scriptProduceTime;this.goals=e.goals.map((e=>new APIGoal(e)));this.singlePageSupport=Kameleoon.Internals.runtime?Kameleoon.Internals.runtime.singlePageSupport:e.singlePageSupport;this.siteCode=e.siteCode}}class APIAction{constructor(i,t){this.dateLaunched=i.dateStatusModified;this.dateModified=i.dateModified;this.id=i.id;this.name=i.name;this.targetSegment=new APISegment(i.targetingSegment);this.active=i.targeting&&!i.disabled&&i.displayedVariation&&null!=i.displayedVariation.id;this.triggered=i.targeting||!1;this.goals=Kameleoon.Internals.configuration.goals.filter((t=>-1!=(i.goals||[]).indexOf(t.id))).map((i=>new APIGoal(i)));this.untrackedTrafficReallocationTime=i.untrackedRespoolTime||null;let e=i=>{let t=Kameleoon.Internals.runtime.variations.filter((t=>t.id==i));return t&&t[0]};const a=Kameleoon.Internals.runtime.Visitor.currentVisit;if("experiments"==t){this.mainGoal=i.kameleoonTracking&&i.kameleoonTracking.mainGoalId?new APIGoal(Kameleoon.Internals.configuration.goals.filter((t=>t.id==i.kameleoonTracking.mainGoalId))[0]):null;let t=e(i.registeredVariationId);this.associatedVariation=t?new APIVariation(t,i):null;this.trafficDeviation={};this.variations=[];this.redirectProcessed=i.redirectProcessed||!1;for(let t in i.deviation){this.trafficDeviation[t]=100*i.deviation[t];this.variations.push(new APIVariation(e(parseInt(t)),i))}let n=Kameleoon.Internals.runtime.storedData.obtainField("Gatherer","experimentsTriggered",{});this.triggeredInVisit=n[this.id]?!0:!1;this.activatedInVisit=a.ExperimentActivations[this.id]?!0:!1}else{this.mainGoal=new APIGoal(Kameleoon.Internals.configuration.goals.filter((t=>t.id==i.mainGoalId))[0]);this.associatedVariation=new APIVariation(e(i.associatedVariation.id),i);let t=Kameleoon.Internals.runtime.storedData.obtainField("Gatherer","personalizationsTriggered",{});this.triggeredInVisit=t[this.id]?!0:!1;this.activatedInVisit=this.triggeredInVisit&&a.PersonalizationActivations[this.id]?!0:!1}}}class APIActionActivation{constructor(i,n,t){const a="experiment"==i;const e=Kameleoon.Internals.runtime.Campaigns.obtainCampaign(n,a);const o=a?"ExperimentActivations":"PersonalizationActivations";const s=t[o][n].associatedVariationID;const r=Kameleoon.Internals.configuration.variations.filter((i=>i.id==s))[0];if(a){this.experimentID=n;this.experiment=e?new APIAction(e,"experiments"):null}else{this.personalizationID=n;this.personalization=e?new APIAction(e,"personalizations"):null}this.times=t[o][n].times;this.associatedVariationID=s;this.associatedVariation=r?new APIVariation(r,e):null}}class APIActions{constructor(e){const i=e;const t="experiments"==i;const n=()=>{if(Kameleoon.Internals.runtime)return Kameleoon.Internals.runtime.Campaigns.obtainCampaignsList(i);else return[]};const a=e=>new APIAction(e,i);this.getAll=()=>n().map(a);this.getActive=()=>n().filter((e=>(!0===e.targeting||e.trackingPerformed)&&1!=e.disabled&&e.displayedVariation&&null!=e.displayedVariation.id)).map(a);this.getTriggeredInVisit=()=>n().map(a).filter((e=>e.triggeredInVisit));this.getActivatedInVisit=()=>n().map(a).filter((e=>e.activatedInVisit));const s=(e,i)=>{const t=n().filter((t=>t[e]==i))[0];if(t)return a(t);return null};this.getById=e=>s("id",e);this.getByName=e=>s("name",e);if(t){this.assignVariation=(e,i,t)=>{};this.block=(e,i=!1)=>{};this.trigger=(e,i)=>{};this.triggerExperiment=(e,i)=>{}}else{this.block=(e,i=!1)=>{};this.disable=e=>{};this.trigger=(e,i)=>{}}}}class APIGoal{constructor(t){if(t){this.id=t.id;this.name=t.name;this.type=t.type}}}class APISegment{constructor(i){if(i){this.id=i.id;this.name=i.name}}}class APITemplate{constructor(s,t){this.name=s;this.customFields=t}}class APIVariation{constructor(e,t={}){if(e){this.id=e.id;this.name=e.name;if(t.experimentAction){var i=t.variations.filter((t=>t.id==e.id))[0];this.reallocationTime=i?i.respoolTime:null}else this.reallocationTime=null;this.instantiatedTemplate=e.widgetTemplateInputData?new APITemplate(e.widgetTemplateName,e.widgetTemplateInputData):null}}}class APIVisit{constructor(t){this.pageViews=t.obtainPageNumberViews();this.duration=t.lastActivityDate-t.startDate;this.locale=Kameleoon.Utils.getLocale();this.startDate=t.startDate;this.index=t.visitNumber;this.currentProduct=null;this.products=[];this.clicks=t.clicks||0;this.pageURLsVisited=t.pageURLsVisited;this.activatedSegments=t.activatedSegments;this.lastActivityDate=t.lastActivityDate;this.activatedExperiments=Object.keys(t.ExperimentActivations).map((e=>new APIActionActivation("experiment",parseInt(e),t)));this.activatedPersonalizations=Object.keys(t.PersonalizationActivations).map((e=>new APIActionActivation("personalization",parseInt(e),t)));if(t==Kameleoon.Internals.runtime.Visitor.currentVisit){this.device=new Device;this.geolocation=t.Geolocation;}this.conversions=Kameleoon.Utils.clone(t.conversions);this.customData={};let i="";let n=[];let a=Kameleoon.Internals.runtime.storedData.obtainField("Runtime","firstReferrersIndices",[]);for(let t=0,e=a.length;t";else{let t=Kameleoon.Internals.runtime.Gatherer.configuration.referrers[e-1];s=null==t?i:t.name}n.push(s)}this.acquisitionChannel=n[0];this.landingPageURL=t.landingPageURL;this.weather=new APIWeather(t)}}class APIVisitor{constructor(){this.getCustomDataVisitor=()=>{const t={};return t};this.setVisitorCode=t=>{Kameleoon.Internals.runtime.Visitor.setVisitorCode(t)};const{Visitor:t,personalizationsActive:i,Consent:s}=Kameleoon.Internals.runtime;this.numberOfVisits=t.totalVisits;this.timeStartedEldestVisit=t.timeStartedEldestVisit;this.customData=this.getCustomDataVisitor();this.personalizationsActive=i;this.code=t.currentVisit.visitorCode;this.currentVisit=new APIVisit(t.currentVisit);this.visits=t.visits.map((t=>new APIVisit(t)));this.previousVisit=t.visits.length>1?new APIVisit(t.visits.slice(-2)[0]):null;this.experimentLegalConsent=s.AB_TESTING;this.personalizationLegalConsent=s.PERSONALIZATION;this.firstVisitStartDate=t.timeStartedEldestVisit}}class APIWeather{constructor(i){let s=i.Weather;this.temperature=s.temperature;this.humidity=s.humidity;this.pressure=s.pressure;this.windSpeed=s.windSpeed;this.cloudiness=s.cloudiness;this.sunrise=s.sunrise;this.sunset=s.sunset;this.conditionCode=s.conditionCode;this.conditionDescription=s.conditionDescription}}class Analyst{constructor(){this.initialize=e=>{this.isTimeout=!1;if(window.kameleoonDisplayPage){if(null==Kameleoon.Internals.configuration.behaviorWhenTimeout||document.getElementById("kameleoonLoadingStyleSheet"))window.clearTimeout(window.kameleoonDisplayPageTimeOut);else if(null==window.kameleoonEndLoadTime)this.isTimeout=!0;try{window.kameleoonDisplayPage(!0)}catch(e){}window.kameleoonDisplayPage=null}window.kameleoonEndLoadTime=(new Date).getTime();e()};this.load=()=>{Kameleoon.Utils.sendKameleoonCustomEvent("Internals",{type:"load",time:(new Date).getTime()});Kameleoon.Utils.runProtectedFunction((function(){if(window.kameleoonQueue)window.kameleoonQueue=new CommandQueue(window.kameleoonQueue,"IMMEDIATE");if(window.kameleoonAddCustomAction){Kameleoon.Utils.runProtectedScript(window.kameleoonAddCustomAction,"kameleoonAddCustomActionScript.js");delete window.kameleoonAddCustomAction}if(window.kameleoonAddCustomGlobalScript){Kameleoon.Internals.configuration.globalScript=window.kameleoonAddCustomGlobalScript;delete window.kameleoonAddCustomGlobalScript}window.addEventListener("error",(e=>{if(e.error&&e.error.stack&&e.error.stack.match(/kameleoon/gi)){Kameleoon.Utils.Logger.send(e.error.stack,"kameleoon.js");return!1}}));Kameleoon.Analyst.initialize((()=>{const e=Kameleoon.Analyst.checkBlockingElements();const o=window.kameleoonEndLoadTime-(window.kameleoonStartLoadTime||window.kameleoonEndLoadTime)-25;Kameleoon.Utils.sendKameleoonCustomEvent.call(window,"Loaded",{timeout:"TIMEOUT"==e,loadTime:o});if(Kameleoon.Internals.runtime)Kameleoon.Internals.runtime.clear();if(0==e.length){Kameleoon.Internals.runtime=new Runtime;Kameleoon.Analyst.loadKameleoonFull((()=>{Kameleoon.Internals.runtime.run()}))}else{Kameleoon.Utils.sendKameleoonCustomEvent("Internals",{type:"abort",blockingReason:e});Kameleoon.Utils.sendKameleoonCustomEvent.call(window,"Aborted",{reason:e})}}))}))};this.loadKameleoonFull=(e,o)=>{if(!Kameleoon.Internals.runtime.kameleoonFull&&(this.kameleoonFullNeeded()||o)){const o="kameleoonFullApplicationCode";const n=o=>{Kameleoon.Utils.runProtectedScript(o+"\n;"+"("+e.toString()+")()","kameleoonFull.js")};const t=sessionStorage.getItem(o);if(null!=t)n(t);else{const{STATIC_HOST_NAME:e,DOMAIN:t}=Kameleoon.Internals.configuration;Kameleoon.Utils.performBeaconServerCall("https://"+e+"."+t+"/kameleoon-full.js?cache="+Kameleoon.Utils.obtainRandomString(16),(e=>{if(void 0===e.readyState||4==e.readyState&&200==e.status){sessionStorage.setItem(o,e.responseText);n(e.responseText)}}))}}else e()};this.Goals=new Goals}checkBlockingElements(){let e=!1;try{const o="kameleoonPrivateMode";if(window.localStorage||window.sessionStorage){localStorage.getItem(o);sessionStorage.getItem(o)}else e=!0}catch(o){e=!0}if(e)return"STORAGE";if(this.isTimeout){return"TIMEOUT"}document.removeEventListener("visibilitychange",Kameleoon.Analyst.load);if("prerender"==document.visibilityState){document.addEventListener("visibilitychange",Kameleoon.Analyst.load);return"PRERENDER"}if(-1!=location.href.indexOf("kameleoonDisabled"))return"PARAMETER";return""}kameleoonFullNeeded(){const{parameters:e,simulationMode:o}=Kameleoon.Internals.runtime;if(sessionStorage.getItem("kameleoonFullApplicationCode")||sessionStorage.getItem("kameleoonLightExtension")||e.kameleoon||e.kameleoonVariationId||e["kameleoon-simulation"]||e.kameleoonLightExtension||o||Kameleoon.Utils.readLocalData("kameleoonSimulationParameters","COOKIE"))return!0;return!1}loadSimulation(){if(!Kameleoon.Internals.runtime.parameters.kameleoonVariationId)Object.keys(localStorage).forEach((e=>{if(-1!==e.indexOf("kameleoonVariation-"))localStorage.removeItem(e)}))}loadVariationFromServer(e,o){}processSimulations(){}}Analyst.CODE_ALPHABET="abcdefghijklmnopqrstuvwxyz0123456789";class API{constructor(){this.Core={enableLegalConsent:function(e="BOTH"){Kameleoon.Internals.runtime.Consent.enable(e)},disableLegalConsent:function(e="BOTH"){Kameleoon.Internals.runtime.Consent.disable(e)},enableSinglePageSupport:function(){Kameleoon.Internals.runtime.enableSinglePageSupport.apply(Kameleoon.Internals.runtime,arguments)},enableDynamicRefresh:function(){Kameleoon.Internals.runtime.enableDynamicRefresh.apply(Kameleoon.Internals.runtime,arguments)},getConfiguration:()=>new APIConfiguration(Kameleoon.Internals.configuration),load:function(){Kameleoon.Analyst.load.apply(Kameleoon.Analyst,arguments)},processRedirect:function(){Kameleoon.Utils.processRedirect.apply(Kameleoon.Utils,arguments)},runWhenConditionTrue:(e,n,t=200)=>{if(e())Kameleoon.Utils.runProtectedFunction(n,!0);else{const o=Kameleoon.Utils.setTimeout((()=>{Kameleoon.Utils.clearTimeout(o);this.Core.runWhenConditionTrue.apply(Kameleoon,[e,n,t])}),t,!0)}},runWhenElementPresent:(e,n,t,o)=>{const a=null==t;const r=Kameleoon.Utils.querySelectorAll(e);const i=n;if(o)n=n=>{KMutationObserver.setMutationObserverSPA();const t=`data-kameleoon-dynamic-class-${Kameleoon.Utils.obtainRandomString(4)}`;const o=e=>{e.forEach((e=>e.setAttribute(t,"true")))};o(n);i(n);Kameleoon.Internals.runtime.waitingDynamicElements.push({selector:e,attribute:t,callback:e=>{o(e);i(e)}})};if(!Kameleoon.Internals.runtime.querySelectorAllHasError)if(0{n(r)}),!0);else if(Kameleoon.Internals.runtime.cantUseMutationObserver||!a){const n=Kameleoon.Utils.setTimeout((()=>{Kameleoon.Utils.clearTimeout(n);this.Core.runWhenElementPresent.apply(Kameleoon,[e,i,t||200,o])}),t||200,!0)}else Kameleoon.Internals.runtime.waitingElementPresentObjects.push({selector:e,callback:n,useAntiFlicker:a})}};this.Goals={cancelConversion:(e,n)=>{try{this.Goals.processConversions(e,n,!0)}catch(e){}},processConversion:(e,n)=>{try{this.Goals.processConversions(e,n,!1)}catch(e){}},processConversions:(e,n,t)=>{Kameleoon.Internals.runtime.goals.forEach((o=>{if(e==o.id||e==o.name)Kameleoon.Analyst.Goals.processConversions([{goal:o,revenue:n,negative:t}])}))}};this.Data={readLocalData:e=>Kameleoon.Internals.runtime.storedData.Vars[e]?Kameleoon.Internals.runtime.storedData.Vars[e].value:null,resetCustomData:e=>{this.Data.setCustomData(e,[],!0)},retrieveDataFromRemoteSource:(e,n)=>{const t={siteCode:Kameleoon.Internals.configuration.siteCode};let o="map";if(e instanceof Array){o="maps";t.keys=encodeURIComponent(JSON.stringify(e))}else t.key=encodeURIComponent(e.toString());Kameleoon.Utils.performBeaconServerCall(Kameleoon.Utils.addParameterToURL(`${Kameleoon.Internals.runtime.DATA_URL}/map/${o}`,Kameleoon.Utils.parseObjectToUrlParams(t),!1),(e=>{if(4==e.readyState){let t={};if(200==e.status)t=JSON.parse(e.responseText);n&&n(t)}}),null)},setCustomData:(e,n,t=!1)=>{},writeLocalData:(e,n,t)=>{Kameleoon.Internals.runtime.storedData.Vars[e]={value:n,date:(new Date).getTime()+24*60*60*1e3*(t?30:1/24)}},performRemoteSynchronization:(e,n,t)=>{}};this.Events={triggered:[],trigger:e=>{this.Core.runWhenConditionTrue((()=>!0===Kameleoon.Internals.runtime.setupAfterLocalDataRetrieval),(()=>{this.Events.triggered.push(e);if(Kameleoon.Analyst.Actions)Kameleoon.Analyst.Actions.processAllActions();if(Kameleoon.Targeting)Kameleoon.Targeting.processAllTargetingSegments();}),100)}};this.Tracking={processOmniture:e=>{Kameleoon.Tracking.processOmniture&&Kameleoon.Tracking.processOmniture(e)}};this.Experiments=new APIActions("experiments");this.Personalizations=new APIActions("personalizations");this.Segments={getAll:()=>Kameleoon.Internals.runtime.targetingSegments.map((e=>new APISegment(e))),getById:e=>{const n=Kameleoon.Internals.runtime.targetingSegments.filter((n=>n.id==e))[0];return n?new APISegment(n):null},getByName:e=>{const n=Kameleoon.Internals.runtime.targetingSegments.filter((n=>n.name==e))[0];return n?new APISegment(n):null},reevaluate:e=>{},trigger:e=>{}};this.Variations={execute:e=>{const n=e=>{const n=Kameleoon.Internals.runtime.variations.filter((n=>n.id==e));return n?n[0]:null};let t=n(e);if(t){t=new Variation(t);if(t.redirections)t.preProcessRedirect();Kameleoon.Utils.addCSSStyleSheet(t.cssCode);return t.applyJavascriptCode(!0)}return null}};this.Utils={addEventListener:function(e,n,t,o){Kameleoon.Utils.addEventListener(e,n,t,o,!0)},addUniversalClickListener:function(e,n,t){const o=Kameleoon.Internals.runtime.mouseDownEvent;this.addEventListener(e,o,(function(e){if(!Kameleoon.Internals.runtime.touchMoveEvent&&("mousedown"==o||!e.target||!e.target.closest||!e.target.closest("[disabled]")))n&&n(e)}))},clearInterval:function(){Kameleoon.Utils.clearInterval.apply(Kameleoon.Utils,arguments)},clearTimeout:function(){Kameleoon.Utils.clearTimeout.apply(Kameleoon.Utils,arguments)},createHash:function(e){return Kameleoon.Utils.computeStringHash.apply(Kameleoon.Utils,arguments)},getURLParameters:function(){return Kameleoon.Utils.parseParameters.apply(Kameleoon.Utils,arguments)},performRequest:(e,n,t,o=5e3)=>Kameleoon.Utils.performBeaconServerCall(e,n,t,o),querySelectorAll:function(e){return Kameleoon.Utils.querySelectorAll.apply(Kameleoon.Utils,arguments)},setInterval:(e,n=200)=>Kameleoon.Utils.setInterval(e,n,!1,!0),setTimeout:(e,n=200)=>Kameleoon.Utils.setTimeout(e,n,!0)};Object.defineProperty(this.Utils,"mouseDownEvent",{enumerable:!0,get:function(){return Kameleoon.Internals.runtime.mouseDownEvent}});Object.defineProperty(this.Utils,"touchMoveEvent",{enumerable:!0,get:function(){return Kameleoon.Internals.runtime.touchMoveEvent}});Object.defineProperty(this,"Visitor",{enumerable:!0,get:function(){try{if(!Kameleoon.Internals.runtime)return{setVisitorCode:e=>{Kameleoon.Internals.configuration.predefinedVisitorCode=e}};else return new APIVisitor}catch(e){return null}}});Object.defineProperty(this,"CurrentVisit",{enumerable:!0,get:function(){try{return new APIVisit(Kameleoon.Internals.runtime.Visitor.currentVisit)}catch(e){return null}}});Object.defineProperty(this,"React",{enumerable:!1,get:function(){return window.KameleoonAPIReact||null}})}}class Gatherer{constructor(){this.MAX_HREF_LENGTH_IN_A_REQUEST=200;this.MAX_PAGE_TITLE_LENGTH_IN_A_REQUEST=200}run(e){let t=Kameleoon.Utils.clone(Kameleoon.Internals.configuration.Gatherer);if("string"==typeof t)t=JSON.parse(Kameleoon.Utils.decodeString(t));Kameleoon.Internals.runtime.Gatherer={configuration:t,active:!0,clicks:0};this.Browser=new Browser(t.browsers);this.KeyPage=new KeyPage(t.keyPages);this.Language=new Language;this.OperatingSystem=new OperatingSystem(t.oss);this.Referrer=new Referrer(t.referrers);this.TimeZone=new TimeZone;Kameleoon.Internals.runtime.storedData.saveField("Gatherer","startsOfVisitForCurrentPage",0);Kameleoon.Internals.runtime.Visitor=new Visitor;e();this.track(VisitEvent_Page);this.track(VisitEvent_StaticData);VisitEvent_Activity.initialize();Kameleoon.Internals.runtime.gathererRun=!0}startNewVisit(e,t){Kameleoon.Internals.runtime.Visitor.updateFromStoredData(!0,!0,t);this.track(VisitEvent_Page);this.track(VisitEvent_StaticData);}track(e,t){new VisitEvent(e).track(t)}}class KameleoonEngine{constructor(){this.Analyst=new Analyst;this.API=new API;this.Gatherer=new Gatherer;this.Loader=new Loader;this.Tracking=new Tracking;this.Utils=new Utils}}class Loader{constructor(){this.enableKameleoonEditorListener=()=>{if(!Kameleoon.Internals.runtime.editorListenerEnabled){Kameleoon.Internals.runtime.editorListenerEnabled=!0;const t=t=>{if(!t)t=window.event;Kameleoon.Loader.listenKeys.call(Kameleoon.Loader,t)};Kameleoon.Utils.addEventListener(document,"keyup",t,!1)}};this.listenKeys=t=>{if(t.shiftKey){if(113==t.keyCode&&Kameleoon.Internals.configuration.webExperimentationSetup){Kameleoon.Internals.runtime.editorMode=!0;Kameleoon.Analyst.loadKameleoonFull((()=>{Kameleoon.Loader.enableKameleoonEditor.apply(Kameleoon.Loader)}),!0)}if(115==t.keyCode&&(Kameleoon.Internals.runtime.simulationMode||Kameleoon.Internals.runtime.parameters.kameleoonVariationSelection))Kameleoon.Analyst.loadKameleoonFull((()=>{Kameleoon.Loader.enableSimulationPanel()}),!0)}};}}class Runtime{constructor(){this.DATA_URL=Kameleoon.Internals.configuration.DATA_URL;this.PAGE_LOADED_POLL_DELAY=250;this.PAGE_LOADING_POLL_DELAY=75;this.IDLE_DURATION=1e4;this.enableSinglePageSupport=()=>{this.singlePageSupport=!0;this.href=window.location.href;KMutationObserver.setMutationObserverSPA();Kameleoon.Utils.setInterval((()=>{const e=this.href;this.href=window.location.href;if(e!=this.href)Kameleoon.Analyst.load.apply(this,[])}),100)};this.enableDynamicRefresh=()=>{this.dynamicRefresh=!0;KMutationObserver.setMutationObserverSPA()};this.executeGlobalScript=()=>{if(Kameleoon.Internals.configuration.globalScript&&!this.globalScriptProcessed&&!this.editorMode&&!this.kameleoonSelectionIframeMode){Kameleoon.Utils.sendKameleoonCustomEvent("Internals",{type:"globalScript"});this.globalScriptProcessed=!0;Kameleoon.Utils.runProtectedScript(Kameleoon.Internals.configuration.globalScript,"kameleoonGlobalScript.js")}};this.initializePredefinedVisitorCode=()=>{const{predefinedVisitorCode:e,experiments:t,personalizations:i}=Kameleoon.Internals.configuration;if(e){const o=Kameleoon.Utils.readLocalData("kameleoonVisitorCode","COOKIE")||Kameleoon.Utils.readLocalData("kameleoonVisitorCode","LS");if(o==e)return;const n=this.storedData.Visitor.visits;if(n)n.slice(-1)[0].visitorCode=e;Kameleoon.Utils.saveVisitorCode(e);t.forEach((e=>{Kameleoon.Utils.eraseLocalData("kameleoonExperiment-"+e.id,null,"LS")}));i.forEach((e=>{Kameleoon.Utils.eraseLocalData("kameleoonPersonalization-"+e.id,null,"LS")}))}};this.initializeActions=()=>{if(Kameleoon.Internals.configuration.webExperimentationSetup){this.targetingSegments=Kameleoon.Utils.clone(Kameleoon.Internals.configuration.targetingSegments);this.variations=Kameleoon.Utils.clone(Kameleoon.Internals.configuration.variations);}};this.initializeActionsAfterGatherer=()=>{};this.initializeIdleTimeListener=()=>{};this.initializeListeners=()=>{Kameleoon.Utils.domReady((()=>{this.domReady=!0;if(!0!==Kameleoon.Internals.configuration.disableEditorLaunchViaKeys)Kameleoon.Loader.enableKameleoonEditorListener();if(this.kameleoonSelectionIframeMode){const e=document.createElement("script");e.setAttribute("type","text/javascript");e.setAttribute("charset","utf-8");e.setAttribute("src","https://back-office-redesign."+Kameleoon.Internals.configuration.DOMAIN+"/get-script?type=selection");this.headNode.appendChild(e)}if(0==window.kameleoonLightIframe&&window.kameleoonIframeURL)if(this.Gatherer.startOfVisit)Kameleoon.Utils.setTimeout((()=>{const e=document.createElement("iframe");e.src=window.kameleoonIframeURL;e.id="kameleoonExternalIframe";e.style.cssFloat="left !important";e.style.opacity="0.0 !important";e.width="0px";e.height="0px";e.onload=()=>{e.parentNode.removeChild(e)};document.head.appendChild(e)}),5e3)}));if("touchend"==this.mouseDownEvent){Kameleoon.Utils.addEventListener(document,"touchmove",(e=>{this.touchMoveEvent=!0}));Kameleoon.Utils.addEventListener(document,"touchstart",(e=>{this.touchMoveEvent=!1}))}if(!this.iframeLocalStorage)window.addEventListener("storage",(e=>{const t=null==e.key?[""]:e.key.split("-");let i=t[0];if(-1!=i.indexOf("kameleoon")){if(window.document.hasFocus())return;let o;try{o=null==e.newValue?null:JSON.parse(e.newValue).value}catch(e){return}if("kameleoonData"===i&&t[1])i+="-"+t[1];const n={};switch(i){case"kameleoonExperiment":n.type=i;const e=t[1];n.experimentId=parseInt(e);let a;if(null==o)a=null;else{const e=o.split("/")[0];a=isNaN(e)?e:parseInt(e)}n.registeredVariationId=a;break;case"kameleoonGlobalPersonalizationExposition":n.type=i;n.active=null==o?null:"true"==o.split("/")[0];break;case this.dataKeyName:case"kameleoonSimulationVisitorData":n.type=i;n.value=null==o?null:o;break;case"kameleoonLegalConsent":n.type=i;n.saveLegalConsent=null==o?null:o;break}if(null!=n.type)Kameleoon.Utils.processStorageData(n)}}),!1);this.initializeIdleTimeListener();};this.loadExternalRequests=()=>{this.Geolocation="undefined"!=typeof KGeolocation?new KGeolocation:null;this.IP="undefined"!=typeof IP?new IP:null;};this.loadAudienceSegments=()=>{};this.processPageLoaded=()=>{Kameleoon.Utils.removeBlockingStyleSheet();for(let e=0,t=this.variations.length;e{if(this.incomingStoredData)return this.incomingStoredData[e];else return Kameleoon.Utils.readLocalData(e,t,!0)};this.setup=()=>{if(this.parameters.kameleoon)Kameleoon.Utils.domReady((()=>{Kameleoon.Loader.enableKameleoonEditor()}));const e="adBlockerCheck";const t=Kameleoon.Utils.setInterval((()=>{let i=document.getElementById(e);if(null==i&&null!=document.body){i=document.createElement("div");i.id=e;i.className="ad-placement";document.body.appendChild(i)}if(null!=i&&0==i.clientWidth){this.adBlocker=!0;Kameleoon.Utils.clearInterval(t)}}),250);const i=Kameleoon.Utils.setTimeout((()=>{Kameleoon.Utils.clearTimeout(i);const o=document.getElementById(e);if(null!=o)o.parentNode.removeChild(o);if(null==this.adBlocker){Kameleoon.Utils.clearInterval(t);this.adBlocker=!1}else Kameleoon.Gatherer.track(VisitEvent_AdBlocker)}),2e3);Kameleoon.Utils.addEventListener(window,"pageshow",(e=>{if(e.persisted)this.updateAfterPageCached()}));this.Visitor.updateFromStoredData(!1,!1,!1);if(!Kameleoon.Internals.configuration.requestsAfterConsent)this.loadExternalRequests();KMutationObserver.setMutationObserver();Kameleoon.Analyst.loadKameleoonFull((()=>{Kameleoon.Analyst.loadSimulation()}));Kameleoon.Analyst.Goals.checkKameleoonGoals();};this.setupLocalData=e=>{Kameleoon.Utils.addEventListener(window,"message",Kameleoon.Utils.processMessageEvent,!1);if(this.iframeLocalStorage){this.externalIframe=document.getElementById("kameleoonExternalIframe")||window.kameleoonExternalIframe;this.postMessageOrigin=window.kameleoonIframeOrigin||"";this.postMessageCallbacks={};if(null==Kameleoon.Internals.configuration.externalIframeData)Kameleoon.Utils.postMessageToExternalIframe(JSON.stringify({type:"retrieve",callbackId:Kameleoon.Utils.addPostMessageCallback((t=>{this.incomingStoredData=t;e()}))}));else{this.incomingStoredData=Kameleoon.Internals.configuration.externalIframeData;e();delete Kameleoon.Internals.configuration.externalIframeData}}else{this.incomingStoredData=null;e()}};this.updateAfterPageCached=()=>{this.pageCached=!0;if(this.iframeLocalStorage)Kameleoon.Utils.postMessageToExternalIframe(JSON.stringify({type:"retrieve",callbackId:Kameleoon.Utils.addPostMessageCallback((()=>{}))}));else{const e=Kameleoon.Utils.readLocalData(this.simulationMode?"kameleoonSimulationVisitorData":this.dataKeyName,"LS",!0);this.storedData.update(e);this.Visitor.updateFromStoredData(!1,!1,!1);Kameleoon.Gatherer.track(VisitEvent_Page)}};this.getSimulationMode=()=>{const e=this.readFromStorageOrExternal("kameleoonSimulation","LS");return e?!0:!1};this.pageStartTime=(new Date).getTime();this.dataKeyName="kameleoonData";if(Kameleoon.Internals.configuration.useMultipleSiteCodes){this.dataKeyName+="-"+Kameleoon.Internals.configuration.siteCode;Utils.LOCAL_STORAGE_OBFUSCATED_KEYS[this.dataKeyName]=!0}this.Device=new Device;this.deviceType=this.Device.type;this.parameters=Kameleoon.Utils.parseParameters();this.beforeUnloadEvent="Phone"==this.deviceType&&"Safari"==this.Device.browser?"pagehide":"beforeunload";this.headNode=document.getElementsByTagName("head")[0];this.editorMode="true"==this.parameters.kameleoon;this.proxyMode="proxy."+Kameleoon.Internals.configuration.DOMAIN===window.location.hostname;this.disableCache="true"==this.parameters.kameleoonDisableCache||this.parameters.kameleoonVariationId;this.kameleoonSelectionIframeMode="true"==this.parameters.kameleoonSelectionIframeMode;this.iframeLocalStorage=Kameleoon.Internals.configuration.useWideDomainSupport;this.useWideDomainSupport=Kameleoon.Internals.configuration.useWideDomainSupport||null!=window.kameleoonLightIframe;if(0==window.kameleoonLightIframe||null==window.kameleoonLightIframe)this.iframeLocalStorage=!1;this.mouseDownEvent="ontouchend"in document.documentElement?"touchend":"mousedown";this.addedClasses={};this.addedIDs={};this.eventListeners=[];this.listenVariations=[];this.waitingElementPresentObjects=[];this.waitingDynamicElements=[];this.variations=[];this.intervalIds={};this.targetingSegments=[];this.timeoutIds={};this.goals=Kameleoon.Utils.clone(Kameleoon.Internals.configuration.goals);this.cantUseMutationObserver="undefined"==typeof MutationObserver&&!Kameleoon.Internals.configuration.disableDomMutationObserver;this.Campaigns=new Campaigns;this.Consent=new Consent;Object.defineProperty(this,"experiments",{get(){return this.Campaigns.obtainCampaignsList("experiments")}});Object.defineProperty(this,"personalizations",{get(){return this.Campaigns.obtainCampaignsList("personalizations")}})}clear(){this.eventListeners.forEach((e=>{let t;if("window"==e.elementKey||"document"==e.elementKey)t="window"==e.elementKey?window:document;else{t=document.querySelector(`[kameleoonListener-${e.elementKey}=true]`);if(t)t.removeAttribute(`kameleoonListener-${e.elementKey}`)}if(t)t.removeEventListener(e.eventType,e.actionFunction,e.useCapture)}));this.waitingDynamicElements.forEach((e=>{Kameleoon.Utils.querySelectorAll(`[${e.attribute}=true]`).forEach((t=>{t.removeAttribute(e.attribute)}))}));for(const e in this.timeoutIds)Kameleoon.Utils.clearTimeout(parseInt(e));for(const e in this.intervalIds)Kameleoon.Utils.clearInterval(parseInt(e));if(this.RequestManager)this.RequestManager.processRequests();if(this.storedData)this.storedData.save(!0);if(null!=this.mutationObserver)this.mutationObserver.disconnect();if(null!=this.mutationObserverSpa)this.mutationObserverSpa.disconnect();let e=Kameleoon.Utils.querySelectorAll("[id^='kameleoonElement'], [id*='kameleoonScenarioLayerBase'], [id^='kameleoonStyleSheet'], [class*='kameleoonWidget']");for(let t=0;t{this.simulationMode=this.getSimulationMode();this.storedData=new StoredData(this.incomingStoredData);this.Consent.setup();this.initializePredefinedVisitorCode();this.initializeActions();Kameleoon.Gatherer.run((()=>{this.RequestManager=new RequestManager}));this.initializeActionsAfterGatherer();this.executeGlobalScript();window.kameleoonQueue=new CommandQueue(window.kameleoonQueue);Kameleoon.Utils.sendKameleoonCustomEvent.call(window,"Started",{newVisitorCode:1==this.Visitor.visits.length});this.initializeListeners();this.setup();this.setupAfterLocalDataRetrieval=!0}))}}class Utils{constructor(){this.events=[];this.addParameterToURL=(e,t,n)=>{if(n)return e+(-1==e.indexOf("#")?"#":"&")+t;let a="";if(-1!=e.indexOf("#")){a=e.substr(e.indexOf("#"));e=e.substr(0,e.indexOf("#"))}e+=(-1==e.indexOf("?")?"?":"&")+t+a;return e};this.computeCurrentPageAbsoluteURLNoProxyMode=function(){let e=Kameleoon.Internals.runtime;if(null==e.currentPageAbsoluteURLNoProxyMode){if(e.proxyMode){let t=e.parameters.kameleoonExperimentId||e.parameters["kameleoon-experiment-id"];if(null!=t){let n=e.Campaigns.obtainCampaign(t,!0);if(n)e.currentPageAbsoluteURLNoProxyMode=n.baseURL}}if(null==e.currentPageAbsoluteURLNoProxyMode)e.currentPageAbsoluteURLNoProxyMode=window.location.href}return e.currentPageAbsoluteURLNoProxyMode};this.computeCurrentPageCanonicalURL=()=>{if(null==Kameleoon.Internals.runtime.currentPageCanonicalURL){let e=this.querySelectorAll('link[rel="canonical"]');if(e.length>0)Kameleoon.Internals.runtime.currentPageCanonicalURL=e[0].href}return Kameleoon.Internals.runtime.currentPageCanonicalURL};this.computeCurrentPageCleanRelativeURL=()=>{if(null==Kameleoon.Internals.runtime.currentPageCleanRelativeURL)Kameleoon.Internals.runtime.currentPageCleanRelativeURL=this.computeRelativeURL(this.computeCurrentPageCleanAbsoluteURL());return Kameleoon.Internals.runtime.currentPageCleanRelativeURL};this.computeIfSuffix=(e,t)=>{let n=e.length-t.length;let a=e.lastIndexOf(t,n);return a>=0&&a==n};this.computeRelativeURL=e=>{let t=document.createElement("a");t.href=e;return t.pathname+t.search+t.hash};this.computeStringSha256=e=>{let t=1,n,a=[],o=[];while(++t<18)for(n=t*t;n<312;n+=t)a[n]=1;function r(e,t){return Math.pow(e,1/t)%1*4294967296|0}for(t=1,n=0;t<313;)if(!a[++t]){o[n]=r(t,2);a[n++]=r(t,3)}function l(e,t){return e>>>t|e<<32-t}let i=o.slice(t=0),s=this.encodeUTF8(e),m=[],u=s.length,c=[],d,f,h;for(;t>2]|=(255&s.charCodeAt(t))<<8*(3-t++%4);u*=8;c[u>>5]|=128<<24-u%32;c[h=u+64>>5|15]=u;for(t=0;t>>10)+(0|m[n-7])+(l(f=m[n-15],7)^l(f,18)^f>>>3)+(0|m[n-16]);let e;d.unshift((f=(d.pop()+(l(e=d[4],6)^l(e,11)^l(e,25))+((e&d[5]^~e&d[6])+a[n])|0)+(0|m[n++]))+(l(u=d[0],2)^l(u,13)^l(u,22))+(u&d[1]^d[1]&d[2]^d[2]&u))}for(n=8;n--;)i[n]=d[n]+i[n]}for(s="";n<63;)s+=(i[++n>>3]>>4*(7-n%8)&15).toString(16);return s};this.computeURLNoKameleoonParameters=e=>{let t=!1;for(let n in Kameleoon.Internals.runtime.parameters)if(-1!=n.indexOf("kameleoon")){t=!0;e=e.replace(new RegExp(n+"="+Kameleoon.Internals.runtime.parameters[n]+"&?"),"")}return t?e.replace(/\?$/,""):e};this.computeURLRegExpNoKameleoonParameters=e=>e?e.replace(/(\\\?|&|#)kameleoon[^&#()]*/g,""):null;this.createLocalData=(e,t,n,a,o,r,l,i)=>{let s="COOKIE"!=o;let m=(new Date).getTime();if(!i&&!Kameleoon.Internals.runtime.Consent.hasGlobalConsent()){let i=s?"LS":"COOKIE";if(null==Kameleoon.Internals.runtime.localDataMap)Kameleoon.Internals.runtime.localDataMap={};if(null==Kameleoon.Internals.runtime.localDataMap[i])Kameleoon.Internals.runtime.localDataMap[i]={};Kameleoon.Internals.runtime.localDataMap[i][e]={name:e,value:t,days:n,domain:a,forceLocalAccess:o,jsonFormat:r,creationTime:m};if(s)l&&l();return}if(s){let a=m+24*n*60*60*1e3;if(Kameleoon.Internals.runtime.iframeLocalStorage)this.postMessageToExternalIframe(JSON.stringify({type:"set",key:e,data:{value:Utils.LOCAL_STORAGE_OBFUSCATED_KEYS[e]&&this.obfuscateString(JSON.stringify(t))||t,expirationDate:a},callbackId:this.addPostMessageCallback(l)}));else{try{localStorage.setItem(e,JSON.stringify({value:Utils.LOCAL_STORAGE_OBFUSCATED_KEYS[e]&&this.obfuscateString(JSON.stringify(t))||t,expirationDate:a}))}catch(e){}l&&l()}}else{let o="";let l=r?JSON.stringify(t):t;if(n){let e=new Date(m+24*n*60*60*1e3);o="; expires="+e.toUTCString()}if("CURRENT_HOST"!=a){a=a||Kameleoon.Internals.configuration.customCookieDomainName||this.obtainCurrentRootDomain();o+="; domain="+a}const i=Kameleoon.Internals.configuration.useSecureCookie?"; Secure":"";document.cookie=e+"="+l+o+"; path=/; SameSite=Lax"+i}};this.decodeString=e=>{let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let n="";let a,o,r;let l,i,s,m;let u=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(u>4;o=(15&i)<<4|s>>2;r=(3&s)<<6|m;n+=String.fromCharCode(a);if(64!=s)n+=String.fromCharCode(o);if(64!=m)n+=String.fromCharCode(r)}n=this.decodeUTF8(n);return n};this.decodeUTF8=e=>{let t="";let n=0;let a=0,o=0,r;while(n191&&a<224){o=e.charCodeAt(n+1);t+=String.fromCharCode((31&a)<<6|63&o);n+=2}else{o=e.charCodeAt(n+1);r=e.charCodeAt(n+2);t+=String.fromCharCode((15&a)<<12|(63&o)<<6|63&r);n+=3}}return t};this.domReady=e=>{if("complete"==document.readyState||"interactive"==document.readyState)return e();else{let t=!1;this.addEventListener(document,"DOMContentLoaded",(()=>{if(t)return;t=!0;e()}),!1);this.addEventListener(window,"load",(()=>{if(t)return;t=!0;e()}),!1)}};this.encodeString=e=>{let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let n="";let a,o,r,l,i,s,m;let u=0;e=this.encodeUTF8(e);while(u>2;i=(3&a)<<4|o>>4;s=(15&o)<<2|r>>6;m=63&r;if(isNaN(o))s=m=64;else if(isNaN(r))m=64;n=n+t.charAt(l)+t.charAt(i)+t.charAt(s)+t.charAt(m)}return n};this.encodeUTF8=e=>{e=e.replace(/\r\n/g,"\n");let t="";for(let n=0;n127&&a<2048){t+=String.fromCharCode(a>>6|192);t+=String.fromCharCode(63&a|128)}else{t+=String.fromCharCode(a>>12|224);t+=String.fromCharCode(a>>6&63|128);t+=String.fromCharCode(63&a|128)}}return t};this.eraseLocalData=(e,t,n)=>{let a="COOKIE"!=n;let o=Kameleoon.Internals.runtime.localDataMap;let r=a?"LS":"COOKIE";if(null!=o&&null!=o[r]&&null!=o[r][e])delete o[r][e];if(a)if(Kameleoon.Internals.runtime.iframeLocalStorage)this.postMessageToExternalIframe(JSON.stringify({type:"remove",key:e,callbackId:this.addPostMessageCallback(null)}));else localStorage.removeItem(e);else this.createLocalData(e,"",-1,t,"COOKIE",!1,null,!0)};this.forceNoFlicker=e=>{let t=document.createElement("style");t.setAttribute("id","kameleoonPageLoading");t.setAttribute("rel","stylesheet");t.setAttribute("type","text/css");t.setAttribute("media","screen");let n=e+" { visibility: hidden !important; background-image: none !important; }";t.appendChild(document.createTextNode(n));Kameleoon.Internals.runtime.headNode.appendChild(t)};this.getLocale=e=>{let t=Kameleoon.Gatherer.Language.obtainLocaleTag();if("fr-FR"==t)t="fr";if("en-US"==t)t="en";if(e&&(!t||"fr"!=t))t="en";return t.substring(0,2)};this.obtainComputedStyle=e=>{if(window.getComputedStyle)return getComputedStyle(e,"");return null};this.obtainCurrentRootDomain=()=>{if(null==Kameleoon.Internals.runtime.currentRootDomain){let e=window.location.hostname.split(".");let t="";const n="testRootDomain";const a="_detectRootDomain";for(let o=0,r=e.length;o0)t="."+t;t=e[r-o-1]+t;if(0==t.length)continue;this.createLocalData(a,n,1,t,"COOKIE",!1,void 0,!0);const l=this.readLocalData(a,"COOKIE",!1);if(l){this.eraseLocalData(a,t,"COOKIE");Kameleoon.Internals.runtime.currentRootDomain=t;break}}}return Kameleoon.Internals.runtime.currentRootDomain};this.obtainRandomString=(e,t=Analyst.CODE_ALPHABET)=>{let n=t.length;let a="";for(let o=0;o{let t=document.createElement("a");t.href=e;return t.hostname};this.processRedirect=(e,t)=>{if(window.location.href!=e){t=t||Kameleoon.Analyst.Actions.currentAction;if(Kameleoon.Internals.runtime.gathererRun&&1==Kameleoon.Internals.runtime.Visitor.currentVisit.obtainPageNumberViews()){}let a=document.createElement("a");a.href=e;if(!Kameleoon.Internals.runtime.useWideDomainSupport&&-1==window.location.href.indexOf(a.protocol+"//"+a.hostname)){if(t)e=Kameleoon.Utils.addParameterToURL(e,"kameleoonRedirect-"+t.id+"="+t.associatedVariation.id,!0)}else if(t)Kameleoon.Utils.createLocalData("kameleoonRedirect-"+t.id,t.associatedVariation.id,1,null,null,!1,null,!0);if(window.location.href!=e){Kameleoon.Utils.forceNoFlicker("*");Kameleoon.Utils.createLocalData("kameleoonReferrer",Kameleoon.Gatherer.Referrer.obtain(),1/24,null,"COOKIE",!1);window.location.replace(e)}}};this.processStorageData=e=>{if(Kameleoon.Internals.runtime.setupAfterLocalDataRetrieval)switch(e.type){case"kameleoonExperiment":for(let t in Kameleoon.Internals.runtime.Campaigns.experiments){let n=Kameleoon.Internals.runtime.Campaigns.experiments[t];if(e.experimentId==n.id){n.registeredVariationId=e.registeredVariationId;break}}break;case"kameleoonGlobalPersonalizationExposition":Kameleoon.Internals.runtime.personalizationsActive=e.active;break;case Kameleoon.Internals.runtime.dataKeyName:case"kameleoonSimulationVisitorData":if(e.type==Kameleoon.Internals.runtime.dataKeyName&&!Kameleoon.Internals.runtime.simulationMode||"kameleoonSimulationVisitorData"==e.type&&Kameleoon.Internals.runtime.simulationMode){if(Kameleoon.Internals.runtime.pageCached)Kameleoon.Internals.runtime.storedData.update(Kameleoon.Utils.readLocalData(e.type,"LS",!0));else Kameleoon.Internals.runtime.storedData.update(JSON.parse(Kameleoon.Utils.unobfuscateString(e.value)));Kameleoon.Internals.runtime.Visitor.updateFromStoredData(!1,!1,!1)}break;case"kameleoonLegalConsent":if(e.saveLegalConsent){let t=e=>e?"enable":"disable";if(null!=e.saveLegalConsent.AB_TESTING){let n=t(e.saveLegalConsent.AB_TESTING);Kameleoon.Internals.runtime.Consent[n]("AB_TESTING",!0)}if(null!=e.saveLegalConsent.PERSONALIZATION){let n=t(e.saveLegalConsent.PERSONALIZATION);Kameleoon.Internals.runtime.Consent[n]("PERSONALIZATION",!0)}}break}};this.querySelectorAll=(e,t)=>{Kameleoon.Internals.runtime.querySelectorAllHasError=!1;let n=!1,a,o=[],r=[];if(null==t)t=document;let l=e.match(/#([0-9]+.*)(?: |$)/);if(l){let t=e.charAt(1);e=e.replace("#"+t,"#\\3"+t+" ")}if(""!==e){if(-1!==e.indexOf("[")&&-1===e.indexOf("']")&&-1===e.indexOf('"]')){let t=e.split(/(?=\.)|(?=#)|(?=\[)/),n,a,o;t.forEach((function(t){if("["===t[0]&&-1===t.indexOf("']")&&-1===e.indexOf('"]')&&-1!==e.indexOf("=")){n=t.split(/=(.+)?/);a=n[1];a=a.substring(0,a.length-1);o=n[0]+"='"+a+"']";e=e.replace(t,o)}}))}if(-1!==e.indexOf(":contains")){n=!0;a=this.treatContainsSelector(e);e=a.newSelector}if(t&&t.querySelectorAll)if(-1!==e.indexOf(":eq"))o=this.treatEqSelector(e,t);else try{o=t.querySelectorAll(e)}catch(e){Kameleoon.Internals.runtime.querySelectorAllHasError=!0;o=[]}for(let e=0,t=o.length;e{let a="COOKIE"!=t;let o=(new Date).getTime();try{if(!Kameleoon.Internals.runtime.Consent.hasGlobalConsent()){let t=Kameleoon.Internals.runtime.localDataMap;let n=a?"LS":"COOKIE";if(null!=t&&null!=t[n]&&null!=t[n][e]){let a=t[n][e];if(o-24*a.days*60*60*1e3>=a.creationTime)delete t[n][e];else return a.value}}if(a){let t;t=localStorage&&localStorage.getItem(e);if(!t)return null;t=JSON.parse(t);if(Utils.LOCAL_STORAGE_OBFUSCATED_KEYS[e])t.value=JSON.parse(this.unobfuscateString(t.value));if(o>(t.date||t.expirationDate)){localStorage.removeItem(e);return null}return t.value}else{let t=null;let a=document.cookie.split(";");for(let o=0,r=a.length;o{try{e()}catch(e){if(t)console.log(e);else Kameleoon.Utils.Logger.send(e,"kameleoon.js");if(Kameleoon.Internals.runtime&&t)Kameleoon.Internals.runtime.processPageLoaded()}};this.runProtectedScript=(e,t,n)=>{if(n)return n();if(e){let n=null;try{let a=t?"//# sourceURL="+t:"";n=eval.call(window,"(function () {\n"+e+"\n})();"+a)}catch(e){n=null;console.log(e)}return n}return null};this.saveVisitorCode=(e,t=!0)=>{if(Kameleoon.Internals.configuration.useWideDomainSupport||Kameleoon.Internals.configuration.useVisitorCodeInLocalStorage)Kameleoon.Utils.createLocalData("kameleoonVisitorCode",e,Utils.MAX_STORAGE_DAYS,null,"LS");if(t)Kameleoon.Utils.createLocalData("kameleoonVisitorCode",e,Utils.MAX_STORAGE_DAYS,null,"COOKIE")};this.seededRandom=(e,t)=>{let n;if(t){n=Kameleoon.Utils.computeStringSha256(e);return parseInt(n,16)/Math.pow(2,256)}n=this.computeStringHash(e);n=(9301*Math.abs(n)+49297)%233280;return n/233280};this.treatEqSelector=(e,t)=>{if(void 0===e)return null;let n=e.split(/\:eq\([0-9]+\)/g);let a=e.match(/(?!\:eq\()[0-9]+/g)||[];let o=null==t?document:t;for(let t=0;t"===n[t].charAt(0))n[t]=n[t].substring(1,e.length).trim();if(null==o||""==n[t].trim())break;if(t>a.length-1)o=o.querySelectorAll(n[t]);else o=o.querySelectorAll(n[t])[a[t]]}if(null==o)return[];if(void 0==o.length)o=[o];let r=Kameleoon.Utils.querySelectorAll(e.replace(/\:eq\([0-9]+\)/g,""));let l=[];for(let e=0;e{let n=t.split("=");try{e[decodeURIComponent(n[0])]=n[1]?decodeURIComponent(n[1]):null}catch(t){e[unescape(n[0])]=n[1]?unescape(n[1]):null}}))}return e}performBeaconServerCall(e,t,n,a){let o=new XMLHttpRequest;o.open("GET",e,!0);if(t)o.onreadystatechange=function(e){t.bind(o)(e.target)};if(n){o.onerror=function(e){n.bind(o)(e.target)};o.ontimeout=function(e){n.bind(o)(e.target)}}o.timeout=a||15*60*1e3;o.send()}postMessageToExternalIframe(e){if(!Kameleoon.Internals.runtime.externalIframe||!Kameleoon.Internals.runtime.externalIframe.contentWindow){if(window.kameleoonIframeURL){let t=document.createElement("iframe");t.src=window.kameleoonIframeURL;t.id="kameleoonExternalIframe";t.style.cssFloat="left !important";t.style.height="0px !important";t.style.opacity="0.0 !important";t.style.width="0px !important";t.onload=()=>{Kameleoon.Internals.runtime.externalIframe=t;Kameleoon.Internals.runtime.externalIframe.contentWindow.postMessage("kameleoon"+e,"*")};document.head.appendChild(t)}}else Kameleoon.Internals.runtime.externalIframe.contentWindow.postMessage("kameleoon"+e,"*")}processMessageEvent(e){if("string"!==typeof e.data)return;if("obtainTagCommanderVariableNames"==e.data){let t=[];if(window.tc_vars)for(let e in window.tc_vars)t.push(e);if(!(e.source instanceof MessagePort)&&!(e.source instanceof ServiceWorker))e.source.postMessage("tagCommanderVariableNames"+JSON.stringify(t),e.origin);return}if(0==e.data.indexOf("checkKameleoonScriptPresent")){if("https://back-office."+Kameleoon.Internals.configuration.DOMAIN==e.origin){let t="";let n=e.data.replace("checkKameleoonScriptPresent","");Kameleoon.Utils.runProtectedScript(n);if(!(e.source instanceof MessagePort)&&!(e.source instanceof ServiceWorker))e.source.postMessage(t,e.origin)}return}if(Kameleoon.Internals.runtime.iframeLocalStorage&&Kameleoon.Internals.runtime.postMessageOrigin==e.origin)try{let t=JSON.parse(e.data);if(t.kameleoonMessage){if(t.callbackId){let e=Kameleoon.Internals.runtime.postMessageCallbacks[t.callbackId];delete Kameleoon.Internals.runtime.postMessageCallbacks[t.callbackId];e&&e(t.data)}if(null!=t.type)Kameleoon.Utils.processStorageData(t)}}catch(e){}}removeBlockingStyleSheet(){let e=document.getElementById("kameleoonPageLoading");if(e&&e.parentNode)e.parentNode.removeChild(e)}removeCSSStyleSheet(e){if(e.loadedCSSStyleSheet){var t=e.loadedCSSStyleSheet.id.replace("kameleoonStyleSheet-","");if(-1==t.indexOf(",")){Kameleoon.Internals.runtime.headNode.removeChild(e.loadedCSSStyleSheet);e.loadedCSSStyleSheet=null}else e.loadedCSSStyleSheet.id="kameleoonStyleSheet-"+t.replace(new RegExp(e.id+",?"),"")}}sendKameleoonCustomEvent(e,t,n){try{let a=document.createEvent("CustomEvent");t.time=(new Date).getTime();a.initCustomEvent("Kameleoon::"+e,!1,!1,t);window.dispatchEvent(a);if(sessionStorage.getItem("kameleoonLightExtension")||Kameleoon.Internals.runtime.parameters.kameleoonLightExtension){t.type=n?n:t.type;window.kameleoonEvents=window.kameleoonEvents||[];window.kameleoonEvents.push(t)}}catch(e){}}setInterval(e,t,n,a){let o=window.setInterval((function(){Kameleoon.Utils.runProtectedFunction((function(){e()}),a)}),t);Kameleoon.Internals.runtime.intervalIds[o]=!0;if(n)e();return o}setTimeout(e,t,n){let a=window.setTimeout((function(){Kameleoon.Utils.runProtectedFunction((function(){e()}),n)}),t);Kameleoon.Internals.runtime.timeoutIds[a]=!0;return a}testEmptyMap(e){return 0==Object.keys(e).length}parseObjectToUrlParams(e){return Object.entries(e).map((e=>e[0]+"="+e[1])).join("&")}treatContainsSelector(e){let t={},n;function a(e,t){let n=!1;if(t.textContent&&-1!==t.textContent.indexOf(e))n=!0;return n}n=e.match(/:contains\(['"]([\s\S]+)['"]\)/);t.containText=n[1];t.newSelector=e.replace(n[0],"");if(""===t.newSelector)t.newSelector="*";t.check=a;return t}unobfuscateString(e){let t="";for(let n=0,a=e.length;n=t){if(a>t){e=[];t=a}e.push(parseInt(r)+1)}}}if(0==e.length)e.push(null);return e}}obtainIsIgnored(e){return!1}obtainMatches(e){const t=e.detections;for(let e=0;e1)return 1;return 3}}class StoredData{constructor(e){this.Gatherer={};this.Runtime={};this.Vars=Kameleoon.Utils.readLocalData("kameleoonVars","LS")||{};this.Visitor={};this.canSave=!1;if(e){let a="";if(e[Kameleoon.Internals.runtime.dataKeyName]){a=e[Kameleoon.Internals.runtime.dataKeyName];if(e.Kameleoon)Kameleoon.Utils.eraseLocalData("kameleoonData",null,"LS")}else if(e.kameleoonData)a=e.kameleoonData;if(Kameleoon.Internals.runtime.simulationMode)if(e.kameleoonDataSimulation||e.kameleoonSimulationVisitorData)a=e.kameleoonDataSimulation||e.kameleoonSimulationVisitorData;let t=Kameleoon.Utils.unobfuscateString(a);let i=t&&JSON.parse(t)||{};this.Gatherer=i.Gatherer||{};this.Runtime=i.Runtime||{};this.Vars=i.Vars||e.kameleoonVars||{};this.Visitor=i.Visitor||{}}else{let e=Kameleoon.Utils.readLocalData("kameleoonData","LS");if(Kameleoon.Internals.configuration.useMultipleSiteCodes){let a=Kameleoon.Utils.readLocalData(Kameleoon.Internals.runtime.dataKeyName,"LS",!0);if(a)e=a;Kameleoon.Utils.eraseLocalData("kameleoonData",null,"LS")}if(Kameleoon.Internals.runtime.simulationMode){const a=Kameleoon.Utils.readLocalData("kameleoonDataSimulation","LS",!0);const t=Kameleoon.Utils.readLocalData("kameleoonSimulationVisitorData","LS",!0);if(a||t)e=a||t}if(e){this.Gatherer=e.Gatherer;this.Runtime=e.Runtime||{};this.Vars=e.Vars||this.Vars;this.Visitor=e.Visitor}}Kameleoon.Utils.eraseLocalData("kameleoonVars",null,"LS");for(let e in this.Vars)if(Kameleoon.Internals.runtime.pageStartTime>this.Vars[e].date)delete this.Vars[e];Kameleoon.Utils.setInterval((()=>{if(this.canSave){this.save(!0);this.canSave=!1}}),1e3);Kameleoon.Utils.addEventListener(window,Kameleoon.Internals.runtime.beforeUnloadEvent,(()=>{if(window.self!==window.top){let e=Kameleoon.Utils.readLocalData(Kameleoon.Internals.runtime.simulationMode?"kameleoonSimulationVisitorData":Kameleoon.Internals.runtime.dataKeyName,"LS");if(e&&e.Visitor&&this.Visitor&&this.Visitor.totalVisits{let t=new this.visitEvent(e);Kameleoon.Internals.runtime.Visitor.saveToStoredData();if((!e||!e.notTrack&&!t.notTrack)&&Kameleoon.Internals.configuration.track)Kameleoon.Internals.runtime.RequestManager.addRequest(t);Kameleoon.Internals.runtime.storedData.save(this.visitEvent.urgent)};if(!Kameleoon.Internals.runtime.Visitor.currentVisit.isVisitFinished())t();else if(this.eventType==VisitEvent_Activity.type&&Kameleoon.Internals.runtime.Gatherer.active){Kameleoon.Internals.runtime.Visitor=new Visitor;Kameleoon.Gatherer.track(VisitEvent_Page);Kameleoon.Gatherer.track(VisitEvent_StaticData);Kameleoon.Internals.runtime.gathererRun=!0;t()}}}class VisitEvent_Main{constructor(t){this.obtainRequestData=()=>{let t="eventType="+this.eventType;for(let e in this){if("function"==typeof this[e]||VisitEvent_Main.NOT_TRACK_FIELD[e])continue;t+=`&${e}=${this.addValueParameter(this[e])}`}return t};this.addValueParameter=t=>{if("object"==typeof t)return encodeURIComponent(JSON.stringify(t));else if("string"==typeof t)return encodeURIComponent(t);return t};this.time=(new Date).getTime();this.nonce=Kameleoon.Utils.obtainRandomString(VisitEvent_Main.NONCE_LENGTH,VisitEvent_Main.HEXADECIMAL_ALPHABET)}}VisitEvent_Main.HEXADECIMAL_ALPHABET="0123456789ABCDEF";VisitEvent_Main.NONCE_LENGTH=16;VisitEvent_Main.NOT_TRACK_FIELD={eventType:1,time:1,notTrack:1,type:1,urgent:1};class VisitEvent_Activity extends VisitEvent_Main{constructor(){super();this.eventType=VisitEvent_Activity.type;this.clicks=Kameleoon.Internals.runtime.Gatherer.clicks;Kameleoon.Internals.runtime.Visitor.currentVisit.addActivity(this.time,Kameleoon.Internals.runtime.Gatherer.active);Kameleoon.Internals.runtime.Visitor.currentVisit.addNumberClicks(this.clicks);Kameleoon.Internals.runtime.Gatherer.active=!1;Kameleoon.Internals.runtime.Gatherer.clicks=0}static initialize(){let e=()=>{Kameleoon.Internals.runtime.Gatherer.active=!0};let t=()=>{e();Kameleoon.Internals.runtime.Gatherer.clicks++};Kameleoon.Utils.addEventListener(document,"mousemove",e,!1);Kameleoon.Utils.addEventListener(document,"scroll",e,!1);Kameleoon.Utils.addEventListener(document,"click",t,!1);Kameleoon.Utils.setInterval((()=>{if(Kameleoon.Internals.runtime.Gatherer.active)Kameleoon.Gatherer.track(this)}),this.ACTIVITY_TRACKING_INTERVAL,!0)}}VisitEvent_Activity.ACTIVITY_TRACKING_INTERVAL=15*1e3;VisitEvent_Activity.type="activity";VisitEvent_Activity.urgent=!1;class VisitEvent_AdBlocker extends VisitEvent_Main{constructor(){super();this.eventType=VisitEvent_AdBlocker.type;Kameleoon.Internals.runtime.Visitor.currentVisit.addAdBlocker()}}VisitEvent_AdBlocker.type="adBlocker";VisitEvent_AdBlocker.urgent=!1;class VisitEvent_Conversions extends VisitEvent_Main{constructor(e){super();this.eventType=VisitEvent_Conversions.type;this.goalId=e.goalId;this.negative=!0===e.negative;let i,t=!1;let n=Kameleoon.Internals.runtime.storedData.obtainField("Gatherer","revenuesByGoalId",{});let s=n[this.goalId];if(this.negative)if(s&&s.length>0){i=s.splice(-1)[0];if(0==s.length)delete n[this.goalId]}else t=!0;else{i=e.revenue;if(isNaN(i))i=0;if(!s)s=[];s.push(i);n[this.goalId]=s.splice(-10)}this.revenue=i;if(!t){Kameleoon.Internals.runtime.storedData.saveField("Gatherer","revenuesByGoalId",n);Kameleoon.Internals.runtime.Visitor.currentVisit.addConversions(this.goalId,1,this.revenue,this.negative);}}}VisitEvent_Conversions.type="conversion";VisitEvent_Conversions.urgent=!0;class VisitEvent_Page extends VisitEvent_Main{constructor(){super();this.eventType=VisitEvent_Page.type;const e=Kameleoon.Utils.computeCurrentPageCleanAbsoluteURL();const t=document.title;const r=Kameleoon.Utils.computeCurrentPageCanonicalURL();const i=Kameleoon.Gatherer.Referrer.obtainCorrected(Kameleoon.Internals.runtime.Gatherer.startOfVisit);this.href=e&&e.slice(0,Kameleoon.Gatherer.MAX_HREF_LENGTH_IN_A_REQUEST);this.title=t.slice(0,Kameleoon.Gatherer.MAX_PAGE_TITLE_LENGTH_IN_A_REQUEST);this.keyPagesIndices=Kameleoon.Gatherer.KeyPage.obtainIndexes();this.referrersIndices=Kameleoon.Gatherer.Referrer.obtainIndexes(Kameleoon.Internals.runtime.Gatherer.startOfVisit);if(r)this.canonicalHref=r;if(null!=i)this.referrerHref=i;if(Kameleoon.Internals.configuration.cleanHrefTracking){if(this.href)this.href=this.href.replace(/(\?|\#)(.*)/gi,"");if(this.referrerHref)this.referrerHref=this.referrerHref.replace(/(\?|\#)(.*)/gi,"")}Kameleoon.Internals.runtime.Visitor.currentVisit.addPage(this.time,e,this.keyPagesIndices,this.referrersIndices);Kameleoon.Internals.runtime.Visitor.currentVisit.addActivity(this.time,!0)}}VisitEvent_Page.type="page";VisitEvent_Page.urgent=!0;class VisitEvent_StaticData extends VisitEvent_Main{constructor(){super();this.eventType=VisitEvent_StaticData.type;this.obtainInfluences=(e,i)=>{let t={experiments:{},personalizations:{}};let n=e=>{for(let i in e)if(e[i][1]<0||"-1"==i||null==e[i][0]||"null"==e[i][0])delete e[i];return e};e.forEach((({ExperimentActivations:e,PersonalizationActivations:n})=>{for(let n in e){let s=e[n];if(s.influence){let e=s.influence-(i-s.times.slice(-1)[0]);t.experiments[n]=[parseInt(s.associatedVariationID),e]}}for(let e in n){let s=n[e];if(s.influence){let n=s.influence-(i-s.times.slice(-1)[0]);t.personalizations[e]=[1,n]}}}));this.experimentInfluences=n(t.experiments);this.personalizationInfluences=n(t.personalizations)};const{Visitor:e,Device:i}=Kameleoon.Internals.runtime;const{Browser:t,OperatingSystem:n,TimeZone:s,Language:a}=Kameleoon.Gatherer;this.timeSincePreviousVisit=e.obtainTimeSincePreviousVisit();this.browser=t.obtain();this.browserIndex=t.obtainIndex();this.browserVersion=i.browserVersion;this.os=n.obtain();this.osIndex=n.obtainIndex();this.windowWidth=i.windowWidth;this.windowHeight=i.windowHeight;this.screenWidth=i.screenWidth;this.screenHeight=i.screenHeight;this.timeZoneId=s.obtainId();this.localeLanguageTag=a.obtainLocaleTag();this.deviceType=i.type.toLocaleUpperCase();this.visitNumber=e.currentVisit.visitNumber;this.obtainInfluences(e.visits,e.currentVisit.startDate)}}VisitEvent_StaticData.type="staticData";VisitEvent_StaticData.urgent=!0;class CommandQueue{constructor(e,o){this.executeCommand=e=>{try{if(e.command)e=e.command;if("function"===typeof e)e();else{let o=e[0];let s=o.split(".");let m;let t;if("Kameleoon"!=s[0]){m=Kameleoon.API;t=Kameleoon.API[s[0]]}else t=Kameleoon.API[s[2]];s.forEach((e=>{if(null==m)m=window[e];else m=m[e]}));m.apply(t,Array.prototype.slice.call(e,1))}}catch(e){console.log(e)}};this.commands=e&&e.forEach?e:[];this.commands.push=e=>{if("IMMEDIATE"==o)e.level==o?this.executeCommand(e):this.commands.unshift(e);else this.executeCommand(e)};let s=[];if("IMMEDIATE"==o)this.commands.forEach(((e,o)=>{if("IMMEDIATE"==e.level){s.push(e);this.commands.splice(o,1)}}));else{this.commands.forEach((e=>{s.push(e)}));this.commands.splice(0,this.commands.length)}s.forEach(this.executeCommand);return this.commands}}class Campaigns{constructor(){this.experiments={};this.personalizations={}}addCampaign(i){if(i.experimentAction)this.experiments[i.id.toString()]=i;else this.personalizations[i.id.toString()]=i}obtainCampaign(i,t){if(null!=i){i=i.toString();if(null!=t){const n=t?"experiments":"personalizations";return this[n][i]}return this.experiments[i]||this.personalizations[i]}}obtainCampaignsList(i){return Object.values(this[i])}}class Consent{constructor(){this.disable=(e,n)=>{Kameleoon.Utils.sendKameleoonCustomEvent("Internals",{type:"consent/disable",consentType:e});if(e&&"BOTH"!=e)this[e]=!1;else{this.AB_TESTING=!1;this.PERSONALIZATION=!1}if(1!=n)this.write();Kameleoon.Utils.sendKameleoonCustomEvent.call(window,"LegalConsentUpdated",{legalConsentUpdate:this.getConsent()})};this.enable=(e,n)=>{Kameleoon.Utils.sendKameleoonCustomEvent("Internals",{type:"consent/enable",consentType:e});if(e&&"BOTH"!=e)this[e]=!0;else{this.AB_TESTING=!0;this.PERSONALIZATION=!0}if(Kameleoon.Internals.runtime&&Kameleoon.Internals.runtime.RequestManager){if(Kameleoon.Internals.configuration.requestsAfterConsent)Kameleoon.Internals.runtime.loadExternalRequests();Kameleoon.Internals.runtime.RequestManager.processRequests();this.purge()}if(1!=n)this.write();Kameleoon.Utils.sendKameleoonCustomEvent.call(window,"LegalConsentUpdated",{legalConsentUpdate:this.getConsent()})};this.getConfiguredConsent=()=>({AB_TESTING:Kameleoon.Internals.configuration.abtestConsent,PERSONALIZATION:Kameleoon.Internals.configuration.personalizationConsent});this.getConsent=()=>({AB_TESTING:this.AB_TESTING,PERSONALIZATION:this.PERSONALIZATION});this.hasGlobalConsent=()=>this.AB_TESTING||this.PERSONALIZATION||Kameleoon.Internals.runtime&&Kameleoon.Internals.runtime.kameleoonFull;this.initialize=e=>{Kameleoon.Utils.sendKameleoonCustomEvent("Internals",{type:"consent/initialize",consent:e});this.AB_TESTING=e.AB_TESTING;this.PERSONALIZATION=e.PERSONALIZATION;this.initializeIAB()};this.initializeIAB=()=>{};this.purge=()=>{if(Kameleoon.Internals.runtime){const e=e=>{if(null!=e)for(const n in e)Kameleoon.Utils.createLocalData(e[n].name,e[n].value,e[n].days,e[n].domain,e[n].forceLocalAccess,e[n].jsonFormat,null,!0)};e(Kameleoon.Internals.runtime.localDataMap&&Kameleoon.Internals.runtime.localDataMap["LS"]);e(Kameleoon.Internals.runtime.localDataMap&&Kameleoon.Internals.runtime.localDataMap["COOKIE"]);Kameleoon.Internals.runtime.localDataMap=null;}};this.setup=()=>{let e={AB_TESTING:!1,PERSONALIZATION:!1};const n=Kameleoon.Internals.runtime.readFromStorageOrExternal("kameleoonLegalConsent","LS");if(null!=n)if(1==n)e={AB_TESTING:!0,PERSONALIZATION:!0};else e=n;else{e={AB_TESTING:"OFF"==Kameleoon.Internals.configuration.abtestConsent?!0:null,PERSONALIZATION:"OFF"==Kameleoon.Internals.configuration.personalizationConsent?!0:null};}this.initialize(e)};this.write=()=>{Kameleoon.Utils.createLocalData("kameleoonLegalConsent",this.getConsent(),Utils.MAX_STORAGE_DAYS,null,"LS",!0,null,!0)};this.AB_TESTING=!1;this.PERSONALIZATION=!1}}class Device{constructor(){const e=Kameleoon.Utils.bowser.parsedResult=Kameleoon.Utils.bowser.parsedResult||Kameleoon.Utils.bowser.parse(navigator.userAgent);let t=e.browser.version;try{if(t.split(".").length>1)t=t.split(".")[0]+"."+t.split(".")[1]}catch(e){}this.browser=e.browser.name||"Other";this.browserVersion=t?parseFloat(t):null;this.type="tablet"==e.platform.type?"Tablet":"mobile"==e.platform.type?"Phone":"Desktop";if("Safari"==this.browser&&"Desktop"==this.type&&"ontouchend"in document.documentElement)this.type="Tablet"}get adBlocker(){return Kameleoon.Internals.runtime.adBlocker}get os(){return Kameleoon.Gatherer.OperatingSystem.obtain()}get screenHeight(){return window.screen.height}get screenWidth(){return window.screen.width}get timeZone(){return Kameleoon.Gatherer.TimeZone.obtainId()}get windowHeight(){return window.innerHeight}get windowWidth(){return window.innerWidth}}class Goals{constructor(){this.checkKameleoonGoals=()=>{const e=[];const n=[];const o=[];const s=[];Kameleoon.Internals.runtime.goals.forEach((t=>{switch(t.type){case"URL":{const n=new RegExp(t.url);if(n.test(Kameleoon.Utils.computeCurrentPageCleanAbsoluteURL()))e.push({goal:t});break}case"PAGE_VIEWS":if(Kameleoon.Internals.runtime.gathererRun){const n=Kameleoon.Internals.runtime.Visitor.currentVisit.obtainPageNumberViews();if((null==t.minPageViews||n>=t.minPageViews)&&(null==t.maxPageViews||n<=t.maxPageViews))e.push({goal:t})}break;case"ENGAGEMENT":n.push({goal:t});break;case"TIME_SPENT":o.push(t);break;case"SCROLL":s.push(t);break}}));if(e.length>0)this.processConversions(e);Kameleoon.Utils.addEventListener(document,Kameleoon.Internals.runtime.mouseDownEvent,(e=>{this.processConversions(n)}),!0);};this.processConversions=e=>{if(Kameleoon.Internals.runtime.gathererRun)for(let n=0,o=e.length;n{if(-1!==e.indexOf(".")||-1!==e.indexOf("#")){let o;let r;if(-1!==e.indexOf("\\")||-1!==e.indexOf("contains")||-1!==e.indexOf(":not")){const t=e.replace(/(:[^:]+\(.+?\)|\\)/g,"").replace(/(\-)?(\[.*?\])/g,((e,t)=>t?e:""));o=t.match(/\.([^\s.]+)/g);r=t.match(/#([^\s:\[]+)/g)}else{o=e.match(/\.([^\s.:\[]+)/g);r=e.match(/#([^\s:\[>]+)/g)}n.push(o||[]);t.push(r||[])}}));e.selectors=o;e.selectorClasses=n;e.selectorIDs=t;return e}static checkClassesForSelector(e,t){if(null==e)return!0;for(let t=0,n=e.length;t=0;e-=1){const t=Kameleoon.Internals.runtime.waitingElementPresentObjects[e];if(t&&t.useAntiFlicker)if(KMutationObserver.checkSelectorInDomTree(t)){const n=Kameleoon.Utils.querySelectorAll(t.selector);if(0{if(KMutationObserver.mutationList.length>=KMutationObserver.MAX_MUTATIONS_LENGTH_FOR_ITERATION)KMutationObserver.fillInternalObjectsForMutationObserver();else KMutationObserver.mutationList.forEach((e=>{const t=e.addedNodes,n=e.removedNodes;const o=Array.prototype.slice.call(t);const r=Array.prototype.slice.call(n);const s=o.concat(r);KMutationObserver.removeMutationElementsFromInternalObjects(n);KMutationObserver.addMutationElementsToInternalObjects(t);for(let t=0;t=KMutationObserver.MAX_MUTATIONS_LENGTH){KMutationObserver.mutationList=KMutationObserver.mutationList.concat(e);KMutationObserver.performAsyncMutations();return}e.forEach((e=>{const n=e.addedNodes,o=e.removedNodes;const r=Array.prototype.slice.call(n);const s=Array.prototype.slice.call(o);const a=r.concat(s);KMutationObserver.removeMutationElementsFromInternalObjects(o);KMutationObserver.addMutationElementsToInternalObjects(n);for(let n=0;n{Kameleoon.Internals.runtime.mutationObserverSpa=new MutationObserver((function(){Kameleoon.Internals.runtime.listenVariations=[];Kameleoon.Internals.runtime.mutationObserverSpa.disconnect();if(Kameleoon.ElementSet)KMutationObserver.checkElementSetIntegrity();KMutationObserver.checkDynamicElements();t()}));const t=()=>{Kameleoon.Internals.runtime.mutationObserverSpa.observe(e[0],{childList:!0,characterData:Kameleoon.ElementSet&&Kameleoon.ElementSet.pageElementSetsSpa.length>0,subtree:!0})};t()}))}}KMutationObserver.MAX_MUTATIONS_LENGTH=3e3;KMutationObserver.MAX_MUTATIONS_LENGTH_FOR_ITERATION=5e3;KMutationObserver.asyncMutationsTimeoutId=null;KMutationObserver.mutationList=[];KMutationObserver.checkDynamicElements=()=>{Kameleoon.Internals.runtime.waitingDynamicElements.forEach((e=>{const t=Kameleoon.Utils.querySelectorAll(e.selector).filter((t=>null==t.getAttribute(e.attribute)));t.length>0&&e.callback(t)}))};KMutationObserver.checkElementSetIntegrity=()=>{};KMutationObserver.resetElementSet=(e,t,n)=>{};KMutationObserver.containsDomOperationElements=e=>{};class Logger{constructor(){this.MAX_REQUESTS_PER_VISIT=3;this.baseUrl="https://logger.kameleoon.com/api/2/store/?sentry_key=d8dc96c209184885ab9643cbaf1eb86f&sentry_version=7";this.canSend=()=>{if(Kameleoon.Internals.runtime&&Kameleoon.Internals.runtime.Consent.hasGlobalConsent())if(this.errorLoggerIds.lengthKameleoon.Utils.computeStringSha256(e+t+n).substr(0,32);this.generateRequestDataAsString=(e,t,n,r)=>{let o={tags:{siteCode:Kameleoon.Internals.configuration.siteCode},user:{},environment:Kameleoon.Internals.configuration.environment,platform:"javascript",event_id:t,request:{url:location.href,headers:{"User-Agent":navigator.userAgent}},exception:{values:[{type:e.name,value:e.stack?e.stack:e.message,stacktrace:{frames:[{filename:n}]},mechanism:{data:{mode:"stack",message:e.stack?e.stack:e.message,name:e.name},handled:!1,type:"onerror"}}]}};if(r){o.tags["action-id"]=r.id;o.tags["action-name"]=r.name;o.tags["action-type"]=r.experimentAction?"experiment":"personalization"}try{o.user={id:Kameleoon.Internals.runtime&&Kameleoon.Internals.runtime.Visitor&&Kameleoon.Internals.runtime.Visitor.currentVisit.visitorCode}}catch(e){o.user={id:"no_visitor_code"}}return JSON.stringify(o)};this.send=(e,t,n)=>{if("DEVELOPMENT"==Kameleoon.Internals.configuration.environment)console.error(e);try{this.errorLoggerIds=Kameleoon.Internals.runtime&&Kameleoon.Internals.runtime.storedData.obtainField("Runtime","loggerRequestsSend")||this.errorLoggerIds;let r=this.generateRandomIdAsString(e.message,Kameleoon.Internals.configuration.siteCode,Kameleoon.Internals.configuration.environment);if(-1==this.errorLoggerIds.indexOf(r)){this.errors.push(e);let o=e.stack?e.stack:e.message;if(this.canSend()&&o&&o.trim().length>0){let o=new XMLHttpRequest;o.open("POST",this.baseUrl,!0);o.timeout=2e3;o.send(this.generateRequestDataAsString(e,r,t,n));Kameleoon.Internals.runtime&&Kameleoon.Internals.runtime.storedData.saveField("Runtime","loggerRequestsSend",this.errorLoggerIds)}this.errorLoggerIds.push(r);if(Kameleoon.Internals.runtime.parameters.kameleoonDebug||localStorage.kameleoonExtensionIsAdmin)console.log(e)}}catch(t){this.errors.push(e)}};this.errorLoggerIds=[];this.errors=[]}}class OnlineMeanAndDeviation{constructor(e){this.dimension=e;this.mean=[];this.nbUpdates=[];this.m2=[];this.deviation=[];for(let t=0;t{if(t>0)for(let n=0;n{let a=new OnlineMeanAndDeviation(1);let s=e.length;let l=0;if(l0&&i)a.update([o]);h=s}}return a};OnlineMeanAndDeviation.createFromValues=e=>{let t=new OnlineMeanAndDeviation(1);for(let n=0,i=e.length;n{let t=new OnlineMeanAndDeviation(1);for(let n=0,i=e.length;n{if(this.callbacksToExecute.length>0&&Kameleoon.Internals.runtime.Consent.hasGlobalConsent()){const e=this.callbacksToExecute.splice(0,1e3);e.forEach((e=>e()))}if(this.eventsToSend.length>0)if(this.validateTrackingRequest())if((!Kameleoon.Internals.runtime.simulationMode||Kameleoon.Internals.runtime.enableRemoteVisitorSynchronization)&&!Kameleoon.Internals.runtime.proxyMode&&!Kameleoon.Internals.runtime.kameleoonSelectionIframeMode){const e=this.eventsToSend.splice(0,1e3);const t=this.obtainRequestBody(e);this.send(this.obtainVisitUrl(),"POST",t,(()=>{}),(()=>{this.createErrorEventsQueue(t)}));if(this.eventsToSend.length>0)this.processRequests()}};this.obtainRequestBody=e=>{let t="";t+=e.reduce(((e,t)=>{if(!t.notTrack)e+=t.obtainRequestData()+"\n";return e}),"");if(sessionStorage.getItem(this.errorKey)){t+=sessionStorage.getItem(this.errorKey);sessionStorage.removeItem(this.errorKey)}return t};this.obtainVisitUrl=()=>{const e=Kameleoon.Internals.runtime.Visitor.currentVisit.visitorCode;return`${this.url}/visit/events?siteCode=${this.siteCode}&visitorCode=${e}&itp=${"Safari"===Kameleoon.Internals.runtime.Device.browser}`};this.obtainIpUrl=()=>this.url+"/ip";this.obtainGeolocationUrl=()=>this.url+"/geolocation";this.send=(e,t,s,n,o,i)=>{const r=new XMLHttpRequest;r.open(t,e,!0);if(n)r.onreadystatechange=function(e){n.bind(r)(e.target)};if(o){r.onabort=function(e){o.bind(r)(e.target)};r.onerror=function(e){o.bind(r)(e.target)};r.ontimeout=function(e){o.bind(r)(e.target)}}r.timeout=i||15*60*1e3;r.send("POST"==t&&s?s:null);};this.sendActiveScript=()=>{};this.sendProduct=(e,t)=>{};this.eventsToSend=[];this.callbacksToExecute=[];this.url=Kameleoon.Internals.runtime.DATA_URL;this.siteCode=Kameleoon.Internals.configuration.siteCode;Kameleoon.Utils.setInterval(this.processRequests.bind(this),500);Kameleoon.Utils.addEventListener(window,Kameleoon.Internals.runtime.beforeUnloadEvent,"Safari"===Kameleoon.Internals.runtime.Device.browser?()=>this.eventsToSend.length&&this.createErrorEventsQueue(this.obtainRequestBody(this.eventsToSend)):this.processRequests.bind(this))}addCallback(e){if(Kameleoon.Internals.runtime.Consent.hasGlobalConsent())e();else this.callbacksToExecute.push(e)}addRequest(e){this.eventsToSend.push(e);if("page"===e.eventType)this.processRequests()}createErrorEventsQueue(e){if(e)sessionStorage.setItem(this.errorKey,(sessionStorage.getItem(this.errorKey)||"")+e)}validateTrackingRequest(){const e=Kameleoon.Internals.runtime.ipIsTrackerAccepted;const t=Kameleoon.Internals.configuration.trackerExcludedIPRanges.length>0;if(t&&!e||!Kameleoon.Internals.runtime.Consent.hasGlobalConsent())return!1;else return!0}}class Segment{}class Tracking{constructor(){this.timeBeforeSendTracking=20*60*1e3;this.checkAndSetKameleoonTrackingTime=(t,e)=>{const n=Kameleoon.Utils.secureSessionStorage("getItem","kameleoonAnalyticsTrackingTimes");const i=null==n?{}:JSON.parse(n);const a="Experiment-"+t;if(null==i[e]||null==i[e][a]||(new Date).getTime()>=i[e][a]+this.timeBeforeSendTracking){if(null==i[e])i[e]={};i[e][a]=(new Date).getTime();Kameleoon.Utils.secureSessionStorage("setItem","kameleoonAnalyticsTrackingTimes",JSON.stringify(i));return!0}return!1};this.obtainTealiumData=()=>{};this.processCustomIntegration=t=>{}}}class Variation{constructor(e){this.getAction=()=>Kameleoon.Internals.runtime.Campaigns.obtainCampaign(this.actionId);for(let t in e)this[t]=e[t]}applyJavascriptCode(e){if(this.javaScriptCode&&this.javaScriptCode.code&&(null==this.javaScriptCode.evaluated||e)){this.javaScriptCode.evaluated=!0;return Kameleoon.Utils.runProtectedScript(this.javaScriptCode.code,"kameleoonVariationJavaScriptCode-"+this.id+".js")}return null}preProcessRedirect(e){}process(){const e=Kameleoon.Internals.runtime.Campaigns.obtainCampaign(this.actionId);if(this.redirections&&!Kameleoon.Internals.runtime.editorEnabled)this.preProcessRedirect(e);if(this.forceNoFlicker&&!Kameleoon.Internals.runtime.domReady){var t="";for(var o=0,n=this.elementSets.length;o{this.applyJavascriptCode(!1)}));if(this.forceNoFlicker&&!this.permanentRefreshActive)Kameleoon.Utils.removeBlockingStyleSheet();const r="enginePollerForVariation"+this.id;if(Kameleoon.Internals.runtime[r]&&!this.permanentRefreshActive){if(Kameleoon.Internals.runtime.cantUseMutationObserver)Kameleoon.Utils.clearInterval(Kameleoon.Internals.runtime[r]);Kameleoon.Internals.runtime[r]=null}if(!Kameleoon.Internals.runtime[r]&&!Kameleoon.Internals.runtime.editorMode&&!Kameleoon.Internals.runtime.kameleoonSelectionIframeMode){this.permanentRefreshActive=!0;Kameleoon.Internals.runtime.listenVariations.push(this);Kameleoon.Internals.runtime[r]=!0;if(Kameleoon.Internals.runtime.cantUseMutationObserver)Kameleoon.Internals.runtime[r]=Kameleoon.Utils.setInterval((()=>{this.process()}),10)}}processReplaceData(e){}}class Visit{constructor(t){this.addActionTriggered=(t,e)=>{if(e){let e=Kameleoon.Internals.runtime.storedData.obtainField("Gatherer","experimentsTriggered",{});e[t.toString()]=!0;Kameleoon.Internals.runtime.storedData.saveField("Gatherer","experimentsTriggered",e)}else{let e=Kameleoon.Internals.runtime.storedData.obtainField("Gatherer","personalizationsTriggered",{});e[t.toString()]=!0;Kameleoon.Internals.runtime.storedData.saveField("Gatherer","personalizationsTriggered",e)}};this.addActivity=(t,e)=>{if(e)this.lastActivityDate=t};this.addAdBlocker=()=>{this.Device.adBlocker=!0};this.addConversions=(t,e,i,s)=>{let n=s?-1:1;e*=n;i*=n;let a=this.conversions[t];let o=a?a.count:0;let r=a?a.revenue:0;let l=o+e;let u=r+i;if(l>0)if(u>=0)this.conversions[t]={count:l,revenue:u};else delete this.conversions[t];else delete this.conversions[t]};this.addCustomData=(t,e,i)=>{if(Kameleoon.Utils.testEmptyMap(e)){if(i)delete this.customData[t]}else{if(i||null==this.customData[t])this.customData[t]={};for(let i in e)this.customData[t][i]=(this.customData[t][i]||0)+e[i]}};this.addExperiment=(t,e,i)=>{};this.addGeolocation=(t,e,i,s,n,a)=>{this.Geolocation={country:t,region:e,city:i,postalCode:s,latitude:n,longitude:a}};this.addNumberClicks=t=>{if(t>0)this.clicks+=t};this.addPage=(t,e,i,s)=>{this.addActivity(t,!0);let n=s.filter((t=>null!=t));this.pages.push({timestamp:t,keyPagesMatched:i,referrersMatched:n.length>0?n:[]});let a=this.pageURLsVisited[e];if(null==a){a=[];this.pageURLsVisited[e]=a}a.push(t);for(let t in this.productEansLastPage)this.productEansAllButLastPages[t]=!0;this.productEansLastPage={}};this.addPersonalization=(t,e,i)=>{};this.addProduct=t=>{this.productEansLastPage[t]=!0};this.addTargetingSegment=(t,e)=>{let i=this.activatedSegments[e];if(null==i){i=[];this.activatedSegments[e]=i}i.push(t)};this.addWeather=t=>{this.Weather=t};this.clearCustomDataPage=()=>{};this.computeActionNumberActivations=(t,e,i,s)=>{if(null==s[t])return 0;return this.computeObjectNumberPresence(e,i,s[t].times)};this.computeObjectNumberPresence=(t,e,i)=>{let s=0;for(let n=0,a=i.length;n=t)&&(null==e||a<=e))s++}return s};this.convertVisitFromServer=()=>this;this.isVisitFinished=()=>this.lastActivityDate<(new Date).getTime()-Kameleoon.Internals.runtime.Gatherer.configuration.maxVisitIdleDuration;this.obtainKeyPageIsVisited=t=>{let e=this.pages.filter((e=>-1!=e.keyPagesMatched.indexOf(t)));return e.length>0};this.obtainMeanPageDuration=()=>{let t=new Date;let e=this.obtainTimesStartedPages();let i=OnlineMeanAndDeviation.createFromDifferences(e,!1,!0,!0);i.update([t.getTime()-e[e.length-1]]);return i.mean[0]};this.obtainNumberConversions=t=>{let e=this.conversions[t];return null==e?0:e.count};this.obtainPageNumberViews=(t,e,i,s)=>{let n=0;for(let a in this.pageURLsVisited)if(null!=a){let o=Kameleoon.Utils.computeRelativeURL(a);if((null==t||t.test(a)||t.test(o))&&(null==e||!e.test(a)&&!e.test(o)))n+=this.computeObjectNumberPresence(i,s,this.pageURLsVisited[a])}return n};this.obtainTimesStartedPages=()=>{let t=[];for(let e in this.pageURLsVisited)t.concat(this.pageURLsVisited[e]);return t.sort()};this.obtainPersonalizationNumberActivations=(t,e,i)=>this.computeActionNumberActivations(t,e,i,this.PersonalizationActivations);this.obtainReferrerIsPresent=t=>{let e=null==t?null:t+1;let i=this.pages.filter((t=>-1!=t.referrersMatched.indexOf(e)));return i.length>0};this.visitNumber=t.visitNumber||0;this.landingPageURL=t.landingPageURL||null;this.productEansAllButLastPages=t.productEansAllButLastPages||{};this.productEansLastPage=t.productEansLastPage||{};this.startDate=t.startDate||0;this.pageURLsVisited=t.pageURLsVisited||{};this.activatedSegments=t.activatedSegments||{};this.visitorCode=t.visitorCode||"";this.customData=t.customData||{};this.clicks=t.clicks||0;this.lastActivityDate=t.lastActivityDate||this.startDate;let e=t.Device||{};this.Device={adBlocker:e.adBlocker||!1,browser:e.browser||"Other",browserVersion:e.browserVersion||null,os:e.os||"Other",screenHeight:e.screenHeight||null,screenWidth:e.screenWidth||null,timeZone:e.timeZone||"UTC",type:e.type?e.type.toLocaleUpperCase():null,windowHeight:e.windowHeight||null,windowWidth:e.windowWidth||null};let i=t.Geolocation||{};this.Geolocation={city:i.city||null,country:i.country||null,latitude:i.latitude||null,longitude:i.longitude||null,postalCode:i.postalCode||null,region:i.region||null};let s=t.Weather||{};this.Weather={conditionCode:s.conditionCode||null,conditionDescription:s.conditionDescription||null,cloudiness:s.cloudiness||null,humidity:s.humidity||null,pressure:s.pressure||null,sunrise:s.sunrise||null,sunset:s.sunset||null,temperature:s.temperature||null,windSpeed:s.windSpeed||null};this.conversions=t.conversions||{};this.ExperimentActivations=t.ExperimentActivations||{};this.PersonalizationActivations=t.PersonalizationActivations||{};this.pages=t.pages||[]}obtainExperimentNumberActivations(t,e,i){return this.computeActionNumberActivations(t,e,i,this.ExperimentActivations)}}class Visitor{constructor(){this.addVisit=t=>{this.visits.push(t);this.currentVisit=t;this.totalVisits++;if(null==this.timeStartedEldestVisit)this.timeStartedEldestVisit=t.startDate;const e=this.visits.length;const i=Math.max(1,Kameleoon.Internals.configuration.maxNumberLocalVisits);if(e>i)this.visits=this.visits.slice(e-i)};this.addPreviousVisits=t=>{if(null!=this.currentVisit){const e=this.currentVisit;const i=[];for(let t=0,e=this.visits.length-1;tt.startDate-e.startDate));this.visits=[];let s=null;let o=null;for(let t=0,e=i.length;t{for(let e=0,i=this.visits.length;e{for(let e=0,i=this.visits.length;e{let e=0;for(let i=this.visits.length-1;i>=0;--i)e+=this.visits[i].obtainNumberConversions(t);return e};this.obtainActionNumberActivations=(t,e,i,s,o,n,r,a)=>{const l=a?"obtainExperimentNumberActivations":"obtainPersonalizationNumberActivations";const m=Kameleoon.Internals.runtime.Visitor.visits.length;let c=0;if(m>0){if(o){const e=Kameleoon.Internals.runtime.Visitor.visits[m-1][l](t,i,s);c+=r?e>0?1:0:e}if(n)for(let e=0,o=m-1;e0?1:0:o}}return c};this.obtainPageNumberViews=(t,e,i,s,o,n)=>{const r=this.visits.length;let a=0;if(r>0){if(o)a+=this.visits[r-1].obtainPageNumberViews(t,e,i,s);if(n)for(let o=0,n=r-1;o{let t=0;if(this.visits.length>1){t=this.currentVisit.startDate-this.visits.slice(-2)[0].lastActivityDate;t=Math.max(t,Kameleoon.Internals.runtime.Gatherer.configuration.maxVisitIdleDuration)}return t};this.obtainVisitorCode=t=>{let e=!1;let i;let s=Kameleoon.Utils.readLocalData("kameleoonVisitorCode","COOKIE");const o=Kameleoon.Internals.runtime.storedData.obtainField("Gatherer","timeNextSynchronization",null);if(s)s=s.replace("_js_","");i=s;if(Kameleoon.Internals.configuration.useWideDomainSupport||Kameleoon.Internals.configuration.useVisitorCodeInLocalStorage){const t=Kameleoon.Internals.runtime.incomingStoredData?Kameleoon.Internals.runtime.incomingStoredData.kameleoonVisitorCode:Kameleoon.Utils.readLocalData("kameleoonVisitorCode","LS");if(t)i=t}if(t||null==i){i=Kameleoon.Utils.obtainRandomString(Visitor.VISITOR_CODE_LENGTH,Analyst.CODE_ALPHABET);e=!0}Kameleoon.Utils.saveVisitorCode(i,null==o);this.visitorCode=i;return e};this.obtainVisitorFromStoredData=()=>Kameleoon.Internals.runtime.storedData.Visitor;this.saveToStoredData=()=>{this.saveFieldToStoredData("visits",this.visits);this.saveFieldToStoredData("totalVisits",this.totalVisits);this.saveFieldToStoredData("timeStartedEldestVisit",this.timeStartedEldestVisit)};this.setVisitorCode=t=>{if(this.visitorCode!=t){Kameleoon.Internals.runtime.newVisitorCode=!0;Kameleoon.Utils.saveVisitorCode(t);this.visitorCode=t;Kameleoon.Internals.runtime.Visitor.currentVisit.visitorCode=t;if(this.visits)this.visits.forEach((e=>{e.visitorCode=t}));Kameleoon.Internals.runtime.Campaigns.obtainCampaignsList("experiments").forEach((t=>{if(void 0!==t.registeredVariationId){t.registeredVariationId=void 0;t.performVariationAssignment(!0)}}));this.saveToStoredData();Kameleoon.Gatherer.track(VisitEvent_Page);Kameleoon.Gatherer.track(VisitEvent_StaticData)}};this.updateCurrentVisit=()=>{};this.updateFromStoredData=(t,e,i)=>{let s=!1;const o=this.obtainVisitorFromStoredData();const n=o.visits;if(!this.visitorCode){const t=this.obtainVisitorCode(i);if(t)i=!0}if(n){const t=n.slice(-1)[0].visitorCode;if(t!=this.visitorCode){const e=Kameleoon.Utils.readLocalData("kameleoonVisitorCode","LS");if(e==t||!Kameleoon.Internals.runtime.Consent.hasGlobalConsent()){this.visitorCode=t;try{delete Kameleoon.Internals.runtime.localDataMap.COOKIE.kameleoonVisitorCode;delete Kameleoon.Internals.runtime.localDataMap.LS.kameleoonVisitorCode}catch(t){}}else if(e==this.visitorCode)i=!0}}if(i||t){e=!0;if(i)this.totalVisits=0}this.visits=[];if(!i&&n){n.forEach((t=>{this.addVisit(new Visit(t))}));this.totalVisits=o.totalVisits;this.timeStartedEldestVisit=o.timeStartedEldestVisit}let r=!1;if(e||!this.currentVisit||this.currentVisit.isVisitFinished()){const{Device:t,storedData:e}=Kameleoon.Internals.runtime;const o=e.obtainField("Gatherer","startsOfVisitForCurrentPage");e.saveField("Gatherer","startsOfVisitForCurrentPage",o+1);Kameleoon.Internals.runtime.Gatherer.startOfVisit=s=!0;e.resetForStartOfVisit();e.saveField("Runtime","firstReferrerHref",Kameleoon.Gatherer.Referrer.obtainCorrected(!0)||null);e.saveField("Runtime","firstReferrersIndices",Kameleoon.Gatherer.Referrer.obtainIndexes(!0)||[null]);e.saveField("Runtime","landingKeyPagesIndices",Kameleoon.Gatherer.KeyPage.obtainIndexes()||[null]);let n;if(!this.currentVisit||i)n=0;else n=this.currentVisit.visitNumber+1;this.addVisit(new Visit({visitorCode:this.visitorCode,startDate:(new Date).getTime(),visitNumber:n,landingPageURL:Kameleoon.Utils.computeCurrentPageCleanAbsoluteURL(),Device:{browser:Kameleoon.Gatherer.Browser.obtain(),browserVersion:t.browserVersion,os:Kameleoon.Gatherer.OperatingSystem.obtain(),screenHeight:t.screenHeight,screenWidth:t.screenWidth,timeZone:Kameleoon.Gatherer.TimeZone.obtainId(),type:t.type,windowHeight:t.windowHeight,windowWidth:t.windowWidth}}));r=!0}this.saveToStoredData();Kameleoon.Internals.runtime.storedData.save(r)};this.trackInfluences=()=>{if(Kameleoon.Internals.runtime.Gatherer.startOfVisit&&this.visits.length>1)Kameleoon.Gatherer.track(VisitEvent_StaticData)};this.getCustomDataVisitor=()=>{const t={};return t};this.registerVisitsRequestSuccessAndChangePreviousVisits=t=>{};this.compareCurrentVisitFromServer=t=>{};this.performRemoteVisitorSynchronization=()=>{};this.obtainProductData=(t,e,i,s)=>{};this.visits=[];this.currentVisit=null;this.totalVisits=0;this.updateFromStoredData(!1);Object.defineProperty(this,"customData",{enumerable:!0,get:()=>this.getCustomDataVisitor()})}saveFieldToStoredData(t,e){Kameleoon.Internals.runtime.storedData.Visitor[t]=e}remoteSynchronisation(t,e,i,s){}}Visitor.VISITOR_CODE_LENGTH=16;Visitor.INFLUENCE_DELAY=1e3*60*60*24*7;try{window.Kameleoon=new KameleoonEngine}catch(o){console.log(o)} Kameleoon.Internals = {"configuration":{"API_HOST_NAME":"api","APP_HOST_NAME":"app","BACK_OFFICE_HOST_NAME":"old","EDITOR_SRC":"src/main.ts","STATIC_IMAGES_URL":"//static.kameleoon.com/js/editor/source/images/","BASE_EDITOR_URL":"//static.kameleoon.com/js/editor/","NEW_EDITOR_URL":"//graphical-editor.kameleoon.com","EDITOR_HOST_NAME":"editor","DOMAIN":"kameleoon.com","WIDE_DOMAIN":"kameleoon.eu","GUI_ESTIMATED_LOADING_TIME":3000,"IMAGE_PATH":"https://aij9hox3gm.kameleoon.eu/images/","PROXY_HOST_NAME":"proxy","QOOXDOO_ESTIMATED_LOADING_TIME":2000,"SERVER_CALL_ESTIMATED_LOADING_TIME":500,"STATIC_DIRECT_HOST_NAME":"static-direct","STATIC_HOST_NAME":"static","VISITOR_DOMAIN":"kameleoon.io","environment":"PRODUCTION","staticURL":"//static.kameleoon.eu/","maxNumberLocalVisits":25,"memberCode":"0","siteCode":"aij9hox3gm","abtestConsent":"OFF","abtestConsentOptout":"RUN","beforeAbtestConsent":"ALL","beforePersonalizationConsent":"ALL","personalizationConsent":"OFF","personalizationConsentOptout":"RUN","personalizationsDeviation":1,"experiments":[],"personalizations":[],"targetingSegments":[],"variations":[{"id":0,"name":"Reference","css":"","elementSets":[]},{"id":null,"name":"Excluded"}],"goals":[{"id":319060,"name":"Retention rate","type":"ENGAGEMENT"},{"id":323885,"name":"button_click","type":"CLICK"}],"scriptProduceTime":1713778754007,"timeZone":"Europe/Berlin","webExperimentationSetup":true,"boLocale":"ENGLISH","trackerContinent":"","DATA_URL":"https://data.kameleoon.io","useMultipleSiteCodes":true,"graphicalEditorVersion":"v1","globalScript":"try{var kameleoonEventsTracker=[{id:323885,selector:\"#a11y-main > div:nth-of-type(3) > div:nth-of-type(2) > div:nth-of-type(2) > div:first-child > div:first-child > div:first-child > a:first-child\"}],createEventTracking=function(e,o){for(var n,t=function(e){Kameleoon.Internals.runtime.touchMoveEvent||Kameleoon.API.Goals.processConversion(o.id)},r=0;r{Kameleoon.API.Core.runWhenElementPresent(e.selector,(o=>{createEventTracking(o,e)}),null,Kameleoon.Internals.runtime.singlePageSupport||Kameleoon.Internals.runtime.dynamicRefresh)}))}),250)}catch(e){console.log(\"An error occurred in your custom JavaScript Kameleoon tracking function, please check your code.\"),console.log(e,e.message)}","track":true,"trackerExcludedIPRanges":[],"Gatherer":"eyJtYXhWaXNpdElkbGVEdXJhdGlvbiI6MTgwMDAwMCwiZGlyZWN0Tm9uZVJlZmVycmVyT25seUZpcnN0IjpmYWxzZSwiYnJvd3NlcnMiOnsiMCI6eyJuYW1lIjoiQ0hST01FIn0sIjEiOnsibmFtZSI6IkVYUExPUkVSIn0sIjIiOnsibmFtZSI6IkZJUkVGT1gifSwiMyI6eyJuYW1lIjoiU0FGQVJJIn0sIjQiOnsibmFtZSI6Ik9QRVJBIn19LCJvc3MiOnsiMCI6eyJuYW1lIjoiV0lORE9XUyJ9LCIxIjp7Im5hbWUiOiJNQUMifSwiMiI6eyJuYW1lIjoiSU9TIn0sIjMiOnsibmFtZSI6IkxJTlVYIn0sIjQiOnsibmFtZSI6IkFORFJPSUQifSwiNSI6eyJuYW1lIjoiV0lORE9XUyBQSE9ORSJ9fSwibm9SZWZlcnJlclBhZ2VzIjpbXSwicmVmZXJyZXJzIjp7IjAiOnsibmFtZSI6Ikdvb2dsZSBBZFdvcmRzIiwicHJpb3JpdHkiOjAsImRldGVjdGlvbnMiOlt7Im1ldGhvZCI6IlJFRkVSUkVSX1JFR0VYIiwiYW5kIjpmYWxzZSwicGFyYW1ldGVycyI6Il4uK1xcXFwuZ29vZ2xlKFxcXFwuY29tPyk/XFxcXC5bXi9cXFxcLl0rL2FjbGsoW1xcXFw/JiNdLip8KSQifSx7Im1ldGhvZCI6IlVSTF9SRUdFWCIsImFuZCI6ZmFsc2UsInBhcmFtZXRlcnMiOiJbXFxcXD8mI11nY2xpZD0ifV19LCIxIjp7Im5hbWUiOiJHb29nbGUgT3JnYW5pYyBTZWFyY2giLCJwcmlvcml0eSI6MCwiZGV0ZWN0aW9ucyI6W3sibWV0aG9kIjoiUkVGRVJSRVJfUkVHRVgiLCJhbmQiOmZhbHNlLCJwYXJhbWV0ZXJzIjoiXi4rXFxcXC5nb29nbGUoXFxcXC5jb20/KT9cXFxcLlteL1xcXFwuXSsvKD8hYWNsa3xpbWdyZXMpLipbXFxcXD8mI11xPS4qKFtcXFxcPyYjXS4qfCkkIn0seyJtZXRob2QiOiJSRUZFUlJFUl9SRUdFWCIsImFuZCI6ZmFsc2UsInBhcmFtZXRlcnMiOiJeLitcXFxcLmdvb2dsZShcXFxcLmNvbT8pP1xcXFwuW14vXFxcXC5dKy8/JCJ9XX0sIjIiOnsibmFtZSI6IkJpbmcgT3JnYW5pYyBTZWFyY2giLCJwcmlvcml0eSI6MCwiZGV0ZWN0aW9ucyI6W3sibWV0aG9kIjoiUkVGRVJSRVJfUkVHRVgiLCJhbmQiOmZhbHNlLCJwYXJhbWV0ZXJzIjoiXi4rXFxcXC5iaW5nXFxcXC5bXi9cXFxcLl0rLy4qW1xcXFw/JiNdcT0uKihbXFxcXD8mI10uKnwpJCJ9XX0sIjMiOnsibmFtZSI6IllhaG9vIE9yZ2FuaWMgU2VhcmNoIiwicHJpb3JpdHkiOjAsImRldGVjdGlvbnMiOlt7Im1ldGhvZCI6IlJFRkVSUkVSX1JFR0VYIiwiYW5kIjpmYWxzZSwicGFyYW1ldGVycyI6Il4uK1xcXFwueWFob29cXFxcLlteL1xcXFwuXSsvLipbXFxcXD8mI11wPS4qKFtcXFxcPyYjXS4qfCkkIn1dfSwiNCI6eyJuYW1lIjoiQmFpZHUgT3JnYW5pYyBTZWFyY2giLCJwcmlvcml0eSI6MCwiZGV0ZWN0aW9ucyI6W3sibWV0aG9kIjoiUkVGRVJSRVJfUkVHRVgiLCJhbmQiOmZhbHNlLCJwYXJhbWV0ZXJzIjoiXi4rXFxcXC5iYWlkdVxcXFwuW14vXFxcXC5dKy8uKltcXFxcPyYjXXdkPS4qKFtcXFxcPyYjXS4qfCkkIn1dfX0sImtleVBhZ2VzIjp7fSwiY3VzdG9tRGF0YSI6e319","isNewEditorEnabled":false}}; })();if (window.kameleoonLightIframe){if (window.kameleoonExternalIFrameLoadedData) { window.kameleoonQueue = window.kameleoonQueue || [];window.kameleoonQueue.push({level: 'IMMEDIATE',command: function () {Kameleoon.Utils.runProtectedScript(window.kameleoonExternalIFrameLoadedData);}}); Kameleoon.Analyst.load();}}else{Kameleoon.Analyst.load();}}